@kaitranntt/ccs 7.74.0-dev.8 → 7.74.0-dev.9

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 (45) hide show
  1. package/dist/bin/ccsxp-runtime.d.ts +4 -0
  2. package/dist/bin/ccsxp-runtime.d.ts.map +1 -1
  3. package/dist/bin/ccsxp-runtime.js +49 -3
  4. package/dist/bin/ccsxp-runtime.js.map +1 -1
  5. package/dist/commands/command-catalog.d.ts.map +1 -1
  6. package/dist/commands/command-catalog.js +4 -1
  7. package/dist/commands/command-catalog.js.map +1 -1
  8. package/dist/ui/assets/{accounts-BHXLCVr2.js → accounts-DCJVsC1R.js} +1 -1
  9. package/dist/ui/assets/{alert-dialog-_HsPBPYt.js → alert-dialog-BZtIoyBc.js} +1 -1
  10. package/dist/ui/assets/{api-DJfWWXFl.js → api-DNXD8EA9.js} +1 -1
  11. package/dist/ui/assets/{auth-section-BAacZ7AC.js → auth-section-2-a8KRNY.js} +1 -1
  12. package/dist/ui/assets/{backups-section-BZRNv86z.js → backups-section-CezuWNFi.js} +1 -1
  13. package/dist/ui/assets/{channels-DP9aCTUd.js → channels-DaijLXYu.js} +1 -1
  14. package/dist/ui/assets/{checkbox-DcZz3WGM.js → checkbox-D6sWns2x.js} +1 -1
  15. package/dist/ui/assets/{claude-extension-CENyhVUo.js → claude-extension-BFbvT7N_.js} +1 -1
  16. package/dist/ui/assets/{cliproxy-Bxpop7Hy.js → cliproxy-4Z6gEF3R.js} +1 -1
  17. package/dist/ui/assets/{cliproxy-ai-providers-CRDA8-Ut.js → cliproxy-ai-providers-BZ0mTP-l.js} +1 -1
  18. package/dist/ui/assets/{cliproxy-control-panel-mve89_rF.js → cliproxy-control-panel-CFFjKRRQ.js} +1 -1
  19. package/dist/ui/assets/codex-D9ivkuYH.js +27 -0
  20. package/dist/ui/assets/{confirm-dialog-CA_kx7yS.js → confirm-dialog-CpZGygf5.js} +1 -1
  21. package/dist/ui/assets/{copilot-DS2c7d1T.js → copilot-DMmn_rxB.js} +1 -1
  22. package/dist/ui/assets/{cursor-Bbta1Z_q.js → cursor-D_Q86_Ei.js} +1 -1
  23. package/dist/ui/assets/{droid-bFC5rthA.js → droid-BAf_vL2l.js} +1 -1
  24. package/dist/ui/assets/{globalenv-section-CZNxpuZE.js → globalenv-section-B8jXcXvb.js} +1 -1
  25. package/dist/ui/assets/{health-DTrCPTsQ.js → health-BO8TUGV-.js} +1 -1
  26. package/dist/ui/assets/{index-CEuKLsUj.js → index-8bXW-BpK.js} +3 -3
  27. package/dist/ui/assets/{index-hh65jn6S.js → index-BsAeVEGk.js} +1 -1
  28. package/dist/ui/assets/{index-DjptczWk.js → index-CC4Wj5Im.js} +1 -1
  29. package/dist/ui/assets/{index-DkB98h6I.js → index-DcX4r1mv.js} +1 -1
  30. package/dist/ui/assets/{index-BzK9qB9a.js → index-DwhLYuc2.js} +1 -1
  31. package/dist/ui/assets/{index-CEtMdB2w.js → index-mHMlp8Vb.js} +1 -1
  32. package/dist/ui/assets/{index-B4dFnnun.js → index-vlkxIfEe.js} +1 -1
  33. package/dist/ui/assets/{logs-CskpzGaG.js → logs-Be6Ybx9a.js} +1 -1
  34. package/dist/ui/assets/{masked-input-Ck9tgCY7.js → masked-input-DXnXVYlE.js} +1 -1
  35. package/dist/ui/assets/{proxy-status-widget-CjDFDoLb.js → proxy-status-widget-BnvVPoy1.js} +1 -1
  36. package/dist/ui/assets/{raw-json-settings-editor-panel-DtHR8TT6.js → raw-json-settings-editor-panel-Bzz3efQU.js} +1 -1
  37. package/dist/ui/assets/{searchable-select-DmX9VGp5.js → searchable-select-DZale_hJ.js} +1 -1
  38. package/dist/ui/assets/{separator-CF37MlTs.js → separator-BkmmPPJc.js} +1 -1
  39. package/dist/ui/assets/{shared-CQDIfxlI.js → shared-ruYPWqHA.js} +1 -1
  40. package/dist/ui/assets/{table-Ce_lz0Ia.js → table-DdulTUSB.js} +1 -1
  41. package/dist/ui/assets/updates-COyrJbQd.js +1 -0
  42. package/dist/ui/index.html +1 -1
  43. package/package.json +1 -1
  44. package/dist/ui/assets/codex-DxHcxVjR.js +0 -27
  45. package/dist/ui/assets/updates-BRRjuRCH.js +0 -1
@@ -1,27 +0,0 @@
1
- import{j as e}from"./radix-ui-Zb8sVEtn.js";import{r as N}from"./react-vendor-CNOkPC89.js";import{t as U}from"./notifications-B2HqRBj7.js";import{C as I,j as F,k as W,B as _,b as K,a as E,d as C,aI as J,r as P,s as O,t as D,v as L,w as b,I as S,n as fe,W as y,bf as se,bg as Pe,c as Oe,bm as He,bn as ve,bo as Qe,Q as Je,R as Ze,U as ae,V as oe,bh as be}from"./index-CEuKLsUj.js";import{aa as es,aS as ss,at as re,L as z,n as rs,aT as ts,aU as ns,aC as as,w as os,a7 as ls,aV as is,aW as cs,aX as ds,ai as me,p as we,$ as xs,m as us,o as ms,_ as hs,S as ps,aN as Ne,aY as fs,x as gs,I as js,T as vs,N as bs}from"./icons-DyorC3Xk.js";import{S as ee}from"./separator-CF37MlTs.js";import{a as ws,u as ye,b as Ce}from"./tanstack-CrmUhA7Z.js";import"./code-highlight-BRUf_pqB.js";import{T as Ns,a as ys,b as Se,c as le,d as Cs,e as ie}from"./table-Ce_lz0Ia.js";import{R as Ss}from"./raw-json-settings-editor-panel-DtHR8TT6.js";import"./utils-CzKF5WmX.js";import"./form-utils-Bcoyqxpq.js";function Z({title:s,icon:r,badge:t,description:l,disabledReason:o,children:n}){return e.jsxs(I,{children:[e.jsxs(F,{className:"pb-2",children:[e.jsxs(W,{className:"flex items-center gap-2 text-base",children:[r,s,t?e.jsx(_,{variant:"outline",className:"text-[10px] font-normal",children:t}):null]}),l?e.jsx("p",{className:"text-xs text-muted-foreground",children:l}):null]}),e.jsxs(K,{className:"space-y-3",children:[o?e.jsx("p",{className:"text-xs text-amber-600",children:o}):null,n]})]})}function _s({catalog:s,state:r,disabled:t=!1,disabledReason:l,onToggle:o}){const{t:n}=E(),a=new Set(s.map(i=>i.name)),c=Object.entries(r).filter(([i])=>!a.has(i)).sort(([i],[d])=>i.localeCompare(d));return e.jsxs(Z,{title:n("codex.features"),badge:"features",icon:e.jsx(es,{className:"h-4 w-4"}),description:n("codex.featuresDesc"),disabledReason:l,children:[e.jsx("div",{className:"space-y-2",children:s.map(i=>{const d=r[i.name]??null;return e.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-md border px-3 py-2",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("p",{className:"text-sm font-medium",children:i.label}),e.jsx(_,{variant:"outline",className:"font-mono text-[10px]",children:i.name})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:i.description})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[d!==null?e.jsx(C,{variant:"outline",size:"sm",onClick:()=>o(i.name,null),disabled:t,children:n("codex.useDefault")}):null,e.jsx(J,{checked:d===!0,onCheckedChange:m=>o(i.name,m),disabled:t})]})]},i.name)})}),c.length>0?e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:n("codex.configOnlyFlags")}),e.jsx("p",{className:"text-xs text-muted-foreground",children:n("codex.configOnlyFlagsDesc")})]}),c.map(([i,d])=>e.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-md border border-dashed px-3 py-2",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("p",{className:"text-sm font-medium",children:i}),e.jsx(_,{variant:"secondary",className:"text-[10px]",children:n("codex.existing")})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:n(d===null?"codex.nonBooleanForm":"codex.discoveredFromFile")})]}),d===null?e.jsx(_,{variant:"outline",children:n("codex.rawOnly")}):e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(C,{variant:"outline",size:"sm",onClick:()=>o(i,null),disabled:t,children:n("codex.useDefault")}),e.jsx(J,{checked:d===!0,onCheckedChange:m=>o(i,m),disabled:t})]})]},i))]}):null]})}const ks={name:"",transport:"stdio",command:null,args:[],url:null,enabled:!0,required:!1,startupTimeoutSec:null,toolTimeoutSec:null,enabledTools:[],disabledTools:[],isCcsManaged:!1,managementSurface:null};function ce(s){return s.join(", ")}function de(s){return s.split(",").map(r=>r.trim()).filter(Boolean)}function Ts({initialDraft:s,isNew:r,disabled:t,saving:l,canDelete:o,onSave:n,onDelete:a}){const{t:c}=E(),[i,d]=N.useState(s),m=r&&i.name.trim()==="ccs_browser";return e.jsxs(e.Fragment,{children:[m?e.jsxs("div",{className:"rounded-md border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-sm text-amber-900 dark:text-amber-200",children:[e.jsx("strong",{children:"ccs_browser"})," is reserved for the CCS-managed browser tooling path. Configure it from ",e.jsx("code",{children:"Settings > Browser"})," instead of creating it here."]}):null,e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsx(S,{value:i.name,onChange:h=>d(x=>({...x,name:h.target.value})),placeholder:"playwright",disabled:t||!r}),e.jsxs(P,{value:i.transport,onValueChange:h=>d(x=>({...x,transport:h})),disabled:t,children:[e.jsx(O,{children:e.jsx(D,{})}),e.jsxs(L,{children:[e.jsx(b,{value:"stdio",children:c("codex.stdio")}),e.jsx(b,{value:"streamable-http",children:c("codex.streamableHttp")})]})]}),i.transport==="stdio"?e.jsxs(e.Fragment,{children:[e.jsx(S,{value:i.command??"",onChange:h=>d(x=>({...x,command:h.target.value||null})),placeholder:"npx",disabled:t}),e.jsx(S,{value:ce(i.args),onChange:h=>d(x=>({...x,args:de(h.target.value)})),placeholder:"@playwright/mcp@latest, --flag",disabled:t})]}):e.jsx(S,{className:"sm:col-span-2",value:i.url??"",onChange:h=>d(x=>({...x,url:h.target.value||null})),placeholder:"https://example.test/mcp",disabled:t}),e.jsx(S,{type:"number",min:1,value:i.startupTimeoutSec??"",onChange:h=>d(x=>({...x,startupTimeoutSec:h.target.value?Number(h.target.value):null})),placeholder:"Startup timeout (sec)",disabled:t}),e.jsx(S,{type:"number",min:1,value:i.toolTimeoutSec??"",onChange:h=>d(x=>({...x,toolTimeoutSec:h.target.value?Number(h.target.value):null})),placeholder:"Tool timeout (sec)",disabled:t}),e.jsx(S,{value:ce(i.enabledTools),onChange:h=>d(x=>({...x,enabledTools:de(h.target.value)})),placeholder:"enabled_tools",disabled:t}),e.jsx(S,{value:ce(i.disabledTools),onChange:h=>d(x=>({...x,disabledTools:de(h.target.value)})),placeholder:"disabled_tools",disabled:t})]}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsxs("label",{className:"flex items-center justify-between rounded-md border px-3 py-2 text-sm",children:["Enabled",e.jsx(J,{checked:i.enabled,onCheckedChange:h=>d(x=>({...x,enabled:h})),disabled:t})]}),e.jsxs("label",{className:"flex items-center justify-between rounded-md border px-3 py-2 text-sm",children:["Required",e.jsx(J,{checked:i.required,onCheckedChange:h=>d(x=>({...x,required:h})),disabled:t})]})]}),e.jsxs("div",{className:"flex justify-between gap-2",children:[e.jsxs(C,{variant:"outline",onClick:a,disabled:t||l||!o,children:[e.jsx(re,{className:"mr-2 h-4 w-4"}),"Delete"]}),e.jsxs(C,{onClick:()=>n(i.name,{transport:i.transport,command:i.command,args:i.args,url:i.url,enabled:i.enabled,required:i.required,startupTimeoutSec:i.startupTimeoutSec,toolTimeoutSec:i.toolTimeoutSec,enabledTools:i.enabledTools,disabledTools:i.disabledTools}),disabled:t||l||i.name.trim().length===0||m,children:[l?e.jsx(z,{className:"mr-2 h-4 w-4 animate-spin"}):null,"Save MCP server"]})]})]})}function Es({entries:s,disabled:r=!1,disabledReason:t,saving:l=!1,onSave:o,onDelete:n}){const{t:a}=E(),[c,i]=N.useState("new"),d=N.useMemo(()=>s.find(j=>j.name===c)??null,[s,c]),m=d??ks,h=JSON.stringify(m),x=d?.isCcsManaged&&d.managementSurface==="browser-settings";return e.jsxs(Z,{title:"MCP servers",badge:"mcp_servers",icon:e.jsx(ss,{className:"h-4 w-4"}),description:"Manage the safe MCP transport fields. Keep auth headers and bearer tokens in raw TOML.",disabledReason:t,children:[x?e.jsxs("div",{className:"rounded-md border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-sm text-amber-900 dark:text-amber-200",children:[e.jsx("strong",{children:d?.name})," is CCS-managed. Configure browser tooling from"," ",e.jsx("code",{children:"Settings > Browser"}),"; the generic MCP editor is read-only for this entry."]}):null,e.jsxs(P,{value:c,onValueChange:i,disabled:r,children:[e.jsx(O,{children:e.jsx(D,{placeholder:"Select MCP server"})}),e.jsxs(L,{children:[e.jsx(b,{value:"new",children:a("codex.createNewMcpServer")}),s.map(j=>e.jsx(b,{value:j.name,children:j.isCcsManaged?`${j.name} (CCS managed)`:j.name},j.name))]})]}),e.jsx(Ts,{initialDraft:m,isNew:c==="new",disabled:r||!!x,saving:l,canDelete:d!==null&&!x,onDelete:async()=>{d&&(await n(d.name),i("new"))},onSave:async(j,p)=>{await o(j,p),i(j)}},h)]})}const Ps={name:"",displayName:null,baseUrl:null,envKey:null,wireApi:"responses",requiresOpenaiAuth:!1,supportsWebsockets:!1},Os={name:"cliproxy",displayName:"CLIProxy Codex",baseUrl:"http://127.0.0.1:8317/api/provider/codex",envKey:"CLIPROXY_API_KEY",wireApi:"responses",requiresOpenaiAuth:!1,supportsWebsockets:!1};function Ds({initialDraft:s,isNew:r,disabled:t,saving:l,canDelete:o,onSave:n,onDelete:a}){const{t:c}=E(),[i,d]=N.useState(s);return e.jsxs(e.Fragment,{children:[r&&e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 rounded-md border border-dashed px-3 py-2 text-xs text-muted-foreground",children:[e.jsxs("p",{children:["Quick start: apply the CLIProxy Codex preset here, then set"," ",e.jsx("strong",{children:c("codex.defaultProvider")})," to ",e.jsx("code",{children:"cliproxy"})," in Top-level settings."]}),e.jsx(C,{variant:"outline",size:"sm",onClick:()=>d(Os),disabled:t,children:"Use CLIProxy Codex preset"})]}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsx(S,{value:i.name,onChange:m=>d(h=>({...h,name:m.target.value})),placeholder:"Provider id",disabled:t||!r}),e.jsx(S,{value:i.displayName??"",onChange:m=>d(h=>({...h,displayName:m.target.value||null})),placeholder:"Display name",disabled:t}),e.jsx(S,{value:i.baseUrl??"",onChange:m=>d(h=>({...h,baseUrl:m.target.value||null})),placeholder:"http://127.0.0.1:8317/api/provider/codex",disabled:t}),e.jsx(S,{value:i.envKey??"",onChange:m=>d(h=>({...h,envKey:m.target.value||null})),placeholder:"CLIPROXY_API_KEY",disabled:t})]}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-3",children:[e.jsxs(P,{value:i.wireApi??"responses",onValueChange:m=>d(h=>({...h,wireApi:m})),disabled:t,children:[e.jsx(O,{children:e.jsx(D,{})}),e.jsx(L,{children:e.jsx(b,{value:"responses",children:c("codex.responses")})})]}),e.jsxs("label",{className:"flex items-center justify-between rounded-md border px-3 py-2 text-sm",children:["Requires OpenAI auth",e.jsx(J,{checked:i.requiresOpenaiAuth,onCheckedChange:m=>d(h=>({...h,requiresOpenaiAuth:m})),disabled:t})]}),e.jsxs("label",{className:"flex items-center justify-between rounded-md border px-3 py-2 text-sm",children:["Supports websockets",e.jsx(J,{checked:i.supportsWebsockets,onCheckedChange:m=>d(h=>({...h,supportsWebsockets:m})),disabled:t})]})]}),e.jsxs("div",{className:"flex justify-between gap-2",children:[e.jsxs(C,{variant:"outline",onClick:a,disabled:t||l||!o,children:[e.jsx(re,{className:"mr-2 h-4 w-4"}),"Delete"]}),e.jsxs(C,{onClick:()=>n(i.name,{displayName:i.displayName,baseUrl:i.baseUrl,envKey:i.envKey,wireApi:i.wireApi,requiresOpenaiAuth:i.requiresOpenaiAuth,supportsWebsockets:i.supportsWebsockets}),disabled:t||l||i.name.trim().length===0,children:[l?e.jsx(z,{className:"mr-2 h-4 w-4 animate-spin"}):null,"Save provider"]})]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["If you want plain native ",e.jsx("code",{children:"codex"})," to default to CLIProxy, save a provider named"," ",e.jsx("code",{children:"cliproxy"})," with ",e.jsx("code",{children:"CLIPROXY_API_KEY"})," here, then pick"," ",e.jsx("code",{children:"cliproxy"})," in the ",e.jsx("strong",{children:c("codex.defaultProvider")})," control above."]})]})}function Ls({entries:s,disabled:r=!1,disabledReason:t,saving:l=!1,onSave:o,onDelete:n}){const{t:a}=E(),[c,i]=N.useState("new"),d=N.useMemo(()=>s.find(x=>x.name===c)??null,[s,c]),m=d??Ps,h=JSON.stringify(m);return e.jsxs(Z,{title:"Model providers",badge:"model_providers",icon:e.jsx(rs,{className:"h-4 w-4"}),description:"Edit the common provider fields CCS can support safely. Keep secret migration and inline bearer tokens in raw TOML.",disabledReason:t,children:[e.jsxs(P,{value:c,onValueChange:i,disabled:r,children:[e.jsx(O,{children:e.jsx(D,{placeholder:"Select provider"})}),e.jsxs(L,{children:[e.jsx(b,{value:"new",children:a("codex.createNewProvider")}),s.map(x=>e.jsx(b,{value:x.name,children:x.name},x.name))]})]}),e.jsx(Ds,{initialDraft:m,isNew:c==="new",disabled:r,saving:l,canDelete:d!==null,onDelete:async()=>{d&&(await n(d.name),i("new"))},onSave:async(x,j)=>{await o(x,j),i(x)}},h)]})}function As({initialName:s,initialModel:r,initialProvider:t,initialEffort:l,providerNames:o,activeProfile:n,selectedEntryName:a,disabled:c,saving:i,onSave:d,onDelete:m,onSetActive:h}){const{t:x}=E(),[j,p]=N.useState(s),[w,M]=N.useState(r),[q,u]=N.useState(t),[v,G]=N.useState(l);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsx(S,{value:j,onChange:g=>p(g.target.value),placeholder:"deep-review",disabled:c||a!==null}),e.jsx(S,{value:w??"",onChange:g=>M(g.target.value||null),placeholder:"gpt-5.4",disabled:c}),e.jsxs(P,{value:q??"__unset__",onValueChange:g=>u(g==="__unset__"?null:g),disabled:c,children:[e.jsx(O,{children:e.jsx(D,{placeholder:x("codex.useGlobalProvider")})}),e.jsxs(L,{children:[e.jsx(b,{value:"__unset__",children:x("codex.useGlobalProvider")}),o.map(g=>e.jsx(b,{value:g,children:g},g))]})]}),e.jsxs(P,{value:v??"__unset__",onValueChange:g=>G(g==="__unset__"?null:g),disabled:c,children:[e.jsx(O,{children:e.jsx(D,{placeholder:x("codex.useGlobalEffort")})}),e.jsxs(L,{children:[e.jsx(b,{value:"__unset__",children:x("codex.useGlobalEffort")}),["minimal","low","medium","high","xhigh"].map(g=>e.jsx(b,{value:g,children:g},g))]})]})]}),e.jsxs("div",{className:"flex justify-between gap-2",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(C,{variant:"outline",onClick:m,disabled:c||i||!a,children:[e.jsx(re,{className:"mr-2 h-4 w-4"}),"Delete"]}),e.jsx(C,{variant:"outline",onClick:h,disabled:c||i||!a||a===n,children:"Set active"})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(C,{variant:"outline",onClick:()=>d(j,{model:w,modelProvider:q,modelReasoningEffort:v},!1),disabled:c||i||j.trim().length===0,children:[i?e.jsx(z,{className:"mr-2 h-4 w-4 animate-spin"}):null,"Save profile"]}),e.jsxs(C,{onClick:()=>d(j,{model:w,modelProvider:q,modelReasoningEffort:v},!0),disabled:c||i||j.trim().length===0,children:[i?e.jsx(z,{className:"mr-2 h-4 w-4 animate-spin"}):null,"Save + activate"]})]})]})]})}function Ms({activeProfile:s,entries:r,providerNames:t,disabled:l=!1,disabledReason:o,saving:n=!1,onSave:a,onDelete:c,onSetActive:i}){const{t:d}=E(),[m,h]=N.useState("new"),x=N.useMemo(()=>r.find(p=>p.name===m)??null,[r,m]),j=JSON.stringify(x??{name:"",values:{}});return e.jsxs(Z,{title:d("codex.profiles"),badge:"profiles",icon:e.jsx(ts,{className:"h-4 w-4"}),description:"Create reusable Codex overlays and set the active default profile.",disabledReason:o,children:[e.jsxs(P,{value:m,onValueChange:h,disabled:l,children:[e.jsx(O,{children:e.jsx(D,{placeholder:"Select profile"})}),e.jsxs(L,{children:[e.jsx(b,{value:"new",children:d("codex.createNewProfile")}),r.map(p=>e.jsxs(b,{value:p.name,children:[p.name,p.name===s?" (active)":""]},p.name))]})]}),e.jsx(As,{initialName:x?.name??"",initialModel:x?.values.model??null,initialProvider:x?.values.modelProvider??null,initialEffort:x?.values.modelReasoningEffort??null,providerNames:t,activeProfile:s,selectedEntryName:x?.name??null,disabled:l,saving:n,onDelete:async()=>{x&&(await c(x.name),h("new"))},onSetActive:async()=>{x&&await i(x.name)},onSave:async(p,w,M)=>{await a(p,w,M),h(p)}},j)]})}function Rs({workspacePath:s,disabled:r,saving:t,onSave:l}){const{t:o}=E(),[n,a]=N.useState(s),[c,i]=N.useState("trusted");return e.jsxs("div",{className:"grid gap-2 sm:grid-cols-[1fr_160px_auto]",children:[e.jsx(S,{value:n,onChange:d=>a(d.target.value),placeholder:"~/repo or /absolute/path",disabled:r}),e.jsxs(P,{value:c,onValueChange:i,disabled:r,children:[e.jsx(O,{children:e.jsx(D,{})}),e.jsxs(L,{children:[e.jsx(b,{value:"trusted",children:o("codex.trusted")}),e.jsx(b,{value:"untrusted",children:o("codex.untrusted")})]})]}),e.jsxs(C,{onClick:()=>l(n,c),disabled:r||t,children:[t?e.jsx(z,{className:"mr-2 h-4 w-4 animate-spin"}):null,"Save trust"]})]})}function Is({workspacePath:s,entries:r,disabled:t=!1,disabledReason:l,saving:o=!1,onSave:n}){const{t:a}=E();return e.jsxs(Z,{title:"Project trust",badge:"projects",icon:e.jsx(ns,{className:"h-4 w-4"}),description:"Trust current workspaces or remove stale trust entries without opening raw TOML.",disabledReason:l,children:[e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Paths must be absolute or start with ",e.jsx("code",{children:"~/"}),". Relative paths are rejected so CCS does not trust the wrong folder."]}),e.jsx(Rs,{workspacePath:s,disabled:t,saving:o,onSave:n},s),e.jsx(C,{variant:"outline",className:"w-full justify-start",onClick:()=>n(s,"trusted"),disabled:t||o,children:"Trust current workspace"}),e.jsx("div",{className:"space-y-2",children:r.length===0?e.jsx("p",{className:"text-xs text-muted-foreground",children:a("codex.noProjectTrustEntries")}):r.map(c=>e.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-md border px-3 py-2",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"truncate text-sm font-medium",children:c.path}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["trust_level = ",c.trustLevel]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(C,{variant:"ghost",size:"sm",onClick:()=>n(c.path,c.trustLevel==="trusted"?"untrusted":"trusted"),disabled:t||o,children:"Toggle"}),e.jsx(C,{variant:"ghost",size:"icon",onClick:()=>n(c.path,null),disabled:t||o,children:e.jsx(re,{className:"h-4 w-4"})})]})]},c.path))})]})}const A="__unset__",Fs=105e4,Ws=272e3,_e=8e5,ke=7e5,Ks=new Intl.NumberFormat("en-US");function X(s){return s??A}function Y(s,r){return r&&!s.includes(r)?[r,...s]:s}function xe(s){return Ks.format(s)}function qs(s){return s?.trim().toLowerCase().startsWith("gpt-5.4")??!1}function Us(s,r){const t={};return r.model!==s.model&&(t.model=r.model),r.modelReasoningEffort!==s.modelReasoningEffort&&(t.modelReasoningEffort=r.modelReasoningEffort),r.modelContextWindow!==s.modelContextWindow&&(t.modelContextWindow=r.modelContextWindow),r.modelAutoCompactTokenLimit!==s.modelAutoCompactTokenLimit&&(t.modelAutoCompactTokenLimit=r.modelAutoCompactTokenLimit),r.modelProvider!==s.modelProvider&&(t.modelProvider=r.modelProvider),r.approvalPolicy!==s.approvalPolicy&&(t.approvalPolicy=r.approvalPolicy),r.sandboxMode!==s.sandboxMode&&(t.sandboxMode=r.sandboxMode),r.webSearch!==s.webSearch&&(t.webSearch=r.webSearch),r.toolOutputTokenLimit!==s.toolOutputTokenLimit&&(t.toolOutputTokenLimit=r.toolOutputTokenLimit),r.personality!==s.personality&&(t.personality=r.personality),t}function Vs({initialValues:s,providerNames:r,disabled:t,saving:l,onSave:o}){const{t:n}=E(),[a,c]=N.useState(s),i=Y(["minimal","low","medium","high","xhigh"],a.modelReasoningEffort),d=Y(r,a.modelProvider),m=Y(["on-request","never","untrusted"],a.approvalPolicy),h=Y(["read-only","workspace-write","danger-full-access"],a.sandboxMode),x=Y(["cached","live","disabled"],a.webSearch),j=Y(["none","friendly","pragmatic"],a.personality),p=Us(s,a),w=Object.keys(p).length>0,M=qs(a.model),q=u=>{const v=u.trim();return v.length>0?Number(v):null};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs font-medium",children:n("codex.model")}),e.jsx(S,{value:a.model??"",onChange:u=>c(v=>({...v,model:u.target.value||null})),placeholder:"gpt-5.5",disabled:t})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs font-medium",children:n("codex.reasoningEffort")}),e.jsxs(P,{value:X(a.modelReasoningEffort),onValueChange:u=>c(v=>({...v,modelReasoningEffort:u===A?null:u})),disabled:t,children:[e.jsx(O,{children:e.jsx(D,{placeholder:n("codex.useDefault")})}),e.jsxs(L,{children:[e.jsx(b,{value:A,children:n("codex.useDefault")}),i.map(u=>e.jsx(b,{value:u,children:u},u))]})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs font-medium",children:n("codex.defaultProvider")}),e.jsxs(P,{value:X(a.modelProvider),onValueChange:u=>c(v=>({...v,modelProvider:u===A?null:u})),disabled:t,children:[e.jsx(O,{children:e.jsx(D,{placeholder:n("codex.useCodexDefault")})}),e.jsxs(L,{children:[e.jsx(b,{value:A,children:n("codex.useCodexDefault")}),d.map(u=>e.jsx(b,{value:u,children:u},u))]})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs font-medium",children:n("codex.approvalPolicy")}),e.jsxs(P,{value:X(a.approvalPolicy),onValueChange:u=>c(v=>({...v,approvalPolicy:u===A?null:u})),disabled:t,children:[e.jsx(O,{children:e.jsx(D,{placeholder:n("codex.useDefault")})}),e.jsxs(L,{children:[e.jsx(b,{value:A,children:n("codex.useDefault")}),m.map(u=>e.jsx(b,{value:u,children:u},u))]})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs font-medium",children:n("codex.sandboxMode")}),e.jsxs(P,{value:X(a.sandboxMode),onValueChange:u=>c(v=>({...v,sandboxMode:u===A?null:u})),disabled:t,children:[e.jsx(O,{children:e.jsx(D,{placeholder:n("codex.useDefault")})}),e.jsxs(L,{children:[e.jsx(b,{value:A,children:n("codex.useDefault")}),h.map(u=>e.jsx(b,{value:u,children:u},u))]})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs font-medium",children:n("codex.webSearch")}),e.jsxs(P,{value:X(a.webSearch),onValueChange:u=>c(v=>({...v,webSearch:u===A?null:u})),disabled:t,children:[e.jsx(O,{children:e.jsx(D,{placeholder:n("codex.useDefault")})}),e.jsxs(L,{children:[e.jsx(b,{value:A,children:n("codex.useDefault")}),x.map(u=>e.jsx(b,{value:u,children:u},u))]})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs font-medium",children:n("codex.toolOutputTokenLimit")}),e.jsx(S,{type:"number",min:1,value:a.toolOutputTokenLimit??"",onChange:u=>c(v=>({...v,toolOutputTokenLimit:u.target.value?Number(u.target.value):null})),placeholder:"25000",disabled:t})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs font-medium",children:n("codex.personality")}),e.jsxs(P,{value:X(a.personality),onValueChange:u=>c(v=>({...v,personality:u===A?null:u})),disabled:t,children:[e.jsx(O,{children:e.jsx(D,{placeholder:n("codex.useDefault")})}),e.jsxs(L,{children:[e.jsx(b,{value:A,children:n("codex.useDefault")}),j.map(u=>e.jsx(b,{value:u,children:u},u))]})]})]})]}),e.jsxs("div",{className:"space-y-4 rounded-xl border border-amber-500/30 bg-amber-500/5 p-4 shadow-sm dark:bg-amber-400/5",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(os,{className:"h-4 w-4 text-amber-600 dark:text-amber-300"}),e.jsx("p",{className:"text-sm font-semibold",children:n("codex.longContextOverride")}),e.jsx(_,{variant:"outline",className:"border-amber-500/40 bg-background/80 text-[10px] uppercase tracking-[0.16em] text-amber-700 dark:text-amber-300",children:"Manual opt-in only"}),e.jsx(_,{variant:"secondary",className:"text-[10px] uppercase tracking-[0.16em] text-muted-foreground",children:M?"GPT-5.4 long-context selected":"GPT-5.4 long-context reference"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Draft values only. Nothing applies until Save."})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(C,{type:"button",variant:"outline",size:"sm",disabled:t,onClick:()=>c(u=>({...u,modelContextWindow:_e,modelAutoCompactTokenLimit:ke})),children:"Fill cautious pair"}),e.jsx(C,{type:"button",variant:"outline",size:"sm",disabled:t,onClick:()=>c(u=>({...u,modelContextWindow:Fs})),children:"Set official max window"}),e.jsx(C,{type:"button",variant:"ghost",size:"sm",disabled:t,onClick:()=>c(u=>({...u,modelContextWindow:null,modelAutoCompactTokenLimit:null})),children:"Clear"})]})]}),e.jsxs("div",{className:"grid gap-2 sm:grid-cols-3",children:[e.jsxs("div",{className:"rounded-lg border bg-background/85 px-3 py-3 shadow-sm shadow-black/5",children:[e.jsx("p",{className:"text-[10px] font-medium uppercase tracking-wide text-muted-foreground",children:"Official max"}),e.jsx("p",{className:"mt-1 font-mono text-base font-semibold text-foreground",children:"1.05M / 1M"}),e.jsx("p",{className:"mt-1 text-[11px] text-muted-foreground",children:n("codex.gptContextCap")})]}),e.jsxs("div",{className:"rounded-lg border bg-background/85 px-3 py-3 shadow-sm shadow-black/5",children:[e.jsx("p",{className:"text-[10px] font-medium uppercase tracking-wide text-muted-foreground",children:"Standard window"}),e.jsx("p",{className:"mt-1 font-mono text-base font-semibold text-foreground",children:xe(Ws)}),e.jsx("p",{className:"mt-1 text-[11px] text-muted-foreground",children:n("codex.normalUsageWindow")})]}),e.jsxs("div",{className:"rounded-lg border bg-background/85 px-3 py-3 shadow-sm shadow-black/5",children:[e.jsx("p",{className:"text-[10px] font-medium uppercase tracking-wide text-muted-foreground",children:"Above 272K"}),e.jsx("p",{className:"mt-1 font-mono text-base font-semibold text-foreground",children:n("codex.counts2x")}),e.jsx("p",{className:"mt-1 text-[11px] text-muted-foreground",children:n("codex.usageLimitCost")})]})]}),e.jsxs("div",{className:"space-y-3 rounded-lg border bg-background/75 px-3 py-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("p",{className:"text-[10px] font-medium uppercase tracking-wide text-muted-foreground",children:"One cautious pair"}),e.jsxs("div",{className:"rounded-full border bg-background px-2.5 py-1 font-mono text-[11px] font-medium",children:["Context ",xe(_e)]}),e.jsxs("div",{className:"rounded-full border bg-background px-2.5 py-1 font-mono text-[11px] font-medium",children:["Auto-compact ",xe(ke)]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[e.jsx(_,{variant:"outline",className:"border-border/70 bg-background/80 text-[10px] uppercase tracking-[0.14em] text-muted-foreground",children:"Not official"}),e.jsx(_,{variant:"outline",className:"border-border/70 bg-background/80 text-[10px] uppercase tracking-[0.14em] text-muted-foreground",children:"Draft only"})]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-[11px] text-muted-foreground",children:[e.jsx("span",{children:n("codex.quickFillWarning")}),!M&&a.model?e.jsxs("span",{children:[e.jsx("code",{children:a.model})," should be checked separately."]}):null]})]}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs font-medium",children:n("codex.modelContextWindow")}),e.jsx(S,{"aria-label":n("codex.modelContextWindow"),type:"number",min:1,value:a.modelContextWindow??"",onChange:u=>c(v=>({...v,modelContextWindow:q(u.target.value)})),placeholder:"Unset",disabled:t}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Writes ",e.jsx("code",{children:"model_context_window"}),". Leave unset to keep Codex defaults."]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs font-medium",children:n("codex.autoCompactTokenLimit")}),e.jsx(S,{"aria-label":n("codex.autoCompactTokenLimit"),type:"number",min:1,value:a.modelAutoCompactTokenLimit??"",onChange:u=>c(v=>({...v,modelAutoCompactTokenLimit:q(u.target.value)})),placeholder:"Unset",disabled:t}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Writes ",e.jsx("code",{children:"model_auto_compact_token_limit"}),". Leave unset to keep model defaults."]})]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-[11px] text-muted-foreground",children:[e.jsx("span",{className:"text-[10px] uppercase tracking-[0.14em]",children:"Docs"}),e.jsx("a",{href:"https://platform.openai.com/docs/models",target:"_blank",rel:"noreferrer",className:"underline underline-offset-2 hover:text-foreground",children:"GPT-5 model guide"}),e.jsx("a",{href:"https://openai.com/index/introducing-gpt-5-5/",target:"_blank",rel:"noreferrer",className:"underline underline-offset-2 hover:text-foreground",children:"Release notes"}),e.jsx("a",{href:"https://developers.openai.com/codex/config-reference",target:"_blank",rel:"noreferrer",className:"underline underline-offset-2 hover:text-foreground",children:"Config reference"})]})]}),e.jsx("div",{className:"flex justify-end",children:e.jsxs(C,{onClick:()=>o(p),disabled:t||l||!w,children:[l?e.jsx(z,{className:"mr-2 h-4 w-4 animate-spin"}):null,"Save top-level settings"]})})]})}function Bs({values:s,providerNames:r,disabled:t=!1,disabledReason:l,saving:o=!1,onSave:n}){return e.jsx(Z,{title:"Top-level controls",badge:"config.toml",icon:e.jsx(as,{className:"h-4 w-4"}),description:"Structured controls for the stable top-level Codex settings users touch most often. Unsupported upstream shapes stay untouched and should be edited in raw TOML.",disabledReason:l,children:e.jsx(Vs,{initialValues:s,providerNames:r,disabled:t,saving:o,onSave:n},JSON.stringify(s))})}function Gs({workspacePath:s,activeProfile:r,topLevelSettings:t,projectTrustEntries:l,profileEntries:o,modelProviderEntries:n,mcpServerEntries:a,featureCatalog:c,featureState:i,disabled:d,disabledReason:m,saving:h,onPatch:x}){const{t:j}=E();return e.jsx(fe,{className:"h-full",children:e.jsxs("div",{className:"space-y-6 pr-1 pb-6",children:[e.jsxs("div",{className:"group relative overflow-hidden rounded-xl border border-border/80 bg-background/50 p-5 shadow-sm transition-all hover:bg-background hover:shadow-md dark:border-border/60",children:[e.jsx("div",{className:"absolute inset-x-0 -top-px h-px bg-gradient-to-r from-transparent via-foreground/15 to-transparent transition-opacity group-hover:via-foreground/30"}),e.jsxs("div",{className:"flex flex-col gap-6 lg:flex-row lg:items-start lg:justify-between",children:[e.jsxs("div",{className:"flex-1 space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-lg border border-primary/20 bg-primary/10 text-primary transition-colors group-hover:border-primary/30",children:e.jsx(ls,{className:"h-4 w-4"})}),e.jsx("div",{children:e.jsx("h2",{className:"text-base font-semibold tracking-tight text-foreground",children:j("codex.controlCenter")})})]}),e.jsxs("ul",{className:"grid gap-3 sm:grid-cols-2 text-sm text-muted-foreground",children:[e.jsxs("li",{className:"flex items-start gap-2.5",children:[e.jsx(is,{className:"h-4 w-4 shrink-0 text-muted-foreground/60 mt-0.5"}),e.jsxs("span",{className:"leading-relaxed",children:["Writes exclusively to user-layer"," ",e.jsx("code",{className:"text-[11px] bg-muted/70 px-1.5 py-0.5 rounded border border-border/50",children:"config.toml"})]})]}),e.jsxs("li",{className:"flex items-start gap-2.5",children:[e.jsx(cs,{className:"h-4 w-4 shrink-0 text-muted-foreground/60 mt-0.5"}),e.jsx("span",{className:"leading-relaxed",children:"Does not reflect repo trust layers or CLI overrides"})]})]})]}),e.jsx("div",{className:"shrink-0 lg:w-[280px]",children:e.jsx("div",{className:"relative overflow-hidden rounded-lg border border-amber-500/20 bg-amber-500/5 p-4 transition-colors group-hover:border-amber-500/30 group-hover:bg-amber-500/10 dark:border-amber-400/10 dark:bg-amber-400/5",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(ds,{className:"mt-0.5 h-4 w-4 shrink-0 text-amber-600 dark:text-amber-400"}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-[11px] font-bold text-amber-700 dark:text-amber-300 uppercase tracking-wider",children:"Formatting Note"}),e.jsx("p",{className:"text-[13px] leading-relaxed text-amber-800/80 dark:text-amber-200/70",children:"Saves normalize TOML formatting and strip comments. Switch to the raw editor if exact layout matters."})]})]})})})]})]}),e.jsx(Bs,{values:t,providerNames:n.map(p=>p.name),disabled:d,disabledReason:m,saving:h,onSave:p=>x({kind:"top-level",values:p},j("toasts.codexSaved"))}),e.jsx(Is,{workspacePath:s,entries:l,disabled:d,disabledReason:m,saving:h,onSave:(p,w)=>x({kind:"project-trust",path:p,trustLevel:w},w?"Saved project trust entry.":"Removed project trust entry.")}),e.jsx(Ms,{activeProfile:r,entries:o,providerNames:n.map(p=>p.name),disabled:d,disabledReason:m,saving:h,onSave:(p,w,M)=>x({kind:"profile",action:"upsert",name:p,values:w,setAsActive:M},"Saved profile."),onDelete:p=>x({kind:"profile",action:"delete",name:p},"Deleted profile."),onSetActive:p=>x({kind:"profile",action:"set-active",name:p},"Set active profile.")}),e.jsx(Ls,{entries:n,disabled:d,disabledReason:m,saving:h,onSave:(p,w)=>x({kind:"model-provider",action:"upsert",name:p,values:w},"Saved model provider."),onDelete:p=>x({kind:"model-provider",action:"delete",name:p},"Deleted model provider.")}),e.jsx(Es,{entries:a,disabled:d,disabledReason:m,saving:h,onSave:(p,w)=>x({kind:"mcp-server",action:"upsert",name:p,values:w},"Saved MCP server."),onDelete:p=>x({kind:"mcp-server",action:"delete",name:p},"Deleted MCP server.")}),e.jsx(_s,{catalog:c,state:i,disabled:d,disabledReason:m,onToggle:(p,w)=>x({kind:"feature",feature:p,enabled:w},"Saved feature toggle.")})]})})}const De=`model_provider = "cliproxy"
2
-
3
- [model_providers.cliproxy]
4
- base_url = "http://127.0.0.1:8317/api/provider/codex"
5
- env_key = "CLIPROXY_API_KEY"
6
- wire_api = "responses"`,$s=["multi_agent","unified_exec","shell_snapshot","apply_patch_freeform","js_repl","runtime_metrics","prevent_idle_sleep","fast_mode","apps","smart_approvals"];function zs(){return[{name:"multi_agent",label:y.t("codex.featureMultiAgentLabel"),description:y.t("codex.featureMultiAgentDesc")},{name:"unified_exec",label:y.t("codex.featureUnifiedExecLabel"),description:y.t("codex.featureUnifiedExecDesc")},{name:"shell_snapshot",label:y.t("codex.featureShellSnapshotLabel"),description:y.t("codex.featureShellSnapshotDesc")},{name:"apply_patch_freeform",label:y.t("codex.featureApplyPatchLabel"),description:y.t("codex.featureApplyPatchDesc")},{name:"js_repl",label:y.t("codex.featureJsReplLabel"),description:y.t("codex.featureJsReplDesc")},{name:"runtime_metrics",label:y.t("codex.featureRuntimeMetricsLabel"),description:y.t("codex.featureRuntimeMetricsDesc")},{name:"prevent_idle_sleep",label:y.t("codex.featurePreventIdleSleepLabel"),description:y.t("codex.featurePreventIdleSleepDesc")},{name:"fast_mode",label:y.t("codex.featureFastModeLabel"),description:y.t("codex.featureFastModeDesc")},{name:"apps",label:y.t("codex.featureAppsLabel"),description:y.t("codex.featureAppsDesc")},{name:"smart_approvals",label:y.t("codex.featureSmartApprovalsLabel"),description:y.t("codex.featureSmartApprovalsDesc")}]}function B(s){return typeof s=="object"&&s!==null&&!Array.isArray(s)?s:null}function T(s){return typeof s=="string"&&s.trim().length>0?s.trim():null}function Q(s){return typeof s=="number"&&Number.isFinite(s)?s:null}function ue(s){return Array.isArray(s)?s.filter(r=>typeof r=="string").map(r=>r.trim()):[]}function Le(s){return{model:T(s?.model),modelReasoningEffort:T(s?.model_reasoning_effort),modelContextWindow:Q(s?.model_context_window),modelAutoCompactTokenLimit:Q(s?.model_auto_compact_token_limit),modelProvider:T(s?.model_provider),approvalPolicy:T(s?.approval_policy),sandboxMode:T(s?.sandbox_mode),webSearch:T(s?.web_search),toolOutputTokenLimit:Q(s?.tool_output_token_limit),personality:T(s?.personality)}}function Xs(s){const r=B(s?.projects);return r?Object.entries(r).map(([t,l])=>{const o=T(B(l)?.trust_level);return o?{path:t,trustLevel:o}:null}).filter(t=>t!==null).sort((t,l)=>t.path.localeCompare(l.path)):[]}function Ys(s){const r=B(s?.profiles);return r?Object.entries(r).map(([t,l])=>({name:t,values:Le(B(l))})).sort((t,l)=>t.name.localeCompare(l.name)):[]}function Hs(s){const r=B(s?.model_providers);return r?Object.entries(r).map(([t,l])=>{const o=B(l);return o?{name:t,displayName:T(o.name),baseUrl:T(o.base_url),envKey:T(o.env_key),wireApi:T(o.wire_api),requiresOpenaiAuth:o.requires_openai_auth===!0,supportsWebsockets:o.supports_websockets===!0}:null}).filter(t=>t!==null).sort((t,l)=>t.name.localeCompare(l.name)):[]}function Qs(s){const r=B(s?.mcp_servers);return r?Object.entries(r).map(([t,l])=>{const o=B(l);if(!o)return null;const n=T(o.command)?"stdio":"streamable-http",a=Q(o.startup_timeout_ms);return{name:t,transport:n,command:T(o.command),args:ue(o.args),url:T(o.url),enabled:o.enabled!==!1,required:o.required===!0,startupTimeoutSec:Q(o.startup_timeout_sec)??(a!==null?a/1e3:null),toolTimeoutSec:Q(o.tool_timeout_sec),enabledTools:ue(o.enabled_tools),disabledTools:ue(o.disabled_tools),isCcsManaged:t==="ccs_browser",managementSurface:t==="ccs_browser"?"browser-settings":null}}).filter(t=>t!==null).sort((t,l)=>t.name.localeCompare(l.name)):[]}function Js(s){const r=B(s?.features),t={};for(const l of $s){const o=r?.[l];t[l]=typeof o=="boolean"?o:null}if(r)for(const[l,o]of Object.entries(r))l in t||(t[l]=typeof o=="boolean"?o:null);return t}const Zs=[{id:"codex-config-basic",label:"Codex Config Basics",url:"https://developers.openai.com/codex/config-basic",description:"Official user-layer setup, config location, and baseline configuration behavior."},{id:"codex-config-advanced",label:"Codex Config Advanced",url:"https://developers.openai.com/codex/config-advanced",description:"Layering, trust, profiles, and advanced config behavior."},{id:"codex-config-reference",label:"Codex Config Reference",url:"https://developers.openai.com/codex/config-reference",description:"Canonical upstream config surface for providers, MCP, features, and trust."},{id:"codex-releases",label:"Codex GitHub Releases",url:"https://github.com/openai/codex/releases",description:"Track upstream release notes and fast-moving CLI changes."}],er=[{provider:"openai",label:"OpenAI Responses API",apiFormat:"Responses API",url:"https://platform.openai.com/docs/api-reference/responses"}];function sr(s){const r=/https?:\/\/[^\s)]+/g,t=[];let l=0,o;for(;(o=r.exec(s))!==null;){const[n]=o,a=o.index;a>l&&t.push(s.slice(l,a)),t.push(e.jsx("a",{href:n,target:"_blank",rel:"noreferrer",className:"underline underline-offset-2 hover:text-foreground",children:n},`${n}-${a}`)),l=a+n.length}return l<s.length&&t.push(s.slice(l)),t.length>0?t:[s]}function rr({diagnostics:s}){const{t:r}=E(),t=s.docsReference??{notes:[],links:[],providerDocs:[],providerValues:[],settingsHierarchy:[]},l=t.links.length>0?t.links:Zs,o=t.providerDocs.length>0?t.providerDocs:er;return e.jsx(fe,{className:"h-full",children:e.jsxs("div",{className:"space-y-4 pr-1",children:[e.jsxs(I,{children:[e.jsx(F,{className:"pb-2",children:e.jsxs(W,{className:"flex items-center gap-2 text-base",children:[e.jsx(me,{className:"h-4 w-4"}),"CCS bridge recipe"]})}),e.jsxs(K,{className:"space-y-3 text-sm text-muted-foreground",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("p",{children:[e.jsx("strong",{children:"Built-in:"})," Use ",e.jsx("code",{children:"ccsxp"})," for the CCS provider shortcut."]}),e.jsxs("p",{children:[e.jsx("strong",{children:"Native:"})," Configure the recipe below to use CLIProxy directly with"," ",e.jsx("code",{children:"codex"}),"."]})]}),e.jsx("pre",{className:"overflow-x-auto rounded-md border bg-muted/20 p-3 text-xs text-foreground",children:De}),e.jsxs("ol",{className:"ml-4 list-decimal space-y-1.5 [&>li]:pl-1",children:[e.jsxs("li",{children:["Save the ",e.jsx("code",{children:"cliproxy"})," provider in your user config."]}),e.jsxs("li",{children:["Set top-level ",e.jsx("code",{children:"model_provider"})," to ",e.jsx("code",{children:"cliproxy"}),"."]}),e.jsxs("li",{children:["Export ",e.jsx("code",{children:"CLIPROXY_API_KEY"})," before launching native Codex."]})]}),e.jsxs("p",{children:["CCS-managed browser tooling belongs to ",e.jsx("code",{children:"Settings > Browser"}),". Do not edit the ",e.jsx("code",{children:"ccs_browser"})," entry from the generic MCP card unless you are intentionally overriding the managed path in raw TOML."]})]})]}),e.jsxs(I,{children:[e.jsx(F,{className:"pb-2",children:e.jsxs(W,{className:"flex items-center gap-2 text-base",children:[e.jsx(me,{className:"h-4 w-4"}),"Upstream notes"]})}),e.jsxs(K,{className:"space-y-2 text-sm",children:[t.notes.length>0&&e.jsx("ul",{className:"ml-4 list-disc space-y-1.5 text-muted-foreground [&>li]:pl-1",children:t.notes.map((n,a)=>e.jsx("li",{children:sr(n)},`${a}-${n}`))}),e.jsx(ee,{}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-xs uppercase tracking-wide text-muted-foreground",children:r("codex.codexDocs")}),e.jsx("div",{className:"space-y-1.5",children:l.map(n=>e.jsxs("a",{href:n.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:n.label}),e.jsx(we,{className:"h-3.5 w-3.5 text-muted-foreground"})]}),e.jsx("p",{className:"mt-0.5 text-[11px] text-muted-foreground",children:n.description}),e.jsx("p",{className:"mt-1 break-all font-mono text-[11px] text-muted-foreground/90 underline underline-offset-2",children:n.url})]},n.id))})]}),e.jsx(ee,{}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-xs uppercase tracking-wide text-muted-foreground",children:"Provider / bridge reference"}),e.jsx("div",{className:"space-y-1.5",children:o.map(n=>e.jsxs("a",{href:n.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:n.label}),e.jsx(we,{className:"h-3.5 w-3.5 text-muted-foreground"})]}),e.jsxs("p",{className:"mt-0.5 text-[11px] text-muted-foreground",children:["provider: ",n.provider," | format: ",n.apiFormat]}),e.jsx("p",{className:"mt-1 break-all font-mono text-[11px] text-muted-foreground/90 underline underline-offset-2",children:n.url})]},`${n.provider}-${n.url}`))})]}),t.providerValues.length>0&&e.jsxs(e.Fragment,{children:[e.jsx(ee,{}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Provider values: ",t.providerValues.join(", ")]})]}),t.settingsHierarchy.length>0&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Settings hierarchy: ",t.settingsHierarchy.join(" -> ")]})]})]})]})})}function tr(s,r){let t=s.slice(0,r).split(/\r\n|\n|\r/g);return[t.length,t.pop().length+1]}function nr(s,r,t){let l=s.split(/\r\n|\n|\r/g),o="",n=(Math.log10(r+1)|0)+1;for(let a=r-1;a<=r+1;a++){let c=l[a-1];c&&(o+=a.toString().padEnd(n," "),o+=": ",o+=c,o+=`
7
- `,a===r&&(o+=" ".repeat(n+t+2),o+=`^
8
- `))}return o}class f extends Error{line;column;codeblock;constructor(r,t){const[l,o]=tr(t.toml,t.ptr),n=nr(t.toml,l,o);super(`Invalid TOML document: ${r}
9
-
10
- ${n}`,t),this.line=l,this.column=o,this.codeblock=n}}function ar(s,r){let t=0;for(;s[r-++t]==="\\";);return--t&&t%2}function he(s,r=0,t=s.length){let l=s.indexOf(`
11
- `,r);return s[l-1]==="\r"&&l--,l<=t?l:-1}function te(s,r){for(let t=r;t<s.length;t++){let l=s[t];if(l===`
12
- `)return t;if(l==="\r"&&s[t+1]===`
13
- `)return t+1;if(l<" "&&l!==" "||l==="")throw new f("control characters are not allowed in comments",{toml:s,ptr:r})}return s.length}function V(s,r,t,l){let o;for(;;){for(;(o=s[r])===" "||o===" "||!t&&(o===`
14
- `||o==="\r"&&s[r+1]===`
15
- `);)r++;if(l||o!=="#")break;r=te(s,r)}return r}function or(s,r,t,l,o=!1){if(!l)return r=he(s,r),r<0?s.length:r;for(let n=r;n<s.length;n++){let a=s[n];if(a==="#")n=he(s,n);else{if(a===t)return n+1;if(a===l||o&&(a===`
16
- `||a==="\r"&&s[n+1]===`
17
- `))return n}}throw new f("cannot find end of structure",{toml:s,ptr:r})}function Ae(s,r){let t=s[r],l=t===s[r+1]&&s[r+1]===s[r+2]?s.slice(r,r+3):t;r+=l.length-1;do r=s.indexOf(l,++r);while(r>-1&&t!=="'"&&ar(s,r));return r>-1&&(r+=l.length,l.length>1&&(s[r]===t&&r++,s[r]===t&&r++)),r}let lr=/^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i;class H extends Date{#s=!1;#r=!1;#e=null;constructor(r){let t=!0,l=!0,o="Z";if(typeof r=="string"){let n=r.match(lr);n?(n[1]||(t=!1,r=`0000-01-01T${r}`),l=!!n[2],l&&r[10]===" "&&(r=r.replace(" ","T")),n[2]&&+n[2]>23?r="":(o=n[3]||null,r=r.toUpperCase(),!o&&l&&(r+="Z"))):r=""}super(r),isNaN(this.getTime())||(this.#s=t,this.#r=l,this.#e=o)}isDateTime(){return this.#s&&this.#r}isLocal(){return!this.#s||!this.#r||!this.#e}isDate(){return this.#s&&!this.#r}isTime(){return this.#r&&!this.#s}isValid(){return this.#s||this.#r}toISOString(){let r=super.toISOString();if(this.isDate())return r.slice(0,10);if(this.isTime())return r.slice(11,23);if(this.#e===null)return r.slice(0,-1);if(this.#e==="Z")return r;let t=+this.#e.slice(1,3)*60+ +this.#e.slice(4,6);return t=this.#e[0]==="-"?t:-t,new Date(this.getTime()-t*6e4).toISOString().slice(0,-1)+this.#e}static wrapAsOffsetDateTime(r,t="Z"){let l=new H(r);return l.#e=t,l}static wrapAsLocalDateTime(r){let t=new H(r);return t.#e=null,t}static wrapAsLocalDate(r){let t=new H(r);return t.#r=!1,t.#e=null,t}static wrapAsLocalTime(r){let t=new H(r);return t.#s=!1,t.#e=null,t}}let ir=/^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/,cr=/^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/,dr=/^[+-]?0[0-9_]/,xr=/^[0-9a-f]{2,8}$/i,Te={b:"\b",t:" ",n:`
18
- `,f:"\f",r:"\r",e:"\x1B",'"':'"',"\\":"\\"};function Me(s,r=0,t=s.length){let l=s[r]==="'",o=s[r++]===s[r]&&s[r]===s[r+1];o&&(t-=2,s[r+=2]==="\r"&&r++,s[r]===`
19
- `&&r++);let n=0,a,c="",i=r;for(;r<t-1;){let d=s[r++];if(d===`
20
- `||d==="\r"&&s[r]===`
21
- `){if(!o)throw new f("newlines are not allowed in strings",{toml:s,ptr:r-1})}else if(d<" "&&d!==" "||d==="")throw new f("control characters are not allowed in strings",{toml:s,ptr:r-1});if(a){if(a=!1,d==="x"||d==="u"||d==="U"){let m=s.slice(r,r+=d==="x"?2:d==="u"?4:8);if(!xr.test(m))throw new f("invalid unicode escape",{toml:s,ptr:n});try{c+=String.fromCodePoint(parseInt(m,16))}catch{throw new f("invalid unicode escape",{toml:s,ptr:n})}}else if(o&&(d===`
22
- `||d===" "||d===" "||d==="\r")){if(r=V(s,r-1,!0),s[r]!==`
23
- `&&s[r]!=="\r")throw new f("invalid escape: only line-ending whitespace may be escaped",{toml:s,ptr:n});r=V(s,r)}else if(d in Te)c+=Te[d];else throw new f("unrecognized escape sequence",{toml:s,ptr:n});i=r}else!l&&d==="\\"&&(n=r-1,a=!0,c+=s.slice(i,n))}return c+s.slice(i,t-1)}function ur(s,r,t,l){if(s==="true")return!0;if(s==="false")return!1;if(s==="-inf")return-1/0;if(s==="inf"||s==="+inf")return 1/0;if(s==="nan"||s==="+nan"||s==="-nan")return NaN;if(s==="-0")return l?0n:0;let o=ir.test(s);if(o||cr.test(s)){if(dr.test(s))throw new f("leading zeroes are not allowed",{toml:r,ptr:t});s=s.replace(/_/g,"");let a=+s;if(isNaN(a))throw new f("invalid number",{toml:r,ptr:t});if(o){if((o=!Number.isSafeInteger(a))&&!l)throw new f("integer value cannot be represented losslessly",{toml:r,ptr:t});(o||l===!0)&&(a=BigInt(s))}return a}const n=new H(s);if(!n.isValid())throw new f("invalid value",{toml:r,ptr:t});return n}function mr(s,r,t){let l=s.slice(r,t),o=l.indexOf("#");return o>-1&&(te(s,o),l=l.slice(0,o)),[l.trimEnd(),o]}function ge(s,r,t,l,o){if(l===0)throw new f("document contains excessively nested structures. aborting.",{toml:s,ptr:r});let n=s[r];if(n==="["||n==="{"){let[i,d]=n==="["?fr(s,r,l,o):pr(s,r,l,o);if(t){if(d=V(s,d),s[d]===",")d++;else if(s[d]!==t)throw new f("expected comma or end of structure",{toml:s,ptr:d})}return[i,d]}let a;if(n==='"'||n==="'"){a=Ae(s,r);let i=Me(s,r,a);if(t){if(a=V(s,a),s[a]&&s[a]!==","&&s[a]!==t&&s[a]!==`
24
- `&&s[a]!=="\r")throw new f("unexpected character encountered",{toml:s,ptr:a});a+=+(s[a]===",")}return[i,a]}a=or(s,r,",",t);let c=mr(s,r,a-+(s[a-1]===","));if(!c[0])throw new f("incomplete key-value declaration: no value specified",{toml:s,ptr:r});return t&&c[1]>-1&&(a=V(s,r+c[1]),a+=+(s[a]===",")),[ur(c[0],s,r,o),a]}let hr=/^[a-zA-Z0-9-_]+[ \t]*$/;function pe(s,r,t="="){let l=r-1,o=[],n=s.indexOf(t,r);if(n<0)throw new f("incomplete key-value: cannot find end of key",{toml:s,ptr:r});do{let a=s[r=++l];if(a!==" "&&a!==" ")if(a==='"'||a==="'"){if(a===s[r+1]&&a===s[r+2])throw new f("multiline strings are not allowed in keys",{toml:s,ptr:r});let c=Ae(s,r);if(c<0)throw new f("unfinished string encountered",{toml:s,ptr:r});l=s.indexOf(".",c);let i=s.slice(c,l<0||l>n?n:l),d=he(i);if(d>-1)throw new f("newlines are not allowed in keys",{toml:s,ptr:r+l+d});if(i.trimStart())throw new f("found extra tokens after the string part",{toml:s,ptr:c});if(n<c&&(n=s.indexOf(t,c),n<0))throw new f("incomplete key-value: cannot find end of key",{toml:s,ptr:r});o.push(Me(s,r,c))}else{l=s.indexOf(".",r);let c=s.slice(r,l<0||l>n?n:l);if(!hr.test(c))throw new f("only letter, numbers, dashes and underscores are allowed in keys",{toml:s,ptr:r});o.push(c.trimEnd())}}while(l+1&&l<n);return[o,V(s,n+1,!0,!0)]}function pr(s,r,t,l){let o={},n=new Set,a;for(r++;(a=s[r++])!=="}"&&a;){if(a===",")throw new f("expected value, found comma",{toml:s,ptr:r-1});if(a==="#")r=te(s,r);else if(a!==" "&&a!==" "&&a!==`
25
- `&&a!=="\r"){let c,i=o,d=!1,[m,h]=pe(s,r-1);for(let p=0;p<m.length;p++){if(p&&(i=d?i[c]:i[c]={}),c=m[p],(d=Object.hasOwn(i,c))&&(typeof i[c]!="object"||n.has(i[c])))throw new f("trying to redefine an already defined value",{toml:s,ptr:r});!d&&c==="__proto__"&&Object.defineProperty(i,c,{enumerable:!0,configurable:!0,writable:!0})}if(d)throw new f("trying to redefine an already defined value",{toml:s,ptr:r});let[x,j]=ge(s,h,"}",t-1,l);n.add(x),i[c]=x,r=j}}if(!a)throw new f("unfinished table encountered",{toml:s,ptr:r});return[o,r]}function fr(s,r,t,l){let o=[],n;for(r++;(n=s[r++])!=="]"&&n;){if(n===",")throw new f("expected value, found comma",{toml:s,ptr:r-1});if(n==="#")r=te(s,r);else if(n!==" "&&n!==" "&&n!==`
26
- `&&n!=="\r"){let a=ge(s,r-1,"]",t-1,l);o.push(a[0]),r=a[1]}}if(!n)throw new f("unfinished array encountered",{toml:s,ptr:r});return[o,r]}function Ee(s,r,t,l){let o=r,n=t,a,c=!1,i;for(let d=0;d<s.length;d++){if(d){if(o=c?o[a]:o[a]={},n=(i=n[a]).c,l===0&&(i.t===1||i.t===2))return null;if(i.t===2){let m=o.length-1;o=o[m],n=n[m].c}}if(a=s[d],(c=Object.hasOwn(o,a))&&n[a]?.t===0&&n[a]?.d)return null;c||(a==="__proto__"&&(Object.defineProperty(o,a,{enumerable:!0,configurable:!0,writable:!0}),Object.defineProperty(n,a,{enumerable:!0,configurable:!0,writable:!0})),n[a]={t:d<s.length-1&&l===2?3:l,d:!1,i:0,c:{}})}if(i=n[a],i.t!==l&&!(l===1&&i.t===3)||(l===2&&(i.d||(i.d=!0,o[a]=[]),o[a].push(o={}),i.c[i.i++]=i={t:1,d:!1,i:0,c:{}}),i.d))return null;if(i.d=!0,l===1)o=c?o[a]:o[a]={};else if(l===0&&c)return null;return[a,o,i.c]}function gr(s,{maxDepth:r=1e3,integersAsBigInt:t}={}){let l={},o={},n=l,a=o;for(let c=V(s,0);c<s.length;){if(s[c]==="["){let i=s[++c]==="[",d=pe(s,c+=+i,"]");if(i){if(s[d[1]-1]!=="]")throw new f("expected end of table declaration",{toml:s,ptr:d[1]-1});d[1]++}let m=Ee(d[0],l,o,i?2:1);if(!m)throw new f("trying to redefine an already defined table or value",{toml:s,ptr:c});a=m[2],n=m[1],c=d[1]}else{let i=pe(s,c),d=Ee(i[0],n,a,0);if(!d)throw new f("trying to redefine an already defined table or value",{toml:s,ptr:c});let m=ge(s,i[1],void 0,r,t);d[1][d[0]]=m[0],c=m[1]}if(c=V(s,c,!0),s[c]&&s[c]!==`
27
- `&&s[c]!=="\r")throw new f("each key-value declaration must be followed by an end-of-line",{toml:s,ptr:c});c=V(s,c)}return l}function jr(s){return typeof s=="object"&&s!==null&&!Array.isArray(s)}function vr(s){if(!s.trim())return{};const t=gr(s);if(!jr(t))throw new Error("TOML root must be a table.");return t}function Re(s){try{return{config:vr(s),parseError:null}}catch(r){return{config:null,parseError:r.message}}}async function br(){const s=await fetch(se("/codex/diagnostics"));if(!s.ok)throw new Error("Failed to fetch Codex diagnostics");return s.json()}async function wr(){const s=await fetch(se("/codex/config/raw"));if(!s.ok)throw new Error("Failed to fetch Codex raw config");return s.json()}async function Nr(s){const r=await fetch(se("/codex/config/raw"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(r.status===409)throw new Pe("Codex raw config changed externally");if(!r.ok){const t=await r.json().catch(()=>null);throw new Error(t?.error||"Failed to save Codex raw config")}return r.json()}async function yr(s){const r=await fetch(se("/codex/config/patch"),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(r.status===409)throw new Pe("Codex config changed externally");if(!r.ok){const t=await r.json().catch(()=>null);throw new Error(t?.error||"Failed to patch Codex config")}return r.json()}function Cr(){const s=ws(),r=ye({queryKey:["codex-diagnostics"],queryFn:br,refetchInterval:1e4}),t=ye({queryKey:["codex-raw-config"],queryFn:wr}),l=Ce({mutationFn:Nr,onSuccess:(n,a)=>{s.setQueryData(["codex-raw-config"],c=>{const i=c?.path??"$CODEX_HOME/config.toml",d=c?.resolvedPath??i,m=Re(a.rawText);return{path:i,resolvedPath:d,exists:!0,mtime:n.mtime,rawText:a.rawText,config:m.config,parseError:m.parseError,readError:null}}),s.invalidateQueries({queryKey:["codex-diagnostics"]})}}),o=Ce({mutationFn:yr,onSuccess:n=>{s.setQueryData(["codex-raw-config"],n),s.invalidateQueries({queryKey:["codex-diagnostics"]})}});return N.useMemo(()=>({diagnostics:r.data,diagnosticsLoading:r.isLoading,diagnosticsError:r.error,refetchDiagnostics:r.refetch,rawConfig:t.data,rawConfigLoading:t.isLoading,rawConfigError:t.error,refetchRawConfig:t.refetch,saveRawConfig:l.mutate,saveRawConfigAsync:l.mutateAsync,isSavingRawConfig:l.isPending,patchConfig:o.mutate,patchConfigAsync:o.mutateAsync,isPatchingConfig:o.isPending}),[r.data,r.isLoading,r.error,r.refetch,t.data,t.isLoading,t.error,t.refetch,l.mutate,l.mutateAsync,l.isPending,o.mutate,o.mutateAsync,o.isPending])}const Sr=[{label:"Start Default",command:"ccs",description:"Launch Claude with default profile"},{label:"GLM Profile",command:"ccs glm",description:"Switch to GLM model"},{label:"Health Check",command:"ccs doctor",description:"Run system diagnostics"},{label:"Delegate Task",command:'ccs glm -p "your task"',description:"Delegate to GLM profile"}];function _r({snippets:s=Sr}){const[r,t]=N.useState(null),{t:l}=E(),o=async(n,a)=>{await navigator.clipboard.writeText(n),t(a),setTimeout(()=>t(null),2e3)};return e.jsxs(I,{children:[e.jsx(F,{className:"pb-3",children:e.jsxs(W,{className:"text-lg flex items-center gap-2",children:[e.jsx(xs,{className:"w-5 h-5 text-muted-foreground"}),l("quickCommands.title")]})}),e.jsx(K,{children:e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:s.map((n,a)=>e.jsxs("div",{className:Oe("group flex items-center justify-between gap-2 px-3 py-2","rounded-lg border bg-muted/30 hover:bg-muted/50 transition-colors"),children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:n.label}),e.jsx("code",{className:"text-sm font-mono font-medium truncate block",children:n.command})]}),e.jsx(C,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>o(n.command,a),title:n.description,children:r===a?e.jsx(us,{className:"h-4 w-4 text-green-600"}):e.jsx(ms,{className:"h-4 w-4"})})]},a))})})]})}function kr(s){return!s||!Number.isFinite(s)?"N/A":new Date(s).toLocaleString()}function Tr(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 k({label:s,value:r,mono:t=!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:Oe("text-right break-all",t&&"font-mono text-xs"),children:r})]})}function Er({diagnostics:s}){const{t:r}=E(),t=s.config.activeProfile?`codex --profile ${s.config.activeProfile}`:"codex",l=s.binary.supportsConfigOverrides;return e.jsx(fe,{className:"h-full",children:e.jsxs("div",{className:"space-y-4 pr-1",children:[e.jsxs(I,{children:[e.jsx(F,{className:"pb-2",children:e.jsxs(W,{className:"flex items-center gap-2 text-base",children:[e.jsx(hs,{className:"h-4 w-4"}),r("codex.howCodexWorks")]})}),e.jsx(K,{className:"text-sm text-muted-foreground",children:e.jsxs("ul",{className:"ml-4 list-disc space-y-1.5 [&>li]:pl-1",children:[e.jsx("li",{children:r("codex.nativeDesc")}),e.jsxs("li",{children:[e.jsx("strong",{children:r("codex.nativeConfigLabel")})," ",r("codex.nativeConfigDesc")]}),e.jsxs("li",{children:[e.jsx("strong",{children:r("codex.transientOverridesLabel")})," ",r("codex.transientOverridesDesc")]}),e.jsxs("li",{children:[e.jsx("strong",{children:r("codex.cliproxyDefaultLabel")})," ",r("codex.cliproxyDefaultDesc")]}),e.jsx("li",{children:r("codex.apiProfilesDefault")})]})})]}),e.jsxs(I,{children:[e.jsx(F,{className:"pb-2",children:e.jsxs(W,{className:"flex items-center gap-2 text-base",children:[e.jsx(ps,{className:"h-4 w-4"}),r("codex.runtimeInstall")]})}),e.jsxs(K,{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:r("codex.status")}),e.jsx(_,{variant:s.binary.installed?"default":"secondary",children:s.binary.installed?r("codex.detected"):r("codex.notFound")})]}),e.jsx(k,{label:r("codex.detectionSource"),value:s.binary.source,mono:!0}),e.jsx(k,{label:r("codex.binaryPath"),value:s.binary.path||r("codex.notFound"),mono:!0}),e.jsx(k,{label:r("codex.installDirectory"),value:s.binary.installDir||"N/A",mono:!0}),e.jsx(k,{label:r("codex.versionLabel"),value:s.binary.version||"Unknown",mono:!0}),e.jsx(k,{label:r("codex.nativeAliases"),value:"ccs-codex, ccsx",mono:!0}),e.jsx(k,{label:r("codex.ccsProviderShortcut"),value:"ccsxp",mono:!0}),e.jsxs("div",{className:"flex items-center justify-between rounded-md border px-3 py-2",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:r("codex.configOverrideSupport")}),e.jsx(_,{variant:s.binary.supportsConfigOverrides?"default":"secondary",children:s.binary.supportsConfigOverrides?r("codex.available"):r("codex.missing")})]})]})]}),e.jsxs(I,{children:[e.jsx(F,{className:"pb-2",children:e.jsxs(W,{className:"flex items-center gap-2 text-base",children:[e.jsx(Ne,{className:"h-4 w-4"}),r("codex.cliproxyNativeCodex")]})}),e.jsx(K,{className:"space-y-3 text-sm text-muted-foreground",children:l?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("p",{children:e.jsx("strong",{children:r("codex.twoSupportedPaths")})}),e.jsxs("ul",{className:"ml-4 list-disc space-y-1 [&>li]:pl-1",children:[e.jsxs("li",{children:[e.jsx("strong",{children:r("codex.builtInLabel")})," ",r("codex.builtInCcsxpDesc")]}),e.jsxs("li",{children:[e.jsx("strong",{children:r("codex.nativeRecipeLabel")})," ",r("codex.nativeRecipeDesc")]})]})]}),e.jsxs("div",{className:"rounded-md border bg-muted/20 p-3",children:[e.jsx("p",{className:"font-medium text-foreground",children:r("codex.codexNativeRecipe")}),e.jsx("pre",{className:"mt-2 overflow-x-auto rounded-md bg-background p-3 text-xs text-foreground",children:De})]}),e.jsxs("ol",{className:"ml-4 list-decimal space-y-1.5 [&>li]:pl-1",children:[e.jsx("li",{children:r("codex.saveProviderNamedCliproxy")}),e.jsx("li",{children:r("codex.inTopLevelSetDefault")}),e.jsx("li",{children:r("codex.exportCliproxyApiKey")})]})]}):e.jsx("p",{children:r("codex.noConfigOverrides")})})]}),e.jsxs(I,{children:[e.jsx(F,{className:"pb-2",children:e.jsxs(W,{className:"flex items-center gap-2 text-base",children:[e.jsx(fs,{className:"h-4 w-4"}),r("codex.configFile")]})}),e.jsx(K,{className:"space-y-3",children: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:r("codex.userConfig")}),s.file.exists?e.jsx(gs,{className:"h-4 w-4 text-green-600"}):e.jsx(js,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsx(k,{label:r("codex.path"),value:s.file.path,mono:!0}),e.jsx(k,{label:r("codex.resolved"),value:s.file.resolvedPath,mono:!0}),e.jsx(k,{label:r("codex.size"),value:Tr(s.file.sizeBytes)}),e.jsx(k,{label:r("codex.lastModified"),value:kr(s.file.mtimeMs)}),s.file.parseError&&e.jsxs("p",{className:"text-xs text-amber-600",children:[r("codex.tomlWarning"),": ",s.file.parseError]}),s.file.readError&&e.jsxs("p",{className:"text-xs text-destructive",children:[r("codex.readWarning"),": ",s.file.readError]})]})})]}),e.jsxs(I,{children:[e.jsx(F,{className:"pb-2",children:e.jsxs(W,{className:"flex items-center gap-2 text-base",children:[e.jsx(me,{className:"h-4 w-4"}),r("codex.currentUserLayerSummary")]})}),e.jsxs(K,{className:"space-y-3",children:[e.jsx(k,{label:r("codex.model"),value:s.config.model||r("codex.notSet"),mono:!0}),e.jsx(k,{label:r("codex.defaultProvider"),value:s.config.modelProvider||r("codex.notSet"),mono:!0}),e.jsx(k,{label:r("codex.activeProfile"),value:s.config.activeProfile||r("codex.notSet"),mono:!0}),e.jsx(k,{label:r("codex.approvalPolicy"),value:s.config.approvalPolicy||r("codex.notSet"),mono:!0}),e.jsx(k,{label:r("codex.sandboxMode"),value:s.config.sandboxMode||r("codex.notSet"),mono:!0}),e.jsx(k,{label:r("codex.webSearch"),value:s.config.webSearch||r("codex.notSet"),mono:!0}),e.jsx(ee,{}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 text-xs",children:[e.jsx(_,{variant:"outline",className:"justify-center",children:r("codex.providersCount",{count:s.config.modelProviderCount})}),e.jsx(_,{variant:"outline",className:"justify-center",children:r("codex.profilesCount",{count:s.config.profileCount})}),e.jsx(_,{variant:"outline",className:"justify-center",children:r("codex.enabledFeaturesCount",{count:s.config.enabledFeatures.length})}),e.jsx(_,{variant:"outline",className:"justify-center",children:r("codex.mcpServersCount",{count:s.config.mcpServerCount})})]}),s.config.topLevelKeys.length>0&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-xs uppercase tracking-wide text-muted-foreground",children:r("codex.userLayerKeysPresent")}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:s.config.topLevelKeys.map(o=>e.jsx(_,{variant:"secondary",className:"font-mono text-[10px]",children:o},o))})]})]})]}),e.jsx(_r,{snippets:[{label:r("codex.nativeShortAlias"),command:"ccsx",description:"Launch the short native Codex runtime alias."},{label:r("codex.ccsCodexShortcut"),command:'ccsxp "your prompt"',description:l?r("codex.runBuiltInCodex"):"Requires a Codex build that exposes --config overrides."},{label:r("codex.explicitProviderRoute"),command:'ccs codex --target codex "your prompt"',description:l?r("codex.runBuiltInCodexExplicit"):"Requires a Codex build that exposes --config overrides."},{label:s.config.activeProfile?"Inspect active profile":r("codex.openNativeCodex"),command:t,description:s.config.activeProfile?"Inspect the active named profile directly in native Codex.":"Open native Codex without forcing a named profile overlay."}]}),e.jsxs(I,{children:[e.jsx(F,{className:"pb-2",children:e.jsxs(W,{className:"flex items-center gap-2 text-base",children:[e.jsx(Ne,{className:"h-4 w-4"}),r("codex.runtimeVsProvider")]})}),e.jsxs(K,{className:"grid gap-3 md:grid-cols-2",children:[e.jsxs("div",{className:"flex flex-col rounded-md border p-3 text-sm",children:[e.jsx("p",{className:"font-medium text-foreground",children:r("codex.nativeCodexRuntime")}),e.jsxs("ul",{className:"mt-2 flex-grow list-disc space-y-1.5 pl-4 text-muted-foreground [&>li]:pl-1",children:[e.jsx("li",{children:e.jsx("code",{children:"ccs-codex"})}),e.jsx("li",{children:e.jsx("code",{children:"ccsx"})}),e.jsx("li",{children:e.jsx("code",{children:"--target codex"})})]}),e.jsx(_,{variant:"secondary",className:"mt-4 w-fit justify-center font-normal",children:r("codex.honorsSavedNativeConfig")})]}),e.jsxs("div",{className:"flex flex-col rounded-md border p-3 text-sm",children:[e.jsx("p",{className:"font-medium text-foreground",children:r("codex.ccsCodexProvider")}),l?e.jsxs(e.Fragment,{children:[e.jsxs("ul",{className:"mt-2 flex-grow list-disc space-y-1.5 pl-4 text-muted-foreground [&>li]:pl-1",children:[e.jsx("li",{children:e.jsx("code",{children:"ccsxp"})}),e.jsx("li",{children:e.jsx("code",{children:"ccs codex --target codex"})})]}),e.jsx(_,{variant:"secondary",className:"mt-4 w-fit justify-center font-normal",children:r("codex.usesTransientOverrides")})]}):e.jsx("p",{className:"mt-2 text-muted-foreground",children:r("codex.unavailableNoConfig")})]})]})]}),e.jsxs(I,{children:[e.jsx(F,{className:"pb-2",children:e.jsx(W,{className:"text-base",children:r("codex.supportedFlows")})}),e.jsx(K,{children:e.jsxs(Ns,{children:[e.jsx(ys,{children:e.jsxs(Se,{children:[e.jsx(le,{children:r("codex.flow")}),e.jsx(le,{children:r("codex.status")}),e.jsx(le,{children:r("codex.notes")})]})}),e.jsx(Cs,{children:s.supportMatrix.map(o=>e.jsxs(Se,{children:[e.jsx(ie,{className:"font-mono text-xs",children:o.label}),e.jsx(ie,{children:e.jsx(_,{variant:o.supported?"default":"secondary",children:o.supported?r("codex.yes"):r("codex.no")})}),e.jsx(ie,{className:"text-xs text-muted-foreground",children:o.notes})]},o.id))})]})})]}),s.warnings.length>0&&e.jsxs(I,{className:"border-amber-200 bg-amber-50/50 dark:bg-amber-950/20",children:[e.jsx(F,{className:"pb-2",children:e.jsxs(W,{className:"flex items-center gap-2 text-base",children:[e.jsx(vs,{className:"h-4 w-4 text-amber-600"}),r("codex.warningsTitle")]})}),e.jsx(K,{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))})]})]})})}function Ur(){const{t:s}=E(),r=zs(),{diagnostics:t,diagnosticsLoading:l,diagnosticsError:o,refetchDiagnostics:n,rawConfig:a,rawConfigLoading:c,rawConfigError:i,refetchRawConfig:d,saveRawConfigAsync:m,isSavingRawConfig:h,patchConfigAsync:x,isPatchingConfig:j}=Cr(),[p,w]=N.useState(null),M=a?.rawText??"",q=p??M,u=p!==null&&p!==M,v=Re(q),G=v.parseError?{valid:!1,error:v.parseError}:{valid:!0},g=a?.config??null,Ie=c||!a||u||a?.parseError!==null||a?.readError!==null,Fe=i?"Structured controls unavailable: failed to load the current config.toml.":a?.readError?`Structured controls unavailable: ${a.readError}`:u?G.valid?"Save or discard raw TOML edits before using structured controls.":"Fix or discard raw TOML edits before using structured controls.":a?.parseError?`Structured controls disabled: ${a.parseError}`:null,We=N.useMemo(()=>Le(g),[g]),Ke=N.useMemo(()=>Xs(g),[g]),qe=N.useMemo(()=>Ys(g),[g]),Ue=N.useMemo(()=>Hs(g),[g]),Ve=N.useMemo(()=>Qs(g),[g]),Be=N.useMemo(()=>Js(g),[g]),Ge=R=>{if(R===M){w(null);return}w(R)},$e=async()=>{try{if((await Promise.all([n(),d()])).some($=>!$||$.status==="error"||$.isError||$.error)){U.error(s("toasts.codexRefreshFailed"));return}w(null)}catch(R){U.error(R.message||s("toasts.codexRefreshError"))}},ze=async()=>{if(!G.valid){U.error(s("toasts.codexFixToml"));return}try{await m({rawText:q,expectedMtime:a?.exists?a.mtime:void 0}),w(null),U.success(s("toasts.codexSaved")),await n()}catch(R){be(R)?U.error(s("toasts.codexChangedExternally")):U.error(R.message||s("toasts.codexSaveFailed"))}},Xe=async(R,je)=>{try{await x({...R,expectedMtime:a?.exists?a.mtime:void 0}),w(null),U.success(je)}catch($){be($)?U.error(s("toasts.codexChangedExternally")):U.error($.message||s("toasts.codexUpdateFailed"))}},ne="mt-0 h-full border-0 p-0 data-[state=inactive]:hidden",Ye=()=>l?e.jsxs("div",{className:"flex h-full items-center justify-center text-muted-foreground",children:[e.jsx(z,{className:"mr-2 h-5 w-5 animate-spin"}),"Loading Codex diagnostics..."]}):o||!t?e.jsx("div",{className:"flex h-full items-center justify-center px-6 text-center text-destructive",children:"Failed to load Codex diagnostics."}):e.jsxs(Je,{defaultValue:"overview",className:"flex h-full flex-col",children:[e.jsx("div",{className:"shrink-0 px-4 pt-4",children:e.jsxs(Ze,{className:"grid w-full grid-cols-3",children:[e.jsx(ae,{value:"overview",children:s("codexPage.overview")}),e.jsx(ae,{value:"controls",children:s("codexPage.controlCenter")}),e.jsx(ae,{value:"docs",children:s("codexPage.docs")})]})}),e.jsxs("div",{className:"flex-1 min-h-0 overflow-hidden px-4 pb-4 pt-3",children:[e.jsx(oe,{value:"overview",className:ne,children:e.jsx(Er,{diagnostics:t})}),e.jsx(oe,{value:"controls",className:ne,children:e.jsx(Gs,{workspacePath:t.workspacePath,activeProfile:t.config.activeProfile,topLevelSettings:We,projectTrustEntries:Ke,profileEntries:qe,modelProviderEntries:Ue,mcpServerEntries:Ve,featureCatalog:r,featureState:Be,disabled:Ie,disabledReason:Fe,saving:j,onPatch:Xe})}),e.jsx(oe,{value:"docs",className:ne,children:e.jsx(rr,{diagnostics:t})})]})]});return e.jsx("div",{className:"h-full min-h-0 overflow-hidden",children:e.jsxs(He,{direction:"horizontal",className:"h-full",children:[e.jsx(ve,{defaultSize:45,minSize:35,children:e.jsx("div",{className:"h-full border-r bg-muted/20",children:Ye()})}),e.jsx(Qe,{className:"group flex w-2 cursor-col-resize items-center justify-center bg-border transition-colors hover:bg-primary/20",children:e.jsx(bs,{className:"h-3 w-3 text-muted-foreground group-hover:text-primary"})}),e.jsx(ve,{defaultSize:55,minSize:35,children:e.jsx(Ss,{title:"Codex config.toml",pathLabel:a?.path||t?.file.path||"$CODEX_HOME/config.toml",loading:c,parseWarning:G.valid?a?.parseError:G.error,readWarning:a?.readError,value:q,dirty:u,readOnly:!!a?.readError,saving:h,saveDisabled:!u||h||c||!G.valid||!!a?.readError,onChange:R=>{Ge(R)},onSave:ze,onRefresh:$e,onDiscard:()=>w(null),language:"toml",loadingLabel:"Loading config.toml...",parseWarningLabel:"TOML warning",ownershipNotice:e.jsxs("div",{className:"rounded-md border border-amber-200 bg-amber-50/60 px-3 py-2 text-sm text-amber-900 dark:bg-amber-950/20 dark:text-amber-300",children:[e.jsx("p",{className:"font-medium",children:"This file is upstream-owned by Codex CLI."}),e.jsxs("p",{children:["CCS does not keep ",e.jsx("code",{children:"~/.codex/config.toml"})," in sync for you."]}),e.jsxs("p",{children:["CCS-backed Codex launches may apply transient ",e.jsx("code",{children:"-c"})," overrides and",e.jsx("code",{children:" CCS_CODEX_API_KEY"}),"; those effective values may not appear here."]})]})})})]})})}export{Ur as CodexPage};
@@ -1 +0,0 @@
1
- import{j as e}from"./radix-ui-Zb8sVEtn.js";import{L,r as c}from"./react-vendor-CNOkPC89.js";import{a as x,B as P,c as S,W as M,d as u,x as U,C,j as v,k as N,_ as w,b as j,n as b,I as B}from"./index-CEuKLsUj.js";import{a1 as F,$ as z,b8 as W,x as H,E as Q,Q as G,aa as K,C as q,b9 as J,av as V}from"./icons-DyorC3Xk.js";import"./tanstack-CrmUhA7Z.js";import"./notifications-B2HqRBj7.js";import"./utils-CzKF5WmX.js";import"./form-utils-Bcoyqxpq.js";import"./code-highlight-BRUf_pqB.js";const Y={new:"border-blue-200 bg-blue-50 text-blue-700 dark:border-blue-900/50 dark:bg-blue-900/20 dark:text-blue-300",stable:"border-green-200 bg-green-50 text-green-700 dark:border-green-900/50 dark:bg-green-900/20 dark:text-green-300",planned:"border-amber-200 bg-amber-50 text-amber-700 dark:border-amber-900/50 dark:bg-amber-900/20 dark:text-amber-300"};function Z({status:t,className:s}){const{t:r}=x(),i={new:r("updates.statusNew"),stable:r("updates.statusStable"),planned:r("updates.statusPlanned")};return e.jsx(P,{variant:"outline",className:S("font-medium",Y[t],s),children:i[t]})}const g={target:"Target CLI",cliproxy:"CLIProxy Provider","api-profiles":"API Profile",websearch:"WebSearch"},X=[{id:"codex-target-runtime-support",title:"Native Codex runtime support is live",summary:"Codex now participates as a first-class runtime target through ccs-codex, ccsx, ccsxp, or --target codex.",primaryAction:"Use Codex as a runtime target for native Codex sessions and Codex-routed CLIProxy flows.",publishedAt:"2026-03-28",status:"new",scopes:["target","cliproxy","api-profiles"],entryIds:["codex-target","codex-cliproxy"],highlights:["Use ccs-codex or ccsx for native Codex runs.","Use ccsxp for the built-in CCS Codex provider shortcut on native Codex.","Built-in Codex and Codex bridge profiles can run on native Codex with --target codex.","Saved default targets for API profiles and variants can now be claude, droid, or codex."],actions:[{id:"copy-codex-alias-command",label:"Open native Codex",description:"Launch Codex through the explicit CCS runtime alias.",type:"command",command:"ccs-codex"},{id:"copy-codex-provider-command",label:"Run built-in Codex on Codex",description:"Use the built-in Codex provider shortcut on native Codex.",type:"command",command:'ccsxp "your prompt"'},{id:"copy-codex-provider-command-explicit",label:"Run built-in Codex on Codex (explicit)",description:"Use the explicit built-in Codex provider route on native Codex.",type:"command",command:'ccs codex --target codex "your prompt"'},{id:"open-codex-dashboard",label:"Open Codex dashboard",description:"Review Codex runtime support, config layers, and dashboard setup flows.",type:"route",path:"/codex"}],routes:[{label:"Codex CLI",path:"/codex"}],commands:["ccs-codex","ccsx",'ccsxp "your prompt"','ccs codex --target codex "your prompt"']},{id:"droid-target-support",title:"Factory Droid support is live",summary:"API Profiles and CLIProxy variants now support Droid as a first-class execution target.",primaryAction:"Set Droid as your default execution target for non-Claude workflows.",publishedAt:"2026-02-25",status:"new",scopes:["target","api-profiles","cliproxy"],entryIds:["droid-target","custom-api-profiles","codex-cliproxy","agy-cliproxy"],highlights:["Set default target to Droid when creating or editing API Profiles.","Set default target to Droid for CLIProxy variants, including Codex and Antigravity flows.","Use ccs-droid as the explicit alias, with ccsd kept as the legacy shortcut."],actions:[{id:"open-api-profiles",label:"Set default target in API Profiles",description:"Open API Profiles and set Default Target to Droid for profiles you run often.",type:"route",path:"/providers"},{id:"open-cliproxy",label:"Set default target in CLIProxy variants",description:"Open CLIProxy variants and set target to Droid for Codex/Antigravity or custom variants.",type:"route",path:"/cliproxy"},{id:"copy-ccs-droid-command",label:"Run once with explicit Droid alias",description:"Use ccs-droid to force the Droid target with your current profile.",type:"command",command:"ccs-droid glm"},{id:"copy-target-override",label:"Run once with --target override",description:"Keep your default profile but force Droid for a single command.",type:"command",command:'ccs codex --target droid "your prompt"'}],routes:[{label:"API Profiles",path:"/providers"},{label:"CLIProxy",path:"/cliproxy"}],commands:["ccs-droid glm",'ccs codex --target droid "your prompt"',"ccs cliproxy create mycodex --provider codex --target droid"]},{id:"updates-center-launch",title:"Updates Center is available for rollout tasks",summary:"A focused Updates Center exists for setup tasks and rollout guidance when you need it.",primaryAction:"Use this page only when needed for rollout tasks, then return to your normal workflow.",publishedAt:"2026-02-25",status:"new",scopes:["target","cliproxy","api-profiles","websearch"],entryIds:["droid-target","codex-cliproxy","custom-api-profiles","opencode-websearch"],highlights:["Single data source powers update content and integration mapping.","Notices can be tracked as new, seen, done, or dismissed.","Catalog covers target CLI, CLIProxy providers, and WebSearch integrations."],actions:[{id:"open-updates-page",label:"Open Updates Center when needed",description:"Review rollout tasks only when you want guided setup changes.",type:"route",path:"/updates"},{id:"copy-open-dashboard",label:"Open dashboard from terminal",description:"Re-open config dashboard anytime from CLI.",type:"command",command:"ccs config"}],routes:[{label:"Updates Center",path:"/updates"}],commands:["ccs config"]}],ee=[{id:"claude-target",name:"Claude Code",scope:"target",status:"stable",summary:"Default runtime target for all CCS profile types.",pillars:{baseUrl:"From profile settings (ANTHROPIC_BASE_URL)",auth:"From profile settings (ANTHROPIC_AUTH_TOKEN)",model:"From profile settings (ANTHROPIC_MODEL)"},routes:[{label:"API Profiles",path:"/providers"},{label:"CLIProxy",path:"/cliproxy"}],commands:["ccs",'ccs glm "your prompt"']},{id:"droid-target",name:"Factory Droid",scope:"target",status:"new",summary:"First-class target for API Profiles and CLIProxy variants.",pillars:{baseUrl:"From profile or variant settings",auth:"From profile or variant settings",model:"From profile or variant settings"},routes:[{label:"API Profiles",path:"/providers"},{label:"CLIProxy",path:"/cliproxy"}],commands:["ccs-droid glm","ccs km --target droid","ccs codex --target droid"],notes:"Use ccs-droid as the explicit runtime alias. Legacy ccsd still works."},{id:"codex-target",name:"Codex CLI",scope:"target",status:"new",summary:"First-class runtime target for native Codex sessions and Codex-routed CLIProxy flows.",pillars:{baseUrl:"Native ~/.codex config for default mode, transient -c overrides for CCS-backed routes",auth:"Native Codex auth for default mode, env_key injection for CCS-backed routes",model:"Native Codex config or routed Codex model mapping from CLIProxy"},routes:[{label:"Codex CLI",path:"/codex"}],commands:["ccs-codex","ccsx","ccs codex --target codex","ccs codex-api --target codex"],notes:"Saved default targets for API profiles and CLIProxy variants can now be claude, droid, or codex."},{id:"codex-cliproxy",name:"Codex via CLIProxy",scope:"cliproxy",status:"stable",summary:"OAuth-backed provider with configurable variant model and a native Codex shortcut.",pillars:{baseUrl:"Managed by CLIProxy backend",auth:"OAuth account via CLIProxy auth flow",model:"Selectable per provider or variant"},routes:[{label:"CLIProxy",path:"/cliproxy"},{label:"Control Panel",path:"/cliproxy/control-panel"}],commands:['ccsxp "your prompt"',"ccs codex --target codex","ccs codex","ccs cliproxy create mycodex --provider codex","ccs api create codex-api --cliproxy-provider codex"],notes:"Use ccsxp when you want the built-in Codex provider on native Codex without retyping --target codex."},{id:"gemini-cliproxy",name:"Gemini via CLIProxy",scope:"cliproxy",status:"stable",summary:"OAuth-backed Gemini provider with multi-account management.",pillars:{baseUrl:"Managed by CLIProxy backend",auth:"OAuth account via CLIProxy auth flow",model:"Selectable per provider or variant"},routes:[{label:"CLIProxy",path:"/cliproxy"},{label:"Control Panel",path:"/cliproxy/control-panel"}],commands:["ccs gemini","ccs cliproxy create mygem --provider gemini"]},{id:"agy-cliproxy",name:"Antigravity via CLIProxy",scope:"cliproxy",status:"stable",summary:"OAuth-backed Antigravity provider with variant target controls.",pillars:{baseUrl:"Managed by CLIProxy backend",auth:"OAuth account via CLIProxy auth flow",model:"Selectable per provider or variant"},routes:[{label:"CLIProxy",path:"/cliproxy"},{label:"Control Panel",path:"/cliproxy/control-panel"}],commands:["ccs agy","ccs cliproxy create myagy --provider agy --target droid"]},{id:"custom-api-profiles",name:"Custom API Profiles",scope:"api-profiles",status:"stable",summary:"Any Anthropic-compatible endpoint with per-profile target and model mapping.",pillars:{baseUrl:"User-defined endpoint",auth:"User-defined token/key",model:"User-defined model identifier"},routes:[{label:"API Profiles",path:"/providers"}],commands:["ccs api create myprofile",'ccs myprofile "your prompt"']},{id:"opencode-websearch",name:"OpenCode WebSearch",scope:"websearch",status:"stable",summary:"WebSearch provider surfaced in Settings for third-party profile workflows.",pillars:{baseUrl:"Managed by OpenCode CLI integration",auth:"Provider-specific (managed externally)",model:"Configurable in WebSearch settings"},routes:[{label:"Settings",path:"/settings"}],commands:["ccs config",'ccs codex "your prompt"'],notes:"Enable OpenCode in Settings > WebSearch to activate fallback search."}];function l(t,s,r){return M.t(t,{defaultValue:s,...r})}function te(){return{target:l("supportCatalog.scope.target",g.target),cliproxy:l("supportCatalog.scope.cliproxy",g.cliproxy),"api-profiles":l("supportCatalog.scope.apiProfiles",g["api-profiles"]),websearch:l("supportCatalog.scope.websearch",g.websearch)}}function se(t){return{...t,title:l(`supportCatalog.notice.${t.id}.title`,t.title),summary:l(`supportCatalog.notice.${t.id}.summary`,t.summary),primaryAction:l(`supportCatalog.notice.${t.id}.primaryAction`,t.primaryAction),highlights:t.highlights.map((s,r)=>l(`supportCatalog.notice.${t.id}.highlight.${r}`,s)),actions:t.actions.map(s=>({...s,label:l(`supportCatalog.notice.${t.id}.action.${s.id}.label`,s.label),description:l(`supportCatalog.notice.${t.id}.action.${s.id}.description`,s.description)})),routes:t.routes.map((s,r)=>({...s,label:l(`supportCatalog.notice.${t.id}.route.${r}.label`,s.label)}))}}function re(t){return{...t,name:l(`supportCatalog.entry.${t.id}.name`,t.name),summary:l(`supportCatalog.entry.${t.id}.summary`,t.summary),pillars:{baseUrl:l(`supportCatalog.entry.${t.id}.pillar.baseUrl`,t.pillars.baseUrl),auth:l(`supportCatalog.entry.${t.id}.pillar.auth`,t.pillars.auth),model:l(`supportCatalog.entry.${t.id}.pillar.model`,t.pillars.model)},routes:t.routes.map((s,r)=>({...s,label:l(`supportCatalog.entry.${t.id}.route.${r}.label`,s.label)})),notes:t.notes?l(`supportCatalog.entry.${t.id}.notes`,t.notes):t.notes}}function ae(){return X.map(se)}function oe(){return ee.map(re)}function ie(t){const s=new Map(oe().map(r=>[r.id,r]));return t.entryIds.map(r=>s.get(r)).filter(r=>!!r)}function O(t){const s=new Date(`${t}T00:00:00Z`);return Number.isNaN(s.getTime())?t:new Intl.DateTimeFormat(void 0,{year:"numeric",month:"short",day:"numeric",timeZone:"UTC"}).format(s)}const $="ccs:updates:notice-progress:v1";function de(t){return t==="new"?"new":"seen"}function m(t,s){return s[t.id]??de(t.status)}function A(t){return t!=="done"&&t!=="dismissed"}function le(){if(typeof window>"u")return{};try{const t=window.localStorage.getItem($);if(!t)return{};const s=JSON.parse(t);if(!s||typeof s!="object"||Array.isArray(s))return{};const r={};for(const[i,d]of Object.entries(s))typeof i=="string"&&(d==="new"||d==="seen"||d==="done"||d==="dismissed")&&(r[i]=d);return r}catch{return{}}}function ne(t){typeof window>"u"||window.localStorage.setItem($,JSON.stringify(t))}function D({state:t,className:s}){const{t:r}=x(),i={new:{label:r("updates.progressNeedsAction"),className:"border-amber-300/70 bg-amber-100/70 text-amber-800 dark:border-amber-500/40 dark:bg-amber-500/15 dark:text-amber-300",showDot:!0},seen:{label:r("updates.progressInReview"),className:"border-blue-300/70 bg-blue-100/70 text-blue-800 dark:border-blue-500/40 dark:bg-blue-500/15 dark:text-blue-300"},done:{label:r("updates.progressDone"),className:"border-emerald-300/70 bg-emerald-100/70 text-emerald-800 dark:border-emerald-500/40 dark:bg-emerald-500/15 dark:text-emerald-300"},dismissed:{label:r("updates.progressDismissed"),className:"border-muted-foreground/20 bg-muted text-muted-foreground dark:border-muted-foreground/30"}}[t];return e.jsxs(P,{variant:"outline",className:S("gap-1.5 border text-[10px] font-medium",i.className,s),children:[i.showDot&&e.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-current"}),i.label]})}function ce({action:t}){const{t:s}=x();return e.jsxs("div",{className:"rounded-md border bg-muted/20 p-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0 space-y-0.5",children:[e.jsx("p",{className:"text-sm font-medium",children:t.label}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t.description})]}),t.type==="route"&&t.path&&e.jsx(u,{size:"sm",asChild:!0,children:e.jsxs(L,{to:t.path,children:[s("updates.open"),e.jsx(F,{className:"h-3.5 w-3.5"})]})})]}),t.type==="command"&&t.command&&e.jsxs("div",{className:"mt-2 flex items-center gap-2 rounded-md border bg-background px-2 py-1.5",children:[e.jsx(z,{className:"h-3.5 w-3.5 text-muted-foreground"}),e.jsx("code",{className:"min-w-0 flex-1 truncate text-[11px]",children:t.command}),e.jsx(U,{value:t.command})]})]})}function pe({notice:t,progress:s,relatedEntries:r,onUpdateProgress:i}){const{t:d}=x(),f=te();return t?e.jsxs("div",{className:"flex-1 min-w-0 bg-background grid grid-rows-[auto_minmax(0,1fr)] overflow-hidden",children:[e.jsxs("div",{className:"border-b bg-background px-4 py-3",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsx("h2",{className:"text-base font-semibold leading-tight",children:t.title}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t.summary})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[s&&e.jsx(D,{state:s}),e.jsx(Z,{status:t.status})]})]}),e.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[e.jsx(W,{className:"h-3.5 w-3.5"}),e.jsx("span",{children:d("updates.published",{date:O(t.publishedAt)})})]}),e.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[e.jsxs(u,{size:"sm",onClick:()=>i("done"),children:[e.jsx(H,{className:"h-4 w-4"}),d("updates.markDone")]}),e.jsxs(u,{size:"sm",variant:"outline",onClick:()=>i("dismissed"),children:[e.jsx(Q,{className:"h-4 w-4"}),d("updates.dismiss")]}),e.jsxs(u,{size:"sm",variant:"ghost",onClick:()=>i("new"),children:[e.jsx(G,{className:"h-4 w-4"}),d("updates.reopen")]})]})]}),e.jsx("div",{className:"min-h-0 p-4",children:e.jsxs("div",{className:"grid h-full gap-4 xl:grid-cols-[minmax(0,1.5fr)_minmax(320px,1fr)] overflow-hidden",children:[e.jsxs(C,{className:"h-full overflow-hidden",children:[e.jsxs(v,{className:"pb-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(K,{className:"h-4 w-4 text-primary"}),e.jsx(N,{className:"text-base",children:d("updates.doNext")})]}),e.jsx(w,{children:t.primaryAction})]}),e.jsx(j,{className:"min-h-0",children:e.jsx(b,{className:"h-full pr-2",children:e.jsx("div",{className:"space-y-3",children:t.actions.map(o=>e.jsx(ce,{action:o},`${t.id}-${o.id}`))})})})]}),e.jsxs("div",{className:"grid h-full grid-rows-[minmax(0,1fr)_minmax(0,1fr)] gap-4 overflow-hidden",children:[e.jsxs(C,{className:"overflow-hidden",children:[e.jsxs(v,{className:"pb-3",children:[e.jsx(N,{className:"text-base",children:d("updates.impactedIntegrations")}),e.jsx(w,{children:d("updates.impactedDesc")})]}),e.jsx(j,{className:"min-h-0",children:e.jsx(b,{className:"h-full pr-2",children:e.jsx("div",{className:"space-y-2",children:r.map(o=>e.jsxs("div",{className:"rounded-md border bg-muted/20 p-2.5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsx("p",{className:"min-w-0 truncate text-sm font-medium",children:o.name}),e.jsx(P,{variant:"outline",className:"h-5 px-1.5 text-[10px]",children:f[o.scope]})]}),e.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[o.routes[0]&&e.jsx(u,{size:"sm",variant:"outline",asChild:!0,children:e.jsx(L,{to:o.routes[0].path,children:o.routes[0].label})}),o.commands[0]&&e.jsxs("div",{className:"ml-auto flex min-w-0 items-center gap-1.5",children:[e.jsx("code",{className:"truncate rounded bg-background px-1.5 py-0.5 text-[11px]",children:o.commands[0]}),e.jsx(U,{value:o.commands[0]})]})]})]},o.id))})})})]}),e.jsxs(C,{className:"overflow-hidden",children:[e.jsxs(v,{className:"pb-3",children:[e.jsx(N,{className:"text-base",children:d("updates.whyMatters")}),e.jsx(w,{children:d("updates.whyMattersDesc")})]}),e.jsx(j,{className:"min-h-0",children:e.jsx(b,{className:"h-full pr-2",children:e.jsx("ul",{className:"space-y-2 text-sm text-muted-foreground",children:t.highlights.map(o=>e.jsxs("li",{children:["- ",o]},`${t.id}-${o}`))})})})]})]})]})})]}):e.jsx("div",{className:"flex h-full items-center justify-center rounded-lg border border-dashed bg-muted/20 p-6",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:d("updates.noUpdates")})})}function me({notice:t,progress:s,selected:r,onSelect:i}){return e.jsxs("button",{type:"button",onClick:i,className:S("w-full rounded-lg border px-3 py-3 text-left transition-colors",r?"border-primary/30 bg-primary/10":"border-transparent bg-background/40 hover:border-border hover:bg-muted/70"),children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsx("p",{className:"truncate text-sm font-medium",children:t.title}),e.jsx("p",{className:"line-clamp-2 text-xs text-muted-foreground",children:t.primaryAction})]}),e.jsx(q,{className:"mt-0.5 h-4 w-4 shrink-0 text-muted-foreground"})]}),e.jsxs("div",{className:"mt-2 flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-[11px] text-muted-foreground",children:O(t.publishedAt)}),e.jsx(D,{state:s})]})]})}function ue(t,s){return s?[t.title,t.summary,t.primaryAction,...t.highlights,...t.commands,...t.actions.map(i=>`${i.label} ${i.description} ${i.command||""}`),...t.routes.map(i=>i.label)].join(" ").toLowerCase().includes(s):!0}function je(){const{t}=x(),s=[...ae()].sort((a,n)=>n.publishedAt.localeCompare(a.publishedAt)),[r,i]=c.useState("inbox"),[d,f]=c.useState(""),[o,I]=c.useState(()=>le()),[k,E]=c.useState(null);c.useEffect(()=>{ne(o)},[o]);const h=c.useMemo(()=>{const a=d.trim().toLowerCase();return s.filter(n=>{const y=m(n,o);return ue(n,a)?r==="done"?y==="done":r==="inbox"?A(y):!0:!1})},[s,o,d,r]),p=c.useMemo(()=>{const a=r==="all"?s:h;return a.find(n=>n.id===k)??a[0]??null},[s,k,r,h]),R=a=>{E(a.id),I(n=>m(a,n)!=="new"?n:{...n,[a.id]:"seen"})},T=c.useMemo(()=>s.filter(a=>A(m(a,o))).length,[s,o]),_=c.useMemo(()=>s.filter(a=>m(a,o)==="done").length,[s,o]);return e.jsxs("div",{className:"flex h-full min-h-0 overflow-hidden",children:[e.jsxs("div",{className:"w-80 border-r bg-muted/30 flex flex-col overflow-hidden",children:[e.jsxs("div",{className:"p-4 border-b bg-background space-y-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(J,{className:"h-5 w-5 text-primary"}),e.jsx("h1",{className:"font-semibold",children:t("updates.inboxTitle")})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t("updates.inboxSubtitle")})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 text-xs",children:[e.jsxs("div",{className:"rounded-md border bg-background px-2 py-1.5",children:[e.jsx("p",{className:"text-muted-foreground",children:t("updates.needsAction")}),e.jsx("p",{className:"text-base font-semibold",children:T})]}),e.jsxs("div",{className:"rounded-md border bg-background px-2 py-1.5",children:[e.jsx("p",{className:"text-muted-foreground",children:t("updates.doneCount")}),e.jsx("p",{className:"text-base font-semibold",children:_})]})]}),e.jsxs("div",{className:"relative",children:[e.jsx(V,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),e.jsx(B,{value:d,onChange:a=>f(a.target.value),placeholder:t("updates.searchPlaceholder"),className:"h-9 pl-8"})]}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:[{id:"inbox",label:t("updates.actionRequired")},{id:"done",label:t("updates.done")},{id:"all",label:t("updates.all")}].map(a=>e.jsx(u,{size:"sm",variant:r===a.id?"default":"outline",onClick:()=>i(a.id),children:a.label},a.id))})]}),e.jsx(b,{className:"flex-1",children:e.jsx("div",{className:"space-y-2 p-2",children:h.length===0?e.jsx("div",{className:"rounded-md border border-dashed p-3 text-xs text-muted-foreground",children:t("updates.noNotices")}):h.map(a=>e.jsx(me,{notice:a,progress:m(a,o),selected:p?.id===a.id,onSelect:()=>R(a)},a.id))})})]}),e.jsx(pe,{notice:p,progress:p?m(p,o):null,relatedEntries:p?ie(p):[],onUpdateProgress:a=>{p&&I(n=>({...n,[p.id]:a}))}})]})}export{je as UpdatesPage};