coder-config 0.40.4 → 0.40.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/constants.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "coder-config",
|
|
3
|
-
"version": "0.40.
|
|
3
|
+
"version": "0.40.5",
|
|
4
4
|
"description": "Configuration manager for AI coding tools - Claude Code, Gemini CLI, Codex CLI, Antigravity. Manage MCPs, rules, permissions, memory, and workstreams.",
|
|
5
5
|
"author": "regression.io",
|
|
6
6
|
"main": "config-loader.js",
|
|
@@ -3201,4 +3201,4 @@ claude-config --help # See all commands
|
|
|
3201
3201
|
Thanks for using Coder Config. We built this to make working with AI coding tools easier and more powerful.
|
|
3202
3202
|
|
|
3203
3203
|
Happy coding!
|
|
3204
|
-
`}},JH={...zH,...HH,...WH,...VH,...UH,...GH,...KH,...qH,...YH,...XH},au={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"}},Bw="claude-config-tutorial-visited";function QH(){const[e,t]=C.useState("intro"),[r,s]=C.useState({welcome:!0}),[o,u]=C.useState(()=>{try{return JSON.parse(localStorage.getItem(Bw)||"[]")}catch{return[]}}),d=C.useRef(null);C.useEffect(()=>{if(d.current){const y=d.current.querySelector("[data-radix-scroll-area-viewport]");y&&(y.scrollTop=0)}},[e]),C.useEffect(()=>{if(e&&!o.includes(e)){const y=[...o,e];u(y),localStorage.setItem(Bw,JSON.stringify(y))}},[e,o]);const l=y=>{s(j=>({...j,[y]:!j[y]}))},c=JH[e],f=za.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,x=m<f.length-1?f[m+1]:null,w=Math.round(o.length/f.length*100),_=(()=>{for(const y of za)if(y.id===e||y.subsections.some(j=>j.id===e))return y;return za[0]})(),v=au[_.id]||au.welcome,b=y=>{for(const j of za){if(j.id===y)return j.title;const E=j.subsections.find(P=>P.id===y);if(E)return E.title}return""},g=y=>({__html:I2(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(ku,{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(W2,{value:w,className:"h-2"})]})]}),n.jsx(Nn,{className:"flex-1",children:n.jsx("div",{className:"p-2",children:za.map((y,j)=>{const E=y.icon,P=au[y.id]||au.welcome,T=e===y.id||y.subsections.some(R=>R.id===e),N=y.subsections.length>0?y.subsections.every(R=>o.includes(R.id)):o.includes(y.id);return n.jsxs("div",{className:"mb-1",children:[n.jsxs("button",{className:je("w-full flex items-center gap-2 px-3 py-2.5 text-sm rounded-lg hover:bg-accent text-left transition-all",T&&"bg-accent"),onClick:()=>{y.subsections.length>0?(l(y.id),r[y.id]||t(y.subsections[0].id)):t(y.id)},children:[n.jsx("span",{className:je("w-7 h-7 rounded-lg flex items-center justify-center transition-colors",T?P.bg+" text-white":P.light),children:N?n.jsx(Em,{className:"w-4 h-4"}):n.jsx(E,{className:je("w-4 h-4",!T&&P.text)})}),n.jsx("span",{className:je("flex-1",T&&"font-medium"),children:y.title}),y.subsections.length>0&&n.jsx(Kr,{className:je("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(R=>{const I=e===R.id,O=o.includes(R.id);return n.jsxs("button",{className:je("w-full text-left px-3 py-1.5 text-sm rounded-md hover:bg-accent text-foreground flex items-center gap-2",I&&"bg-accent font-medium",I&&P.text),onClick:()=>t(R.id),children:[O&&!I&&n.jsx(Em,{className:"w-3 h-3 text-green-500"}),n.jsx("span",{className:je(!O&&!I&&"ml-5"),children:R.title})]},R.id)})})]},y.id)})})})]}),n.jsxs("div",{className:"flex-1 overflow-hidden flex flex-col",children:[n.jsx("div",{className:je("px-8 py-4 border-b border-border",v.light),children:n.jsxs("div",{className:"max-w-3xl mx-auto flex items-center gap-3",children:[n.jsx("div",{className:je("w-10 h-10 rounded-xl flex items-center justify-center",v.bg,"text-white"),children:n.jsx(_.icon,{className:"w-5 h-5"})}),n.jsxs("div",{children:[n.jsx("p",{className:je("text-sm font-medium",v.text),children:_.title}),n.jsx("h1",{className:"text-lg font-semibold text-foreground",children:(c==null?void 0:c.title)||b(e)})]})]})}),n.jsx(Nn,{className:"flex-1",ref:d,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:g(c.content)}):n.jsxs("div",{className:"text-center text-muted-foreground py-12",children:[n.jsx(ku,{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(le,{variant:"ghost",onClick:()=>t(h),className:"flex items-center gap-2",children:[n.jsx(cM,{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]}),x?n.jsxs(le,{onClick:()=>t(x),className:je("flex items-center gap-2",v.bg,"hover:opacity-90"),children:[n.jsx("span",{className:"max-w-[150px] truncate",children:b(x)}),n.jsx(Hp,{className:"w-4 h-4"})]}):n.jsx(le,{variant:"outline",onClick:()=>t("intro"),className:"flex items-center gap-2",children:"Start Over"})]})})]})]})}const ZH=[{id:"projects",label:"All Projects",icon:Zs,section:"Projects"},{id:"explorer",label:"Project Explorer",icon:si,section:"Projects"},{id:"registry",label:"MCP Registry",icon:ns,section:"Tools"},{id:"plugins",label:"Plugins",icon:Fi,section:"Tools"},{id:"memory",label:"Memory",icon:Ii,section:"Tools"},{id:"workstreams",label:"Workstreams",icon:P1,section:"Tools"},{id:"claude-settings",label:"Claude Code",icon:as,section:"Configuration"},{id:"gemini-settings",label:"Gemini CLI",icon:Ft,section:"Configuration"},{id:"codex-settings",label:"Codex CLI",icon:Ft,section:"Configuration",isNew:!0},{id:"antigravity-settings",label:"Antigravity",icon:wl,section:"Configuration"},{id:"create-mcp",label:"Create MCP",icon:Qn,section:"Developer"},{id:"preferences",label:"Preferences",icon:A1,section:"System"},{id:"tutorial",label:"Tutorial",icon:ku,section:"Help",isNew:!0},{id:"docs",label:"Docs & Help",icon:Li,section:"Help"}],Fw=(e,t)=>{try{const r=localStorage.getItem(`claude-config-${e}`);return r?JSON.parse(r):t}catch{return t}},eW=(e,t)=>{try{localStorage.setItem(`claude-config-${e}`,JSON.stringify(t))}catch{}};function tW(){const[e,t]=C.useState(()=>Fw("currentView","explorer")),[r,s]=C.useState(!0),[o,u]=C.useState({dir:"",subprojects:[],hierarchy:[]}),[d,l]=C.useState([]),[c,f]=C.useState({mcpServers:{}}),[m,h]=C.useState([]),[x,w]=C.useState([]),[k,_]=C.useState(null),[v,b]=C.useState(null),[g,y]=C.useState(!1),[j,E]=C.useState({title:"",type:""}),[P,T]=C.useState(""),[N,R]=C.useState(""),[I,O]=C.useState({}),[$,W]=C.useState(null),[Y,z]=C.useState(null),[K,G]=C.useState(!1),[U,L]=C.useState([]),[M,B]=C.useState(null),[q,F]=C.useState(!1),[oe,fe]=C.useState(null);C.useEffect(()=>{eW("currentView",e)},[e]);const me=C.useCallback(async()=>{try{const[re,de,De,Re,Ze]=await Promise.all([ke.getProject(),ke.getConfigs(),ke.getRegistry(),ke.getRules(),ke.getCommands()]);u(re),l(de),f(De),h(Re),w(Ze),de.length>0&&!k&&_(de[de.length-1])}catch(re){ee.error("Failed to load data: "+re.message)}finally{s(!1)}},[k]),X=C.useCallback(async(re=!1)=>{var de;try{const De=await ke.getProjects();L(De.projects||[]);const Re=(de=De.projects)==null?void 0:de.find(Ze=>Ze.isActive);if(B(Re||null),re&&Re){const Ze=await ke.getSubprojects(Re.path);fe({dir:Re.path,subprojects:Ze.subprojects||[]})}re&&!Re&&(Fw("currentView",null)||t("projects"))}catch{console.log("Projects API not available")}},[]),H=async re=>{try{const de=await ke.setActiveProject(re);de.success?(u({dir:de.dir,hierarchy:de.hierarchy,subprojects:de.subprojects}),fe({dir:de.dir,subprojects:de.subprojects}),B(de.project),L(De=>De.map(Re=>({...Re,isActive:Re.id===re}))),await me(),ee.success(`Switched to ${de.project.name}`)):ee.error(de.error||"Failed to switch project")}catch(de){ee.error("Failed to switch project: "+de.message)}},ae=re=>{L(de=>[...de,{...re,exists:!0,hasClaudeConfig:!1}])};C.useEffect(()=>{me(),X(!0),ke.checkVersion().then(re=>{W(re==null?void 0:re.installedVersion),re!=null&&re.updateAvailable&&(re==null?void 0:re.updateMethod)==="npm"&&z(re)}).catch(()=>{})},[]);const ne=async()=>{if(Y!=null&&Y.updateAvailable){G(!0);try{const re=await ke.performUpdate({updateMethod:Y.updateMethod,sourcePath:Y.sourcePath,targetVersion:Y.latestVersion});re.success?(ee.success(`Updated to v${re.newVersion}! Reloading...`),setTimeout(()=>window.location.reload(),1500)):(ee.error("Update failed: "+re.error),G(!1))}catch(re){ee.error("Update failed: "+re.message),G(!1)}}};C.useEffect(()=>{const re=async()=>{try{const{hashes:De}=await ke.getFileHashes(),Re=I;(Object.keys(De).some(Se=>Re[Se]!==De[Se])||Object.keys(Re).some(Se=>!De[Se]))&&Object.keys(Re).length>0&&(ee.info("Files changed externally, reloading..."),await me()),O(De)}catch{}},de=setInterval(re,2e3);return re(),()=>clearInterval(de)},[I,me]);const J=new Set;d.forEach(re=>{var de,De;(((de=re.config)==null?void 0:de.include)||[]).forEach(Re=>J.add(Re)),Object.keys(((De=re.config)==null?void 0:De.mcpServers)||{}).forEach(Re=>J.add(Re))});const ie={mcps:J.size,rules:m.length,commands:x.length},ye=async()=>{try{const re=await ke.applyConfig(o.dir);if(re.tools){const de=Object.entries(re.tools).filter(([,De])=>De).map(([De])=>De==="claude"?"Claude Code":"Antigravity");de.length>0?ee.success(`Config applied to: ${de.join(", ")}`):ee.warning("No tools were updated")}else ee.success("Configuration applied successfully!")}catch(re){ee.error("Failed to apply config: "+re.message)}},Oe=async()=>{s(!0),await me(),ee.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 Ve=()=>{switch(e){case"explorer":return n.jsx(GF,{project:o,onRefresh:me});case"registry":return n.jsx(lH,{registry:c,searchQuery:P,setSearchQuery:T,onUpdate:me});case"plugins":return n.jsx(PH,{});case"memory":return n.jsx(cH,{project:o,onUpdate:me});case"create-mcp":return n.jsx(Fz,{project:o});case"claude-settings":return n.jsx(Cz,{});case"gemini-settings":return n.jsx(kz,{});case"codex-settings":return n.jsx(Oz,{});case"antigravity-settings":return n.jsx(Az,{});case"preferences":return n.jsx(Sz,{});case"projects":return n.jsx(uH,{onProjectSwitch:re=>{u({dir:re.dir,hierarchy:re.hierarchy,subprojects:re.subprojects}),fe({dir:re.dir,subprojects:re.subprojects}),me(),X()}});case"workstreams":return n.jsx(AH,{projects:U,onWorkstreamChange:re=>{ee.success(`Switched to workstream: ${re.name}`)}});case"docs":return n.jsx(NH,{});case"tutorial":return n.jsx(QH,{});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(kn,{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"})]})}),Y&&n.jsxs("button",{onClick:ne,disabled:K,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:[K?n.jsx(ut,{className:"w-3 h-3 animate-spin"}):n.jsx(bl,{className:"w-3 h-3"}),K?"Updating...":`Update to v${Y.latestVersion}`]})]}),n.jsx(Oj,{orientation:"vertical",className:"h-6"}),n.jsx(KF,{projects:U,activeProject:M,onSwitch:H,onAddClick:()=>F(!0),onManageClick:()=>t("projects")})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(JF,{}),n.jsx(le,{variant:"ghost",size:"sm",onClick:Oe,children:n.jsx(pr,{className:"w-4 h-4"})}),n.jsxs(le,{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(wl,{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(Nn,{className:"flex-1 py-4",children:["Projects","Tools","Configuration","Developer","System","Help"].map(re=>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:re}),n.jsx("div",{className:"space-y-0.5",children:ZH.filter(de=>de.section===re).map(de=>{const De=de.icon,Re=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 ${Re?"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 ${Re?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground"}`,children:ie[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)})})]},re))}),n.jsx("div",{className:"px-4 py-3 border-t border-border",children:n.jsx("span",{className:"text-xs text-muted-foreground",children:$?`v${$}`:""})})]}),n.jsx("main",{className:je("flex-1 overflow-auto",["explorer","docs","tutorial"].includes(e)?"h-[calc(100vh-64px)]":"p-6"),children:n.jsx(Vw,{mode:"wait",children:n.jsx(Eo.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:Ve()},e)})})]}),n.jsx(Mj,{open:q,onOpenChange:F,onAdded:ae}),n.jsx(qF,{onStartTutorial:()=>t("tutorial")})]})}function rW(){const[e,t]=C.useState(!1),[r,s]=C.useState(!1),[o,u]=C.useState(!1),d=C.useCallback(async()=>{s(!0);try{await ke.restartServer(),ee.info("Server restarting... page will reload."),setTimeout(()=>{window.location.reload()},2e3)}catch(c){ee.error("Failed to restart: "+c.message),s(!1)}},[]),l=C.useCallback(()=>{u(!0),t(!1),ee.dismiss("update-available")},[]);return C.useEffect(()=>{let c;const f=async()=>{try{const m=await ke.getVersion();console.log("[Update Check]",m),m.needsRestart&&!o&&t(!0)}catch{}};return f(),c=setInterval(f,3e4),()=>clearInterval(c)},[o]),n.jsx(YF,{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:d,children:[n.jsx(pr,{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(ei,{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(pr,{className:"w-4 h-4 animate-spin"}),n.jsx("span",{className:"text-sm font-medium",children:"Restarting server..."})]}),n.jsx(tW,{}),n.jsx(yP,{position:"bottom-right",richColors:!0})]})})}GE.createRoot(document.getElementById("root")).render(n.jsx(rW,{}));
|
|
3204
|
+
`}},JH={...zH,...HH,...WH,...VH,...UH,...GH,...KH,...qH,...YH,...XH},au={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"}},Bw="claude-config-tutorial-visited";function QH(){const[e,t]=C.useState("intro"),[r,s]=C.useState({welcome:!0}),[o,u]=C.useState(()=>{try{return JSON.parse(localStorage.getItem(Bw)||"[]")}catch{return[]}}),d=C.useRef(null);C.useEffect(()=>{if(d.current){const y=d.current.querySelector("[data-radix-scroll-area-viewport]");y&&(y.scrollTop=0)}},[e]),C.useEffect(()=>{if(e&&!o.includes(e)){const y=[...o,e];u(y),localStorage.setItem(Bw,JSON.stringify(y))}},[e,o]);const l=y=>{s(j=>({...j,[y]:!j[y]}))},c=JH[e],f=za.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,x=m<f.length-1?f[m+1]:null,w=Math.round(o.length/f.length*100),_=(()=>{for(const y of za)if(y.id===e||y.subsections.some(j=>j.id===e))return y;return za[0]})(),v=au[_.id]||au.welcome,b=y=>{for(const j of za){if(j.id===y)return j.title;const E=j.subsections.find(P=>P.id===y);if(E)return E.title}return""},g=y=>({__html:I2(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(ku,{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(W2,{value:w,className:"h-2"})]})]}),n.jsx(Nn,{className:"flex-1",children:n.jsx("div",{className:"p-2",children:za.map((y,j)=>{const E=y.icon,P=au[y.id]||au.welcome,T=e===y.id||y.subsections.some(R=>R.id===e),N=y.subsections.length>0?y.subsections.every(R=>o.includes(R.id)):o.includes(y.id);return n.jsxs("div",{className:"mb-1",children:[n.jsxs("button",{className:je("w-full flex items-center gap-2 px-3 py-2.5 text-sm rounded-lg hover:bg-accent text-left transition-all",T&&"bg-accent"),onClick:()=>{y.subsections.length>0?(l(y.id),r[y.id]||t(y.subsections[0].id)):t(y.id)},children:[n.jsx("span",{className:je("w-7 h-7 rounded-lg flex items-center justify-center transition-colors",T?P.bg+" text-white":P.light),children:N?n.jsx(Em,{className:"w-4 h-4"}):n.jsx(E,{className:je("w-4 h-4",!T&&P.text)})}),n.jsx("span",{className:je("flex-1",T&&"font-medium"),children:y.title}),y.subsections.length>0&&n.jsx(Kr,{className:je("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(R=>{const I=e===R.id,O=o.includes(R.id);return n.jsxs("button",{className:je("w-full text-left px-3 py-1.5 text-sm rounded-md hover:bg-accent text-foreground flex items-center gap-2",I&&"bg-accent font-medium",I&&P.text),onClick:()=>t(R.id),children:[O&&!I&&n.jsx(Em,{className:"w-3 h-3 text-green-500"}),n.jsx("span",{className:je(!O&&!I&&"ml-5"),children:R.title})]},R.id)})})]},y.id)})})})]}),n.jsxs("div",{className:"flex-1 overflow-hidden flex flex-col",children:[n.jsx("div",{className:je("px-8 py-4 border-b border-border",v.light),children:n.jsxs("div",{className:"max-w-3xl mx-auto flex items-center gap-3",children:[n.jsx("div",{className:je("w-10 h-10 rounded-xl flex items-center justify-center",v.bg,"text-white"),children:n.jsx(_.icon,{className:"w-5 h-5"})}),n.jsxs("div",{children:[n.jsx("p",{className:je("text-sm font-medium",v.text),children:_.title}),n.jsx("h1",{className:"text-lg font-semibold text-foreground",children:(c==null?void 0:c.title)||b(e)})]})]})}),n.jsx(Nn,{className:"flex-1",ref:d,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:g(c.content)}):n.jsxs("div",{className:"text-center text-muted-foreground py-12",children:[n.jsx(ku,{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(le,{variant:"ghost",onClick:()=>t(h),className:"flex items-center gap-2",children:[n.jsx(cM,{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]}),x?n.jsxs(le,{onClick:()=>t(x),className:je("flex items-center gap-2",v.bg,"hover:opacity-90"),children:[n.jsx("span",{className:"max-w-[150px] truncate",children:b(x)}),n.jsx(Hp,{className:"w-4 h-4"})]}):n.jsx(le,{variant:"outline",onClick:()=>t("intro"),className:"flex items-center gap-2",children:"Start Over"})]})})]})]})}const ZH=[{id:"projects",label:"All Projects",icon:Zs,section:"Projects"},{id:"explorer",label:"Project Explorer",icon:si,section:"Projects"},{id:"registry",label:"MCP Registry",icon:ns,section:"Tools"},{id:"plugins",label:"Plugins",icon:Fi,section:"Tools"},{id:"memory",label:"Memory",icon:Ii,section:"Tools"},{id:"workstreams",label:"Workstreams",icon:P1,section:"Tools"},{id:"claude-settings",label:"Claude Code",icon:as,section:"Configuration"},{id:"gemini-settings",label:"Gemini CLI",icon:Ft,section:"Configuration"},{id:"codex-settings",label:"Codex CLI",icon:Ft,section:"Configuration",isNew:!0},{id:"antigravity-settings",label:"Antigravity",icon:wl,section:"Configuration"},{id:"create-mcp",label:"Create MCP",icon:Qn,section:"Developer"},{id:"preferences",label:"Preferences",icon:A1,section:"System"},{id:"tutorial",label:"Tutorial",icon:ku,section:"Help",isNew:!0},{id:"docs",label:"Docs & Help",icon:Li,section:"Help"}],Fw=(e,t)=>{try{const r=localStorage.getItem(`claude-config-${e}`);return r?JSON.parse(r):t}catch{return t}},eW=(e,t)=>{try{localStorage.setItem(`claude-config-${e}`,JSON.stringify(t))}catch{}};function tW(){const[e,t]=C.useState(()=>Fw("currentView","explorer")),[r,s]=C.useState(!0),[o,u]=C.useState({dir:"",subprojects:[],hierarchy:[]}),[d,l]=C.useState([]),[c,f]=C.useState({mcpServers:{}}),[m,h]=C.useState([]),[x,w]=C.useState([]),[k,_]=C.useState(null),[v,b]=C.useState(null),[g,y]=C.useState(!1),[j,E]=C.useState({title:"",type:""}),[P,T]=C.useState(""),[N,R]=C.useState(""),[I,O]=C.useState({}),[$,W]=C.useState(null),[Y,z]=C.useState(null),[K,G]=C.useState(!1),[U,L]=C.useState([]),[M,B]=C.useState(null),[q,F]=C.useState(!1),[oe,fe]=C.useState(null);C.useEffect(()=>{eW("currentView",e)},[e]);const me=C.useCallback(async()=>{try{const[re,de,De,Re,Ze]=await Promise.all([ke.getProject(),ke.getConfigs(),ke.getRegistry(),ke.getRules(),ke.getCommands()]);u(re),l(de),f(De),h(Re),w(Ze),de.length>0&&!k&&_(de[de.length-1])}catch(re){ee.error("Failed to load data: "+re.message)}finally{s(!1)}},[k]),X=C.useCallback(async(re=!1)=>{var de;try{const De=await ke.getProjects();L(De.projects||[]);const Re=(de=De.projects)==null?void 0:de.find(Ze=>Ze.isActive);if(B(Re||null),re&&Re){const Ze=await ke.getSubprojects(Re.path);fe({dir:Re.path,subprojects:Ze.subprojects||[]})}re&&!Re&&(Fw("currentView",null)||t("projects"))}catch{console.log("Projects API not available")}},[]),H=async re=>{try{const de=await ke.setActiveProject(re);de.success?(u({dir:de.dir,hierarchy:de.hierarchy,subprojects:de.subprojects}),fe({dir:de.dir,subprojects:de.subprojects}),B(de.project),L(De=>De.map(Re=>({...Re,isActive:Re.id===re}))),await me(),ee.success(`Switched to ${de.project.name}`)):ee.error(de.error||"Failed to switch project")}catch(de){ee.error("Failed to switch project: "+de.message)}},ae=re=>{L(de=>[...de,{...re,exists:!0,hasClaudeConfig:!1}])};C.useEffect(()=>{me(),X(!0),ke.checkVersion().then(re=>{W(re==null?void 0:re.installedVersion),re!=null&&re.updateAvailable&&(re==null?void 0:re.updateMethod)==="npm"&&z(re)}).catch(()=>{})},[]);const ne=async()=>{if(Y!=null&&Y.updateAvailable){G(!0);try{const re=await ke.performUpdate({updateMethod:Y.updateMethod,sourcePath:Y.sourcePath,targetVersion:Y.latestVersion});re.success?(ee.success(`Updated to v${re.newVersion}! Reloading...`),setTimeout(()=>window.location.reload(),1500)):(ee.error("Update failed: "+re.error),G(!1))}catch(re){ee.error("Update failed: "+re.message),G(!1)}}};C.useEffect(()=>{const re=async()=>{try{const{hashes:De}=await ke.getFileHashes(),Re=I;(Object.keys(De).some(Se=>Re[Se]!==De[Se])||Object.keys(Re).some(Se=>!De[Se]))&&Object.keys(Re).length>0&&(ee.info("Files changed externally, reloading..."),await me()),O(De)}catch{}},de=setInterval(re,2e3);return re(),()=>clearInterval(de)},[I,me]);const J=new Set;d.forEach(re=>{var de,De;(((de=re.config)==null?void 0:de.include)||[]).forEach(Re=>J.add(Re)),Object.keys(((De=re.config)==null?void 0:De.mcpServers)||{}).forEach(Re=>J.add(Re))});const ie={mcps:J.size,rules:m.length,commands:x.length},ye=async()=>{try{const re=await ke.applyConfig(o.dir);if(re.tools){const de=Object.entries(re.tools).filter(([,De])=>De).map(([De])=>De==="claude"?"Claude Code":"Antigravity");de.length>0?ee.success(`Config applied to: ${de.join(", ")}`):ee.warning("No tools were updated")}else ee.success("Configuration applied successfully!")}catch(re){ee.error("Failed to apply config: "+re.message)}},Oe=async()=>{s(!0),await me(),ee.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 Ve=()=>{switch(e){case"explorer":return n.jsx(GF,{project:o,onRefresh:me});case"registry":return n.jsx(lH,{registry:c,searchQuery:P,setSearchQuery:T,onUpdate:me});case"plugins":return n.jsx(PH,{});case"memory":return n.jsx(cH,{project:o,onUpdate:me});case"create-mcp":return n.jsx(Fz,{project:o});case"claude-settings":return n.jsx(Cz,{});case"gemini-settings":return n.jsx(kz,{});case"codex-settings":return n.jsx(Oz,{});case"antigravity-settings":return n.jsx(Az,{});case"preferences":return n.jsx(Sz,{});case"projects":return n.jsx(uH,{onProjectSwitch:re=>{u({dir:re.dir,hierarchy:re.hierarchy,subprojects:re.subprojects}),fe({dir:re.dir,subprojects:re.subprojects}),me(),X()}});case"workstreams":return n.jsx(AH,{projects:U,onWorkstreamChange:re=>{ee.success(`Switched to workstream: ${re.name}`)}});case"docs":return n.jsx(NH,{});case"tutorial":return n.jsx(QH,{});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(kn,{className:"w-5 h-5 text-white"})}),n.jsx("div",{children:n.jsxs("h1",{className:"text-xl font-bold text-foreground",children:["Coder ",n.jsx("span",{className:"text-primary",children:"Config"})]})}),Y&&n.jsxs("button",{onClick:ne,disabled:K,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:[K?n.jsx(ut,{className:"w-3 h-3 animate-spin"}):n.jsx(bl,{className:"w-3 h-3"}),K?"Updating...":`Update to v${Y.latestVersion}`]})]}),n.jsx(Oj,{orientation:"vertical",className:"h-6"}),n.jsx(KF,{projects:U,activeProject:M,onSwitch:H,onAddClick:()=>F(!0),onManageClick:()=>t("projects")})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(JF,{}),n.jsx(le,{variant:"ghost",size:"sm",onClick:Oe,children:n.jsx(pr,{className:"w-4 h-4"})}),n.jsxs(le,{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(wl,{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(Nn,{className:"flex-1 py-4",children:["Projects","Tools","Configuration","Developer","System","Help"].map(re=>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:re}),n.jsx("div",{className:"space-y-0.5",children:ZH.filter(de=>de.section===re).map(de=>{const De=de.icon,Re=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 ${Re?"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 ${Re?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground"}`,children:ie[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)})})]},re))}),n.jsx("div",{className:"px-4 py-3 border-t border-border",children:n.jsx("span",{className:"text-xs text-muted-foreground",children:$?`v${$}`:""})})]}),n.jsx("main",{className:je("flex-1 overflow-auto",["explorer","docs","tutorial"].includes(e)?"h-[calc(100vh-64px)]":"p-6"),children:n.jsx(Vw,{mode:"wait",children:n.jsx(Eo.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:Ve()},e)})})]}),n.jsx(Mj,{open:q,onOpenChange:F,onAdded:ae}),n.jsx(qF,{onStartTutorial:()=>t("tutorial")})]})}function rW(){const[e,t]=C.useState(!1),[r,s]=C.useState(!1),[o,u]=C.useState(!1),d=C.useCallback(async()=>{s(!0);try{await ke.restartServer(),ee.info("Server restarting... page will reload."),setTimeout(()=>{window.location.reload()},2e3)}catch(c){ee.error("Failed to restart: "+c.message),s(!1)}},[]),l=C.useCallback(()=>{u(!0),t(!1),ee.dismiss("update-available")},[]);return C.useEffect(()=>{let c;const f=async()=>{try{const m=await ke.getVersion();console.log("[Update Check]",m),m.needsRestart&&!o&&t(!0)}catch{}};return f(),c=setInterval(f,3e4),()=>clearInterval(c)},[o]),n.jsx(YF,{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:d,children:[n.jsx(pr,{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(ei,{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(pr,{className:"w-4 h-4 animate-spin"}),n.jsx("span",{className:"text-sm font-medium",children:"Restarting server..."})]}),n.jsx(tW,{}),n.jsx(yP,{position:"bottom-right",richColors:!0})]})})}GE.createRoot(document.getElementById("root")).render(n.jsx(rW,{}));
|
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-CTytYK0Q.js"></script>
|
|
23
23
|
<link rel="stylesheet" crossorigin href="/assets/index-DjLdm3Mr.css">
|
|
24
24
|
</head>
|
|
25
25
|
<body>
|