@regression-io/claude-config 0.37.13 → 0.37.15

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
@@ -2,7 +2,7 @@
2
2
  * Constants and tool path configurations
3
3
  */
4
4
 
5
- const VERSION = '0.37.12';
5
+ const VERSION = '0.37.15';
6
6
 
7
7
  // Tool-specific path configurations
8
8
  const TOOL_PATHS = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@regression-io/claude-config",
3
- "version": "0.37.13",
3
+ "version": "0.37.15",
4
4
  "description": "Configuration management UI for Claude Code and Antigravity - manage MCPs, rules, commands, memory, and project folders",
5
5
  "author": "regression.io",
6
6
  "main": "config-loader.js",
@@ -3230,4 +3230,4 @@ claude-config --help # See all commands
3230
3230
  Thanks for using Claude Config. We built this to make working with AI coding tools easier and more powerful.
3231
3231
 
3232
3232
  Happy coding!
3233
- `}},VH={...LH,...IH,...OH,...BH,...FH,...$H,...zH,...HH,...WH,...UH},nu={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"},"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"}},Ow="claude-config-tutorial-visited";function GH(){const[e,t]=C.useState("intro"),[r,s]=C.useState({welcome:!0}),[o,d]=C.useState(()=>{try{return JSON.parse(localStorage.getItem(Ow)||"[]")}catch{return[]}}),u=C.useRef(null);C.useEffect(()=>{if(u.current){const y=u.current.querySelector("[data-radix-scroll-area-viewport]");y&&(y.scrollTop=0)}},[e]),C.useEffect(()=>{if(e&&!o.includes(e)){const y=[...o,e];d(y),localStorage.setItem(Ow,JSON.stringify(y))}},[e,o]);const l=y=>{s(j=>({...j,[y]:!j[y]}))},c=VH[e],f=Ba.flatMap(y=>y.subsections.length>0?y.subsections.map(j=>j.id):[y.id]),m=f.indexOf(e),h=m>0?f[m-1]:null,g=m<f.length-1?f[m+1]:null,w=Math.round(o.length/f.length*100),_=(()=>{for(const y of Ba)if(y.id===e||y.subsections.some(j=>j.id===e))return y;return Ba[0]})(),x=nu[_.id]||nu.welcome,b=y=>{for(const j of Ba){if(j.id===y)return j.title;const E=j.subsections.find(A=>A.id===y);if(E)return E.title}return""},v=y=>({__html:D2(y)});return n.jsxs("div",{className:"flex h-full",children:[n.jsxs("div",{className:"w-72 border-r border-border bg-muted/30 flex flex-col",children:[n.jsxs("div",{className:"p-4 border-b border-border bg-gradient-to-r from-indigo-500/10 to-purple-500/10",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.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:n.jsx(_u,{className:"w-5 h-5 text-white"})}),n.jsxs("div",{children:[n.jsx("h2",{className:"font-semibold text-foreground",children:"Tutorial"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Step-by-step guide"})]})]}),n.jsxs("div",{className:"mt-3",children:[n.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground mb-1",children:[n.jsx("span",{children:"Progress"}),n.jsxs("span",{children:[w,"% complete"]})]}),n.jsx(z2,{value:w,className:"h-2"})]})]}),n.jsx(Ln,{className:"flex-1",children:n.jsx("div",{className:"p-2",children:Ba.map((y,j)=>{const E=y.icon,A=nu[y.id]||nu.welcome,P=e===y.id||y.subsections.some(L=>L.id===e),N=y.subsections.length>0?y.subsections.every(L=>o.includes(L.id)):o.includes(y.id);return n.jsxs("div",{className:"mb-1",children:[n.jsxs("button",{className:Pe("w-full flex items-center gap-2 px-3 py-2.5 text-sm rounded-lg hover:bg-accent text-left transition-all",P&&"bg-accent"),onClick:()=>{y.subsections.length>0?(l(y.id),r[y.id]||t(y.subsections[0].id)):t(y.id)},children:[n.jsx("span",{className:Pe("w-7 h-7 rounded-lg flex items-center justify-center transition-colors",P?A.bg+" text-white":A.light),children:N?n.jsx(wm,{className:"w-4 h-4"}):n.jsx(E,{className:Pe("w-4 h-4",!P&&A.text)})}),n.jsx("span",{className:Pe("flex-1",P&&"font-medium"),children:y.title}),y.subsections.length>0&&n.jsx(tn,{className:Pe("w-4 h-4 text-muted-foreground transition-transform",r[y.id]&&"rotate-90")})]}),y.subsections.length>0&&r[y.id]&&n.jsx("div",{className:"ml-4 mt-1 space-y-0.5 border-l-2 border-border pl-3",children:y.subsections.map(L=>{const B=e===L.id,I=o.includes(L.id);return n.jsxs("button",{className:Pe("w-full text-left px-3 py-1.5 text-sm rounded-md hover:bg-accent text-foreground flex items-center gap-2",B&&"bg-accent font-medium",B&&A.text),onClick:()=>t(L.id),children:[I&&!B&&n.jsx(wm,{className:"w-3 h-3 text-green-500"}),n.jsx("span",{className:Pe(!I&&!B&&"ml-5"),children:L.title})]},L.id)})})]},y.id)})})})]}),n.jsxs("div",{className:"flex-1 overflow-hidden flex flex-col",children:[n.jsx("div",{className:Pe("px-8 py-4 border-b border-border",x.light),children:n.jsxs("div",{className:"max-w-3xl mx-auto flex items-center gap-3",children:[n.jsx("div",{className:Pe("w-10 h-10 rounded-xl flex items-center justify-center",x.bg,"text-white"),children:n.jsx(_.icon,{className:"w-5 h-5"})}),n.jsxs("div",{children:[n.jsx("p",{className:Pe("text-sm font-medium",x.text),children:_.title}),n.jsx("h1",{className:"text-lg font-semibold text-foreground",children:(c==null?void 0:c.title)||b(e)})]})]})}),n.jsx(Ln,{className:"flex-1",ref:u,children:n.jsx("div",{className:"max-w-3xl mx-auto p-8",children:c?n.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:v(c.content)}):n.jsxs("div",{className:"text-center text-muted-foreground py-12",children:[n.jsx(_u,{className:"w-12 h-12 mx-auto mb-4 opacity-50"}),n.jsx("p",{children:"Select a topic from the sidebar"})]})})}),n.jsx("div",{className:"border-t border-border p-4 bg-muted/30",children:n.jsxs("div",{className:"max-w-3xl mx-auto flex items-center justify-between",children:[h?n.jsxs(ce,{variant:"ghost",onClick:()=>t(h),className:"flex items-center gap-2",children:[n.jsx(lM,{className:"w-4 h-4"}),n.jsx("span",{className:"max-w-[150px] truncate",children:b(h)})]}):n.jsx("div",{}),n.jsxs("span",{className:"text-xs text-muted-foreground",children:[m+1," of ",f.length]}),g?n.jsxs(ce,{onClick:()=>t(g),className:Pe("flex items-center gap-2",x.bg,"hover:opacity-90"),children:[n.jsx("span",{className:"max-w-[150px] truncate",children:b(g)}),n.jsx(Ku,{className:"w-4 h-4"})]}):n.jsx(ce,{variant:"outline",onClick:()=>t("intro"),className:"flex items-center gap-2",children:"Start Over"})]})})]})]})}const KH=[{id:"projects",label:"All Projects",icon:ei,section:"Projects"},{id:"explorer",label:"Project Explorer",icon:ii,section:"Projects"},{id:"registry",label:"MCP Registry",icon:es,section:"Tools"},{id:"plugins",label:"Plugins",icon:Bi,section:"Tools"},{id:"memory",label:"Memory",icon:Ii,section:"Tools"},{id:"workstreams",label:"Workstreams",icon:qa,section:"Tools"},{id:"claude-settings",label:"Claude Code",icon:ci,section:"Configuration"},{id:"gemini-settings",label:"Gemini CLI",icon:Xt,section:"Configuration"},{id:"antigravity-settings",label:"Antigravity",icon:bl,section:"Configuration"},{id:"create-mcp",label:"Create MCP",icon:qn,section:"Developer"},{id:"preferences",label:"Preferences",icon:ES,section:"System"},{id:"tutorial",label:"Tutorial",icon:_u,section:"Help",isNew:!0},{id:"docs",label:"Docs & Help",icon:Li,section:"Help"}],Bw=(e,t)=>{try{const r=localStorage.getItem(`claude-config-${e}`);return r?JSON.parse(r):t}catch{return t}},qH=(e,t)=>{try{localStorage.setItem(`claude-config-${e}`,JSON.stringify(t))}catch{}};function YH(){const[e,t]=C.useState(()=>Bw("currentView","explorer")),[r,s]=C.useState(!0),[o,d]=C.useState({dir:"",subprojects:[],hierarchy:[]}),[u,l]=C.useState([]),[c,f]=C.useState({mcpServers:{}}),[m,h]=C.useState([]),[g,w]=C.useState([]),[k,_]=C.useState(null),[x,b]=C.useState(null),[v,y]=C.useState(!1),[j,E]=C.useState({title:"",type:""}),[A,P]=C.useState(""),[N,L]=C.useState(""),[B,I]=C.useState({}),[F,z]=C.useState(null),[K,V]=C.useState(null),[Y,q]=C.useState(!1),[U,D]=C.useState([]),[M,O]=C.useState(null),[G,$]=C.useState(!1),[oe,me]=C.useState(null);C.useEffect(()=>{qH("currentView",e)},[e]);const he=C.useCallback(async()=>{try{const[ee,de,De,ge,ve]=await Promise.all([Se.getProject(),Se.getConfigs(),Se.getRegistry(),Se.getRules(),Se.getCommands()]);d(ee),l(de),f(De),h(ge),w(ve),de.length>0&&!k&&_(de[de.length-1])}catch(ee){Z.error("Failed to load data: "+ee.message)}finally{s(!1)}},[k]),X=C.useCallback(async(ee=!1)=>{var de;try{const De=await Se.getProjects();D(De.projects||[]);const ge=(de=De.projects)==null?void 0:de.find(ve=>ve.isActive);if(O(ge||null),ee&&ge){const ve=await Se.getSubprojects(ge.path);me({dir:ge.path,subprojects:ve.subprojects||[]})}ee&&!ge&&(Bw("currentView",null)||t("projects"))}catch{console.log("Projects API not available")}},[]),H=async ee=>{try{const de=await Se.setActiveProject(ee);de.success?(d({dir:de.dir,hierarchy:de.hierarchy,subprojects:de.subprojects}),me({dir:de.dir,subprojects:de.subprojects}),O(de.project),D(De=>De.map(ge=>({...ge,isActive:ge.id===ee}))),await he(),Z.success(`Switched to ${de.project.name}`)):Z.error(de.error||"Failed to switch project")}catch(de){Z.error("Failed to switch project: "+de.message)}},ae=ee=>{D(de=>[...de,{...ee,exists:!0,hasClaudeConfig:!1}])};C.useEffect(()=>{he(),X(!0),Se.checkVersion().then(ee=>{z(ee==null?void 0:ee.installedVersion),ee!=null&&ee.updateAvailable&&(ee==null?void 0:ee.updateMethod)==="npm"&&V(ee)}).catch(()=>{})},[]);const ne=async()=>{if(K!=null&&K.updateAvailable){q(!0);try{const ee=await Se.performUpdate({updateMethod:K.updateMethod,sourcePath:K.sourcePath});ee.success?(Z.success(`Updated to v${ee.newVersion}! Reloading...`),setTimeout(()=>window.location.reload(),1500)):(Z.error("Update failed: "+ee.error),q(!1))}catch(ee){Z.error("Update failed: "+ee.message),q(!1)}}};C.useEffect(()=>{const ee=async()=>{try{const{hashes:De}=await Se.getFileHashes(),ge=B;(Object.keys(De).some(Le=>ge[Le]!==De[Le])||Object.keys(ge).some(Le=>!De[Le]))&&Object.keys(ge).length>0&&(Z.info("Files changed externally, reloading..."),await he()),I(De)}catch{}},de=setInterval(ee,2e3);return ee(),()=>clearInterval(de)},[B,he]);const J=new Set;u.forEach(ee=>{var de,De;(((de=ee.config)==null?void 0:de.include)||[]).forEach(ge=>J.add(ge)),Object.keys(((De=ee.config)==null?void 0:De.mcpServers)||{}).forEach(ge=>J.add(ge))});const se={mcps:J.size,rules:m.length,commands:g.length},ye=async()=>{try{const ee=await Se.applyConfig(o.dir);if(ee.tools){const de=Object.entries(ee.tools).filter(([,De])=>De).map(([De])=>De==="claude"?"Claude Code":"Antigravity");de.length>0?Z.success(`Config applied to: ${de.join(", ")}`):Z.warning("No tools were updated")}else Z.success("Configuration applied successfully!")}catch(ee){Z.error("Failed to apply config: "+ee.message)}},Oe=async()=>{s(!0),await he(),Z.success("Data refreshed")};if(r)return n.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:n.jsxs("div",{className:"flex flex-col items-center gap-4",children:[n.jsx(ut,{className:"w-8 h-8 animate-spin text-primary"}),n.jsx("p",{className:"text-muted-foreground",children:"Loading configuration..."})]})});const Ue=()=>{switch(e){case"explorer":return n.jsx(FF,{project:o,onRefresh:he});case"registry":return n.jsx(rH,{registry:c,searchQuery:A,setSearchQuery:P,onUpdate:he});case"plugins":return n.jsx(SH,{});case"memory":return n.jsx(nH,{project:o,onUpdate:he});case"create-mcp":return n.jsx(Mz,{project:o});case"claude-settings":return n.jsx(yz,{});case"gemini-settings":return n.jsx(bz,{});case"antigravity-settings":return n.jsx(kz,{});case"preferences":return n.jsx(xz,{});case"projects":return n.jsx(sH,{onProjectSwitch:ee=>{d({dir:ee.dir,hierarchy:ee.hierarchy,subprojects:ee.subprojects}),me({dir:ee.dir,subprojects:ee.subprojects}),he(),X()}});case"workstreams":return n.jsx(CH,{projects:U,onWorkstreamChange:ee=>{Z.success(`Switched to workstream: ${ee.name}`)}});case"docs":return n.jsx(wH,{});case"tutorial":return n.jsx(GH,{});default:return null}};return n.jsxs("div",{className:"min-h-screen bg-background",children:[n.jsx("header",{className:"h-16 bg-card border-b border-border sticky top-0 z-50 shadow-sm",children:n.jsxs("div",{className:"h-full px-6 flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-10 h-10 rounded-lg bg-gradient-to-br from-indigo-500 to-purple-600 flex items-center justify-center shadow-lg shadow-indigo-500/20",children:n.jsx(Dn,{className:"w-5 h-5 text-white"})}),n.jsx("div",{children:n.jsxs("h1",{className:"text-xl font-bold text-foreground",children:["Claude ",n.jsx("span",{className:"text-primary",children:"Config"})]})}),K&&n.jsxs("button",{onClick:ne,disabled:Y,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:[Y?n.jsx(ut,{className:"w-3 h-3 animate-spin"}):n.jsx(yl,{className:"w-3 h-3"}),Y?"Updating...":`Update to v${K.latestVersion}`]})]}),n.jsx(Dj,{orientation:"vertical",className:"h-6"}),n.jsx($F,{projects:U,activeProject:M,onSwitch:H,onAddClick:()=>$(!0),onManageClick:()=>t("projects")}),n.jsx(zF,{onManageClick:()=>t("workstreams")})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(GF,{}),n.jsx(ce,{variant:"ghost",size:"sm",onClick:Oe,children:n.jsx(Er,{className:"w-4 h-4"})}),n.jsxs(ce,{onClick:ye,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:[n.jsx(bl,{className:"w-4 h-4"}),"Re-apply"]})]})]})}),n.jsxs("div",{className:"flex",children:[n.jsxs("aside",{className:"w-64 h-[calc(100vh-64px)] border-r border-border bg-card sticky top-16 flex flex-col",children:[n.jsx(Ln,{className:"flex-1 py-4",children:["Projects","Tools","Configuration","Developer","System","Help"].map(ee=>n.jsxs("div",{className:"mb-6",children:[n.jsx("h3",{className:"px-4 mb-2 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:ee}),n.jsx("div",{className:"space-y-0.5",children:KH.filter(de=>de.section===ee).map(de=>{const De=de.icon,ge=e===de.id;return n.jsxs("button",{onClick:()=>t(de.id),className:`w-full flex items-center gap-3 px-4 py-2.5 text-sm transition-all duration-200 border-l-2 ${ge?"bg-accent border-primary text-primary font-medium":"border-transparent text-muted-foreground hover:text-foreground hover:bg-accent"}`,children:[n.jsx(De,{className:"w-4 h-4"}),n.jsx("span",{className:"flex-1 text-left",children:de.label}),de.badge&&n.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full font-medium ${ge?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground"}`,children:se[de.badge]}),de.isNew&&n.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"})]},de.id)})})]},ee))}),n.jsx("div",{className:"px-4 py-3 border-t border-border",children:n.jsx("span",{className:"text-xs text-muted-foreground",children:F?`v${F}`:""})})]}),n.jsx("main",{className:Pe("flex-1 overflow-auto",["explorer","docs","tutorial"].includes(e)?"h-[calc(100vh-64px)]":"p-6"),children:n.jsx(np,{mode:"wait",children:n.jsx(Mi.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:Ue()},e)})})]}),n.jsx(Aj,{open:G,onOpenChange:$,onAdded:ae}),n.jsx(HF,{enabled:!0,pollInterval:3e4,onWorkstreamChange:ee=>{Z.success(`Switched to workstream: ${ee.name}`)}}),n.jsx(WF,{onStartTutorial:()=>t("tutorial")})]})}function XH(){const[e,t]=C.useState(!1),[r,s]=C.useState(!1),[o,d]=C.useState(!1),u=C.useCallback(async()=>{s(!0);try{await Se.restartServer(),Z.info("Server restarting... page will reload."),setTimeout(()=>{window.location.reload()},2e3)}catch(c){Z.error("Failed to restart: "+c.message),s(!1)}},[]),l=C.useCallback(()=>{d(!0),t(!1),Z.dismiss("update-available")},[]);return C.useEffect(()=>{let c;const f=async()=>{try{const m=await Se.getVersion();console.log("[Update Check]",m),m.needsRestart&&!o&&t(!0)}catch{}};return f(),c=setInterval(f,3e4),()=>clearInterval(c)},[o]),n.jsx(UF,{children:n.jsxs("div",{className:"min-h-screen bg-background",children:[e&&!r&&n.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:[n.jsx(Er,{className:"w-4 h-4"}),n.jsx("span",{className:"text-sm font-medium",children:"Update available — click to restart"}),n.jsx("button",{onClick:c=>{c.stopPropagation(),l()},className:"absolute right-3 p-1 hover:bg-blue-500 rounded",children:n.jsx(Di,{className:"w-4 h-4"})})]}),r&&n.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:[n.jsx(Er,{className:"w-4 h-4 animate-spin"}),n.jsx("span",{className:"text-sm font-medium",children:"Restarting server..."})]}),n.jsx(YH,{}),n.jsx(vP,{position:"bottom-right",richColors:!0})]})})}UE.createRoot(document.getElementById("root")).render(n.jsx(XH,{}));
3233
+ `}},VH={...LH,...IH,...OH,...BH,...FH,...$H,...zH,...HH,...WH,...UH},nu={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"},"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"}},Ow="claude-config-tutorial-visited";function GH(){const[e,t]=C.useState("intro"),[r,s]=C.useState({welcome:!0}),[o,d]=C.useState(()=>{try{return JSON.parse(localStorage.getItem(Ow)||"[]")}catch{return[]}}),u=C.useRef(null);C.useEffect(()=>{if(u.current){const y=u.current.querySelector("[data-radix-scroll-area-viewport]");y&&(y.scrollTop=0)}},[e]),C.useEffect(()=>{if(e&&!o.includes(e)){const y=[...o,e];d(y),localStorage.setItem(Ow,JSON.stringify(y))}},[e,o]);const l=y=>{s(j=>({...j,[y]:!j[y]}))},c=VH[e],f=Ba.flatMap(y=>y.subsections.length>0?y.subsections.map(j=>j.id):[y.id]),m=f.indexOf(e),h=m>0?f[m-1]:null,g=m<f.length-1?f[m+1]:null,w=Math.round(o.length/f.length*100),_=(()=>{for(const y of Ba)if(y.id===e||y.subsections.some(j=>j.id===e))return y;return Ba[0]})(),x=nu[_.id]||nu.welcome,b=y=>{for(const j of Ba){if(j.id===y)return j.title;const E=j.subsections.find(A=>A.id===y);if(E)return E.title}return""},v=y=>({__html:D2(y)});return n.jsxs("div",{className:"flex h-full",children:[n.jsxs("div",{className:"w-72 border-r border-border bg-muted/30 flex flex-col",children:[n.jsxs("div",{className:"p-4 border-b border-border bg-gradient-to-r from-indigo-500/10 to-purple-500/10",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.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:n.jsx(_u,{className:"w-5 h-5 text-white"})}),n.jsxs("div",{children:[n.jsx("h2",{className:"font-semibold text-foreground",children:"Tutorial"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Step-by-step guide"})]})]}),n.jsxs("div",{className:"mt-3",children:[n.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground mb-1",children:[n.jsx("span",{children:"Progress"}),n.jsxs("span",{children:[w,"% complete"]})]}),n.jsx(z2,{value:w,className:"h-2"})]})]}),n.jsx(Ln,{className:"flex-1",children:n.jsx("div",{className:"p-2",children:Ba.map((y,j)=>{const E=y.icon,A=nu[y.id]||nu.welcome,P=e===y.id||y.subsections.some(L=>L.id===e),N=y.subsections.length>0?y.subsections.every(L=>o.includes(L.id)):o.includes(y.id);return n.jsxs("div",{className:"mb-1",children:[n.jsxs("button",{className:Pe("w-full flex items-center gap-2 px-3 py-2.5 text-sm rounded-lg hover:bg-accent text-left transition-all",P&&"bg-accent"),onClick:()=>{y.subsections.length>0?(l(y.id),r[y.id]||t(y.subsections[0].id)):t(y.id)},children:[n.jsx("span",{className:Pe("w-7 h-7 rounded-lg flex items-center justify-center transition-colors",P?A.bg+" text-white":A.light),children:N?n.jsx(wm,{className:"w-4 h-4"}):n.jsx(E,{className:Pe("w-4 h-4",!P&&A.text)})}),n.jsx("span",{className:Pe("flex-1",P&&"font-medium"),children:y.title}),y.subsections.length>0&&n.jsx(tn,{className:Pe("w-4 h-4 text-muted-foreground transition-transform",r[y.id]&&"rotate-90")})]}),y.subsections.length>0&&r[y.id]&&n.jsx("div",{className:"ml-4 mt-1 space-y-0.5 border-l-2 border-border pl-3",children:y.subsections.map(L=>{const B=e===L.id,I=o.includes(L.id);return n.jsxs("button",{className:Pe("w-full text-left px-3 py-1.5 text-sm rounded-md hover:bg-accent text-foreground flex items-center gap-2",B&&"bg-accent font-medium",B&&A.text),onClick:()=>t(L.id),children:[I&&!B&&n.jsx(wm,{className:"w-3 h-3 text-green-500"}),n.jsx("span",{className:Pe(!I&&!B&&"ml-5"),children:L.title})]},L.id)})})]},y.id)})})})]}),n.jsxs("div",{className:"flex-1 overflow-hidden flex flex-col",children:[n.jsx("div",{className:Pe("px-8 py-4 border-b border-border",x.light),children:n.jsxs("div",{className:"max-w-3xl mx-auto flex items-center gap-3",children:[n.jsx("div",{className:Pe("w-10 h-10 rounded-xl flex items-center justify-center",x.bg,"text-white"),children:n.jsx(_.icon,{className:"w-5 h-5"})}),n.jsxs("div",{children:[n.jsx("p",{className:Pe("text-sm font-medium",x.text),children:_.title}),n.jsx("h1",{className:"text-lg font-semibold text-foreground",children:(c==null?void 0:c.title)||b(e)})]})]})}),n.jsx(Ln,{className:"flex-1",ref:u,children:n.jsx("div",{className:"max-w-3xl mx-auto p-8",children:c?n.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:v(c.content)}):n.jsxs("div",{className:"text-center text-muted-foreground py-12",children:[n.jsx(_u,{className:"w-12 h-12 mx-auto mb-4 opacity-50"}),n.jsx("p",{children:"Select a topic from the sidebar"})]})})}),n.jsx("div",{className:"border-t border-border p-4 bg-muted/30",children:n.jsxs("div",{className:"max-w-3xl mx-auto flex items-center justify-between",children:[h?n.jsxs(ce,{variant:"ghost",onClick:()=>t(h),className:"flex items-center gap-2",children:[n.jsx(lM,{className:"w-4 h-4"}),n.jsx("span",{className:"max-w-[150px] truncate",children:b(h)})]}):n.jsx("div",{}),n.jsxs("span",{className:"text-xs text-muted-foreground",children:[m+1," of ",f.length]}),g?n.jsxs(ce,{onClick:()=>t(g),className:Pe("flex items-center gap-2",x.bg,"hover:opacity-90"),children:[n.jsx("span",{className:"max-w-[150px] truncate",children:b(g)}),n.jsx(Ku,{className:"w-4 h-4"})]}):n.jsx(ce,{variant:"outline",onClick:()=>t("intro"),className:"flex items-center gap-2",children:"Start Over"})]})})]})]})}const KH=[{id:"projects",label:"All Projects",icon:ei,section:"Projects"},{id:"explorer",label:"Project Explorer",icon:ii,section:"Projects"},{id:"registry",label:"MCP Registry",icon:es,section:"Tools"},{id:"plugins",label:"Plugins",icon:Bi,section:"Tools"},{id:"memory",label:"Memory",icon:Ii,section:"Tools"},{id:"workstreams",label:"Workstreams",icon:qa,section:"Tools"},{id:"claude-settings",label:"Claude Code",icon:ci,section:"Configuration"},{id:"gemini-settings",label:"Gemini CLI",icon:Xt,section:"Configuration"},{id:"antigravity-settings",label:"Antigravity",icon:bl,section:"Configuration"},{id:"create-mcp",label:"Create MCP",icon:qn,section:"Developer"},{id:"preferences",label:"Preferences",icon:ES,section:"System"},{id:"tutorial",label:"Tutorial",icon:_u,section:"Help",isNew:!0},{id:"docs",label:"Docs & Help",icon:Li,section:"Help"}],Bw=(e,t)=>{try{const r=localStorage.getItem(`claude-config-${e}`);return r?JSON.parse(r):t}catch{return t}},qH=(e,t)=>{try{localStorage.setItem(`claude-config-${e}`,JSON.stringify(t))}catch{}};function YH(){const[e,t]=C.useState(()=>Bw("currentView","explorer")),[r,s]=C.useState(!0),[o,d]=C.useState({dir:"",subprojects:[],hierarchy:[]}),[u,l]=C.useState([]),[c,f]=C.useState({mcpServers:{}}),[m,h]=C.useState([]),[g,w]=C.useState([]),[k,_]=C.useState(null),[x,b]=C.useState(null),[v,y]=C.useState(!1),[j,E]=C.useState({title:"",type:""}),[A,P]=C.useState(""),[N,L]=C.useState(""),[B,I]=C.useState({}),[F,z]=C.useState(null),[K,V]=C.useState(null),[Y,q]=C.useState(!1),[U,D]=C.useState([]),[M,O]=C.useState(null),[G,$]=C.useState(!1),[oe,me]=C.useState(null);C.useEffect(()=>{qH("currentView",e)},[e]);const he=C.useCallback(async()=>{try{const[ee,de,De,ge,ve]=await Promise.all([Se.getProject(),Se.getConfigs(),Se.getRegistry(),Se.getRules(),Se.getCommands()]);d(ee),l(de),f(De),h(ge),w(ve),de.length>0&&!k&&_(de[de.length-1])}catch(ee){Z.error("Failed to load data: "+ee.message)}finally{s(!1)}},[k]),X=C.useCallback(async(ee=!1)=>{var de;try{const De=await Se.getProjects();D(De.projects||[]);const ge=(de=De.projects)==null?void 0:de.find(ve=>ve.isActive);if(O(ge||null),ee&&ge){const ve=await Se.getSubprojects(ge.path);me({dir:ge.path,subprojects:ve.subprojects||[]})}ee&&!ge&&(Bw("currentView",null)||t("projects"))}catch{console.log("Projects API not available")}},[]),H=async ee=>{try{const de=await Se.setActiveProject(ee);de.success?(d({dir:de.dir,hierarchy:de.hierarchy,subprojects:de.subprojects}),me({dir:de.dir,subprojects:de.subprojects}),O(de.project),D(De=>De.map(ge=>({...ge,isActive:ge.id===ee}))),await he(),Z.success(`Switched to ${de.project.name}`)):Z.error(de.error||"Failed to switch project")}catch(de){Z.error("Failed to switch project: "+de.message)}},ae=ee=>{D(de=>[...de,{...ee,exists:!0,hasClaudeConfig:!1}])};C.useEffect(()=>{he(),X(!0),Se.checkVersion().then(ee=>{z(ee==null?void 0:ee.installedVersion),ee!=null&&ee.updateAvailable&&(ee==null?void 0:ee.updateMethod)==="npm"&&V(ee)}).catch(()=>{})},[]);const ne=async()=>{if(K!=null&&K.updateAvailable){q(!0);try{const ee=await Se.performUpdate({updateMethod:K.updateMethod,sourcePath:K.sourcePath,targetVersion:K.latestVersion});ee.success?(Z.success(`Updated to v${ee.newVersion}! Reloading...`),setTimeout(()=>window.location.reload(),1500)):(Z.error("Update failed: "+ee.error),q(!1))}catch(ee){Z.error("Update failed: "+ee.message),q(!1)}}};C.useEffect(()=>{const ee=async()=>{try{const{hashes:De}=await Se.getFileHashes(),ge=B;(Object.keys(De).some(Le=>ge[Le]!==De[Le])||Object.keys(ge).some(Le=>!De[Le]))&&Object.keys(ge).length>0&&(Z.info("Files changed externally, reloading..."),await he()),I(De)}catch{}},de=setInterval(ee,2e3);return ee(),()=>clearInterval(de)},[B,he]);const J=new Set;u.forEach(ee=>{var de,De;(((de=ee.config)==null?void 0:de.include)||[]).forEach(ge=>J.add(ge)),Object.keys(((De=ee.config)==null?void 0:De.mcpServers)||{}).forEach(ge=>J.add(ge))});const se={mcps:J.size,rules:m.length,commands:g.length},ye=async()=>{try{const ee=await Se.applyConfig(o.dir);if(ee.tools){const de=Object.entries(ee.tools).filter(([,De])=>De).map(([De])=>De==="claude"?"Claude Code":"Antigravity");de.length>0?Z.success(`Config applied to: ${de.join(", ")}`):Z.warning("No tools were updated")}else Z.success("Configuration applied successfully!")}catch(ee){Z.error("Failed to apply config: "+ee.message)}},Oe=async()=>{s(!0),await he(),Z.success("Data refreshed")};if(r)return n.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:n.jsxs("div",{className:"flex flex-col items-center gap-4",children:[n.jsx(ut,{className:"w-8 h-8 animate-spin text-primary"}),n.jsx("p",{className:"text-muted-foreground",children:"Loading configuration..."})]})});const Ue=()=>{switch(e){case"explorer":return n.jsx(FF,{project:o,onRefresh:he});case"registry":return n.jsx(rH,{registry:c,searchQuery:A,setSearchQuery:P,onUpdate:he});case"plugins":return n.jsx(SH,{});case"memory":return n.jsx(nH,{project:o,onUpdate:he});case"create-mcp":return n.jsx(Mz,{project:o});case"claude-settings":return n.jsx(yz,{});case"gemini-settings":return n.jsx(bz,{});case"antigravity-settings":return n.jsx(kz,{});case"preferences":return n.jsx(xz,{});case"projects":return n.jsx(sH,{onProjectSwitch:ee=>{d({dir:ee.dir,hierarchy:ee.hierarchy,subprojects:ee.subprojects}),me({dir:ee.dir,subprojects:ee.subprojects}),he(),X()}});case"workstreams":return n.jsx(CH,{projects:U,onWorkstreamChange:ee=>{Z.success(`Switched to workstream: ${ee.name}`)}});case"docs":return n.jsx(wH,{});case"tutorial":return n.jsx(GH,{});default:return null}};return n.jsxs("div",{className:"min-h-screen bg-background",children:[n.jsx("header",{className:"h-16 bg-card border-b border-border sticky top-0 z-50 shadow-sm",children:n.jsxs("div",{className:"h-full px-6 flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-10 h-10 rounded-lg bg-gradient-to-br from-indigo-500 to-purple-600 flex items-center justify-center shadow-lg shadow-indigo-500/20",children:n.jsx(Dn,{className:"w-5 h-5 text-white"})}),n.jsx("div",{children:n.jsxs("h1",{className:"text-xl font-bold text-foreground",children:["Claude ",n.jsx("span",{className:"text-primary",children:"Config"})]})}),K&&n.jsxs("button",{onClick:ne,disabled:Y,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:[Y?n.jsx(ut,{className:"w-3 h-3 animate-spin"}):n.jsx(yl,{className:"w-3 h-3"}),Y?"Updating...":`Update to v${K.latestVersion}`]})]}),n.jsx(Dj,{orientation:"vertical",className:"h-6"}),n.jsx($F,{projects:U,activeProject:M,onSwitch:H,onAddClick:()=>$(!0),onManageClick:()=>t("projects")}),n.jsx(zF,{onManageClick:()=>t("workstreams")})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(GF,{}),n.jsx(ce,{variant:"ghost",size:"sm",onClick:Oe,children:n.jsx(Er,{className:"w-4 h-4"})}),n.jsxs(ce,{onClick:ye,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:[n.jsx(bl,{className:"w-4 h-4"}),"Re-apply"]})]})]})}),n.jsxs("div",{className:"flex",children:[n.jsxs("aside",{className:"w-64 h-[calc(100vh-64px)] border-r border-border bg-card sticky top-16 flex flex-col",children:[n.jsx(Ln,{className:"flex-1 py-4",children:["Projects","Tools","Configuration","Developer","System","Help"].map(ee=>n.jsxs("div",{className:"mb-6",children:[n.jsx("h3",{className:"px-4 mb-2 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:ee}),n.jsx("div",{className:"space-y-0.5",children:KH.filter(de=>de.section===ee).map(de=>{const De=de.icon,ge=e===de.id;return n.jsxs("button",{onClick:()=>t(de.id),className:`w-full flex items-center gap-3 px-4 py-2.5 text-sm transition-all duration-200 border-l-2 ${ge?"bg-accent border-primary text-primary font-medium":"border-transparent text-muted-foreground hover:text-foreground hover:bg-accent"}`,children:[n.jsx(De,{className:"w-4 h-4"}),n.jsx("span",{className:"flex-1 text-left",children:de.label}),de.badge&&n.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full font-medium ${ge?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground"}`,children:se[de.badge]}),de.isNew&&n.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"})]},de.id)})})]},ee))}),n.jsx("div",{className:"px-4 py-3 border-t border-border",children:n.jsx("span",{className:"text-xs text-muted-foreground",children:F?`v${F}`:""})})]}),n.jsx("main",{className:Pe("flex-1 overflow-auto",["explorer","docs","tutorial"].includes(e)?"h-[calc(100vh-64px)]":"p-6"),children:n.jsx(np,{mode:"wait",children:n.jsx(Mi.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:Ue()},e)})})]}),n.jsx(Aj,{open:G,onOpenChange:$,onAdded:ae}),n.jsx(HF,{enabled:!0,pollInterval:3e4,onWorkstreamChange:ee=>{Z.success(`Switched to workstream: ${ee.name}`)}}),n.jsx(WF,{onStartTutorial:()=>t("tutorial")})]})}function XH(){const[e,t]=C.useState(!1),[r,s]=C.useState(!1),[o,d]=C.useState(!1),u=C.useCallback(async()=>{s(!0);try{await Se.restartServer(),Z.info("Server restarting... page will reload."),setTimeout(()=>{window.location.reload()},2e3)}catch(c){Z.error("Failed to restart: "+c.message),s(!1)}},[]),l=C.useCallback(()=>{d(!0),t(!1),Z.dismiss("update-available")},[]);return C.useEffect(()=>{let c;const f=async()=>{try{const m=await Se.getVersion();console.log("[Update Check]",m),m.needsRestart&&!o&&t(!0)}catch{}};return f(),c=setInterval(f,3e4),()=>clearInterval(c)},[o]),n.jsx(UF,{children:n.jsxs("div",{className:"min-h-screen bg-background",children:[e&&!r&&n.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:[n.jsx(Er,{className:"w-4 h-4"}),n.jsx("span",{className:"text-sm font-medium",children:"Update available — click to restart"}),n.jsx("button",{onClick:c=>{c.stopPropagation(),l()},className:"absolute right-3 p-1 hover:bg-blue-500 rounded",children:n.jsx(Di,{className:"w-4 h-4"})})]}),r&&n.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:[n.jsx(Er,{className:"w-4 h-4 animate-spin"}),n.jsx("span",{className:"text-sm font-medium",children:"Restarting server..."})]}),n.jsx(YH,{}),n.jsx(vP,{position:"bottom-right",richColors:!0})]})})}UE.createRoot(document.getElementById("root")).render(n.jsx(XH,{}));
@@ -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-a6jIjV7T.js"></script>
22
+ <script type="module" crossorigin src="/assets/index-D0yyqvkB.js"></script>
23
23
  <link rel="stylesheet" crossorigin href="/assets/index-B5xMgttx.css">
24
24
  </head>
25
25
  <body>
@@ -111,7 +111,7 @@ async function checkForUpdates(manager, dirname) {
111
111
  /**
112
112
  * Perform npm update
113
113
  */
114
- async function performNpmUpdate() {
114
+ async function performNpmUpdate(targetVersion) {
115
115
  try {
116
116
  // Use npm install @latest instead of npm update for reliable updates
117
117
  execSync('npm install -g @regression-io/claude-config@latest', {
@@ -119,13 +119,10 @@ async function performNpmUpdate() {
119
119
  timeout: 120000
120
120
  });
121
121
 
122
- // Get the new version from npm registry since we just updated
123
- const newVersion = await fetchNpmVersion();
124
-
125
122
  return {
126
123
  success: true,
127
124
  updateMethod: 'npm',
128
- newVersion: newVersion || 'latest',
125
+ newVersion: targetVersion || 'latest',
129
126
  message: 'Updated via npm. Please restart the UI to use the new version.'
130
127
  };
131
128
  } catch (error) {
@@ -249,10 +246,10 @@ function performLocalUpdate(sourcePath, manager) {
249
246
  * Perform update
250
247
  */
251
248
  async function performUpdate(options, manager) {
252
- const { updateMethod, sourcePath } = options;
249
+ const { updateMethod, sourcePath, targetVersion } = options;
253
250
 
254
251
  if (updateMethod === 'npm') {
255
- return await performNpmUpdate();
252
+ return await performNpmUpdate(targetVersion);
256
253
  }
257
254
 
258
255
  if (sourcePath) {