@kaitranntt/ccs 7.50.0-dev.2 → 7.50.0-dev.5

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 (109) hide show
  1. package/README.md +3 -0
  2. package/dist/ccs.js +31 -7
  3. package/dist/ccs.js.map +1 -1
  4. package/dist/cliproxy/account-safety.d.ts.map +1 -1
  5. package/dist/cliproxy/account-safety.js +4 -0
  6. package/dist/cliproxy/account-safety.js.map +1 -1
  7. package/dist/cliproxy/antigravity-responsibility.d.ts +36 -0
  8. package/dist/cliproxy/antigravity-responsibility.d.ts.map +1 -0
  9. package/dist/cliproxy/antigravity-responsibility.js +171 -0
  10. package/dist/cliproxy/antigravity-responsibility.js.map +1 -0
  11. package/dist/cliproxy/auth/auth-types.d.ts +2 -0
  12. package/dist/cliproxy/auth/auth-types.d.ts.map +1 -1
  13. package/dist/cliproxy/auth/oauth-handler.d.ts.map +1 -1
  14. package/dist/cliproxy/auth/oauth-handler.js +18 -0
  15. package/dist/cliproxy/auth/oauth-handler.js.map +1 -1
  16. package/dist/cliproxy/executor/index.d.ts.map +1 -1
  17. package/dist/cliproxy/executor/index.js +30 -0
  18. package/dist/cliproxy/executor/index.js.map +1 -1
  19. package/dist/commands/help-command.d.ts.map +1 -1
  20. package/dist/commands/help-command.js +5 -0
  21. package/dist/commands/help-command.js.map +1 -1
  22. package/dist/config/unified-config-loader.d.ts +11 -1
  23. package/dist/config/unified-config-loader.d.ts.map +1 -1
  24. package/dist/config/unified-config-loader.js +127 -59
  25. package/dist/config/unified-config-loader.js.map +1 -1
  26. package/dist/config/unified-config-types.d.ts +14 -0
  27. package/dist/config/unified-config-types.d.ts.map +1 -1
  28. package/dist/config/unified-config-types.js +8 -1
  29. package/dist/config/unified-config-types.js.map +1 -1
  30. package/dist/targets/droid-adapter.d.ts.map +1 -1
  31. package/dist/targets/droid-adapter.js +1 -0
  32. package/dist/targets/droid-adapter.js.map +1 -1
  33. package/dist/targets/droid-config-manager.d.ts +1 -0
  34. package/dist/targets/droid-config-manager.d.ts.map +1 -1
  35. package/dist/targets/droid-config-manager.js +106 -3
  36. package/dist/targets/droid-config-manager.js.map +1 -1
  37. package/dist/targets/droid-reasoning-runtime.d.ts +14 -0
  38. package/dist/targets/droid-reasoning-runtime.d.ts.map +1 -0
  39. package/dist/targets/droid-reasoning-runtime.js +42 -0
  40. package/dist/targets/droid-reasoning-runtime.js.map +1 -0
  41. package/dist/targets/target-adapter.d.ts +6 -0
  42. package/dist/targets/target-adapter.d.ts.map +1 -1
  43. package/dist/ui/assets/accounts-Cv9gdSl_.js +1 -0
  44. package/dist/ui/assets/{alert-dialog-DmrIcJav.js → alert-dialog-Cbz7hjbH.js} +1 -1
  45. package/dist/ui/assets/api-CtPIBYPJ.js +1 -0
  46. package/dist/ui/assets/auth-section-DDB-gXA-.js +1 -0
  47. package/dist/ui/assets/{backups-section-jwtuA5Ay.js → backups-section-f3TrZYc_.js} +1 -1
  48. package/dist/ui/assets/{checkbox-CNqHZx7Z.js → checkbox-DyM_OviW.js} +1 -1
  49. package/dist/ui/assets/{cliproxy-control-panel--WUVyBIk.js → cliproxy-control-panel-D-0qYG1v.js} +1 -1
  50. package/dist/ui/assets/cliproxy-nwnHc6Ex.js +3 -0
  51. package/dist/ui/assets/{confirm-dialog-CQNxkz9X.js → confirm-dialog-B1DNTIER.js} +1 -1
  52. package/dist/ui/assets/{copilot-DLxxmnsW.js → copilot-CsbHY1RT.js} +1 -1
  53. package/dist/ui/assets/{cursor-YRIza7sP.js → cursor-Dae1NLqC.js} +1 -1
  54. package/dist/ui/assets/droid-BQLHOVuB.js +2 -0
  55. package/dist/ui/assets/globalenv-section-DryB5ety.js +1 -0
  56. package/dist/ui/assets/{health-BWPd6F4h.js → health-DXE1K5e_.js} +1 -1
  57. package/dist/ui/assets/icons-D7XDTBCN.js +1 -0
  58. package/dist/ui/assets/index-BDygjMjY.js +1 -0
  59. package/dist/ui/assets/index-BGM7ArZ-.js +1 -0
  60. package/dist/ui/assets/{index-PWMOllOf.js → index-BOyrh__4.js} +11 -11
  61. package/dist/ui/assets/index-C5CDmWs5.css +1 -0
  62. package/dist/ui/assets/{index-BlldLmNl.js → index-Dt0OpGYK.js} +1 -1
  63. package/dist/ui/assets/{index-D244tv89.js → index-n1iv9ylt.js} +1 -1
  64. package/dist/ui/assets/proxy-status-widget-Bvi7eWkI.js +1 -0
  65. package/dist/ui/assets/{separator-OcJLDgYQ.js → separator-DrB7U5vm.js} +1 -1
  66. package/dist/ui/assets/{shared-LxAdbm4g.js → shared-ByrShSly.js} +1 -1
  67. package/dist/ui/assets/{switch-s8pp-m8L.js → switch-JJlvFHut.js} +1 -1
  68. package/dist/ui/assets/{updates-BQRhDVbP.js → updates-BUBIr73T.js} +1 -1
  69. package/dist/ui/index.html +3 -3
  70. package/dist/web-server/routes/cliproxy-auth-routes.d.ts.map +1 -1
  71. package/dist/web-server/routes/cliproxy-auth-routes.js +58 -24
  72. package/dist/web-server/routes/cliproxy-auth-routes.js.map +1 -1
  73. package/dist/web-server/routes/droid-routes.d.ts +3 -0
  74. package/dist/web-server/routes/droid-routes.d.ts.map +1 -0
  75. package/dist/web-server/routes/droid-routes.js +61 -0
  76. package/dist/web-server/routes/droid-routes.js.map +1 -0
  77. package/dist/web-server/routes/index.d.ts.map +1 -1
  78. package/dist/web-server/routes/index.js +3 -0
  79. package/dist/web-server/routes/index.js.map +1 -1
  80. package/dist/web-server/routes/settings-routes.d.ts.map +1 -1
  81. package/dist/web-server/routes/settings-routes.js +110 -12
  82. package/dist/web-server/routes/settings-routes.js.map +1 -1
  83. package/dist/web-server/services/compatible-cli-docs-registry.d.ts +23 -0
  84. package/dist/web-server/services/compatible-cli-docs-registry.d.ts.map +1 -0
  85. package/dist/web-server/services/compatible-cli-docs-registry.js +81 -0
  86. package/dist/web-server/services/compatible-cli-docs-registry.js.map +1 -0
  87. package/dist/web-server/services/compatible-cli-json-file-service.d.ts +41 -0
  88. package/dist/web-server/services/compatible-cli-json-file-service.d.ts.map +1 -0
  89. package/dist/web-server/services/compatible-cli-json-file-service.js +205 -0
  90. package/dist/web-server/services/compatible-cli-json-file-service.js.map +1 -0
  91. package/dist/web-server/services/compatible-cli-types.d.ts +82 -0
  92. package/dist/web-server/services/compatible-cli-types.d.ts.map +1 -0
  93. package/dist/web-server/services/compatible-cli-types.js +3 -0
  94. package/dist/web-server/services/compatible-cli-types.js.map +1 -0
  95. package/dist/web-server/services/droid-dashboard-service.d.ts +29 -0
  96. package/dist/web-server/services/droid-dashboard-service.d.ts.map +1 -0
  97. package/dist/web-server/services/droid-dashboard-service.js +238 -0
  98. package/dist/web-server/services/droid-dashboard-service.js.map +1 -0
  99. package/package.json +1 -1
  100. package/dist/ui/assets/accounts-BKK-Lc16.js +0 -1
  101. package/dist/ui/assets/api-DzTwRtww.js +0 -1
  102. package/dist/ui/assets/auth-section-CP_2r8oJ.js +0 -1
  103. package/dist/ui/assets/cliproxy-CtO9BwgG.js +0 -3
  104. package/dist/ui/assets/globalenv-section-vUSIK5rf.js +0 -1
  105. package/dist/ui/assets/icons-Dk2sL3Mr.js +0 -1
  106. package/dist/ui/assets/index-B9dJZNls.js +0 -1
  107. package/dist/ui/assets/index-BZdHAol5.js +0 -1
  108. package/dist/ui/assets/index-DEDy1J8t.css +0 -1
  109. package/dist/ui/assets/proxy-status-widget-MlyNgoPh.js +0 -1
@@ -0,0 +1,2 @@
1
+ import{j as e}from"./radix-ui-DIWAxjEp.js";import{r as F}from"./react-vendor-CNOkPC89.js";import{t as g}from"./notifications-B2HqRBj7.js";import{aU as ee,aV as we,B as S,b as V,c as le,aY as ke,C as b,i as v,j as y,a as N,q as H,r as Q,s as W,t as G,v as k,I as ce,aZ as Se,a_ as ae,a$ as Ce,O as Ee,Q as Te,R as z,U as $,m as _,aW as Ae}from"./index-BOyrh__4.js";import{a as Re,u as ie,b as Oe}from"./tanstack-Hn82hibe.js";import{aA as De,L as X,ai as _e,m as Be,R as Me,aB as Fe,aC as Ke,v as Le,S as Pe,aD as Ie,r as Ue,s as Ve,T as ze,a5 as $e,az as Ye,n as oe}from"./icons-D7XDTBCN.js";import{S as B}from"./separator-DrB7U5vm.js";import"./utils-CzKF5WmX.js";import"./form-utils-Cn_Uld6y.js";import"./code-highlight-BRUf_pqB.js";function Je(s){try{const t=JSON.parse(s);return!t||typeof t!="object"||Array.isArray(t)?{settings:null,parseError:"JSON root must be an object."}:{settings:t,parseError:null}}catch(t){return{settings:null,parseError:t.message}}}async function qe(){const s=await fetch(ee("/droid/diagnostics"));if(!s.ok)throw new Error("Failed to fetch Droid diagnostics");return s.json()}async function He(){const s=await fetch(ee("/droid/settings/raw"));if(!s.ok)throw new Error("Failed to fetch Droid raw settings");return s.json()}async function Qe(s){const t=await fetch(ee("/droid/settings/raw"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(t.status===409)throw new we("Droid raw settings changed externally");if(!t.ok){const r=await t.json().catch(()=>null);throw new Error(r?.error||"Failed to save Droid raw settings")}return t.json()}function We(){const s=Re(),t=ie({queryKey:["droid-diagnostics"],queryFn:qe,refetchInterval:1e4}),r=ie({queryKey:["droid-raw-settings"],queryFn:He}),l=Oe({mutationFn:Qe,onSuccess:(i,c)=>{s.setQueryData(["droid-raw-settings"],n=>{const a=n?.path??"~/.factory/settings.json",u=n?.resolvedPath??a,m=Je(c.rawText);return{path:a,resolvedPath:u,exists:!0,mtime:i.mtime,rawText:c.rawText,settings:m.settings,parseError:m.parseError}}),s.invalidateQueries({queryKey:["droid-diagnostics"]})}});return F.useMemo(()=>({diagnostics:t.data,diagnosticsLoading:t.isLoading,diagnosticsError:t.error,refetchDiagnostics:t.refetch,rawSettings:r.data,rawSettingsLoading:r.isLoading,rawSettingsError:r.error,refetchRawSettings:r.refetch,saveRawSettings:l.mutate,saveRawSettingsAsync:l.mutateAsync,isSavingRawSettings:l.isPending}),[t.data,t.isLoading,t.error,t.refetch,r.data,r.isLoading,r.error,r.refetch,l.mutate,l.mutateAsync,l.isPending])}function Ge({title:s,pathLabel:t,loading:r,parseWarning:l,value:i,dirty:c,saving:n,saveDisabled:a,onChange:u,onSave:m,onRefresh:T}){const[A,C]=F.useState(!1),D=async()=>{i&&(await navigator.clipboard.writeText(i),C(!0),g.success("Settings copied to clipboard"),window.setTimeout(()=>C(!1),1500))};return e.jsxs("div",{className:"h-full flex flex-col",children:[e.jsxs("div",{className:"p-4 border-b bg-background flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("h2",{className:"font-semibold flex items-center gap-2",children:[e.jsx(De,{className:"h-4 w-4 text-primary"}),s,c&&e.jsx(S,{variant:"secondary",className:"text-[10px]",children:"Unsaved"})]}),e.jsx("p",{className:"text-xs text-muted-foreground font-mono truncate",children:t})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(V,{size:"sm",onClick:m,disabled:a,children:[n?e.jsx(X,{className:"h-4 w-4 mr-1 animate-spin"}):e.jsx(_e,{className:"h-4 w-4 mr-1"}),"Save"]}),e.jsxs(V,{variant:"outline",size:"sm",onClick:D,disabled:!i,children:[e.jsx(Be,{className:"h-4 w-4 mr-1"}),A?"Copied":"Copy"]}),e.jsx(V,{variant:"outline",size:"sm",onClick:T,children:e.jsx(Me,{className:le("h-4 w-4",r?"animate-spin":"")})})]})]}),e.jsx("div",{className:"flex-1 overflow-auto",children:r?e.jsxs("div",{className:"h-full flex items-center justify-center text-muted-foreground",children:[e.jsx(X,{className:"h-5 w-5 animate-spin mr-2"}),"Loading settings.json..."]}):e.jsxs("div",{className:"h-full flex flex-col",children:[l&&e.jsxs("div",{className:"mx-4 mt-4 rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-sm text-amber-800 dark:bg-amber-950/20 dark:text-amber-300",children:["Parse warning: ",l]}),e.jsx("div",{className:"flex-1 p-4 pt-3",children:e.jsx("div",{className:"h-full rounded-md border overflow-hidden bg-background",children:e.jsx(ke,{value:i,onChange:u,language:"json",minHeight:"100%"})})})]})})]})}const Xe=["customModels","custom_models"],Ze={low:4e3,medium:12e3,high:3e4,max:5e4,xhigh:64e3},es=["low","medium","high","max","xhigh"];function p(s){return typeof s=="object"&&s!==null&&!Array.isArray(s)}function j(s){return typeof s=="string"&&s.trim()?s.trim():null}function K(s){return typeof s=="number"&&Number.isFinite(s)?s:null}function Z(s){if(!s)return"unknown";const t=s.toLowerCase();return t==="anthropic"?"anthropic":t==="openai"?"openai":t==="generic-chat-completion-api"?"generic-chat-completion-api":"unknown"}function ss(s,t,r){return`${s}:${t}:${encodeURIComponent(String(r))}`}function ts(s){const t=s.indexOf(":"),r=s.indexOf(":",t+1);if(t<=0||r<=t+1)return null;const l=s.slice(0,t),i=s.slice(t+1,r),c=s.slice(r+1);if(l!=="customModels"&&l!=="custom_models"||i!=="array"&&i!=="object")return null;const n=decodeURIComponent(c);if(i==="array"){const a=Number.parseInt(n,10);return!Number.isInteger(a)||a<0?null:{rootKey:l,locationType:i,locationKey:a}}return{rootKey:l,locationType:i,locationKey:n}}function rs(s){return!s||s<=0?null:s<=4e3?"low":s<=12e3?"medium":s<=3e4?"high":s<=5e4?"max":"xhigh"}function ns(s){return Object.prototype.hasOwnProperty.call(s,"extraArgs")?"extraArgs":Object.prototype.hasOwnProperty.call(s,"extra_args")?"extra_args":"extraArgs"}function de(s){return JSON.parse(JSON.stringify(s))}function as(s){const t=[];for(const r of Xe){const l=s[r];if(Array.isArray(l)){l.forEach((i,c)=>{p(i)&&t.push({rootKey:r,locationType:"array",locationKey:c,entry:i})});continue}if(p(l))for(const[i,c]of Object.entries(l))p(c)&&t.push({rootKey:r,locationType:"object",locationKey:i,entry:c})}return t}function ue(s,t){const r=ts(t);if(!r)return null;const l=s[r.rootKey];if(r.locationType==="array"){if(!Array.isArray(l))return null;const n=l[r.locationKey];if(!p(n))return null;const a=j(n.provider);return{entry:n,providerKind:Z(a)}}if(!p(l))return null;const i=l[r.locationKey];if(!p(i))return null;const c=j(i.provider);return{entry:i,providerKind:Z(c)}}function is(s,t){const r=t.extraArgs??t.extra_args,l=p(r)?r:null;if(!l)return{effort:null,anthropicBudgetTokens:null};const i=j(l.reasoning_effort)??j(l.reasoningEffort),c=p(l.reasoning)?l.reasoning:null,n=c?j(c.effort):null,a=p(l.thinking)?l.thinking:null,u=a?j(a.type):null,m=a?K(a.budget_tokens)??K(a.budgetTokens):null;return s==="openai"?{effort:n??i,anthropicBudgetTokens:null}:s==="anthropic"?u==="enabled"?{effort:rs(m)??"high",anthropicBudgetTokens:m}:{effort:n??i,anthropicBudgetTokens:m}:{effort:i??n,anthropicBudgetTokens:null}}function os(s){if(!s)return null;const t=s.trim().toLowerCase();return!t||t==="default"||t==="unset"||t==="off"||t==="none"||t==="disabled"?null:t}function me(s){const t=ns(s),r=s[t],l=p(r)?{...r}:{};return{extraArgsKey:t,extraArgs:l}}function xe(s,t,r){if(Object.keys(r).length===0){delete s[t];return}s[t]=r}function ls(s){return as(s).map(({rootKey:t,locationType:r,locationKey:l,entry:i})=>{const c=j(i.displayName)??j(i.model_display_name)??"Unnamed model",n=j(i.model)??"",a=j(i.provider)??"unknown",u=Z(a),m=is(u,i);return{id:ss(t,r,l),rootKey:t,locationType:r,locationKey:l,displayName:c,model:n,provider:a,providerKind:u,effort:m.effort,anthropicBudgetTokens:m.anthropicBudgetTokens}})}function cs(s,t,r){const l=de(s),i=ue(l,t);if(!i)return null;const c=os(r),{extraArgsKey:n,extraArgs:a}=me(i.entry);if(i.providerKind==="openai")if(delete a.reasoning_effort,delete a.reasoningEffort,!c)delete a.reasoning;else{const u=p(a.reasoning)?a.reasoning:{};a.reasoning={...u,effort:c}}else if(i.providerKind==="anthropic")if(delete a.reasoning_effort,delete a.reasoningEffort,delete a.reasoning,!c)delete a.thinking;else{const u=p(a.thinking)?{...a.thinking}:{},m=K(u.budget_tokens)??K(u.budgetTokens);delete u.budgetTokens,a.thinking={...u,type:"enabled",budget_tokens:m??Ze[c]??3e4}}else delete a.reasoning,delete a.reasoningEffort,c?a.reasoning_effort=c:delete a.reasoning_effort;return xe(i.entry,n,a),l}function ds(s,t,r){const l=de(s),i=ue(l,t);if(!i||i.providerKind!=="anthropic")return null;const{extraArgsKey:c,extraArgs:n}=me(i.entry),a=p(n.thinking)?{...n.thinking}:{};if(a.type="enabled",r===null)delete a.budget_tokens,delete a.budgetTokens;else{const u=Math.max(1024,Math.floor(r));a.budget_tokens=u,delete a.budgetTokens}return n.thinking=a,xe(i.entry,c,n),l}const Y="__unset__";function us(s){return s.providerKind==="openai"?"Writes: extraArgs.reasoning.effort":s.providerKind==="anthropic"?"Writes: extraArgs.thinking.{type,budget_tokens}":"Writes: extraArgs.reasoning_effort"}function ms({models:s,disabled:t,disabledReason:r,onEffortChange:l,onAnthropicBudgetChange:i}){return e.jsxs(b,{children:[e.jsx(v,{className:"pb-2",children:e.jsxs(y,{className:"text-base flex items-center gap-2",children:[e.jsx(Fe,{className:"h-4 w-4"}),"BYOK Reasoning / Thinking",e.jsx(S,{variant:"outline",className:"text-[10px] font-normal",children:"customModels"})]})}),e.jsxs(N,{className:"space-y-3",children:[r&&e.jsx("p",{className:"text-xs text-amber-600",children:r}),s.length===0?e.jsx("p",{className:"text-xs text-muted-foreground",children:"No BYOK custom models found in settings.json (`customModels` or `custom_models`)."}):e.jsx("div",{className:"space-y-2",children:s.map(c=>e.jsxs("div",{className:"rounded-md border p-3 space-y-2",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-xs font-medium truncate",children:c.displayName}),e.jsx("p",{className:"text-[11px] font-mono text-muted-foreground truncate",children:c.model||"(missing model id)"})]}),e.jsx(S,{variant:"outline",className:"font-mono text-[10px] shrink-0",children:c.provider})]}),e.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-[11px] font-medium",children:"Reasoning Effort"}),e.jsxs(H,{value:c.effort??Y,onValueChange:n=>l(c.id,n===Y?null:n),disabled:t,children:[e.jsx(Q,{className:"h-8 text-xs",children:e.jsx(W,{placeholder:"Use provider default"})}),e.jsxs(G,{children:[e.jsx(k,{value:Y,children:"Use provider default"}),es.map(n=>e.jsx(k,{value:n,children:n},n))]})]})]}),c.providerKind==="anthropic"&&e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-[11px] font-medium",children:"Thinking Budget Tokens"}),e.jsx(ce,{type:"number",min:1024,step:1024,value:c.anthropicBudgetTokens??"",placeholder:"auto",className:"h-8 text-xs",disabled:t,onChange:n=>{const a=n.target.value.trim();if(!a){i(c.id,null);return}const u=Number.parseInt(a,10);Number.isFinite(u)&&i(c.id,Math.max(1024,u))}})]})]}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:us(c)})]},c.id))})]})]})}const O="__unset__",xs=[{key:"reasoningEffort",label:"Reasoning Effort",description:"none | medium | high | max",options:[{value:"none",label:"none"},{value:"medium",label:"medium"},{value:"high",label:"high"},{value:"max",label:"max"}]},{key:"autonomyLevel",label:"Autonomy Level",description:"suggest | aggressive | full",options:[{value:"suggest",label:"suggest"},{value:"aggressive",label:"aggressive"},{value:"full",label:"full"}]},{key:"diffMode",label:"Diff Mode",description:"auto | none | inline | split",options:[{value:"auto",label:"auto"},{value:"none",label:"none"},{value:"inline",label:"inline"},{value:"split",label:"split"}]}],fs=[{key:"todoEnabled",label:"Todo Enabled"},{key:"todoAutoRefresh",label:"Todo Auto Refresh"},{key:"autoCompactEnabled",label:"Auto Compact Enabled"},{key:"soundEnabled",label:"Sound Enabled"}],hs=[{key:"maxTurns",label:"Max Turns",min:1,step:1},{key:"maxToolCalls",label:"Max Tool Calls",min:1,step:1},{key:"autoCompactThreshold",label:"Auto Compact Threshold",min:1e3,step:1e3}];function ps(s){return s===!0?"true":s===!1?"false":O}function gs(s){return s==="true"?!0:s==="false"?!1:null}function js({values:s,disabled:t,disabledReason:r,onEnumSettingChange:l,onBooleanSettingChange:i,onNumberSettingChange:c}){return e.jsxs(b,{children:[e.jsx(v,{className:"pb-2",children:e.jsxs(y,{className:"text-base flex items-center gap-2",children:[e.jsx(Ke,{className:"h-4 w-4"}),"Quick Settings",e.jsx(S,{variant:"outline",className:"text-[10px] font-normal",children:"settings.json"})]})}),e.jsxs(N,{className:"space-y-4",children:[r&&e.jsx("p",{className:"text-xs text-amber-600",children:r}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[xs.map(n=>e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs font-medium",children:n.label}),e.jsxs(H,{value:s[n.key]??O,onValueChange:a=>l(n.key,a===O?null:a),disabled:t,children:[e.jsx(Q,{className:"h-8 text-xs",children:e.jsx(W,{placeholder:"Use default"})}),e.jsxs(G,{children:[e.jsx(k,{value:O,children:"Use default"}),n.options.map(a=>e.jsx(k,{value:a.value,children:a.label},a.value))]})]}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:n.description})]},n.key)),hs.map(n=>e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs font-medium",children:n.label}),e.jsx(ce,{type:"number",min:n.min,step:n.step,value:s[n.key]??"",onChange:a=>{const u=a.target.value.trim();if(!u){c(n.key,null);return}const m=Number.parseInt(u,10);Number.isFinite(m)&&c(n.key,Math.max(n.min,m))},className:"h-8 text-xs",disabled:t})]},n.key)),fs.map(n=>e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs font-medium",children:n.label}),e.jsxs(H,{value:ps(s[n.key]),onValueChange:a=>i(n.key,gs(a)),disabled:t,children:[e.jsx(Q,{className:"h-8 text-xs",children:e.jsx(W,{placeholder:"Use default"})}),e.jsxs(G,{children:[e.jsx(k,{value:O,children:"Use default"}),e.jsx(k,{value:"true",children:"true"}),e.jsx(k,{value:"false",children:"false"})]})]})]},n.key))]})]})]})}const bs=[{id:"droid-cli-overview",label:"Droid CLI Overview",url:"https://docs.factory.ai/cli/",description:"Primary entry docs for setup, auth, and core CLI usage."},{id:"droid-byok-overview",label:"BYOK Overview",url:"https://docs.factory.ai/cli/byok/overview/",description:"BYOK model/provider shape, provider values, and migration notes."},{id:"droid-settings-reference",label:"settings.json Reference",url:"https://docs.factory.ai/cli/configuration/settings/",description:"Supported settings keys, defaults, and allowed values."}],vs=[{provider:"anthropic",label:"Anthropic Messages API",apiFormat:"Messages API",url:"https://docs.anthropic.com/en/api/messages"},{provider:"openai",label:"OpenAI Responses API",apiFormat:"Responses API",url:"https://platform.openai.com/docs/api-reference/responses"},{provider:"generic-chat-completion-api",label:"OpenAI Chat Completions Spec",apiFormat:"Chat Completions API",url:"https://platform.openai.com/docs/api-reference/chat"}];function ys(s){const t=/https?:\/\/[^\s)]+/g,r=[];let l=0,i;for(;(i=t.exec(s))!==null;){const[c]=i,n=i.index;n>l&&r.push(s.slice(l,n)),r.push(e.jsx("a",{href:c,target:"_blank",rel:"noreferrer",className:"underline underline-offset-2 hover:text-foreground",children:c},`${c}-${n}`)),l=n+c.length}return l<s.length&&r.push(s.slice(l)),r.length>0?r:[s]}function Ns(s){return!s||!Number.isFinite(s)?"N/A":new Date(s).toLocaleString()}function ws(s){return!s||s<=0?"0 B":s<1024?`${s} B`:s<1024*1024?`${(s/1024).toFixed(1)} KB`:`${(s/(1024*1024)).toFixed(2)} MB`}function ks(s){try{const t=JSON.parse(s);return!t||typeof t!="object"||Array.isArray(t)?{valid:!1,error:"JSON root must be an object."}:{valid:!0,value:t}}catch(t){return{valid:!1,error:t.message}}}function J(s){return typeof s=="string"?s:null}function q(s){return typeof s=="number"&&Number.isFinite(s)?s:null}function M(s){return typeof s=="boolean"?s:null}function f({label:s,value:t,mono:r=!1}){return e.jsxs("div",{className:"flex items-start justify-between gap-3 text-sm",children:[e.jsx("span",{className:"text-muted-foreground shrink-0",children:s}),e.jsx("span",{className:le("text-right break-all",r&&"font-mono text-xs"),children:t})]})}function Ms(){const{diagnostics:s,diagnosticsLoading:t,diagnosticsError:r,refetchDiagnostics:l,rawSettings:i,rawSettingsLoading:c,refetchRawSettings:n,saveRawSettingsAsync:a,isSavingRawSettings:u}=We(),[m,T]=F.useState(null),A=i?.rawText??"{}",C=m??A,D=m!==null&&m!==A,d=ks(C),L=d.valid?{valid:!0}:{valid:!1,error:d.error},se=x=>{if(x===A){T(null);return}T(x)},P=x=>{se(JSON.stringify(x,null,2)+`
2
+ `)},I=(x,w)=>{if(!d.valid){g.error("Fix JSON syntax before using quick settings controls.");return}const E={...d.value};w==null?delete E[x]:E[x]=w,P(E)},fe=d.valid?{reasoningEffort:J(d.value.reasoningEffort),autonomyLevel:J(d.value.autonomyLevel),diffMode:J(d.value.diffMode),maxTurns:q(d.value.maxTurns),maxToolCalls:q(d.value.maxToolCalls),autoCompactThreshold:q(d.value.autoCompactThreshold),todoEnabled:M(d.value.todoEnabled),todoAutoRefresh:M(d.value.todoAutoRefresh),autoCompactEnabled:M(d.value.autoCompactEnabled),soundEnabled:M(d.value.soundEnabled)}:{reasoningEffort:null,autonomyLevel:null,diffMode:null,maxTurns:null,maxToolCalls:null,autoCompactThreshold:null,todoEnabled:null,todoAutoRefresh:null,autoCompactEnabled:null,soundEnabled:null},he=d.valid?ls(d.value):[],pe=async()=>{await Promise.all([l(),n()])},ge=async()=>{if(!L.valid){g.error(`Invalid JSON: ${L.error}`);return}try{await a({rawText:C,expectedMtime:i?.exists?i.mtime:void 0}),T(null),g.success("Droid settings saved")}catch(x){Ae(x)?g.error("Droid settings changed externally. Refresh and retry."):g.error(x.message||"Failed to save Droid settings")}},te=s?.byok.customModels??[],re=F.useMemo(()=>Object.entries(s?.byok.providerBreakdown??{}).sort((x,w)=>w[1]-x[1]),[s?.byok.providerBreakdown]),je=()=>{if(t)return e.jsxs("div",{className:"flex h-full items-center justify-center text-muted-foreground",children:[e.jsx(X,{className:"h-5 w-5 animate-spin mr-2"}),"Loading Droid diagnostics..."]});if(r||!s)return e.jsx("div",{className:"flex h-full items-center justify-center text-destructive px-6 text-center",children:"Failed to load Droid diagnostics."});const x=s.docsReference??{notes:[],links:[],providerDocs:[],providerValues:[],settingsHierarchy:[]},w=x.notes??[],E=x.links??[],ne=x.providerDocs??[],be=E.length>0?E:bs,ve=ne.length>0?ne:vs,ye=x.providerValues??[],Ne=x.settingsHierarchy??[],U="mt-0 h-full border-0 p-0 data-[state=inactive]:hidden";return e.jsxs(Ee,{defaultValue:"byok",className:"h-full flex flex-col",children:[e.jsx("div",{className:"px-4 pt-4 shrink-0",children:e.jsxs(Te,{className:"grid w-full grid-cols-3",children:[e.jsx(z,{value:"overview",children:"Overview"}),e.jsx(z,{value:"byok",children:"BYOK"}),e.jsx(z,{value:"docs",children:"Docs"})]})}),e.jsxs("div",{className:"flex-1 min-h-0 overflow-hidden px-4 pb-4 pt-3",children:[e.jsx($,{value:"overview",className:U,children:e.jsx(_,{className:"h-full",children:e.jsxs("div",{className:"space-y-4 pr-1",children:[e.jsxs(b,{children:[e.jsx(v,{className:"pb-2",children:e.jsxs(y,{className:"text-base flex items-center gap-2",children:[e.jsx(Pe,{className:"h-4 w-4"}),"Runtime & Installation"]})}),e.jsxs(N,{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Status"}),e.jsx(S,{variant:s.binary.installed?"default":"secondary",children:s.binary.installed?"Detected":"Not Found"})]}),e.jsx(f,{label:"Detection source",value:s.binary.source,mono:!0}),e.jsx(f,{label:"Binary path",value:s.binary.path||"Not detected",mono:!0}),e.jsx(f,{label:"Install directory",value:s.binary.installDir||"N/A",mono:!0}),e.jsx(f,{label:"Version",value:s.binary.version||"Unknown",mono:!0}),e.jsx(f,{label:"Override (CCS_DROID_PATH)",value:s.binary.overridePath||"Not set",mono:!0})]})]}),e.jsxs(b,{children:[e.jsx(v,{className:"pb-2",children:e.jsxs(y,{className:"text-base flex items-center gap-2",children:[e.jsx(Ie,{className:"h-4 w-4"}),"Config Files"]})}),e.jsx(N,{className:"space-y-3",children:[s.files.settings,s.files.legacyConfig].map(o=>e.jsxs("div",{className:"rounded-md border p-3 space-y-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"font-medium text-sm",children:o.label}),o.exists?e.jsx(Ue,{className:"h-4 w-4 text-green-600"}):e.jsx(Ve,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsx(f,{label:"Path",value:o.path,mono:!0}),e.jsx(f,{label:"Resolved",value:o.resolvedPath,mono:!0}),e.jsx(f,{label:"Size",value:ws(o.sizeBytes)}),e.jsx(f,{label:"Last modified",value:Ns(o.mtimeMs)}),o.parseError&&e.jsxs("p",{className:"text-xs text-amber-600",children:["Parse warning: ",o.parseError]}),o.readError&&e.jsxs("p",{className:"text-xs text-destructive",children:["Read warning: ",o.readError]})]},o.label))})]}),s.warnings.length>0&&e.jsxs(b,{className:"border-amber-200 bg-amber-50/50 dark:bg-amber-950/20",children:[e.jsx(v,{className:"pb-2",children:e.jsxs(y,{className:"text-base flex items-center gap-2",children:[e.jsx(ze,{className:"h-4 w-4 text-amber-600"}),"Warnings"]})}),e.jsx(N,{className:"space-y-1.5",children:s.warnings.map(o=>e.jsxs("p",{className:"text-sm text-amber-800 dark:text-amber-300",children:["- ",o]},o))})]})]})})}),e.jsx($,{value:"byok",className:U,children:e.jsx(_,{className:"h-full",children:e.jsxs("div",{className:"space-y-4 pr-1",children:[e.jsx(js,{values:fe,disabled:c||!d.valid,disabledReason:d.valid?null:`Quick settings disabled: ${d.error}`,onEnumSettingChange:(o,h)=>{I(o,h)},onBooleanSettingChange:(o,h)=>{I(o,h)},onNumberSettingChange:(o,h)=>{I(o,h)}}),e.jsx(ms,{models:he,disabled:c||!d.valid,disabledReason:d.valid?null:`BYOK reasoning controls disabled: ${d.error}`,onEffortChange:(o,h)=>{if(!d.valid){g.error("Fix JSON syntax before updating BYOK reasoning settings.");return}const R=cs(d.value,o,h);if(!R){g.error("Unable to update selected BYOK model reasoning setting.");return}P(R)},onAnthropicBudgetChange:(o,h)=>{if(!d.valid){g.error("Fix JSON syntax before updating thinking budget.");return}const R=ds(d.value,o,h);if(!R){g.error("Thinking budget is only available for Anthropic BYOK models.");return}P(R)}}),e.jsxs(b,{children:[e.jsx(v,{className:"pb-2",children:e.jsxs(y,{className:"text-base flex items-center gap-2",children:[e.jsx($e,{className:"h-4 w-4"}),"BYOK Summary"]})}),e.jsxs(N,{className:"space-y-2",children:[e.jsx(f,{label:"Active model selector",value:s.byok.activeModelSelector||"Not set",mono:!0}),e.jsx(f,{label:"Custom models",value:String(s.byok.customModelCount)}),e.jsx(f,{label:"CCS-managed",value:String(s.byok.ccsManagedCount)}),e.jsx(f,{label:"User-managed",value:String(s.byok.userManagedCount)}),e.jsx(f,{label:"Malformed entries",value:String(s.byok.invalidModelEntryCount)}),e.jsx(B,{}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:"Providers"}),e.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[re.length===0&&e.jsx(S,{variant:"secondary",className:"font-mono",children:"none"}),re.map(([o,h])=>e.jsxs(S,{variant:"outline",className:"font-mono text-xs",children:[o,": ",h]},o))]})]})]})]}),e.jsxs(b,{children:[e.jsx(v,{className:"pb-2",children:e.jsx(y,{className:"text-base",children:"Custom Models"})}),e.jsx(N,{children:e.jsxs("div",{className:"rounded-md border overflow-hidden",children:[e.jsxs("div",{className:"grid grid-cols-[2fr_1fr_2fr] bg-muted/40 px-3 py-2 text-xs font-medium",children:[e.jsx("span",{children:"Name / Model"}),e.jsx("span",{children:"Provider"}),e.jsx("span",{children:"Base URL"})]}),e.jsx(_,{className:"h-52",children:e.jsxs("div",{className:"divide-y",children:[te.length===0&&e.jsx("div",{className:"px-3 py-4 text-xs text-muted-foreground",children:"No custom models"}),te.map(o=>e.jsxs("div",{className:"grid grid-cols-[2fr_1fr_2fr] gap-2 px-3 py-2 text-xs",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"font-medium truncate",children:o.displayName}),e.jsx("p",{className:"text-muted-foreground font-mono truncate",children:o.model})]}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"truncate",children:o.provider}),e.jsx("p",{className:"text-muted-foreground",children:o.apiKeyPreview||"no-key"})]}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"truncate",title:o.baseUrl,children:o.host||o.baseUrl}),e.jsx("p",{className:"text-muted-foreground font-mono truncate",children:o.baseUrl})]})]},`${o.displayName}-${o.model}-${o.baseUrl}`))]})})]})})]})]})})}),e.jsx($,{value:"docs",className:U,children:e.jsx(_,{className:"h-full",children:e.jsx("div",{className:"space-y-4 pr-1",children:e.jsxs(b,{children:[e.jsx(v,{className:"pb-2",children:e.jsxs(y,{className:"text-base flex items-center gap-2",children:[e.jsx(Ye,{className:"h-4 w-4"}),"Docs-Aligned Notes"]})}),e.jsxs(N,{className:"space-y-2 text-sm",children:[w.map((o,h)=>e.jsxs("p",{className:"text-muted-foreground",children:["- ",ys(o)]},`${h}-${o}`)),e.jsx(B,{}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-wide",children:"Factory Docs"}),e.jsx("div",{className:"space-y-1.5",children:be.map(o=>e.jsxs("a",{href:o.url,target:"_blank",rel:"noreferrer",className:"block rounded-md border px-2.5 py-2 transition-colors hover:bg-muted/50",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs font-medium",children:o.label}),e.jsx(oe,{className:"h-3.5 w-3.5 text-muted-foreground"})]}),e.jsx("p",{className:"mt-0.5 text-[11px] text-muted-foreground",children:o.description}),e.jsx("p",{className:"mt-1 break-all font-mono text-[11px] text-muted-foreground/90 underline underline-offset-2",children:o.url})]},o.id))})]}),e.jsx(B,{}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-wide",children:"Provider Fact-Check Docs"}),e.jsx("div",{className:"space-y-1.5",children:ve.map(o=>e.jsxs("a",{href:o.url,target:"_blank",rel:"noreferrer",className:"block rounded-md border px-2.5 py-2 transition-colors hover:bg-muted/50",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs font-medium",children:o.label}),e.jsx(oe,{className:"h-3.5 w-3.5 text-muted-foreground"})]}),e.jsxs("p",{className:"mt-0.5 text-[11px] text-muted-foreground",children:["provider: ",o.provider," | format: ",o.apiFormat]}),e.jsx("p",{className:"mt-1 break-all font-mono text-[11px] text-muted-foreground/90 underline underline-offset-2",children:o.url})]},`${o.provider}-${o.url}`))})]}),e.jsx(B,{}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Provider values: ",ye.join(", ")]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Settings hierarchy: ",Ne.join(" -> ")]})]})]})})})})]})]})};return e.jsx("div",{className:"h-[calc(100vh-100px)] overflow-hidden",children:e.jsxs(Se,{direction:"horizontal",className:"h-full",children:[e.jsx(ae,{defaultSize:45,minSize:35,children:e.jsx("div",{className:"h-full border-r bg-muted/20",children:je()})}),e.jsx(Ce,{className:"w-2 bg-border hover:bg-primary/20 transition-colors cursor-col-resize flex items-center justify-center group",children:e.jsx(Le,{className:"w-3 h-3 text-muted-foreground group-hover:text-primary"})}),e.jsx(ae,{defaultSize:55,minSize:35,children:e.jsx(Ge,{title:"Droid BYOK Settings",pathLabel:i?.path||"~/.factory/settings.json",loading:c,parseWarning:i?.parseError,value:C,dirty:D,saving:u,saveDisabled:!D||u||c||!L.valid,onChange:x=>{se(x)},onSave:ge,onRefresh:pe})})]})})}export{Ms as DroidPage};
@@ -0,0 +1 @@
1
+ import{j as e}from"./radix-ui-DIWAxjEp.js";import{r as c}from"./react-vendor-CNOkPC89.js";import{b9 as N,ba as C,bb as w,b2 as y,b4 as G,m as S,b as x,I as p}from"./index-BOyrh__4.js";import{S as k}from"./switch-JJlvFHut.js";import{R as j,a2 as A,r as R,ah as L,a0 as V}from"./icons-D7XDTBCN.js";import"./tanstack-Hn82hibe.js";import"./notifications-B2HqRBj7.js";import"./utils-CzKF5WmX.js";import"./form-utils-Cn_Uld6y.js";import"./code-highlight-BRUf_pqB.js";function _(){const{state:s}=N(),a=C(),[l,d]=c.useState(""),[m,v]=c.useState(""),u=c.useCallback(async()=>{try{a.setGlobalEnvLoading(!0),a.setGlobalEnvError(null);const t=await fetch("/api/global-env");if(!t.ok)throw new Error("Failed to load Global Env config");const r=await t.json();a.setGlobalEnvConfig(r)}catch(t){a.setGlobalEnvError(t.message)}finally{a.setGlobalEnvLoading(!1)}},[a]),i=c.useCallback(async t=>{const r=s.globalEnvConfig;if(!r)return;const f={...r,...t};a.setGlobalEnvConfig(f);try{a.setGlobalEnvSaving(!0),a.setGlobalEnvError(null);const o=await fetch("/api/global-env",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(f)});if(!o.ok){const n=await o.json();throw new Error(n.error||"Failed to save")}const h=await o.json();a.setGlobalEnvConfig(h.config),a.setGlobalEnvSuccess(!0),setTimeout(()=>a.setGlobalEnvSuccess(!1),1500)}catch(o){a.setGlobalEnvConfig(r),a.setGlobalEnvError(o.message)}finally{a.setGlobalEnvSaving(!1)}},[s.globalEnvConfig,a]),b=c.useCallback(()=>{if(!l.trim()||!s.globalEnvConfig)return;const t={...s.globalEnvConfig.env,[l.trim()]:m};i({env:t}),d(""),v("")},[l,m,s.globalEnvConfig,i]),g=c.useCallback(t=>{if(!s.globalEnvConfig)return;const r={...s.globalEnvConfig.env};delete r[t],i({env:r})},[s.globalEnvConfig,i]);return{config:s.globalEnvConfig,loading:s.globalEnvLoading,saving:s.globalEnvSaving,error:s.globalEnvError,success:s.globalEnvSuccess,newEnvKey:l,setNewEnvKey:d,newEnvValue:m,setNewEnvValue:v,fetchConfig:u,saveConfig:i,addEnvVar:b,removeEnvVar:g}}function F(){const{config:s,loading:a,saving:l,error:d,success:m,newEnvKey:v,setNewEnvKey:u,newEnvValue:i,setNewEnvValue:b,fetchConfig:g,saveConfig:t,addEnvVar:r,removeEnvVar:f}=_(),{fetchRawConfig:o}=w();c.useEffect(()=>{g(),o()},[g,o]);const h=()=>{t({enabled:!s?.enabled})};return a?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(j,{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 ${d||m?"opacity-100 translate-y-0":"opacity-0 -translate-y-2 pointer-events-none"}`,children:[d&&e.jsxs(y,{variant:"destructive",className:"py-2 shadow-lg",children:[e.jsx(A,{className:"h-4 w-4"}),e.jsx(G,{children:d})]}),m&&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(R,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"text-sm font-medium",children:"Saved"})]})]}),e.jsx(S,{className:"flex-1",children:e.jsxs("div",{className:"p-5 space-y-6",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Environment variables injected into all non-Claude subscription profiles (gemini, codex, agy, ghcp, etc.)"}),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:s?.enabled?"Global Env enabled":"Global Env disabled"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s?.enabled?"Env vars will be injected into third-party profiles":"Env vars will not be injected"})]}),e.jsx(k,{checked:s?.enabled??!0,onCheckedChange:h})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-base font-medium",children:"Environment Variables"}),s?.env&&Object.keys(s.env).length>0?e.jsx("div",{className:"space-y-2",children:Object.entries(s.env).map(([n,E])=>e.jsxs("div",{className:"flex items-center gap-2 p-3 rounded-lg border bg-background",children:[e.jsx("code",{className:"flex-1 font-mono text-sm truncate",children:n}),e.jsx("span",{className:"text-muted-foreground",children:"="}),e.jsx("code",{className:"font-mono text-sm px-2 py-1 bg-muted rounded",children:E}),e.jsx(x,{variant:"ghost",size:"sm",onClick:()=>f(n),disabled:l,className:"h-8 w-8 p-0 text-destructive hover:text-destructive hover:bg-destructive/10",children:e.jsx(L,{className:"w-4 h-4"})})]},n))}):e.jsx("div",{className:"p-4 rounded-lg border border-dashed text-center text-muted-foreground",children:e.jsx("p",{children:"No environment variables configured"})}),e.jsxs("div",{className:"p-4 rounded-lg border bg-muted/30",children:[e.jsx("h4",{className:"text-sm font-medium mb-3",children:"Add New Variable"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(p,{value:v,onChange:n=>u(n.target.value.toUpperCase()),placeholder:"KEY_NAME",className:"flex-1 font-mono text-sm h-9",disabled:l}),e.jsx("span",{className:"flex items-center text-muted-foreground",children:"="}),e.jsx(p,{value:i,onChange:n=>b(n.target.value),placeholder:"value",className:"flex-1 font-mono text-sm h-9",disabled:l}),e.jsxs(x,{size:"sm",onClick:r,disabled:l||!v.trim(),className:"h-9",children:[e.jsx(V,{className:"w-4 h-4 mr-1"}),"Add"]})]})]}),e.jsxs("div",{className:"p-4 rounded-lg border bg-muted/30",children:[e.jsx("h4",{className:"text-sm font-medium mb-3",children:"Quick Add Common Variables"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[[{key:"DISABLE_BUG_COMMAND",value:"1"},{key:"DISABLE_ERROR_REPORTING",value:"1"},{key:"DISABLE_TELEMETRY",value:"1"}].map(({key:n,value:E})=>!s?.env?.[n]&&e.jsxs(x,{variant:"outline",size:"sm",onClick:()=>{u(n),b(E)},className:"text-xs font-mono",children:["+ ",n]},n)),s?.env&&["DISABLE_BUG_COMMAND","DISABLE_ERROR_REPORTING","DISABLE_TELEMETRY"].every(n=>s.env[n])&&e.jsx("span",{className:"text-sm text-muted-foreground",children:"All common variables are configured"})]})]})]})]})}),e.jsx("div",{className:"p-4 border-t bg-background",children:e.jsxs(x,{variant:"outline",size:"sm",onClick:()=>{g(),o()},disabled:a||l,className:"w-full",children:[e.jsx(j,{className:`w-4 h-4 mr-2 ${a?"animate-spin":""}`}),"Refresh"]})})]})}export{F as default};
@@ -1 +1 @@
1
- import{j as e}from"./radix-ui-DIWAxjEp.js";import{c as l,b as p,K as w,M as y,N as k,B as z,S as h}from"./index-PWMOllOf.js";import{u as M,a as R,b as W}from"./tanstack-Hn82hibe.js";import{t as g}from"./notifications-B2HqRBj7.js";import{r as j}from"./react-vendor-CNOkPC89.js";import{ay as v,b as E,y as C,l as S,Z as P,f as O,U as $,S as H,az as I,V as T,x as F,R as A}from"./icons-Dk2sL3Mr.js";import"./utils-CzKF5WmX.js";import"./form-utils-Cn_Uld6y.js";import"./code-highlight-BRUf_pqB.js";const B={sm:{dimension:80,strokeWidth:6,fontSize:"text-lg",labelSize:"text-[10px]"},md:{dimension:120,strokeWidth:8,fontSize:"text-3xl",labelSize:"text-xs"},lg:{dimension:160,strokeWidth:10,fontSize:"text-4xl",labelSize:"text-sm"}},D={ok:{stroke:"#22C55E",glow:"rgba(34, 197, 94, 0.4)"},warning:{stroke:"#EAB308",glow:"rgba(234, 179, 8, 0.4)"},error:{stroke:"#EF4444",glow:"rgba(239, 68, 68, 0.4)"}};function K({passed:s,total:t,status:r,size:o="md"}){const n=B[o],d=D[r],i=t>0?Math.round(s/t*100):0,a=(n.dimension-n.strokeWidth)/2,c=2*Math.PI*a,f=c-i/100*c,x=n.dimension/2;return e.jsxs("div",{className:"relative inline-flex items-center justify-center",children:[e.jsxs("svg",{width:n.dimension,height:n.dimension,className:"transform -rotate-90",style:{filter:`drop-shadow(0 0 8px ${d.glow})`},children:[e.jsx("circle",{cx:x,cy:x,r:a,fill:"none",stroke:"currentColor",strokeWidth:n.strokeWidth,className:"text-muted/30"}),e.jsx("circle",{cx:x,cy:x,r:a,fill:"none",stroke:d.stroke,strokeWidth:n.strokeWidth,strokeLinecap:"round",strokeDasharray:c,strokeDashoffset:f,className:"transition-all duration-1000 ease-out"}),i>0&&e.jsx("circle",{cx:x+a*Math.cos(i/100*2*Math.PI-Math.PI/2),cy:x+a*Math.sin(i/100*2*Math.PI-Math.PI/2),r:n.strokeWidth/2,fill:d.stroke,className:"animate-pulse",style:{filter:`drop-shadow(0 0 4px ${d.glow})`}})]}),e.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[e.jsx("span",{className:l("font-mono font-bold tracking-tight",n.fontSize),children:i}),e.jsx("span",{className:l("font-mono uppercase tracking-widest text-muted-foreground",n.labelSize),children:"health"})]})]})}function b({label:s,value:t,color:r,bgColor:o}){return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:l("w-2 h-2 rounded-full animate-pulse",o)}),e.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:s}),e.jsx("span",{className:l("font-mono font-bold text-sm",r),children:t})]})}function L({total:s,passed:t,warnings:r,errors:o,info:n}){const d=t/s*100,i=r/s*100,a=o/s*100,c=n/s*100;return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"h-2 rounded-full overflow-hidden bg-muted/50 flex",children:[a>0&&e.jsx("div",{className:"h-full bg-red-500 transition-all duration-500",style:{width:`${a}%`}}),i>0&&e.jsx("div",{className:"h-full bg-yellow-500 transition-all duration-500",style:{width:`${i}%`}}),c>0&&e.jsx("div",{className:"h-full bg-blue-500 transition-all duration-500",style:{width:`${c}%`}}),d>0&&e.jsx("div",{className:"h-full bg-green-500 transition-all duration-500",style:{width:`${d}%`}})]}),e.jsxs("div",{className:"flex items-center justify-between gap-4 flex-wrap",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"Checks"}),e.jsx("span",{className:"font-mono font-bold text-lg",children:s})]}),e.jsxs("div",{className:"flex items-center gap-4 flex-wrap",children:[e.jsx(b,{label:"OK",value:t,color:"text-green-500",bgColor:"bg-green-500"}),e.jsx(b,{label:"WARN",value:r,color:"text-yellow-500",bgColor:"bg-yellow-500"}),e.jsx(b,{label:"ERR",value:o,color:"text-red-500",bgColor:"bg-red-500"}),e.jsx(b,{label:"INFO",value:n,color:"text-blue-500",bgColor:"bg-blue-500"})]})]})]})}function q(){return M({queryKey:["health"],queryFn:async()=>(await fetch("/api/health")).json(),refetchInterval:3e4})}function G(){const s=R();return W({mutationFn:async t=>{const r=await fetch(`/api/health/fix/${t}`,{method:"POST"}),o=await r.json();if(!r.ok)throw new Error(o.message);return o},onSuccess:t=>{s.invalidateQueries({queryKey:["health"]}),g.success(t.message)},onError:t=>{g.error(t.message)}})}const Q={ok:{dot:"bg-green-500",label:"OK",labelColor:"text-green-500"},warning:{dot:"bg-yellow-500",label:"WARN",labelColor:"text-yellow-500"},error:{dot:"bg-red-500",label:"ERR",labelColor:"text-red-500"},info:{dot:"bg-blue-500",label:"INFO",labelColor:"text-blue-500"}};function U({check:s}){const t=G(),r=Q[s.status],[o,n]=j.useState(!1),d=s.details||s.fix,i=a=>{navigator.clipboard.writeText(a),g.success("Copied to clipboard")};return d?e.jsx(w,{open:o,onOpenChange:n,children:e.jsxs("div",{className:l("group rounded-lg border transition-all duration-150",o?"border-border bg-muted/30":"border-transparent hover:border-border/50 hover:bg-muted/50"),children:[e.jsx(y,{asChild:!0,children:e.jsxs("button",{className:"w-full flex items-center gap-3 px-3 py-2 text-left",children:[e.jsxs("div",{className:"relative flex items-center justify-center w-4 h-4",children:[e.jsx("div",{className:l("w-2 h-2 rounded-full",r.dot)}),s.status!=="ok"&&e.jsx("div",{className:l("absolute w-2 h-2 rounded-full animate-ping opacity-75",r.dot)})]}),e.jsx("span",{className:"flex-1 text-sm font-medium truncate",children:s.name}),e.jsxs("span",{className:l("font-mono text-xs font-semibold",r.labelColor),children:["[",r.label,"]"]}),e.jsx(E,{className:l("w-4 h-4 text-muted-foreground transition-transform duration-200",o&&"rotate-90")})]})}),e.jsx(k,{children:e.jsxs("div",{className:"px-3 pb-3 pt-1 space-y-2 ml-7",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:s.message}),s.details&&e.jsx("pre",{className:"text-xs font-mono text-muted-foreground bg-background/50 rounded p-2 overflow-x-auto border border-border/50",children:s.details}),s.fix&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"flex-1 flex items-center gap-2 bg-background/50 rounded px-2 py-1.5 border border-border/50",children:[e.jsx(C,{className:"w-3 h-3 text-muted-foreground shrink-0"}),e.jsx("code",{className:"text-xs font-mono flex-1 truncate",children:s.fix}),e.jsx(p,{variant:"ghost",size:"sm",onClick:()=>s.fix&&i(s.fix),className:"h-5 w-5 p-0",children:e.jsx(S,{className:"w-3 h-3"})})]}),s.fixable&&s.status!=="ok"&&e.jsxs(p,{size:"sm",onClick:()=>t.mutate(s.id),disabled:t.isPending,className:"h-7 px-3 text-xs",children:[e.jsx(v,{className:"w-3 h-3 mr-1"}),"Apply Fix"]})]})]})})]})}):e.jsxs("div",{className:l("group flex items-center gap-3 px-3 py-2 rounded-lg","hover:bg-muted/50 transition-colors duration-150","border border-transparent hover:border-border/50"),children:[e.jsxs("div",{className:"relative flex items-center justify-center w-4 h-4",children:[e.jsx("div",{className:l("w-2 h-2 rounded-full",r.dot)}),s.status!=="ok"&&e.jsx("div",{className:l("absolute w-2 h-2 rounded-full animate-ping opacity-75",r.dot)})]}),e.jsx("span",{className:"flex-1 text-sm font-medium truncate",children:s.name}),e.jsxs("span",{className:l("font-mono text-xs font-semibold",r.labelColor),children:["[",r.label,"]"]}),s.fixable&&s.status!=="ok"&&e.jsxs(p,{size:"sm",variant:"ghost",onClick:()=>t.mutate(s.id),disabled:t.isPending,className:"h-6 px-2 text-xs opacity-0 group-hover:opacity-100 transition-opacity",children:[e.jsx(v,{className:"w-3 h-3 mr-1"}),"Fix"]})]})}const V={Monitor:I,Settings:H,Users:$,Shield:O,Zap:P};function Z({group:s,defaultOpen:t=!0}){const[r,o]=j.useState(t),n=V[s.icon]||I,d=s.checks.filter(m=>m.status==="ok").length,i=s.checks.length,a=s.checks.some(m=>m.status==="error"),c=s.checks.some(m=>m.status==="warning"),f=Math.round(d/i*100),x=a?"text-red-500":c?"text-yellow-500":"text-green-500",u=a?"bg-red-500":c?"bg-yellow-500":"bg-green-500";return e.jsx(w,{open:r,onOpenChange:o,children:e.jsxs("div",{className:l("rounded-lg border transition-all duration-200",a?"border-red-500/30":c?"border-yellow-500/30":"border-border"),children:[e.jsx(y,{asChild:!0,children:e.jsxs("button",{className:l("w-full flex items-center gap-3 p-3 text-left rounded-lg","hover:bg-muted/50 transition-colors duration-150",r&&"rounded-b-none border-b border-border/50"),children:[e.jsx("div",{className:l("p-1.5 rounded-md",a?"bg-red-500/10 text-red-500":c?"bg-yellow-500/10 text-yellow-500":"bg-muted text-muted-foreground"),children:e.jsx(n,{className:"w-4 h-4"})}),e.jsx("span",{className:"flex-1 text-sm font-semibold",children:s.name}),!r&&e.jsx("div",{className:"flex items-center gap-2",children:e.jsx("div",{className:"w-16 h-1.5 rounded-full bg-muted overflow-hidden",children:e.jsx("div",{className:l("h-full transition-all duration-500",u),style:{width:`${f}%`}})})}),e.jsxs("span",{className:l("font-mono text-xs font-semibold",x),children:[d,"/",i]}),e.jsx(T,{className:l("w-4 h-4 text-muted-foreground transition-transform duration-200",r&&"rotate-180")})]})}),e.jsx(k,{children:e.jsx("div",{className:"p-2 space-y-0.5",children:s.checks.map(m=>e.jsx(U,{check:m},m.id))})})]})})}function J(s){return s.errors>0?"error":s.warnings>0?"warning":"ok"}function X(s){const t=Math.floor((Date.now()-s)/1e3);if(t<5)return"just now";if(t<60)return`${t}s ago`;const r=Math.floor(t/60);return r<60?`${r}m ago`:`${Math.floor(r/60)}h ago`}function Y(s){return[...s].sort((t,r)=>{const o=t.checks.filter(a=>a.status==="error").length,n=r.checks.filter(a=>a.status==="error").length,d=t.checks.filter(a=>a.status==="warning").length,i=r.checks.filter(a=>a.status==="warning").length;return o!==n?n-o:i-d})}function _(){return e.jsxs("div",{className:"font-mono text-sm text-muted-foreground flex items-center gap-2",children:[e.jsx("span",{className:"text-green-500",children:"$"}),e.jsx("span",{children:"ccs doctor"})]})}function ee(){return e.jsxs("div",{className:"p-6 max-w-6xl mx-auto space-y-6",children:[e.jsx("div",{className:"rounded-xl border bg-gradient-to-br from-background to-muted/20 p-6",children:e.jsxs("div",{className:"flex items-center gap-6",children:[e.jsx(h,{className:"w-[120px] h-[120px] rounded-full"}),e.jsxs("div",{className:"flex-1 space-y-3",children:[e.jsx(h,{className:"h-5 w-48"}),e.jsx(h,{className:"h-8 w-64"}),e.jsx(h,{className:"h-4 w-32"})]})]})}),e.jsx(h,{className:"h-16 w-full rounded-lg"}),e.jsx("div",{className:"space-y-3",children:[1,2,3,4].map(s=>e.jsx(h,{className:"h-20 rounded-lg"},s))})]})}function ce(){const{data:s,isLoading:t,refetch:r,dataUpdatedAt:o}=q(),n=o,[d,i]=j.useState(0);j.useEffect(()=>{const u=setInterval(()=>i(m=>m+1),1e3);return()=>clearInterval(u)},[]);const a=()=>{navigator.clipboard.writeText("ccs doctor"),g.success("Copied to clipboard")},c=()=>{r(),g.info("Refreshing health checks...")};if(t&&!s)return e.jsx(ee,{});const f=s?J(s.summary):"ok",x=s?.groups?Y(s.groups):[];return e.jsxs("div",{className:"p-6 max-w-6xl mx-auto space-y-6",children:[e.jsxs("div",{className:l("relative overflow-hidden rounded-xl border p-6","bg-gradient-to-br from-background via-background to-muted/30"),children:[e.jsx("div",{className:"absolute inset-0 opacity-[0.02] pointer-events-none",style:{backgroundImage:"repeating-linear-gradient(0deg, transparent, transparent 2px, currentColor 2px, currentColor 3px)"}}),e.jsx("div",{className:"absolute inset-0 opacity-[0.03] pointer-events-none",children:e.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"radial-gradient(circle at 1px 1px, currentColor 1px, transparent 0)",backgroundSize:"24px 24px"}})}),e.jsxs("div",{className:"relative flex flex-col md:flex-row items-start md:items-center gap-6",children:[s&&e.jsx("div",{className:"shrink-0",children:e.jsx(K,{passed:s.summary.passed,total:s.summary.total-s.summary.info,status:f,size:"md"})}),e.jsxs("div",{className:"flex-1 space-y-3",children:[e.jsx(_,{}),e.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[e.jsx("h1",{className:"text-2xl font-bold font-mono tracking-tight",children:"System Health"}),s?.version&&e.jsxs(z,{variant:"outline",className:"font-mono text-xs bg-muted/50",children:["build ",s.version]})]}),e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx(F,{className:"w-4 h-4 text-muted-foreground"}),e.jsx("span",{className:"text-muted-foreground",children:"Last scan:"}),e.jsx("span",{className:"font-mono",children:n?X(n):"--"}),e.jsx("span",{className:"text-muted-foreground",children:"|"}),e.jsx("span",{className:"text-muted-foreground",children:"Auto-refresh:"}),e.jsx("span",{className:"font-mono text-green-500",children:"30s"})]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsxs(p,{variant:"outline",size:"sm",onClick:a,className:"gap-2 font-mono text-xs",children:[e.jsx(C,{className:"w-3 h-3"}),"ccs doctor",e.jsx(S,{className:"w-3 h-3 opacity-50"})]}),e.jsxs(p,{variant:"outline",size:"sm",onClick:c,disabled:t,className:"gap-2",children:[e.jsx(A,{className:l("w-4 h-4",t&&"animate-spin")}),e.jsx("span",{className:"hidden sm:inline",children:"Refresh"}),e.jsx("kbd",{className:"hidden md:inline-flex h-5 items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium text-muted-foreground",children:"R"})]})]})]})]}),s&&e.jsx("div",{className:"rounded-lg border bg-card p-4",children:e.jsx(L,{total:s.summary.total,passed:s.summary.passed,warnings:s.summary.warnings,errors:s.summary.errors,info:s.summary.info})}),x.length>0&&e.jsx("div",{className:"space-y-3",children:x.map((u,m)=>e.jsx(Z,{group:u,defaultOpen:m<2||u.checks.some(N=>N.status==="error"||N.status==="warning")},u.id))}),e.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground border-t pt-4",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("span",{children:["Version ",e.jsx("span",{className:"font-mono",children:s?.version??"--"})]}),e.jsxs("span",{children:["Platform"," ",e.jsx("span",{className:"font-mono",children:typeof navigator<"u"?navigator.platform:"linux"})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-green-500 animate-pulse"}),e.jsx("span",{children:"Live monitoring active"})]})]})]})}export{ce as HealthPage};
1
+ import{j as e}from"./radix-ui-DIWAxjEp.js";import{c as l,b as p,K as w,M as y,N as k,B as z,S as h}from"./index-BOyrh__4.js";import{u as M,a as R,b as E}from"./tanstack-Hn82hibe.js";import{t as g}from"./notifications-B2HqRBj7.js";import{r as j}from"./react-vendor-CNOkPC89.js";import{aE as v,c as W,z as C,m as S,Z as P,g as O,U as $,b as F,aF as I,Y as H,y as T,R as A}from"./icons-D7XDTBCN.js";import"./utils-CzKF5WmX.js";import"./form-utils-Cn_Uld6y.js";import"./code-highlight-BRUf_pqB.js";const B={sm:{dimension:80,strokeWidth:6,fontSize:"text-lg",labelSize:"text-[10px]"},md:{dimension:120,strokeWidth:8,fontSize:"text-3xl",labelSize:"text-xs"},lg:{dimension:160,strokeWidth:10,fontSize:"text-4xl",labelSize:"text-sm"}},D={ok:{stroke:"#22C55E",glow:"rgba(34, 197, 94, 0.4)"},warning:{stroke:"#EAB308",glow:"rgba(234, 179, 8, 0.4)"},error:{stroke:"#EF4444",glow:"rgba(239, 68, 68, 0.4)"}};function K({passed:s,total:t,status:r,size:o="md"}){const n=B[o],d=D[r],i=t>0?Math.round(s/t*100):0,a=(n.dimension-n.strokeWidth)/2,c=2*Math.PI*a,f=c-i/100*c,x=n.dimension/2;return e.jsxs("div",{className:"relative inline-flex items-center justify-center",children:[e.jsxs("svg",{width:n.dimension,height:n.dimension,className:"transform -rotate-90",style:{filter:`drop-shadow(0 0 8px ${d.glow})`},children:[e.jsx("circle",{cx:x,cy:x,r:a,fill:"none",stroke:"currentColor",strokeWidth:n.strokeWidth,className:"text-muted/30"}),e.jsx("circle",{cx:x,cy:x,r:a,fill:"none",stroke:d.stroke,strokeWidth:n.strokeWidth,strokeLinecap:"round",strokeDasharray:c,strokeDashoffset:f,className:"transition-all duration-1000 ease-out"}),i>0&&e.jsx("circle",{cx:x+a*Math.cos(i/100*2*Math.PI-Math.PI/2),cy:x+a*Math.sin(i/100*2*Math.PI-Math.PI/2),r:n.strokeWidth/2,fill:d.stroke,className:"animate-pulse",style:{filter:`drop-shadow(0 0 4px ${d.glow})`}})]}),e.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[e.jsx("span",{className:l("font-mono font-bold tracking-tight",n.fontSize),children:i}),e.jsx("span",{className:l("font-mono uppercase tracking-widest text-muted-foreground",n.labelSize),children:"health"})]})]})}function b({label:s,value:t,color:r,bgColor:o}){return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:l("w-2 h-2 rounded-full animate-pulse",o)}),e.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:s}),e.jsx("span",{className:l("font-mono font-bold text-sm",r),children:t})]})}function L({total:s,passed:t,warnings:r,errors:o,info:n}){const d=t/s*100,i=r/s*100,a=o/s*100,c=n/s*100;return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"h-2 rounded-full overflow-hidden bg-muted/50 flex",children:[a>0&&e.jsx("div",{className:"h-full bg-red-500 transition-all duration-500",style:{width:`${a}%`}}),i>0&&e.jsx("div",{className:"h-full bg-yellow-500 transition-all duration-500",style:{width:`${i}%`}}),c>0&&e.jsx("div",{className:"h-full bg-blue-500 transition-all duration-500",style:{width:`${c}%`}}),d>0&&e.jsx("div",{className:"h-full bg-green-500 transition-all duration-500",style:{width:`${d}%`}})]}),e.jsxs("div",{className:"flex items-center justify-between gap-4 flex-wrap",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"Checks"}),e.jsx("span",{className:"font-mono font-bold text-lg",children:s})]}),e.jsxs("div",{className:"flex items-center gap-4 flex-wrap",children:[e.jsx(b,{label:"OK",value:t,color:"text-green-500",bgColor:"bg-green-500"}),e.jsx(b,{label:"WARN",value:r,color:"text-yellow-500",bgColor:"bg-yellow-500"}),e.jsx(b,{label:"ERR",value:o,color:"text-red-500",bgColor:"bg-red-500"}),e.jsx(b,{label:"INFO",value:n,color:"text-blue-500",bgColor:"bg-blue-500"})]})]})]})}function q(){return M({queryKey:["health"],queryFn:async()=>(await fetch("/api/health")).json(),refetchInterval:3e4})}function G(){const s=R();return E({mutationFn:async t=>{const r=await fetch(`/api/health/fix/${t}`,{method:"POST"}),o=await r.json();if(!r.ok)throw new Error(o.message);return o},onSuccess:t=>{s.invalidateQueries({queryKey:["health"]}),g.success(t.message)},onError:t=>{g.error(t.message)}})}const Q={ok:{dot:"bg-green-500",label:"OK",labelColor:"text-green-500"},warning:{dot:"bg-yellow-500",label:"WARN",labelColor:"text-yellow-500"},error:{dot:"bg-red-500",label:"ERR",labelColor:"text-red-500"},info:{dot:"bg-blue-500",label:"INFO",labelColor:"text-blue-500"}};function U({check:s}){const t=G(),r=Q[s.status],[o,n]=j.useState(!1),d=s.details||s.fix,i=a=>{navigator.clipboard.writeText(a),g.success("Copied to clipboard")};return d?e.jsx(w,{open:o,onOpenChange:n,children:e.jsxs("div",{className:l("group rounded-lg border transition-all duration-150",o?"border-border bg-muted/30":"border-transparent hover:border-border/50 hover:bg-muted/50"),children:[e.jsx(y,{asChild:!0,children:e.jsxs("button",{className:"w-full flex items-center gap-3 px-3 py-2 text-left",children:[e.jsxs("div",{className:"relative flex items-center justify-center w-4 h-4",children:[e.jsx("div",{className:l("w-2 h-2 rounded-full",r.dot)}),s.status!=="ok"&&e.jsx("div",{className:l("absolute w-2 h-2 rounded-full animate-ping opacity-75",r.dot)})]}),e.jsx("span",{className:"flex-1 text-sm font-medium truncate",children:s.name}),e.jsxs("span",{className:l("font-mono text-xs font-semibold",r.labelColor),children:["[",r.label,"]"]}),e.jsx(W,{className:l("w-4 h-4 text-muted-foreground transition-transform duration-200",o&&"rotate-90")})]})}),e.jsx(k,{children:e.jsxs("div",{className:"px-3 pb-3 pt-1 space-y-2 ml-7",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:s.message}),s.details&&e.jsx("pre",{className:"text-xs font-mono text-muted-foreground bg-background/50 rounded p-2 overflow-x-auto border border-border/50",children:s.details}),s.fix&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"flex-1 flex items-center gap-2 bg-background/50 rounded px-2 py-1.5 border border-border/50",children:[e.jsx(C,{className:"w-3 h-3 text-muted-foreground shrink-0"}),e.jsx("code",{className:"text-xs font-mono flex-1 truncate",children:s.fix}),e.jsx(p,{variant:"ghost",size:"sm",onClick:()=>s.fix&&i(s.fix),className:"h-5 w-5 p-0",children:e.jsx(S,{className:"w-3 h-3"})})]}),s.fixable&&s.status!=="ok"&&e.jsxs(p,{size:"sm",onClick:()=>t.mutate(s.id),disabled:t.isPending,className:"h-7 px-3 text-xs",children:[e.jsx(v,{className:"w-3 h-3 mr-1"}),"Apply Fix"]})]})]})})]})}):e.jsxs("div",{className:l("group flex items-center gap-3 px-3 py-2 rounded-lg","hover:bg-muted/50 transition-colors duration-150","border border-transparent hover:border-border/50"),children:[e.jsxs("div",{className:"relative flex items-center justify-center w-4 h-4",children:[e.jsx("div",{className:l("w-2 h-2 rounded-full",r.dot)}),s.status!=="ok"&&e.jsx("div",{className:l("absolute w-2 h-2 rounded-full animate-ping opacity-75",r.dot)})]}),e.jsx("span",{className:"flex-1 text-sm font-medium truncate",children:s.name}),e.jsxs("span",{className:l("font-mono text-xs font-semibold",r.labelColor),children:["[",r.label,"]"]}),s.fixable&&s.status!=="ok"&&e.jsxs(p,{size:"sm",variant:"ghost",onClick:()=>t.mutate(s.id),disabled:t.isPending,className:"h-6 px-2 text-xs opacity-0 group-hover:opacity-100 transition-opacity",children:[e.jsx(v,{className:"w-3 h-3 mr-1"}),"Fix"]})]})}const Z={Monitor:I,Settings:F,Users:$,Shield:O,Zap:P};function V({group:s,defaultOpen:t=!0}){const[r,o]=j.useState(t),n=Z[s.icon]||I,d=s.checks.filter(m=>m.status==="ok").length,i=s.checks.length,a=s.checks.some(m=>m.status==="error"),c=s.checks.some(m=>m.status==="warning"),f=Math.round(d/i*100),x=a?"text-red-500":c?"text-yellow-500":"text-green-500",u=a?"bg-red-500":c?"bg-yellow-500":"bg-green-500";return e.jsx(w,{open:r,onOpenChange:o,children:e.jsxs("div",{className:l("rounded-lg border transition-all duration-200",a?"border-red-500/30":c?"border-yellow-500/30":"border-border"),children:[e.jsx(y,{asChild:!0,children:e.jsxs("button",{className:l("w-full flex items-center gap-3 p-3 text-left rounded-lg","hover:bg-muted/50 transition-colors duration-150",r&&"rounded-b-none border-b border-border/50"),children:[e.jsx("div",{className:l("p-1.5 rounded-md",a?"bg-red-500/10 text-red-500":c?"bg-yellow-500/10 text-yellow-500":"bg-muted text-muted-foreground"),children:e.jsx(n,{className:"w-4 h-4"})}),e.jsx("span",{className:"flex-1 text-sm font-semibold",children:s.name}),!r&&e.jsx("div",{className:"flex items-center gap-2",children:e.jsx("div",{className:"w-16 h-1.5 rounded-full bg-muted overflow-hidden",children:e.jsx("div",{className:l("h-full transition-all duration-500",u),style:{width:`${f}%`}})})}),e.jsxs("span",{className:l("font-mono text-xs font-semibold",x),children:[d,"/",i]}),e.jsx(H,{className:l("w-4 h-4 text-muted-foreground transition-transform duration-200",r&&"rotate-180")})]})}),e.jsx(k,{children:e.jsx("div",{className:"p-2 space-y-0.5",children:s.checks.map(m=>e.jsx(U,{check:m},m.id))})})]})})}function Y(s){return s.errors>0?"error":s.warnings>0?"warning":"ok"}function J(s){const t=Math.floor((Date.now()-s)/1e3);if(t<5)return"just now";if(t<60)return`${t}s ago`;const r=Math.floor(t/60);return r<60?`${r}m ago`:`${Math.floor(r/60)}h ago`}function X(s){return[...s].sort((t,r)=>{const o=t.checks.filter(a=>a.status==="error").length,n=r.checks.filter(a=>a.status==="error").length,d=t.checks.filter(a=>a.status==="warning").length,i=r.checks.filter(a=>a.status==="warning").length;return o!==n?n-o:i-d})}function _(){return e.jsxs("div",{className:"font-mono text-sm text-muted-foreground flex items-center gap-2",children:[e.jsx("span",{className:"text-green-500",children:"$"}),e.jsx("span",{children:"ccs doctor"})]})}function ee(){return e.jsxs("div",{className:"p-6 max-w-6xl mx-auto space-y-6",children:[e.jsx("div",{className:"rounded-xl border bg-gradient-to-br from-background to-muted/20 p-6",children:e.jsxs("div",{className:"flex items-center gap-6",children:[e.jsx(h,{className:"w-[120px] h-[120px] rounded-full"}),e.jsxs("div",{className:"flex-1 space-y-3",children:[e.jsx(h,{className:"h-5 w-48"}),e.jsx(h,{className:"h-8 w-64"}),e.jsx(h,{className:"h-4 w-32"})]})]})}),e.jsx(h,{className:"h-16 w-full rounded-lg"}),e.jsx("div",{className:"space-y-3",children:[1,2,3,4].map(s=>e.jsx(h,{className:"h-20 rounded-lg"},s))})]})}function ce(){const{data:s,isLoading:t,refetch:r,dataUpdatedAt:o}=q(),n=o,[d,i]=j.useState(0);j.useEffect(()=>{const u=setInterval(()=>i(m=>m+1),1e3);return()=>clearInterval(u)},[]);const a=()=>{navigator.clipboard.writeText("ccs doctor"),g.success("Copied to clipboard")},c=()=>{r(),g.info("Refreshing health checks...")};if(t&&!s)return e.jsx(ee,{});const f=s?Y(s.summary):"ok",x=s?.groups?X(s.groups):[];return e.jsxs("div",{className:"p-6 max-w-6xl mx-auto space-y-6",children:[e.jsxs("div",{className:l("relative overflow-hidden rounded-xl border p-6","bg-gradient-to-br from-background via-background to-muted/30"),children:[e.jsx("div",{className:"absolute inset-0 opacity-[0.02] pointer-events-none",style:{backgroundImage:"repeating-linear-gradient(0deg, transparent, transparent 2px, currentColor 2px, currentColor 3px)"}}),e.jsx("div",{className:"absolute inset-0 opacity-[0.03] pointer-events-none",children:e.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"radial-gradient(circle at 1px 1px, currentColor 1px, transparent 0)",backgroundSize:"24px 24px"}})}),e.jsxs("div",{className:"relative flex flex-col md:flex-row items-start md:items-center gap-6",children:[s&&e.jsx("div",{className:"shrink-0",children:e.jsx(K,{passed:s.summary.passed,total:s.summary.total-s.summary.info,status:f,size:"md"})}),e.jsxs("div",{className:"flex-1 space-y-3",children:[e.jsx(_,{}),e.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[e.jsx("h1",{className:"text-2xl font-bold font-mono tracking-tight",children:"System Health"}),s?.version&&e.jsxs(z,{variant:"outline",className:"font-mono text-xs bg-muted/50",children:["build ",s.version]})]}),e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx(T,{className:"w-4 h-4 text-muted-foreground"}),e.jsx("span",{className:"text-muted-foreground",children:"Last scan:"}),e.jsx("span",{className:"font-mono",children:n?J(n):"--"}),e.jsx("span",{className:"text-muted-foreground",children:"|"}),e.jsx("span",{className:"text-muted-foreground",children:"Auto-refresh:"}),e.jsx("span",{className:"font-mono text-green-500",children:"30s"})]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsxs(p,{variant:"outline",size:"sm",onClick:a,className:"gap-2 font-mono text-xs",children:[e.jsx(C,{className:"w-3 h-3"}),"ccs doctor",e.jsx(S,{className:"w-3 h-3 opacity-50"})]}),e.jsxs(p,{variant:"outline",size:"sm",onClick:c,disabled:t,className:"gap-2",children:[e.jsx(A,{className:l("w-4 h-4",t&&"animate-spin")}),e.jsx("span",{className:"hidden sm:inline",children:"Refresh"}),e.jsx("kbd",{className:"hidden md:inline-flex h-5 items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium text-muted-foreground",children:"R"})]})]})]})]}),s&&e.jsx("div",{className:"rounded-lg border bg-card p-4",children:e.jsx(L,{total:s.summary.total,passed:s.summary.passed,warnings:s.summary.warnings,errors:s.summary.errors,info:s.summary.info})}),x.length>0&&e.jsx("div",{className:"space-y-3",children:x.map((u,m)=>e.jsx(V,{group:u,defaultOpen:m<2||u.checks.some(N=>N.status==="error"||N.status==="warning")},u.id))}),e.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground border-t pt-4",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("span",{children:["Version ",e.jsx("span",{className:"font-mono",children:s?.version??"--"})]}),e.jsxs("span",{children:["Platform"," ",e.jsx("span",{className:"font-mono",children:typeof navigator<"u"?navigator.platform:"linux"})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-green-500 animate-pulse"}),e.jsx("span",{children:"Live monitoring active"})]})]})]})}export{ce as HealthPage};
@@ -0,0 +1 @@
1
+ import{r as d}from"./react-vendor-CNOkPC89.js";const M=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),_=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,c,o)=>o?o.toUpperCase():c.toLowerCase()),s=t=>{const e=_(t);return e.charAt(0).toUpperCase()+e.slice(1)},k=(...t)=>t.filter((e,c,o)=>!!e&&e.trim()!==""&&o.indexOf(e)===c).join(" ").trim(),v=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0};var x={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const m=d.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:c=2,absoluteStrokeWidth:o,className:y="",children:h,iconNode:r,...n},i)=>d.createElement("svg",{ref:i,...x,width:e,height:e,stroke:t,strokeWidth:o?Number(c)*24/Number(e):c,className:k("lucide",y),...!h&&!v(n)&&{"aria-hidden":"true"},...n},[...r.map(([p,l])=>d.createElement(p,l)),...Array.isArray(h)?h:[h]]));const a=(t,e)=>{const c=d.forwardRef(({className:o,...y},h)=>d.createElement(m,{ref:h,iconNode:e,className:k(`lucide-${M(s(t))}`,`lucide-${t}`,o),...y}));return c.displayName=s(t),c};const g=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],w2=a("activity",g);const f=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]],N2=a("archive",f);const w=[["path",{d:"M17 7 7 17",key:"15tmo1"}],["path",{d:"M17 17H7V7",key:"1org7z"}]],$2=a("arrow-down-left",w);const N=[["path",{d:"m7 7 10 10",key:"1fmybs"}],["path",{d:"M17 7v10H7",key:"6fjiku"}]],u2=a("arrow-down-right",N);const $=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],z2=a("arrow-down",$);const u=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],b2=a("arrow-left",u);const z=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],q2=a("arrow-right",z);const b=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],C2=a("arrow-up-right",b);const q=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],A2=a("arrow-up",q);const C=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],j2=a("book-open",C);const A=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],H2=a("bot",A);const j=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],V2=a("box",j);const H=[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M9 13a4.5 4.5 0 0 0 3-4",key:"10igwf"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M12 13h4",key:"1ku699"}],["path",{d:"M12 18h6a2 2 0 0 1 2 2v1",key:"105ag5"}],["path",{d:"M12 8h8",key:"1lhi5i"}],["path",{d:"M16 8V5a2 2 0 0 1 2-2",key:"u6izg6"}],["circle",{cx:"16",cy:"13",r:".5",key:"ry7gng"}],["circle",{cx:"18",cy:"3",r:".5",key:"1aiba7"}],["circle",{cx:"20",cy:"21",r:".5",key:"yhc1fs"}],["circle",{cx:"20",cy:"8",r:".5",key:"1e43v0"}]],L2=a("brain-circuit",H);const V=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],S2=a("brain",V);const L=[["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z",key:"uouzyp"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M21 21a4 4 0 0 0-3.81-4",key:"1b0z45"}],["path",{d:"M21 5a4 4 0 0 1-3.55 3.97",key:"5cxbf6"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M3 21a4 4 0 0 1 3.81-4",key:"1fjd4g"}],["path",{d:"M3 5a4 4 0 0 0 3.55 3.97",key:"1d7oge"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M9 7.13V6a3 3 0 1 1 6 0v1.13",key:"1vgav8"}]],B2=a("bug",L);const S=[["path",{d:"M16 14v2.2l1.6 1",key:"fo4ql5"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",key:"1osxxc"}],["path",{d:"M3 10h5",key:"r794hk"}],["path",{d:"M8 2v4",key:"1cmpym"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]],P2=a("calendar-clock",S);const B=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],R2=a("calendar",B);const P=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],E2=a("chart-column",P);const R=[["path",{d:"M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z",key:"pzmjnu"}],["path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83",key:"k2fpak"}]],F2=a("chart-pie",R);const E=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],D2=a("check",E);const F=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],G2=a("chevron-down",F);const D=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],O2=a("chevron-left",D);const G=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],U2=a("chevron-right",G);const O=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Z2=a("chevron-up",O);const U=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],T2=a("circle-alert",U);const Z=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],W2=a("circle-check-big",Z);const T=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],I2=a("circle-check",T);const W=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],K2=a("circle-question-mark",W);const I=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Q2=a("circle-x",I);const K=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],X2=a("circle",K);const Q=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],J2=a("clock",Q);const X=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],Y2=a("cloud",X);const J=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],a0=a("code-xml",J);const Y=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],e0=a("code",Y);const a1=[["circle",{cx:"8",cy:"8",r:"6",key:"3yglwk"}],["path",{d:"M18.09 10.37A6 6 0 1 1 10.34 18",key:"t5s6rm"}],["path",{d:"M7 6h1v4",key:"1obek4"}],["path",{d:"m16.71 13.88.7.71-2.82 2.82",key:"1rbuyh"}]],t0=a("coins",a1);const e1=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],c0=a("copy",e1);const t1=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],o0=a("cpu",t1);const c1=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],h0=a("database",c1);const o1=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],d0=a("dollar-sign",o1);const h1=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],y0=a("download",h1);const d1=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],n0=a("ellipsis",d1);const y1=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],s0=a("external-link",y1);const n1=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],k0=a("eye-off",n1);const s1=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],r0=a("eye",s1);const k1=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]],i0=a("file-braces",k1);const r1=[["path",{d:"M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35",key:"1wthlu"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m5 16-3 3 3 3",key:"331omg"}],["path",{d:"m9 22 3-3-3-3",key:"lsp7cz"}]],p0=a("file-code-corner",r1);const i1=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]],l0=a("file-code",i1);const p1=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]],M0=a("file-down",p1);const l1=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],_0=a("file-exclamation-point",l1);const M1=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],v0=a("file-text",M1);const _1=[["path",{d:"M10 10.5 8 13l2 2.5",key:"m4t9c1"}],["path",{d:"m14 10.5 2 2.5-2 2.5",key:"14w2eb"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2z",key:"1u1bxd"}]],x0=a("folder-code",_1);const v1=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],m0=a("folder-open",v1);const x1=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],g0=a("folder",x1);const m1=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],f0=a("gauge",m1);const g1=[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]],w0=a("git-branch",g1);const f1=[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]],N0=a("github",f1);const w1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],$0=a("globe",w1);const N1=[["circle",{cx:"12",cy:"9",r:"1",key:"124mty"}],["circle",{cx:"19",cy:"9",r:"1",key:"1ruzo2"}],["circle",{cx:"5",cy:"9",r:"1",key:"1a8b28"}],["circle",{cx:"12",cy:"15",r:"1",key:"1e56xg"}],["circle",{cx:"19",cy:"15",r:"1",key:"1a92ep"}],["circle",{cx:"5",cy:"15",r:"1",key:"5r1jwy"}]],u0=a("grip-horizontal",N1);const $1=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],z0=a("grip-vertical",$1);const u1=[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]],b0=a("heart",u1);const z1=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],q0=a("house",z1);const b1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],C0=a("info",b1);const q1=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],A0=a("key-round",q1);const C1=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],j0=a("key",C1);const A1=[["path",{d:"M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z",key:"1pdavp"}],["path",{d:"M20.054 15.987H3.946",key:"14rxg9"}]],H0=a("laptop",A1);const j1=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],V0=a("loader-circle",j1);const H1=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],L0=a("lock",H1);const V1=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],S0=a("log-out",V1);const L1=[["path",{d:"M11 6a13 13 0 0 0 8.4-2.8A1 1 0 0 1 21 4v12a1 1 0 0 1-1.6.8A13 13 0 0 0 11 14H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2z",key:"q8bfy3"}],["path",{d:"M6 14a12 12 0 0 0 2.4 7.2 2 2 0 0 0 3.2-2.4A8 8 0 0 1 10 14",key:"1853fq"}],["path",{d:"M8 6v8",key:"15ugcq"}]],B0=a("megaphone",L1);const S1=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],P0=a("monitor",S1);const B1=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],R0=a("moon",B1);const P1=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],E0=a("network",P1);const R1=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],F0=a("package",R1);const E1=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],D0=a("panel-left",E1);const F1=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],G0=a("pause",F1);const D1=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],O0=a("play",D1);const G1=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],U0=a("plus",G1);const O1=[["path",{d:"M18.36 6.64A9 9 0 0 1 20.77 15",key:"dxknvb"}],["path",{d:"M6.16 6.16a9 9 0 1 0 12.68 12.68",key:"1x7qb5"}],["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],Z0=a("power-off",O1);const U1=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],T0=a("power",U1);const Z1=[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],W0=a("radio",Z1);const T1=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],I0=a("refresh-cw",T1);const W1=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],K0=a("rotate-ccw",W1);const I1=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],Q0=a("rotate-cw",I1);const K1=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],X0=a("save",K1);const Q1=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],J0=a("search",Q1);const X1=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],Y0=a("server",X1);const J1=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],aa=a("settings-2",J1);const Y1=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],ea=a("settings",Y1);const a2=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],ta=a("shield-alert",a2);const e2=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],ca=a("shield-check",e2);const t2=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],oa=a("shield",t2);const c2=[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]],ha=a("sliders-horizontal",c2);const o2=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],da=a("sparkles",o2);const h2=[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],ya=a("square-terminal",h2);const d2=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],na=a("square",d2);const y2=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],sa=a("star",y2);const n2=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],ka=a("sun",n2);const s2=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],ra=a("terminal",s2);const k2=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],ia=a("trash-2",k2);const r2=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],pa=a("trending-up",r2);const i2=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],la=a("triangle-alert",i2);const p2=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],Ma=a("user",p2);const l2=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],_a=a("users",l2);const M2=[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]],va=a("wand-sparkles",M2);const _2=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],xa=a("wifi-off",_2);const v2=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]],ma=a("wifi",v2);const x2=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],ga=a("wrench",x2);const m2=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],fa=a("x",m2);const g2=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],wa=a("zap",g2);export{aa as $,w2 as A,j2 as B,E2 as C,e0 as D,k0 as E,m0 as F,f0 as G,q0 as H,C0 as I,C2 as J,j0 as K,V0 as L,R0 as M,$2 as N,v0 as O,D0 as P,_0 as Q,I0 as R,ya as S,la as T,_a as U,u0 as V,xa as W,fa as X,G2 as Y,wa as Z,Z2 as _,N0 as a,U0 as a0,da as a1,T2 as a2,$0 as a3,S2 as a4,Y0 as a5,N2 as a6,l0 as a7,O2 as a8,L0 as a9,p0 as aA,L2 as aB,ha as aC,g0 as aD,ga as aE,P0 as aF,H2 as aG,P2 as aH,B0 as aI,F0 as aJ,Y2 as aK,H0 as aL,V2 as aM,B2 as aN,M0 as aO,Q0 as aP,na as aQ,z2 as aR,A2 as aS,d0 as aa,h0 as ab,u2 as ac,R2 as ad,t0 as ae,pa as af,F2 as ag,ia as ah,X0 as ai,J0 as aj,va as ak,a0 as al,q2 as am,i0 as an,b2 as ao,ta as ap,y0 as aq,sa as ar,E0 as as,x0 as at,n0 as au,K2 as av,w0 as aw,T0 as ax,Z0 as ay,ca as az,ea as b,U2 as c,ka as d,r0 as e,ma as f,oa as g,b0 as h,W2 as i,X2 as j,D2 as k,A0 as l,c0 as m,s0 as n,Ma as o,S0 as p,J2 as q,I2 as r,Q2 as s,O0 as t,G0 as u,z0 as v,K0 as w,W0 as x,o0 as y,ra as z};
@@ -0,0 +1 @@
1
+ import{j as e}from"./radix-ui-DIWAxjEp.js";import{r as a}from"./react-vendor-CNOkPC89.js";import{b9 as Fe,ba as Ge,W as R,I as T,q as Ye,r as $e,s as He,t as Ue,v as xe,b as $,bb as Oe,bc as Ve,bd as ze,b2 as ee,b4 as se,m as qe}from"./index-BOyrh__4.js";import{S as B}from"./switch-JJlvFHut.js";import{C as H}from"./default-ports-1QQSffYX.js";import{aK as he,R as te,f as We,r as ge,W as Je,a2 as Xe,aL as Qe,aM as Ze,T as ue,ap as es,n as ss,aN as ts}from"./icons-D7XDTBCN.js";import{R as Y,P as rs}from"./proxy-status-widget-Bvi7eWkI.js";import{t as I}from"./notifications-B2HqRBj7.js";import"./tanstack-Hn82hibe.js";import"./utils-CzKF5WmX.js";import"./form-utils-Cn_Uld6y.js";import"./code-highlight-BRUf_pqB.js";import"./alert-dialog-Cbz7hjbH.js";function as(){const{state:t}=Fe(),r=Ge(),[o,m]=a.useState(null),[h,b]=a.useState(null),[f,u]=a.useState(null),[k,N]=a.useState(null),[y,C]=a.useState(null),P=a.useCallback(async()=>{try{r.setProxyLoading(!0),r.setProxyError(null);const c=await R.cliproxyServer.get();r.setProxyConfig(c)}catch(c){r.setProxyError(c.message)}finally{r.setProxyLoading(!1)}},[r]),w=a.useCallback(async c=>{const d=t.proxyConfig;if(!d)return;const p={remote:{...d.remote,...c.remote},fallback:{...d.fallback,...c.fallback},local:{...d.local,...c.local}};r.setProxyConfig(p),r.setProxyTestResult(null);try{r.setProxySaving(!0),r.setProxyError(null);const i=await R.cliproxyServer.update(c);r.setProxyConfig(i),r.setProxySuccess(!0),setTimeout(()=>r.setProxySuccess(!1),1500)}catch(i){r.setProxyConfig(d),r.setProxyError(i.message)}finally{r.setProxySaving(!1)}},[t.proxyConfig,r]),S=a.useCallback(async c=>{const{host:d,port:p,protocol:i,authToken:A}=c;if(!d){r.setProxyError("Host is required");return}try{r.setProxyTesting(!0),r.setProxyError(null),r.setProxyTestResult(null);const l=p?parseInt(p,10):void 0,E=await R.cliproxyServer.test({host:d,port:l||void 0,protocol:i,authToken:A||void 0});r.setProxyTestResult(E)}catch(l){r.setProxyError(l.message)}finally{r.setProxyTesting(!1)}},[r]);return{config:t.proxyConfig,loading:t.proxyLoading,saving:t.proxySaving,error:t.proxyError,success:t.proxySuccess,testResult:t.proxyTestResult,testing:t.proxyTesting,editedHost:o,setEditedHost:m,editedPort:h,setEditedPort:b,editedAuthToken:f,setEditedAuthToken:u,editedManagementKey:k,setEditedManagementKey:N,editedLocalPort:y,setEditedLocalPort:C,fetchConfig:P,saveConfig:w,testConnection:S}}function os({config:t,saving:r,displayLocalPort:o,setEditedLocalPort:m,onSaveLocalPort:h,onSaveConfig:b}){const f=t.local;return e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-base font-medium",children:"Local Proxy"}),e.jsxs("div",{className:"space-y-3 p-4 rounded-lg border bg-muted/30",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("label",{className:"text-sm text-muted-foreground",children:"Port"}),e.jsx(T,{type:"text",inputMode:"numeric",value:o,onChange:u=>m(u.target.value.replace(/\D/g,"")),onBlur:h,placeholder:`${H}`,className:"font-mono max-w-32",disabled:r})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-sm",children:"Auto-start"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Start local proxy automatically when needed"})]}),e.jsx(B,{checked:f.auto_start??!0,onCheckedChange:u=>b({local:{...f,auto_start:u}}),disabled:r})]})]})]})}function ns({config:t,saving:r,testing:o,testResult:m,displayHost:h,displayPort:b,displayAuthToken:f,displayManagementKey:u,setEditedHost:k,setEditedPort:N,setEditedAuthToken:y,setEditedManagementKey:C,onSaveHost:P,onSavePort:w,onSaveAuthToken:S,onSaveManagementKey:c,onSaveConfig:d,onTestConnection:p}){const i=t.remote,A=l=>l==="https"?443:H;return e.jsxs("div",{className:"space-y-4 p-4 rounded-lg border bg-muted/30",children:[e.jsxs("h4",{className:"text-sm font-medium flex items-center gap-2",children:[e.jsx(he,{className:"w-4 h-4"}),"Remote Server Configuration"]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-sm text-muted-foreground",children:"Host"}),e.jsx(T,{value:h,onChange:l=>k(l.target.value),onBlur:P,placeholder:"192.168.1.100 or proxy.example.com",className:"font-mono",disabled:r})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("label",{className:"text-sm text-muted-foreground",children:["Port"," ",e.jsxs("span",{className:"text-xs opacity-70",children:["(default: ",A(t.remote.protocol||"http"),")"]})]}),e.jsx(T,{type:"text",inputMode:"numeric",value:b,onChange:l=>N(l.target.value.replace(/\D/g,"")),onBlur:w,placeholder:`Leave empty for ${A(t.remote.protocol||"http")}`,className:"font-mono",disabled:r})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-sm text-muted-foreground",children:"Protocol"}),e.jsxs(Ye,{value:t.remote.protocol||"http",onValueChange:l=>d({remote:{...i,protocol:l}}),disabled:r,children:[e.jsx($e,{children:e.jsx(He,{})}),e.jsxs(Ue,{children:[e.jsx(xe,{value:"http",children:"HTTP"}),e.jsx(xe,{value:"https",children:"HTTPS"})]})]})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-sm text-muted-foreground",children:"API Key (optional)"}),e.jsx(T,{type:"password",value:f,onChange:l=>y(l.target.value),onBlur:S,placeholder:"For /v1/* API endpoints",className:"font-mono",disabled:r}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Used for API requests to /v1/chat/completions"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-sm text-muted-foreground",children:"Management Key (optional)"}),e.jsx(T,{type:"password",value:u,onChange:l=>C(l.target.value),onBlur:c,placeholder:"For /v0/management/* endpoints",className:"font-mono",disabled:r}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Used for dashboard management APIs. Falls back to API Key if not set."})]}),e.jsxs("div",{className:"space-y-3 pt-2",children:[e.jsx($,{onClick:p,disabled:o||!h,variant:"outline",className:"w-full",children:o?e.jsxs(e.Fragment,{children:[e.jsx(te,{className:"w-4 h-4 mr-2 animate-spin"}),"Testing..."]}):e.jsxs(e.Fragment,{children:[e.jsx(We,{className:"w-4 h-4 mr-2"}),"Test Connection"]})}),m&&e.jsx("div",{className:`p-3 rounded-md ${m.reachable?"bg-green-50 border border-green-200 dark:bg-green-900/20 dark:border-green-900/50":"bg-red-50 border border-red-200 dark:bg-red-900/20 dark:border-red-900/50"}`,children:e.jsx("div",{className:"flex items-center gap-2",children:m.reachable?e.jsxs(e.Fragment,{children:[e.jsx(ge,{className:"w-4 h-4 text-green-600 dark:text-green-400"}),e.jsxs("span",{className:"text-sm font-medium text-green-700 dark:text-green-300",children:["Connected (",m.latencyMs,"ms)"]})]}):e.jsxs(e.Fragment,{children:[e.jsx(Je,{className:"w-4 h-4 text-red-600 dark:text-red-400"}),e.jsx("span",{className:"text-sm font-medium text-red-700 dark:text-red-300",children:m.error||"Connection failed"})]})})})]})]})}const pe="ccs_debug_mode",ls=["kiro","ghcp"];function is(t){return t.trim().replace(/\s+/g," ").toUpperCase()}function Ns(){const{config:t,loading:r,saving:o,error:m,success:h,testResult:b,testing:f,editedHost:u,setEditedHost:k,editedPort:N,setEditedPort:y,editedAuthToken:C,setEditedAuthToken:P,editedManagementKey:w,setEditedManagementKey:S,editedLocalPort:c,setEditedLocalPort:d,fetchConfig:p,saveConfig:i,testConnection:A}=as(),{fetchRawConfig:l}=Oe(),[E,fe]=a.useState(()=>{try{return localStorage.getItem(pe)==="true"}catch{return!1}}),[ye,U]=a.useState(!1),[be,re]=a.useState(!0),[g,ae]=a.useState(!1),[je,_]=a.useState(!1),[oe,M]=a.useState(""),D=a.useRef(!1),O=is(oe)===Y,ve=s=>{fe(s);try{localStorage.setItem(pe,String(s))}catch{}},V=a.useCallback(async()=>{try{re(!0);const s=await fetch("/api/settings/auth/antigravity-risk");if(!s.ok)throw new Error("Failed to load AGY power user mode");const n=await s.json();U(n.antigravityAckBypass===!0)}catch(s){I.error(s instanceof Error?s.message:"Failed to load AGY power user mode"),U(!1)}finally{re(!1)}},[]),K=a.useCallback(async s=>{if(!(D.current||g||o))try{D.current=!0,ae(!0);const n=await fetch("/api/settings/auth/antigravity-risk",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({antigravityAckBypass:s})}),G=await n.json();if(!n.ok)throw new Error(G.error||"Failed to update AGY power user mode");const Ke=G.antigravityAckBypass===!0,de=await fetch("/api/settings/auth/antigravity-risk",{cache:"no-store"});if(!de.ok)throw new Error("Failed to verify AGY power user mode persistence");const me=(await de.json()).antigravityAckBypass===!0;if(me!==s)throw new Error("AGY power user mode was not persisted. Config may have been modified by another process.");U(me&&Ke),_(!1),M(""),I.success(s?"AGY power user mode enabled.":"AGY power user mode disabled."),await l()}catch(n){I.error(n instanceof Error?n.message:"Failed to update AGY power user mode")}finally{D.current=!1,ae(!1)}},[g,l,o]),ke=a.useCallback(s=>{if(!(D.current||g||o)){if(s){_(!0);return}_(!1),M(""),K(!1)}},[g,K,o]),Ne=a.useCallback(()=>{if(!O){I.error(`Type "${Y}" to continue.`);return}K(!0)},[O,K]),[j,z]=a.useState("plus"),[Ce,Pe]=a.useState(!1),q=Ve(),{data:we}=ze(),ne=we?.running??!1,W=a.useCallback(async()=>{try{const s=await R.cliproxyServer.getBackend();z(s.backend)}catch(s){console.error("[Proxy] Failed to fetch backend:",s)}},[]),J=a.useCallback(async()=>{try{const n=(await R.cliproxy.list()).variants.some(G=>ls.includes(G.provider));Pe(n)}catch(s){console.error("[Proxy] Failed to check variants:",s)}},[]),le=s=>{const n=j;z(s),q.mutate({backend:s},{onError:()=>{z(n)}})};if(a.useEffect(()=>{if(E&&t){const s={...t,remote:{...t.remote,auth_token:t.remote.auth_token?"[REDACTED]":void 0,management_key:t.remote.management_key?"[REDACTED]":void 0}};console.log("[CCS Debug] Debug mode enabled - proxy config:",s)}},[E,t]),a.useEffect(()=>{p(),V(),l(),W(),J()},[p,V,l,W,J]),r||!t)return 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(te,{className:"w-5 h-5 animate-spin"}),e.jsx("span",{children:"Loading..."})]})});const x=t.remote.enabled??!1,F=!x&&ne,v=t.remote,L=t.fallback,Se=t.remote.host??"",Ae=t.remote.port!==void 0?t.remote.port.toString():"",Ee=t.remote.auth_token??"",Ie=t.remote.management_key??"",Te=(t.local.port??H).toString(),X=u??Se,Q=N??Ae,Z=C??Ee,ie=w??Ie,ce=c??Te,Le=()=>{const s=u??X;s!==t.remote.host&&i({remote:{...v,host:s}}),k(null)},Be=()=>{const s=(N??Q).trim();if(s===""){t.remote.port!==void 0&&i({remote:{...v,port:void 0}}),y(null);return}const n=Number(s);if(!Number.isInteger(n)||n<1||n>65535){I.error("Port must be an integer between 1 and 65535, or empty for default"),y(null);return}n!==t.remote.port&&i({remote:{...v,port:n}}),y(null)},Re=()=>{const s=C??Z;s!==t.remote.auth_token&&i({remote:{...v,auth_token:s}}),P(null)},_e=()=>{const s=w??ie;s!==t.remote.management_key&&i({remote:{...v,management_key:s||void 0}}),S(null)},Me=()=>{const s=(c??ce).trim(),n=s===""?H:Number(s);if(!Number.isInteger(n)||n<1||n>65535){I.error("Local port must be an integer between 1 and 65535"),d(null);return}n!==t.local.port&&i({local:{...t.local,port:n}}),d(null)},De=()=>{A({host:X,port:Q,protocol:t.remote.protocol||"http",authToken:Z})};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:`absolute left-5 right-5 top-20 z-10 transition-all duration-200 ease-out ${m||h?"opacity-100 translate-y-0":"opacity-0 -translate-y-2 pointer-events-none"}`,children:[m&&e.jsxs(ee,{variant:"destructive",className:"py-2 shadow-lg",children:[e.jsx(Xe,{className:"h-4 w-4"}),e.jsx(se,{children:m})]}),h&&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(ge,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"text-sm font-medium",children:"Saved"})]})]}),e.jsx(qe,{className:"flex-1",children:e.jsxs("div",{className:"p-5 space-y-6",children:[e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Configure local or remote ",j==="plus"?"CLIProxy Plus":"CLIProxy"," connection for proxy-based profiles"]}),!x&&e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-base font-medium",children:"Instance Status"}),e.jsx(rs,{})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-base font-medium",children:"Connection Mode"}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("button",{onClick:()=>i({remote:{...v,enabled:!1}}),disabled:o,className:`p-4 rounded-lg border-2 text-left transition-all ${x?"border-border hover:border-muted-foreground/50":"border-primary bg-primary/5"}`,children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx(Qe,{className:`w-5 h-5 ${x?"text-muted-foreground":"text-primary"}`}),e.jsx("span",{className:"font-medium",children:"Local"})]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Run ",j==="plus"?"CLIProxy Plus":"CLIProxy"," binary on this machine"]})]}),e.jsxs("button",{onClick:()=>i({remote:{...v,enabled:!0}}),disabled:o,className:`p-4 rounded-lg border-2 text-left transition-all ${x?"border-primary bg-primary/5":"border-border hover:border-muted-foreground/50"}`,children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx(he,{className:`w-5 h-5 ${x?"text-primary":"text-muted-foreground"}`}),e.jsx("span",{className:"font-medium",children:"Remote"})]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Connect to a remote ",j==="plus"?"CLIProxy Plus":"CLIProxy"," server"]})]})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("h3",{className:"text-base font-medium flex items-center gap-2",children:[e.jsx(Ze,{className:"w-4 h-4"}),"Backend Binary"]}),!x&&ne&&e.jsxs(ee,{className:"py-2 border-amber-200 bg-amber-50 dark:border-amber-900/50 dark:bg-amber-900/20 [&>svg]:top-2.5",children:[e.jsx(ue,{className:"h-4 w-4 text-amber-600"}),e.jsx(se,{className:"text-amber-700 dark:text-amber-400",children:"Stop the running proxy in Instance Status to switch backend."})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("button",{onClick:()=>le("plus"),disabled:q.isPending||F,className:`p-4 rounded-lg border-2 text-left transition-all ${j==="plus"?"border-primary bg-primary/5":"border-border hover:border-muted-foreground/50"} ${F?"opacity-60 cursor-not-allowed":""}`,children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx("span",{className:"font-medium",children:"CLIProxyAPIPlus"}),e.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-green-100 text-green-700 dark:bg-green-900/50 dark:text-green-400",children:"Default"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Full provider support including Kiro and GitHub Copilot"})]}),e.jsxs("button",{onClick:()=>le("original"),disabled:q.isPending||F,className:`p-4 rounded-lg border-2 text-left transition-all ${j==="original"?"border-primary bg-primary/5":"border-border hover:border-muted-foreground/50"} ${F?"opacity-60 cursor-not-allowed":""}`,children:[e.jsx("div",{className:"flex items-center gap-3 mb-2",children:e.jsx("span",{className:"font-medium",children:"CLIProxyAPI"})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Original binary (Gemini, Codex, Antigravity only)"})]})]}),j==="original"&&Ce&&e.jsxs(ee,{variant:"destructive",className:"py-2",children:[e.jsx(ue,{className:"h-4 w-4"}),e.jsx(se,{children:"Existing Kiro/Copilot variants will not work with CLIProxyAPI. Switch to CLIProxyAPIPlus or remove those variants."})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("h3",{className:"text-base font-medium flex items-center gap-2",children:[e.jsx(es,{className:"w-4 h-4 text-amber-700 dark:text-amber-300"}),"Safety"]}),e.jsxs("div",{className:"space-y-3 rounded-lg border border-amber-400/35 bg-amber-50/70 p-4 dark:border-amber-800/60 dark:bg-amber-950/25",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"font-medium text-sm",children:"Antigravity Power User Mode"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Skip AGY responsibility checklist in Add Account and `ccs agy` flows."})]}),e.jsx(B,{"aria-labelledby":"agy-power-user-mode-label","aria-describedby":"agy-power-user-mode-description",checked:ye,disabled:be||g||o,onCheckedChange:ke})]}),e.jsx("p",{id:"agy-power-user-mode-description",className:"text-xs text-amber-800/90 dark:text-amber-200/90",children:"Use only if you fully understand the OAuth suspension/ban risk pattern (#509). CCS cannot assume responsibility for account loss."}),je&&e.jsxs("div",{className:"space-y-3 rounded-lg border border-rose-500/40 bg-rose-500/[0.08] p-3.5",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("p",{className:"text-xs font-semibold tracking-wide text-rose-900 dark:text-rose-200",children:"Final confirmation required"}),e.jsx("p",{className:"text-xs leading-relaxed text-rose-800/95 dark:text-rose-200/90",children:"Enabling this will skip AGY safety checkpoints in both dashboard and CLI. Review issue #509 and type the exact phrase to proceed."})]}),e.jsxs("div",{className:"grid gap-2 md:grid-cols-2",children:[e.jsxs("div",{className:"rounded-md border border-rose-400/30 bg-rose-500/10 p-2.5",children:[e.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wide text-rose-900 dark:text-rose-200",children:"Step 1"}),e.jsxs("a",{href:"https://github.com/kaitranntt/ccs/issues/509",target:"_blank",rel:"noreferrer",className:"mt-1 inline-flex items-center gap-1.5 text-xs font-medium text-rose-800 underline decoration-rose-500/60 underline-offset-2 transition-colors hover:text-rose-700 dark:text-rose-200",children:["Read issue #509",e.jsx(ss,{className:"h-3.5 w-3.5"})]})]}),e.jsxs("div",{className:"rounded-md border border-rose-400/30 bg-rose-500/10 p-2.5",children:[e.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wide text-rose-900 dark:text-rose-200",children:"Step 2"}),e.jsxs("p",{className:"mt-1 text-xs text-rose-800/95 dark:text-rose-200/90",children:["Type"," ",e.jsx("code",{className:"rounded bg-background/80 px-1 py-0.5 font-mono",children:Y})," ","to enable."]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{value:oe,onChange:s=>M(s.target.value),placeholder:Y,disabled:g||o,className:"font-mono text-xs","aria-label":"Type I ACCEPT RISK to enable Antigravity power user mode"}),e.jsx("p",{className:"text-[11px] text-rose-800/90 dark:text-rose-200/80",children:"Exact phrase required."})]}),e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[e.jsx($,{variant:"outline",size:"sm",onClick:()=>{_(!1),M("")},disabled:g||o,children:"Cancel"}),e.jsx($,{size:"sm",variant:"destructive",onClick:Ne,disabled:!O||g||o,children:"Enable Power User Mode"})]})]}),e.jsx("span",{id:"agy-power-user-mode-label",className:"sr-only",children:"Toggle AGY power user mode"})]})]}),x&&e.jsx(ns,{config:t,saving:o,testing:f,testResult:b,displayHost:X,displayPort:Q,displayAuthToken:Z,displayManagementKey:ie,setEditedHost:k,setEditedPort:y,setEditedAuthToken:P,setEditedManagementKey:S,onSaveHost:Le,onSavePort:Be,onSaveAuthToken:Re,onSaveManagementKey:_e,onSaveConfig:i,onTestConnection:De}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-base font-medium",children:"Fallback Settings"}),e.jsxs("div",{className:"space-y-3 p-4 rounded-lg border bg-muted/30",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-sm",children:"Enable fallback to local"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Use local proxy if remote is unreachable"})]}),e.jsx(B,{checked:L.enabled??!0,onCheckedChange:s=>i({fallback:{...L,enabled:s}}),disabled:o||!x})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-sm",children:"Auto-start local proxy"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Automatically start local proxy on fallback"})]}),e.jsx(B,{checked:L.auto_start??!1,onCheckedChange:s=>i({fallback:{...L,auto_start:s}}),disabled:o||!x||!L.enabled})]})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("h3",{className:"text-base font-medium flex items-center gap-2",children:[e.jsx(ts,{className:"w-4 h-4"}),"Advanced"]}),e.jsxs("div",{className:"space-y-3 p-4 rounded-lg border bg-muted/30",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-sm",children:"Debug Mode"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Enable developer diagnostics in browser console"})]}),e.jsx(B,{checked:E,onCheckedChange:ve,disabled:o})]}),E&&e.jsx("p",{className:"text-xs text-amber-600 dark:text-amber-400 pl-0.5",children:"Debug mode enabled. Check browser console for detailed logs."})]})]}),!x&&e.jsx(os,{config:t,saving:o,displayLocalPort:ce,setEditedLocalPort:d,onSaveLocalPort:Me,onSaveConfig:i})]})}),e.jsx("div",{className:"p-4 border-t bg-background",children:e.jsxs($,{variant:"outline",size:"sm",onClick:()=>{p(),V(),l(),W(),J()},disabled:r||o||g,className:"w-full",children:[e.jsx(te,{className:`w-4 h-4 mr-2 ${r?"animate-spin":""}`}),"Refresh"]})})]})}export{Ns as default};
@@ -0,0 +1 @@
1
+ import{j as e}from"./radix-ui-DIWAxjEp.js";import{r as i}from"./react-vendor-CNOkPC89.js";import{b9 as P,ba as $,I as F,bb as U,b2 as _,b4 as z,m as B,b as O}from"./index-BOyrh__4.js";import{S as K}from"./switch-JJlvFHut.js";import{z as Y,k as q,_ as D,Y as J,n as V,R as y,a2 as X,r as Z,aJ as Q}from"./icons-D7XDTBCN.js";import"./tanstack-Hn82hibe.js";import"./notifications-B2HqRBj7.js";import"./utils-CzKF5WmX.js";import"./form-utils-Cn_Uld6y.js";import"./code-highlight-BRUf_pqB.js";function ee(){const{state:s}=P(),a=$(),[d,l]=i.useState(""),[o,m]=i.useState(""),[f,h]=i.useState(!1),[j,u]=i.useState(!1),S=i.useCallback(async()=>{try{a.setWebSearchLoading(!0),a.setWebSearchError(null);const t=await fetch("/api/websearch");if(!t.ok)throw new Error("Failed to load WebSearch config");const r=await t.json();a.setWebSearchConfig(r)}catch(t){a.setWebSearchError(t.message)}finally{a.setWebSearchLoading(!1)}},[a]),v=i.useCallback(async()=>{try{a.setWebSearchStatusLoading(!0);const t=await fetch("/api/websearch/status");if(!t.ok)throw new Error("Failed to load status");const r=await t.json();a.setWebSearchStatus(r)}catch{}finally{a.setWebSearchStatusLoading(!1)}},[a]),g=i.useCallback(async t=>{const r=s.webSearchConfig;if(!r)return;const w={...r,...t};a.setWebSearchConfig(w);try{a.setWebSearchSaving(!0),a.setWebSearchError(null);const n=await fetch("/api/websearch",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(w)});if(!n.ok){const k=await n.json();throw new Error(k.error||"Failed to save")}const C=await n.json();a.setWebSearchConfig(C.websearch),a.setWebSearchSuccess(!0),setTimeout(()=>a.setWebSearchSuccess(!1),1500)}catch(n){a.setWebSearchConfig(r),a.setWebSearchError(n.message)}finally{a.setWebSearchSaving(!1)}},[s.webSearchConfig,a]);i.useEffect(()=>{s.webSearchConfig&&(l(s.webSearchConfig.providers?.gemini?.model??"gemini-2.5-flash"),m(s.webSearchConfig.providers?.opencode?.model??"opencode/grok-code"))},[s.webSearchConfig]);const x=i.useCallback(async()=>{const t=s.webSearchConfig?.providers?.gemini?.model??"gemini-2.5-flash";if(d!==t){const r=s.webSearchConfig?.providers||{};await g({providers:{...r,gemini:{...r.gemini,model:d}}}),h(!0),setTimeout(()=>h(!1),2e3)}},[d,s.webSearchConfig,g]),p=i.useCallback(async()=>{const t=s.webSearchConfig?.providers?.opencode?.model??"opencode/grok-code";if(o!==t){const r=s.webSearchConfig?.providers||{};await g({providers:{...r,opencode:{...r.opencode,model:o}}}),u(!0),setTimeout(()=>u(!1),2e3)}},[o,s.webSearchConfig,g]);return{config:s.webSearchConfig,status:s.webSearchStatus,loading:s.webSearchLoading,statusLoading:s.webSearchStatusLoading,saving:s.webSearchSaving,error:s.webSearchError,success:s.webSearchSuccess,geminiModelInput:d,setGeminiModelInput:l,opencodeModelInput:o,setOpencodeModelInput:m,geminiModelSaved:f,opencodeModelSaved:j,fetchConfig:S,fetchStatus:v,saveConfig:g,saveGeminiModel:x,saveOpencodeModel:p}}function A({name:s,label:a,badge:d,badgeColor:l,enabled:o,installed:m,statusLoading:f,saving:h,onToggle:j,modelInput:u,setModelInput:S,onModelBlur:v,modelSaved:g,modelPlaceholder:x,showHint:p,setShowHint:t,installCmd:r,docsUrl:w,hintColor:n}){const C=l==="green"?"bg-green-500/10 text-green-600":l==="blue"?"bg-blue-500/10 text-blue-600":"bg-purple-500/10 text-purple-600",k=n==="amber"?"bg-amber-50 dark:bg-amber-900/20 text-amber-700 dark:text-amber-300":n==="blue"?"bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300":"bg-purple-50 dark:bg-purple-900/20 text-purple-700 dark:text-purple-300",E=n==="amber"?"bg-amber-100 dark:bg-amber-900/40":n==="blue"?"bg-blue-100 dark:bg-blue-900/40":"bg-purple-100 dark:bg-purple-900/40",I=n==="amber"?"text-amber-600 dark:text-amber-400":n==="blue"?"text-blue-600 dark:text-blue-400":"text-purple-600 dark:text-purple-400",M=s==="opencode"?"OpenCode":s.charAt(0).toUpperCase()+s.slice(1);return e.jsxs("div",{className:`rounded-lg border transition-colors ${o?"border-primary border-l-4":"border-border"}`,children:[e.jsxs("div",{className:"flex items-center justify-between p-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Y,{className:`w-5 h-5 ${o?"text-primary":"text-muted-foreground"}`}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("p",{className:"font-mono font-medium",children:s}),e.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded font-medium ${C}`,children:d}),m?e.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-green-500/10 text-green-600 font-medium",children:"installed"}):e.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-amber-500/10 text-amber-600 font-medium",children:"not installed"})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:a})]})]}),e.jsx(K,{checked:o,onCheckedChange:j,disabled:h||!m})]}),o&&u!==void 0&&S&&v&&e.jsx("div",{className:"px-4 pb-4 pt-0",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("label",{className:"text-sm text-muted-foreground whitespace-nowrap",children:"Model:"}),e.jsx(F,{value:u,onChange:W=>S(W.target.value),onBlur:v,placeholder:x,className:"h-8 text-sm font-mono",disabled:h}),g&&e.jsxs("span",{className:"flex items-center gap-1 text-green-600 dark:text-green-400 text-xs animate-in fade-in duration-200",children:[e.jsx(q,{className:"w-3.5 h-3.5"}),"Saved"]})]})}),!m&&!f&&e.jsxs("div",{className:"px-4 pb-4 pt-0 border-t border-border/50",children:[e.jsxs("button",{onClick:()=>t(!p),className:`flex items-center gap-2 text-sm hover:underline w-full py-2 ${I}`,children:[p?e.jsx(D,{className:"w-4 h-4"}):e.jsx(J,{className:"w-4 h-4"}),"How to install ",M," CLI"]}),p&&e.jsxs("div",{className:`mt-2 p-3 rounded-md text-sm ${k}`,children:[e.jsxs("p",{className:"mb-2",children:["Install globally"," ",d==="GROK_API_KEY"?"(requires xAI API key)":"(FREE tier available)",":"]}),e.jsx("code",{className:`text-sm px-2 py-1 rounded font-mono block mb-2 ${E}`,children:r}),e.jsxs("a",{href:w,target:"_blank",rel:"noopener noreferrer",className:"hover:underline inline-flex items-center gap-1",children:[e.jsx(V,{className:"w-3 h-3"}),"View documentation"]})]})]})]})}function me(){const{config:s,status:a,loading:d,statusLoading:l,saving:o,error:m,success:f,geminiModelInput:h,setGeminiModelInput:j,opencodeModelInput:u,setOpencodeModelInput:S,geminiModelSaved:v,opencodeModelSaved:g,fetchConfig:x,fetchStatus:p,saveConfig:t,saveGeminiModel:r,saveOpencodeModel:w}=ee(),{fetchRawConfig:n}=U(),[C,k]=i.useState(!1),[E,I]=i.useState(!1),[M,W]=i.useState(!1);i.useEffect(()=>{x(),p(),n()},[x,p,n]);const N=s?.providers?.gemini?.enabled??!1,G=s?.providers?.grok?.enabled??!1,L=s?.providers?.opencode?.enabled??!1,H=()=>{const c=s?.providers||{},b=c.gemini?.enabled??!1;t({enabled:!b||G||L,providers:{...c,gemini:{...c.gemini,enabled:!b}}})},R=()=>{const c=s?.providers||{},b=c.grok?.enabled??!1;t({enabled:N||!b||L,providers:{...c,grok:{...c.grok,enabled:!b}}})},T=()=>{const c=s?.providers||{},b=c.opencode?.enabled??!1;t({enabled:N||G||!b,providers:{...c,opencode:{...c.opencode,enabled:!b}}})};return d?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 ${m||f?"opacity-100 translate-y-0":"opacity-0 -translate-y-2 pointer-events-none"}`,children:[m&&e.jsxs(_,{variant:"destructive",className:"py-2 shadow-lg",children:[e.jsx(X,{className:"h-4 w-4"}),e.jsx(z,{children:m})]}),f&&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(Z,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"text-sm font-medium",children:"Saved"})]})]}),e.jsx(B,{className:"flex-1",children:e.jsxs("div",{className:"p-5 space-y-6",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"CLI-based web search for third-party profiles (gemini, codex, agy, etc.)"}),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:N?"WebSearch enabled":"WebSearch disabled"}),l?e.jsx("p",{className:"text-sm text-muted-foreground",children:"Checking status..."}):a?.readiness?e.jsx("p",{className:"text-sm text-muted-foreground",children:a.readiness.message}):null]}),e.jsx(O,{variant:"ghost",size:"sm",onClick:p,disabled:l,children:e.jsx(y,{className:`w-4 h-4 ${l?"animate-spin":""}`})})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-base font-medium",children:"Providers"}),!a?.geminiCli&&!a?.opencodeCli&&!a?.grokCli&&!l&&e.jsxs("div",{className:"flex flex-col items-center justify-center p-8 border-2 border-dashed rounded-lg text-center bg-muted/30",children:[e.jsx(Q,{className:"w-12 h-12 text-muted-foreground mb-3 opacity-30"}),e.jsx("p",{className:"font-medium text-foreground mb-1",children:"No providers configured"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Install CLI tools to enable web search providers"}),e.jsxs(O,{variant:"outline",size:"sm",onClick:p,children:[e.jsx(y,{className:"w-4 h-4 mr-2"}),"Check for providers"]})]}),e.jsx(A,{name:"gemini",label:"Google Gemini CLI (1000 req/day free)",badge:"FREE",badgeColor:"green",enabled:N,installed:a?.geminiCli?.installed??!1,statusLoading:l,saving:o,onToggle:H,modelInput:h,setModelInput:j,onModelBlur:r,modelSaved:v,modelPlaceholder:"gemini-2.5-flash",showHint:C,setShowHint:k,installCmd:"npm install -g @google/gemini-cli",docsUrl:"https://github.com/google-gemini/gemini-cli",hintColor:"amber"}),e.jsx(A,{name:"opencode",label:"OpenCode (web search via Zen)",badge:"FREE",badgeColor:"green",enabled:L,installed:a?.opencodeCli?.installed??!1,statusLoading:l,saving:o,onToggle:T,modelInput:u,setModelInput:S,onModelBlur:w,modelSaved:g,modelPlaceholder:"opencode/grok-code",showHint:E,setShowHint:I,installCmd:"curl -fsSL https://opencode.ai/install | bash",docsUrl:"https://github.com/sst/opencode",hintColor:"purple"}),e.jsx(A,{name:"grok",label:"xAI Grok CLI (web + X search)",badge:"GROK_API_KEY",badgeColor:"blue",enabled:G,installed:a?.grokCli?.installed??!1,statusLoading:l,saving:o,onToggle:R,showHint:M,setShowHint:W,installCmd:"npm install -g @vibe-kit/grok-cli",docsUrl:"https://github.com/superagent-ai/grok-cli",hintColor:"blue"})]})]})}),e.jsx("div",{className:"p-4 border-t bg-background",children:e.jsxs(O,{variant:"outline",size:"sm",onClick:()=>{x(),n()},disabled:d||o,className:"w-full",children:[e.jsx(y,{className:`w-4 h-4 mr-2 ${d?"animate-spin":""}`}),"Refresh"]})})]})}export{me as default};