coder-config 0.43.8 → 0.43.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.
package/lib/constants.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "coder-config",
|
|
3
|
-
"version": "0.43.
|
|
3
|
+
"version": "0.43.9",
|
|
4
4
|
"description": "Configuration manager for AI coding tools - Claude Code, Gemini CLI, Codex CLI, Antigravity. Manage MCPs, rules, permissions, memory, and workstreams.",
|
|
5
5
|
"author": "regression.io",
|
|
6
6
|
"main": "config-loader.js",
|
|
@@ -3957,4 +3957,4 @@ coder-config --help # See all commands
|
|
|
3957
3957
|
Thanks for using Coder Config. We built this to make working with AI coding tools easier and more powerful.
|
|
3958
3958
|
|
|
3959
3959
|
Happy coding!
|
|
3960
|
-
`}},gW={...iW,...oW,...aW,...lW,...cW,...dW,...uW,...hW,...fW,...mW,...pW},Ed={welcome:{bg:"bg-violet-500",light:"bg-violet-100 dark:bg-violet-950",text:"text-violet-600 dark:text-violet-400"},"first-project":{bg:"bg-blue-500",light:"bg-blue-100 dark:bg-blue-950",text:"text-blue-600 dark:text-blue-400"},"rules-guide":{bg:"bg-emerald-500",light:"bg-emerald-100 dark:bg-emerald-950",text:"text-emerald-600 dark:text-emerald-400"},"mcp-guide":{bg:"bg-orange-500",light:"bg-orange-100 dark:bg-orange-950",text:"text-orange-600 dark:text-orange-400"},"permissions-guide":{bg:"bg-green-500",light:"bg-green-100 dark:bg-green-950",text:"text-green-600 dark:text-green-400"},"memory-guide":{bg:"bg-pink-500",light:"bg-pink-100 dark:bg-pink-950",text:"text-pink-600 dark:text-pink-400"},"plugins-guide":{bg:"bg-purple-500",light:"bg-purple-100 dark:bg-purple-950",text:"text-purple-600 dark:text-purple-400"},"workstreams-guide":{bg:"bg-cyan-500",light:"bg-cyan-100 dark:bg-cyan-950",text:"text-cyan-600 dark:text-cyan-400"},"loops-guide":{bg:"bg-teal-500",light:"bg-teal-100 dark:bg-teal-950",text:"text-teal-600 dark:text-teal-400"},"multi-tool-guide":{bg:"bg-amber-500",light:"bg-amber-100 dark:bg-amber-950",text:"text-amber-600 dark:text-amber-400"},"next-steps":{bg:"bg-rose-500",light:"bg-rose-100 dark:bg-rose-950",text:"text-rose-600 dark:text-rose-400"}},Zw="claude-config-tutorial-visited";function xW(){const[e,t]=C.useState("intro"),[n,s]=C.useState({welcome:!0}),[o,d]=C.useState(()=>{try{return JSON.parse(localStorage.getItem(Zw)||"[]")}catch{return[]}}),u=C.useRef(null);C.useEffect(()=>{if(u.current){const b=u.current.querySelector("[data-radix-scroll-area-viewport]");b&&(b.scrollTop=0)}},[e]),C.useEffect(()=>{if(e&&!o.includes(e)){const b=[...o,e];d(b),localStorage.setItem(Zw,JSON.stringify(b))}},[e,o]);const l=b=>{s(j=>({...j,[b]:!j[b]}))},c=gW[e],f=il.flatMap(b=>b.subsections.length>0?b.subsections.map(j=>j.id):[b.id]),m=f.indexOf(e),h=m>0?f[m-1]:null,x=m<f.length-1?f[m+1]:null,w=Math.round(o.length/f.length*100),_=(()=>{for(const b of il)if(b.id===e||b.subsections.some(j=>j.id===e))return b;return il[0]})(),y=Ed[_.id]||Ed.welcome,v=b=>{for(const j of il){if(j.id===b)return j.title;const E=j.subsections.find(P=>P.id===b);if(E)return E.title}return""},g=b=>({__html:JN(b)});return r.jsxs("div",{className:"flex h-full",children:[r.jsxs("div",{className:"w-72 border-r border-border bg-muted/30 flex flex-col",children:[r.jsxs("div",{className:"p-4 border-b border-border bg-gradient-to-r from-indigo-500/10 to-purple-500/10",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"w-10 h-10 rounded-xl bg-gradient-to-br from-indigo-500 to-purple-600 flex items-center justify-center shadow-lg",children:r.jsx(Gd,{className:"w-5 h-5 text-white"})}),r.jsxs("div",{children:[r.jsx("h2",{className:"font-semibold text-foreground",children:"Tutorial"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Step-by-step guide"})]})]}),r.jsxs("div",{className:"mt-3",children:[r.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground mb-1",children:[r.jsx("span",{children:"Progress"}),r.jsxs("span",{children:[w,"% complete"]})]}),r.jsx(s2,{value:w,className:"h-2"})]})]}),r.jsx(Wn,{className:"flex-1",children:r.jsx("div",{className:"p-2",children:il.map((b,j)=>{const E=b.icon,P=Ed[b.id]||Ed.welcome,T=e===b.id||b.subsections.some(M=>M.id===e),N=b.subsections.length>0?b.subsections.every(M=>o.includes(M.id)):o.includes(b.id);return r.jsxs("div",{className:"mb-1",children:[r.jsxs("button",{className:Ae("w-full flex items-center gap-2 px-3 py-2.5 text-sm rounded-lg hover:bg-accent text-left transition-all",T&&"bg-accent"),onClick:()=>{b.subsections.length>0?(l(b.id),n[b.id]||t(b.subsections[0].id)):t(b.id)},children:[r.jsx("span",{className:Ae("w-7 h-7 rounded-lg flex items-center justify-center transition-colors",T?P.bg+" text-white":P.light),children:N?r.jsx(ta,{className:"w-4 h-4"}):r.jsx(E,{className:Ae("w-4 h-4",!T&&P.text)})}),r.jsx("span",{className:Ae("flex-1",T&&"font-medium"),children:b.title}),b.subsections.length>0&&r.jsx(Qr,{className:Ae("w-4 h-4 text-muted-foreground transition-transform",n[b.id]&&"rotate-90")})]}),b.subsections.length>0&&n[b.id]&&r.jsx("div",{className:"ml-4 mt-1 space-y-0.5 border-l-2 border-border pl-3",children:b.subsections.map(M=>{const I=e===M.id,O=o.includes(M.id);return r.jsxs("button",{className:Ae("w-full text-left px-3 py-1.5 text-sm rounded-md hover:bg-accent text-foreground flex items-center gap-2",I&&"bg-accent font-medium",I&&P.text),onClick:()=>t(M.id),children:[O&&!I&&r.jsx(ta,{className:"w-3 h-3 text-green-500"}),r.jsx("span",{className:Ae(!O&&!I&&"ml-5"),children:M.title})]},M.id)})})]},b.id)})})})]}),r.jsxs("div",{className:"flex-1 overflow-hidden flex flex-col",children:[r.jsx("div",{className:Ae("px-8 py-4 border-b border-border",y.light),children:r.jsxs("div",{className:"max-w-3xl mx-auto flex items-center gap-3",children:[r.jsx("div",{className:Ae("w-10 h-10 rounded-xl flex items-center justify-center",y.bg,"text-white"),children:r.jsx(_.icon,{className:"w-5 h-5"})}),r.jsxs("div",{children:[r.jsx("p",{className:Ae("text-sm font-medium",y.text),children:_.title}),r.jsx("h1",{className:"text-lg font-semibold text-foreground",children:(c==null?void 0:c.title)||v(e)})]})]})}),r.jsx(Wn,{className:"flex-1",ref:u,children:r.jsx("div",{className:"max-w-3xl mx-auto p-8",children:c?r.jsx("div",{className:"prose prose-sm max-w-none dark:prose-invert prose-headings:text-foreground prose-p:text-muted-foreground prose-strong:text-foreground prose-code:text-primary prose-code:bg-muted prose-code:px-1 prose-code:py-0.5 prose-code:rounded prose-pre:bg-muted prose-pre:border prose-pre:border-border",dangerouslySetInnerHTML:g(c.content)}):r.jsxs("div",{className:"text-center text-muted-foreground py-12",children:[r.jsx(Gd,{className:"w-12 h-12 mx-auto mb-4 opacity-50"}),r.jsx("p",{children:"Select a topic from the sidebar"})]})})}),r.jsx("div",{className:"border-t border-border p-4 bg-muted/30",children:r.jsxs("div",{className:"max-w-3xl mx-auto flex items-center justify-between",children:[h?r.jsxs(ie,{variant:"ghost",onClick:()=>t(h),className:"flex items-center gap-2",children:[r.jsx(v5,{className:"w-4 h-4"}),r.jsx("span",{className:"max-w-[150px] truncate",children:v(h)})]}):r.jsx("div",{}),r.jsxs("span",{className:"text-xs text-muted-foreground",children:[m+1," of ",f.length]}),x?r.jsxs(ie,{onClick:()=>t(x),className:Ae("flex items-center gap-2",y.bg,"hover:opacity-90"),children:[r.jsx("span",{className:"max-w-[150px] truncate",children:v(x)}),r.jsx(sg,{className:"w-4 h-4"})]}):r.jsx(ie,{variant:"outline",onClick:()=>t("intro"),className:"flex items-center gap-2",children:"Start Over"})]})})]})]})}function vW(){const[e,t]=C.useState(null),[n,s]=C.useState(!0),[o,d]=C.useState(!1),[u,l]=C.useState(!1),[c,f]=C.useState(!1),[m,h]=C.useState(null);C.useEffect(()=>{x()},[]);const x=async()=>{try{s(!0);const j=await ge.getSessionStatus();t(j)}catch{X.error("Failed to load session status")}finally{s(!1)}},w=async()=>{var j,E;d(!0);try{const P=await ge.installSessionAll();P.success?(X.success("Session persistence installed!"),x()):X.error(((j=P.hooks)==null?void 0:j.error)||((E=P.command)==null?void 0:E.error)||"Installation failed")}catch{X.error("Installation failed")}finally{d(!1)}},k=async()=>{d(!0);try{const j=await ge.installSessionHooks();j.success?(X.success("Session hooks installed!"),x()):X.error(j.error||"Failed to install hooks")}catch{X.error("Failed to install hooks")}finally{d(!1)}},_=async()=>{d(!0);try{const j=await ge.installFlushCommand();j.success?(X.success(j.alreadyInstalled?"/flush command already installed":"/flush command installed!"),x()):X.error(j.error||"Failed to install command")}catch{X.error("Failed to install command")}finally{d(!1)}},y=async()=>{l(!0);try{const j=await ge.clearSessionContext();j.success?(X.success(j.cleared?"Session context cleared":"No context to clear"),x()):X.error("Failed to clear context")}catch{X.error("Failed to clear context")}finally{l(!1)}},v=async()=>{try{const j=await ge.getSessionContext();h(j.content),f(!0)}catch{X.error("Failed to load context")}},g=j=>j===null?"Unknown":j<60?`${j} minutes ago`:j<1440?`${Math.floor(j/60)} hours ago`:`${Math.floor(j/1440)} days ago`;if(n)return r.jsx("div",{className:"flex items-center justify-center h-64",children:r.jsx(tt,{className:"w-8 h-8 animate-spin text-indigo-600"})});const b=(e==null?void 0:e.hooksInstalled)&&(e==null?void 0:e.flushCommandInstalled)&&(e==null?void 0:e.permissionInstalled);return r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"bg-white dark:bg-slate-950 rounded-xl border border-gray-200 dark:border-slate-800 p-5 shadow-sm",children:[r.jsxs("div",{className:"flex items-center justify-between mb-4",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"p-2 rounded-lg bg-indigo-100 dark:bg-indigo-950",children:r.jsx(Hn,{className:"w-5 h-5 text-indigo-600 dark:text-indigo-400"})}),r.jsxs("div",{children:[r.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Session Persistence"}),r.jsx("p",{className:"text-sm text-gray-500 dark:text-slate-400",children:"Save and restore Claude Code session context"})]})]}),r.jsx(ie,{variant:"ghost",size:"sm",onClick:x,children:r.jsx(yr,{className:"w-4 h-4"})})]}),r.jsxs("p",{className:"text-sm text-gray-600 dark:text-slate-400",children:["Session persistence allows you to save your current Claude Code context using the ",r.jsx("code",{className:"bg-gray-100 dark:bg-slate-800 px-1.5 py-0.5 rounded text-indigo-600 dark:text-indigo-400",children:"/flush"})," command, and automatically restore it when you start a new session."]})]}),r.jsxs("div",{className:"bg-white dark:bg-slate-950 rounded-xl border border-gray-200 dark:border-slate-800 overflow-hidden shadow-sm",children:[r.jsx("div",{className:"p-4 border-b border-gray-200 dark:border-slate-700",children:r.jsx("h3",{className:"font-medium text-gray-900 dark:text-white",children:"Installation Status"})}),r.jsxs("div",{className:"divide-y divide-gray-100 dark:divide-slate-800",children:[r.jsxs("div",{className:"p-4 flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[e!=null&&e.hooksInstalled?r.jsx(Mt,{className:"w-5 h-5 text-green-500"}):r.jsx(Sn,{className:"w-5 h-5 text-amber-500"}),r.jsxs("div",{children:[r.jsx("div",{className:"text-sm font-medium text-gray-900 dark:text-white",children:"Session Hooks"}),r.jsx("div",{className:"text-xs text-gray-500 dark:text-slate-400",children:"Auto-restore context on session start, preserve on session end"})]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Qe,{variant:e!=null&&e.hooksInstalled?"default":"secondary",children:e!=null&&e.hooksInstalled?"Installed":"Not Installed"}),!(e!=null&&e.hooksInstalled)&&r.jsx(ie,{variant:"outline",size:"sm",onClick:k,disabled:o,children:o?r.jsx(tt,{className:"w-4 h-4 animate-spin"}):"Install"})]})]}),r.jsxs("div",{className:"p-4 flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[e!=null&&e.flushCommandInstalled?r.jsx(Mt,{className:"w-5 h-5 text-green-500"}):r.jsx(Sn,{className:"w-5 h-5 text-amber-500"}),r.jsxs("div",{children:[r.jsx("div",{className:"text-sm font-medium text-gray-900 dark:text-white",children:"/flush Command"}),r.jsx("div",{className:"text-xs text-gray-500 dark:text-slate-400",children:"Adds the /flush command to save session context"})]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Qe,{variant:e!=null&&e.flushCommandInstalled?"default":"secondary",children:e!=null&&e.flushCommandInstalled?"Installed":"Not Installed"}),!(e!=null&&e.flushCommandInstalled)&&r.jsx(ie,{variant:"outline",size:"sm",onClick:_,disabled:o,children:o?r.jsx(tt,{className:"w-4 h-4 animate-spin"}):"Install"})]})]}),r.jsxs("div",{className:"p-4 flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[e!=null&&e.permissionInstalled?r.jsx(Mt,{className:"w-5 h-5 text-green-500"}):r.jsx(Sn,{className:"w-5 h-5 text-amber-500"}),r.jsxs("div",{children:[r.jsx("div",{className:"text-sm font-medium text-gray-900 dark:text-white",children:"Write Permission"}),r.jsx("div",{className:"text-xs text-gray-500 dark:text-slate-400",children:"Allows Claude to write session context without prompting"})]})]}),r.jsx(Qe,{variant:e!=null&&e.permissionInstalled?"default":"secondary",children:e!=null&&e.permissionInstalled?"Granted":"Not Granted"})]})]}),!b&&r.jsx("div",{className:"p-4 bg-gray-50 dark:bg-slate-900 border-t border-gray-200 dark:border-slate-800",children:r.jsxs(ie,{onClick:w,disabled:o,className:"w-full bg-indigo-600 hover:bg-indigo-700 text-white",children:[o?r.jsx(tt,{className:"w-4 h-4 mr-2 animate-spin"}):r.jsx(Qi,{className:"w-4 h-4 mr-2"}),"Install All"]})})]}),r.jsxs("div",{className:"bg-white dark:bg-slate-950 rounded-xl border border-gray-200 dark:border-slate-800 overflow-hidden shadow-sm",children:[r.jsxs("div",{className:"p-4 border-b border-gray-200 dark:border-slate-700 flex items-center justify-between",children:[r.jsx("h3",{className:"font-medium text-gray-900 dark:text-white",children:"Saved Context"}),(e==null?void 0:e.hasSavedContext)&&r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs(ie,{variant:"outline",size:"sm",onClick:v,children:[r.jsx(Er,{className:"w-4 h-4 mr-2"}),"View"]}),r.jsx(ie,{variant:"outline",size:"sm",onClick:y,disabled:u,className:"text-red-600 hover:text-red-700 hover:bg-red-50 dark:hover:bg-red-950",children:u?r.jsx(tt,{className:"w-4 h-4 animate-spin"}):r.jsx(un,{className:"w-4 h-4"})})]})]}),r.jsx("div",{className:"p-4",children:e!=null&&e.hasSavedContext?r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[r.jsx(pl,{className:"w-4 h-4 text-gray-400"}),r.jsx("span",{className:"text-gray-600 dark:text-slate-400",children:"Last saved:"}),r.jsx("span",{className:"text-gray-900 dark:text-white",children:g(e.contextAge)})]}),e.contextPreview&&r.jsx("div",{className:"bg-gray-50 dark:bg-slate-900 rounded-lg p-3",children:r.jsx("pre",{className:"text-xs text-gray-600 dark:text-slate-400 whitespace-pre-wrap overflow-hidden",children:e.contextPreview})}),r.jsxs("div",{className:"text-xs text-gray-500 dark:text-slate-500",children:["Storage: ",e.sessionDir]})]}):r.jsxs("div",{className:"text-center py-6",children:[r.jsx(Hn,{className:"w-12 h-12 text-gray-300 dark:text-slate-600 mx-auto mb-3"}),r.jsx("p",{className:"text-sm text-gray-600 dark:text-slate-400",children:"No saved context"}),r.jsxs("p",{className:"text-xs text-gray-400 dark:text-slate-500 mt-1",children:["Use ",r.jsx("code",{className:"bg-gray-100 dark:bg-slate-800 px-1 rounded",children:"/flush"})," in Claude Code to save your session"]})]})})]}),(e==null?void 0:e.lastSession)&&r.jsxs("div",{className:"bg-white dark:bg-slate-950 rounded-xl border border-gray-200 dark:border-slate-800 overflow-hidden shadow-sm",children:[r.jsx("div",{className:"p-4 border-b border-gray-200 dark:border-slate-700",children:r.jsx("h3",{className:"font-medium text-gray-900 dark:text-white",children:"Last Session"})}),r.jsxs("div",{className:"p-4 space-y-2",children:[e.lastSession.session_id&&r.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[r.jsx("span",{className:"text-gray-500 dark:text-slate-400 w-20",children:"ID:"}),r.jsx("code",{className:"text-xs bg-gray-100 dark:bg-slate-800 px-2 py-0.5 rounded",children:e.lastSession.session_id})]}),e.lastSession.cwd&&r.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[r.jsx("span",{className:"text-gray-500 dark:text-slate-400 w-20",children:"Directory:"}),r.jsx("span",{className:"text-gray-900 dark:text-white font-mono text-xs",children:e.lastSession.cwd})]}),e.lastSession.timestamp&&r.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[r.jsx("span",{className:"text-gray-500 dark:text-slate-400 w-20",children:"Ended:"}),r.jsx("span",{className:"text-gray-900 dark:text-white",children:e.lastSession.timestamp})]}),e.lastSession.reason&&r.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[r.jsx("span",{className:"text-gray-500 dark:text-slate-400 w-20",children:"Reason:"}),r.jsx(Qe,{variant:"secondary",children:e.lastSession.reason})]})]})]}),r.jsxs("div",{className:"bg-gray-50 dark:bg-slate-900 rounded-lg p-4 border border-transparent dark:border-slate-800",children:[r.jsx("h4",{className:"text-sm font-medium text-gray-900 dark:text-white mb-2",children:"How to Use"}),r.jsxs("ol",{className:"space-y-2 text-sm text-gray-600 dark:text-slate-400",children:[r.jsxs("li",{className:"flex gap-2",children:[r.jsx("span",{className:"font-medium text-indigo-600 dark:text-indigo-400",children:"1."}),"Install session hooks and the /flush command above"]}),r.jsxs("li",{className:"flex gap-2",children:[r.jsx("span",{className:"font-medium text-indigo-600 dark:text-indigo-400",children:"2."}),"Use ",r.jsx("code",{className:"bg-white dark:bg-slate-800 px-1.5 py-0.5 rounded",children:"/flush"})," in Claude Code before ending a session"]}),r.jsxs("li",{className:"flex gap-2",children:[r.jsx("span",{className:"font-medium text-indigo-600 dark:text-indigo-400",children:"3."}),"Your context is automatically restored when you start a new session"]})]})]}),r.jsxs("div",{className:"bg-gray-50 dark:bg-slate-900 rounded-lg p-4 border border-transparent dark:border-slate-800",children:[r.jsx("h4",{className:"text-sm font-medium text-gray-900 dark:text-white mb-2",children:"CLI Commands"}),r.jsxs("div",{className:"space-y-1 text-sm text-gray-600 dark:text-slate-400 font-mono",children:[r.jsx("p",{children:"coder-config session # Show session status"}),r.jsx("p",{children:"coder-config session install-hooks # Install session hooks"}),r.jsx("p",{children:"coder-config session clear # Clear saved context"})]})]}),r.jsx(wt,{open:c,onOpenChange:f,children:r.jsxs(gt,{className:"max-w-2xl max-h-[80vh] overflow-hidden flex flex-col",children:[r.jsxs(xt,{children:[r.jsx(vt,{children:"Saved Context"}),r.jsx(er,{children:"This context will be restored on your next Claude Code session"})]}),r.jsx("div",{className:"flex-1 overflow-auto py-4",children:r.jsx("pre",{className:"text-sm text-gray-700 dark:text-slate-300 whitespace-pre-wrap bg-gray-50 dark:bg-slate-900 p-4 rounded-lg",children:m||"No content"})}),r.jsx(At,{children:r.jsx(ie,{variant:"ghost",onClick:()=>f(!1),children:"Close"})})]})})]})}const yW=[{id:"projects",label:"All Projects",icon:fs,section:"Projects"},{id:"explorer",label:"Project Explorer",icon:Ci,section:"Projects"},{id:"workstreams",label:"Workstreams",icon:WC,section:"Projects"},{id:"registry",label:"MCP Registry",icon:bs,section:"Tools"},{id:"plugins",label:"Plugins",icon:eo,section:"Tools"},{id:"memory",label:"Memory",icon:Ji,section:"Tools"},{id:"claude-settings",label:"Claude Code",icon:ks,section:"Configuration",tool:"claude"},{id:"gemini-settings",label:"Gemini CLI",icon:Ft,section:"Configuration",tool:"gemini"},{id:"codex-settings",label:"Codex CLI",icon:Ft,section:"Configuration",isNew:!0,tool:"codex"},{id:"antigravity-settings",label:"Antigravity",icon:Hl,section:"Configuration",tool:"antigravity"},{id:"create-mcp",label:"Create MCP",icon:Fn,section:"Developer"},{id:"loops",label:"Ralph Loops",icon:kl,section:"Developer",isNew:!0},{id:"sessions",label:"Sessions",icon:Hn,section:"System"},{id:"preferences",label:"Preferences",icon:VC,section:"System"},{id:"tutorial",label:"Tutorial",icon:Gd,section:"Help"},{id:"docs",label:"Docs & Help",icon:Xi,section:"Help"}],e_=(e,t)=>{try{const n=localStorage.getItem(`claude-config-${e}`);return n?JSON.parse(n):t}catch{return t}},bW=(e,t)=>{try{localStorage.setItem(`claude-config-${e}`,JSON.stringify(t))}catch{}};function wW(){const[e,t]=C.useState(()=>e_("currentView","explorer")),[n,s]=C.useState(!0),[o,d]=C.useState({dir:"",subprojects:[],hierarchy:[]}),[u,l]=C.useState([]),[c,f]=C.useState({mcpServers:{}}),[m,h]=C.useState([]),[x,w]=C.useState([]),[k,_]=C.useState(null),[y,v]=C.useState(null),[g,b]=C.useState(!1),[j,E]=C.useState({title:"",type:""}),[P,T]=C.useState(""),[N,M]=C.useState(""),[I,O]=C.useState({}),[B,H]=C.useState(null),[q,z]=C.useState(null),[G,J]=C.useState(!1),[K,F]=C.useState([]),[R,L]=C.useState(null),[U,$]=C.useState(!1),[ne,he]=C.useState(null),[me,Y]=C.useState(null),[W,le]=C.useState(!1),te=C.useRef(null);C.useEffect(()=>{bW("currentView",e)},[e]);const Q=C.useCallback(async()=>{try{const[Se,Ne,se,xe,De]=await Promise.all([ge.getProject(),ge.getConfigs(),ge.getRegistry(),ge.getRules(),ge.getCommands()]);d(Se),l(Ne),f(se),h(xe),w(De),Ne.length>0&&!k&&_(Ne[Ne.length-1])}catch(Se){X.error("Failed to load data: "+Se.message)}finally{s(!1)}},[k]),oe=C.useCallback(async(Se=!1)=>{var Ne;try{const se=await ge.getProjects();F(se.projects||[]);const xe=(Ne=se.projects)==null?void 0:Ne.find(De=>De.isActive);if(L(xe||null),Se&&xe){const De=await ge.getSubprojects(xe.path);he({dir:xe.path,subprojects:De.subprojects||[]})}Se&&!xe&&(e_("currentView",null)||t("projects"))}catch{console.log("Projects API not available")}},[]),ye=async Se=>{try{const Ne=await ge.setActiveProject(Se);Ne.success?(d({dir:Ne.dir,hierarchy:Ne.hierarchy,subprojects:Ne.subprojects}),he({dir:Ne.dir,subprojects:Ne.subprojects}),L(Ne.project),F(se=>se.map(xe=>({...xe,isActive:xe.id===Se}))),await Q(),X.success(`Switched to ${Ne.project.name}`)):X.error(Ne.error||"Failed to switch project")}catch(Ne){X.error("Failed to switch project: "+Ne.message)}},Be=Se=>{F(Ne=>[...Ne,{...Se,exists:!0,hasClaudeConfig:!1}])};C.useEffect(()=>{Q(),oe(!0),(async()=>{var Ne;try{const[se,xe]=await Promise.all([ge.checkVersion(),ge.getConfig()]);if(H(se==null?void 0:se.installedVersion),Y((xe==null?void 0:xe.config)||{}),!te.current&&(se!=null&&se.installedVersion)&&(te.current=se.installedVersion),se!=null&&se.updateAvailable&&(se==null?void 0:se.updateMethod)==="npm")if((Ne=xe==null?void 0:xe.config)!=null&&Ne.autoUpdate){X.info(`Auto-updating to v${se.latestVersion}...`),J(!0);const De=await ge.performUpdate({updateMethod:se.updateMethod,targetVersion:se.latestVersion});if(De.success){X.success(`Updated to v${De.newVersion}! Restarting server...`);try{await ge.restartServer()}catch{}let He=0;const ze=setInterval(async()=>{He++;try{await ge.checkVersion(),clearInterval(ze),X.success("Server restarted! Reloading..."),setTimeout(()=>window.location.reload(),500)}catch{He>30&&(clearInterval(ze),X.info("Server restarting. Please refresh the page."),J(!1))}},500)}else X.error("Auto-update failed: "+De.error),J(!1),z(se)}else z(se)}catch{}})()},[]),C.useEffect(()=>{const Ne=setInterval(async()=>{if(te.current)try{const se=await ge.checkVersion();se!=null&&se.installedVersion&&se.installedVersion!==te.current&&(console.log(`[stale-ui] Server updated to v${se.installedVersion}, refreshing...`),window.location.reload())}catch{}},3e4);return()=>clearInterval(Ne)},[]);const Ke=(Se,Ne)=>{if(!Se||!Ne)return!1;const se=He=>He.split(".").map(ze=>parseInt(ze,10)||0),xe=se(Se),De=se(Ne);for(let He=0;He<Math.max(xe.length,De.length);He++){if((xe[He]||0)>(De[He]||0))return!0;if((xe[He]||0)<(De[He]||0))return!1}return!1},ce=async(Se,Ne="npm")=>{J(!0);const se=await ge.performUpdate({updateMethod:Ne,targetVersion:Se});if(se.success){X.success(`Updated to v${se.newVersion}! Restarting server...`),z(null);try{await ge.restartServer()}catch{}let xe=0;const De=setInterval(async()=>{xe++;try{await ge.checkVersion(),clearInterval(De),X.success("Server restarted! Reloading..."),setTimeout(()=>window.location.reload(),500)}catch{xe>30&&(clearInterval(De),X.info("Server restarting. Please refresh the page."),J(!1))}},500);return!0}else return X.error("Update failed: "+se.error),J(!1),!1},be=async()=>{le(!0);try{const Se=await ge.checkVersion(),Ne=Se==null?void 0:Se.installedVersion,se=Se==null?void 0:Se.latestVersion;if(Ne&&te.current&&Ne!==te.current){X.info(`Refreshing to v${Ne}...`),setTimeout(()=>window.location.reload(),500);return}Ke(se,Ne)&&(me!=null&&me.autoUpdate?(le(!1),X.info(`Auto-updating to v${se}...`),await ce(se,(Se==null?void 0:Se.updateMethod)||"npm")):(z({...Se,updateAvailable:!0}),X.info(`Update available: v${se}`)))}catch{X.error("Failed to check for updates")}finally{le(!1)}},Je=async()=>{if(q!=null&&q.updateAvailable){J(!0);try{const Se=await ge.performUpdate({updateMethod:q.updateMethod,sourcePath:q.sourcePath,targetVersion:q.latestVersion});if(Se.success){X.success(`Updated to v${Se.newVersion}! Restarting server...`),z(null),H(Se.newVersion);try{await ge.restartServer()}catch{}let Ne=0;const se=setInterval(async()=>{Ne++;try{await ge.checkVersion(),clearInterval(se),X.success("Server restarted! Reloading..."),setTimeout(()=>window.location.reload(),500)}catch{Ne>30&&(clearInterval(se),X.info("Server restarting. Please refresh the page."),J(!1))}},500)}else X.error("Update failed: "+Se.error),J(!1)}catch(Se){X.error("Update failed: "+Se.message),J(!1)}}};C.useEffect(()=>{const Se=async()=>{try{const{hashes:se}=await ge.getFileHashes(),xe=I,De=Object.keys(se).some(ze=>xe[ze]!==se[ze])||Object.keys(xe).some(ze=>!se[ze]),He=xe.__subprojects__!==se.__subprojects__;if(De&&Object.keys(xe).length>0&&(X.info("Files changed externally, reloading..."),await Q(),He&&ne))try{const ze=await ge.getSubprojects(ne.dir);he(Ct=>({...Ct,subprojects:ze.subprojects||[]}))}catch{}O(se)}catch{}},Ne=setInterval(Se,2e3);return Se(),()=>clearInterval(Ne)},[I,Q,ne]);const qe=new Set;u.forEach(Se=>{var Ne,se;(((Ne=Se.config)==null?void 0:Ne.include)||[]).forEach(xe=>qe.add(xe)),Object.keys(((se=Se.config)==null?void 0:se.mcpServers)||{}).forEach(xe=>qe.add(xe))});const ct={mcps:qe.size,rules:m.length,commands:x.length},ke=async()=>{try{const Se=await ge.applyConfig(o.dir);if(Se.tools){const Ne=Object.entries(Se.tools).filter(([,se])=>se).map(([se])=>se==="claude"?"Claude Code":"Antigravity");Ne.length>0?X.success(`Config applied to: ${Ne.join(", ")}`):X.warning("No tools were updated")}else X.success("Configuration applied successfully!")}catch(Se){X.error("Failed to apply config: "+Se.message)}},we=async()=>{s(!0),await Q(),X.success("Data refreshed")};if(n)return r.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:r.jsxs("div",{className:"flex flex-col items-center gap-4",children:[r.jsx(tt,{className:"w-8 h-8 animate-spin text-primary"}),r.jsx("p",{className:"text-muted-foreground",children:"Loading configuration..."})]})});const Le=()=>{switch(e){case"explorer":return r.jsx(o8,{project:o,onRefresh:Q});case"registry":return r.jsx(_z,{registry:c,searchQuery:P,setSearchQuery:T,onUpdate:Q});case"plugins":return r.jsx(Gz,{});case"memory":return r.jsx(Cz,{project:o,onUpdate:Q});case"create-mcp":return r.jsx(ZH,{project:o});case"claude-settings":return r.jsx(FH,{});case"gemini-settings":return r.jsx(BH,{});case"codex-settings":return r.jsx(JH,{});case"antigravity-settings":return r.jsx(VH,{});case"sessions":return r.jsx(vW,{});case"preferences":return r.jsx(OH,{onConfigChange:Se=>Y(Se)});case"projects":return r.jsx(Sz,{onProjectSwitch:Se=>{d({dir:Se.dir,hierarchy:Se.hierarchy,subprojects:Se.subprojects}),he({dir:Se.dir,subprojects:Se.subprojects}),Q(),oe()}});case"workstreams":return r.jsx(Kz,{projects:K,onWorkstreamChange:Se=>{X.success(`Switched to workstream: ${Se.name}`)}});case"loops":return r.jsx(qz,{activeProject:R});case"docs":return r.jsx(Vz,{});case"tutorial":return r.jsx(xW,{});default:return null}};return r.jsxs("div",{className:"min-h-screen bg-background",children:[r.jsx("header",{className:"h-16 bg-card border-b border-border sticky top-0 z-50 shadow-sm",children:r.jsxs("div",{className:"h-full px-6 flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-4",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"w-10 h-10 rounded-xl bg-gradient-to-br from-indigo-500 to-purple-600 flex items-center justify-center shadow-lg shadow-indigo-500/20",children:r.jsxs("svg",{width:"22",height:"22",viewBox:"0 0 128 128",children:[r.jsx("circle",{cx:"64",cy:"64",r:"52",fill:"none",stroke:"white",strokeWidth:"10",strokeDasharray:"24 12"}),r.jsx("circle",{cx:"64",cy:"64",r:"28",fill:"white"}),r.jsx("circle",{cx:"64",cy:"64",r:"12",fill:"#7c3aed"})]})}),r.jsx("div",{children:r.jsxs("h1",{className:"text-xl font-bold text-foreground",children:["Coder ",r.jsx("span",{className:"text-primary",children:"Config"})]})}),q&&r.jsxs("button",{onClick:Je,disabled:G,className:"ml-3 px-2.5 py-1 text-xs font-medium bg-green-100 text-green-700 hover:bg-green-200 rounded-full flex items-center gap-1.5 transition-colors disabled:opacity-50",children:[G?r.jsx(tt,{className:"w-3 h-3 animate-spin"}):r.jsx(Qi,{className:"w-3 h-3"}),G?"Updating...":`Update to v${q.latestVersion}`]})]}),r.jsx(Qj,{orientation:"vertical",className:"h-6"}),r.jsx(a8,{projects:K,activeProject:R,onSwitch:ye,onAddClick:()=>$(!0),onManageClick:()=>t("projects")})]}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx(u8,{}),r.jsx(ie,{variant:"ghost",size:"sm",onClick:we,children:r.jsx(yr,{className:"w-4 h-4"})}),r.jsxs(ie,{onClick:ke,variant:"ghost",size:"sm",className:"gap-2 text-muted-foreground hover:text-foreground",title:"Config auto-applies on save. Click to manually re-apply.",children:[r.jsx(Hl,{className:"w-4 h-4"}),"Re-apply"]})]})]})}),r.jsxs("div",{className:"flex",children:[r.jsxs("aside",{className:"w-64 h-[calc(100vh-64px)] border-r border-border bg-card sticky top-16 flex flex-col",children:[r.jsx(Wn,{className:"flex-1 py-4",children:["Projects","Tools","Configuration","Developer","System","Help"].map(Se=>r.jsxs("div",{className:"mb-6",children:[r.jsx("h3",{className:"px-4 mb-2 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:Se}),r.jsx("div",{className:"space-y-0.5",children:yW.filter(Ne=>Ne.section===Se).filter(Ne=>{var se;return Ne.id!=="loops"||((se=me==null?void 0:me.experimental)==null?void 0:se.ralphLoops)}).filter(Ne=>!Ne.tool||((me==null?void 0:me.enabledTools)||["claude"]).includes(Ne.tool)).map(Ne=>{const se=Ne.icon,xe=e===Ne.id;return r.jsxs("button",{onClick:()=>t(Ne.id),className:`w-full flex items-center gap-3 px-4 py-2.5 text-sm transition-all duration-200 border-l-2 ${xe?"bg-accent border-primary text-primary font-medium":"border-transparent text-muted-foreground hover:text-foreground hover:bg-accent"}`,children:[r.jsx(se,{className:"w-4 h-4"}),r.jsx("span",{className:"flex-1 text-left",children:Ne.label}),Ne.badge&&r.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full font-medium ${xe?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground"}`,children:ct[Ne.badge]}),Ne.isNew&&r.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded font-medium bg-green-500/20 text-green-600 dark:text-green-400",children:"new"})]},Ne.id)})})]},Se))}),r.jsx("div",{className:"px-4 py-3 border-t border-border",children:r.jsxs("button",{onClick:be,disabled:W,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center gap-1",title:"Check for updates",children:[W?r.jsx(tt,{className:"w-3 h-3 animate-spin"}):null,B?`v${B}`:""]})})]}),r.jsx("main",{style:{zoom:.9},className:Ae("flex-1 overflow-auto",["explorer","docs","tutorial"].includes(e)?"h-[calc(100vh-64px)]":"p-6"),children:r.jsx(i_,{mode:"wait",children:r.jsx(Uo.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},className:["explorer","docs","tutorial"].includes(e)?"h-full":"",children:Le()},e)})})]}),r.jsx(qj,{open:U,onOpenChange:$,onAdded:Be}),r.jsx(l8,{onStartTutorial:()=>t("tutorial")})]})}function _W(){const[e,t]=C.useState(!1),[n,s]=C.useState(!1),[o,d]=C.useState(!1),u=C.useCallback(async()=>{s(!0);try{await ge.restartServer(),X.info("Server restarting... page will reload."),setTimeout(()=>{window.location.reload()},2e3)}catch(c){X.error("Failed to restart: "+c.message),s(!1)}},[]),l=C.useCallback(()=>{d(!0),t(!1),X.dismiss("update-available")},[]);return C.useEffect(()=>{let c;const f=async()=>{try{const m=await ge.getVersion();console.log("[Update Check]",m),m.needsRestart&&!o&&t(!0)}catch{}};return f(),c=setInterval(f,3e4),()=>clearInterval(c)},[o]),r.jsx(c8,{children:r.jsxs("div",{className:"min-h-screen bg-background",children:[e&&!n&&r.jsxs("div",{className:"fixed top-0 left-0 right-0 z-50 bg-blue-600 text-white px-4 py-2 flex items-center justify-center gap-2 shadow-lg cursor-pointer hover:bg-blue-700 transition-colors",onClick:u,children:[r.jsx(yr,{className:"w-4 h-4"}),r.jsx("span",{className:"text-sm font-medium",children:"Update available — click to restart"}),r.jsx("button",{onClick:c=>{c.stopPropagation(),l()},className:"absolute right-3 p-1 hover:bg-blue-500 rounded",children:r.jsx(yi,{className:"w-4 h-4"})})]}),n&&r.jsxs("div",{className:"fixed top-0 left-0 right-0 z-50 bg-amber-600 text-white px-4 py-2 flex items-center justify-center gap-2",children:[r.jsx(yr,{className:"w-4 h-4 animate-spin"}),r.jsx("span",{className:"text-sm font-medium",children:"Restarting server..."})]}),r.jsx(wW,{}),r.jsx(EP,{position:"bottom-right",richColors:!0})]})})}tP.createRoot(document.getElementById("root")).render(r.jsx(_W,{}));
|
|
3960
|
+
`}},gW={...iW,...oW,...aW,...lW,...cW,...dW,...uW,...hW,...fW,...mW,...pW},Ed={welcome:{bg:"bg-violet-500",light:"bg-violet-100 dark:bg-violet-950",text:"text-violet-600 dark:text-violet-400"},"first-project":{bg:"bg-blue-500",light:"bg-blue-100 dark:bg-blue-950",text:"text-blue-600 dark:text-blue-400"},"rules-guide":{bg:"bg-emerald-500",light:"bg-emerald-100 dark:bg-emerald-950",text:"text-emerald-600 dark:text-emerald-400"},"mcp-guide":{bg:"bg-orange-500",light:"bg-orange-100 dark:bg-orange-950",text:"text-orange-600 dark:text-orange-400"},"permissions-guide":{bg:"bg-green-500",light:"bg-green-100 dark:bg-green-950",text:"text-green-600 dark:text-green-400"},"memory-guide":{bg:"bg-pink-500",light:"bg-pink-100 dark:bg-pink-950",text:"text-pink-600 dark:text-pink-400"},"plugins-guide":{bg:"bg-purple-500",light:"bg-purple-100 dark:bg-purple-950",text:"text-purple-600 dark:text-purple-400"},"workstreams-guide":{bg:"bg-cyan-500",light:"bg-cyan-100 dark:bg-cyan-950",text:"text-cyan-600 dark:text-cyan-400"},"loops-guide":{bg:"bg-teal-500",light:"bg-teal-100 dark:bg-teal-950",text:"text-teal-600 dark:text-teal-400"},"multi-tool-guide":{bg:"bg-amber-500",light:"bg-amber-100 dark:bg-amber-950",text:"text-amber-600 dark:text-amber-400"},"next-steps":{bg:"bg-rose-500",light:"bg-rose-100 dark:bg-rose-950",text:"text-rose-600 dark:text-rose-400"}},Zw="claude-config-tutorial-visited";function xW(){const[e,t]=C.useState("intro"),[n,s]=C.useState({welcome:!0}),[o,d]=C.useState(()=>{try{return JSON.parse(localStorage.getItem(Zw)||"[]")}catch{return[]}}),u=C.useRef(null);C.useEffect(()=>{if(u.current){const b=u.current.querySelector("[data-radix-scroll-area-viewport]");b&&(b.scrollTop=0)}},[e]),C.useEffect(()=>{if(e&&!o.includes(e)){const b=[...o,e];d(b),localStorage.setItem(Zw,JSON.stringify(b))}},[e,o]);const l=b=>{s(j=>({...j,[b]:!j[b]}))},c=gW[e],f=il.flatMap(b=>b.subsections.length>0?b.subsections.map(j=>j.id):[b.id]),m=f.indexOf(e),h=m>0?f[m-1]:null,x=m<f.length-1?f[m+1]:null,w=Math.round(o.length/f.length*100),_=(()=>{for(const b of il)if(b.id===e||b.subsections.some(j=>j.id===e))return b;return il[0]})(),y=Ed[_.id]||Ed.welcome,v=b=>{for(const j of il){if(j.id===b)return j.title;const E=j.subsections.find(P=>P.id===b);if(E)return E.title}return""},g=b=>({__html:JN(b)});return r.jsxs("div",{className:"flex h-full",children:[r.jsxs("div",{className:"w-72 border-r border-border bg-muted/30 flex flex-col",children:[r.jsxs("div",{className:"p-4 border-b border-border bg-gradient-to-r from-indigo-500/10 to-purple-500/10",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"w-10 h-10 rounded-xl bg-gradient-to-br from-indigo-500 to-purple-600 flex items-center justify-center shadow-lg",children:r.jsx(Gd,{className:"w-5 h-5 text-white"})}),r.jsxs("div",{children:[r.jsx("h2",{className:"font-semibold text-foreground",children:"Tutorial"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Step-by-step guide"})]})]}),r.jsxs("div",{className:"mt-3",children:[r.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground mb-1",children:[r.jsx("span",{children:"Progress"}),r.jsxs("span",{children:[w,"% complete"]})]}),r.jsx(s2,{value:w,className:"h-2"})]})]}),r.jsx(Wn,{className:"flex-1",children:r.jsx("div",{className:"p-2",children:il.map((b,j)=>{const E=b.icon,P=Ed[b.id]||Ed.welcome,T=e===b.id||b.subsections.some(M=>M.id===e),N=b.subsections.length>0?b.subsections.every(M=>o.includes(M.id)):o.includes(b.id);return r.jsxs("div",{className:"mb-1",children:[r.jsxs("button",{className:Ae("w-full flex items-center gap-2 px-3 py-2.5 text-sm rounded-lg hover:bg-accent text-left transition-all",T&&"bg-accent"),onClick:()=>{b.subsections.length>0?(l(b.id),n[b.id]||t(b.subsections[0].id)):t(b.id)},children:[r.jsx("span",{className:Ae("w-7 h-7 rounded-lg flex items-center justify-center transition-colors",T?P.bg+" text-white":P.light),children:N?r.jsx(ta,{className:"w-4 h-4"}):r.jsx(E,{className:Ae("w-4 h-4",!T&&P.text)})}),r.jsx("span",{className:Ae("flex-1",T&&"font-medium"),children:b.title}),b.subsections.length>0&&r.jsx(Qr,{className:Ae("w-4 h-4 text-muted-foreground transition-transform",n[b.id]&&"rotate-90")})]}),b.subsections.length>0&&n[b.id]&&r.jsx("div",{className:"ml-4 mt-1 space-y-0.5 border-l-2 border-border pl-3",children:b.subsections.map(M=>{const I=e===M.id,O=o.includes(M.id);return r.jsxs("button",{className:Ae("w-full text-left px-3 py-1.5 text-sm rounded-md hover:bg-accent text-foreground flex items-center gap-2",I&&"bg-accent font-medium",I&&P.text),onClick:()=>t(M.id),children:[O&&!I&&r.jsx(ta,{className:"w-3 h-3 text-green-500"}),r.jsx("span",{className:Ae(!O&&!I&&"ml-5"),children:M.title})]},M.id)})})]},b.id)})})})]}),r.jsxs("div",{className:"flex-1 overflow-hidden flex flex-col",children:[r.jsx("div",{className:Ae("px-8 py-4 border-b border-border",y.light),children:r.jsxs("div",{className:"max-w-3xl mx-auto flex items-center gap-3",children:[r.jsx("div",{className:Ae("w-10 h-10 rounded-xl flex items-center justify-center",y.bg,"text-white"),children:r.jsx(_.icon,{className:"w-5 h-5"})}),r.jsxs("div",{children:[r.jsx("p",{className:Ae("text-sm font-medium",y.text),children:_.title}),r.jsx("h1",{className:"text-lg font-semibold text-foreground",children:(c==null?void 0:c.title)||v(e)})]})]})}),r.jsx(Wn,{className:"flex-1",ref:u,children:r.jsx("div",{className:"max-w-3xl mx-auto p-8",children:c?r.jsx("div",{className:"prose prose-sm max-w-none dark:prose-invert prose-headings:text-foreground prose-p:text-muted-foreground prose-strong:text-foreground prose-code:text-primary prose-code:bg-muted prose-code:px-1 prose-code:py-0.5 prose-code:rounded prose-pre:bg-muted prose-pre:border prose-pre:border-border",dangerouslySetInnerHTML:g(c.content)}):r.jsxs("div",{className:"text-center text-muted-foreground py-12",children:[r.jsx(Gd,{className:"w-12 h-12 mx-auto mb-4 opacity-50"}),r.jsx("p",{children:"Select a topic from the sidebar"})]})})}),r.jsx("div",{className:"border-t border-border p-4 bg-muted/30",children:r.jsxs("div",{className:"max-w-3xl mx-auto flex items-center justify-between",children:[h?r.jsxs(ie,{variant:"ghost",onClick:()=>t(h),className:"flex items-center gap-2",children:[r.jsx(v5,{className:"w-4 h-4"}),r.jsx("span",{className:"max-w-[150px] truncate",children:v(h)})]}):r.jsx("div",{}),r.jsxs("span",{className:"text-xs text-muted-foreground",children:[m+1," of ",f.length]}),x?r.jsxs(ie,{onClick:()=>t(x),className:Ae("flex items-center gap-2",y.bg,"hover:opacity-90"),children:[r.jsx("span",{className:"max-w-[150px] truncate",children:v(x)}),r.jsx(sg,{className:"w-4 h-4"})]}):r.jsx(ie,{variant:"outline",onClick:()=>t("intro"),className:"flex items-center gap-2",children:"Start Over"})]})})]})]})}function vW(){const[e,t]=C.useState(null),[n,s]=C.useState(!0),[o,d]=C.useState(!1),[u,l]=C.useState(!1),[c,f]=C.useState(!1),[m,h]=C.useState(null);C.useEffect(()=>{x()},[]);const x=async()=>{try{s(!0);const j=await ge.getSessionStatus();t(j)}catch{X.error("Failed to load session status")}finally{s(!1)}},w=async()=>{var j,E;d(!0);try{const P=await ge.installSessionAll();P.success?(X.success("Session persistence installed!"),x()):X.error(((j=P.hooks)==null?void 0:j.error)||((E=P.command)==null?void 0:E.error)||"Installation failed")}catch{X.error("Installation failed")}finally{d(!1)}},k=async()=>{d(!0);try{const j=await ge.installSessionHooks();j.success?(X.success("Session hooks installed!"),x()):X.error(j.error||"Failed to install hooks")}catch{X.error("Failed to install hooks")}finally{d(!1)}},_=async()=>{d(!0);try{const j=await ge.installFlushCommand();j.success?(X.success(j.alreadyInstalled?"/flush command already installed":"/flush command installed!"),x()):X.error(j.error||"Failed to install command")}catch{X.error("Failed to install command")}finally{d(!1)}},y=async()=>{l(!0);try{const j=await ge.clearSessionContext();j.success?(X.success(j.cleared?"Session context cleared":"No context to clear"),x()):X.error("Failed to clear context")}catch{X.error("Failed to clear context")}finally{l(!1)}},v=async()=>{try{const j=await ge.getSessionContext();h(j.content),f(!0)}catch{X.error("Failed to load context")}},g=j=>j===null?"Unknown":j<60?`${j} minutes ago`:j<1440?`${Math.floor(j/60)} hours ago`:`${Math.floor(j/1440)} days ago`;if(n)return r.jsx("div",{className:"flex items-center justify-center h-64",children:r.jsx(tt,{className:"w-8 h-8 animate-spin text-indigo-600"})});const b=(e==null?void 0:e.hooksInstalled)&&(e==null?void 0:e.flushCommandInstalled)&&(e==null?void 0:e.permissionInstalled);return r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"bg-white dark:bg-slate-950 rounded-xl border border-gray-200 dark:border-slate-800 p-5 shadow-sm",children:[r.jsxs("div",{className:"flex items-center justify-between mb-4",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"p-2 rounded-lg bg-indigo-100 dark:bg-indigo-950",children:r.jsx(Hn,{className:"w-5 h-5 text-indigo-600 dark:text-indigo-400"})}),r.jsxs("div",{children:[r.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Session Persistence"}),r.jsx("p",{className:"text-sm text-gray-500 dark:text-slate-400",children:"Save and restore Claude Code session context"})]})]}),r.jsx(ie,{variant:"ghost",size:"sm",onClick:x,children:r.jsx(yr,{className:"w-4 h-4"})})]}),r.jsxs("p",{className:"text-sm text-gray-600 dark:text-slate-400",children:["Session persistence allows you to save your current Claude Code context using the ",r.jsx("code",{className:"bg-gray-100 dark:bg-slate-800 px-1.5 py-0.5 rounded text-indigo-600 dark:text-indigo-400",children:"/flush"})," command, and automatically restore it when you start a new session."]})]}),r.jsxs("div",{className:"bg-white dark:bg-slate-950 rounded-xl border border-gray-200 dark:border-slate-800 overflow-hidden shadow-sm",children:[r.jsx("div",{className:"p-4 border-b border-gray-200 dark:border-slate-700",children:r.jsx("h3",{className:"font-medium text-gray-900 dark:text-white",children:"Installation Status"})}),r.jsxs("div",{className:"divide-y divide-gray-100 dark:divide-slate-800",children:[r.jsxs("div",{className:"p-4 flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[e!=null&&e.hooksInstalled?r.jsx(Mt,{className:"w-5 h-5 text-green-500"}):r.jsx(Sn,{className:"w-5 h-5 text-amber-500"}),r.jsxs("div",{children:[r.jsx("div",{className:"text-sm font-medium text-gray-900 dark:text-white",children:"Session Hooks"}),r.jsx("div",{className:"text-xs text-gray-500 dark:text-slate-400",children:"Auto-restore context on session start, preserve on session end"})]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Qe,{variant:e!=null&&e.hooksInstalled?"default":"secondary",children:e!=null&&e.hooksInstalled?"Installed":"Not Installed"}),!(e!=null&&e.hooksInstalled)&&r.jsx(ie,{variant:"outline",size:"sm",onClick:k,disabled:o,children:o?r.jsx(tt,{className:"w-4 h-4 animate-spin"}):"Install"})]})]}),r.jsxs("div",{className:"p-4 flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[e!=null&&e.flushCommandInstalled?r.jsx(Mt,{className:"w-5 h-5 text-green-500"}):r.jsx(Sn,{className:"w-5 h-5 text-amber-500"}),r.jsxs("div",{children:[r.jsx("div",{className:"text-sm font-medium text-gray-900 dark:text-white",children:"/flush Command"}),r.jsx("div",{className:"text-xs text-gray-500 dark:text-slate-400",children:"Adds the /flush command to save session context"})]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Qe,{variant:e!=null&&e.flushCommandInstalled?"default":"secondary",children:e!=null&&e.flushCommandInstalled?"Installed":"Not Installed"}),!(e!=null&&e.flushCommandInstalled)&&r.jsx(ie,{variant:"outline",size:"sm",onClick:_,disabled:o,children:o?r.jsx(tt,{className:"w-4 h-4 animate-spin"}):"Install"})]})]}),r.jsxs("div",{className:"p-4 flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[e!=null&&e.permissionInstalled?r.jsx(Mt,{className:"w-5 h-5 text-green-500"}):r.jsx(Sn,{className:"w-5 h-5 text-amber-500"}),r.jsxs("div",{children:[r.jsx("div",{className:"text-sm font-medium text-gray-900 dark:text-white",children:"Write Permission"}),r.jsx("div",{className:"text-xs text-gray-500 dark:text-slate-400",children:"Allows Claude to write session context without prompting"})]})]}),r.jsx(Qe,{variant:e!=null&&e.permissionInstalled?"default":"secondary",children:e!=null&&e.permissionInstalled?"Granted":"Not Granted"})]})]}),!b&&r.jsx("div",{className:"p-4 bg-gray-50 dark:bg-slate-900 border-t border-gray-200 dark:border-slate-800",children:r.jsxs(ie,{onClick:w,disabled:o,className:"w-full bg-indigo-600 hover:bg-indigo-700 text-white",children:[o?r.jsx(tt,{className:"w-4 h-4 mr-2 animate-spin"}):r.jsx(Qi,{className:"w-4 h-4 mr-2"}),"Install All"]})})]}),r.jsxs("div",{className:"bg-white dark:bg-slate-950 rounded-xl border border-gray-200 dark:border-slate-800 overflow-hidden shadow-sm",children:[r.jsxs("div",{className:"p-4 border-b border-gray-200 dark:border-slate-700 flex items-center justify-between",children:[r.jsx("h3",{className:"font-medium text-gray-900 dark:text-white",children:"Saved Context"}),(e==null?void 0:e.hasSavedContext)&&r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs(ie,{variant:"outline",size:"sm",onClick:v,children:[r.jsx(Er,{className:"w-4 h-4 mr-2"}),"View"]}),r.jsx(ie,{variant:"outline",size:"sm",onClick:y,disabled:u,className:"text-red-600 hover:text-red-700 hover:bg-red-50 dark:hover:bg-red-950",children:u?r.jsx(tt,{className:"w-4 h-4 animate-spin"}):r.jsx(un,{className:"w-4 h-4"})})]})]}),r.jsx("div",{className:"p-4",children:e!=null&&e.hasSavedContext?r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[r.jsx(pl,{className:"w-4 h-4 text-gray-400"}),r.jsx("span",{className:"text-gray-600 dark:text-slate-400",children:"Last saved:"}),r.jsx("span",{className:"text-gray-900 dark:text-white",children:g(e.contextAge)})]}),e.contextPreview&&r.jsx("div",{className:"bg-gray-50 dark:bg-slate-900 rounded-lg p-3",children:r.jsx("pre",{className:"text-xs text-gray-600 dark:text-slate-400 whitespace-pre-wrap overflow-hidden",children:e.contextPreview})}),r.jsxs("div",{className:"text-xs text-gray-500 dark:text-slate-500",children:["Storage: ",e.sessionDir]})]}):r.jsxs("div",{className:"text-center py-6",children:[r.jsx(Hn,{className:"w-12 h-12 text-gray-300 dark:text-slate-600 mx-auto mb-3"}),r.jsx("p",{className:"text-sm text-gray-600 dark:text-slate-400",children:"No saved context"}),r.jsxs("p",{className:"text-xs text-gray-400 dark:text-slate-500 mt-1",children:["Use ",r.jsx("code",{className:"bg-gray-100 dark:bg-slate-800 px-1 rounded",children:"/flush"})," in Claude Code to save your session"]})]})})]}),(e==null?void 0:e.lastSession)&&r.jsxs("div",{className:"bg-white dark:bg-slate-950 rounded-xl border border-gray-200 dark:border-slate-800 overflow-hidden shadow-sm",children:[r.jsx("div",{className:"p-4 border-b border-gray-200 dark:border-slate-700",children:r.jsx("h3",{className:"font-medium text-gray-900 dark:text-white",children:"Last Session"})}),r.jsxs("div",{className:"p-4 space-y-2",children:[e.lastSession.session_id&&r.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[r.jsx("span",{className:"text-gray-500 dark:text-slate-400 w-20",children:"ID:"}),r.jsx("code",{className:"text-xs bg-gray-100 dark:bg-slate-800 px-2 py-0.5 rounded",children:e.lastSession.session_id})]}),e.lastSession.cwd&&r.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[r.jsx("span",{className:"text-gray-500 dark:text-slate-400 w-20",children:"Directory:"}),r.jsx("span",{className:"text-gray-900 dark:text-white font-mono text-xs",children:e.lastSession.cwd})]}),e.lastSession.timestamp&&r.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[r.jsx("span",{className:"text-gray-500 dark:text-slate-400 w-20",children:"Ended:"}),r.jsx("span",{className:"text-gray-900 dark:text-white",children:e.lastSession.timestamp})]}),e.lastSession.reason&&r.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[r.jsx("span",{className:"text-gray-500 dark:text-slate-400 w-20",children:"Reason:"}),r.jsx(Qe,{variant:"secondary",children:e.lastSession.reason})]})]})]}),r.jsxs("div",{className:"bg-gray-50 dark:bg-slate-900 rounded-lg p-4 border border-transparent dark:border-slate-800",children:[r.jsx("h4",{className:"text-sm font-medium text-gray-900 dark:text-white mb-2",children:"How to Use"}),r.jsxs("ol",{className:"space-y-2 text-sm text-gray-600 dark:text-slate-400",children:[r.jsxs("li",{className:"flex gap-2",children:[r.jsx("span",{className:"font-medium text-indigo-600 dark:text-indigo-400",children:"1."}),"Install session hooks and the /flush command above"]}),r.jsxs("li",{className:"flex gap-2",children:[r.jsx("span",{className:"font-medium text-indigo-600 dark:text-indigo-400",children:"2."}),"Use ",r.jsx("code",{className:"bg-white dark:bg-slate-800 px-1.5 py-0.5 rounded",children:"/flush"})," in Claude Code before ending a session"]}),r.jsxs("li",{className:"flex gap-2",children:[r.jsx("span",{className:"font-medium text-indigo-600 dark:text-indigo-400",children:"3."}),"Your context is automatically restored when you start a new session"]})]})]}),r.jsxs("div",{className:"bg-gray-50 dark:bg-slate-900 rounded-lg p-4 border border-transparent dark:border-slate-800",children:[r.jsx("h4",{className:"text-sm font-medium text-gray-900 dark:text-white mb-2",children:"CLI Commands"}),r.jsxs("div",{className:"space-y-1 text-sm text-gray-600 dark:text-slate-400 font-mono",children:[r.jsx("p",{children:"coder-config session # Show session status"}),r.jsx("p",{children:"coder-config session install-hooks # Install session hooks"}),r.jsx("p",{children:"coder-config session clear # Clear saved context"})]})]}),r.jsx(wt,{open:c,onOpenChange:f,children:r.jsxs(gt,{className:"max-w-2xl max-h-[80vh] overflow-hidden flex flex-col",children:[r.jsxs(xt,{children:[r.jsx(vt,{children:"Saved Context"}),r.jsx(er,{children:"This context will be restored on your next Claude Code session"})]}),r.jsx("div",{className:"flex-1 overflow-auto py-4",children:r.jsx("pre",{className:"text-sm text-gray-700 dark:text-slate-300 whitespace-pre-wrap bg-gray-50 dark:bg-slate-900 p-4 rounded-lg",children:m||"No content"})}),r.jsx(At,{children:r.jsx(ie,{variant:"ghost",onClick:()=>f(!1),children:"Close"})})]})})]})}const yW=[{id:"projects",label:"All Projects",icon:fs,section:"Projects"},{id:"explorer",label:"Project Explorer",icon:Ci,section:"Projects"},{id:"workstreams",label:"Workstreams",icon:WC,section:"Projects"},{id:"registry",label:"MCP Registry",icon:bs,section:"Tools"},{id:"plugins",label:"Plugins",icon:eo,section:"Tools"},{id:"memory",label:"Memory",icon:Ji,section:"Tools"},{id:"claude-settings",label:"Claude Code",icon:ks,section:"Configuration",tool:"claude"},{id:"gemini-settings",label:"Gemini CLI",icon:Ft,section:"Configuration",tool:"gemini"},{id:"codex-settings",label:"Codex CLI",icon:Ft,section:"Configuration",isNew:!0,tool:"codex"},{id:"antigravity-settings",label:"Antigravity",icon:Hl,section:"Configuration",tool:"antigravity"},{id:"create-mcp",label:"Create MCP",icon:Fn,section:"Developer"},{id:"loops",label:"Ralph Loops",icon:kl,section:"Developer",isNew:!0},{id:"sessions",label:"Sessions",icon:Hn,section:"System"},{id:"preferences",label:"Preferences",icon:VC,section:"System"},{id:"tutorial",label:"Tutorial",icon:Gd,section:"Help"},{id:"docs",label:"Docs & Help",icon:Xi,section:"Help"}],e_=(e,t)=>{try{const n=localStorage.getItem(`claude-config-${e}`);return n?JSON.parse(n):t}catch{return t}},bW=(e,t)=>{try{localStorage.setItem(`claude-config-${e}`,JSON.stringify(t))}catch{}};function wW(){const[e,t]=C.useState(()=>e_("currentView","explorer")),[n,s]=C.useState(!0),[o,d]=C.useState({dir:"",subprojects:[],hierarchy:[]}),[u,l]=C.useState([]),[c,f]=C.useState({mcpServers:{}}),[m,h]=C.useState([]),[x,w]=C.useState([]),[k,_]=C.useState(null),[y,v]=C.useState(null),[g,b]=C.useState(!1),[j,E]=C.useState({title:"",type:""}),[P,T]=C.useState(""),[N,M]=C.useState(""),[I,O]=C.useState({}),[B,H]=C.useState(null),[q,z]=C.useState(null),[G,J]=C.useState(!1),[K,F]=C.useState([]),[R,L]=C.useState(null),[U,$]=C.useState(!1),[ne,he]=C.useState(null),[me,Y]=C.useState(null),[W,le]=C.useState(!1),te=C.useRef(null);C.useEffect(()=>{bW("currentView",e)},[e]);const Q=C.useCallback(async()=>{try{const[Se,Ne,se,xe,De]=await Promise.all([ge.getProject(),ge.getConfigs(),ge.getRegistry(),ge.getRules(),ge.getCommands()]);d(Se),l(Ne),f(se),h(xe),w(De),Ne.length>0&&!k&&_(Ne[Ne.length-1])}catch(Se){X.error("Failed to load data: "+Se.message)}finally{s(!1)}},[k]),oe=C.useCallback(async(Se=!1)=>{var Ne;try{const se=await ge.getProjects();F(se.projects||[]);const xe=(Ne=se.projects)==null?void 0:Ne.find(De=>De.isActive);if(L(xe||null),Se&&xe){const De=await ge.getSubprojects(xe.path);he({dir:xe.path,subprojects:De.subprojects||[]})}Se&&!xe&&(e_("currentView",null)||t("projects"))}catch{console.log("Projects API not available")}},[]),ye=async Se=>{try{const Ne=await ge.setActiveProject(Se);Ne.success?(d({dir:Ne.dir,hierarchy:Ne.hierarchy,subprojects:Ne.subprojects}),he({dir:Ne.dir,subprojects:Ne.subprojects}),L(Ne.project),F(se=>se.map(xe=>({...xe,isActive:xe.id===Se}))),await Q(),X.success(`Switched to ${Ne.project.name}`)):X.error(Ne.error||"Failed to switch project")}catch(Ne){X.error("Failed to switch project: "+Ne.message)}},Be=Se=>{F(Ne=>[...Ne,{...Se,exists:!0,hasClaudeConfig:!1}])};C.useEffect(()=>{Q(),oe(!0),(async()=>{var Ne;try{const[se,xe]=await Promise.all([ge.checkVersion(),ge.getConfig()]);if(H(se==null?void 0:se.installedVersion),Y((xe==null?void 0:xe.config)||{}),!te.current&&(se!=null&&se.installedVersion)&&(te.current=se.installedVersion),se!=null&&se.updateAvailable&&(se==null?void 0:se.updateMethod)==="npm")if((Ne=xe==null?void 0:xe.config)!=null&&Ne.autoUpdate){X.info(`Auto-updating to v${se.latestVersion}...`),J(!0);const De=await ge.performUpdate({updateMethod:se.updateMethod,targetVersion:se.latestVersion});if(De.success){X.success(`Updated to v${De.newVersion}! Restarting server...`);try{await ge.restartServer()}catch{}let He=0;const ze=setInterval(async()=>{He++;try{await ge.checkVersion(),clearInterval(ze),X.success("Server restarted! Reloading..."),setTimeout(()=>window.location.reload(),500)}catch{He>30&&(clearInterval(ze),X.info("Server restarting. Please refresh the page."),J(!1))}},500)}else X.error("Auto-update failed: "+De.error),J(!1),z(se)}else z(se)}catch{}})()},[]),C.useEffect(()=>{const Ne=setInterval(async()=>{if(te.current)try{const se=await ge.checkVersion();se!=null&&se.installedVersion&&se.installedVersion!==te.current&&(console.log(`[stale-ui] Server updated to v${se.installedVersion}, refreshing...`),window.location.reload())}catch{}},3e4);return()=>clearInterval(Ne)},[]);const Ke=(Se,Ne)=>{if(!Se||!Ne)return!1;const se=He=>He.split(".").map(ze=>parseInt(ze,10)||0),xe=se(Se),De=se(Ne);for(let He=0;He<Math.max(xe.length,De.length);He++){if((xe[He]||0)>(De[He]||0))return!0;if((xe[He]||0)<(De[He]||0))return!1}return!1},ce=async(Se,Ne="npm")=>{J(!0);const se=await ge.performUpdate({updateMethod:Ne,targetVersion:Se});if(se.success){X.success(`Updated to v${se.newVersion}! Restarting server...`),z(null);try{await ge.restartServer()}catch{}let xe=0;const De=setInterval(async()=>{xe++;try{await ge.checkVersion(),clearInterval(De),X.success("Server restarted! Reloading..."),setTimeout(()=>window.location.reload(),500)}catch{xe>30&&(clearInterval(De),X.info("Server restarting. Please refresh the page."),J(!1))}},500);return!0}else return X.error("Update failed: "+se.error),J(!1),!1},be=async()=>{le(!0);try{const Se=await ge.checkVersion(),Ne=Se==null?void 0:Se.installedVersion,se=Se==null?void 0:Se.latestVersion;if(Ne&&te.current&&Ne!==te.current){X.info(`Refreshing to v${Ne}...`),setTimeout(()=>window.location.reload(),500);return}Ke(se,Ne)&&(me!=null&&me.autoUpdate?(le(!1),X.info(`Auto-updating to v${se}...`),await ce(se,(Se==null?void 0:Se.updateMethod)||"npm")):(z({...Se,updateAvailable:!0}),X.info(`Update available: v${se}`)))}catch{X.error("Failed to check for updates")}finally{le(!1)}},Je=async()=>{if(q!=null&&q.updateAvailable){J(!0);try{const Se=await ge.performUpdate({updateMethod:q.updateMethod,sourcePath:q.sourcePath,targetVersion:q.latestVersion});if(Se.success){X.success(`Updated to v${Se.newVersion}! Restarting server...`),z(null),H(Se.newVersion);try{await ge.restartServer()}catch{}let Ne=0;const se=setInterval(async()=>{Ne++;try{await ge.checkVersion(),clearInterval(se),X.success("Server restarted! Reloading..."),setTimeout(()=>window.location.reload(),500)}catch{Ne>30&&(clearInterval(se),X.info("Server restarting. Please refresh the page."),J(!1))}},500)}else X.error("Update failed: "+Se.error),J(!1)}catch(Se){X.error("Update failed: "+Se.message),J(!1)}}};C.useEffect(()=>{const Se=async()=>{try{const{hashes:se}=await ge.getFileHashes(),xe=I,De=Object.keys(se).some(ze=>xe[ze]!==se[ze])||Object.keys(xe).some(ze=>!se[ze]),He=xe.__subprojects__!==se.__subprojects__;if(De&&Object.keys(xe).length>0&&(X.info("Files changed externally, reloading..."),await Q(),He&&ne))try{const ze=await ge.getSubprojects(ne.dir);he(Ct=>({...Ct,subprojects:ze.subprojects||[]}))}catch{}O(se)}catch{}},Ne=setInterval(Se,2e3);return Se(),()=>clearInterval(Ne)},[I,Q,ne]);const qe=new Set;u.forEach(Se=>{var Ne,se;(((Ne=Se.config)==null?void 0:Ne.include)||[]).forEach(xe=>qe.add(xe)),Object.keys(((se=Se.config)==null?void 0:se.mcpServers)||{}).forEach(xe=>qe.add(xe))});const ct={mcps:qe.size,rules:m.length,commands:x.length},ke=async()=>{try{const Se=await ge.applyConfig(o.dir);if(Se.tools){const Ne=Object.entries(Se.tools).filter(([,se])=>se).map(([se])=>se==="claude"?"Claude Code":"Antigravity");Ne.length>0?X.success(`Config applied to: ${Ne.join(", ")}`):X.warning("No tools were updated")}else X.success("Configuration applied successfully!")}catch(Se){X.error("Failed to apply config: "+Se.message)}},we=async()=>{s(!0),await Q(),X.success("Data refreshed")};if(n)return r.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:r.jsxs("div",{className:"flex flex-col items-center gap-4",children:[r.jsx(tt,{className:"w-8 h-8 animate-spin text-primary"}),r.jsx("p",{className:"text-muted-foreground",children:"Loading configuration..."})]})});const Le=()=>{switch(e){case"explorer":return r.jsx(o8,{project:o,onRefresh:Q});case"registry":return r.jsx(_z,{registry:c,searchQuery:P,setSearchQuery:T,onUpdate:Q});case"plugins":return r.jsx(Gz,{});case"memory":return r.jsx(Cz,{project:o,onUpdate:Q});case"create-mcp":return r.jsx(ZH,{project:o});case"claude-settings":return r.jsx(FH,{});case"gemini-settings":return r.jsx(BH,{});case"codex-settings":return r.jsx(JH,{});case"antigravity-settings":return r.jsx(VH,{});case"sessions":return r.jsx(vW,{});case"preferences":return r.jsx(OH,{onConfigChange:Se=>Y(Se)});case"projects":return r.jsx(Sz,{onProjectSwitch:Se=>{d({dir:Se.dir,hierarchy:Se.hierarchy,subprojects:Se.subprojects}),he({dir:Se.dir,subprojects:Se.subprojects}),Q(),oe()}});case"workstreams":return r.jsx(Kz,{projects:K,onWorkstreamChange:Se=>{X.success(`Switched to workstream: ${Se.name}`)}});case"loops":return r.jsx(qz,{activeProject:R});case"docs":return r.jsx(Vz,{});case"tutorial":return r.jsx(xW,{});default:return null}};return r.jsxs("div",{className:"min-h-screen bg-background",children:[r.jsx("header",{className:"h-16 bg-card border-b border-border sticky top-0 z-50 shadow-sm",children:r.jsxs("div",{className:"h-full px-6 flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-4",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"w-10 h-10 rounded-xl bg-gradient-to-br from-indigo-500 to-purple-600 flex items-center justify-center shadow-lg shadow-indigo-500/20",children:r.jsxs("svg",{width:"22",height:"22",viewBox:"0 0 128 128",children:[r.jsx("circle",{cx:"64",cy:"64",r:"52",fill:"none",stroke:"white",strokeWidth:"10",strokeDasharray:"24 12"}),r.jsx("circle",{cx:"64",cy:"64",r:"28",fill:"white"}),r.jsx("circle",{cx:"64",cy:"64",r:"12",fill:"#7c3aed"})]})}),r.jsx("div",{children:r.jsxs("h1",{className:"text-xl font-bold text-foreground",children:["Coder ",r.jsx("span",{className:"text-primary",children:"Config"})]})}),q&&r.jsxs("button",{onClick:Je,disabled:G,className:"ml-3 px-2.5 py-1 text-xs font-medium bg-green-100 text-green-700 hover:bg-green-200 rounded-full flex items-center gap-1.5 transition-colors disabled:opacity-50",children:[G?r.jsx(tt,{className:"w-3 h-3 animate-spin"}):r.jsx(Qi,{className:"w-3 h-3"}),G?"Updating...":`Update to v${q.latestVersion}`]})]}),r.jsx(Qj,{orientation:"vertical",className:"h-6"}),r.jsx(a8,{projects:K,activeProject:R,onSwitch:ye,onAddClick:()=>$(!0),onManageClick:()=>t("projects")})]}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx(u8,{}),r.jsx(ie,{variant:"ghost",size:"sm",onClick:we,children:r.jsx(yr,{className:"w-4 h-4"})}),r.jsxs(ie,{onClick:ke,variant:"ghost",size:"sm",className:"gap-2 text-muted-foreground hover:text-foreground",title:"Config auto-applies on save. Click to manually re-apply.",children:[r.jsx(Hl,{className:"w-4 h-4"}),"Re-apply"]})]})]})}),r.jsxs("div",{className:"flex",children:[r.jsxs("aside",{className:"w-64 h-[calc(100vh-64px)] border-r border-border bg-card sticky top-16 flex flex-col",children:[r.jsx(Wn,{className:"flex-1 py-4",children:["Projects","Tools","Configuration","Developer","System","Help"].map(Se=>r.jsxs("div",{className:"mb-6",children:[r.jsx("h3",{className:"px-4 mb-2 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:Se}),r.jsx("div",{className:"space-y-0.5",children:yW.filter(Ne=>Ne.section===Se).filter(Ne=>{var se;return Ne.id!=="loops"||((se=me==null?void 0:me.experimental)==null?void 0:se.ralphLoops)}).filter(Ne=>!Ne.tool||((me==null?void 0:me.enabledTools)||["claude"]).includes(Ne.tool)).map(Ne=>{const se=Ne.icon,xe=e===Ne.id;return r.jsxs("button",{onClick:()=>t(Ne.id),className:`w-full flex items-center gap-3 px-4 py-2.5 text-sm transition-all duration-200 border-l-2 ${xe?"bg-accent border-primary text-primary font-medium":"border-transparent text-muted-foreground hover:text-foreground hover:bg-accent"}`,children:[r.jsx(se,{className:"w-4 h-4"}),r.jsx("span",{className:"flex-1 text-left",children:Ne.label}),Ne.badge&&r.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full font-medium ${xe?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground"}`,children:ct[Ne.badge]}),Ne.isNew&&r.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded font-medium bg-green-500/20 text-green-600 dark:text-green-400",children:"new"})]},Ne.id)})})]},Se))}),r.jsx("div",{className:"px-4 py-3 border-t border-border",children:r.jsxs("button",{onClick:be,disabled:W,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center gap-1",title:"Check for updates",children:[W?r.jsx(tt,{className:"w-3 h-3 animate-spin"}):null,B?`v${B}`:""]})})]}),r.jsx("main",{style:["explorer","docs","tutorial"].includes(e)?{}:{zoom:.9},className:Ae("flex-1 overflow-auto",["explorer","docs","tutorial"].includes(e)?"h-[calc(100vh-64px)]":"p-6"),children:r.jsx(i_,{mode:"wait",children:r.jsx(Uo.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},className:["explorer","docs","tutorial"].includes(e)?"h-full":"",children:Le()},e)})})]}),r.jsx(qj,{open:U,onOpenChange:$,onAdded:Be}),r.jsx(l8,{onStartTutorial:()=>t("tutorial")})]})}function _W(){const[e,t]=C.useState(!1),[n,s]=C.useState(!1),[o,d]=C.useState(!1),u=C.useCallback(async()=>{s(!0);try{await ge.restartServer(),X.info("Server restarting... page will reload."),setTimeout(()=>{window.location.reload()},2e3)}catch(c){X.error("Failed to restart: "+c.message),s(!1)}},[]),l=C.useCallback(()=>{d(!0),t(!1),X.dismiss("update-available")},[]);return C.useEffect(()=>{let c;const f=async()=>{try{const m=await ge.getVersion();console.log("[Update Check]",m),m.needsRestart&&!o&&t(!0)}catch{}};return f(),c=setInterval(f,3e4),()=>clearInterval(c)},[o]),r.jsx(c8,{children:r.jsxs("div",{className:"min-h-screen bg-background",children:[e&&!n&&r.jsxs("div",{className:"fixed top-0 left-0 right-0 z-50 bg-blue-600 text-white px-4 py-2 flex items-center justify-center gap-2 shadow-lg cursor-pointer hover:bg-blue-700 transition-colors",onClick:u,children:[r.jsx(yr,{className:"w-4 h-4"}),r.jsx("span",{className:"text-sm font-medium",children:"Update available — click to restart"}),r.jsx("button",{onClick:c=>{c.stopPropagation(),l()},className:"absolute right-3 p-1 hover:bg-blue-500 rounded",children:r.jsx(yi,{className:"w-4 h-4"})})]}),n&&r.jsxs("div",{className:"fixed top-0 left-0 right-0 z-50 bg-amber-600 text-white px-4 py-2 flex items-center justify-center gap-2",children:[r.jsx(yr,{className:"w-4 h-4 animate-spin"}),r.jsx("span",{className:"text-sm font-medium",children:"Restarting server..."})]}),r.jsx(wW,{}),r.jsx(EP,{position:"bottom-right",richColors:!0})]})})}tP.createRoot(document.getElementById("root")).render(r.jsx(_W,{}));
|
package/ui/dist/index.html
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
|
|
20
20
|
<!-- PWA Manifest -->
|
|
21
21
|
<link rel="manifest" href="/manifest.json">
|
|
22
|
-
<script type="module" crossorigin src="/assets/index-
|
|
22
|
+
<script type="module" crossorigin src="/assets/index-CcLAqDrQ.js"></script>
|
|
23
23
|
<link rel="stylesheet" crossorigin href="/assets/index-B0EJaqXM.css">
|
|
24
24
|
</head>
|
|
25
25
|
<body>
|