@regression-io/claude-config 0.21.8 → 0.21.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/config-loader.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@regression-io/claude-config",
|
|
3
|
-
"version": "0.21.
|
|
3
|
+
"version": "0.21.10",
|
|
4
4
|
"description": "Configuration management UI for Claude Code and Antigravity - manage MCPs, rules, commands, memory, and project folders",
|
|
5
5
|
"author": "regression.io",
|
|
6
6
|
"main": "config-loader.js",
|
|
@@ -504,7 +504,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
|
|
|
504
504
|
`,p+=`- See also: related documentation
|
|
505
505
|
`;c(p),g(!1)},500)},E=v=>{if(!a){le.error("Generate content first");return}l(v==="replace"?a:o+`
|
|
506
506
|
|
|
507
|
-
`+a),t(),le.success("Content inserted")},b=()=>{f(""),c(""),t()};return i.jsx(ir,{open:e,onOpenChange:b,children:i.jsxs(Qt,{className:"max-w-2xl max-h-[80vh] overflow-hidden flex flex-col",children:[i.jsxs(Zt,{children:[i.jsxs(tr,{className:"flex items-center gap-2",children:[i.jsx($t,{className:"w-5 h-5 text-indigo-600"}),"AI Assist"]}),i.jsxs(Nr,{children:["Generate content for your ",s||"file"," using templates or custom prompts"]})]}),i.jsxs("div",{className:"flex-1 overflow-auto space-y-4 py-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300 mb-2 block",children:"Quick Templates"}),i.jsx("div",{className:"flex flex-wrap gap-2",children:_.map(v=>i.jsx(de,{variant:"outline",size:"sm",onClick:()=>{f(v.prompt),S(v.prompt)},disabled:h,children:v.label},v.label))})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300 mb-2 block",children:"Custom Prompt"}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(Xe,{placeholder:"Describe what you want to generate...",value:m,onChange:v=>f(v.target.value),onKeyDown:v=>v.key==="Enter"&&S()}),i.jsx(de,{onClick:()=>S(),disabled:h||!m.trim(),children:h?i.jsx(gr,{className:"w-4 h-4 animate-spin"}):"Generate"})]})]}),a&&i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300 mb-2 block",children:"Generated Content"}),i.jsx(Ze,{value:a,onChange:v=>c(v.target.value),className:"font-mono text-sm min-h-[200px]"})]})]}),i.jsxs(er,{children:[i.jsx(de,{variant:"ghost",onClick:b,children:"Cancel"}),a&&i.jsxs(i.Fragment,{children:[i.jsx(de,{variant:"outline",onClick:()=>E("append"),children:"Append to File"}),i.jsx(de,{onClick:()=>E("replace"),className:"bg-indigo-600 hover:bg-indigo-700 text-white",children:"Replace Content"})]})]})]})})}function Iy({content:e,onSave:t,fileType:s}){const[o,l]=C.useState(e||""),[m,f]=C.useState(!1),[a,c]=C.useState(!1);C.useEffect(()=>{l(e||""),f(!1)},[e]);const h=()=>{t(o),f(!1)},g=_=>{l(_),f(!0)},u=fa[s]||fa.claudemd;return i.jsxs("div",{className:"h-full flex flex-col",children:[i.jsxs("div",{className:"flex items-center justify-between p-3 border-b bg-gray-50 dark:bg-slate-800",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(u.icon,{className:xe("w-4 h-4",u.color)}),i.jsx("span",{className:"text-sm font-medium",children:u.label})]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsxs(de,{variant:"outline",size:"sm",onClick:()=>c(!0),children:[i.jsx($t,{className:"w-4 h-4 mr-1"}),"AI Assist"]}),m&&i.jsxs(de,{size:"sm",onClick:h,children:[i.jsx(ri,{className:"w-4 h-4 mr-1"}),"Save"]})]})]}),i.jsx(Ze,{className:"flex-1 w-full font-mono text-sm border-0 rounded-none resize-none p-4",value:o,onChange:_=>{l(_.target.value),f(!0)},placeholder:`Enter ${u.label.toLowerCase()} content...`}),i.jsx(YO,{open:a,onClose:()=>c(!1),fileType:s,currentContent:o,onInsert:g})]})}function XO({content:e,parsed:t,onSave:s,filePath:o}){const l=async a=>{const c=JSON.stringify(a,null,2);s(c)},m=(o==null?void 0:o.includes(".gemini"))||(o==null?void 0:o.includes("/.gemini/")),f=(o==null?void 0:o.includes(".agent"))||(o==null?void 0:o.includes("/antigravity/"));return m&&!f?i.jsx("div",{className:"h-full overflow-auto p-4",children:i.jsx(E1,{settings:t||{},onSave:l,loading:!1,settingsPath:o||"~/.gemini/settings.json"})}):i.jsx("div",{className:"h-full overflow-auto p-4",children:i.jsx(k1,{settings:t||{},onSave:l,loading:!1,settingsPath:o||"~/.claude/settings.json"})})}function JO({open:e,onClose:t,item:s,intermediatePaths:o,onMove:l}){const[m,f]=C.useState("copy"),[a,c]=C.useState(null),[h,g]=C.useState(""),[u,_]=C.useState(!1),S=()=>{const E=h.trim()||a;if(!E){le.error("Please select or enter a target path");return}l(s.path,E,m,u)};return i.jsx(ir,{open:e,onOpenChange:t,children:i.jsxs(Qt,{className:"max-w-md",children:[i.jsxs(Zt,{children:[i.jsxs(tr,{children:[m==="copy"?"Copy":"Move"," ",s==null?void 0:s.name]}),i.jsx(Nr,{children:"Select a destination for this file"})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex gap-2",children:[i.jsxs(de,{variant:m==="copy"?"default":"outline",size:"sm",onClick:()=>f("copy"),children:[i.jsx(zi,{className:"w-4 h-4 mr-1"}),"Copy"]}),i.jsxs(de,{variant:m==="move"?"default":"outline",size:"sm",onClick:()=>f("move"),children:[i.jsx(M_,{className:"w-4 h-4 mr-1"}),"Move"]})]}),i.jsx("div",{className:"space-y-2 max-h-48 overflow-y-auto",children:o==null?void 0:o.map(E=>i.jsxs("div",{className:xe("flex items-center justify-between p-2 rounded border cursor-pointer",a===E.dir?"border-blue-500 bg-blue-50":"hover:bg-gray-50 dark:bg-slate-800"),onClick:()=>{c(E.dir),g("")},children:[i.jsxs("div",{className:"flex items-center gap-2",children:[E.isHome?i.jsx(Qf,{className:"w-4 h-4"}):i.jsx(jt,{className:"w-4 h-4"}),i.jsx("span",{className:"text-sm",children:E.label})]}),E.hasClaudeFolder?i.jsx(st,{variant:"secondary",className:"text-xs",children:"exists"}):i.jsx(st,{variant:"outline",className:"text-xs",children:"create"})]},E.dir))}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium",children:"Or enter custom path:"}),i.jsx(Xe,{className:"mt-1 font-mono text-sm",placeholder:"/path/to/directory",value:h,onChange:E=>{g(E.target.value),c(null)}})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(yt,{checked:u,onCheckedChange:_}),i.jsx("span",{className:"text-sm",children:"Merge if target exists"})]})]}),i.jsxs(er,{children:[i.jsx(de,{variant:"ghost",onClick:t,children:"Cancel"}),i.jsx(de,{onClick:S,children:m==="copy"?"Copy":"Move"})]})]})})}function QO({open:e,onClose:t,item:s,onRename:o}){const[l,m]=C.useState("");C.useEffect(()=>{s!=null&&s.name&&m(s.name.replace(/\.md$/,""))},[s,e]);const f=()=>{if(!l.trim()){le.error("Please enter a name");return}o(s,l.trim())};return i.jsx(ir,{open:e,onOpenChange:t,children:i.jsxs(Qt,{className:"sm:max-w-md",children:[i.jsx(Zt,{children:i.jsxs(tr,{children:["Rename ",s==null?void 0:s.type]})}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium",children:"New name"}),i.jsx(Xe,{className:"mt-1",placeholder:"new-name",value:l,onChange:a=>m(a.target.value),onKeyDown:a=>a.key==="Enter"&&f()}),i.jsx("p",{className:"text-xs text-gray-500 dark:text-slate-400 mt-1",children:".md extension will be added automatically"})]}),i.jsxs(er,{children:[i.jsx(de,{variant:"ghost",onClick:t,children:"Cancel"}),i.jsx(de,{onClick:f,children:"Rename"})]})]})})}function ZO({open:e,onClose:t,dir:s,type:o,onCreate:l}){const[m,f]=C.useState("");C.useEffect(()=>{f("")},[e]);const a=()=>{if((o==="command"||o==="rule"||o==="workflow")&&!m.trim()){le.error("Please enter a name");return}const g=o==="command"||o==="rule"||o==="workflow"?m.endsWith(".md")?m:`${m}.md`:m;l(s,g,o)},c=fa[o]||{},h=o==="command"||o==="rule"||o==="workflow";return i.jsx(ir,{open:e,onOpenChange:t,children:i.jsxs(Qt,{className:"max-w-sm",children:[i.jsx(Zt,{children:i.jsxs(tr,{children:["Create ",c.label||o]})}),h&&i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium",children:"Name"}),i.jsx(Xe,{className:"mt-1",placeholder:o==="command"?"my-command.md":o==="workflow"?"my-workflow.md":"my-rule.md",value:m,onChange:g=>f(g.target.value),onKeyDown:g=>g.key==="Enter"&&a()})]}),i.jsxs(er,{children:[i.jsx(de,{variant:"ghost",onClick:t,children:"Cancel"}),i.jsx(de,{onClick:a,children:"Create"})]})]})})}function eI({project:e,onRefresh:t}){var ue,U,O;const[s,o]=C.useState([]),[l,m]=C.useState([]),[f,a]=C.useState(null),[c,h]=C.useState(null),[g,u]=C.useState(null),[_,S]=C.useState({}),[E,b]=C.useState(!0),[v,y]=C.useState({open:!1,item:null}),[p,x]=C.useState({open:!1,dir:null,type:null}),[k,P]=C.useState({open:!1,item:null}),[T,R]=C.useState(!1),[j,M]=C.useState(!1),[$,B]=C.useState({x:0,y:0,item:null}),[W,H]=C.useState(["claude"]),J=C.useCallback(async()=>{var Q;try{b(!0);const[X,q,re,he]=await Promise.all([Ne.getClaudeFolders(),Ne.getIntermediatePaths(),Ne.getRegistry(),Ne.getConfig()]);o(X),m(q),a(re),H(((Q=he.config)==null?void 0:Q.enabledTools)||["claude"])}catch(X){le.error("Failed to load data: "+X.message)}finally{b(!1)}},[]);C.useEffect(()=>{J(),h(null),u(null)},[J,e==null?void 0:e.dir]);const K=async Q=>{h(Q);try{const X=await Ne.getClaudeFile(Q.path);u(X)}catch(X){le.error("Failed to load file: "+X.message)}},G=async Q=>{if(c)try{await Ne.saveClaudeFile(c.path,Q),le.success("Saved");const X=await Ne.getClaudeFile(c.path);u(X),J()}catch(X){le.error("Failed to save: "+X.message)}},ee=Q=>{S(X=>({...X,[Q]:!X[Q]}))},z=(Q,X)=>{Q.preventDefault(),B({x:Q.clientX,y:Q.clientY,item:X})},D=(Q,X)=>{X==="command"||X==="rule"||X==="workflow"?x({open:!0,dir:Q,type:X}):F(Q,X==="mcps"?"mcps.json":X==="settings"?"settings.json":"CLAUDE.md",X)},F=async(Q,X,q)=>{try{const re=await Ne.createClaudeFile(Q,X,q);if(le.success("Created"),x({open:!1,dir:null,type:null}),await J(),re.path){const he={path:re.path,name:X,type:q==="command"?"command":q==="rule"?"rule":q==="workflow"?"workflow":"file"};h(he),u(re.content||"")}}catch(re){le.error("Failed to create: "+re.message)}},L=async Q=>{try{await Ne.createClaudeFile(Q,"mcps.json","mcps"),le.success(`Created .claude folder at ${Q}`),R(!1),J()}catch(X){le.error("Failed to create: "+X.message)}},V=async(Q,X)=>{try{const q=await Ne.renameClaudeFile(Q.path,X);q.success?(le.success("Renamed"),P({open:!1,item:null}),await J(),h({...Q,path:q.newPath,name:X.endsWith(".md")?X:`${X}.md`})):le.error(q.error||"Failed to rename")}catch(q){le.error("Failed to rename: "+q.message)}},te=async Q=>{if(confirm(`Delete ${Q.name}?`))try{await Ne.deleteClaudeFile(Q.path),le.success("Deleted"),(c==null?void 0:c.path)===Q.path&&(h(null),u(null)),J()}catch(X){le.error("Failed to delete: "+X.message)}},ne=async(Q,X,q,re)=>{try{await Ne.moveClaudeItem(Q,X,q,re),le.success(q==="copy"?"Copied":"Moved"),y({open:!1,item:null}),J()}catch(he){le.error("Failed: "+he.message)}},ce=()=>{if(!c||!g)return i.jsx("div",{className:"h-full flex items-center justify-center text-gray-500 dark:text-slate-400",children:i.jsxs("div",{className:"text-center",children:[i.jsx(Gh,{className:"w-12 h-12 mx-auto mb-2 opacity-50"}),i.jsx("p",{children:"Select a file to edit"})]})});switch(c.type){case"mcps":return i.jsx(qO,{content:g.content,parsed:g.parsed,onSave:G,registry:f});case"settings":return i.jsx(XO,{content:g.content,parsed:g.parsed,onSave:G});case"command":case"rule":case"workflow":case"claudemd":return i.jsx(Iy,{content:g.content,onSave:G,fileType:c.type});default:return i.jsx(Iy,{content:g.content,onSave:G,fileType:"claudemd"})}};return E?i.jsx("div",{className:"h-full flex items-center justify-center",children:i.jsx(gr,{className:"w-6 h-6 animate-spin text-gray-400"})}):i.jsxs("div",{className:"h-full flex",children:[i.jsxs("div",{className:"w-72 border-r flex flex-col bg-white dark:bg-slate-950",children:[i.jsxs("div",{className:"flex items-center justify-between p-3 border-b",children:[i.jsx("h2",{className:"font-semibold text-sm",children:"Project Config"}),i.jsxs("div",{className:"flex gap-1",children:[W.includes("claude")&&W.includes("antigravity")&&i.jsxs(de,{variant:"ghost",size:"sm",className:"h-7 px-2",onClick:()=>M(!0),title:"Sync rules between tools",children:[i.jsx(MR,{className:"w-4 h-4 mr-1"}),"Sync"]}),i.jsxs(de,{variant:"ghost",size:"sm",className:"h-7 px-2",onClick:()=>R(!0),children:[i.jsx(Ht,{className:"w-4 h-4 mr-1"}),"New"]}),i.jsx(de,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:J,children:i.jsx(gr,{className:"w-4 h-4"})})]})]}),i.jsx(ei,{className:"flex-1",children:s.map((Q,X)=>{var q,re;return i.jsxs("div",{children:[i.jsx(GO,{folder:Q,isFirst:X===0,isLast:X===s.length-1,onCreateFile:D}),Q.exists&&Q.files.length>0?i.jsxs("div",{className:"py-1",children:[i.jsxs("div",{className:"px-3 py-1 text-[10px] font-medium text-orange-600 uppercase tracking-wide flex items-center gap-1",children:[i.jsx($t,{className:"w-3 h-3"}),"Claude Code"]}),Q.files.map(he=>i.jsx(oc,{item:he,selectedPath:c==null?void 0:c.path,onSelect:K,onContextMenu:z,expandedFolders:_,onToggleFolder:ee},he.path))]}):i.jsx("div",{className:"px-4 py-2 text-sm text-gray-400 italic",children:Q.exists?"Empty .claude":"No .claude folder"}),Q.geminiExists&&((q=Q.geminiFiles)==null?void 0:q.length)>0&&i.jsxs("div",{className:"py-1 border-t border-dashed border-gray-200 dark:border-slate-700 mt-1",children:[i.jsxs("div",{className:"px-3 py-1 text-[10px] font-medium text-blue-600 uppercase tracking-wide flex items-center gap-1",children:[i.jsx($t,{className:"w-3 h-3"}),"Gemini CLI"]}),Q.geminiFiles.map(he=>i.jsx(oc,{item:he,selectedPath:c==null?void 0:c.path,onSelect:K,onContextMenu:z,expandedFolders:_,onToggleFolder:ee},he.path))]}),Q.agentExists&&((re=Q.agentFiles)==null?void 0:re.length)>0&&i.jsxs("div",{className:"py-1 border-t border-dashed border-gray-200 dark:border-slate-700 mt-1",children:[i.jsxs("div",{className:"px-3 py-1 text-[10px] font-medium text-purple-600 uppercase tracking-wide flex items-center gap-1",children:[i.jsx($t,{className:"w-3 h-3"}),"Antigravity"]}),Q.agentFiles.map(he=>i.jsx(oc,{item:he,selectedPath:c==null?void 0:c.path,onSelect:K,onContextMenu:z,expandedFolders:_,onToggleFolder:ee},he.path))]})]},Q.dir)})})]}),i.jsxs("div",{className:"flex-1 flex flex-col bg-gray-50 dark:bg-slate-800",children:[c&&i.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b bg-white dark:bg-slate-950",children:[i.jsx("div",{className:"flex items-center gap-2 text-sm",children:i.jsx("span",{className:"text-gray-500 dark:text-slate-400 font-mono truncate max-w-md",children:c.path})}),i.jsxs("div",{className:"flex gap-1",children:[i.jsx(de,{variant:"ghost",size:"sm",onClick:()=>y({open:!0,item:c}),children:i.jsx(zi,{className:"w-4 h-4"})}),i.jsx(de,{variant:"ghost",size:"sm",onClick:()=>te(c),children:i.jsx(Gn,{className:"w-4 h-4"})})]})]}),i.jsx("div",{className:"flex-1",children:ce()})]}),$.item&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>B({x:0,y:0,item:null})}),i.jsxs("div",{className:"fixed z-50 bg-white dark:bg-slate-950 rounded-md shadow-lg border py-1 min-w-[160px]",style:{left:$.x,top:$.y},children:[(((ue=$.item)==null?void 0:ue.type)==="rule"||((U=$.item)==null?void 0:U.type)==="command"||((O=$.item)==null?void 0:O.type)==="workflow")&&i.jsxs("button",{className:"w-full px-3 py-2 text-sm text-left hover:bg-gray-100 dark:hover:bg-slate-700 dark:bg-slate-700 flex items-center",onClick:()=>{P({open:!0,item:$.item}),B({x:0,y:0,item:null})},children:[i.jsx(Zf,{className:"w-4 h-4 mr-2"}),"Rename"]}),i.jsxs("button",{className:"w-full px-3 py-2 text-sm text-left hover:bg-gray-100 dark:hover:bg-slate-700 dark:bg-slate-700 flex items-center",onClick:()=>{y({open:!0,item:$.item}),B({x:0,y:0,item:null})},children:[i.jsx(zi,{className:"w-4 h-4 mr-2"}),"Copy to..."]}),i.jsxs("button",{className:"w-full px-3 py-2 text-sm text-left hover:bg-gray-100 dark:hover:bg-slate-700 dark:bg-slate-700 flex items-center",onClick:()=>{y({open:!0,item:$.item}),B({x:0,y:0,item:null})},children:[i.jsx(M_,{className:"w-4 h-4 mr-2"}),"Move to..."]}),i.jsx("div",{className:"border-t my-1"}),i.jsxs("button",{className:"w-full px-3 py-2 text-sm text-left hover:bg-gray-100 dark:hover:bg-slate-700 dark:bg-slate-700 flex items-center text-red-600",onClick:()=>{te($.item),B({x:0,y:0,item:null})},children:[i.jsx(Gn,{className:"w-4 h-4 mr-2"}),"Delete"]})]})]}),i.jsx(JO,{open:v.open,onClose:()=>y({open:!1,item:null}),item:v.item,intermediatePaths:l,onMove:ne}),i.jsx(ZO,{open:p.open,onClose:()=>x({open:!1,dir:null,type:null}),dir:p.dir,type:p.type,onCreate:F}),i.jsx(QO,{open:k.open,onClose:()=>P({open:!1,item:null}),item:k.item,onRename:V}),i.jsx(ir,{open:T,onOpenChange:R,children:i.jsxs(Qt,{className:"max-w-md",children:[i.jsxs(Zt,{children:[i.jsx(tr,{children:"Create New .claude Folder"}),i.jsx(Nr,{children:"Select a location to create a new .claude configuration folder"})]}),i.jsxs("div",{className:"space-y-2 max-h-64 overflow-y-auto",children:[l.filter(Q=>!s.some(X=>X.dir===Q.dir)).map(Q=>i.jsxs("div",{className:"flex items-center justify-between p-3 rounded border hover:bg-gray-50 dark:bg-slate-800 cursor-pointer",onClick:()=>L(Q.dir),children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(jt,{className:"w-4 h-4 text-gray-500 dark:text-slate-400"}),i.jsx("span",{className:"text-sm font-mono",children:Q.label})]}),i.jsx(st,{variant:"outline",className:"text-xs",children:"create"})]},Q.dir)),l.filter(Q=>!s.some(X=>X.dir===Q.dir)).length===0&&i.jsx("p",{className:"text-sm text-gray-500 dark:text-slate-400 text-center py-4",children:"All intermediate directories already have .claude folders"})]}),i.jsx(er,{children:i.jsx(de,{variant:"ghost",onClick:()=>R(!1),children:"Cancel"})})]})}),i.jsx(DO,{open:j,onOpenChange:M,projectDir:e==null?void 0:e.dir,onSynced:J})]})}function tI({projects:e=[],activeProject:t=null,onSwitch:s,onAddClick:o,onManageClick:l,disabled:m=!1}){const f=(t==null?void 0:t.name)||"No Project";return i.jsxs(Ta,{children:[i.jsx(Aa,{asChild:!0,children:i.jsxs(de,{variant:"outline",className:"gap-2 max-w-[220px] h-9",disabled:m,children:[i.jsx(Kn,{className:"w-4 h-4 text-indigo-500 flex-shrink-0"}),i.jsx("span",{className:"truncate font-medium",children:f}),i.jsx(xa,{className:"w-4 h-4 opacity-50 flex-shrink-0"})]})}),i.jsxs(no,{align:"start",className:"w-72",children:[i.jsx(S1,{className:"text-xs text-gray-500 font-normal",children:"Projects"}),i.jsx(qi,{}),e.length===0?i.jsxs("div",{className:"px-3 py-6 text-sm text-gray-500 text-center",children:[i.jsx(jt,{className:"w-8 h-8 mx-auto mb-2 text-gray-300"}),i.jsx("p",{children:"No projects registered"}),i.jsx("p",{className:"text-xs mt-1",children:"Add a project to get started"})]}):i.jsx("div",{className:"max-h-64 overflow-y-auto",children:e.map(a=>i.jsxs(Dt,{onClick:()=>!a.isActive&&s(a.id),className:`flex items-start gap-2 py-2 cursor-pointer ${a.isActive?"bg-indigo-50":""}`,disabled:a.isActive,children:[i.jsx("div",{className:"mt-0.5 flex-shrink-0",children:a.isActive?i.jsx(Rr,{className:"w-4 h-4 text-indigo-600"}):a.exists?i.jsx(jt,{className:"w-4 h-4 text-gray-400"}):i.jsx(Fc,{className:"w-4 h-4 text-amber-500"})}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("div",{className:`truncate font-medium ${a.isActive?"text-indigo-700":""}`,children:a.name}),i.jsx("div",{className:"truncate text-xs text-gray-400 font-mono",children:a.path.replace(/^\/Users\/[^/]+/,"~")}),!a.exists&&i.jsx("div",{className:"text-xs text-amber-600 mt-0.5",children:"Path not found"})]}),a.hasClaudeConfig&&i.jsx("div",{className:"flex-shrink-0",children:i.jsx("div",{className:"w-2 h-2 rounded-full bg-green-400",title:"Has .claude config"})})]},a.id))}),i.jsx(qi,{}),i.jsxs(Dt,{onClick:o,className:"gap-2 cursor-pointer",children:[i.jsx(Ht,{className:"w-4 h-4"}),"Add Project"]}),e.length>0&&i.jsxs(Dt,{onClick:l,className:"gap-2 cursor-pointer",children:[i.jsx(KT,{className:"w-4 h-4"}),"Manage Projects"]})]})]})}function Y1({open:e,onOpenChange:t,onSelect:s,type:o="directory",initialPath:l="~",title:m="Select Path"}){const[f,a]=C.useState(""),[c,h]=C.useState([]),[g,u]=C.useState(!1),[_,S]=C.useState(null),[E,b]=C.useState(""),[v,y]=C.useState("");C.useEffect(()=>{e&&p(l)},[e,l]);const p=async R=>{u(!0),S(null);try{const j=await Ne.browse(R,o);j.error?(S(j.error),j.path&&(a(j.path),y(j.path))):(a(j.path),y(j.path),h(j.items||[]),j.home&&b(j.home))}catch(j){S(j.message)}finally{u(!1)}},x=R=>{R.type==="directory"?p(R.path):o==="file"&&(s(R.path),t(!1))},k=()=>{s(f),t(!1)},P=()=>{v&&p(v)},T=R=>{R.key==="Enter"&&P()};return i.jsx(ir,{open:e,onOpenChange:t,children:i.jsxs(Qt,{className:"max-w-lg",children:[i.jsx(Zt,{children:i.jsxs(tr,{className:"flex items-center gap-2",children:[o==="directory"?i.jsx(jt,{className:"w-5 h-5"}):i.jsx(Gh,{className:"w-5 h-5"}),m]})}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex gap-2",children:[i.jsx(Xe,{value:v,onChange:R=>y(R.target.value),onKeyDown:T,placeholder:"Enter path...",className:"font-mono text-sm flex-1"}),i.jsx(de,{variant:"outline",size:"icon",onClick:()=>p(E||"~"),title:"Go to home",children:i.jsx(Qf,{className:"w-4 h-4"})}),i.jsx(de,{onClick:P,disabled:g,children:"Go"})]}),i.jsx("div",{className:"text-xs text-gray-500 font-mono truncate px-1",children:f}),_&&i.jsx("div",{className:"text-sm text-red-600 bg-red-50 p-2 rounded",children:_}),i.jsx(ei,{className:"h-64 border rounded-lg",children:g?i.jsx("div",{className:"flex items-center justify-center h-full",children:i.jsx(ct,{className:"w-6 h-6 animate-spin text-gray-400"})}):i.jsx("div",{className:"p-1",children:c.length===0?i.jsx("div",{className:"text-sm text-gray-500 p-4 text-center",children:o==="directory"?"No subdirectories":"No files found"}):c.map((R,j)=>i.jsxs("button",{onClick:()=>x(R),className:"w-full flex items-center gap-2 px-3 py-2 text-sm hover:bg-gray-100 rounded transition-colors text-left",children:[R.type==="directory"?i.jsx(jt,{className:"w-4 h-4 text-blue-500 flex-shrink-0"}):i.jsx(Gh,{className:"w-4 h-4 text-gray-400 flex-shrink-0"}),i.jsx("span",{className:`flex-1 truncate ${R.isParent?"text-gray-500":""}`,children:R.name}),R.type==="directory"&&!R.isParent&&i.jsx(Oc,{className:"w-4 h-4 text-gray-400"})]},j))})})]}),i.jsxs(er,{children:[i.jsx(de,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),i.jsx(de,{onClick:k,disabled:!f,children:o==="directory"?"Select Folder":"Select"})]})]})})}function X1({open:e,onOpenChange:t,onAdded:s}){const[o,l]=C.useState(""),[m,f]=C.useState(""),[a,c]=C.useState(!1),[h,g]=C.useState(!1);C.useEffect(()=>{e&&(l(""),f(""))},[e]),C.useEffect(()=>{if(o&&!m){const S=o.split("/").pop();f(S||"")}},[o]);const u=S=>{l(S),c(!1)},_=async()=>{if(!o){le.error("Please select a project path");return}g(!0);try{const S=await Ne.addProject(o,m||void 0);S.error?le.error(S.error):(le.success(`Added project: ${S.project.name}`),s==null||s(S.project),t(!1))}catch(S){le.error("Failed to add project: "+S.message)}finally{g(!1)}};return i.jsxs(i.Fragment,{children:[i.jsx(ir,{open:e,onOpenChange:t,children:i.jsxs(Qt,{className:"sm:max-w-md",children:[i.jsxs(Zt,{children:[i.jsxs(tr,{className:"flex items-center gap-2",children:[i.jsx(Kn,{className:"w-5 h-5 text-indigo-500"}),"Add Project"]}),i.jsx(Nr,{children:"Register a project folder to quickly switch between projects in the UI."})]}),i.jsxs("div",{className:"space-y-4 py-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(wt,{htmlFor:"path",children:"Project Path"}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(Xe,{id:"path",value:o,onChange:S=>l(S.target.value),placeholder:"/path/to/project",className:"font-mono text-sm flex-1"}),i.jsx(de,{variant:"outline",size:"icon",onClick:()=>c(!0),title:"Browse",children:i.jsx(Kn,{className:"w-4 h-4"})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(wt,{htmlFor:"name",children:"Display Name"}),i.jsx(Xe,{id:"name",value:m,onChange:S=>f(S.target.value),placeholder:"Auto-filled from folder name"}),i.jsx("p",{className:"text-xs text-gray-500",children:"Optional. Leave empty to use folder name."})]})]}),i.jsxs(er,{children:[i.jsx(de,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),i.jsx(de,{onClick:_,disabled:h||!o,children:h?i.jsxs(i.Fragment,{children:[i.jsx(ct,{className:"w-4 h-4 mr-2 animate-spin"}),"Adding..."]}):"Add Project"})]})]})}),i.jsx(Y1,{open:a,onOpenChange:c,onSelect:u,type:"directory",initialPath:"~",title:"Select Project Folder"})]})}const J1=C.createContext({theme:"auto",setTheme:()=>{},resolvedTheme:"light"});function rI({children:e}){const[t,s]=C.useState(()=>{try{return localStorage.getItem("claude-config-theme")||"auto"}catch{return"auto"}}),[o,l]=C.useState("light");C.useEffect(()=>{const f=window.document.documentElement,a=g=>{let u;g==="auto"?u=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":u=g,l(u),u==="dark"?f.classList.add("dark"):f.classList.remove("dark")};a(t);const c=window.matchMedia("(prefers-color-scheme: dark)"),h=()=>{t==="auto"&&a("auto")};return c.addEventListener("change",h),()=>c.removeEventListener("change",h)},[t]);const m=f=>{s(f);try{localStorage.setItem("claude-config-theme",f)}catch{}};return i.jsx(J1.Provider,{value:{theme:t,setTheme:m,resolvedTheme:o},children:e})}function sI(){return C.useContext(J1)}function nI(){const{theme:e,setTheme:t,resolvedTheme:s}=sI(),o=s==="dark"?ey:ty;return i.jsxs(Ta,{children:[i.jsx(Aa,{asChild:!0,children:i.jsxs(de,{variant:"ghost",size:"sm",className:"w-9 px-0",children:[i.jsx(o,{className:"h-4 w-4"}),i.jsx("span",{className:"sr-only",children:"Toggle theme"})]})}),i.jsxs(no,{align:"end",children:[i.jsxs(Dt,{onClick:()=>t("light"),className:e==="light"?"bg-accent":"",children:[i.jsx(ty,{className:"mr-2 h-4 w-4"}),"Light"]}),i.jsxs(Dt,{onClick:()=>t("dark"),className:e==="dark"?"bg-accent":"",children:[i.jsx(ey,{className:"mr-2 h-4 w-4"}),"Dark"]}),i.jsxs(Dt,{onClick:()=>t("auto"),className:e==="auto"?"bg-accent":"",children:[i.jsx(D_,{className:"mr-2 h-4 w-4"}),"System"]})]})]})}var iI=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],oI=iI.reduce((e,t)=>{const s=sp(`Primitive.${t}`),o=C.forwardRef((l,m)=>{const{asChild:f,...a}=l,c=f?s:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),i.jsx(c,{...a,ref:m})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{}),aI="Separator",By="horizontal",lI=["horizontal","vertical"],Q1=C.forwardRef((e,t)=>{const{decorative:s,orientation:o=By,...l}=e,m=cI(o)?o:By,a=s?{role:"none"}:{"aria-orientation":m==="vertical"?m:void 0,role:"separator"};return i.jsx(oI.div,{"data-orientation":m,...a,...l,ref:t})});Q1.displayName=aI;function cI(e){return lI.includes(e)}var Z1=Q1;const eC=C.forwardRef(({className:e,orientation:t="horizontal",decorative:s=!0,...o},l)=>i.jsx(Z1,{ref:l,decorative:s,orientation:t,className:xe("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...o}));eC.displayName=Z1.displayName;function uI(){var P,T;const[e,t]=C.useState(null),[s,o]=C.useState(""),[l,m]=C.useState({open:!1,field:null,type:"directory"}),[f,a]=C.useState(!0),[c,h]=C.useState(!1),[g,u]=C.useState(null),[_,S]=C.useState(!1);C.useEffect(()=>{v(),E()},[]);const E=async()=>{try{const R=await Ne.checkVersion();u(R)}catch(R){console.error("Failed to load version info:",R)}},b=async()=>{var R;if(!(g!=null&&g.updateAvailable)){le.error("No update available");return}S(!0);try{const j=await Ne.performUpdate({updateMethod:g.updateMethod,sourcePath:g.sourcePath});j.success?(j.updateMethod==="npm"?le.success(j.message||"Updated via npm! Restart the server to apply."):le.success(`Updated! Files: ${((R=j.updated)==null?void 0:R.join(", "))||"all"}. Restart the server to apply.`),E()):le.error("Update failed: "+j.error)}catch(j){le.error("Update failed: "+j.message)}finally{S(!1)}},v=async()=>{try{a(!0);const R=await Ne.getConfig();t(R.config),o(R.path)}catch{le.error("Failed to load settings")}finally{a(!1)}},y=async()=>{h(!0);try{await Ne.saveConfig(e),le.success("Preferences saved!")}catch{le.error("Failed to save preferences")}finally{h(!1)}},p=(R,j)=>{t(M=>({...M,[R]:j}))},x=(R,j,M)=>{t($=>({...$,[R]:{...$[R],[j]:M}}))},k=R=>{const j=(e==null?void 0:e.enabledTools)||["claude"];j.includes(R)?j.length>1&&p("enabledTools",j.filter(M=>M!==R)):p("enabledTools",[...j,R])};return f?i.jsx("div",{className:"flex items-center justify-center h-64",children:i.jsx(ct,{className:"w-8 h-8 animate-spin text-primary"})}):i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-10 h-10 rounded-lg bg-muted flex items-center justify-center",children:i.jsx(O_,{className:"w-5 h-5 text-muted-foreground"})}),i.jsxs("div",{children:[i.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"claude-config Preferences"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Tool settings for this configuration manager"})]})]}),i.jsxs("div",{className:"bg-card rounded-xl border border-border p-6 shadow-sm",children:[i.jsxs("div",{className:"flex items-center justify-between mb-6",children:[i.jsx("div",{children:i.jsxs("p",{className:"text-sm text-muted-foreground",children:["Stored in: ",i.jsx("code",{className:"bg-muted px-2 py-0.5 rounded",children:s})]})}),i.jsxs(de,{onClick:y,disabled:c,children:[c?i.jsx(ct,{className:"w-4 h-4 mr-2 animate-spin"}):i.jsx(ri,{className:"w-4 h-4 mr-2"}),"Save"]})]}),i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"border-b border-border pb-6",children:[i.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[i.jsx(jt,{className:"w-4 h-4"}),"Directories"]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium text-foreground",children:"MCP Tools Directories"}),i.jsx("p",{className:"text-xs text-muted-foreground mb-2",children:"Folders containing local MCP tool repositories for discovery"}),i.jsxs("div",{className:"space-y-2",children:[((e==null?void 0:e.toolsDirs)||(e!=null&&e.toolsDir?[e.toolsDir]:[])).map((R,j)=>i.jsxs("div",{className:"flex gap-2",children:[i.jsx(Xe,{value:R||"",onChange:M=>{const $=[...(e==null?void 0:e.toolsDirs)||(e!=null&&e.toolsDir?[e.toolsDir]:[])];$[j]=M.target.value,p("toolsDirs",$),e!=null&&e.toolsDir&&t(B=>{const{toolsDir:W,...H}=B;return{...H,toolsDirs:$}})},placeholder:"~/mcp-tools",className:"font-mono flex-1"}),i.jsx(de,{variant:"outline",size:"icon",onClick:()=>m({open:!0,field:"toolsDirs",type:"directory",index:j}),title:"Browse...",children:i.jsx(Kn,{className:"w-4 h-4"})}),i.jsx(de,{variant:"outline",size:"icon",onClick:()=>{const $=((e==null?void 0:e.toolsDirs)||(e!=null&&e.toolsDir?[e.toolsDir]:[])).filter((B,W)=>W!==j);t(B=>{const{toolsDir:W,...H}=B;return{...H,toolsDirs:$.length>0?$:void 0}})},title:"Remove",className:"text-destructive hover:text-destructive",children:i.jsx(I_,{className:"w-4 h-4"})})]},j)),i.jsxs(de,{variant:"outline",size:"sm",onClick:()=>m({open:!0,field:"toolsDirs",type:"directory",index:-1}),className:"mt-2",children:[i.jsx(N_,{className:"w-4 h-4 mr-2"}),"Add Tools Folder"]})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium text-foreground",children:"Global Registry Path"}),i.jsx("p",{className:"text-xs text-muted-foreground mb-2",children:"Path to the global MCP registry file"}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(Xe,{value:(e==null?void 0:e.registryPath)||"",onChange:R=>p("registryPath",R.target.value),placeholder:"~/.claude/registry.json",className:"font-mono flex-1"}),i.jsx(de,{variant:"outline",size:"icon",onClick:()=>m({open:!0,field:"registryPath",type:"file"}),title:"Browse...",children:i.jsx(Kn,{className:"w-4 h-4"})})]})]})]})]}),i.jsxs("div",{className:"border-b border-border pb-6",children:[i.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[i.jsx(Bc,{className:"w-4 h-4"}),"User Interface"]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium text-foreground",children:"Default Port"}),i.jsx("p",{className:"text-xs text-muted-foreground mb-2",children:"Port for the web UI server"}),i.jsx(Xe,{type:"number",value:((P=e==null?void 0:e.ui)==null?void 0:P.port)||3333,onChange:R=>x("ui","port",parseInt(R.target.value)||3333),placeholder:"3333",className:"w-32"})]}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium text-foreground",children:"Open Browser on Start"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Automatically open browser when starting the UI"})]}),i.jsx(yt,{checked:((T=e==null?void 0:e.ui)==null?void 0:T.openBrowser)??!0,onCheckedChange:R=>x("ui","openBrowser",R)})]})]})]}),i.jsxs("div",{className:"border-b border-border pb-6",children:[i.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[i.jsx($R,{className:"w-4 h-4"}),"AI Assistant"]}),i.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"Choose which AI assistant to use for features like MCP creation and tool import."}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("label",{className:`flex items-center gap-3 p-3 rounded-lg cursor-pointer border-2 transition-colors ${((e==null?void 0:e.aiAssistant)||"claude")==="claude"?"border-orange-500 bg-orange-500/5":"border-transparent bg-muted/50 hover:bg-muted"}`,onClick:()=>p("aiAssistant","claude"),children:[i.jsx("input",{type:"radio",name:"aiAssistant",value:"claude",checked:((e==null?void 0:e.aiAssistant)||"claude")==="claude",onChange:()=>p("aiAssistant","claude"),className:"sr-only"}),i.jsx("div",{className:"w-8 h-8 rounded-md bg-orange-500/10 flex items-center justify-center",children:i.jsx($t,{className:"w-4 h-4 text-orange-500"})}),i.jsxs("div",{className:"flex-1",children:[i.jsx("span",{className:"text-sm font-medium text-foreground",children:"Claude Code"}),i.jsxs("p",{className:"text-xs text-muted-foreground",children:["Anthropic's AI coding assistant • Command: ",i.jsx("code",{className:"text-xs",children:"claude"})]})]}),((e==null?void 0:e.aiAssistant)||"claude")==="claude"&&i.jsx("div",{className:"w-2 h-2 rounded-full bg-orange-500"})]}),i.jsxs("label",{className:`flex items-center gap-3 p-3 rounded-lg cursor-pointer border-2 transition-colors ${(e==null?void 0:e.aiAssistant)==="gemini"?"border-blue-500 bg-blue-500/5":"border-transparent bg-muted/50 hover:bg-muted"}`,onClick:()=>p("aiAssistant","gemini"),children:[i.jsx("input",{type:"radio",name:"aiAssistant",value:"gemini",checked:(e==null?void 0:e.aiAssistant)==="gemini",onChange:()=>p("aiAssistant","gemini"),className:"sr-only"}),i.jsx("div",{className:"w-8 h-8 rounded-md bg-blue-500/10 flex items-center justify-center",children:i.jsx(bt,{className:"w-4 h-4 text-blue-500"})}),i.jsxs("div",{className:"flex-1",children:[i.jsx("span",{className:"text-sm font-medium text-foreground",children:"Gemini CLI"}),i.jsxs("p",{className:"text-xs text-muted-foreground",children:["Google's AI coding assistant • Command: ",i.jsx("code",{className:"text-xs",children:"gemini"})]})]}),(e==null?void 0:e.aiAssistant)==="gemini"&&i.jsx("div",{className:"w-2 h-2 rounded-full bg-blue-500"})]})]})]}),i.jsxs("div",{className:"border-b border-border pb-6",children:[i.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[i.jsx(nT,{className:"w-4 h-4"}),"Enabled AI Tools"]}),i.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"Select which AI coding tools to generate MCP configurations for. The Apply button will update all enabled tools."}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center justify-between p-3 bg-muted/50 rounded-lg",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-8 h-8 rounded-md bg-orange-500/10 flex items-center justify-center",children:i.jsx($t,{className:"w-4 h-4 text-orange-500"})}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium text-foreground",children:"Claude Code"}),i.jsxs("p",{className:"text-xs text-muted-foreground",children:["Anthropic's AI coding assistant • Output: ",i.jsx("code",{className:"text-xs",children:".mcp.json"})]})]})]}),i.jsx(yt,{checked:((e==null?void 0:e.enabledTools)||["claude"]).includes("claude"),onCheckedChange:()=>k("claude")})]}),i.jsxs("div",{className:"flex items-center justify-between p-3 bg-muted/50 rounded-lg",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-8 h-8 rounded-md bg-blue-500/10 flex items-center justify-center",children:i.jsx($t,{className:"w-4 h-4 text-blue-500"})}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium text-foreground",children:"Gemini CLI"}),i.jsxs("p",{className:"text-xs text-muted-foreground",children:["Google's terminal AI coding assistant • Output: ",i.jsx("code",{className:"text-xs",children:"~/.gemini/settings.json"})]})]})]}),i.jsx(yt,{checked:((e==null?void 0:e.enabledTools)||["claude"]).includes("gemini"),onCheckedChange:()=>k("gemini")})]}),i.jsxs("div",{className:"flex items-center justify-between p-3 bg-muted/50 rounded-lg",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-8 h-8 rounded-md bg-purple-500/10 flex items-center justify-center",children:i.jsx($t,{className:"w-4 h-4 text-purple-500"})}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium text-foreground",children:"Antigravity"}),i.jsxs("p",{className:"text-xs text-muted-foreground",children:["Google's AI IDE • Output: ",i.jsx("code",{className:"text-xs",children:"~/.gemini/antigravity/mcp_config.json"})]})]})]}),i.jsx(yt,{checked:((e==null?void 0:e.enabledTools)||["claude"]).includes("antigravity"),onCheckedChange:()=>k("antigravity")})]}),i.jsxs("p",{className:"text-xs text-muted-foreground italic",children:["Note: Antigravity does not support environment variable interpolation (",i.jsx("code",{children:"${VAR}"}),"). Variables are resolved to actual values when generating its config."]})]})]}),i.jsxs("div",{children:[i.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[i.jsx(mr,{className:"w-4 h-4"}),"About"]}),i.jsxs("div",{className:"bg-muted rounded-lg p-4 space-y-3",children:[i.jsxs("div",{className:"flex justify-between text-sm",children:[i.jsx("span",{className:"text-muted-foreground",children:"Installed Version"}),i.jsx("span",{className:"font-medium font-mono text-foreground",children:(g==null?void 0:g.installedVersion)||"Loading..."})]}),(g==null?void 0:g.updateAvailable)&&i.jsx("div",{className:"p-3 bg-green-500/10 border border-green-500/20 rounded-lg",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("p",{className:"text-sm font-medium text-green-600 dark:text-green-400",children:"Update Available!"}),i.jsxs("p",{className:"text-xs text-green-600/80 dark:text-green-400/80",children:["Version ",g.latestVersion," via ",g.updateMethod==="npm"?"npm":g.sourcePath]})]}),i.jsxs(de,{size:"sm",onClick:b,disabled:_,className:"bg-green-600 hover:bg-green-700 text-white",children:[_?i.jsx(ct,{className:"w-4 h-4 mr-2 animate-spin"}):i.jsx(Ic,{className:"w-4 h-4 mr-2"}),"Update Now"]})]})}),!(g!=null&&g.updateAvailable)&&(g==null?void 0:g.latestVersion)&&i.jsxs("div",{className:"flex justify-between text-sm",children:[i.jsx("span",{className:"text-muted-foreground",children:"Latest Version"}),i.jsxs("span",{className:"font-mono text-green-600 dark:text-green-400",children:[g.latestVersion," ✓"]})]}),(g==null?void 0:g.sourcePath)&&!(g!=null&&g.updateAvailable)&&i.jsxs("div",{className:"flex items-center justify-between text-sm",children:[i.jsx("span",{className:"text-muted-foreground",children:"Dev Source"}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("code",{className:"text-xs text-muted-foreground",children:g.sourcePath}),i.jsx(de,{size:"sm",variant:"outline",onClick:b,disabled:_,className:"h-7",children:_?i.jsx(ct,{className:"w-3 h-3 animate-spin"}):i.jsx(gr,{className:"w-3 h-3"})})]})]}),i.jsxs("div",{className:"flex justify-between text-sm",children:[i.jsx("span",{className:"text-muted-foreground",children:"Install Location"}),i.jsx("code",{className:"text-xs text-muted-foreground",children:(g==null?void 0:g.installDir)||"~/.claude-config"})]}),i.jsxs("div",{className:"border-t border-border pt-3 mt-3",children:[i.jsxs("div",{className:"flex justify-between text-sm",children:[i.jsx("span",{className:"text-muted-foreground",children:"Documentation"}),i.jsx("a",{href:"https://github.com/regression-io/claude-config",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"GitHub"})]}),i.jsxs("p",{className:"text-xs text-muted-foreground mt-2",children:["After updating, restart the server with ",i.jsx("code",{className:"bg-muted-foreground/10 px-1 rounded",children:"claude-config ui"})]})]})]})]})]})]}),i.jsx(Y1,{open:l.open,onOpenChange:R=>m(j=>({...j,open:R})),onSelect:R=>{if(l.field==="toolsDirs"){const j=(e==null?void 0:e.toolsDirs)||(e!=null&&e.toolsDir?[e.toolsDir]:[]);if(l.index===-1)t(M=>{const{toolsDir:$,...B}=M;return{...B,toolsDirs:[...j,R]}});else{const M=[...j];M[l.index]=R,t($=>{const{toolsDir:B,...W}=$;return{...W,toolsDirs:M}})}}else l.field&&p(l.field,R)},type:l.type,initialPath:l.field==="toolsDirs"&&l.index>=0?((e==null?void 0:e.toolsDirs)||(e!=null&&e.toolsDir?[e.toolsDir]:[]))[l.index]||"~":(e==null?void 0:e[l.field])||"~",title:l.type==="directory"?"Select Directory":"Select File"})]})}function dI(){const[e,t]=C.useState(null),[s,o]=C.useState(!0);C.useEffect(()=>{l()},[]);const l=async()=>{try{o(!0);const f=await Ne.getClaudeSettings();t(f.settings)}catch(f){console.error("Failed to load Claude settings:",f)}finally{o(!1)}},m=async f=>{try{await Ne.saveClaudeSettings(f),t(f),le.success("Claude Code settings saved!")}catch(a){le.error("Failed to save settings: "+a.message)}};return s?i.jsx("div",{className:"flex items-center justify-center h-64",children:i.jsx(ct,{className:"w-8 h-8 animate-spin text-indigo-600"})}):i.jsx("div",{className:"space-y-6",children:i.jsx("div",{className:"bg-white dark:bg-slate-950 rounded-xl border border-gray-200 dark:border-slate-800 p-6 shadow-sm",children:i.jsx(k1,{settings:e,onSave:m,loading:s,settingsPath:"~/.claude/settings.json"})})})}function hI(){const[e,t]=C.useState(null),[s,o]=C.useState(!0);C.useEffect(()=>{l()},[]);const l=async()=>{try{o(!0);const f=await Ne.getGeminiSettings();t(f.settings)}catch(f){console.error("Failed to load Gemini settings:",f)}finally{o(!1)}},m=async f=>{try{await Ne.saveGeminiSettings(f),t(f),le.success("Gemini CLI settings saved!")}catch(a){le.error("Failed to save settings: "+a.message)}};return s?i.jsx("div",{className:"flex items-center justify-center h-64",children:i.jsx(ct,{className:"w-8 h-8 animate-spin text-blue-600"})}):i.jsx("div",{className:"space-y-6",children:i.jsx("div",{className:"bg-white dark:bg-slate-950 rounded-xl border border-gray-200 dark:border-slate-800 p-6 shadow-sm",children:i.jsx(E1,{settings:e,onSave:m,loading:s,settingsPath:"~/.gemini/settings.json"})})})}var jh={exports:{}},Fy;function fI(){return Fy||(Fy=1,(function(e,t){(function(s,o){e.exports=o()})(globalThis,(()=>(()=>{var s={4567:function(f,a,c){var h=this&&this.__decorate||function(p,x,k,P){var T,R=arguments.length,j=R<3?x:P===null?P=Object.getOwnPropertyDescriptor(x,k):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(p,x,k,P);else for(var M=p.length-1;M>=0;M--)(T=p[M])&&(j=(R<3?T(j):R>3?T(x,k,j):T(x,k))||j);return R>3&&j&&Object.defineProperty(x,k,j),j},g=this&&this.__param||function(p,x){return function(k,P){x(k,P,p)}};Object.defineProperty(a,"__esModule",{value:!0}),a.AccessibilityManager=void 0;const u=c(9042),_=c(9924),S=c(844),E=c(4725),b=c(2585),v=c(3656);let y=a.AccessibilityManager=class extends S.Disposable{constructor(p,x,k,P){super(),this._terminal=p,this._coreBrowserService=k,this._renderService=P,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let T=0;T<this._terminal.rows;T++)this._rowElements[T]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[T]);if(this._topBoundaryFocusListener=T=>this._handleBoundaryFocus(T,0),this._bottomBoundaryFocusListener=T=>this._handleBoundaryFocus(T,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new _.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((T=>this._handleResize(T.rows)))),this.register(this._terminal.onRender((T=>this._refreshRows(T.start,T.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((T=>this._handleChar(T)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
|
|
507
|
+
`+a),t(),le.success("Content inserted")},b=()=>{f(""),c(""),t()};return i.jsx(ir,{open:e,onOpenChange:b,children:i.jsxs(Qt,{className:"max-w-2xl max-h-[80vh] overflow-hidden flex flex-col",children:[i.jsxs(Zt,{children:[i.jsxs(tr,{className:"flex items-center gap-2",children:[i.jsx($t,{className:"w-5 h-5 text-indigo-600"}),"AI Assist"]}),i.jsxs(Nr,{children:["Generate content for your ",s||"file"," using templates or custom prompts"]})]}),i.jsxs("div",{className:"flex-1 overflow-auto space-y-4 py-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300 mb-2 block",children:"Quick Templates"}),i.jsx("div",{className:"flex flex-wrap gap-2",children:_.map(v=>i.jsx(de,{variant:"outline",size:"sm",onClick:()=>{f(v.prompt),S(v.prompt)},disabled:h,children:v.label},v.label))})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300 mb-2 block",children:"Custom Prompt"}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(Xe,{placeholder:"Describe what you want to generate...",value:m,onChange:v=>f(v.target.value),onKeyDown:v=>v.key==="Enter"&&S()}),i.jsx(de,{onClick:()=>S(),disabled:h||!m.trim(),children:h?i.jsx(gr,{className:"w-4 h-4 animate-spin"}):"Generate"})]})]}),a&&i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300 mb-2 block",children:"Generated Content"}),i.jsx(Ze,{value:a,onChange:v=>c(v.target.value),className:"font-mono text-sm min-h-[200px]"})]})]}),i.jsxs(er,{children:[i.jsx(de,{variant:"ghost",onClick:b,children:"Cancel"}),a&&i.jsxs(i.Fragment,{children:[i.jsx(de,{variant:"outline",onClick:()=>E("append"),children:"Append to File"}),i.jsx(de,{onClick:()=>E("replace"),className:"bg-indigo-600 hover:bg-indigo-700 text-white",children:"Replace Content"})]})]})]})})}function Iy({content:e,onSave:t,fileType:s}){const[o,l]=C.useState(e||""),[m,f]=C.useState(!1),[a,c]=C.useState(!1);C.useEffect(()=>{l(e||""),f(!1)},[e]);const h=()=>{t(o),f(!1)},g=_=>{l(_),f(!0)},u=fa[s]||fa.claudemd;return i.jsxs("div",{className:"h-full flex flex-col",children:[i.jsxs("div",{className:"flex items-center justify-between p-3 border-b bg-gray-50 dark:bg-slate-800",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(u.icon,{className:xe("w-4 h-4",u.color)}),i.jsx("span",{className:"text-sm font-medium",children:u.label})]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsxs(de,{variant:"outline",size:"sm",onClick:()=>c(!0),children:[i.jsx($t,{className:"w-4 h-4 mr-1"}),"AI Assist"]}),m&&i.jsxs(de,{size:"sm",onClick:h,children:[i.jsx(ri,{className:"w-4 h-4 mr-1"}),"Save"]})]})]}),i.jsx(Ze,{className:"flex-1 w-full font-mono text-sm border-0 rounded-none resize-none p-4",value:o,onChange:_=>{l(_.target.value),f(!0)},placeholder:`Enter ${u.label.toLowerCase()} content...`}),i.jsx(YO,{open:a,onClose:()=>c(!1),fileType:s,currentContent:o,onInsert:g})]})}function XO({content:e,parsed:t,onSave:s,filePath:o}){const l=async a=>{const c=JSON.stringify(a,null,2);s(c)},m=(o==null?void 0:o.includes(".gemini"))||(o==null?void 0:o.includes("/.gemini/")),f=(o==null?void 0:o.includes(".agent"))||(o==null?void 0:o.includes("/antigravity/"));return m&&!f?i.jsx("div",{className:"h-full overflow-auto p-4",children:i.jsx(E1,{settings:t||{},onSave:l,loading:!1,settingsPath:o||"~/.gemini/settings.json"})}):i.jsx("div",{className:"h-full overflow-auto p-4",children:i.jsx(k1,{settings:t||{},onSave:l,loading:!1,settingsPath:o||"~/.claude/settings.json"})})}function JO({open:e,onClose:t,item:s,intermediatePaths:o,onMove:l}){const[m,f]=C.useState("copy"),[a,c]=C.useState(null),[h,g]=C.useState(""),[u,_]=C.useState(!1),S=()=>{const E=h.trim()||a;if(!E){le.error("Please select or enter a target path");return}l(s.path,E,m,u)};return i.jsx(ir,{open:e,onOpenChange:t,children:i.jsxs(Qt,{className:"max-w-md",children:[i.jsxs(Zt,{children:[i.jsxs(tr,{children:[m==="copy"?"Copy":"Move"," ",s==null?void 0:s.name]}),i.jsx(Nr,{children:"Select a destination for this file"})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex gap-2",children:[i.jsxs(de,{variant:m==="copy"?"default":"outline",size:"sm",onClick:()=>f("copy"),children:[i.jsx(zi,{className:"w-4 h-4 mr-1"}),"Copy"]}),i.jsxs(de,{variant:m==="move"?"default":"outline",size:"sm",onClick:()=>f("move"),children:[i.jsx(M_,{className:"w-4 h-4 mr-1"}),"Move"]})]}),i.jsx("div",{className:"space-y-2 max-h-48 overflow-y-auto",children:o==null?void 0:o.map(E=>i.jsxs("div",{className:xe("flex items-center justify-between p-2 rounded border cursor-pointer",a===E.dir?"border-blue-500 bg-blue-50":"hover:bg-gray-50 dark:bg-slate-800"),onClick:()=>{c(E.dir),g("")},children:[i.jsxs("div",{className:"flex items-center gap-2",children:[E.isHome?i.jsx(Qf,{className:"w-4 h-4"}):i.jsx(jt,{className:"w-4 h-4"}),i.jsx("span",{className:"text-sm",children:E.label})]}),E.hasClaudeFolder?i.jsx(st,{variant:"secondary",className:"text-xs",children:"exists"}):i.jsx(st,{variant:"outline",className:"text-xs",children:"create"})]},E.dir))}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium",children:"Or enter custom path:"}),i.jsx(Xe,{className:"mt-1 font-mono text-sm",placeholder:"/path/to/directory",value:h,onChange:E=>{g(E.target.value),c(null)}})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(yt,{checked:u,onCheckedChange:_}),i.jsx("span",{className:"text-sm",children:"Merge if target exists"})]})]}),i.jsxs(er,{children:[i.jsx(de,{variant:"ghost",onClick:t,children:"Cancel"}),i.jsx(de,{onClick:S,children:m==="copy"?"Copy":"Move"})]})]})})}function QO({open:e,onClose:t,item:s,onRename:o}){const[l,m]=C.useState("");C.useEffect(()=>{s!=null&&s.name&&m(s.name.replace(/\.md$/,""))},[s,e]);const f=()=>{if(!l.trim()){le.error("Please enter a name");return}o(s,l.trim())};return i.jsx(ir,{open:e,onOpenChange:t,children:i.jsxs(Qt,{className:"sm:max-w-md",children:[i.jsx(Zt,{children:i.jsxs(tr,{children:["Rename ",s==null?void 0:s.type]})}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium",children:"New name"}),i.jsx(Xe,{className:"mt-1",placeholder:"new-name",value:l,onChange:a=>m(a.target.value),onKeyDown:a=>a.key==="Enter"&&f()}),i.jsx("p",{className:"text-xs text-gray-500 dark:text-slate-400 mt-1",children:".md extension will be added automatically"})]}),i.jsxs(er,{children:[i.jsx(de,{variant:"ghost",onClick:t,children:"Cancel"}),i.jsx(de,{onClick:f,children:"Rename"})]})]})})}function ZO({open:e,onClose:t,dir:s,type:o,onCreate:l}){const[m,f]=C.useState("");C.useEffect(()=>{f("")},[e]);const a=()=>{if((o==="command"||o==="rule"||o==="workflow")&&!m.trim()){le.error("Please enter a name");return}const g=o==="command"||o==="rule"||o==="workflow"?m.endsWith(".md")?m:`${m}.md`:m;l(s,g,o)},c=fa[o]||{},h=o==="command"||o==="rule"||o==="workflow";return i.jsx(ir,{open:e,onOpenChange:t,children:i.jsxs(Qt,{className:"max-w-sm",children:[i.jsx(Zt,{children:i.jsxs(tr,{children:["Create ",c.label||o]})}),h&&i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium",children:"Name"}),i.jsx(Xe,{className:"mt-1",placeholder:o==="command"?"my-command.md":o==="workflow"?"my-workflow.md":"my-rule.md",value:m,onChange:g=>f(g.target.value),onKeyDown:g=>g.key==="Enter"&&a()})]}),i.jsxs(er,{children:[i.jsx(de,{variant:"ghost",onClick:t,children:"Cancel"}),i.jsx(de,{onClick:a,children:"Create"})]})]})})}function eI({project:e,onRefresh:t}){var ue,U,O;const[s,o]=C.useState([]),[l,m]=C.useState([]),[f,a]=C.useState(null),[c,h]=C.useState(null),[g,u]=C.useState(null),[_,S]=C.useState({}),[E,b]=C.useState(!0),[v,y]=C.useState({open:!1,item:null}),[p,x]=C.useState({open:!1,dir:null,type:null}),[k,P]=C.useState({open:!1,item:null}),[T,R]=C.useState(!1),[j,M]=C.useState(!1),[$,B]=C.useState({x:0,y:0,item:null}),[W,H]=C.useState(["claude"]),J=C.useCallback(async()=>{var Q;try{b(!0);const[X,q,re,he]=await Promise.all([Ne.getClaudeFolders(),Ne.getIntermediatePaths(),Ne.getRegistry(),Ne.getConfig()]);o(X),m(q),a(re),H(((Q=he.config)==null?void 0:Q.enabledTools)||["claude"])}catch(X){le.error("Failed to load data: "+X.message)}finally{b(!1)}},[]);C.useEffect(()=>{J(),h(null),u(null)},[J,e==null?void 0:e.dir]);const K=async Q=>{h(Q);try{const X=await Ne.getClaudeFile(Q.path);u(X)}catch(X){le.error("Failed to load file: "+X.message)}},G=async Q=>{if(c)try{await Ne.saveClaudeFile(c.path,Q),le.success("Saved");const X=await Ne.getClaudeFile(c.path);u(X),J()}catch(X){le.error("Failed to save: "+X.message)}},ee=Q=>{S(X=>({...X,[Q]:!X[Q]}))},z=(Q,X)=>{Q.preventDefault(),B({x:Q.clientX,y:Q.clientY,item:X})},D=(Q,X)=>{X==="command"||X==="rule"||X==="workflow"?x({open:!0,dir:Q,type:X}):F(Q,X==="mcps"?"mcps.json":X==="settings"?"settings.json":"CLAUDE.md",X)},F=async(Q,X,q)=>{try{const re=await Ne.createClaudeFile(Q,X,q);if(le.success("Created"),x({open:!1,dir:null,type:null}),await J(),re.path){const he={path:re.path,name:X,type:q==="command"?"command":q==="rule"?"rule":q==="workflow"?"workflow":"file"};h(he),u(re.content||"")}}catch(re){le.error("Failed to create: "+re.message)}},L=async Q=>{try{await Ne.createClaudeFile(Q,"mcps.json","mcps"),le.success(`Created .claude folder at ${Q}`),R(!1),J()}catch(X){le.error("Failed to create: "+X.message)}},V=async(Q,X)=>{try{const q=await Ne.renameClaudeFile(Q.path,X);q.success?(le.success("Renamed"),P({open:!1,item:null}),await J(),h({...Q,path:q.newPath,name:X.endsWith(".md")?X:`${X}.md`})):le.error(q.error||"Failed to rename")}catch(q){le.error("Failed to rename: "+q.message)}},te=async Q=>{if(confirm(`Delete ${Q.name}?`))try{await Ne.deleteClaudeFile(Q.path),le.success("Deleted"),(c==null?void 0:c.path)===Q.path&&(h(null),u(null)),J()}catch(X){le.error("Failed to delete: "+X.message)}},ne=async(Q,X,q,re)=>{try{await Ne.moveClaudeItem(Q,X,q,re),le.success(q==="copy"?"Copied":"Moved"),y({open:!1,item:null}),J()}catch(he){le.error("Failed: "+he.message)}},ce=()=>{if(!c||!g)return i.jsx("div",{className:"h-full flex items-center justify-center text-gray-500 dark:text-slate-400",children:i.jsxs("div",{className:"text-center",children:[i.jsx(Gh,{className:"w-12 h-12 mx-auto mb-2 opacity-50"}),i.jsx("p",{children:"Select a file to edit"})]})});switch(c.type){case"mcps":return i.jsx(qO,{content:g.content,parsed:g.parsed,onSave:G,registry:f});case"settings":return i.jsx(XO,{content:g.content,parsed:g.parsed,onSave:G,filePath:c==null?void 0:c.path});case"command":case"rule":case"workflow":case"claudemd":return i.jsx(Iy,{content:g.content,onSave:G,fileType:c.type});default:return i.jsx(Iy,{content:g.content,onSave:G,fileType:"claudemd"})}};return E?i.jsx("div",{className:"h-full flex items-center justify-center",children:i.jsx(gr,{className:"w-6 h-6 animate-spin text-gray-400"})}):i.jsxs("div",{className:"h-full flex",children:[i.jsxs("div",{className:"w-72 border-r flex flex-col bg-white dark:bg-slate-950",children:[i.jsxs("div",{className:"flex items-center justify-between p-3 border-b",children:[i.jsx("h2",{className:"font-semibold text-sm",children:"Project Config"}),i.jsxs("div",{className:"flex gap-1",children:[W.includes("claude")&&W.includes("antigravity")&&i.jsxs(de,{variant:"ghost",size:"sm",className:"h-7 px-2",onClick:()=>M(!0),title:"Sync rules between tools",children:[i.jsx(MR,{className:"w-4 h-4 mr-1"}),"Sync"]}),i.jsxs(de,{variant:"ghost",size:"sm",className:"h-7 px-2",onClick:()=>R(!0),children:[i.jsx(Ht,{className:"w-4 h-4 mr-1"}),"New"]}),i.jsx(de,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:J,children:i.jsx(gr,{className:"w-4 h-4"})})]})]}),i.jsx(ei,{className:"flex-1",children:s.map((Q,X)=>{var q,re;return i.jsxs("div",{children:[i.jsx(GO,{folder:Q,isFirst:X===0,isLast:X===s.length-1,onCreateFile:D}),Q.exists&&Q.files.length>0?i.jsxs("div",{className:"py-1",children:[i.jsxs("div",{className:"px-3 py-1 text-[10px] font-medium text-orange-600 uppercase tracking-wide flex items-center gap-1",children:[i.jsx($t,{className:"w-3 h-3"}),"Claude Code"]}),Q.files.map(he=>i.jsx(oc,{item:he,selectedPath:c==null?void 0:c.path,onSelect:K,onContextMenu:z,expandedFolders:_,onToggleFolder:ee},he.path))]}):i.jsx("div",{className:"px-4 py-2 text-sm text-gray-400 italic",children:Q.exists?"Empty .claude":"No .claude folder"}),Q.geminiExists&&((q=Q.geminiFiles)==null?void 0:q.length)>0&&i.jsxs("div",{className:"py-1 border-t border-dashed border-gray-200 dark:border-slate-700 mt-1",children:[i.jsxs("div",{className:"px-3 py-1 text-[10px] font-medium text-blue-600 uppercase tracking-wide flex items-center gap-1",children:[i.jsx($t,{className:"w-3 h-3"}),"Gemini CLI"]}),Q.geminiFiles.map(he=>i.jsx(oc,{item:he,selectedPath:c==null?void 0:c.path,onSelect:K,onContextMenu:z,expandedFolders:_,onToggleFolder:ee},he.path))]}),Q.agentExists&&((re=Q.agentFiles)==null?void 0:re.length)>0&&i.jsxs("div",{className:"py-1 border-t border-dashed border-gray-200 dark:border-slate-700 mt-1",children:[i.jsxs("div",{className:"px-3 py-1 text-[10px] font-medium text-purple-600 uppercase tracking-wide flex items-center gap-1",children:[i.jsx($t,{className:"w-3 h-3"}),"Antigravity"]}),Q.agentFiles.map(he=>i.jsx(oc,{item:he,selectedPath:c==null?void 0:c.path,onSelect:K,onContextMenu:z,expandedFolders:_,onToggleFolder:ee},he.path))]})]},Q.dir)})})]}),i.jsxs("div",{className:"flex-1 flex flex-col bg-gray-50 dark:bg-slate-800",children:[c&&i.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b bg-white dark:bg-slate-950",children:[i.jsx("div",{className:"flex items-center gap-2 text-sm",children:i.jsx("span",{className:"text-gray-500 dark:text-slate-400 font-mono truncate max-w-md",children:c.path})}),i.jsxs("div",{className:"flex gap-1",children:[i.jsx(de,{variant:"ghost",size:"sm",onClick:()=>y({open:!0,item:c}),children:i.jsx(zi,{className:"w-4 h-4"})}),i.jsx(de,{variant:"ghost",size:"sm",onClick:()=>te(c),children:i.jsx(Gn,{className:"w-4 h-4"})})]})]}),i.jsx("div",{className:"flex-1",children:ce()})]}),$.item&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>B({x:0,y:0,item:null})}),i.jsxs("div",{className:"fixed z-50 bg-white dark:bg-slate-950 rounded-md shadow-lg border py-1 min-w-[160px]",style:{left:$.x,top:$.y},children:[(((ue=$.item)==null?void 0:ue.type)==="rule"||((U=$.item)==null?void 0:U.type)==="command"||((O=$.item)==null?void 0:O.type)==="workflow")&&i.jsxs("button",{className:"w-full px-3 py-2 text-sm text-left hover:bg-gray-100 dark:hover:bg-slate-700 dark:bg-slate-700 flex items-center",onClick:()=>{P({open:!0,item:$.item}),B({x:0,y:0,item:null})},children:[i.jsx(Zf,{className:"w-4 h-4 mr-2"}),"Rename"]}),i.jsxs("button",{className:"w-full px-3 py-2 text-sm text-left hover:bg-gray-100 dark:hover:bg-slate-700 dark:bg-slate-700 flex items-center",onClick:()=>{y({open:!0,item:$.item}),B({x:0,y:0,item:null})},children:[i.jsx(zi,{className:"w-4 h-4 mr-2"}),"Copy to..."]}),i.jsxs("button",{className:"w-full px-3 py-2 text-sm text-left hover:bg-gray-100 dark:hover:bg-slate-700 dark:bg-slate-700 flex items-center",onClick:()=>{y({open:!0,item:$.item}),B({x:0,y:0,item:null})},children:[i.jsx(M_,{className:"w-4 h-4 mr-2"}),"Move to..."]}),i.jsx("div",{className:"border-t my-1"}),i.jsxs("button",{className:"w-full px-3 py-2 text-sm text-left hover:bg-gray-100 dark:hover:bg-slate-700 dark:bg-slate-700 flex items-center text-red-600",onClick:()=>{te($.item),B({x:0,y:0,item:null})},children:[i.jsx(Gn,{className:"w-4 h-4 mr-2"}),"Delete"]})]})]}),i.jsx(JO,{open:v.open,onClose:()=>y({open:!1,item:null}),item:v.item,intermediatePaths:l,onMove:ne}),i.jsx(ZO,{open:p.open,onClose:()=>x({open:!1,dir:null,type:null}),dir:p.dir,type:p.type,onCreate:F}),i.jsx(QO,{open:k.open,onClose:()=>P({open:!1,item:null}),item:k.item,onRename:V}),i.jsx(ir,{open:T,onOpenChange:R,children:i.jsxs(Qt,{className:"max-w-md",children:[i.jsxs(Zt,{children:[i.jsx(tr,{children:"Create New .claude Folder"}),i.jsx(Nr,{children:"Select a location to create a new .claude configuration folder"})]}),i.jsxs("div",{className:"space-y-2 max-h-64 overflow-y-auto",children:[l.filter(Q=>!s.some(X=>X.dir===Q.dir)).map(Q=>i.jsxs("div",{className:"flex items-center justify-between p-3 rounded border hover:bg-gray-50 dark:bg-slate-800 cursor-pointer",onClick:()=>L(Q.dir),children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(jt,{className:"w-4 h-4 text-gray-500 dark:text-slate-400"}),i.jsx("span",{className:"text-sm font-mono",children:Q.label})]}),i.jsx(st,{variant:"outline",className:"text-xs",children:"create"})]},Q.dir)),l.filter(Q=>!s.some(X=>X.dir===Q.dir)).length===0&&i.jsx("p",{className:"text-sm text-gray-500 dark:text-slate-400 text-center py-4",children:"All intermediate directories already have .claude folders"})]}),i.jsx(er,{children:i.jsx(de,{variant:"ghost",onClick:()=>R(!1),children:"Cancel"})})]})}),i.jsx(DO,{open:j,onOpenChange:M,projectDir:e==null?void 0:e.dir,onSynced:J})]})}function tI({projects:e=[],activeProject:t=null,onSwitch:s,onAddClick:o,onManageClick:l,disabled:m=!1}){const f=(t==null?void 0:t.name)||"No Project";return i.jsxs(Ta,{children:[i.jsx(Aa,{asChild:!0,children:i.jsxs(de,{variant:"outline",className:"gap-2 max-w-[220px] h-9",disabled:m,children:[i.jsx(Kn,{className:"w-4 h-4 text-indigo-500 flex-shrink-0"}),i.jsx("span",{className:"truncate font-medium",children:f}),i.jsx(xa,{className:"w-4 h-4 opacity-50 flex-shrink-0"})]})}),i.jsxs(no,{align:"start",className:"w-72",children:[i.jsx(S1,{className:"text-xs text-gray-500 font-normal",children:"Projects"}),i.jsx(qi,{}),e.length===0?i.jsxs("div",{className:"px-3 py-6 text-sm text-gray-500 text-center",children:[i.jsx(jt,{className:"w-8 h-8 mx-auto mb-2 text-gray-300"}),i.jsx("p",{children:"No projects registered"}),i.jsx("p",{className:"text-xs mt-1",children:"Add a project to get started"})]}):i.jsx("div",{className:"max-h-64 overflow-y-auto",children:e.map(a=>i.jsxs(Dt,{onClick:()=>!a.isActive&&s(a.id),className:`flex items-start gap-2 py-2 cursor-pointer ${a.isActive?"bg-indigo-50":""}`,disabled:a.isActive,children:[i.jsx("div",{className:"mt-0.5 flex-shrink-0",children:a.isActive?i.jsx(Rr,{className:"w-4 h-4 text-indigo-600"}):a.exists?i.jsx(jt,{className:"w-4 h-4 text-gray-400"}):i.jsx(Fc,{className:"w-4 h-4 text-amber-500"})}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("div",{className:`truncate font-medium ${a.isActive?"text-indigo-700":""}`,children:a.name}),i.jsx("div",{className:"truncate text-xs text-gray-400 font-mono",children:a.path.replace(/^\/Users\/[^/]+/,"~")}),!a.exists&&i.jsx("div",{className:"text-xs text-amber-600 mt-0.5",children:"Path not found"})]}),a.hasClaudeConfig&&i.jsx("div",{className:"flex-shrink-0",children:i.jsx("div",{className:"w-2 h-2 rounded-full bg-green-400",title:"Has .claude config"})})]},a.id))}),i.jsx(qi,{}),i.jsxs(Dt,{onClick:o,className:"gap-2 cursor-pointer",children:[i.jsx(Ht,{className:"w-4 h-4"}),"Add Project"]}),e.length>0&&i.jsxs(Dt,{onClick:l,className:"gap-2 cursor-pointer",children:[i.jsx(KT,{className:"w-4 h-4"}),"Manage Projects"]})]})]})}function Y1({open:e,onOpenChange:t,onSelect:s,type:o="directory",initialPath:l="~",title:m="Select Path"}){const[f,a]=C.useState(""),[c,h]=C.useState([]),[g,u]=C.useState(!1),[_,S]=C.useState(null),[E,b]=C.useState(""),[v,y]=C.useState("");C.useEffect(()=>{e&&p(l)},[e,l]);const p=async R=>{u(!0),S(null);try{const j=await Ne.browse(R,o);j.error?(S(j.error),j.path&&(a(j.path),y(j.path))):(a(j.path),y(j.path),h(j.items||[]),j.home&&b(j.home))}catch(j){S(j.message)}finally{u(!1)}},x=R=>{R.type==="directory"?p(R.path):o==="file"&&(s(R.path),t(!1))},k=()=>{s(f),t(!1)},P=()=>{v&&p(v)},T=R=>{R.key==="Enter"&&P()};return i.jsx(ir,{open:e,onOpenChange:t,children:i.jsxs(Qt,{className:"max-w-lg",children:[i.jsx(Zt,{children:i.jsxs(tr,{className:"flex items-center gap-2",children:[o==="directory"?i.jsx(jt,{className:"w-5 h-5"}):i.jsx(Gh,{className:"w-5 h-5"}),m]})}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex gap-2",children:[i.jsx(Xe,{value:v,onChange:R=>y(R.target.value),onKeyDown:T,placeholder:"Enter path...",className:"font-mono text-sm flex-1"}),i.jsx(de,{variant:"outline",size:"icon",onClick:()=>p(E||"~"),title:"Go to home",children:i.jsx(Qf,{className:"w-4 h-4"})}),i.jsx(de,{onClick:P,disabled:g,children:"Go"})]}),i.jsx("div",{className:"text-xs text-gray-500 font-mono truncate px-1",children:f}),_&&i.jsx("div",{className:"text-sm text-red-600 bg-red-50 p-2 rounded",children:_}),i.jsx(ei,{className:"h-64 border rounded-lg",children:g?i.jsx("div",{className:"flex items-center justify-center h-full",children:i.jsx(ct,{className:"w-6 h-6 animate-spin text-gray-400"})}):i.jsx("div",{className:"p-1",children:c.length===0?i.jsx("div",{className:"text-sm text-gray-500 p-4 text-center",children:o==="directory"?"No subdirectories":"No files found"}):c.map((R,j)=>i.jsxs("button",{onClick:()=>x(R),className:"w-full flex items-center gap-2 px-3 py-2 text-sm hover:bg-gray-100 rounded transition-colors text-left",children:[R.type==="directory"?i.jsx(jt,{className:"w-4 h-4 text-blue-500 flex-shrink-0"}):i.jsx(Gh,{className:"w-4 h-4 text-gray-400 flex-shrink-0"}),i.jsx("span",{className:`flex-1 truncate ${R.isParent?"text-gray-500":""}`,children:R.name}),R.type==="directory"&&!R.isParent&&i.jsx(Oc,{className:"w-4 h-4 text-gray-400"})]},j))})})]}),i.jsxs(er,{children:[i.jsx(de,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),i.jsx(de,{onClick:k,disabled:!f,children:o==="directory"?"Select Folder":"Select"})]})]})})}function X1({open:e,onOpenChange:t,onAdded:s}){const[o,l]=C.useState(""),[m,f]=C.useState(""),[a,c]=C.useState(!1),[h,g]=C.useState(!1);C.useEffect(()=>{e&&(l(""),f(""))},[e]),C.useEffect(()=>{if(o&&!m){const S=o.split("/").pop();f(S||"")}},[o]);const u=S=>{l(S),c(!1)},_=async()=>{if(!o){le.error("Please select a project path");return}g(!0);try{const S=await Ne.addProject(o,m||void 0);S.error?le.error(S.error):(le.success(`Added project: ${S.project.name}`),s==null||s(S.project),t(!1))}catch(S){le.error("Failed to add project: "+S.message)}finally{g(!1)}};return i.jsxs(i.Fragment,{children:[i.jsx(ir,{open:e,onOpenChange:t,children:i.jsxs(Qt,{className:"sm:max-w-md",children:[i.jsxs(Zt,{children:[i.jsxs(tr,{className:"flex items-center gap-2",children:[i.jsx(Kn,{className:"w-5 h-5 text-indigo-500"}),"Add Project"]}),i.jsx(Nr,{children:"Register a project folder to quickly switch between projects in the UI."})]}),i.jsxs("div",{className:"space-y-4 py-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(wt,{htmlFor:"path",children:"Project Path"}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(Xe,{id:"path",value:o,onChange:S=>l(S.target.value),placeholder:"/path/to/project",className:"font-mono text-sm flex-1"}),i.jsx(de,{variant:"outline",size:"icon",onClick:()=>c(!0),title:"Browse",children:i.jsx(Kn,{className:"w-4 h-4"})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(wt,{htmlFor:"name",children:"Display Name"}),i.jsx(Xe,{id:"name",value:m,onChange:S=>f(S.target.value),placeholder:"Auto-filled from folder name"}),i.jsx("p",{className:"text-xs text-gray-500",children:"Optional. Leave empty to use folder name."})]})]}),i.jsxs(er,{children:[i.jsx(de,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),i.jsx(de,{onClick:_,disabled:h||!o,children:h?i.jsxs(i.Fragment,{children:[i.jsx(ct,{className:"w-4 h-4 mr-2 animate-spin"}),"Adding..."]}):"Add Project"})]})]})}),i.jsx(Y1,{open:a,onOpenChange:c,onSelect:u,type:"directory",initialPath:"~",title:"Select Project Folder"})]})}const J1=C.createContext({theme:"auto",setTheme:()=>{},resolvedTheme:"light"});function rI({children:e}){const[t,s]=C.useState(()=>{try{return localStorage.getItem("claude-config-theme")||"auto"}catch{return"auto"}}),[o,l]=C.useState("light");C.useEffect(()=>{const f=window.document.documentElement,a=g=>{let u;g==="auto"?u=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":u=g,l(u),u==="dark"?f.classList.add("dark"):f.classList.remove("dark")};a(t);const c=window.matchMedia("(prefers-color-scheme: dark)"),h=()=>{t==="auto"&&a("auto")};return c.addEventListener("change",h),()=>c.removeEventListener("change",h)},[t]);const m=f=>{s(f);try{localStorage.setItem("claude-config-theme",f)}catch{}};return i.jsx(J1.Provider,{value:{theme:t,setTheme:m,resolvedTheme:o},children:e})}function sI(){return C.useContext(J1)}function nI(){const{theme:e,setTheme:t,resolvedTheme:s}=sI(),o=s==="dark"?ey:ty;return i.jsxs(Ta,{children:[i.jsx(Aa,{asChild:!0,children:i.jsxs(de,{variant:"ghost",size:"sm",className:"w-9 px-0",children:[i.jsx(o,{className:"h-4 w-4"}),i.jsx("span",{className:"sr-only",children:"Toggle theme"})]})}),i.jsxs(no,{align:"end",children:[i.jsxs(Dt,{onClick:()=>t("light"),className:e==="light"?"bg-accent":"",children:[i.jsx(ty,{className:"mr-2 h-4 w-4"}),"Light"]}),i.jsxs(Dt,{onClick:()=>t("dark"),className:e==="dark"?"bg-accent":"",children:[i.jsx(ey,{className:"mr-2 h-4 w-4"}),"Dark"]}),i.jsxs(Dt,{onClick:()=>t("auto"),className:e==="auto"?"bg-accent":"",children:[i.jsx(D_,{className:"mr-2 h-4 w-4"}),"System"]})]})]})}var iI=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],oI=iI.reduce((e,t)=>{const s=sp(`Primitive.${t}`),o=C.forwardRef((l,m)=>{const{asChild:f,...a}=l,c=f?s:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),i.jsx(c,{...a,ref:m})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{}),aI="Separator",By="horizontal",lI=["horizontal","vertical"],Q1=C.forwardRef((e,t)=>{const{decorative:s,orientation:o=By,...l}=e,m=cI(o)?o:By,a=s?{role:"none"}:{"aria-orientation":m==="vertical"?m:void 0,role:"separator"};return i.jsx(oI.div,{"data-orientation":m,...a,...l,ref:t})});Q1.displayName=aI;function cI(e){return lI.includes(e)}var Z1=Q1;const eC=C.forwardRef(({className:e,orientation:t="horizontal",decorative:s=!0,...o},l)=>i.jsx(Z1,{ref:l,decorative:s,orientation:t,className:xe("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...o}));eC.displayName=Z1.displayName;function uI(){var P,T;const[e,t]=C.useState(null),[s,o]=C.useState(""),[l,m]=C.useState({open:!1,field:null,type:"directory"}),[f,a]=C.useState(!0),[c,h]=C.useState(!1),[g,u]=C.useState(null),[_,S]=C.useState(!1);C.useEffect(()=>{v(),E()},[]);const E=async()=>{try{const R=await Ne.checkVersion();u(R)}catch(R){console.error("Failed to load version info:",R)}},b=async()=>{var R;if(!(g!=null&&g.updateAvailable)){le.error("No update available");return}S(!0);try{const j=await Ne.performUpdate({updateMethod:g.updateMethod,sourcePath:g.sourcePath});j.success?(j.updateMethod==="npm"?le.success(j.message||"Updated via npm! Restart the server to apply."):le.success(`Updated! Files: ${((R=j.updated)==null?void 0:R.join(", "))||"all"}. Restart the server to apply.`),E()):le.error("Update failed: "+j.error)}catch(j){le.error("Update failed: "+j.message)}finally{S(!1)}},v=async()=>{try{a(!0);const R=await Ne.getConfig();t(R.config),o(R.path)}catch{le.error("Failed to load settings")}finally{a(!1)}},y=async()=>{h(!0);try{await Ne.saveConfig(e),le.success("Preferences saved!")}catch{le.error("Failed to save preferences")}finally{h(!1)}},p=(R,j)=>{t(M=>({...M,[R]:j}))},x=(R,j,M)=>{t($=>({...$,[R]:{...$[R],[j]:M}}))},k=R=>{const j=(e==null?void 0:e.enabledTools)||["claude"];j.includes(R)?j.length>1&&p("enabledTools",j.filter(M=>M!==R)):p("enabledTools",[...j,R])};return f?i.jsx("div",{className:"flex items-center justify-center h-64",children:i.jsx(ct,{className:"w-8 h-8 animate-spin text-primary"})}):i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-10 h-10 rounded-lg bg-muted flex items-center justify-center",children:i.jsx(O_,{className:"w-5 h-5 text-muted-foreground"})}),i.jsxs("div",{children:[i.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"claude-config Preferences"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Tool settings for this configuration manager"})]})]}),i.jsxs("div",{className:"bg-card rounded-xl border border-border p-6 shadow-sm",children:[i.jsxs("div",{className:"flex items-center justify-between mb-6",children:[i.jsx("div",{children:i.jsxs("p",{className:"text-sm text-muted-foreground",children:["Stored in: ",i.jsx("code",{className:"bg-muted px-2 py-0.5 rounded",children:s})]})}),i.jsxs(de,{onClick:y,disabled:c,children:[c?i.jsx(ct,{className:"w-4 h-4 mr-2 animate-spin"}):i.jsx(ri,{className:"w-4 h-4 mr-2"}),"Save"]})]}),i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"border-b border-border pb-6",children:[i.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[i.jsx(jt,{className:"w-4 h-4"}),"Directories"]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium text-foreground",children:"MCP Tools Directories"}),i.jsx("p",{className:"text-xs text-muted-foreground mb-2",children:"Folders containing local MCP tool repositories for discovery"}),i.jsxs("div",{className:"space-y-2",children:[((e==null?void 0:e.toolsDirs)||(e!=null&&e.toolsDir?[e.toolsDir]:[])).map((R,j)=>i.jsxs("div",{className:"flex gap-2",children:[i.jsx(Xe,{value:R||"",onChange:M=>{const $=[...(e==null?void 0:e.toolsDirs)||(e!=null&&e.toolsDir?[e.toolsDir]:[])];$[j]=M.target.value,p("toolsDirs",$),e!=null&&e.toolsDir&&t(B=>{const{toolsDir:W,...H}=B;return{...H,toolsDirs:$}})},placeholder:"~/mcp-tools",className:"font-mono flex-1"}),i.jsx(de,{variant:"outline",size:"icon",onClick:()=>m({open:!0,field:"toolsDirs",type:"directory",index:j}),title:"Browse...",children:i.jsx(Kn,{className:"w-4 h-4"})}),i.jsx(de,{variant:"outline",size:"icon",onClick:()=>{const $=((e==null?void 0:e.toolsDirs)||(e!=null&&e.toolsDir?[e.toolsDir]:[])).filter((B,W)=>W!==j);t(B=>{const{toolsDir:W,...H}=B;return{...H,toolsDirs:$.length>0?$:void 0}})},title:"Remove",className:"text-destructive hover:text-destructive",children:i.jsx(I_,{className:"w-4 h-4"})})]},j)),i.jsxs(de,{variant:"outline",size:"sm",onClick:()=>m({open:!0,field:"toolsDirs",type:"directory",index:-1}),className:"mt-2",children:[i.jsx(N_,{className:"w-4 h-4 mr-2"}),"Add Tools Folder"]})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium text-foreground",children:"Global Registry Path"}),i.jsx("p",{className:"text-xs text-muted-foreground mb-2",children:"Path to the global MCP registry file"}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(Xe,{value:(e==null?void 0:e.registryPath)||"",onChange:R=>p("registryPath",R.target.value),placeholder:"~/.claude/registry.json",className:"font-mono flex-1"}),i.jsx(de,{variant:"outline",size:"icon",onClick:()=>m({open:!0,field:"registryPath",type:"file"}),title:"Browse...",children:i.jsx(Kn,{className:"w-4 h-4"})})]})]})]})]}),i.jsxs("div",{className:"border-b border-border pb-6",children:[i.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[i.jsx(Bc,{className:"w-4 h-4"}),"User Interface"]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium text-foreground",children:"Default Port"}),i.jsx("p",{className:"text-xs text-muted-foreground mb-2",children:"Port for the web UI server"}),i.jsx(Xe,{type:"number",value:((P=e==null?void 0:e.ui)==null?void 0:P.port)||3333,onChange:R=>x("ui","port",parseInt(R.target.value)||3333),placeholder:"3333",className:"w-32"})]}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium text-foreground",children:"Open Browser on Start"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Automatically open browser when starting the UI"})]}),i.jsx(yt,{checked:((T=e==null?void 0:e.ui)==null?void 0:T.openBrowser)??!0,onCheckedChange:R=>x("ui","openBrowser",R)})]})]})]}),i.jsxs("div",{className:"border-b border-border pb-6",children:[i.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[i.jsx($R,{className:"w-4 h-4"}),"AI Assistant"]}),i.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"Choose which AI assistant to use for features like MCP creation and tool import."}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("label",{className:`flex items-center gap-3 p-3 rounded-lg cursor-pointer border-2 transition-colors ${((e==null?void 0:e.aiAssistant)||"claude")==="claude"?"border-orange-500 bg-orange-500/5":"border-transparent bg-muted/50 hover:bg-muted"}`,onClick:()=>p("aiAssistant","claude"),children:[i.jsx("input",{type:"radio",name:"aiAssistant",value:"claude",checked:((e==null?void 0:e.aiAssistant)||"claude")==="claude",onChange:()=>p("aiAssistant","claude"),className:"sr-only"}),i.jsx("div",{className:"w-8 h-8 rounded-md bg-orange-500/10 flex items-center justify-center",children:i.jsx($t,{className:"w-4 h-4 text-orange-500"})}),i.jsxs("div",{className:"flex-1",children:[i.jsx("span",{className:"text-sm font-medium text-foreground",children:"Claude Code"}),i.jsxs("p",{className:"text-xs text-muted-foreground",children:["Anthropic's AI coding assistant • Command: ",i.jsx("code",{className:"text-xs",children:"claude"})]})]}),((e==null?void 0:e.aiAssistant)||"claude")==="claude"&&i.jsx("div",{className:"w-2 h-2 rounded-full bg-orange-500"})]}),i.jsxs("label",{className:`flex items-center gap-3 p-3 rounded-lg cursor-pointer border-2 transition-colors ${(e==null?void 0:e.aiAssistant)==="gemini"?"border-blue-500 bg-blue-500/5":"border-transparent bg-muted/50 hover:bg-muted"}`,onClick:()=>p("aiAssistant","gemini"),children:[i.jsx("input",{type:"radio",name:"aiAssistant",value:"gemini",checked:(e==null?void 0:e.aiAssistant)==="gemini",onChange:()=>p("aiAssistant","gemini"),className:"sr-only"}),i.jsx("div",{className:"w-8 h-8 rounded-md bg-blue-500/10 flex items-center justify-center",children:i.jsx(bt,{className:"w-4 h-4 text-blue-500"})}),i.jsxs("div",{className:"flex-1",children:[i.jsx("span",{className:"text-sm font-medium text-foreground",children:"Gemini CLI"}),i.jsxs("p",{className:"text-xs text-muted-foreground",children:["Google's AI coding assistant • Command: ",i.jsx("code",{className:"text-xs",children:"gemini"})]})]}),(e==null?void 0:e.aiAssistant)==="gemini"&&i.jsx("div",{className:"w-2 h-2 rounded-full bg-blue-500"})]})]})]}),i.jsxs("div",{className:"border-b border-border pb-6",children:[i.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[i.jsx(nT,{className:"w-4 h-4"}),"Enabled AI Tools"]}),i.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"Select which AI coding tools to generate MCP configurations for. The Apply button will update all enabled tools."}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center justify-between p-3 bg-muted/50 rounded-lg",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-8 h-8 rounded-md bg-orange-500/10 flex items-center justify-center",children:i.jsx($t,{className:"w-4 h-4 text-orange-500"})}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium text-foreground",children:"Claude Code"}),i.jsxs("p",{className:"text-xs text-muted-foreground",children:["Anthropic's AI coding assistant • Output: ",i.jsx("code",{className:"text-xs",children:".mcp.json"})]})]})]}),i.jsx(yt,{checked:((e==null?void 0:e.enabledTools)||["claude"]).includes("claude"),onCheckedChange:()=>k("claude")})]}),i.jsxs("div",{className:"flex items-center justify-between p-3 bg-muted/50 rounded-lg",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-8 h-8 rounded-md bg-blue-500/10 flex items-center justify-center",children:i.jsx($t,{className:"w-4 h-4 text-blue-500"})}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium text-foreground",children:"Gemini CLI"}),i.jsxs("p",{className:"text-xs text-muted-foreground",children:["Google's terminal AI coding assistant • Output: ",i.jsx("code",{className:"text-xs",children:"~/.gemini/settings.json"})]})]})]}),i.jsx(yt,{checked:((e==null?void 0:e.enabledTools)||["claude"]).includes("gemini"),onCheckedChange:()=>k("gemini")})]}),i.jsxs("div",{className:"flex items-center justify-between p-3 bg-muted/50 rounded-lg",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-8 h-8 rounded-md bg-purple-500/10 flex items-center justify-center",children:i.jsx($t,{className:"w-4 h-4 text-purple-500"})}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium text-foreground",children:"Antigravity"}),i.jsxs("p",{className:"text-xs text-muted-foreground",children:["Google's AI IDE • Output: ",i.jsx("code",{className:"text-xs",children:"~/.gemini/antigravity/mcp_config.json"})]})]})]}),i.jsx(yt,{checked:((e==null?void 0:e.enabledTools)||["claude"]).includes("antigravity"),onCheckedChange:()=>k("antigravity")})]}),i.jsxs("p",{className:"text-xs text-muted-foreground italic",children:["Note: Antigravity does not support environment variable interpolation (",i.jsx("code",{children:"${VAR}"}),"). Variables are resolved to actual values when generating its config."]})]})]}),i.jsxs("div",{children:[i.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[i.jsx(mr,{className:"w-4 h-4"}),"About"]}),i.jsxs("div",{className:"bg-muted rounded-lg p-4 space-y-3",children:[i.jsxs("div",{className:"flex justify-between text-sm",children:[i.jsx("span",{className:"text-muted-foreground",children:"Installed Version"}),i.jsx("span",{className:"font-medium font-mono text-foreground",children:(g==null?void 0:g.installedVersion)||"Loading..."})]}),(g==null?void 0:g.updateAvailable)&&i.jsx("div",{className:"p-3 bg-green-500/10 border border-green-500/20 rounded-lg",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("p",{className:"text-sm font-medium text-green-600 dark:text-green-400",children:"Update Available!"}),i.jsxs("p",{className:"text-xs text-green-600/80 dark:text-green-400/80",children:["Version ",g.latestVersion," via ",g.updateMethod==="npm"?"npm":g.sourcePath]})]}),i.jsxs(de,{size:"sm",onClick:b,disabled:_,className:"bg-green-600 hover:bg-green-700 text-white",children:[_?i.jsx(ct,{className:"w-4 h-4 mr-2 animate-spin"}):i.jsx(Ic,{className:"w-4 h-4 mr-2"}),"Update Now"]})]})}),!(g!=null&&g.updateAvailable)&&(g==null?void 0:g.latestVersion)&&i.jsxs("div",{className:"flex justify-between text-sm",children:[i.jsx("span",{className:"text-muted-foreground",children:"Latest Version"}),i.jsxs("span",{className:"font-mono text-green-600 dark:text-green-400",children:[g.latestVersion," ✓"]})]}),(g==null?void 0:g.sourcePath)&&!(g!=null&&g.updateAvailable)&&i.jsxs("div",{className:"flex items-center justify-between text-sm",children:[i.jsx("span",{className:"text-muted-foreground",children:"Dev Source"}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("code",{className:"text-xs text-muted-foreground",children:g.sourcePath}),i.jsx(de,{size:"sm",variant:"outline",onClick:b,disabled:_,className:"h-7",children:_?i.jsx(ct,{className:"w-3 h-3 animate-spin"}):i.jsx(gr,{className:"w-3 h-3"})})]})]}),i.jsxs("div",{className:"flex justify-between text-sm",children:[i.jsx("span",{className:"text-muted-foreground",children:"Install Location"}),i.jsx("code",{className:"text-xs text-muted-foreground",children:(g==null?void 0:g.installDir)||"~/.claude-config"})]}),i.jsxs("div",{className:"border-t border-border pt-3 mt-3",children:[i.jsxs("div",{className:"flex justify-between text-sm",children:[i.jsx("span",{className:"text-muted-foreground",children:"Documentation"}),i.jsx("a",{href:"https://github.com/regression-io/claude-config",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"GitHub"})]}),i.jsxs("p",{className:"text-xs text-muted-foreground mt-2",children:["After updating, restart the server with ",i.jsx("code",{className:"bg-muted-foreground/10 px-1 rounded",children:"claude-config ui"})]})]})]})]})]})]}),i.jsx(Y1,{open:l.open,onOpenChange:R=>m(j=>({...j,open:R})),onSelect:R=>{if(l.field==="toolsDirs"){const j=(e==null?void 0:e.toolsDirs)||(e!=null&&e.toolsDir?[e.toolsDir]:[]);if(l.index===-1)t(M=>{const{toolsDir:$,...B}=M;return{...B,toolsDirs:[...j,R]}});else{const M=[...j];M[l.index]=R,t($=>{const{toolsDir:B,...W}=$;return{...W,toolsDirs:M}})}}else l.field&&p(l.field,R)},type:l.type,initialPath:l.field==="toolsDirs"&&l.index>=0?((e==null?void 0:e.toolsDirs)||(e!=null&&e.toolsDir?[e.toolsDir]:[]))[l.index]||"~":(e==null?void 0:e[l.field])||"~",title:l.type==="directory"?"Select Directory":"Select File"})]})}function dI(){const[e,t]=C.useState(null),[s,o]=C.useState(!0);C.useEffect(()=>{l()},[]);const l=async()=>{try{o(!0);const f=await Ne.getClaudeSettings();t(f.settings)}catch(f){console.error("Failed to load Claude settings:",f)}finally{o(!1)}},m=async f=>{try{await Ne.saveClaudeSettings(f),t(f),le.success("Claude Code settings saved!")}catch(a){le.error("Failed to save settings: "+a.message)}};return s?i.jsx("div",{className:"flex items-center justify-center h-64",children:i.jsx(ct,{className:"w-8 h-8 animate-spin text-indigo-600"})}):i.jsx("div",{className:"space-y-6",children:i.jsx("div",{className:"bg-white dark:bg-slate-950 rounded-xl border border-gray-200 dark:border-slate-800 p-6 shadow-sm",children:i.jsx(k1,{settings:e,onSave:m,loading:s,settingsPath:"~/.claude/settings.json"})})})}function hI(){const[e,t]=C.useState(null),[s,o]=C.useState(!0);C.useEffect(()=>{l()},[]);const l=async()=>{try{o(!0);const f=await Ne.getGeminiSettings();t(f.settings)}catch(f){console.error("Failed to load Gemini settings:",f)}finally{o(!1)}},m=async f=>{try{await Ne.saveGeminiSettings(f),t(f),le.success("Gemini CLI settings saved!")}catch(a){le.error("Failed to save settings: "+a.message)}};return s?i.jsx("div",{className:"flex items-center justify-center h-64",children:i.jsx(ct,{className:"w-8 h-8 animate-spin text-blue-600"})}):i.jsx("div",{className:"space-y-6",children:i.jsx("div",{className:"bg-white dark:bg-slate-950 rounded-xl border border-gray-200 dark:border-slate-800 p-6 shadow-sm",children:i.jsx(E1,{settings:e,onSave:m,loading:s,settingsPath:"~/.gemini/settings.json"})})})}var jh={exports:{}},Fy;function fI(){return Fy||(Fy=1,(function(e,t){(function(s,o){e.exports=o()})(globalThis,(()=>(()=>{var s={4567:function(f,a,c){var h=this&&this.__decorate||function(p,x,k,P){var T,R=arguments.length,j=R<3?x:P===null?P=Object.getOwnPropertyDescriptor(x,k):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(p,x,k,P);else for(var M=p.length-1;M>=0;M--)(T=p[M])&&(j=(R<3?T(j):R>3?T(x,k,j):T(x,k))||j);return R>3&&j&&Object.defineProperty(x,k,j),j},g=this&&this.__param||function(p,x){return function(k,P){x(k,P,p)}};Object.defineProperty(a,"__esModule",{value:!0}),a.AccessibilityManager=void 0;const u=c(9042),_=c(9924),S=c(844),E=c(4725),b=c(2585),v=c(3656);let y=a.AccessibilityManager=class extends S.Disposable{constructor(p,x,k,P){super(),this._terminal=p,this._coreBrowserService=k,this._renderService=P,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let T=0;T<this._terminal.rows;T++)this._rowElements[T]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[T]);if(this._topBoundaryFocusListener=T=>this._handleBoundaryFocus(T,0),this._bottomBoundaryFocusListener=T=>this._handleBoundaryFocus(T,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new _.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((T=>this._handleResize(T.rows)))),this.register(this._terminal.onRender((T=>this._refreshRows(T.start,T.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((T=>this._handleChar(T)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
|
|
508
508
|
`)))),this.register(this._terminal.onA11yTab((T=>this._handleTab(T)))),this.register(this._terminal.onKey((T=>this._handleKey(T.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,v.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,S.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(p){for(let x=0;x<p;x++)this._handleChar(" ")}_handleChar(p){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==p&&(this._charsToAnnounce+=p):this._charsToAnnounce+=p,p===`
|
|
509
509
|
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=u.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(p){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(p)||this._charsToConsume.push(p)}_refreshRows(p,x){this._liveRegionDebouncer.refresh(p,x,this._terminal.rows)}_renderRows(p,x){const k=this._terminal.buffer,P=k.lines.length.toString();for(let T=p;T<=x;T++){const R=k.lines.get(k.ydisp+T),j=[],M=(R==null?void 0:R.translateToString(!0,void 0,void 0,j))||"",$=(k.ydisp+T+1).toString(),B=this._rowElements[T];B&&(M.length===0?(B.innerText=" ",this._rowColumns.set(B,[0,1])):(B.textContent=M,this._rowColumns.set(B,j)),B.setAttribute("aria-posinset",$),B.setAttribute("aria-setsize",P))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(p,x){const k=p.target,P=this._rowElements[x===0?1:this._rowElements.length-2];if(k.getAttribute("aria-posinset")===(x===0?"1":`${this._terminal.buffer.lines.length}`)||p.relatedTarget!==P)return;let T,R;if(x===0?(T=k,R=this._rowElements.pop(),this._rowContainer.removeChild(R)):(T=this._rowElements.shift(),R=k,this._rowContainer.removeChild(T)),T.removeEventListener("focus",this._topBoundaryFocusListener),R.removeEventListener("focus",this._bottomBoundaryFocusListener),x===0){const j=this._createAccessibilityTreeNode();this._rowElements.unshift(j),this._rowContainer.insertAdjacentElement("afterbegin",j)}else{const j=this._createAccessibilityTreeNode();this._rowElements.push(j),this._rowContainer.appendChild(j)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(x===0?-1:1),this._rowElements[x===0?1:this._rowElements.length-2].focus(),p.preventDefault(),p.stopImmediatePropagation()}_handleSelectionChange(){var M;if(this._rowElements.length===0)return;const p=document.getSelection();if(!p)return;if(p.isCollapsed)return void(this._rowContainer.contains(p.anchorNode)&&this._terminal.clearSelection());if(!p.anchorNode||!p.focusNode)return void console.error("anchorNode and/or focusNode are null");let x={node:p.anchorNode,offset:p.anchorOffset},k={node:p.focusNode,offset:p.focusOffset};if((x.node.compareDocumentPosition(k.node)&Node.DOCUMENT_POSITION_PRECEDING||x.node===k.node&&x.offset>k.offset)&&([x,k]=[k,x]),x.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(x={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(x.node))return;const P=this._rowElements.slice(-1)[0];if(k.node.compareDocumentPosition(P)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(k={node:P,offset:((M=P.textContent)==null?void 0:M.length)??0}),!this._rowContainer.contains(k.node))return;const T=({node:$,offset:B})=>{const W=$ instanceof Text?$.parentNode:$;let H=parseInt(W==null?void 0:W.getAttribute("aria-posinset"),10)-1;if(isNaN(H))return console.warn("row is invalid. Race condition?"),null;const J=this._rowColumns.get(W);if(!J)return console.warn("columns is null. Race condition?"),null;let K=B<J.length?J[B]:J.slice(-1)[0]+1;return K>=this._terminal.cols&&(++H,K=0),{row:H,column:K}},R=T(x),j=T(k);if(R&&j){if(R.row>j.row||R.row===j.row&&R.column>=j.column)throw new Error("invalid range");this._terminal.select(R.column,R.row,(j.row-R.row)*this._terminal.cols-R.column+j.column)}}_handleResize(p){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let x=this._rowContainer.children.length;x<this._terminal.rows;x++)this._rowElements[x]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[x]);for(;this._rowElements.length>p;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const p=this._coreBrowserService.mainDocument.createElement("div");return p.setAttribute("role","listitem"),p.tabIndex=-1,this._refreshRowDimensions(p),p}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let p=0;p<this._terminal.rows;p++)this._refreshRowDimensions(this._rowElements[p])}}_refreshRowDimensions(p){p.style.height=`${this._renderService.dimensions.css.cell.height}px`}};a.AccessibilityManager=y=h([g(1,b.IInstantiationService),g(2,E.ICoreBrowserService),g(3,E.IRenderService)],y)},3614:(f,a)=>{function c(_){return _.replace(/\r?\n/g,"\r")}function h(_,S){return S?"\x1B[200~"+_+"\x1B[201~":_}function g(_,S,E,b){_=h(_=c(_),E.decPrivateModes.bracketedPasteMode&&b.rawOptions.ignoreBracketedPasteMode!==!0),E.triggerDataEvent(_,!0),S.value=""}function u(_,S,E){const b=E.getBoundingClientRect(),v=_.clientX-b.left-10,y=_.clientY-b.top-10;S.style.width="20px",S.style.height="20px",S.style.left=`${v}px`,S.style.top=`${y}px`,S.style.zIndex="1000",S.focus()}Object.defineProperty(a,"__esModule",{value:!0}),a.rightClickHandler=a.moveTextAreaUnderMouseCursor=a.paste=a.handlePasteEvent=a.copyHandler=a.bracketTextForPaste=a.prepareTextForTerminal=void 0,a.prepareTextForTerminal=c,a.bracketTextForPaste=h,a.copyHandler=function(_,S){_.clipboardData&&_.clipboardData.setData("text/plain",S.selectionText),_.preventDefault()},a.handlePasteEvent=function(_,S,E,b){_.stopPropagation(),_.clipboardData&&g(_.clipboardData.getData("text/plain"),S,E,b)},a.paste=g,a.moveTextAreaUnderMouseCursor=u,a.rightClickHandler=function(_,S,E,b,v){u(_,S,E),v&&b.rightClickSelect(_),S.value=b.selectionText,S.select()}},7239:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ColorContrastCache=void 0;const h=c(1505);a.ColorContrastCache=class{constructor(){this._color=new h.TwoKeyMap,this._css=new h.TwoKeyMap}setCss(g,u,_){this._css.set(g,u,_)}getCss(g,u){return this._css.get(g,u)}setColor(g,u,_){this._color.set(g,u,_)}getColor(g,u){return this._color.get(g,u)}clear(){this._color.clear(),this._css.clear()}}},3656:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.addDisposableDomListener=void 0,a.addDisposableDomListener=function(c,h,g,u){c.addEventListener(h,g,u);let _=!1;return{dispose:()=>{_||(_=!0,c.removeEventListener(h,g,u))}}}},3551:function(f,a,c){var h=this&&this.__decorate||function(y,p,x,k){var P,T=arguments.length,R=T<3?p:k===null?k=Object.getOwnPropertyDescriptor(p,x):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(y,p,x,k);else for(var j=y.length-1;j>=0;j--)(P=y[j])&&(R=(T<3?P(R):T>3?P(p,x,R):P(p,x))||R);return T>3&&R&&Object.defineProperty(p,x,R),R},g=this&&this.__param||function(y,p){return function(x,k){p(x,k,y)}};Object.defineProperty(a,"__esModule",{value:!0}),a.Linkifier=void 0;const u=c(3656),_=c(8460),S=c(844),E=c(2585),b=c(4725);let v=a.Linkifier=class extends S.Disposable{get currentLink(){return this._currentLink}constructor(y,p,x,k,P){super(),this._element=y,this._mouseService=p,this._renderService=x,this._bufferService=k,this._linkProviderService=P,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new _.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new _.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,S.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,S.toDisposable)((()=>{var T;this._lastMouseEvent=void 0,(T=this._activeProviderReplies)==null||T.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,u.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,u.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,u.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,u.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(y){this._lastMouseEvent=y;const p=this._positionFromMouseEvent(y,this._element,this._mouseService);if(!p)return;this._isMouseOut=!1;const x=y.composedPath();for(let k=0;k<x.length;k++){const P=x[k];if(P.classList.contains("xterm"))break;if(P.classList.contains("xterm-hover"))return}this._lastBufferCell&&p.x===this._lastBufferCell.x&&p.y===this._lastBufferCell.y||(this._handleHover(p),this._lastBufferCell=p)}_handleHover(y){if(this._activeLine!==y.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(y,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,y)||(this._clearCurrentLink(),this._askForLink(y,!0))}_askForLink(y,p){var k,P;this._activeProviderReplies&&p||((k=this._activeProviderReplies)==null||k.forEach((T=>{T==null||T.forEach((R=>{R.link.dispose&&R.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=y.y);let x=!1;for(const[T,R]of this._linkProviderService.linkProviders.entries())p?(P=this._activeProviderReplies)!=null&&P.get(T)&&(x=this._checkLinkProviderResult(T,y,x)):R.provideLinks(y.y,(j=>{var $,B;if(this._isMouseOut)return;const M=j==null?void 0:j.map((W=>({link:W})));($=this._activeProviderReplies)==null||$.set(T,M),x=this._checkLinkProviderResult(T,y,x),((B=this._activeProviderReplies)==null?void 0:B.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(y.y,this._activeProviderReplies)}))}_removeIntersectingLinks(y,p){const x=new Set;for(let k=0;k<p.size;k++){const P=p.get(k);if(P)for(let T=0;T<P.length;T++){const R=P[T],j=R.link.range.start.y<y?0:R.link.range.start.x,M=R.link.range.end.y>y?this._bufferService.cols:R.link.range.end.x;for(let $=j;$<=M;$++){if(x.has($)){P.splice(T--,1);break}x.add($)}}}}_checkLinkProviderResult(y,p,x){var T;if(!this._activeProviderReplies)return x;const k=this._activeProviderReplies.get(y);let P=!1;for(let R=0;R<y;R++)this._activeProviderReplies.has(R)&&!this._activeProviderReplies.get(R)||(P=!0);if(!P&&k){const R=k.find((j=>this._linkAtPosition(j.link,p)));R&&(x=!0,this._handleNewLink(R))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!x)for(let R=0;R<this._activeProviderReplies.size;R++){const j=(T=this._activeProviderReplies.get(R))==null?void 0:T.find((M=>this._linkAtPosition(M.link,p)));if(j){x=!0,this._handleNewLink(j);break}}return x}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(y){if(!this._currentLink)return;const p=this._positionFromMouseEvent(y,this._element,this._mouseService);p&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,p)&&this._currentLink.link.activate(y,this._currentLink.link.text)}_clearCurrentLink(y,p){this._currentLink&&this._lastMouseEvent&&(!y||!p||this._currentLink.link.range.start.y>=y&&this._currentLink.link.range.end.y<=p)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,S.disposeArray)(this._linkCacheDisposables))}_handleNewLink(y){if(!this._lastMouseEvent)return;const p=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);p&&this._linkAtPosition(y.link,p)&&(this._currentLink=y,this._currentLink.state={decorations:{underline:y.link.decorations===void 0||y.link.decorations.underline,pointerCursor:y.link.decorations===void 0||y.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,y.link,this._lastMouseEvent),y.link.decorations={},Object.defineProperties(y.link.decorations,{pointerCursor:{get:()=>{var x,k;return(k=(x=this._currentLink)==null?void 0:x.state)==null?void 0:k.decorations.pointerCursor},set:x=>{var k;(k=this._currentLink)!=null&&k.state&&this._currentLink.state.decorations.pointerCursor!==x&&(this._currentLink.state.decorations.pointerCursor=x,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",x))}},underline:{get:()=>{var x,k;return(k=(x=this._currentLink)==null?void 0:x.state)==null?void 0:k.decorations.underline},set:x=>{var k,P,T;(k=this._currentLink)!=null&&k.state&&((T=(P=this._currentLink)==null?void 0:P.state)==null?void 0:T.decorations.underline)!==x&&(this._currentLink.state.decorations.underline=x,this._currentLink.state.isHovered&&this._fireUnderlineEvent(y.link,x))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((x=>{if(!this._currentLink)return;const k=x.start===0?0:x.start+1+this._bufferService.buffer.ydisp,P=this._bufferService.buffer.ydisp+1+x.end;if(this._currentLink.link.range.start.y>=k&&this._currentLink.link.range.end.y<=P&&(this._clearCurrentLink(k,P),this._lastMouseEvent)){const T=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);T&&this._askForLink(T,!1)}}))))}_linkHover(y,p,x){var k;(k=this._currentLink)!=null&&k.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(p,!0),this._currentLink.state.decorations.pointerCursor&&y.classList.add("xterm-cursor-pointer")),p.hover&&p.hover(x,p.text)}_fireUnderlineEvent(y,p){const x=y.range,k=this._bufferService.buffer.ydisp,P=this._createLinkUnderlineEvent(x.start.x-1,x.start.y-k-1,x.end.x,x.end.y-k-1,void 0);(p?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(P)}_linkLeave(y,p,x){var k;(k=this._currentLink)!=null&&k.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(p,!1),this._currentLink.state.decorations.pointerCursor&&y.classList.remove("xterm-cursor-pointer")),p.leave&&p.leave(x,p.text)}_linkAtPosition(y,p){const x=y.range.start.y*this._bufferService.cols+y.range.start.x,k=y.range.end.y*this._bufferService.cols+y.range.end.x,P=p.y*this._bufferService.cols+p.x;return x<=P&&P<=k}_positionFromMouseEvent(y,p,x){const k=x.getCoords(y,p,this._bufferService.cols,this._bufferService.rows);if(k)return{x:k[0],y:k[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(y,p,x,k,P){return{x1:y,y1:p,x2:x,y2:k,cols:this._bufferService.cols,fg:P}}};a.Linkifier=v=h([g(1,b.IMouseService),g(2,b.IRenderService),g(3,E.IBufferService),g(4,b.ILinkProviderService)],v)},9042:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.tooMuchOutput=a.promptLabel=void 0,a.promptLabel="Terminal input",a.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(f,a,c){var h=this&&this.__decorate||function(b,v,y,p){var x,k=arguments.length,P=k<3?v:p===null?p=Object.getOwnPropertyDescriptor(v,y):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(b,v,y,p);else for(var T=b.length-1;T>=0;T--)(x=b[T])&&(P=(k<3?x(P):k>3?x(v,y,P):x(v,y))||P);return k>3&&P&&Object.defineProperty(v,y,P),P},g=this&&this.__param||function(b,v){return function(y,p){v(y,p,b)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OscLinkProvider=void 0;const u=c(511),_=c(2585);let S=a.OscLinkProvider=class{constructor(b,v,y){this._bufferService=b,this._optionsService=v,this._oscLinkService=y}provideLinks(b,v){var M;const y=this._bufferService.buffer.lines.get(b-1);if(!y)return void v(void 0);const p=[],x=this._optionsService.rawOptions.linkHandler,k=new u.CellData,P=y.getTrimmedLength();let T=-1,R=-1,j=!1;for(let $=0;$<P;$++)if(R!==-1||y.hasContent($)){if(y.loadCell($,k),k.hasExtendedAttrs()&&k.extended.urlId){if(R===-1){R=$,T=k.extended.urlId;continue}j=k.extended.urlId!==T}else R!==-1&&(j=!0);if(j||R!==-1&&$===P-1){const B=(M=this._oscLinkService.getLinkData(T))==null?void 0:M.uri;if(B){const W={start:{x:R+1,y:b},end:{x:$+(j||$!==P-1?0:1),y:b}};let H=!1;if(!(x!=null&&x.allowNonHttpProtocols))try{const J=new URL(B);["http:","https:"].includes(J.protocol)||(H=!0)}catch{H=!0}H||p.push({text:B,range:W,activate:(J,K)=>x?x.activate(J,K,W):E(0,K),hover:(J,K)=>{var G;return(G=x==null?void 0:x.hover)==null?void 0:G.call(x,J,K,W)},leave:(J,K)=>{var G;return(G=x==null?void 0:x.leave)==null?void 0:G.call(x,J,K,W)}})}j=!1,k.hasExtendedAttrs()&&k.extended.urlId?(R=$,T=k.extended.urlId):(R=-1,T=-1)}}v(p)}};function E(b,v){if(confirm(`Do you want to navigate to ${v}?
|
|
510
510
|
|
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-YLcZxk6K.js"></script>
|
|
23
23
|
<link rel="stylesheet" crossorigin href="/assets/index-DUrG0pq3.css">
|
|
24
24
|
</head>
|
|
25
25
|
<body>
|