coder-config 0.42.2 → 0.42.3
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.42.
|
|
3
|
+
"version": "0.42.3",
|
|
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",
|
|
@@ -3840,4 +3840,4 @@ coder-config --help # See all commands
|
|
|
3840
3840
|
Thanks for using Coder Config. We built this to make working with AI coding tools easier and more powerful.
|
|
3841
3841
|
|
|
3842
3842
|
Happy coding!
|
|
3843
|
-
`}},fW={...rW,...nW,...sW,...iW,...oW,...aW,...lW,...cW,...uW,...dW,...hW},hu={welcome:{bg:"bg-violet-500",light:"bg-violet-100 dark:bg-violet-950",text:"text-violet-600 dark:text-violet-400"},"first-project":{bg:"bg-blue-500",light:"bg-blue-100 dark:bg-blue-950",text:"text-blue-600 dark:text-blue-400"},"rules-guide":{bg:"bg-emerald-500",light:"bg-emerald-100 dark:bg-emerald-950",text:"text-emerald-600 dark:text-emerald-400"},"mcp-guide":{bg:"bg-orange-500",light:"bg-orange-100 dark:bg-orange-950",text:"text-orange-600 dark:text-orange-400"},"permissions-guide":{bg:"bg-green-500",light:"bg-green-100 dark:bg-green-950",text:"text-green-600 dark:text-green-400"},"memory-guide":{bg:"bg-pink-500",light:"bg-pink-100 dark:bg-pink-950",text:"text-pink-600 dark:text-pink-400"},"plugins-guide":{bg:"bg-purple-500",light:"bg-purple-100 dark:bg-purple-950",text:"text-purple-600 dark:text-purple-400"},"workstreams-guide":{bg:"bg-cyan-500",light:"bg-cyan-100 dark:bg-cyan-950",text:"text-cyan-600 dark:text-cyan-400"},"loops-guide":{bg:"bg-teal-500",light:"bg-teal-100 dark:bg-teal-950",text:"text-teal-600 dark:text-teal-400"},"multi-tool-guide":{bg:"bg-amber-500",light:"bg-amber-100 dark:bg-amber-950",text:"text-amber-600 dark:text-amber-400"},"next-steps":{bg:"bg-rose-500",light:"bg-rose-100 dark:bg-rose-950",text:"text-rose-600 dark:text-rose-400"}},Uw="claude-config-tutorial-visited";function mW(){const[e,t]=C.useState("intro"),[n,s]=C.useState({welcome:!0}),[o,u]=C.useState(()=>{try{return JSON.parse(localStorage.getItem(Uw)||"[]")}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(Uw,JSON.stringify(y))}},[e,o]);const l=y=>{s(j=>({...j,[y]:!j[y]}))},c=fW[e],f=Wa.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 Wa)if(y.id===e||y.subsections.some(j=>j.id===e))return y;return Wa[0]})(),v=hu[_.id]||hu.welcome,b=y=>{for(const j of Wa){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:WN(y)});return r.jsxs("div",{className:"flex h-full",children:[r.jsxs("div",{className:"w-72 border-r border-border bg-muted/30 flex flex-col",children:[r.jsxs("div",{className:"p-4 border-b border-border bg-gradient-to-r from-indigo-500/10 to-purple-500/10",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"w-10 h-10 rounded-xl bg-gradient-to-br from-indigo-500 to-purple-600 flex items-center justify-center shadow-lg",children:r.jsx(Tu,{className:"w-5 h-5 text-white"})}),r.jsxs("div",{children:[r.jsx("h2",{className:"font-semibold text-foreground",children:"Tutorial"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Step-by-step guide"})]})]}),r.jsxs("div",{className:"mt-3",children:[r.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground mb-1",children:[r.jsx("span",{children:"Progress"}),r.jsxs("span",{children:[w,"% complete"]})]}),r.jsx(XN,{value:w,className:"h-2"})]})]}),r.jsx(Tn,{className:"flex-1",children:r.jsx("div",{className:"p-2",children:Wa.map((y,j)=>{const E=y.icon,P=hu[y.id]||hu.welcome,A=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 r.jsxs("div",{className:"mb-1",children:[r.jsxs("button",{className:Ee("w-full flex items-center gap-2 px-3 py-2.5 text-sm rounded-lg hover:bg-accent text-left transition-all",A&&"bg-accent"),onClick:()=>{y.subsections.length>0?(l(y.id),n[y.id]||t(y.subsections[0].id)):t(y.id)},children:[r.jsx("span",{className:Ee("w-7 h-7 rounded-lg flex items-center justify-center transition-colors",A?P.bg+" text-white":P.light),children:N?r.jsx(al,{className:"w-4 h-4"}):r.jsx(E,{className:Ee("w-4 h-4",!A&&P.text)})}),r.jsx("span",{className:Ee("flex-1",A&&"font-medium"),children:y.title}),y.subsections.length>0&&r.jsx(Vr,{className:Ee("w-4 h-4 text-muted-foreground transition-transform",n[y.id]&&"rotate-90")})]}),y.subsections.length>0&&n[y.id]&&r.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 r.jsxs("button",{className:Ee("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&&r.jsx(al,{className:"w-3 h-3 text-green-500"}),r.jsx("span",{className:Ee(!O&&!I&&"ml-5"),children:R.title})]},R.id)})})]},y.id)})})})]}),r.jsxs("div",{className:"flex-1 overflow-hidden flex flex-col",children:[r.jsx("div",{className:Ee("px-8 py-4 border-b border-border",v.light),children:r.jsxs("div",{className:"max-w-3xl mx-auto flex items-center gap-3",children:[r.jsx("div",{className:Ee("w-10 h-10 rounded-xl flex items-center justify-center",v.bg,"text-white"),children:r.jsx(_.icon,{className:"w-5 h-5"})}),r.jsxs("div",{children:[r.jsx("p",{className:Ee("text-sm font-medium",v.text),children:_.title}),r.jsx("h1",{className:"text-lg font-semibold text-foreground",children:(c==null?void 0:c.title)||b(e)})]})]})}),r.jsx(Tn,{className:"flex-1",ref:d,children:r.jsx("div",{className:"max-w-3xl mx-auto p-8",children:c?r.jsx("div",{className:"prose prose-sm max-w-none dark:prose-invert prose-headings:text-foreground prose-p:text-muted-foreground prose-strong:text-foreground prose-code:text-primary prose-code:bg-muted prose-code:px-1 prose-code:py-0.5 prose-code:rounded prose-pre:bg-muted prose-pre:border prose-pre:border-border",dangerouslySetInnerHTML:g(c.content)}):r.jsxs("div",{className:"text-center text-muted-foreground py-12",children:[r.jsx(Tu,{className:"w-12 h-12 mx-auto mb-4 opacity-50"}),r.jsx("p",{children:"Select a topic from the sidebar"})]})})}),r.jsx("div",{className:"border-t border-border p-4 bg-muted/30",children:r.jsxs("div",{className:"max-w-3xl mx-auto flex items-center justify-between",children:[h?r.jsxs(ae,{variant:"ghost",onClick:()=>t(h),className:"flex items-center gap-2",children:[r.jsx(gM,{className:"w-4 h-4"}),r.jsx("span",{className:"max-w-[150px] truncate",children:b(h)})]}):r.jsx("div",{}),r.jsxs("span",{className:"text-xs text-muted-foreground",children:[m+1," of ",f.length]}),x?r.jsxs(ae,{onClick:()=>t(x),className:Ee("flex items-center gap-2",v.bg,"hover:opacity-90"),children:[r.jsx("span",{className:"max-w-[150px] truncate",children:b(x)}),r.jsx(Up,{className:"w-4 h-4"})]}):r.jsx(ae,{variant:"outline",onClick:()=>t("intro"),className:"flex items-center gap-2",children:"Start Over"})]})})]})]})}const pW=[{id:"projects",label:"All Projects",icon:es,section:"Projects"},{id:"explorer",label:"Project Explorer",icon:oi,section:"Projects"},{id:"registry",label:"MCP Registry",icon:as,section:"Tools"},{id:"plugins",label:"Plugins",icon:$i,section:"Tools"},{id:"memory",label:"Memory",icon:Bi,section:"Tools"},{id:"workstreams",label:"Workstreams",icon:LC,section:"Tools"},{id:"loops",label:"Ralph Loops",icon:cl,section:"Tools",isNew:!0},{id:"claude-settings",label:"Claude Code",icon:ds,section:"Configuration"},{id:"gemini-settings",label:"Gemini CLI",icon:Ot,section:"Configuration"},{id:"codex-settings",label:"Codex CLI",icon:Ot,section:"Configuration",isNew:!0},{id:"antigravity-settings",label:"Antigravity",icon:jl,section:"Configuration"},{id:"create-mcp",label:"Create MCP",icon:jn,section:"Developer"},{id:"preferences",label:"Preferences",icon:IC,section:"System"},{id:"tutorial",label:"Tutorial",icon:Tu,section:"Help"},{id:"docs",label:"Docs & Help",icon:Oi,section:"Help"}],Gw=(e,t)=>{try{const n=localStorage.getItem(`claude-config-${e}`);return n?JSON.parse(n):t}catch{return t}},gW=(e,t)=>{try{localStorage.setItem(`claude-config-${e}`,JSON.stringify(t))}catch{}};function xW(){const[e,t]=C.useState(()=>Gw("currentView","explorer")),[n,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,A]=C.useState(""),[N,R]=C.useState(""),[I,O]=C.useState({}),[B,$]=C.useState(null),[Y,z]=C.useState(null),[K,G]=C.useState(!1),[U,L]=C.useState([]),[M,F]=C.useState(null),[q,H]=C.useState(!1),[oe,fe]=C.useState(null);C.useEffect(()=>{gW("currentView",e)},[e]);const me=C.useCallback(async()=>{try{const[ee,de,je,De,Je]=await Promise.all([ve.getProject(),ve.getConfigs(),ve.getRegistry(),ve.getRules(),ve.getCommands()]);u(ee),l(de),f(je),h(De),w(Je),de.length>0&&!k&&_(de[de.length-1])}catch(ee){J.error("Failed to load data: "+ee.message)}finally{s(!1)}},[k]),X=C.useCallback(async(ee=!1)=>{var de;try{const je=await ve.getProjects();L(je.projects||[]);const De=(de=je.projects)==null?void 0:de.find(Je=>Je.isActive);if(F(De||null),ee&&De){const Je=await ve.getSubprojects(De.path);fe({dir:De.path,subprojects:Je.subprojects||[]})}ee&&!De&&(Gw("currentView",null)||t("projects"))}catch{console.log("Projects API not available")}},[]),W=async ee=>{try{const de=await ve.setActiveProject(ee);de.success?(u({dir:de.dir,hierarchy:de.hierarchy,subprojects:de.subprojects}),fe({dir:de.dir,subprojects:de.subprojects}),F(de.project),L(je=>je.map(De=>({...De,isActive:De.id===ee}))),await me(),J.success(`Switched to ${de.project.name}`)):J.error(de.error||"Failed to switch project")}catch(de){J.error("Failed to switch project: "+de.message)}},le=ee=>{L(de=>[...de,{...ee,exists:!0,hasClaudeConfig:!1}])};C.useEffect(()=>{me(),X(!0),(async()=>{var de;try{const[je,De]=await Promise.all([ve.checkVersion(),ve.getConfig()]);if($(je==null?void 0:je.installedVersion),je!=null&&je.updateAvailable&&(je==null?void 0:je.updateMethod)==="npm")if((de=De==null?void 0:De.config)!=null&&de.autoUpdate){J.info(`Auto-updating to v${je.latestVersion}...`),G(!0);const Je=await ve.performUpdate({updateMethod:je.updateMethod,targetVersion:je.latestVersion});if(Je.success){J.success(`Updated to v${Je.newVersion}! Restarting server...`);try{await ve.restartServer()}catch{}let _e=0;const be=setInterval(async()=>{_e++;try{await ve.checkVersion(),clearInterval(be),J.success("Server restarted! Reloading..."),setTimeout(()=>window.location.reload(),500)}catch{_e>30&&(clearInterval(be),J.info("Server restarting. Please refresh the page."),G(!1))}},500)}else J.error("Auto-update failed: "+Je.error),G(!1),z(je)}else z(je)}catch{}})()},[]);const re=async()=>{if(Y!=null&&Y.updateAvailable){G(!0);try{const ee=await ve.performUpdate({updateMethod:Y.updateMethod,sourcePath:Y.sourcePath,targetVersion:Y.latestVersion});if(ee.success){J.success(`Updated to v${ee.newVersion}! Restarting server...`),z(null),$(ee.newVersion);try{await ve.restartServer()}catch{}let de=0;const je=setInterval(async()=>{de++;try{await ve.checkVersion(),clearInterval(je),J.success("Server restarted! Reloading..."),setTimeout(()=>window.location.reload(),500)}catch{de>30&&(clearInterval(je),J.info("Server restarting. Please refresh the page."),G(!1))}},500)}else J.error("Update failed: "+ee.error),G(!1)}catch(ee){J.error("Update failed: "+ee.message),G(!1)}}};C.useEffect(()=>{const ee=async()=>{try{const{hashes:je}=await ve.getFileHashes(),De=I;(Object.keys(je).some(_e=>De[_e]!==je[_e])||Object.keys(De).some(_e=>!je[_e]))&&Object.keys(De).length>0&&(J.info("Files changed externally, reloading..."),await me()),O(je)}catch{}},de=setInterval(ee,2e3);return ee(),()=>clearInterval(de)},[I,me]);const Q=new Set;d.forEach(ee=>{var de,je;(((de=ee.config)==null?void 0:de.include)||[]).forEach(De=>Q.add(De)),Object.keys(((je=ee.config)==null?void 0:je.mcpServers)||{}).forEach(De=>Q.add(De))});const se={mcps:Q.size,rules:m.length,commands:x.length},ye=async()=>{try{const ee=await ve.applyConfig(o.dir);if(ee.tools){const de=Object.entries(ee.tools).filter(([,je])=>je).map(([je])=>je==="claude"?"Claude Code":"Antigravity");de.length>0?J.success(`Config applied to: ${de.join(", ")}`):J.warning("No tools were updated")}else J.success("Configuration applied successfully!")}catch(ee){J.error("Failed to apply config: "+ee.message)}},Be=async()=>{s(!0),await me(),J.success("Data refreshed")};if(n)return r.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:r.jsxs("div",{className:"flex flex-col items-center gap-4",children:[r.jsx(at,{className:"w-8 h-8 animate-spin text-primary"}),r.jsx("p",{className:"text-muted-foreground",children:"Loading configuration..."})]})});const Ke=()=>{switch(e){case"explorer":return r.jsx(s8,{project:o,onRefresh:me});case"registry":return r.jsx(bH,{registry:c,searchQuery:P,setSearchQuery:A,onUpdate:me});case"plugins":return r.jsx(WH,{});case"memory":return r.jsx(wH,{project:o,onUpdate:me});case"create-mcp":return r.jsx(Jz,{project:o});case"claude-settings":return r.jsx(Iz,{});case"gemini-settings":return r.jsx(Oz,{});case"codex-settings":return r.jsx(Yz,{});case"antigravity-settings":return r.jsx(Hz,{});case"preferences":return r.jsx(Lz,{});case"projects":return r.jsx(_H,{onProjectSwitch:ee=>{u({dir:ee.dir,hierarchy:ee.hierarchy,subprojects:ee.subprojects}),fe({dir:ee.dir,subprojects:ee.subprojects}),me(),X()}});case"workstreams":return r.jsx(VH,{projects:U,onWorkstreamChange:ee=>{J.success(`Switched to workstream: ${ee.name}`)}});case"loops":return r.jsx(UH,{activeProject:M});case"docs":return r.jsx(zH,{});case"tutorial":return r.jsx(mW,{});default:return null}};return r.jsxs("div",{className:"min-h-screen bg-background",children:[r.jsx("header",{className:"h-16 bg-card border-b border-border sticky top-0 z-50 shadow-sm",children:r.jsxs("div",{className:"h-full px-6 flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-4",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"w-10 h-10 rounded-xl bg-gradient-to-br from-indigo-500 to-purple-600 flex items-center justify-center shadow-lg shadow-indigo-500/20",children:r.jsxs("svg",{width:"22",height:"22",viewBox:"0 0 128 128",children:[r.jsx("circle",{cx:"64",cy:"64",r:"52",fill:"none",stroke:"white",strokeWidth:"10",strokeDasharray:"24 12"}),r.jsx("circle",{cx:"64",cy:"64",r:"28",fill:"white"}),r.jsx("circle",{cx:"64",cy:"64",r:"12",fill:"#7c3aed"})]})}),r.jsx("div",{children:r.jsxs("h1",{className:"text-xl font-bold text-foreground",children:["Coder ",r.jsx("span",{className:"text-primary",children:"Config"})]})}),Y&&r.jsxs("button",{onClick:re,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?r.jsx(at,{className:"w-3 h-3 animate-spin"}):r.jsx(kl,{className:"w-3 h-3"}),K?"Updating...":`Update to v${Y.latestVersion}`]})]}),r.jsx(Vj,{orientation:"vertical",className:"h-6"}),r.jsx(i8,{projects:U,activeProject:M,onSwitch:W,onAddClick:()=>H(!0),onManageClick:()=>t("projects")})]}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx(c8,{}),r.jsx(ae,{variant:"ghost",size:"sm",onClick:Be,children:r.jsx(_r,{className:"w-4 h-4"})}),r.jsxs(ae,{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:[r.jsx(jl,{className:"w-4 h-4"}),"Re-apply"]})]})]})}),r.jsxs("div",{className:"flex",children:[r.jsxs("aside",{className:"w-64 h-[calc(100vh-64px)] border-r border-border bg-card sticky top-16 flex flex-col",children:[r.jsx(Tn,{className:"flex-1 py-4",children:["Projects","Tools","Configuration","Developer","System","Help"].map(ee=>r.jsxs("div",{className:"mb-6",children:[r.jsx("h3",{className:"px-4 mb-2 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:ee}),r.jsx("div",{className:"space-y-0.5",children:pW.filter(de=>de.section===ee).map(de=>{const je=de.icon,De=e===de.id;return r.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 ${De?"bg-accent border-primary text-primary font-medium":"border-transparent text-muted-foreground hover:text-foreground hover:bg-accent"}`,children:[r.jsx(je,{className:"w-4 h-4"}),r.jsx("span",{className:"flex-1 text-left",children:de.label}),de.badge&&r.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full font-medium ${De?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground"}`,children:se[de.badge]}),de.isNew&&r.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded font-medium bg-green-500/20 text-green-600 dark:text-green-400",children:"new"})]},de.id)})})]},ee))}),r.jsx("div",{className:"px-4 py-3 border-t border-border",children:r.jsx("span",{className:"text-xs text-muted-foreground",children:B?`v${B}`:""})})]}),r.jsx("main",{className:Ee("flex-1 overflow-auto",["explorer","docs","tutorial"].includes(e)?"h-[calc(100vh-64px)]":"p-6"),children:r.jsx(Jw,{mode:"wait",children:r.jsx(Ao.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:Ke()},e)})})]}),r.jsx($j,{open:q,onOpenChange:H,onAdded:le}),r.jsx(o8,{onStartTutorial:()=>t("tutorial")})]})}function vW(){const[e,t]=C.useState(!1),[n,s]=C.useState(!1),[o,u]=C.useState(!1),d=C.useCallback(async()=>{s(!0);try{await ve.restartServer(),J.info("Server restarting... page will reload."),setTimeout(()=>{window.location.reload()},2e3)}catch(c){J.error("Failed to restart: "+c.message),s(!1)}},[]),l=C.useCallback(()=>{u(!0),t(!1),J.dismiss("update-available")},[]);return C.useEffect(()=>{let c;const f=async()=>{try{const m=await ve.getVersion();console.log("[Update Check]",m),m.needsRestart&&!o&&t(!0)}catch{}};return f(),c=setInterval(f,3e4),()=>clearInterval(c)},[o]),r.jsx(a8,{children:r.jsxs("div",{className:"min-h-screen bg-background",children:[e&&!n&&r.jsxs("div",{className:"fixed top-0 left-0 right-0 z-50 bg-blue-600 text-white px-4 py-2 flex items-center justify-center gap-2 shadow-lg cursor-pointer hover:bg-blue-700 transition-colors",onClick:d,children:[r.jsx(_r,{className:"w-4 h-4"}),r.jsx("span",{className:"text-sm font-medium",children:"Update available — click to restart"}),r.jsx("button",{onClick:c=>{c.stopPropagation(),l()},className:"absolute right-3 p-1 hover:bg-blue-500 rounded",children:r.jsx(ri,{className:"w-4 h-4"})})]}),n&&r.jsxs("div",{className:"fixed top-0 left-0 right-0 z-50 bg-amber-600 text-white px-4 py-2 flex items-center justify-center gap-2",children:[r.jsx(_r,{className:"w-4 h-4 animate-spin"}),r.jsx("span",{className:"text-sm font-medium",children:"Restarting server..."})]}),r.jsx(xW,{}),r.jsx(jP,{position:"bottom-right",richColors:!0})]})})}ZE.createRoot(document.getElementById("root")).render(r.jsx(vW,{}));
|
|
3843
|
+
`}},fW={...rW,...nW,...sW,...iW,...oW,...aW,...lW,...cW,...uW,...dW,...hW},hu={welcome:{bg:"bg-violet-500",light:"bg-violet-100 dark:bg-violet-950",text:"text-violet-600 dark:text-violet-400"},"first-project":{bg:"bg-blue-500",light:"bg-blue-100 dark:bg-blue-950",text:"text-blue-600 dark:text-blue-400"},"rules-guide":{bg:"bg-emerald-500",light:"bg-emerald-100 dark:bg-emerald-950",text:"text-emerald-600 dark:text-emerald-400"},"mcp-guide":{bg:"bg-orange-500",light:"bg-orange-100 dark:bg-orange-950",text:"text-orange-600 dark:text-orange-400"},"permissions-guide":{bg:"bg-green-500",light:"bg-green-100 dark:bg-green-950",text:"text-green-600 dark:text-green-400"},"memory-guide":{bg:"bg-pink-500",light:"bg-pink-100 dark:bg-pink-950",text:"text-pink-600 dark:text-pink-400"},"plugins-guide":{bg:"bg-purple-500",light:"bg-purple-100 dark:bg-purple-950",text:"text-purple-600 dark:text-purple-400"},"workstreams-guide":{bg:"bg-cyan-500",light:"bg-cyan-100 dark:bg-cyan-950",text:"text-cyan-600 dark:text-cyan-400"},"loops-guide":{bg:"bg-teal-500",light:"bg-teal-100 dark:bg-teal-950",text:"text-teal-600 dark:text-teal-400"},"multi-tool-guide":{bg:"bg-amber-500",light:"bg-amber-100 dark:bg-amber-950",text:"text-amber-600 dark:text-amber-400"},"next-steps":{bg:"bg-rose-500",light:"bg-rose-100 dark:bg-rose-950",text:"text-rose-600 dark:text-rose-400"}},Uw="claude-config-tutorial-visited";function mW(){const[e,t]=C.useState("intro"),[n,s]=C.useState({welcome:!0}),[o,u]=C.useState(()=>{try{return JSON.parse(localStorage.getItem(Uw)||"[]")}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(Uw,JSON.stringify(y))}},[e,o]);const l=y=>{s(j=>({...j,[y]:!j[y]}))},c=fW[e],f=Wa.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 Wa)if(y.id===e||y.subsections.some(j=>j.id===e))return y;return Wa[0]})(),v=hu[_.id]||hu.welcome,b=y=>{for(const j of Wa){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:WN(y)});return r.jsxs("div",{className:"flex h-full",children:[r.jsxs("div",{className:"w-72 border-r border-border bg-muted/30 flex flex-col",children:[r.jsxs("div",{className:"p-4 border-b border-border bg-gradient-to-r from-indigo-500/10 to-purple-500/10",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"w-10 h-10 rounded-xl bg-gradient-to-br from-indigo-500 to-purple-600 flex items-center justify-center shadow-lg",children:r.jsx(Tu,{className:"w-5 h-5 text-white"})}),r.jsxs("div",{children:[r.jsx("h2",{className:"font-semibold text-foreground",children:"Tutorial"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Step-by-step guide"})]})]}),r.jsxs("div",{className:"mt-3",children:[r.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground mb-1",children:[r.jsx("span",{children:"Progress"}),r.jsxs("span",{children:[w,"% complete"]})]}),r.jsx(XN,{value:w,className:"h-2"})]})]}),r.jsx(Tn,{className:"flex-1",children:r.jsx("div",{className:"p-2",children:Wa.map((y,j)=>{const E=y.icon,P=hu[y.id]||hu.welcome,A=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 r.jsxs("div",{className:"mb-1",children:[r.jsxs("button",{className:Ee("w-full flex items-center gap-2 px-3 py-2.5 text-sm rounded-lg hover:bg-accent text-left transition-all",A&&"bg-accent"),onClick:()=>{y.subsections.length>0?(l(y.id),n[y.id]||t(y.subsections[0].id)):t(y.id)},children:[r.jsx("span",{className:Ee("w-7 h-7 rounded-lg flex items-center justify-center transition-colors",A?P.bg+" text-white":P.light),children:N?r.jsx(al,{className:"w-4 h-4"}):r.jsx(E,{className:Ee("w-4 h-4",!A&&P.text)})}),r.jsx("span",{className:Ee("flex-1",A&&"font-medium"),children:y.title}),y.subsections.length>0&&r.jsx(Vr,{className:Ee("w-4 h-4 text-muted-foreground transition-transform",n[y.id]&&"rotate-90")})]}),y.subsections.length>0&&n[y.id]&&r.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 r.jsxs("button",{className:Ee("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&&r.jsx(al,{className:"w-3 h-3 text-green-500"}),r.jsx("span",{className:Ee(!O&&!I&&"ml-5"),children:R.title})]},R.id)})})]},y.id)})})})]}),r.jsxs("div",{className:"flex-1 overflow-hidden flex flex-col",children:[r.jsx("div",{className:Ee("px-8 py-4 border-b border-border",v.light),children:r.jsxs("div",{className:"max-w-3xl mx-auto flex items-center gap-3",children:[r.jsx("div",{className:Ee("w-10 h-10 rounded-xl flex items-center justify-center",v.bg,"text-white"),children:r.jsx(_.icon,{className:"w-5 h-5"})}),r.jsxs("div",{children:[r.jsx("p",{className:Ee("text-sm font-medium",v.text),children:_.title}),r.jsx("h1",{className:"text-lg font-semibold text-foreground",children:(c==null?void 0:c.title)||b(e)})]})]})}),r.jsx(Tn,{className:"flex-1",ref:d,children:r.jsx("div",{className:"max-w-3xl mx-auto p-8",children:c?r.jsx("div",{className:"prose prose-sm max-w-none dark:prose-invert prose-headings:text-foreground prose-p:text-muted-foreground prose-strong:text-foreground prose-code:text-primary prose-code:bg-muted prose-code:px-1 prose-code:py-0.5 prose-code:rounded prose-pre:bg-muted prose-pre:border prose-pre:border-border",dangerouslySetInnerHTML:g(c.content)}):r.jsxs("div",{className:"text-center text-muted-foreground py-12",children:[r.jsx(Tu,{className:"w-12 h-12 mx-auto mb-4 opacity-50"}),r.jsx("p",{children:"Select a topic from the sidebar"})]})})}),r.jsx("div",{className:"border-t border-border p-4 bg-muted/30",children:r.jsxs("div",{className:"max-w-3xl mx-auto flex items-center justify-between",children:[h?r.jsxs(ae,{variant:"ghost",onClick:()=>t(h),className:"flex items-center gap-2",children:[r.jsx(gM,{className:"w-4 h-4"}),r.jsx("span",{className:"max-w-[150px] truncate",children:b(h)})]}):r.jsx("div",{}),r.jsxs("span",{className:"text-xs text-muted-foreground",children:[m+1," of ",f.length]}),x?r.jsxs(ae,{onClick:()=>t(x),className:Ee("flex items-center gap-2",v.bg,"hover:opacity-90"),children:[r.jsx("span",{className:"max-w-[150px] truncate",children:b(x)}),r.jsx(Up,{className:"w-4 h-4"})]}):r.jsx(ae,{variant:"outline",onClick:()=>t("intro"),className:"flex items-center gap-2",children:"Start Over"})]})})]})]})}const pW=[{id:"projects",label:"All Projects",icon:es,section:"Projects"},{id:"explorer",label:"Project Explorer",icon:oi,section:"Projects"},{id:"workstreams",label:"Workstreams",icon:LC,section:"Projects"},{id:"registry",label:"MCP Registry",icon:as,section:"Tools"},{id:"plugins",label:"Plugins",icon:$i,section:"Tools"},{id:"memory",label:"Memory",icon:Bi,section:"Tools"},{id:"loops",label:"Ralph Loops",icon:cl,section:"Tools",isNew:!0},{id:"claude-settings",label:"Claude Code",icon:ds,section:"Configuration"},{id:"gemini-settings",label:"Gemini CLI",icon:Ot,section:"Configuration"},{id:"codex-settings",label:"Codex CLI",icon:Ot,section:"Configuration",isNew:!0},{id:"antigravity-settings",label:"Antigravity",icon:jl,section:"Configuration"},{id:"create-mcp",label:"Create MCP",icon:jn,section:"Developer"},{id:"preferences",label:"Preferences",icon:IC,section:"System"},{id:"tutorial",label:"Tutorial",icon:Tu,section:"Help"},{id:"docs",label:"Docs & Help",icon:Oi,section:"Help"}],Gw=(e,t)=>{try{const n=localStorage.getItem(`claude-config-${e}`);return n?JSON.parse(n):t}catch{return t}},gW=(e,t)=>{try{localStorage.setItem(`claude-config-${e}`,JSON.stringify(t))}catch{}};function xW(){const[e,t]=C.useState(()=>Gw("currentView","explorer")),[n,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,A]=C.useState(""),[N,R]=C.useState(""),[I,O]=C.useState({}),[B,$]=C.useState(null),[Y,z]=C.useState(null),[K,G]=C.useState(!1),[U,L]=C.useState([]),[M,F]=C.useState(null),[q,H]=C.useState(!1),[oe,fe]=C.useState(null);C.useEffect(()=>{gW("currentView",e)},[e]);const me=C.useCallback(async()=>{try{const[ee,de,je,De,Je]=await Promise.all([ve.getProject(),ve.getConfigs(),ve.getRegistry(),ve.getRules(),ve.getCommands()]);u(ee),l(de),f(je),h(De),w(Je),de.length>0&&!k&&_(de[de.length-1])}catch(ee){J.error("Failed to load data: "+ee.message)}finally{s(!1)}},[k]),X=C.useCallback(async(ee=!1)=>{var de;try{const je=await ve.getProjects();L(je.projects||[]);const De=(de=je.projects)==null?void 0:de.find(Je=>Je.isActive);if(F(De||null),ee&&De){const Je=await ve.getSubprojects(De.path);fe({dir:De.path,subprojects:Je.subprojects||[]})}ee&&!De&&(Gw("currentView",null)||t("projects"))}catch{console.log("Projects API not available")}},[]),W=async ee=>{try{const de=await ve.setActiveProject(ee);de.success?(u({dir:de.dir,hierarchy:de.hierarchy,subprojects:de.subprojects}),fe({dir:de.dir,subprojects:de.subprojects}),F(de.project),L(je=>je.map(De=>({...De,isActive:De.id===ee}))),await me(),J.success(`Switched to ${de.project.name}`)):J.error(de.error||"Failed to switch project")}catch(de){J.error("Failed to switch project: "+de.message)}},le=ee=>{L(de=>[...de,{...ee,exists:!0,hasClaudeConfig:!1}])};C.useEffect(()=>{me(),X(!0),(async()=>{var de;try{const[je,De]=await Promise.all([ve.checkVersion(),ve.getConfig()]);if($(je==null?void 0:je.installedVersion),je!=null&&je.updateAvailable&&(je==null?void 0:je.updateMethod)==="npm")if((de=De==null?void 0:De.config)!=null&&de.autoUpdate){J.info(`Auto-updating to v${je.latestVersion}...`),G(!0);const Je=await ve.performUpdate({updateMethod:je.updateMethod,targetVersion:je.latestVersion});if(Je.success){J.success(`Updated to v${Je.newVersion}! Restarting server...`);try{await ve.restartServer()}catch{}let _e=0;const be=setInterval(async()=>{_e++;try{await ve.checkVersion(),clearInterval(be),J.success("Server restarted! Reloading..."),setTimeout(()=>window.location.reload(),500)}catch{_e>30&&(clearInterval(be),J.info("Server restarting. Please refresh the page."),G(!1))}},500)}else J.error("Auto-update failed: "+Je.error),G(!1),z(je)}else z(je)}catch{}})()},[]);const re=async()=>{if(Y!=null&&Y.updateAvailable){G(!0);try{const ee=await ve.performUpdate({updateMethod:Y.updateMethod,sourcePath:Y.sourcePath,targetVersion:Y.latestVersion});if(ee.success){J.success(`Updated to v${ee.newVersion}! Restarting server...`),z(null),$(ee.newVersion);try{await ve.restartServer()}catch{}let de=0;const je=setInterval(async()=>{de++;try{await ve.checkVersion(),clearInterval(je),J.success("Server restarted! Reloading..."),setTimeout(()=>window.location.reload(),500)}catch{de>30&&(clearInterval(je),J.info("Server restarting. Please refresh the page."),G(!1))}},500)}else J.error("Update failed: "+ee.error),G(!1)}catch(ee){J.error("Update failed: "+ee.message),G(!1)}}};C.useEffect(()=>{const ee=async()=>{try{const{hashes:je}=await ve.getFileHashes(),De=I;(Object.keys(je).some(_e=>De[_e]!==je[_e])||Object.keys(De).some(_e=>!je[_e]))&&Object.keys(De).length>0&&(J.info("Files changed externally, reloading..."),await me()),O(je)}catch{}},de=setInterval(ee,2e3);return ee(),()=>clearInterval(de)},[I,me]);const Q=new Set;d.forEach(ee=>{var de,je;(((de=ee.config)==null?void 0:de.include)||[]).forEach(De=>Q.add(De)),Object.keys(((je=ee.config)==null?void 0:je.mcpServers)||{}).forEach(De=>Q.add(De))});const se={mcps:Q.size,rules:m.length,commands:x.length},ye=async()=>{try{const ee=await ve.applyConfig(o.dir);if(ee.tools){const de=Object.entries(ee.tools).filter(([,je])=>je).map(([je])=>je==="claude"?"Claude Code":"Antigravity");de.length>0?J.success(`Config applied to: ${de.join(", ")}`):J.warning("No tools were updated")}else J.success("Configuration applied successfully!")}catch(ee){J.error("Failed to apply config: "+ee.message)}},Be=async()=>{s(!0),await me(),J.success("Data refreshed")};if(n)return r.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:r.jsxs("div",{className:"flex flex-col items-center gap-4",children:[r.jsx(at,{className:"w-8 h-8 animate-spin text-primary"}),r.jsx("p",{className:"text-muted-foreground",children:"Loading configuration..."})]})});const Ke=()=>{switch(e){case"explorer":return r.jsx(s8,{project:o,onRefresh:me});case"registry":return r.jsx(bH,{registry:c,searchQuery:P,setSearchQuery:A,onUpdate:me});case"plugins":return r.jsx(WH,{});case"memory":return r.jsx(wH,{project:o,onUpdate:me});case"create-mcp":return r.jsx(Jz,{project:o});case"claude-settings":return r.jsx(Iz,{});case"gemini-settings":return r.jsx(Oz,{});case"codex-settings":return r.jsx(Yz,{});case"antigravity-settings":return r.jsx(Hz,{});case"preferences":return r.jsx(Lz,{});case"projects":return r.jsx(_H,{onProjectSwitch:ee=>{u({dir:ee.dir,hierarchy:ee.hierarchy,subprojects:ee.subprojects}),fe({dir:ee.dir,subprojects:ee.subprojects}),me(),X()}});case"workstreams":return r.jsx(VH,{projects:U,onWorkstreamChange:ee=>{J.success(`Switched to workstream: ${ee.name}`)}});case"loops":return r.jsx(UH,{activeProject:M});case"docs":return r.jsx(zH,{});case"tutorial":return r.jsx(mW,{});default:return null}};return r.jsxs("div",{className:"min-h-screen bg-background",children:[r.jsx("header",{className:"h-16 bg-card border-b border-border sticky top-0 z-50 shadow-sm",children:r.jsxs("div",{className:"h-full px-6 flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-4",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"w-10 h-10 rounded-xl bg-gradient-to-br from-indigo-500 to-purple-600 flex items-center justify-center shadow-lg shadow-indigo-500/20",children:r.jsxs("svg",{width:"22",height:"22",viewBox:"0 0 128 128",children:[r.jsx("circle",{cx:"64",cy:"64",r:"52",fill:"none",stroke:"white",strokeWidth:"10",strokeDasharray:"24 12"}),r.jsx("circle",{cx:"64",cy:"64",r:"28",fill:"white"}),r.jsx("circle",{cx:"64",cy:"64",r:"12",fill:"#7c3aed"})]})}),r.jsx("div",{children:r.jsxs("h1",{className:"text-xl font-bold text-foreground",children:["Coder ",r.jsx("span",{className:"text-primary",children:"Config"})]})}),Y&&r.jsxs("button",{onClick:re,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?r.jsx(at,{className:"w-3 h-3 animate-spin"}):r.jsx(kl,{className:"w-3 h-3"}),K?"Updating...":`Update to v${Y.latestVersion}`]})]}),r.jsx(Vj,{orientation:"vertical",className:"h-6"}),r.jsx(i8,{projects:U,activeProject:M,onSwitch:W,onAddClick:()=>H(!0),onManageClick:()=>t("projects")})]}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx(c8,{}),r.jsx(ae,{variant:"ghost",size:"sm",onClick:Be,children:r.jsx(_r,{className:"w-4 h-4"})}),r.jsxs(ae,{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:[r.jsx(jl,{className:"w-4 h-4"}),"Re-apply"]})]})]})}),r.jsxs("div",{className:"flex",children:[r.jsxs("aside",{className:"w-64 h-[calc(100vh-64px)] border-r border-border bg-card sticky top-16 flex flex-col",children:[r.jsx(Tn,{className:"flex-1 py-4",children:["Projects","Tools","Configuration","Developer","System","Help"].map(ee=>r.jsxs("div",{className:"mb-6",children:[r.jsx("h3",{className:"px-4 mb-2 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:ee}),r.jsx("div",{className:"space-y-0.5",children:pW.filter(de=>de.section===ee).map(de=>{const je=de.icon,De=e===de.id;return r.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 ${De?"bg-accent border-primary text-primary font-medium":"border-transparent text-muted-foreground hover:text-foreground hover:bg-accent"}`,children:[r.jsx(je,{className:"w-4 h-4"}),r.jsx("span",{className:"flex-1 text-left",children:de.label}),de.badge&&r.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full font-medium ${De?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground"}`,children:se[de.badge]}),de.isNew&&r.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded font-medium bg-green-500/20 text-green-600 dark:text-green-400",children:"new"})]},de.id)})})]},ee))}),r.jsx("div",{className:"px-4 py-3 border-t border-border",children:r.jsx("span",{className:"text-xs text-muted-foreground",children:B?`v${B}`:""})})]}),r.jsx("main",{className:Ee("flex-1 overflow-auto",["explorer","docs","tutorial"].includes(e)?"h-[calc(100vh-64px)]":"p-6"),children:r.jsx(Jw,{mode:"wait",children:r.jsx(Ao.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:Ke()},e)})})]}),r.jsx($j,{open:q,onOpenChange:H,onAdded:le}),r.jsx(o8,{onStartTutorial:()=>t("tutorial")})]})}function vW(){const[e,t]=C.useState(!1),[n,s]=C.useState(!1),[o,u]=C.useState(!1),d=C.useCallback(async()=>{s(!0);try{await ve.restartServer(),J.info("Server restarting... page will reload."),setTimeout(()=>{window.location.reload()},2e3)}catch(c){J.error("Failed to restart: "+c.message),s(!1)}},[]),l=C.useCallback(()=>{u(!0),t(!1),J.dismiss("update-available")},[]);return C.useEffect(()=>{let c;const f=async()=>{try{const m=await ve.getVersion();console.log("[Update Check]",m),m.needsRestart&&!o&&t(!0)}catch{}};return f(),c=setInterval(f,3e4),()=>clearInterval(c)},[o]),r.jsx(a8,{children:r.jsxs("div",{className:"min-h-screen bg-background",children:[e&&!n&&r.jsxs("div",{className:"fixed top-0 left-0 right-0 z-50 bg-blue-600 text-white px-4 py-2 flex items-center justify-center gap-2 shadow-lg cursor-pointer hover:bg-blue-700 transition-colors",onClick:d,children:[r.jsx(_r,{className:"w-4 h-4"}),r.jsx("span",{className:"text-sm font-medium",children:"Update available — click to restart"}),r.jsx("button",{onClick:c=>{c.stopPropagation(),l()},className:"absolute right-3 p-1 hover:bg-blue-500 rounded",children:r.jsx(ri,{className:"w-4 h-4"})})]}),n&&r.jsxs("div",{className:"fixed top-0 left-0 right-0 z-50 bg-amber-600 text-white px-4 py-2 flex items-center justify-center gap-2",children:[r.jsx(_r,{className:"w-4 h-4 animate-spin"}),r.jsx("span",{className:"text-sm font-medium",children:"Restarting server..."})]}),r.jsx(xW,{}),r.jsx(jP,{position:"bottom-right",richColors:!0})]})})}ZE.createRoot(document.getElementById("root")).render(r.jsx(vW,{}));
|
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-D1c1IYap.js"></script>
|
|
23
23
|
<link rel="stylesheet" crossorigin href="/assets/index-X0dVhMey.css">
|
|
24
24
|
</head>
|
|
25
25
|
<body>
|