@regression-io/claude-config 0.22.10 → 0.22.11

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/config-loader.js CHANGED
@@ -19,7 +19,7 @@ const fs = require('fs');
19
19
  const path = require('path');
20
20
  const { execSync } = require('child_process');
21
21
 
22
- const VERSION = '0.22.10';
22
+ const VERSION = '0.22.11';
23
23
 
24
24
  // Tool-specific path configurations
25
25
  const TOOL_PATHS = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@regression-io/claude-config",
3
- "version": "0.22.10",
3
+ "version": "0.22.11",
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",
@@ -1707,4 +1707,4 @@ When reporting issues, include:
1707
1707
  - Operating system
1708
1708
  - Error messages or logs
1709
1709
  `}};function DI(){const[e,t]=C.useState("installation"),[s,o]=C.useState({"getting-started":!0}),l=f=>{o(a=>({...a,[f]:!a[f]}))},m=MI[e];return i.jsxs("div",{className:"flex h-full",children:[i.jsxs("div",{className:"w-64 border-r border-border bg-muted/50 flex flex-col",children:[i.jsx("div",{className:"p-4 border-b border-border",children:i.jsxs("h2",{className:"font-semibold flex items-center gap-2 text-foreground",children:[i.jsx(Un,{className:"w-5 h-5"}),"Documentation"]})}),i.jsx(ei,{className:"flex-1",children:i.jsx("div",{className:"p-2",children:AI.map(f=>i.jsxs("div",{className:"mb-1",children:[i.jsxs("button",{className:be("w-full flex items-center gap-2 px-3 py-2 text-sm rounded-md hover:bg-accent text-left",(e===f.id||f.subsections.some(a=>a.id===e))&&"bg-accent"),onClick:()=>{f.subsections.length>0?(l(f.id),s[f.id]||t(f.subsections[0].id)):t(f.id)},children:[i.jsx(f.icon,{className:"w-4 h-4 text-muted-foreground"}),i.jsx("span",{className:"flex-1",children:f.title}),f.subsections.length>0&&i.jsx(Qi,{className:be("w-4 h-4 text-muted-foreground transition-transform",s[f.id]&&"rotate-90")})]}),f.subsections.length>0&&s[f.id]&&i.jsx("div",{className:"ml-6 mt-1 space-y-1",children:f.subsections.map(a=>i.jsx("button",{className:be("w-full text-left px-3 py-1.5 text-sm rounded-md hover:bg-accent text-foreground",e===a.id&&"bg-accent text-primary font-medium"),onClick:()=>t(a.id),children:a.title},a.id))})]},f.id))})})]}),i.jsx("div",{className:"flex-1 overflow-hidden",children:i.jsx(ei,{className:"h-full",children:i.jsx("div",{className:"max-w-3xl mx-auto p-8",children:m?i.jsx("div",{className:"prose prose-sm max-w-none",children:i.jsx("div",{dangerouslySetInnerHTML:{__html:LI(m.content)}})}):i.jsxs("div",{className:"text-center text-muted-foreground py-12",children:[i.jsx(Un,{className:"w-12 h-12 mx-auto mb-4 opacity-50"}),i.jsx("p",{children:"Select a topic from the sidebar"})]})})})})]})}function LI(e){let t=e.replace(/```(\w*)\n([\s\S]*?)```/g,(s,o,l)=>`<pre class="bg-zinc-900 text-zinc-100 p-4 rounded-lg overflow-x-auto my-4"><code class="text-sm">${l.replace(/</g,"&lt;").replace(/>/g,"&gt;").trim()}</code></pre>`);return t=t.replace(/(\|[^\n]+\|\n\|[-| :]+\|\n(?:\|[^\n]+\|\n?)+)/g,s=>{const o=s.trim().split(`
1710
- `);if(o.length<2)return s;const l=o[0].split("|").filter(f=>f.trim()).map(f=>`<th class="border border-border px-3 py-2 bg-muted font-semibold text-left">${f.trim()}</th>`).join(""),m=o.slice(2).map(f=>`<tr>${f.split("|").filter(c=>c.trim()).map(c=>`<td class="border border-border px-3 py-2">${c.trim()}</td>`).join("")}</tr>`).join("");return`<table class="w-full border-collapse border border-border my-4"><thead><tr>${l}</tr></thead><tbody>${m}</tbody></table>`}),t.replace(/^### (.*$)/gim,'<h3 class="text-lg font-semibold mt-6 mb-2 text-foreground">$1</h3>').replace(/^## (.*$)/gim,'<h2 class="text-xl font-semibold mt-8 mb-4 text-foreground">$1</h2>').replace(/^# (.*$)/gim,'<h1 class="text-2xl font-bold mb-6 text-foreground">$1</h1>').replace(/\*\*(.*?)\*\*/g,"<strong>$1</strong>").replace(/\*(.*?)\*/g,"<em>$1</em>").replace(/`([^`]+)`/g,'<code class="bg-muted px-1.5 py-0.5 rounded text-sm font-mono">$1</code>').replace(/^- (.*$)/gim,'<li class="ml-4">$1</li>').replace(/(<li.*<\/li>\n?)+/g,'<ul class="list-disc my-2">$&</ul>').replace(/^\d+\. (.*$)/gim,'<li class="ml-4">$1</li>').replace(/\n\n/g,'</p><p class="my-3 text-foreground">').replace(/\n/g,"<br/>")}const OI=[{id:"projects",label:"All Projects",icon:A_,section:"Projects"},{id:"explorer",label:"Project Explorer",icon:vn,section:"Projects"},{id:"registry",label:"MCP Registry",icon:ua,section:"Configuration"},{id:"memory",label:"Memory",icon:Wi,section:"Configuration"},{id:"claude-settings",label:"Claude Code",icon:Ca,section:"Configuration"},{id:"gemini-settings",label:"Gemini CLI",icon:St,section:"Configuration"},{id:"templates",label:"Templates",icon:Sa,section:"Tools"},{id:"create-mcp",label:"Create MCP",icon:Ps,section:"Developer"},{id:"preferences",label:"Preferences",icon:O_,section:"System"},{id:"docs",label:"Docs & Help",icon:Un,section:"Help"}],qy=(e,t)=>{try{const s=localStorage.getItem(`claude-config-${e}`);return s?JSON.parse(s):t}catch{return t}},II=(e,t)=>{try{localStorage.setItem(`claude-config-${e}`,JSON.stringify(t))}catch{}};function BI(){const[e,t]=C.useState(()=>qy("currentView","explorer")),[s,o]=C.useState(!0),[l,m]=C.useState({dir:"",subprojects:[],hierarchy:[]}),[f,a]=C.useState([]),[c,h]=C.useState({mcpServers:{}}),[g,d]=C.useState([]),[_,S]=C.useState([]),[j,b]=C.useState([]),[v,y]=C.useState(null),[p,x]=C.useState(null),[k,R]=C.useState(!1),[T,N]=C.useState({title:"",type:""}),[E,D]=C.useState(""),[H,F]=C.useState(""),[W,$]=C.useState({}),[J,G]=C.useState(null),[K,q]=C.useState(null),[z,M]=C.useState(!1),[B,L]=C.useState([]),[V,Z]=C.useState(null),[se,ce]=C.useState(!1),[ue,U]=C.useState(null);C.useEffect(()=>{II("currentView",e)},[e]);const O=C.useCallback(async()=>{try{const[Ce,Ee,Ke,ze,Ge,Ye]=await Promise.all([De.getProject(),De.getConfigs(),De.getRegistry(),De.getRules(),De.getCommands(),De.getTemplates()]);m(Ce),a(Ee),h(Ke),d(ze),S(Ge),b(Ye),Ee.length>0&&!v&&y(Ee[Ee.length-1])}catch(Ce){le.error("Failed to load data: "+Ce.message)}finally{o(!1)}},[v]),ne=C.useCallback(async(Ce=!1)=>{var Ee;try{const Ke=await De.getProjects();L(Ke.projects||[]);const ze=(Ee=Ke.projects)==null?void 0:Ee.find(Ge=>Ge.isActive);if(Z(ze||null),Ce&&ze){const Ge=await De.getSubprojects(ze.path);U({dir:ze.path,subprojects:Ge.subprojects||[]})}Ce&&!ze&&(qy("currentView",null)||t("projects"))}catch{console.log("Projects API not available")}},[]),te=async Ce=>{try{const Ee=await De.setActiveProject(Ce);Ee.success?(m({dir:Ee.dir,hierarchy:Ee.hierarchy,subprojects:Ee.subprojects}),U({dir:Ee.dir,subprojects:Ee.subprojects}),Z(Ee.project),L(Ke=>Ke.map(ze=>({...ze,isActive:ze.id===Ce}))),await O(),le.success(`Switched to ${Ee.project.name}`)):le.error(Ee.error||"Failed to switch project")}catch(Ee){le.error("Failed to switch project: "+Ee.message)}},X=Ce=>{L(Ee=>[...Ee,{...Ce,exists:!0,hasClaudeConfig:!1}])};C.useEffect(()=>{O(),ne(!0),De.checkVersion().then(Ce=>{G(Ce==null?void 0:Ce.installedVersion),Ce!=null&&Ce.updateAvailable&&q(Ce)}).catch(()=>{})},[]);const re=async()=>{if(K!=null&&K.updateAvailable){M(!0);try{const Ce=await De.performUpdate({updateMethod:K.updateMethod,sourcePath:K.sourcePath});Ce.success?(le.success(`Updated to v${Ce.newVersion}! Reloading...`),setTimeout(()=>window.location.reload(),1500)):(le.error("Update failed: "+Ce.error),M(!1))}catch(Ce){le.error("Update failed: "+Ce.message),M(!1)}}};C.useEffect(()=>{const Ce=async()=>{try{const{hashes:Ke}=await De.getFileHashes(),ze=W;(Object.keys(Ke).some(Ye=>ze[Ye]!==Ke[Ye])||Object.keys(ze).some(Ye=>!Ke[Ye]))&&Object.keys(ze).length>0&&(le.info("Files changed externally, reloading..."),await O()),$(Ke)}catch{}},Ee=setInterval(Ce,2e3);return Ce(),()=>clearInterval(Ee)},[W,O]);const ve=new Set;f.forEach(Ce=>{var Ee,Ke;(((Ee=Ce.config)==null?void 0:Ee.include)||[]).forEach(ze=>ve.add(ze)),Object.keys(((Ke=Ce.config)==null?void 0:Ke.mcpServers)||{}).forEach(ze=>ve.add(ze))});const he={mcps:ve.size,rules:g.length,commands:_.length},de=async()=>{try{const Ce=await De.applyConfig(l.dir);if(Ce.tools){const Ee=Object.entries(Ce.tools).filter(([,Ke])=>Ke).map(([Ke])=>Ke==="claude"?"Claude Code":"Antigravity");Ee.length>0?le.success(`Config applied to: ${Ee.join(", ")}`):le.warning("No tools were updated")}else le.success("Configuration applied successfully!")}catch(Ce){le.error("Failed to apply config: "+Ce.message)}},Ae=async()=>{o(!0),await O(),le.success("Data refreshed")};if(s)return i.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:i.jsxs("div",{className:"flex flex-col items-center gap-4",children:[i.jsx(ft,{className:"w-8 h-8 animate-spin text-primary"}),i.jsx("p",{className:"text-muted-foreground",children:"Loading configuration..."})]})});const _e=()=>{switch(e){case"explorer":return i.jsx(FO,{project:l,onRefresh:O});case"registry":return i.jsx(PI,{registry:c,searchQuery:E,setSearchQuery:D,onUpdate:O});case"memory":return i.jsx(RI,{project:l,onUpdate:O});case"templates":return i.jsx(oI,{templates:j,project:l,onApply:O});case"create-mcp":return i.jsx(iI,{project:l});case"claude-settings":return i.jsx(XO,{});case"gemini-settings":return i.jsx(JO,{});case"preferences":return i.jsx(YO,{});case"projects":return i.jsx(TI,{onProjectSwitch:Ce=>{m({dir:Ce.dir,hierarchy:Ce.hierarchy,subprojects:Ce.subprojects}),U({dir:Ce.dir,subprojects:Ce.subprojects}),O(),ne()}});case"docs":return i.jsx(DI,{});default:return null}};return i.jsxs("div",{className:"min-h-screen bg-background",children:[i.jsx("header",{className:"h-16 bg-card border-b border-border sticky top-0 z-50 shadow-sm",children:i.jsxs("div",{className:"h-full px-6 flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.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:i.jsx(Kn,{className:"w-5 h-5 text-white"})}),i.jsx("div",{children:i.jsxs("h1",{className:"text-xl font-bold text-foreground",children:["Claude ",i.jsx("span",{className:"text-primary",children:"Config"}),J&&i.jsxs("span",{className:"text-xs font-normal text-muted-foreground ml-2",children:["v",J]})]})}),K&&i.jsxs("button",{onClick:re,disabled:z,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:[z?i.jsx(ft,{className:"w-3 h-3 animate-spin"}):i.jsx($c,{className:"w-3 h-3"}),z?"Updating...":`Update to v${K.sourceVersion}`]})]}),i.jsx(Z1,{orientation:"vertical",className:"h-6"}),i.jsx(HO,{projects:B,activeProject:V,onSwitch:te,onAddClick:()=>ce(!0),onManageClick:()=>t("projects")})]}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(zO,{}),i.jsx(pe,{variant:"ghost",size:"sm",onClick:Ae,children:i.jsx(pr,{className:"w-4 h-4"})}),i.jsxs(pe,{onClick:de,className:"bg-indigo-600 hover:bg-indigo-700 text-white gap-2 shadow-md",children:[i.jsx(RT,{className:"w-4 h-4"}),"Apply Config"]})]})]})}),i.jsxs("div",{className:"flex",children:[i.jsx("aside",{className:"w-64 h-[calc(100vh-64px)] border-r border-border bg-card sticky top-16",children:i.jsx(ei,{className:"h-full py-4",children:["Projects","Configuration","Tools","Developer","System","Help"].map(Ce=>i.jsxs("div",{className:"mb-6",children:[i.jsx("h3",{className:"px-4 mb-2 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:Ce}),i.jsx("div",{className:"space-y-0.5",children:OI.filter(Ee=>Ee.section===Ce).map(Ee=>{const Ke=Ee.icon,ze=e===Ee.id;return i.jsxs("button",{onClick:()=>t(Ee.id),className:`w-full flex items-center gap-3 px-4 py-2.5 text-sm transition-all duration-200 border-l-2 ${ze?"bg-accent border-primary text-primary font-medium":"border-transparent text-muted-foreground hover:text-foreground hover:bg-accent"}`,children:[i.jsx(Ke,{className:"w-4 h-4"}),i.jsx("span",{className:"flex-1 text-left",children:Ee.label}),Ee.badge&&i.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full font-medium ${ze?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground"}`,children:he[Ee.badge]})]},Ee.id)})})]},Ce))})}),i.jsx("main",{className:be("flex-1 overflow-auto",e==="explorer"||e==="docs"?"h-[calc(100vh-64px)]":"p-6"),children:i.jsx(Zy,{mode:"wait",children:i.jsx(Ii.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},className:e==="explorer"||e==="docs"?"h-full":"",children:_e()},e)})})]}),i.jsx(Y1,{open:se,onOpenChange:ce,onAdded:X})]})}function FI(){const[e,t]=C.useState(!1),[s,o]=C.useState(!1),[l,m]=C.useState(!1),f=C.useCallback(async()=>{o(!0);try{await De.restartServer(),le.info("Server restarting... page will reload."),setTimeout(()=>{window.location.reload()},2e3)}catch(c){le.error("Failed to restart: "+c.message),o(!1)}},[]),a=C.useCallback(()=>{m(!0),t(!1),le.dismiss("update-available")},[]);return C.useEffect(()=>{let c;const h=async()=>{try{const g=await De.getVersion();console.log("[Update Check]",g),g.needsRestart&&!l&&(t(!0),le("Update available!",{id:"update-available",duration:1/0,description:"New version ready to apply.",action:{label:"Restart Now",onClick:async()=>{try{await De.restartServer(),le.info("Restarting..."),setTimeout(()=>window.location.reload(),2e3)}catch{le.error("Restart failed")}}}}))}catch{}};return h(),c=setInterval(h,3e4),()=>clearInterval(c)},[l]),i.jsx($O,{children:i.jsxs("div",{className:"min-h-screen bg-background",children:[e&&!s&&i.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-4 shadow-lg",children:[i.jsx("span",{className:"text-sm font-medium",children:"Update available! Restart the server to apply changes."}),i.jsxs(pe,{size:"sm",variant:"secondary",className:"h-7 bg-white text-blue-600 hover:bg-blue-50",onClick:f,children:[i.jsx(pr,{className:"w-3 h-3 mr-1"}),"Restart Now"]}),i.jsx("button",{onClick:a,className:"p-1 hover:bg-blue-500 rounded",children:i.jsx(ip,{className:"w-4 h-4"})})]}),s&&i.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:[i.jsx(pr,{className:"w-4 h-4 animate-spin"}),i.jsx("span",{className:"text-sm font-medium",children:"Restarting server..."})]}),i.jsx(BI,{}),i.jsx(G2,{position:"bottom-right",richColors:!0})]})})}_2.createRoot(document.getElementById("root")).render(i.jsx(FI,{}));
1710
+ `);if(o.length<2)return s;const l=o[0].split("|").filter(f=>f.trim()).map(f=>`<th class="border border-border px-3 py-2 bg-muted font-semibold text-left">${f.trim()}</th>`).join(""),m=o.slice(2).map(f=>`<tr>${f.split("|").filter(c=>c.trim()).map(c=>`<td class="border border-border px-3 py-2">${c.trim()}</td>`).join("")}</tr>`).join("");return`<table class="w-full border-collapse border border-border my-4"><thead><tr>${l}</tr></thead><tbody>${m}</tbody></table>`}),t.replace(/^### (.*$)/gim,'<h3 class="text-lg font-semibold mt-6 mb-2 text-foreground">$1</h3>').replace(/^## (.*$)/gim,'<h2 class="text-xl font-semibold mt-8 mb-4 text-foreground">$1</h2>').replace(/^# (.*$)/gim,'<h1 class="text-2xl font-bold mb-6 text-foreground">$1</h1>').replace(/\*\*(.*?)\*\*/g,"<strong>$1</strong>").replace(/\*(.*?)\*/g,"<em>$1</em>").replace(/`([^`]+)`/g,'<code class="bg-muted px-1.5 py-0.5 rounded text-sm font-mono">$1</code>').replace(/^- (.*$)/gim,'<li class="ml-4">$1</li>').replace(/(<li.*<\/li>\n?)+/g,'<ul class="list-disc my-2">$&</ul>').replace(/^\d+\. (.*$)/gim,'<li class="ml-4">$1</li>').replace(/\n\n/g,'</p><p class="my-3 text-foreground">').replace(/\n/g,"<br/>")}const OI=[{id:"projects",label:"All Projects",icon:A_,section:"Projects"},{id:"explorer",label:"Project Explorer",icon:vn,section:"Projects"},{id:"registry",label:"MCP Registry",icon:ua,section:"Configuration"},{id:"memory",label:"Memory",icon:Wi,section:"Configuration"},{id:"claude-settings",label:"Claude Code",icon:Ca,section:"Configuration"},{id:"gemini-settings",label:"Gemini CLI",icon:St,section:"Configuration"},{id:"templates",label:"Templates",icon:Sa,section:"Tools"},{id:"create-mcp",label:"Create MCP",icon:Ps,section:"Developer"},{id:"preferences",label:"Preferences",icon:O_,section:"System"},{id:"docs",label:"Docs & Help",icon:Un,section:"Help"}],qy=(e,t)=>{try{const s=localStorage.getItem(`claude-config-${e}`);return s?JSON.parse(s):t}catch{return t}},II=(e,t)=>{try{localStorage.setItem(`claude-config-${e}`,JSON.stringify(t))}catch{}};function BI(){const[e,t]=C.useState(()=>qy("currentView","explorer")),[s,o]=C.useState(!0),[l,m]=C.useState({dir:"",subprojects:[],hierarchy:[]}),[f,a]=C.useState([]),[c,h]=C.useState({mcpServers:{}}),[g,d]=C.useState([]),[_,S]=C.useState([]),[j,b]=C.useState([]),[v,y]=C.useState(null),[p,x]=C.useState(null),[k,R]=C.useState(!1),[T,N]=C.useState({title:"",type:""}),[E,D]=C.useState(""),[H,F]=C.useState(""),[W,$]=C.useState({}),[J,G]=C.useState(null),[K,q]=C.useState(null),[z,M]=C.useState(!1),[B,L]=C.useState([]),[V,Z]=C.useState(null),[se,ce]=C.useState(!1),[ue,U]=C.useState(null);C.useEffect(()=>{II("currentView",e)},[e]);const O=C.useCallback(async()=>{try{const[Ce,Ee,Ke,ze,Ge,Ye]=await Promise.all([De.getProject(),De.getConfigs(),De.getRegistry(),De.getRules(),De.getCommands(),De.getTemplates()]);m(Ce),a(Ee),h(Ke),d(ze),S(Ge),b(Ye),Ee.length>0&&!v&&y(Ee[Ee.length-1])}catch(Ce){le.error("Failed to load data: "+Ce.message)}finally{o(!1)}},[v]),ne=C.useCallback(async(Ce=!1)=>{var Ee;try{const Ke=await De.getProjects();L(Ke.projects||[]);const ze=(Ee=Ke.projects)==null?void 0:Ee.find(Ge=>Ge.isActive);if(Z(ze||null),Ce&&ze){const Ge=await De.getSubprojects(ze.path);U({dir:ze.path,subprojects:Ge.subprojects||[]})}Ce&&!ze&&(qy("currentView",null)||t("projects"))}catch{console.log("Projects API not available")}},[]),te=async Ce=>{try{const Ee=await De.setActiveProject(Ce);Ee.success?(m({dir:Ee.dir,hierarchy:Ee.hierarchy,subprojects:Ee.subprojects}),U({dir:Ee.dir,subprojects:Ee.subprojects}),Z(Ee.project),L(Ke=>Ke.map(ze=>({...ze,isActive:ze.id===Ce}))),await O(),le.success(`Switched to ${Ee.project.name}`)):le.error(Ee.error||"Failed to switch project")}catch(Ee){le.error("Failed to switch project: "+Ee.message)}},X=Ce=>{L(Ee=>[...Ee,{...Ce,exists:!0,hasClaudeConfig:!1}])};C.useEffect(()=>{O(),ne(!0),De.checkVersion().then(Ce=>{G(Ce==null?void 0:Ce.installedVersion),Ce!=null&&Ce.updateAvailable&&q(Ce)}).catch(()=>{})},[]);const re=async()=>{if(K!=null&&K.updateAvailable){M(!0);try{const Ce=await De.performUpdate({updateMethod:K.updateMethod,sourcePath:K.sourcePath});Ce.success?(le.success(`Updated to v${Ce.newVersion}! Reloading...`),setTimeout(()=>window.location.reload(),1500)):(le.error("Update failed: "+Ce.error),M(!1))}catch(Ce){le.error("Update failed: "+Ce.message),M(!1)}}};C.useEffect(()=>{const Ce=async()=>{try{const{hashes:Ke}=await De.getFileHashes(),ze=W;(Object.keys(Ke).some(Ye=>ze[Ye]!==Ke[Ye])||Object.keys(ze).some(Ye=>!Ke[Ye]))&&Object.keys(ze).length>0&&(le.info("Files changed externally, reloading..."),await O()),$(Ke)}catch{}},Ee=setInterval(Ce,2e3);return Ce(),()=>clearInterval(Ee)},[W,O]);const ve=new Set;f.forEach(Ce=>{var Ee,Ke;(((Ee=Ce.config)==null?void 0:Ee.include)||[]).forEach(ze=>ve.add(ze)),Object.keys(((Ke=Ce.config)==null?void 0:Ke.mcpServers)||{}).forEach(ze=>ve.add(ze))});const he={mcps:ve.size,rules:g.length,commands:_.length},de=async()=>{try{const Ce=await De.applyConfig(l.dir);if(Ce.tools){const Ee=Object.entries(Ce.tools).filter(([,Ke])=>Ke).map(([Ke])=>Ke==="claude"?"Claude Code":"Antigravity");Ee.length>0?le.success(`Config applied to: ${Ee.join(", ")}`):le.warning("No tools were updated")}else le.success("Configuration applied successfully!")}catch(Ce){le.error("Failed to apply config: "+Ce.message)}},Ae=async()=>{o(!0),await O(),le.success("Data refreshed")};if(s)return i.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:i.jsxs("div",{className:"flex flex-col items-center gap-4",children:[i.jsx(ft,{className:"w-8 h-8 animate-spin text-primary"}),i.jsx("p",{className:"text-muted-foreground",children:"Loading configuration..."})]})});const _e=()=>{switch(e){case"explorer":return i.jsx(FO,{project:l,onRefresh:O});case"registry":return i.jsx(PI,{registry:c,searchQuery:E,setSearchQuery:D,onUpdate:O});case"memory":return i.jsx(RI,{project:l,onUpdate:O});case"templates":return i.jsx(oI,{templates:j,project:l,onApply:O});case"create-mcp":return i.jsx(iI,{project:l});case"claude-settings":return i.jsx(XO,{});case"gemini-settings":return i.jsx(JO,{});case"preferences":return i.jsx(YO,{});case"projects":return i.jsx(TI,{onProjectSwitch:Ce=>{m({dir:Ce.dir,hierarchy:Ce.hierarchy,subprojects:Ce.subprojects}),U({dir:Ce.dir,subprojects:Ce.subprojects}),O(),ne()}});case"docs":return i.jsx(DI,{});default:return null}};return i.jsxs("div",{className:"min-h-screen bg-background",children:[i.jsx("header",{className:"h-16 bg-card border-b border-border sticky top-0 z-50 shadow-sm",children:i.jsxs("div",{className:"h-full px-6 flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.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:i.jsx(Kn,{className:"w-5 h-5 text-white"})}),i.jsx("div",{children:i.jsxs("h1",{className:"text-xl font-bold text-foreground",children:["Claude ",i.jsx("span",{className:"text-primary",children:"Config"}),J&&i.jsxs("span",{className:"text-xs font-normal text-muted-foreground ml-2",children:["v",J]})]})}),K&&i.jsxs("button",{onClick:re,disabled:z,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:[z?i.jsx(ft,{className:"w-3 h-3 animate-spin"}):i.jsx($c,{className:"w-3 h-3"}),z?"Updating...":`Update to v${K.sourceVersion}`]})]}),i.jsx(Z1,{orientation:"vertical",className:"h-6"}),i.jsx(HO,{projects:B,activeProject:V,onSwitch:te,onAddClick:()=>ce(!0),onManageClick:()=>t("projects")})]}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(zO,{}),i.jsx(pe,{variant:"ghost",size:"sm",onClick:Ae,children:i.jsx(pr,{className:"w-4 h-4"})}),i.jsxs(pe,{onClick:de,className:"bg-indigo-600 hover:bg-indigo-700 text-white gap-2 shadow-md",children:[i.jsx(RT,{className:"w-4 h-4"}),"Apply Config"]})]})]})}),i.jsxs("div",{className:"flex",children:[i.jsx("aside",{className:"w-64 h-[calc(100vh-64px)] border-r border-border bg-card sticky top-16",children:i.jsx(ei,{className:"h-full py-4",children:["Projects","Configuration","Tools","Developer","System","Help"].map(Ce=>i.jsxs("div",{className:"mb-6",children:[i.jsx("h3",{className:"px-4 mb-2 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:Ce}),i.jsx("div",{className:"space-y-0.5",children:OI.filter(Ee=>Ee.section===Ce).map(Ee=>{const Ke=Ee.icon,ze=e===Ee.id;return i.jsxs("button",{onClick:()=>t(Ee.id),className:`w-full flex items-center gap-3 px-4 py-2.5 text-sm transition-all duration-200 border-l-2 ${ze?"bg-accent border-primary text-primary font-medium":"border-transparent text-muted-foreground hover:text-foreground hover:bg-accent"}`,children:[i.jsx(Ke,{className:"w-4 h-4"}),i.jsx("span",{className:"flex-1 text-left",children:Ee.label}),Ee.badge&&i.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full font-medium ${ze?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground"}`,children:he[Ee.badge]})]},Ee.id)})})]},Ce))})}),i.jsx("main",{className:be("flex-1 overflow-auto",e==="explorer"||e==="docs"?"h-[calc(100vh-64px)]":"p-6"),children:i.jsx(Zy,{mode:"wait",children:i.jsx(Ii.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},className:e==="explorer"||e==="docs"?"h-full":"",children:_e()},e)})})]}),i.jsx(Y1,{open:se,onOpenChange:ce,onAdded:X})]})}function FI(){const[e,t]=C.useState(!1),[s,o]=C.useState(!1),[l,m]=C.useState(!1),f=C.useCallback(async()=>{o(!0);try{await De.restartServer(),le.info("Server restarting... page will reload."),setTimeout(()=>{window.location.reload()},2e3)}catch(c){le.error("Failed to restart: "+c.message),o(!1)}},[]),a=C.useCallback(()=>{m(!0),t(!1),le.dismiss("update-available")},[]);return C.useEffect(()=>{let c;const h=async()=>{try{const g=await De.getVersion();console.log("[Update Check]",g),g.needsRestart&&!l&&t(!0)}catch{}};return h(),c=setInterval(h,3e4),()=>clearInterval(c)},[l]),i.jsx($O,{children:i.jsxs("div",{className:"min-h-screen bg-background",children:[e&&!s&&i.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:f,children:[i.jsx(pr,{className:"w-4 h-4"}),i.jsx("span",{className:"text-sm font-medium",children:"Update available — click to restart"}),i.jsx("button",{onClick:c=>{c.stopPropagation(),a()},className:"absolute right-3 p-1 hover:bg-blue-500 rounded",children:i.jsx(ip,{className:"w-4 h-4"})})]}),s&&i.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:[i.jsx(pr,{className:"w-4 h-4 animate-spin"}),i.jsx("span",{className:"text-sm font-medium",children:"Restarting server..."})]}),i.jsx(BI,{}),i.jsx(G2,{position:"bottom-right",richColors:!0})]})})}_2.createRoot(document.getElementById("root")).render(i.jsx(FI,{}));
@@ -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-D0Lxa6Bv.js"></script>
22
+ <script type="module" crossorigin src="/assets/index-BIp0Gwws.js"></script>
23
23
  <link rel="stylesheet" crossorigin href="/assets/index-BEcfwDlR.css">
24
24
  </head>
25
25
  <body>
package/ui/dist/sw.js CHANGED
@@ -1,54 +1,24 @@
1
1
  // Service Worker for Claude Config PWA
2
- const CACHE_NAME = 'claude-config-v1';
3
- const OFFLINE_URL = '/';
2
+ // Minimal SW - no caching, just enables PWA install
4
3
 
5
- // Install event - cache basic resources
6
- self.addEventListener('install', (event) => {
7
- event.waitUntil(
8
- caches.open(CACHE_NAME).then((cache) => {
9
- return cache.addAll([OFFLINE_URL]);
10
- })
11
- );
4
+ // Install - skip waiting to activate immediately
5
+ self.addEventListener('install', () => {
12
6
  self.skipWaiting();
13
7
  });
14
8
 
15
- // Activate event - clean up old caches
9
+ // Activate - claim clients and clear any old caches
16
10
  self.addEventListener('activate', (event) => {
17
11
  event.waitUntil(
18
12
  caches.keys().then((cacheNames) => {
19
13
  return Promise.all(
20
- cacheNames
21
- .filter((cacheName) => cacheName !== CACHE_NAME)
22
- .map((cacheName) => caches.delete(cacheName))
14
+ cacheNames.map((cacheName) => caches.delete(cacheName))
23
15
  );
24
- })
16
+ }).then(() => self.clients.claim())
25
17
  );
26
- self.clients.claim();
27
18
  });
28
19
 
29
- // Fetch event - network first, fallback to cache
30
- self.addEventListener('fetch', (event) => {
31
- // Only handle GET requests
32
- if (event.request.method !== 'GET') return;
33
-
34
- // Skip API calls - we want those to always go to network
35
- if (event.request.url.includes('/api/')) return;
36
-
37
- event.respondWith(
38
- fetch(event.request)
39
- .then((response) => {
40
- // Clone the response to cache it
41
- const responseClone = response.clone();
42
- caches.open(CACHE_NAME).then((cache) => {
43
- cache.put(event.request, responseClone);
44
- });
45
- return response;
46
- })
47
- .catch(() => {
48
- // Network failed, try cache
49
- return caches.match(event.request).then((cachedResponse) => {
50
- return cachedResponse || caches.match(OFFLINE_URL);
51
- });
52
- })
53
- );
20
+ // Fetch - always use network, no caching
21
+ self.addEventListener('fetch', () => {
22
+ // Let all requests pass through to network
23
+ return;
54
24
  });