@kaitranntt/ccs 7.43.0-dev.13 → 7.43.0-dev.15

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.
Files changed (85) hide show
  1. package/README.md +25 -0
  2. package/dist/ccs.js +23 -4
  3. package/dist/ccs.js.map +1 -1
  4. package/dist/cliproxy/config/thinking-config.d.ts.map +1 -1
  5. package/dist/cliproxy/config/thinking-config.js +59 -10
  6. package/dist/cliproxy/config/thinking-config.js.map +1 -1
  7. package/dist/cliproxy/executor/env-resolver.d.ts.map +1 -1
  8. package/dist/cliproxy/executor/env-resolver.js +1 -1
  9. package/dist/cliproxy/executor/env-resolver.js.map +1 -1
  10. package/dist/cliproxy/executor/index.d.ts.map +1 -1
  11. package/dist/cliproxy/executor/index.js +24 -33
  12. package/dist/cliproxy/executor/index.js.map +1 -1
  13. package/dist/cliproxy/executor/thinking-arg-parser.d.ts +27 -0
  14. package/dist/cliproxy/executor/thinking-arg-parser.d.ts.map +1 -0
  15. package/dist/cliproxy/executor/thinking-arg-parser.js +80 -0
  16. package/dist/cliproxy/executor/thinking-arg-parser.js.map +1 -0
  17. package/dist/commands/cursor-command-display.d.ts +6 -0
  18. package/dist/commands/cursor-command-display.d.ts.map +1 -0
  19. package/dist/commands/cursor-command-display.js +100 -0
  20. package/dist/commands/cursor-command-display.js.map +1 -0
  21. package/dist/commands/cursor-command.d.ts +1 -1
  22. package/dist/commands/cursor-command.d.ts.map +1 -1
  23. package/dist/commands/cursor-command.js +103 -106
  24. package/dist/commands/cursor-command.js.map +1 -1
  25. package/dist/commands/help-command.d.ts.map +1 -1
  26. package/dist/commands/help-command.js +11 -3
  27. package/dist/commands/help-command.js.map +1 -1
  28. package/dist/config/unified-config-loader.d.ts.map +1 -1
  29. package/dist/config/unified-config-loader.js +1 -1
  30. package/dist/config/unified-config-loader.js.map +1 -1
  31. package/dist/cursor/cursor-daemon-entry.d.ts +14 -0
  32. package/dist/cursor/cursor-daemon-entry.d.ts.map +1 -0
  33. package/dist/cursor/cursor-daemon-entry.js +236 -0
  34. package/dist/cursor/cursor-daemon-entry.js.map +1 -0
  35. package/dist/cursor/cursor-daemon.d.ts +2 -2
  36. package/dist/cursor/cursor-daemon.d.ts.map +1 -1
  37. package/dist/cursor/cursor-daemon.js +44 -23
  38. package/dist/cursor/cursor-daemon.js.map +1 -1
  39. package/dist/cursor/cursor-models.d.ts +1 -1
  40. package/dist/cursor/cursor-models.d.ts.map +1 -1
  41. package/dist/cursor/cursor-models.js +1 -1
  42. package/dist/cursor/cursor-models.js.map +1 -1
  43. package/dist/cursor/index.d.ts +1 -1
  44. package/dist/cursor/index.d.ts.map +1 -1
  45. package/dist/cursor/index.js +3 -1
  46. package/dist/cursor/index.js.map +1 -1
  47. package/dist/cursor/types.d.ts +3 -4
  48. package/dist/cursor/types.d.ts.map +1 -1
  49. package/dist/ui/assets/accounts-DUXGezDd.js +1 -0
  50. package/dist/ui/assets/{alert-dialog-B9Uu5j7u.js → alert-dialog-v_t-MSkk.js} +1 -1
  51. package/dist/ui/assets/api-DpgZIIc_.js +1 -0
  52. package/dist/ui/assets/auth-section-DK9uZk6p.js +1 -0
  53. package/dist/ui/assets/{backups-section-DvQ6124z.js → backups-section-foNPSV01.js} +1 -1
  54. package/dist/ui/assets/{cliproxy-CwCnK3nw.js → cliproxy-Dstv6JjS.js} +1 -1
  55. package/dist/ui/assets/{cliproxy-control-panel-CIXluDh-.js → cliproxy-control-panel-CmGlW0jo.js} +1 -1
  56. package/dist/ui/assets/{confirm-dialog-B75dfynE.js → confirm-dialog-DzyrERXX.js} +1 -1
  57. package/dist/ui/assets/{copilot-DbnYMqPk.js → copilot-ByJVO9GO.js} +2 -2
  58. package/dist/ui/assets/cursor-CFGRYnUC.js +1 -0
  59. package/dist/ui/assets/globalenv-section-COm3Jt3S.js +1 -0
  60. package/dist/ui/assets/{health-DYrD6KCx.js → health-cWZ_UY4k.js} +1 -1
  61. package/dist/ui/assets/{icons-D5eAI-GR.js → icons-G0rMFC4M.js} +1 -1
  62. package/dist/ui/assets/{index-C27PqItS.js → index-BPN_caRg.js} +1 -1
  63. package/dist/ui/assets/{index-Bmb4X9Km.js → index-Bj8Fp2nX.js} +1 -1
  64. package/dist/ui/assets/index-Bqle3SG4.css +1 -0
  65. package/dist/ui/assets/{index-XGsZr8Ow.js → index-D9Lyhtjg.js} +1 -1
  66. package/dist/ui/assets/{index-DyigGY6D.js → index-gkEvbSRZ.js} +18 -18
  67. package/dist/ui/assets/{index-dfia1xYK.js → index-u6iaQ6lY.js} +1 -1
  68. package/dist/ui/assets/{proxy-status-widget-DiMcpCvZ.js → proxy-status-widget-DhrkchWy.js} +1 -1
  69. package/dist/ui/assets/shared-BEtOs0xN.js +1 -0
  70. package/dist/ui/assets/{switch-BKMDc-FD.js → switch-BIZV9lTh.js} +1 -1
  71. package/dist/ui/index.html +3 -3
  72. package/dist/web-server/routes/cursor-routes.d.ts +10 -0
  73. package/dist/web-server/routes/cursor-routes.d.ts.map +1 -1
  74. package/dist/web-server/routes/cursor-routes.js +54 -46
  75. package/dist/web-server/routes/cursor-routes.js.map +1 -1
  76. package/dist/web-server/routes/cursor-settings-routes.d.ts.map +1 -1
  77. package/dist/web-server/routes/cursor-settings-routes.js +43 -5
  78. package/dist/web-server/routes/cursor-settings-routes.js.map +1 -1
  79. package/package.json +1 -1
  80. package/dist/ui/assets/accounts-CQjv5gdg.js +0 -1
  81. package/dist/ui/assets/api-8PhE29RT.js +0 -1
  82. package/dist/ui/assets/auth-section-DOVsMam9.js +0 -1
  83. package/dist/ui/assets/globalenv-section-D1RvXzRJ.js +0 -1
  84. package/dist/ui/assets/index-ByiEOnlQ.css +0 -1
  85. package/dist/ui/assets/shared-DqLXV07P.js +0 -1
@@ -1 +1 @@
1
- import{j as e}from"./radix-ui-qEZD5MMp.js";import{r as a}from"./react-vendor-CNOkPC89.js";import{aP as R,aR as A,b as C,m as M,L as D,X as L,Y as $,Z as F,_ as K,$ as z}from"./index-DyigGY6D.js";import{S as H}from"./switch-BKMDc-FD.js";import{R as k,a1 as U,q as O,a3 as q,I as G}from"./icons-D5eAI-GR.js";import"./tanstack-De4wvi8X.js";import"./notifications-B2HqRBj7.js";import"./utils-CzKF5WmX.js";import"./form-utils-C-pVd1--.js";import"./code-highlight-BRUf_pqB.js";const p={mode:"auto",tier_defaults:{opus:"high",sonnet:"medium",haiku:"low"},show_warnings:!0},T=1e4;function P(){const[n,i]=a.useState(null),[g,u]=a.useState(!0),[b,c]=a.useState(!1),[j,o]=a.useState(null),[v,s]=a.useState(!1),l=a.useRef(void 0),N=a.useCallback(async()=>{const r=new AbortController,m=setTimeout(()=>r.abort(),T);try{u(!0),o(null);const t=await fetch("/api/thinking",{signal:r.signal});if(clearTimeout(m),!t.ok)throw t.headers.get("content-type")?.includes("text/html")?new Error(`Server error (${t.status})`):new Error("Failed to load Thinking config");const x=await t.json();i(x.config||p),l.current=x.lastModified}catch(t){clearTimeout(m),t.name==="AbortError"?o("Request timeout - please try again"):o(t.message),i(p)}finally{u(!1)}return()=>r.abort()},[]),d=a.useCallback(async r=>{const m=n||p,t={...m,...r};i(t);const x=new AbortController,w=setTimeout(()=>x.abort(),T);try{c(!0),o(null);const f={...t,lastModified:l.current},h=await fetch("/api/thinking",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(f),signal:x.signal});if(clearTimeout(w),!h.ok){if(h.headers.get("content-type")?.includes("text/html"))throw new Error(`Server error (${h.status})`);const I=await h.json();throw h.status===409?new Error("Config changed by another session. Refreshing..."):new Error(I.error||"Failed to save")}const y=await h.json();i(y.config),l.current=y.lastModified,s(!0),setTimeout(()=>s(!1),1500)}catch(f){clearTimeout(w),i(m),f.name==="AbortError"?o("Request timeout - please try again"):(o(f.message),f.message.includes("another session")&&setTimeout(()=>N(),1e3))}finally{c(!1)}},[n,N]),S=a.useCallback(r=>{d({mode:r})},[d]),E=a.useCallback((r,m)=>{const t=n?.tier_defaults||p.tier_defaults;d({tier_defaults:{...t,[r]:m}})},[n,d]),_=a.useCallback(r=>{d({show_warnings:r})},[d]);return{config:n||p,loading:g,saving:b,error:j,success:v,fetchConfig:N,saveConfig:d,setMode:S,setTierDefault:E,setShowWarnings:_}}const V=[{value:"minimal",label:"Minimal (512 tokens)"},{value:"low",label:"Low (1K tokens)"},{value:"medium",label:"Medium (8K tokens)"},{value:"high",label:"High (24K tokens)"},{value:"xhigh",label:"Extra High (32K tokens)"},{value:"auto",label:"Auto (dynamic)"}];function ne(){const{config:n,loading:i,saving:g,error:u,success:b,fetchConfig:c,setMode:j,setTierDefault:o,setShowWarnings:v}=P();return a.useEffect(()=>{c()},[c]),i?e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsxs("div",{className:"flex items-center gap-3 text-muted-foreground",children:[e.jsx(k,{className:"w-5 h-5 animate-spin"}),e.jsx("span",{children:"Loading..."})]})}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:`absolute left-5 right-5 top-20 z-10 transition-all duration-200 ease-out ${u||b?"opacity-100 translate-y-0":"opacity-0 -translate-y-2 pointer-events-none"}`,children:[u&&e.jsx(R,{variant:"destructive",className:"py-2 shadow-lg",children:e.jsxs("div",{className:"flex items-center justify-between w-full",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(U,{className:"h-4 w-4"}),e.jsx(A,{children:u})]}),e.jsxs(C,{variant:"outline",size:"sm",onClick:c,className:"h-7 px-2 text-xs border-destructive/50 hover:bg-destructive/10",children:[e.jsx(k,{className:"w-3 h-3 mr-1"}),"Retry"]})]})}),b&&e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-md border border-green-200 bg-green-50 text-green-700 shadow-lg dark:border-green-900/50 dark:bg-green-900/90 dark:text-green-300",children:[e.jsx(O,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"text-sm font-medium",children:"Saved"})]})]}),e.jsx(M,{className:"flex-1",children:e.jsxs("div",{className:"p-5 space-y-6",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(q,{className:"w-5 h-5 text-primary"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Configure extended thinking/reasoning for supported models."})]}),e.jsxs("div",{className:"flex items-start gap-2 p-3 rounded-lg bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800",children:[e.jsx(G,{className:"w-4 h-4 text-blue-600 dark:text-blue-400 shrink-0 mt-0.5"}),e.jsxs("div",{className:"text-sm text-blue-700 dark:text-blue-300",children:[e.jsx("p",{className:"font-medium",children:"Supported Providers"}),e.jsxs("ul",{className:"mt-1 space-y-0.5 text-blue-600 dark:text-blue-400",children:[e.jsxs("li",{children:["Thinking budget: ",e.jsx("strong",{children:"agy"}),", ",e.jsx("strong",{children:"gemini"})," (token-based)"]}),e.jsxs("li",{children:["Reasoning effort: ",e.jsx("strong",{children:"codex"})," (level-based: medium/high/xhigh)"]})]})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-base font-medium",children:"Thinking Mode"}),e.jsx("div",{className:"space-y-2",children:["auto","off","manual"].map(s=>e.jsxs("div",{className:`flex items-center justify-between p-4 rounded-lg cursor-pointer transition-colors ${n.mode===s?"bg-primary/10 border border-primary/30":"bg-muted/50 hover:bg-muted/80"}`,onClick:()=>j(s),children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium capitalize",children:s}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:[s==="auto"&&"Automatically set thinking based on model tier",s==="off"&&"Disable extended thinking",s==="manual"&&"Use --thinking flag to control manually"]})]}),e.jsx("div",{className:`w-4 h-4 rounded-full border-2 ${n.mode===s?"bg-primary border-primary":"border-muted-foreground/50"}`})]},s))})]}),n.mode==="auto"&&e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-base font-medium",children:"Tier Defaults"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Default thinking level for each model tier when in auto mode."}),e.jsx("div",{className:"space-y-3",children:["opus","sonnet","haiku"].map(s=>e.jsxs("div",{className:"flex items-center gap-4 p-3 rounded-lg bg-muted/30",children:[e.jsx(D,{className:"w-20 capitalize font-medium",children:s}),e.jsxs(L,{value:n.tier_defaults[s],onValueChange:l=>o(s,l),disabled:g,children:[e.jsx($,{className:"flex-1",children:e.jsx(F,{})}),e.jsx(K,{children:V.map(l=>e.jsx(z,{value:l.value,children:l.label},l.value))})]})]},s))})]}),e.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-muted/50",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:"Show Warnings"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Display warnings when thinking values are clamped or adjusted"})]}),e.jsx(H,{checked:n.show_warnings??!0,onCheckedChange:v,disabled:g})]}),e.jsxs("div",{className:"p-4 rounded-lg border bg-muted/30",children:[e.jsx("h4",{className:"text-sm font-medium mb-2",children:"CLI Override"}),e.jsxs("p",{className:"text-sm text-muted-foreground mb-2",children:["Use ",e.jsx("code",{className:"px-1.5 py-0.5 rounded bg-muted",children:"--thinking"})," flag to override settings per session:"]}),e.jsxs("div",{className:"space-y-1 text-sm font-mono text-muted-foreground",children:[e.jsx("p",{children:"ccs gemini --thinking high"}),e.jsx("p",{children:"ccs agy --thinking 16384"}),e.jsx("p",{children:"ccs gemini --thinking off"})]})]})]})}),e.jsx("div",{className:"p-4 border-t bg-background",children:e.jsxs(C,{variant:"outline",size:"sm",onClick:c,disabled:i||g,className:"w-full",children:[e.jsx(k,{className:`w-4 h-4 mr-2 ${i?"animate-spin":""}`}),"Refresh"]})})]})}export{ne as default};
1
+ import{j as e}from"./radix-ui-qEZD5MMp.js";import{r as a}from"./react-vendor-CNOkPC89.js";import{aQ as R,aS as A,b as C,m as M,L as D,X as L,Y as $,Z as F,_ as K,$ as z}from"./index-gkEvbSRZ.js";import{S as H}from"./switch-BIZV9lTh.js";import{R as y,a2 as O,r as U,a4 as G,I as V}from"./icons-G0rMFC4M.js";import"./tanstack-De4wvi8X.js";import"./notifications-B2HqRBj7.js";import"./utils-CzKF5WmX.js";import"./form-utils-C-pVd1--.js";import"./code-highlight-BRUf_pqB.js";const p={mode:"auto",tier_defaults:{opus:"high",sonnet:"medium",haiku:"low"},show_warnings:!0},T=1e4;function W(){const[r,i]=a.useState(null),[g,u]=a.useState(!0),[b,c]=a.useState(!1),[j,o]=a.useState(null),[v,s]=a.useState(!1),l=a.useRef(void 0),N=a.useCallback(async()=>{const n=new AbortController,m=setTimeout(()=>n.abort(),T);try{u(!0),o(null);const t=await fetch("/api/thinking",{signal:n.signal});if(clearTimeout(m),!t.ok)throw t.headers.get("content-type")?.includes("text/html")?new Error(`Server error (${t.status})`):new Error("Failed to load Thinking config");const x=await t.json();i(x.config||p),l.current=x.lastModified}catch(t){clearTimeout(m),t.name==="AbortError"?o("Request timeout - please try again"):o(t.message),i(p)}finally{u(!1)}return()=>n.abort()},[]),d=a.useCallback(async n=>{const m=r||p,t={...m,...n};i(t);const x=new AbortController,w=setTimeout(()=>x.abort(),T);try{c(!0),o(null);const f={...t,lastModified:l.current},h=await fetch("/api/thinking",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(f),signal:x.signal});if(clearTimeout(w),!h.ok){if(h.headers.get("content-type")?.includes("text/html"))throw new Error(`Server error (${h.status})`);const I=await h.json();throw h.status===409?new Error("Config changed by another session. Refreshing..."):new Error(I.error||"Failed to save")}const k=await h.json();i(k.config),l.current=k.lastModified,s(!0),setTimeout(()=>s(!1),1500)}catch(f){clearTimeout(w),i(m),f.name==="AbortError"?o("Request timeout - please try again"):(o(f.message),f.message.includes("another session")&&setTimeout(()=>N(),1e3))}finally{c(!1)}},[r,N]),S=a.useCallback(n=>{d({mode:n})},[d]),E=a.useCallback((n,m)=>{const t=r?.tier_defaults||p.tier_defaults;d({tier_defaults:{...t,[n]:m}})},[r,d]),_=a.useCallback(n=>{d({show_warnings:n})},[d]);return{config:r||p,loading:g,saving:b,error:j,success:v,fetchConfig:N,saveConfig:d,setMode:S,setTierDefault:E,setShowWarnings:_}}const q=[{value:"minimal",label:"Minimal (512 tokens)"},{value:"low",label:"Low (1K tokens)"},{value:"medium",label:"Medium (8K tokens)"},{value:"high",label:"High (24K tokens)"},{value:"xhigh",label:"Extra High (32K tokens)"},{value:"auto",label:"Auto (dynamic)"}];function re(){const{config:r,loading:i,saving:g,error:u,success:b,fetchConfig:c,setMode:j,setTierDefault:o,setShowWarnings:v}=W();return a.useEffect(()=>{c()},[c]),i?e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsxs("div",{className:"flex items-center gap-3 text-muted-foreground",children:[e.jsx(y,{className:"w-5 h-5 animate-spin"}),e.jsx("span",{children:"Loading..."})]})}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:`absolute left-5 right-5 top-20 z-10 transition-all duration-200 ease-out ${u||b?"opacity-100 translate-y-0":"opacity-0 -translate-y-2 pointer-events-none"}`,children:[u&&e.jsx(R,{variant:"destructive",className:"py-2 shadow-lg",children:e.jsxs("div",{className:"flex items-center justify-between w-full",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(O,{className:"h-4 w-4"}),e.jsx(A,{children:u})]}),e.jsxs(C,{variant:"outline",size:"sm",onClick:c,className:"h-7 px-2 text-xs border-destructive/50 hover:bg-destructive/10",children:[e.jsx(y,{className:"w-3 h-3 mr-1"}),"Retry"]})]})}),b&&e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-md border border-green-200 bg-green-50 text-green-700 shadow-lg dark:border-green-900/50 dark:bg-green-900/90 dark:text-green-300",children:[e.jsx(U,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"text-sm font-medium",children:"Saved"})]})]}),e.jsx(M,{className:"flex-1",children:e.jsxs("div",{className:"p-5 space-y-6",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(G,{className:"w-5 h-5 text-primary"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Configure extended thinking/reasoning for supported models."})]}),e.jsxs("div",{className:"flex items-start gap-2 p-3 rounded-lg bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800",children:[e.jsx(V,{className:"w-4 h-4 text-blue-600 dark:text-blue-400 shrink-0 mt-0.5"}),e.jsxs("div",{className:"text-sm text-blue-700 dark:text-blue-300",children:[e.jsx("p",{className:"font-medium",children:"Supported Providers"}),e.jsxs("ul",{className:"mt-1 space-y-0.5 text-blue-600 dark:text-blue-400",children:[e.jsxs("li",{children:["Thinking budget: ",e.jsx("strong",{children:"agy"}),", ",e.jsx("strong",{children:"gemini"})," (token-based)"]}),e.jsxs("li",{children:["Reasoning effort: ",e.jsx("strong",{children:"codex"})," (level-based: medium/high/xhigh)"]})]})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-base font-medium",children:"Thinking Mode"}),e.jsx("div",{className:"space-y-2",children:["auto","off","manual"].map(s=>e.jsxs("div",{className:`flex items-center justify-between p-4 rounded-lg cursor-pointer transition-colors ${r.mode===s?"bg-primary/10 border border-primary/30":"bg-muted/50 hover:bg-muted/80"}`,onClick:()=>j(s),children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium capitalize",children:s}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:[s==="auto"&&"Automatically set thinking based on model tier",s==="off"&&"Disable extended thinking",s==="manual"&&"Use --thinking (agy/gemini) or --effort (codex) per run"]})]}),e.jsx("div",{className:`w-4 h-4 rounded-full border-2 ${r.mode===s?"bg-primary border-primary":"border-muted-foreground/50"}`})]},s))})]}),r.mode==="auto"&&e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-base font-medium",children:"Tier Defaults"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Default thinking level for each model tier when in auto mode."}),e.jsx("div",{className:"space-y-3",children:["opus","sonnet","haiku"].map(s=>e.jsxs("div",{className:"flex items-center gap-4 p-3 rounded-lg bg-muted/30",children:[e.jsx(D,{className:"w-20 capitalize font-medium",children:s}),e.jsxs(L,{value:r.tier_defaults[s],onValueChange:l=>o(s,l),disabled:g,children:[e.jsx($,{className:"flex-1",children:e.jsx(F,{})}),e.jsx(K,{children:q.map(l=>e.jsx(z,{value:l.value,children:l.label},l.value))})]})]},s))})]}),e.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-muted/50",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:"Show Warnings"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Display warnings when thinking values are clamped or adjusted"})]}),e.jsx(H,{checked:r.show_warnings??!0,onCheckedChange:v,disabled:g})]}),e.jsxs("div",{className:"p-4 rounded-lg border bg-muted/30",children:[e.jsx("h4",{className:"text-sm font-medium mb-2",children:"CLI Override"}),e.jsxs("p",{className:"text-sm text-muted-foreground mb-2",children:["Override per session with"," ",e.jsx("code",{className:"px-1.5 py-0.5 rounded bg-muted",children:"--thinking"})," (agy/gemini) or"," ",e.jsx("code",{className:"px-1.5 py-0.5 rounded bg-muted",children:"--effort"})," (codex):"]}),e.jsxs("div",{className:"space-y-1 text-sm font-mono text-muted-foreground",children:[e.jsx("p",{children:"ccs gemini --thinking high"}),e.jsx("p",{children:"ccs agy --thinking 16384"}),e.jsx("p",{children:"ccs codex --effort xhigh"}),e.jsx("p",{children:'ccs codex -p "Refactor this module" --effort xhigh'})]})]})]})}),e.jsx("div",{className:"p-4 border-t bg-background",children:e.jsxs(C,{variant:"outline",size:"sm",onClick:c,disabled:i||g,className:"w-full",children:[e.jsx(y,{className:`w-4 h-4 mr-2 ${i?"animate-spin":""}`}),"Refresh"]})})]})}export{re as default};
@@ -1 +1 @@
1
- import{j as e}from"./radix-ui-qEZD5MMp.js";import{r as y}from"./react-vendor-CNOkPC89.js";import{aW as W,aC as Z,aX as _,aY as J,aZ as ee,a_ as se,a$ as te,c as d,B as E,ao as ae,E as ne,G as re,X as oe,Y as ie,Z as le,_ as ce,$ as de,b as T,T as xe,o as me,p as ue,ae as he}from"./index-DyigGY6D.js";import{A as ge,a as pe,b as fe,c as be,d as je,e as ye,f as Ne,g as we}from"./alert-dialog-B9Uu5j7u.js";import{u as q,a as ve,b as Ce,e as Se}from"./tanstack-De4wvi8X.js";import{t as V}from"./notifications-B2HqRBj7.js";import{a2 as ke,A as Pe,R as f,aF as Ve,aG as Ae,aH as Te,X as De,S as Ie,aI as Ue,aJ as $e,U as Ee,p as Re,j as qe,a1 as Fe,ao as Le,T as R,av as Me}from"./icons-D5eAI-GR.js";async function Be(){const s=await fetch("/api/cliproxy/sync/status");if(!s.ok){let n="Failed to fetch sync status";try{const t=await s.json();n=t.error||t.message||n}catch{}throw new Error(n)}return s.json()}async function Ke(){const s=new AbortController,n=setTimeout(()=>s.abort(),3e4);try{const t=await fetch("/api/cliproxy/sync",{method:"POST",headers:{"Content-Type":"application/json"},signal:s.signal});if(!t.ok){let a="Sync failed";try{const r=await t.json();a=r.error||r.message||a}catch{}throw new Error(a)}return t.json()}catch(t){throw t instanceof Error&&t.name==="AbortError"?new Error("Sync request timed out after 30 seconds"):t}finally{clearTimeout(n)}}function Qe(){return q({queryKey:["cliproxy-sync-status"],queryFn:Be,refetchInterval:3e4,retry:1,staleTime:1e4})}function ze(){const s=ve();return Ce({mutationFn:Ke,onSuccess:n=>{s.invalidateQueries({queryKey:["cliproxy-sync-status"]}),s.invalidateQueries({queryKey:["cliproxy-sync-preview"]}),n.syncedCount===0?V.info("No profiles to sync"):V.success(`Synced ${n.syncedCount} profile${n.syncedCount===1?"":"s"} to CLIProxy`)},onError:n=>{V.error(`Sync failed: ${n.message}`)}})}function A(s,n){const t=s.replace(/-\d+$/,"").split(".").map(Number),a=n.replace(/-\d+$/,"").split(".").map(Number);for(let r=0;r<3;r++){if((t[r]||0)>(a[r]||0))return!0;if((t[r]||0)<(a[r]||0))return!1}return!1}function Ge(s){if(!s)return"";const n=new Date(s).getTime(),a=Date.now()-n,r=Math.floor(a/(1e3*60*60)),i=Math.floor(a%(1e3*60*60)/(1e3*60));return r>0?`${r}h ${i}m`:`${i}m`}function He(s){if(!s)return"";const n=Date.now()-s,t=Math.floor(n/(1e3*60)),a=Math.floor(n/(1e3*60*60));return t<1?"just now":t<60?`${t}m ago`:`${a}h ago`}function N({icon:s,tooltip:n,onClick:t,disabled:a,isPending:r,className:i,variant:l="ghost"}){return e.jsxs(xe,{children:[e.jsx(me,{asChild:!0,children:e.jsx(T,{variant:l==="destructive-ghost"?"ghost":l,size:"sm",className:d("h-7 w-7 p-0",l==="destructive-ghost"&&"hover:bg-destructive/10 hover:text-destructive hover:border-destructive/30",i),onClick:t,disabled:a,children:r?e.jsx(f,{className:"w-3.5 h-3.5 animate-spin"}):e.jsx(s,{className:"w-3.5 h-3.5"})})}),e.jsx(ue,{side:"bottom",className:"text-xs",children:n})]})}function es(){const{data:s,isLoading:n}=W(),{data:t}=Z(),{data:a,isLoading:r}=_(),i=J(),l=ee(),w=se(),u=te(),{data:F}=Qe(),{mutate:L,isPending:v}=ze(),[h,D]=y.useState(!1),[g,M]=y.useState(""),[B,b]=y.useState(!1),[C,S]=y.useState(null),{data:K}=q({queryKey:["cliproxy-server-config"],queryFn:()=>he.cliproxyServer.get(),staleTime:3e4}),Q=Se({mutationKey:["update-backend"]})>0,x=K?.remote,I=x?.enabled&&x?.host,p=s?.running??!1,k=i.isPending||l.isPending||w.isPending||u.isPending||Q||v,z=t?.hasUpdate??!1,m=t?.isStable===!1,U=t?.currentVersion,j=F?.configured??!1,G=j?"Sync Ready":"No Config",P=m?t?.maxStableVersion||a?.latestStable:t?.latestVersion,$=o=>{if(!o)return;const c=a?.maxStableVersion||"6.6.80";if(A(o,c)){S(o),b(!0);return}u.mutate({version:o})},H=()=>{C&&u.mutate({version:C,force:!0}),b(!1),S(null)},O=()=>{b(!1),S(null)},X=I?(()=>{const o=x.protocol||"http",c=x.port||(o==="https"?443:80);return o==="https"&&c===443||o==="http"&&c===80?x.host:`${x.host}:${c}`})():null;return I?e.jsxs("div",{className:d("rounded-lg border p-3 transition-colors","border-blue-500/30 bg-blue-500/5"),children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ke,{className:"w-4 h-4 text-blue-500"}),e.jsx("span",{className:"text-sm font-medium",children:"Remote Proxy"}),e.jsx(E,{variant:"secondary",className:"text-[10px] h-4 px-1.5 bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",children:"Active"})]}),e.jsx(Pe,{className:"w-3 h-3 text-blue-600"})]}),e.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:[e.jsx("div",{className:"flex items-center gap-1 mb-1",children:e.jsx("span",{className:"font-mono",children:X})}),e.jsx("p",{className:"text-[10px] text-muted-foreground/70 leading-tight",children:"Traffic auto-routed to remote server"})]})]}):e.jsx(ae,{delayDuration:300,children:e.jsxs("div",{className:d("rounded-lg border p-3 transition-colors",p?"border-green-500/30 bg-green-500/5":"border-muted bg-muted/30"),children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:d("w-2 h-2 rounded-full",p?"bg-green-500 animate-pulse":"bg-muted-foreground/30")}),e.jsx("span",{className:"text-sm font-medium",children:t?.backendLabel??"CLIProxy"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[n?e.jsx(f,{className:"w-3 h-3 animate-spin text-muted-foreground"}):p?e.jsxs(e.Fragment,{children:[e.jsx(N,{icon:v?f:Ve,tooltip:"Sync profiles to CLIProxy",onClick:()=>L(),disabled:!j||k,isPending:v}),e.jsx(N,{icon:Ae,tooltip:"Restart",onClick:()=>w.mutate(),disabled:k,isPending:w.isPending}),e.jsx(N,{icon:Te,tooltip:"Stop",onClick:()=>l.mutate(),disabled:k,isPending:l.isPending,variant:"destructive-ghost"})]}):null,e.jsx(N,{icon:h?De:Ie,tooltip:h?"Close":"Version settings",onClick:()=>D(!h),className:h?"bg-muted":void 0})]})]}),U&&e.jsxs("div",{className:"mt-1.5 flex items-center gap-2",children:[e.jsxs("span",{className:d("text-xs font-mono text-muted-foreground",m&&"text-amber-600 dark:text-amber-400"),children:["v",U]}),(z||m)&&P&&e.jsxs(E,{variant:"secondary",className:d("text-[10px] h-4 px-1.5 gap-0.5 cursor-pointer transition-colors",m?"bg-amber-100 text-amber-700 hover:bg-amber-200 dark:bg-amber-900/30 dark:text-amber-400 dark:hover:bg-amber-900/50":"bg-green-100 text-green-700 hover:bg-green-200 dark:bg-green-900/30 dark:text-green-400 dark:hover:bg-green-900/50"),onClick:()=>$(P),title:`Click to ${m?"downgrade":"update"}`,children:[m?e.jsx(Ue,{className:"w-2.5 h-2.5"}):e.jsx($e,{className:"w-2.5 h-2.5"}),P]})]}),p&&s&&e.jsxs("div",{className:"mt-2 flex items-center gap-4 text-xs text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:["Port ",s.port]}),s.sessionCount!==void 0&&s.sessionCount>0&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Ee,{className:"w-3 h-3"}),s.sessionCount," session",s.sessionCount!==1?"s":""]}),s.startedAt&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Re,{className:"w-3 h-3"}),Ge(s.startedAt)]})]}),e.jsxs("div",{className:"mt-2 flex items-center gap-1.5 text-xs",children:[j?e.jsx(qe,{className:"w-3 h-3 text-green-600 dark:text-green-400"}):e.jsx(Fe,{className:"w-3 h-3 text-muted-foreground"}),e.jsx("span",{className:d("text-xs",j?"text-green-600 dark:text-green-400":"text-muted-foreground"),children:G})]}),e.jsx(ne,{open:h,onOpenChange:D,children:e.jsxs(re,{className:"mt-3 pt-3 border-t border-muted",children:[e.jsx("h4",{className:"text-xs font-medium text-muted-foreground mb-3",children:"Version Management"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(oe,{value:g,onValueChange:M,disabled:r,children:[e.jsx(ie,{className:"h-8 text-xs flex-1",children:e.jsx(le,{placeholder:"Select version to install..."})}),e.jsx(ce,{children:a?.versions.slice(0,20).map(o=>{const c=a?.maxStableVersion&&A(o,a.maxStableVersion);return e.jsx(de,{value:o,className:"text-xs",children:e.jsxs("span",{className:"flex items-center gap-2",children:["v",o,o===a.latestStable&&e.jsx("span",{className:"text-green-600 dark:text-green-400",children:"(stable)"}),c&&e.jsx("span",{className:"text-amber-600 dark:text-amber-400",children:"⚠"})]})},o)})})]}),e.jsxs(T,{variant:"outline",size:"sm",className:"h-8 text-xs gap-1.5 px-3",onClick:()=>$(g),disabled:u.isPending||!g,children:[u.isPending?e.jsx(f,{className:"w-3.5 h-3.5 animate-spin"}):e.jsx(Le,{className:"w-3.5 h-3.5"}),"Install"]})]}),g&&a?.maxStableVersion&&A(g,a.maxStableVersion)&&e.jsxs("div",{className:"mt-2 flex items-center gap-1.5 text-[11px] text-amber-600 dark:text-amber-400",children:[e.jsx(R,{className:"w-3.5 h-3.5 flex-shrink-0"}),e.jsxs("span",{children:["Versions above ",a.maxStableVersion," have known issues"]})]}),t?.checkedAt&&e.jsxs("div",{className:"mt-2 text-[10px] text-muted-foreground/60",children:["Last checked ",He(t.checkedAt)]})]})}),!p&&e.jsxs("div",{className:"mt-2 flex items-center justify-between",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:"Not running"}),e.jsxs(T,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1",onClick:()=>i.mutate(),disabled:i.isPending,children:[i.isPending?e.jsx(f,{className:"w-3 h-3 animate-spin"}):e.jsx(Me,{className:"w-3 h-3"}),"Start"]})]}),e.jsx(ge,{open:B,onOpenChange:b,children:e.jsxs(pe,{children:[e.jsxs(fe,{children:[e.jsxs(be,{className:"flex items-center gap-2",children:[e.jsx(R,{className:"w-5 h-5 text-amber-500"}),"Install Unstable Version?"]}),e.jsxs(je,{className:"space-y-2",children:[e.jsxs("p",{children:["You are about to install ",e.jsxs("strong",{children:["v",C]}),", which is above the maximum stable version"," ",e.jsxs("strong",{children:["v",a?.maxStableVersion||"6.6.80"]}),"."]}),e.jsx("p",{className:"text-amber-600 dark:text-amber-400",children:"This version has known stability issues and may cause unexpected behavior."}),e.jsx("p",{children:"Are you sure you want to proceed?"})]})]}),e.jsxs(ye,{children:[e.jsx(Ne,{onClick:O,children:"Cancel"}),e.jsx(we,{onClick:H,className:"bg-amber-500 hover:bg-amber-600 text-white",children:"Install Anyway"})]})]})})]})})}export{es as P};
1
+ import{j as e}from"./radix-ui-qEZD5MMp.js";import{r as y}from"./react-vendor-CNOkPC89.js";import{aX as Z,aC as _,aY as J,aZ as W,a_ as ee,a$ as se,b0 as te,c as d,B as E,ao as ae,E as ne,G as re,X as oe,Y as ie,Z as le,_ as ce,$ as de,b as T,T as xe,o as me,p as ue,ae as he}from"./index-gkEvbSRZ.js";import{A as ge,a as pe,b as fe,c as be,d as je,e as ye,f as Ne,g as we}from"./alert-dialog-v_t-MSkk.js";import{u as R,a as ve,b as Ce,e as Se}from"./tanstack-De4wvi8X.js";import{t as V}from"./notifications-B2HqRBj7.js";import{a3 as ke,A as Pe,R as f,aG as Ve,aH as Ae,aI as Te,X as De,S as Ie,aJ as Ue,aK as $e,U as Ee,q as qe,k as Re,a2 as Le,ap as Me,T as q,aw as Fe}from"./icons-G0rMFC4M.js";async function Ke(){const s=await fetch("/api/cliproxy/sync/status");if(!s.ok){let n="Failed to fetch sync status";try{const t=await s.json();n=t.error||t.message||n}catch{}throw new Error(n)}return s.json()}async function Be(){const s=new AbortController,n=setTimeout(()=>s.abort(),3e4);try{const t=await fetch("/api/cliproxy/sync",{method:"POST",headers:{"Content-Type":"application/json"},signal:s.signal});if(!t.ok){let a="Sync failed";try{const r=await t.json();a=r.error||r.message||a}catch{}throw new Error(a)}return t.json()}catch(t){throw t instanceof Error&&t.name==="AbortError"?new Error("Sync request timed out after 30 seconds"):t}finally{clearTimeout(n)}}function Qe(){return R({queryKey:["cliproxy-sync-status"],queryFn:Ke,refetchInterval:3e4,retry:1,staleTime:1e4})}function ze(){const s=ve();return Ce({mutationFn:Be,onSuccess:n=>{s.invalidateQueries({queryKey:["cliproxy-sync-status"]}),s.invalidateQueries({queryKey:["cliproxy-sync-preview"]}),n.syncedCount===0?V.info("No profiles to sync"):V.success(`Synced ${n.syncedCount} profile${n.syncedCount===1?"":"s"} to CLIProxy`)},onError:n=>{V.error(`Sync failed: ${n.message}`)}})}function A(s,n){const t=s.replace(/-\d+$/,"").split(".").map(Number),a=n.replace(/-\d+$/,"").split(".").map(Number);for(let r=0;r<3;r++){if((t[r]||0)>(a[r]||0))return!0;if((t[r]||0)<(a[r]||0))return!1}return!1}function Ge(s){if(!s)return"";const n=new Date(s).getTime(),a=Date.now()-n,r=Math.floor(a/(1e3*60*60)),i=Math.floor(a%(1e3*60*60)/(1e3*60));return r>0?`${r}h ${i}m`:`${i}m`}function He(s){if(!s)return"";const n=Date.now()-s,t=Math.floor(n/(1e3*60)),a=Math.floor(n/(1e3*60*60));return t<1?"just now":t<60?`${t}m ago`:`${a}h ago`}function N({icon:s,tooltip:n,onClick:t,disabled:a,isPending:r,className:i,variant:l="ghost"}){return e.jsxs(xe,{children:[e.jsx(me,{asChild:!0,children:e.jsx(T,{variant:l==="destructive-ghost"?"ghost":l,size:"sm",className:d("h-7 w-7 p-0",l==="destructive-ghost"&&"hover:bg-destructive/10 hover:text-destructive hover:border-destructive/30",i),onClick:t,disabled:a,children:r?e.jsx(f,{className:"w-3.5 h-3.5 animate-spin"}):e.jsx(s,{className:"w-3.5 h-3.5"})})}),e.jsx(ue,{side:"bottom",className:"text-xs",children:n})]})}function es(){const{data:s,isLoading:n}=Z(),{data:t}=_(),{data:a,isLoading:r}=J(),i=W(),l=ee(),w=se(),u=te(),{data:L}=Qe(),{mutate:M,isPending:v}=ze(),[h,D]=y.useState(!1),[g,F]=y.useState(""),[K,b]=y.useState(!1),[C,S]=y.useState(null),{data:B}=R({queryKey:["cliproxy-server-config"],queryFn:()=>he.cliproxyServer.get(),staleTime:3e4}),Q=Se({mutationKey:["update-backend"]})>0,x=B?.remote,I=x?.enabled&&x?.host,p=s?.running??!1,k=i.isPending||l.isPending||w.isPending||u.isPending||Q||v,z=t?.hasUpdate??!1,m=t?.isStable===!1,U=t?.currentVersion,j=L?.configured??!1,G=j?"Sync Ready":"No Config",P=m?t?.maxStableVersion||a?.latestStable:t?.latestVersion,$=o=>{if(!o)return;const c=a?.maxStableVersion||"6.6.80";if(A(o,c)){S(o),b(!0);return}u.mutate({version:o})},H=()=>{C&&u.mutate({version:C,force:!0}),b(!1),S(null)},O=()=>{b(!1),S(null)},X=I?(()=>{const o=x.protocol||"http",c=x.port||(o==="https"?443:80);return o==="https"&&c===443||o==="http"&&c===80?x.host:`${x.host}:${c}`})():null;return I?e.jsxs("div",{className:d("rounded-lg border p-3 transition-colors","border-blue-500/30 bg-blue-500/5"),children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ke,{className:"w-4 h-4 text-blue-500"}),e.jsx("span",{className:"text-sm font-medium",children:"Remote Proxy"}),e.jsx(E,{variant:"secondary",className:"text-[10px] h-4 px-1.5 bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",children:"Active"})]}),e.jsx(Pe,{className:"w-3 h-3 text-blue-600"})]}),e.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:[e.jsx("div",{className:"flex items-center gap-1 mb-1",children:e.jsx("span",{className:"font-mono",children:X})}),e.jsx("p",{className:"text-[10px] text-muted-foreground/70 leading-tight",children:"Traffic auto-routed to remote server"})]})]}):e.jsx(ae,{delayDuration:300,children:e.jsxs("div",{className:d("rounded-lg border p-3 transition-colors",p?"border-green-500/30 bg-green-500/5":"border-muted bg-muted/30"),children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:d("w-2 h-2 rounded-full",p?"bg-green-500 animate-pulse":"bg-muted-foreground/30")}),e.jsx("span",{className:"text-sm font-medium",children:t?.backendLabel??"CLIProxy"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[n?e.jsx(f,{className:"w-3 h-3 animate-spin text-muted-foreground"}):p?e.jsxs(e.Fragment,{children:[e.jsx(N,{icon:v?f:Ve,tooltip:"Sync profiles to CLIProxy",onClick:()=>M(),disabled:!j||k,isPending:v}),e.jsx(N,{icon:Ae,tooltip:"Restart",onClick:()=>w.mutate(),disabled:k,isPending:w.isPending}),e.jsx(N,{icon:Te,tooltip:"Stop",onClick:()=>l.mutate(),disabled:k,isPending:l.isPending,variant:"destructive-ghost"})]}):null,e.jsx(N,{icon:h?De:Ie,tooltip:h?"Close":"Version settings",onClick:()=>D(!h),className:h?"bg-muted":void 0})]})]}),U&&e.jsxs("div",{className:"mt-1.5 flex items-center gap-2",children:[e.jsxs("span",{className:d("text-xs font-mono text-muted-foreground",m&&"text-amber-600 dark:text-amber-400"),children:["v",U]}),(z||m)&&P&&e.jsxs(E,{variant:"secondary",className:d("text-[10px] h-4 px-1.5 gap-0.5 cursor-pointer transition-colors",m?"bg-amber-100 text-amber-700 hover:bg-amber-200 dark:bg-amber-900/30 dark:text-amber-400 dark:hover:bg-amber-900/50":"bg-green-100 text-green-700 hover:bg-green-200 dark:bg-green-900/30 dark:text-green-400 dark:hover:bg-green-900/50"),onClick:()=>$(P),title:`Click to ${m?"downgrade":"update"}`,children:[m?e.jsx(Ue,{className:"w-2.5 h-2.5"}):e.jsx($e,{className:"w-2.5 h-2.5"}),P]})]}),p&&s&&e.jsxs("div",{className:"mt-2 flex items-center gap-4 text-xs text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:["Port ",s.port]}),s.sessionCount!==void 0&&s.sessionCount>0&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Ee,{className:"w-3 h-3"}),s.sessionCount," session",s.sessionCount!==1?"s":""]}),s.startedAt&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(qe,{className:"w-3 h-3"}),Ge(s.startedAt)]})]}),e.jsxs("div",{className:"mt-2 flex items-center gap-1.5 text-xs",children:[j?e.jsx(Re,{className:"w-3 h-3 text-green-600 dark:text-green-400"}):e.jsx(Le,{className:"w-3 h-3 text-muted-foreground"}),e.jsx("span",{className:d("text-xs",j?"text-green-600 dark:text-green-400":"text-muted-foreground"),children:G})]}),e.jsx(ne,{open:h,onOpenChange:D,children:e.jsxs(re,{className:"mt-3 pt-3 border-t border-muted",children:[e.jsx("h4",{className:"text-xs font-medium text-muted-foreground mb-3",children:"Version Management"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(oe,{value:g,onValueChange:F,disabled:r,children:[e.jsx(ie,{className:"h-8 text-xs flex-1",children:e.jsx(le,{placeholder:"Select version to install..."})}),e.jsx(ce,{children:a?.versions.slice(0,20).map(o=>{const c=a?.maxStableVersion&&A(o,a.maxStableVersion);return e.jsx(de,{value:o,className:"text-xs",children:e.jsxs("span",{className:"flex items-center gap-2",children:["v",o,o===a.latestStable&&e.jsx("span",{className:"text-green-600 dark:text-green-400",children:"(stable)"}),c&&e.jsx("span",{className:"text-amber-600 dark:text-amber-400",children:"⚠"})]})},o)})})]}),e.jsxs(T,{variant:"outline",size:"sm",className:"h-8 text-xs gap-1.5 px-3",onClick:()=>$(g),disabled:u.isPending||!g,children:[u.isPending?e.jsx(f,{className:"w-3.5 h-3.5 animate-spin"}):e.jsx(Me,{className:"w-3.5 h-3.5"}),"Install"]})]}),g&&a?.maxStableVersion&&A(g,a.maxStableVersion)&&e.jsxs("div",{className:"mt-2 flex items-center gap-1.5 text-[11px] text-amber-600 dark:text-amber-400",children:[e.jsx(q,{className:"w-3.5 h-3.5 flex-shrink-0"}),e.jsxs("span",{children:["Versions above ",a.maxStableVersion," have known issues"]})]}),t?.checkedAt&&e.jsxs("div",{className:"mt-2 text-[10px] text-muted-foreground/60",children:["Last checked ",He(t.checkedAt)]})]})}),!p&&e.jsxs("div",{className:"mt-2 flex items-center justify-between",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:"Not running"}),e.jsxs(T,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1",onClick:()=>i.mutate(),disabled:i.isPending,children:[i.isPending?e.jsx(f,{className:"w-3 h-3 animate-spin"}):e.jsx(Fe,{className:"w-3 h-3"}),"Start"]})]}),e.jsx(ge,{open:K,onOpenChange:b,children:e.jsxs(pe,{children:[e.jsxs(fe,{children:[e.jsxs(be,{className:"flex items-center gap-2",children:[e.jsx(q,{className:"w-5 h-5 text-amber-500"}),"Install Unstable Version?"]}),e.jsxs(je,{className:"space-y-2",children:[e.jsxs("p",{children:["You are about to install ",e.jsxs("strong",{children:["v",C]}),", which is above the maximum stable version"," ",e.jsxs("strong",{children:["v",a?.maxStableVersion||"6.6.80"]}),"."]}),e.jsx("p",{className:"text-amber-600 dark:text-amber-400",children:"This version has known stability issues and may cause unexpected behavior."}),e.jsx("p",{children:"Are you sure you want to proceed?"})]})]}),e.jsxs(ye,{children:[e.jsx(Ne,{onClick:O,children:"Cancel"}),e.jsx(we,{onClick:H,className:"bg-amber-500 hover:bg-amber-600 text-white",children:"Install Anyway"})]})]})})]})})}export{es as P};
@@ -0,0 +1 @@
1
+ import{j as s}from"./radix-ui-qEZD5MMp.js";import{r as l}from"./react-vendor-CNOkPC89.js";import{aO as o,aP as m,aQ as c,aR as x,aS as u,b as h,C as p,a as g}from"./index-gkEvbSRZ.js";import{O as j,a1 as f,B as N,T as b}from"./icons-G0rMFC4M.js";import"./tanstack-De4wvi8X.js";import"./notifications-B2HqRBj7.js";import"./utils-CzKF5WmX.js";import"./form-utils-C-pVd1--.js";import"./code-highlight-BRUf_pqB.js";function B(){const[t,i]=l.useState("commands"),{data:e}=o(),{data:n,isLoading:r}=m(t),d=[{id:"commands",label:"Commands",icon:j,count:e?.commands??0},{id:"skills",label:"Skills",icon:f,count:e?.skills??0},{id:"agents",label:"Agents",icon:N,count:e?.agents??0}];return s.jsxs("div",{className:"p-6 max-w-6xl mx-auto space-y-8",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold",children:"Shared Data"}),s.jsx("p",{className:"text-muted-foreground",children:"Commands, skills, and agents shared across Claude instances"})]}),e&&!e.symlinkStatus.valid&&s.jsxs(c,{variant:"warning",children:[s.jsx(b,{className:"h-4 w-4"}),s.jsx(x,{children:"Configuration Required"}),s.jsxs(u,{children:[e.symlinkStatus.message,". Run `ccs sync` to configure."]})]}),s.jsx("div",{className:"flex gap-2 border-b pb-2",children:d.map(a=>s.jsxs(h,{variant:t===a.id?"default":"ghost",size:"sm",onClick:()=>i(a.id),className:"flex items-center gap-2",children:[s.jsx(a.icon,{className:"w-4 h-4"}),a.label," (",a.count,")"]},a.id))}),s.jsx("div",{className:"mt-4",children:r?s.jsx("div",{className:"text-muted-foreground",children:"Loading..."}):n?.items.length===0?s.jsxs("div",{className:"text-muted-foreground",children:["No ",t," found"]}):s.jsx("div",{className:"grid gap-3",children:n?.items.map(a=>s.jsx(p,{children:s.jsxs(g,{children:[s.jsx("div",{className:"font-medium",children:a.name}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:a.description}),s.jsx("p",{className:"text-xs text-muted-foreground mt-2 font-mono truncate",children:a.path})]})},a.name))})})]})}export{B as SharedPage};
@@ -1 +1 @@
1
- import{j as a,a2 as s,a3 as n}from"./radix-ui-qEZD5MMp.js";import"./react-vendor-CNOkPC89.js";import{c as e}from"./index-DyigGY6D.js";function c({className:t,...r}){return a.jsx(s,{"data-slot":"switch",className:e("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),...r,children:a.jsx(n,{"data-slot":"switch-thumb",className:e("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}export{c as S};
1
+ import{j as a,a2 as s,a3 as n}from"./radix-ui-qEZD5MMp.js";import"./react-vendor-CNOkPC89.js";import{c as e}from"./index-gkEvbSRZ.js";function c({className:t,...r}){return a.jsx(s,{"data-slot":"switch",className:e("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),...r,children:a.jsx(n,{"data-slot":"switch-thumb",className:e("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}export{c as S};
@@ -24,16 +24,16 @@
24
24
  href="https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap"
25
25
  rel="stylesheet"
26
26
  />
27
- <script type="module" crossorigin src="/assets/index-DyigGY6D.js"></script>
27
+ <script type="module" crossorigin src="/assets/index-gkEvbSRZ.js"></script>
28
28
  <link rel="modulepreload" crossorigin href="/assets/react-vendor-CNOkPC89.js">
29
29
  <link rel="modulepreload" crossorigin href="/assets/radix-ui-qEZD5MMp.js">
30
30
  <link rel="modulepreload" crossorigin href="/assets/tanstack-De4wvi8X.js">
31
31
  <link rel="modulepreload" crossorigin href="/assets/notifications-B2HqRBj7.js">
32
- <link rel="modulepreload" crossorigin href="/assets/icons-D5eAI-GR.js">
32
+ <link rel="modulepreload" crossorigin href="/assets/icons-G0rMFC4M.js">
33
33
  <link rel="modulepreload" crossorigin href="/assets/utils-CzKF5WmX.js">
34
34
  <link rel="modulepreload" crossorigin href="/assets/form-utils-C-pVd1--.js">
35
35
  <link rel="modulepreload" crossorigin href="/assets/code-highlight-BRUf_pqB.js">
36
- <link rel="stylesheet" crossorigin href="/assets/index-ByiEOnlQ.css">
36
+ <link rel="stylesheet" crossorigin href="/assets/index-Bqle3SG4.css">
37
37
  </head>
38
38
  <body>
39
39
  <div id="root"></div>
@@ -2,5 +2,15 @@
2
2
  * Cursor Routes - Cursor IDE integration via cursor proxy daemon
3
3
  */
4
4
  declare const router: import("express-serve-static-core").Router;
5
+ interface DaemonStartPreconditionInput {
6
+ enabled: boolean;
7
+ authenticated: boolean;
8
+ tokenExpired?: boolean;
9
+ }
10
+ interface DaemonStartPreconditionError {
11
+ status: number;
12
+ error: string;
13
+ }
14
+ export declare function getDaemonStartPreconditionError(input: DaemonStartPreconditionInput): DaemonStartPreconditionError | null;
5
15
  export default router;
6
16
  //# sourceMappingURL=cursor-routes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cursor-routes.d.ts","sourceRoot":"","sources":["../../../src/web-server/routes/cursor-routes.ts"],"names":[],"mappings":"AAAA;;GAEG;AAaH,QAAA,MAAM,MAAM,4CAAW,CAAC;AAqKxB,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"cursor-routes.d.ts","sourceRoot":"","sources":["../../../src/web-server/routes/cursor-routes.ts"],"names":[],"mappings":"AAAA;;GAEG;AAkBH,QAAA,MAAM,MAAM,4CAAW,CAAC;AAExB,UAAU,4BAA4B;IACpC,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,EAAE,OAAO,CAAC;IACvB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,UAAU,4BAA4B;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,+BAA+B,CAC7C,KAAK,EAAE,4BAA4B,GAClC,4BAA4B,GAAG,IAAI,CAuBrC;AAiJD,eAAe,MAAM,CAAC"}
@@ -6,59 +6,50 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
6
6
  return (mod && mod.__esModule) ? mod : { "default": mod };
7
7
  };
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.getDaemonStartPreconditionError = void 0;
9
10
  const express_1 = require("express");
10
- const cursor_auth_1 = require("../../cursor/cursor-auth");
11
+ const cursor_1 = require("../../cursor");
11
12
  const unified_config_loader_1 = require("../../config/unified-config-loader");
12
13
  const cursor_settings_routes_1 = __importDefault(require("./cursor-settings-routes"));
13
14
  const router = (0, express_1.Router)();
15
+ function getDaemonStartPreconditionError(input) {
16
+ if (!input.enabled) {
17
+ return {
18
+ status: 400,
19
+ error: 'Cursor integration is disabled. Enable it before starting daemon.',
20
+ };
21
+ }
22
+ if (!input.authenticated) {
23
+ return {
24
+ status: 401,
25
+ error: 'Cursor authentication required. Import credentials before starting daemon.',
26
+ };
27
+ }
28
+ if (input.tokenExpired) {
29
+ return {
30
+ status: 401,
31
+ error: 'Cursor credentials expired. Re-authenticate before starting daemon.',
32
+ };
33
+ }
34
+ return null;
35
+ }
36
+ exports.getDaemonStartPreconditionError = getDaemonStartPreconditionError;
14
37
  // Mount settings sub-routes
15
38
  router.use('/settings', cursor_settings_routes_1.default);
16
- /**
17
- * Get daemon status
18
- * TODO: Implement in cursor-executor.ts (#520)
19
- */
20
- async function getDaemonStatus(port) {
21
- // Stub - will be implemented in #520
22
- return { running: false, port };
23
- }
24
- /**
25
- * Get available models
26
- * TODO: Implement in cursor-executor.ts (#520)
27
- */
28
- async function getAvailableModels() {
29
- // Stub - will be implemented in #520
30
- return []; // TODO: populated by cursor-models.ts (#520)
31
- }
32
- /**
33
- * Start daemon
34
- * TODO: Implement in cursor-executor.ts (#520)
35
- */
36
- async function startDaemon(port, ghostMode) {
37
- // Stub - will be implemented in #520
38
- return {
39
- success: false,
40
- message: `Daemon start not implemented (port: ${port}, ghost: ${ghostMode})`,
41
- };
42
- }
43
- /**
44
- * Stop daemon
45
- * TODO: Implement in cursor-executor.ts (#520)
46
- */
47
- async function stopDaemon() {
48
- // Stub - will be implemented in #520
49
- return { success: false, message: 'Daemon stop not implemented' };
50
- }
51
39
  /**
52
40
  * GET /api/cursor/status - Get Cursor status (auth + daemon)
53
41
  */
54
42
  router.get('/status', async (_req, res) => {
55
43
  try {
56
44
  const cursorConfig = (0, unified_config_loader_1.getCursorConfig)();
57
- const authStatus = (0, cursor_auth_1.checkAuthStatus)();
58
- const daemonStatus = await getDaemonStatus(cursorConfig.port);
45
+ const authStatus = (0, cursor_1.checkAuthStatus)();
46
+ const daemonStatus = await (0, cursor_1.getDaemonStatus)(cursorConfig.port);
59
47
  res.json({
60
48
  enabled: cursorConfig.enabled,
61
49
  authenticated: authStatus.authenticated,
50
+ auth_method: authStatus.credentials?.authMethod ?? null,
51
+ token_age: authStatus.tokenAge ?? null,
52
+ token_expired: authStatus.expired ?? false,
62
53
  daemon_running: daemonStatus.running,
63
54
  port: cursorConfig.port,
64
55
  auto_start: cursorConfig.auto_start,
@@ -80,12 +71,12 @@ router.post('/auth/import', async (req, res) => {
80
71
  return;
81
72
  }
82
73
  // Validate token format
83
- if (!(0, cursor_auth_1.validateToken)(accessToken, machineId)) {
74
+ if (!(0, cursor_1.validateToken)(accessToken, machineId)) {
84
75
  res.status(400).json({ error: 'Invalid token or machine ID format' });
85
76
  return;
86
77
  }
87
78
  // Save credentials
88
- (0, cursor_auth_1.saveCredentials)({
79
+ (0, cursor_1.saveCredentials)({
89
80
  accessToken,
90
81
  machineId,
91
82
  authMethod: 'manual',
@@ -102,13 +93,13 @@ router.post('/auth/import', async (req, res) => {
102
93
  */
103
94
  router.post('/auth/auto-detect', async (_req, res) => {
104
95
  try {
105
- const result = (0, cursor_auth_1.autoDetectTokens)();
96
+ const result = (0, cursor_1.autoDetectTokens)();
106
97
  if (!result.found || !result.accessToken || !result.machineId) {
107
98
  res.status(404).json({ error: result.error ?? 'Token not found' });
108
99
  return;
109
100
  }
110
101
  // Save credentials
111
- (0, cursor_auth_1.saveCredentials)({
102
+ (0, cursor_1.saveCredentials)({
112
103
  accessToken: result.accessToken,
113
104
  machineId: result.machineId,
114
105
  authMethod: 'auto-detect',
@@ -125,8 +116,9 @@ router.post('/auth/auto-detect', async (_req, res) => {
125
116
  */
126
117
  router.get('/models', async (_req, res) => {
127
118
  try {
128
- const models = await getAvailableModels();
129
- res.json({ models });
119
+ const cursorConfig = (0, unified_config_loader_1.getCursorConfig)();
120
+ const models = await (0, cursor_1.getAvailableModels)(cursorConfig.port);
121
+ res.json({ models, current: (0, cursor_1.getDefaultModel)() });
130
122
  }
131
123
  catch (error) {
132
124
  res.status(500).json({ error: error.message });
@@ -139,7 +131,23 @@ router.get('/models', async (_req, res) => {
139
131
  router.post('/daemon/start', async (_req, res) => {
140
132
  try {
141
133
  const cursorConfig = (0, unified_config_loader_1.getCursorConfig)();
142
- const result = await startDaemon(cursorConfig.port, cursorConfig.ghost_mode);
134
+ const authStatus = (0, cursor_1.checkAuthStatus)();
135
+ const preconditionError = getDaemonStartPreconditionError({
136
+ enabled: cursorConfig.enabled,
137
+ authenticated: authStatus.authenticated,
138
+ tokenExpired: authStatus.expired ?? false,
139
+ });
140
+ if (preconditionError) {
141
+ res.status(preconditionError.status).json({
142
+ success: false,
143
+ error: preconditionError.error,
144
+ });
145
+ return;
146
+ }
147
+ const result = await (0, cursor_1.startDaemon)({
148
+ port: cursorConfig.port,
149
+ ghost_mode: cursorConfig.ghost_mode,
150
+ });
143
151
  res.json(result);
144
152
  }
145
153
  catch (error) {
@@ -152,7 +160,7 @@ router.post('/daemon/start', async (_req, res) => {
152
160
  */
153
161
  router.post('/daemon/stop', async (_req, res) => {
154
162
  try {
155
- const result = await stopDaemon();
163
+ const result = await (0, cursor_1.stopDaemon)();
156
164
  res.json(result);
157
165
  }
158
166
  catch (error) {
@@ -1 +1 @@
1
- {"version":3,"file":"cursor-routes.js","sourceRoot":"","sources":["../../../src/web-server/routes/cursor-routes.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;AAGH,qCAAiC;AACjC,0DAKkC;AAClC,8EAAqE;AACrE,sFAA4D;AAE5D,MAAM,MAAM,GAAG,IAAA,gBAAM,GAAE,CAAC;AAExB,4BAA4B;AAC5B,MAAM,CAAC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AAI,CAAC,cAAc,EAAE,KAAK,EAAE,IAAa,EAAE,GAAa,EAAiB,EAAE;IAChF,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,IAAA,mBAAU,GAAE,CAAC;QAClC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACnB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAG,KAAe,CAAC,OAAO,EAAE,CAAC,CAAC;IAC5D,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,kBAAe,MAAM,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"cursor-settings-routes.d.ts","sourceRoot":"","sources":["../../../src/web-server/routes/cursor-settings-routes.ts"],"names":[],"mappings":"AAAA;;GAEG;AAcH,QAAA,MAAM,MAAM,4CAAW,CAAC;AAyJxB,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"cursor-settings-routes.d.ts","sourceRoot":"","sources":["../../../src/web-server/routes/cursor-settings-routes.ts"],"names":[],"mappings":"AAAA;;GAEG;AAcH,QAAA,MAAM,MAAM,4CAAW,CAAC;AA4LxB,eAAe,MAAM,CAAC"}
@@ -33,6 +33,28 @@ const config_manager_1 = require("../../utils/config-manager");
33
33
  const unified_config_types_1 = require("../../config/unified-config-types");
34
34
  const unified_config_loader_1 = require("../../config/unified-config-loader");
35
35
  const router = (0, express_1.Router)();
36
+ function parseLocalCursorPort(settings) {
37
+ if (typeof settings !== 'object' || settings === null)
38
+ return null;
39
+ const env = settings.env;
40
+ if (typeof env !== 'object' || env === null)
41
+ return null;
42
+ const baseUrl = env.ANTHROPIC_BASE_URL;
43
+ if (typeof baseUrl !== 'string' || !baseUrl)
44
+ return null;
45
+ try {
46
+ const parsed = new URL(baseUrl);
47
+ if (parsed.hostname !== '127.0.0.1' && parsed.hostname !== 'localhost')
48
+ return null;
49
+ const port = Number(parsed.port);
50
+ if (!Number.isInteger(port) || port < 1 || port > 65535)
51
+ return null;
52
+ return port;
53
+ }
54
+ catch {
55
+ return null;
56
+ }
57
+ }
36
58
  /**
37
59
  * GET /api/cursor/settings - Get cursor config (port, auto_start, ghost_mode)
38
60
  */
@@ -116,7 +138,7 @@ router.get('/raw', (_req, res) => {
116
138
  res.json({
117
139
  settings: defaultSettings,
118
140
  mtime: Date.now(),
119
- path: settingsPath,
141
+ path: '~/.ccs/cursor.settings.json',
120
142
  exists: false,
121
143
  });
122
144
  return;
@@ -127,7 +149,7 @@ router.get('/raw', (_req, res) => {
127
149
  res.json({
128
150
  settings,
129
151
  mtime: stat.mtimeMs,
130
- path: settingsPath,
152
+ path: '~/.ccs/cursor.settings.json',
131
153
  exists: true,
132
154
  });
133
155
  }
@@ -147,9 +169,16 @@ router.put('/raw', (req, res) => {
147
169
  return;
148
170
  }
149
171
  const settingsPath = path.join((0, config_manager_1.getCcsDir)(), 'cursor.settings.json');
150
- // Check for conflict if file exists and expectedMtime provided
151
- if (fs.existsSync(settingsPath) && expectedMtime) {
172
+ // For existing files, expectedMtime is required to prevent blind overwrite races.
173
+ if (fs.existsSync(settingsPath)) {
152
174
  const stat = fs.statSync(settingsPath);
175
+ if (typeof expectedMtime !== 'number' || !Number.isFinite(expectedMtime)) {
176
+ res.status(409).json({
177
+ error: 'File metadata not loaded. Refresh and retry.',
178
+ mtime: stat.mtimeMs,
179
+ });
180
+ return;
181
+ }
153
182
  if (Math.abs(stat.mtimeMs - expectedMtime) > 1000) {
154
183
  res.status(409).json({ error: 'File modified externally', mtime: stat.mtimeMs });
155
184
  return;
@@ -159,7 +188,16 @@ router.put('/raw', (req, res) => {
159
188
  const tempPath = settingsPath + '.tmp';
160
189
  fs.writeFileSync(tempPath, JSON.stringify(settings, null, 2) + '\n');
161
190
  fs.renameSync(tempPath, settingsPath);
162
- // TODO: Sync raw settings back to unified config when cursor-daemon is integrated (#520)
191
+ // Keep unified config aligned with raw settings edits (parity with Copilot raw editor).
192
+ const parsedPort = parseLocalCursorPort(settings);
193
+ if (parsedPort) {
194
+ const config = (0, unified_config_loader_1.loadOrCreateUnifiedConfig)();
195
+ config.cursor = {
196
+ ...(config.cursor ?? unified_config_types_1.DEFAULT_CURSOR_CONFIG),
197
+ port: parsedPort,
198
+ };
199
+ (0, unified_config_loader_1.saveUnifiedConfig)(config);
200
+ }
163
201
  const stat = fs.statSync(settingsPath);
164
202
  res.json({ success: true, mtime: stat.mtimeMs });
165
203
  }
@@ -1 +1 @@
1
- {"version":3,"file":"cursor-settings-routes.js","sourceRoot":"","sources":["../../../src/web-server/routes/cursor-settings-routes.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;AAGH,qCAAiC;AACjC,uCAAyB;AACzB,2CAA6B;AAC7B,+DAAuD;AACvD,4EAA0E;AAC1E,8EAI4C;AAE5C,MAAM,MAAM,GAAG,IAAA,gBAAM,GAAE,CAAC;AAExB;;GAEG;AACH,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,IAAa,EAAE,GAAa,EAAQ,EAAE;IACrD,IAAI,CAAC;QACH,MAAM,YAAY,GAAG,IAAA,uCAAe,GAAE,CAAC;QACvC,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IACzB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAG,KAAe,CAAC,OAAO,EAAE,CAAC,CAAC;IAC5D,CAAC;AACH,CAAC,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,GAAY,EAAE,GAAa,EAAQ,EAAE;IACpD,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,GAAG,CAAC,IAAI,CAAC;QAEzB,2BAA2B;QAC3B,IAAI,CAAC,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAA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AE,KAAK,EAAG,KAAe,CAAC,OAAO,EAAE,CAAC,CAAC;IAC5D,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,kBAAe,MAAM,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kaitranntt/ccs",
3
- "version": "7.43.0-dev.13",
3
+ "version": "7.43.0-dev.15",
4
4
  "description": "Claude Code Switch - Instant profile switching between Claude Sonnet 4.5 and GLM 4.6",
5
5
  "keywords": [
6
6
  "cli",
@@ -1 +0,0 @@
1
- import{j as e}from"./radix-ui-qEZD5MMp.js";import{r as p}from"./react-vendor-CNOkPC89.js";import{u as D,a as b,b as N,d as A,f as y,g as T}from"./tanstack-De4wvi8X.js";import{c as m,ae as f,b as d,a4 as k,a5 as R,a6 as S,a7 as z,a8 as P,L as C,I as q}from"./index-DyigGY6D.js";import{A as F,a as _,b as K,c as L,d as M,e as $,f as E,g as H}from"./alert-dialog-B9Uu5j7u.js";import{t as u}from"./notifications-B2HqRBj7.js";import{v as Q,j,ag as O,y as I,l as v,$ as B}from"./icons-D5eAI-GR.js";import"./utils-CzKF5WmX.js";import"./form-utils-C-pVd1--.js";import"./code-highlight-BRUf_pqB.js";function U({className:t,...s}){return e.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:e.jsx("table",{"data-slot":"table",className:m("w-full caption-bottom text-sm",t),...s})})}function V({className:t,...s}){return e.jsx("thead",{"data-slot":"table-header",className:m("[&_tr]:border-b",t),...s})}function Z({className:t,...s}){return e.jsx("tbody",{"data-slot":"table-body",className:m("[&_tr:last-child]:border-0",t),...s})}function w({className:t,...s}){return e.jsx("tr",{"data-slot":"table-row",className:m("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",t),...s})}function G({className:t,...s}){return e.jsx("th",{"data-slot":"table-head",className:m("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),...s})}function J({className:t,...s}){return e.jsx("td",{"data-slot":"table-cell",className:m("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),...s})}function W(){return D({queryKey:["accounts"],queryFn:()=>f.accounts.list()})}function X(){const t=b();return N({mutationFn:s=>f.accounts.setDefault(s),onSuccess:(s,l)=>{t.invalidateQueries({queryKey:["accounts"]}),u.success(`Default account set to "${l}"`)},onError:s=>{u.error(s.message)}})}function Y(){const t=b();return N({mutationFn:()=>f.accounts.resetDefault(),onSuccess:()=>{t.invalidateQueries({queryKey:["accounts"]}),u.success("Default account reset to CCS")},onError:s=>{u.error(s.message)}})}function ee(){const t=b();return N({mutationFn:s=>f.accounts.delete(s),onSuccess:(s,l)=>{t.invalidateQueries({queryKey:["accounts"]}),u.success(`Account "${l}" deleted`)},onError:s=>{u.error(s.message)}})}function se({data:t,defaultAccount:s}){const l=X(),i=ee(),r=Y(),[c,o]=p.useState(null),x=A({data:t,columns:[{accessorKey:"name",header:"Name",size:200,cell:({row:a})=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-medium",children:a.original.name}),a.original.name===s&&e.jsx("span",{className:"text-xs bg-primary/10 text-primary px-1.5 py-0.5 rounded border border-primary/20",children:"default"})]})},{accessorKey:"type",header:"Type",size:100,cell:({row:a})=>e.jsx("span",{className:"capitalize text-muted-foreground",children:a.original.type||"oauth"})},{accessorKey:"created",header:"Created",size:150,cell:({row:a})=>{const n=new Date(a.original.created);return e.jsx("span",{className:"text-muted-foreground",children:n.toLocaleDateString()})}},{accessorKey:"last_used",header:"Last Used",size:150,cell:({row:a})=>{if(!a.original.last_used)return e.jsx("span",{className:"text-muted-foreground/50",children:"-"});const n=new Date(a.original.last_used);return e.jsx("span",{className:"text-muted-foreground",children:n.toLocaleDateString()})}},{id:"actions",header:"Actions",size:180,cell:({row:a})=>{const n=a.original.name===s,h=l.isPending||i.isPending;return e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsxs(d,{variant:n?"secondary":"default",size:"sm",className:"h-8 px-2",disabled:n||h,onClick:()=>l.mutate(a.original.name),children:[e.jsx(j,{className:`w-3 h-3 mr-1 ${n?"opacity-50":""}`}),n?"Active":"Set Default"]}),e.jsx(d,{variant:"ghost",size:"sm",className:"h-8 px-2 text-destructive hover:text-destructive hover:bg-destructive/10",disabled:n||h,onClick:()=>o(a.original.name),title:n?"Cannot delete default account":"Delete account",children:e.jsx(O,{className:"w-4 h-4"})})]})}}],getCoreRowModel:T()});return t.length===0?e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:["No accounts found. Use"," ",e.jsx("code",{className:"text-sm bg-muted px-1 rounded",children:"ccs auth create"})," to add accounts."]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"border rounded-md",children:e.jsxs(U,{children:[e.jsx(V,{children:x.getHeaderGroups().map(a=>e.jsx(w,{children:a.headers.map(n=>{const h={name:"w-[200px]",type:"w-[100px]",created:"w-[150px]",last_used:"w-[150px]",actions:"w-[180px]"}[n.id]||"w-auto";return e.jsx(G,{className:h,children:n.isPlaceholder?null:y(n.column.columnDef.header,n.getContext())},n.id)})},a.id))}),e.jsx(Z,{children:x.getRowModel().rows.map(a=>e.jsx(w,{children:a.getVisibleCells().map(n=>e.jsx(J,{children:y(n.column.columnDef.cell,n.getContext())},n.id))},a.id))})]})}),s&&e.jsx("div",{className:"flex justify-end",children:e.jsxs(d,{variant:"outline",size:"sm",onClick:()=>r.mutate(),disabled:r.isPending,children:[e.jsx(Q,{className:"w-4 h-4 mr-2"}),"Reset to CCS Default"]})})]}),e.jsx(F,{open:!!c,onOpenChange:a=>!a&&o(null),children:e.jsxs(_,{children:[e.jsxs(K,{children:[e.jsx(L,{children:"Delete Account"}),e.jsxs(M,{children:['Are you sure you want to delete the account "',c,'"? This will remove the profile and all its session data. This action cannot be undone.']})]}),e.jsxs($,{children:[e.jsx(E,{children:"Cancel"}),e.jsx(H,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{c&&(i.mutate(c),o(null))},children:"Delete"})]})]})})]})}function te({open:t,onClose:s}){const[l,i]=p.useState(""),[r,c]=p.useState(!1),o=/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(l),g=l?`ccs auth create ${l}`:"ccs auth create <name>",x=async()=>{o&&(await navigator.clipboard.writeText(g),c(!0),setTimeout(()=>c(!1),2e3))},a=()=>{i(""),c(!1),s()};return e.jsx(k,{open:t,onOpenChange:n=>!n&&a(),children:e.jsxs(R,{className:"sm:max-w-md",children:[e.jsxs(S,{children:[e.jsx(z,{children:"Create New Account"}),e.jsx(P,{children:"Auth profiles require Claude CLI login. Run the command below in your terminal."})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(C,{htmlFor:"profile-name",children:"Profile Name"}),e.jsx(q,{id:"profile-name",value:l,onChange:n=>i(n.target.value),placeholder:"e.g., work, personal, client",autoComplete:"off"}),l&&!o&&e.jsx("p",{className:"text-xs text-destructive",children:"Name must start with a letter and contain only letters, numbers, dashes, or underscores."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(C,{children:"Command"}),e.jsxs("div",{className:"flex items-center gap-2 p-3 bg-muted rounded-md font-mono text-sm",children:[e.jsx(I,{className:"w-4 h-4 text-muted-foreground shrink-0"}),e.jsx("code",{className:"flex-1 break-all",children:g}),e.jsx(d,{variant:"ghost",size:"sm",className:"shrink-0 h-8 px-2",onClick:x,disabled:!o,children:r?e.jsx(j,{className:"w-4 h-4 text-green-500"}):e.jsx(v,{className:"w-4 h-4"})})]})]}),e.jsxs("div",{className:"text-sm text-muted-foreground space-y-1",children:[e.jsx("p",{children:"After running the command:"}),e.jsxs("ol",{className:"list-decimal list-inside pl-2 space-y-0.5",children:[e.jsx("li",{children:"Complete the Claude login in your browser"}),e.jsx("li",{children:"Return here and refresh to see the new account"})]})]}),e.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[e.jsx(d,{variant:"ghost",onClick:a,children:"Close"}),e.jsx(d,{onClick:x,disabled:!o,children:r?e.jsxs(e.Fragment,{children:[e.jsx(j,{className:"w-4 h-4 mr-2"}),"Copied!"]}):e.jsxs(e.Fragment,{children:[e.jsx(v,{className:"w-4 h-4 mr-2"}),"Copy Command"]})})]})]})]})})}function xe(){const{data:t,isLoading:s,refetch:l}=W(),[i,r]=p.useState(!1);return e.jsxs("div",{className:"p-6 max-w-6xl mx-auto space-y-8",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold",children:"Accounts"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Manage multi-account Claude sessions (profiles.json)"})]}),e.jsxs(d,{onClick:()=>r(!0),children:[e.jsx(B,{className:"w-4 h-4 mr-2"}),"Create Account"]})]}),s?e.jsx("div",{className:"text-muted-foreground",children:"Loading accounts..."}):e.jsx(se,{data:t?.accounts||[],defaultAccount:t?.default??null,onRefresh:l}),e.jsx(te,{open:i,onClose:()=>r(!1)})]})}export{xe as AccountsPage};
@@ -1 +0,0 @@
1
- import{j as e}from"./radix-ui-qEZD5MMp.js";import{r as c}from"./react-vendor-CNOkPC89.js";import{B as S,c as E,T as Ne,o as ve,p as be,b as g,I as y,m as I,L as T,q as M,r as ne,s as we,t as Ce,v as ye,w as Oe,S as W,x as L,y as $,z as re,A as Ae,D as Ee,E as ie,F as le,G as ce,H as Te,J as _e,K as X,M as Z,R as ke,N as q,C as Se,i as Re,j as Pe,O as Le,a as Me,Q as De,U as Ie,V as Ue,W as He}from"./index-DyigGY6D.js";import{a as Fe,u as Ke,b as ze}from"./tanstack-De4wvi8X.js";import{C as B,S as ee}from"./confirm-dialog-B75dfynE.js";import{t as Q}from"./notifications-B2HqRBj7.js";import{R as U,ag as oe,L as G,ah as Je,E as $e,d as Be,$ as D,I as Qe,ai as de,a0 as V,b as xe,aj as qe,_ as Ge,ak as Ve,m as me,X as Ye,Z as ue,al as We,a4 as Xe,a1 as he,am as Ze,q as fe}from"./icons-D5eAI-GR.js";import"./utils-CzKF5WmX.js";import"./form-utils-C-pVd1--.js";import"./code-highlight-BRUf_pqB.js";import"./alert-dialog-B9Uu5j7u.js";function es({className:s,showTooltip:t=!0}){const i=e.jsxs(S,{variant:"outline",className:E("bg-accent/10 border-accent/30 text-accent","dark:bg-accent/20 dark:border-accent/40 dark:text-accent-foreground",s),children:[e.jsx("img",{src:"/icons/openrouter.svg",alt:"OpenRouter",className:"mr-1 h-3 w-3"}),"OpenRouter"]});return t?e.jsxs(Ne,{children:[e.jsx(ve,{asChild:!0,children:i}),e.jsx(be,{children:e.jsx("p",{children:"Access 349+ models via OpenRouter"})})]}):i}function se(s){return[/^ANTHROPIC_AUTH_TOKEN$/,/_API_KEY$/,/_AUTH_TOKEN$/,/^API_KEY$/,/^AUTH_TOKEN$/,/_SECRET$/,/^SECRET$/].some(i=>i.test(s))}function pe(s){return s?.env?(s.env.ANTHROPIC_BASE_URL||"").toLowerCase().includes("openrouter.ai"):!1}function ss(s){return{opus:s.ANTHROPIC_DEFAULT_OPUS_MODEL||void 0,sonnet:s.ANTHROPIC_DEFAULT_SONNET_MODEL||void 0,haiku:s.ANTHROPIC_DEFAULT_HAIKU_MODEL||void 0}}function ts(s,t){const i={...s};return t.opus?i.ANTHROPIC_DEFAULT_OPUS_MODEL=t.opus:delete i.ANTHROPIC_DEFAULT_OPUS_MODEL,t.sonnet?i.ANTHROPIC_DEFAULT_SONNET_MODEL=t.sonnet:delete i.ANTHROPIC_DEFAULT_SONNET_MODEL,t.haiku?i.ANTHROPIC_DEFAULT_HAIKU_MODEL=t.haiku:delete i.ANTHROPIC_DEFAULT_HAIKU_MODEL,i}function as({profileName:s,data:t,settings:i,isLoading:l,isSaving:d,hasChanges:f,isRawJsonValid:x,onRefresh:n,onDelete:o,onSave:m}){return e.jsxs("div",{className:"px-6 py-4 border-b bg-background flex items-center justify-between shrink-0",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-lg font-semibold",children:s}),t?.path&&e.jsx(S,{variant:"outline",className:"text-xs",children:t.path.replace(/^.*\//,"")}),pe(i)&&e.jsx(es,{className:"ml-1"})]}),t&&e.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5",children:["Last modified: ",new Date(t.mtime).toLocaleString()]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(g,{variant:"ghost",size:"sm",onClick:n,disabled:l,children:e.jsx(U,{className:`w-4 h-4 ${l?"animate-spin":""}`})}),o&&e.jsx(g,{variant:"ghost",size:"sm",onClick:o,children:e.jsx(oe,{className:"w-4 h-4 text-destructive"})}),e.jsx(g,{size:"sm",onClick:m,disabled:d||!f||!x,children:d?e.jsxs(e.Fragment,{children:[e.jsx(G,{className:"w-4 h-4 mr-1 animate-spin"}),"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(Je,{className:"w-4 h-4 mr-1"}),"Save"]})})]})]})}function ge({label:s,...t}){const[i,l]=c.useState(!1);return e.jsxs("div",{className:"space-y-1",children:[s&&e.jsx("label",{className:"text-sm font-medium",children:s}),e.jsxs("div",{className:"relative",children:[e.jsx(y,{type:i?"text":"password",className:"pr-10 font-mono",...t}),e.jsx(g,{type:"button",variant:"ghost",size:"sm",className:"absolute right-0 top-0 h-full px-3",onClick:()=>l(!i),tabIndex:-1,children:i?e.jsx($e,{className:"w-4 h-4"}):e.jsx(Be,{className:"w-4 h-4"})})]})]})}function ns({currentSettings:s,newEnvKey:t,newEnvValue:i,onNewEnvKeyChange:l,onNewEnvValueChange:d,onEnvValueChange:f,onAddEnvVar:x}){return e.jsxs(e.Fragment,{children:[e.jsx(I,{className:"flex-1",children:e.jsx("div",{className:"p-4 space-y-4",children:s?.env&&Object.keys(s.env).length>0?e.jsx(e.Fragment,{children:Object.entries(s.env).map(([n,o])=>e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs(T,{className:"text-xs font-medium flex items-center gap-2 text-muted-foreground",children:[n,se(n)&&e.jsx(S,{variant:"secondary",className:"text-[10px] px-1 py-0 h-4",children:"sensitive"})]}),se(n)?e.jsx(ge,{value:o,onChange:m=>f(n,m.target.value),className:"font-mono text-sm h-8"}):e.jsx(y,{value:o,onChange:m=>f(n,m.target.value),className:"font-mono text-sm h-8"})]},n))}):e.jsxs("div",{className:"py-8 text-center text-muted-foreground bg-muted/30 rounded-lg border border-dashed text-sm",children:[e.jsx("p",{children:"No environment variables configured."}),e.jsx("p",{className:"text-xs mt-1 opacity-70",children:"Add variables using the input below or edit the JSON directly."})]})})}),e.jsxs("div",{className:"p-4 border-t bg-background shrink-0",children:[e.jsx(T,{className:"text-xs font-medium text-muted-foreground",children:"Add Environment Variable"}),e.jsxs("div",{className:"flex gap-2 mt-2",children:[e.jsx(y,{placeholder:"VARIABLE_NAME",value:t,onChange:n=>l(n.target.value.toUpperCase()),className:"font-mono text-sm h-8 w-2/5",onKeyDown:n=>n.key==="Enter"&&t.trim()&&x()}),e.jsx(y,{placeholder:"value",value:i,onChange:n=>d(n.target.value),className:"font-mono text-sm h-8 flex-1",onKeyDown:n=>n.key==="Enter"&&t.trim()&&x()}),e.jsx(g,{variant:"outline",size:"sm",className:"h-8",onClick:x,disabled:!t.trim(),children:e.jsx(D,{className:"w-4 h-4"})})]})]})]})}function rs({profileName:s,data:t}){return e.jsx(I,{className:"h-full",children:e.jsxs("div",{className:"p-4 space-y-6",children:[e.jsxs("div",{children:[e.jsxs("h3",{className:"text-sm font-medium flex items-center gap-2 mb-3",children:[e.jsx(Qe,{className:"w-4 h-4"}),"Profile Information"]}),e.jsx("div",{className:"space-y-3 bg-card rounded-lg border p-4 shadow-sm",children:t&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2 text-sm items-center",children:[e.jsx("span",{className:"font-medium text-muted-foreground",children:"Profile Name"}),e.jsx("span",{className:"font-mono",children:t.profile})]}),e.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2 text-sm items-center",children:[e.jsx("span",{className:"font-medium text-muted-foreground",children:"File Path"}),e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("code",{className:"bg-muted px-1.5 py-0.5 rounded text-xs break-all",children:t.path}),e.jsx(M,{value:t.path,size:"icon",className:"h-5 w-5"})]})]}),e.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2 text-sm items-center",children:[e.jsx("span",{className:"font-medium text-muted-foreground",children:"Last Modified"}),e.jsx("span",{className:"text-xs",children:new Date(t.mtime).toLocaleString()})]})]})})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-medium mb-3",children:"Quick Usage"}),e.jsxs("div",{className:"space-y-3 bg-card rounded-lg border p-4 shadow-sm",children:[e.jsxs("div",{children:[e.jsx(T,{className:"text-xs text-muted-foreground",children:"Run with profile"}),e.jsxs("div",{className:"mt-1 flex gap-2",children:[e.jsxs("code",{className:"flex-1 px-2 py-1.5 bg-muted rounded text-xs font-mono truncate",children:["ccs ",s,' "prompt"']}),e.jsx(M,{value:`ccs ${s} "prompt"`,size:"icon",className:"h-6 w-6"})]})]}),e.jsxs("div",{children:[e.jsx(T,{className:"text-xs text-muted-foreground",children:"Set as default"}),e.jsxs("div",{className:"mt-1 flex gap-2",children:[e.jsxs("code",{className:"flex-1 px-2 py-1.5 bg-muted rounded text-xs font-mono truncate",children:["ccs default ",s]}),e.jsx(M,{value:`ccs default ${s}`,size:"icon",className:"h-6 w-6"})]})]})]})]})]})})}function is({value:s,onChange:t,placeholder:i="Search models...",className:l}){const[d,f]=c.useState(""),[x,n]=c.useState(null),{models:o,isLoading:m,isError:j,isFetching:O}=ne(),A=we(),N=c.useMemo(()=>Ce(o,d,{category:x??void 0}),[o,d,x]),b=c.useMemo(()=>ye(o,2),[o]),k=!d.trim()&&!x,_=c.useMemo(()=>{const r={anthropic:[],openai:[],google:[],meta:[],mistral:[],opensource:[],other:[]};N.forEach(a=>{r[a.category].push(a)});for(const a of Object.keys(r))r[a]=Oe(r[a]);return r},[N]),C=c.useCallback(()=>{A()},[A]),p=o.find(r=>r.id===s);return m&&o.length===0?e.jsxs("div",{className:E("space-y-2",l),children:[e.jsx(W,{className:"h-10 w-full"}),e.jsx(W,{className:"h-32 w-full"})]}):e.jsxs("div",{className:E("space-y-2 w-full min-w-0 overflow-hidden",l),children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(de,{className:"text-muted-foreground absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2"}),e.jsx(y,{value:d,onChange:r=>f(r.target.value),placeholder:i,className:"pl-9"})]}),e.jsx(g,{variant:"outline",size:"icon",onClick:C,disabled:O,title:"Refresh models",children:O?e.jsx(G,{className:"h-4 w-4 animate-spin"}):e.jsx(U,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"flex flex-wrap gap-1",children:[e.jsxs(S,{variant:x===null?"default":"outline",className:"cursor-pointer",onClick:()=>n(null),children:["All (",o.length,")"]}),Object.keys(L).map(r=>{const a=_[r].length;return a===0?null:e.jsxs(S,{variant:x===r?"default":"outline",className:"cursor-pointer",onClick:()=>n(r),children:[L[r]," (",a,")"]},r)})]}),p&&e.jsxs("div",{className:"bg-muted rounded-md p-2 text-sm",children:[e.jsx("span",{className:"font-medium",children:p.name}),e.jsxs("span",{className:"text-muted-foreground ml-2",children:[$(p.pricing)," |"," ",re(p.context_length)]})]}),e.jsx(I,{className:"h-72 w-full rounded-md border",children:j?e.jsxs("div",{className:"text-destructive p-4 text-center",children:["Failed to load models."," ",e.jsx(g,{variant:"link",onClick:C,children:"Retry"})]}):N.length===0?e.jsxs("div",{className:"text-muted-foreground p-4 text-center",children:['No models found matching "',d,'"']}):e.jsxs("div",{className:"space-y-6 p-3",children:[k&&b.length>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"text-muted-foreground bg-background sticky top-0 mb-2 flex items-center gap-1.5 py-1.5 text-xs font-semibold border-b pb-2",children:[e.jsx(V,{className:"h-3 w-3 text-accent"}),e.jsx("span",{children:"Newest Models"})]}),e.jsx("div",{className:"space-y-1",children:b.map(r=>e.jsx(te,{model:r,isSelected:r.id===s,onClick:()=>t(r.id),showAge:!0},r.id))})]}),Object.keys(L).map(r=>{const a=_[r];return a.length===0?null:e.jsxs("div",{children:[e.jsx("div",{className:"text-muted-foreground bg-background sticky top-0 mb-2 py-1.5 text-xs font-semibold border-b pb-2",children:L[r]}),e.jsx("div",{className:"space-y-1",children:a.map(v=>e.jsx(te,{model:v,isSelected:v.id===s,onClick:()=>t(v.id)},v.id))})]},r)})]})})]})}function te({model:s,isSelected:t,onClick:i,showAge:l=!1}){return e.jsxs("button",{type:"button",onClick:i,className:E("group flex w-full items-center gap-2 rounded-md px-3 py-2 text-left text-sm transition-colors","hover:bg-accent hover:text-accent-foreground",t&&"bg-accent text-accent-foreground"),children:[e.jsx("span",{className:"flex-1 min-w-0 truncate font-medium",children:s.name}),e.jsxs("span",{className:E("flex shrink-0 items-center gap-1 text-xs whitespace-nowrap",t?"text-accent-foreground/80":"text-muted-foreground group-hover:text-accent-foreground/80"),children:[l&&s.created&&e.jsx(S,{variant:"outline",className:E("text-[10px] px-1",t?"border-accent-foreground/30 text-accent-foreground/80":"text-accent border-accent/30 group-hover:text-accent-foreground/80 group-hover:border-accent-foreground/30"),children:Ae(s.created)}),s.isFree?e.jsx(S,{variant:"secondary",className:E("text-[10px] px-1",t?"bg-accent-foreground/20 text-accent-foreground":"group-hover:bg-accent-foreground/20 group-hover:text-accent-foreground"),children:"Free"}):s.isExacto?e.jsxs(e.Fragment,{children:[e.jsx(S,{variant:"outline",className:E("text-[10px] px-1 border-emerald-500/50 text-emerald-600",t?"border-accent-foreground/30 text-accent-foreground/80":"group-hover:border-accent-foreground/30 group-hover:text-accent-foreground/80"),children:"Exacto"}),e.jsx("span",{className:"tabular-nums",children:$(s.pricing)})]}):e.jsx("span",{className:"tabular-nums",children:$(s.pricing)}),e.jsx("span",{className:"tabular-nums",children:re(s.context_length)})]})]})}function ls({selectedModel:s,value:t,onChange:i,className:l}){const{models:d}=ne(),f=c.useMemo(()=>s?Ee(s,d):{},[s,d]),x=()=>{i(f)},n=(m,j)=>{i({...t,[m]:j||void 0})},o=s&&Object.keys(f).length>0;return e.jsxs(ie,{className:E("group",l),children:[e.jsxs(le,{className:"flex items-center gap-2 text-sm font-medium hover:underline",children:[e.jsx(xe,{className:"h-4 w-4 transition-transform group-data-[state=open]:rotate-90"}),"Model Tier Mapping",e.jsx("span",{className:"text-muted-foreground font-normal",children:"(Advanced)"})]}),e.jsxs(ce,{className:"space-y-3 pt-3",children:[e.jsx("p",{className:"text-muted-foreground text-sm",children:"Configure different models for Claude Code's opus/sonnet/haiku tiers."}),o&&e.jsxs(g,{type:"button",variant:"outline",size:"sm",onClick:x,children:[e.jsx(qe,{className:"mr-1 h-4 w-4"}),"Auto-suggest based on ",s?.split("/")[0]]}),e.jsxs("div",{className:"grid gap-3",children:[e.jsxs("div",{className:"grid grid-cols-[80px_1fr] items-center gap-2",children:[e.jsx(T,{htmlFor:"tier-opus",className:"text-right",children:"Opus"}),e.jsx(y,{id:"tier-opus",value:t.opus??"",onChange:m=>n("opus",m.target.value),placeholder:"e.g., anthropic/claude-opus-4"})]}),e.jsxs("div",{className:"grid grid-cols-[80px_1fr] items-center gap-2",children:[e.jsx(T,{htmlFor:"tier-sonnet",className:"text-right",children:"Sonnet"}),e.jsx(y,{id:"tier-sonnet",value:t.sonnet??"",onChange:m=>n("sonnet",m.target.value),placeholder:"e.g., anthropic/claude-sonnet-4"})]}),e.jsxs("div",{className:"grid grid-cols-[80px_1fr] items-center gap-2",children:[e.jsx(T,{htmlFor:"tier-haiku",className:"text-right",children:"Haiku"}),e.jsx(y,{id:"tier-haiku",value:t.haiku??"",onChange:m=>n("haiku",m.target.value),placeholder:"e.g., anthropic/claude-3.5-haiku"})]})]}),e.jsx("p",{className:"text-muted-foreground text-xs",children:"These set ANTHROPIC_DEFAULT_OPUS_MODEL, ANTHROPIC_DEFAULT_SONNET_MODEL, ANTHROPIC_DEFAULT_HAIKU_MODEL."})]})]})}function cs({profileName:s,data:t,currentSettings:i,newEnvKey:l,newEnvValue:d,onNewEnvKeyChange:f,onNewEnvValueChange:x,onEnvValueChange:n,onAddEnvVar:o,onEnvBulkChange:m}){const j=pe(i),O=i?.env,A=c.useMemo(()=>ss(O??{}),[O]),N=O??{},b=a=>{if(m){const v={...N,ANTHROPIC_MODEL:a,ANTHROPIC_DEFAULT_OPUS_MODEL:a,ANTHROPIC_DEFAULT_SONNET_MODEL:a,ANTHROPIC_DEFAULT_HAIKU_MODEL:a};m(v)}else n("ANTHROPIC_MODEL",a),n("ANTHROPIC_DEFAULT_OPUS_MODEL",a),n("ANTHROPIC_DEFAULT_SONNET_MODEL",a),n("ANTHROPIC_DEFAULT_HAIKU_MODEL",a);Q.success("Applied model to all tiers",{duration:2e3})},k=a=>{if(m){const v=ts(N,a);m(v)}else a.opus!==void 0&&n("ANTHROPIC_DEFAULT_OPUS_MODEL",a.opus||""),a.sonnet!==void 0&&n("ANTHROPIC_DEFAULT_SONNET_MODEL",a.sonnet||""),a.haiku!==void 0&&n("ANTHROPIC_DEFAULT_HAIKU_MODEL",a.haiku||"")},[_,C]=c.useState(!1),p=new Set(["ANTHROPIC_AUTH_TOKEN"]),r=Object.entries(N).filter(([a])=>!p.has(a));return e.jsx("div",{className:"h-full w-full min-w-0 flex flex-col",children:e.jsxs(Te,{defaultValue:"env",className:"h-full w-full min-w-0 flex flex-col",children:[e.jsx("div",{className:"px-4 pt-4 shrink-0",children:e.jsxs(_e,{className:"w-full",children:[e.jsx(X,{value:"env",className:"flex-1",children:j?"Configuration":"Environment Variables"}),e.jsx(X,{value:"info",className:"flex-1",children:"Info & Usage"})]})}),e.jsxs("div",{className:"flex-1 overflow-hidden flex flex-col min-w-0",children:[e.jsx(Z,{value:"env",className:"flex-1 mt-0 border-0 p-0 data-[state=inactive]:hidden flex flex-col overflow-hidden min-w-0",children:j?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex-1 overflow-hidden",children:e.jsxs("div",{className:"h-full overflow-y-auto overflow-x-hidden p-4 space-y-6",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx(T,{className:"text-sm font-medium",children:"Model Selection"}),e.jsx(is,{value:N.ANTHROPIC_MODEL,onChange:b,placeholder:"Search OpenRouter models..."})]}),e.jsx(ls,{selectedModel:N.ANTHROPIC_MODEL,value:A,onChange:k}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{className:"text-sm font-medium",children:"API Key"}),e.jsx(ge,{value:N.ANTHROPIC_AUTH_TOKEN||"",onChange:a=>n("ANTHROPIC_AUTH_TOKEN",a.target.value),placeholder:"sk-or-v1-...",className:"font-mono text-sm"}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Get your API key from"," ",e.jsx("a",{href:"https://openrouter.ai/keys",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"openrouter.ai/keys"})]})]}),r.length>0&&e.jsxs(ie,{open:_,onOpenChange:C,children:[e.jsxs(le,{className:"flex items-center gap-2 text-sm font-medium text-muted-foreground hover:text-foreground transition-colors group",children:[e.jsx(xe,{className:E("h-4 w-4 transition-transform",_&&"rotate-90")}),e.jsx(Ge,{className:"h-4 w-4"}),e.jsx("span",{children:"Additional Variables"}),e.jsxs("span",{className:"text-xs font-normal opacity-70",children:["(",r.length,")"]})]}),e.jsx(ce,{className:"pt-4",children:e.jsx("div",{className:"space-y-3 border rounded-lg p-3 bg-muted/30",children:r.map(([a,v])=>e.jsxs("div",{className:"space-y-1",children:[e.jsx(T,{className:"text-xs text-muted-foreground",children:a}),e.jsx(y,{value:v,onChange:P=>n(a,P.target.value),className:"font-mono text-xs h-8"})]},a))})})]})]})}),e.jsxs("div",{className:"p-4 border-t bg-background shrink-0",children:[e.jsx(T,{className:"text-xs font-medium text-muted-foreground",children:"Add Environment Variable"}),e.jsxs("div",{className:"flex gap-2 mt-2",children:[e.jsx(y,{placeholder:"VARIABLE_NAME",value:l,onChange:a=>f(a.target.value.toUpperCase()),className:"font-mono text-sm h-8 w-2/5",onKeyDown:a=>a.key==="Enter"&&l.trim()&&o()}),e.jsx(y,{placeholder:"value",value:d,onChange:a=>x(a.target.value),className:"font-mono text-sm h-8 flex-1",onKeyDown:a=>a.key==="Enter"&&l.trim()&&o()}),e.jsx(g,{variant:"outline",size:"sm",className:"h-8",onClick:o,disabled:!l.trim(),children:e.jsx(D,{className:"w-4 h-4"})})]})]})]}):e.jsx(ns,{currentSettings:i,newEnvKey:l,newEnvValue:d,onNewEnvKeyChange:f,onNewEnvValueChange:x,onEnvValueChange:n,onAddEnvVar:o})}),e.jsx(Z,{value:"info",className:"h-full mt-0 border-0 p-0 data-[state=inactive]:hidden",children:e.jsx(rs,{profileName:s,data:t})})]})]})})}function os({profileName:s,onDelete:t,onHasChangesUpdate:i}){const[l,d]=c.useState({}),[f,x]=c.useState(!1),[n,o]=c.useState(null),[m,j]=c.useState(""),[O,A]=c.useState(""),N=Fe(),{data:b,isLoading:k,isError:_,refetch:C}=Ke({queryKey:["settings",s],queryFn:async()=>{const h=await fetch(`/api/settings/${s}/raw`);if(!h.ok)throw new Error(`Failed to load settings: ${h.status}`);return h.json()}}),p=b?.settings,r=c.useMemo(()=>{if(n!==null)try{return JSON.parse(n)}catch{}if(p)return{...p,env:{...p.env,...l}}},[p,l,n]),a=c.useMemo(()=>n!==null?n:p?JSON.stringify(p,null,2):"",[n,p]),v=c.useCallback(h=>{o(h)},[]),P=(h,w)=>{const R={...r?.env||{},[h]:w};d(J=>({...J,[h]:w})),o(JSON.stringify({...r,env:R},null,2))},H=h=>{const w={...r?.env||{},...h};d(R=>({...R,...h})),o(JSON.stringify({...r,env:w},null,2))},F=()=>{if(!m.trim())return;const h=m.trim(),w=O,R={...r?.env||{},[h]:w};d(J=>({...J,[h]:w})),o(JSON.stringify({...r,env:R},null,2)),j(""),A("")},u=c.useMemo(()=>{try{return JSON.parse(a),!0}catch{return!1}},[a]),K=c.useMemo(()=>n!==null?n!==JSON.stringify(p,null,2):Object.keys(l).length>0,[n,l,p]),je=c.useMemo(()=>{const h=["ANTHROPIC_BASE_URL","ANTHROPIC_AUTH_TOKEN"],w=r?.env||{};return h.filter(R=>!w[R]?.trim())},[r]);c.useEffect(()=>{i?.(K)},[K,i]);const z=ze({mutationFn:async()=>{let h;try{h=JSON.parse(a)}catch{h={...b?.settings,env:{...b?.settings?.env,...l}}}const w=await fetch(`/api/settings/${s}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({settings:h,expectedMtime:b?.mtime})});if(w.status===409)throw new Error("CONFLICT");if(!w.ok)throw new Error("Failed to save");return w.json()},onSuccess:()=>{N.invalidateQueries({queryKey:["settings",s]}),N.invalidateQueries({queryKey:["profiles"]}),d({}),o(null),Q.success("Settings saved")},onError:h=>{h.message==="CONFLICT"?x(!0):Q.error(h.message)}}),Y=async h=>{x(!1),h?(await C(),z.mutate()):(d({}),o(null))};return e.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[e.jsx(as,{profileName:s,data:b,settings:r,isLoading:k,isSaving:z.isPending,hasChanges:K,isRawJsonValid:u,onRefresh:()=>C(),onDelete:t,onSave:()=>z.mutate()}),k?e.jsxs("div",{className:"flex-1 flex items-center justify-center",children:[e.jsx(G,{className:"w-8 h-8 animate-spin text-muted-foreground"}),e.jsx("span",{className:"ml-3 text-muted-foreground",children:"Loading settings..."})]}):_?e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsxs("div",{className:"text-center space-y-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Failed to load settings."}),e.jsxs(g,{variant:"outline",size:"sm",onClick:()=>C(),children:[e.jsx(U,{className:"w-4 h-4 mr-1"}),"Retry"]})]})}):e.jsxs("div",{className:"flex-1 grid grid-cols-[40%_60%] divide-x overflow-hidden",children:[e.jsx("div",{className:"flex flex-col overflow-hidden bg-muted/5 min-w-0",children:e.jsx(cs,{profileName:s,data:b,currentSettings:r,newEnvKey:m,newEnvValue:O,onNewEnvKeyChange:j,onNewEnvValueChange:A,onEnvValueChange:P,onEnvBulkChange:H,onAddEnvVar:F})}),e.jsxs("div",{className:"flex flex-col overflow-hidden",children:[e.jsxs("div",{className:"px-6 py-2 bg-muted/30 border-b flex items-center gap-2 shrink-0 h-[45px]",children:[e.jsx(Ve,{className:"w-4 h-4 text-muted-foreground"}),e.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:"Raw Configuration (JSON)"})]}),e.jsx(ke,{rawJsonContent:a,isRawJsonValid:u,rawJsonEdits:n,settings:p,onChange:v,missingRequiredFields:je})]})]}),e.jsx(B,{open:f,title:"File Modified Externally",description:"Overwrite with your changes or discard?",confirmText:"Overwrite",variant:"destructive",onConfirm:()=>Y(!0),onCancel:()=>Y(!1)})]},s)}const ae="ccs:openrouter-banner-dismissed";function ds({onCreateClick:s}){const[t,i]=c.useState(!0),{modelCount:l,isLoading:d}=q();c.useEffect(()=>{const x=localStorage.getItem(ae)==="true";i(x)},[]);const f=()=>{localStorage.setItem(ae,"true"),i(!0)};return t?null:e.jsx("div",{className:"bg-gradient-to-r from-accent to-accent/90 text-white px-4 py-3 relative shrink-0",children:e.jsxs("div",{className:"flex items-center justify-between gap-4 max-w-screen-xl mx-auto",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[e.jsx("div",{className:"p-1.5 bg-white/20 rounded-md shrink-0",children:e.jsx(V,{className:"w-4 h-4"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"font-medium text-sm",children:"NEW: OpenRouter Integration"}),e.jsxs("p",{className:"text-xs text-white/80 truncate",children:["Browse ",d?"300+":`${l}+`," models from OpenAI, Anthropic, Google, Meta and more."]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[s&&e.jsx(g,{size:"sm",variant:"secondary",onClick:s,className:"bg-white text-accent hover:bg-white/90 h-8",children:"Try it now"}),e.jsxs("a",{href:"https://openrouter.ai",target:"_blank",rel:"noopener noreferrer",className:"text-xs text-white/80 hover:text-white hidden sm:flex items-center gap-1",children:["Learn more",e.jsx(me,{className:"w-3 h-3"})]}),e.jsxs(g,{size:"icon",variant:"ghost",onClick:f,className:"h-7 w-7 text-white/70 hover:text-white hover:bg-white/20",children:[e.jsx(Ye,{className:"w-4 h-4"}),e.jsx("span",{className:"sr-only",children:"Dismiss"})]})]})]})})}function xs({onOpenRouterClick:s,onCustomClick:t}){const{modelCount:i,isLoading:l}=q();return e.jsx("div",{className:"flex-1 flex items-center justify-center bg-muted/20 p-8",children:e.jsxs("div",{className:"max-w-lg w-full space-y-6",children:[e.jsxs(Se,{className:"border-accent/30 dark:border-accent/40 bg-gradient-to-br from-accent/5 to-background dark:from-accent/10",children:[e.jsxs(Re,{className:"pb-3",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx("div",{className:"p-2 rounded-lg bg-accent/10 dark:bg-accent/20",children:e.jsx("img",{src:"/icons/openrouter.svg",alt:"OpenRouter",className:"w-6 h-6"})}),e.jsx(S,{variant:"secondary",className:"bg-accent/10 text-accent dark:bg-accent/20 dark:text-accent-foreground",children:"Recommended"})]}),e.jsx(Pe,{className:"text-xl",children:"Start with OpenRouter"}),e.jsxs(Le,{className:"text-base",children:["Access ",l?"300+":`${i}+`," models from OpenAI, Anthropic, Google, Meta and more - all through one API."]})]}),e.jsxs(Me,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-3 text-sm",children:[e.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[e.jsx(ue,{className:"w-4 h-4 text-accent"}),e.jsx("span",{children:"One API, all providers"})]}),e.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[e.jsx(V,{className:"w-4 h-4 text-accent"}),e.jsx("span",{children:"Model tier mapping"})]})]}),e.jsxs(g,{onClick:s,className:"w-full bg-accent hover:bg-accent/90 text-white",size:"lg",children:["Create OpenRouter Profile",e.jsx(We,{className:"w-4 h-4 ml-2"})]}),e.jsxs("p",{className:"text-xs text-center text-muted-foreground",children:["Get your API key at"," ",e.jsxs("a",{href:"https://openrouter.ai/keys",target:"_blank",rel:"noopener noreferrer",className:"text-accent hover:underline inline-flex items-center gap-1",children:["openrouter.ai/keys",e.jsx(me,{className:"w-3 h-3"})]})]})]})]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(ee,{className:"flex-1"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"or"}),e.jsx(ee,{className:"flex-1"})]}),e.jsx(g,{variant:"outline",onClick:t,className:"w-full",children:"Create Custom API Profile"})]})})}function ms({onCreateClick:s}){const{modelCount:t,isLoading:i}=q();return e.jsx("div",{className:"p-3 border-t bg-gradient-to-r from-accent/5 to-accent/10 dark:from-accent/10 dark:to-accent/15",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"p-1.5 bg-accent/10 dark:bg-accent/20 rounded shrink-0",children:e.jsx("img",{src:"/icons/openrouter.svg",alt:"",className:"w-4 h-4"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-xs font-medium text-accent dark:text-accent-foreground",children:"OpenRouter"}),e.jsxs("p",{className:"text-[10px] text-muted-foreground truncate",children:[i?"300+":`${t}+`," models available"]})]}),e.jsxs(g,{size:"sm",variant:"ghost",onClick:s,className:"h-7 px-2 text-accent hover:text-accent hover:bg-accent/10 dark:hover:bg-accent/20",children:[e.jsx(ue,{className:"w-3 h-3 mr-1"}),e.jsx("span",{className:"text-xs",children:"Add"})]})]})})}function Os(){const{data:s,isLoading:t,isError:i,refetch:l}=De(),d=Ie(),[f,x]=c.useState(null),[n,o]=c.useState(""),[m,j]=c.useState(!1),[O,A]=c.useState("normal"),[N,b]=c.useState(null),[k,_]=c.useState(!1),[C,p]=c.useState(null);Ue();const r=c.useMemo(()=>s?.profiles||[],[s?.profiles]),a=c.useMemo(()=>r.filter(u=>u.name.toLowerCase().includes(n.toLowerCase())),[r,n]),v=f?r.find(u=>u.name===f):null,P=u=>{d.mutate(u,{onSuccess:()=>{f===u&&x(null),b(null)}})},H=u=>{j(!1),k&&f!==null?p(u):x(u)},F=u=>{k&&f!==u?p(u):x(u)};return e.jsxs("div",{className:"h-[calc(100vh-100px)] flex flex-col",children:[e.jsx(ds,{onCreateClick:()=>j(!0)}),e.jsxs("div",{className:"flex-1 flex min-h-0",children:[e.jsxs("div",{className:"w-80 border-r flex flex-col bg-muted/30",children:[e.jsxs("div",{className:"p-4 border-b bg-background",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Xe,{className:"w-5 h-5 text-primary"}),e.jsx("h1",{className:"font-semibold",children:"API Profiles"})]}),e.jsxs(g,{size:"sm",onClick:()=>{j(!0)},children:[e.jsx(D,{className:"w-4 h-4 mr-1"}),"New"]})]}),e.jsxs("div",{className:"relative",children:[e.jsx(de,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),e.jsx(y,{placeholder:"Search profiles...",className:"pl-8 h-9",value:n,onChange:u=>o(u.target.value)})]})]}),e.jsx(I,{className:"flex-1",children:t?e.jsx("div",{className:"p-4 text-sm text-muted-foreground",children:"Loading profiles..."}):i?e.jsx("div",{className:"p-4 text-center",children:e.jsxs("div",{className:"space-y-3 py-8",children:[e.jsx(he,{className:"w-12 h-12 mx-auto text-destructive/50"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"Failed to load profiles"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Unable to fetch API profiles. Please try again."})]}),e.jsxs(g,{size:"sm",variant:"outline",onClick:()=>l(),children:[e.jsx(U,{className:"w-4 h-4 mr-1"}),"Retry"]})]})}):a.length===0?e.jsx("div",{className:"p-4 text-center",children:r.length===0?e.jsxs("div",{className:"space-y-3 py-8",children:[e.jsx(Ze,{className:"w-12 h-12 mx-auto text-muted-foreground/50"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"No API profiles yet"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Create your first profile to connect to custom API endpoints"})]}),e.jsxs(g,{size:"sm",variant:"outline",onClick:()=>{j(!0)},children:[e.jsx(D,{className:"w-4 h-4 mr-1"}),"Create Profile"]})]}):e.jsxs("p",{className:"text-sm text-muted-foreground py-4",children:['No profiles match "',n,'"']})}):e.jsx("div",{className:"p-2 space-y-1",children:a.map(u=>e.jsx(us,{profile:u,isSelected:f===u.name,onSelect:()=>F(u.name),onDelete:()=>b(u.name)},u.name))})}),r.length>0&&e.jsx("div",{className:"p-3 border-t bg-background text-xs text-muted-foreground",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{children:[r.length," profile",r.length!==1?"s":""]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(fe,{className:"w-3 h-3 text-green-600"}),r.filter(u=>u.configured).length," configured"]})]})}),e.jsx(ms,{onCreateClick:()=>{A("openrouter"),j(!0)}})]}),e.jsx("div",{className:"flex-1 flex flex-col min-w-0",children:v?e.jsx(os,{profileName:v.name,onDelete:()=>b(v.name),onHasChangesUpdate:_},v.name):e.jsx(xs,{onOpenRouterClick:()=>{A("openrouter"),j(!0)},onCustomClick:()=>{A("normal"),j(!0)}})})]}),e.jsx(He,{open:m,onOpenChange:j,onSuccess:H,initialMode:O}),e.jsx(B,{open:!!N,title:"Delete Profile",description:`Are you sure you want to delete "${N}"? This will remove the settings file and cannot be undone.`,confirmText:"Delete",variant:"destructive",onConfirm:()=>N&&P(N),onCancel:()=>b(null)}),e.jsx(B,{open:!!C,title:"Unsaved Changes",description:`You have unsaved changes in "${f}". Discard and switch to "${C}"?`,confirmText:"Discard & Switch",variant:"destructive",onConfirm:()=>{_(!1),x(C),p(null)},onCancel:()=>p(null)})]})}function us({profile:s,isSelected:t,onSelect:i,onDelete:l}){return e.jsxs("div",{className:E("group flex items-center gap-2 px-3 py-2.5 rounded-md cursor-pointer transition-colors",t?"bg-primary/10 border border-primary/20":"hover:bg-muted border border-transparent"),onClick:i,children:[s.configured?e.jsx(fe,{className:"w-4 h-4 text-green-600 shrink-0"}):e.jsx(he,{className:"w-4 h-4 text-yellow-600 shrink-0"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"font-medium text-sm truncate",children:s.name}),e.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[e.jsx("div",{className:"text-xs text-muted-foreground truncate flex-1",children:s.settingsPath}),e.jsx(M,{value:s.settingsPath,size:"icon",className:"h-5 w-5 opacity-0 group-hover:opacity-100 transition-opacity"})]})]}),e.jsx(g,{variant:"ghost",size:"icon",className:"h-7 w-7 opacity-0 group-hover:opacity-100 transition-opacity",onClick:d=>{d.stopPropagation(),l()},children:e.jsx(oe,{className:"w-3.5 h-3.5 text-destructive"})})]})}export{Os as ApiPage};