cogpit 3.5.0 → 3.5.1

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 (28) hide show
  1. package/dist/cli-runtime.js +1462 -260
  2. package/dist/instance-worker.js +3 -3
  3. package/dist/web/assets/{CogpitBlock-Ku77iAFz.js → CogpitBlock-ZgOubpsS.js} +1 -1
  4. package/dist/web/assets/{CommandPaletteHost-CjZO-FyZ.js → CommandPaletteHost-Djn2jqYR.js} +1 -1
  5. package/dist/web/assets/{ConfigBrowser-B6jQRpcW.js → ConfigBrowser-CRwh8BXq.js} +1 -1
  6. package/dist/web/assets/{CrewPanel-DvHboAAW.js → CrewPanel-BxPl5D7h.js} +1 -1
  7. package/dist/web/assets/{HighlightedEditor-5NbcDE8n.js → HighlightedEditor-D9A-dW2Z.js} +1 -1
  8. package/dist/web/assets/{KeyboardShortcutsDialog-yO3h4xr-.js → KeyboardShortcutsDialog-L7rRhApI.js} +1 -1
  9. package/dist/web/assets/{MissionHome-CZpQbWs3.js → MissionHome-zp7VebSO.js} +2 -2
  10. package/dist/web/assets/{MobileFileChanges-DERAdWVc.js → MobileFileChanges-O-SvMq9F.js} +1 -1
  11. package/dist/web/assets/{PluginsDialog-DusZU8fA.js → PluginsDialog-CBOyfoUX.js} +1 -1
  12. package/dist/web/assets/{PreviewPanel-BpCD0UAz.js → PreviewPanel-_pKuUaps.js} +1 -1
  13. package/dist/web/assets/{ProjectFilesPanel-CPHWyVwU.js → ProjectFilesPanel-BsbpTgWK.js} +1 -1
  14. package/dist/web/assets/{ProjectSwitcherModal-BmYW6es0.js → ProjectSwitcherModal-D4MzdPVH.js} +1 -1
  15. package/dist/web/assets/{TerminalOutput-4YZ5J0ny.js → TerminalOutput-DOX29EmA.js} +1 -1
  16. package/dist/web/assets/{ThemeSelectorModal-CHFAl7zz.js → ThemeSelectorModal-7CWXZB-z.js} +1 -1
  17. package/dist/web/assets/{WorkflowsPanel-B6whBEyJ.js → WorkflowsPanel-aOz1o3kA.js} +1 -1
  18. package/dist/web/assets/{WorktreePanel-ASvzuwqm.js → WorktreePanel-BFve9bpC.js} +1 -1
  19. package/dist/web/assets/{edition-ui-DZ5m565z.js → edition-ui-CFxEM3WF.js} +1 -1
  20. package/dist/web/assets/{index-BFA_YkUM.js → index-By5-_P50.js} +1 -1
  21. package/dist/web/assets/{index-yM7CTfeg.js → index-CPTFl4Qh.js} +13 -13
  22. package/dist/web/assets/index-DjpYbGVZ.js +2 -0
  23. package/dist/web/assets/{index-D262IRnL.js → index-DmMg-zf3.js} +1 -1
  24. package/dist/web/assets/{switch-BBkU1zqg.js → switch-DS7UyNS2.js} +1 -1
  25. package/dist/web/assets/{vendor-ui-DkzcTXCS.js → vendor-ui-DQeMoSiV.js} +195 -190
  26. package/dist/web/index.html +2 -2
  27. package/package.json +1 -1
  28. package/dist/web/assets/index-C9bzBC6T.js +0 -2
@@ -14,9 +14,9 @@
14
14
  .dark body { background: var(--canvas, #09090b); color: var(--foreground, #fafafa); }
15
15
  body { background: var(--canvas, #fafafa); color: var(--foreground, #09090b); }
16
16
  </style>
17
- <script type="module" crossorigin src="/assets/index-yM7CTfeg.js"></script>
17
+ <script type="module" crossorigin src="/assets/index-CPTFl4Qh.js"></script>
18
18
  <link rel="modulepreload" crossorigin href="/assets/vendor-react-gGw_S5I_.js">
19
- <link rel="modulepreload" crossorigin href="/assets/vendor-ui-DkzcTXCS.js">
19
+ <link rel="modulepreload" crossorigin href="/assets/vendor-ui-DQeMoSiV.js">
20
20
  <link rel="modulepreload" crossorigin href="/assets/vendor-markdown-BE1gYnO9.js">
21
21
  <link rel="modulepreload" crossorigin href="/assets/vendor-shiki-DOn6sF-i.js">
22
22
  <link rel="stylesheet" crossorigin href="/assets/index-hGMtuUNI.css">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cogpit",
3
- "version": "3.5.0",
3
+ "version": "3.5.1",
4
4
  "description": "Run Cogpit's local Claude Code, Codex, and GitHub Copilot CLI interface without installing it",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/PluginsDialog-DusZU8fA.js","assets/vendor-react-gGw_S5I_.js","assets/index-yM7CTfeg.js","assets/vendor-ui-DkzcTXCS.js","assets/vendor-shiki-DOn6sF-i.js","assets/vendor-markdown-BE1gYnO9.js","assets/index-hGMtuUNI.css"])))=>i.map(i=>d[i]);
2
- import{C as Z,b6 as re,b7 as V,m as pt,n as gt,I as jt,E as It,G as Pt,b8 as zt,B as le,b9 as bt,J as dt,U as Le,ba as vt,a0 as wt,a1 as Nt,a4 as St,bb as ot,bc as yt,Z as lt,bd as Dt,at as Lt,au as Rt,be as Ot,bf as Ct,bg as Ft,i as Ut,j as Bt,k as Mt,bh as Gt,z as Ht,aL as Vt,h as Wt,D as Xt}from"./index-yM7CTfeg.js";import{c as ae,j as t,r as p}from"./vendor-react-gGw_S5I_.js";import{S as qt}from"./switch-BBkU1zqg.js";import{aa as Kt,ab as Jt,d as Zt,T as Qt,M as Yt,ac as es,ad as ts,ae as ss,a5 as kt,C as _t,af as ut,ag as ns,n as is,z as ls,ah as as,I as rs,ai as os,aj as cs}from"./vendor-ui-DkzcTXCS.js";import{P as mt}from"./password-BV9mqUzz.js";import"./vendor-shiki-DOn6sF-i.js";import"./vendor-markdown-BE1gYnO9.js";function ds(s){const e=ae.c(3),{name:n}=s,i=n.toLowerCase();if(i.includes("iphone")||i.includes("android")){let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Zt,{"data-icon":"inline-start",className:"size-4 text-muted-foreground"}),e[0]=r):r=e[0],r}if(i.includes("ipad")||i.includes("tablet")){let r;return e[1]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Qt,{"data-icon":"inline-start",className:"size-4 text-muted-foreground"}),e[1]=r):r=e[1],r}let l;return e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(Yt,{"data-icon":"inline-start",className:"size-4 text-muted-foreground"}),e[2]=l):l=e[2],l}function ct(s){const e=Math.floor((Date.now()-s)/1e3);if(e<60)return"just now";const n=Math.floor(e/60);if(n<60)return`${n}m ago`;const i=Math.floor(n/60);return i<24?`${i}h ago`:`${Math.floor(i/24)}d ago`}function us(s){const e=[`Shared ${ct(s.createdAt)}`,s.lastAccessAt>0?`opened ${ct(s.lastAccessAt)}`:"never opened"];return s.guests>0&&e.push(s.guests===1?"1 guest":`${s.guests} guests`),e.join(" · ")}function ms(){const s=ae.c(12),{shares:e,revoke:n,revokeAll:i}=zt();let l;s[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("p",{className:"text-xs text-muted-foreground",children:"Shared sessions"}),s[0]=l):l=s[0];let r;s[1]!==i||s[2]!==e.length?(r=e.length>0&&t.jsx(le,{variant:"ghost",size:"xs",className:"text-destructive hover:text-destructive",onClick:()=>void i(),children:"Revoke all"}),s[1]=i,s[2]=e.length,s[3]=r):r=s[3];let a;s[4]!==r?(a=t.jsxs("div",{className:"flex h-6 items-center justify-between",children:[l,r]}),s[4]=r,s[5]=a):a=s[5];let g;s[6]!==n||s[7]!==e?(g=e.length===0?t.jsx("p",{className:"text-xs text-muted-foreground",children:"No sessions are shared."}):t.jsx("div",{className:"flex flex-col gap-1.5",children:e.map(o=>{const m=o.title||o.sessionId;return t.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-lg border px-3 py-2",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"truncate text-sm text-foreground",children:m}),t.jsx("p",{className:"text-xs text-muted-foreground",children:us(o)})]}),t.jsx(le,{variant:"ghost",size:"xs","aria-label":`Revoke share of ${m}`,className:"text-destructive hover:text-destructive",onClick:()=>void n(o.sessionId),children:"Revoke"})]},o.sessionId)})}),s[6]=n,s[7]=e,s[8]=g):g=s[8];let c;return s[9]!==a||s[10]!==g?(c=t.jsxs("div",{className:"flex flex-col gap-2",children:[a,g]}),s[9]=a,s[10]=g,s[11]=c):c=s[11],c}function fs(s){const e=ae.c(30),{networkAccess:n,setNetworkAccess:i,networkPassword:l,setNetworkPassword:r,showNetworkPassword:a,setShowNetworkPassword:g,hasExistingPassword:c,initialNetworkAccess:o,connectedDevices:m,minPasswordLength:w}=s;let h;e[0]!==n?(h=n?t.jsx(es,{"data-icon":"inline-start",className:"size-4 text-success"}):t.jsx(ts,{"data-icon":"inline-start",className:"size-4 text-muted-foreground"}),e[0]=n,e[1]=h):h=e[1];let v;e[2]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsxs("div",{children:[t.jsx("p",{className:"text-sm font-medium text-foreground",children:"Network Access"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Allow other devices to connect"})]}),e[2]=v):v=e[2];let C;e[3]!==h?(C=t.jsxs("div",{className:"flex items-center gap-2",children:[h,v]}),e[3]=h,e[4]=C):C=e[4];let _;e[5]!==i?(_=j=>i(j),e[5]=i,e[6]=_):_=e[6];let N;e[7]!==n||e[8]!==_?(N=t.jsx(qt,{"aria-label":"Network Access",checked:n,onCheckedChange:_}),e[7]=n,e[8]=_,e[9]=N):N=e[9];let S;e[10]!==C||e[11]!==N?(S=t.jsxs("div",{className:"flex items-center justify-between",children:[C,N]}),e[10]=C,e[11]=N,e[12]=S):S=e[12];let f;e[13]!==c||e[14]!==w||e[15]!==n||e[16]!==l||e[17]!==r||e[18]!==g||e[19]!==a?(f=n&&t.jsxs(Z,{"data-invalid":l.length>0&&l.length<w,children:[t.jsx(re,{htmlFor:"network-password",children:"Password"}),t.jsx(V,{children:c&&l.length===0?"A password is already set. Leave blank to keep it.":`Use at least ${w} characters.`}),t.jsxs(pt,{children:[t.jsx(gt,{id:"network-password",type:a?"text":"password",value:l,onChange:j=>r(j.target.value),placeholder:c?"Enter new password to change":"Set a password for remote access"}),t.jsx(jt,{align:"inline-end",children:t.jsx(It,{size:"icon-xs","aria-label":a?"Hide password":"Show password",onClick:()=>g(!a),children:a?t.jsx(Kt,{"data-icon":"inline-start"}):t.jsx(Jt,{"data-icon":"inline-start"})})})]}),l.length>0&&l.length<w&&t.jsxs(Pt,{children:["Password must be at least ",w," characters (",l.length,"/",w,")"]}),t.jsx(V,{children:"Requires app restart. Remote browsers need an HTTPS reverse proxy; port 19384 remains available to Cogpit hubs and device clients."})]}),e[13]=c,e[14]=w,e[15]=n,e[16]=l,e[17]=r,e[18]=g,e[19]=a,e[20]=f):f=e[20];let x;e[21]!==m||e[22]!==o||e[23]!==n?(x=n&&o&&m.length>0&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("p",{className:"text-xs text-muted-foreground",children:"Connected devices"}),t.jsx("div",{className:"flex flex-col gap-1.5",children:m.map(hs)})]}),e[21]=m,e[22]=o,e[23]=n,e[24]=x):x=e[24];let y;e[25]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(ms,{}),e[25]=y):y=e[25];let k;return e[26]!==S||e[27]!==f||e[28]!==x?(k=t.jsxs("div",{className:"flex flex-col gap-4 border-t pt-5",children:[S,f,x,y]}),e[26]=S,e[27]=f,e[28]=x,e[29]=k):k=e[29],k}function hs(s,e){return t.jsxs("div",{className:"flex items-center justify-between rounded-lg border px-3 py-2",children:[t.jsxs("div",{className:"flex items-center gap-2.5",children:[t.jsx(ds,{name:s.deviceName}),t.jsxs("div",{children:[t.jsx("p",{className:"text-sm text-foreground",children:s.deviceName}),t.jsx("p",{className:"text-xs text-muted-foreground",children:s.ip})]})]}),t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx("span",{className:"size-1.5 rounded-full bg-success"}),t.jsx("span",{className:"text-xs text-muted-foreground",children:ct(s.lastActivity)})]})]},`${s.ip}-${e}`)}const xs=["auto","path","npm","bundled","custom"],at={source:"auto"},ps=["path","npm","bundled"];function gs(s){return xs.includes(s)}function js(s){if(!s||typeof s!="object")return;const{source:e,path:n}=s;if(!(!gs(e)||e==="auto"))return e==="custom"?typeof n=="string"&&n.trim()?{source:e,path:n.trim()}:void 0:{source:e}}const De={auto:"Automatic",path:"Installed on PATH",npm:"Global npm install",bundled:"Bundled with Cogpit",custom:"Custom path"};function Et(s,e){return e?`v${e} · ${s}`:s}function bs(s,e){return s===null?"Checking installed binaries…":e?e.version===null?`${e.path} did not report a version — check the path.`:`Now running: ${Et(e.path,e.version)}`:"No launchable binary for the saved choice — sessions cannot start."}function vs(s){return s!==null&&s.version!==null}function ws(s){const e=ae.c(92),{kind:n,value:i,onChange:l,disabled:r,reportVersion:a}=s;let g;e[0]!==n?(g=bt(n),e[0]=n,e[1]=g):g=e[1];const{displayName:c}=g,[o,m]=p.useState(null),[w,h]=p.useState(!1),v=`agent-executable-${n}`;let C;e[2]!==n?(C=()=>{let se=!1;return Le(`/api/agent-executable/${n}`).then(ys).then(G=>{se||m(G)}).catch(Ss),()=>{se=!0}},e[2]=n,e[3]=C):C=e[3];let _;e[4]!==n||e[5]!==a?(_=[n,a],e[4]=n,e[5]=a,e[6]=_):_=e[6],p.useEffect(C,_);let N,S,f,x,y,k,j,T,b,I,E,D,u;if(e[7]!==r||e[8]!==c||e[9]!==v||e[10]!==l||e[11]!==w||e[12]!==(o==null?void 0:o.active)||e[13]!==(o==null?void 0:o.candidates)||e[14]!==i.path||e[15]!==i.source){const se=new Map((o==null?void 0:o.candidates.map(Ns))??[]);x=(o==null?void 0:o.active)??null;let G;e[29]!==r||e[30]!==v||e[31]!==l||e[32]!==i.path||e[33]!==i.source?(G=(z,F,ce,de)=>{const ue=de===void 0?!0:de,J=`${v}-${z}`;return t.jsxs(Z,{orientation:"horizontal",children:[t.jsx("input",{type:"radio",id:J,name:v,className:"mt-1 size-4 shrink-0 accent-primary",checked:i.source===z,disabled:r||!ue,onChange:()=>l(z==="custom"?{source:z,path:i.path??""}:{source:z})}),t.jsxs(vt,{children:[t.jsx(re,{htmlFor:J,children:F}),t.jsx(V,{className:"break-all",children:ce})]})]},z)},e[29]=r,e[30]=v,e[31]=l,e[32]=i.path,e[33]=i.source,e[34]=G):G=e[34],y=G;const st=z=>{const F=se.get(z);return y(z,De[z],F?Et(F.path,F.version):"Not found on this machine.",F!==void 0||i.source===z)},L=x?`${De[i.source]} · v${x.version??"?"}`:De[i.source];f=wt,D=w,u=h,k="flex flex-col gap-2";let oe;e[35]===Symbol.for("react.memo_cache_sentinel")?(oe=t.jsx(le,{type:"button",variant:"ghost",className:"h-auto w-full justify-between px-0 font-medium hover:bg-transparent"}),e[35]=oe):oe=e[35];let R;e[36]===Symbol.for("react.memo_cache_sentinel")?(R=t.jsx(ss,{"data-icon":"inline-start",className:"size-4 text-muted-foreground"}),e[36]=R):R=e[36];let ne;e[37]!==c?(ne=t.jsxs("span",{className:"flex items-center gap-2",children:[R,c," executable"]}),e[37]=c,e[38]=ne):ne=e[38];let O;e[39]!==L?(O=t.jsx("span",{className:"truncate",children:L}),e[39]=L,e[40]=O):O=e[40];let H;e[41]!==w?(H=w?t.jsx(kt,{className:"size-4 shrink-0"}):t.jsx(_t,{className:"size-4 shrink-0"}),e[41]=w,e[42]=H):H=e[42];let K;e[43]!==O||e[44]!==H?(K=t.jsxs("span",{className:"flex min-w-0 items-center gap-1 text-xs font-normal text-muted-foreground",children:[O,H]}),e[43]=O,e[44]=H,e[45]=K):K=e[45],e[46]!==ne||e[47]!==K?(j=t.jsxs(Nt,{render:oe,children:[ne,K]}),e[46]=ne,e[47]=K,e[48]=j):j=e[48],S=St,N=Z,e[49]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(V,{children:"Which binary new sessions run. Automatic uses your installed CLI unless it is older than the copy bundled with Cogpit."}),e[49]=E):E=e[49],T="flex flex-col gap-2 pl-1",e[50]!==y?(b=y("auto",De.auto,"Recommended."),e[50]=y,e[51]=b):b=e[51],I=ps.map(st),e[7]=r,e[8]=c,e[9]=v,e[10]=l,e[11]=w,e[12]=o==null?void 0:o.active,e[13]=o==null?void 0:o.candidates,e[14]=i.path,e[15]=i.source,e[16]=N,e[17]=S,e[18]=f,e[19]=x,e[20]=y,e[21]=k,e[22]=j,e[23]=T,e[24]=b,e[25]=I,e[26]=E,e[27]=D,e[28]=u}else N=e[16],S=e[17],f=e[18],x=e[19],y=e[20],k=e[21],j=e[22],T=e[23],b=e[24],I=e[25],E=e[26],D=e[27],u=e[28];const Q=`${c} executable path`,U=i.source==="custom"?i.path??"":"",ze=r||i.source!=="custom";let P;e[52]!==l?(P=se=>l({source:"custom",path:se.target.value}),e[52]=l,e[53]=P):P=e[53];let W;e[54]!==Q||e[55]!==U||e[56]!==ze||e[57]!==P?(W=t.jsx(ot,{"aria-label":Q,value:U,placeholder:"/path/to/binary",disabled:ze,onChange:P,className:"mt-1"}),e[54]=Q,e[55]=U,e[56]=ze,e[57]=P,e[58]=W):W=e[58];let B;e[59]!==y||e[60]!==W?(B=y("custom",De.custom,W),e[59]=y,e[60]=W,e[61]=B):B=e[61];let Y;e[62]!==B||e[63]!==T||e[64]!==b||e[65]!==I?(Y=t.jsxs("div",{className:T,children:[b,I,B]}),e[62]=B,e[63]=T,e[64]=b,e[65]=I,e[66]=Y):Y=e[66];let A;e[67]!==x?(A=vs(x)?"text-muted-foreground":"text-destructive",e[67]=x,e[68]=A):A=e[68];let X;e[69]!==A?(X=dt("text-xs",A),e[69]=A,e[70]=X):X=e[70];let M;e[71]!==x||e[72]!==o?(M=bs(o,x),e[71]=x,e[72]=o,e[73]=M):M=e[73];let ee;e[74]!==X||e[75]!==M?(ee=t.jsx("p",{className:X,"aria-live":"polite",children:M}),e[74]=X,e[75]=M,e[76]=ee):ee=e[76];let $;e[77]!==N||e[78]!==Y||e[79]!==ee||e[80]!==E?($=t.jsxs(N,{children:[E,Y,ee]}),e[77]=N,e[78]=Y,e[79]=ee,e[80]=E,e[81]=$):$=e[81];let q;e[82]!==S||e[83]!==$?(q=t.jsx(S,{children:$}),e[82]=S,e[83]=$,e[84]=q):q=e[84];let te;return e[85]!==f||e[86]!==k||e[87]!==j||e[88]!==q||e[89]!==D||e[90]!==u?(te=t.jsxs(f,{open:D,onOpenChange:u,className:k,children:[j,q]}),e[85]=f,e[86]=k,e[87]=j,e[88]=q,e[89]=D,e[90]=u,e[91]=te):te=e[91],te}function Ns(s){return[s.source,s]}function Ss(){}function ys(s){return s.ok?s.json():null}function At(s){return s instanceof Error?s.message:String(s)}async function ft(s){try{const e=await Le(`/api/agent-accounts/${s}`);return e.status===404?{status:"missing"}:e.ok?await e.json():{status:"error",error:await yt(e,`Request failed (${e.status})`)}}catch(e){return{status:"error",error:At(e)}}}function Cs(s){const[e,n]=p.useState(null),[i,l]=p.useState(null),[r,a]=p.useState(null);p.useEffect(()=>{let c=!1;return ft(s).then(o=>{c||n(o)}),()=>{c=!0}},[s]);const g=p.useCallback(async c=>{l(c),a(null);try{const o=await Le(`/api/agent-accounts/${s}/switch`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({slot:c})});if(!o.ok){a({kind:"failed",error:await yt(o,`Request failed (${o.status})`)});return}a({kind:"switched",result:await o.json()}),n(await ft(s))}catch(o){a({kind:"failed",error:At(o)})}finally{l(null)}},[s]);return{report:e,switchingSlot:i,outcome:r,switchTo:g}}const ks={token_expired:"Token expired",relogin_required:"Login needed",no_credentials:"No credentials",keychain_unavailable:"Keychain locked",foreign_credential:"Credential mismatch",api_key:"API key",unavailable:"Usage unavailable"};function rt(s){return s.alias??s.email}function ht(s){const e=ae.c(18),{label:n,window:i}=s;if(!i)return null;const l=i.pct>=80,r=i.resetsIn?`${n} window resets in ${i.resetsIn}`:void 0;let a;e[0]!==n?(a=t.jsx("span",{className:"w-5",children:n}),e[0]=n,e[1]=a):a=e[1];const g=l?"bg-destructive":"bg-primary";let c;e[2]!==g?(c=dt("absolute inset-y-0 left-0 rounded-full",g),e[2]=g,e[3]=c):c=e[3];const o=`${i.pct}%`;let m;e[4]!==o?(m={width:o},e[4]=o,e[5]=m):m=e[5];let w;e[6]!==c||e[7]!==m?(w=t.jsx("span",{className:"relative h-1 w-16 overflow-hidden rounded-full bg-muted",children:t.jsx("span",{className:c,style:m})}),e[6]=c,e[7]=m,e[8]=w):w=e[8];let h;e[9]!==i.pct?(h=Math.round(i.pct),e[9]=i.pct,e[10]=h):h=e[10];let v;e[11]!==h?(v=t.jsxs("span",{className:"tabular-nums",children:[h,"%"]}),e[11]=h,e[12]=v):v=e[12];let C;return e[13]!==r||e[14]!==a||e[15]!==w||e[16]!==v?(C=t.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",title:r,children:[a,w,v]}),e[13]=r,e[14]=a,e[15]=w,e[16]=v,e[17]=C):C=e[17],C}function xt(s){return/[.!?]$/.test(s)?s:`${s}.`}function _s(s,e){if(s.kind==="failed")return`Switch failed: ${s.error}`;const{result:n}=s,i=[xt(n.message)];return n.switched&&i.push(n.credentialStore==="keychain"?`Running ${e} sessions pick it up within about 30 seconds; restart one to apply it immediately.`:`New messages in ${e} use it from now on.`),[...i,...n.warnings.map(xt)].join(" ")}function Es(s){const e=ae.c(41),{kind:n,disabled:i}=s;let l;e[0]!==n?(l=bt(n),e[0]=n,e[1]=l):l=e[1];const{displayName:r}=l,{report:a,switchingSlot:g,outcome:c,switchTo:o}=Cs(n),[m,w]=p.useState(!1);if(a===null||a.status==="missing")return null;let h,v;if(e[2]!==a.accounts||e[3]!==a.status){h=a.status==="ok"?a.accounts:[];const u=h.find(As)??null;v=a.status==="error"?"Unavailable":u?`${rt(u)} · ${h.length} account${h.length===1?"":"s"}`:`${h.length} account${h.length===1?"":"s"}`,e[2]=a.accounts,e[3]=a.status,e[4]=h,e[5]=v}else h=e[4],v=e[5];const C=v;let _;e[6]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(le,{type:"button",variant:"ghost",className:"h-auto w-full justify-between px-0 font-medium hover:bg-transparent"}),e[6]=_):_=e[6];let N;e[7]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(ns,{"data-icon":"inline-start",className:"size-4 text-muted-foreground"}),e[7]=N):N=e[7];let S;e[8]!==r?(S=t.jsxs("span",{className:"flex items-center gap-2",children:[N,r," accounts"]}),e[8]=r,e[9]=S):S=e[9];let f;e[10]!==C?(f=t.jsx("span",{className:"truncate",children:C}),e[10]=C,e[11]=f):f=e[11];let x;e[12]!==m?(x=m?t.jsx(kt,{className:"size-4 shrink-0"}):t.jsx(_t,{className:"size-4 shrink-0"}),e[12]=m,e[13]=x):x=e[13];let y;e[14]!==f||e[15]!==x?(y=t.jsxs("span",{className:"flex min-w-0 items-center gap-1 text-xs font-normal text-muted-foreground",children:[f,x]}),e[14]=f,e[15]=x,e[16]=y):y=e[16];let k;e[17]!==S||e[18]!==y?(k=t.jsxs(Nt,{render:_,children:[S,y]}),e[17]=S,e[18]=y,e[19]=k):k=e[19];const j=a.status==="ok"&&`Logins managed by ${a.tool}${a.version?` ${a.version}`:""}. `;let T;e[20]!==r||e[21]!==j?(T=t.jsxs(V,{children:[j,"Switching changes which login ",r," sessions authenticate with."]}),e[20]=r,e[21]=j,e[22]=T):T=e[22];let b;e[23]!==h||e[24]!==i||e[25]!==a.error||e[26]!==a.status||e[27]!==o||e[28]!==g?(b=a.status==="error"?t.jsx("p",{className:"text-xs text-destructive",role:"alert",children:a.error}):t.jsx("ul",{className:"flex flex-col divide-y divide-border rounded-md border border-border",children:h.map(u=>{const Q=g===u.slot,U=ks[u.usageStatus];return t.jsxs("li",{className:"flex items-center gap-3 px-3 py-2",children:[t.jsx("span",{className:"w-5 shrink-0 text-xs tabular-nums text-muted-foreground",children:u.slot}),t.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[t.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1",children:[t.jsx("span",{className:"truncate text-sm font-medium",children:rt(u)}),u.alias&&t.jsx("span",{className:"truncate text-xs text-muted-foreground",children:u.email}),u.active&&t.jsx(lt,{children:"Active"}),u.disabled&&t.jsx(lt,{variant:"outline",children:"Disabled"}),U&&t.jsx(lt,{variant:"destructive",children:U})]}),u.organization&&t.jsx("span",{className:"truncate text-xs text-muted-foreground",children:u.organization}),u.usage&&t.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1",children:[t.jsx(ht,{label:"5h",window:u.usage.fiveHour}),t.jsx(ht,{label:"7d",window:u.usage.sevenDay})]})]}),!i&&!u.active&&t.jsx(le,{type:"button",size:"sm",variant:"outline",disabled:g!==null,onClick:()=>o(u.slot),"aria-label":`Switch to ${rt(u)}`,children:Q?t.jsxs(t.Fragment,{children:[t.jsx(ut,{"data-icon":"inline-start",className:"size-3.5 animate-spin"}),"Switching…"]}):"Switch"})]},u.slot)})}),e[23]=h,e[24]=i,e[25]=a.error,e[26]=a.status,e[27]=o,e[28]=g,e[29]=b):b=e[29];let I;e[30]!==r||e[31]!==c?(I=c&&t.jsx("p",{className:dt("text-xs",c.kind==="failed"?"text-destructive":"text-muted-foreground"),"aria-live":"polite",role:c.kind==="failed"?"alert":"status",children:_s(c,r)}),e[30]=r,e[31]=c,e[32]=I):I=e[32];let E;e[33]!==T||e[34]!==b||e[35]!==I?(E=t.jsx(St,{children:t.jsxs(Z,{children:[T,b,I]})}),e[33]=T,e[34]=b,e[35]=I,e[36]=E):E=e[36];let D;return e[37]!==m||e[38]!==E||e[39]!==k?(D=t.jsxs(wt,{open:m,onOpenChange:w,className:"flex flex-col gap-2",children:[k,E]}),e[37]=m,e[38]=E,e[39]=k,e[40]=D):D=e[40],D}function As(s){return s.active}const $s=p.lazy(()=>Ft(()=>import("./PluginsDialog-DusZU8fA.js"),__vite__mapDeps([0,1,2,3,4,5,6])).then(s=>({default:s.PluginsDialog}))),Ts=Ct().filter(s=>s.cli.bundledBySdk).map(s=>s.kind),Is=Ct().filter(s=>s.capabilities.accountSwitching).map(s=>s.kind);function Ps(s,e){return s.source===e.source&&(s.source!=="custom"||s.path===e.path)}function zs(s){const e=ae.c(5),{status:n,error:i}=s;if(n==="validating"){let l;return e[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[t.jsx(ut,{"data-icon":"inline-start",className:"size-3.5 animate-spin"}),"Checking path..."]}),e[0]=l):l=e[0],l}if(n==="valid"){let l;return e[1]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsxs("div",{className:"flex items-center gap-2 text-sm text-success",children:[t.jsx(os,{"data-icon":"inline-start",className:"size-3.5"}),"Valid .claude directory found"]}),e[1]=l):l=e[1],l}if(n==="invalid"&&i){let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(cs,{"data-icon":"inline-start",className:"size-3.5"}),e[2]=l):l=e[2];let r;return e[3]!==i?(r=t.jsxs("div",{className:"flex items-center gap-2 text-sm text-destructive",children:[l,i]}),e[3]=i,e[4]=r):r=e[4],r}return null}function qs(s){const e=ae.c(118),{open:n,currentPath:i,onClose:l,onSaved:r}=s,[a,g]=p.useState(i),[c,o]=p.useState(!1),{status:m,error:w,debouncedValidate:h,reset:v,save:C}=Dt();let _;e[0]===Symbol.for("react.memo_cache_sentinel")?(_=Lt(),e[0]=_):_=e[0];const N=_;let S;e[1]===Symbol.for("react.memo_cache_sentinel")?(S=Rt("configWrite"),e[1]=S):S=e[1];const f=S,[x,y]=p.useState(!1),k=Ot(n&&x&&f),[j,T]=p.useState(!1),[b,I]=p.useState(""),[E,D]=p.useState(!1),[u,Q]=p.useState(""),[U,ze]=p.useState(""),[P,W]=p.useState(""),[B,Y]=p.useState(""),[A,X]=p.useState(!1),[M,ee]=p.useState(!1),[$,q]=p.useState(at),[te,se]=p.useState(0),[G,st]=p.useState(at),[L,oe]=p.useState(!1),[R,ne]=p.useState(!1);let O;e[2]===Symbol.for("react.memo_cache_sentinel")?(O=[],e[2]=O):O=e[2];const[H,K]=p.useState(O);let z,F;e[3]!==i||e[4]!==n||e[5]!==v?(z=()=>{n&&(g(i),v(),Le("/api/config").then(Fs).then(d=>{const ie=(d==null?void 0:d.networkAccess)||!1;T(ie),oe(ie),ne(!!(d!=null&&d.networkPassword)),I("");const Qe=(d==null?void 0:d.terminalApp)||"";Q(Qe),ze(Qe);const Ye=(d==null?void 0:d.editorApp)||"";W(Ye),Y(Ye);const et=(d==null?void 0:d.useBuiltInEditor)===!0;X(et),ee(et);const tt=js(d==null?void 0:d.agentExecutable)??at;q(tt),st(tt),ie&&(d!=null&&d.networkPassword)&&!N?Le("/api/connected-devices").then(Os).then(Pe=>K((Pe==null?void 0:Pe.devices)||[])).catch(Rs):K([])}).catch(Ls))},F=[n,i,v,N],e[3]=i,e[4]=n,e[5]=v,e[6]=z,e[7]=F):(z=e[6],F=e[7]),p.useEffect(z,F);let ce;e[8]!==h?(ce=d=>{const ie=d.target.value;g(ie),h(ie)},e[8]=h,e[9]=ce):ce=e[9];const de=ce;let ue;e[10]!==$||e[11]!==P||e[12]!==L||e[13]!==j||e[14]!==b||e[15]!==r||e[16]!==a||e[17]!==C||e[18]!==u||e[19]!==A?(ue=async()=>{o(!0);const d=await C(a,{networkAccess:N?L:j,networkPassword:!N&&j&&b.length>0?b:void 0,terminalApp:u.trim()||void 0,editorApp:P.trim()||void 0,useBuiltInEditor:A,agentExecutable:$});d.success&&d.claudeDir&&(se(Ds),r(d.claudeDir)),o(!1)},e[10]=$,e[11]=P,e[12]=L,e[13]=j,e[14]=b,e[15]=r,e[16]=a,e[17]=C,e[18]=u,e[19]=A,e[20]=ue):ue=e[20];const J=ue;let Re;e[21]!==$||e[22]!==P||e[23]!==R||e[24]!==G||e[25]!==B||e[26]!==L||e[27]!==U||e[28]!==M||e[29]!==j||e[30]!==b||e[31]!==m||e[32]!==u||e[33]!==A?(Re=function(){var Pe;if(m==="validating"||m==="invalid")return!1;const ie=m==="valid",Qe=!N&&(j!==L||j&&b.length>0),Ye=u!==U,et=P!==B||A!==M,tt=!Ps($,G);if(!ie&&!Qe&&!Ye&&!et&&!tt||$.source==="custom"&&!((Pe=$.path)!=null&&Pe.trim()))return!1;if(!N&&j){const $t=b.length>0&&b.length<mt,Tt=!R&&b.length===0;if($t||Tt)return!1}return!0},e[21]=$,e[22]=P,e[23]=R,e[24]=G,e[25]=B,e[26]=L,e[27]=U,e[28]=M,e[29]=j,e[30]=b,e[31]=m,e[32]=u,e[33]=A,e[34]=Re):Re=e[34];const me=Re();let fe;e[35]!==l?(fe=d=>{d||l()},e[35]=l,e[36]=fe):fe=e[36];let Oe;e[37]===Symbol.for("react.memo_cache_sentinel")?(Oe=t.jsxs(Ut,{children:[t.jsx(Bt,{className:"text-foreground",children:"Configuration"}),t.jsx(Mt,{className:"text-muted-foreground",children:"Manage local paths, preferred apps, and remote access."})]}),e[37]=Oe):Oe=e[37];let Fe;e[38]===Symbol.for("react.memo_cache_sentinel")?(Fe=f&&t.jsxs(Z,{children:[t.jsx(re,{children:"Plugins"}),t.jsx(V,{children:"Manage installed plugins, their settings, and service connections."}),t.jsx(le,{type:"button",variant:"outline",onClick:()=>y(!0),children:"Manage plugins"})]}),e[38]=Fe):Fe=e[38];let Ue,Be;e[39]===Symbol.for("react.memo_cache_sentinel")?(Ue=t.jsx(re,{htmlFor:"claude-directory",children:"Claude directory"}),Be=t.jsx(V,{children:"The directory containing your Claude configuration."}),e[39]=Ue,e[40]=Be):(Ue=e[39],Be=e[40]);let Me;e[41]===Symbol.for("react.memo_cache_sentinel")?(Me=t.jsx(jt,{children:t.jsx(is,{"data-icon":"inline-start"})}),e[41]=Me):Me=e[41];let he;e[42]!==me||e[43]!==J||e[44]!==c?(he=d=>{d.key==="Enter"&&me&&!c&&J()},e[42]=me,e[43]=J,e[44]=c,e[45]=he):he=e[45];let xe;e[46]!==de||e[47]!==a||e[48]!==he?(xe=t.jsxs(pt,{children:[Me,t.jsx(gt,{id:"claude-directory",value:a,onChange:de,placeholder:"/Users/you/.claude",disabled:!f,onKeyDown:he})]}),e[46]=de,e[47]=a,e[48]=he,e[49]=xe):xe=e[49];let pe;e[50]!==w||e[51]!==m?(pe=t.jsx("div",{"aria-live":"polite",children:t.jsx(zs,{status:m,error:w})}),e[50]=w,e[51]=m,e[52]=pe):pe=e[52];let ge;e[53]!==xe||e[54]!==pe?(ge=t.jsxs(Z,{children:[Ue,Be,xe,pe]}),e[53]=xe,e[54]=pe,e[55]=ge):ge=e[55];let Ge,He;e[56]===Symbol.for("react.memo_cache_sentinel")?(Ge=t.jsxs(re,{htmlFor:"terminal-application",children:[t.jsx(ls,{"data-icon":"inline-start",className:"size-4 text-muted-foreground"}),"Terminal application"]}),He=t.jsx(V,{children:"Leave blank to use the system default for Ctrl+Cmd+T."}),e[56]=Ge,e[57]=He):(Ge=e[56],He=e[57]);let Ve;e[58]===Symbol.for("react.memo_cache_sentinel")?(Ve=d=>Q(d.target.value),e[58]=Ve):Ve=e[58];let je;e[59]!==u?(je=t.jsxs(Z,{children:[Ge,He,t.jsx(ot,{id:"terminal-application",value:u,onChange:Ve,placeholder:"Ghostty, iTerm, or /path/to/binary",disabled:!f})]}),e[59]=u,e[60]=je):je=e[60];let We;e[61]===Symbol.for("react.memo_cache_sentinel")?(We=d=>X(d===!0),e[61]=We):We=e[61];let be;e[62]!==A?(be=t.jsx(Gt,{id:"use-built-in-editor",checked:A,onCheckedChange:We,disabled:!f}),e[62]=A,e[63]=be):be=e[63];let Xe;e[64]===Symbol.for("react.memo_cache_sentinel")?(Xe=t.jsxs(vt,{children:[t.jsxs(re,{htmlFor:"use-built-in-editor",children:[t.jsx(as,{"data-icon":"inline-start",className:"size-4 text-muted-foreground"}),"Open files in Cogpit"]}),t.jsx(V,{children:"Files and diffs open in Cogpit’s file workspace instead of launching an external editor."})]}),e[64]=Xe):Xe=e[64];let ve;e[65]!==be?(ve=t.jsxs(Z,{orientation:"horizontal",children:[be,Xe]}),e[65]=be,e[66]=ve):ve=e[66];let qe;e[67]===Symbol.for("react.memo_cache_sentinel")?(qe=t.jsxs(re,{htmlFor:"editor-application",children:[t.jsx(rs,{"data-icon":"inline-start",className:"size-4 text-muted-foreground"}),"Editor application"]}),e[67]=qe):qe=e[67];const nt=A?"Not used while files open in Cogpit.":"Leave blank to use $VISUAL or automatic detection.";let we;e[68]!==nt?(we=t.jsx(V,{children:nt}),e[68]=nt,e[69]=we):we=e[69];let Ke;e[70]===Symbol.for("react.memo_cache_sentinel")?(Ke=d=>W(d.target.value),e[70]=Ke):Ke=e[70];const it=!f||A;let Ne;e[71]!==P||e[72]!==it?(Ne=t.jsx(ot,{id:"editor-application",value:P,onChange:Ke,placeholder:"cursor, code, zed, or /path/to/binary",disabled:it}),e[71]=P,e[72]=it,e[73]=Ne):Ne=e[73];let Se;e[74]!==we||e[75]!==Ne?(Se=t.jsxs(Z,{children:[qe,we,Ne]}),e[74]=we,e[75]=Ne,e[76]=Se):Se=e[76];let ye;e[77]!==$||e[78]!==te?(ye=Ts.map(d=>t.jsx(ws,{kind:d,value:$,onChange:q,disabled:!f,reportVersion:te},d)),e[77]=$,e[78]=te,e[79]=ye):ye=e[79];let Je;e[80]===Symbol.for("react.memo_cache_sentinel")?(Je=Is.map(d=>t.jsx(Es,{kind:d,disabled:!f},d)),e[80]=Je):Je=e[80];let Ce;e[81]!==H||e[82]!==R||e[83]!==L||e[84]!==j||e[85]!==b||e[86]!==E?(Ce=!N&&f&&t.jsx(fs,{networkAccess:j,setNetworkAccess:T,networkPassword:b,setNetworkPassword:I,showNetworkPassword:E,setShowNetworkPassword:D,hasExistingPassword:R,initialNetworkAccess:L,connectedDevices:H,minPasswordLength:mt}),e[81]=H,e[82]=R,e[83]=L,e[84]=j,e[85]=b,e[86]=E,e[87]=Ce):Ce=e[87];let ke;e[88]!==ge||e[89]!==je||e[90]!==ve||e[91]!==Se||e[92]!==ye||e[93]!==Ce?(ke=t.jsxs(Ht,{children:[Fe,ge,je,ve,Se,ye,Je,Ce]}),e[88]=ge,e[89]=je,e[90]=ve,e[91]=Se,e[92]=ye,e[93]=Ce,e[94]=ke):ke=e[94];let _e;e[95]!==l?(_e=t.jsx(le,{variant:"outline",onClick:l,children:"Cancel"}),e[95]=l,e[96]=_e):_e=e[96];let Ee;e[97]!==me||e[98]!==J||e[99]!==c?(Ee=f&&t.jsx(le,{disabled:!me||c,onClick:J,children:c?t.jsxs(t.Fragment,{children:[t.jsx(ut,{"data-icon":"inline-start",className:"size-4 animate-spin"}),"Saving..."]}):"Save"}),e[97]=me,e[98]=J,e[99]=c,e[100]=Ee):Ee=e[100];let Ae;e[101]!==_e||e[102]!==Ee?(Ae=t.jsxs(Vt,{children:[_e,Ee]}),e[101]=_e,e[102]=Ee,e[103]=Ae):Ae=e[103];let $e;e[104]!==ke||e[105]!==Ae?($e=t.jsxs(Wt,{className:"max-h-[calc(100dvh-2rem)] overflow-y-auto sm:max-w-lg",children:[Oe,ke,Ae]}),e[104]=ke,e[105]=Ae,e[106]=$e):$e=e[106];let Te;e[107]!==n||e[108]!==$e||e[109]!==fe?(Te=t.jsx(Xt,{open:n,onOpenChange:fe,children:$e}),e[107]=n,e[108]=$e,e[109]=fe,e[110]=Te):Te=e[110];let Ie;e[111]!==n||e[112]!==x||e[113]!==k?(Ie=n&&x&&f&&t.jsx(p.Suspense,{fallback:null,children:t.jsx($s,{client:k.client,state:k,currentPath:null,onClose:()=>y(!1)})}),e[111]=n,e[112]=x,e[113]=k,e[114]=Ie):Ie=e[114];let Ze;return e[115]!==Te||e[116]!==Ie?(Ze=t.jsxs(t.Fragment,{children:[Te,Ie]}),e[115]=Te,e[116]=Ie,e[117]=Ze):Ze=e[117],Ze}function Ds(s){return s+1}function Ls(){}function Rs(){}function Os(s){return s.json()}function Fs(s){return s.json()}export{qs as ConfigDialog};