@kaitranntt/ccs 7.77.1-dev.11 → 7.77.1-dev.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth/auth-commands.d.ts +2 -1
- package/dist/auth/auth-commands.d.ts.map +1 -1
- package/dist/auth/auth-commands.js +18 -4
- package/dist/auth/auth-commands.js.map +1 -1
- package/dist/auth/commands/backup-command.d.ts.map +1 -1
- package/dist/auth/commands/backup-command.js +7 -2
- package/dist/auth/commands/backup-command.js.map +1 -1
- package/dist/auth/commands/create-command.d.ts.map +1 -1
- package/dist/auth/commands/create-command.js +14 -16
- package/dist/auth/commands/create-command.js.map +1 -1
- package/dist/auth/commands/default-command.d.ts +1 -1
- package/dist/auth/commands/default-command.d.ts.map +1 -1
- package/dist/auth/commands/default-command.js +10 -2
- package/dist/auth/commands/default-command.js.map +1 -1
- package/dist/auth/commands/index.d.ts +1 -0
- package/dist/auth/commands/index.d.ts.map +1 -1
- package/dist/auth/commands/index.js +3 -1
- package/dist/auth/commands/index.js.map +1 -1
- package/dist/auth/commands/list-command.d.ts.map +1 -1
- package/dist/auth/commands/list-command.js +16 -3
- package/dist/auth/commands/list-command.js.map +1 -1
- package/dist/auth/commands/remove-command.d.ts.map +1 -1
- package/dist/auth/commands/remove-command.js +5 -1
- package/dist/auth/commands/remove-command.js.map +1 -1
- package/dist/auth/commands/resources-command.d.ts +3 -0
- package/dist/auth/commands/resources-command.d.ts.map +1 -0
- package/dist/auth/commands/resources-command.js +115 -0
- package/dist/auth/commands/resources-command.js.map +1 -0
- package/dist/auth/commands/show-command.d.ts.map +1 -1
- package/dist/auth/commands/show-command.js +13 -4
- package/dist/auth/commands/show-command.js.map +1 -1
- package/dist/auth/commands/types.d.ts +11 -1
- package/dist/auth/commands/types.d.ts.map +1 -1
- package/dist/auth/commands/types.js +41 -2
- package/dist/auth/commands/types.js.map +1 -1
- package/dist/auth/profile-continuity-inheritance.d.ts.map +1 -1
- package/dist/auth/profile-continuity-inheritance.js +2 -1
- package/dist/auth/profile-continuity-inheritance.js.map +1 -1
- package/dist/auth/profile-detector.d.ts.map +1 -1
- package/dist/auth/profile-detector.js +1 -0
- package/dist/auth/profile-detector.js.map +1 -1
- package/dist/auth/profile-registry.d.ts +2 -0
- package/dist/auth/profile-registry.d.ts.map +1 -1
- package/dist/auth/profile-registry.js +6 -2
- package/dist/auth/profile-registry.js.map +1 -1
- package/dist/auth/shared-resource-policy.d.ts +20 -0
- package/dist/auth/shared-resource-policy.d.ts.map +1 -0
- package/dist/auth/shared-resource-policy.js +69 -0
- package/dist/auth/shared-resource-policy.js.map +1 -0
- package/dist/cliproxy/auth/oauth-handler.d.ts +34 -0
- package/dist/cliproxy/auth/oauth-handler.d.ts.map +1 -1
- package/dist/cliproxy/auth/oauth-handler.js +85 -13
- package/dist/cliproxy/auth/oauth-handler.js.map +1 -1
- package/dist/commands/command-catalog.d.ts +1 -1
- package/dist/commands/command-catalog.d.ts.map +1 -1
- package/dist/commands/command-catalog.js +1 -0
- package/dist/commands/command-catalog.js.map +1 -1
- package/dist/commands/completion-backend.d.ts.map +1 -1
- package/dist/commands/completion-backend.js +7 -0
- package/dist/commands/completion-backend.js.map +1 -1
- package/dist/commands/help-command.d.ts.map +1 -1
- package/dist/commands/help-command.js +1 -0
- package/dist/commands/help-command.js.map +1 -1
- package/dist/commands/sync-command.d.ts.map +1 -1
- package/dist/commands/sync-command.js +3 -2
- package/dist/commands/sync-command.js.map +1 -1
- package/dist/config/migration-manager.d.ts.map +1 -1
- package/dist/config/migration-manager.js +12 -0
- package/dist/config/migration-manager.js.map +1 -1
- package/dist/config/schemas/auth.d.ts +2 -0
- package/dist/config/schemas/auth.d.ts.map +1 -1
- package/dist/config/schemas/auth.js.map +1 -1
- package/dist/dispatcher/flows/account-flow.d.ts.map +1 -1
- package/dist/dispatcher/flows/account-flow.js +4 -3
- package/dist/dispatcher/flows/account-flow.js.map +1 -1
- package/dist/shared/claude-extension-setup.d.ts.map +1 -1
- package/dist/shared/claude-extension-setup.js +5 -1
- package/dist/shared/claude-extension-setup.js.map +1 -1
- package/dist/types/config.d.ts +2 -0
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/config.js.map +1 -1
- package/dist/ui/assets/accounts-CW9bbE4S.js +1 -0
- package/dist/ui/assets/{alert-dialog-CDKh6Iej.js → alert-dialog-ClPYGzV3.js} +1 -1
- package/dist/ui/assets/{api-BHoqwj9I.js → api-BjpAFHdA.js} +1 -1
- package/dist/ui/assets/{auth-section--qaXBZqv.js → auth-section-wl4-fzwD.js} +1 -1
- package/dist/ui/assets/{backups-section-B0UrPJSd.js → backups-section-CRfyOhtX.js} +1 -1
- package/dist/ui/assets/{channels-LNSoyw91.js → channels-DH0HkSGX.js} +1 -1
- package/dist/ui/assets/{checkbox-qW_Bg5Pj.js → checkbox-CTpEjpTH.js} +1 -1
- package/dist/ui/assets/{claude-extension-CMbaulCy.js → claude-extension-BQOBO5Au.js} +1 -1
- package/dist/ui/assets/{cliproxy-ai-providers-DM_Qss9R.js → cliproxy-ai-providers-DoUPKyI5.js} +1 -1
- package/dist/ui/assets/{cliproxy-control-panel-L8agopTe.js → cliproxy-control-panel-CvjXdHw9.js} +1 -1
- package/dist/ui/assets/{cliproxy-275p7_R-.js → cliproxy-qUbiZjec.js} +2 -2
- package/dist/ui/assets/{codex-Bq4vc-Bt.js → codex-BeeazJpw.js} +1 -1
- package/dist/ui/assets/{confirm-dialog-DT--b5KS.js → confirm-dialog-CYj_LLWN.js} +1 -1
- package/dist/ui/assets/{copilot-C-h6PKsb.js → copilot-ZCJeM_Zk.js} +1 -1
- package/dist/ui/assets/{cursor-BNYNTdOU.js → cursor-CtBjQ1_j.js} +1 -1
- package/dist/ui/assets/{droid-BDcKP8ys.js → droid-BLmzMBtN.js} +1 -1
- package/dist/ui/assets/{globalenv-section-B-MZK7oT.js → globalenv-section-0ENDeVbM.js} +1 -1
- package/dist/ui/assets/{health-Z4tbeEMB.js → health-BEnDHk-j.js} +1 -1
- package/dist/ui/assets/{icons-DIVjDO-z.js → icons-DzKUh8vG.js} +1 -1
- package/dist/ui/assets/{index-BYH8td_-.js → index-B3xma6R0.js} +1 -1
- package/dist/ui/assets/{index-BnUnpDeI.js → index-Bs28kNJN.js} +27 -27
- package/dist/ui/assets/{index-CNr-xTDQ.js → index-C04Kst21.js} +1 -1
- package/dist/ui/assets/{index-XlZulaah.js → index-Cip18A41.js} +1 -1
- package/dist/ui/assets/{index-lrKih76J.js → index-ClMz157R.js} +1 -1
- package/dist/ui/assets/index-D2_yb3d2.css +1 -0
- package/dist/ui/assets/{index-Bx05FUIb.js → index-DrCrZ7r1.js} +1 -1
- package/dist/ui/assets/{index-DeESkz1L.js → index-O9Qq-UJq.js} +1 -1
- package/dist/ui/assets/{logs-CPq1nOO3.js → logs-DQxVdsHm.js} +1 -1
- package/dist/ui/assets/{masked-input-DKEaMpuM.js → masked-input-eN6tFUjN.js} +1 -1
- package/dist/ui/assets/{proxy-status-widget-DHvXGB-0.js → proxy-status-widget-50UIM6S8.js} +1 -1
- package/dist/ui/assets/{raw-json-settings-editor-panel-DYFizqns.js → raw-json-settings-editor-panel-DqKmVWL-.js} +1 -1
- package/dist/ui/assets/{searchable-select-0sMBiw79.js → searchable-select-JO0gngYE.js} +1 -1
- package/dist/ui/assets/{separator-Iwj015MP.js → separator-AoncAA6l.js} +1 -1
- package/dist/ui/assets/shared-BTv96-3y.js +8 -0
- package/dist/ui/assets/{table-BtToEVHU.js → table-BM_YK49c.js} +1 -1
- package/dist/ui/assets/{updates-TpeG63IU.js → updates-eo4H4NOg.js} +1 -1
- package/dist/ui/assets/use-accounts-ELLatpzU.js +1 -0
- package/dist/ui/index.html +3 -3
- package/dist/web-server/routes/account-route-helpers.d.ts +3 -0
- package/dist/web-server/routes/account-route-helpers.d.ts.map +1 -1
- package/dist/web-server/routes/account-route-helpers.js.map +1 -1
- package/dist/web-server/routes/account-routes.d.ts.map +1 -1
- package/dist/web-server/routes/account-routes.js +97 -4
- package/dist/web-server/routes/account-routes.js.map +1 -1
- package/dist/web-server/routes/cliproxy-auth-routes.d.ts.map +1 -1
- package/dist/web-server/routes/cliproxy-auth-routes.js +29 -0
- package/dist/web-server/routes/cliproxy-auth-routes.js.map +1 -1
- package/dist/web-server/shared-routes.d.ts +1 -1
- package/dist/web-server/shared-routes.js +304 -10
- package/dist/web-server/shared-routes.js.map +1 -1
- package/package.json +1 -1
- package/dist/ui/assets/accounts-CZAk1r5e.js +0 -1
- package/dist/ui/assets/index-CczVFk1P.css +0 -1
- package/dist/ui/assets/shared-DsbHybKL.js +0 -8
package/dist/ui/assets/{cliproxy-ai-providers-DM_Qss9R.js → cliproxy-ai-providers-DoUPKyI5.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e}from"./radix-ui-nu4wz29m.js";import{r as o,u as Fe,e as Ge}from"./react-vendor-Bjx91N7w.js";import{c as B,aG as pe,b8 as xe,B as p,a as Ue,b9 as Ie,ah as Ve,ai as ze,aj as Je,ak as _e,al as Qe,L,I as A,M as We,N as Xe,O as Ye,aD as Ze,d as y,ba as he,bb as Le,Y as ne,S as be,n as se,Q as je,R as Ne,U as X,V as Y,bc as we,bd as es,be as ss}from"./index-
|
|
1
|
+
import{j as e}from"./radix-ui-nu4wz29m.js";import{r as o,u as Fe,e as Ge}from"./react-vendor-Bjx91N7w.js";import{c as B,aG as pe,b8 as xe,B as p,a as Ue,b9 as Ie,ah as Ve,ai as ze,aj as Je,ak as _e,al as Qe,L,I as A,M as We,N as Xe,O as Ye,aD as Ze,d as y,ba as he,bb as Le,Y as ne,S as be,n as se,Q as je,R as Ne,U as X,V as Y,bc as we,bd as es,be as ss}from"./index-Bs28kNJN.js";import{P as ts}from"./proxy-status-widget-50UIM6S8.js";import{C as rs}from"./confirm-dialog-CYj_LLWN.js";import{l as as,w as Re,m as Te,n as ge,aC as te,s as ns,R as de,Z as is,a9 as Ee,p as qe,O as ls,Q as os,at as ds,au as cs,_ as Ce,aM as Oe,aN as Ke,ai as He,ax as ms,aO as us}from"./icons-DzKUh8vG.js";import{u as ps,a as fe,b as ve}from"./tanstack-bhJxV1h8.js";import{t as G}from"./notifications-B4_o8bcr.js";import"./utils-CzKF5WmX.js";import"./form-utils-CuHzLhJZ.js";import"./code-highlight-D4E79GKQ.js";import"./alert-dialog-ClPYGzV3.js";function xs(s){switch(s){case"ready":return{icon:Te,text:"Ready",className:"text-green-600"};case"partial":return{icon:Re,text:"Needs attention",className:"text-amber-600"};default:return{icon:as,text:"Not configured",className:"text-muted-foreground"}}}function hs({families:s,selectedFamily:t,onSelect:r}){return e.jsx("div",{className:"space-y-1",children:s.map(n=>{const i=n.id===t,d=xs(n.status),h=d.icon;return e.jsx("button",{type:"button",onClick:()=>r(n.id),className:B("w-full cursor-pointer rounded-lg border px-3 py-2.5 text-left transition-colors",i?"border-primary/20 bg-primary/10":"border-transparent hover:bg-muted/70"),children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(pe,{provider:xe(n.id),size:"md"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"truncate text-sm font-medium",children:n.displayName}),n.entries.length>0&&e.jsx(p,{variant:"secondary",className:"h-4 px-1 text-[10px]",children:n.entries.length})]}),e.jsxs("div",{className:B("mt-0.5 flex items-center gap-1.5 text-xs",d.className),children:[e.jsx(h,{className:"h-3 w-3"}),e.jsx("span",{children:d.text})]})]}),e.jsx(p,{variant:"outline",className:"h-5 px-1.5 text-[9px] uppercase tracking-wide",children:n.authMode})]})},n.id)})})}function gs(s){switch(s){case"gemini-api-key":return{familyName:"Gemini",description:"Store the Gemini key here so CLIProxy can route Gemini requests without creating a separate CCS API Profile.",requiredNow:["Paste the Gemini API key.","Leave Base URL empty unless you use a custom Gemini host."],optionalLater:["Model mappings only when requested names and Gemini names differ.","Headers only when your provider setup requires them."],keyLabel:"Gemini API Key",keyPlaceholder:"AIza...",keyHelper:"This is the only field most Gemini setups need.",baseUrlPlaceholder:"https://generativelanguage.googleapis.com",baseUrlHelper:"Optional. Leave blank to keep the default Gemini endpoint.",aliasesPlaceholder:"claude-sonnet-4-5=gemini-2.5-pro",aliasesHelper:"Format: requested=upstream. Leave this blank unless the upstream Gemini model name differs.",headersPlaceholder:"X-Goog-User-Project: your-project"};case"codex-api-key":return{familyName:"Codex",description:"Store the Codex or OpenAI key here so CLIProxy can route Codex requests without duplicating the setup in API Profiles.",requiredNow:["Paste the Codex or OpenAI API key.","Leave Base URL empty unless this route should target another OpenAI-style endpoint."],optionalLater:["Model mappings only when the upstream model ID differs.","Headers only when org or project routing needs them."],keyLabel:"Codex API Key",keyPlaceholder:"sk-...",keyHelper:"This is the only field most Codex setups need.",baseUrlPlaceholder:"https://api.openai.com/v1",baseUrlHelper:"Optional. Leave blank to keep the default Codex endpoint.",aliasesPlaceholder:"claude-sonnet-4-5=gpt-5",aliasesHelper:"Format: requested=upstream. Add a mapping only when the upstream model name differs.",headersPlaceholder:"OpenAI-Organization: org_..."};case"claude-api-key":return{familyName:"Claude",description:"Store the Anthropic or compatible key here for CLIProxy-managed Claude routing. Save the key first, then add rewrites only if this route needs them.",requiredNow:["Paste the Claude or Anthropic-compatible API key.","Leave Base URL empty unless this route should target another compatible endpoint."],optionalLater:["Model mappings only when the requested and upstream Claude model IDs differ.","Proxy, prefix, exclusions, and headers only for advanced routing cases."],keyLabel:"Claude API Key",keyPlaceholder:"sk-ant-...",keyHelper:"Most Claude routes can start with the key only.",baseUrlPlaceholder:"https://api.anthropic.com",baseUrlHelper:"Optional. Leave blank to keep the default Claude-compatible endpoint.",aliasesPlaceholder:"claude-sonnet-4-5=claude-3-7-sonnet-latest",aliasesHelper:"Format: requested=upstream. Add a mapping only when the upstream model ID should differ.",headersPlaceholder:"X-Project: internal-routing"};case"vertex-api-key":return{familyName:"Vertex",description:"Store the Vertex key here so CLIProxy can route Vertex traffic without creating a separate CCS API Profile.",requiredNow:["Paste the Vertex API key.","Leave Base URL empty unless a regional or gateway endpoint is required."],optionalLater:["Model mappings only when the upstream name differs.","Headers only when the provider expects extra routing context."],keyLabel:"Vertex API Key",keyPlaceholder:"AIza...",keyHelper:"Most Vertex routes only need the key.",baseUrlPlaceholder:"https://vertex.googleapis.com",baseUrlHelper:"Optional. Leave blank to keep the default Vertex endpoint.",aliasesPlaceholder:"claude-sonnet-4-5=gemini-2.5-pro",aliasesHelper:"Format: requested=upstream. Leave blank unless the upstream model name differs.",headersPlaceholder:"X-Goog-User-Project: your-project"};case"openai-compatibility":return{familyName:"OpenAI-Compatible Connector",description:"Create a named connector for OpenRouter, Together, or any OpenAI-style endpoint. This page owns the connector setup directly inside CLIProxy.",requiredNow:["Pick a connector name such as openrouter or together.","Set the connector Base URL.","Add at least one API key before saving."],optionalLater:["Model mappings only when requested and upstream model names differ.","Headers only when the connector requires provider-specific auth or routing."],keyLabel:"API Keys",keyPlaceholder:"sk-...",keyHelper:"Add one key per line. Most connectors start with a single key.",connectorPlaceholder:"openrouter",connectorHelper:"This becomes the connector label in the saved entries list.",baseUrlPlaceholder:"https://openrouter.ai/api/v1",baseUrlHelper:"Required for connectors. This is the upstream OpenAI-style endpoint.",aliasesPlaceholder:"claude-sonnet-4-5=gpt-4.1",aliasesHelper:"Format: requested=upstream. Leave blank unless the connector expects a different model ID.",headersPlaceholder:"HTTP-Referer: https://your-app.example"}}}function ke(s){return s.split(`
|
|
2
2
|
`).map(t=>t.trim()).filter(t=>t.length>0)}function fs(s){return s.split(`
|
|
3
3
|
`).map(t=>t.trim()).filter(t=>t.length>0).map(t=>{const r=t.includes(":")?":":"=",[n,...i]=t.split(r);return{key:n.trim(),value:i.join(r).trim()}}).filter(t=>t.key.length>0)}function vs(s){return Le(s)}function Z({value:s,onChange:t,placeholder:r,rows:n=4}){return e.jsx("textarea",{rows:n,value:s,onChange:i=>t(i.target.value),placeholder:r,className:"flex min-h-24 w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-xs outline-none transition-[color,box-shadow] placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50"})}function ys(s){return(s?.headers||[]).map(t=>`${t.key}: ${t.value}`).join(`
|
|
4
4
|
`)}function bs(s){return(s?.excludedModels||[]).join(`
|
package/dist/ui/assets/{cliproxy-control-panel-L8agopTe.js → cliproxy-control-panel-CvjXdHw9.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./radix-ui-nu4wz29m.js";import{r as s}from"./react-vendor-Bjx91N7w.js";import{u as S}from"./tanstack-bhJxV1h8.js";import{a as D,bf as g,Y as I}from"./index-
|
|
1
|
+
import{j as e}from"./radix-ui-nu4wz29m.js";import{r as s}from"./react-vendor-Bjx91N7w.js";import{u as S}from"./tanstack-bhJxV1h8.js";import{a as D,bf as g,Y as I}from"./index-Bs28kNJN.js";import{C as _}from"./default-ports-1QQSffYX.js";import{G as Q,R as $,w as X}from"./icons-DzKUh8vG.js";import"./notifications-B4_o8bcr.js";import"./utils-CzKF5WmX.js";import"./form-utils-CuHzLhJZ.js";import"./code-highlight-D4E79GKQ.js";const k="cli-proxy-auth",O="isLoggedIn",U="apiBase",K="apiUrl",F="managementKey";function A(a){return a.startsWith("/")?new URL(a.replace(/\/$/,""),window.location.origin).href:a.replace(/\/$/,"")}function J(a,u){window.localStorage.removeItem(k),window.localStorage.setItem(U,a),window.localStorage.setItem(K,a),window.localStorage.setItem(F,u),window.localStorage.setItem(O,"true")}function T(){window.localStorage.removeItem(k),window.localStorage.removeItem(U),window.localStorage.removeItem(K),window.localStorage.removeItem(F),window.localStorage.removeItem(O)}function V({port:a=_}){const{t:u}=D(),f=s.useRef(null),[M,N]=s.useState(null),[B,Y]=s.useState(0),[L,v]=s.useState(null),[G,E]=s.useState(!1),{data:l,error:w}=S({queryKey:["cliproxy-server-config"],queryFn:()=>I.cliproxyServer.get(),staleTime:3e4});s.useEffect(()=>{w&&console.warn("[ControlPanelEmbed] Config fetch failed, using local mode:",w)},[w]);const j=!!(l?.remote?.enabled&&l?.remote?.host),{data:y,error:x}=S({queryKey:["auth-tokens-raw",j?"remote":"local"],enabled:l!==void 0&&!j,queryFn:async()=>{try{const t=await fetch(g("/settings/auth/tokens/raw"));if(!t.ok)throw new Error("Failed to fetch auth tokens");const n=await t.json(),o=n.managementSecret.value.trim();if(!o)throw new Error("Management secret missing");return J(A(g("/cliproxy-local/")),o),n}catch(t){throw T(),t}},staleTime:3e4}),{managementUrl:R,checkUrl:h,authToken:b,isRemote:i,displayHost:c}=s.useMemo(()=>{const t=l?.remote,n=l?.local?.port??a;if(t?.enabled&&t?.host){const o=t.protocol||"http",m=t.port||(o==="https"?443:_),p=o==="https"&&m===443||o==="http"&&m===80?"":`:${m}`,r=`${o}://${t.host}${p}`;return{managementUrl:`${r}/management.html`,checkUrl:`${r}/`,authToken:t.auth_token||void 0,isRemote:!0,displayHost:`${t.host}${p}`}}return{managementUrl:g("/cliproxy-local/management.html"),checkUrl:g("/cliproxy-local/"),authToken:y?.managementSecret?.value||void 0,isRemote:!1,displayHost:`localhost:${n}`}},[l,y,a]),C=`${R}:${i?"remote":"local"}:${h}:${b??"missing"}:${B}`,P=l!==void 0&&(i||!!y||!!x);s.useEffect(()=>{x&&console.warn("[ControlPanelEmbed] Failed to preload local control panel session, falling back to manual login:",x)},[x]),s.useEffect(()=>{if(!i)return()=>{T()}},[i]);const H=!P||!(M===C),q=()=>{if(!(!i||!f.current?.contentWindow||!b))try{const t=A(h),n=new URL(`${t}/`).origin;if(new URL(f.current.src,window.location.origin).origin!==n){console.warn("[ControlPanelEmbed] Remote iframe origin mismatch, skipping postMessage");return}f.current.contentWindow.postMessage({type:"ccs-auto-login",apiBase:t,managementKey:b},n)}catch(t){console.debug("[ControlPanelEmbed] Remote postMessage bootstrap failed:",t)}};s.useEffect(()=>{const t=new AbortController;let n=!1;const o=(r,d)=>{n||(E(r),v(d))},m=async()=>{try{if(i){const r=l?.remote,d=await I.cliproxyServer.test({host:r?.host??"",port:r?.port,protocol:r?.protocol??"http",authToken:r?.auth_token});d?.reachable?o(!0,null):o(!1,d?.error?`Remote CLIProxy at ${c}: ${d.error}`:`Remote CLIProxy at ${c} returned an error`)}else(await fetch(h,{signal:t.signal})).ok?o(!0,null):o(!1,"CLIProxy returned an error")}catch(r){if(r instanceof Error&&r.name==="AbortError")return;o(!1,i?`Remote CLIProxy at ${c} is not reachable`:"CLIProxy is not running")}},p=setTimeout(()=>t.abort(),2e3);return m().finally(()=>clearTimeout(p)),()=>{n=!0,t.abort()}},[h,i,c,l]);const W=()=>{N(C),q()},z=()=>{N(null),Y(t=>t+1),v(null),E(!1)};return!G&&L?e.jsxs("div",{className:"flex-1 flex flex-col",children:[e.jsxs("div",{className:"flex items-center justify-between p-4 border-b",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Q,{className:"w-5 h-5 text-primary"}),e.jsx("h2",{className:"font-semibold",children:u("cliproxyHeader.cliproxyControlPanel")})]}),e.jsxs("button",{className:"inline-flex items-center gap-2 px-3 py-1.5 text-sm border rounded-md hover:bg-muted",onClick:z,children:[e.jsx($,{className:"w-4 h-4"}),"Retry"]})]}),e.jsx("div",{className:"flex-1 flex items-center justify-center bg-muted/20",children:e.jsxs("div",{className:"text-center max-w-md px-8",children:[e.jsx("div",{className:"w-16 h-16 rounded-full bg-destructive/10 flex items-center justify-center mx-auto mb-6",children:e.jsx(X,{className:"w-8 h-8 text-destructive"})}),e.jsx("h3",{className:"text-lg font-semibold mb-2",children:u("cliproxyHeader.cliproxyNotAvailable")}),e.jsx("p",{className:"text-muted-foreground mb-4",children:L}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Start a CLIProxy session with"," ",e.jsx("code",{className:"bg-muted px-1 rounded",children:"ccs gemini"})," or run"," ",e.jsx("code",{className:"bg-muted px-1 rounded",children:"ccs config"})," which auto-starts it."]})]})})]}):e.jsx("div",{className:"flex-1 flex flex-col",children:e.jsxs("div",{className:"flex-1 flex flex-col relative",children:[H&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-background/80 z-10",children:e.jsxs("div",{className:"text-center",children:[e.jsx($,{className:"w-8 h-8 animate-spin text-primary mx-auto mb-2"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:i?`Loading Control Panel from ${c}...`:"Loading Control Panel..."})]})}),P?e.jsx("iframe",{ref:f,src:R,className:"flex-1 w-full border-0",title:"CLIProxy Management Panel",onLoad:W},C):null]})})}function me(){return e.jsx("div",{className:"flex h-full min-h-0 flex-col overflow-hidden",children:e.jsx(V,{})})}export{me as CliproxyControlPanelPage};
|