neural-loom 0.2.14 → 0.2.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/BUILD_ID +1 -1
- package/.next/app-path-routes-manifest.json +1 -0
- package/.next/build-manifest.json +3 -3
- package/.next/cache/.previewinfo +1 -1
- package/.next/cache/.rscinfo +1 -1
- package/.next/cache/.tsbuildinfo +1 -1
- package/.next/diagnostics/route-bundle-stats.json +2 -2
- package/.next/fallback-build-manifest.json +3 -3
- package/.next/prerender-manifest.json +3 -3
- package/.next/routes-manifest.json +6 -0
- package/.next/server/app/_global-error.html +1 -1
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +1 -1
- package/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/api/sessions/start/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/sessions/start/route/build-manifest.json +9 -0
- package/.next/server/app/api/sessions/start/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/sessions/start/route.js +7 -0
- package/.next/server/app/api/sessions/start/route.js.map +5 -0
- package/.next/server/app/api/sessions/start/route.js.nft.json +1 -0
- package/.next/server/app/api/sessions/start/route_client-reference-manifest.js +3 -0
- package/.next/server/app/index.html +1 -1
- package/.next/server/app/index.rsc +2 -2
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/index.segments/_full.segment.rsc +2 -2
- package/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/.next/server/app/index.segments/_index.segment.rsc +1 -1
- package/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/page/react-loadable-manifest.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +1 -0
- package/.next/server/chunks/[root-of-the-server]__0-lisav._.js +15 -0
- package/.next/server/chunks/[root-of-the-server]__0-lisav._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__0d0pykb._.js +3 -3
- package/.next/server/chunks/[root-of-the-server]__0d0pykb._.js.map +1 -1
- package/.next/server/chunks/_next-internal_server_app_api_sessions_start_route_actions_10.y0di.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_sessions_start_route_actions_10.y0di.js.map +1 -0
- package/.next/server/chunks/ssr/_0t7oqy6._.js +1 -1
- package/.next/server/chunks/ssr/_0t7oqy6._.js.map +1 -1
- package/.next/server/middleware-build-manifest.js +3 -3
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/0cv9~vnm0atn4.js +1 -0
- package/.next/static/chunks/{0g45rn_9mbzt6.js → 0t~533m2dl-bb.js} +1 -1
- package/.next/trace +1 -1
- package/.next/trace-build +1 -1
- package/.next/types/routes.d.ts +2 -1
- package/.next/types/validator.ts +9 -0
- package/package.json +1 -1
- package/src/app/api/sessions/start/route.ts +20 -0
- package/src/app/components/IdeLayout.tsx +39 -0
- package/src/app/page.tsx +48 -10
- package/src/lib/agents/SessionManager.ts +9 -1
- package/src/lib/agents/WebSocketServer.ts +14 -10
- package/.next/static/chunks/0ew-ei_k3d-qg.js +0 -1
- /package/.next/static/{g7S_nNTPWKtmCY0Va4YcB → Sqg0WwYlho2e4abhJPPMw}/_buildManifest.js +0 -0
- /package/.next/static/{g7S_nNTPWKtmCY0Va4YcB → Sqg0WwYlho2e4abhJPPMw}/_clientMiddlewareManifest.js +0 -0
- /package/.next/static/{g7S_nNTPWKtmCY0Va4YcB → Sqg0WwYlho2e4abhJPPMw}/_ssgManifest.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,3839,e=>{"use strict";var t=e.i(43476),r=e.i(71645),o=e.i(5991),i=e.i(54370);let n={display:"flex",width:"100%",height:"100%",flex:1,minHeight:0,backgroundColor:"#05070a",border:"1px solid var(--border)",borderRadius:"12px",overflow:"hidden",boxShadow:"0 20px 25px -5px rgba(0, 0, 0, 0.6)"},l={width:"50px",backgroundColor:"#030406",borderRight:"1px solid var(--border)",display:"flex",flexDirection:"column",justifyContent:"space-between",alignItems:"center",padding:"0.75rem 0"},a={display:"flex",flexDirection:"column",width:"100%",gap:"0.5rem"},s={width:"100%",height:"45px",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",fontSize:"1.25rem",transition:"all 0.15s ease"},d={width:"260px",backgroundColor:"#080c14",borderRight:"1px solid var(--border)",display:"flex",flexDirection:"column",overflow:"hidden"},c={padding:"0.75rem 1rem",borderBottom:"1px solid var(--border)",display:"flex",alignItems:"center",justifyContent:"space-between",background:"rgba(255,255,255,0.02)"},p={flex:1,overflowY:"auto",padding:"0.75rem 0"},m={padding:"0.25rem 1rem",fontSize:"0.75rem",fontWeight:700,color:"var(--muted)",display:"flex",alignItems:"center",justifyContent:"space-between",textTransform:"uppercase",letterSpacing:"0.05em"},u={fontSize:"0.6rem",backgroundColor:"rgba(59, 130, 246, 0.1)",color:"#3b82f6",padding:"0.1rem 0.3rem",borderRadius:"3px",textTransform:"none",letterSpacing:"normal"},f={fontSize:"0.75rem",fontWeight:600,color:"var(--foreground)"},h={flex:1,display:"flex",flexDirection:"column",overflow:"hidden",backgroundColor:"#0b101b"},g={flex:1,display:"flex",flexDirection:"column",borderBottom:"1px solid var(--border)",overflow:"hidden"},x={height:"35px",backgroundColor:"#05070a",borderBottom:"1px solid var(--border)",display:"flex",alignItems:"center",justifyContent:"space-between",paddingRight:"0.75rem"},y={display:"flex",height:"100%",overflowX:"auto"},b={padding:"0 1rem",height:"100%",display:"flex",alignItems:"center",gap:"0.75rem",fontSize:"0.75rem",borderRight:"1px solid var(--border)",borderBottom:"2px solid transparent",cursor:"pointer",transition:"all 0.15s ease",maxWidth:"150px"},v={fontSize:"0.65rem",color:"var(--muted)",cursor:"pointer",padding:"2px"},j={color:"var(--primary)",fontSize:"0.65rem",marginLeft:"2px"},C={padding:"0.25rem 0.5rem",borderRadius:"4px",border:"1px solid var(--border-focus)",backgroundColor:"rgba(16, 185, 129, 0.15)",color:"var(--success)",fontSize:"0.7rem",fontWeight:600},w={flex:1,position:"relative",overflow:"hidden"},S={width:"100%",height:"100%",backgroundColor:"#0b101b",border:"none",outline:"none",color:"#e2e8f0",fontFamily:"var(--font-mono), monospace",fontSize:"0.85rem",padding:"1rem",resize:"none",lineHeight:1.5},k={display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100%",color:"var(--muted)",textAlign:"center",padding:"2rem"},T={flex:1.4,backgroundColor:"#05070a",display:"flex",flexDirection:"column",overflow:"hidden"},z={padding:"0.5rem 1rem",borderBottom:"1px solid var(--border)",display:"flex",alignItems:"center",justifyContent:"space-between",backgroundColor:"rgba(255,255,255,0.01)"},R={padding:"0.3rem 0.6rem",borderRadius:"4px",border:"1px solid var(--primary)",backgroundColor:"transparent",color:"var(--primary)",fontSize:"0.7rem",fontWeight:600,cursor:"pointer"},P={padding:"0.3rem 0.6rem",borderRadius:"4px",border:"1px solid var(--success)",backgroundColor:"transparent",color:"var(--success)",fontSize:"0.7rem",fontWeight:600,cursor:"pointer"},F={flex:1,overflow:"hidden"};function I({node:e,onSelect:o,onCreate:i,onRename:n,onDelete:l,isReadOnly:a=!1}){let[s,d]=(0,r.useState)(!1),[c,p]=(0,r.useState)(!1),m="directory"===e.type,u={padding:"0.25rem 0.5rem",display:"flex",alignItems:"center",justifyContent:"space-between",fontSize:"0.8rem",fontFamily:"var(--font-mono), monospace",cursor:"pointer",color:"var(--foreground)",borderRadius:"4px",transition:"background 0.1s ease",userSelect:"none",backgroundColor:c?"rgba(255, 255, 255, 0.05)":"transparent",minWidth:0,width:"100%"},f={display:"flex",alignItems:"center",gap:"0.375rem",flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},h={display:c?"flex":"none",alignItems:"center",gap:"0.25rem",paddingLeft:"0.5rem",flexShrink:0},g={background:"none",border:"none",padding:"2px 4px",cursor:"pointer",fontSize:"0.75rem",color:"var(--muted)",borderRadius:"3px",transition:"all 0.1s ease"},x=(e,t)=>{e.stopPropagation(),t()};return m?(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{onClick:()=>d(!s),style:u,onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),children:[(0,t.jsxs)("div",{style:f,children:[(0,t.jsx)("span",{style:{color:"#eab308"},children:s?"📂":"📁"}),(0,t.jsx)("span",{style:{fontWeight:600,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.name})]}),!a&&(0,t.jsxs)("div",{style:h,children:[(0,t.jsx)("button",{onClick:t=>x(t,()=>i(e.path,"file")),style:g,title:"New File inside...",onMouseEnter:e=>e.currentTarget.style.color="var(--success)",onMouseLeave:e=>e.currentTarget.style.color="var(--muted)",children:"📄+"}),(0,t.jsx)("button",{onClick:t=>x(t,()=>i(e.path,"directory")),style:g,title:"New Folder inside...",onMouseEnter:e=>e.currentTarget.style.color="var(--success)",onMouseLeave:e=>e.currentTarget.style.color="var(--muted)",children:"📁+"}),(0,t.jsx)("button",{onClick:t=>x(t,()=>n(e.path)),style:g,title:"Rename...",onMouseEnter:e=>e.currentTarget.style.color="var(--primary)",onMouseLeave:e=>e.currentTarget.style.color="var(--muted)",children:"✏️"}),(0,t.jsx)("button",{onClick:t=>x(t,()=>l(e.path)),style:g,title:"Delete Folder",onMouseEnter:e=>e.currentTarget.style.color="var(--danger)",onMouseLeave:e=>e.currentTarget.style.color="var(--muted)",children:"🗑️"})]})]}),s&&e.children&&(0,t.jsx)("div",{style:{paddingLeft:"10px",borderLeft:"1px solid rgba(255, 255, 255, 0.05)",marginLeft:"8px"},children:e.children.map(e=>(0,t.jsx)(I,{node:e,onSelect:o,onCreate:i,onRename:n,onDelete:l,isReadOnly:a},e.path))})]}):(0,t.jsxs)("div",{onClick:()=>o(e.path),style:u,onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),children:[(0,t.jsxs)("div",{style:f,children:[(0,t.jsx)("span",{style:{color:"#3b82f6"},children:"📄"}),(0,t.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.name})]}),!a&&(0,t.jsxs)("div",{style:h,children:[(0,t.jsx)("button",{onClick:t=>x(t,()=>n(e.path)),style:g,title:"Rename...",onMouseEnter:e=>e.currentTarget.style.color="var(--primary)",onMouseLeave:e=>e.currentTarget.style.color="var(--muted)",children:"✏️"}),(0,t.jsx)("button",{onClick:t=>x(t,()=>l(e.path)),style:g,title:"Delete File",onMouseEnter:e=>e.currentTarget.style.color="var(--danger)",onMouseLeave:e=>e.currentTarget.style.color="var(--muted)",children:"🗑️"})]})]})}let W={position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0,0,0,0.7)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3,backdropFilter:"blur(4px)"},L={width:"420px",backgroundColor:"#080c14",border:"1px solid var(--border)",borderRadius:"12px",padding:"1.5rem",boxShadow:"0 20px 25px -5px rgba(0, 0, 0, 0.8)"},O={width:"100%",backgroundColor:"#05070a",border:"1px solid var(--border)",borderRadius:"6px",padding:"0.5rem 0.75rem",color:"#e2e8f0",fontSize:"0.85rem",outline:"none",marginBottom:"1.5rem",fontFamily:"var(--font-mono), monospace"},D={display:"flex",justifyContent:"flex-end",gap:"0.75rem"},E={backgroundColor:"transparent",border:"1px solid var(--border)",color:"var(--foreground)",padding:"0.5rem 1rem",borderRadius:"6px",fontSize:"0.8rem",fontWeight:600,cursor:"pointer"},M={backgroundColor:"var(--primary)",border:"none",color:"#ffffff",padding:"0.5rem 1rem",borderRadius:"6px",fontSize:"0.8rem",fontWeight:600,cursor:"pointer"},N={background:"none",border:"none",color:"var(--muted)",cursor:"pointer",fontSize:"0.8rem",padding:"4px",borderRadius:"3px",transition:"all 0.1s ease"},B={position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0,0,0,0.5)",display:"flex",alignItems:"flex-start",justifyContent:"center",zIndex:1100,paddingTop:"5vh",backdropFilter:"blur(2px)"},U={width:"600px",backgroundColor:"#080c14",border:"1px solid var(--border)",borderRadius:"8px",boxShadow:"0 10px 25px -5px rgba(0, 0, 0, 0.8)",display:"flex",flexDirection:"column",overflow:"hidden"},$={width:"100%",backgroundColor:"#05070a",border:"none",borderBottom:"1px solid var(--border)",padding:"0.75rem 1rem",color:"#e2e8f0",fontSize:"0.9rem",outline:"none",fontFamily:"var(--font-mono), monospace"},A={maxHeight:"300px",overflowY:"auto",padding:"0.25rem 0"},V={display:"flex",alignItems:"center",padding:"0.5rem 1rem",cursor:"pointer",transition:"all 0.1s ease",justifyContent:"space-between"},J={backgroundColor:"rgba(255,255,255,0.02)",border:"1px solid var(--border)",borderRadius:"6px",padding:"0.5rem 0.75rem",display:"flex",flexDirection:"column",gap:"0.25rem"},K={fontSize:"0.6rem",color:"var(--muted)",textTransform:"uppercase"},_={fontSize:"1.1rem",fontWeight:700,fontFamily:"var(--font-mono)"},H={width:"100%",height:"6px",backgroundColor:"rgba(255,255,255,0.05)",borderRadius:"3px",overflow:"hidden"},Y={height:"100%",borderRadius:"3px",transition:"width 0.5s ease-out"},X={padding:"0.35rem 1rem",borderBottom:"1px solid var(--border)",backgroundColor:"#030406",display:"flex",alignItems:"center",gap:"0.75rem",flexWrap:"nowrap",overflowX:"auto"},G={padding:"0.15rem 0.45rem",borderRadius:"4px",border:"1px solid var(--border)",backgroundColor:"rgba(255,255,255,0.02)",color:"var(--muted)",fontSize:"0.7rem",fontFamily:"var(--font-mono)",fontWeight:600,cursor:"pointer",transition:"all 0.1s ease"},Q={backgroundColor:"#05070a",borderBottom:"1px solid var(--border)",padding:"0.25rem 0.75rem 0 0.75rem",display:"flex",alignItems:"center",justifyContent:"space-between"},q={padding:"0.35rem 0.75rem",borderRadius:"6px 6px 0 0",border:"1px solid var(--border)",borderBottom:"none",display:"flex",alignItems:"center",gap:"0.5rem",cursor:"pointer",transition:"all 0.15s ease"};e.s(["default",0,function({sessionId:e,workspaceRoot:Z,scopedDirs:ee,onClose:et,sessions:er,onSwitchSession:eo,onRefreshSessions:ei}){let en=JSON.stringify(ee),el=er.find(t=>t.id===e),[ea,es]=(0,r.useState)(null),[ed,ec]=(0,r.useState)([]),[ep,em]=(0,r.useState)(!1),eu=async t=>{try{let r=await fetch("/api/sessions/scope",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:e,path:t,action:"add"})});if(r.ok)ei&&ei();else{let e=await r.json();alert(e.error||"Failed to add scoped folder.")}}catch(e){console.error(e),alert("Network error: failed to add scoped folder.")}},ef=async t=>{try{let r=await fetch("/api/sessions/scope",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:e,path:t,action:"remove"})});if(r.ok)ei&&ei();else{let e=await r.json();alert(e.error||"Failed to remove scoped folder.")}}catch(e){console.error(e),alert("Network error: failed to remove scoped folder.")}},[eh,eg]=(0,r.useState)({}),[ex,ey]=(0,r.useState)({}),eb=eh[e]||[],ev=ex[e]||null,ej=(0,r.useCallback)(t=>{eg(r=>{let o=r[e]||[],i="function"==typeof t?t(o):t;return{...r,[e]:i}})},[e]),eC=(0,r.useCallback)(t=>{ey(r=>({...r,[e]:t}))},[e]),[ew,eS]=(0,r.useState)(!0),[ek,eT]=(0,r.useState)("explorer"),[ez,eR]=(0,r.useState)(!1),[eP,eF]=(0,r.useState)([]),[eI,eW]=(0,r.useState)(!1),[eL,eO]=(0,r.useState)(!1),[eD,eE]=(0,r.useState)(null),[eM,eN]=(0,r.useState)(null),[eB,eU]=(0,r.useState)(""),[e$,eA]=(0,r.useState)([]),[eV,eJ]=(0,r.useState)(""),[eK,e_]=(0,r.useState)(""),[eH,eY]=(0,r.useState)(null),eX=(0,r.useCallback)(async()=>{await new Promise(e=>setTimeout(e,0)),eO(!0);try{let e=await fetch(`/api/git?action=status&root=${encodeURIComponent(Z)}`);if(e.ok){let t=await e.json();t.success&&(eW(t.isGit),eF(t.files||[]))}}catch(e){console.error("Failed to load git status:",e)}finally{eO(!1)}},[Z]);(0,r.useEffect)(()=>{setTimeout(()=>{eX()},0);let e=setInterval(eX,5e3);return()=>clearInterval(e)},[eX]),(0,r.useEffect)(()=>{let t=async()=>{try{let t=await fetch(`/api/sessions?id=${e}`);if(t.ok){let e=await t.json();eE(e)}}catch(e){console.error("Failed to fetch session status:",e)}};t();let r=setInterval(t,3e3);return()=>clearInterval(r)},[e]),(0,r.useEffect)(()=>{let t=async()=>{try{let t=await fetch(`/api/sessions/stats?id=${e}`);if(t.ok){let e=await t.json();eN(e)}}catch(e){console.error("Failed to fetch container/process stats:",e)}};t();let r=setInterval(t,3e3);return()=>clearInterval(r)},[e]),(0,r.useEffect)(()=>{let e=localStorage.getItem("neural_loom_custom_commands");if(e)try{let t=JSON.parse(e);setTimeout(()=>{eA(t)},0)}catch{}},[]);let eG=e=>{eA(e),localStorage.setItem("neural_loom_custom_commands",JSON.stringify(e))},eQ=async t=>{try{await fetch("/api/sessions/inject",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,command:t})})}catch(e){console.error("Failed to inject command:",e)}},eq=eD?.type?.includes("aider"),[eZ,e0]=(0,r.useState)({type:null,targetPath:null,inputValue:"",error:null}),[e5,e1]=(0,r.useState)(!1),[e2,e7]=(0,r.useState)(""),[e8,e6]=(0,r.useState)([]),[e3,e4]=(0,r.useState)(0),e9=(0,r.useCallback)(async()=>{await new Promise(e=>setTimeout(e,0)),eR(!0);try{let e=ee&&ee.length>0?`&scoped=${encodeURIComponent(ee.join(","))}`:"",t=await fetch(`/api/files?action=list&root=${encodeURIComponent(Z)}${e}`);if(t.ok){let e=await t.json();e.success&&(es(e.workspace),ec(e.scoped||[]))}}catch(e){console.error("Failed to load file explorer:",e)}finally{eR(!1)}},[Z,en]);(0,r.useEffect)(()=>{setTimeout(()=>{e9()},0)},[e9]);let te=(e,t)=>{e0({type:"file"===t?"create-file":"create-folder",targetPath:e,inputValue:"",error:null})},tt=e=>{let t=e.split(/[/\\]/).pop()||"";e0({type:"rename",targetPath:e,inputValue:t,error:null})},tr=e=>{e0({type:"delete",targetPath:e,inputValue:"",error:null})},to=async e=>{if(e&&e.preventDefault(),eZ.type&&eZ.targetPath){e0(e=>({...e,error:null}));try{if("create-file"===eZ.type||"create-folder"===eZ.type){if(!eZ.inputValue.trim())return void e0(e=>({...e,error:"Name cannot be empty"}));let e=`${eZ.targetPath}/${eZ.inputValue.trim()}`,t="create-file"===eZ.type?"file":"directory",r=await fetch("/api/files",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"create",path:e,type:t})});if(r.ok){let o=await r.json();o.success?(e0({type:null,targetPath:null,inputValue:"",error:null}),await e9(),"file"===t&&await tn(e)):e0(e=>({...e,error:o.error||"Failed to create item"}))}else{let e=await r.json();e0(t=>({...t,error:e.error||"Failed to create item"}))}}if("rename"===eZ.type){if(!eZ.inputValue.trim())return void e0(e=>({...e,error:"Name cannot be empty"}));let e=eZ.targetPath.replace(/\\/g,"/"),t=e.substring(0,e.lastIndexOf("/")),r=t?`${t}/${eZ.inputValue.trim()}`:eZ.inputValue.trim(),o=await fetch("/api/files",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"rename",oldPath:eZ.targetPath,newPath:r})});if(o.ok){let e=await o.json();e.success?(ej(e=>e.map(e=>e.path===eZ.targetPath?{...e,path:r,name:eZ.inputValue.trim()}:e)),ev===eZ.targetPath&&eC(r),e0({type:null,targetPath:null,inputValue:"",error:null}),await e9()):e0(t=>({...t,error:e.error||"Failed to rename item"}))}else{let e=await o.json();e0(t=>({...t,error:e.error||"Failed to rename item"}))}}if("delete"===eZ.type){let e=await fetch("/api/files",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"delete",path:eZ.targetPath})});if(e.ok){let t=await e.json();t.success?(tl(eZ.targetPath),e0({type:null,targetPath:null,inputValue:"",error:null}),await e9()):e0(e=>({...e,error:t.error||"Failed to delete item"}))}else{let t=await e.json();e0(e=>({...e,error:t.error||"Failed to delete item"}))}}}catch(e){console.error("File operation failed:",e),e0(e=>({...e,error:"An unexpected error occurred"}))}}},ti=(0,r.useCallback)(async()=>{try{let e=ee&&ee.length>0?`&scoped=${encodeURIComponent(ee.join(","))}`:"",t=await fetch(`/api/files?action=flat_list&root=${encodeURIComponent(Z)}${e}`);if(t.ok){let e=await t.json();e.success&&e.files&&e6(e.files)}}catch(e){console.error("Failed to load flat files list:",e)}},[Z,en]);(0,r.useEffect)(()=>{e5&&setTimeout(()=>{e7(""),e4(0),ti()},0)},[e5,ti]);let tn=async e=>{if(eb.find(t=>t.path===e))return void eC(e);try{let t=await fetch(`/api/files?action=read&path=${encodeURIComponent(e)}`);if(t.ok){let r=await t.json();if(r.success){let t={name:e.split(/[/\\]/).pop()||"Untitled",path:e,content:r.content,isModified:!1};ej([...eb,t]),eC(e)}}}catch(t){console.error(`Failed to read file ${e}:`,t)}},tl=e=>{let t=eb.filter(t=>t.path!==e);ej(t),ev===e&&eC(t.length>0?t[t.length-1].path:null)},ta=eb.find(e=>e.path===ev),ts=(0,r.useCallback)(async()=>{if(ta)try{(await fetch("/api/files",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"write",path:ta.path,content:ta.content})})).ok&&ej(e=>e.map(e=>e.path===ev?{...e,isModified:!1}:e))}catch(e){console.error(`Failed to save file ${ta.path}:`,e)}},[ta,ev,ej]);(0,r.useEffect)(()=>{let e=e=>{(e.ctrlKey||e.metaKey)&&"s"===e.key&&(e.preventDefault(),ts()),(e.ctrlKey||e.metaKey)&&"p"===e.key&&(e.preventDefault(),e1(e=>!e))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[ts]);let td=e8.filter(e=>e.name.toLowerCase().includes(e2.toLowerCase())||e.relativePath.toLowerCase().includes(e2.toLowerCase())).slice(0,10);return(0,t.jsxs)("div",{style:n,children:[(0,t.jsxs)("div",{style:l,children:[(0,t.jsxs)("div",{style:a,children:[(0,t.jsx)("div",{onClick:()=>{"explorer"===ek?eS(!ew):(eT("explorer"),eS(!0))},style:{...s,backgroundColor:"explorer"===ek&&ew?"rgba(255,255,255,0.08)":"transparent",borderLeft:"explorer"===ek&&ew?"2px solid var(--primary)":"2px solid transparent"},title:"File Explorer (Ctrl+P to search files)",children:"📁"}),(0,t.jsx)("div",{onClick:()=>{"git"===ek?eS(!ew):(eT("git"),eS(!0))},style:{...s,backgroundColor:"git"===ek&&ew?"rgba(255,255,255,0.08)":"transparent",borderLeft:"git"===ek&&ew?"2px solid var(--primary)":"2px solid transparent"},title:"Source Control (Git Changes)",children:"🌿"}),(0,t.jsx)("div",{onClick:()=>{"analytics"===ek?eS(!ew):(eT("analytics"),eS(!0))},style:{...s,backgroundColor:"analytics"===ek&&ew?"rgba(255,255,255,0.08)":"transparent",borderLeft:"analytics"===ek&&ew?"2px solid var(--primary)":"2px solid transparent"},title:"Token Usage & Cost Analytics",children:"📊"}),(0,t.jsx)("div",{onClick:()=>{"auditor"===ek?eS(!ew):(eT("auditor"),eS(!0))},style:{...s,backgroundColor:"auditor"===ek&&ew?"rgba(255,255,255,0.08)":"transparent",borderLeft:"auditor"===ek&&ew?"2px solid var(--primary)":"2px solid transparent"},title:"Session Log Auditor & Search",children:"🔍"})]}),(0,t.jsx)("div",{onClick:et,style:{...s,color:"var(--danger)",fontSize:"1rem"},title:"Exit Session Layout",children:"✖"})]}),ew&&(0,t.jsxs)("div",{style:d,children:[(0,t.jsxs)("div",{style:c,children:[(0,t.jsxs)("span",{style:{fontWeight:700,fontSize:"0.75rem",textTransform:"uppercase",letterSpacing:"0.05em"},children:["explorer"===ek&&"Workspace Explorer","git"===ek&&"Source Control","analytics"===ek&&"Telemetry & Cost","auditor"===ek&&"Session Auditor"]}),"explorer"===ek&&(0,t.jsxs)("div",{style:{display:"flex",gap:"0.25rem"},children:[ea&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{onClick:()=>te(ea.path,"file"),style:N,title:"New File at Root...",children:"📄+"}),(0,t.jsx)("button",{onClick:()=>te(ea.path,"directory"),style:N,title:"New Folder at Root...",children:"📁+"})]}),(0,t.jsx)("button",{onClick:e9,disabled:ez,style:N,title:"Refresh tree",children:"🔄"})]}),"git"===ek&&(0,t.jsx)("button",{onClick:eX,disabled:eL,style:N,title:"Refresh git status",children:"🔄"})]}),(0,t.jsxs)("div",{style:p,children:["explorer"===ek&&(0,t.jsxs)(t.Fragment,{children:[ea?(0,t.jsxs)("div",{style:{marginBottom:"1.5rem"},children:[(0,t.jsxs)("div",{style:m,children:["💼 ",ea.name," ",(0,t.jsx)("span",{style:u,title:ea.path,children:"root"})]}),(0,t.jsx)("div",{style:{padding:"0.25rem 0.5rem"},children:ea.tree.map(e=>(0,t.jsx)(I,{node:e,onSelect:tn,onCreate:te,onRename:tt,onDelete:tr,isReadOnly:!1},e.path))})]}):(0,t.jsx)("div",{style:{padding:"1rem",color:"var(--muted)",fontSize:"0.8rem"},children:"Scanning Workspace directory..."}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{style:{...m,borderTop:"1px solid var(--border)",paddingTop:"1rem"},children:[(0,t.jsxs)("span",{children:["🔍 Scoped Folders (",ed.length,")"]}),(0,t.jsx)("button",{onClick:()=>em(!0),style:N,title:"Add Scoped Folder...",children:"➕"})]}),ed.length>0?ed.map(e=>(0,t.jsxs)("div",{style:{marginTop:"0.75rem",padding:"0 0.5rem"},children:[(0,t.jsxs)("div",{style:{...f,display:"flex",gap:"0.25rem",color:"#a855f7",fontSize:"0.75rem",fontWeight:700,padding:"0.25rem",justifyContent:"space-between",alignItems:"center"},title:e.path,children:[(0,t.jsxs)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1},children:["🔗 ",e.name,"/"]}),(0,t.jsx)("button",{onClick:()=>ef(e.path),style:{background:"none",border:"none",color:"var(--danger)",cursor:"pointer",fontSize:"0.75rem",padding:"0 0.25rem"},title:"Remove Scoped Folder",children:"✖"})]}),(0,t.jsx)("div",{style:{paddingLeft:"0.25rem"},children:e.tree.map(e=>(0,t.jsx)(I,{node:e,onSelect:tn,onCreate:te,onRename:tt,onDelete:tr,isReadOnly:!0},e.path))})]},e.path)):(0,t.jsx)("div",{style:{padding:"0.5rem 1rem",color:"var(--muted)",fontSize:"0.75rem",fontStyle:"italic"},children:"No extra scoped folders. Click [+] to mount a folder."})]})]}),"git"===ek&&(0,t.jsxs)("div",{style:{padding:"0.5rem 1rem"},children:[(0,t.jsx)("div",{style:{fontSize:"0.75rem",fontWeight:700,textTransform:"uppercase",color:"var(--muted)",marginBottom:"0.5rem"},children:"Changes"}),eI?0===eP.length?(0,t.jsx)("div",{style:{color:"var(--success)",fontSize:"0.75rem",padding:"0.5rem 0"},children:"✔ Workspace clean."}):(0,t.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:"0.25rem"},children:eP.map(e=>{let r="#eab308";return"??"===e.status&&(r="#10b981"),"A"===e.status&&(r="#10b981"),"D"===e.status&&(r="#ef4444"),(0,t.jsxs)("div",{onClick:async()=>{try{let t=await fetch(`/api/git?action=diff&file=${encodeURIComponent(e.relativePath)}&root=${encodeURIComponent(Z)}`);if(t.ok){let r=await t.json();if(r.success){let t=`diff:${e.relativePath}`;eb.some(e=>e.path===t)||ej(o=>[...o,{name:`Diff: ${e.name}`,path:t,content:r.diff,isModified:!1}]),eC(t)}}}catch(e){console.error(e)}},style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0.35rem 0.5rem",borderRadius:"4px",backgroundColor:"rgba(255,255,255,0.02)",cursor:"pointer",fontSize:"0.75rem",fontFamily:"var(--font-mono)"},onMouseEnter:e=>e.currentTarget.style.backgroundColor="rgba(255,255,255,0.06)",onMouseLeave:e=>e.currentTarget.style.backgroundColor="rgba(255,255,255,0.02)",children:[(0,t.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1},title:e.relativePath,children:e.name}),(0,t.jsx)("span",{style:{fontSize:"0.6rem",padding:"0.1rem 0.3rem",borderRadius:"3px",backgroundColor:r+"22",color:r,fontWeight:700},children:e.status})]},e.relativePath)})}):(0,t.jsx)("div",{style:{color:"var(--muted)",fontSize:"0.75rem",fontStyle:"italic"},children:"Not a git repository."})]}),"analytics"===ek&&(0,t.jsxs)("div",{style:{padding:"0.5rem 1rem",display:"flex",flexDirection:"column",gap:"1.25rem"},children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{style:{fontSize:"0.75rem",fontWeight:700,textTransform:"uppercase",color:"var(--muted)",marginBottom:"0.5rem"},children:"Token Usage"}),(0,t.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"0.5rem"},children:[(0,t.jsxs)("div",{style:J,children:[(0,t.jsx)("div",{style:K,children:"Input"}),(0,t.jsx)("div",{style:_,children:(eD?.tokenUsage?.input??0).toLocaleString()})]}),(0,t.jsxs)("div",{style:J,children:[(0,t.jsx)("div",{style:K,children:"Output"}),(0,t.jsx)("div",{style:_,children:(eD?.tokenUsage?.output??0).toLocaleString()})]}),(0,t.jsxs)("div",{style:{...J,gridColumn:"span 2"},children:[(0,t.jsx)("div",{style:K,children:"Cost"}),(0,t.jsxs)("div",{style:{..._,color:"#10b981",fontSize:"1.25rem"},children:["$",(eD?.tokenUsage?.cost??0).toFixed(4)]})]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{style:{fontSize:"0.75rem",fontWeight:700,textTransform:"uppercase",color:"var(--muted)",marginBottom:"0.5rem"},children:"Resource Telemetry"}),(0,t.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:"0.75rem"},children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"0.7rem",marginBottom:"0.25rem"},children:[(0,t.jsx)("span",{children:"CPU Usage"}),(0,t.jsx)("span",{style:{fontWeight:600,color:"var(--primary)"},children:eM?.cpu??"0.0%"})]}),(0,t.jsx)("div",{style:H,children:(0,t.jsx)("div",{style:{...Y,width:eM?.cpu||"0%",backgroundColor:"var(--primary)"}})})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"0.7rem",marginBottom:"0.25rem"},children:[(0,t.jsx)("span",{children:"Memory Usage"}),(0,t.jsx)("span",{style:{fontWeight:600,color:"#eab308"},children:eM?.memory??"0.0MiB"})]}),(0,t.jsx)("div",{style:H,children:(0,t.jsx)("div",{style:{...Y,width:eM?.memoryPercent||"0%",backgroundColor:"#eab308"}})})]}),(0,t.jsx)("div",{style:{fontSize:"0.6rem",color:"var(--muted)",marginTop:"0.25rem",fontStyle:"italic"},children:eM?.type?.includes("docker")?"🐳 Docker container statistics":"💻 Local process statistics"})]})]})]}),"auditor"===ek&&(0,t.jsxs)("div",{style:{padding:"0.5rem 1rem",display:"flex",flexDirection:"column",gap:"1rem",height:"100%"},children:[(0,t.jsxs)("div",{style:{display:"flex",gap:"0.25rem"},children:[(0,t.jsx)("input",{type:"text",placeholder:"Search logs...",value:eB,onChange:e=>eU(e.target.value),style:{flex:1,backgroundColor:"#05070a",border:"1px solid var(--border)",borderRadius:"4px",padding:"0.25rem 0.5rem",color:"#ffffff",fontSize:"0.75rem",outline:"none"}}),(0,t.jsx)("button",{onClick:()=>{if(!eD?.logs)return;let t=new Blob([eD.logs.join("").replace(/\x1b\[[0-9;]*m/g,"")],{type:"text/plain;charset=utf-8"}),r=URL.createObjectURL(t),o=document.createElement("a");o.href=r,o.download=`session-${e}-logs.txt`,o.click(),URL.revokeObjectURL(r)},style:{backgroundColor:"rgba(59, 130, 246, 0.15)",border:"1px solid #3b82f6",color:"#3b82f6",padding:"0.25rem 0.5rem",borderRadius:"4px",fontSize:"0.7rem",fontWeight:600,cursor:"pointer"},children:"Export"})]}),(0,t.jsx)("div",{style:{height:"220px",overflowY:"auto",backgroundColor:"#05070a",border:"1px solid var(--border)",borderRadius:"6px",padding:"0.5rem",fontFamily:"var(--font-mono)",fontSize:"0.7rem",lineHeight:"1.4",whiteSpace:"pre-wrap",color:"#cbd5e1"},children:(()=>{if(!eD?.logs||0===eD.logs.length)return(0,t.jsx)("div",{style:{color:"var(--muted)",fontStyle:"italic",textAlign:"center"},children:"No logs captured."});let e=eD.logs.join("").replace(/\x1b\[[0-9;]*m/g,"").split(/\r?\n/),r=eB.trim()?e.filter(e=>e.toLowerCase().includes(eB.toLowerCase())):e;return 0===r.length?(0,t.jsx)("div",{style:{color:"var(--muted)",fontStyle:"italic",textAlign:"center"},children:"No matches."}):r.map((e,r)=>{if(!eB.trim())return(0,t.jsx)("div",{children:e},r);let o=e.split(RegExp(`(${eB})`,"gi"));return(0,t.jsx)("div",{children:o.map((e,r)=>e.toLowerCase()===eB.toLowerCase()?(0,t.jsx)("span",{style:{backgroundColor:"#eab308",color:"#000000",fontWeight:600},children:e},r):e)},r)})})()}),(0,t.jsxs)("div",{style:{borderTop:"1px solid var(--border)",paddingTop:"0.75rem"},children:[(0,t.jsx)("div",{style:{fontSize:"0.75rem",fontWeight:700,color:"var(--muted)",marginBottom:"0.5rem"},children:"Custom Buttons"}),(0,t.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:"0.35rem"},children:[(0,t.jsx)("input",{type:"text",placeholder:"Button Name (e.g. /undo)",value:eV,onChange:e=>eJ(e.target.value),style:{backgroundColor:"#05070a",border:"1px solid var(--border)",borderRadius:"4px",padding:"0.25rem 0.5rem",color:"#ffffff",fontSize:"0.7rem",outline:"none"}}),(0,t.jsx)("input",{type:"text",placeholder:"Injection Command",value:eK,onChange:e=>e_(e.target.value),style:{backgroundColor:"#05070a",border:"1px solid var(--border)",borderRadius:"4px",padding:"0.25rem 0.5rem",color:"#ffffff",fontSize:"0.7rem",outline:"none"}}),(0,t.jsx)("button",{onClick:()=>{eV.trim()&&eK.trim()&&(eG([...e$,{name:eV.trim(),command:eK.trim()}]),eJ(""),e_(""))},style:{backgroundColor:"rgba(168, 85, 247, 0.15)",border:"1px solid #a855f7",color:"#c084fc",padding:"0.3rem",borderRadius:"4px",fontSize:"0.7rem",fontWeight:600,cursor:"pointer"},children:"+ Add Button"}),e$.length>0&&(0,t.jsx)("div",{style:{marginTop:"0.25rem",maxHeight:"60px",overflowY:"auto"},children:e$.map((e,r)=>(0,t.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",fontSize:"0.65rem",backgroundColor:"rgba(255,255,255,0.02)",padding:"0.1rem 0.25rem",borderRadius:"3px",marginTop:"0.15rem"},children:[(0,t.jsx)("span",{style:{color:"#c084fc"},children:e.name}),(0,t.jsx)("span",{onClick:()=>{eG(e$.filter((e,t)=>t!==r))},style:{color:"var(--danger)",cursor:"pointer"},children:"✖"})]},r))})]})]})]})]})]}),(0,t.jsxs)("div",{style:h,children:[(0,t.jsx)("div",{style:Q,children:(0,t.jsx)("div",{style:{display:"flex",gap:"0.25rem",overflowX:"auto"},children:er.map(r=>{let o=r.id===e,i="running"===r.status?"#10b981":"rgba(255,255,255,0.2)";return(0,t.jsxs)("div",{onClick:()=>{eH===r.id&&eY(null),eo(r.id)},style:{...q,backgroundColor:o?"#0b101b":"rgba(8,12,20,0.6)",borderColor:o?"var(--border-focus)":"var(--border)",color:o?"var(--foreground)":"var(--muted)"},children:[(0,t.jsx)("span",{style:{width:"6px",height:"6px",borderRadius:"50%",backgroundColor:i,display:"inline-block"}}),(0,t.jsx)("span",{style:{fontSize:"0.75rem",fontWeight:o?600:500},children:r.name}),(0,t.jsx)("span",{style:{fontSize:"0.6rem",color:"var(--muted)",backgroundColor:"rgba(255,255,255,0.05)",padding:"1px 4px",borderRadius:"3px"},children:r.type.replace("claude-","").replace("aider-","")})]},r.id)})})}),(0,t.jsxs)("div",{style:g,children:[(0,t.jsxs)("div",{style:x,children:[(0,t.jsx)("div",{style:y,children:eb.map(e=>(0,t.jsxs)("div",{style:{...b,backgroundColor:ev===e.path?"#0b101b":"rgba(8,12,20,0.4)",borderColor:ev===e.path?"var(--border-focus)":"transparent",color:ev===e.path?"var(--foreground)":"var(--muted)"},onClick:()=>eC(e.path),children:[(0,t.jsxs)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[e.name," ",e.isModified&&(0,t.jsx)("span",{style:j,children:"●"})]}),(0,t.jsx)("span",{onClick:t=>{t.stopPropagation(),tl(e.path)},style:v,children:"✖"})]},e.path))}),ta&&!ta.path.startsWith("diff:")&&(0,t.jsx)("button",{onClick:ts,disabled:!ta.isModified,style:{...C,opacity:ta.isModified?1:.5,cursor:ta.isModified?"pointer":"not-allowed"},children:"💾 Save (Ctrl+S)"})]}),(0,t.jsx)("div",{style:w,children:ta?ta.path.startsWith("diff:")?(0,t.jsx)("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.8rem",padding:"1rem",overflow:"auto",height:"100%",backgroundColor:"#0b101b",lineHeight:1.5},children:ta.content.split("\n").map((e,r)=>{let o="#e2e8f0",i="transparent";return e.startsWith("+")?(o="#4ade80",i="rgba(74, 222, 128, 0.08)"):e.startsWith("-")?(o="#f87171",i="rgba(248, 113, 113, 0.08)"):e.startsWith("@@")&&(o="#60a5fa",i="rgba(96, 165, 250, 0.05)"),(0,t.jsx)("div",{style:{color:o,backgroundColor:i,whiteSpace:"pre-wrap",padding:"0.1rem 0.5rem"},children:e},r)})}):(0,t.jsx)("textarea",{value:ta.content,onChange:e=>{var t;return t=e.target.value,void(ev&&ej(eb.map(e=>e.path===ev?{...e,content:t,isModified:!0}:e)))},style:S,spellCheck:!1}):(0,t.jsxs)("div",{style:k,children:[(0,t.jsx)("div",{style:{fontSize:"2rem",marginBottom:"1rem"},children:"💻"}),(0,t.jsx)("h4",{style:{margin:0,fontWeight:600},children:"NeuralLoom Workspace Editor"}),(0,t.jsx)("p",{style:{margin:"0.5rem 0 0 0",color:"var(--muted)",fontSize:"0.8rem"},children:"Select files from the left explorer panel to view and edit. Use Ctrl+S to save changes."}),(0,t.jsxs)("p",{style:{margin:"0.5rem 0 0 0",color:"var(--muted)",fontSize:"0.75rem",fontStyle:"italic"},children:["Press ",(0,t.jsx)("kbd",{style:{background:"rgba(255,255,255,0.1)",padding:"2px 4px",borderRadius:"3px"},children:"Ctrl+P"})," to search files."]})]})})]}),(0,t.jsxs)("div",{style:T,children:[(0,t.jsxs)("div",{style:z,children:[(0,t.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:"0.5rem",fontWeight:600,fontSize:"0.8rem"},children:["🖥️ Session Console Bridge ",eH&&"(Split View Active)"]}),(0,t.jsxs)("div",{style:{display:"flex",gap:"0.5rem",alignItems:"center"},children:[el?.status==="stopped"&&(0,t.jsx)("button",{onClick:async()=>{try{let t=await fetch("/api/sessions/start",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e})});if(t.ok)ei&&ei();else{let e=await t.json();alert(e.error||"Failed to restart session.")}}catch(e){console.error("Failed to restart session:",e),alert("Network error: failed to restart session.")}},style:{padding:"0.3rem 0.6rem",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.jsxs)("select",{onChange:e=>{eY(e.target.value||null)},value:eH||"",style:{backgroundColor:"#080c14",border:"1px solid var(--border)",borderRadius:"4px",padding:"0.2rem 0.5rem",color:"var(--foreground)",fontSize:"0.7rem",outline:"none",cursor:"pointer"},children:[(0,t.jsx)("option",{value:"",children:"🖥️ Single Terminal"}),er.filter(t=>t.id!==e&&"running"===t.status).map(e=>(0,t.jsxs)("option",{value:e.id,children:["🖥️|🖥️ Split: ",e.name]},e.id))]}),(0,t.jsx)("button",{onClick:async()=>{await fetch("/api/sessions/inject",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,command:"/ccc"})})},style:R,children:"🚀 Mount Context (/ccc)"}),(0,t.jsx)("button",{onClick:async()=>{await fetch("/api/sessions/inject",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,command:"/ccp"})})},style:P,children:"⚡ Trigger Prompt (/ccp)"})]})]}),(0,t.jsxs)("div",{style:X,children:[(0,t.jsx)("span",{style:{fontSize:"0.7rem",color:"var(--muted)",textTransform:"uppercase",letterSpacing:"0.05em",fontWeight:700},children:"Quick Commands:"}),(0,t.jsxs)("div",{style:{display:"flex",gap:"0.35rem",flexWrap:"wrap",alignItems:"center"},children:[eq?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{onClick:()=>eQ("/undo"),style:G,title:"Aider: undo last commit",children:"/undo"}),(0,t.jsx)("button",{onClick:()=>eQ("/diff"),style:G,title:"Aider: show git diff",children:"/diff"}),(0,t.jsx)("button",{onClick:()=>eQ("/commit"),style:G,title:"Aider: commit edits",children:"/commit"}),(0,t.jsx)("button",{onClick:()=>eQ("/test"),style:G,title:"Aider: run tests",children:"/test"}),(0,t.jsx)("button",{onClick:()=>eQ("/clear"),style:G,title:"Clear terminal screen",children:"/clear"})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{onClick:()=>eQ("/compact"),style:G,title:"Claude Code: compact history",children:"/compact"}),(0,t.jsx)("button",{onClick:()=>eQ("/history"),style:G,title:"Claude Code: view history",children:"/history"}),(0,t.jsx)("button",{onClick:()=>eQ("/reset"),style:G,title:"Claude Code: reset conversation",children:"/reset"}),(0,t.jsx)("button",{onClick:()=>eQ("/help"),style:G,title:"Claude Code: show help",children:"/help"})]}),e$.map((e,r)=>(0,t.jsx)("button",{onClick:()=>eQ(e.command),style:{...G,borderColor:"rgba(168, 85, 247, 0.4)",color:"#c084fc"},title:`Inject command: ${e.command}`,children:e.name},r))]})]}),(0,t.jsxs)("div",{style:{...F,display:"flex",width:"100%",height:"100%"},children:[(0,t.jsx)("div",{style:{flex:1,height:"100%",borderRight:eH?"1px solid var(--border)":"none",overflow:"hidden"},children:(0,t.jsx)(o.default,{sessionId:e,height:"100%"})}),eH&&(0,t.jsxs)("div",{style:{flex:1,height:"100%",overflow:"hidden",display:"flex",flexDirection:"column"},children:[(0,t.jsxs)("div",{style:{padding:"0.25rem 0.5rem",backgroundColor:"#030406",fontSize:"0.7rem",borderBottom:"1px solid var(--border)",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,t.jsxs)("span",{style:{color:"#a855f7",fontWeight:600},children:["🔗 Focused PTY Connection: ",er.find(e=>e.id===eH)?.name]}),(0,t.jsx)("button",{onClick:()=>eY(null),style:{background:"none",border:"none",color:"var(--danger)",cursor:"pointer",fontSize:"0.7rem"},children:"Close Split ✖"})]}),(0,t.jsx)("div",{style:{flex:1,overflow:"hidden"},children:(0,t.jsx)(o.default,{sessionId:eH,height:"100%"})})]})]})]})]}),eZ.type&&(0,t.jsx)("div",{style:W,children:(0,t.jsxs)("div",{style:L,children:[(0,t.jsxs)("h3",{style:{margin:"0 0 1rem 0",fontSize:"1rem",fontWeight:600},children:["create-file"===eZ.type&&"Create New File","create-folder"===eZ.type&&"Create New Folder","rename"===eZ.type&&"Rename Item","delete"===eZ.type&&"Confirm Deletion"]}),eZ.error&&(0,t.jsxs)("div",{style:{color:"var(--danger)",fontSize:"0.8rem",marginBottom:"1rem"},children:["⚠️ ",eZ.error]}),"delete"!==eZ.type?(0,t.jsxs)("form",{onSubmit:to,children:[(0,t.jsxs)("div",{style:{marginBottom:"0.5rem",fontSize:"0.75rem",color:"var(--muted)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:eZ.targetPath||"",children:["Target: ",eZ.targetPath]}),(0,t.jsx)("input",{type:"text",value:eZ.inputValue,onChange:e=>e0({...eZ,inputValue:e.target.value}),style:O,autoFocus:!0,placeholder:"rename"===eZ.type?"Enter new name":"Enter name"}),(0,t.jsxs)("div",{style:D,children:[(0,t.jsx)("button",{type:"button",onClick:()=>e0({type:null,targetPath:null,inputValue:"",error:null}),style:E,children:"Cancel"}),(0,t.jsx)("button",{type:"submit",style:M,children:"Submit"})]})]}):(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{style:{fontSize:"0.85rem",marginBottom:"1.5rem",color:"var(--muted)",overflowWrap:"break-word"},children:["Are you sure you want to delete this item? This action is permanent.",(0,t.jsx)("div",{style:{marginTop:"0.5rem",color:"#e2e8f0",fontFamily:"var(--font-mono)",fontSize:"0.75rem",background:"rgba(255,255,255,0.05)",padding:"0.5rem",borderRadius:"4px"},children:eZ.targetPath})]}),(0,t.jsxs)("div",{style:D,children:[(0,t.jsx)("button",{type:"button",onClick:()=>e0({type:null,targetPath:null,inputValue:"",error:null}),style:E,children:"Cancel"}),(0,t.jsx)("button",{onClick:()=>to(),style:{...M,backgroundColor:"var(--danger)"},children:"Delete Permanently"})]})]})]})}),e5&&(0,t.jsx)("div",{style:B,onClick:()=>e1(!1),children:(0,t.jsxs)("div",{style:U,onClick:e=>e.stopPropagation(),children:[(0,t.jsx)("input",{type:"text",value:e2,onChange:e=>{e7(e.target.value),e4(0)},onKeyDown:e=>{"ArrowDown"===e.key?(e.preventDefault(),e4(e=>(e+1)%Math.max(1,td.length))):"ArrowUp"===e.key?(e.preventDefault(),e4(e=>(e-1+td.length)%Math.max(1,td.length))):"Enter"===e.key?(e.preventDefault(),td[e3]&&(tn(td[e3].path),e1(!1))):"Escape"===e.key&&(e.preventDefault(),e1(!1))},placeholder:"Search files by name or path...",style:$,autoFocus:!0}),(0,t.jsx)("div",{style:A,children:td.length>0?td.map((e,r)=>(0,t.jsxs)("div",{onClick:()=>{tn(e.path),e1(!1)},style:{...V,backgroundColor:r===e3?"rgba(168, 85, 247, 0.15)":"transparent",borderLeft:r===e3?"3px solid var(--primary)":"3px solid transparent"},children:[(0,t.jsx)("span",{style:{fontSize:"0.85rem",fontWeight:600},children:e.name}),(0,t.jsx)("span",{style:{fontSize:"0.7rem",color:"var(--muted)",marginLeft:"0.5rem",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.relativePath})]},e.path)):(0,t.jsx)("div",{style:{padding:"0.75rem 1rem",color:"var(--muted)",fontSize:"0.8rem",textAlign:"center"},children:"No matching files found"})}),(0,t.jsx)("div",{style:{padding:"0.5rem 1rem",borderTop:"1px solid var(--border)",fontSize:"0.65rem",color:"var(--muted)",textAlign:"right"},children:"Use ↑↓ to navigate, Enter to select, Esc to close"})]})}),ep&&(0,t.jsx)(i.default,{title:"Add Scoped Directory",initialPath:Z,onClose:()=>em(!1),onSelect:e=>{eu(e),em(!1)}})]})}])},97722,e=>{e.n(e.i(3839))}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,67585,(e,a,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"BailoutToCSR",{enumerable:!0,get:function(){return n}});let t=e.r(32061);function n({reason:e,children:a}){if("u"<typeof window)throw Object.defineProperty(new t.BailoutToCSRError(e),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return a}},9885,(e,a,s)=>{"use strict";function t(e){return e.split("/").map(e=>encodeURIComponent(e)).join("/")}Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"encodeURIPath",{enumerable:!0,get:function(){return t}})},52157,(e,a,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"PreloadChunks",{enumerable:!0,get:function(){return i}});let t=e.r(43476),n=e.r(74080),l=e.r(63599),r=e.r(9885),o=e.r(43369);function i({moduleIds:e}){if("u">typeof window)return null;let a=l.workAsyncStorage.getStore();if(void 0===a)return null;let s=[];if(a.reactLoadableManifest&&e){let t=a.reactLoadableManifest;for(let a of e){if(!t[a])continue;let e=t[a].files;s.push(...e)}}if(0===s.length)return null;let d=(0,o.getAssetTokenQuery)();return(0,t.jsx)(t.Fragment,{children:s.map(e=>{let s=`${a.assetPrefix}/_next/${(0,r.encodeURIPath)(e)}${d}`;return e.endsWith(".css")?(0,t.jsx)("link",{precedence:"dynamic",href:s,rel:"stylesheet",as:"style",nonce:a.nonce},e):((0,n.preload)(s,{as:"script",fetchPriority:"low",nonce:a.nonce}),null)})})}},69093,(e,a,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"default",{enumerable:!0,get:function(){return d}});let t=e.r(43476),n=e.r(71645),l=e.r(67585),r=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 a={...i,...e},s=(0,n.lazy)(()=>a.loader().then(o)),d=a.loading;function c(e){let o=d?(0,t.jsx)(d,{isLoading:!0,pastDelay:!0,error:null}):null,i=!a.ssr||!!a.loading,c=i?n.Suspense:n.Fragment,u=a.ssr?(0,t.jsxs)(t.Fragment,{children:["u"<typeof window?(0,t.jsx)(r.PreloadChunks,{moduleIds:a.modules}):null,(0,t.jsx)(s,{...e})]}):(0,t.jsx)(l.BailoutToCSR,{reason:"next/dynamic",children:(0,t.jsx)(s,{...e})});return(0,t.jsx)(c,{...i?{fallback:o}:{},children:u})}return c.displayName="LoadableComponent",c}},70703,(e,a,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"default",{enumerable:!0,get:function(){return n}});let t=e.r(55682)._(e.r(69093));function n(e,a){let s={};"function"==typeof e&&(s.loader=e);let n={...s,...a};return(0,t.default)({...n,modules:n.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),a.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 a=e.i(43476),s=e.i(71645),t=e.i(70703),n=e.i(20897);let l=(0,t.default)(()=>e.A(33779),{loadableGenerated:{modules:[37314]},ssr:!1,loading:()=>(0,a.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,a.jsx)("span",{children:"Initializing terminal emulator..."})})}),r=(0,t.default)(()=>e.A(39429),{loadableGenerated:{modules:[1985]},ssr:!1,loading:()=>(0,a.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,a.jsx)("span",{style:{color:"var(--muted)"},children:"Initializing prompt editor..."})})}),o=(0,t.default)(()=>e.A(56915),{loadableGenerated:{modules:[99026]},ssr:!1}),i=(0,t.default)(()=>e.A(78716),{loadableGenerated:{modules:[9949]},ssr:!1}),d=(0,t.default)(()=>e.A(33789),{loadableGenerated:{modules:[20032]},ssr:!1}),c=(0,t.default)(()=>e.A(78003),{loadableGenerated:{modules:[97722]},ssr:!1});e.s(["default",0,function(){let[e,t]=(0,s.useState)([]),[u,p]=(0,s.useState)(null),[m,_]=(0,s.useState)(!1),[h,f]=(0,s.useState)(!1),[x,g]=(0,s.useState)(!1),[j,y]=(0,s.useState)(!1),[b,v]=(0,s.useState)(!1),[w,k]=(0,s.useState)(!1),[C,N]=(0,s.useState)(""),S=e.find(e=>e.id===u),E=e.some(e=>("claude-docker"===e.type||"aider-docker"===e.type)&&"running"===e.status),P=e.some(e=>"claude-ssh"===e.type&&"running"===e.status),W=async()=>{try{let e=await fetch("/api/sessions"),a=await e.json();a.sessions&&t(a.sessions),a.originalCwd&&N(a.originalCwd)}catch(e){console.error("Failed to fetch sessions:",e)}};(0,s.useEffect)(()=>{(async()=>{await W()})();let e=setInterval(W,4e3);return()=>clearInterval(e)},[]);let T=async(e,a,s,t)=>{_(!0);try{let n=a;n||("claude"===e?n="Claude Local":"claude-docker"===e?n="Claude Docker":"claude-ssh"===e?n="Claude SSH":"aider"===e?n="Aider Local":"aider-docker"===e?n="Aider Docker":"mock"===e&&(n="Mock Session"));let l={type:e,name:n,workspaceRoot:s,scopedDirs:t};if(("aider"===e||"aider-docker"===e)&&!s)try{let e=await fetch("/api/context/aider");if(e.ok){let a=await e.json();a.success&&a.config&&(l.workspaceRoot=a.config.workspaceRoot,l.scopedDirs=a.config.scopedDirs)}}catch(e){console.error("Failed to load aider configuration before launch:",e)}let r=await fetch("/api/sessions/launch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)}),o=await r.json();o.success&&(await W(),p(o.session.id))}catch(e){console.error("Failed to launch session:",e)}finally{_(!1)}},L=async(e,a=!1)=>{try{let s=await fetch("/api/sessions/stop",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,delete:a})});(await s.json()).success&&(a&&u===e&&p(null),await W())}catch(e){console.error("Failed to stop session:",e)}};return(0,a.jsxs)("div",{className:`${n.default.container} ${S?n.default.containerActive:""}`,children:[(0,a.jsxs)("header",{className:n.default.header,children:[(0,a.jsxs)("div",{className:n.default.logoArea,children:[(0,a.jsx)("h1",{className:n.default.title,children:"NeuralLoom"}),(0,a.jsx)("span",{className:n.default.subtitle,children:"Unified AI Orchestrator & Context Bridge"})]}),(0,a.jsxs)("div",{className:n.default.statusIndicator,children:[(0,a.jsx)("span",{className:n.default.pulseDot}),(0,a.jsx)("span",{children:"Orchestrator Online"})]})]}),S?(0,a.jsx)("div",{style:{flex:1,minHeight:0,display:"flex",flexDirection:"column"},children:(0,a.jsx)(c,{sessionId:S.id,workspaceRoot:S.workspaceRoot||"",scopedDirs:S.scopedDirs||[],onClose:()=>p(null),sessions:e,onSwitchSession:e=>p(e),onRefreshSessions:W})}):(0,a.jsxs)("div",{className:n.default.dashboardGrid,children:[(0,a.jsxs)("main",{className:n.default.mainPanel,children:[(0,a.jsxs)("section",{children:[(0,a.jsx)("h2",{className:n.default.sectionTitle,children:"Active AI Agents"}),0===e.length?(0,a.jsxs)("div",{className:"card",style:{padding:"3rem 1.5rem",textAlign:"center"},children:[(0,a.jsx)("p",{style:{color:"var(--muted)",marginBottom:"1.5rem"},children:"No active agent sessions in this workspace. Launch a simulated session to verify the control bridge."}),(0,a.jsx)("button",{className:n.default.quickLaunchBtn,onClick:()=>T("mock"),disabled:m,style:{maxWidth:"240px",margin:"0 auto"},children:m?"Launching...":"⚡ Launch Simulated Session"})]}):(0,a.jsx)("div",{className:n.default.agentGrid,children:e.map(e=>(0,a.jsxs)("div",{className:`${n.default.agentCard} card ${u===e.id?n.default.activeBorder:""}`,children:[(0,a.jsxs)("div",{className:n.default.agentHeader,children:[(0,a.jsx)("span",{className:n.default.agentName,children:e.name}),(0,a.jsx)("span",{className:`${n.default.agentBadge} ${"stopped"===e.status?n.default.stoppedBadge:""}`,children:e.status})]}),(0,a.jsxs)("div",{className:n.default.cardBody,children:[(0,a.jsxs)("p",{style:{fontSize:"0.825rem",color:"var(--muted)"},children:["ID: ",(0,a.jsx)("code",{style:{fontSize:"0.75rem"},children:e.id.substring(0,8)}),(0,a.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,a.jsx)("br",{}),"Logs: ",e.logsCount," captured lines"]}),(0,a.jsxs)("div",{style:{display:"flex",gap:"0.5rem",marginTop:"1rem"},children:["running"===e.status?(0,a.jsx)("button",{onClick:()=>L(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,a.jsx)("button",{onClick:()=>L(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,a.jsx)("button",{onClick:()=>p(e.id),style:{flex:2,padding:"0.4rem 0.6rem",borderRadius:"6px",border:"none",backgroundColor:u===e.id?"var(--border-focus)":"var(--primary)",fontSize:"0.75rem",fontWeight:600,color:"#fff"},children:u===e.id?"Connected":"Open Session"})]})]})]},e.id))})]}),u&&(0,a.jsxs)("section",{className:"card",style:{display:"flex",flexDirection:"column",border:"1px solid var(--border-focus)"},children:[(0,a.jsxs)("div",{className:n.default.agentHeader,style:{justifyContent:"space-between",background:"rgba(109, 40, 217, 0.08)"},children:[(0,a.jsxs)("span",{style:{fontWeight:600,display:"flex",alignItems:"center",gap:"0.5rem"},children:["🖥️ Console Bridge — ",e.find(e=>e.id===u)?.name]}),(0,a.jsx)("button",{onClick:()=>p(null),style:{border:"none",background:"none",color:"var(--muted)",cursor:"pointer",fontSize:"0.75rem"},children:"Close Panel ✖"})]}),(0,a.jsx)(l,{sessionId:u})]}),(0,a.jsxs)("section",{children:[(0,a.jsx)("h2",{className:n.default.sectionTitle,children:"Shared Context Hub & Slash Commands"}),(0,a.jsxs)("div",{className:n.default.contextList,children:[(0,a.jsxs)("div",{className:`${n.default.contextItem} card`,children:[(0,a.jsxs)("div",{className:n.default.contextMeta,children:[(0,a.jsx)("span",{className:n.default.contextTitle,children:"Staged Context & System Rules (/ccc)"}),(0,a.jsx)("span",{className:n.default.contextDetails,children:"Compiles AGENTS.md guidelines and project files folder hierarchy map."})]}),(0,a.jsx)("button",{onClick:async()=>{u&&await fetch("/api/sessions/inject",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:u,command:"/ccc"})})},disabled:!u,style:{padding:"0.4rem 0.8rem",borderRadius:"6px",border:"1px solid var(--primary)",backgroundColor:"transparent",color:"var(--primary)",fontSize:"0.75rem",fontWeight:600,opacity:u?1:.5,cursor:u?"pointer":"not-allowed"},children:"🚀 Mount Context (/ccc)"})]}),(0,a.jsxs)("div",{className:`${n.default.contextItem} card`,children:[(0,a.jsxs)("div",{className:n.default.contextMeta,children:[(0,a.jsx)("span",{className:n.default.contextTitle,children:"Staged Developer Prompt (/ccp)"}),(0,a.jsx)("span",{className:n.default.contextDetails,children:"Executes instructions written in .ai/neural-loom/cprompt.md."})]}),(0,a.jsx)("button",{onClick:async()=>{u&&await fetch("/api/sessions/inject",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:u,command:"/ccp"})})},disabled:!u,style:{padding:"0.4rem 0.8rem",borderRadius:"6px",border:"1px solid var(--success)",backgroundColor:"transparent",color:"var(--success)",fontSize:"0.75rem",fontWeight:600,opacity:u?1:.5,cursor:u?"pointer":"not-allowed"},children:"⚡ Trigger Prompt (/ccp)"})]})]}),(0,a.jsx)(r,{})]})]}),(0,a.jsxs)("aside",{className:n.default.sidePanel,children:[(0,a.jsxs)("section",{children:[(0,a.jsx)("h2",{className:n.default.sectionTitle,children:"Execution Environments"}),(0,a.jsxs)("div",{className:n.default.envGrid,children:[(0,a.jsxs)("div",{className:n.default.envRow,children:[(0,a.jsx)("span",{className:n.default.envName,children:"💻 Local host OS"}),(0,a.jsx)("span",{className:n.default.envStatus,style:{color:"var(--success)"},children:"Active"})]}),(0,a.jsxs)("div",{className:n.default.envRow,style:{opacity:E?1:.6},children:[(0,a.jsx)("span",{className:n.default.envName,children:"🐳 Docker Sandbox"}),(0,a.jsx)("span",{className:n.default.envStatus,style:{color:E?"var(--success)":"var(--muted)"},children:E?"Active":"Not Mounted"})]}),(0,a.jsxs)("div",{className:n.default.envRow,style:{opacity:P?1:.6},children:[(0,a.jsx)("span",{className:n.default.envName,children:"🌐 Remote VM (SSH)"}),(0,a.jsx)("span",{className:n.default.envStatus,style:{color:P?"var(--success)":"var(--muted)"},children:P?"Active":"Disconnected"})]})]})]}),(0,a.jsxs)("section",{style:{display:"flex",flexDirection:"column",gap:"0.75rem"},children:[(0,a.jsxs)("button",{className:n.default.quickLaunchBtn,onClick:()=>T("mock"),disabled:m,children:[(0,a.jsx)("span",{children:"⚡"}),(0,a.jsx)("span",{children:"Launch Mock Agent"})]}),(0,a.jsxs)("button",{className:n.default.quickLaunchBtn,onClick:()=>{k(!1),v(!0)},disabled:m,style:{background:"linear-gradient(135deg, hsl(262, 83%, 60%) 0%, hsl(195, 100%, 45%) 100%)",border:"none"},children:[(0,a.jsx)("span",{children:"🤖"}),(0,a.jsx)("span",{children:"Launch Claude PTY"})]}),(0,a.jsxs)("button",{className:n.default.quickLaunchBtn,onClick:()=>{k(!0),v(!0)},disabled:m,style:{background:"linear-gradient(135deg, hsl(170, 72%, 40%) 0%, hsl(195, 100%, 40%) 100%)",border:"none"},children:[(0,a.jsx)("span",{children:"🐳"}),(0,a.jsx)("span",{children:"Launch Docker PTY"})]}),(0,a.jsxs)("button",{className:n.default.quickLaunchBtn,onClick:()=>f(!0),disabled:m,style:{background:"linear-gradient(135deg, hsl(38, 92%, 50%) 0%, hsl(0, 84%, 60%) 100%)",border:"none"},children:[(0,a.jsx)("span",{children:"🌐"}),(0,a.jsx)("span",{children:"Launch SSH PTY"})]}),(0,a.jsxs)("button",{className:n.default.quickLaunchBtn,onClick:()=>{y(!1),g(!0)},disabled:m,style:{background:"linear-gradient(135deg, hsl(210, 80%, 45%) 0%, hsl(262, 80%, 55%) 100%)",border:"none"},children:[(0,a.jsx)("span",{children:"🐍"}),(0,a.jsx)("span",{children:"Launch Aider PTY"})]}),(0,a.jsxs)("button",{className:n.default.quickLaunchBtn,onClick:()=>{y(!0),g(!0)},disabled:m,style:{background:"linear-gradient(135deg, hsl(195, 100%, 40%) 0%, hsl(262, 80%, 55%) 100%)",border:"none"},children:[(0,a.jsx)("span",{children:"🐳"}),(0,a.jsx)("span",{children:"Launch Aider Docker"})]})]}),(0,a.jsxs)("section",{className:"card",style:{padding:"1.5rem",display:"flex",flexDirection:"column",gap:"0.75rem"},children:[(0,a.jsx)("h3",{style:{fontSize:"1rem",fontWeight:700},children:"Quick Actions"}),(0,a.jsxs)("ul",{style:{listStyle:"none",fontSize:"0.875rem",display:"flex",flexDirection:"column",gap:"0.5rem",color:"var(--muted)"},children:[(0,a.jsxs)("li",{style:{display:"flex",justifyContent:"space-between"},children:[(0,a.jsx)("span",{children:"Configure global API Keys"}),(0,a.jsx)("span",{style:{color:"var(--primary)",cursor:"pointer"},children:"→"})]}),(0,a.jsxs)("li",{style:{display:"flex",justifyContent:"space-between"},children:[(0,a.jsx)("span",{children:"Edit rules templates"}),(0,a.jsx)("span",{style:{color:"var(--primary)",cursor:"pointer"},children:"→"})]}),(0,a.jsxs)("li",{style:{display:"flex",justifyContent:"space-between"},children:[(0,a.jsx)("span",{children:"Inspect process locks"}),(0,a.jsx)("span",{style:{color:"var(--primary)",cursor:"pointer"},children:"→"})]})]})]})]})]}),(0,a.jsxs)("footer",{className:n.default.footer,children:[(0,a.jsx)("span",{children:"NeuralLoom v0.2.13 — Experimental AI Orchestrator Bridge"}),(0,a.jsxs)("span",{children:["Directory: ",C||"Loading..."]})]}),h&&(0,a.jsx)(o,{onClose:()=>f(!1),onConfirmLaunch:()=>{f(!1),T("claude-ssh")}}),x&&(0,a.jsx)(i,{onClose:()=>g(!1),isDocker:j,onConfirmLaunch:()=>{g(!1),T(j?"aider-docker":"aider")}}),b&&(0,a.jsx)(d,{onClose:()=>v(!1),isDocker:w,onConfirmLaunch:(e,a,s)=>{v(!1),T(w?"claude-docker":"claude",e,a,s)}})]})}])},33779,e=>{e.v(a=>Promise.all(["static/chunks/03g6xpslyid3~.js","static/chunks/06z14vx5drwj0.js","static/chunks/0ga14ztvrhau2.css"].map(a=>e.l(a))).then(()=>a(37314)))},39429,e=>{e.v(a=>Promise.all(["static/chunks/16w4~t4h7gk13.js"].map(a=>e.l(a))).then(()=>a(1985)))},56915,e=>{e.v(a=>Promise.all(["static/chunks/0lnobx4eh3~-_.js"].map(a=>e.l(a))).then(()=>a(99026)))},78716,e=>{e.v(a=>Promise.all(["static/chunks/0jxar8nsw_py3.js"].map(a=>e.l(a))).then(()=>a(9949)))},33789,e=>{e.v(a=>Promise.all(["static/chunks/0b89ti7ob.09t.js"].map(a=>e.l(a))).then(()=>a(20032)))},78003,e=>{e.v(a=>Promise.all(["static/chunks/0eidfx-s54367.js","static/chunks/06z14vx5drwj0.js","static/chunks/0ew-ei_k3d-qg.js","static/chunks/0ga14ztvrhau2.css"].map(a=>e.l(a))).then(()=>a(97722)))}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,67585,(e,a,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"BailoutToCSR",{enumerable:!0,get:function(){return n}});let t=e.r(32061);function n({reason:e,children:a}){if("u"<typeof window)throw Object.defineProperty(new t.BailoutToCSRError(e),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return a}},9885,(e,a,s)=>{"use strict";function t(e){return e.split("/").map(e=>encodeURIComponent(e)).join("/")}Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"encodeURIPath",{enumerable:!0,get:function(){return t}})},52157,(e,a,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"PreloadChunks",{enumerable:!0,get:function(){return i}});let t=e.r(43476),n=e.r(74080),l=e.r(63599),r=e.r(9885),o=e.r(43369);function i({moduleIds:e}){if("u">typeof window)return null;let a=l.workAsyncStorage.getStore();if(void 0===a)return null;let s=[];if(a.reactLoadableManifest&&e){let t=a.reactLoadableManifest;for(let a of e){if(!t[a])continue;let e=t[a].files;s.push(...e)}}if(0===s.length)return null;let d=(0,o.getAssetTokenQuery)();return(0,t.jsx)(t.Fragment,{children:s.map(e=>{let s=`${a.assetPrefix}/_next/${(0,r.encodeURIPath)(e)}${d}`;return e.endsWith(".css")?(0,t.jsx)("link",{precedence:"dynamic",href:s,rel:"stylesheet",as:"style",nonce:a.nonce},e):((0,n.preload)(s,{as:"script",fetchPriority:"low",nonce:a.nonce}),null)})})}},69093,(e,a,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"default",{enumerable:!0,get:function(){return d}});let t=e.r(43476),n=e.r(71645),l=e.r(67585),r=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 a={...i,...e},s=(0,n.lazy)(()=>a.loader().then(o)),d=a.loading;function c(e){let o=d?(0,t.jsx)(d,{isLoading:!0,pastDelay:!0,error:null}):null,i=!a.ssr||!!a.loading,c=i?n.Suspense:n.Fragment,u=a.ssr?(0,t.jsxs)(t.Fragment,{children:["u"<typeof window?(0,t.jsx)(r.PreloadChunks,{moduleIds:a.modules}):null,(0,t.jsx)(s,{...e})]}):(0,t.jsx)(l.BailoutToCSR,{reason:"next/dynamic",children:(0,t.jsx)(s,{...e})});return(0,t.jsx)(c,{...i?{fallback:o}:{},children:u})}return c.displayName="LoadableComponent",c}},70703,(e,a,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"default",{enumerable:!0,get:function(){return n}});let t=e.r(55682)._(e.r(69093));function n(e,a){let s={};"function"==typeof e&&(s.loader=e);let n={...s,...a};return(0,t.default)({...n,modules:n.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),a.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 a=e.i(43476),s=e.i(71645),t=e.i(70703),n=e.i(20897);let l=(0,t.default)(()=>e.A(33779),{loadableGenerated:{modules:[37314]},ssr:!1,loading:()=>(0,a.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,a.jsx)("span",{children:"Initializing terminal emulator..."})})}),r=(0,t.default)(()=>e.A(39429),{loadableGenerated:{modules:[1985]},ssr:!1,loading:()=>(0,a.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,a.jsx)("span",{style:{color:"var(--muted)"},children:"Initializing prompt editor..."})})}),o=(0,t.default)(()=>e.A(56915),{loadableGenerated:{modules:[99026]},ssr:!1}),i=(0,t.default)(()=>e.A(78716),{loadableGenerated:{modules:[9949]},ssr:!1}),d=(0,t.default)(()=>e.A(33789),{loadableGenerated:{modules:[20032]},ssr:!1}),c=(0,t.default)(()=>e.A(78003),{loadableGenerated:{modules:[97722]},ssr:!1});e.s(["default",0,function(){let[e,t]=(0,s.useState)([]),[u,p]=(0,s.useState)(null),[m,h]=(0,s.useState)(!1),[_,f]=(0,s.useState)(!1),[x,g]=(0,s.useState)(!1),[j,y]=(0,s.useState)(!1),[b,v]=(0,s.useState)(!1),[w,k]=(0,s.useState)(!1),[C,S]=(0,s.useState)(""),N=e.find(e=>e.id===u),E=e.some(e=>("claude-docker"===e.type||"aider-docker"===e.type)&&"running"===e.status),P=e.some(e=>"claude-ssh"===e.type&&"running"===e.status),W=async()=>{try{let e=await fetch("/api/sessions"),a=await e.json();a.sessions&&t(a.sessions),a.originalCwd&&S(a.originalCwd)}catch(e){console.error("Failed to fetch sessions:",e)}};(0,s.useEffect)(()=>{(async()=>{await W()})();let e=setInterval(W,4e3);return()=>clearInterval(e)},[]);let T=async(e,a,s,t)=>{h(!0);try{let n=a;n||("claude"===e?n="Claude Local":"claude-docker"===e?n="Claude Docker":"claude-ssh"===e?n="Claude SSH":"aider"===e?n="Aider Local":"aider-docker"===e?n="Aider Docker":"mock"===e&&(n="Mock Session"));let l={type:e,name:n,workspaceRoot:s,scopedDirs:t};if(("aider"===e||"aider-docker"===e)&&!s)try{let e=await fetch("/api/context/aider");if(e.ok){let a=await e.json();a.success&&a.config&&(l.workspaceRoot=a.config.workspaceRoot,l.scopedDirs=a.config.scopedDirs)}}catch(e){console.error("Failed to load aider configuration before launch:",e)}let r=await fetch("/api/sessions/launch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)}),o=await r.json();o.success&&(await W(),p(o.session.id))}catch(e){console.error("Failed to launch session:",e)}finally{h(!1)}},L=async(e,a=!1)=>{try{let s=await fetch("/api/sessions/stop",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,delete:a})});(await s.json()).success&&(a&&u===e&&p(null),await W())}catch(e){console.error("Failed to stop session:",e)}};return(0,a.jsxs)("div",{className:`${n.default.container} ${N?n.default.containerActive:""}`,children:[(0,a.jsxs)("header",{className:n.default.header,children:[(0,a.jsxs)("div",{className:n.default.logoArea,children:[(0,a.jsx)("h1",{className:n.default.title,children:"NeuralLoom"}),(0,a.jsx)("span",{className:n.default.subtitle,children:"Unified AI Orchestrator & Context Bridge"})]}),(0,a.jsxs)("div",{className:n.default.statusIndicator,children:[(0,a.jsx)("span",{className:n.default.pulseDot}),(0,a.jsx)("span",{children:"Orchestrator Online"})]})]}),N?(0,a.jsx)("div",{style:{flex:1,minHeight:0,display:"flex",flexDirection:"column"},children:(0,a.jsx)(c,{sessionId:N.id,workspaceRoot:N.workspaceRoot||"",scopedDirs:N.scopedDirs||[],onClose:()=>p(null),sessions:e,onSwitchSession:e=>p(e),onRefreshSessions:W})}):(0,a.jsxs)("div",{className:n.default.dashboardGrid,children:[(0,a.jsxs)("main",{className:n.default.mainPanel,children:[(0,a.jsxs)("section",{children:[(0,a.jsx)("h2",{className:n.default.sectionTitle,children:"Active AI Agents"}),0===e.length?(0,a.jsxs)("div",{className:"card",style:{padding:"3rem 1.5rem",textAlign:"center"},children:[(0,a.jsx)("p",{style:{color:"var(--muted)",marginBottom:"1.5rem"},children:"No active agent sessions in this workspace. Launch a simulated session to verify the control bridge."}),(0,a.jsx)("button",{className:n.default.quickLaunchBtn,onClick:()=>T("mock"),disabled:m,style:{maxWidth:"240px",margin:"0 auto"},children:m?"Launching...":"⚡ Launch Simulated Session"})]}):(0,a.jsx)("div",{className:n.default.agentGrid,children:e.map(e=>(0,a.jsxs)("div",{className:`${n.default.agentCard} card ${u===e.id?n.default.activeBorder:""}`,children:[(0,a.jsxs)("div",{className:n.default.agentHeader,children:[(0,a.jsx)("span",{className:n.default.agentName,children:e.name}),(0,a.jsx)("span",{className:`${n.default.agentBadge} ${"stopped"===e.status?n.default.stoppedBadge:""}`,children:e.status})]}),(0,a.jsxs)("div",{className:n.default.cardBody,children:[(0,a.jsxs)("p",{style:{fontSize:"0.825rem",color:"var(--muted)"},children:["ID: ",(0,a.jsx)("code",{style:{fontSize:"0.75rem"},children:e.id.substring(0,8)}),(0,a.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,a.jsx)("br",{}),"Logs: ",e.logsCount," captured lines"]}),(0,a.jsxs)("div",{style:{display:"flex",gap:"0.5rem",marginTop:"1rem"},children:["running"===e.status?(0,a.jsx)("button",{onClick:()=>L(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,a.jsx)("button",{onClick:()=>L(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,a.jsx)("button",{onClick:()=>p(e.id),style:{flex:2,padding:"0.4rem 0.6rem",borderRadius:"6px",border:"none",backgroundColor:u===e.id?"var(--border-focus)":"var(--primary)",fontSize:"0.75rem",fontWeight:600,color:"#fff"},children:u===e.id?"Connected":"Open Session"})]})]})]},e.id))})]}),u&&(0,a.jsxs)("section",{className:"card",style:{display:"flex",flexDirection:"column",border:"1px solid var(--border-focus)"},children:[(0,a.jsxs)("div",{className:n.default.agentHeader,style:{justifyContent:"space-between",background:"rgba(109, 40, 217, 0.08)"},children:[(0,a.jsxs)("span",{style:{fontWeight:600,display:"flex",alignItems:"center",gap:"0.5rem"},children:["🖥️ Console Bridge — ",e.find(e=>e.id===u)?.name]}),(0,a.jsxs)("div",{style:{display:"flex",gap:"0.5rem",alignItems:"center"},children:[e.find(e=>e.id===u)?.status==="stopped"&&(0,a.jsx)("button",{onClick:async()=>{try{let e=await fetch("/api/sessions/start",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:u})});if(e.ok)await W();else{let a=await e.json();alert(a.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,a.jsx)("button",{onClick:()=>p(null),style:{border:"none",background:"none",color:"var(--muted)",cursor:"pointer",fontSize:"0.75rem"},children:"Close Panel ✖"})]})]}),(0,a.jsx)(l,{sessionId:u})]}),(0,a.jsxs)("section",{children:[(0,a.jsx)("h2",{className:n.default.sectionTitle,children:"Shared Context Hub & Slash Commands"}),(0,a.jsxs)("div",{className:n.default.contextList,children:[(0,a.jsxs)("div",{className:`${n.default.contextItem} card`,children:[(0,a.jsxs)("div",{className:n.default.contextMeta,children:[(0,a.jsx)("span",{className:n.default.contextTitle,children:"Staged Context & System Rules (/ccc)"}),(0,a.jsx)("span",{className:n.default.contextDetails,children:"Compiles AGENTS.md guidelines and project files folder hierarchy map."})]}),(0,a.jsx)("button",{onClick:async()=>{u&&await fetch("/api/sessions/inject",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:u,command:"/ccc"})})},disabled:!u,style:{padding:"0.4rem 0.8rem",borderRadius:"6px",border:"1px solid var(--primary)",backgroundColor:"transparent",color:"var(--primary)",fontSize:"0.75rem",fontWeight:600,opacity:u?1:.5,cursor:u?"pointer":"not-allowed"},children:"🚀 Mount Context (/ccc)"})]}),(0,a.jsxs)("div",{className:`${n.default.contextItem} card`,children:[(0,a.jsxs)("div",{className:n.default.contextMeta,children:[(0,a.jsx)("span",{className:n.default.contextTitle,children:"Staged Developer Prompt (/ccp)"}),(0,a.jsx)("span",{className:n.default.contextDetails,children:"Executes instructions written in .ai/neural-loom/cprompt.md."})]}),(0,a.jsx)("button",{onClick:async()=>{u&&await fetch("/api/sessions/inject",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:u,command:"/ccp"})})},disabled:!u,style:{padding:"0.4rem 0.8rem",borderRadius:"6px",border:"1px solid var(--success)",backgroundColor:"transparent",color:"var(--success)",fontSize:"0.75rem",fontWeight:600,opacity:u?1:.5,cursor:u?"pointer":"not-allowed"},children:"⚡ Trigger Prompt (/ccp)"})]})]}),(0,a.jsx)(r,{})]})]}),(0,a.jsxs)("aside",{className:n.default.sidePanel,children:[(0,a.jsxs)("section",{children:[(0,a.jsx)("h2",{className:n.default.sectionTitle,children:"Execution Environments"}),(0,a.jsxs)("div",{className:n.default.envGrid,children:[(0,a.jsxs)("div",{className:n.default.envRow,children:[(0,a.jsx)("span",{className:n.default.envName,children:"💻 Local host OS"}),(0,a.jsx)("span",{className:n.default.envStatus,style:{color:"var(--success)"},children:"Active"})]}),(0,a.jsxs)("div",{className:n.default.envRow,style:{opacity:E?1:.6},children:[(0,a.jsx)("span",{className:n.default.envName,children:"🐳 Docker Sandbox"}),(0,a.jsx)("span",{className:n.default.envStatus,style:{color:E?"var(--success)":"var(--muted)"},children:E?"Active":"Not Mounted"})]}),(0,a.jsxs)("div",{className:n.default.envRow,style:{opacity:P?1:.6},children:[(0,a.jsx)("span",{className:n.default.envName,children:"🌐 Remote VM (SSH)"}),(0,a.jsx)("span",{className:n.default.envStatus,style:{color:P?"var(--success)":"var(--muted)"},children:P?"Active":"Disconnected"})]})]})]}),(0,a.jsxs)("section",{style:{display:"flex",flexDirection:"column",gap:"0.75rem"},children:[(0,a.jsxs)("button",{className:n.default.quickLaunchBtn,onClick:()=>T("mock"),disabled:m,children:[(0,a.jsx)("span",{children:"⚡"}),(0,a.jsx)("span",{children:"Launch Mock Agent"})]}),(0,a.jsxs)("button",{className:n.default.quickLaunchBtn,onClick:()=>{k(!1),v(!0)},disabled:m,style:{background:"linear-gradient(135deg, hsl(262, 83%, 60%) 0%, hsl(195, 100%, 45%) 100%)",border:"none"},children:[(0,a.jsx)("span",{children:"🤖"}),(0,a.jsx)("span",{children:"Launch Claude PTY"})]}),(0,a.jsxs)("button",{className:n.default.quickLaunchBtn,onClick:()=>{k(!0),v(!0)},disabled:m,style:{background:"linear-gradient(135deg, hsl(170, 72%, 40%) 0%, hsl(195, 100%, 40%) 100%)",border:"none"},children:[(0,a.jsx)("span",{children:"🐳"}),(0,a.jsx)("span",{children:"Launch Docker PTY"})]}),(0,a.jsxs)("button",{className:n.default.quickLaunchBtn,onClick:()=>f(!0),disabled:m,style:{background:"linear-gradient(135deg, hsl(38, 92%, 50%) 0%, hsl(0, 84%, 60%) 100%)",border:"none"},children:[(0,a.jsx)("span",{children:"🌐"}),(0,a.jsx)("span",{children:"Launch SSH PTY"})]}),(0,a.jsxs)("button",{className:n.default.quickLaunchBtn,onClick:()=>{y(!1),g(!0)},disabled:m,style:{background:"linear-gradient(135deg, hsl(210, 80%, 45%) 0%, hsl(262, 80%, 55%) 100%)",border:"none"},children:[(0,a.jsx)("span",{children:"🐍"}),(0,a.jsx)("span",{children:"Launch Aider PTY"})]}),(0,a.jsxs)("button",{className:n.default.quickLaunchBtn,onClick:()=>{y(!0),g(!0)},disabled:m,style:{background:"linear-gradient(135deg, hsl(195, 100%, 40%) 0%, hsl(262, 80%, 55%) 100%)",border:"none"},children:[(0,a.jsx)("span",{children:"🐳"}),(0,a.jsx)("span",{children:"Launch Aider Docker"})]})]}),(0,a.jsxs)("section",{className:"card",style:{padding:"1.5rem",display:"flex",flexDirection:"column",gap:"0.75rem"},children:[(0,a.jsx)("h3",{style:{fontSize:"1rem",fontWeight:700},children:"Quick Actions"}),(0,a.jsxs)("ul",{style:{listStyle:"none",fontSize:"0.875rem",display:"flex",flexDirection:"column",gap:"0.5rem",color:"var(--muted)"},children:[(0,a.jsxs)("li",{style:{display:"flex",justifyContent:"space-between"},children:[(0,a.jsx)("span",{children:"Configure global API Keys"}),(0,a.jsx)("span",{style:{color:"var(--primary)",cursor:"pointer"},children:"→"})]}),(0,a.jsxs)("li",{style:{display:"flex",justifyContent:"space-between"},children:[(0,a.jsx)("span",{children:"Edit rules templates"}),(0,a.jsx)("span",{style:{color:"var(--primary)",cursor:"pointer"},children:"→"})]}),(0,a.jsxs)("li",{style:{display:"flex",justifyContent:"space-between"},children:[(0,a.jsx)("span",{children:"Inspect process locks"}),(0,a.jsx)("span",{style:{color:"var(--primary)",cursor:"pointer"},children:"→"})]})]})]})]})]}),(0,a.jsxs)("footer",{className:n.default.footer,children:[(0,a.jsx)("span",{children:"NeuralLoom v0.2.13 — Experimental AI Orchestrator Bridge"}),(0,a.jsxs)("span",{children:["Directory: ",C||"Loading..."]})]}),_&&(0,a.jsx)(o,{onClose:()=>f(!1),onConfirmLaunch:()=>{f(!1),T("claude-ssh")}}),x&&(0,a.jsx)(i,{onClose:()=>g(!1),isDocker:j,onConfirmLaunch:()=>{g(!1),T(j?"aider-docker":"aider")}}),b&&(0,a.jsx)(d,{onClose:()=>v(!1),isDocker:w,onConfirmLaunch:(e,a,s)=>{v(!1),T(w?"claude-docker":"claude",e,a,s)}})]})}])},33779,e=>{e.v(a=>Promise.all(["static/chunks/03g6xpslyid3~.js","static/chunks/06z14vx5drwj0.js","static/chunks/0ga14ztvrhau2.css"].map(a=>e.l(a))).then(()=>a(37314)))},39429,e=>{e.v(a=>Promise.all(["static/chunks/16w4~t4h7gk13.js"].map(a=>e.l(a))).then(()=>a(1985)))},56915,e=>{e.v(a=>Promise.all(["static/chunks/0lnobx4eh3~-_.js"].map(a=>e.l(a))).then(()=>a(99026)))},78716,e=>{e.v(a=>Promise.all(["static/chunks/0jxar8nsw_py3.js"].map(a=>e.l(a))).then(()=>a(9949)))},33789,e=>{e.v(a=>Promise.all(["static/chunks/0b89ti7ob.09t.js"].map(a=>e.l(a))).then(()=>a(20032)))},78003,e=>{e.v(a=>Promise.all(["static/chunks/0eidfx-s54367.js","static/chunks/06z14vx5drwj0.js","static/chunks/0cv9~vnm0atn4.js","static/chunks/0ga14ztvrhau2.css"].map(a=>e.l(a))).then(()=>a(97722)))}]);
|
package/.next/trace
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"name":"generate-buildid","duration":242,"timestamp":116202428050,"id":4,"parentId":1,"tags":{},"startTime":1781336938199,"traceId":"9e99489e5b6dfe49"},{"name":"load-custom-routes","duration":366,"timestamp":116202428412,"id":5,"parentId":1,"tags":{},"startTime":1781336938199,"traceId":"9e99489e5b6dfe49"},{"name":"create-dist-dir","duration":562,"timestamp":116202428811,"id":6,"parentId":1,"tags":{},"startTime":1781336938200,"traceId":"9e99489e5b6dfe49"},{"name":"clean","duration":485,"timestamp":116202430134,"id":7,"parentId":1,"tags":{},"startTime":1781336938201,"traceId":"9e99489e5b6dfe49"},{"name":"discover-routes","duration":8806,"timestamp":116202452509,"id":8,"parentId":1,"tags":{},"startTime":1781336938224,"traceId":"9e99489e5b6dfe49"},{"name":"create-root-mapping","duration":95,"timestamp":116202461387,"id":9,"parentId":1,"tags":{},"startTime":1781336938232,"traceId":"9e99489e5b6dfe49"},{"name":"generate-route-types","duration":16799,"timestamp":116202463346,"id":10,"parentId":1,"tags":{},"startTime":1781336938234,"traceId":"9e99489e5b6dfe49"},{"name":"public-dir-conflict-check","duration":88,"timestamp":116202480287,"id":11,"parentId":1,"tags":{},"startTime":1781336938251,"traceId":"9e99489e5b6dfe49"},{"name":"generate-routes-manifest","duration":2480,"timestamp":116202480477,"id":12,"parentId":1,"tags":{},"startTime":1781336938251,"traceId":"9e99489e5b6dfe49"},{"name":"run-turbopack","duration":2478438,"timestamp":116202490484,"id":14,"parentId":1,"tags":{},"startTime":1781336938262,"traceId":"9e99489e5b6dfe49"},{"name":"turbopack-build-events","duration":70,"timestamp":116202793308,"id":15,"parentId":1,"tags":{},"startTime":1781336938564,"traceId":"9e99489e5b6dfe49"},{"name":"run-typescript","duration":3593514,"timestamp":116204981999,"id":16,"parentId":1,"tags":{},"startTime":1781336940753,"traceId":"9e99489e5b6dfe49"},{"name":"generate-required-server-files","duration":1387,"timestamp":116208576324,"id":18,"parentId":1,"tags":{},"startTime":1781336944347,"traceId":"9e99489e5b6dfe49"},{"name":"check-static-error-page","duration":6185,"timestamp":116208691368,"id":20,"parentId":19,"tags":{},"startTime":1781336944462,"traceId":"9e99489e5b6dfe49"},{"name":"is-page-static","duration":516547,"timestamp":116208701537,"id":40,"parentId":22,"tags":{},"startTime":1781336944473,"traceId":"9e99489e5b6dfe49"},{"name":"check-page","duration":524505,"timestamp":116208693727,"id":22,"parentId":19,"tags":{"page":"/_global-error"},"startTime":1781336944465,"traceId":"9e99489e5b6dfe49"},{"name":"is-page-static","duration":626167,"timestamp":116208701656,"id":42,"parentId":24,"tags":{},"startTime":1781336944473,"traceId":"9e99489e5b6dfe49"},{"name":"check-page","duration":633849,"timestamp":116208694190,"id":24,"parentId":19,"tags":{"page":"/api/context/claude"},"startTime":1781336944465,"traceId":"9e99489e5b6dfe49"},{"name":"is-page-static","duration":645597,"timestamp":116208701958,"id":45,"parentId":27,"tags":{},"startTime":1781336944473,"traceId":"9e99489e5b6dfe49"},{"name":"check-page","duration":652826,"timestamp":116208694781,"id":27,"parentId":19,"tags":{"page":"/api/files"},"startTime":1781336944466,"traceId":"9e99489e5b6dfe49"},{"name":"is-page-static","duration":645984,"timestamp":116208701753,"id":44,"parentId":26,"tags":{},"startTime":1781336944473,"traceId":"9e99489e5b6dfe49"},{"name":"check-page","duration":653165,"timestamp":116208694596,"id":26,"parentId":19,"tags":{"page":"/api/context/ssh"},"startTime":1781336944466,"traceId":"9e99489e5b6dfe49"},{"name":"is-page-static","duration":646171,"timestamp":116208701705,"id":43,"parentId":25,"tags":{},"startTime":1781336944473,"traceId":"9e99489e5b6dfe49"},{"name":"check-page","duration":653512,"timestamp":116208694385,"id":25,"parentId":19,"tags":{"page":"/api/context"},"startTime":1781336944465,"traceId":"9e99489e5b6dfe49"},{"name":"is-page-static","duration":646936,"timestamp":116208702888,"id":55,"parentId":37,"tags":{},"startTime":1781336944474,"traceId":"9e99489e5b6dfe49"},{"name":"check-page","duration":652934,"timestamp":116208696932,"id":37,"parentId":19,"tags":{"page":"/favicon.ico"},"startTime":1781336944468,"traceId":"9e99489e5b6dfe49"},{"name":"is-page-static","duration":649006,"timestamp":116208702208,"id":47,"parentId":29,"tags":{},"startTime":1781336944473,"traceId":"9e99489e5b6dfe49"},{"name":"check-page","duration":656061,"timestamp":116208695185,"id":29,"parentId":19,"tags":{"page":"/api/recents"},"startTime":1781336944466,"traceId":"9e99489e5b6dfe49"},{"name":"is-page-static","duration":650696,"timestamp":116208702096,"id":46,"parentId":28,"tags":{},"startTime":1781336944473,"traceId":"9e99489e5b6dfe49"},{"name":"check-page","duration":657826,"timestamp":116208695000,"id":28,"parentId":19,"tags":{"page":"/api/git"},"startTime":1781336944466,"traceId":"9e99489e5b6dfe49"},{"name":"is-page-static","duration":653432,"timestamp":116208701316,"id":39,"parentId":21,"tags":{},"startTime":1781336944472,"traceId":"9e99489e5b6dfe49"},{"name":"check-page","duration":661961,"timestamp":116208692826,"id":21,"parentId":19,"tags":{"page":"/_not-found"},"startTime":1781336944464,"traceId":"9e99489e5b6dfe49"},{"name":"is-page-static","duration":654104,"timestamp":116208705822,"id":56,"parentId":38,"tags":{},"startTime":1781336944477,"traceId":"9e99489e5b6dfe49"},{"name":"check-page","duration":662678,"timestamp":116208697293,"id":38,"parentId":19,"tags":{"page":"/"},"startTime":1781336944468,"traceId":"9e99489e5b6dfe49"},{"name":"is-page-static","duration":660494,"timestamp":116208702755,"id":52,"parentId":34,"tags":{},"startTime":1781336944474,"traceId":"9e99489e5b6dfe49"},{"name":"check-page","duration":667224,"timestamp":116208696058,"id":34,"parentId":19,"tags":{"page":"/api/sessions/scope"},"startTime":1781336944467,"traceId":"9e99489e5b6dfe49"},{"name":"is-page-static","duration":661357,"timestamp":116208702628,"id":50,"parentId":32,"tags":{},"startTime":1781336944474,"traceId":"9e99489e5b6dfe49"},{"name":"check-page","duration":668285,"timestamp":116208695733,"id":32,"parentId":19,"tags":{"page":"/api/sessions/launch"},"startTime":1781336944467,"traceId":"9e99489e5b6dfe49"},{"name":"is-page-static","duration":661622,"timestamp":116208702544,"id":49,"parentId":31,"tags":{},"startTime":1781336944474,"traceId":"9e99489e5b6dfe49"},{"name":"check-page","duration":668624,"timestamp":116208695556,"id":31,"parentId":19,"tags":{"page":"/api/sessions/input"},"startTime":1781336944467,"traceId":"9e99489e5b6dfe49"},{"name":"is-page-static","duration":663663,"timestamp":116208702410,"id":48,"parentId":30,"tags":{},"startTime":1781336944473,"traceId":"9e99489e5b6dfe49"},{"name":"check-page","duration":670736,"timestamp":116208695364,"id":30,"parentId":19,"tags":{"page":"/api/sessions/inject"},"startTime":1781336944466,"traceId":"9e99489e5b6dfe49"},{"name":"is-page-static","duration":664878,"timestamp":116208701606,"id":41,"parentId":23,"tags":{},"startTime":1781336944473,"traceId":"9e99489e5b6dfe49"},{"name":"check-page","duration":672510,"timestamp":116208693990,"id":23,"parentId":19,"tags":{"page":"/api/context/aider"},"startTime":1781336944465,"traceId":"9e99489e5b6dfe49"},{"name":"is-page-static","duration":666929,"timestamp":116208702686,"id":51,"parentId":33,"tags":{},"startTime":1781336944474,"traceId":"9e99489e5b6dfe49"},{"name":"check-page","duration":673750,"timestamp":116208695889,"id":33,"parentId":19,"tags":{"page":"/api/sessions"},"startTime":1781336944467,"traceId":"9e99489e5b6dfe49"},{"name":"is-page-static","duration":667403,"timestamp":116208702854,"id":54,"parentId":36,"tags":{},"startTime":1781336944474,"traceId":"9e99489e5b6dfe49"},{"name":"check-page","duration":673555,"timestamp":116208696727,"id":36,"parentId":19,"tags":{"page":"/api/sessions/stop"},"startTime":1781336944468,"traceId":"9e99489e5b6dfe49"},{"name":"is-page-static","duration":668602,"timestamp":116208702811,"id":53,"parentId":35,"tags":{},"startTime":1781336944474,"traceId":"9e99489e5b6dfe49"},{"name":"check-page","duration":675108,"timestamp":116208696330,"id":35,"parentId":19,"tags":{"page":"/api/sessions/stats"},"startTime":1781336944467,"traceId":"9e99489e5b6dfe49"},{"name":"static-check","duration":680526,"timestamp":116208690931,"id":19,"parentId":1,"tags":{},"startTime":1781336944462,"traceId":"9e99489e5b6dfe49"},{"name":"write-routes-manifest","duration":843,"timestamp":116209372458,"id":58,"parentId":1,"tags":{},"startTime":1781336945143,"traceId":"9e99489e5b6dfe49"},{"name":"load-dotenv","duration":29,"timestamp":116209386808,"id":61,"parentId":60,"tags":{},"startTime":1781336945158,"traceId":"9e99489e5b6dfe49"},{"name":"run-export-path-map","duration":339,"timestamp":116209391124,"id":62,"parentId":60,"tags":{},"startTime":1781336945162,"traceId":"9e99489e5b6dfe49"},{"name":"next-export","duration":644233,"timestamp":116209386006,"id":60,"parentId":1,"tags":{},"startTime":1781336945157,"traceId":"9e99489e5b6dfe49"},{"name":"move-exported-app-not-found-","duration":1868,"timestamp":116210031668,"id":63,"parentId":59,"tags":{},"startTime":1781336945803,"traceId":"9e99489e5b6dfe49"},{"name":"move-exported-app-global-error-","duration":1316,"timestamp":116210033625,"id":64,"parentId":59,"tags":{},"startTime":1781336945805,"traceId":"9e99489e5b6dfe49"},{"name":"static-generation","duration":660529,"timestamp":116209377116,"id":59,"parentId":1,"tags":{},"startTime":1781336945148,"traceId":"9e99489e5b6dfe49"},{"name":"write-routes-manifest","duration":652,"timestamp":116210037739,"id":65,"parentId":1,"tags":{},"startTime":1781336945809,"traceId":"9e99489e5b6dfe49"},{"name":"print-tree-view","duration":2840,"timestamp":116210048491,"id":66,"parentId":1,"tags":{},"startTime":1781336945820,"traceId":"9e99489e5b6dfe49"},{"name":"write-route-bundle-stats","duration":10342,"timestamp":116210051362,"id":67,"parentId":1,"tags":{},"startTime":1781336945822,"traceId":"9e99489e5b6dfe49"},{"name":"telemetry-flush","duration":174661,"timestamp":116210061741,"id":68,"parentId":1,"tags":{},"startTime":1781336945833,"traceId":"9e99489e5b6dfe49"},{"name":"next-build","duration":7858859,"timestamp":116202377566,"id":1,"tags":{"buildMode":"default","version":"16.2.6","bundler":"turbopack","has-custom-webpack-config":"false","use-build-worker":"true"},"startTime":1781336938149,"traceId":"9e99489e5b6dfe49"}]
|
|
1
|
+
[{"name":"generate-buildid","duration":282,"timestamp":118007911269,"id":4,"parentId":1,"tags":{},"startTime":1781338743682,"traceId":"9cb8826ecd92b75b"},{"name":"load-custom-routes","duration":343,"timestamp":118007911664,"id":5,"parentId":1,"tags":{},"startTime":1781338743682,"traceId":"9cb8826ecd92b75b"},{"name":"create-dist-dir","duration":1906,"timestamp":118007912037,"id":6,"parentId":1,"tags":{},"startTime":1781338743683,"traceId":"9cb8826ecd92b75b"},{"name":"clean","duration":508,"timestamp":118007914735,"id":7,"parentId":1,"tags":{},"startTime":1781338743685,"traceId":"9cb8826ecd92b75b"},{"name":"discover-routes","duration":7369,"timestamp":118007936353,"id":8,"parentId":1,"tags":{},"startTime":1781338743707,"traceId":"9cb8826ecd92b75b"},{"name":"create-root-mapping","duration":59,"timestamp":118007943770,"id":9,"parentId":1,"tags":{},"startTime":1781338743714,"traceId":"9cb8826ecd92b75b"},{"name":"generate-route-types","duration":17441,"timestamp":118007945233,"id":10,"parentId":1,"tags":{},"startTime":1781338743716,"traceId":"9cb8826ecd92b75b"},{"name":"public-dir-conflict-check","duration":84,"timestamp":118007962798,"id":11,"parentId":1,"tags":{},"startTime":1781338743733,"traceId":"9cb8826ecd92b75b"},{"name":"generate-routes-manifest","duration":2186,"timestamp":118007962977,"id":12,"parentId":1,"tags":{},"startTime":1781338743734,"traceId":"9cb8826ecd92b75b"},{"name":"run-turbopack","duration":2289163,"timestamp":118007971439,"id":14,"parentId":1,"tags":{},"startTime":1781338743742,"traceId":"9cb8826ecd92b75b"},{"name":"turbopack-build-events","duration":64,"timestamp":118008264417,"id":15,"parentId":1,"tags":{},"startTime":1781338744035,"traceId":"9cb8826ecd92b75b"},{"name":"run-typescript","duration":3434329,"timestamp":118010272734,"id":16,"parentId":1,"tags":{},"startTime":1781338746043,"traceId":"9cb8826ecd92b75b"},{"name":"generate-required-server-files","duration":1351,"timestamp":118013707902,"id":18,"parentId":1,"tags":{},"startTime":1781338749478,"traceId":"9cb8826ecd92b75b"},{"name":"check-static-error-page","duration":7348,"timestamp":118013829609,"id":20,"parentId":19,"tags":{},"startTime":1781338749600,"traceId":"9cb8826ecd92b75b"},{"name":"is-page-static","duration":515970,"timestamp":118013841895,"id":41,"parentId":22,"tags":{},"startTime":1781338749612,"traceId":"9cb8826ecd92b75b"},{"name":"check-page","duration":525707,"timestamp":118013832279,"id":22,"parentId":19,"tags":{"page":"/_global-error"},"startTime":1781338749603,"traceId":"9cb8826ecd92b75b"},{"name":"is-page-static","duration":639263,"timestamp":118013842115,"id":43,"parentId":24,"tags":{},"startTime":1781338749613,"traceId":"9cb8826ecd92b75b"},{"name":"check-page","duration":648585,"timestamp":118013832862,"id":24,"parentId":19,"tags":{"page":"/api/context/claude"},"startTime":1781338749603,"traceId":"9cb8826ecd92b75b"},{"name":"is-page-static","duration":648704,"timestamp":118013842021,"id":42,"parentId":23,"tags":{},"startTime":1781338749613,"traceId":"9cb8826ecd92b75b"},{"name":"check-page","duration":658186,"timestamp":118013832592,"id":23,"parentId":19,"tags":{"page":"/api/context/aider"},"startTime":1781338749603,"traceId":"9cb8826ecd92b75b"},{"name":"is-page-static","duration":649657,"timestamp":118013842303,"id":45,"parentId":26,"tags":{},"startTime":1781338749613,"traceId":"9cb8826ecd92b75b"},{"name":"check-page","duration":658525,"timestamp":118013833481,"id":26,"parentId":19,"tags":{"page":"/api/context/ssh"},"startTime":1781338749604,"traceId":"9cb8826ecd92b75b"},{"name":"is-page-static","duration":654791,"timestamp":118013842209,"id":44,"parentId":25,"tags":{},"startTime":1781338749613,"traceId":"9cb8826ecd92b75b"},{"name":"check-page","duration":663932,"timestamp":118013833114,"id":25,"parentId":19,"tags":{"page":"/api/context"},"startTime":1781338749604,"traceId":"9cb8826ecd92b75b"},{"name":"is-page-static","duration":655914,"timestamp":118013842808,"id":47,"parentId":28,"tags":{},"startTime":1781338749613,"traceId":"9cb8826ecd92b75b"},{"name":"check-page","duration":664750,"timestamp":118013834019,"id":28,"parentId":19,"tags":{"page":"/api/git"},"startTime":1781338749605,"traceId":"9cb8826ecd92b75b"},{"name":"is-page-static","duration":658504,"timestamp":118013842927,"id":48,"parentId":29,"tags":{},"startTime":1781338749613,"traceId":"9cb8826ecd92b75b"},{"name":"check-page","duration":667255,"timestamp":118013834231,"id":29,"parentId":19,"tags":{"page":"/api/recents"},"startTime":1781338749605,"traceId":"9cb8826ecd92b75b"},{"name":"is-page-static","duration":662542,"timestamp":118013843513,"id":52,"parentId":33,"tags":{},"startTime":1781338749614,"traceId":"9cb8826ecd92b75b"},{"name":"check-page","duration":671071,"timestamp":118013835036,"id":33,"parentId":19,"tags":{"page":"/api/sessions"},"startTime":1781338749606,"traceId":"9cb8826ecd92b75b"},{"name":"is-page-static","duration":663896,"timestamp":118013847267,"id":58,"parentId":39,"tags":{},"startTime":1781338749618,"traceId":"9cb8826ecd92b75b"},{"name":"check-page","duration":674545,"timestamp":118013836663,"id":39,"parentId":19,"tags":{"page":"/"},"startTime":1781338749607,"traceId":"9cb8826ecd92b75b"},{"name":"is-page-static","duration":671435,"timestamp":118013843760,"id":56,"parentId":37,"tags":{},"startTime":1781338749614,"traceId":"9cb8826ecd92b75b"},{"name":"check-page","duration":679130,"timestamp":118013836117,"id":37,"parentId":19,"tags":{"page":"/api/sessions/stop"},"startTime":1781338749607,"traceId":"9cb8826ecd92b75b"},{"name":"is-page-static","duration":674171,"timestamp":118013841449,"id":40,"parentId":21,"tags":{},"startTime":1781338749612,"traceId":"9cb8826ecd92b75b"},{"name":"check-page","duration":684474,"timestamp":118013831188,"id":21,"parentId":19,"tags":{"page":"/_not-found"},"startTime":1781338749602,"traceId":"9cb8826ecd92b75b"},{"name":"is-page-static","duration":673413,"timestamp":118013844141,"id":57,"parentId":38,"tags":{},"startTime":1781338749615,"traceId":"9cb8826ecd92b75b"},{"name":"check-page","duration":681313,"timestamp":118013836300,"id":38,"parentId":19,"tags":{"page":"/favicon.ico"},"startTime":1781338749607,"traceId":"9cb8826ecd92b75b"},{"name":"is-page-static","duration":678441,"timestamp":118013843713,"id":55,"parentId":36,"tags":{},"startTime":1781338749614,"traceId":"9cb8826ecd92b75b"},{"name":"check-page","duration":686315,"timestamp":118013835895,"id":36,"parentId":19,"tags":{"page":"/api/sessions/stats"},"startTime":1781338749606,"traceId":"9cb8826ecd92b75b"},{"name":"is-page-static","duration":679345,"timestamp":118013843148,"id":49,"parentId":30,"tags":{},"startTime":1781338749614,"traceId":"9cb8826ecd92b75b"},{"name":"check-page","duration":688097,"timestamp":118013834431,"id":30,"parentId":19,"tags":{"page":"/api/sessions/inject"},"startTime":1781338749605,"traceId":"9cb8826ecd92b75b"},{"name":"is-page-static","duration":680072,"timestamp":118013842550,"id":46,"parentId":27,"tags":{},"startTime":1781338749613,"traceId":"9cb8826ecd92b75b"},{"name":"check-page","duration":688908,"timestamp":118013833738,"id":27,"parentId":19,"tags":{"page":"/api/files"},"startTime":1781338749604,"traceId":"9cb8826ecd92b75b"},{"name":"is-page-static","duration":681725,"timestamp":118013843663,"id":54,"parentId":35,"tags":{},"startTime":1781338749614,"traceId":"9cb8826ecd92b75b"},{"name":"check-page","duration":689938,"timestamp":118013835495,"id":35,"parentId":19,"tags":{"page":"/api/sessions/start"},"startTime":1781338749606,"traceId":"9cb8826ecd92b75b"},{"name":"is-page-static","duration":685057,"timestamp":118013843601,"id":53,"parentId":34,"tags":{},"startTime":1781338749614,"traceId":"9cb8826ecd92b75b"},{"name":"check-page","duration":693485,"timestamp":118013835212,"id":34,"parentId":19,"tags":{"page":"/api/sessions/scope"},"startTime":1781338749606,"traceId":"9cb8826ecd92b75b"},{"name":"is-page-static","duration":685674,"timestamp":118013843363,"id":51,"parentId":32,"tags":{},"startTime":1781338749614,"traceId":"9cb8826ecd92b75b"},{"name":"check-page","duration":694198,"timestamp":118013834859,"id":32,"parentId":19,"tags":{"page":"/api/sessions/launch"},"startTime":1781338749605,"traceId":"9cb8826ecd92b75b"},{"name":"is-page-static","duration":687810,"timestamp":118013843286,"id":50,"parentId":31,"tags":{},"startTime":1781338749614,"traceId":"9cb8826ecd92b75b"},{"name":"check-page","duration":696471,"timestamp":118013834656,"id":31,"parentId":19,"tags":{"page":"/api/sessions/input"},"startTime":1781338749605,"traceId":"9cb8826ecd92b75b"},{"name":"static-check","duration":702012,"timestamp":118013829142,"id":19,"parentId":1,"tags":{},"startTime":1781338749600,"traceId":"9cb8826ecd92b75b"},{"name":"write-routes-manifest","duration":825,"timestamp":118014532169,"id":60,"parentId":1,"tags":{},"startTime":1781338750303,"traceId":"9cb8826ecd92b75b"},{"name":"load-dotenv","duration":37,"timestamp":118014549398,"id":63,"parentId":62,"tags":{},"startTime":1781338750320,"traceId":"9cb8826ecd92b75b"},{"name":"run-export-path-map","duration":511,"timestamp":118014554631,"id":64,"parentId":62,"tags":{},"startTime":1781338750325,"traceId":"9cb8826ecd92b75b"},{"name":"next-export","duration":662660,"timestamp":118014548449,"id":62,"parentId":1,"tags":{},"startTime":1781338750319,"traceId":"9cb8826ecd92b75b"},{"name":"move-exported-app-not-found-","duration":2015,"timestamp":118015212509,"id":65,"parentId":61,"tags":{},"startTime":1781338750983,"traceId":"9cb8826ecd92b75b"},{"name":"move-exported-app-global-error-","duration":1369,"timestamp":118015214626,"id":66,"parentId":61,"tags":{},"startTime":1781338750985,"traceId":"9cb8826ecd92b75b"},{"name":"static-generation","duration":681180,"timestamp":118014537878,"id":61,"parentId":1,"tags":{},"startTime":1781338750308,"traceId":"9cb8826ecd92b75b"},{"name":"write-routes-manifest","duration":791,"timestamp":118015219174,"id":67,"parentId":1,"tags":{},"startTime":1781338750990,"traceId":"9cb8826ecd92b75b"},{"name":"print-tree-view","duration":2954,"timestamp":118015229447,"id":68,"parentId":1,"tags":{},"startTime":1781338751000,"traceId":"9cb8826ecd92b75b"},{"name":"write-route-bundle-stats","duration":16441,"timestamp":118015232437,"id":69,"parentId":1,"tags":{},"startTime":1781338751003,"traceId":"9cb8826ecd92b75b"},{"name":"telemetry-flush","duration":169841,"timestamp":118015248909,"id":70,"parentId":1,"tags":{},"startTime":1781338751019,"traceId":"9cb8826ecd92b75b"},{"name":"next-build","duration":7554364,"timestamp":118007864407,"id":1,"tags":{"buildMode":"default","version":"16.2.6","bundler":"turbopack","has-custom-webpack-config":"false","use-build-worker":"true"},"startTime":1781338743635,"traceId":"9cb8826ecd92b75b"}]
|
package/.next/trace-build
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"name":"run-turbopack","duration":
|
|
1
|
+
[{"name":"run-turbopack","duration":2289163,"timestamp":118007971439,"id":14,"parentId":1,"tags":{},"startTime":1781338743742,"traceId":"9cb8826ecd92b75b"},{"name":"turbopack-build-events","duration":64,"timestamp":118008264417,"id":15,"parentId":1,"tags":{},"startTime":1781338744035,"traceId":"9cb8826ecd92b75b"},{"name":"run-typescript","duration":3434329,"timestamp":118010272734,"id":16,"parentId":1,"tags":{},"startTime":1781338746043,"traceId":"9cb8826ecd92b75b"},{"name":"static-check","duration":702012,"timestamp":118013829142,"id":19,"parentId":1,"tags":{},"startTime":1781338749600,"traceId":"9cb8826ecd92b75b"},{"name":"static-generation","duration":681180,"timestamp":118014537878,"id":61,"parentId":1,"tags":{},"startTime":1781338750308,"traceId":"9cb8826ecd92b75b"},{"name":"telemetry-flush","duration":169841,"timestamp":118015248909,"id":70,"parentId":1,"tags":{},"startTime":1781338751019,"traceId":"9cb8826ecd92b75b"},{"name":"next-build","duration":7554364,"timestamp":118007864407,"id":1,"tags":{"buildMode":"default","version":"16.2.6","bundler":"turbopack","has-custom-webpack-config":"false","use-build-worker":"true"},"startTime":1781338743635,"traceId":"9cb8826ecd92b75b"}]
|
package/.next/types/routes.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Do not edit this file manually
|
|
3
3
|
|
|
4
4
|
type AppRoutes = "/"
|
|
5
|
-
type AppRouteHandlerRoutes = "/api/context" | "/api/context/aider" | "/api/context/claude" | "/api/context/ssh" | "/api/files" | "/api/git" | "/api/recents" | "/api/sessions" | "/api/sessions/inject" | "/api/sessions/input" | "/api/sessions/launch" | "/api/sessions/scope" | "/api/sessions/stats" | "/api/sessions/stop"
|
|
5
|
+
type AppRouteHandlerRoutes = "/api/context" | "/api/context/aider" | "/api/context/claude" | "/api/context/ssh" | "/api/files" | "/api/git" | "/api/recents" | "/api/sessions" | "/api/sessions/inject" | "/api/sessions/input" | "/api/sessions/launch" | "/api/sessions/scope" | "/api/sessions/start" | "/api/sessions/stats" | "/api/sessions/stop"
|
|
6
6
|
type PageRoutes = never
|
|
7
7
|
type LayoutRoutes = "/"
|
|
8
8
|
type RedirectRoutes = never
|
|
@@ -24,6 +24,7 @@ interface ParamMap {
|
|
|
24
24
|
"/api/sessions/input": {}
|
|
25
25
|
"/api/sessions/launch": {}
|
|
26
26
|
"/api/sessions/scope": {}
|
|
27
|
+
"/api/sessions/start": {}
|
|
27
28
|
"/api/sessions/stats": {}
|
|
28
29
|
"/api/sessions/stop": {}
|
|
29
30
|
}
|
package/.next/types/validator.ts
CHANGED
|
@@ -164,6 +164,15 @@ type RouteHandlerConfig<Route extends AppRouteHandlerRoutes = AppRouteHandlerRou
|
|
|
164
164
|
type __Unused = __Check
|
|
165
165
|
}
|
|
166
166
|
|
|
167
|
+
// Validate ../../src/app/api/sessions/start/route.ts
|
|
168
|
+
{
|
|
169
|
+
type __IsExpected<Specific extends RouteHandlerConfig<"/api/sessions/start">> = Specific
|
|
170
|
+
const handler = {} as typeof import("../../src/app/api/sessions/start/route.js")
|
|
171
|
+
type __Check = __IsExpected<typeof handler>
|
|
172
|
+
// @ts-ignore
|
|
173
|
+
type __Unused = __Check
|
|
174
|
+
}
|
|
175
|
+
|
|
167
176
|
// Validate ../../src/app/api/sessions/stats/route.ts
|
|
168
177
|
{
|
|
169
178
|
type __IsExpected<Specific extends RouteHandlerConfig<"/api/sessions/stats">> = Specific
|
package/package.json
CHANGED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { NextResponse } from "next/server";
|
|
2
|
+
import { SessionManager } from "@/lib/agents/SessionManager";
|
|
3
|
+
|
|
4
|
+
export async function POST(request: Request) {
|
|
5
|
+
try {
|
|
6
|
+
const body = await request.json();
|
|
7
|
+
const { id } = body;
|
|
8
|
+
|
|
9
|
+
if (!id) {
|
|
10
|
+
return NextResponse.json({ error: "Missing required field 'id'." }, { status: 400 });
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const manager = SessionManager.getInstance();
|
|
14
|
+
const success = await manager.startSession(id);
|
|
15
|
+
return NextResponse.json({ success });
|
|
16
|
+
} catch (error) {
|
|
17
|
+
const errorMessage = error instanceof Error ? error.message : "Unknown error";
|
|
18
|
+
return NextResponse.json({ error: errorMessage }, { status: 500 });
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -84,6 +84,7 @@ interface OpenFile {
|
|
|
84
84
|
|
|
85
85
|
export default function IdeLayout({ sessionId, workspaceRoot, scopedDirs, onClose, sessions, onSwitchSession, onRefreshSessions }: IdeLayoutProps) {
|
|
86
86
|
const scopedDirsStr = JSON.stringify(scopedDirs);
|
|
87
|
+
const activeSession = sessions.find(s => s.id === sessionId);
|
|
87
88
|
const [workspace, setWorkspace] = useState<WorkspaceData | null>(null);
|
|
88
89
|
const [scoped, setScoped] = useState<ScopedData[]>([]);
|
|
89
90
|
const [isBrowsingScope, setIsBrowsingScope] = useState(false);
|
|
@@ -1279,6 +1280,44 @@ export default function IdeLayout({ sessionId, workspaceRoot, scopedDirs, onClos
|
|
|
1279
1280
|
</span>
|
|
1280
1281
|
|
|
1281
1282
|
<div style={{ display: "flex", gap: "0.5rem", alignItems: "center" }}>
|
|
1283
|
+
{activeSession?.status === "stopped" && (
|
|
1284
|
+
<button
|
|
1285
|
+
onClick={async () => {
|
|
1286
|
+
try {
|
|
1287
|
+
const res = await fetch("/api/sessions/start", {
|
|
1288
|
+
method: "POST",
|
|
1289
|
+
headers: { "Content-Type": "application/json" },
|
|
1290
|
+
body: JSON.stringify({ id: sessionId }),
|
|
1291
|
+
});
|
|
1292
|
+
if (res.ok) {
|
|
1293
|
+
if (onRefreshSessions) {
|
|
1294
|
+
onRefreshSessions();
|
|
1295
|
+
}
|
|
1296
|
+
} else {
|
|
1297
|
+
const data = await res.json();
|
|
1298
|
+
alert(data.error || "Failed to restart session.");
|
|
1299
|
+
}
|
|
1300
|
+
} catch (err) {
|
|
1301
|
+
console.error("Failed to restart session:", err);
|
|
1302
|
+
alert("Network error: failed to restart session.");
|
|
1303
|
+
}
|
|
1304
|
+
}}
|
|
1305
|
+
style={{
|
|
1306
|
+
padding: "0.3rem 0.6rem",
|
|
1307
|
+
borderRadius: "4px",
|
|
1308
|
+
border: "1px solid #eab308",
|
|
1309
|
+
backgroundColor: "rgba(234, 179, 8, 0.15)",
|
|
1310
|
+
color: "#eab308",
|
|
1311
|
+
fontSize: "0.7rem",
|
|
1312
|
+
fontWeight: 600,
|
|
1313
|
+
cursor: "pointer",
|
|
1314
|
+
boxShadow: "0 0 8px rgba(234, 179, 8, 0.2)",
|
|
1315
|
+
}}
|
|
1316
|
+
title="Restart the stopped session process runner"
|
|
1317
|
+
>
|
|
1318
|
+
⚡ Restart Session
|
|
1319
|
+
</button>
|
|
1320
|
+
)}
|
|
1282
1321
|
{/* Split dropdown controller */}
|
|
1283
1322
|
<select
|
|
1284
1323
|
onChange={(e) => {
|
package/src/app/page.tsx
CHANGED
|
@@ -334,16 +334,54 @@ export default function Home() {
|
|
|
334
334
|
<span style={{ fontWeight: 600, display: "flex", alignItems: "center", gap: "0.5rem" }}>
|
|
335
335
|
🖥️ Console Bridge — {sessions.find(s => s.id === activeSessionId)?.name}
|
|
336
336
|
</span>
|
|
337
|
-
<
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
337
|
+
<div style={{ display: "flex", gap: "0.5rem", alignItems: "center" }}>
|
|
338
|
+
{sessions.find(s => s.id === activeSessionId)?.status === "stopped" && (
|
|
339
|
+
<button
|
|
340
|
+
onClick={async () => {
|
|
341
|
+
try {
|
|
342
|
+
const res = await fetch("/api/sessions/start", {
|
|
343
|
+
method: "POST",
|
|
344
|
+
headers: { "Content-Type": "application/json" },
|
|
345
|
+
body: JSON.stringify({ id: activeSessionId }),
|
|
346
|
+
});
|
|
347
|
+
if (res.ok) {
|
|
348
|
+
await fetchSessions();
|
|
349
|
+
} else {
|
|
350
|
+
const data = await res.json();
|
|
351
|
+
alert(data.error || "Failed to restart session.");
|
|
352
|
+
}
|
|
353
|
+
} catch (err) {
|
|
354
|
+
console.error("Failed to restart session:", err);
|
|
355
|
+
alert("Network error: failed to restart session.");
|
|
356
|
+
}
|
|
357
|
+
}}
|
|
358
|
+
style={{
|
|
359
|
+
padding: "0.2rem 0.5rem",
|
|
360
|
+
borderRadius: "4px",
|
|
361
|
+
border: "1px solid #eab308",
|
|
362
|
+
backgroundColor: "rgba(234, 179, 8, 0.15)",
|
|
363
|
+
color: "#eab308",
|
|
364
|
+
fontSize: "0.7rem",
|
|
365
|
+
fontWeight: 600,
|
|
366
|
+
cursor: "pointer",
|
|
367
|
+
boxShadow: "0 0 8px rgba(234, 179, 8, 0.2)",
|
|
368
|
+
}}
|
|
369
|
+
title="Restart the stopped session process runner"
|
|
370
|
+
>
|
|
371
|
+
⚡ Restart Session
|
|
372
|
+
</button>
|
|
373
|
+
)}
|
|
374
|
+
<button
|
|
375
|
+
onClick={() => setActiveSessionId(null)}
|
|
376
|
+
style={{
|
|
377
|
+
border: "none",
|
|
378
|
+
background: "none",
|
|
379
|
+
color: "var(--muted)",
|
|
380
|
+
cursor: "pointer",
|
|
381
|
+
fontSize: "0.75rem"
|
|
382
|
+
}}
|
|
383
|
+
>Close Panel ✖</button>
|
|
384
|
+
</div>
|
|
347
385
|
</div>
|
|
348
386
|
<TerminalConsole sessionId={activeSessionId} />
|
|
349
387
|
</section>
|
|
@@ -59,7 +59,7 @@ export class SessionManager {
|
|
|
59
59
|
if (!SessionManager.instance) {
|
|
60
60
|
SessionManager.instance = new SessionManager();
|
|
61
61
|
// Initialize WebSocket gateway server on port 3001
|
|
62
|
-
initWebSocketServer(3001);
|
|
62
|
+
initWebSocketServer(3001, (id) => SessionManager.getInstance().getSession(id));
|
|
63
63
|
}
|
|
64
64
|
return SessionManager.instance;
|
|
65
65
|
}
|
|
@@ -162,6 +162,14 @@ export class SessionManager {
|
|
|
162
162
|
}
|
|
163
163
|
}
|
|
164
164
|
|
|
165
|
+
public async startSession(id: string): Promise<boolean> {
|
|
166
|
+
const runner = this.sessions.get(id);
|
|
167
|
+
if (!runner) return false;
|
|
168
|
+
await runner.start();
|
|
169
|
+
SessionPersister.saveSession(runner, true);
|
|
170
|
+
return true;
|
|
171
|
+
}
|
|
172
|
+
|
|
165
173
|
public async stopSession(id: string): Promise<boolean> {
|
|
166
174
|
const runner = this.sessions.get(id);
|
|
167
175
|
if (!runner) return false;
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import { WebSocketServer, WebSocket } from "ws";
|
|
2
|
-
import {
|
|
2
|
+
import { AgentRunner } from "./AgentRunner";
|
|
3
3
|
|
|
4
4
|
declare global {
|
|
5
5
|
var wss: WebSocketServer | undefined;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
let getSessionCallback: ((id: string) => AgentRunner | undefined) | null = null;
|
|
9
|
+
|
|
10
|
+
export function initWebSocketServer(port = 3001, getSession?: (id: string) => AgentRunner | undefined) {
|
|
11
|
+
if (getSession) {
|
|
12
|
+
getSessionCallback = getSession;
|
|
13
|
+
}
|
|
9
14
|
// Prevent duplicate WebSocket servers during hot reloads in development
|
|
10
15
|
if (global.wss) {
|
|
11
16
|
console.log("[WebSocketServer] WebSocket Server already active on port 3001 (cached).");
|
|
@@ -16,6 +21,9 @@ export function initWebSocketServer(port = 3001) {
|
|
|
16
21
|
|
|
17
22
|
try {
|
|
18
23
|
const wss = new WebSocketServer({ port });
|
|
24
|
+
wss.on("error", (err) => {
|
|
25
|
+
console.error("[WebSocketServer] WebSocket server error:", err);
|
|
26
|
+
});
|
|
19
27
|
global.wss = wss;
|
|
20
28
|
|
|
21
29
|
wss.on("connection", (ws: WebSocket & { sessionId?: string }) => {
|
|
@@ -32,8 +40,7 @@ export function initWebSocketServer(port = 3001) {
|
|
|
32
40
|
// Client handshake to establish connection to a specific session
|
|
33
41
|
if (msg.type === "handshake") {
|
|
34
42
|
const { sessionId } = msg;
|
|
35
|
-
const
|
|
36
|
-
const session = manager.getSession(sessionId);
|
|
43
|
+
const session = getSessionCallback ? getSessionCallback(sessionId) : null;
|
|
37
44
|
|
|
38
45
|
if (session) {
|
|
39
46
|
activeSessionId = sessionId;
|
|
@@ -63,8 +70,7 @@ export function initWebSocketServer(port = 3001) {
|
|
|
63
70
|
|
|
64
71
|
// User terminal input routing
|
|
65
72
|
if (msg.type === "input" && activeSessionId) {
|
|
66
|
-
const
|
|
67
|
-
const session = manager.getSession(activeSessionId);
|
|
73
|
+
const session = getSessionCallback ? getSessionCallback(activeSessionId) : null;
|
|
68
74
|
if (session && session.status === "running") {
|
|
69
75
|
if (session.type === "mock") {
|
|
70
76
|
// Buffer input for simulated command parsing in MockRunner
|
|
@@ -93,8 +99,7 @@ export function initWebSocketServer(port = 3001) {
|
|
|
93
99
|
// User terminal resize routing
|
|
94
100
|
if (msg.type === "resize" && activeSessionId) {
|
|
95
101
|
const { cols, rows } = msg;
|
|
96
|
-
const
|
|
97
|
-
const session = manager.getSession(activeSessionId);
|
|
102
|
+
const session = getSessionCallback ? getSessionCallback(activeSessionId) : null;
|
|
98
103
|
if (session) {
|
|
99
104
|
session.resize(cols, rows);
|
|
100
105
|
}
|
|
@@ -106,8 +111,7 @@ export function initWebSocketServer(port = 3001) {
|
|
|
106
111
|
|
|
107
112
|
ws.on("close", () => {
|
|
108
113
|
if (activeSessionId && outputListener) {
|
|
109
|
-
const
|
|
110
|
-
const session = manager.getSession(activeSessionId);
|
|
114
|
+
const session = getSessionCallback ? getSessionCallback(activeSessionId) : null;
|
|
111
115
|
if (session) {
|
|
112
116
|
session.offOutput(outputListener);
|
|
113
117
|
}
|