coder-config 0.45.3 → 0.45.4
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.45.
|
|
3
|
+
"version": "0.45.4",
|
|
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",
|
|
@@ -3754,4 +3754,4 @@ Everything you can do in the UI, you can do from the command line. Some power us
|
|
|
3754
3754
|
Thanks for using Coder Config. The goal is to make AI coding assistants work the way you want them to, without the friction of scattered configuration files and forgotten context. Hopefully this tool helps.
|
|
3755
3755
|
|
|
3756
3756
|
Happy coding.
|
|
3757
|
-
`}},LW={...kW,...jW,...NW,...EW,...PW,...AW,...TW,...RW,...MW,...DW,...IW},ou={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"}},y_="claude-config-tutorial-visited";function OW(){const[e,t]=_.useState("intro"),[s,n]=_.useState({welcome:!0}),[o,c]=_.useState(()=>{try{return JSON.parse(localStorage.getItem(y_)||"[]")}catch{return[]}}),u=_.useRef(null);_.useEffect(()=>{if(u.current){const b=u.current.querySelector("[data-radix-scroll-area-viewport]");b&&(b.scrollTop=0)}},[e]),_.useEffect(()=>{if(e&&!o.includes(e)){const b=[...o,e];c(b),localStorage.setItem(y_,JSON.stringify(b))}},[e,o]);const l=b=>{n(k=>({...k,[b]:!k[b]}))},d=LW[e],f=Vl.flatMap(b=>b.subsections.length>0?b.subsections.map(k=>k.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),C=(()=>{for(const b of Vl)if(b.id===e||b.subsections.some(k=>k.id===e))return b;return Vl[0]})(),v=ou[C.id]||ou.welcome,y=b=>{for(const k of Vl){if(k.id===b)return k.title;const E=k.subsections.find(P=>P.id===b);if(E)return E.title}return""},g=b=>({__html:x2(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(Cu,{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(nn,{className:"flex-1",children:r.jsx("div",{className:"p-2",children:Vl.map((b,k)=>{const E=b.icon,P=ou[b.id]||ou.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:Ne("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),s[b.id]||t(b.subsections[0].id)):t(b.id)},children:[r.jsx("span",{className:Ne("w-7 h-7 rounded-lg flex items-center justify-center transition-colors",T?P.bg+" text-white":P.light),children:N?r.jsx(No,{className:"w-4 h-4"}):r.jsx(E,{className:Ne("w-4 h-4",!T&&P.text)})}),r.jsx("span",{className:Ne("flex-1",T&&"font-medium"),children:b.title}),b.subsections.length>0&&r.jsx(us,{className:Ne("w-4 h-4 text-muted-foreground transition-transform",s[b.id]&&"rotate-90")})]}),b.subsections.length>0&&s[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,L=o.includes(M.id);return r.jsxs("button",{className:Ne("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:[L&&!I&&r.jsx(No,{className:"w-3 h-3 text-green-500"}),r.jsx("span",{className:Ne(!L&&!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:Ne("px-8 py-4 border-b border-border",v.light),children:r.jsxs("div",{className:"max-w-3xl mx-auto flex items-center gap-3",children:[r.jsx("div",{className:Ne("w-10 h-10 rounded-xl flex items-center justify-center",v.bg,"text-white"),children:r.jsx(C.icon,{className:"w-5 h-5"})}),r.jsxs("div",{children:[r.jsx("p",{className:Ne("text-sm font-medium",v.text),children:C.title}),r.jsx("h1",{className:"text-lg font-semibold text-foreground",children:(d==null?void 0:d.title)||y(e)})]})]})}),r.jsx(nn,{className:"flex-1",ref:u,children:r.jsx("div",{className:"max-w-3xl mx-auto p-8",children:d?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(d.content)}):r.jsxs("div",{className:"text-center text-muted-foreground py-12",children:[r.jsx(Cu,{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(re,{variant:"ghost",onClick:()=>t(h),className:"flex items-center gap-2",children:[r.jsx(S5,{className:"w-4 h-4"}),r.jsx("span",{className:"max-w-[150px] truncate",children:y(h)})]}):r.jsx("div",{}),r.jsxs("span",{className:"text-xs text-muted-foreground",children:[m+1," of ",f.length]}),x?r.jsxs(re,{onClick:()=>t(x),className:Ne("flex items-center gap-2",v.bg,"hover:opacity-90"),children:[r.jsx("span",{className:"max-w-[150px] truncate",children:y(x)}),r.jsx(Pg,{className:"w-4 h-4"})]}):r.jsx(re,{variant:"outline",onClick:()=>t("intro"),className:"flex items-center gap-2",children:"Start Over"})]})})]})]})}function FW(){const[e,t]=_.useState(null),[s,n]=_.useState(!0),[o,c]=_.useState(!1),[u,l]=_.useState(!1),[d,f]=_.useState(!1),[m,h]=_.useState(null);_.useEffect(()=>{x()},[]);const x=async()=>{try{n(!0);const k=await ue.getSessionStatus();t(k)}catch{Y.error("Failed to load session status")}finally{n(!1)}},w=async()=>{var k,E;c(!0);try{const P=await ue.installSessionAll();P.success?(Y.success("Session persistence installed!"),x()):Y.error(((k=P.hooks)==null?void 0:k.error)||((E=P.command)==null?void 0:E.error)||"Installation failed")}catch{Y.error("Installation failed")}finally{c(!1)}},j=async()=>{c(!0);try{const k=await ue.installSessionHooks();k.success?(Y.success("Session hooks installed!"),x()):Y.error(k.error||"Failed to install hooks")}catch{Y.error("Failed to install hooks")}finally{c(!1)}},C=async()=>{c(!0);try{const k=await ue.installFlushCommand();k.success?(Y.success(k.alreadyInstalled?"/flush command already installed":"/flush command installed!"),x()):Y.error(k.error||"Failed to install command")}catch{Y.error("Failed to install command")}finally{c(!1)}},v=async()=>{l(!0);try{const k=await ue.clearSessionContext();k.success?(Y.success(k.cleared?"Session context cleared":"No context to clear"),x()):Y.error("Failed to clear context")}catch{Y.error("Failed to clear context")}finally{l(!1)}},y=async()=>{try{const k=await ue.getSessionContext();h(k.content),f(!0)}catch{Y.error("Failed to load context")}},g=k=>k===null?"Unknown":k<60?`${k} minutes ago`:k<1440?`${Math.floor(k/60)} hours ago`:`${Math.floor(k/1440)} days ago`;if(s)return r.jsx("div",{className:"flex items-center justify-center h-64",children:r.jsx(Ze,{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(Vs,{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(re,{variant:"ghost",size:"sm",onClick:x,children:r.jsx(Tr,{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($t,{className:"w-5 h-5 text-green-500"}):r.jsx($s,{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(et,{variant:e!=null&&e.hooksInstalled?"default":"secondary",children:e!=null&&e.hooksInstalled?"Installed":"Not Installed"}),!(e!=null&&e.hooksInstalled)&&r.jsx(re,{variant:"outline",size:"sm",onClick:j,disabled:o,children:o?r.jsx(Ze,{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($t,{className:"w-5 h-5 text-green-500"}):r.jsx($s,{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(et,{variant:e!=null&&e.flushCommandInstalled?"default":"secondary",children:e!=null&&e.flushCommandInstalled?"Installed":"Not Installed"}),!(e!=null&&e.flushCommandInstalled)&&r.jsx(re,{variant:"outline",size:"sm",onClick:C,disabled:o,children:o?r.jsx(Ze,{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($t,{className:"w-5 h-5 text-green-500"}):r.jsx($s,{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(et,{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(re,{onClick:w,disabled:o,className:"w-full bg-indigo-600 hover:bg-indigo-700 text-white",children:[o?r.jsx(Ze,{className:"w-4 h-4 mr-2 animate-spin"}):r.jsx(ui,{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(re,{variant:"outline",size:"sm",onClick:y,children:[r.jsx(Br,{className:"w-4 h-4 mr-2"}),"View"]}),r.jsx(re,{variant:"outline",size:"sm",onClick:v,disabled:u,className:"text-red-600 hover:text-red-700 hover:bg-red-50 dark:hover:bg-red-950",children:u?r.jsx(Ze,{className:"w-4 h-4 animate-spin"}):r.jsx(js,{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(ec,{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(Vs,{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(et,{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:d,onOpenChange:f,children:r.jsxs(xt,{className:"max-w-2xl max-h-[80vh] overflow-hidden flex flex-col",children:[r.jsxs(vt,{children:[r.jsx(yt,{children:"Saved Context"}),r.jsx(ur,{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(kt,{children:r.jsx(re,{variant:"ghost",onClick:()=>f(!1),children:"Close"})})]})})]})}const BW=[{id:"projects",label:"All Projects",icon:Rn,section:"Projects"},{id:"explorer",label:"Project Explorer",icon:Wi,section:"Projects"},{id:"workstreams",label:"Workstreams",icon:lS,section:"Projects"},{id:"registry",label:"MCP Registry",icon:Bn,section:"Tools"},{id:"plugins",label:"Plugins",icon:Po,section:"Tools"},{id:"memory",label:"Memory",icon:jo,section:"Tools"},{id:"claude-settings",label:"Claude Code",icon:Vn,section:"Configuration",tool:"claude"},{id:"gemini-settings",label:"Gemini CLI",icon:qt,section:"Configuration",tool:"gemini"},{id:"codex-settings",label:"Codex CLI",icon:qt,section:"Configuration",isNew:!0,tool:"codex"},{id:"antigravity-settings",label:"Antigravity",icon:Sc,section:"Configuration",tool:"antigravity"},{id:"create-mcp",label:"Create MCP",icon:os,section:"Developer"},{id:"loops",label:"Ralph Loops",icon:cc,section:"Developer",isNew:!0},{id:"sessions",label:"Sessions",icon:Vs,section:"System"},{id:"preferences",label:"Preferences",icon:cS,section:"System"},{id:"tutorial",label:"Tutorial",icon:Cu,section:"Help"},{id:"docs",label:"Docs & Help",icon:ko,section:"Help"}],b_=(e,t)=>{try{const s=localStorage.getItem(`claude-config-${e}`);return s?JSON.parse(s):t}catch{return t}},$W=(e,t)=>{try{localStorage.setItem(`claude-config-${e}`,JSON.stringify(t))}catch{}};function zW(){const{projects:e,activeProject:t,fetch:s,setActive:n}=Ex(),{appConfig:o,version:c,fetch:u,checkVersion:l}=Nw(),[d,f]=_.useState(()=>b_("currentView","explorer")),[m,h]=_.useState(!0),[x,w]=_.useState({dir:"",subprojects:[],hierarchy:[]}),[j,C]=_.useState([]),[v,y]=_.useState({mcpServers:{}}),[g,b]=_.useState([]),[k,E]=_.useState([]),[P,T]=_.useState(null),[N,M]=_.useState(null),[I,L]=_.useState(!1),[B,H]=_.useState({title:"",type:""}),[q,z]=_.useState(""),[G,J]=_.useState(""),[K,F]=_.useState({}),[R,O]=_.useState(null),[V,$]=_.useState(!1),[se,de]=_.useState(!1),[pe,X]=_.useState(null),[W,ce]=_.useState(!1),ie=_.useRef(null);_.useEffect(()=>{$W("currentView",d)},[d]);const Q=_.useCallback(async()=>{try{const[Ee,_e,oe,ve,De]=await Promise.all([ue.getProject(),ue.getConfigs(),ue.getRegistry(),ue.getRules(),ue.getCommands()]);w(Ee),C(_e),y(oe),b(ve),E(De),_e.length>0&&!P&&T(_e[_e.length-1])}catch(Ee){Y.error("Failed to load data: "+Ee.message)}finally{h(!1)}},[P]),le=_.useCallback(async(Ee=!1)=>{try{const _e=await s(),oe=_e==null?void 0:_e.find(ve=>ve.isActive);if(Ee&&oe){const ve=await ue.getSubprojects(oe.path);X({dir:oe.path,subprojects:ve.subprojects||[]})}Ee&&!oe&&(b_("currentView",null)||f("projects"))}catch{console.log("Projects API not available")}},[s]),we=async Ee=>{try{const _e=await n(Ee);_e.success?(w({dir:_e.dir,hierarchy:_e.hierarchy,subprojects:_e.subprojects}),X({dir:_e.dir,subprojects:_e.subprojects}),await Q(),Y.success(`Switched to ${_e.project.name}`)):Y.error(_e.error||"Failed to switch project")}catch(_e){Y.error("Failed to switch project: "+_e.message)}},Le=()=>{s()};_.useEffect(()=>{Q(),le(!0),(async()=>{try{const[_e]=await Promise.all([l(),u()]);!ie.current&&(_e!=null&&_e.installedVersion)&&(ie.current=_e.installedVersion);const oe=Nw.getState().appConfig;if(_e!=null&&_e.updateAvailable&&(_e==null?void 0:_e.updateMethod)==="npm")if(oe!=null&&oe.autoUpdate){Y.info(`Auto-updating to v${_e.latestVersion}...`),$(!0);const ve=await ue.performUpdate({updateMethod:_e.updateMethod,targetVersion:_e.latestVersion});if(ve.success){Y.success(`Updated to v${ve.newVersion}! Restarting server...`);try{await ue.restartServer()}catch{}let De=0;const Be=setInterval(async()=>{De++;try{await ue.checkVersion(),clearInterval(Be),Y.success("Server restarted! Reloading..."),setTimeout(()=>window.location.reload(),500)}catch{De>30&&(clearInterval(Be),Y.info("Server restarting. Please refresh the page."),$(!1))}},500)}else Y.error("Auto-update failed: "+ve.error),$(!1),O(_e)}else O(_e)}catch{}})()},[]),_.useEffect(()=>{const _e=setInterval(async()=>{if(ie.current)try{const oe=await ue.checkVersion();oe!=null&&oe.installedVersion&&oe.installedVersion!==ie.current&&(console.log(`[stale-ui] Server updated to v${oe.installedVersion}, refreshing...`),window.location.reload())}catch{}},3e4);return()=>clearInterval(_e)},[]);const Ke=(Ee,_e)=>{if(!Ee||!_e)return!1;const oe=Be=>Be.split(".").map(ze=>parseInt(ze,10)||0),ve=oe(Ee),De=oe(_e);for(let Be=0;Be<Math.max(ve.length,De.length);Be++){if((ve[Be]||0)>(De[Be]||0))return!0;if((ve[Be]||0)<(De[Be]||0))return!1}return!1},fe=async(Ee,_e="npm")=>{$(!0);const oe=await ue.performUpdate({updateMethod:_e,targetVersion:Ee});if(oe.success){Y.success(`Updated to v${oe.newVersion}! Restarting server...`),O(null);try{await ue.restartServer()}catch{}let ve=0;const De=setInterval(async()=>{ve++;try{await ue.checkVersion(),clearInterval(De),Y.success("Server restarted! Reloading..."),setTimeout(()=>window.location.reload(),500)}catch{ve>30&&(clearInterval(De),Y.info("Server restarting. Please refresh the page."),$(!1))}},500);return!0}else return Y.error("Update failed: "+oe.error),$(!1),!1},ye=async()=>{ce(!0);try{const Ee=await ue.checkVersion(),_e=Ee==null?void 0:Ee.installedVersion,oe=Ee==null?void 0:Ee.latestVersion;if(_e&&ie.current&&_e!==ie.current){Y.info(`Refreshing to v${_e}...`),setTimeout(()=>window.location.reload(),500);return}Ke(oe,_e)&&(o!=null&&o.autoUpdate?(ce(!1),Y.info(`Auto-updating to v${oe}...`),await fe(oe,(Ee==null?void 0:Ee.updateMethod)||"npm")):(O({...Ee,updateAvailable:!0}),Y.info(`Update available: v${oe}`)))}catch{Y.error("Failed to check for updates")}finally{ce(!1)}},Je=async()=>{if(R!=null&&R.updateAvailable){$(!0);try{const Ee=await ue.performUpdate({updateMethod:R.updateMethod,sourcePath:R.sourcePath,targetVersion:R.latestVersion});if(Ee.success){Y.success(`Updated to v${Ee.newVersion}! Restarting server...`),O(null),setVersion(Ee.newVersion);try{await ue.restartServer()}catch{}let _e=0;const oe=setInterval(async()=>{_e++;try{await ue.checkVersion(),clearInterval(oe),Y.success("Server restarted! Reloading..."),setTimeout(()=>window.location.reload(),500)}catch{_e>30&&(clearInterval(oe),Y.info("Server restarting. Please refresh the page."),$(!1))}},500)}else Y.error("Update failed: "+Ee.error),$(!1)}catch(Ee){Y.error("Update failed: "+Ee.message),$(!1)}}};_.useEffect(()=>{const Ee=async()=>{try{const{hashes:oe}=await ue.getFileHashes(),ve=K,De=Object.keys(oe).some(ze=>ve[ze]!==oe[ze])||Object.keys(ve).some(ze=>!oe[ze]),Be=ve.__subprojects__!==oe.__subprojects__;if(De&&Object.keys(ve).length>0&&(Y.info("Files changed externally, reloading..."),await Q(),Be&&pe))try{const ze=await ue.getSubprojects(pe.dir);X(St=>({...St,subprojects:ze.subprojects||[]}))}catch{}F(oe)}catch{}},_e=setInterval(Ee,2e3);return Ee(),()=>clearInterval(_e)},[K,Q,pe]);const Ye=new Set;j.forEach(Ee=>{var _e,oe;(((_e=Ee.config)==null?void 0:_e.include)||[]).forEach(ve=>Ye.add(ve)),Object.keys(((oe=Ee.config)==null?void 0:oe.mcpServers)||{}).forEach(ve=>Ye.add(ve))});const ot={mcps:Ye.size,rules:g.length,commands:k.length},ke=async()=>{try{const Ee=await ue.applyConfig(x.dir);if(Ee.tools){const _e=Object.entries(Ee.tools).filter(([,oe])=>oe).map(([oe])=>oe==="claude"?"Claude Code":"Antigravity");_e.length>0?Y.success(`Config applied to: ${_e.join(", ")}`):Y.warning("No tools were updated")}else Y.success("Configuration applied successfully!")}catch(Ee){Y.error("Failed to apply config: "+Ee.message)}},be=async()=>{h(!0),await Q(),Y.success("Data refreshed")};if(m)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(Ze,{className:"w-8 h-8 animate-spin text-primary"}),r.jsx("p",{className:"text-muted-foreground",children:"Loading configuration..."})]})});const Oe=()=>{switch(d){case"explorer":return r.jsx(y8,{project:x,onRefresh:Q});case"registry":return r.jsx(FH,{registry:v,searchQuery:q,setSearchQuery:z,onUpdate:Q});case"plugins":return r.jsx(hW,{});case"memory":return r.jsx(BH,{project:x,onUpdate:Q});case"create-mcp":return r.jsx(pH,{project:x});case"claude-settings":return r.jsx(eH,{});case"gemini-settings":return r.jsx(tH,{});case"codex-settings":return r.jsx(fH,{});case"antigravity-settings":return r.jsx(oH,{});case"sessions":return r.jsx(FW,{});case"preferences":return r.jsx(Zz,{onConfigChange:()=>u()});case"projects":return r.jsx(VH,{onProjectSwitch:Ee=>{w({dir:Ee.dir,hierarchy:Ee.hierarchy,subprojects:Ee.subprojects}),X({dir:Ee.dir,subprojects:Ee.subprojects}),Q(),le()}});case"workstreams":return r.jsx(fW,{onWorkstreamChange:Ee=>{Y.success(`Switched to workstream: ${Ee.name}`)}});case"loops":return r.jsx(mW,{activeProject:t});case"docs":return r.jsx(dW,{});case"tutorial":return r.jsx(OW,{});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"})]})}),R&&r.jsxs("button",{onClick:Je,disabled:V,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:[V?r.jsx(Ze,{className:"w-3 h-3 animate-spin"}):r.jsx(ui,{className:"w-3 h-3"}),V?"Updating...":`Update to v${R.latestVersion}`]})]}),r.jsx(xN,{orientation:"vertical",className:"h-6"}),r.jsx(b8,{projects:e,activeProject:t,onSwitch:we,onAddClick:()=>de(!0),onManageClick:()=>f("projects")})]}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx(S8,{}),r.jsx(re,{variant:"ghost",size:"sm",onClick:be,children:r.jsx(Tr,{className:"w-4 h-4"})}),r.jsxs(re,{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(Sc,{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(nn,{className:"flex-1 py-4",children:["Projects","Tools","Configuration","Developer","System","Help"].map(Ee=>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:Ee}),r.jsx("div",{className:"space-y-0.5",children:BW.filter(_e=>_e.section===Ee).filter(_e=>{var oe;return _e.id!=="loops"||((oe=o==null?void 0:o.experimental)==null?void 0:oe.ralphLoops)}).filter(_e=>!_e.tool||((o==null?void 0:o.enabledTools)||["claude"]).includes(_e.tool)).map(_e=>{const oe=_e.icon,ve=d===_e.id;return r.jsxs("button",{onClick:()=>f(_e.id),className:`w-full flex items-center gap-3 px-4 py-2.5 text-sm transition-all duration-200 border-l-2 ${ve?"bg-accent border-primary text-primary font-medium":"border-transparent text-muted-foreground hover:text-foreground hover:bg-accent"}`,children:[r.jsx(oe,{className:"w-4 h-4"}),r.jsx("span",{className:"flex-1 text-left",children:_e.label}),_e.badge&&r.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full font-medium ${ve?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground"}`,children:ot[_e.badge]}),_e.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"})]},_e.id)})})]},Ee))}),r.jsx("div",{className:"px-4 py-3 border-t border-border",children:r.jsxs("button",{onClick:ye,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(Ze,{className:"w-3 h-3 animate-spin"}):null,c?`v${c}`:""]})})]}),r.jsx("main",{style:["explorer","docs","tutorial"].includes(d)?{}:{zoom:.9},className:Ne("flex-1 overflow-auto",["explorer","docs","tutorial"].includes(d)?"h-[calc(100vh-64px)]":"p-6"),children:r.jsx(k_,{mode:"wait",children:r.jsx(Pa.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},className:["explorer","docs","tutorial"].includes(d)?"h-full":"",children:Oe()},d)})})]}),r.jsx(fN,{open:se,onOpenChange:de,onAdded:Le}),r.jsx(w8,{onStartTutorial:()=>f("tutorial")})]})}function HW(){const[e,t]=_.useState(!1),[s,n]=_.useState(!1),[o,c]=_.useState(!1),u=_.useCallback(async()=>{n(!0);try{await ue.restartServer(),Y.info("Server restarting... page will reload."),setTimeout(()=>{window.location.reload()},2e3)}catch(d){Y.error("Failed to restart: "+d.message),n(!1)}},[]),l=_.useCallback(()=>{c(!0),t(!1),Y.dismiss("update-available")},[]);return _.useEffect(()=>{let d;const f=async()=>{try{const m=await ue.getVersion();console.log("[Update Check]",m),m.needsRestart&&!o&&t(!0)}catch{}};return f(),d=setInterval(f,3e4),()=>clearInterval(d)},[o]),r.jsx(_8,{children:r.jsxs("div",{className:"min-h-screen bg-background",children:[e&&!s&&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(Tr,{className:"w-4 h-4"}),r.jsx("span",{className:"text-sm font-medium",children:"Update available — click to restart"}),r.jsx("button",{onClick:d=>{d.stopPropagation(),l()},className:"absolute right-3 p-1 hover:bg-blue-500 rounded",children:r.jsx(oi,{className:"w-4 h-4"})})]}),s&&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(Tr,{className:"w-4 h-4 animate-spin"}),r.jsx("span",{className:"text-sm font-medium",children:"Restarting server..."})]}),r.jsx(zW,{}),r.jsx(DP,{position:"bottom-right",richColors:!0})]})})}aP.createRoot(document.getElementById("root")).render(r.jsx(HW,{}));
|
|
3757
|
+
`}},LW={...kW,...jW,...NW,...EW,...PW,...AW,...TW,...RW,...MW,...DW,...IW},ou={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"}},y_="claude-config-tutorial-visited";function OW(){const[e,t]=_.useState("intro"),[s,n]=_.useState({welcome:!0}),[o,c]=_.useState(()=>{try{return JSON.parse(localStorage.getItem(y_)||"[]")}catch{return[]}}),u=_.useRef(null);_.useEffect(()=>{if(u.current){const b=u.current.querySelector("[data-radix-scroll-area-viewport]");b&&(b.scrollTop=0)}},[e]),_.useEffect(()=>{if(e&&!o.includes(e)){const b=[...o,e];c(b),localStorage.setItem(y_,JSON.stringify(b))}},[e,o]);const l=b=>{n(k=>({...k,[b]:!k[b]}))},d=LW[e],f=Vl.flatMap(b=>b.subsections.length>0?b.subsections.map(k=>k.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),C=(()=>{for(const b of Vl)if(b.id===e||b.subsections.some(k=>k.id===e))return b;return Vl[0]})(),v=ou[C.id]||ou.welcome,y=b=>{for(const k of Vl){if(k.id===b)return k.title;const E=k.subsections.find(P=>P.id===b);if(E)return E.title}return""},g=b=>({__html:x2(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(Cu,{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(nn,{className:"flex-1",children:r.jsx("div",{className:"p-2",children:Vl.map((b,k)=>{const E=b.icon,P=ou[b.id]||ou.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:Ne("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),s[b.id]||t(b.subsections[0].id)):t(b.id)},children:[r.jsx("span",{className:Ne("w-7 h-7 rounded-lg flex items-center justify-center transition-colors",T?P.bg+" text-white":P.light),children:N?r.jsx(No,{className:"w-4 h-4"}):r.jsx(E,{className:Ne("w-4 h-4",!T&&P.text)})}),r.jsx("span",{className:Ne("flex-1",T&&"font-medium"),children:b.title}),b.subsections.length>0&&r.jsx(us,{className:Ne("w-4 h-4 text-muted-foreground transition-transform",s[b.id]&&"rotate-90")})]}),b.subsections.length>0&&s[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,L=o.includes(M.id);return r.jsxs("button",{className:Ne("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:[L&&!I&&r.jsx(No,{className:"w-3 h-3 text-green-500"}),r.jsx("span",{className:Ne(!L&&!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:Ne("px-8 py-4 border-b border-border",v.light),children:r.jsxs("div",{className:"max-w-3xl mx-auto flex items-center gap-3",children:[r.jsx("div",{className:Ne("w-10 h-10 rounded-xl flex items-center justify-center",v.bg,"text-white"),children:r.jsx(C.icon,{className:"w-5 h-5"})}),r.jsxs("div",{children:[r.jsx("p",{className:Ne("text-sm font-medium",v.text),children:C.title}),r.jsx("h1",{className:"text-lg font-semibold text-foreground",children:(d==null?void 0:d.title)||y(e)})]})]})}),r.jsx(nn,{className:"flex-1",ref:u,children:r.jsx("div",{className:"max-w-3xl mx-auto p-8",children:d?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(d.content)}):r.jsxs("div",{className:"text-center text-muted-foreground py-12",children:[r.jsx(Cu,{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(re,{variant:"ghost",onClick:()=>t(h),className:"flex items-center gap-2",children:[r.jsx(S5,{className:"w-4 h-4"}),r.jsx("span",{className:"max-w-[150px] truncate",children:y(h)})]}):r.jsx("div",{}),r.jsxs("span",{className:"text-xs text-muted-foreground",children:[m+1," of ",f.length]}),x?r.jsxs(re,{onClick:()=>t(x),className:Ne("flex items-center gap-2",v.bg,"hover:opacity-90"),children:[r.jsx("span",{className:"max-w-[150px] truncate",children:y(x)}),r.jsx(Pg,{className:"w-4 h-4"})]}):r.jsx(re,{variant:"outline",onClick:()=>t("intro"),className:"flex items-center gap-2",children:"Start Over"})]})})]})]})}function FW(){const[e,t]=_.useState(null),[s,n]=_.useState(!0),[o,c]=_.useState(!1),[u,l]=_.useState(!1),[d,f]=_.useState(!1),[m,h]=_.useState(null);_.useEffect(()=>{x()},[]);const x=async()=>{try{n(!0);const k=await ue.getSessionStatus();t(k)}catch{Y.error("Failed to load session status")}finally{n(!1)}},w=async()=>{var k,E;c(!0);try{const P=await ue.installSessionAll();P.success?(Y.success("Session persistence installed!"),x()):Y.error(((k=P.hooks)==null?void 0:k.error)||((E=P.command)==null?void 0:E.error)||"Installation failed")}catch{Y.error("Installation failed")}finally{c(!1)}},j=async()=>{c(!0);try{const k=await ue.installSessionHooks();k.success?(Y.success("Session hooks installed!"),x()):Y.error(k.error||"Failed to install hooks")}catch{Y.error("Failed to install hooks")}finally{c(!1)}},C=async()=>{c(!0);try{const k=await ue.installFlushCommand();k.success?(Y.success(k.alreadyInstalled?"/flush command already installed":"/flush command installed!"),x()):Y.error(k.error||"Failed to install command")}catch{Y.error("Failed to install command")}finally{c(!1)}},v=async()=>{l(!0);try{const k=await ue.clearSessionContext();k.success?(Y.success(k.cleared?"Session context cleared":"No context to clear"),x()):Y.error("Failed to clear context")}catch{Y.error("Failed to clear context")}finally{l(!1)}},y=async()=>{try{const k=await ue.getSessionContext();h(k.content),f(!0)}catch{Y.error("Failed to load context")}},g=k=>k===null?"Unknown":k<60?`${k} minutes ago`:k<1440?`${Math.floor(k/60)} hours ago`:`${Math.floor(k/1440)} days ago`;if(s)return r.jsx("div",{className:"flex items-center justify-center h-64",children:r.jsx(Ze,{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(Vs,{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(re,{variant:"ghost",size:"sm",onClick:x,children:r.jsx(Tr,{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($t,{className:"w-5 h-5 text-green-500"}):r.jsx($s,{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(et,{variant:e!=null&&e.hooksInstalled?"default":"secondary",children:e!=null&&e.hooksInstalled?"Installed":"Not Installed"}),!(e!=null&&e.hooksInstalled)&&r.jsx(re,{variant:"outline",size:"sm",onClick:j,disabled:o,children:o?r.jsx(Ze,{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($t,{className:"w-5 h-5 text-green-500"}):r.jsx($s,{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(et,{variant:e!=null&&e.flushCommandInstalled?"default":"secondary",children:e!=null&&e.flushCommandInstalled?"Installed":"Not Installed"}),!(e!=null&&e.flushCommandInstalled)&&r.jsx(re,{variant:"outline",size:"sm",onClick:C,disabled:o,children:o?r.jsx(Ze,{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($t,{className:"w-5 h-5 text-green-500"}):r.jsx($s,{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(et,{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(re,{onClick:w,disabled:o,className:"w-full bg-indigo-600 hover:bg-indigo-700 text-white",children:[o?r.jsx(Ze,{className:"w-4 h-4 mr-2 animate-spin"}):r.jsx(ui,{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(re,{variant:"outline",size:"sm",onClick:y,children:[r.jsx(Br,{className:"w-4 h-4 mr-2"}),"View"]}),r.jsx(re,{variant:"outline",size:"sm",onClick:v,disabled:u,className:"text-red-600 hover:text-red-700 hover:bg-red-50 dark:hover:bg-red-950",children:u?r.jsx(Ze,{className:"w-4 h-4 animate-spin"}):r.jsx(js,{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(ec,{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(Vs,{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(et,{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:d,onOpenChange:f,children:r.jsxs(xt,{className:"max-w-2xl max-h-[80vh] overflow-hidden flex flex-col",children:[r.jsxs(vt,{children:[r.jsx(yt,{children:"Saved Context"}),r.jsx(ur,{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(kt,{children:r.jsx(re,{variant:"ghost",onClick:()=>f(!1),children:"Close"})})]})})]})}const BW=[{id:"projects",label:"All Projects",icon:Rn,section:"Projects"},{id:"explorer",label:"Project Explorer",icon:Wi,section:"Projects"},{id:"workstreams",label:"Workstreams",icon:lS,section:"Projects"},{id:"registry",label:"MCP Registry",icon:Bn,section:"Tools"},{id:"plugins",label:"Plugins",icon:Po,section:"Tools"},{id:"memory",label:"Memory",icon:jo,section:"Tools"},{id:"claude-settings",label:"Claude Code",icon:Vn,section:"Configuration",tool:"claude"},{id:"gemini-settings",label:"Gemini CLI",icon:qt,section:"Configuration",tool:"gemini"},{id:"codex-settings",label:"Codex CLI",icon:qt,section:"Configuration",isNew:!0,tool:"codex"},{id:"antigravity-settings",label:"Antigravity",icon:Sc,section:"Configuration",tool:"antigravity"},{id:"create-mcp",label:"Create MCP",icon:os,section:"Developer"},{id:"loops",label:"Ralph Loops",icon:cc,section:"Developer",isNew:!0},{id:"sessions",label:"Sessions",icon:Vs,section:"System"},{id:"preferences",label:"Preferences",icon:cS,section:"System"},{id:"tutorial",label:"Tutorial",icon:Cu,section:"Help"},{id:"docs",label:"Docs & Help",icon:ko,section:"Help"}],b_=(e,t)=>{try{const s=localStorage.getItem(`claude-config-${e}`);return s?JSON.parse(s):t}catch{return t}},$W=(e,t)=>{try{localStorage.setItem(`claude-config-${e}`,JSON.stringify(t))}catch{}};function zW(){const{projects:e,activeProject:t,fetch:s,setActive:n}=Ex(),{appConfig:o,version:c,fetch:u,checkVersion:l}=Nw(),[d,f]=_.useState(()=>b_("currentView","explorer")),[m,h]=_.useState(!0),[x,w]=_.useState({dir:"",subprojects:[],hierarchy:[]}),[j,C]=_.useState([]),[v,y]=_.useState({mcpServers:{}}),[g,b]=_.useState([]),[k,E]=_.useState([]),[P,T]=_.useState(null),[N,M]=_.useState(null),[I,L]=_.useState(!1),[B,H]=_.useState({title:"",type:""}),[q,z]=_.useState(""),[G,J]=_.useState(""),[K,F]=_.useState({}),[R,O]=_.useState(null),[V,$]=_.useState(!1),[se,de]=_.useState(!1),[pe,X]=_.useState(null),[W,ce]=_.useState(!1),ie=_.useRef(null);_.useEffect(()=>{$W("currentView",d)},[d]);const Q=_.useCallback(async()=>{try{const[Ee,_e,oe,ve,De]=await Promise.all([ue.getProject(),ue.getConfigs(),ue.getRegistry(),ue.getRules(),ue.getCommands()]);w(Ee),C(_e),y(oe),b(ve),E(De),_e.length>0&&!P&&T(_e[_e.length-1])}catch(Ee){Y.error("Failed to load data: "+Ee.message)}finally{h(!1)}},[P]),le=_.useCallback(async(Ee=!1)=>{try{const _e=await s(),oe=_e==null?void 0:_e.find(ve=>ve.isActive);if(Ee&&oe){const ve=await ue.getSubprojects(oe.path);X({dir:oe.path,subprojects:ve.subprojects||[]})}Ee&&!oe&&(b_("currentView",null)||f("projects"))}catch{console.log("Projects API not available")}},[s]),we=async Ee=>{try{const _e=await n(Ee);_e.success?(w({dir:_e.dir,hierarchy:_e.hierarchy,subprojects:_e.subprojects}),X({dir:_e.dir,subprojects:_e.subprojects}),await Q(),Y.success(`Switched to ${_e.project.name}`)):Y.error(_e.error||"Failed to switch project")}catch(_e){Y.error("Failed to switch project: "+_e.message)}},Le=()=>{s()};_.useEffect(()=>{Q(),le(!0),(async()=>{try{const[_e]=await Promise.all([l(),u()]);!ie.current&&(_e!=null&&_e.installedVersion)&&(ie.current=_e.installedVersion);const oe=Nw.getState().appConfig;if(_e!=null&&_e.updateAvailable&&(_e==null?void 0:_e.updateMethod)==="npm")if(oe!=null&&oe.autoUpdate){Y.info(`Auto-updating to v${_e.latestVersion}...`),$(!0);const ve=await ue.performUpdate({updateMethod:_e.updateMethod,targetVersion:_e.latestVersion});if(ve.success){Y.success(`Updated to v${ve.newVersion}! Restarting server...`);try{await ue.restartServer()}catch{}let De=0;const Be=setInterval(async()=>{De++;try{await ue.checkVersion(),clearInterval(Be),Y.success("Server restarted! Reloading..."),setTimeout(()=>window.location.reload(),500)}catch{De>30&&(clearInterval(Be),Y.info("Server restarting. Please refresh the page."),$(!1))}},500)}else Y.error("Auto-update failed: "+ve.error),$(!1),O(_e)}else O(_e)}catch{}})()},[]),_.useEffect(()=>{const _e=setInterval(async()=>{if(ie.current)try{const oe=await ue.checkVersion();oe!=null&&oe.installedVersion&&oe.installedVersion!==ie.current&&(console.log(`[stale-ui] Server updated to v${oe.installedVersion}, refreshing...`),window.location.reload())}catch{}},3e4);return()=>clearInterval(_e)},[]);const Ke=(Ee,_e)=>{if(!Ee||!_e)return!1;const oe=Be=>Be.split(".").map(ze=>parseInt(ze,10)||0),ve=oe(Ee),De=oe(_e);for(let Be=0;Be<Math.max(ve.length,De.length);Be++){if((ve[Be]||0)>(De[Be]||0))return!0;if((ve[Be]||0)<(De[Be]||0))return!1}return!1},fe=async(Ee,_e="npm")=>{$(!0);const oe=await ue.performUpdate({updateMethod:_e,targetVersion:Ee});if(oe.success){Y.success(`Updated to v${oe.newVersion}! Restarting server...`),O(null);try{await ue.restartServer()}catch{}let ve=0;const De=setInterval(async()=>{ve++;try{await ue.checkVersion(),clearInterval(De),Y.success("Server restarted! Reloading..."),setTimeout(()=>window.location.reload(),500)}catch{ve>30&&(clearInterval(De),Y.info("Server restarting. Please refresh the page."),$(!1))}},500);return!0}else return Y.error("Update failed: "+oe.error),$(!1),!1},ye=async()=>{ce(!0);try{const Ee=await ue.checkVersion(),_e=Ee==null?void 0:Ee.installedVersion,oe=Ee==null?void 0:Ee.latestVersion;if(_e&&ie.current&&_e!==ie.current){Y.info(`Refreshing to v${_e}...`),setTimeout(()=>window.location.reload(),500);return}Ke(oe,_e)&&(o!=null&&o.autoUpdate?(ce(!1),Y.info(`Auto-updating to v${oe}...`),await fe(oe,(Ee==null?void 0:Ee.updateMethod)||"npm")):(O({...Ee,updateAvailable:!0}),Y.info(`Update available: v${oe}`)))}catch{Y.error("Failed to check for updates")}finally{ce(!1)}},Je=async()=>{if(R!=null&&R.updateAvailable){$(!0);try{const Ee=await ue.performUpdate({updateMethod:R.updateMethod,sourcePath:R.sourcePath,targetVersion:R.latestVersion});if(Ee.success){Y.success(`Updated to v${Ee.newVersion}! Restarting server...`),O(null),setVersion(Ee.newVersion);try{await ue.restartServer()}catch{}let _e=0;const oe=setInterval(async()=>{_e++;try{await ue.checkVersion(),clearInterval(oe),Y.success("Server restarted! Reloading..."),setTimeout(()=>window.location.reload(),500)}catch{_e>30&&(clearInterval(oe),Y.info("Server restarting. Please refresh the page."),$(!1))}},500)}else Y.error("Update failed: "+Ee.error),$(!1)}catch(Ee){Y.error("Update failed: "+Ee.message),$(!1)}}};_.useEffect(()=>{const Ee=async()=>{try{const{hashes:oe}=await ue.getFileHashes(),ve=K,De=Object.keys(oe).some(ze=>ve[ze]!==oe[ze])||Object.keys(ve).some(ze=>!oe[ze]),Be=ve.__subprojects__!==oe.__subprojects__;if(De&&Object.keys(ve).length>0&&(Y.info("Files changed externally, reloading..."),await Q(),Be&&pe))try{const ze=await ue.getSubprojects(pe.dir);X(St=>({...St,subprojects:ze.subprojects||[]}))}catch{}F(oe)}catch{}},_e=setInterval(Ee,2e3);return Ee(),()=>clearInterval(_e)},[K,Q,pe]);const Ye=new Set;j.forEach(Ee=>{var _e,oe;(((_e=Ee.config)==null?void 0:_e.include)||[]).forEach(ve=>Ye.add(ve)),Object.keys(((oe=Ee.config)==null?void 0:oe.mcpServers)||{}).forEach(ve=>Ye.add(ve))});const ot={mcps:Ye.size,rules:g.length,commands:k.length},ke=async()=>{try{const Ee=await ue.applyConfig(x.dir);if(Ee.tools){const _e=Object.entries(Ee.tools).filter(([,oe])=>oe).map(([oe])=>oe==="claude"?"Claude Code":"Antigravity");_e.length>0?Y.success(`Config applied to: ${_e.join(", ")}`):Y.warning("No tools were updated")}else Y.success("Configuration applied successfully!")}catch(Ee){Y.error("Failed to apply config: "+Ee.message)}},be=async()=>{h(!0),await Q(),Y.success("Data refreshed")};if(m)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(Ze,{className:"w-8 h-8 animate-spin text-primary"}),r.jsx("p",{className:"text-muted-foreground",children:"Loading configuration..."})]})});const Oe=()=>{switch(d){case"explorer":return r.jsx(y8,{project:x,onRefresh:Q});case"registry":return r.jsx(FH,{registry:v,searchQuery:q,setSearchQuery:z,onUpdate:Q});case"plugins":return r.jsx(hW,{});case"memory":return r.jsx(BH,{project:x,onUpdate:Q});case"create-mcp":return r.jsx(pH,{project:x});case"claude-settings":return r.jsx(eH,{});case"gemini-settings":return r.jsx(tH,{});case"codex-settings":return r.jsx(fH,{});case"antigravity-settings":return r.jsx(oH,{});case"sessions":return r.jsx(FW,{});case"preferences":return r.jsx(Zz,{onConfigChange:()=>u()});case"projects":return r.jsx(VH,{onProjectSwitch:Ee=>{w({dir:Ee.dir,hierarchy:Ee.hierarchy,subprojects:Ee.subprojects}),X({dir:Ee.dir,subprojects:Ee.subprojects}),Q(),le()}});case"workstreams":return r.jsx(fW,{onWorkstreamChange:Ee=>{Y.success(`Switched to workstream: ${Ee.name}`)}});case"loops":return r.jsx(mW,{activeProject:t});case"docs":return r.jsx(dW,{});case"tutorial":return r.jsx(OW,{});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"})]})}),R&&r.jsxs("button",{onClick:Je,disabled:V,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:[V?r.jsx(Ze,{className:"w-3 h-3 animate-spin"}):r.jsx(ui,{className:"w-3 h-3"}),V?"Updating...":`Update to v${R.latestVersion}`]})]}),r.jsx(xN,{orientation:"vertical",className:"h-6"}),r.jsx(b8,{projects:e,activeProject:t,onSwitch:we,onAddClick:()=>de(!0),onManageClick:()=>f("projects")})]}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx(S8,{}),r.jsx(re,{variant:"ghost",size:"sm",onClick:be,children:r.jsx(Tr,{className:"w-4 h-4"})}),r.jsxs(re,{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(Sc,{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(nn,{className:"flex-1 py-4",children:["Projects","Tools","Configuration","Developer","System","Help"].map(Ee=>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:Ee}),r.jsx("div",{className:"space-y-0.5",children:BW.filter(_e=>_e.section===Ee).filter(_e=>{var oe;return _e.id!=="loops"||((oe=o==null?void 0:o.experimental)==null?void 0:oe.ralphLoops)}).filter(_e=>!_e.tool||((o==null?void 0:o.enabledTools)||["claude"]).includes(_e.tool)).map(_e=>{const oe=_e.icon,ve=d===_e.id;return r.jsxs("button",{onClick:()=>f(_e.id),className:`w-full flex items-center gap-3 px-4 py-2.5 text-sm transition-all duration-200 border-l-2 ${ve?"bg-accent border-primary text-primary font-medium":"border-transparent text-muted-foreground hover:text-foreground hover:bg-accent"}`,children:[r.jsx(oe,{className:"w-4 h-4"}),r.jsx("span",{className:"flex-1 text-left",children:_e.label}),_e.badge&&r.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full font-medium ${ve?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground"}`,children:ot[_e.badge]}),_e.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"})]},_e.id)})})]},Ee))}),r.jsx("div",{className:"px-4 py-3 border-t border-border",children:r.jsxs("button",{onClick:ye,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(Ze,{className:"w-3 h-3 animate-spin"}):null,c?`v${c}`:""]})})]}),r.jsx("main",{style:["explorer","docs","tutorial"].includes(d)?{}:{zoom:.9},className:Ne("flex-1 overflow-auto",["explorer","docs","tutorial"].includes(d)?"h-[calc(100vh-64px)]":"p-6"),children:r.jsx(k_,{mode:"wait",children:r.jsx(Pa.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},className:["explorer","docs","tutorial"].includes(d)?"h-full":"",children:Oe()},d)})})]}),r.jsx(fN,{open:se,onOpenChange:de,onAdded:Le}),r.jsx(w8,{onStartTutorial:()=>f("tutorial")})]})}function HW(){const[e,t]=_.useState(!1),[s,n]=_.useState(!1),[o,c]=_.useState(!1),u=_.useCallback(async()=>{n(!0);try{await ue.restartServer(),Y.info("Server restarting... page will reload."),setTimeout(()=>{window.location.reload()},2e3)}catch(d){Y.error("Failed to restart: "+d.message),n(!1)}},[]),l=_.useCallback(()=>{c(!0),t(!1),Y.dismiss("update-available")},[]);return _.useEffect(()=>{let d;const f=async()=>{try{const m=await ue.getVersion();console.log("[Update Check]",m),m.needsRestart&&!o&&t(!0)}catch{}};return f(),d=setInterval(f,3e4),()=>clearInterval(d)},[o]),r.jsx(_8,{children:r.jsxs("div",{className:"min-h-screen bg-background",children:[e&&!s&&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(Tr,{className:"w-4 h-4"}),r.jsx("span",{className:"text-sm font-medium",children:"Update available — click to restart"}),r.jsx("button",{onClick:d=>{d.stopPropagation(),l()},className:"absolute right-3 p-1 hover:bg-blue-500 rounded",children:r.jsx(oi,{className:"w-4 h-4"})})]}),s&&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(Tr,{className:"w-4 h-4 animate-spin"}),r.jsx("span",{className:"text-sm font-medium",children:"Restarting server..."})]}),r.jsx(zW,{}),r.jsx(DP,{position:"bottom-right",richColors:!0})]})})}aP.createRoot(document.getElementById("root")).render(r.jsx(HW,{}));
|
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-CcFoPsRr.js"></script>
|
|
23
23
|
<link rel="stylesheet" crossorigin href="/assets/index-ChBU02w_.css">
|
|
24
24
|
</head>
|
|
25
25
|
<body>
|