@siteboon/claude-code-ui 1.10.1 → 1.10.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -899,4 +899,4 @@ abc123`})]})]}),$.importMode==="form"&&($.type==="sse"||$.type==="http")&&t.jsxs
899
899
  DEBUG=true`})]}),$.importMode==="form"&&($.type==="sse"||$.type==="http")&&t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Headers (KEY=value, one per line)"}),t.jsx("textarea",{value:Object.entries($.config.headers||{}).map(([C,X])=>`${C}=${X}`).join(`
900
900
  `),onChange:C=>{const X={};C.target.value.split(`
901
901
  `).forEach(fe=>{const[He,...at]=fe.split("=");He&&He.trim()&&(X[He.trim()]=at.join("=").trim())}),T("headers",X)},className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 bg-gray-50 dark:bg-gray-800 text-gray-900 dark:text-gray-100 rounded-lg focus:ring-blue-500 focus:border-blue-500",rows:"3",placeholder:`Authorization=Bearer token
902
- X-API-Key=your-key`})]}),t.jsxs("div",{className:"flex justify-end gap-2 pt-4",children:[t.jsx(Me,{type:"button",variant:"outline",onClick:A,children:"Cancel"}),t.jsx(Me,{type:"submit",disabled:ce,className:"bg-purple-600 hover:bg-purple-700 disabled:opacity-50",children:ce?"Saving...":W?"Update Server":"Add Server"})]})]})]})})]}),he==="cursor"&&t.jsxs("div",{className:"space-y-6 md:space-y-8",children:[t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(Nn,{className:"w-5 h-5 text-orange-500"}),t.jsx("h3",{className:"text-lg font-medium text-foreground",children:"Cursor Permission Settings"})]}),t.jsx("div",{className:"bg-orange-50 dark:bg-orange-900/20 border border-orange-200 dark:border-orange-800 rounded-lg p-4",children:t.jsxs("label",{className:"flex items-center gap-3",children:[t.jsx("input",{type:"checkbox",checked:xe,onChange:C=>Re(C.target.checked),className:"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500"}),t.jsxs("div",{children:[t.jsx("div",{className:"font-medium text-orange-900 dark:text-orange-100",children:"Skip permission prompts (use with caution)"}),t.jsx("div",{className:"text-sm text-orange-700 dark:text-orange-300",children:"Equivalent to -f flag in Cursor CLI"})]})]})})]}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(Jn,{className:"w-5 h-5 text-purple-500"}),t.jsx("h3",{className:"text-lg font-medium text-foreground",children:"Authentication"})]}),t.jsx("div",{className:"bg-purple-50 dark:bg-purple-900/20 border border-purple-200 dark:border-purple-800 rounded-lg p-4",children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{children:[t.jsx("div",{className:"font-medium text-purple-900 dark:text-purple-100",children:"Cursor CLI Login"}),t.jsx("div",{className:"text-sm text-purple-700 dark:text-purple-300",children:"Sign in to your Cursor account to enable AI features"})]}),t.jsxs(Me,{onClick:Ot,className:"bg-purple-600 hover:bg-purple-700 text-white",size:"sm",children:[t.jsx(Jn,{className:"w-4 h-4 mr-2"}),"Login"]})]})})]}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx($s,{className:"w-5 h-5 text-green-500"}),t.jsx("h3",{className:"text-lg font-medium text-foreground",children:"Allowed Shell Commands"})]}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Shell commands that are automatically allowed without prompting for permission"}),t.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[t.jsx(wt,{value:pe,onChange:C=>Ue(C.target.value),placeholder:'e.g., "Shell(ls)" or "Shell(git status)"',onKeyPress:C=>{C.key==="Enter"&&pe&&!ke.includes(pe)&&(Ve([...ke,pe]),Ue(""))},className:"flex-1 h-10 touch-manipulation",style:{fontSize:"16px"}}),t.jsxs(Me,{onClick:()=>{pe&&!ke.includes(pe)&&(Ve([...ke,pe]),Ue(""))},disabled:!pe,size:"sm",className:"h-10 px-4 touch-manipulation",children:[t.jsx(Ct,{className:"w-4 h-4 mr-2 sm:mr-0"}),t.jsx("span",{className:"sm:hidden",children:"Add Command"})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("p",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"Quick add common commands:"}),t.jsx("div",{className:"grid grid-cols-2 sm:flex sm:flex-wrap gap-2",children:Le.map(C=>t.jsx(Me,{variant:"outline",size:"sm",onClick:()=>{ke.includes(C)||Ve([...ke,C])},disabled:ke.includes(C),className:"text-xs h-8 touch-manipulation truncate",children:C},C))})]}),t.jsxs("div",{className:"space-y-2",children:[ke.map(C=>t.jsxs("div",{className:"flex items-center justify-between bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-800 rounded-lg p-3",children:[t.jsx("span",{className:"font-mono text-sm text-green-800 dark:text-green-200",children:C}),t.jsx(Me,{variant:"ghost",size:"sm",onClick:()=>Ve(ke.filter(X=>X!==C)),className:"text-green-600 hover:text-green-700 dark:text-green-400 dark:hover:text-green-300",children:t.jsx(ot,{className:"w-4 h-4"})})]},C)),ke.length===0&&t.jsx("div",{className:"text-center py-8 text-gray-500 dark:text-gray-400",children:"No allowed shell commands configured"})]})]}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx($s,{className:"w-5 h-5 text-red-500"}),t.jsx("h3",{className:"text-lg font-medium text-foreground",children:"Disallowed Shell Commands"})]}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Shell commands that should always be denied"}),t.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[t.jsx(wt,{value:mt,onChange:C=>Ie(C.target.value),placeholder:'e.g., "Shell(rm -rf)" or "Shell(sudo)"',onKeyPress:C=>{C.key==="Enter"&&mt&&!Ke.includes(mt)&&(rt([...Ke,mt]),Ie(""))},className:"flex-1 h-10 touch-manipulation",style:{fontSize:"16px"}}),t.jsxs(Me,{onClick:()=>{mt&&!Ke.includes(mt)&&(rt([...Ke,mt]),Ie(""))},disabled:!mt,size:"sm",className:"h-10 px-4 touch-manipulation",children:[t.jsx(Ct,{className:"w-4 h-4 mr-2 sm:mr-0"}),t.jsx("span",{className:"sm:hidden",children:"Add Command"})]})]}),t.jsxs("div",{className:"space-y-2",children:[Ke.map(C=>t.jsxs("div",{className:"flex items-center justify-between bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg p-3",children:[t.jsx("span",{className:"font-mono text-sm text-red-800 dark:text-red-200",children:C}),t.jsx(Me,{variant:"ghost",size:"sm",onClick:()=>rt(Ke.filter(X=>X!==C)),className:"text-red-600 hover:text-red-700 dark:text-red-400 dark:hover:text-red-300",children:t.jsx(ot,{className:"w-4 h-4"})})]},C)),Ke.length===0&&t.jsx("div",{className:"text-center py-8 text-gray-500 dark:text-gray-400",children:"No disallowed shell commands configured"})]})]}),t.jsxs("div",{className:"bg-purple-50 dark:bg-purple-900/20 border border-purple-200 dark:border-purple-800 rounded-lg p-4",children:[t.jsx("h4",{className:"font-medium text-purple-900 dark:text-purple-100 mb-2",children:"Cursor Shell Command Examples:"}),t.jsxs("ul",{className:"text-sm text-purple-800 dark:text-purple-200 space-y-1",children:[t.jsxs("li",{children:[t.jsx("code",{className:"bg-purple-100 dark:bg-purple-800 px-1 rounded",children:'"Shell(ls)"'})," - Allow ls command"]}),t.jsxs("li",{children:[t.jsx("code",{className:"bg-purple-100 dark:bg-purple-800 px-1 rounded",children:'"Shell(git status)"'})," - Allow git status command"]}),t.jsxs("li",{children:[t.jsx("code",{className:"bg-purple-100 dark:bg-purple-800 px-1 rounded",children:'"Shell(mkdir)"'})," - Allow mkdir command"]}),t.jsxs("li",{children:[t.jsx("code",{className:"bg-purple-100 dark:bg-purple-800 px-1 rounded",children:'"-f"'})," flag - Skip all permission prompts (dangerous)"]})]})]})]})]}),ne==="tasks"&&t.jsx("div",{className:"space-y-6 md:space-y-8",children:m?t.jsx("div",{className:"bg-gray-50 dark:bg-gray-900/50 border border-gray-200 dark:border-gray-700 rounded-lg p-4",children:t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:"animate-spin w-5 h-5 border-2 border-blue-600 border-t-transparent rounded-full"}),t.jsx("span",{className:"text-sm text-muted-foreground",children:"Checking TaskMaster installation..."})]})}):t.jsxs(t.Fragment,{children:[!l&&t.jsx("div",{className:"bg-orange-50 dark:bg-orange-950/50 border border-orange-200 dark:border-orange-800 rounded-lg p-4",children:t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx("div",{className:"w-8 h-8 bg-orange-100 dark:bg-orange-900 rounded-full flex items-center justify-center flex-shrink-0 mt-0.5",children:t.jsx("svg",{className:"w-4 h-4 text-orange-600 dark:text-orange-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z"})})}),t.jsxs("div",{className:"flex-1",children:[t.jsx("div",{className:"font-medium text-orange-900 dark:text-orange-100 mb-2",children:"TaskMaster AI CLI Not Installed"}),t.jsxs("div",{className:"text-sm text-orange-800 dark:text-orange-200 space-y-3",children:[t.jsx("p",{children:"TaskMaster CLI is required to use task management features. Install it to get started:"}),t.jsxs("div",{className:"bg-orange-100 dark:bg-orange-900/50 rounded-lg p-3 font-mono text-sm",children:[t.jsx("code",{children:"npm install -g task-master-ai"}),t.jsxs("a",{href:"https://github.com/eyaltoledano/claude-task-master",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 font-medium",children:[t.jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",children:t.jsx("path",{fillRule:"evenodd",d:"M10 0C4.477 0 0 4.484 0 10.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0110 4.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.203 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.942.359.31.678.921.678 1.856 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0020 10.017C20 4.484 15.522 0 10 0z",clipRule:"evenodd"})}),"View on GitHub",t.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("p",{className:"font-medium",children:"After installation:"}),t.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-xs",children:[t.jsx("li",{children:"Restart this application"}),t.jsx("li",{children:"TaskMaster features will automatically become available"}),t.jsxs("li",{children:["Use ",t.jsx("code",{className:"bg-orange-100 dark:bg-orange-800 px-1 rounded",children:"task-master init"})," in your project directory"]})]})]})]})]})]})}),t.jsxs("div",{className:"space-y-4",children:[t.jsx("div",{className:"bg-gray-50 dark:bg-gray-900/50 border border-gray-200 dark:border-gray-700 rounded-lg p-4",children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{children:[t.jsx("div",{className:"font-medium text-foreground",children:"Enable TaskMaster Integration"}),t.jsx("div",{className:"text-sm text-muted-foreground mt-1",children:"Show TaskMaster tasks, banners, and sidebar indicators across the interface"}),!l&&t.jsx("div",{className:"text-xs text-orange-600 dark:text-orange-400 mt-1",children:"TaskMaster CLI must be installed first"})]}),t.jsxs("label",{className:"relative inline-flex items-center cursor-pointer",children:[t.jsx("input",{type:"checkbox",checked:i,onChange:C=>o(C.target.checked),disabled:!l,className:"sr-only peer"}),t.jsx("div",{className:`w-11 h-6 ${l?"bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-blue-300 dark:peer-focus:ring-blue-800":"bg-gray-300 dark:bg-gray-600"} rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-blue-600`})]})]})}),t.jsx("div",{className:"bg-blue-50 dark:bg-blue-950/50 border border-blue-200 dark:border-blue-800 rounded-lg p-4",children:t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx("div",{className:"w-8 h-8 bg-blue-100 dark:bg-blue-900 rounded-full flex items-center justify-center flex-shrink-0 mt-0.5",children:t.jsx(ya,{className:"w-4 h-4 text-blue-600 dark:text-blue-400"})}),t.jsxs("div",{children:[t.jsx("div",{className:"font-medium text-blue-900 dark:text-blue-100 mb-2",children:"🎯 About TaskMaster AI"}),t.jsxs("div",{className:"text-sm text-blue-800 dark:text-blue-200 space-y-2",children:[t.jsxs("p",{children:[t.jsx("strong",{children:"AI-Powered Task Management:"})," Break complex projects into manageable subtasks with AI assistance"]}),t.jsxs("p",{children:[t.jsx("strong",{children:"PRD:"})," Generate structured tasks from Product Requirements Documents"]}),t.jsxs("p",{children:[t.jsx("strong",{children:"Dependency Tracking:"})," Understand task relationships and execution order"]}),t.jsxs("p",{children:[t.jsx("strong",{children:"Progress Visualization:"})," Kanban boards, and detailed task views"]})]})]}),t.jsx("div",{className:"mt-4 pt-4 border-t border-blue-200 dark:border-blue-700",children:t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx("div",{className:"w-6 h-6 bg-blue-100 dark:bg-blue-800 rounded-full flex items-center justify-center flex-shrink-0 mt-0.5",children:t.jsx("svg",{className:"w-3 h-3 text-blue-600 dark:text-blue-400",fill:"currentColor",viewBox:"0 0 20 20",children:t.jsx("path",{fillRule:"evenodd",d:"M12.586 4.586a2 2 0 112.828 2.828l-3 3a2 2 0 01-2.828 0 1 1 0 00-1.414 1.414 4 4 0 005.656 0l3-3a4 4 0 00-5.656-5.656l-1.5 1.5a1 1 0 101.414 1.414l1.5-1.5zm-5 5a2 2 0 012.828 0 1 1 0 101.414-1.414 4 4 0 00-5.656 0l-3 3a4 4 0 105.656 5.656l1.5-1.5a1 1 0 10-1.414-1.414l-1.5 1.5a2 2 0 11-2.828-2.828l3-3z",clipRule:"evenodd"})})}),t.jsxs("div",{className:"flex-1",children:[t.jsx("div",{className:"font-medium text-blue-900 dark:text-blue-100 mb-2",children:"📚 Learn More & Tutorial"}),t.jsxs("div",{className:"text-sm text-blue-800 dark:text-blue-200 space-y-2",children:[t.jsxs("p",{children:["TaskMaster AI (aka ",t.jsx("strong",{children:"claude-task-master"})," ) is an advanced AI-powered task management system built for developers."]}),t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("a",{href:"https://github.com/eyaltoledano/claude-task-master",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 font-medium",children:[t.jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",children:t.jsx("path",{fillRule:"evenodd",d:"M10 0C4.477 0 0 4.484 0 10.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0110 4.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.203 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.942.359.31.678.921.678 1.856 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0020 10.017C20 4.484 15.522 0 10 0z",clipRule:"evenodd"})}),"View on GitHub",t.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})]}),t.jsx("p",{className:"text-xs text-blue-700 dark:text-blue-300",children:"Find documentation, setup guides, and examples for advanced TaskMaster workflows"})]})]})]})]})})]})})]})]})}),ne==="api"&&t.jsx("div",{className:"space-y-6 md:space-y-8",children:t.jsx(c1,{})})]})]}),t.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between p-4 md:p-6 border-t border-border flex-shrink-0 gap-3 pb-safe-area-inset-bottom",children:[t.jsxs("div",{className:"flex items-center justify-center sm:justify-start gap-2 order-2 sm:order-1",children:[B==="success"&&t.jsxs("div",{className:"text-green-600 dark:text-green-400 text-sm flex items-center gap-1",children:[t.jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",children:t.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})}),"Settings saved successfully!"]}),B==="error"&&t.jsxs("div",{className:"text-red-600 dark:text-red-400 text-sm flex items-center gap-1",children:[t.jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",children:t.jsx("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z",clipRule:"evenodd"})}),"Failed to save settings"]})]}),t.jsxs("div",{className:"flex items-center gap-3 order-1 sm:order-2",children:[t.jsx(Me,{variant:"outline",onClick:r,disabled:U,className:"flex-1 sm:flex-none h-10 touch-manipulation",children:"Cancel"}),t.jsx(Me,{onClick:Lt,disabled:U,className:"flex-1 sm:flex-none h-10 bg-blue-600 hover:bg-blue-700 disabled:opacity-50 touch-manipulation",children:U?t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"w-4 h-4 animate-spin rounded-full border-2 border-white border-t-transparent"}),"Saving..."]}):"Save Settings"})]})]})]}),ue&&t.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 max-md:items-stretch max-md:justify-stretch",children:t.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-xl w-full max-w-4xl h-3/4 flex flex-col md:max-w-4xl md:h-3/4 md:rounded-lg md:m-4 max-md:max-w-none max-md:h-full max-md:rounded-none max-md:m-0",children:[t.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-gray-200 dark:border-gray-700",children:[t.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:F==="claude"?"Claude CLI Login":"Cursor CLI Login"}),t.jsx("button",{onClick:()=>S(!1),className:"text-gray-400 hover:text-gray-600 dark:hover:text-gray-300",children:t.jsx(ot,{className:"w-6 h-6"})})]}),t.jsx("div",{className:"flex-1 overflow-hidden",children:t.jsx(au,{project:se,command:F==="claude"?"claude /login":"cursor-agent login",onComplete:Bt,showHeader:!1})})]})})]}):null}function u1(){const{isDarkMode:e,toggleDarkMode:r}=Ci();return t.jsxs("button",{onClick:r,className:"relative inline-flex h-8 w-14 items-center rounded-full bg-gray-200 dark:bg-gray-700 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 dark:focus:ring-offset-gray-900",role:"switch","aria-checked":e,"aria-label":"Toggle dark mode",children:[t.jsx("span",{className:"sr-only",children:"Toggle dark mode"}),t.jsx("span",{className:`${e?"translate-x-7":"translate-x-1"} inline-block h-6 w-6 transform rounded-full bg-white shadow-lg transition-transform duration-200 flex items-center justify-center`,children:e?t.jsx("svg",{className:"w-3.5 h-3.5 text-gray-700",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z"})}):t.jsx("svg",{className:"w-3.5 h-3.5 text-yellow-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z"})})})]})}const m1=({isOpen:e,onToggle:r,autoExpandTools:n,onAutoExpandChange:s,showRawParameters:a,onShowRawParametersChange:i,showThinking:o,onShowThinkingChange:l,autoScrollToBottom:c,onAutoScrollChange:d,sendByCtrlEnter:m,onSendByCtrlEnterChange:u,isMobile:h})=>{const[p,g]=f.useState(e),[x,b]=f.useState(()=>localStorage.getItem("whisperMode")||"default"),{isDarkMode:k}=Ci();f.useEffect(()=>{g(e)},[e]);const N=()=>{const y=!p;g(y),r(y)};return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:`fixed ${h?"bottom-44":"top-1/2 -translate-y-1/2"} ${p?"right-64":"right-0"} z-50 transition-all duration-150 ease-out`,children:t.jsx("button",{onClick:N,className:"bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-l-md p-2 hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors shadow-lg","aria-label":p?"Close settings panel":"Open settings panel",children:p?t.jsx(kr,{className:"h-5 w-5 text-gray-600 dark:text-gray-400"}):t.jsx(ep,{className:"h-5 w-5 text-gray-600 dark:text-gray-400"})})}),t.jsx("div",{className:`fixed top-0 right-0 h-full w-64 bg-white dark:bg-gray-900 border-l border-gray-200 dark:border-gray-700 shadow-xl transform transition-transform duration-150 ease-out z-40 ${p?"translate-x-0":"translate-x-full"} ${h?"h-screen":""}`,children:t.jsxs("div",{className:"h-full flex flex-col",children:[t.jsx("div",{className:"p-4 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900",children:t.jsxs("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white flex items-center gap-2",children:[t.jsx(ph,{className:"h-5 w-5 text-gray-600 dark:text-gray-400"}),"Quick Settings"]})}),t.jsxs("div",{className:`flex-1 overflow-y-auto overflow-x-hidden p-4 space-y-6 bg-white dark:bg-gray-900 ${h?"pb-20":""}`,children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wider text-gray-500 dark:text-gray-400 mb-2",children:"Appearance"}),t.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg bg-gray-50 dark:bg-gray-800 hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors border border-transparent hover:border-gray-300 dark:hover:border-gray-600",children:[t.jsxs("span",{className:"flex items-center gap-2 text-sm text-gray-900 dark:text-white",children:[k?t.jsx(ac,{className:"h-4 w-4 text-gray-600 dark:text-gray-400"}):t.jsx(oc,{className:"h-4 w-4 text-gray-600 dark:text-gray-400"}),"Dark Mode"]}),t.jsx(u1,{})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wider text-gray-500 dark:text-gray-400 mb-2",children:"Tool Display"}),t.jsxs("label",{className:"flex items-center justify-between p-3 rounded-lg bg-gray-50 dark:bg-gray-800 hover:bg-gray-100 dark:hover:bg-gray-700 cursor-pointer transition-colors border border-transparent hover:border-gray-300 dark:hover:border-gray-600",children:[t.jsxs("span",{className:"flex items-center gap-2 text-sm text-gray-900 dark:text-white",children:[t.jsx(Xa,{className:"h-4 w-4 text-gray-600 dark:text-gray-400"}),"Auto-expand tools"]}),t.jsx("input",{type:"checkbox",checked:n,onChange:y=>s(y.target.checked),className:"h-4 w-4 rounded border-gray-300 dark:border-gray-600 text-blue-600 dark:text-blue-500 focus:ring-blue-500 dark:focus:ring-blue-400 dark:bg-gray-800 dark:checked:bg-blue-600"})]}),t.jsxs("label",{className:"flex items-center justify-between p-3 rounded-lg bg-gray-50 dark:bg-gray-800 hover:bg-gray-100 dark:hover:bg-gray-700 cursor-pointer transition-colors border border-transparent hover:border-gray-300 dark:hover:border-gray-600",children:[t.jsxs("span",{className:"flex items-center gap-2 text-sm text-gray-900 dark:text-white",children:[t.jsx(an,{className:"h-4 w-4 text-gray-600 dark:text-gray-400"}),"Show raw parameters"]}),t.jsx("input",{type:"checkbox",checked:a,onChange:y=>i(y.target.checked),className:"h-4 w-4 rounded border-gray-300 dark:border-gray-600 text-blue-600 dark:text-blue-500 focus:ring-blue-500 dark:focus:ring-blue-400 dark:bg-gray-800 dark:checked:bg-blue-600"})]}),t.jsxs("label",{className:"flex items-center justify-between p-3 rounded-lg bg-gray-50 dark:bg-gray-800 hover:bg-gray-100 dark:hover:bg-gray-700 cursor-pointer transition-colors border border-transparent hover:border-gray-300 dark:hover:border-gray-600",children:[t.jsxs("span",{className:"flex items-center gap-2 text-sm text-gray-900 dark:text-white",children:[t.jsx(Zl,{className:"h-4 w-4 text-gray-600 dark:text-gray-400"}),"Show thinking"]}),t.jsx("input",{type:"checkbox",checked:o,onChange:y=>l(y.target.checked),className:"h-4 w-4 rounded border-gray-300 dark:border-gray-600 text-blue-600 dark:text-blue-500 focus:ring-blue-500 dark:focus:ring-blue-400 dark:bg-gray-800 dark:checked:bg-blue-600"})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wider text-gray-500 dark:text-gray-400 mb-2",children:"View Options"}),t.jsxs("label",{className:"flex items-center justify-between p-3 rounded-lg bg-gray-50 dark:bg-gray-800 hover:bg-gray-100 dark:hover:bg-gray-700 cursor-pointer transition-colors border border-transparent hover:border-gray-300 dark:hover:border-gray-600",children:[t.jsxs("span",{className:"flex items-center gap-2 text-sm text-gray-900 dark:text-white",children:[t.jsx(Xl,{className:"h-4 w-4 text-gray-600 dark:text-gray-400"}),"Auto-scroll to bottom"]}),t.jsx("input",{type:"checkbox",checked:c,onChange:y=>d(y.target.checked),className:"h-4 w-4 rounded border-gray-300 dark:border-gray-600 text-blue-600 dark:text-blue-500 focus:ring-blue-500 dark:focus:ring-blue-400 dark:bg-gray-800 dark:checked:bg-blue-600"})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wider text-gray-500 dark:text-gray-400 mb-2",children:"Input Settings"}),t.jsxs("label",{className:"flex items-center justify-between p-3 rounded-lg bg-gray-50 dark:bg-gray-800 hover:bg-gray-100 dark:hover:bg-gray-700 cursor-pointer transition-colors border border-transparent hover:border-gray-300 dark:hover:border-gray-600",children:[t.jsxs("span",{className:"flex items-center gap-2 text-sm text-gray-900 dark:text-white",children:[t.jsx(Wp,{className:"h-4 w-4 text-gray-600 dark:text-gray-400"}),"Send by Ctrl+Enter"]}),t.jsx("input",{type:"checkbox",checked:m,onChange:y=>u(y.target.checked),className:"h-4 w-4 rounded border-gray-300 dark:border-gray-600 text-blue-600 dark:text-blue-500 focus:ring-blue-500 dark:focus:ring-blue-400 dark:bg-gray-800 dark:checked:bg-blue-600"})]}),t.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 ml-3",children:"When enabled, pressing Ctrl+Enter will send the message instead of just Enter. This is useful for IME users to avoid accidental sends."})]}),t.jsxs("div",{className:"space-y-2",style:{display:"none"},children:[t.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wider text-gray-500 dark:text-gray-400 mb-2",children:"Whisper Dictation"}),t.jsxs("div",{className:"space-y-2",children:[t.jsxs("label",{className:"flex items-start p-3 rounded-lg bg-gray-50 dark:bg-gray-800 hover:bg-gray-100 dark:hover:bg-gray-700 cursor-pointer transition-colors border border-transparent hover:border-gray-300 dark:hover:border-gray-600",children:[t.jsx("input",{type:"radio",name:"whisperMode",value:"default",checked:x==="default",onChange:()=>{b("default"),localStorage.setItem("whisperMode","default"),window.dispatchEvent(new Event("whisperModeChanged"))},className:"mt-0.5 h-4 w-4 border-gray-300 dark:border-gray-600 text-blue-600 dark:text-blue-500 focus:ring-blue-500 dark:focus:ring-blue-400 dark:bg-gray-800 dark:checked:bg-blue-600"}),t.jsxs("div",{className:"ml-3 flex-1",children:[t.jsxs("span",{className:"flex items-center gap-2 text-sm font-medium text-gray-900 dark:text-white",children:[t.jsx(as,{className:"h-4 w-4 text-gray-600 dark:text-gray-400"}),"Default Mode"]}),t.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1",children:"Direct transcription of your speech"})]})]}),t.jsxs("label",{className:"flex items-start p-3 rounded-lg bg-gray-50 dark:bg-gray-800 hover:bg-gray-100 dark:hover:bg-gray-700 cursor-pointer transition-colors border border-transparent hover:border-gray-300 dark:hover:border-gray-600",children:[t.jsx("input",{type:"radio",name:"whisperMode",value:"prompt",checked:x==="prompt",onChange:()=>{b("prompt"),localStorage.setItem("whisperMode","prompt"),window.dispatchEvent(new Event("whisperModeChanged"))},className:"mt-0.5 h-4 w-4 border-gray-300 dark:border-gray-600 text-blue-600 dark:text-blue-500 focus:ring-blue-500 dark:focus:ring-blue-400 dark:bg-gray-800 dark:checked:bg-blue-600"}),t.jsxs("div",{className:"ml-3 flex-1",children:[t.jsxs("span",{className:"flex items-center gap-2 text-sm font-medium text-gray-900 dark:text-white",children:[t.jsx(Pr,{className:"h-4 w-4 text-gray-600 dark:text-gray-400"}),"Prompt Enhancement"]}),t.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1",children:"Transform rough ideas into clear, detailed AI prompts"})]})]}),t.jsxs("label",{className:"flex items-start p-3 rounded-lg bg-gray-50 dark:bg-gray-800 hover:bg-gray-100 dark:hover:bg-gray-700 cursor-pointer transition-colors border border-transparent hover:border-gray-300 dark:hover:border-gray-600",children:[t.jsx("input",{type:"radio",name:"whisperMode",value:"vibe",checked:x==="vibe"||x==="instructions"||x==="architect",onChange:()=>{b("vibe"),localStorage.setItem("whisperMode","vibe"),window.dispatchEvent(new Event("whisperModeChanged"))},className:"mt-0.5 h-4 w-4 border-gray-300 dark:border-gray-600 text-blue-600 dark:text-blue-500 focus:ring-blue-500 dark:focus:ring-blue-400 dark:bg-gray-800 dark:checked:bg-blue-600"}),t.jsxs("div",{className:"ml-3 flex-1",children:[t.jsxs("span",{className:"flex items-center gap-2 text-sm font-medium text-gray-900 dark:text-white",children:[t.jsx(Tt,{className:"h-4 w-4 text-gray-600 dark:text-gray-400"}),"Vibe Mode"]}),t.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1",children:"Format ideas as clear agent instructions with details"})]})]})]})]})]})]})}),p&&t.jsx("div",{className:"fixed inset-0 bg-background/80 backdrop-blur-sm z-30 transition-opacity duration-150 ease-out",onClick:N})]})},p1=()=>{const[e,r]=f.useState(""),[n,s]=f.useState(""),[a,i]=f.useState(""),[o,l]=f.useState(!1),[c,d]=f.useState(""),{register:m}=ws(),u=async h=>{if(h.preventDefault(),d(""),n!==a){d("Passwords do not match");return}if(e.length<3){d("Username must be at least 3 characters long");return}if(n.length<6){d("Password must be at least 6 characters long");return}l(!0);const p=await m(e,n);p.success||d(p.error),l(!1)};return t.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-4",children:t.jsx("div",{className:"w-full max-w-md",children:t.jsxs("div",{className:"bg-card rounded-lg shadow-lg border border-border p-8 space-y-6",children:[t.jsxs("div",{className:"text-center",children:[t.jsx("div",{className:"flex justify-center mb-4",children:t.jsx(Zt,{size:64})}),t.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"Welcome to Claude Code UI"}),t.jsx("p",{className:"text-muted-foreground mt-2",children:"Set up your account to get started"})]}),t.jsxs("form",{onSubmit:u,className:"space-y-4",children:[t.jsxs("div",{children:[t.jsx("label",{htmlFor:"username",className:"block text-sm font-medium text-foreground mb-1",children:"Username"}),t.jsx("input",{type:"text",id:"username",value:e,onChange:h=>r(h.target.value),className:"w-full px-3 py-2 border border-border rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"Enter your username",required:!0,disabled:o})]}),t.jsxs("div",{children:[t.jsx("label",{htmlFor:"password",className:"block text-sm font-medium text-foreground mb-1",children:"Password"}),t.jsx("input",{type:"password",id:"password",value:n,onChange:h=>s(h.target.value),className:"w-full px-3 py-2 border border-border rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"Enter your password",required:!0,disabled:o})]}),t.jsxs("div",{children:[t.jsx("label",{htmlFor:"confirmPassword",className:"block text-sm font-medium text-foreground mb-1",children:"Confirm Password"}),t.jsx("input",{type:"password",id:"confirmPassword",value:a,onChange:h=>i(h.target.value),className:"w-full px-3 py-2 border border-border rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"Confirm your password",required:!0,disabled:o})]}),c&&t.jsx("div",{className:"p-3 bg-red-100 dark:bg-red-900/20 border border-red-300 dark:border-red-800 rounded-md",children:t.jsx("p",{className:"text-sm text-red-700 dark:text-red-400",children:c})}),t.jsx("button",{type:"submit",disabled:o,className:"w-full bg-blue-600 hover:bg-blue-700 disabled:bg-blue-400 text-white font-medium py-2 px-4 rounded-md transition-colors duration-200",children:o?"Setting up...":"Create Account"})]}),t.jsx("div",{className:"text-center",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"This is a single-user system. Only one account can be created."})})]})})})},h1=()=>{const[e,r]=f.useState(""),[n,s]=f.useState(""),[a,i]=f.useState(!1),[o,l]=f.useState(""),{login:c}=ws(),d=async m=>{if(m.preventDefault(),l(""),!e||!n){l("Please enter both username and password");return}i(!0);const u=await c(e,n);u.success||l(u.error),i(!1)};return t.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-4",children:t.jsx("div",{className:"w-full max-w-md",children:t.jsxs("div",{className:"bg-card rounded-lg shadow-lg border border-border p-8 space-y-6",children:[t.jsxs("div",{className:"text-center",children:[t.jsx("div",{className:"flex justify-center mb-4",children:t.jsx("div",{className:"w-16 h-16 bg-primary rounded-lg flex items-center justify-center shadow-sm",children:t.jsx(An,{className:"w-8 h-8 text-primary-foreground"})})}),t.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"Welcome Back"}),t.jsx("p",{className:"text-muted-foreground mt-2",children:"Sign in to your Claude Code UI account"})]}),t.jsxs("form",{onSubmit:d,className:"space-y-4",children:[t.jsxs("div",{children:[t.jsx("label",{htmlFor:"username",className:"block text-sm font-medium text-foreground mb-1",children:"Username"}),t.jsx("input",{type:"text",id:"username",value:e,onChange:m=>r(m.target.value),className:"w-full px-3 py-2 border border-border rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"Enter your username",required:!0,disabled:a})]}),t.jsxs("div",{children:[t.jsx("label",{htmlFor:"password",className:"block text-sm font-medium text-foreground mb-1",children:"Password"}),t.jsx("input",{type:"password",id:"password",value:n,onChange:m=>s(m.target.value),className:"w-full px-3 py-2 border border-border rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"Enter your password",required:!0,disabled:a})]}),o&&t.jsx("div",{className:"p-3 bg-red-100 dark:bg-red-900/20 border border-red-300 dark:border-red-800 rounded-md",children:t.jsx("p",{className:"text-sm text-red-700 dark:text-red-400",children:o})}),t.jsx("button",{type:"submit",disabled:a,className:"w-full bg-blue-600 hover:bg-blue-700 disabled:bg-blue-400 text-white font-medium py-2 px-4 rounded-md transition-colors duration-200",children:a?"Signing in...":"Sign In"})]}),t.jsx("div",{className:"text-center",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"Enter your credentials to access Claude Code UI"})})]})})})},f1=()=>t.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-4",children:t.jsxs("div",{className:"text-center",children:[t.jsx("div",{className:"flex justify-center mb-4",children:t.jsx("div",{className:"w-16 h-16 bg-primary rounded-lg flex items-center justify-center shadow-sm",children:t.jsx(An,{className:"w-8 h-8 text-primary-foreground"})})}),t.jsx("h1",{className:"text-2xl font-bold text-foreground mb-2",children:"Claude Code UI"}),t.jsxs("div",{className:"flex items-center justify-center space-x-2",children:[t.jsx("div",{className:"w-2 h-2 bg-blue-500 rounded-full animate-bounce"}),t.jsx("div",{className:"w-2 h-2 bg-blue-500 rounded-full animate-bounce",style:{animationDelay:"0.1s"}}),t.jsx("div",{className:"w-2 h-2 bg-blue-500 rounded-full animate-bounce",style:{animationDelay:"0.2s"}})]}),t.jsx("p",{className:"text-muted-foreground mt-2",children:"Loading..."})]})}),g1=({children:e})=>{const{user:r,isLoading:n,needsSetup:s}=ws();return n?t.jsx(f1,{}):s?t.jsx(p1,{}):r?e:t.jsx(h1,{})},Al="1.10.0",x1=(e,r)=>{const[n,s]=f.useState(!1),[a,i]=f.useState(null);return f.useEffect(()=>{const o=async()=>{try{const d=await(await fetch(`https://api.github.com/repos/${e}/${r}/releases/latest`)).json();if(d.tag_name){const m=d.tag_name.replace(/^v/,"");i(m),s(Al!==m)}else s(!1),i(null)}catch(c){console.error("Version check failed:",c),s(!1),i(null)}};o();const l=setInterval(o,300*1e3);return()=>clearInterval(l)},[e,r]),{updateAvailable:n,latestVersion:a,currentVersion:Al}};function kn(e,r){const[n,s]=f.useState(()=>{if(typeof window>"u")return r;try{const i=window.localStorage.getItem(e);return i?JSON.parse(i):r}catch(i){return console.log(i),r}});return[n,i=>{if(!(typeof window>"u"))try{const o=i instanceof Function?i(n):i;window.localStorage.setItem(e,JSON.stringify(o)),s(o)}catch(o){console.log(o)}}]}function Ml(){const e=Ku(),{sessionId:r}=Ju(),{updateAvailable:n,latestVersion:s,currentVersion:a}=x1("siteboon","claudecodeui"),[i,o]=f.useState(!1),[l,c]=f.useState([]),[d,m]=f.useState(null),[u,h]=f.useState(null),[p,g]=f.useState("chat"),[x,b]=f.useState(!1),[k,N]=f.useState(!1),[y,_]=f.useState(!0),[U,D]=f.useState(!1),[B,L]=f.useState(!1),[H,j]=f.useState(!1),[P,M]=kn("autoExpandTools",!1),[R,w]=kn("showRawParameters",!1),[W,O]=kn("showThinking",!0),[$,G]=kn("autoScrollToBottom",!0),[ce,I]=kn("sendByCtrlEnter",!1),[je,We]=f.useState(new Set),[v,te]=f.useState(new Set),[me,Ne]=f.useState(0),{ws:ne,sendMessage:Oe,messages:ee}=dc(),[oe,he]=f.useState(!1);f.useEffect(()=>{const S=()=>{const F=window.matchMedia("(display-mode: standalone)").matches||window.navigator.standalone||document.referrer.includes("android-app://");he(F),F?(document.documentElement.classList.add("pwa-mode"),document.body.classList.add("pwa-mode")):(document.documentElement.classList.remove("pwa-mode"),document.body.classList.remove("pwa-mode"))};return S(),window.matchMedia("(display-mode: standalone)").addEventListener("change",S),()=>{window.matchMedia("(display-mode: standalone)").removeEventListener("change",S)}},[]),f.useEffect(()=>{const S=()=>{b(window.innerWidth<768)};return S(),window.addEventListener("resize",S),()=>window.removeEventListener("resize",S)},[]),f.useEffect(()=>{ke()},[]);const Ce=(S,F,K,se)=>{if(!K||!se)return!0;const le=S?.find(tt=>tt.name===K.name),ze=F?.find(tt=>tt.name===K.name);if(!le||!ze)return!1;const Le=le.sessions?.find(tt=>tt.id===se.id),Je=ze.sessions?.find(tt=>tt.id===se.id);return!Le||!Je?!1:Le.id===Je.id&&Le.title===Je.title&&Le.created_at===Je.created_at&&Le.updated_at===Je.updated_at};f.useEffect(()=>{if(ee.length>0){const S=ee[ee.length-1];if(S.type==="projects_updated"){if(S.changedFile&&u&&d){const se=S.changedFile.split("/");se.length>=2&&se[se.length-1].replace(".jsonl","")===u.id&&(je.has(u.id)||Ne(Je=>Je+1))}if(u&&je.has(u.id)||je.size>0&&Array.from(je).some(se=>se.startsWith("new-session-"))){const se=S.projects;if(!Ce(l,se,d,u))return}const K=S.projects;if(c(K),d){const se=K.find(le=>le.name===d.name);se&&(JSON.stringify(se)!==JSON.stringify(d)&&m(se),u&&(se.sessions?.find(ze=>ze.id===u.id)||h(null)))}}}},[ee,d,u,je]);const ke=async()=>{try{_(!0);const F=await(await Fe.projects()).json();for(let K of F)try{const se=`/api/cursor/sessions?projectPath=${encodeURIComponent(K.fullPath||K.path)}`,le=await De(se);if(le.ok){const ze=await le.json();ze.success&&ze.sessions?K.cursorSessions=ze.sessions:K.cursorSessions=[]}else K.cursorSessions=[]}catch(se){console.error(`Error fetching Cursor sessions for project ${K.name}:`,se),K.cursorSessions=[]}c(K=>K.length===0||F.some((le,ze)=>{const Le=K[ze];return Le?le.name!==Le.name||le.displayName!==Le.displayName||le.fullPath!==Le.fullPath||JSON.stringify(le.sessionMeta)!==JSON.stringify(Le.sessionMeta)||JSON.stringify(le.sessions)!==JSON.stringify(Le.sessions)||JSON.stringify(le.cursorSessions)!==JSON.stringify(Le.cursorSessions):!0})||F.length!==K.length?F:K)}catch(S){console.error("Error fetching projects:",S)}finally{_(!1)}};window.refreshProjects=ke,f.useEffect(()=>{if(r&&l.length>0){const S=!u||u.id!==r;for(const F of l){let K=F.sessions?.find(le=>le.id===r);if(K){m(F),h({...K,__provider:"claude"}),S&&g("chat");return}const se=F.cursorSessions?.find(le=>le.id===r);if(se){m(F),h({...se,__provider:"cursor"}),S&&g("chat");return}}}},[r,l,e]);const Ve=S=>{m(S),h(null),e("/"),x&&N(!1)},Ke=S=>{if(h(S),p!=="git"&&p!=="preview"&&g("chat"),(localStorage.getItem("selected-provider")||"claude")==="cursor"&&sessionStorage.setItem("cursorSessionId",S.id),x){const K=S.__projectName,se=d?.name;K!==se&&N(!1)}e(`/session/${S.id}`)},rt=S=>{m(S),h(null),g("chat"),e("/"),x&&N(!1)},xe=S=>{u?.id===S&&(h(null),e("/")),c(F=>F.map(K=>({...K,sessions:K.sessions?.filter(se=>se.id!==S)||[],sessionMeta:{...K.sessionMeta,total:Math.max(0,(K.sessionMeta?.total||0)-1)}})))},Re=async()=>{try{const F=await(await Fe.projects()).json();if(c(K=>F.some((le,ze)=>{const Le=K[ze];return Le?le.name!==Le.name||le.displayName!==Le.displayName||le.fullPath!==Le.fullPath||JSON.stringify(le.sessionMeta)!==JSON.stringify(Le.sessionMeta)||JSON.stringify(le.sessions)!==JSON.stringify(Le.sessions):!0})||F.length!==K.length?F:K),d){const K=F.find(se=>se.name===d.name);if(K&&(JSON.stringify(K)!==JSON.stringify(d)&&m(K),u)){const se=K.sessions?.find(le=>le.id===u.id);se&&JSON.stringify(se)!==JSON.stringify(u)&&h(se)}}}catch(S){console.error("Error refreshing sidebar:",S)}},pe=S=>{d?.name===S&&(m(null),h(null),e("/")),c(F=>F.filter(K=>K.name!==S))},Ue=f.useCallback(S=>{S&&We(F=>new Set([...F,S]))},[]),mt=f.useCallback(S=>{S&&We(F=>{const K=new Set(F);return K.delete(S),K})},[]),Ie=f.useCallback(S=>{S&&te(F=>new Set([...F,S]))},[]),$t=f.useCallback(S=>{S&&te(F=>{const K=new Set(F);return K.delete(S),K})},[]),Z=f.useCallback(S=>{S&&We(F=>{const K=new Set;for(const se of F)se.startsWith("new-session-")||K.add(se);return K.add(S),K})},[]),ue=()=>i?t.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[t.jsx("button",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm",onClick:()=>o(!1),"aria-label":"Close version upgrade modal"}),t.jsxs("div",{className:"relative bg-white dark:bg-gray-800 rounded-lg shadow-xl border border-gray-200 dark:border-gray-700 w-full max-w-md mx-4 p-6 space-y-4",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:"w-10 h-10 bg-blue-100 dark:bg-blue-900/30 rounded-lg flex items-center justify-center",children:t.jsx("svg",{className:"w-5 h-5 text-blue-600 dark:text-blue-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M9 19l3 3m0 0l3-3m-3 3V10"})})}),t.jsxs("div",{children:[t.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Update Available"}),t.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"A new version is ready"})]})]}),t.jsx("button",{onClick:()=>o(!1),className:"p-2 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 rounded-md hover:bg-gray-100 dark:hover:bg-gray-700",children:t.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"flex justify-between items-center p-3 bg-gray-50 dark:bg-gray-700/50 rounded-lg",children:[t.jsx("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"Current Version"}),t.jsx("span",{className:"text-sm text-gray-900 dark:text-white font-mono",children:a})]}),t.jsxs("div",{className:"flex justify-between items-center p-3 bg-blue-50 dark:bg-blue-900/20 rounded-lg border border-blue-200 dark:border-blue-700",children:[t.jsx("span",{className:"text-sm font-medium text-blue-700 dark:text-blue-300",children:"Latest Version"}),t.jsx("span",{className:"text-sm text-blue-900 dark:text-blue-100 font-mono",children:s})]})]}),t.jsxs("div",{className:"space-y-3",children:[t.jsx("h3",{className:"text-sm font-medium text-gray-900 dark:text-white",children:"How to upgrade:"}),t.jsx("div",{className:"bg-gray-100 dark:bg-gray-800 rounded-lg p-3 border",children:t.jsx("code",{className:"text-sm text-gray-800 dark:text-gray-200 font-mono",children:"git checkout main && git pull && npm install"})}),t.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:"Run this command in your Claude Code UI directory to update to the latest version."})]}),t.jsxs("div",{className:"flex gap-2 pt-2",children:[t.jsx("button",{onClick:()=>o(!1),className:"flex-1 px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 bg-gray-100 dark:bg-gray-700 hover:bg-gray-200 dark:hover:bg-gray-600 rounded-md transition-colors",children:"Later"}),t.jsx("button",{onClick:()=>{navigator.clipboard.writeText("git checkout main && git pull && npm install"),o(!1)},className:"flex-1 px-4 py-2 text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 rounded-md transition-colors",children:"Copy Command"})]})]})]}):null;return t.jsxs("div",{className:"fixed inset-0 flex bg-background",children:[!x&&t.jsx("div",{className:"w-80 flex-shrink-0 border-r border-border bg-card",children:t.jsx("div",{className:"h-full overflow-hidden",children:t.jsx(Qi,{projects:l,selectedProject:d,selectedSession:u,onProjectSelect:Ve,onSessionSelect:Ke,onNewSession:rt,onSessionDelete:xe,onProjectDelete:pe,isLoading:y,onRefresh:Re,onShowSettings:()=>L(!0),updateAvailable:n,latestVersion:s,currentVersion:a,onShowVersionModal:()=>o(!0),isPWA:oe,isMobile:x})})}),x&&t.jsxs("div",{className:`fixed inset-0 z-50 flex transition-all duration-150 ease-out ${k?"opacity-100 visible":"opacity-0 invisible"}`,children:[t.jsx("button",{className:"fixed inset-0 bg-background/80 backdrop-blur-sm transition-opacity duration-150 ease-out",onClick:S=>{S.stopPropagation(),N(!1)},onTouchStart:S=>{S.preventDefault(),S.stopPropagation(),N(!1)},"aria-label":"Close sidebar"}),t.jsx("div",{className:`relative w-[85vw] max-w-sm sm:w-80 bg-card border-r border-border transform transition-transform duration-150 ease-out ${k?"translate-x-0":"-translate-x-full"}`,style:{height:"calc(100vh - 80px)"},onClick:S=>S.stopPropagation(),onTouchStart:S=>S.stopPropagation(),children:t.jsx(Qi,{projects:l,selectedProject:d,selectedSession:u,onProjectSelect:Ve,onSessionSelect:Ke,onNewSession:rt,onSessionDelete:xe,onProjectDelete:pe,isLoading:y,onRefresh:Re,onShowSettings:()=>L(!0),updateAvailable:n,latestVersion:s,currentVersion:a,onShowVersionModal:()=>o(!0),isPWA:oe,isMobile:x})})]}),t.jsx("div",{className:`flex-1 flex flex-col min-w-0 ${x&&!U?"pb-16":""}`,children:t.jsx(i1,{selectedProject:d,selectedSession:u,activeTab:p,setActiveTab:g,ws:ne,sendMessage:Oe,messages:ee,isMobile:x,isPWA:oe,onMenuClick:()=>N(!0),isLoading:y,onInputFocusChange:D,onSessionActive:Ue,onSessionInactive:mt,onSessionProcessing:Ie,onSessionNotProcessing:$t,processingSessions:v,onReplaceTemporarySession:Z,onNavigateToSession:S=>e(`/session/${S}`),onShowSettings:()=>L(!0),autoExpandTools:P,showRawParameters:R,showThinking:W,autoScrollToBottom:$,sendByCtrlEnter:ce,externalMessageUpdate:me})}),x&&t.jsx(o1,{activeTab:p,setActiveTab:g,isInputFocused:U}),p==="chat"&&t.jsx(m1,{isOpen:H,onToggle:j,autoExpandTools:P,onAutoExpandChange:M,showRawParameters:R,onShowRawParametersChange:w,showThinking:W,onShowThinkingChange:O,autoScrollToBottom:$,onAutoScrollChange:G,sendByCtrlEnter:ce,onSendByCtrlEnterChange:I,isMobile:x}),t.jsx(d1,{isOpen:B,onClose:()=>L(!1),projects:l}),t.jsx(ue,{})]})}function b1(){return t.jsx(l1,{children:t.jsx(Ph,{children:t.jsx(Rh,{children:t.jsx(zh,{children:t.jsx(_h,{children:t.jsx(g1,{children:t.jsx(Vu,{children:t.jsxs(Gu,{children:[t.jsx(_i,{path:"/",element:t.jsx(Ml,{})}),t.jsx(_i,{path:"/session/:sessionId",element:t.jsx(Ml,{})})]})})})})})})})})}"serviceWorker"in navigator&&navigator.serviceWorker.getRegistrations().then(e=>{e.forEach(r=>{r.unregister()})}).catch(e=>{console.warn("Failed to unregister service workers:",e)});rm.createRoot(document.getElementById("root")).render(t.jsx(or.StrictMode,{children:t.jsx(b1,{})}));
902
+ X-API-Key=your-key`})]}),t.jsxs("div",{className:"flex justify-end gap-2 pt-4",children:[t.jsx(Me,{type:"button",variant:"outline",onClick:A,children:"Cancel"}),t.jsx(Me,{type:"submit",disabled:ce,className:"bg-purple-600 hover:bg-purple-700 disabled:opacity-50",children:ce?"Saving...":W?"Update Server":"Add Server"})]})]})]})})]}),he==="cursor"&&t.jsxs("div",{className:"space-y-6 md:space-y-8",children:[t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(Nn,{className:"w-5 h-5 text-orange-500"}),t.jsx("h3",{className:"text-lg font-medium text-foreground",children:"Cursor Permission Settings"})]}),t.jsx("div",{className:"bg-orange-50 dark:bg-orange-900/20 border border-orange-200 dark:border-orange-800 rounded-lg p-4",children:t.jsxs("label",{className:"flex items-center gap-3",children:[t.jsx("input",{type:"checkbox",checked:xe,onChange:C=>Re(C.target.checked),className:"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500"}),t.jsxs("div",{children:[t.jsx("div",{className:"font-medium text-orange-900 dark:text-orange-100",children:"Skip permission prompts (use with caution)"}),t.jsx("div",{className:"text-sm text-orange-700 dark:text-orange-300",children:"Equivalent to -f flag in Cursor CLI"})]})]})})]}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(Jn,{className:"w-5 h-5 text-purple-500"}),t.jsx("h3",{className:"text-lg font-medium text-foreground",children:"Authentication"})]}),t.jsx("div",{className:"bg-purple-50 dark:bg-purple-900/20 border border-purple-200 dark:border-purple-800 rounded-lg p-4",children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{children:[t.jsx("div",{className:"font-medium text-purple-900 dark:text-purple-100",children:"Cursor CLI Login"}),t.jsx("div",{className:"text-sm text-purple-700 dark:text-purple-300",children:"Sign in to your Cursor account to enable AI features"})]}),t.jsxs(Me,{onClick:Ot,className:"bg-purple-600 hover:bg-purple-700 text-white",size:"sm",children:[t.jsx(Jn,{className:"w-4 h-4 mr-2"}),"Login"]})]})})]}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx($s,{className:"w-5 h-5 text-green-500"}),t.jsx("h3",{className:"text-lg font-medium text-foreground",children:"Allowed Shell Commands"})]}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Shell commands that are automatically allowed without prompting for permission"}),t.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[t.jsx(wt,{value:pe,onChange:C=>Ue(C.target.value),placeholder:'e.g., "Shell(ls)" or "Shell(git status)"',onKeyPress:C=>{C.key==="Enter"&&pe&&!ke.includes(pe)&&(Ve([...ke,pe]),Ue(""))},className:"flex-1 h-10 touch-manipulation",style:{fontSize:"16px"}}),t.jsxs(Me,{onClick:()=>{pe&&!ke.includes(pe)&&(Ve([...ke,pe]),Ue(""))},disabled:!pe,size:"sm",className:"h-10 px-4 touch-manipulation",children:[t.jsx(Ct,{className:"w-4 h-4 mr-2 sm:mr-0"}),t.jsx("span",{className:"sm:hidden",children:"Add Command"})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("p",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"Quick add common commands:"}),t.jsx("div",{className:"grid grid-cols-2 sm:flex sm:flex-wrap gap-2",children:Le.map(C=>t.jsx(Me,{variant:"outline",size:"sm",onClick:()=>{ke.includes(C)||Ve([...ke,C])},disabled:ke.includes(C),className:"text-xs h-8 touch-manipulation truncate",children:C},C))})]}),t.jsxs("div",{className:"space-y-2",children:[ke.map(C=>t.jsxs("div",{className:"flex items-center justify-between bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-800 rounded-lg p-3",children:[t.jsx("span",{className:"font-mono text-sm text-green-800 dark:text-green-200",children:C}),t.jsx(Me,{variant:"ghost",size:"sm",onClick:()=>Ve(ke.filter(X=>X!==C)),className:"text-green-600 hover:text-green-700 dark:text-green-400 dark:hover:text-green-300",children:t.jsx(ot,{className:"w-4 h-4"})})]},C)),ke.length===0&&t.jsx("div",{className:"text-center py-8 text-gray-500 dark:text-gray-400",children:"No allowed shell commands configured"})]})]}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx($s,{className:"w-5 h-5 text-red-500"}),t.jsx("h3",{className:"text-lg font-medium text-foreground",children:"Disallowed Shell Commands"})]}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Shell commands that should always be denied"}),t.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[t.jsx(wt,{value:mt,onChange:C=>Ie(C.target.value),placeholder:'e.g., "Shell(rm -rf)" or "Shell(sudo)"',onKeyPress:C=>{C.key==="Enter"&&mt&&!Ke.includes(mt)&&(rt([...Ke,mt]),Ie(""))},className:"flex-1 h-10 touch-manipulation",style:{fontSize:"16px"}}),t.jsxs(Me,{onClick:()=>{mt&&!Ke.includes(mt)&&(rt([...Ke,mt]),Ie(""))},disabled:!mt,size:"sm",className:"h-10 px-4 touch-manipulation",children:[t.jsx(Ct,{className:"w-4 h-4 mr-2 sm:mr-0"}),t.jsx("span",{className:"sm:hidden",children:"Add Command"})]})]}),t.jsxs("div",{className:"space-y-2",children:[Ke.map(C=>t.jsxs("div",{className:"flex items-center justify-between bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg p-3",children:[t.jsx("span",{className:"font-mono text-sm text-red-800 dark:text-red-200",children:C}),t.jsx(Me,{variant:"ghost",size:"sm",onClick:()=>rt(Ke.filter(X=>X!==C)),className:"text-red-600 hover:text-red-700 dark:text-red-400 dark:hover:text-red-300",children:t.jsx(ot,{className:"w-4 h-4"})})]},C)),Ke.length===0&&t.jsx("div",{className:"text-center py-8 text-gray-500 dark:text-gray-400",children:"No disallowed shell commands configured"})]})]}),t.jsxs("div",{className:"bg-purple-50 dark:bg-purple-900/20 border border-purple-200 dark:border-purple-800 rounded-lg p-4",children:[t.jsx("h4",{className:"font-medium text-purple-900 dark:text-purple-100 mb-2",children:"Cursor Shell Command Examples:"}),t.jsxs("ul",{className:"text-sm text-purple-800 dark:text-purple-200 space-y-1",children:[t.jsxs("li",{children:[t.jsx("code",{className:"bg-purple-100 dark:bg-purple-800 px-1 rounded",children:'"Shell(ls)"'})," - Allow ls command"]}),t.jsxs("li",{children:[t.jsx("code",{className:"bg-purple-100 dark:bg-purple-800 px-1 rounded",children:'"Shell(git status)"'})," - Allow git status command"]}),t.jsxs("li",{children:[t.jsx("code",{className:"bg-purple-100 dark:bg-purple-800 px-1 rounded",children:'"Shell(mkdir)"'})," - Allow mkdir command"]}),t.jsxs("li",{children:[t.jsx("code",{className:"bg-purple-100 dark:bg-purple-800 px-1 rounded",children:'"-f"'})," flag - Skip all permission prompts (dangerous)"]})]})]})]})]}),ne==="tasks"&&t.jsx("div",{className:"space-y-6 md:space-y-8",children:m?t.jsx("div",{className:"bg-gray-50 dark:bg-gray-900/50 border border-gray-200 dark:border-gray-700 rounded-lg p-4",children:t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:"animate-spin w-5 h-5 border-2 border-blue-600 border-t-transparent rounded-full"}),t.jsx("span",{className:"text-sm text-muted-foreground",children:"Checking TaskMaster installation..."})]})}):t.jsxs(t.Fragment,{children:[!l&&t.jsx("div",{className:"bg-orange-50 dark:bg-orange-950/50 border border-orange-200 dark:border-orange-800 rounded-lg p-4",children:t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx("div",{className:"w-8 h-8 bg-orange-100 dark:bg-orange-900 rounded-full flex items-center justify-center flex-shrink-0 mt-0.5",children:t.jsx("svg",{className:"w-4 h-4 text-orange-600 dark:text-orange-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z"})})}),t.jsxs("div",{className:"flex-1",children:[t.jsx("div",{className:"font-medium text-orange-900 dark:text-orange-100 mb-2",children:"TaskMaster AI CLI Not Installed"}),t.jsxs("div",{className:"text-sm text-orange-800 dark:text-orange-200 space-y-3",children:[t.jsx("p",{children:"TaskMaster CLI is required to use task management features. Install it to get started:"}),t.jsxs("div",{className:"bg-orange-100 dark:bg-orange-900/50 rounded-lg p-3 font-mono text-sm",children:[t.jsx("code",{children:"npm install -g task-master-ai"}),t.jsxs("a",{href:"https://github.com/eyaltoledano/claude-task-master",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 font-medium",children:[t.jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",children:t.jsx("path",{fillRule:"evenodd",d:"M10 0C4.477 0 0 4.484 0 10.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0110 4.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.203 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.942.359.31.678.921.678 1.856 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0020 10.017C20 4.484 15.522 0 10 0z",clipRule:"evenodd"})}),"View on GitHub",t.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("p",{className:"font-medium",children:"After installation:"}),t.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-xs",children:[t.jsx("li",{children:"Restart this application"}),t.jsx("li",{children:"TaskMaster features will automatically become available"}),t.jsxs("li",{children:["Use ",t.jsx("code",{className:"bg-orange-100 dark:bg-orange-800 px-1 rounded",children:"task-master init"})," in your project directory"]})]})]})]})]})]})}),t.jsxs("div",{className:"space-y-4",children:[t.jsx("div",{className:"bg-gray-50 dark:bg-gray-900/50 border border-gray-200 dark:border-gray-700 rounded-lg p-4",children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{children:[t.jsx("div",{className:"font-medium text-foreground",children:"Enable TaskMaster Integration"}),t.jsx("div",{className:"text-sm text-muted-foreground mt-1",children:"Show TaskMaster tasks, banners, and sidebar indicators across the interface"}),!l&&t.jsx("div",{className:"text-xs text-orange-600 dark:text-orange-400 mt-1",children:"TaskMaster CLI must be installed first"})]}),t.jsxs("label",{className:"relative inline-flex items-center cursor-pointer",children:[t.jsx("input",{type:"checkbox",checked:i,onChange:C=>o(C.target.checked),disabled:!l,className:"sr-only peer"}),t.jsx("div",{className:`w-11 h-6 ${l?"bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-blue-300 dark:peer-focus:ring-blue-800":"bg-gray-300 dark:bg-gray-600"} rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-blue-600`})]})]})}),t.jsx("div",{className:"bg-blue-50 dark:bg-blue-950/50 border border-blue-200 dark:border-blue-800 rounded-lg p-4",children:t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx("div",{className:"w-8 h-8 bg-blue-100 dark:bg-blue-900 rounded-full flex items-center justify-center flex-shrink-0 mt-0.5",children:t.jsx(ya,{className:"w-4 h-4 text-blue-600 dark:text-blue-400"})}),t.jsxs("div",{children:[t.jsx("div",{className:"font-medium text-blue-900 dark:text-blue-100 mb-2",children:"🎯 About TaskMaster AI"}),t.jsxs("div",{className:"text-sm text-blue-800 dark:text-blue-200 space-y-2",children:[t.jsxs("p",{children:[t.jsx("strong",{children:"AI-Powered Task Management:"})," Break complex projects into manageable subtasks with AI assistance"]}),t.jsxs("p",{children:[t.jsx("strong",{children:"PRD:"})," Generate structured tasks from Product Requirements Documents"]}),t.jsxs("p",{children:[t.jsx("strong",{children:"Dependency Tracking:"})," Understand task relationships and execution order"]}),t.jsxs("p",{children:[t.jsx("strong",{children:"Progress Visualization:"})," Kanban boards, and detailed task views"]})]})]}),t.jsx("div",{className:"mt-4 pt-4 border-t border-blue-200 dark:border-blue-700",children:t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx("div",{className:"w-6 h-6 bg-blue-100 dark:bg-blue-800 rounded-full flex items-center justify-center flex-shrink-0 mt-0.5",children:t.jsx("svg",{className:"w-3 h-3 text-blue-600 dark:text-blue-400",fill:"currentColor",viewBox:"0 0 20 20",children:t.jsx("path",{fillRule:"evenodd",d:"M12.586 4.586a2 2 0 112.828 2.828l-3 3a2 2 0 01-2.828 0 1 1 0 00-1.414 1.414 4 4 0 005.656 0l3-3a4 4 0 00-5.656-5.656l-1.5 1.5a1 1 0 101.414 1.414l1.5-1.5zm-5 5a2 2 0 012.828 0 1 1 0 101.414-1.414 4 4 0 00-5.656 0l-3 3a4 4 0 105.656 5.656l1.5-1.5a1 1 0 10-1.414-1.414l-1.5 1.5a2 2 0 11-2.828-2.828l3-3z",clipRule:"evenodd"})})}),t.jsxs("div",{className:"flex-1",children:[t.jsx("div",{className:"font-medium text-blue-900 dark:text-blue-100 mb-2",children:"📚 Learn More & Tutorial"}),t.jsxs("div",{className:"text-sm text-blue-800 dark:text-blue-200 space-y-2",children:[t.jsxs("p",{children:["TaskMaster AI (aka ",t.jsx("strong",{children:"claude-task-master"})," ) is an advanced AI-powered task management system built for developers."]}),t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("a",{href:"https://github.com/eyaltoledano/claude-task-master",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 font-medium",children:[t.jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",children:t.jsx("path",{fillRule:"evenodd",d:"M10 0C4.477 0 0 4.484 0 10.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0110 4.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.203 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.942.359.31.678.921.678 1.856 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0020 10.017C20 4.484 15.522 0 10 0z",clipRule:"evenodd"})}),"View on GitHub",t.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})]}),t.jsx("p",{className:"text-xs text-blue-700 dark:text-blue-300",children:"Find documentation, setup guides, and examples for advanced TaskMaster workflows"})]})]})]})]})})]})})]})]})}),ne==="api"&&t.jsx("div",{className:"space-y-6 md:space-y-8",children:t.jsx(c1,{})})]})]}),t.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between p-4 md:p-6 border-t border-border flex-shrink-0 gap-3 pb-safe-area-inset-bottom",children:[t.jsxs("div",{className:"flex items-center justify-center sm:justify-start gap-2 order-2 sm:order-1",children:[B==="success"&&t.jsxs("div",{className:"text-green-600 dark:text-green-400 text-sm flex items-center gap-1",children:[t.jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",children:t.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})}),"Settings saved successfully!"]}),B==="error"&&t.jsxs("div",{className:"text-red-600 dark:text-red-400 text-sm flex items-center gap-1",children:[t.jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",children:t.jsx("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z",clipRule:"evenodd"})}),"Failed to save settings"]})]}),t.jsxs("div",{className:"flex items-center gap-3 order-1 sm:order-2",children:[t.jsx(Me,{variant:"outline",onClick:r,disabled:U,className:"flex-1 sm:flex-none h-10 touch-manipulation",children:"Cancel"}),t.jsx(Me,{onClick:Lt,disabled:U,className:"flex-1 sm:flex-none h-10 bg-blue-600 hover:bg-blue-700 disabled:opacity-50 touch-manipulation",children:U?t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"w-4 h-4 animate-spin rounded-full border-2 border-white border-t-transparent"}),"Saving..."]}):"Save Settings"})]})]})]}),ue&&t.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 max-md:items-stretch max-md:justify-stretch",children:t.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-xl w-full max-w-4xl h-3/4 flex flex-col md:max-w-4xl md:h-3/4 md:rounded-lg md:m-4 max-md:max-w-none max-md:h-full max-md:rounded-none max-md:m-0",children:[t.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-gray-200 dark:border-gray-700",children:[t.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:F==="claude"?"Claude CLI Login":"Cursor CLI Login"}),t.jsx("button",{onClick:()=>S(!1),className:"text-gray-400 hover:text-gray-600 dark:hover:text-gray-300",children:t.jsx(ot,{className:"w-6 h-6"})})]}),t.jsx("div",{className:"flex-1 overflow-hidden",children:t.jsx(au,{project:se,command:F==="claude"?"claude /login":"cursor-agent login",onComplete:Bt,showHeader:!1})})]})})]}):null}function u1(){const{isDarkMode:e,toggleDarkMode:r}=Ci();return t.jsxs("button",{onClick:r,className:"relative inline-flex h-8 w-14 items-center rounded-full bg-gray-200 dark:bg-gray-700 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 dark:focus:ring-offset-gray-900",role:"switch","aria-checked":e,"aria-label":"Toggle dark mode",children:[t.jsx("span",{className:"sr-only",children:"Toggle dark mode"}),t.jsx("span",{className:`${e?"translate-x-7":"translate-x-1"} inline-block h-6 w-6 transform rounded-full bg-white shadow-lg transition-transform duration-200 flex items-center justify-center`,children:e?t.jsx("svg",{className:"w-3.5 h-3.5 text-gray-700",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z"})}):t.jsx("svg",{className:"w-3.5 h-3.5 text-yellow-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z"})})})]})}const m1=({isOpen:e,onToggle:r,autoExpandTools:n,onAutoExpandChange:s,showRawParameters:a,onShowRawParametersChange:i,showThinking:o,onShowThinkingChange:l,autoScrollToBottom:c,onAutoScrollChange:d,sendByCtrlEnter:m,onSendByCtrlEnterChange:u,isMobile:h})=>{const[p,g]=f.useState(e),[x,b]=f.useState(()=>localStorage.getItem("whisperMode")||"default"),{isDarkMode:k}=Ci();f.useEffect(()=>{g(e)},[e]);const N=()=>{const y=!p;g(y),r(y)};return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:`fixed ${h?"bottom-44":"top-1/2 -translate-y-1/2"} ${p?"right-64":"right-0"} z-50 transition-all duration-150 ease-out`,children:t.jsx("button",{onClick:N,className:"bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-l-md p-2 hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors shadow-lg","aria-label":p?"Close settings panel":"Open settings panel",children:p?t.jsx(kr,{className:"h-5 w-5 text-gray-600 dark:text-gray-400"}):t.jsx(ep,{className:"h-5 w-5 text-gray-600 dark:text-gray-400"})})}),t.jsx("div",{className:`fixed top-0 right-0 h-full w-64 bg-white dark:bg-gray-900 border-l border-gray-200 dark:border-gray-700 shadow-xl transform transition-transform duration-150 ease-out z-40 ${p?"translate-x-0":"translate-x-full"} ${h?"h-screen":""}`,children:t.jsxs("div",{className:"h-full flex flex-col",children:[t.jsx("div",{className:"p-4 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900",children:t.jsxs("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white flex items-center gap-2",children:[t.jsx(ph,{className:"h-5 w-5 text-gray-600 dark:text-gray-400"}),"Quick Settings"]})}),t.jsxs("div",{className:`flex-1 overflow-y-auto overflow-x-hidden p-4 space-y-6 bg-white dark:bg-gray-900 ${h?"pb-20":""}`,children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wider text-gray-500 dark:text-gray-400 mb-2",children:"Appearance"}),t.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg bg-gray-50 dark:bg-gray-800 hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors border border-transparent hover:border-gray-300 dark:hover:border-gray-600",children:[t.jsxs("span",{className:"flex items-center gap-2 text-sm text-gray-900 dark:text-white",children:[k?t.jsx(ac,{className:"h-4 w-4 text-gray-600 dark:text-gray-400"}):t.jsx(oc,{className:"h-4 w-4 text-gray-600 dark:text-gray-400"}),"Dark Mode"]}),t.jsx(u1,{})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wider text-gray-500 dark:text-gray-400 mb-2",children:"Tool Display"}),t.jsxs("label",{className:"flex items-center justify-between p-3 rounded-lg bg-gray-50 dark:bg-gray-800 hover:bg-gray-100 dark:hover:bg-gray-700 cursor-pointer transition-colors border border-transparent hover:border-gray-300 dark:hover:border-gray-600",children:[t.jsxs("span",{className:"flex items-center gap-2 text-sm text-gray-900 dark:text-white",children:[t.jsx(Xa,{className:"h-4 w-4 text-gray-600 dark:text-gray-400"}),"Auto-expand tools"]}),t.jsx("input",{type:"checkbox",checked:n,onChange:y=>s(y.target.checked),className:"h-4 w-4 rounded border-gray-300 dark:border-gray-600 text-blue-600 dark:text-blue-500 focus:ring-blue-500 dark:focus:ring-blue-400 dark:bg-gray-800 dark:checked:bg-blue-600"})]}),t.jsxs("label",{className:"flex items-center justify-between p-3 rounded-lg bg-gray-50 dark:bg-gray-800 hover:bg-gray-100 dark:hover:bg-gray-700 cursor-pointer transition-colors border border-transparent hover:border-gray-300 dark:hover:border-gray-600",children:[t.jsxs("span",{className:"flex items-center gap-2 text-sm text-gray-900 dark:text-white",children:[t.jsx(an,{className:"h-4 w-4 text-gray-600 dark:text-gray-400"}),"Show raw parameters"]}),t.jsx("input",{type:"checkbox",checked:a,onChange:y=>i(y.target.checked),className:"h-4 w-4 rounded border-gray-300 dark:border-gray-600 text-blue-600 dark:text-blue-500 focus:ring-blue-500 dark:focus:ring-blue-400 dark:bg-gray-800 dark:checked:bg-blue-600"})]}),t.jsxs("label",{className:"flex items-center justify-between p-3 rounded-lg bg-gray-50 dark:bg-gray-800 hover:bg-gray-100 dark:hover:bg-gray-700 cursor-pointer transition-colors border border-transparent hover:border-gray-300 dark:hover:border-gray-600",children:[t.jsxs("span",{className:"flex items-center gap-2 text-sm text-gray-900 dark:text-white",children:[t.jsx(Zl,{className:"h-4 w-4 text-gray-600 dark:text-gray-400"}),"Show thinking"]}),t.jsx("input",{type:"checkbox",checked:o,onChange:y=>l(y.target.checked),className:"h-4 w-4 rounded border-gray-300 dark:border-gray-600 text-blue-600 dark:text-blue-500 focus:ring-blue-500 dark:focus:ring-blue-400 dark:bg-gray-800 dark:checked:bg-blue-600"})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wider text-gray-500 dark:text-gray-400 mb-2",children:"View Options"}),t.jsxs("label",{className:"flex items-center justify-between p-3 rounded-lg bg-gray-50 dark:bg-gray-800 hover:bg-gray-100 dark:hover:bg-gray-700 cursor-pointer transition-colors border border-transparent hover:border-gray-300 dark:hover:border-gray-600",children:[t.jsxs("span",{className:"flex items-center gap-2 text-sm text-gray-900 dark:text-white",children:[t.jsx(Xl,{className:"h-4 w-4 text-gray-600 dark:text-gray-400"}),"Auto-scroll to bottom"]}),t.jsx("input",{type:"checkbox",checked:c,onChange:y=>d(y.target.checked),className:"h-4 w-4 rounded border-gray-300 dark:border-gray-600 text-blue-600 dark:text-blue-500 focus:ring-blue-500 dark:focus:ring-blue-400 dark:bg-gray-800 dark:checked:bg-blue-600"})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wider text-gray-500 dark:text-gray-400 mb-2",children:"Input Settings"}),t.jsxs("label",{className:"flex items-center justify-between p-3 rounded-lg bg-gray-50 dark:bg-gray-800 hover:bg-gray-100 dark:hover:bg-gray-700 cursor-pointer transition-colors border border-transparent hover:border-gray-300 dark:hover:border-gray-600",children:[t.jsxs("span",{className:"flex items-center gap-2 text-sm text-gray-900 dark:text-white",children:[t.jsx(Wp,{className:"h-4 w-4 text-gray-600 dark:text-gray-400"}),"Send by Ctrl+Enter"]}),t.jsx("input",{type:"checkbox",checked:m,onChange:y=>u(y.target.checked),className:"h-4 w-4 rounded border-gray-300 dark:border-gray-600 text-blue-600 dark:text-blue-500 focus:ring-blue-500 dark:focus:ring-blue-400 dark:bg-gray-800 dark:checked:bg-blue-600"})]}),t.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 ml-3",children:"When enabled, pressing Ctrl+Enter will send the message instead of just Enter. This is useful for IME users to avoid accidental sends."})]}),t.jsxs("div",{className:"space-y-2",style:{display:"none"},children:[t.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wider text-gray-500 dark:text-gray-400 mb-2",children:"Whisper Dictation"}),t.jsxs("div",{className:"space-y-2",children:[t.jsxs("label",{className:"flex items-start p-3 rounded-lg bg-gray-50 dark:bg-gray-800 hover:bg-gray-100 dark:hover:bg-gray-700 cursor-pointer transition-colors border border-transparent hover:border-gray-300 dark:hover:border-gray-600",children:[t.jsx("input",{type:"radio",name:"whisperMode",value:"default",checked:x==="default",onChange:()=>{b("default"),localStorage.setItem("whisperMode","default"),window.dispatchEvent(new Event("whisperModeChanged"))},className:"mt-0.5 h-4 w-4 border-gray-300 dark:border-gray-600 text-blue-600 dark:text-blue-500 focus:ring-blue-500 dark:focus:ring-blue-400 dark:bg-gray-800 dark:checked:bg-blue-600"}),t.jsxs("div",{className:"ml-3 flex-1",children:[t.jsxs("span",{className:"flex items-center gap-2 text-sm font-medium text-gray-900 dark:text-white",children:[t.jsx(as,{className:"h-4 w-4 text-gray-600 dark:text-gray-400"}),"Default Mode"]}),t.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1",children:"Direct transcription of your speech"})]})]}),t.jsxs("label",{className:"flex items-start p-3 rounded-lg bg-gray-50 dark:bg-gray-800 hover:bg-gray-100 dark:hover:bg-gray-700 cursor-pointer transition-colors border border-transparent hover:border-gray-300 dark:hover:border-gray-600",children:[t.jsx("input",{type:"radio",name:"whisperMode",value:"prompt",checked:x==="prompt",onChange:()=>{b("prompt"),localStorage.setItem("whisperMode","prompt"),window.dispatchEvent(new Event("whisperModeChanged"))},className:"mt-0.5 h-4 w-4 border-gray-300 dark:border-gray-600 text-blue-600 dark:text-blue-500 focus:ring-blue-500 dark:focus:ring-blue-400 dark:bg-gray-800 dark:checked:bg-blue-600"}),t.jsxs("div",{className:"ml-3 flex-1",children:[t.jsxs("span",{className:"flex items-center gap-2 text-sm font-medium text-gray-900 dark:text-white",children:[t.jsx(Pr,{className:"h-4 w-4 text-gray-600 dark:text-gray-400"}),"Prompt Enhancement"]}),t.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1",children:"Transform rough ideas into clear, detailed AI prompts"})]})]}),t.jsxs("label",{className:"flex items-start p-3 rounded-lg bg-gray-50 dark:bg-gray-800 hover:bg-gray-100 dark:hover:bg-gray-700 cursor-pointer transition-colors border border-transparent hover:border-gray-300 dark:hover:border-gray-600",children:[t.jsx("input",{type:"radio",name:"whisperMode",value:"vibe",checked:x==="vibe"||x==="instructions"||x==="architect",onChange:()=>{b("vibe"),localStorage.setItem("whisperMode","vibe"),window.dispatchEvent(new Event("whisperModeChanged"))},className:"mt-0.5 h-4 w-4 border-gray-300 dark:border-gray-600 text-blue-600 dark:text-blue-500 focus:ring-blue-500 dark:focus:ring-blue-400 dark:bg-gray-800 dark:checked:bg-blue-600"}),t.jsxs("div",{className:"ml-3 flex-1",children:[t.jsxs("span",{className:"flex items-center gap-2 text-sm font-medium text-gray-900 dark:text-white",children:[t.jsx(Tt,{className:"h-4 w-4 text-gray-600 dark:text-gray-400"}),"Vibe Mode"]}),t.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1",children:"Format ideas as clear agent instructions with details"})]})]})]})]})]})]})}),p&&t.jsx("div",{className:"fixed inset-0 bg-background/80 backdrop-blur-sm z-30 transition-opacity duration-150 ease-out",onClick:N})]})},p1=()=>{const[e,r]=f.useState(""),[n,s]=f.useState(""),[a,i]=f.useState(""),[o,l]=f.useState(!1),[c,d]=f.useState(""),{register:m}=ws(),u=async h=>{if(h.preventDefault(),d(""),n!==a){d("Passwords do not match");return}if(e.length<3){d("Username must be at least 3 characters long");return}if(n.length<6){d("Password must be at least 6 characters long");return}l(!0);const p=await m(e,n);p.success||d(p.error),l(!1)};return t.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-4",children:t.jsx("div",{className:"w-full max-w-md",children:t.jsxs("div",{className:"bg-card rounded-lg shadow-lg border border-border p-8 space-y-6",children:[t.jsxs("div",{className:"text-center",children:[t.jsx("div",{className:"flex justify-center mb-4",children:t.jsx(Zt,{size:64})}),t.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"Welcome to Claude Code UI"}),t.jsx("p",{className:"text-muted-foreground mt-2",children:"Set up your account to get started"})]}),t.jsxs("form",{onSubmit:u,className:"space-y-4",children:[t.jsxs("div",{children:[t.jsx("label",{htmlFor:"username",className:"block text-sm font-medium text-foreground mb-1",children:"Username"}),t.jsx("input",{type:"text",id:"username",value:e,onChange:h=>r(h.target.value),className:"w-full px-3 py-2 border border-border rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"Enter your username",required:!0,disabled:o})]}),t.jsxs("div",{children:[t.jsx("label",{htmlFor:"password",className:"block text-sm font-medium text-foreground mb-1",children:"Password"}),t.jsx("input",{type:"password",id:"password",value:n,onChange:h=>s(h.target.value),className:"w-full px-3 py-2 border border-border rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"Enter your password",required:!0,disabled:o})]}),t.jsxs("div",{children:[t.jsx("label",{htmlFor:"confirmPassword",className:"block text-sm font-medium text-foreground mb-1",children:"Confirm Password"}),t.jsx("input",{type:"password",id:"confirmPassword",value:a,onChange:h=>i(h.target.value),className:"w-full px-3 py-2 border border-border rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"Confirm your password",required:!0,disabled:o})]}),c&&t.jsx("div",{className:"p-3 bg-red-100 dark:bg-red-900/20 border border-red-300 dark:border-red-800 rounded-md",children:t.jsx("p",{className:"text-sm text-red-700 dark:text-red-400",children:c})}),t.jsx("button",{type:"submit",disabled:o,className:"w-full bg-blue-600 hover:bg-blue-700 disabled:bg-blue-400 text-white font-medium py-2 px-4 rounded-md transition-colors duration-200",children:o?"Setting up...":"Create Account"})]}),t.jsx("div",{className:"text-center",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"This is a single-user system. Only one account can be created."})})]})})})},h1=()=>{const[e,r]=f.useState(""),[n,s]=f.useState(""),[a,i]=f.useState(!1),[o,l]=f.useState(""),{login:c}=ws(),d=async m=>{if(m.preventDefault(),l(""),!e||!n){l("Please enter both username and password");return}i(!0);const u=await c(e,n);u.success||l(u.error),i(!1)};return t.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-4",children:t.jsx("div",{className:"w-full max-w-md",children:t.jsxs("div",{className:"bg-card rounded-lg shadow-lg border border-border p-8 space-y-6",children:[t.jsxs("div",{className:"text-center",children:[t.jsx("div",{className:"flex justify-center mb-4",children:t.jsx("div",{className:"w-16 h-16 bg-primary rounded-lg flex items-center justify-center shadow-sm",children:t.jsx(An,{className:"w-8 h-8 text-primary-foreground"})})}),t.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"Welcome Back"}),t.jsx("p",{className:"text-muted-foreground mt-2",children:"Sign in to your Claude Code UI account"})]}),t.jsxs("form",{onSubmit:d,className:"space-y-4",children:[t.jsxs("div",{children:[t.jsx("label",{htmlFor:"username",className:"block text-sm font-medium text-foreground mb-1",children:"Username"}),t.jsx("input",{type:"text",id:"username",value:e,onChange:m=>r(m.target.value),className:"w-full px-3 py-2 border border-border rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"Enter your username",required:!0,disabled:a})]}),t.jsxs("div",{children:[t.jsx("label",{htmlFor:"password",className:"block text-sm font-medium text-foreground mb-1",children:"Password"}),t.jsx("input",{type:"password",id:"password",value:n,onChange:m=>s(m.target.value),className:"w-full px-3 py-2 border border-border rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"Enter your password",required:!0,disabled:a})]}),o&&t.jsx("div",{className:"p-3 bg-red-100 dark:bg-red-900/20 border border-red-300 dark:border-red-800 rounded-md",children:t.jsx("p",{className:"text-sm text-red-700 dark:text-red-400",children:o})}),t.jsx("button",{type:"submit",disabled:a,className:"w-full bg-blue-600 hover:bg-blue-700 disabled:bg-blue-400 text-white font-medium py-2 px-4 rounded-md transition-colors duration-200",children:a?"Signing in...":"Sign In"})]}),t.jsx("div",{className:"text-center",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"Enter your credentials to access Claude Code UI"})})]})})})},f1=()=>t.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-4",children:t.jsxs("div",{className:"text-center",children:[t.jsx("div",{className:"flex justify-center mb-4",children:t.jsx("div",{className:"w-16 h-16 bg-primary rounded-lg flex items-center justify-center shadow-sm",children:t.jsx(An,{className:"w-8 h-8 text-primary-foreground"})})}),t.jsx("h1",{className:"text-2xl font-bold text-foreground mb-2",children:"Claude Code UI"}),t.jsxs("div",{className:"flex items-center justify-center space-x-2",children:[t.jsx("div",{className:"w-2 h-2 bg-blue-500 rounded-full animate-bounce"}),t.jsx("div",{className:"w-2 h-2 bg-blue-500 rounded-full animate-bounce",style:{animationDelay:"0.1s"}}),t.jsx("div",{className:"w-2 h-2 bg-blue-500 rounded-full animate-bounce",style:{animationDelay:"0.2s"}})]}),t.jsx("p",{className:"text-muted-foreground mt-2",children:"Loading..."})]})}),g1=({children:e})=>{const{user:r,isLoading:n,needsSetup:s}=ws();return n?t.jsx(f1,{}):s?t.jsx(p1,{}):r?e:t.jsx(h1,{})},Al="1.10.2",x1=(e,r)=>{const[n,s]=f.useState(!1),[a,i]=f.useState(null);return f.useEffect(()=>{const o=async()=>{try{const d=await(await fetch(`https://api.github.com/repos/${e}/${r}/releases/latest`)).json();if(d.tag_name){const m=d.tag_name.replace(/^v/,"");i(m),s(Al!==m)}else s(!1),i(null)}catch(c){console.error("Version check failed:",c),s(!1),i(null)}};o();const l=setInterval(o,300*1e3);return()=>clearInterval(l)},[e,r]),{updateAvailable:n,latestVersion:a,currentVersion:Al}};function kn(e,r){const[n,s]=f.useState(()=>{if(typeof window>"u")return r;try{const i=window.localStorage.getItem(e);return i?JSON.parse(i):r}catch(i){return console.log(i),r}});return[n,i=>{if(!(typeof window>"u"))try{const o=i instanceof Function?i(n):i;window.localStorage.setItem(e,JSON.stringify(o)),s(o)}catch(o){console.log(o)}}]}function Ml(){const e=Ku(),{sessionId:r}=Ju(),{updateAvailable:n,latestVersion:s,currentVersion:a}=x1("siteboon","claudecodeui"),[i,o]=f.useState(!1),[l,c]=f.useState([]),[d,m]=f.useState(null),[u,h]=f.useState(null),[p,g]=f.useState("chat"),[x,b]=f.useState(!1),[k,N]=f.useState(!1),[y,_]=f.useState(!0),[U,D]=f.useState(!1),[B,L]=f.useState(!1),[H,j]=f.useState(!1),[P,M]=kn("autoExpandTools",!1),[R,w]=kn("showRawParameters",!1),[W,O]=kn("showThinking",!0),[$,G]=kn("autoScrollToBottom",!0),[ce,I]=kn("sendByCtrlEnter",!1),[je,We]=f.useState(new Set),[v,te]=f.useState(new Set),[me,Ne]=f.useState(0),{ws:ne,sendMessage:Oe,messages:ee}=dc(),[oe,he]=f.useState(!1);f.useEffect(()=>{const S=()=>{const F=window.matchMedia("(display-mode: standalone)").matches||window.navigator.standalone||document.referrer.includes("android-app://");he(F),F?(document.documentElement.classList.add("pwa-mode"),document.body.classList.add("pwa-mode")):(document.documentElement.classList.remove("pwa-mode"),document.body.classList.remove("pwa-mode"))};return S(),window.matchMedia("(display-mode: standalone)").addEventListener("change",S),()=>{window.matchMedia("(display-mode: standalone)").removeEventListener("change",S)}},[]),f.useEffect(()=>{const S=()=>{b(window.innerWidth<768)};return S(),window.addEventListener("resize",S),()=>window.removeEventListener("resize",S)},[]),f.useEffect(()=>{ke()},[]);const Ce=(S,F,K,se)=>{if(!K||!se)return!0;const le=S?.find(tt=>tt.name===K.name),ze=F?.find(tt=>tt.name===K.name);if(!le||!ze)return!1;const Le=le.sessions?.find(tt=>tt.id===se.id),Je=ze.sessions?.find(tt=>tt.id===se.id);return!Le||!Je?!1:Le.id===Je.id&&Le.title===Je.title&&Le.created_at===Je.created_at&&Le.updated_at===Je.updated_at};f.useEffect(()=>{if(ee.length>0){const S=ee[ee.length-1];if(S.type==="projects_updated"){if(S.changedFile&&u&&d){const se=S.changedFile.split("/");se.length>=2&&se[se.length-1].replace(".jsonl","")===u.id&&(je.has(u.id)||Ne(Je=>Je+1))}if(u&&je.has(u.id)||je.size>0&&Array.from(je).some(se=>se.startsWith("new-session-"))){const se=S.projects;if(!Ce(l,se,d,u))return}const K=S.projects;if(c(K),d){const se=K.find(le=>le.name===d.name);se&&(JSON.stringify(se)!==JSON.stringify(d)&&m(se),u&&(se.sessions?.find(ze=>ze.id===u.id)||h(null)))}}}},[ee,d,u,je]);const ke=async()=>{try{_(!0);const F=await(await Fe.projects()).json();for(let K of F)try{const se=`/api/cursor/sessions?projectPath=${encodeURIComponent(K.fullPath||K.path)}`,le=await De(se);if(le.ok){const ze=await le.json();ze.success&&ze.sessions?K.cursorSessions=ze.sessions:K.cursorSessions=[]}else K.cursorSessions=[]}catch(se){console.error(`Error fetching Cursor sessions for project ${K.name}:`,se),K.cursorSessions=[]}c(K=>K.length===0||F.some((le,ze)=>{const Le=K[ze];return Le?le.name!==Le.name||le.displayName!==Le.displayName||le.fullPath!==Le.fullPath||JSON.stringify(le.sessionMeta)!==JSON.stringify(Le.sessionMeta)||JSON.stringify(le.sessions)!==JSON.stringify(Le.sessions)||JSON.stringify(le.cursorSessions)!==JSON.stringify(Le.cursorSessions):!0})||F.length!==K.length?F:K)}catch(S){console.error("Error fetching projects:",S)}finally{_(!1)}};window.refreshProjects=ke,f.useEffect(()=>{if(r&&l.length>0){const S=!u||u.id!==r;for(const F of l){let K=F.sessions?.find(le=>le.id===r);if(K){m(F),h({...K,__provider:"claude"}),S&&g("chat");return}const se=F.cursorSessions?.find(le=>le.id===r);if(se){m(F),h({...se,__provider:"cursor"}),S&&g("chat");return}}}},[r,l,e]);const Ve=S=>{m(S),h(null),e("/"),x&&N(!1)},Ke=S=>{if(h(S),p!=="git"&&p!=="preview"&&g("chat"),(localStorage.getItem("selected-provider")||"claude")==="cursor"&&sessionStorage.setItem("cursorSessionId",S.id),x){const K=S.__projectName,se=d?.name;K!==se&&N(!1)}e(`/session/${S.id}`)},rt=S=>{m(S),h(null),g("chat"),e("/"),x&&N(!1)},xe=S=>{u?.id===S&&(h(null),e("/")),c(F=>F.map(K=>({...K,sessions:K.sessions?.filter(se=>se.id!==S)||[],sessionMeta:{...K.sessionMeta,total:Math.max(0,(K.sessionMeta?.total||0)-1)}})))},Re=async()=>{try{const F=await(await Fe.projects()).json();if(c(K=>F.some((le,ze)=>{const Le=K[ze];return Le?le.name!==Le.name||le.displayName!==Le.displayName||le.fullPath!==Le.fullPath||JSON.stringify(le.sessionMeta)!==JSON.stringify(Le.sessionMeta)||JSON.stringify(le.sessions)!==JSON.stringify(Le.sessions):!0})||F.length!==K.length?F:K),d){const K=F.find(se=>se.name===d.name);if(K&&(JSON.stringify(K)!==JSON.stringify(d)&&m(K),u)){const se=K.sessions?.find(le=>le.id===u.id);se&&JSON.stringify(se)!==JSON.stringify(u)&&h(se)}}}catch(S){console.error("Error refreshing sidebar:",S)}},pe=S=>{d?.name===S&&(m(null),h(null),e("/")),c(F=>F.filter(K=>K.name!==S))},Ue=f.useCallback(S=>{S&&We(F=>new Set([...F,S]))},[]),mt=f.useCallback(S=>{S&&We(F=>{const K=new Set(F);return K.delete(S),K})},[]),Ie=f.useCallback(S=>{S&&te(F=>new Set([...F,S]))},[]),$t=f.useCallback(S=>{S&&te(F=>{const K=new Set(F);return K.delete(S),K})},[]),Z=f.useCallback(S=>{S&&We(F=>{const K=new Set;for(const se of F)se.startsWith("new-session-")||K.add(se);return K.add(S),K})},[]),ue=()=>i?t.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[t.jsx("button",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm",onClick:()=>o(!1),"aria-label":"Close version upgrade modal"}),t.jsxs("div",{className:"relative bg-white dark:bg-gray-800 rounded-lg shadow-xl border border-gray-200 dark:border-gray-700 w-full max-w-md mx-4 p-6 space-y-4",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:"w-10 h-10 bg-blue-100 dark:bg-blue-900/30 rounded-lg flex items-center justify-center",children:t.jsx("svg",{className:"w-5 h-5 text-blue-600 dark:text-blue-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M9 19l3 3m0 0l3-3m-3 3V10"})})}),t.jsxs("div",{children:[t.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Update Available"}),t.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"A new version is ready"})]})]}),t.jsx("button",{onClick:()=>o(!1),className:"p-2 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 rounded-md hover:bg-gray-100 dark:hover:bg-gray-700",children:t.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"flex justify-between items-center p-3 bg-gray-50 dark:bg-gray-700/50 rounded-lg",children:[t.jsx("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"Current Version"}),t.jsx("span",{className:"text-sm text-gray-900 dark:text-white font-mono",children:a})]}),t.jsxs("div",{className:"flex justify-between items-center p-3 bg-blue-50 dark:bg-blue-900/20 rounded-lg border border-blue-200 dark:border-blue-700",children:[t.jsx("span",{className:"text-sm font-medium text-blue-700 dark:text-blue-300",children:"Latest Version"}),t.jsx("span",{className:"text-sm text-blue-900 dark:text-blue-100 font-mono",children:s})]})]}),t.jsxs("div",{className:"space-y-3",children:[t.jsx("h3",{className:"text-sm font-medium text-gray-900 dark:text-white",children:"How to upgrade:"}),t.jsx("div",{className:"bg-gray-100 dark:bg-gray-800 rounded-lg p-3 border",children:t.jsx("code",{className:"text-sm text-gray-800 dark:text-gray-200 font-mono",children:"git checkout main && git pull && npm install"})}),t.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:"Run this command in your Claude Code UI directory to update to the latest version."})]}),t.jsxs("div",{className:"flex gap-2 pt-2",children:[t.jsx("button",{onClick:()=>o(!1),className:"flex-1 px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 bg-gray-100 dark:bg-gray-700 hover:bg-gray-200 dark:hover:bg-gray-600 rounded-md transition-colors",children:"Later"}),t.jsx("button",{onClick:()=>{navigator.clipboard.writeText("git checkout main && git pull && npm install"),o(!1)},className:"flex-1 px-4 py-2 text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 rounded-md transition-colors",children:"Copy Command"})]})]})]}):null;return t.jsxs("div",{className:"fixed inset-0 flex bg-background",children:[!x&&t.jsx("div",{className:"w-80 flex-shrink-0 border-r border-border bg-card",children:t.jsx("div",{className:"h-full overflow-hidden",children:t.jsx(Qi,{projects:l,selectedProject:d,selectedSession:u,onProjectSelect:Ve,onSessionSelect:Ke,onNewSession:rt,onSessionDelete:xe,onProjectDelete:pe,isLoading:y,onRefresh:Re,onShowSettings:()=>L(!0),updateAvailable:n,latestVersion:s,currentVersion:a,onShowVersionModal:()=>o(!0),isPWA:oe,isMobile:x})})}),x&&t.jsxs("div",{className:`fixed inset-0 z-50 flex transition-all duration-150 ease-out ${k?"opacity-100 visible":"opacity-0 invisible"}`,children:[t.jsx("button",{className:"fixed inset-0 bg-background/80 backdrop-blur-sm transition-opacity duration-150 ease-out",onClick:S=>{S.stopPropagation(),N(!1)},onTouchStart:S=>{S.preventDefault(),S.stopPropagation(),N(!1)},"aria-label":"Close sidebar"}),t.jsx("div",{className:`relative w-[85vw] max-w-sm sm:w-80 bg-card border-r border-border transform transition-transform duration-150 ease-out ${k?"translate-x-0":"-translate-x-full"}`,style:{height:"calc(100vh - 80px)"},onClick:S=>S.stopPropagation(),onTouchStart:S=>S.stopPropagation(),children:t.jsx(Qi,{projects:l,selectedProject:d,selectedSession:u,onProjectSelect:Ve,onSessionSelect:Ke,onNewSession:rt,onSessionDelete:xe,onProjectDelete:pe,isLoading:y,onRefresh:Re,onShowSettings:()=>L(!0),updateAvailable:n,latestVersion:s,currentVersion:a,onShowVersionModal:()=>o(!0),isPWA:oe,isMobile:x})})]}),t.jsx("div",{className:`flex-1 flex flex-col min-w-0 ${x&&!U?"pb-16":""}`,children:t.jsx(i1,{selectedProject:d,selectedSession:u,activeTab:p,setActiveTab:g,ws:ne,sendMessage:Oe,messages:ee,isMobile:x,isPWA:oe,onMenuClick:()=>N(!0),isLoading:y,onInputFocusChange:D,onSessionActive:Ue,onSessionInactive:mt,onSessionProcessing:Ie,onSessionNotProcessing:$t,processingSessions:v,onReplaceTemporarySession:Z,onNavigateToSession:S=>e(`/session/${S}`),onShowSettings:()=>L(!0),autoExpandTools:P,showRawParameters:R,showThinking:W,autoScrollToBottom:$,sendByCtrlEnter:ce,externalMessageUpdate:me})}),x&&t.jsx(o1,{activeTab:p,setActiveTab:g,isInputFocused:U}),p==="chat"&&t.jsx(m1,{isOpen:H,onToggle:j,autoExpandTools:P,onAutoExpandChange:M,showRawParameters:R,onShowRawParametersChange:w,showThinking:W,onShowThinkingChange:O,autoScrollToBottom:$,onAutoScrollChange:G,sendByCtrlEnter:ce,onSendByCtrlEnterChange:I,isMobile:x}),t.jsx(d1,{isOpen:B,onClose:()=>L(!1),projects:l}),t.jsx(ue,{})]})}function b1(){return t.jsx(l1,{children:t.jsx(Ph,{children:t.jsx(Rh,{children:t.jsx(zh,{children:t.jsx(_h,{children:t.jsx(g1,{children:t.jsx(Vu,{children:t.jsxs(Gu,{children:[t.jsx(_i,{path:"/",element:t.jsx(Ml,{})}),t.jsx(_i,{path:"/session/:sessionId",element:t.jsx(Ml,{})})]})})})})})})})})}"serviceWorker"in navigator&&navigator.serviceWorker.getRegistrations().then(e=>{e.forEach(r=>{r.unregister()})}).catch(e=>{console.warn("Failed to unregister service workers:",e)});rm.createRoot(document.getElementById("root")).render(t.jsx(or.StrictMode,{children:t.jsx(b1,{})}));
package/dist/index.html CHANGED
@@ -25,7 +25,7 @@
25
25
 
26
26
  <!-- Prevent zoom on iOS -->
27
27
  <meta name="format-detection" content="telephone=no" />
28
- <script type="module" crossorigin src="/assets/index-CDjRDwT5.js"></script>
28
+ <script type="module" crossorigin src="/assets/index-DDdVKZPL.js"></script>
29
29
  <link rel="modulepreload" crossorigin href="/assets/vendor-react-7V_UDHjJ.js">
30
30
  <link rel="modulepreload" crossorigin href="/assets/vendor-codemirror-B7BYDWj-.js">
31
31
  <link rel="modulepreload" crossorigin href="/assets/vendor-xterm-jI4BCHEb.js">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@siteboon/claude-code-ui",
3
- "version": "1.10.1",
3
+ "version": "1.10.3",
4
4
  "description": "A web-based UI for Claude Code CLI",
5
5
  "type": "module",
6
6
  "main": "server/index.js",
@@ -27,7 +27,7 @@
27
27
  "build": "vite build",
28
28
  "preview": "vite preview",
29
29
  "start": "npm run build && npm run server",
30
- "release": "release-it"
30
+ "release": "./release.sh"
31
31
  },
32
32
  "keywords": [
33
33
  "claude coode",
@@ -90,13 +90,13 @@ function normalizeGitHubUrl(url) {
90
90
  function parseGitHubUrl(url) {
91
91
  // Handle HTTPS URLs: https://github.com/owner/repo or https://github.com/owner/repo.git
92
92
  // Handle SSH URLs: git@github.com:owner/repo or git@github.com:owner/repo.git
93
- const match = url.match(/github\.com[:/]([^/]+)\/([^/.]+)/);
93
+ const match = url.match(/github\.com[:/]([^/]+)\/([^/]+?)(?:\.git)?$/);
94
94
  if (!match) {
95
95
  throw new Error('Invalid GitHub URL format');
96
96
  }
97
97
  return {
98
98
  owner: match[1],
99
- repo: match[2].replace('.git', '')
99
+ repo: match[2].replace(/\.git$/, '')
100
100
  };
101
101
  }
102
102
 
@@ -114,14 +114,37 @@ function autogenerateBranchName(message) {
114
114
  .replace(/-+/g, '-') // Replace multiple hyphens with single
115
115
  .replace(/^-|-$/g, ''); // Remove leading/trailing hyphens
116
116
 
117
- // Limit length to 50 characters
118
- if (branchName.length > 50) {
119
- branchName = branchName.substring(0, 50).replace(/-$/, '');
117
+ // Ensure non-empty fallback
118
+ if (!branchName) {
119
+ branchName = 'task';
120
120
  }
121
121
 
122
- // Add timestamp suffix to ensure uniqueness
123
- const timestamp = Date.now().toString(36).substring(-6);
124
- branchName = `${branchName}-${timestamp}`;
122
+ // Generate timestamp suffix (last 6 chars of base36 timestamp)
123
+ const timestamp = Date.now().toString(36).slice(-6);
124
+ const suffix = `-${timestamp}`;
125
+
126
+ // Limit length to ensure total length including suffix fits within 50 characters
127
+ const maxBaseLength = 50 - suffix.length;
128
+ if (branchName.length > maxBaseLength) {
129
+ branchName = branchName.substring(0, maxBaseLength);
130
+ }
131
+
132
+ // Remove any trailing hyphen after truncation and ensure no leading hyphen
133
+ branchName = branchName.replace(/-$/, '').replace(/^-+/, '');
134
+
135
+ // If still empty or starts with hyphen after cleanup, use fallback
136
+ if (!branchName || branchName.startsWith('-')) {
137
+ branchName = 'task';
138
+ }
139
+
140
+ // Combine base name with timestamp suffix
141
+ branchName = `${branchName}${suffix}`;
142
+
143
+ // Final validation: ensure it matches safe pattern
144
+ if (!/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(branchName)) {
145
+ // Fallback to deterministic safe name
146
+ return `branch-${timestamp}`;
147
+ }
125
148
 
126
149
  return branchName;
127
150
  }