@regression-io/claude-config 0.23.15 → 0.23.17
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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@regression-io/claude-config",
|
|
3
|
-
"version": "0.23.
|
|
3
|
+
"version": "0.23.17",
|
|
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",
|
package/shared/mcp-registry.json
CHANGED
|
@@ -10,17 +10,6 @@
|
|
|
10
10
|
"GITHUB_TOKEN": "${GITHUB_TOKEN}"
|
|
11
11
|
}
|
|
12
12
|
},
|
|
13
|
-
"gitlab": {
|
|
14
|
-
"command": "npx",
|
|
15
|
-
"args": [
|
|
16
|
-
"-y",
|
|
17
|
-
"@modelcontextprotocol/server-gitlab"
|
|
18
|
-
],
|
|
19
|
-
"env": {
|
|
20
|
-
"GITLAB_TOKEN": "${GITLAB_TOKEN}",
|
|
21
|
-
"GITLAB_URL": "${GITLAB_URL}"
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
13
|
"slack": {
|
|
25
14
|
"command": "npx",
|
|
26
15
|
"args": [
|
|
@@ -32,26 +21,6 @@
|
|
|
32
21
|
"SLACK_TEAM_ID": "${SLACK_TEAM_ID}"
|
|
33
22
|
}
|
|
34
23
|
},
|
|
35
|
-
"postgres": {
|
|
36
|
-
"command": "npx",
|
|
37
|
-
"args": [
|
|
38
|
-
"-y",
|
|
39
|
-
"@modelcontextprotocol/server-postgres"
|
|
40
|
-
],
|
|
41
|
-
"env": {
|
|
42
|
-
"DATABASE_URL": "${DATABASE_URL}"
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
"sqlite": {
|
|
46
|
-
"command": "npx",
|
|
47
|
-
"args": [
|
|
48
|
-
"-y",
|
|
49
|
-
"@modelcontextprotocol/server-sqlite"
|
|
50
|
-
],
|
|
51
|
-
"env": {
|
|
52
|
-
"SQLITE_PATH": "${SQLITE_PATH}"
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
24
|
"filesystem": {
|
|
56
25
|
"command": "npx",
|
|
57
26
|
"args": [
|
|
@@ -67,23 +36,6 @@
|
|
|
67
36
|
"@modelcontextprotocol/server-memory"
|
|
68
37
|
]
|
|
69
38
|
},
|
|
70
|
-
"puppeteer": {
|
|
71
|
-
"command": "npx",
|
|
72
|
-
"args": [
|
|
73
|
-
"-y",
|
|
74
|
-
"@modelcontextprotocol/server-puppeteer"
|
|
75
|
-
]
|
|
76
|
-
},
|
|
77
|
-
"brave-search": {
|
|
78
|
-
"command": "npx",
|
|
79
|
-
"args": [
|
|
80
|
-
"-y",
|
|
81
|
-
"@modelcontextprotocol/server-brave-search"
|
|
82
|
-
],
|
|
83
|
-
"env": {
|
|
84
|
-
"BRAVE_API_KEY": "${BRAVE_API_KEY}"
|
|
85
|
-
}
|
|
86
|
-
},
|
|
87
39
|
"fetch": {
|
|
88
40
|
"command": "npx",
|
|
89
41
|
"args": [
|
|
@@ -1722,4 +1722,4 @@ When reporting issues, include:
|
|
|
1722
1722
|
- Operating system
|
|
1723
1723
|
- Error messages or logs
|
|
1724
1724
|
`}};function VI(){const[e,t]=C.useState("installation"),[s,o]=C.useState({"getting-started":!0}),l=f=>{o(a=>({...a,[f]:!a[f]}))},m=HI[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(Yn,{className:"w-5 h-5"}),"Documentation"]})}),i.jsx(ii,{className:"flex-1",children:i.jsx("div",{className:"p-2",children:$I.map(f=>i.jsxs("div",{className:"mb-1",children:[i.jsxs("button",{className:Se("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(so,{className:Se("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:Se("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(ii,{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:zI(m.content)}})}):i.jsxs("div",{className:"text-center text-muted-foreground py-12",children:[i.jsx(Yn,{className:"w-12 h-12 mx-auto mb-4 opacity-50"}),i.jsx("p",{children:"Select a topic from the sidebar"})]})})})})]})}function zI(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,"<").replace(/>/g,">").trim()}</code></pre>`);return t=t.replace(/(\|[^\n]+\|\n\|[-| :]+\|\n(?:\|[^\n]+\|\n?)+)/g,s=>{const o=s.trim().split(`
|
|
1725
|
-
`);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 Qy={mcp:Jn,lsp:Xn,tools:va,default:va},Zy={mcp:"text-blue-600 bg-blue-50 border-blue-200 dark:text-blue-400 dark:bg-blue-950/30 dark:border-blue-800",lsp:"text-purple-600 bg-purple-50 border-purple-200 dark:text-purple-400 dark:bg-purple-950/30 dark:border-purple-800",tools:"text-green-600 bg-green-50 border-green-200 dark:text-green-400 dark:bg-green-950/30 dark:border-green-800",default:"text-gray-600 bg-gray-50 border-gray-200 dark:text-gray-400 dark:bg-gray-800 dark:border-gray-700"};function UI(){const[e,t]=C.useState(!0),[s,o]=C.useState({installed:{},marketplaces:[]}),[l,m]=C.useState(""),[f,a]=C.useState("all"),[c,h]=C.useState(null),[g,u]=C.useState(null),[_,S]=C.useState(null),[j,w]=C.useState({open:!1,name:"",repo:""}),v=async()=>{t(!0);try{const O=await we.getPlugins();o(O)}catch(O){ie.error("Failed to load plugins: "+O.message)}finally{t(!1)}};C.useEffect(()=>{v()},[]);const y=()=>{var U;const O=[],K=[];if(s.installed)for(const[G,X]of Object.entries(s.installed)){const[z,M]=G.split("@");O.push({id:G,name:z,marketplace:M,isInstalled:!0,installedInfo:X})}if(s.marketplaces){for(const G of s.marketplaces)if(G.plugins)for(const X of G.plugins){const z=`${X.name}@${G.name}`;if(!!!((U=s.installed)!=null&&U[z]))K.push({...X,id:z,marketplace:G.name,isInstalled:!1});else{const B=O.find(L=>L.id===z);B&&Object.assign(B,X)}}}return{installed:O,available:K}},p=()=>{const{installed:O,available:K}=y();let U=[];if((f==="installed"||f==="all")&&(U=[...U,...O]),(f==="available"||f==="all")&&(U=[...U,...K]),l){const G=l.toLowerCase();U=U.filter(X=>{var z,M,B;return((z=X.name)==null?void 0:z.toLowerCase().includes(G))||((M=X.description)==null?void 0:M.toLowerCase().includes(G))||((B=X.category)==null?void 0:B.toLowerCase().includes(G))})}return U},x=async O=>{h(O.id);try{const K=await we.installPlugin(O.id,O.marketplace);K.success?(ie.success(`Installed ${O.name}`),await v()):ie.error(K.error||"Failed to install plugin")}catch(K){ie.error("Failed to install: "+K.message)}finally{h(null)}},k=async O=>{u(O.id);try{const K=await we.uninstallPlugin(O.id);K.success?(ie.success(`Uninstalled ${O.name}`),await v()):ie.error(K.error||"Failed to uninstall plugin")}catch(K){ie.error("Failed to uninstall: "+K.message)}finally{u(null)}},R=async O=>{S(O);try{const K=await we.refreshMarketplace(O);K.success?(ie.success(`Refreshed ${O}`),await v()):ie.error(K.error||"Failed to refresh marketplace")}catch(K){ie.error("Failed to refresh: "+K.message)}finally{S(null)}},T=async()=>{if(!j.name.trim()||!j.repo.trim()){ie.error("Please enter both name and repository URL");return}try{const O=await we.addMarketplace(j.name.trim(),j.repo.trim());O.success?(ie.success(`Added marketplace: ${j.name}`),w({open:!1,name:"",repo:""}),await v()):ie.error(O.error||"Failed to add marketplace")}catch(O){ie.error("Failed to add marketplace: "+O.message)}},P=p(),{installed:E,available:D}=y(),V=E.length,H=D.length,W=s.marketplaces||[];return e?i.jsx("div",{className:"flex items-center justify-center h-64",children:i.jsx(lt,{className:"w-8 h-8 animate-spin text-primary"})}):i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"bg-white dark:bg-slate-950 rounded-xl border border-gray-200 dark:border-slate-800 overflow-hidden shadow-sm",children:[i.jsxs("div",{className:"p-5 border-b border-gray-200 dark:border-slate-700",children:[i.jsxs("div",{className:"flex items-center justify-between mb-4",children:[i.jsxs("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white flex items-center gap-2",children:[i.jsx(va,{className:"w-5 h-5 text-indigo-600"}),"Claude Code Plugins"]}),i.jsx(ue,{variant:"ghost",size:"sm",onClick:v,disabled:e,children:i.jsx(nr,{className:`w-4 h-4 ${e?"animate-spin":""}`})})]}),i.jsxs("div",{className:"flex gap-2 mb-4",children:[i.jsxs(ue,{variant:f==="all"?"default":"outline",size:"sm",onClick:()=>a("all"),className:f==="all"?"bg-indigo-600":"",children:[i.jsx(va,{className:"w-4 h-4 mr-2"}),"All (",V+H,")"]}),i.jsxs(ue,{variant:f==="installed"?"default":"outline",size:"sm",onClick:()=>a("installed"),className:f==="installed"?"bg-green-600":"",children:[i.jsx(dr,{className:"w-4 h-4 mr-2"}),"Installed (",V,")"]}),i.jsxs(ue,{variant:f==="available"?"default":"outline",size:"sm",onClick:()=>a("available"),className:f==="available"?"bg-blue-600":"",children:[i.jsx(Jl,{className:"w-4 h-4 mr-2"}),"Available (",H>0?H:0,")"]})]}),i.jsxs("div",{className:"relative",children:[i.jsx(Kc,{className:"w-4 h-4 absolute left-3 top-1/2 -translate-y-1/2 text-gray-400"}),i.jsx(et,{value:l,onChange:O=>m(O.target.value),placeholder:"Search plugins...",className:"pl-9 bg-white dark:bg-slate-900 border-gray-300 dark:border-slate-700"})]})]}),i.jsxs("div",{className:"p-4 grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[P.map((O,K)=>{var M,B,L,$;const U=Qy[O.category]||Qy.default,G=Zy[O.category]||Zy.default,X=c===O.id,z=g===O.id;return i.jsxs(pn.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:K*.03},className:`rounded-lg border p-4 hover:shadow-md transition-all group ${O.isInstalled?"bg-green-50 border-green-200 dark:bg-green-950/20 dark:border-green-800":"bg-white border-gray-200 dark:bg-slate-900 dark:border-slate-700"}`,children:[i.jsxs("div",{className:"flex items-center justify-between mb-2",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("h3",{className:"font-semibold text-gray-900 dark:text-white",children:O.name}),O.isInstalled&&i.jsxs(it,{variant:"outline",className:"text-green-600 border-green-300 dark:text-green-400 dark:border-green-700",children:[i.jsx(dr,{className:"w-3 h-3 mr-1"}),"Installed"]})]}),i.jsxs(fo,{children:[i.jsx(po,{asChild:!0,children:i.jsx(ue,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 opacity-0 group-hover:opacity-100",children:i.jsx(np,{className:"w-4 h-4 text-gray-400"})})}),i.jsxs(ci,{children:[O.isInstalled?i.jsxs(nt,{className:"text-red-600",onClick:()=>k(O),disabled:z,children:[z?i.jsx(lt,{className:"w-4 h-4 mr-2 animate-spin"}):i.jsx(Is,{className:"w-4 h-4 mr-2"}),"Uninstall"]}):i.jsxs(nt,{onClick:()=>x(O),disabled:X,children:[X?i.jsx(lt,{className:"w-4 h-4 mr-2 animate-spin"}):i.jsx(xt,{className:"w-4 h-4 mr-2"}),"Install"]}),O.url&&i.jsxs(nt,{onClick:()=>window.open(O.url,"_blank"),children:[i.jsx(cc,{className:"w-4 h-4 mr-2"}),"View Source"]})]})]})]}),i.jsx("p",{className:"text-sm text-gray-600 dark:text-slate-400 mb-3 line-clamp-2",children:O.description||"No description available"}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[O.category&&i.jsxs(it,{variant:"outline",className:G,children:[i.jsx(U,{className:"w-3 h-3 mr-1"}),O.category]}),O.version&&i.jsxs("span",{className:"text-xs text-gray-500 dark:text-slate-500",children:["v",O.version]})]}),O.marketplace&&i.jsx("span",{className:"text-xs text-gray-400 dark:text-slate-500",children:O.marketplace})]}),(((M=O.mcpServers)==null?void 0:M.length)>0||((B=O.lspServers)==null?void 0:B.length)>0)&&i.jsx("div",{className:"mt-3 pt-3 border-t border-gray-100 dark:border-slate-800",children:i.jsxs("div",{className:"flex items-center gap-3 text-xs text-gray-500 dark:text-slate-500",children:[((L=O.mcpServers)==null?void 0:L.length)>0&&i.jsxs("span",{className:"flex items-center gap-1",children:[i.jsx(Jn,{className:"w-3 h-3"}),O.mcpServers.length," MCP"]}),(($=O.lspServers)==null?void 0:$.length)>0&&i.jsxs("span",{className:"flex items-center gap-1",children:[i.jsx(Xn,{className:"w-3 h-3"}),O.lspServers.length," LSP"]})]})}),!O.isInstalled&&i.jsxs(ue,{size:"sm",onClick:()=>x(O),disabled:X,className:"w-full mt-3 bg-indigo-600 hover:bg-indigo-700 text-white",children:[X?i.jsx(lt,{className:"w-4 h-4 mr-2 animate-spin"}):i.jsx(xt,{className:"w-4 h-4 mr-2"}),"Install"]})]},O.id||`${O.name}-${K}`)}),P.length===0&&i.jsx("div",{className:"col-span-full text-center py-8 text-gray-500 dark:text-slate-400",children:l?"No plugins match your search.":f==="installed"?"No plugins installed yet.":"No plugins available. Add a marketplace to discover plugins."})]})]}),i.jsxs("div",{className:"bg-white dark:bg-slate-950 rounded-xl border border-gray-200 dark:border-slate-800 overflow-hidden shadow-sm",children:[i.jsx("div",{className:"p-5 border-b border-gray-200 dark:border-slate-700",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white flex items-center gap-2",children:[i.jsx(Jl,{className:"w-5 h-5 text-purple-600"}),"Plugin Marketplaces"]}),i.jsxs(ue,{variant:"outline",size:"sm",onClick:()=>w({open:!0,name:"",repo:""}),className:"border-purple-300 dark:border-purple-700 text-purple-700 dark:text-purple-400 hover:bg-purple-50 dark:hover:bg-purple-950/30",children:[i.jsx(xt,{className:"w-4 h-4 mr-2"}),"Add Marketplace"]})]})}),i.jsx("div",{className:"p-4",children:W.length>0?i.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:W.map((O,K)=>{var U;return i.jsxs(pn.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:K*.03},className:"bg-purple-50 dark:bg-purple-950/20 rounded-lg border border-purple-200 dark:border-purple-800 p-4",children:[i.jsxs("div",{className:"flex items-center justify-between mb-2",children:[i.jsx("h3",{className:"font-semibold text-purple-900 dark:text-purple-200",children:O.name}),i.jsx(ue,{variant:"ghost",size:"sm",onClick:()=>R(O.name),disabled:_===O.name,className:"h-7 w-7 p-0",children:i.jsx(nr,{className:`w-4 h-4 text-purple-600 dark:text-purple-400 ${_===O.name?"animate-spin":""}`})})]}),i.jsx("p",{className:"text-sm text-purple-700 dark:text-purple-300 mb-2 truncate",children:O.source}),i.jsxs("div",{className:"flex items-center justify-between text-xs text-purple-600 dark:text-purple-400",children:[i.jsxs("span",{children:[((U=O.plugins)==null?void 0:U.length)||0," plugins"]}),O.lastUpdated&&i.jsxs("span",{children:["Updated: ",new Date(O.lastUpdated).toLocaleDateString()]})]})]},O.name)})}):i.jsxs("div",{className:"text-center py-8 text-gray-500 dark:text-slate-400",children:[i.jsx(Jl,{className:"w-12 h-12 mx-auto mb-3 opacity-30"}),i.jsx("p",{children:"No marketplaces configured."}),i.jsx("p",{className:"text-sm mt-1",children:"Add a marketplace to discover plugins."})]})})]}),i.jsx(ir,{open:j.open,onOpenChange:O=>w({...j,open:O}),children:i.jsxs(Kt,{className:"max-w-lg",children:[i.jsxs(Gt,{children:[i.jsxs(Yt,{className:"flex items-center gap-2",children:[i.jsx(Jl,{className:"w-5 h-5 text-purple-600"}),"Add Plugin Marketplace"]}),i.jsx(br,{children:"Add a new plugin marketplace repository. Marketplaces are Git repositories containing plugin definitions."})]}),i.jsxs("div",{className:"space-y-4 py-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Marketplace Name"}),i.jsx(et,{value:j.name,onChange:O=>w({...j,name:O.target.value}),placeholder:"my-plugins",className:"mt-1"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Repository URL"}),i.jsx(et,{value:j.repo,onChange:O=>w({...j,repo:O.target.value}),placeholder:"https://github.com/user/claude-plugins",className:"mt-1"}),i.jsxs("p",{className:"text-xs text-gray-500 dark:text-slate-400 mt-1",children:["The repository should contain a ",i.jsx("code",{className:"bg-gray-100 dark:bg-slate-700 px-1 rounded",children:".claude-plugin/marketplace.json"})," manifest"]})]})]}),i.jsxs(qt,{children:[i.jsx(ue,{variant:"ghost",onClick:()=>w({open:!1,name:"",repo:""}),children:"Cancel"}),i.jsxs(ue,{onClick:T,className:"bg-purple-600 hover:bg-purple-700 text-white",children:[i.jsx(xt,{className:"w-4 h-4 mr-2"}),"Add Marketplace"]})]})]})})]})}const WI=[{id:"projects",label:"All Projects",icon:$_,section:"Projects"},{id:"explorer",label:"Project Explorer",icon:_n,section:"Projects"},{id:"registry",label:"MCP Registry",icon:Xn,section:"Configuration"},{id:"plugins",label:"Plugins",icon:va,section:"Configuration"},{id:"memory",label:"Memory",icon:Yi,section:"Configuration"},{id:"claude-settings",label:"Claude Code",icon:Pa,section:"Configuration"},{id:"gemini-settings",label:"Gemini CLI",icon:Nt,section:"Configuration"},{id:"templates",label:"Templates",icon:no,section:"Tools"},{id:"create-mcp",label:"Create MCP",icon:Ts,section:"Developer"},{id:"preferences",label:"Preferences",icon:U_,section:"System"},{id:"docs",label:"Docs & Help",icon:Yn,section:"Help"}],ex=(e,t)=>{try{const s=localStorage.getItem(`claude-config-${e}`);return s?JSON.parse(s):t}catch{return t}},KI=(e,t)=>{try{localStorage.setItem(`claude-config-${e}`,JSON.stringify(t))}catch{}};function GI(){const[e,t]=C.useState(()=>ex("currentView","explorer")),[s,o]=C.useState(!0),[l,m]=C.useState({dir:"",subprojects:[],hierarchy:[]}),[f,a]=C.useState([]),[c,h]=C.useState({mcpServers:{}}),[g,u]=C.useState([]),[_,S]=C.useState([]),[j,w]=C.useState([]),[v,y]=C.useState(null),[p,x]=C.useState(null),[k,R]=C.useState(!1),[T,P]=C.useState({title:"",type:""}),[E,D]=C.useState(""),[V,H]=C.useState(""),[W,O]=C.useState({}),[K,U]=C.useState(null),[G,X]=C.useState(null),[z,M]=C.useState(!1),[B,L]=C.useState([]),[$,Q]=C.useState(null),[se,ce]=C.useState(!1),[de,q]=C.useState(null);C.useEffect(()=>{KI("currentView",e)},[e]);const I=C.useCallback(async()=>{try{const[Ae,Ee,Ye,Xe,Je,tt]=await Promise.all([we.getProject(),we.getConfigs(),we.getRegistry(),we.getRules(),we.getCommands(),we.getTemplates()]);m(Ae),a(Ee),h(Ye),u(Xe),S(Je),w(tt),Ee.length>0&&!v&&y(Ee[Ee.length-1])}catch(Ae){ie.error("Failed to load data: "+Ae.message)}finally{o(!1)}},[v]),ne=C.useCallback(async(Ae=!1)=>{var Ee;try{const Ye=await we.getProjects();L(Ye.projects||[]);const Xe=(Ee=Ye.projects)==null?void 0:Ee.find(Je=>Je.isActive);if(Q(Xe||null),Ae&&Xe){const Je=await we.getSubprojects(Xe.path);q({dir:Xe.path,subprojects:Je.subprojects||[]})}Ae&&!Xe&&(ex("currentView",null)||t("projects"))}catch{console.log("Projects API not available")}},[]),te=async Ae=>{try{const Ee=await we.setActiveProject(Ae);Ee.success?(m({dir:Ee.dir,hierarchy:Ee.hierarchy,subprojects:Ee.subprojects}),q({dir:Ee.dir,subprojects:Ee.subprojects}),Q(Ee.project),L(Ye=>Ye.map(Xe=>({...Xe,isActive:Xe.id===Ae}))),await I(),ie.success(`Switched to ${Ee.project.name}`)):ie.error(Ee.error||"Failed to switch project")}catch(Ee){ie.error("Failed to switch project: "+Ee.message)}},J=Ae=>{L(Ee=>[...Ee,{...Ae,exists:!0,hasClaudeConfig:!1}])};C.useEffect(()=>{I(),ne(!0),we.checkVersion().then(Ae=>{U(Ae==null?void 0:Ae.installedVersion),Ae!=null&&Ae.updateAvailable&&X(Ae)}).catch(()=>{})},[]);const re=async()=>{if(G!=null&&G.updateAvailable){M(!0);try{const Ae=await we.performUpdate({updateMethod:G.updateMethod,sourcePath:G.sourcePath});Ae.success?(ie.success(`Updated to v${Ae.newVersion}! Reloading...`),setTimeout(()=>window.location.reload(),1500)):(ie.error("Update failed: "+Ae.error),M(!1))}catch(Ae){ie.error("Update failed: "+Ae.message),M(!1)}}};C.useEffect(()=>{const Ae=async()=>{try{const{hashes:Ye}=await we.getFileHashes(),Xe=W;(Object.keys(Ye).some(tt=>Xe[tt]!==Ye[tt])||Object.keys(Xe).some(tt=>!Ye[tt]))&&Object.keys(Xe).length>0&&(ie.info("Files changed externally, reloading..."),await I()),O(Ye)}catch{}},Ee=setInterval(Ae,2e3);return Ae(),()=>clearInterval(Ee)},[W,I]);const me=new Set;f.forEach(Ae=>{var Ee,Ye;(((Ee=Ae.config)==null?void 0:Ee.include)||[]).forEach(Xe=>me.add(Xe)),Object.keys(((Ye=Ae.config)==null?void 0:Ye.mcpServers)||{}).forEach(Xe=>me.add(Xe))});const De={mcps:me.size,rules:g.length,commands:_.length},$e=async()=>{try{const Ae=await we.applyConfig(l.dir);if(Ae.tools){const Ee=Object.entries(Ae.tools).filter(([,Ye])=>Ye).map(([Ye])=>Ye==="claude"?"Claude Code":"Antigravity");Ee.length>0?ie.success(`Config applied to: ${Ee.join(", ")}`):ie.warning("No tools were updated")}else ie.success("Configuration applied successfully!")}catch(Ae){ie.error("Failed to apply config: "+Ae.message)}},Ge=async()=>{o(!0),await I(),ie.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(lt,{className:"w-8 h-8 animate-spin text-primary"}),i.jsx("p",{className:"text-muted-foreground",children:"Loading configuration..."})]})});const Ne=()=>{switch(e){case"explorer":return i.jsx(GO,{project:l,onRefresh:I});case"registry":return i.jsx(II,{registry:c,searchQuery:E,setSearchQuery:D,onUpdate:I});case"plugins":return i.jsx(UI,{});case"memory":return i.jsx(BI,{project:l,onUpdate:I});case"templates":return i.jsx(pI,{templates:j,project:l,onApply:I});case"create-mcp":return i.jsx(fI,{project:l});case"claude-settings":return i.jsx(nI,{});case"gemini-settings":return i.jsx(iI,{});case"preferences":return i.jsx(sI,{});case"projects":return i.jsx(FI,{onProjectSwitch:Ae=>{m({dir:Ae.dir,hierarchy:Ae.hierarchy,subprojects:Ae.subprojects}),q({dir:Ae.dir,subprojects:Ae.subprojects}),I(),ne()}});case"docs":return i.jsx(VI,{});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(Qn,{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"}),K&&i.jsxs("span",{className:"text-xs font-normal text-muted-foreground ml-2",children:["v",K]})]})}),G&&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(lt,{className:"w-3 h-3 animate-spin"}):i.jsx(Uc,{className:"w-3 h-3"}),z?"Updating...":`Update to v${G.sourceVersion}`]})]}),i.jsx(oC,{orientation:"vertical",className:"h-6"}),i.jsx(qO,{projects:B,activeProject:$,onSwitch:te,onAddClick:()=>ce(!0),onManageClick:()=>t("projects")})]}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(JO,{}),i.jsx(ue,{variant:"ghost",size:"sm",onClick:Ge,children:i.jsx(nr,{className:"w-4 h-4"})}),i.jsxs(ue,{onClick:$e,className:"bg-indigo-600 hover:bg-indigo-700 text-white gap-2 shadow-md",children:[i.jsx(IT,{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(ii,{className:"h-full py-4",children:["Projects","Configuration","Tools","Developer","System","Help"].map(Ae=>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:Ae}),i.jsx("div",{className:"space-y-0.5",children:WI.filter(Ee=>Ee.section===Ae).map(Ee=>{const Ye=Ee.icon,Xe=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 ${Xe?"bg-accent border-primary text-primary font-medium":"border-transparent text-muted-foreground hover:text-foreground hover:bg-accent"}`,children:[i.jsx(Ye,{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 ${Xe?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground"}`,children:De[Ee.badge]})]},Ee.id)})})]},Ae))})}),i.jsx("main",{className:Se("flex-1 overflow-auto",e==="explorer"||e==="docs"?"h-[calc(100vh-64px)]":"p-6"),children:i.jsx(ix,{mode:"wait",children:i.jsx(pn.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:Ne()},e)})})]}),i.jsx(rC,{open:se,onOpenChange:ce,onAdded:J})]})}function qI(){const[e,t]=C.useState(!1),[s,o]=C.useState(!1),[l,m]=C.useState(!1),f=C.useCallback(async()=>{o(!0);try{await we.restartServer(),ie.info("Server restarting... page will reload."),setTimeout(()=>{window.location.reload()},2e3)}catch(c){ie.error("Failed to restart: "+c.message),o(!1)}},[]),a=C.useCallback(()=>{m(!0),t(!1),ie.dismiss("update-available")},[]);return C.useEffect(()=>{let c;const h=async()=>{try{const g=await we.getVersion();console.log("[Update Check]",g),g.needsRestart&&!l&&t(!0)}catch{}};return h(),c=setInterval(h,3e4),()=>clearInterval(c)},[l]),i.jsx(YO,{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(nr,{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(lp,{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(nr,{className:"w-4 h-4 animate-spin"}),i.jsx("span",{className:"text-sm font-medium",children:"Restarting server..."})]}),i.jsx(GI,{}),i.jsx(ej,{position:"bottom-right",richColors:!0})]})})}E2.createRoot(document.getElementById("root")).render(i.jsx(qI,{}));
|
|
1725
|
+
`);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 Qy={mcp:Jn,lsp:Xn,tools:va,default:va},Zy={mcp:"text-blue-600 bg-blue-50 border-blue-200 dark:text-blue-400 dark:bg-blue-950/30 dark:border-blue-800",lsp:"text-purple-600 bg-purple-50 border-purple-200 dark:text-purple-400 dark:bg-purple-950/30 dark:border-purple-800",tools:"text-green-600 bg-green-50 border-green-200 dark:text-green-400 dark:bg-green-950/30 dark:border-green-800",default:"text-gray-600 bg-gray-50 border-gray-200 dark:text-gray-400 dark:bg-gray-800 dark:border-gray-700"};function UI(){const[e,t]=C.useState(!0),[s,o]=C.useState({installed:{},marketplaces:[]}),[l,m]=C.useState(""),[f,a]=C.useState("all"),[c,h]=C.useState(null),[g,u]=C.useState(null),[_,S]=C.useState(null),[j,w]=C.useState({open:!1,name:"",repo:""}),v=async()=>{t(!0);try{const O=await we.getPlugins();o(O)}catch(O){ie.error("Failed to load plugins: "+O.message)}finally{t(!1)}};C.useEffect(()=>{v()},[]);const y=()=>{var U;const O=[],K=[];if(s.installed)for(const[G,X]of Object.entries(s.installed)){const[z,M]=G.split("@");O.push({id:G,name:z,marketplace:M,isInstalled:!0,installedInfo:X})}if(s.marketplaces){for(const G of s.marketplaces)if(G.plugins)for(const X of G.plugins){const z=`${X.name}@${G.name}`;if(!!!((U=s.installed)!=null&&U[z]))K.push({...X,id:z,marketplace:G.name,isInstalled:!1});else{const B=O.find(L=>L.id===z);B&&Object.assign(B,X)}}}return{installed:O,available:K}},p=()=>{const{installed:O,available:K}=y();let U=[];if((f==="installed"||f==="all")&&(U=[...U,...O]),(f==="available"||f==="all")&&(U=[...U,...K]),l){const G=l.toLowerCase();U=U.filter(X=>{var z,M,B;return((z=X.name)==null?void 0:z.toLowerCase().includes(G))||((M=X.description)==null?void 0:M.toLowerCase().includes(G))||((B=X.category)==null?void 0:B.toLowerCase().includes(G))})}return U},x=async O=>{h(O.id);try{const K=await we.installPlugin(O.id,O.marketplace);K.success?(ie.success(`Installed ${O.name}`),await v()):ie.error(K.error||"Failed to install plugin")}catch(K){ie.error("Failed to install: "+K.message)}finally{h(null)}},k=async O=>{u(O.id);try{const K=await we.uninstallPlugin(O.id);K.success?(ie.success(`Uninstalled ${O.name}`),await v()):ie.error(K.error||"Failed to uninstall plugin")}catch(K){ie.error("Failed to uninstall: "+K.message)}finally{u(null)}},R=async O=>{S(O);try{const K=await we.refreshMarketplace(O);K.success?(ie.success(`Refreshed ${O}`),await v()):ie.error(K.error||"Failed to refresh marketplace")}catch(K){ie.error("Failed to refresh: "+K.message)}finally{S(null)}},T=async()=>{if(!j.name.trim()||!j.repo.trim()){ie.error("Please enter both name and repository URL");return}try{const O=await we.addMarketplace(j.name.trim(),j.repo.trim());O.success?(ie.success(`Added marketplace: ${j.name}`),w({open:!1,name:"",repo:""}),await v()):ie.error(O.error||"Failed to add marketplace")}catch(O){ie.error("Failed to add marketplace: "+O.message)}},P=p(),{installed:E,available:D}=y(),V=E.length,H=D.length,W=s.marketplaces||[];return e?i.jsx("div",{className:"flex items-center justify-center h-64",children:i.jsx(lt,{className:"w-8 h-8 animate-spin text-primary"})}):i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"bg-white dark:bg-slate-950 rounded-xl border border-gray-200 dark:border-slate-800 overflow-hidden shadow-sm",children:[i.jsxs("div",{className:"p-5 border-b border-gray-200 dark:border-slate-700",children:[i.jsxs("div",{className:"flex items-center justify-between mb-4",children:[i.jsxs("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white flex items-center gap-2",children:[i.jsx(va,{className:"w-5 h-5 text-indigo-600"}),"Claude Code Plugins"]}),i.jsx(ue,{variant:"ghost",size:"sm",onClick:v,disabled:e,children:i.jsx(nr,{className:`w-4 h-4 ${e?"animate-spin":""}`})})]}),i.jsxs("div",{className:"flex gap-2 mb-4",children:[i.jsxs(ue,{variant:f==="all"?"default":"outline",size:"sm",onClick:()=>a("all"),className:f==="all"?"bg-indigo-600":"",children:[i.jsx(va,{className:"w-4 h-4 mr-2"}),"All (",V+H,")"]}),i.jsxs(ue,{variant:f==="installed"?"default":"outline",size:"sm",onClick:()=>a("installed"),className:f==="installed"?"bg-green-600":"",children:[i.jsx(dr,{className:"w-4 h-4 mr-2"}),"Installed (",V,")"]}),i.jsxs(ue,{variant:f==="available"?"default":"outline",size:"sm",onClick:()=>a("available"),className:f==="available"?"bg-blue-600":"",children:[i.jsx(Jl,{className:"w-4 h-4 mr-2"}),"Available (",H>0?H:0,")"]})]}),i.jsxs("div",{className:"relative",children:[i.jsx(Kc,{className:"w-4 h-4 absolute left-3 top-1/2 -translate-y-1/2 text-gray-400"}),i.jsx(et,{value:l,onChange:O=>m(O.target.value),placeholder:"Search plugins...",className:"pl-9 bg-white dark:bg-slate-900 border-gray-300 dark:border-slate-700"})]})]}),i.jsxs("div",{className:"p-4 grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[P.map((O,K)=>{var M,B,L,$;const U=Qy[O.category]||Qy.default,G=Zy[O.category]||Zy.default,X=c===O.id,z=g===O.id;return i.jsxs(pn.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:K*.03},className:`rounded-lg border p-4 hover:shadow-md transition-all group ${O.isInstalled?"bg-green-50 border-green-200 dark:bg-green-950/20 dark:border-green-800":"bg-white border-gray-200 dark:bg-slate-900 dark:border-slate-700"}`,children:[i.jsxs("div",{className:"flex items-center justify-between mb-2",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("h3",{className:"font-semibold text-gray-900 dark:text-white",children:O.name}),O.isInstalled&&i.jsxs(it,{variant:"outline",className:"text-green-600 border-green-300 dark:text-green-400 dark:border-green-700",children:[i.jsx(dr,{className:"w-3 h-3 mr-1"}),"Installed"]})]}),i.jsxs(fo,{children:[i.jsx(po,{asChild:!0,children:i.jsx(ue,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 opacity-0 group-hover:opacity-100",children:i.jsx(np,{className:"w-4 h-4 text-gray-400"})})}),i.jsxs(ci,{children:[O.isInstalled?i.jsxs(nt,{className:"text-red-600",onClick:()=>k(O),disabled:z,children:[z?i.jsx(lt,{className:"w-4 h-4 mr-2 animate-spin"}):i.jsx(Is,{className:"w-4 h-4 mr-2"}),"Uninstall"]}):i.jsxs(nt,{onClick:()=>x(O),disabled:X,children:[X?i.jsx(lt,{className:"w-4 h-4 mr-2 animate-spin"}):i.jsx(xt,{className:"w-4 h-4 mr-2"}),"Install"]}),O.url&&i.jsxs(nt,{onClick:()=>window.open(O.url,"_blank"),children:[i.jsx(cc,{className:"w-4 h-4 mr-2"}),"View Source"]})]})]})]}),i.jsx("p",{className:"text-sm text-gray-600 dark:text-slate-400 mb-3 line-clamp-2",children:O.description||"No description available"}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[O.category&&i.jsxs(it,{variant:"outline",className:G,children:[i.jsx(U,{className:"w-3 h-3 mr-1"}),O.category]}),O.version&&i.jsxs("span",{className:"text-xs text-gray-500 dark:text-slate-500",children:["v",O.version]})]}),O.marketplace&&i.jsx("span",{className:"text-xs text-gray-400 dark:text-slate-500",children:O.marketplace})]}),(((M=O.mcpServers)==null?void 0:M.length)>0||((B=O.lspServers)==null?void 0:B.length)>0)&&i.jsx("div",{className:"mt-3 pt-3 border-t border-gray-100 dark:border-slate-800",children:i.jsxs("div",{className:"flex items-center gap-3 text-xs text-gray-500 dark:text-slate-500",children:[((L=O.mcpServers)==null?void 0:L.length)>0&&i.jsxs("span",{className:"flex items-center gap-1",children:[i.jsx(Jn,{className:"w-3 h-3"}),O.mcpServers.length," MCP"]}),(($=O.lspServers)==null?void 0:$.length)>0&&i.jsxs("span",{className:"flex items-center gap-1",children:[i.jsx(Xn,{className:"w-3 h-3"}),O.lspServers.length," LSP"]})]})}),!O.isInstalled&&i.jsxs(ue,{size:"sm",onClick:()=>x(O),disabled:X,className:"w-full mt-3 bg-indigo-600 hover:bg-indigo-700 text-white",children:[X?i.jsx(lt,{className:"w-4 h-4 mr-2 animate-spin"}):i.jsx(xt,{className:"w-4 h-4 mr-2"}),"Install"]})]},O.id||`${O.name}-${K}`)}),P.length===0&&i.jsx("div",{className:"col-span-full text-center py-8 text-gray-500 dark:text-slate-400",children:l?"No plugins match your search.":f==="installed"?"No plugins installed yet.":"No plugins available. Add a marketplace to discover plugins."})]})]}),i.jsxs("div",{className:"bg-white dark:bg-slate-950 rounded-xl border border-gray-200 dark:border-slate-800 overflow-hidden shadow-sm",children:[i.jsx("div",{className:"p-5 border-b border-gray-200 dark:border-slate-700",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white flex items-center gap-2",children:[i.jsx(Jl,{className:"w-5 h-5 text-purple-600"}),"Plugin Marketplaces"]}),i.jsxs(ue,{variant:"outline",size:"sm",onClick:()=>w({open:!0,name:"",repo:""}),className:"border-purple-300 dark:border-purple-700 text-purple-700 dark:text-purple-400 hover:bg-purple-50 dark:hover:bg-purple-950/30",children:[i.jsx(xt,{className:"w-4 h-4 mr-2"}),"Add Marketplace"]})]})}),i.jsx("div",{className:"p-4",children:W.length>0?i.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:W.map((O,K)=>{var U,G;return i.jsxs(pn.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:K*.03},className:"bg-purple-50 dark:bg-purple-950/20 rounded-lg border border-purple-200 dark:border-purple-800 p-4",children:[i.jsxs("div",{className:"flex items-center justify-between mb-2",children:[i.jsx("h3",{className:"font-semibold text-purple-900 dark:text-purple-200",children:O.name}),i.jsx(ue,{variant:"ghost",size:"sm",onClick:()=>R(O.name),disabled:_===O.name,className:"h-7 w-7 p-0",children:i.jsx(nr,{className:`w-4 h-4 text-purple-600 dark:text-purple-400 ${_===O.name?"animate-spin":""}`})})]}),i.jsx("p",{className:"text-sm text-purple-700 dark:text-purple-300 mb-2 truncate",children:typeof O.source=="string"?O.source:((U=O.source)==null?void 0:U.repo)||"Unknown source"}),i.jsxs("div",{className:"flex items-center justify-between text-xs text-purple-600 dark:text-purple-400",children:[i.jsxs("span",{children:[((G=O.plugins)==null?void 0:G.length)||0," plugins"]}),O.lastUpdated&&i.jsxs("span",{children:["Updated: ",new Date(O.lastUpdated).toLocaleDateString()]})]})]},O.name)})}):i.jsxs("div",{className:"text-center py-8 text-gray-500 dark:text-slate-400",children:[i.jsx(Jl,{className:"w-12 h-12 mx-auto mb-3 opacity-30"}),i.jsx("p",{children:"No marketplaces configured."}),i.jsx("p",{className:"text-sm mt-1",children:"Add a marketplace to discover plugins."})]})})]}),i.jsx(ir,{open:j.open,onOpenChange:O=>w({...j,open:O}),children:i.jsxs(Kt,{className:"max-w-lg",children:[i.jsxs(Gt,{children:[i.jsxs(Yt,{className:"flex items-center gap-2",children:[i.jsx(Jl,{className:"w-5 h-5 text-purple-600"}),"Add Plugin Marketplace"]}),i.jsx(br,{children:"Add a new plugin marketplace repository. Marketplaces are Git repositories containing plugin definitions."})]}),i.jsxs("div",{className:"space-y-4 py-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Marketplace Name"}),i.jsx(et,{value:j.name,onChange:O=>w({...j,name:O.target.value}),placeholder:"my-plugins",className:"mt-1"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Repository URL"}),i.jsx(et,{value:j.repo,onChange:O=>w({...j,repo:O.target.value}),placeholder:"https://github.com/user/claude-plugins",className:"mt-1"}),i.jsxs("p",{className:"text-xs text-gray-500 dark:text-slate-400 mt-1",children:["The repository should contain a ",i.jsx("code",{className:"bg-gray-100 dark:bg-slate-700 px-1 rounded",children:".claude-plugin/marketplace.json"})," manifest"]})]})]}),i.jsxs(qt,{children:[i.jsx(ue,{variant:"ghost",onClick:()=>w({open:!1,name:"",repo:""}),children:"Cancel"}),i.jsxs(ue,{onClick:T,className:"bg-purple-600 hover:bg-purple-700 text-white",children:[i.jsx(xt,{className:"w-4 h-4 mr-2"}),"Add Marketplace"]})]})]})})]})}const WI=[{id:"projects",label:"All Projects",icon:$_,section:"Projects"},{id:"explorer",label:"Project Explorer",icon:_n,section:"Projects"},{id:"registry",label:"MCP Registry",icon:Xn,section:"Configuration"},{id:"plugins",label:"Plugins",icon:va,section:"Configuration"},{id:"memory",label:"Memory",icon:Yi,section:"Configuration"},{id:"claude-settings",label:"Claude Code",icon:Pa,section:"Configuration"},{id:"gemini-settings",label:"Gemini CLI",icon:Nt,section:"Configuration"},{id:"templates",label:"Templates",icon:no,section:"Tools"},{id:"create-mcp",label:"Create MCP",icon:Ts,section:"Developer"},{id:"preferences",label:"Preferences",icon:U_,section:"System"},{id:"docs",label:"Docs & Help",icon:Yn,section:"Help"}],ex=(e,t)=>{try{const s=localStorage.getItem(`claude-config-${e}`);return s?JSON.parse(s):t}catch{return t}},KI=(e,t)=>{try{localStorage.setItem(`claude-config-${e}`,JSON.stringify(t))}catch{}};function GI(){const[e,t]=C.useState(()=>ex("currentView","explorer")),[s,o]=C.useState(!0),[l,m]=C.useState({dir:"",subprojects:[],hierarchy:[]}),[f,a]=C.useState([]),[c,h]=C.useState({mcpServers:{}}),[g,u]=C.useState([]),[_,S]=C.useState([]),[j,w]=C.useState([]),[v,y]=C.useState(null),[p,x]=C.useState(null),[k,R]=C.useState(!1),[T,P]=C.useState({title:"",type:""}),[E,D]=C.useState(""),[V,H]=C.useState(""),[W,O]=C.useState({}),[K,U]=C.useState(null),[G,X]=C.useState(null),[z,M]=C.useState(!1),[B,L]=C.useState([]),[$,Q]=C.useState(null),[se,ce]=C.useState(!1),[de,q]=C.useState(null);C.useEffect(()=>{KI("currentView",e)},[e]);const I=C.useCallback(async()=>{try{const[Ae,Ee,Ye,Xe,Je,tt]=await Promise.all([we.getProject(),we.getConfigs(),we.getRegistry(),we.getRules(),we.getCommands(),we.getTemplates()]);m(Ae),a(Ee),h(Ye),u(Xe),S(Je),w(tt),Ee.length>0&&!v&&y(Ee[Ee.length-1])}catch(Ae){ie.error("Failed to load data: "+Ae.message)}finally{o(!1)}},[v]),ne=C.useCallback(async(Ae=!1)=>{var Ee;try{const Ye=await we.getProjects();L(Ye.projects||[]);const Xe=(Ee=Ye.projects)==null?void 0:Ee.find(Je=>Je.isActive);if(Q(Xe||null),Ae&&Xe){const Je=await we.getSubprojects(Xe.path);q({dir:Xe.path,subprojects:Je.subprojects||[]})}Ae&&!Xe&&(ex("currentView",null)||t("projects"))}catch{console.log("Projects API not available")}},[]),te=async Ae=>{try{const Ee=await we.setActiveProject(Ae);Ee.success?(m({dir:Ee.dir,hierarchy:Ee.hierarchy,subprojects:Ee.subprojects}),q({dir:Ee.dir,subprojects:Ee.subprojects}),Q(Ee.project),L(Ye=>Ye.map(Xe=>({...Xe,isActive:Xe.id===Ae}))),await I(),ie.success(`Switched to ${Ee.project.name}`)):ie.error(Ee.error||"Failed to switch project")}catch(Ee){ie.error("Failed to switch project: "+Ee.message)}},J=Ae=>{L(Ee=>[...Ee,{...Ae,exists:!0,hasClaudeConfig:!1}])};C.useEffect(()=>{I(),ne(!0),we.checkVersion().then(Ae=>{U(Ae==null?void 0:Ae.installedVersion),Ae!=null&&Ae.updateAvailable&&X(Ae)}).catch(()=>{})},[]);const re=async()=>{if(G!=null&&G.updateAvailable){M(!0);try{const Ae=await we.performUpdate({updateMethod:G.updateMethod,sourcePath:G.sourcePath});Ae.success?(ie.success(`Updated to v${Ae.newVersion}! Reloading...`),setTimeout(()=>window.location.reload(),1500)):(ie.error("Update failed: "+Ae.error),M(!1))}catch(Ae){ie.error("Update failed: "+Ae.message),M(!1)}}};C.useEffect(()=>{const Ae=async()=>{try{const{hashes:Ye}=await we.getFileHashes(),Xe=W;(Object.keys(Ye).some(tt=>Xe[tt]!==Ye[tt])||Object.keys(Xe).some(tt=>!Ye[tt]))&&Object.keys(Xe).length>0&&(ie.info("Files changed externally, reloading..."),await I()),O(Ye)}catch{}},Ee=setInterval(Ae,2e3);return Ae(),()=>clearInterval(Ee)},[W,I]);const me=new Set;f.forEach(Ae=>{var Ee,Ye;(((Ee=Ae.config)==null?void 0:Ee.include)||[]).forEach(Xe=>me.add(Xe)),Object.keys(((Ye=Ae.config)==null?void 0:Ye.mcpServers)||{}).forEach(Xe=>me.add(Xe))});const De={mcps:me.size,rules:g.length,commands:_.length},$e=async()=>{try{const Ae=await we.applyConfig(l.dir);if(Ae.tools){const Ee=Object.entries(Ae.tools).filter(([,Ye])=>Ye).map(([Ye])=>Ye==="claude"?"Claude Code":"Antigravity");Ee.length>0?ie.success(`Config applied to: ${Ee.join(", ")}`):ie.warning("No tools were updated")}else ie.success("Configuration applied successfully!")}catch(Ae){ie.error("Failed to apply config: "+Ae.message)}},Ge=async()=>{o(!0),await I(),ie.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(lt,{className:"w-8 h-8 animate-spin text-primary"}),i.jsx("p",{className:"text-muted-foreground",children:"Loading configuration..."})]})});const Ne=()=>{switch(e){case"explorer":return i.jsx(GO,{project:l,onRefresh:I});case"registry":return i.jsx(II,{registry:c,searchQuery:E,setSearchQuery:D,onUpdate:I});case"plugins":return i.jsx(UI,{});case"memory":return i.jsx(BI,{project:l,onUpdate:I});case"templates":return i.jsx(pI,{templates:j,project:l,onApply:I});case"create-mcp":return i.jsx(fI,{project:l});case"claude-settings":return i.jsx(nI,{});case"gemini-settings":return i.jsx(iI,{});case"preferences":return i.jsx(sI,{});case"projects":return i.jsx(FI,{onProjectSwitch:Ae=>{m({dir:Ae.dir,hierarchy:Ae.hierarchy,subprojects:Ae.subprojects}),q({dir:Ae.dir,subprojects:Ae.subprojects}),I(),ne()}});case"docs":return i.jsx(VI,{});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(Qn,{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"}),K&&i.jsxs("span",{className:"text-xs font-normal text-muted-foreground ml-2",children:["v",K]})]})}),G&&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(lt,{className:"w-3 h-3 animate-spin"}):i.jsx(Uc,{className:"w-3 h-3"}),z?"Updating...":`Update to v${G.sourceVersion}`]})]}),i.jsx(oC,{orientation:"vertical",className:"h-6"}),i.jsx(qO,{projects:B,activeProject:$,onSwitch:te,onAddClick:()=>ce(!0),onManageClick:()=>t("projects")})]}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(JO,{}),i.jsx(ue,{variant:"ghost",size:"sm",onClick:Ge,children:i.jsx(nr,{className:"w-4 h-4"})}),i.jsxs(ue,{onClick:$e,className:"bg-indigo-600 hover:bg-indigo-700 text-white gap-2 shadow-md",children:[i.jsx(IT,{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(ii,{className:"h-full py-4",children:["Projects","Configuration","Tools","Developer","System","Help"].map(Ae=>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:Ae}),i.jsx("div",{className:"space-y-0.5",children:WI.filter(Ee=>Ee.section===Ae).map(Ee=>{const Ye=Ee.icon,Xe=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 ${Xe?"bg-accent border-primary text-primary font-medium":"border-transparent text-muted-foreground hover:text-foreground hover:bg-accent"}`,children:[i.jsx(Ye,{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 ${Xe?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground"}`,children:De[Ee.badge]})]},Ee.id)})})]},Ae))})}),i.jsx("main",{className:Se("flex-1 overflow-auto",e==="explorer"||e==="docs"?"h-[calc(100vh-64px)]":"p-6"),children:i.jsx(ix,{mode:"wait",children:i.jsx(pn.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:Ne()},e)})})]}),i.jsx(rC,{open:se,onOpenChange:ce,onAdded:J})]})}function qI(){const[e,t]=C.useState(!1),[s,o]=C.useState(!1),[l,m]=C.useState(!1),f=C.useCallback(async()=>{o(!0);try{await we.restartServer(),ie.info("Server restarting... page will reload."),setTimeout(()=>{window.location.reload()},2e3)}catch(c){ie.error("Failed to restart: "+c.message),o(!1)}},[]),a=C.useCallback(()=>{m(!0),t(!1),ie.dismiss("update-available")},[]);return C.useEffect(()=>{let c;const h=async()=>{try{const g=await we.getVersion();console.log("[Update Check]",g),g.needsRestart&&!l&&t(!0)}catch{}};return h(),c=setInterval(h,3e4),()=>clearInterval(c)},[l]),i.jsx(YO,{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(nr,{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(lp,{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(nr,{className:"w-4 h-4 animate-spin"}),i.jsx("span",{className:"text-sm font-medium",children:"Restarting server..."})]}),i.jsx(GI,{}),i.jsx(ej,{position:"bottom-right",richColors:!0})]})})}E2.createRoot(document.getElementById("root")).render(i.jsx(qI,{}));
|
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-BQ9sPJd2.js"></script>
|
|
23
23
|
<link rel="stylesheet" crossorigin href="/assets/index-CrywZ6KU.css">
|
|
24
24
|
</head>
|
|
25
25
|
<body>
|
package/ui/server.cjs
CHANGED
|
@@ -1464,9 +1464,10 @@ class ConfigUIServer {
|
|
|
1464
1464
|
async installPlugin(pluginId, marketplace) {
|
|
1465
1465
|
// Use claude CLI to install
|
|
1466
1466
|
return new Promise((resolve) => {
|
|
1467
|
-
const proc = spawn('claude', ['
|
|
1467
|
+
const proc = spawn('claude', ['plugin', 'install', `${pluginId}@${marketplace}`], {
|
|
1468
1468
|
cwd: os.homedir(),
|
|
1469
|
-
env: process.env
|
|
1469
|
+
env: process.env,
|
|
1470
|
+
stdio: ['ignore', 'pipe', 'pipe'] // Don't wait for stdin
|
|
1470
1471
|
});
|
|
1471
1472
|
|
|
1472
1473
|
let stdout = '';
|
|
@@ -1492,9 +1493,10 @@ class ConfigUIServer {
|
|
|
1492
1493
|
async uninstallPlugin(pluginId) {
|
|
1493
1494
|
// Use claude CLI to uninstall
|
|
1494
1495
|
return new Promise((resolve) => {
|
|
1495
|
-
const proc = spawn('claude', ['
|
|
1496
|
+
const proc = spawn('claude', ['plugin', 'uninstall', pluginId], {
|
|
1496
1497
|
cwd: os.homedir(),
|
|
1497
|
-
env: process.env
|
|
1498
|
+
env: process.env,
|
|
1499
|
+
stdio: ['ignore', 'pipe', 'pipe'] // Don't wait for stdin
|
|
1498
1500
|
});
|
|
1499
1501
|
|
|
1500
1502
|
let stdout = '';
|
|
@@ -1520,9 +1522,10 @@ class ConfigUIServer {
|
|
|
1520
1522
|
async addMarketplace(name, repo) {
|
|
1521
1523
|
// Use claude CLI to add marketplace
|
|
1522
1524
|
return new Promise((resolve) => {
|
|
1523
|
-
const proc = spawn('claude', ['
|
|
1525
|
+
const proc = spawn('claude', ['plugin', 'marketplace', 'add', repo], {
|
|
1524
1526
|
cwd: os.homedir(),
|
|
1525
|
-
env: process.env
|
|
1527
|
+
env: process.env,
|
|
1528
|
+
stdio: ['ignore', 'pipe', 'pipe']
|
|
1526
1529
|
});
|
|
1527
1530
|
|
|
1528
1531
|
let stdout = '';
|
|
@@ -1548,9 +1551,10 @@ class ConfigUIServer {
|
|
|
1548
1551
|
async refreshMarketplace(name) {
|
|
1549
1552
|
// Use claude CLI to refresh/update marketplace
|
|
1550
1553
|
return new Promise((resolve) => {
|
|
1551
|
-
const proc = spawn('claude', ['
|
|
1554
|
+
const proc = spawn('claude', ['plugin', 'marketplace', 'update', name], {
|
|
1552
1555
|
cwd: os.homedir(),
|
|
1553
|
-
env: process.env
|
|
1556
|
+
env: process.env,
|
|
1557
|
+
stdio: ['ignore', 'pipe', 'pipe']
|
|
1554
1558
|
});
|
|
1555
1559
|
|
|
1556
1560
|
let stdout = '';
|