coder-config 0.41.9 → 0.41.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/constants.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "coder-config",
|
|
3
|
-
"version": "0.41.
|
|
3
|
+
"version": "0.41.11",
|
|
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",
|
|
@@ -601,7 +601,7 @@ WARNING: This link could potentially be dangerous`)){const v=window.open();if(v)
|
|
|
601
601
|
}`,className:"font-mono text-sm min-h-[100px]"})]})]})]})]})]})}const r8=[{id:"Default",name:"Default"},{id:"GitHub",name:"GitHub"},{id:"Monokai",name:"Monokai"},{id:"SolarizedDark",name:"Solarized Dark"},{id:"SolarizedLight",name:"Solarized Light"}],n8=[{id:"gemini-2.5-pro",name:"Gemini 2.5 Pro",description:"Most capable"},{id:"gemini-2.5-flash",name:"Gemini 2.5 Flash",description:"Fast and efficient"},{id:"gemini-2.0-pro",name:"Gemini 2.0 Pro",description:"Previous generation"},{id:"gemini-2.0-flash",name:"Gemini 2.0 Flash",description:"Previous generation fast"}];function Bj({settings:e,onSave:t,loading:n,settingsPath:s}){var P,N,R,I;const[o,u]=S.useState(e||{}),[d,l]=S.useState(!1),[c,f]=S.useState("rich"),[m,h]=S.useState(JSON.stringify(e||{},null,2)),[x,w]=S.useState({open:!1,name:"",json:""}),[k,_]=S.useState({}),y=async()=>{l(!0);try{if(c==="json")try{const O=JSON.parse(m);await t(O),u(O)}catch{Z.error("Invalid JSON"),l(!1);return}else await t(o),h(JSON.stringify(o,null,2));Z.success("Settings saved")}finally{l(!1)}},v=(O,F,H)=>{u(Y=>({...Y,[O]:{...Y[O],[F]:H}}))},g=(O,F,H=!1)=>{var Y;return((Y=o==null?void 0:o[O])==null?void 0:Y[F])??H},b=o.mcpServers||{},j=()=>{const{name:O,json:F}=x;if(!O.trim()){Z.error("Please enter a name for the MCP");return}let H;try{H=JSON.parse(F)}catch{Z.error("Invalid JSON configuration");return}if(!H.command){Z.error('MCP config must have a "command" field');return}u(Y=>({...Y,mcpServers:{...Y.mcpServers,[O.trim()]:H}})),w({open:!1,name:"",json:""}),Z.success(`Added MCP: ${O}`)},E=O=>{u(F=>{const{[O]:H,...Y}=F.mcpServers||{};return{...F,mcpServers:Y}}),Z.success(`Removed MCP: ${O}`)},A=O=>{_(F=>({...F,[O]:!F[O]}))};return r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"w-10 h-10 rounded-lg bg-blue-500/10 flex items-center justify-center",children:r.jsx(Mt,{className:"w-5 h-5 text-blue-500"})}),r.jsxs("div",{children:[r.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2",children:["Gemini CLI Settings",r.jsxs(Qe,{variant:"outline",className:"text-xs font-normal text-blue-600 border-blue-300 dark:border-blue-700",children:[r.jsx(zt,{className:"w-3 h-3 mr-1"}),"Google"]})]}),r.jsxs("p",{className:"text-sm text-muted-foreground",children:["Stored in: ",r.jsx("code",{className:"bg-muted px-1.5 py-0.5 rounded text-xs",children:s})]})]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs("div",{className:"flex bg-muted rounded-lg p-1",children:[r.jsx("button",{className:`px-3 py-1 text-sm rounded-md transition-colors ${c==="rich"?"bg-background shadow-sm":"text-muted-foreground hover:text-foreground"}`,onClick:()=>f("rich"),children:"Settings"}),r.jsx("button",{className:`px-3 py-1 text-sm rounded-md transition-colors ${c==="json"?"bg-background shadow-sm":"text-muted-foreground hover:text-foreground"}`,onClick:()=>{h(JSON.stringify(o,null,2)),f("json")},children:"JSON"})]}),r.jsxs(le,{onClick:y,disabled:d||n,children:[d?r.jsx(it,{className:"w-4 h-4 mr-2 animate-spin"}):r.jsx(hi,{className:"w-4 h-4 mr-2"}),"Save"]})]})]}),c==="json"?r.jsx("div",{className:"border border-border rounded-lg bg-card overflow-hidden",children:r.jsx(ft,{value:m,onChange:O=>h(O.target.value),className:"font-mono text-sm min-h-[500px] border-0 rounded-none resize-none",placeholder:"{ }"})}):r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card",children:[r.jsxs("div",{className:"flex items-center justify-between mb-4",children:[r.jsxs("h3",{className:"text-sm font-medium text-foreground flex items-center gap-2",children:[r.jsx($n,{className:"w-4 h-4 text-blue-500"}),"MCP Servers",r.jsx(Qe,{variant:"secondary",className:"text-xs",children:Object.keys(b).length})]}),r.jsxs(le,{size:"sm",variant:"outline",onClick:()=>w({open:!0,name:"",json:`{
|
|
602
602
|
"command": "npx",
|
|
603
603
|
"args": ["-y", "@example/mcp-server"]
|
|
604
|
-
}`}),children:[r.jsx(vt,{className:"w-4 h-4 mr-1"}),"Add MCP"]})]}),r.jsx("div",{className:"space-y-2",children:Object.keys(b).length===0?r.jsx("p",{className:"text-sm text-muted-foreground italic",children:"No MCP servers configured"}):Object.entries(b).map(([O,F])=>r.jsxs(Ol,{open:k[O],onOpenChange:()=>A(O),children:[r.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg border bg-background group",children:[r.jsxs(Bl,{className:"flex items-center gap-2 flex-1 text-left",children:[k[O]?r.jsx(vr,{className:"w-4 h-4 text-muted-foreground"}):r.jsx(Hr,{className:"w-4 h-4 text-muted-foreground"}),r.jsx($n,{className:"w-4 h-4 text-blue-500"}),r.jsx("span",{className:"font-medium text-sm",children:O}),r.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:F.command})]}),r.jsx(le,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0 opacity-0 group-hover:opacity-100 text-destructive hover:text-destructive",onClick:()=>E(O),children:r.jsx(mn,{className:"w-4 h-4"})})]}),r.jsx(Fl,{children:r.jsx("div",{className:"mt-2 ml-6 p-3 rounded-lg bg-muted/50 border",children:r.jsx("pre",{className:"text-xs font-mono text-muted-foreground overflow-x-auto",children:JSON.stringify(F,null,2)})})})]},O))})]}),r.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card",children:[r.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[r.jsx(zt,{className:"w-4 h-4 text-blue-500"}),"Model"]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx("label",{className:"text-sm font-medium text-foreground",children:"Default Model"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Model used for Gemini CLI sessions"})]}),r.jsxs(gr,{value:g("model","name",""),onValueChange:O=>v("model","name",O),children:[r.jsx(ur,{className:"w-48",children:r.jsx(xr,{placeholder:"Select model"})}),r.jsx(dr,{children:n8.map(O=>r.jsx(_t,{value:O.id,children:r.jsx("div",{className:"flex flex-col",children:r.jsx("span",{children:O.name})})},O.id))})]})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx("label",{className:"text-sm font-medium text-foreground",children:"Preview Features"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Enable access to experimental models and features"})]}),r.jsx(dt,{checked:g("general","previewFeatures",!1),onCheckedChange:O=>v("general","previewFeatures",O)})]})]})]}),r.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card",children:[r.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[r.jsx(w5,{className:"w-4 h-4 text-blue-500"}),"Appearance"]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx("label",{className:"text-sm font-medium text-foreground",children:"Theme"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Color theme for the CLI interface"})]}),r.jsxs(gr,{value:g("ui","theme","Default"),onValueChange:O=>v("ui","theme",O),children:[r.jsx(ur,{className:"w-40",children:r.jsx(xr,{})}),r.jsx(dr,{children:r8.map(O=>r.jsx(_t,{value:O.id,children:O.name},O.id))})]})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx("label",{className:"text-sm font-medium text-foreground",children:"Output Format"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Format for CLI output"})]}),r.jsxs(gr,{value:g("output","format","text"),onValueChange:O=>v("output","format",O),children:[r.jsx(ur,{className:"w-40",children:r.jsx(xr,{})}),r.jsxs(dr,{children:[r.jsx(_t,{value:"text",children:"Text"}),r.jsx(_t,{value:"json",children:"JSON"})]})]})]})]})]}),r.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card",children:[r.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[r.jsx(AC,{className:"w-4 h-4 text-blue-500"}),"Display Options"]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx("label",{className:"text-sm font-medium text-foreground",children:"Dynamic Window Title"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Update title with status icons (Ready, Working, etc.)"})]}),r.jsx(dt,{checked:g("ui","dynamicWindowTitle",!0),onCheckedChange:O=>v("ui","dynamicWindowTitle",O)})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx("label",{className:"text-sm font-medium text-foreground",children:"Show Line Numbers"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Display line numbers in chat"})]}),r.jsx(dt,{checked:g("ui","showLineNumbers",!0),onCheckedChange:O=>v("ui","showLineNumbers",O)})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx("label",{className:"text-sm font-medium text-foreground",children:"Show Citations"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Display citations for generated text"})]}),r.jsx(dt,{checked:g("ui","showCitations",!1),onCheckedChange:O=>v("ui","showCitations",O)})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx("label",{className:"text-sm font-medium text-foreground",children:"Hide Context Summary"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Hide GEMINI.md and MCP servers above input"})]}),r.jsx(dt,{checked:g("ui","hideContextSummary",!1),onCheckedChange:O=>v("ui","hideContextSummary",O)})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx("label",{className:"text-sm font-medium text-foreground",children:"Hide Footer"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Remove footer entirely from the UI"})]}),r.jsx(dt,{checked:g("ui","hideFooter",!1),onCheckedChange:O=>v("ui","hideFooter",O)})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx("label",{className:"text-sm font-medium text-foreground",children:"Screen Reader Mode"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Render output in plain-text for accessibility"})]}),r.jsx(dt,{checked:((N=(P=o==null?void 0:o.ui)==null?void 0:P.accessibility)==null?void 0:N.screenReader)??!1,onCheckedChange:O=>u(F=>{var H;return{...F,ui:{...F.ui,accessibility:{...(H=F.ui)==null?void 0:H.accessibility,screenReader:O}}}})})]})]})]}),r.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card",children:[r.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[r.jsx(fn,{className:"w-4 h-4 text-blue-500"}),"General"]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx("label",{className:"text-sm font-medium text-foreground",children:"Vim Mode"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Enable Vim keybindings in the prompt editor"})]}),r.jsx(dt,{checked:g("general","vimMode",!1),onCheckedChange:O=>v("general","vimMode",O)})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx("label",{className:"text-sm font-medium text-foreground",children:"Auto Update"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Allow automatic updates to Gemini CLI"})]}),r.jsx(dt,{checked:g("general","enableAutoUpdate",!0),onCheckedChange:O=>v("general","enableAutoUpdate",O)})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx("label",{className:"text-sm font-medium text-foreground",children:"Checkpointing"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Enable session recovery support"})]}),r.jsx(dt,{checked:((I=(R=o==null?void 0:o.general)==null?void 0:R.checkpointing)==null?void 0:I.enabled)??!1,onCheckedChange:O=>u(F=>{var H;return{...F,general:{...F.general,checkpointing:{...(H=F.general)==null?void 0:H.checkpointing,enabled:O}}}})})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx("label",{className:"text-sm font-medium text-foreground",children:"Respect .gitignore"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Exclude files matching .gitignore patterns"})]}),r.jsx(dt,{checked:g("general","respectGitignore",!0),onCheckedChange:O=>v("general","respectGitignore",O)})]})]})]}),r.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card",children:[r.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[r.jsx(ls,{className:"w-4 h-4 text-blue-500"}),"Privacy"]}),r.jsx("div",{className:"space-y-4",children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx("label",{className:"text-sm font-medium text-foreground",children:"Usage Statistics"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Allow collection of anonymous usage data"})]}),r.jsx(dt,{checked:g("privacy","usageStatisticsEnabled",!0),onCheckedChange:O=>v("privacy","usageStatisticsEnabled",O)})]})})]})]}),r.jsx(St,{open:x.open,onOpenChange:O=>w({...x,open:O}),children:r.jsxs(yt,{className:"bg-card",children:[r.jsxs(bt,{children:[r.jsx(wt,{children:"Add MCP Server"}),r.jsx(tr,{children:"Add a new MCP server to Gemini CLI"})]}),r.jsxs("div",{className:"space-y-4 py-4",children:[r.jsxs("div",{children:[r.jsx("label",{className:"text-sm font-medium",children:"Name"}),r.jsx(lt,{value:x.name,onChange:O=>w({...x,name:O.target.value}),placeholder:"my-mcp-server",className:"mt-1"})]}),r.jsxs("div",{children:[r.jsx("label",{className:"text-sm font-medium",children:"Configuration (JSON)"}),r.jsx(ft,{value:x.json,onChange:O=>w({...x,json:O.target.value}),className:"mt-1 font-mono text-sm",rows:6})]})]}),r.jsxs(Et,{children:[r.jsx(le,{variant:"ghost",onClick:()=>w({open:!1,name:"",json:""}),children:"Cancel"}),r.jsxs(le,{onClick:j,children:[r.jsx(vt,{className:"w-4 h-4 mr-2"}),"Add MCP"]})]})]})})]})}function s8({content:e,parsed:t,onSave:n,filePath:s}){const o=async l=>{const c=JSON.stringify(l,null,2);n(c)},u=(s==null?void 0:s.includes(".gemini"))||(s==null?void 0:s.includes("/.gemini/")),d=(s==null?void 0:s.includes(".agent"))||(s==null?void 0:s.includes("/antigravity/"));return u&&!d?r.jsx("div",{className:"h-full overflow-auto p-4",children:r.jsx(Bj,{settings:t||{},onSave:o,loading:!1,settingsPath:s||"~/.gemini/settings.json"})}):r.jsx("div",{className:"h-full overflow-auto p-4",children:r.jsx(Oj,{settings:t||{},onSave:o,loading:!1,settingsPath:s||"~/.claude/settings.json"})})}function i8({open:e,onClose:t,item:n,intermediatePaths:s,onMove:o}){const[u,d]=S.useState("copy"),[l,c]=S.useState(null),[f,m]=S.useState(""),[h,x]=S.useState(!1),w=()=>{const k=f.trim()||l;if(!k){Z.error("Please select or enter a target path");return}o(n.path,k,u,h)};return r.jsx(St,{open:e,onOpenChange:t,children:r.jsxs(yt,{className:"max-w-md",children:[r.jsxs(bt,{children:[r.jsxs(wt,{children:[u==="copy"?"Copy":"Move"," ",n==null?void 0:n.name]}),r.jsx(tr,{children:"Select a destination for this file"})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex gap-2",children:[r.jsxs(le,{variant:u==="copy"?"default":"outline",size:"sm",onClick:()=>d("copy"),children:[r.jsx(al,{className:"w-4 h-4 mr-1"})," Copy"]}),r.jsxs(le,{variant:u==="move"?"default":"outline",size:"sm",onClick:()=>d("move"),children:[r.jsx(TC,{className:"w-4 h-4 mr-1"})," Move"]})]}),r.jsx("div",{className:"space-y-2 max-h-48 overflow-y-auto",children:s==null?void 0:s.map(k=>r.jsxs("div",{className:Ne("flex items-center justify-between p-2 rounded border cursor-pointer",l===k.dir?"border-blue-500 bg-blue-50 dark:bg-blue-900/20":"hover:bg-gray-50 dark:hover:bg-slate-800"),onClick:()=>{c(k.dir),m("")},children:[r.jsxs("div",{className:"flex items-center gap-2",children:[k.isHome?r.jsx(qp,{className:"w-4 h-4"}):r.jsx(kr,{className:"w-4 h-4"}),r.jsx("span",{className:"text-sm",children:k.label})]}),k.hasClaudeFolder?r.jsx(Qe,{variant:"secondary",className:"text-xs",children:"exists"}):r.jsx(Qe,{variant:"outline",className:"text-xs",children:"create"})]},k.dir))}),r.jsxs("div",{children:[r.jsx("label",{className:"text-sm font-medium",children:"Or enter custom path:"}),r.jsx(lt,{className:"mt-1 font-mono text-sm",placeholder:"/path/to/directory",value:f,onChange:k=>{m(k.target.value),c(null)}})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(dt,{checked:h,onCheckedChange:x}),r.jsx("span",{className:"text-sm",children:"Merge if target exists"})]})]}),r.jsxs(Et,{children:[r.jsx(le,{variant:"ghost",onClick:t,children:"Cancel"}),r.jsx(le,{onClick:w,children:u==="copy"?"Copy":"Move"})]})]})})}function o8({open:e,onClose:t,item:n,onRename:s}){const[o,u]=S.useState("");S.useEffect(()=>{n!=null&&n.name&&u(n.name.replace(/\.md$/,""))},[n,e]);const d=()=>{if(!o.trim()){Z.error("Please enter a name");return}s(n,o.trim())};return r.jsx(St,{open:e,onOpenChange:t,children:r.jsxs(yt,{className:"sm:max-w-md",children:[r.jsx(bt,{children:r.jsxs(wt,{children:["Rename ",n==null?void 0:n.type]})}),r.jsxs("div",{children:[r.jsx("label",{className:"text-sm font-medium",children:"New name"}),r.jsx(lt,{className:"mt-1",placeholder:"new-name",value:o,onChange:l=>u(l.target.value),onKeyDown:l=>l.key==="Enter"&&d()}),r.jsx("p",{className:"text-xs text-gray-500 dark:text-slate-400 mt-1",children:".md extension will be added automatically"})]}),r.jsxs(Et,{children:[r.jsx(le,{variant:"ghost",onClick:t,children:"Cancel"}),r.jsx(le,{onClick:d,children:"Rename"})]})]})})}function a8({open:e,onClose:t,dir:n,type:s,onCreate:o}){const[u,d]=S.useState("");S.useEffect(()=>{d("")},[e]);const l=()=>{if((s==="command"||s==="rule"||s==="workflow"||s==="memory")&&!u.trim()){Z.error("Please enter a name");return}const m=s==="command"||s==="rule"||s==="workflow"||s==="memory"?u.endsWith(".md")?u:`${u}.md`:u;o(n,m,s)},c=pl[s]||{},f=s==="command"||s==="rule"||s==="workflow"||s==="memory";return r.jsx(St,{open:e,onOpenChange:t,children:r.jsxs(yt,{className:"max-w-sm",children:[r.jsx(bt,{children:r.jsxs(wt,{children:["Create ",c.label||s]})}),f&&r.jsxs("div",{children:[r.jsx("label",{className:"text-sm font-medium",children:"Name"}),r.jsx(lt,{className:"mt-1",placeholder:s==="command"?"my-command.md":s==="workflow"?"my-workflow.md":s==="memory"?"context.md":"my-rule.md",value:u,onChange:m=>d(m.target.value),onKeyDown:m=>m.key==="Enter"&&l()})]}),r.jsxs(Et,{children:[r.jsx(le,{variant:"ghost",onClick:t,children:"Cancel"}),r.jsx(le,{onClick:l,children:"Create"})]})]})})}function l8({project:e,onRefresh:t}){var ke,Re,qe;const[n,s]=S.useState([]),[o,u]=S.useState([]),[d,l]=S.useState(null),[c,f]=S.useState(null),[m,h]=S.useState(null),[x,w]=S.useState(()=>{try{return localStorage.getItem("claude-config-expanded-folder")||null}catch{return null}}),[k,_]=S.useState({}),[y,v]=S.useState(!0),[g,b]=S.useState({open:!1,item:null}),[j,E]=S.useState({open:!1,dir:null,type:null}),[A,P]=S.useState({open:!1,item:null}),[N,R]=S.useState(!1),[I,O]=S.useState({open:!1,projectDir:null}),[F,H]=S.useState({open:!1,dir:null,name:null}),[Y,z]=S.useState({open:!1,dir:null}),[K,G]=S.useState({x:0,y:0,item:null}),[U,L]=S.useState(["claude"]),M=S.useCallback(async()=>{var _e;try{v(!0);const[ye,De,ht,Nt]=await Promise.all([ve.getClaudeFolders(),ve.getIntermediatePaths(),ve.getRegistry(),ve.getConfig()]);if(s(ye),u(De),l(ht),L(((_e=Nt.config)==null?void 0:_e.enabledTools)||["claude"]),ye.length>0){const J=localStorage.getItem("claude-config-expanded-folder");if(!J||!ye.find(ge=>ge.dir===J)){const ge=ye.filter(Ke=>!Ke.isSubproject),Be=ge.length>1?ge[ge.length-1]:ge[0],Ue=(Be==null?void 0:Be.dir)||ye[0].dir;w(Ue);try{localStorage.setItem("claude-config-expanded-folder",Ue)}catch{}}}}catch(ye){Z.error("Failed to load data: "+ye.message)}finally{v(!1)}},[]);S.useEffect(()=>{M(),f(null),h(null)},[M,e==null?void 0:e.dir]);const B=_e=>{const ye=x===_e?null:_e;w(ye);try{ye?localStorage.setItem("claude-config-expanded-folder",ye):localStorage.removeItem("claude-config-expanded-folder")}catch{}},q=async _e=>{f(_e);try{const ye=await ve.getClaudeFile(_e.path);h(ye)}catch(ye){Z.error("Failed to load file: "+ye.message)}},$=async _e=>{if(c)try{await ve.saveClaudeFile(c.path,_e),Z.success("Saved");const ye=await ve.getClaudeFile(c.path);h(ye),M()}catch(ye){Z.error("Failed to save: "+ye.message)}},ae=_e=>{_(ye=>({...ye,[_e]:!ye[_e]}))},fe=(_e,ye)=>{_e.preventDefault(),G({x:_e.clientX,y:_e.clientY,item:ye})},me=async(_e,ye)=>{ye==="command"||ye==="rule"||ye==="workflow"||ye==="memory"?E({open:!0,dir:_e,type:ye}):ye==="claudemd"?z({open:!0,dir:_e}):X(_e,ye==="mcps"?"mcps.json":ye==="settings"?"settings.json":ye==="env"?".env":"CLAUDE.md",ye)},X=async(_e,ye,De)=>{try{const ht=await ve.createClaudeFile(_e,ye,De);if(Z.success("Created"),E({open:!1,dir:null,type:null}),await M(),ht.path){const Nt={path:ht.path,name:ye,type:De==="command"?"command":De==="rule"?"rule":De==="workflow"?"workflow":"file"};f(Nt),h(ht.content||"")}}catch(ht){Z.error("Failed to create: "+ht.message)}},W=async(_e,ye)=>{try{const De=await ve.renameClaudeFile(_e.path,ye);De.success?(Z.success("Renamed"),P({open:!1,item:null}),await M(),f({..._e,path:De.newPath,name:ye.endsWith(".md")?ye:`${ye}.md`})):Z.error(De.error||"Failed to rename")}catch(De){Z.error("Failed to rename: "+De.message)}},ce=async _e=>{if(confirm(`Delete ${_e.name}?`))try{await ve.deleteClaudeFile(_e.path),Z.success("Deleted"),(c==null?void 0:c.path)===_e.path&&(f(null),h(null)),M()}catch(ye){Z.error("Failed to delete: "+ye.message)}},se=async(_e,ye,De,ht)=>{try{await ve.moveClaudeItem(_e,ye,De,ht),Z.success(De==="copy"?"Copied":"Moved"),b({open:!1,item:null}),M()}catch(Nt){Z.error("Failed: "+Nt.message)}},Q=async _e=>{if(_e)try{const ye=await ve.addManualSubproject(I.projectDir,_e);ye.success?(Z.success(`Added sub-project: ${_e.split("/").pop()}`),O({open:!1,projectDir:null}),M()):Z.error(ye.error||"Failed to add sub-project")}catch(ye){Z.error("Failed to add sub-project: "+ye.message)}},oe=async _e=>{const ye=n.find(De=>!De.isSubproject&&!De.isHome);if(ye)try{const De=await ve.removeManualSubproject(ye.dir,_e);De.success?(Z.success("Removed sub-project"),M()):Z.error(De.error||"Failed to remove sub-project")}catch(De){Z.error("Failed to remove sub-project: "+De.message)}},we=async _e=>{const ye=n.find(De=>!De.isSubproject&&!De.isHome);if(ye)try{const De=await ve.hideSubproject(ye.dir,_e);De.success?(Z.success("Sub-project hidden"),M()):Z.error(De.error||"Failed to hide sub-project")}catch(De){Z.error("Failed to hide sub-project: "+De.message)}},Ie=()=>{if(!c||!m)return r.jsx("div",{className:"h-full flex items-center justify-center text-gray-500 dark:text-slate-400",children:r.jsxs("div",{className:"text-center",children:[r.jsx(Mm,{className:"w-12 h-12 mx-auto mb-2 opacity-50"}),r.jsx("p",{children:"Select a file to edit"})]})});const _e=c.path?c.path.replace(/\/.claude\/mcps\.json$/,""):null;switch(c.type){case"mcps":return r.jsx(jF,{content:m.content,parsed:m.parsed,onSave:$,registry:d,configDir:_e});case"settings":return r.jsx(s8,{content:m.content,parsed:m.parsed,onSave:$,filePath:c==null?void 0:c.path});case"command":case"rule":case"workflow":case"claudemd":case"env":return r.jsx(Yb,{content:m.content,onSave:$,fileType:c.type});default:return r.jsx(Yb,{content:m.content,onSave:$,fileType:"claudemd"})}};if(y)return r.jsx("div",{className:"h-full flex items-center justify-center",children:r.jsx(yr,{className:"w-6 h-6 animate-spin text-gray-400"})});const We=n.some(_e=>_e.isSubproject),ne=(_e,ye)=>ye===0,de=(_e,ye)=>{const De=n.findIndex(ht=>ht.isSubproject);return!_e.isSubproject&&(De>=0?ye===De-1:ye===n.length-1)};return r.jsxs("div",{className:"h-full flex",children:[r.jsxs("div",{className:"w-76 border-r flex flex-col bg-white dark:bg-slate-950",children:[r.jsxs("div",{className:"flex items-center justify-between p-3 border-b",children:[r.jsx("h2",{className:"font-semibold text-sm",children:"Project Config"}),r.jsxs("div",{className:"flex gap-1",children:[U.includes("claude")&&U.includes("antigravity")&&r.jsxs(le,{variant:"ghost",size:"sm",className:"h-7 px-2",onClick:()=>R(!0),title:"Sync rules between tools",children:[r.jsx(sM,{className:"w-4 h-4 mr-1"}),"Sync"]}),r.jsx(le,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:M,children:r.jsx(yr,{className:"w-4 h-4"})})]})]}),r.jsx(En,{className:"flex-1",children:n.map((_e,ye)=>r.jsx(eF,{folder:_e,isExpanded:x===_e.dir,isHome:ne(_e,ye),isProject:de(_e,ye),isSubproject:_e.isSubproject,depth:_e.depth||0,onToggle:()=>B(_e.dir),onCreateFile:me,onInstallPlugin:(De,ht)=>H({open:!0,dir:De,name:ht}),onSelectItem:q,selectedPath:c==null?void 0:c.path,onContextMenu:fe,expandedFolders:k,onToggleFolder:ae,hasSubprojects:We,onAddSubproject:De=>O({open:!0,projectDir:De}),onRemoveSubproject:oe,onHideSubproject:we},_e.dir))})]}),r.jsxs("div",{className:"flex-1 flex flex-col bg-gray-50 dark:bg-slate-900",children:[c&&r.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b bg-white dark:bg-slate-950",children:[r.jsx("div",{className:"flex items-center gap-2 text-sm",children:r.jsx("span",{className:"text-gray-500 dark:text-slate-400 font-mono truncate max-w-md",children:c.path})}),r.jsxs("div",{className:"flex gap-1",children:[r.jsx(le,{variant:"ghost",size:"sm",onClick:()=>b({open:!0,item:c}),children:r.jsx(al,{className:"w-4 h-4"})}),r.jsx(le,{variant:"ghost",size:"sm",onClick:()=>ce(c),children:r.jsx(mn,{className:"w-4 h-4"})})]})]}),r.jsx("div",{className:"flex-1",children:Ie()})]}),K.item&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>G({x:0,y:0,item:null})}),r.jsxs("div",{className:"fixed z-50 bg-white dark:bg-slate-950 rounded-md shadow-lg border py-1 min-w-[160px]",style:{left:K.x,top:K.y},children:[(((ke=K.item)==null?void 0:ke.type)==="rule"||((Re=K.item)==null?void 0:Re.type)==="command"||((qe=K.item)==null?void 0:qe.type)==="workflow")&&r.jsxs("button",{className:"w-full px-3 py-2 text-sm text-left hover:bg-gray-100 dark:hover:bg-slate-800 flex items-center",onClick:()=>{P({open:!0,item:K.item}),G({x:0,y:0,item:null})},children:[r.jsx(MC,{className:"w-4 h-4 mr-2"})," Rename"]}),r.jsxs("button",{className:"w-full px-3 py-2 text-sm text-left hover:bg-gray-100 dark:hover:bg-slate-800 flex items-center",onClick:()=>{b({open:!0,item:K.item}),G({x:0,y:0,item:null})},children:[r.jsx(al,{className:"w-4 h-4 mr-2"})," Copy to..."]}),r.jsxs("button",{className:"w-full px-3 py-2 text-sm text-left hover:bg-gray-100 dark:hover:bg-slate-800 flex items-center",onClick:()=>{b({open:!0,item:K.item}),G({x:0,y:0,item:null})},children:[r.jsx(TC,{className:"w-4 h-4 mr-2"})," Move to..."]}),r.jsx("div",{className:"border-t my-1"}),r.jsxs("button",{className:"w-full px-3 py-2 text-sm text-left hover:bg-gray-100 dark:hover:bg-slate-800 flex items-center text-red-600",onClick:()=>{ce(K.item),G({x:0,y:0,item:null})},children:[r.jsx(mn,{className:"w-4 h-4 mr-2"})," Delete"]})]})]}),r.jsx(i8,{open:g.open,onClose:()=>b({open:!1,item:null}),item:g.item,intermediatePaths:o,onMove:se}),r.jsx(a8,{open:j.open,onClose:()=>E({open:!1,dir:null,type:null}),dir:j.dir,type:j.type,onCreate:X}),r.jsx(o8,{open:A.open,onClose:()=>P({open:!1,item:null}),item:A.item,onRename:W}),r.jsx(d6,{open:N,onOpenChange:R,projectDir:e==null?void 0:e.dir,onSynced:M}),r.jsx(GB,{open:F.open,onOpenChange:_e=>H({...F,open:_e}),projectDir:F.dir,projectName:F.name}),r.jsx(Ng,{open:I.open,onOpenChange:_e=>O({...I,open:_e}),onSelect:Q,type:"directory",title:"Add Sub-project",initialPath:I.projectDir||"~"}),r.jsx(ZB,{open:Y.open,onOpenChange:_e=>{z({...Y,open:_e}),_e||M()},title:"Initialize CLAUDE.md",description:"Running claude -p /init to generate project-aware CLAUDE.md",cwd:Y.dir,initialCommand:"claude -p /init; exit",autoCloseOnExit:!0,autoCloseDelay:2e3})]})}function c8({projects:e=[],activeProject:t=null,onSwitch:n,onAddClick:s,onManageClick:o,disabled:u=!1}){const d=(t==null?void 0:t.name)||"No Project";return r.jsxs(ci,{children:[r.jsx(ui,{asChild:!0,children:r.jsxs(le,{variant:"outline",className:"gap-2 max-w-[220px] h-9",disabled:u,children:[r.jsx(oi,{className:"w-4 h-4 text-indigo-500 flex-shrink-0"}),r.jsx("span",{className:"truncate font-medium",children:d}),r.jsx(vr,{className:"w-4 h-4 opacity-50 flex-shrink-0"})]})}),r.jsxs(js,{align:"start",className:"w-72",children:[r.jsx(ml,{className:"text-xs text-gray-500 font-normal",children:"Projects"}),r.jsx(zr,{}),e.length===0?r.jsxs("div",{className:"px-3 py-6 text-sm text-gray-500 text-center",children:[r.jsx(kr,{className:"w-8 h-8 mx-auto mb-2 text-gray-300"}),r.jsx("p",{children:"No projects registered"}),r.jsx("p",{className:"text-xs mt-1",children:"Add a project to get started"})]}):r.jsx("div",{className:"max-h-64 overflow-y-auto",children:e.map(l=>r.jsxs(Rt,{onClick:()=>!l.isActive&&n(l.id),className:`flex items-start gap-2 py-2 cursor-pointer ${l.isActive?"bg-indigo-50":""}`,disabled:l.isActive,children:[r.jsx("div",{className:"mt-0.5 flex-shrink-0",children:l.isActive?r.jsx(Gt,{className:"w-4 h-4 text-indigo-600"}):l.exists?r.jsx(kr,{className:"w-4 h-4 text-gray-400"}):r.jsx(rd,{className:"w-4 h-4 text-amber-500"})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("div",{className:`truncate font-medium ${l.isActive?"text-indigo-700":""}`,children:l.name}),r.jsx("div",{className:"truncate text-xs text-gray-400 font-mono",children:l.path.replace(/^\/Users\/[^/]+/,"~")}),!l.exists&&r.jsx("div",{className:"text-xs text-amber-600 mt-0.5",children:"Path not found"})]}),l.hasClaudeConfig&&r.jsx("div",{className:"flex-shrink-0",children:r.jsx("div",{className:"w-2 h-2 rounded-full bg-green-400",title:"Has .claude config"})})]},l.id))}),r.jsx(zr,{}),r.jsxs(Rt,{onClick:s,className:"gap-2 cursor-pointer",children:[r.jsx(vt,{className:"w-4 h-4"}),"Add Project"]}),e.length>0&&r.jsxs(Rt,{onClick:o,className:"gap-2 cursor-pointer",children:[r.jsx(Dm,{className:"w-4 h-4"}),"Manage Projects"]})]})]})}const tm="claude-config-welcome-seen";function u8({onStartTutorial:e}){const[t,n]=S.useState(!1),[s,o]=S.useState(!0);S.useEffect(()=>{if(!localStorage.getItem(tm)){const c=setTimeout(()=>n(!0),500);return()=>clearTimeout(c)}},[]);const u=()=>{s&&localStorage.setItem(tm,"true"),n(!1)},d=()=>{s&&localStorage.setItem(tm,"true"),n(!1),e==null||e()};return r.jsx(St,{open:t,onOpenChange:n,children:r.jsxs(yt,{className:"sm:max-w-lg",children:[r.jsxs(bt,{children:[r.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[r.jsx("div",{className:"w-12 h-12 rounded-xl bg-gradient-to-br from-indigo-500 to-purple-600 flex items-center justify-center shadow-lg",children:r.jsx(fn,{className:"w-6 h-6 text-white"})}),r.jsx(wt,{className:"text-2xl",children:"Welcome to Coder Config"})]}),r.jsx(tr,{className:"text-base pt-2",children:"Your control center for Claude Code and AI coding tools."})]}),r.jsxs("div",{className:"py-4 space-y-4",children:[r.jsx("p",{className:"text-sm text-muted-foreground",children:"We built Coder Config because managing AI coding assistants shouldn't require editing JSON files or memorizing command-line flags. You deserve a visual interface that makes configuration easy."}),r.jsxs("div",{className:"grid grid-cols-3 gap-3 py-2",children:[r.jsxs("div",{className:"text-center p-3 rounded-lg bg-muted/50",children:[r.jsx(ss,{className:"w-5 h-5 mx-auto mb-2 text-indigo-500"}),r.jsx("span",{className:"text-xs text-muted-foreground",children:"MCP Servers"})]}),r.jsxs("div",{className:"text-center p-3 rounded-lg bg-muted/50",children:[r.jsx(ls,{className:"w-5 h-5 mx-auto mb-2 text-green-500"}),r.jsx("span",{className:"text-xs text-muted-foreground",children:"Permissions"})]}),r.jsxs("div",{className:"text-center p-3 rounded-lg bg-muted/50",children:[r.jsx(zt,{className:"w-5 h-5 mx-auto mb-2 text-amber-500"}),r.jsx("span",{className:"text-xs text-muted-foreground",children:"Rules & Memory"})]})]}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"Take our guided tutorial to learn the basics, or dive in and explore on your own."}),r.jsxs("div",{className:"flex items-center gap-2 pt-2",children:[r.jsx(Al,{id:"dont-ask",checked:s,onCheckedChange:o}),r.jsx(Ft,{htmlFor:"dont-ask",className:"text-sm text-muted-foreground cursor-pointer",children:"Don't show this again"})]})]}),r.jsxs(Et,{className:"flex gap-2 sm:gap-2",children:[r.jsx(le,{variant:"ghost",onClick:u,children:"Skip for now"}),r.jsxs(le,{onClick:d,className:"gap-2",children:[r.jsx(Au,{className:"w-4 h-4"}),"Start Tutorial",r.jsx(Up,{className:"w-4 h-4"})]})]})]})})}const rm="claude-config:claude-init-preference";function Fj({open:e,onOpenChange:t,onAdded:n}){const[s,o]=S.useState(""),[u,d]=S.useState(""),[l,c]=S.useState(!1),[f,m]=S.useState(!1),[h,x]=S.useState(!0),[w,k]=S.useState([]),[_,y]=S.useState(null),v=S.useRef(null);S.useEffect(()=>{const E=localStorage.getItem(rm);E==="never"?x(!1):E==="always"&&x(!0)},[]),S.useEffect(()=>{if(e){o(""),d(""),k([]),y(null);const E=localStorage.getItem(rm);x(E!=="never")}},[e]),S.useEffect(()=>{v.current&&(v.current.scrollTop=v.current.scrollHeight)},[w]),S.useEffect(()=>{if(s&&!u){const E=s.split("/").pop();d(E||"")}},[s]);const g=E=>{o(E),c(!1)},b=async()=>{if(!s){Z.error("Please select a project path");return}m(!0),k([]),y(null);try{if(h){y("running");const A=await new Promise(P=>{const N=new EventSource(`/api/projects/init-stream?path=${encodeURIComponent(s)}`);N.onmessage=R=>{const I=JSON.parse(R.data);I.type==="output"?k(O=>[...O,I.text]):I.type==="status"?k(O=>[...O,I.message+`
|
|
604
|
+
}`}),children:[r.jsx(vt,{className:"w-4 h-4 mr-1"}),"Add MCP"]})]}),r.jsx("div",{className:"space-y-2",children:Object.keys(b).length===0?r.jsx("p",{className:"text-sm text-muted-foreground italic",children:"No MCP servers configured"}):Object.entries(b).map(([O,F])=>r.jsxs(Ol,{open:k[O],onOpenChange:()=>A(O),children:[r.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg border bg-background group",children:[r.jsxs(Bl,{className:"flex items-center gap-2 flex-1 text-left",children:[k[O]?r.jsx(vr,{className:"w-4 h-4 text-muted-foreground"}):r.jsx(Hr,{className:"w-4 h-4 text-muted-foreground"}),r.jsx($n,{className:"w-4 h-4 text-blue-500"}),r.jsx("span",{className:"font-medium text-sm",children:O}),r.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:F.command})]}),r.jsx(le,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0 opacity-0 group-hover:opacity-100 text-destructive hover:text-destructive",onClick:()=>E(O),children:r.jsx(mn,{className:"w-4 h-4"})})]}),r.jsx(Fl,{children:r.jsx("div",{className:"mt-2 ml-6 p-3 rounded-lg bg-muted/50 border",children:r.jsx("pre",{className:"text-xs font-mono text-muted-foreground overflow-x-auto",children:JSON.stringify(F,null,2)})})})]},O))})]}),r.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card",children:[r.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[r.jsx(zt,{className:"w-4 h-4 text-blue-500"}),"Model"]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx("label",{className:"text-sm font-medium text-foreground",children:"Default Model"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Model used for Gemini CLI sessions"})]}),r.jsxs(gr,{value:g("model","name",""),onValueChange:O=>v("model","name",O),children:[r.jsx(ur,{className:"w-48",children:r.jsx(xr,{placeholder:"Select model"})}),r.jsx(dr,{children:n8.map(O=>r.jsx(_t,{value:O.id,children:r.jsx("div",{className:"flex flex-col",children:r.jsx("span",{children:O.name})})},O.id))})]})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx("label",{className:"text-sm font-medium text-foreground",children:"Preview Features"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Enable access to experimental models and features"})]}),r.jsx(dt,{checked:g("general","previewFeatures",!1),onCheckedChange:O=>v("general","previewFeatures",O)})]})]})]}),r.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card",children:[r.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[r.jsx(w5,{className:"w-4 h-4 text-blue-500"}),"Appearance"]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx("label",{className:"text-sm font-medium text-foreground",children:"Theme"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Color theme for the CLI interface"})]}),r.jsxs(gr,{value:g("ui","theme","Default"),onValueChange:O=>v("ui","theme",O),children:[r.jsx(ur,{className:"w-40",children:r.jsx(xr,{})}),r.jsx(dr,{children:r8.map(O=>r.jsx(_t,{value:O.id,children:O.name},O.id))})]})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx("label",{className:"text-sm font-medium text-foreground",children:"Output Format"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Format for CLI output"})]}),r.jsxs(gr,{value:g("output","format","text"),onValueChange:O=>v("output","format",O),children:[r.jsx(ur,{className:"w-40",children:r.jsx(xr,{})}),r.jsxs(dr,{children:[r.jsx(_t,{value:"text",children:"Text"}),r.jsx(_t,{value:"json",children:"JSON"})]})]})]})]})]}),r.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card",children:[r.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[r.jsx(AC,{className:"w-4 h-4 text-blue-500"}),"Display Options"]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx("label",{className:"text-sm font-medium text-foreground",children:"Dynamic Window Title"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Update title with status icons (Ready, Working, etc.)"})]}),r.jsx(dt,{checked:g("ui","dynamicWindowTitle",!0),onCheckedChange:O=>v("ui","dynamicWindowTitle",O)})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx("label",{className:"text-sm font-medium text-foreground",children:"Show Line Numbers"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Display line numbers in chat"})]}),r.jsx(dt,{checked:g("ui","showLineNumbers",!0),onCheckedChange:O=>v("ui","showLineNumbers",O)})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx("label",{className:"text-sm font-medium text-foreground",children:"Show Citations"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Display citations for generated text"})]}),r.jsx(dt,{checked:g("ui","showCitations",!1),onCheckedChange:O=>v("ui","showCitations",O)})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx("label",{className:"text-sm font-medium text-foreground",children:"Hide Context Summary"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Hide GEMINI.md and MCP servers above input"})]}),r.jsx(dt,{checked:g("ui","hideContextSummary",!1),onCheckedChange:O=>v("ui","hideContextSummary",O)})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx("label",{className:"text-sm font-medium text-foreground",children:"Hide Footer"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Remove footer entirely from the UI"})]}),r.jsx(dt,{checked:g("ui","hideFooter",!1),onCheckedChange:O=>v("ui","hideFooter",O)})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx("label",{className:"text-sm font-medium text-foreground",children:"Screen Reader Mode"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Render output in plain-text for accessibility"})]}),r.jsx(dt,{checked:((N=(P=o==null?void 0:o.ui)==null?void 0:P.accessibility)==null?void 0:N.screenReader)??!1,onCheckedChange:O=>u(F=>{var H;return{...F,ui:{...F.ui,accessibility:{...(H=F.ui)==null?void 0:H.accessibility,screenReader:O}}}})})]})]})]}),r.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card",children:[r.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[r.jsx(fn,{className:"w-4 h-4 text-blue-500"}),"General"]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx("label",{className:"text-sm font-medium text-foreground",children:"Vim Mode"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Enable Vim keybindings in the prompt editor"})]}),r.jsx(dt,{checked:g("general","vimMode",!1),onCheckedChange:O=>v("general","vimMode",O)})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx("label",{className:"text-sm font-medium text-foreground",children:"Auto Update"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Allow automatic updates to Gemini CLI"})]}),r.jsx(dt,{checked:g("general","enableAutoUpdate",!0),onCheckedChange:O=>v("general","enableAutoUpdate",O)})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx("label",{className:"text-sm font-medium text-foreground",children:"Checkpointing"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Enable session recovery support"})]}),r.jsx(dt,{checked:((I=(R=o==null?void 0:o.general)==null?void 0:R.checkpointing)==null?void 0:I.enabled)??!1,onCheckedChange:O=>u(F=>{var H;return{...F,general:{...F.general,checkpointing:{...(H=F.general)==null?void 0:H.checkpointing,enabled:O}}}})})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx("label",{className:"text-sm font-medium text-foreground",children:"Respect .gitignore"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Exclude files matching .gitignore patterns"})]}),r.jsx(dt,{checked:g("general","respectGitignore",!0),onCheckedChange:O=>v("general","respectGitignore",O)})]})]})]}),r.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card",children:[r.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[r.jsx(ls,{className:"w-4 h-4 text-blue-500"}),"Privacy"]}),r.jsx("div",{className:"space-y-4",children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx("label",{className:"text-sm font-medium text-foreground",children:"Usage Statistics"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Allow collection of anonymous usage data"})]}),r.jsx(dt,{checked:g("privacy","usageStatisticsEnabled",!0),onCheckedChange:O=>v("privacy","usageStatisticsEnabled",O)})]})})]})]}),r.jsx(St,{open:x.open,onOpenChange:O=>w({...x,open:O}),children:r.jsxs(yt,{className:"bg-card",children:[r.jsxs(bt,{children:[r.jsx(wt,{children:"Add MCP Server"}),r.jsx(tr,{children:"Add a new MCP server to Gemini CLI"})]}),r.jsxs("div",{className:"space-y-4 py-4",children:[r.jsxs("div",{children:[r.jsx("label",{className:"text-sm font-medium",children:"Name"}),r.jsx(lt,{value:x.name,onChange:O=>w({...x,name:O.target.value}),placeholder:"my-mcp-server",className:"mt-1"})]}),r.jsxs("div",{children:[r.jsx("label",{className:"text-sm font-medium",children:"Configuration (JSON)"}),r.jsx(ft,{value:x.json,onChange:O=>w({...x,json:O.target.value}),className:"mt-1 font-mono text-sm",rows:6})]})]}),r.jsxs(Et,{children:[r.jsx(le,{variant:"ghost",onClick:()=>w({open:!1,name:"",json:""}),children:"Cancel"}),r.jsxs(le,{onClick:j,children:[r.jsx(vt,{className:"w-4 h-4 mr-2"}),"Add MCP"]})]})]})})]})}function s8({content:e,parsed:t,onSave:n,filePath:s}){const o=async l=>{const c=JSON.stringify(l,null,2);n(c)},u=(s==null?void 0:s.includes(".gemini"))||(s==null?void 0:s.includes("/.gemini/")),d=(s==null?void 0:s.includes(".agent"))||(s==null?void 0:s.includes("/antigravity/"));return u&&!d?r.jsx("div",{className:"h-full overflow-auto p-4",children:r.jsx(Bj,{settings:t||{},onSave:o,loading:!1,settingsPath:s||"~/.gemini/settings.json"})}):r.jsx("div",{className:"h-full overflow-auto p-4",children:r.jsx(Oj,{settings:t||{},onSave:o,loading:!1,settingsPath:s||"~/.claude/settings.json"})})}function i8({open:e,onClose:t,item:n,intermediatePaths:s,onMove:o}){const[u,d]=S.useState("copy"),[l,c]=S.useState(null),[f,m]=S.useState(""),[h,x]=S.useState(!1),w=()=>{const k=f.trim()||l;if(!k){Z.error("Please select or enter a target path");return}o(n.path,k,u,h)};return r.jsx(St,{open:e,onOpenChange:t,children:r.jsxs(yt,{className:"max-w-md",children:[r.jsxs(bt,{children:[r.jsxs(wt,{children:[u==="copy"?"Copy":"Move"," ",n==null?void 0:n.name]}),r.jsx(tr,{children:"Select a destination for this file"})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex gap-2",children:[r.jsxs(le,{variant:u==="copy"?"default":"outline",size:"sm",onClick:()=>d("copy"),children:[r.jsx(al,{className:"w-4 h-4 mr-1"})," Copy"]}),r.jsxs(le,{variant:u==="move"?"default":"outline",size:"sm",onClick:()=>d("move"),children:[r.jsx(TC,{className:"w-4 h-4 mr-1"})," Move"]})]}),r.jsx("div",{className:"space-y-2 max-h-48 overflow-y-auto",children:s==null?void 0:s.map(k=>r.jsxs("div",{className:Ne("flex items-center justify-between p-2 rounded border cursor-pointer",l===k.dir?"border-blue-500 bg-blue-50 dark:bg-blue-900/20":"hover:bg-gray-50 dark:hover:bg-slate-800"),onClick:()=>{c(k.dir),m("")},children:[r.jsxs("div",{className:"flex items-center gap-2",children:[k.isHome?r.jsx(qp,{className:"w-4 h-4"}):r.jsx(kr,{className:"w-4 h-4"}),r.jsx("span",{className:"text-sm",children:k.label})]}),k.hasClaudeFolder?r.jsx(Qe,{variant:"secondary",className:"text-xs",children:"exists"}):r.jsx(Qe,{variant:"outline",className:"text-xs",children:"create"})]},k.dir))}),r.jsxs("div",{children:[r.jsx("label",{className:"text-sm font-medium",children:"Or enter custom path:"}),r.jsx(lt,{className:"mt-1 font-mono text-sm",placeholder:"/path/to/directory",value:f,onChange:k=>{m(k.target.value),c(null)}})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(dt,{checked:h,onCheckedChange:x}),r.jsx("span",{className:"text-sm",children:"Merge if target exists"})]})]}),r.jsxs(Et,{children:[r.jsx(le,{variant:"ghost",onClick:t,children:"Cancel"}),r.jsx(le,{onClick:w,children:u==="copy"?"Copy":"Move"})]})]})})}function o8({open:e,onClose:t,item:n,onRename:s}){const[o,u]=S.useState("");S.useEffect(()=>{n!=null&&n.name&&u(n.name.replace(/\.md$/,""))},[n,e]);const d=()=>{if(!o.trim()){Z.error("Please enter a name");return}s(n,o.trim())};return r.jsx(St,{open:e,onOpenChange:t,children:r.jsxs(yt,{className:"sm:max-w-md",children:[r.jsx(bt,{children:r.jsxs(wt,{children:["Rename ",n==null?void 0:n.type]})}),r.jsxs("div",{children:[r.jsx("label",{className:"text-sm font-medium",children:"New name"}),r.jsx(lt,{className:"mt-1",placeholder:"new-name",value:o,onChange:l=>u(l.target.value),onKeyDown:l=>l.key==="Enter"&&d()}),r.jsx("p",{className:"text-xs text-gray-500 dark:text-slate-400 mt-1",children:".md extension will be added automatically"})]}),r.jsxs(Et,{children:[r.jsx(le,{variant:"ghost",onClick:t,children:"Cancel"}),r.jsx(le,{onClick:d,children:"Rename"})]})]})})}function a8({open:e,onClose:t,dir:n,type:s,onCreate:o}){const[u,d]=S.useState("");S.useEffect(()=>{d("")},[e]);const l=()=>{if((s==="command"||s==="rule"||s==="workflow"||s==="memory")&&!u.trim()){Z.error("Please enter a name");return}const m=s==="command"||s==="rule"||s==="workflow"||s==="memory"?u.endsWith(".md")?u:`${u}.md`:u;o(n,m,s)},c=pl[s]||{},f=s==="command"||s==="rule"||s==="workflow"||s==="memory";return r.jsx(St,{open:e,onOpenChange:t,children:r.jsxs(yt,{className:"max-w-sm",children:[r.jsx(bt,{children:r.jsxs(wt,{children:["Create ",c.label||s]})}),f&&r.jsxs("div",{children:[r.jsx("label",{className:"text-sm font-medium",children:"Name"}),r.jsx(lt,{className:"mt-1",placeholder:s==="command"?"my-command.md":s==="workflow"?"my-workflow.md":s==="memory"?"context.md":"my-rule.md",value:u,onChange:m=>d(m.target.value),onKeyDown:m=>m.key==="Enter"&&l()})]}),r.jsxs(Et,{children:[r.jsx(le,{variant:"ghost",onClick:t,children:"Cancel"}),r.jsx(le,{onClick:l,children:"Create"})]})]})})}function l8({project:e,onRefresh:t}){var ke,Re,qe;const[n,s]=S.useState([]),[o,u]=S.useState([]),[d,l]=S.useState(null),[c,f]=S.useState(null),[m,h]=S.useState(null),[x,w]=S.useState(()=>{try{return localStorage.getItem("claude-config-expanded-folder")||null}catch{return null}}),[k,_]=S.useState({}),[y,v]=S.useState(!0),[g,b]=S.useState({open:!1,item:null}),[j,E]=S.useState({open:!1,dir:null,type:null}),[A,P]=S.useState({open:!1,item:null}),[N,R]=S.useState(!1),[I,O]=S.useState({open:!1,projectDir:null}),[F,H]=S.useState({open:!1,dir:null,name:null}),[Y,z]=S.useState({open:!1,dir:null}),[K,G]=S.useState({x:0,y:0,item:null}),[U,L]=S.useState(["claude"]),M=S.useCallback(async()=>{var _e;try{v(!0);const[ye,De,ht,Nt]=await Promise.all([ve.getClaudeFolders(),ve.getIntermediatePaths(),ve.getRegistry(),ve.getConfig()]);if(s(ye),u(De),l(ht),L(((_e=Nt.config)==null?void 0:_e.enabledTools)||["claude"]),ye.length>0){const J=localStorage.getItem("claude-config-expanded-folder");if(!J||!ye.find(ge=>ge.dir===J)){const ge=ye.filter(Ke=>!Ke.isSubproject),Be=ge.length>1?ge[ge.length-1]:ge[0],Ue=(Be==null?void 0:Be.dir)||ye[0].dir;w(Ue);try{localStorage.setItem("claude-config-expanded-folder",Ue)}catch{}}}}catch(ye){Z.error("Failed to load data: "+ye.message)}finally{v(!1)}},[]);S.useEffect(()=>{M(),f(null),h(null)},[M,e==null?void 0:e.dir]);const B=_e=>{const ye=x===_e?null:_e;w(ye);try{ye?localStorage.setItem("claude-config-expanded-folder",ye):localStorage.removeItem("claude-config-expanded-folder")}catch{}},q=async _e=>{f(_e);try{const ye=await ve.getClaudeFile(_e.path);h(ye)}catch(ye){Z.error("Failed to load file: "+ye.message)}},$=async _e=>{if(c)try{await ve.saveClaudeFile(c.path,_e),Z.success("Saved");const ye=await ve.getClaudeFile(c.path);h(ye),M()}catch(ye){Z.error("Failed to save: "+ye.message)}},ae=_e=>{_(ye=>({...ye,[_e]:!ye[_e]}))},fe=(_e,ye)=>{_e.preventDefault(),G({x:_e.clientX,y:_e.clientY,item:ye})},me=async(_e,ye)=>{ye==="command"||ye==="rule"||ye==="workflow"||ye==="memory"?E({open:!0,dir:_e,type:ye}):ye==="claudemd"?z({open:!0,dir:_e}):X(_e,ye==="mcps"?"mcps.json":ye==="settings"?"settings.json":ye==="env"?".env":"CLAUDE.md",ye)},X=async(_e,ye,De)=>{try{const ht=await ve.createClaudeFile(_e,ye,De);if(Z.success("Created"),E({open:!1,dir:null,type:null}),await M(),ht.path){const Nt={path:ht.path,name:ye,type:["command","rule","workflow","env","mcps","settings","claudemd","memory"].includes(De)?De:"file"};f(Nt),h({content:ht.content||"",parsed:null})}}catch(ht){Z.error("Failed to create: "+ht.message)}},W=async(_e,ye)=>{try{const De=await ve.renameClaudeFile(_e.path,ye);De.success?(Z.success("Renamed"),P({open:!1,item:null}),await M(),f({..._e,path:De.newPath,name:ye.endsWith(".md")?ye:`${ye}.md`})):Z.error(De.error||"Failed to rename")}catch(De){Z.error("Failed to rename: "+De.message)}},ce=async _e=>{if(confirm(`Delete ${_e.name}?`))try{await ve.deleteClaudeFile(_e.path),Z.success("Deleted"),(c==null?void 0:c.path)===_e.path&&(f(null),h(null)),M()}catch(ye){Z.error("Failed to delete: "+ye.message)}},se=async(_e,ye,De,ht)=>{try{await ve.moveClaudeItem(_e,ye,De,ht),Z.success(De==="copy"?"Copied":"Moved"),b({open:!1,item:null}),M()}catch(Nt){Z.error("Failed: "+Nt.message)}},Q=async _e=>{if(_e)try{const ye=await ve.addManualSubproject(I.projectDir,_e);ye.success?(Z.success(`Added sub-project: ${_e.split("/").pop()}`),O({open:!1,projectDir:null}),M()):Z.error(ye.error||"Failed to add sub-project")}catch(ye){Z.error("Failed to add sub-project: "+ye.message)}},oe=async _e=>{const ye=n.find(De=>!De.isSubproject&&!De.isHome);if(ye)try{const De=await ve.removeManualSubproject(ye.dir,_e);De.success?(Z.success("Removed sub-project"),M()):Z.error(De.error||"Failed to remove sub-project")}catch(De){Z.error("Failed to remove sub-project: "+De.message)}},we=async _e=>{const ye=n.find(De=>!De.isSubproject&&!De.isHome);if(ye)try{const De=await ve.hideSubproject(ye.dir,_e);De.success?(Z.success("Sub-project hidden"),M()):Z.error(De.error||"Failed to hide sub-project")}catch(De){Z.error("Failed to hide sub-project: "+De.message)}},Ie=()=>{if(!c||!m)return r.jsx("div",{className:"h-full flex items-center justify-center text-gray-500 dark:text-slate-400",children:r.jsxs("div",{className:"text-center",children:[r.jsx(Mm,{className:"w-12 h-12 mx-auto mb-2 opacity-50"}),r.jsx("p",{children:"Select a file to edit"})]})});const _e=c.path?c.path.replace(/\/.claude\/mcps\.json$/,""):null;switch(c.type){case"mcps":return r.jsx(jF,{content:m.content,parsed:m.parsed,onSave:$,registry:d,configDir:_e});case"settings":return r.jsx(s8,{content:m.content,parsed:m.parsed,onSave:$,filePath:c==null?void 0:c.path});case"command":case"rule":case"workflow":case"claudemd":case"env":return r.jsx(Yb,{content:m.content,onSave:$,fileType:c.type});default:return r.jsx(Yb,{content:m.content,onSave:$,fileType:"claudemd"})}};if(y)return r.jsx("div",{className:"h-full flex items-center justify-center",children:r.jsx(yr,{className:"w-6 h-6 animate-spin text-gray-400"})});const We=n.some(_e=>_e.isSubproject),ne=(_e,ye)=>ye===0,de=(_e,ye)=>{const De=n.findIndex(ht=>ht.isSubproject);return!_e.isSubproject&&(De>=0?ye===De-1:ye===n.length-1)};return r.jsxs("div",{className:"h-full flex",children:[r.jsxs("div",{className:"w-76 border-r flex flex-col bg-white dark:bg-slate-950",children:[r.jsxs("div",{className:"flex items-center justify-between p-3 border-b",children:[r.jsx("h2",{className:"font-semibold text-sm",children:"Project Config"}),r.jsxs("div",{className:"flex gap-1",children:[U.includes("claude")&&U.includes("antigravity")&&r.jsxs(le,{variant:"ghost",size:"sm",className:"h-7 px-2",onClick:()=>R(!0),title:"Sync rules between tools",children:[r.jsx(sM,{className:"w-4 h-4 mr-1"}),"Sync"]}),r.jsx(le,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:M,children:r.jsx(yr,{className:"w-4 h-4"})})]})]}),r.jsx(En,{className:"flex-1",children:n.map((_e,ye)=>r.jsx(eF,{folder:_e,isExpanded:x===_e.dir,isHome:ne(_e,ye),isProject:de(_e,ye),isSubproject:_e.isSubproject,depth:_e.depth||0,onToggle:()=>B(_e.dir),onCreateFile:me,onInstallPlugin:(De,ht)=>H({open:!0,dir:De,name:ht}),onSelectItem:q,selectedPath:c==null?void 0:c.path,onContextMenu:fe,expandedFolders:k,onToggleFolder:ae,hasSubprojects:We,onAddSubproject:De=>O({open:!0,projectDir:De}),onRemoveSubproject:oe,onHideSubproject:we},_e.dir))})]}),r.jsxs("div",{className:"flex-1 flex flex-col bg-gray-50 dark:bg-slate-900",children:[c&&r.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b bg-white dark:bg-slate-950",children:[r.jsx("div",{className:"flex items-center gap-2 text-sm",children:r.jsx("span",{className:"text-gray-500 dark:text-slate-400 font-mono truncate max-w-md",children:c.path})}),r.jsxs("div",{className:"flex gap-1",children:[r.jsx(le,{variant:"ghost",size:"sm",onClick:()=>b({open:!0,item:c}),children:r.jsx(al,{className:"w-4 h-4"})}),r.jsx(le,{variant:"ghost",size:"sm",onClick:()=>ce(c),children:r.jsx(mn,{className:"w-4 h-4"})})]})]}),r.jsx("div",{className:"flex-1",children:Ie()})]}),K.item&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>G({x:0,y:0,item:null})}),r.jsxs("div",{className:"fixed z-50 bg-white dark:bg-slate-950 rounded-md shadow-lg border py-1 min-w-[160px]",style:{left:K.x,top:K.y},children:[(((ke=K.item)==null?void 0:ke.type)==="rule"||((Re=K.item)==null?void 0:Re.type)==="command"||((qe=K.item)==null?void 0:qe.type)==="workflow")&&r.jsxs("button",{className:"w-full px-3 py-2 text-sm text-left hover:bg-gray-100 dark:hover:bg-slate-800 flex items-center",onClick:()=>{P({open:!0,item:K.item}),G({x:0,y:0,item:null})},children:[r.jsx(MC,{className:"w-4 h-4 mr-2"})," Rename"]}),r.jsxs("button",{className:"w-full px-3 py-2 text-sm text-left hover:bg-gray-100 dark:hover:bg-slate-800 flex items-center",onClick:()=>{b({open:!0,item:K.item}),G({x:0,y:0,item:null})},children:[r.jsx(al,{className:"w-4 h-4 mr-2"})," Copy to..."]}),r.jsxs("button",{className:"w-full px-3 py-2 text-sm text-left hover:bg-gray-100 dark:hover:bg-slate-800 flex items-center",onClick:()=>{b({open:!0,item:K.item}),G({x:0,y:0,item:null})},children:[r.jsx(TC,{className:"w-4 h-4 mr-2"})," Move to..."]}),r.jsx("div",{className:"border-t my-1"}),r.jsxs("button",{className:"w-full px-3 py-2 text-sm text-left hover:bg-gray-100 dark:hover:bg-slate-800 flex items-center text-red-600",onClick:()=>{ce(K.item),G({x:0,y:0,item:null})},children:[r.jsx(mn,{className:"w-4 h-4 mr-2"})," Delete"]})]})]}),r.jsx(i8,{open:g.open,onClose:()=>b({open:!1,item:null}),item:g.item,intermediatePaths:o,onMove:se}),r.jsx(a8,{open:j.open,onClose:()=>E({open:!1,dir:null,type:null}),dir:j.dir,type:j.type,onCreate:X}),r.jsx(o8,{open:A.open,onClose:()=>P({open:!1,item:null}),item:A.item,onRename:W}),r.jsx(d6,{open:N,onOpenChange:R,projectDir:e==null?void 0:e.dir,onSynced:M}),r.jsx(GB,{open:F.open,onOpenChange:_e=>H({...F,open:_e}),projectDir:F.dir,projectName:F.name}),r.jsx(Ng,{open:I.open,onOpenChange:_e=>O({...I,open:_e}),onSelect:Q,type:"directory",title:"Add Sub-project",initialPath:I.projectDir||"~"}),r.jsx(ZB,{open:Y.open,onOpenChange:_e=>{z({...Y,open:_e}),_e||M()},title:"Initialize CLAUDE.md",description:"Running claude -p /init to generate project-aware CLAUDE.md",cwd:Y.dir,initialCommand:"claude -p /init; exit",autoCloseOnExit:!0,autoCloseDelay:2e3})]})}function c8({projects:e=[],activeProject:t=null,onSwitch:n,onAddClick:s,onManageClick:o,disabled:u=!1}){const d=(t==null?void 0:t.name)||"No Project";return r.jsxs(ci,{children:[r.jsx(ui,{asChild:!0,children:r.jsxs(le,{variant:"outline",className:"gap-2 max-w-[220px] h-9",disabled:u,children:[r.jsx(oi,{className:"w-4 h-4 text-indigo-500 flex-shrink-0"}),r.jsx("span",{className:"truncate font-medium",children:d}),r.jsx(vr,{className:"w-4 h-4 opacity-50 flex-shrink-0"})]})}),r.jsxs(js,{align:"start",className:"w-72",children:[r.jsx(ml,{className:"text-xs text-gray-500 font-normal",children:"Projects"}),r.jsx(zr,{}),e.length===0?r.jsxs("div",{className:"px-3 py-6 text-sm text-gray-500 text-center",children:[r.jsx(kr,{className:"w-8 h-8 mx-auto mb-2 text-gray-300"}),r.jsx("p",{children:"No projects registered"}),r.jsx("p",{className:"text-xs mt-1",children:"Add a project to get started"})]}):r.jsx("div",{className:"max-h-64 overflow-y-auto",children:e.map(l=>r.jsxs(Rt,{onClick:()=>!l.isActive&&n(l.id),className:`flex items-start gap-2 py-2 cursor-pointer ${l.isActive?"bg-indigo-50":""}`,disabled:l.isActive,children:[r.jsx("div",{className:"mt-0.5 flex-shrink-0",children:l.isActive?r.jsx(Gt,{className:"w-4 h-4 text-indigo-600"}):l.exists?r.jsx(kr,{className:"w-4 h-4 text-gray-400"}):r.jsx(rd,{className:"w-4 h-4 text-amber-500"})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("div",{className:`truncate font-medium ${l.isActive?"text-indigo-700":""}`,children:l.name}),r.jsx("div",{className:"truncate text-xs text-gray-400 font-mono",children:l.path.replace(/^\/Users\/[^/]+/,"~")}),!l.exists&&r.jsx("div",{className:"text-xs text-amber-600 mt-0.5",children:"Path not found"})]}),l.hasClaudeConfig&&r.jsx("div",{className:"flex-shrink-0",children:r.jsx("div",{className:"w-2 h-2 rounded-full bg-green-400",title:"Has .claude config"})})]},l.id))}),r.jsx(zr,{}),r.jsxs(Rt,{onClick:s,className:"gap-2 cursor-pointer",children:[r.jsx(vt,{className:"w-4 h-4"}),"Add Project"]}),e.length>0&&r.jsxs(Rt,{onClick:o,className:"gap-2 cursor-pointer",children:[r.jsx(Dm,{className:"w-4 h-4"}),"Manage Projects"]})]})]})}const tm="claude-config-welcome-seen";function u8({onStartTutorial:e}){const[t,n]=S.useState(!1),[s,o]=S.useState(!0);S.useEffect(()=>{if(!localStorage.getItem(tm)){const c=setTimeout(()=>n(!0),500);return()=>clearTimeout(c)}},[]);const u=()=>{s&&localStorage.setItem(tm,"true"),n(!1)},d=()=>{s&&localStorage.setItem(tm,"true"),n(!1),e==null||e()};return r.jsx(St,{open:t,onOpenChange:n,children:r.jsxs(yt,{className:"sm:max-w-lg",children:[r.jsxs(bt,{children:[r.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[r.jsx("div",{className:"w-12 h-12 rounded-xl bg-gradient-to-br from-indigo-500 to-purple-600 flex items-center justify-center shadow-lg",children:r.jsx(fn,{className:"w-6 h-6 text-white"})}),r.jsx(wt,{className:"text-2xl",children:"Welcome to Coder Config"})]}),r.jsx(tr,{className:"text-base pt-2",children:"Your control center for Claude Code and AI coding tools."})]}),r.jsxs("div",{className:"py-4 space-y-4",children:[r.jsx("p",{className:"text-sm text-muted-foreground",children:"We built Coder Config because managing AI coding assistants shouldn't require editing JSON files or memorizing command-line flags. You deserve a visual interface that makes configuration easy."}),r.jsxs("div",{className:"grid grid-cols-3 gap-3 py-2",children:[r.jsxs("div",{className:"text-center p-3 rounded-lg bg-muted/50",children:[r.jsx(ss,{className:"w-5 h-5 mx-auto mb-2 text-indigo-500"}),r.jsx("span",{className:"text-xs text-muted-foreground",children:"MCP Servers"})]}),r.jsxs("div",{className:"text-center p-3 rounded-lg bg-muted/50",children:[r.jsx(ls,{className:"w-5 h-5 mx-auto mb-2 text-green-500"}),r.jsx("span",{className:"text-xs text-muted-foreground",children:"Permissions"})]}),r.jsxs("div",{className:"text-center p-3 rounded-lg bg-muted/50",children:[r.jsx(zt,{className:"w-5 h-5 mx-auto mb-2 text-amber-500"}),r.jsx("span",{className:"text-xs text-muted-foreground",children:"Rules & Memory"})]})]}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"Take our guided tutorial to learn the basics, or dive in and explore on your own."}),r.jsxs("div",{className:"flex items-center gap-2 pt-2",children:[r.jsx(Al,{id:"dont-ask",checked:s,onCheckedChange:o}),r.jsx(Ft,{htmlFor:"dont-ask",className:"text-sm text-muted-foreground cursor-pointer",children:"Don't show this again"})]})]}),r.jsxs(Et,{className:"flex gap-2 sm:gap-2",children:[r.jsx(le,{variant:"ghost",onClick:u,children:"Skip for now"}),r.jsxs(le,{onClick:d,className:"gap-2",children:[r.jsx(Au,{className:"w-4 h-4"}),"Start Tutorial",r.jsx(Up,{className:"w-4 h-4"})]})]})]})})}const rm="claude-config:claude-init-preference";function Fj({open:e,onOpenChange:t,onAdded:n}){const[s,o]=S.useState(""),[u,d]=S.useState(""),[l,c]=S.useState(!1),[f,m]=S.useState(!1),[h,x]=S.useState(!0),[w,k]=S.useState([]),[_,y]=S.useState(null),v=S.useRef(null);S.useEffect(()=>{const E=localStorage.getItem(rm);E==="never"?x(!1):E==="always"&&x(!0)},[]),S.useEffect(()=>{if(e){o(""),d(""),k([]),y(null);const E=localStorage.getItem(rm);x(E!=="never")}},[e]),S.useEffect(()=>{v.current&&(v.current.scrollTop=v.current.scrollHeight)},[w]),S.useEffect(()=>{if(s&&!u){const E=s.split("/").pop();d(E||"")}},[s]);const g=E=>{o(E),c(!1)},b=async()=>{if(!s){Z.error("Please select a project path");return}m(!0),k([]),y(null);try{if(h){y("running");const A=await new Promise(P=>{const N=new EventSource(`/api/projects/init-stream?path=${encodeURIComponent(s)}`);N.onmessage=R=>{const I=JSON.parse(R.data);I.type==="output"?k(O=>[...O,I.text]):I.type==="status"?k(O=>[...O,I.message+`
|
|
605
605
|
`]):I.type==="skip"?k(O=>[...O,I.message+`
|
|
606
606
|
`]):I.type==="done"?(N.close(),y(I.success?"success":"error"),P(I.success)):I.type==="error"&&(k(O=>[...O,`Error: ${I.message}
|
|
607
607
|
`]),N.close(),y("error"),P(!1))},N.onerror=()=>{N.close(),k(R=>[...R,`Connection error - is Claude Code installed?
|
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-Bptpr20U.js"></script>
|
|
23
23
|
<link rel="stylesheet" crossorigin href="/assets/index-ClOpkZec.css">
|
|
24
24
|
</head>
|
|
25
25
|
<body>
|
|
@@ -129,6 +129,17 @@ function scanClaudeFolder(folder, claudeDir, manager) {
|
|
|
129
129
|
// memory folder
|
|
130
130
|
addSubfolder(folder.files, claudeDir, 'memory', '.md', 'memory');
|
|
131
131
|
|
|
132
|
+
// .env file
|
|
133
|
+
const envPath = path.join(claudeDir, '.env');
|
|
134
|
+
if (fs.existsSync(envPath)) {
|
|
135
|
+
folder.files.push({
|
|
136
|
+
name: '.env',
|
|
137
|
+
path: envPath,
|
|
138
|
+
type: 'env',
|
|
139
|
+
size: fs.statSync(envPath).size
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
|
|
132
143
|
// CLAUDE.md inside .claude
|
|
133
144
|
const claudeMdPath = path.join(claudeDir, 'CLAUDE.md');
|
|
134
145
|
if (fs.existsSync(claudeMdPath)) {
|