neural-loom 0.2.7 → 0.2.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +3 -3
  3. package/.next/cache/.previewinfo +1 -1
  4. package/.next/cache/.rscinfo +1 -1
  5. package/.next/cache/.tsbuildinfo +1 -1
  6. package/.next/diagnostics/route-bundle-stats.json +2 -2
  7. package/.next/fallback-build-manifest.json +3 -3
  8. package/.next/prerender-manifest.json +3 -3
  9. package/.next/server/app/_global-error.html +1 -1
  10. package/.next/server/app/_global-error.rsc +1 -1
  11. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  12. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  13. package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  14. package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  15. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  16. package/.next/server/app/_not-found.html +1 -1
  17. package/.next/server/app/_not-found.rsc +1 -1
  18. package/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
  19. package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  20. package/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
  21. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  22. package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  23. package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  24. package/.next/server/app/api/context/aider/route.js.nft.json +1 -1
  25. package/.next/server/app/api/context/claude/route.js.nft.json +1 -1
  26. package/.next/server/app/api/context/ssh/route.js.nft.json +1 -1
  27. package/.next/server/app/index.html +1 -1
  28. package/.next/server/app/index.rsc +3 -3
  29. package/.next/server/app/index.segments/__PAGE__.segment.rsc +3 -3
  30. package/.next/server/app/index.segments/_full.segment.rsc +3 -3
  31. package/.next/server/app/index.segments/_head.segment.rsc +1 -1
  32. package/.next/server/app/index.segments/_index.segment.rsc +1 -1
  33. package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  34. package/.next/server/app/page/react-loadable-manifest.json +1 -1
  35. package/.next/server/app/page_client-reference-manifest.js +1 -1
  36. package/.next/server/chunks/[root-of-the-server]__0d0pykb._.js +8 -8
  37. package/.next/server/chunks/[root-of-the-server]__0d0pykb._.js.map +1 -1
  38. package/.next/server/chunks/[root-of-the-server]__0ezygp7._.js +5 -5
  39. package/.next/server/chunks/[root-of-the-server]__0ezygp7._.js.map +1 -1
  40. package/.next/server/chunks/[root-of-the-server]__0k6w___._.js +2 -2
  41. package/.next/server/chunks/[root-of-the-server]__0k6w___._.js.map +1 -1
  42. package/.next/server/chunks/[root-of-the-server]__0m7xwu2._.js +2 -2
  43. package/.next/server/chunks/[root-of-the-server]__0m7xwu2._.js.map +1 -1
  44. package/.next/server/chunks/[root-of-the-server]__0rd5ojc._.js +5 -5
  45. package/.next/server/chunks/[root-of-the-server]__0rd5ojc._.js.map +1 -1
  46. package/.next/server/chunks/[root-of-the-server]__0tl2n51._.js +5 -5
  47. package/.next/server/chunks/[root-of-the-server]__0tl2n51._.js.map +1 -1
  48. package/.next/server/chunks/[root-of-the-server]__0y-63z8._.js +2 -2
  49. package/.next/server/chunks/[root-of-the-server]__0y-63z8._.js.map +1 -1
  50. package/.next/server/chunks/[root-of-the-server]__12-x1lx._.js +5 -5
  51. package/.next/server/chunks/[root-of-the-server]__12-x1lx._.js.map +1 -1
  52. package/.next/server/chunks/ssr/_0t7oqy6._.js +1 -1
  53. package/.next/server/chunks/ssr/_0t7oqy6._.js.map +1 -1
  54. package/.next/server/middleware-build-manifest.js +3 -3
  55. package/.next/server/pages/404.html +1 -1
  56. package/.next/server/pages/500.html +1 -1
  57. package/.next/server/server-reference-manifest.js +1 -1
  58. package/.next/server/server-reference-manifest.json +1 -1
  59. package/.next/static/chunks/0.fe1iw3rves5.js +1 -0
  60. package/.next/static/chunks/0ayrw9yot-bjb.js +1 -0
  61. package/.next/static/chunks/{0q4suv6uexpud.css → 0pp.lp89pntpv.css} +1 -1
  62. package/.next/trace +1 -1
  63. package/.next/trace-build +1 -1
  64. package/package.json +1 -1
  65. package/src/app/components/IdeLayout.tsx +4 -2
  66. package/src/app/page.module.css +9 -0
  67. package/src/app/page.tsx +3 -3
  68. package/src/lib/agents/AiderRunner.ts +2 -2
  69. package/src/lib/agents/ClaudeRunner.ts +1 -1
  70. package/src/lib/agents/ContextManager.ts +10 -8
  71. package/src/lib/agents/DockerRunner.ts +1 -1
  72. package/src/lib/agents/SSHRunner.ts +2 -2
  73. package/src/lib/agents/SessionManager.ts +1 -1
  74. package/src/lib/agents/SessionPersister.ts +3 -1
  75. package/.next/static/chunks/0xq6bhmghl02_.js +0 -1
  76. package/.next/static/chunks/0~v3l-a32te59.js +0 -1
  77. /package/.next/static/{AX92TjDUTzX6JISwse3gN → Zdg5QHFrz2LSBAcINdqar}/_buildManifest.js +0 -0
  78. /package/.next/static/{AX92TjDUTzX6JISwse3gN → Zdg5QHFrz2LSBAcINdqar}/_clientMiddlewareManifest.js +0 -0
  79. /package/.next/static/{AX92TjDUTzX6JISwse3gN → Zdg5QHFrz2LSBAcINdqar}/_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);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)"},i={width:"50px",backgroundColor:"#030406",borderRight:"1px solid var(--border)",display:"flex",flexDirection:"column",justifyContent:"space-between",alignItems:"center",padding:"0.75rem 0"},l={display:"flex",flexDirection:"column",width:"100%",gap:"0.5rem"},a={width:"100%",height:"45px",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",fontSize:"1.25rem",transition:"all 0.15s ease"},s={width:"260px",backgroundColor:"#080c14",borderRight:"1px solid var(--border)",display:"flex",flexDirection:"column",overflow:"hidden"},d={padding:"0.75rem 1rem",borderBottom:"1px solid var(--border)",display:"flex",alignItems:"center",justifyContent:"space-between",background:"rgba(255,255,255,0.02)"},c={flex:1,overflowY:"auto",padding:"0.75rem 0"},p={padding:"0.25rem 1rem",fontSize:"0.75rem",fontWeight:700,color:"var(--muted)",display:"flex",alignItems:"center",justifyContent:"space-between",textTransform:"uppercase",letterSpacing:"0.05em"},m={fontSize:"0.6rem",backgroundColor:"rgba(59, 130, 246, 0.1)",color:"#3b82f6",padding:"0.1rem 0.3rem",borderRadius:"3px",textTransform:"none",letterSpacing:"normal"},u={fontSize:"0.75rem",fontWeight:600,color:"var(--foreground)"},f={flex:1,display:"flex",flexDirection:"column",overflow:"hidden",backgroundColor:"#0b101b"},h={flex:1,display:"flex",flexDirection:"column",borderBottom:"1px solid var(--border)",overflow:"hidden"},g={height:"35px",backgroundColor:"#05070a",borderBottom:"1px solid var(--border)",display:"flex",alignItems:"center",justifyContent:"space-between",paddingRight:"0.75rem"},x={display:"flex",height:"100%",overflowX:"auto"},y={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"},b={fontSize:"0.65rem",color:"var(--muted)",cursor:"pointer",padding:"2px"},v={color:"var(--primary)",fontSize:"0.65rem",marginLeft:"2px"},j={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},C={flex:1,position:"relative",overflow:"hidden"},w={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},S={display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100%",color:"var(--muted)",textAlign:"center",padding:"2rem"},k={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)"},T={padding:"0.3rem 0.6rem",borderRadius:"4px",border:"1px solid var(--primary)",backgroundColor:"transparent",color:"var(--primary)",fontSize:"0.7rem",fontWeight:600,cursor:"pointer"},R={padding:"0.3rem 0.6rem",borderRadius:"4px",border:"1px solid var(--success)",backgroundColor:"transparent",color:"var(--success)",fontSize:"0.7rem",fontWeight:600,cursor:"pointer"},I={flex:1,overflow:"hidden"};function P({node:e,onSelect:o,onCreate:n,onRename:i,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,()=>n(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,()=>n(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,()=>i(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)(P,{node:e,onSelect:o,onCreate:n,onRename:i,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,()=>i(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 F={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)"},W={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)"},L={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"},O={backgroundColor:"transparent",border:"1px solid var(--border)",color:"var(--foreground)",padding:"0.5rem 1rem",borderRadius:"6px",fontSize:"0.8rem",fontWeight:600,cursor:"pointer"},E={backgroundColor:"var(--primary)",border:"none",color:"#ffffff",padding:"0.5rem 1rem",borderRadius:"6px",fontSize:"0.8rem",fontWeight:600,cursor:"pointer"},M={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"},N={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"},$={maxHeight:"300px",overflowY:"auto",padding:"0.25rem 0"},A={display:"flex",alignItems:"center",padding:"0.5rem 1rem",cursor:"pointer",transition:"all 0.1s ease",justifyContent:"space-between"},V={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"},J={fontSize:"0.6rem",color:"var(--muted)",textTransform:"uppercase"},K={fontSize:"1.1rem",fontWeight:700,fontFamily:"var(--font-mono)"},_={width:"100%",height:"6px",backgroundColor:"rgba(255,255,255,0.05)",borderRadius:"3px",overflow:"hidden"},H={height:"100%",borderRadius:"3px",transition:"width 0.5s ease-out"},Y={padding:"0.35rem 1rem",borderBottom:"1px solid var(--border)",backgroundColor:"#030406",display:"flex",alignItems:"center",gap:"0.75rem",flexWrap:"nowrap",overflowX:"auto"},X={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"},G={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:q,scopedDirs:Z,onClose:ee,sessions:et,onSwitchSession:er}){let eo=JSON.stringify(Z),[en,ei]=(0,r.useState)(null),[el,ea]=(0,r.useState)([]),[es,ed]=(0,r.useState)({}),[ec,ep]=(0,r.useState)({}),em=es[e]||[],eu=ec[e]||null,ef=(0,r.useCallback)(t=>{ed(r=>{let o=r[e]||[],n="function"==typeof t?t(o):t;return{...r,[e]:n}})},[e]),eh=(0,r.useCallback)(t=>{ep(r=>({...r,[e]:t}))},[e]),[eg,ex]=(0,r.useState)(!0),[ey,eb]=(0,r.useState)("explorer"),[ev,ej]=(0,r.useState)(!1),[eC,ew]=(0,r.useState)([]),[eS,ek]=(0,r.useState)(!1),[ez,eT]=(0,r.useState)(!1),[eR,eI]=(0,r.useState)(null),[eP,eF]=(0,r.useState)(null),[eW,eL]=(0,r.useState)(""),[eD,eO]=(0,r.useState)([]),[eE,eM]=(0,r.useState)(""),[eB,eU]=(0,r.useState)(""),[eN,e$]=(0,r.useState)(null),eA=(0,r.useCallback)(async()=>{await new Promise(e=>setTimeout(e,0)),eT(!0);try{let e=await fetch(`/api/git?action=status&root=${encodeURIComponent(q)}`);if(e.ok){let t=await e.json();t.success&&(ek(t.isGit),ew(t.files||[]))}}catch(e){console.error("Failed to load git status:",e)}finally{eT(!1)}},[q]);(0,r.useEffect)(()=>{setTimeout(()=>{eA()},0);let e=setInterval(eA,5e3);return()=>clearInterval(e)},[eA]),(0,r.useEffect)(()=>{let t=async()=>{try{let t=await fetch(`/api/sessions?id=${e}`);if(t.ok){let e=await t.json();eI(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();eF(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(()=>{eO(t)},0)}catch{}},[]);let eV=e=>{eO(e),localStorage.setItem("neural_loom_custom_commands",JSON.stringify(e))},eJ=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)}},eK=eR?.type?.includes("aider"),[e_,eH]=(0,r.useState)({type:null,targetPath:null,inputValue:"",error:null}),[eY,eX]=(0,r.useState)(!1),[eG,eQ]=(0,r.useState)(""),[eq,eZ]=(0,r.useState)([]),[e0,e5]=(0,r.useState)(0),e1=(0,r.useCallback)(async()=>{await new Promise(e=>setTimeout(e,0)),ej(!0);try{let e=Z&&Z.length>0?`&scoped=${encodeURIComponent(Z.join(","))}`:"",t=await fetch(`/api/files?action=list&root=${encodeURIComponent(q)}${e}`);if(t.ok){let e=await t.json();e.success&&(ei(e.workspace),ea(e.scoped||[]))}}catch(e){console.error("Failed to load file explorer:",e)}finally{ej(!1)}},[q,eo]);(0,r.useEffect)(()=>{setTimeout(()=>{e1()},0)},[e1]);let e2=(e,t)=>{eH({type:"file"===t?"create-file":"create-folder",targetPath:e,inputValue:"",error:null})},e7=e=>{let t=e.split(/[/\\]/).pop()||"";eH({type:"rename",targetPath:e,inputValue:t,error:null})},e8=e=>{eH({type:"delete",targetPath:e,inputValue:"",error:null})},e6=async e=>{if(e&&e.preventDefault(),e_.type&&e_.targetPath){eH(e=>({...e,error:null}));try{if("create-file"===e_.type||"create-folder"===e_.type){if(!e_.inputValue.trim())return void eH(e=>({...e,error:"Name cannot be empty"}));let e=`${e_.targetPath}/${e_.inputValue.trim()}`,t="create-file"===e_.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?(eH({type:null,targetPath:null,inputValue:"",error:null}),await e1(),"file"===t&&await e4(e)):eH(e=>({...e,error:o.error||"Failed to create item"}))}else{let e=await r.json();eH(t=>({...t,error:e.error||"Failed to create item"}))}}if("rename"===e_.type){if(!e_.inputValue.trim())return void eH(e=>({...e,error:"Name cannot be empty"}));let e=e_.targetPath.replace(/\\/g,"/"),t=e.substring(0,e.lastIndexOf("/")),r=t?`${t}/${e_.inputValue.trim()}`:e_.inputValue.trim(),o=await fetch("/api/files",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"rename",oldPath:e_.targetPath,newPath:r})});if(o.ok){let e=await o.json();e.success?(ef(e=>e.map(e=>e.path===e_.targetPath?{...e,path:r,name:e_.inputValue.trim()}:e)),eu===e_.targetPath&&eh(r),eH({type:null,targetPath:null,inputValue:"",error:null}),await e1()):eH(t=>({...t,error:e.error||"Failed to rename item"}))}else{let e=await o.json();eH(t=>({...t,error:e.error||"Failed to rename item"}))}}if("delete"===e_.type){let e=await fetch("/api/files",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"delete",path:e_.targetPath})});if(e.ok){let t=await e.json();t.success?(e9(e_.targetPath),eH({type:null,targetPath:null,inputValue:"",error:null}),await e1()):eH(e=>({...e,error:t.error||"Failed to delete item"}))}else{let t=await e.json();eH(e=>({...e,error:t.error||"Failed to delete item"}))}}}catch(e){console.error("File operation failed:",e),eH(e=>({...e,error:"An unexpected error occurred"}))}}},e3=(0,r.useCallback)(async()=>{try{let e=Z&&Z.length>0?`&scoped=${encodeURIComponent(Z.join(","))}`:"",t=await fetch(`/api/files?action=flat_list&root=${encodeURIComponent(q)}${e}`);if(t.ok){let e=await t.json();e.success&&e.files&&eZ(e.files)}}catch(e){console.error("Failed to load flat files list:",e)}},[q,eo]);(0,r.useEffect)(()=>{eY&&setTimeout(()=>{eQ(""),e5(0),e3()},0)},[eY,e3]);let e4=async e=>{if(em.find(t=>t.path===e))return void eh(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};ef([...em,t]),eh(e)}}}catch(t){console.error(`Failed to read file ${e}:`,t)}},e9=e=>{let t=em.filter(t=>t.path!==e);ef(t),eu===e&&eh(t.length>0?t[t.length-1].path:null)},te=em.find(e=>e.path===eu),tt=(0,r.useCallback)(async()=>{if(te)try{(await fetch("/api/files",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"write",path:te.path,content:te.content})})).ok&&ef(e=>e.map(e=>e.path===eu?{...e,isModified:!1}:e))}catch(e){console.error(`Failed to save file ${te.path}:`,e)}},[te,eu,ef]);(0,r.useEffect)(()=>{let e=e=>{(e.ctrlKey||e.metaKey)&&"s"===e.key&&(e.preventDefault(),tt()),(e.ctrlKey||e.metaKey)&&"p"===e.key&&(e.preventDefault(),eX(e=>!e))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[tt]);let tr=eq.filter(e=>e.name.toLowerCase().includes(eG.toLowerCase())||e.relativePath.toLowerCase().includes(eG.toLowerCase())).slice(0,10);return(0,t.jsxs)("div",{style:n,children:[(0,t.jsxs)("div",{style:i,children:[(0,t.jsxs)("div",{style:l,children:[(0,t.jsx)("div",{onClick:()=>{"explorer"===ey?ex(!eg):(eb("explorer"),ex(!0))},style:{...a,backgroundColor:"explorer"===ey&&eg?"rgba(255,255,255,0.08)":"transparent",borderLeft:"explorer"===ey&&eg?"2px solid var(--primary)":"2px solid transparent"},title:"File Explorer (Ctrl+P to search files)",children:"📁"}),(0,t.jsx)("div",{onClick:()=>{"git"===ey?ex(!eg):(eb("git"),ex(!0))},style:{...a,backgroundColor:"git"===ey&&eg?"rgba(255,255,255,0.08)":"transparent",borderLeft:"git"===ey&&eg?"2px solid var(--primary)":"2px solid transparent"},title:"Source Control (Git Changes)",children:"🌿"}),(0,t.jsx)("div",{onClick:()=>{"analytics"===ey?ex(!eg):(eb("analytics"),ex(!0))},style:{...a,backgroundColor:"analytics"===ey&&eg?"rgba(255,255,255,0.08)":"transparent",borderLeft:"analytics"===ey&&eg?"2px solid var(--primary)":"2px solid transparent"},title:"Token Usage & Cost Analytics",children:"📊"}),(0,t.jsx)("div",{onClick:()=>{"auditor"===ey?ex(!eg):(eb("auditor"),ex(!0))},style:{...a,backgroundColor:"auditor"===ey&&eg?"rgba(255,255,255,0.08)":"transparent",borderLeft:"auditor"===ey&&eg?"2px solid var(--primary)":"2px solid transparent"},title:"Session Log Auditor & Search",children:"🔍"})]}),(0,t.jsx)("div",{onClick:ee,style:{...a,color:"var(--danger)",fontSize:"1rem"},title:"Exit Session Layout",children:"✖"})]}),eg&&(0,t.jsxs)("div",{style:s,children:[(0,t.jsxs)("div",{style:d,children:[(0,t.jsxs)("span",{style:{fontWeight:700,fontSize:"0.75rem",textTransform:"uppercase",letterSpacing:"0.05em"},children:["explorer"===ey&&"Workspace Explorer","git"===ey&&"Source Control","analytics"===ey&&"Telemetry & Cost","auditor"===ey&&"Session Auditor"]}),"explorer"===ey&&(0,t.jsxs)("div",{style:{display:"flex",gap:"0.25rem"},children:[en&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{onClick:()=>e2(en.path,"file"),style:M,title:"New File at Root...",children:"📄+"}),(0,t.jsx)("button",{onClick:()=>e2(en.path,"directory"),style:M,title:"New Folder at Root...",children:"📁+"})]}),(0,t.jsx)("button",{onClick:e1,disabled:ev,style:M,title:"Refresh tree",children:"🔄"})]}),"git"===ey&&(0,t.jsx)("button",{onClick:eA,disabled:ez,style:M,title:"Refresh git status",children:"🔄"})]}),(0,t.jsxs)("div",{style:c,children:["explorer"===ey&&(0,t.jsxs)(t.Fragment,{children:[en?(0,t.jsxs)("div",{style:{marginBottom:"1.5rem"},children:[(0,t.jsxs)("div",{style:p,children:["💼 ",en.name," ",(0,t.jsx)("span",{style:m,title:en.path,children:"root"})]}),(0,t.jsx)("div",{style:{padding:"0.25rem 0.5rem"},children:en.tree.map(e=>(0,t.jsx)(P,{node:e,onSelect:e4,onCreate:e2,onRename:e7,onDelete:e8,isReadOnly:!1},e.path))})]}):(0,t.jsx)("div",{style:{padding:"1rem",color:"var(--muted)",fontSize:"0.8rem"},children:"Scanning Workspace directory..."}),el.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{style:{...p,borderTop:"1px solid var(--border)",paddingTop:"1rem"},children:["🔍 Scoped Folders (",el.length,")"]}),el.map(e=>(0,t.jsxs)("div",{style:{marginTop:"0.75rem",padding:"0 0.5rem"},children:[(0,t.jsxs)("div",{style:{...u,display:"flex",gap:"0.25rem",color:"#a855f7",fontSize:"0.75rem",fontWeight:700,padding:"0.25rem"},title:e.path,children:["🔗 ",e.name,"/"]}),(0,t.jsx)("div",{style:{paddingLeft:"0.25rem"},children:e.tree.map(e=>(0,t.jsx)(P,{node:e,onSelect:e4,onCreate:e2,onRename:e7,onDelete:e8,isReadOnly:!0},e.path))})]},e.path))]})]}),"git"===ey&&(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"}),eS?0===eC.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:eC.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(q)}`);if(t.ok){let r=await t.json();if(r.success){let t=`diff:${e.relativePath}`;em.some(e=>e.path===t)||ef(o=>[...o,{name:`Diff: ${e.name}`,path:t,content:r.diff,isModified:!1}]),eh(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"===ey&&(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:V,children:[(0,t.jsx)("div",{style:J,children:"Input"}),(0,t.jsx)("div",{style:K,children:(eR?.tokenUsage?.input??0).toLocaleString()})]}),(0,t.jsxs)("div",{style:V,children:[(0,t.jsx)("div",{style:J,children:"Output"}),(0,t.jsx)("div",{style:K,children:(eR?.tokenUsage?.output??0).toLocaleString()})]}),(0,t.jsxs)("div",{style:{...V,gridColumn:"span 2"},children:[(0,t.jsx)("div",{style:J,children:"Cost"}),(0,t.jsxs)("div",{style:{...K,color:"#10b981",fontSize:"1.25rem"},children:["$",(eR?.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:eP?.cpu??"0.0%"})]}),(0,t.jsx)("div",{style:_,children:(0,t.jsx)("div",{style:{...H,width:eP?.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:eP?.memory??"0.0MiB"})]}),(0,t.jsx)("div",{style:_,children:(0,t.jsx)("div",{style:{...H,width:eP?.memoryPercent||"0%",backgroundColor:"#eab308"}})})]}),(0,t.jsx)("div",{style:{fontSize:"0.6rem",color:"var(--muted)",marginTop:"0.25rem",fontStyle:"italic"},children:eP?.type?.includes("docker")?"🐳 Docker container statistics":"💻 Local process statistics"})]})]})]}),"auditor"===ey&&(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:eW,onChange:e=>eL(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(!eR?.logs)return;let t=new Blob([eR.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(!eR?.logs||0===eR.logs.length)return(0,t.jsx)("div",{style:{color:"var(--muted)",fontStyle:"italic",textAlign:"center"},children:"No logs captured."});let e=eR.logs.join("").replace(/\x1b\[[0-9;]*m/g,"").split(/\r?\n/),r=eW.trim()?e.filter(e=>e.toLowerCase().includes(eW.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(!eW.trim())return(0,t.jsx)("div",{children:e},r);let o=e.split(RegExp(`(${eW})`,"gi"));return(0,t.jsx)("div",{children:o.map((e,r)=>e.toLowerCase()===eW.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:eE,onChange:e=>eM(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:eB,onChange:e=>eU(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:()=>{eE.trim()&&eB.trim()&&(eV([...eD,{name:eE.trim(),command:eB.trim()}]),eM(""),eU(""))},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"}),eD.length>0&&(0,t.jsx)("div",{style:{marginTop:"0.25rem",maxHeight:"60px",overflowY:"auto"},children:eD.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:()=>{eV(eD.filter((e,t)=>t!==r))},style:{color:"var(--danger)",cursor:"pointer"},children:"✖"})]},r))})]})]})]})]})]}),(0,t.jsxs)("div",{style:f,children:[(0,t.jsx)("div",{style:G,children:(0,t.jsx)("div",{style:{display:"flex",gap:"0.25rem",overflowX:"auto"},children:et.map(r=>{let o=r.id===e,n="running"===r.status?"#10b981":"rgba(255,255,255,0.2)";return(0,t.jsxs)("div",{onClick:()=>{eN===r.id&&e$(null),er(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:n,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:h,children:[(0,t.jsxs)("div",{style:g,children:[(0,t.jsx)("div",{style:x,children:em.map(e=>(0,t.jsxs)("div",{style:{...y,backgroundColor:eu===e.path?"#0b101b":"rgba(8,12,20,0.4)",borderColor:eu===e.path?"var(--border-focus)":"transparent",color:eu===e.path?"var(--foreground)":"var(--muted)"},onClick:()=>eh(e.path),children:[(0,t.jsxs)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[e.name," ",e.isModified&&(0,t.jsx)("span",{style:v,children:"●"})]}),(0,t.jsx)("span",{onClick:t=>{t.stopPropagation(),e9(e.path)},style:b,children:"✖"})]},e.path))}),te&&!te.path.startsWith("diff:")&&(0,t.jsx)("button",{onClick:tt,disabled:!te.isModified,style:{...j,opacity:te.isModified?1:.5,cursor:te.isModified?"pointer":"not-allowed"},children:"💾 Save (Ctrl+S)"})]}),(0,t.jsx)("div",{style:C,children:te?te.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:te.content.split("\n").map((e,r)=>{let o="#e2e8f0",n="transparent";return e.startsWith("+")?(o="#4ade80",n="rgba(74, 222, 128, 0.08)"):e.startsWith("-")?(o="#f87171",n="rgba(248, 113, 113, 0.08)"):e.startsWith("@@")&&(o="#60a5fa",n="rgba(96, 165, 250, 0.05)"),(0,t.jsx)("div",{style:{color:o,backgroundColor:n,whiteSpace:"pre-wrap",padding:"0.1rem 0.5rem"},children:e},r)})}):(0,t.jsx)("textarea",{value:te.content,onChange:e=>{var t;return t=e.target.value,void(eu&&ef(em.map(e=>e.path===eu?{...e,content:t,isModified:!0}:e)))},style:w,spellCheck:!1}):(0,t.jsxs)("div",{style:S,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:k,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 ",eN&&"(Split View Active)"]}),(0,t.jsxs)("div",{style:{display:"flex",gap:"0.5rem",alignItems:"center"},children:[(0,t.jsxs)("select",{onChange:e=>{e$(e.target.value||null)},value:eN||"",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"}),et.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:T,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:R,children:"⚡ Trigger Prompt (/ccp)"})]})]}),(0,t.jsxs)("div",{style:Y,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:[eK?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{onClick:()=>eJ("/undo"),style:X,title:"Aider: undo last commit",children:"/undo"}),(0,t.jsx)("button",{onClick:()=>eJ("/diff"),style:X,title:"Aider: show git diff",children:"/diff"}),(0,t.jsx)("button",{onClick:()=>eJ("/commit"),style:X,title:"Aider: commit edits",children:"/commit"}),(0,t.jsx)("button",{onClick:()=>eJ("/test"),style:X,title:"Aider: run tests",children:"/test"}),(0,t.jsx)("button",{onClick:()=>eJ("/clear"),style:X,title:"Clear terminal screen",children:"/clear"})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{onClick:()=>eJ("/compact"),style:X,title:"Claude Code: compact history",children:"/compact"}),(0,t.jsx)("button",{onClick:()=>eJ("/history"),style:X,title:"Claude Code: view history",children:"/history"}),(0,t.jsx)("button",{onClick:()=>eJ("/reset"),style:X,title:"Claude Code: reset conversation",children:"/reset"}),(0,t.jsx)("button",{onClick:()=>eJ("/help"),style:X,title:"Claude Code: show help",children:"/help"})]}),eD.map((e,r)=>(0,t.jsx)("button",{onClick:()=>eJ(e.command),style:{...X,borderColor:"rgba(168, 85, 247, 0.4)",color:"#c084fc"},title:`Inject command: ${e.command}`,children:e.name},r))]})]}),(0,t.jsxs)("div",{style:{...I,display:"flex",width:"100%",height:"100%"},children:[(0,t.jsx)("div",{style:{flex:1,height:"100%",borderRight:eN?"1px solid var(--border)":"none",overflow:"hidden"},children:(0,t.jsx)(o.default,{sessionId:e,height:"100%"})}),eN&&(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: ",et.find(e=>e.id===eN)?.name]}),(0,t.jsx)("button",{onClick:()=>e$(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:eN,height:"100%"})})]})]})]})]}),e_.type&&(0,t.jsx)("div",{style:F,children:(0,t.jsxs)("div",{style:W,children:[(0,t.jsxs)("h3",{style:{margin:"0 0 1rem 0",fontSize:"1rem",fontWeight:600},children:["create-file"===e_.type&&"Create New File","create-folder"===e_.type&&"Create New Folder","rename"===e_.type&&"Rename Item","delete"===e_.type&&"Confirm Deletion"]}),e_.error&&(0,t.jsxs)("div",{style:{color:"var(--danger)",fontSize:"0.8rem",marginBottom:"1rem"},children:["⚠️ ",e_.error]}),"delete"!==e_.type?(0,t.jsxs)("form",{onSubmit:e6,children:[(0,t.jsxs)("div",{style:{marginBottom:"0.5rem",fontSize:"0.75rem",color:"var(--muted)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:e_.targetPath||"",children:["Target: ",e_.targetPath]}),(0,t.jsx)("input",{type:"text",value:e_.inputValue,onChange:e=>eH({...e_,inputValue:e.target.value}),style:L,autoFocus:!0,placeholder:"rename"===e_.type?"Enter new name":"Enter name"}),(0,t.jsxs)("div",{style:D,children:[(0,t.jsx)("button",{type:"button",onClick:()=>eH({type:null,targetPath:null,inputValue:"",error:null}),style:O,children:"Cancel"}),(0,t.jsx)("button",{type:"submit",style:E,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:e_.targetPath})]}),(0,t.jsxs)("div",{style:D,children:[(0,t.jsx)("button",{type:"button",onClick:()=>eH({type:null,targetPath:null,inputValue:"",error:null}),style:O,children:"Cancel"}),(0,t.jsx)("button",{onClick:()=>e6(),style:{...E,backgroundColor:"var(--danger)"},children:"Delete Permanently"})]})]})]})}),eY&&(0,t.jsx)("div",{style:B,onClick:()=>eX(!1),children:(0,t.jsxs)("div",{style:U,onClick:e=>e.stopPropagation(),children:[(0,t.jsx)("input",{type:"text",value:eG,onChange:e=>{eQ(e.target.value),e5(0)},onKeyDown:e=>{"ArrowDown"===e.key?(e.preventDefault(),e5(e=>(e+1)%Math.max(1,tr.length))):"ArrowUp"===e.key?(e.preventDefault(),e5(e=>(e-1+tr.length)%Math.max(1,tr.length))):"Enter"===e.key?(e.preventDefault(),tr[e0]&&(e4(tr[e0].path),eX(!1))):"Escape"===e.key&&(e.preventDefault(),eX(!1))},placeholder:"Search files by name or path...",style:N,autoFocus:!0}),(0,t.jsx)("div",{style:$,children:tr.length>0?tr.map((e,r)=>(0,t.jsxs)("div",{onClick:()=>{e4(e.path),eX(!1)},style:{...A,backgroundColor:r===e0?"rgba(168, 85, 247, 0.15)":"transparent",borderLeft:r===e0?"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"})]})})]})}])},97722,e=>{e.n(e.i(3839))}]);
@@ -1 +1 @@
1
- .page-module___8aEwW__container{flex-direction:column;gap:2rem;max-width:1400px;min-height:100vh;margin:0 auto;padding:2rem;display:flex}.page-module___8aEwW__header{border-bottom:1px solid var(--border);justify-content:space-between;align-items:center;padding-bottom:1.5rem;display:flex}.page-module___8aEwW__logoArea{flex-direction:column;gap:.25rem;display:flex}.page-module___8aEwW__title{letter-spacing:-.05em;background:linear-gradient(135deg, hsl(var(--primary-hsl)) 0%, hsl(var(--accent-hsl)) 100%);-webkit-text-fill-color:transparent;-webkit-background-clip:text;font-size:2.25rem;font-weight:800}.page-module___8aEwW__subtitle{color:var(--muted);font-size:.875rem}.page-module___8aEwW__statusIndicator{background-color:var(--card);border:1px solid var(--border);border-radius:9999px;align-items:center;gap:.5rem;padding:.5rem 1rem;font-size:.875rem;display:flex}.page-module___8aEwW__pulseDot{background-color:var(--success);width:8px;height:8px;box-shadow:0 0 10px var(--success);border-radius:50%;animation:2s infinite page-module___8aEwW__pulse}.page-module___8aEwW__dashboardGrid{grid-template-columns:2fr 1fr;gap:2rem;display:grid}@media (max-width:1024px){.page-module___8aEwW__dashboardGrid{grid-template-columns:1fr}}.page-module___8aEwW__mainPanel{flex-direction:column;gap:2rem;min-width:0;display:flex}.page-module___8aEwW__sidePanel{flex-direction:column;gap:2rem;display:flex}.page-module___8aEwW__sectionTitle{color:var(--foreground);margin-bottom:1rem;font-size:1.25rem;font-weight:700}.page-module___8aEwW__cardBody{flex-direction:column;gap:1rem;padding:1.5rem;display:flex}.page-module___8aEwW__agentGrid{grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:1.5rem;display:grid}.page-module___8aEwW__agentCard{background-color:var(--card);border:1px solid var(--border);border-radius:12px;overflow:hidden}.page-module___8aEwW__agentHeader{background-color:hsla(var(--border-hsl), .3);border-bottom:1px solid var(--border);justify-content:space-between;align-items:center;padding:1rem 1.5rem;display:flex}.page-module___8aEwW__agentName{font-size:1rem;font-weight:600}.page-module___8aEwW__agentBadge{background-color:hsla(var(--primary-hsl), .15);color:var(--primary);border-radius:4px;padding:.25rem .5rem;font-size:.75rem;font-weight:500}.page-module___8aEwW__envGrid{grid-template-columns:1fr;gap:1rem;display:grid}.page-module___8aEwW__envRow{background-color:var(--card);border:1px solid var(--border);border-radius:8px;justify-content:space-between;align-items:center;padding:.75rem 1rem;display:flex}.page-module___8aEwW__envName{font-size:.875rem;font-weight:500}.page-module___8aEwW__envStatus{color:var(--muted);font-size:.75rem}.page-module___8aEwW__quickLaunchBtn{background-color:var(--primary);color:#fff;border:none;border-radius:8px;justify-content:center;align-items:center;gap:.5rem;width:100%;padding:1rem;font-size:1rem;font-weight:600;display:flex}.page-module___8aEwW__quickLaunchBtn:hover{background-color:var(--primary-hover);transform:translateY(-1px)}.page-module___8aEwW__contextList{flex-direction:column;gap:.75rem;display:flex}.page-module___8aEwW__contextItem{background-color:var(--card);border:1px solid var(--border);border-radius:8px;justify-content:space-between;align-items:center;padding:.75rem 1rem;display:flex}.page-module___8aEwW__contextMeta{flex-direction:column;gap:.25rem;display:flex}.page-module___8aEwW__contextTitle{font-size:.875rem;font-weight:600}.page-module___8aEwW__contextDetails{color:var(--muted);font-size:.75rem}.page-module___8aEwW__footer{border-top:1px solid var(--border);color:var(--muted);justify-content:space-between;margin-top:auto;padding-top:1.5rem;font-size:.75rem;display:flex}@keyframes page-module___8aEwW__pulse{0%{transform:scale(.95);box-shadow:0 0 #22c55eb3}70%{transform:scale(1);box-shadow:0 0 0 6px #22c55e00}to{transform:scale(.95);box-shadow:0 0 #22c55e00}}.page-module___8aEwW__activeBorder{box-shadow:0 0 12px hsla(var(--primary-hsl), .2);border-color:var(--border-focus)!important}.page-module___8aEwW__stoppedBadge{background-color:hsla(var(--danger-hsl), .15)!important;color:var(--danger)!important}.page-module___8aEwW__terminalContainer{border-bottom:1px solid var(--border);font-family:var(--font-mono);color:#c9d1d9;background-color:#05070a;flex-direction:column;gap:.35rem;height:380px;padding:1.5rem;font-size:.825rem;line-height:1.5;display:flex;overflow-y:auto}.page-module___8aEwW__terminalLine{white-space:pre-wrap;word-break:break-all}.page-module___8aEwW__terminalInputArea{background-color:#0b0f17;border-bottom-right-radius:12px;border-bottom-left-radius:12px;align-items:center;gap:.75rem;padding:1rem 1.5rem;display:flex}.page-module___8aEwW__terminalInput{color:var(--foreground);font-family:var(--font-mono);background:0 0;border:none;outline:none;flex:1;font-size:.825rem}.page-module___8aEwW__terminalSendBtn{background-color:var(--primary);color:#fff;border:none;border-radius:6px;padding:.4rem 1rem;font-size:.75rem;font-weight:600;transition:all .2s}.page-module___8aEwW__terminalSendBtn:hover:not(:disabled){background-color:var(--primary-hover);transform:translateY(-1px)}.page-module___8aEwW__terminalSendBtn:disabled{opacity:.5;cursor:not-allowed}.page-module___8aEwW__ansiMagenta{color:#ff79c6}.page-module___8aEwW__ansiCyan{color:#8be9fd}.page-module___8aEwW__ansiGreen{color:#50fa7b}.page-module___8aEwW__ansiRed{color:#f55}.page-module___8aEwW__ansiYellow{color:#f1fa8c}
1
+ .page-module___8aEwW__container{flex-direction:column;gap:2rem;max-width:1400px;min-height:100vh;margin:0 auto;padding:2rem;display:flex}.page-module___8aEwW__header{border-bottom:1px solid var(--border);justify-content:space-between;align-items:center;padding-bottom:1.5rem;display:flex}.page-module___8aEwW__logoArea{flex-direction:column;gap:.25rem;display:flex}.page-module___8aEwW__title{letter-spacing:-.05em;background:linear-gradient(135deg, hsl(var(--primary-hsl)) 0%, hsl(var(--accent-hsl)) 100%);-webkit-text-fill-color:transparent;-webkit-background-clip:text;font-size:2.25rem;font-weight:800}.page-module___8aEwW__subtitle{color:var(--muted);font-size:.875rem}.page-module___8aEwW__statusIndicator{background-color:var(--card);border:1px solid var(--border);border-radius:9999px;align-items:center;gap:.5rem;padding:.5rem 1rem;font-size:.875rem;display:flex}.page-module___8aEwW__pulseDot{background-color:var(--success);width:8px;height:8px;box-shadow:0 0 10px var(--success);border-radius:50%;animation:2s infinite page-module___8aEwW__pulse}.page-module___8aEwW__dashboardGrid{grid-template-columns:2fr 1fr;gap:2rem;display:grid}@media (max-width:1024px){.page-module___8aEwW__dashboardGrid{grid-template-columns:1fr}}.page-module___8aEwW__mainPanel{flex-direction:column;gap:2rem;min-width:0;display:flex}.page-module___8aEwW__sidePanel{flex-direction:column;gap:2rem;display:flex}.page-module___8aEwW__sectionTitle{color:var(--foreground);margin-bottom:1rem;font-size:1.25rem;font-weight:700}.page-module___8aEwW__cardBody{flex-direction:column;gap:1rem;padding:1.5rem;display:flex}.page-module___8aEwW__agentGrid{grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:1.5rem;display:grid}.page-module___8aEwW__agentCard{background-color:var(--card);border:1px solid var(--border);border-radius:12px;overflow:hidden}.page-module___8aEwW__agentHeader{background-color:hsla(var(--border-hsl), .3);border-bottom:1px solid var(--border);justify-content:space-between;align-items:center;padding:1rem 1.5rem;display:flex}.page-module___8aEwW__agentName{font-size:1rem;font-weight:600}.page-module___8aEwW__agentBadge{background-color:hsla(var(--primary-hsl), .15);color:var(--primary);border-radius:4px;padding:.25rem .5rem;font-size:.75rem;font-weight:500}.page-module___8aEwW__envGrid{grid-template-columns:1fr;gap:1rem;display:grid}.page-module___8aEwW__envRow{background-color:var(--card);border:1px solid var(--border);border-radius:8px;justify-content:space-between;align-items:center;padding:.75rem 1rem;display:flex}.page-module___8aEwW__envName{font-size:.875rem;font-weight:500}.page-module___8aEwW__envStatus{color:var(--muted);font-size:.75rem}.page-module___8aEwW__quickLaunchBtn{background-color:var(--primary);color:#fff;border:none;border-radius:8px;justify-content:center;align-items:center;gap:.5rem;width:100%;padding:1rem;font-size:1rem;font-weight:600;display:flex}.page-module___8aEwW__quickLaunchBtn:hover{background-color:var(--primary-hover);transform:translateY(-1px)}.page-module___8aEwW__contextList{flex-direction:column;gap:.75rem;display:flex}.page-module___8aEwW__contextItem{background-color:var(--card);border:1px solid var(--border);border-radius:8px;justify-content:space-between;align-items:center;padding:.75rem 1rem;display:flex}.page-module___8aEwW__contextMeta{flex-direction:column;gap:.25rem;display:flex}.page-module___8aEwW__contextTitle{font-size:.875rem;font-weight:600}.page-module___8aEwW__contextDetails{color:var(--muted);font-size:.75rem}.page-module___8aEwW__footer{border-top:1px solid var(--border);color:var(--muted);justify-content:space-between;margin-top:auto;padding-top:1.5rem;font-size:.75rem;display:flex}@keyframes page-module___8aEwW__pulse{0%{transform:scale(.95);box-shadow:0 0 #22c55eb3}70%{transform:scale(1);box-shadow:0 0 0 6px #22c55e00}to{transform:scale(.95);box-shadow:0 0 #22c55e00}}.page-module___8aEwW__activeBorder{box-shadow:0 0 12px hsla(var(--primary-hsl), .2);border-color:var(--border-focus)!important}.page-module___8aEwW__stoppedBadge{background-color:hsla(var(--danger-hsl), .15)!important;color:var(--danger)!important}.page-module___8aEwW__terminalContainer{border-bottom:1px solid var(--border);font-family:var(--font-mono);color:#c9d1d9;background-color:#05070a;flex-direction:column;gap:.35rem;height:380px;padding:1.5rem;font-size:.825rem;line-height:1.5;display:flex;overflow-y:auto}.page-module___8aEwW__terminalLine{white-space:pre-wrap;word-break:break-all}.page-module___8aEwW__terminalInputArea{background-color:#0b0f17;border-bottom-right-radius:12px;border-bottom-left-radius:12px;align-items:center;gap:.75rem;padding:1rem 1.5rem;display:flex}.page-module___8aEwW__terminalInput{color:var(--foreground);font-family:var(--font-mono);background:0 0;border:none;outline:none;flex:1;font-size:.825rem}.page-module___8aEwW__terminalSendBtn{background-color:var(--primary);color:#fff;border:none;border-radius:6px;padding:.4rem 1rem;font-size:.75rem;font-weight:600;transition:all .2s}.page-module___8aEwW__terminalSendBtn:hover:not(:disabled){background-color:var(--primary-hover);transform:translateY(-1px)}.page-module___8aEwW__terminalSendBtn:disabled{opacity:.5;cursor:not-allowed}.page-module___8aEwW__ansiMagenta{color:#ff79c6}.page-module___8aEwW__ansiCyan{color:#8be9fd}.page-module___8aEwW__ansiGreen{color:#50fa7b}.page-module___8aEwW__ansiRed{color:#f55}.page-module___8aEwW__ansiYellow{color:#f1fa8c}.page-module___8aEwW__containerActive{gap:1rem;height:100vh;min-height:100vh;max-height:100vh;padding:1rem 1.5rem;overflow:hidden}
package/.next/trace CHANGED
@@ -1 +1 @@
1
- [{"name":"generate-buildid","duration":335,"timestamp":106110684722,"id":4,"parentId":1,"tags":{},"startTime":1781326846456,"traceId":"ba37f844718c1515"},{"name":"load-custom-routes","duration":390,"timestamp":106110685190,"id":5,"parentId":1,"tags":{},"startTime":1781326846457,"traceId":"ba37f844718c1515"},{"name":"create-dist-dir","duration":2533,"timestamp":106110685614,"id":6,"parentId":1,"tags":{},"startTime":1781326846457,"traceId":"ba37f844718c1515"},{"name":"clean","duration":598,"timestamp":106110689094,"id":7,"parentId":1,"tags":{},"startTime":1781326846461,"traceId":"ba37f844718c1515"},{"name":"discover-routes","duration":7920,"timestamp":106110714449,"id":8,"parentId":1,"tags":{},"startTime":1781326846486,"traceId":"ba37f844718c1515"},{"name":"create-root-mapping","duration":66,"timestamp":106110722422,"id":9,"parentId":1,"tags":{},"startTime":1781326846494,"traceId":"ba37f844718c1515"},{"name":"generate-route-types","duration":18854,"timestamp":106110723899,"id":10,"parentId":1,"tags":{},"startTime":1781326846496,"traceId":"ba37f844718c1515"},{"name":"public-dir-conflict-check","duration":113,"timestamp":106110742907,"id":11,"parentId":1,"tags":{},"startTime":1781326846515,"traceId":"ba37f844718c1515"},{"name":"generate-routes-manifest","duration":2455,"timestamp":106110743136,"id":12,"parentId":1,"tags":{},"startTime":1781326846515,"traceId":"ba37f844718c1515"},{"name":"run-turbopack","duration":2602074,"timestamp":106110753848,"id":14,"parentId":1,"tags":{},"startTime":1781326846526,"traceId":"ba37f844718c1515"},{"name":"turbopack-build-events","duration":75,"timestamp":106111080252,"id":15,"parentId":1,"tags":{},"startTime":1781326846852,"traceId":"ba37f844718c1515"},{"name":"run-typescript","duration":3843622,"timestamp":106113367678,"id":16,"parentId":1,"tags":{},"startTime":1781326849139,"traceId":"ba37f844718c1515"},{"name":"generate-required-server-files","duration":2052,"timestamp":106117212281,"id":18,"parentId":1,"tags":{},"startTime":1781326852984,"traceId":"ba37f844718c1515"},{"name":"check-static-error-page","duration":7540,"timestamp":106117334044,"id":20,"parentId":19,"tags":{},"startTime":1781326853106,"traceId":"ba37f844718c1515"},{"name":"is-page-static","duration":633652,"timestamp":106117347268,"id":38,"parentId":22,"tags":{},"startTime":1781326853119,"traceId":"ba37f844718c1515"},{"name":"check-page","duration":644325,"timestamp":106117336730,"id":22,"parentId":19,"tags":{"page":"/_global-error"},"startTime":1781326853108,"traceId":"ba37f844718c1515"},{"name":"is-page-static","duration":805186,"timestamp":106117347732,"id":42,"parentId":26,"tags":{},"startTime":1781326853119,"traceId":"ba37f844718c1515"},{"name":"check-page","duration":815196,"timestamp":106117337812,"id":26,"parentId":19,"tags":{"page":"/api/context/ssh"},"startTime":1781326853109,"traceId":"ba37f844718c1515"},{"name":"is-page-static","duration":806488,"timestamp":106117347363,"id":39,"parentId":23,"tags":{},"startTime":1781326853119,"traceId":"ba37f844718c1515"},{"name":"check-page","duration":816783,"timestamp":106117337113,"id":23,"parentId":19,"tags":{"page":"/api/context/aider"},"startTime":1781326853109,"traceId":"ba37f844718c1515"},{"name":"is-page-static","duration":815043,"timestamp":106117346967,"id":37,"parentId":21,"tags":{},"startTime":1781326853119,"traceId":"ba37f844718c1515"},{"name":"check-page","duration":826368,"timestamp":106117335690,"id":21,"parentId":19,"tags":{"page":"/_not-found"},"startTime":1781326853107,"traceId":"ba37f844718c1515"},{"name":"is-page-static","duration":824766,"timestamp":106117348149,"id":44,"parentId":28,"tags":{},"startTime":1781326853120,"traceId":"ba37f844718c1515"},{"name":"check-page","duration":834693,"timestamp":106117338277,"id":28,"parentId":19,"tags":{"page":"/api/git"},"startTime":1781326853110,"traceId":"ba37f844718c1515"},{"name":"is-page-static","duration":833297,"timestamp":106117347988,"id":43,"parentId":27,"tags":{},"startTime":1781326853120,"traceId":"ba37f844718c1515"},{"name":"check-page","duration":843310,"timestamp":106117338029,"id":27,"parentId":19,"tags":{"page":"/api/files"},"startTime":1781326853110,"traceId":"ba37f844718c1515"},{"name":"is-page-static","duration":834270,"timestamp":106117348920,"id":51,"parentId":35,"tags":{},"startTime":1781326853121,"traceId":"ba37f844718c1515"},{"name":"check-page","duration":842893,"timestamp":106117340352,"id":35,"parentId":19,"tags":{"page":"/favicon.ico"},"startTime":1781326853112,"traceId":"ba37f844718c1515"},{"name":"is-page-static","duration":836756,"timestamp":106117347626,"id":41,"parentId":25,"tags":{},"startTime":1781326853119,"traceId":"ba37f844718c1515"},{"name":"check-page","duration":846830,"timestamp":106117337600,"id":25,"parentId":19,"tags":{"page":"/api/context"},"startTime":1781326853109,"traceId":"ba37f844718c1515"},{"name":"is-page-static","duration":839671,"timestamp":106117347460,"id":40,"parentId":24,"tags":{},"startTime":1781326853119,"traceId":"ba37f844718c1515"},{"name":"check-page","duration":849803,"timestamp":106117337381,"id":24,"parentId":19,"tags":{"page":"/api/context/claude"},"startTime":1781326853109,"traceId":"ba37f844718c1515"},{"name":"is-page-static","duration":839915,"timestamp":106117348745,"id":48,"parentId":32,"tags":{},"startTime":1781326853120,"traceId":"ba37f844718c1515"},{"name":"check-page","duration":849290,"timestamp":106117339412,"id":32,"parentId":19,"tags":{"page":"/api/sessions"},"startTime":1781326853111,"traceId":"ba37f844718c1515"},{"name":"is-page-static","duration":844525,"timestamp":106117348526,"id":46,"parentId":30,"tags":{},"startTime":1781326853120,"traceId":"ba37f844718c1515"},{"name":"check-page","duration":854256,"timestamp":106117338834,"id":30,"parentId":19,"tags":{"page":"/api/sessions/input"},"startTime":1781326853111,"traceId":"ba37f844718c1515"},{"name":"is-page-static","duration":847223,"timestamp":106117348275,"id":45,"parentId":29,"tags":{},"startTime":1781326853120,"traceId":"ba37f844718c1515"},{"name":"check-page","duration":857043,"timestamp":106117338502,"id":29,"parentId":19,"tags":{"page":"/api/sessions/inject"},"startTime":1781326853110,"traceId":"ba37f844718c1515"},{"name":"is-page-static","duration":850351,"timestamp":106117348805,"id":49,"parentId":33,"tags":{},"startTime":1781326853120,"traceId":"ba37f844718c1515"},{"name":"check-page","duration":859498,"timestamp":106117339693,"id":33,"parentId":19,"tags":{"page":"/api/sessions/stats"},"startTime":1781326853111,"traceId":"ba37f844718c1515"},{"name":"is-page-static","duration":852857,"timestamp":106117348874,"id":50,"parentId":34,"tags":{},"startTime":1781326853121,"traceId":"ba37f844718c1515"},{"name":"check-page","duration":861820,"timestamp":106117339958,"id":34,"parentId":19,"tags":{"page":"/api/sessions/stop"},"startTime":1781326853112,"traceId":"ba37f844718c1515"},{"name":"is-page-static","duration":853226,"timestamp":106117348669,"id":47,"parentId":31,"tags":{},"startTime":1781326853120,"traceId":"ba37f844718c1515"},{"name":"check-page","duration":862792,"timestamp":106117339131,"id":31,"parentId":19,"tags":{"page":"/api/sessions/launch"},"startTime":1781326853111,"traceId":"ba37f844718c1515"},{"name":"is-page-static","duration":851181,"timestamp":106117352512,"id":52,"parentId":36,"tags":{},"startTime":1781326853124,"traceId":"ba37f844718c1515"},{"name":"check-page","duration":862571,"timestamp":106117341158,"id":36,"parentId":19,"tags":{"page":"/"},"startTime":1781326853113,"traceId":"ba37f844718c1515"},{"name":"static-check","duration":870331,"timestamp":106117333425,"id":19,"parentId":1,"tags":{},"startTime":1781326853105,"traceId":"ba37f844718c1515"},{"name":"write-routes-manifest","duration":843,"timestamp":106118204883,"id":54,"parentId":1,"tags":{},"startTime":1781326853977,"traceId":"ba37f844718c1515"},{"name":"load-dotenv","duration":40,"timestamp":106118222505,"id":57,"parentId":56,"tags":{},"startTime":1781326853994,"traceId":"ba37f844718c1515"},{"name":"run-export-path-map","duration":444,"timestamp":106118228417,"id":58,"parentId":56,"tags":{},"startTime":1781326854000,"traceId":"ba37f844718c1515"},{"name":"next-export","duration":754579,"timestamp":106118221504,"id":56,"parentId":1,"tags":{},"startTime":1781326853993,"traceId":"ba37f844718c1515"},{"name":"move-exported-app-not-found-","duration":2546,"timestamp":106118978074,"id":59,"parentId":55,"tags":{},"startTime":1781326854750,"traceId":"ba37f844718c1515"},{"name":"move-exported-app-global-error-","duration":2426,"timestamp":106118980750,"id":60,"parentId":55,"tags":{},"startTime":1781326854752,"traceId":"ba37f844718c1515"},{"name":"static-generation","duration":776612,"timestamp":106118210472,"id":55,"parentId":1,"tags":{},"startTime":1781326853982,"traceId":"ba37f844718c1515"},{"name":"write-routes-manifest","duration":876,"timestamp":106118987249,"id":61,"parentId":1,"tags":{},"startTime":1781326854759,"traceId":"ba37f844718c1515"},{"name":"print-tree-view","duration":3668,"timestamp":106119002103,"id":62,"parentId":1,"tags":{},"startTime":1781326854774,"traceId":"ba37f844718c1515"},{"name":"write-route-bundle-stats","duration":12562,"timestamp":106119005807,"id":63,"parentId":1,"tags":{},"startTime":1781326854777,"traceId":"ba37f844718c1515"},{"name":"telemetry-flush","duration":179559,"timestamp":106119018402,"id":64,"parentId":1,"tags":{},"startTime":1781326854790,"traceId":"ba37f844718c1515"},{"name":"next-build","duration":8567043,"timestamp":106110630941,"id":1,"tags":{"buildMode":"default","version":"16.2.6","bundler":"turbopack","has-custom-webpack-config":"false","use-build-worker":"true"},"startTime":1781326846403,"traceId":"ba37f844718c1515"}]
1
+ [{"name":"generate-buildid","duration":234,"timestamp":109770124266,"id":4,"parentId":1,"tags":{},"startTime":1781330505895,"traceId":"318220d88ba8a9c9"},{"name":"load-custom-routes","duration":384,"timestamp":109770124624,"id":5,"parentId":1,"tags":{},"startTime":1781330505896,"traceId":"318220d88ba8a9c9"},{"name":"create-dist-dir","duration":599,"timestamp":109770125042,"id":6,"parentId":1,"tags":{},"startTime":1781330505896,"traceId":"318220d88ba8a9c9"},{"name":"clean","duration":584,"timestamp":109770126557,"id":7,"parentId":1,"tags":{},"startTime":1781330505898,"traceId":"318220d88ba8a9c9"},{"name":"discover-routes","duration":7892,"timestamp":109770149388,"id":8,"parentId":1,"tags":{},"startTime":1781330505920,"traceId":"318220d88ba8a9c9"},{"name":"create-root-mapping","duration":68,"timestamp":109770157333,"id":9,"parentId":1,"tags":{},"startTime":1781330505928,"traceId":"318220d88ba8a9c9"},{"name":"generate-route-types","duration":18890,"timestamp":109770158796,"id":10,"parentId":1,"tags":{},"startTime":1781330505930,"traceId":"318220d88ba8a9c9"},{"name":"public-dir-conflict-check","duration":105,"timestamp":109770177857,"id":11,"parentId":1,"tags":{},"startTime":1781330505949,"traceId":"318220d88ba8a9c9"},{"name":"generate-routes-manifest","duration":2506,"timestamp":109770178072,"id":12,"parentId":1,"tags":{},"startTime":1781330505949,"traceId":"318220d88ba8a9c9"},{"name":"run-turbopack","duration":2349741,"timestamp":109770187670,"id":14,"parentId":1,"tags":{},"startTime":1781330505959,"traceId":"318220d88ba8a9c9"},{"name":"turbopack-build-events","duration":61,"timestamp":109770478803,"id":15,"parentId":1,"tags":{},"startTime":1781330506250,"traceId":"318220d88ba8a9c9"},{"name":"run-typescript","duration":3412340,"timestamp":109772547016,"id":16,"parentId":1,"tags":{},"startTime":1781330508318,"traceId":"318220d88ba8a9c9"},{"name":"generate-required-server-files","duration":1669,"timestamp":109775960242,"id":18,"parentId":1,"tags":{},"startTime":1781330511731,"traceId":"318220d88ba8a9c9"},{"name":"check-static-error-page","duration":6180,"timestamp":109776065568,"id":20,"parentId":19,"tags":{},"startTime":1781330511837,"traceId":"318220d88ba8a9c9"},{"name":"is-page-static","duration":498235,"timestamp":109776076302,"id":38,"parentId":22,"tags":{},"startTime":1781330511847,"traceId":"318220d88ba8a9c9"},{"name":"check-page","duration":506520,"timestamp":109776068147,"id":22,"parentId":19,"tags":{"page":"/_global-error"},"startTime":1781330511839,"traceId":"318220d88ba8a9c9"},{"name":"is-page-static","duration":622517,"timestamp":109776076070,"id":37,"parentId":21,"tags":{},"startTime":1781330511847,"traceId":"318220d88ba8a9c9"},{"name":"check-page","duration":631499,"timestamp":109776067147,"id":21,"parentId":19,"tags":{"page":"/_not-found"},"startTime":1781330511838,"traceId":"318220d88ba8a9c9"},{"name":"is-page-static","duration":624331,"timestamp":109776076443,"id":40,"parentId":24,"tags":{},"startTime":1781330511847,"traceId":"318220d88ba8a9c9"},{"name":"check-page","duration":632175,"timestamp":109776068646,"id":24,"parentId":19,"tags":{"page":"/api/context/claude"},"startTime":1781330511840,"traceId":"318220d88ba8a9c9"},{"name":"is-page-static","duration":629164,"timestamp":109776076967,"id":44,"parentId":28,"tags":{},"startTime":1781330511848,"traceId":"318220d88ba8a9c9"},{"name":"check-page","duration":636763,"timestamp":109776069423,"id":28,"parentId":19,"tags":{"page":"/api/git"},"startTime":1781330511840,"traceId":"318220d88ba8a9c9"},{"name":"is-page-static","duration":629706,"timestamp":109776076603,"id":42,"parentId":26,"tags":{},"startTime":1781330511848,"traceId":"318220d88ba8a9c9"},{"name":"check-page","duration":637304,"timestamp":109776069030,"id":26,"parentId":19,"tags":{"page":"/api/context/ssh"},"startTime":1781330511840,"traceId":"318220d88ba8a9c9"},{"name":"is-page-static","duration":630897,"timestamp":109776076526,"id":41,"parentId":25,"tags":{},"startTime":1781330511847,"traceId":"318220d88ba8a9c9"},{"name":"check-page","duration":638632,"timestamp":109776068835,"id":25,"parentId":19,"tags":{"page":"/api/context"},"startTime":1781330511840,"traceId":"318220d88ba8a9c9"},{"name":"is-page-static","duration":632294,"timestamp":109776076370,"id":39,"parentId":23,"tags":{},"startTime":1781330511847,"traceId":"318220d88ba8a9c9"},{"name":"check-page","duration":640276,"timestamp":109776068425,"id":23,"parentId":19,"tags":{"page":"/api/context/aider"},"startTime":1781330511839,"traceId":"318220d88ba8a9c9"},{"name":"is-page-static","duration":635161,"timestamp":109776077089,"id":45,"parentId":29,"tags":{},"startTime":1781330511848,"traceId":"318220d88ba8a9c9"},{"name":"check-page","duration":642698,"timestamp":109776069609,"id":29,"parentId":19,"tags":{"page":"/api/sessions/inject"},"startTime":1781330511841,"traceId":"318220d88ba8a9c9"},{"name":"is-page-static","duration":635632,"timestamp":109776076826,"id":43,"parentId":27,"tags":{},"startTime":1781330511848,"traceId":"318220d88ba8a9c9"},{"name":"check-page","duration":643273,"timestamp":109776069214,"id":27,"parentId":19,"tags":{"page":"/api/files"},"startTime":1781330511840,"traceId":"318220d88ba8a9c9"},{"name":"is-page-static","duration":638423,"timestamp":109776077691,"id":51,"parentId":35,"tags":{},"startTime":1781330511849,"traceId":"318220d88ba8a9c9"},{"name":"check-page","duration":645366,"timestamp":109776070798,"id":35,"parentId":19,"tags":{"page":"/favicon.ico"},"startTime":1781330511842,"traceId":"318220d88ba8a9c9"},{"name":"is-page-static","duration":639216,"timestamp":109776077588,"id":49,"parentId":33,"tags":{},"startTime":1781330511849,"traceId":"318220d88ba8a9c9"},{"name":"check-page","duration":646463,"timestamp":109776070372,"id":33,"parentId":19,"tags":{"page":"/api/sessions/stats"},"startTime":1781330511841,"traceId":"318220d88ba8a9c9"},{"name":"is-page-static","duration":639416,"timestamp":109776081121,"id":52,"parentId":36,"tags":{},"startTime":1781330511852,"traceId":"318220d88ba8a9c9"},{"name":"check-page","duration":649158,"timestamp":109776071412,"id":36,"parentId":19,"tags":{"page":"/"},"startTime":1781330511842,"traceId":"318220d88ba8a9c9"},{"name":"is-page-static","duration":643722,"timestamp":109776077648,"id":50,"parentId":34,"tags":{},"startTime":1781330511849,"traceId":"318220d88ba8a9c9"},{"name":"check-page","duration":650860,"timestamp":109776070540,"id":34,"parentId":19,"tags":{"page":"/api/sessions/stop"},"startTime":1781330511841,"traceId":"318220d88ba8a9c9"},{"name":"is-page-static","duration":644831,"timestamp":109776077302,"id":46,"parentId":30,"tags":{},"startTime":1781330511848,"traceId":"318220d88ba8a9c9"},{"name":"check-page","duration":652316,"timestamp":109776069841,"id":30,"parentId":19,"tags":{"page":"/api/sessions/input"},"startTime":1781330511841,"traceId":"318220d88ba8a9c9"},{"name":"is-page-static","duration":647462,"timestamp":109776077439,"id":47,"parentId":31,"tags":{},"startTime":1781330511848,"traceId":"318220d88ba8a9c9"},{"name":"check-page","duration":654910,"timestamp":109776070024,"id":31,"parentId":19,"tags":{"page":"/api/sessions/launch"},"startTime":1781330511841,"traceId":"318220d88ba8a9c9"},{"name":"is-page-static","duration":650874,"timestamp":109776077514,"id":48,"parentId":32,"tags":{},"startTime":1781330511848,"traceId":"318220d88ba8a9c9"},{"name":"check-page","duration":658223,"timestamp":109776070201,"id":32,"parentId":19,"tags":{"page":"/api/sessions"},"startTime":1781330511841,"traceId":"318220d88ba8a9c9"},{"name":"static-check","duration":663346,"timestamp":109776065101,"id":19,"parentId":1,"tags":{},"startTime":1781330511836,"traceId":"318220d88ba8a9c9"},{"name":"write-routes-manifest","duration":931,"timestamp":109776729531,"id":54,"parentId":1,"tags":{},"startTime":1781330512500,"traceId":"318220d88ba8a9c9"},{"name":"load-dotenv","duration":31,"timestamp":109776746224,"id":57,"parentId":56,"tags":{},"startTime":1781330512517,"traceId":"318220d88ba8a9c9"},{"name":"run-export-path-map","duration":368,"timestamp":109776751254,"id":58,"parentId":56,"tags":{},"startTime":1781330512522,"traceId":"318220d88ba8a9c9"},{"name":"next-export","duration":642152,"timestamp":109776745298,"id":56,"parentId":1,"tags":{},"startTime":1781330512516,"traceId":"318220d88ba8a9c9"},{"name":"move-exported-app-not-found-","duration":2643,"timestamp":109777390296,"id":59,"parentId":55,"tags":{},"startTime":1781330513161,"traceId":"318220d88ba8a9c9"},{"name":"move-exported-app-global-error-","duration":2473,"timestamp":109777393092,"id":60,"parentId":55,"tags":{},"startTime":1781330513164,"traceId":"318220d88ba8a9c9"},{"name":"static-generation","duration":665040,"timestamp":109776734898,"id":55,"parentId":1,"tags":{},"startTime":1781330512506,"traceId":"318220d88ba8a9c9"},{"name":"write-routes-manifest","duration":975,"timestamp":109777400109,"id":61,"parentId":1,"tags":{},"startTime":1781330513171,"traceId":"318220d88ba8a9c9"},{"name":"print-tree-view","duration":3152,"timestamp":109777412297,"id":62,"parentId":1,"tags":{},"startTime":1781330513183,"traceId":"318220d88ba8a9c9"},{"name":"write-route-bundle-stats","duration":10086,"timestamp":109777415489,"id":63,"parentId":1,"tags":{},"startTime":1781330513186,"traceId":"318220d88ba8a9c9"},{"name":"telemetry-flush","duration":231205,"timestamp":109777425610,"id":64,"parentId":1,"tags":{},"startTime":1781330513197,"traceId":"318220d88ba8a9c9"},{"name":"next-build","duration":7584270,"timestamp":109770072571,"id":1,"tags":{"buildMode":"default","version":"16.2.6","bundler":"turbopack","has-custom-webpack-config":"false","use-build-worker":"true"},"startTime":1781330505844,"traceId":"318220d88ba8a9c9"}]
package/.next/trace-build CHANGED
@@ -1 +1 @@
1
- [{"name":"run-turbopack","duration":2602074,"timestamp":106110753848,"id":14,"parentId":1,"tags":{},"startTime":1781326846526,"traceId":"ba37f844718c1515"},{"name":"turbopack-build-events","duration":75,"timestamp":106111080252,"id":15,"parentId":1,"tags":{},"startTime":1781326846852,"traceId":"ba37f844718c1515"},{"name":"run-typescript","duration":3843622,"timestamp":106113367678,"id":16,"parentId":1,"tags":{},"startTime":1781326849139,"traceId":"ba37f844718c1515"},{"name":"static-check","duration":870331,"timestamp":106117333425,"id":19,"parentId":1,"tags":{},"startTime":1781326853105,"traceId":"ba37f844718c1515"},{"name":"static-generation","duration":776612,"timestamp":106118210472,"id":55,"parentId":1,"tags":{},"startTime":1781326853982,"traceId":"ba37f844718c1515"},{"name":"telemetry-flush","duration":179559,"timestamp":106119018402,"id":64,"parentId":1,"tags":{},"startTime":1781326854790,"traceId":"ba37f844718c1515"},{"name":"next-build","duration":8567043,"timestamp":106110630941,"id":1,"tags":{"buildMode":"default","version":"16.2.6","bundler":"turbopack","has-custom-webpack-config":"false","use-build-worker":"true"},"startTime":1781326846403,"traceId":"ba37f844718c1515"}]
1
+ [{"name":"run-turbopack","duration":2349741,"timestamp":109770187670,"id":14,"parentId":1,"tags":{},"startTime":1781330505959,"traceId":"318220d88ba8a9c9"},{"name":"turbopack-build-events","duration":61,"timestamp":109770478803,"id":15,"parentId":1,"tags":{},"startTime":1781330506250,"traceId":"318220d88ba8a9c9"},{"name":"run-typescript","duration":3412340,"timestamp":109772547016,"id":16,"parentId":1,"tags":{},"startTime":1781330508318,"traceId":"318220d88ba8a9c9"},{"name":"static-check","duration":663346,"timestamp":109776065101,"id":19,"parentId":1,"tags":{},"startTime":1781330511836,"traceId":"318220d88ba8a9c9"},{"name":"static-generation","duration":665040,"timestamp":109776734898,"id":55,"parentId":1,"tags":{},"startTime":1781330512506,"traceId":"318220d88ba8a9c9"},{"name":"telemetry-flush","duration":231205,"timestamp":109777425610,"id":64,"parentId":1,"tags":{},"startTime":1781330513197,"traceId":"318220d88ba8a9c9"},{"name":"next-build","duration":7584270,"timestamp":109770072571,"id":1,"tags":{"buildMode":"default","version":"16.2.6","bundler":"turbopack","has-custom-webpack-config":"false","use-build-worker":"true"},"startTime":1781330505844,"traceId":"318220d88ba8a9c9"}]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neural-loom",
3
- "version": "0.2.7",
3
+ "version": "0.2.9",
4
4
  "bin": {
5
5
  "neural-loom": "./bin/cli.js"
6
6
  },
@@ -1463,7 +1463,9 @@ export default function IdeLayout({ sessionId, workspaceRoot, scopedDirs, onClos
1463
1463
  const ideContainerStyle: React.CSSProperties = {
1464
1464
  display: "flex",
1465
1465
  width: "100%",
1466
- height: "calc(100vh - 120px)",
1466
+ height: "100%",
1467
+ flex: 1,
1468
+ minHeight: 0,
1467
1469
  backgroundColor: "#05070a",
1468
1470
  border: "1px solid var(--border)",
1469
1471
  borderRadius: "12px",
@@ -1654,7 +1656,7 @@ const emptyEditorStateStyle: React.CSSProperties = {
1654
1656
  };
1655
1657
 
1656
1658
  const terminalPanelStyle: React.CSSProperties = {
1657
- height: "360px",
1659
+ flex: 1.4,
1658
1660
  backgroundColor: "#05070a",
1659
1661
  display: "flex",
1660
1662
  flexDirection: "column",
@@ -328,3 +328,12 @@
328
328
  color: #f1fa8c;
329
329
  }
330
330
 
331
+ .containerActive {
332
+ height: 100vh;
333
+ min-height: 100vh;
334
+ max-height: 100vh;
335
+ padding: 1rem 1.5rem;
336
+ gap: 1rem;
337
+ overflow: hidden;
338
+ }
339
+
package/src/app/page.tsx CHANGED
@@ -198,7 +198,7 @@ export default function Home() {
198
198
  };
199
199
 
200
200
  return (
201
- <div className={styles.container}>
201
+ <div className={`${styles.container} ${activeSession ? styles.containerActive : ""}`}>
202
202
  {/* Header */}
203
203
  <header className={styles.header}>
204
204
  <div className={styles.logoArea}>
@@ -213,7 +213,7 @@ export default function Home() {
213
213
 
214
214
  {/* Main Dashboard Grid or Active Session IDE */}
215
215
  {activeSession ? (
216
- <div style={{ padding: "0 2rem", marginBottom: "2rem" }}>
216
+ <div style={{ flex: 1, minHeight: 0, display: "flex", flexDirection: "column" }}>
217
217
  <IdeLayout
218
218
  sessionId={activeSession.id}
219
219
  workspaceRoot={activeSession.workspaceRoot || ""}
@@ -541,7 +541,7 @@ export default function Home() {
541
541
 
542
542
  {/* Footer */}
543
543
  <footer className={styles.footer}>
544
- <span>NeuralLoom v0.2.7 — Experimental AI Orchestrator Bridge</span>
544
+ <span>NeuralLoom v0.2.9 — Experimental AI Orchestrator Bridge</span>
545
545
  <span>Directory: C:\Users\Dave\OneDrive\Projects\JS\neural-loom</span>
546
546
  </footer>
547
547
 
@@ -86,7 +86,7 @@ export class AiderRunner extends AgentRunner {
86
86
  extraFlags: "",
87
87
  };
88
88
 
89
- const aiderConfigPath = path.join(process.cwd(), ".ai", "neural-loom", "aider.json");
89
+ const aiderConfigPath = path.join(process.env.ORIGINAL_CWD || process.cwd(), ".ai", "neural-loom", "aider.json");
90
90
  if (fs.existsSync(aiderConfigPath)) {
91
91
  try {
92
92
  aiderConfig = JSON.parse(fs.readFileSync(aiderConfigPath, "utf8"));
@@ -117,7 +117,7 @@ export class AiderRunner extends AgentRunner {
117
117
 
118
118
  const targetCwd = (this.workspaceRoot && fs.existsSync(this.workspaceRoot))
119
119
  ? this.workspaceRoot
120
- : process.cwd();
120
+ : process.env.ORIGINAL_CWD || process.cwd();
121
121
 
122
122
  if (this.type === "aider-docker") {
123
123
  this.appendLog("[System] Verifying Docker environment accessibility...\r\n");
@@ -81,7 +81,7 @@ export class ClaudeRunner extends AgentRunner {
81
81
 
82
82
  const targetCwd = (this.workspaceRoot && fs.existsSync(this.workspaceRoot))
83
83
  ? this.workspaceRoot
84
- : process.cwd();
84
+ : process.env.ORIGINAL_CWD || process.cwd();
85
85
 
86
86
  // Spawn bash and run 'claude' command
87
87
  this.ptyProcess = this.ptyModule!.spawn(bashPath, ["-c", "claude"], {
@@ -2,7 +2,9 @@ import fs from "fs";
2
2
  import path from "path";
3
3
 
4
4
  export class ContextManager {
5
- private static workspaceRoot = process.cwd();
5
+ private static get workspaceRoot(): string {
6
+ return process.env.ORIGINAL_CWD || process.cwd();
7
+ }
6
8
 
7
9
  private static ensureDirs(root: string) {
8
10
  const aiDir = path.join(root, ".ai", "neural-loom");
@@ -16,7 +18,7 @@ export class ContextManager {
16
18
  }
17
19
  }
18
20
 
19
- public static initializeStaging(root: string = process.cwd()) {
21
+ public static initializeStaging(root: string = process.env.ORIGINAL_CWD || process.cwd()) {
20
22
  this.ensureDirs(root);
21
23
 
22
24
  // Create /ccp.md custom slash command file
@@ -38,30 +40,30 @@ export class ContextManager {
38
40
  }
39
41
  }
40
42
 
41
- public static updatePrompt(promptText: string, root: string = process.cwd()) {
43
+ public static updatePrompt(promptText: string, root: string = process.env.ORIGINAL_CWD || process.cwd()) {
42
44
  this.ensureDirs(root);
43
45
  const promptFile = path.join(root, ".ai", "neural-loom", "cprompt.md");
44
46
  fs.writeFileSync(promptFile, promptText);
45
47
  }
46
48
 
47
- public static updateContext(contextText: string, root: string = process.cwd()) {
49
+ public static updateContext(contextText: string, root: string = process.env.ORIGINAL_CWD || process.cwd()) {
48
50
  this.ensureDirs(root);
49
51
  const contextFile = path.join(root, ".ai", "neural-loom", "ccontext.md");
50
52
  fs.writeFileSync(contextFile, contextText);
51
53
  }
52
54
 
53
- public static updateRules(rulesText: string, root: string = process.cwd()) {
55
+ public static updateRules(rulesText: string, root: string = process.env.ORIGINAL_CWD || process.cwd()) {
54
56
  this.ensureDirs(root);
55
57
  const agentsMdPath = path.join(root, "AGENTS.md");
56
58
  fs.writeFileSync(agentsMdPath, rulesText, "utf8");
57
59
  }
58
60
 
59
- public static loadPrompt(root: string = process.cwd()): string {
61
+ public static loadPrompt(root: string = process.env.ORIGINAL_CWD || process.cwd()): string {
60
62
  const promptFile = path.join(root, ".ai", "neural-loom", "cprompt.md");
61
63
  return fs.existsSync(promptFile) ? fs.readFileSync(promptFile, "utf8") : "";
62
64
  }
63
65
 
64
- public static loadRules(root: string = process.cwd()): string {
66
+ public static loadRules(root: string = process.env.ORIGINAL_CWD || process.cwd()): string {
65
67
  const agentsMdPath = path.join(root, "AGENTS.md");
66
68
  return fs.existsSync(agentsMdPath) ? fs.readFileSync(agentsMdPath, "utf8") : "";
67
69
  }
@@ -70,7 +72,7 @@ export class ContextManager {
70
72
  this.compileSessionContext();
71
73
  }
72
74
 
73
- public static compileSessionContext(root: string = process.cwd(), scopedDirs?: string[]) {
75
+ public static compileSessionContext(root: string = process.env.ORIGINAL_CWD || process.cwd(), scopedDirs?: string[]) {
74
76
  this.ensureDirs(root);
75
77
  this.initializeStaging(root);
76
78
 
@@ -79,7 +79,7 @@ export class DockerRunner extends AgentRunner {
79
79
 
80
80
  const targetCwd = (this.workspaceRoot && fs.existsSync(this.workspaceRoot))
81
81
  ? this.workspaceRoot
82
- : process.cwd();
82
+ : process.env.ORIGINAL_CWD || process.cwd();
83
83
 
84
84
  // Check if docker executable exists by spawning `docker -v`
85
85
  const testPty = this.ptyModule!.spawn(bashPath, ["-c", "docker --version"], {
@@ -79,7 +79,7 @@ export class SSHRunner extends AgentRunner {
79
79
  return;
80
80
  }
81
81
 
82
- const configPath = path.join(process.cwd(), ".ai", "neural-loom", "ssh.json");
82
+ const configPath = path.join(process.env.ORIGINAL_CWD || process.cwd(), ".ai", "neural-loom", "ssh.json");
83
83
  if (!fs.existsSync(configPath)) {
84
84
  this.status = 'stopped';
85
85
  this.appendLog("\x1b[1;31m[Configuration Error] ssh.json not found!\x1b[0m\r\n");
@@ -126,7 +126,7 @@ export class SSHRunner extends AgentRunner {
126
126
  name: "xterm-256color",
127
127
  cols: 120,
128
128
  rows: 30,
129
- cwd: process.cwd(),
129
+ cwd: process.env.ORIGINAL_CWD || process.cwd(),
130
130
  env: {
131
131
  ...process.env,
132
132
  TERM: "xterm-256color",
@@ -125,7 +125,7 @@ export class SessionManager {
125
125
  const runner = this.sessions.get(id);
126
126
  if (!runner || runner.status !== 'running') return false;
127
127
 
128
- const root = runner.workspaceRoot || process.cwd();
128
+ const root = runner.workspaceRoot || process.env.ORIGINAL_CWD || process.cwd();
129
129
 
130
130
  if (command === '/ccc' || command === '/ccp') {
131
131
  ContextManager.compileSessionContext(root, runner.scopedDirs);
@@ -13,7 +13,9 @@ export interface PersistedSession {
13
13
  }
14
14
 
15
15
  export class SessionPersister {
16
- private static workspaceRoot = process.cwd();
16
+ private static get workspaceRoot(): string {
17
+ return process.env.ORIGINAL_CWD || process.cwd();
18
+ }
17
19
 
18
20
  private static getSessionsDir(): string {
19
21
  const dir = path.join(this.workspaceRoot, ".ai", "neural-loom", "sessions");
@@ -1 +0,0 @@
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);let n={display:"flex",width:"100%",height:"calc(100vh - 120px)",backgroundColor:"#05070a",border:"1px solid var(--border)",borderRadius:"12px",overflow:"hidden",boxShadow:"0 20px 25px -5px rgba(0, 0, 0, 0.6)"},i={width:"50px",backgroundColor:"#030406",borderRight:"1px solid var(--border)",display:"flex",flexDirection:"column",justifyContent:"space-between",alignItems:"center",padding:"0.75rem 0"},l={display:"flex",flexDirection:"column",width:"100%",gap:"0.5rem"},a={width:"100%",height:"45px",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",fontSize:"1.25rem",transition:"all 0.15s ease"},s={width:"260px",backgroundColor:"#080c14",borderRight:"1px solid var(--border)",display:"flex",flexDirection:"column",overflow:"hidden"},d={padding:"0.75rem 1rem",borderBottom:"1px solid var(--border)",display:"flex",alignItems:"center",justifyContent:"space-between",background:"rgba(255,255,255,0.02)"},c={flex:1,overflowY:"auto",padding:"0.75rem 0"},p={padding:"0.25rem 1rem",fontSize:"0.75rem",fontWeight:700,color:"var(--muted)",display:"flex",alignItems:"center",justifyContent:"space-between",textTransform:"uppercase",letterSpacing:"0.05em"},m={fontSize:"0.6rem",backgroundColor:"rgba(59, 130, 246, 0.1)",color:"#3b82f6",padding:"0.1rem 0.3rem",borderRadius:"3px",textTransform:"none",letterSpacing:"normal"},u={fontSize:"0.75rem",fontWeight:600,color:"var(--foreground)"},h={flex:1,display:"flex",flexDirection:"column",overflow:"hidden",backgroundColor:"#0b101b"},f={flex:1,display:"flex",flexDirection:"column",borderBottom:"1px solid var(--border)",overflow:"hidden"},g={height:"35px",backgroundColor:"#05070a",borderBottom:"1px solid var(--border)",display:"flex",alignItems:"center",justifyContent:"space-between",paddingRight:"0.75rem"},x={display:"flex",height:"100%",overflowX:"auto"},y={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"},b={fontSize:"0.65rem",color:"var(--muted)",cursor:"pointer",padding:"2px"},v={color:"var(--primary)",fontSize:"0.65rem",marginLeft:"2px"},j={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},C={flex:1,position:"relative",overflow:"hidden"},w={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},S={display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100%",color:"var(--muted)",textAlign:"center",padding:"2rem"},k={height:"360px",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)"},T={padding:"0.3rem 0.6rem",borderRadius:"4px",border:"1px solid var(--primary)",backgroundColor:"transparent",color:"var(--primary)",fontSize:"0.7rem",fontWeight:600,cursor:"pointer"},R={padding:"0.3rem 0.6rem",borderRadius:"4px",border:"1px solid var(--success)",backgroundColor:"transparent",color:"var(--success)",fontSize:"0.7rem",fontWeight:600,cursor:"pointer"},I={flex:1,overflow:"hidden"};function P({node:e,onSelect:o,onCreate:n,onRename:i,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%"},h={display:"flex",alignItems:"center",gap:"0.375rem",flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},f={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:h,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:f,children:[(0,t.jsx)("button",{onClick:t=>x(t,()=>n(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,()=>n(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,()=>i(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)(P,{node:e,onSelect:o,onCreate:n,onRename:i,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:h,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:f,children:[(0,t.jsx)("button",{onClick:t=>x(t,()=>i(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 F={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)"},W={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)"},L={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"},O={backgroundColor:"transparent",border:"1px solid var(--border)",color:"var(--foreground)",padding:"0.5rem 1rem",borderRadius:"6px",fontSize:"0.8rem",fontWeight:600,cursor:"pointer"},E={backgroundColor:"var(--primary)",border:"none",color:"#ffffff",padding:"0.5rem 1rem",borderRadius:"6px",fontSize:"0.8rem",fontWeight:600,cursor:"pointer"},M={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"},N={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"},$={maxHeight:"300px",overflowY:"auto",padding:"0.25rem 0"},A={display:"flex",alignItems:"center",padding:"0.5rem 1rem",cursor:"pointer",transition:"all 0.1s ease",justifyContent:"space-between"},V={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"},J={fontSize:"0.6rem",color:"var(--muted)",textTransform:"uppercase"},K={fontSize:"1.1rem",fontWeight:700,fontFamily:"var(--font-mono)"},_={width:"100%",height:"6px",backgroundColor:"rgba(255,255,255,0.05)",borderRadius:"3px",overflow:"hidden"},H={height:"100%",borderRadius:"3px",transition:"width 0.5s ease-out"},Y={padding:"0.35rem 1rem",borderBottom:"1px solid var(--border)",backgroundColor:"#030406",display:"flex",alignItems:"center",gap:"0.75rem",flexWrap:"nowrap",overflowX:"auto"},X={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"},G={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:q,scopedDirs:Z,onClose:ee,sessions:et,onSwitchSession:er}){let eo=JSON.stringify(Z),[en,ei]=(0,r.useState)(null),[el,ea]=(0,r.useState)([]),[es,ed]=(0,r.useState)({}),[ec,ep]=(0,r.useState)({}),em=es[e]||[],eu=ec[e]||null,eh=(0,r.useCallback)(t=>{ed(r=>{let o=r[e]||[],n="function"==typeof t?t(o):t;return{...r,[e]:n}})},[e]),ef=(0,r.useCallback)(t=>{ep(r=>({...r,[e]:t}))},[e]),[eg,ex]=(0,r.useState)(!0),[ey,eb]=(0,r.useState)("explorer"),[ev,ej]=(0,r.useState)(!1),[eC,ew]=(0,r.useState)([]),[eS,ek]=(0,r.useState)(!1),[ez,eT]=(0,r.useState)(!1),[eR,eI]=(0,r.useState)(null),[eP,eF]=(0,r.useState)(null),[eW,eL]=(0,r.useState)(""),[eD,eO]=(0,r.useState)([]),[eE,eM]=(0,r.useState)(""),[eB,eU]=(0,r.useState)(""),[eN,e$]=(0,r.useState)(null),eA=(0,r.useCallback)(async()=>{await new Promise(e=>setTimeout(e,0)),eT(!0);try{let e=await fetch(`/api/git?action=status&root=${encodeURIComponent(q)}`);if(e.ok){let t=await e.json();t.success&&(ek(t.isGit),ew(t.files||[]))}}catch(e){console.error("Failed to load git status:",e)}finally{eT(!1)}},[q]);(0,r.useEffect)(()=>{setTimeout(()=>{eA()},0);let e=setInterval(eA,5e3);return()=>clearInterval(e)},[eA]),(0,r.useEffect)(()=>{let t=async()=>{try{let t=await fetch(`/api/sessions?id=${e}`);if(t.ok){let e=await t.json();eI(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();eF(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(()=>{eO(t)},0)}catch{}},[]);let eV=e=>{eO(e),localStorage.setItem("neural_loom_custom_commands",JSON.stringify(e))},eJ=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)}},eK=eR?.type?.includes("aider"),[e_,eH]=(0,r.useState)({type:null,targetPath:null,inputValue:"",error:null}),[eY,eX]=(0,r.useState)(!1),[eG,eQ]=(0,r.useState)(""),[eq,eZ]=(0,r.useState)([]),[e0,e5]=(0,r.useState)(0),e1=(0,r.useCallback)(async()=>{await new Promise(e=>setTimeout(e,0)),ej(!0);try{let e=Z&&Z.length>0?`&scoped=${encodeURIComponent(Z.join(","))}`:"",t=await fetch(`/api/files?action=list&root=${encodeURIComponent(q)}${e}`);if(t.ok){let e=await t.json();e.success&&(ei(e.workspace),ea(e.scoped||[]))}}catch(e){console.error("Failed to load file explorer:",e)}finally{ej(!1)}},[q,eo]);(0,r.useEffect)(()=>{setTimeout(()=>{e1()},0)},[e1]);let e2=(e,t)=>{eH({type:"file"===t?"create-file":"create-folder",targetPath:e,inputValue:"",error:null})},e7=e=>{let t=e.split(/[/\\]/).pop()||"";eH({type:"rename",targetPath:e,inputValue:t,error:null})},e8=e=>{eH({type:"delete",targetPath:e,inputValue:"",error:null})},e6=async e=>{if(e&&e.preventDefault(),e_.type&&e_.targetPath){eH(e=>({...e,error:null}));try{if("create-file"===e_.type||"create-folder"===e_.type){if(!e_.inputValue.trim())return void eH(e=>({...e,error:"Name cannot be empty"}));let e=`${e_.targetPath}/${e_.inputValue.trim()}`,t="create-file"===e_.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?(eH({type:null,targetPath:null,inputValue:"",error:null}),await e1(),"file"===t&&await e4(e)):eH(e=>({...e,error:o.error||"Failed to create item"}))}else{let e=await r.json();eH(t=>({...t,error:e.error||"Failed to create item"}))}}if("rename"===e_.type){if(!e_.inputValue.trim())return void eH(e=>({...e,error:"Name cannot be empty"}));let e=e_.targetPath.replace(/\\/g,"/"),t=e.substring(0,e.lastIndexOf("/")),r=t?`${t}/${e_.inputValue.trim()}`:e_.inputValue.trim(),o=await fetch("/api/files",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"rename",oldPath:e_.targetPath,newPath:r})});if(o.ok){let e=await o.json();e.success?(eh(e=>e.map(e=>e.path===e_.targetPath?{...e,path:r,name:e_.inputValue.trim()}:e)),eu===e_.targetPath&&ef(r),eH({type:null,targetPath:null,inputValue:"",error:null}),await e1()):eH(t=>({...t,error:e.error||"Failed to rename item"}))}else{let e=await o.json();eH(t=>({...t,error:e.error||"Failed to rename item"}))}}if("delete"===e_.type){let e=await fetch("/api/files",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"delete",path:e_.targetPath})});if(e.ok){let t=await e.json();t.success?(e9(e_.targetPath),eH({type:null,targetPath:null,inputValue:"",error:null}),await e1()):eH(e=>({...e,error:t.error||"Failed to delete item"}))}else{let t=await e.json();eH(e=>({...e,error:t.error||"Failed to delete item"}))}}}catch(e){console.error("File operation failed:",e),eH(e=>({...e,error:"An unexpected error occurred"}))}}},e3=(0,r.useCallback)(async()=>{try{let e=Z&&Z.length>0?`&scoped=${encodeURIComponent(Z.join(","))}`:"",t=await fetch(`/api/files?action=flat_list&root=${encodeURIComponent(q)}${e}`);if(t.ok){let e=await t.json();e.success&&e.files&&eZ(e.files)}}catch(e){console.error("Failed to load flat files list:",e)}},[q,eo]);(0,r.useEffect)(()=>{eY&&setTimeout(()=>{eQ(""),e5(0),e3()},0)},[eY,e3]);let e4=async e=>{if(em.find(t=>t.path===e))return void ef(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};eh([...em,t]),ef(e)}}}catch(t){console.error(`Failed to read file ${e}:`,t)}},e9=e=>{let t=em.filter(t=>t.path!==e);eh(t),eu===e&&ef(t.length>0?t[t.length-1].path:null)},te=em.find(e=>e.path===eu),tt=(0,r.useCallback)(async()=>{if(te)try{(await fetch("/api/files",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"write",path:te.path,content:te.content})})).ok&&eh(e=>e.map(e=>e.path===eu?{...e,isModified:!1}:e))}catch(e){console.error(`Failed to save file ${te.path}:`,e)}},[te,eu,eh]);(0,r.useEffect)(()=>{let e=e=>{(e.ctrlKey||e.metaKey)&&"s"===e.key&&(e.preventDefault(),tt()),(e.ctrlKey||e.metaKey)&&"p"===e.key&&(e.preventDefault(),eX(e=>!e))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[tt]);let tr=eq.filter(e=>e.name.toLowerCase().includes(eG.toLowerCase())||e.relativePath.toLowerCase().includes(eG.toLowerCase())).slice(0,10);return(0,t.jsxs)("div",{style:n,children:[(0,t.jsxs)("div",{style:i,children:[(0,t.jsxs)("div",{style:l,children:[(0,t.jsx)("div",{onClick:()=>{"explorer"===ey?ex(!eg):(eb("explorer"),ex(!0))},style:{...a,backgroundColor:"explorer"===ey&&eg?"rgba(255,255,255,0.08)":"transparent",borderLeft:"explorer"===ey&&eg?"2px solid var(--primary)":"2px solid transparent"},title:"File Explorer (Ctrl+P to search files)",children:"📁"}),(0,t.jsx)("div",{onClick:()=>{"git"===ey?ex(!eg):(eb("git"),ex(!0))},style:{...a,backgroundColor:"git"===ey&&eg?"rgba(255,255,255,0.08)":"transparent",borderLeft:"git"===ey&&eg?"2px solid var(--primary)":"2px solid transparent"},title:"Source Control (Git Changes)",children:"🌿"}),(0,t.jsx)("div",{onClick:()=>{"analytics"===ey?ex(!eg):(eb("analytics"),ex(!0))},style:{...a,backgroundColor:"analytics"===ey&&eg?"rgba(255,255,255,0.08)":"transparent",borderLeft:"analytics"===ey&&eg?"2px solid var(--primary)":"2px solid transparent"},title:"Token Usage & Cost Analytics",children:"📊"}),(0,t.jsx)("div",{onClick:()=>{"auditor"===ey?ex(!eg):(eb("auditor"),ex(!0))},style:{...a,backgroundColor:"auditor"===ey&&eg?"rgba(255,255,255,0.08)":"transparent",borderLeft:"auditor"===ey&&eg?"2px solid var(--primary)":"2px solid transparent"},title:"Session Log Auditor & Search",children:"🔍"})]}),(0,t.jsx)("div",{onClick:ee,style:{...a,color:"var(--danger)",fontSize:"1rem"},title:"Exit Session Layout",children:"✖"})]}),eg&&(0,t.jsxs)("div",{style:s,children:[(0,t.jsxs)("div",{style:d,children:[(0,t.jsxs)("span",{style:{fontWeight:700,fontSize:"0.75rem",textTransform:"uppercase",letterSpacing:"0.05em"},children:["explorer"===ey&&"Workspace Explorer","git"===ey&&"Source Control","analytics"===ey&&"Telemetry & Cost","auditor"===ey&&"Session Auditor"]}),"explorer"===ey&&(0,t.jsxs)("div",{style:{display:"flex",gap:"0.25rem"},children:[en&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{onClick:()=>e2(en.path,"file"),style:M,title:"New File at Root...",children:"📄+"}),(0,t.jsx)("button",{onClick:()=>e2(en.path,"directory"),style:M,title:"New Folder at Root...",children:"📁+"})]}),(0,t.jsx)("button",{onClick:e1,disabled:ev,style:M,title:"Refresh tree",children:"🔄"})]}),"git"===ey&&(0,t.jsx)("button",{onClick:eA,disabled:ez,style:M,title:"Refresh git status",children:"🔄"})]}),(0,t.jsxs)("div",{style:c,children:["explorer"===ey&&(0,t.jsxs)(t.Fragment,{children:[en?(0,t.jsxs)("div",{style:{marginBottom:"1.5rem"},children:[(0,t.jsxs)("div",{style:p,children:["💼 ",en.name," ",(0,t.jsx)("span",{style:m,title:en.path,children:"root"})]}),(0,t.jsx)("div",{style:{padding:"0.25rem 0.5rem"},children:en.tree.map(e=>(0,t.jsx)(P,{node:e,onSelect:e4,onCreate:e2,onRename:e7,onDelete:e8,isReadOnly:!1},e.path))})]}):(0,t.jsx)("div",{style:{padding:"1rem",color:"var(--muted)",fontSize:"0.8rem"},children:"Scanning Workspace directory..."}),el.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{style:{...p,borderTop:"1px solid var(--border)",paddingTop:"1rem"},children:["🔍 Scoped Folders (",el.length,")"]}),el.map(e=>(0,t.jsxs)("div",{style:{marginTop:"0.75rem",padding:"0 0.5rem"},children:[(0,t.jsxs)("div",{style:{...u,display:"flex",gap:"0.25rem",color:"#a855f7",fontSize:"0.75rem",fontWeight:700,padding:"0.25rem"},title:e.path,children:["🔗 ",e.name,"/"]}),(0,t.jsx)("div",{style:{paddingLeft:"0.25rem"},children:e.tree.map(e=>(0,t.jsx)(P,{node:e,onSelect:e4,onCreate:e2,onRename:e7,onDelete:e8,isReadOnly:!0},e.path))})]},e.path))]})]}),"git"===ey&&(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"}),eS?0===eC.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:eC.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(q)}`);if(t.ok){let r=await t.json();if(r.success){let t=`diff:${e.relativePath}`;em.some(e=>e.path===t)||eh(o=>[...o,{name:`Diff: ${e.name}`,path:t,content:r.diff,isModified:!1}]),ef(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"===ey&&(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:V,children:[(0,t.jsx)("div",{style:J,children:"Input"}),(0,t.jsx)("div",{style:K,children:(eR?.tokenUsage?.input??0).toLocaleString()})]}),(0,t.jsxs)("div",{style:V,children:[(0,t.jsx)("div",{style:J,children:"Output"}),(0,t.jsx)("div",{style:K,children:(eR?.tokenUsage?.output??0).toLocaleString()})]}),(0,t.jsxs)("div",{style:{...V,gridColumn:"span 2"},children:[(0,t.jsx)("div",{style:J,children:"Cost"}),(0,t.jsxs)("div",{style:{...K,color:"#10b981",fontSize:"1.25rem"},children:["$",(eR?.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:eP?.cpu??"0.0%"})]}),(0,t.jsx)("div",{style:_,children:(0,t.jsx)("div",{style:{...H,width:eP?.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:eP?.memory??"0.0MiB"})]}),(0,t.jsx)("div",{style:_,children:(0,t.jsx)("div",{style:{...H,width:eP?.memoryPercent||"0%",backgroundColor:"#eab308"}})})]}),(0,t.jsx)("div",{style:{fontSize:"0.6rem",color:"var(--muted)",marginTop:"0.25rem",fontStyle:"italic"},children:eP?.type?.includes("docker")?"🐳 Docker container statistics":"💻 Local process statistics"})]})]})]}),"auditor"===ey&&(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:eW,onChange:e=>eL(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(!eR?.logs)return;let t=new Blob([eR.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(!eR?.logs||0===eR.logs.length)return(0,t.jsx)("div",{style:{color:"var(--muted)",fontStyle:"italic",textAlign:"center"},children:"No logs captured."});let e=eR.logs.join("").replace(/\x1b\[[0-9;]*m/g,"").split(/\r?\n/),r=eW.trim()?e.filter(e=>e.toLowerCase().includes(eW.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(!eW.trim())return(0,t.jsx)("div",{children:e},r);let o=e.split(RegExp(`(${eW})`,"gi"));return(0,t.jsx)("div",{children:o.map((e,r)=>e.toLowerCase()===eW.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:eE,onChange:e=>eM(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:eB,onChange:e=>eU(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:()=>{eE.trim()&&eB.trim()&&(eV([...eD,{name:eE.trim(),command:eB.trim()}]),eM(""),eU(""))},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"}),eD.length>0&&(0,t.jsx)("div",{style:{marginTop:"0.25rem",maxHeight:"60px",overflowY:"auto"},children:eD.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:()=>{eV(eD.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:G,children:(0,t.jsx)("div",{style:{display:"flex",gap:"0.25rem",overflowX:"auto"},children:et.map(r=>{let o=r.id===e,n="running"===r.status?"#10b981":"rgba(255,255,255,0.2)";return(0,t.jsxs)("div",{onClick:()=>{eN===r.id&&e$(null),er(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:n,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:f,children:[(0,t.jsxs)("div",{style:g,children:[(0,t.jsx)("div",{style:x,children:em.map(e=>(0,t.jsxs)("div",{style:{...y,backgroundColor:eu===e.path?"#0b101b":"rgba(8,12,20,0.4)",borderColor:eu===e.path?"var(--border-focus)":"transparent",color:eu===e.path?"var(--foreground)":"var(--muted)"},onClick:()=>ef(e.path),children:[(0,t.jsxs)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[e.name," ",e.isModified&&(0,t.jsx)("span",{style:v,children:"●"})]}),(0,t.jsx)("span",{onClick:t=>{t.stopPropagation(),e9(e.path)},style:b,children:"✖"})]},e.path))}),te&&!te.path.startsWith("diff:")&&(0,t.jsx)("button",{onClick:tt,disabled:!te.isModified,style:{...j,opacity:te.isModified?1:.5,cursor:te.isModified?"pointer":"not-allowed"},children:"💾 Save (Ctrl+S)"})]}),(0,t.jsx)("div",{style:C,children:te?te.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:te.content.split("\n").map((e,r)=>{let o="#e2e8f0",n="transparent";return e.startsWith("+")?(o="#4ade80",n="rgba(74, 222, 128, 0.08)"):e.startsWith("-")?(o="#f87171",n="rgba(248, 113, 113, 0.08)"):e.startsWith("@@")&&(o="#60a5fa",n="rgba(96, 165, 250, 0.05)"),(0,t.jsx)("div",{style:{color:o,backgroundColor:n,whiteSpace:"pre-wrap",padding:"0.1rem 0.5rem"},children:e},r)})}):(0,t.jsx)("textarea",{value:te.content,onChange:e=>{var t;return t=e.target.value,void(eu&&eh(em.map(e=>e.path===eu?{...e,content:t,isModified:!0}:e)))},style:w,spellCheck:!1}):(0,t.jsxs)("div",{style:S,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:k,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 ",eN&&"(Split View Active)"]}),(0,t.jsxs)("div",{style:{display:"flex",gap:"0.5rem",alignItems:"center"},children:[(0,t.jsxs)("select",{onChange:e=>{e$(e.target.value||null)},value:eN||"",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"}),et.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:T,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:R,children:"⚡ Trigger Prompt (/ccp)"})]})]}),(0,t.jsxs)("div",{style:Y,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:[eK?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{onClick:()=>eJ("/undo"),style:X,title:"Aider: undo last commit",children:"/undo"}),(0,t.jsx)("button",{onClick:()=>eJ("/diff"),style:X,title:"Aider: show git diff",children:"/diff"}),(0,t.jsx)("button",{onClick:()=>eJ("/commit"),style:X,title:"Aider: commit edits",children:"/commit"}),(0,t.jsx)("button",{onClick:()=>eJ("/test"),style:X,title:"Aider: run tests",children:"/test"}),(0,t.jsx)("button",{onClick:()=>eJ("/clear"),style:X,title:"Clear terminal screen",children:"/clear"})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{onClick:()=>eJ("/compact"),style:X,title:"Claude Code: compact history",children:"/compact"}),(0,t.jsx)("button",{onClick:()=>eJ("/history"),style:X,title:"Claude Code: view history",children:"/history"}),(0,t.jsx)("button",{onClick:()=>eJ("/reset"),style:X,title:"Claude Code: reset conversation",children:"/reset"}),(0,t.jsx)("button",{onClick:()=>eJ("/help"),style:X,title:"Claude Code: show help",children:"/help"})]}),eD.map((e,r)=>(0,t.jsx)("button",{onClick:()=>eJ(e.command),style:{...X,borderColor:"rgba(168, 85, 247, 0.4)",color:"#c084fc"},title:`Inject command: ${e.command}`,children:e.name},r))]})]}),(0,t.jsxs)("div",{style:{...I,display:"flex",width:"100%",height:"100%"},children:[(0,t.jsx)("div",{style:{flex:1,height:"100%",borderRight:eN?"1px solid var(--border)":"none",overflow:"hidden"},children:(0,t.jsx)(o.default,{sessionId:e,height:"100%"})}),eN&&(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: ",et.find(e=>e.id===eN)?.name]}),(0,t.jsx)("button",{onClick:()=>e$(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:eN,height:"100%"})})]})]})]})]}),e_.type&&(0,t.jsx)("div",{style:F,children:(0,t.jsxs)("div",{style:W,children:[(0,t.jsxs)("h3",{style:{margin:"0 0 1rem 0",fontSize:"1rem",fontWeight:600},children:["create-file"===e_.type&&"Create New File","create-folder"===e_.type&&"Create New Folder","rename"===e_.type&&"Rename Item","delete"===e_.type&&"Confirm Deletion"]}),e_.error&&(0,t.jsxs)("div",{style:{color:"var(--danger)",fontSize:"0.8rem",marginBottom:"1rem"},children:["⚠️ ",e_.error]}),"delete"!==e_.type?(0,t.jsxs)("form",{onSubmit:e6,children:[(0,t.jsxs)("div",{style:{marginBottom:"0.5rem",fontSize:"0.75rem",color:"var(--muted)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:e_.targetPath||"",children:["Target: ",e_.targetPath]}),(0,t.jsx)("input",{type:"text",value:e_.inputValue,onChange:e=>eH({...e_,inputValue:e.target.value}),style:L,autoFocus:!0,placeholder:"rename"===e_.type?"Enter new name":"Enter name"}),(0,t.jsxs)("div",{style:D,children:[(0,t.jsx)("button",{type:"button",onClick:()=>eH({type:null,targetPath:null,inputValue:"",error:null}),style:O,children:"Cancel"}),(0,t.jsx)("button",{type:"submit",style:E,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:e_.targetPath})]}),(0,t.jsxs)("div",{style:D,children:[(0,t.jsx)("button",{type:"button",onClick:()=>eH({type:null,targetPath:null,inputValue:"",error:null}),style:O,children:"Cancel"}),(0,t.jsx)("button",{onClick:()=>e6(),style:{...E,backgroundColor:"var(--danger)"},children:"Delete Permanently"})]})]})]})}),eY&&(0,t.jsx)("div",{style:B,onClick:()=>eX(!1),children:(0,t.jsxs)("div",{style:U,onClick:e=>e.stopPropagation(),children:[(0,t.jsx)("input",{type:"text",value:eG,onChange:e=>{eQ(e.target.value),e5(0)},onKeyDown:e=>{"ArrowDown"===e.key?(e.preventDefault(),e5(e=>(e+1)%Math.max(1,tr.length))):"ArrowUp"===e.key?(e.preventDefault(),e5(e=>(e-1+tr.length)%Math.max(1,tr.length))):"Enter"===e.key?(e.preventDefault(),tr[e0]&&(e4(tr[e0].path),eX(!1))):"Escape"===e.key&&(e.preventDefault(),eX(!1))},placeholder:"Search files by name or path...",style:N,autoFocus:!0}),(0,t.jsx)("div",{style:$,children:tr.length>0?tr.map((e,r)=>(0,t.jsxs)("div",{onClick:()=>{e4(e.path),eX(!1)},style:{...A,backgroundColor:r===e0?"rgba(168, 85, 247, 0.15)":"transparent",borderLeft:r===e0?"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"})]})})]})}])},97722,e=>{e.n(e.i(3839))}]);