cogpit 2.1.3 → 2.3.0

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 (33) hide show
  1. package/dist/cli.js +1603 -773
  2. package/dist/web/assets/CommandPaletteHost-D-VvT_HL.js +1 -0
  3. package/dist/web/assets/ConfigBrowser-Cc2lrh85.js +1 -0
  4. package/dist/web/assets/{HighlightedEditor-qhEWgnBF.js → HighlightedEditor-DWNz1Jcz.js} +2 -2
  5. package/dist/web/assets/{KeyboardShortcutsDialog-B9nMtf5U.js → KeyboardShortcutsDialog-yOs1u5D6.js} +1 -1
  6. package/dist/web/assets/{MobileFileChanges-j9DCxvz6.js → MobileFileChanges-B1dtcdSZ.js} +1 -1
  7. package/dist/web/assets/PreviewPanel-BJwfunf9.js +1 -0
  8. package/dist/web/assets/ProjectFilesPanel-DppuIFEt.js +4 -0
  9. package/dist/web/assets/{ProjectSwitcherModal-o8NhzySH.js → ProjectSwitcherModal-DgsuH5CY.js} +1 -1
  10. package/dist/web/assets/{TerminalOutput-CcWkSv29.js → TerminalOutput-DlGDS0Wx.js} +1 -1
  11. package/dist/web/assets/ThemeSelectorModal-oI9Vm3EH.js +1 -0
  12. package/dist/web/assets/WorkflowsPanel-SKbsv_IK.js +1 -0
  13. package/dist/web/assets/WorktreePanel-CcSLupr7.js +1 -0
  14. package/dist/web/assets/{index-_0HhakEy.js → index-7FuVzOBC.js} +4 -4
  15. package/dist/web/assets/index-BVkjlOVU.js +1 -0
  16. package/dist/web/assets/index-Bw-DFQut.js +1 -0
  17. package/dist/web/assets/index-Du17HzQD.js +151 -0
  18. package/dist/web/assets/index-xdv0cIL2.css +1 -0
  19. package/dist/web/assets/{session-parser.worker-DycJL0jJ.js → session-parser.worker-RMitC4X_.js} +17 -17
  20. package/dist/web/assets/{vendor-ui-Bg9q4lA4.js → vendor-ui-CdA11Wfh.js} +162 -147
  21. package/dist/web/index.html +3 -3
  22. package/package.json +1 -1
  23. package/dist/web/assets/CommandPaletteHost-1UPdv9Nv.js +0 -1
  24. package/dist/web/assets/ConfigBrowser-B5lZsJDw.js +0 -1
  25. package/dist/web/assets/PreviewPanel-DZSVN3mt.js +0 -1
  26. package/dist/web/assets/ProjectFilesPanel-DSvO4CrB.js +0 -4
  27. package/dist/web/assets/ThemeSelectorModal-CnbSCgJj.js +0 -1
  28. package/dist/web/assets/WorkflowsPanel-CvBweQMf.js +0 -1
  29. package/dist/web/assets/WorktreePanel-DahbK2L0.js +0 -1
  30. package/dist/web/assets/index-7UiltNKa.js +0 -1
  31. package/dist/web/assets/index-BESnPMZk.js +0 -144
  32. package/dist/web/assets/index-Bif4Kdtn.css +0 -1
  33. package/dist/web/assets/index-DXTQExVH.js +0 -1
@@ -0,0 +1 @@
1
+ import{c as oe,j as t,r as x}from"./vendor-react-gGw_S5I_.js";import{_ as st,V as le,aV as Ae,aW as ne,m as nt,n as at,I as it,W as ut,X as mt,aX as ft,B as Te,aY as ht,w as Ze,aZ as lt,am as pt,an as xt,ao as gt,a_ as Qe,a$ as bt,aw as jt,ax as vt,b0 as wt,i as Nt,j as St,k as Ct,b1 as kt,U as yt,a8 as _t,h as Et,D as At}from"./index-Du17HzQD.js";import{a5 as zt,a6 as $t,a7 as Tt,a8 as It,e as Dt,T as Pt,M as Ft,a9 as Lt,aa as Bt,ab as Rt,$ as Ut,C as Ot,F as Vt,A as Mt,ac as Xt,J as Gt,ad as ot,ae as Ht,af as Wt}from"./vendor-ui-CdA11Wfh.js";import"./vendor-shiki-DOn6sF-i.js";import"./vendor-markdown-BE1gYnO9.js";function qt(s){const e=oe.c(11);let n,i,a;e[0]!==s?({className:n,size:a,...i}=s,e[0]=s,e[1]=n,e[2]=i,e[3]=a):(n=e[1],i=e[2],a=e[3]);const o=a===void 0?"default":a;let c;e[4]!==n?(c=st("peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent transition-all outline-none group-has-[:focus-visible]/field-label:border-transparent group-has-[:focus-visible]/field-label:ring-0 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 data-disabled:cursor-not-allowed data-disabled:opacity-50",n),e[4]=n,e[5]=c):c=e[5];let f;e[6]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx($t,{"data-slot":"switch-thumb",className:"pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] dark:data-checked:bg-primary-foreground group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 dark:data-unchecked:bg-foreground"}),e[6]=f):f=e[6];let u;return e[7]!==i||e[8]!==o||e[9]!==c?(u=t.jsx(zt,{"data-slot":"switch","data-size":o,className:c,...i,children:f}),e[7]=i,e[8]=o,e[9]=c,e[10]=u):u=e[10],u}function Kt(s){const e=oe.c(3),{name:n}=s,i=n.toLowerCase();if(i.includes("iphone")||i.includes("android")){let o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(Dt,{"data-icon":"inline-start",className:"size-4 text-muted-foreground"}),e[0]=o):o=e[0],o}if(i.includes("ipad")||i.includes("tablet")){let o;return e[1]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(Pt,{"data-icon":"inline-start",className:"size-4 text-muted-foreground"}),e[1]=o):o=e[1],o}let a;return e[2]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(Ft,{"data-icon":"inline-start",className:"size-4 text-muted-foreground"}),e[2]=a):a=e[2],a}function et(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 Jt(s){const e=[`Shared ${et(s.createdAt)}`,s.lastAccessAt>0?`opened ${et(s.lastAccessAt)}`:"never opened"];return s.guests>0&&e.push(s.guests===1?"1 guest":`${s.guests} guests`),e.join(" · ")}function Yt(){const s=oe.c(12),{shares:e,revoke:n,revokeAll:i}=ft();let a;s[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("p",{className:"text-xs text-muted-foreground",children:"Shared sessions"}),s[0]=a):a=s[0];let o;s[1]!==i||s[2]!==e.length?(o=e.length>0&&t.jsx(Te,{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]=o):o=s[3];let c;s[4]!==o?(c=t.jsxs("div",{className:"flex h-6 items-center justify-between",children:[a,o]}),s[4]=o,s[5]=c):c=s[5];let f;s[6]!==n||s[7]!==e?(f=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(r=>{const g=r.title||r.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:g}),t.jsx("p",{className:"text-xs text-muted-foreground",children:Jt(r)})]}),t.jsx(Te,{variant:"ghost",size:"xs","aria-label":`Revoke share of ${g}`,className:"text-destructive hover:text-destructive",onClick:()=>void n(r.sessionId),children:"Revoke"})]},r.sessionId)})}),s[6]=n,s[7]=e,s[8]=f):f=s[8];let u;return s[9]!==c||s[10]!==f?(u=t.jsxs("div",{className:"flex flex-col gap-2",children:[c,f]}),s[9]=c,s[10]=f,s[11]=u):u=s[11],u}function Zt(s){const e=oe.c(30),{networkAccess:n,setNetworkAccess:i,networkPassword:a,setNetworkPassword:o,showNetworkPassword:c,setShowNetworkPassword:f,hasExistingPassword:u,initialNetworkAccess:r,connectedDevices:g,minPasswordLength:b}=s;let $;e[0]!==n?($=n?t.jsx(Lt,{"data-icon":"inline-start",className:"size-4 text-success"}):t.jsx(Bt,{"data-icon":"inline-start",className:"size-4 text-muted-foreground"}),e[0]=n,e[1]=$):$=e[1];let S;e[2]===Symbol.for("react.memo_cache_sentinel")?(S=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]=S):S=e[2];let _;e[3]!==$?(_=t.jsxs("div",{className:"flex items-center gap-2",children:[$,S]}),e[3]=$,e[4]=_):_=e[4];let C;e[5]!==i?(C=E=>i(E),e[5]=i,e[6]=C):C=e[6];let h;e[7]!==n||e[8]!==C?(h=t.jsx(qt,{"aria-label":"Network Access",checked:n,onCheckedChange:C}),e[7]=n,e[8]=C,e[9]=h):h=e[9];let j;e[10]!==_||e[11]!==h?(j=t.jsxs("div",{className:"flex items-center justify-between",children:[_,h]}),e[10]=_,e[11]=h,e[12]=j):j=e[12];let p;e[13]!==u||e[14]!==b||e[15]!==n||e[16]!==a||e[17]!==o||e[18]!==f||e[19]!==c?(p=n&&t.jsxs(le,{"data-invalid":a.length>0&&a.length<b,children:[t.jsx(Ae,{htmlFor:"network-password",children:"Password"}),t.jsx(ne,{children:u&&a.length===0?"A password is already set. Leave blank to keep it.":`Use at least ${b} characters.`}),t.jsxs(nt,{children:[t.jsx(at,{id:"network-password",type:c?"text":"password",value:a,onChange:E=>o(E.target.value),placeholder:u?"Enter new password to change":"Set a password for remote access"}),t.jsx(it,{align:"inline-end",children:t.jsx(ut,{size:"icon-xs","aria-label":c?"Hide password":"Show password",onClick:()=>f(!c),children:c?t.jsx(Tt,{"data-icon":"inline-start"}):t.jsx(It,{"data-icon":"inline-start"})})})]}),a.length>0&&a.length<b&&t.jsxs(mt,{children:["Password must be at least ",b," characters (",a.length,"/",b,")"]}),t.jsx(ne,{children:"Requires app restart. Remote browsers need an HTTPS reverse proxy; port 19384 remains available to Cogpit hubs and device clients."})]}),e[13]=u,e[14]=b,e[15]=n,e[16]=a,e[17]=o,e[18]=f,e[19]=c,e[20]=p):p=e[20];let d;e[21]!==g||e[22]!==r||e[23]!==n?(d=n&&r&&g.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:g.map(Qt)})]}),e[21]=g,e[22]=r,e[23]=n,e[24]=d):d=e[24];let v;e[25]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(Yt,{}),e[25]=v):v=e[25];let m;return e[26]!==j||e[27]!==p||e[28]!==d?(m=t.jsxs("div",{className:"flex flex-col gap-4 border-t pt-5",children:[j,p,d,v]}),e[26]=j,e[27]=p,e[28]=d,e[29]=m):m=e[29],m}function Qt(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(Kt,{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:et(s.lastActivity)})]})]},`${s.ip}-${e}`)}const es=["auto","path","npm","bundled","custom"],Ye={source:"auto"},ts=["path","npm","bundled"];function ss(s){return es.includes(s)}function ns(s){if(!s||typeof s!="object")return;const{source:e,path:n}=s;if(!(!ss(e)||e==="auto"))return e==="custom"?typeof n=="string"&&n.trim()?{source:e,path:n.trim()}:void 0:{source:e}}const $e={auto:"Automatic",path:"Installed on PATH",npm:"Global npm install",bundled:"Bundled with Cogpit",custom:"Custom path"};function rt(s,e){return e?`v${e} · ${s}`:s}function as(s,e){return s===null?"Checking installed binaries…":e?e.version===null?`${e.path} did not report a version — check the path.`:`Now running: ${rt(e.path,e.version)}`:"No launchable binary for the saved choice — sessions cannot start."}function is(s){return s!==null&&s.version!==null}function ls(s){const e=oe.c(92),{kind:n,value:i,onChange:a,disabled:o,reportVersion:c}=s;let f;e[0]!==n?(f=ht(n),e[0]=n,e[1]=f):f=e[1];const{displayName:u}=f,[r,g]=x.useState(null),[b,$]=x.useState(!1),S=`agent-executable-${n}`;let _;e[2]!==n?(_=()=>{let y=!1;return Ze(`/api/agent-executable/${n}`).then(cs).then(Z=>{y||g(Z)}).catch(rs),()=>{y=!0}},e[2]=n,e[3]=_):_=e[3];let C;e[4]!==n||e[5]!==c?(C=[n,c],e[4]=n,e[5]=c,e[6]=C):C=e[6],x.useEffect(_,C);let h,j,p,d,v,m,E,L,B,k,T,R,q;if(e[7]!==o||e[8]!==u||e[9]!==S||e[10]!==a||e[11]!==b||e[12]!==(r==null?void 0:r.active)||e[13]!==(r==null?void 0:r.candidates)||e[14]!==i.path||e[15]!==i.source){const y=new Map((r==null?void 0:r.candidates.map(os))??[]);d=(r==null?void 0:r.active)??null;let Z;e[29]!==o||e[30]!==S||e[31]!==a||e[32]!==i.path||e[33]!==i.source?(Z=(A,F,te,ie)=>{const tt=ie===void 0?!0:ie,W=`${S}-${A}`;return t.jsxs(le,{orientation:"horizontal",children:[t.jsx("input",{type:"radio",id:W,name:S,className:"mt-1 size-4 shrink-0 accent-primary",checked:i.source===A,disabled:o||!tt,onChange:()=>a(A==="custom"?{source:A,path:i.path??""}:{source:A})}),t.jsxs(lt,{children:[t.jsx(Ae,{htmlFor:W,children:F}),t.jsx(ne,{className:"break-all",children:te})]})]},A)},e[29]=o,e[30]=S,e[31]=a,e[32]=i.path,e[33]=i.source,e[34]=Z):Z=e[34],v=Z;const Q=A=>{const F=y.get(A);return v(A,$e[A],F?rt(F.path,F.version):"Not found on this machine.",F!==void 0||i.source===A)},ze=d?`${$e[i.source]} · v${d.version??"?"}`:$e[i.source];p=pt,R=b,q=$,m="flex flex-col gap-2";let G;e[35]===Symbol.for("react.memo_cache_sentinel")?(G=t.jsx(Te,{type:"button",variant:"ghost",className:"h-auto w-full justify-between px-0 font-medium hover:bg-transparent"}),e[35]=G):G=e[35];let ee;e[36]===Symbol.for("react.memo_cache_sentinel")?(ee=t.jsx(Rt,{"data-icon":"inline-start",className:"size-4 text-muted-foreground"}),e[36]=ee):ee=e[36];let H;e[37]!==u?(H=t.jsxs("span",{className:"flex items-center gap-2",children:[ee,u," executable"]}),e[37]=u,e[38]=H):H=e[38];let I;e[39]!==ze?(I=t.jsx("span",{className:"truncate",children:ze}),e[39]=ze,e[40]=I):I=e[40];let D;e[41]!==b?(D=b?t.jsx(Ut,{className:"size-4 shrink-0"}):t.jsx(Ot,{className:"size-4 shrink-0"}),e[41]=b,e[42]=D):D=e[42];let P;e[43]!==I||e[44]!==D?(P=t.jsxs("span",{className:"flex min-w-0 items-center gap-1 text-xs font-normal text-muted-foreground",children:[I,D]}),e[43]=I,e[44]=D,e[45]=P):P=e[45],e[46]!==H||e[47]!==P?(E=t.jsxs(xt,{render:G,children:[H,P]}),e[46]=H,e[47]=P,e[48]=E):E=e[48],j=gt,h=le,e[49]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(ne,{children:"Which binary new sessions run. Automatic uses your installed CLI unless it is older than the copy bundled with Cogpit."}),e[49]=T):T=e[49],L="flex flex-col gap-2 pl-1",e[50]!==v?(B=v("auto",$e.auto,"Recommended."),e[50]=v,e[51]=B):B=e[51],k=ts.map(Q),e[7]=o,e[8]=u,e[9]=S,e[10]=a,e[11]=b,e[12]=r==null?void 0:r.active,e[13]=r==null?void 0:r.candidates,e[14]=i.path,e[15]=i.source,e[16]=h,e[17]=j,e[18]=p,e[19]=d,e[20]=v,e[21]=m,e[22]=E,e[23]=L,e[24]=B,e[25]=k,e[26]=T,e[27]=R,e[28]=q}else h=e[16],j=e[17],p=e[18],d=e[19],v=e[20],m=e[21],E=e[22],L=e[23],B=e[24],k=e[25],T=e[26],R=e[27],q=e[28];const z=`${u} executable path`,re=i.source==="custom"?i.path??"":"",ae=o||i.source!=="custom";let K;e[52]!==a?(K=y=>a({source:"custom",path:y.target.value}),e[52]=a,e[53]=K):K=e[53];let w;e[54]!==z||e[55]!==re||e[56]!==ae||e[57]!==K?(w=t.jsx(Qe,{"aria-label":z,value:re,placeholder:"/path/to/binary",disabled:ae,onChange:K,className:"mt-1"}),e[54]=z,e[55]=re,e[56]=ae,e[57]=K,e[58]=w):w=e[58];let M;e[59]!==v||e[60]!==w?(M=v("custom",$e.custom,w),e[59]=v,e[60]=w,e[61]=M):M=e[61];let U;e[62]!==M||e[63]!==L||e[64]!==B||e[65]!==k?(U=t.jsxs("div",{className:L,children:[B,k,M]}),e[62]=M,e[63]=L,e[64]=B,e[65]=k,e[66]=U):U=e[66];let J;e[67]!==d?(J=is(d)?"text-muted-foreground":"text-destructive",e[67]=d,e[68]=J):J=e[68];let N;e[69]!==J?(N=st("text-xs",J),e[69]=J,e[70]=N):N=e[70];let X;e[71]!==d||e[72]!==r?(X=as(r,d),e[71]=d,e[72]=r,e[73]=X):X=e[73];let O;e[74]!==N||e[75]!==X?(O=t.jsx("p",{className:N,"aria-live":"polite",children:X}),e[74]=N,e[75]=X,e[76]=O):O=e[76];let Y;e[77]!==h||e[78]!==U||e[79]!==O||e[80]!==T?(Y=t.jsxs(h,{children:[T,U,O]}),e[77]=h,e[78]=U,e[79]=O,e[80]=T,e[81]=Y):Y=e[81];let V;e[82]!==j||e[83]!==Y?(V=t.jsx(j,{children:Y}),e[82]=j,e[83]=Y,e[84]=V):V=e[84];let ce;return e[85]!==p||e[86]!==m||e[87]!==E||e[88]!==V||e[89]!==R||e[90]!==q?(ce=t.jsxs(p,{open:R,onOpenChange:q,className:m,children:[E,V]}),e[85]=p,e[86]=m,e[87]=E,e[88]=V,e[89]=R,e[90]=q,e[91]=ce):ce=e[91],ce}function os(s){return[s.source,s]}function rs(){}function cs(s){return s.ok?s.json():null}const ds=wt().filter(s=>s.cli.bundledBySdk).map(s=>s.kind);function us(s,e){return s.source===e.source&&(s.source!=="custom"||s.path===e.path)}function ms(s){const e=oe.c(5),{status:n,error:i}=s;if(n==="validating"){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[t.jsx(ot,{"data-icon":"inline-start",className:"size-3.5 animate-spin"}),"Checking path..."]}),e[0]=a):a=e[0],a}if(n==="valid"){let a;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsxs("div",{className:"flex items-center gap-2 text-sm text-success",children:[t.jsx(Ht,{"data-icon":"inline-start",className:"size-3.5"}),"Valid .claude directory found"]}),e[1]=a):a=e[1],a}if(n==="invalid"&&i){let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(Wt,{"data-icon":"inline-start",className:"size-3.5"}),e[2]=a):a=e[2];let o;return e[3]!==i?(o=t.jsxs("div",{className:"flex items-center gap-2 text-sm text-destructive",children:[a,i]}),e[3]=i,e[4]=o):o=e[4],o}return null}function Ss(s){const e=oe.c(109),{open:n,currentPath:i,onClose:a,onSaved:o}=s,[c,f]=x.useState(i),[u,r]=x.useState(!1),{status:g,error:b,debouncedValidate:$,reset:S,save:_}=bt();let C;e[0]===Symbol.for("react.memo_cache_sentinel")?(C=jt(),e[0]=C):C=e[0];const h=C;let j;e[1]===Symbol.for("react.memo_cache_sentinel")?(j=vt("configWrite"),e[1]=j):j=e[1];const p=j,[d,v]=x.useState(!1),[m,E]=x.useState(""),[L,B]=x.useState(!1),[k,T]=x.useState(""),[R,q]=x.useState(""),[z,re]=x.useState(""),[ae,K]=x.useState(""),[w,M]=x.useState(!1),[U,J]=x.useState(!1),[N,X]=x.useState(Ye),[O,Y]=x.useState(0),[V,ce]=x.useState(Ye),[y,Z]=x.useState(!1),[Q,ze]=x.useState(!1);let G;e[2]===Symbol.for("react.memo_cache_sentinel")?(G=[],e[2]=G):G=e[2];const[ee,H]=x.useState(G);let I,D;e[3]!==i||e[4]!==n||e[5]!==S?(I=()=>{n&&(f(i),S(),Ze("/api/config").then(gs).then(l=>{const se=(l==null?void 0:l.networkAccess)||!1;v(se),Z(se),ze(!!(l!=null&&l.networkPassword)),E("");const Ge=(l==null?void 0:l.terminalApp)||"";T(Ge),q(Ge);const He=(l==null?void 0:l.editorApp)||"";re(He),K(He);const We=(l==null?void 0:l.useBuiltInEditor)===!0;M(We),J(We);const qe=ns(l==null?void 0:l.agentExecutable)??Ye;X(qe),ce(qe),se&&(l!=null&&l.networkPassword)&&!h?Ze("/api/connected-devices").then(xs).then(Ee=>H((Ee==null?void 0:Ee.devices)||[])).catch(ps):H([])}).catch(hs))},D=[n,i,S,h],e[3]=i,e[4]=n,e[5]=S,e[6]=I,e[7]=D):(I=e[6],D=e[7]),x.useEffect(I,D);let P;e[8]!==$?(P=l=>{const se=l.target.value;f(se),$(se)},e[8]=$,e[9]=P):P=e[9];const A=P;let F;e[10]!==N||e[11]!==z||e[12]!==y||e[13]!==d||e[14]!==m||e[15]!==o||e[16]!==c||e[17]!==_||e[18]!==k||e[19]!==w?(F=async()=>{r(!0);const l=await _(c,{networkAccess:h?y:d,networkPassword:!h&&d&&m.length>0?m:void 0,terminalApp:k.trim()||void 0,editorApp:z.trim()||void 0,useBuiltInEditor:w,agentExecutable:N});l.success&&l.claudeDir&&(Y(fs),o(l.claudeDir)),r(!1)},e[10]=N,e[11]=z,e[12]=y,e[13]=d,e[14]=m,e[15]=o,e[16]=c,e[17]=_,e[18]=k,e[19]=w,e[20]=F):F=e[20];const te=F;let ie;e[21]!==N||e[22]!==z||e[23]!==Q||e[24]!==V||e[25]!==ae||e[26]!==y||e[27]!==R||e[28]!==U||e[29]!==d||e[30]!==m||e[31]!==g||e[32]!==k||e[33]!==w?(ie=function(){var Ee;if(g==="validating"||g==="invalid")return!1;const se=g==="valid",Ge=!h&&(d!==y||d&&m.length>0),He=k!==R,We=z!==ae||w!==U,qe=!us(N,V);if(!se&&!Ge&&!He&&!We&&!qe||N.source==="custom"&&!((Ee=N.path)!=null&&Ee.trim()))return!1;if(!h&&d){const ct=m.length>0&&m.length<16,dt=!Q&&m.length===0;if(ct||dt)return!1}return!0},e[21]=N,e[22]=z,e[23]=Q,e[24]=V,e[25]=ae,e[26]=y,e[27]=R,e[28]=U,e[29]=d,e[30]=m,e[31]=g,e[32]=k,e[33]=w,e[34]=ie):ie=e[34];const W=ie();let de;e[35]!==a?(de=l=>{l||a()},e[35]=a,e[36]=de):de=e[36];let Ie;e[37]===Symbol.for("react.memo_cache_sentinel")?(Ie=t.jsxs(Nt,{children:[t.jsx(St,{className:"text-foreground",children:"Configuration"}),t.jsx(Ct,{className:"text-muted-foreground",children:"Manage local paths, preferred apps, and remote access."})]}),e[37]=Ie):Ie=e[37];let De,Pe;e[38]===Symbol.for("react.memo_cache_sentinel")?(De=t.jsx(Ae,{htmlFor:"claude-directory",children:"Claude directory"}),Pe=t.jsx(ne,{children:"The directory containing your Claude configuration."}),e[38]=De,e[39]=Pe):(De=e[38],Pe=e[39]);let Fe;e[40]===Symbol.for("react.memo_cache_sentinel")?(Fe=t.jsx(it,{children:t.jsx(Vt,{"data-icon":"inline-start"})}),e[40]=Fe):Fe=e[40];let ue;e[41]!==W||e[42]!==te||e[43]!==u?(ue=l=>{l.key==="Enter"&&W&&!u&&te()},e[41]=W,e[42]=te,e[43]=u,e[44]=ue):ue=e[44];let me;e[45]!==A||e[46]!==c||e[47]!==ue?(me=t.jsxs(nt,{children:[Fe,t.jsx(at,{id:"claude-directory",value:c,onChange:A,placeholder:"/Users/you/.claude",disabled:!p,onKeyDown:ue})]}),e[45]=A,e[46]=c,e[47]=ue,e[48]=me):me=e[48];let fe;e[49]!==b||e[50]!==g?(fe=t.jsx("div",{"aria-live":"polite",children:t.jsx(ms,{status:g,error:b})}),e[49]=b,e[50]=g,e[51]=fe):fe=e[51];let he;e[52]!==me||e[53]!==fe?(he=t.jsxs(le,{children:[De,Pe,me,fe]}),e[52]=me,e[53]=fe,e[54]=he):he=e[54];let Le,Be;e[55]===Symbol.for("react.memo_cache_sentinel")?(Le=t.jsxs(Ae,{htmlFor:"terminal-application",children:[t.jsx(Mt,{"data-icon":"inline-start",className:"size-4 text-muted-foreground"}),"Terminal application"]}),Be=t.jsx(ne,{children:"Leave blank to use the system default for Ctrl+Cmd+T."}),e[55]=Le,e[56]=Be):(Le=e[55],Be=e[56]);let Re;e[57]===Symbol.for("react.memo_cache_sentinel")?(Re=l=>T(l.target.value),e[57]=Re):Re=e[57];let pe;e[58]!==k?(pe=t.jsxs(le,{children:[Le,Be,t.jsx(Qe,{id:"terminal-application",value:k,onChange:Re,placeholder:"Ghostty, iTerm, or /path/to/binary",disabled:!p})]}),e[58]=k,e[59]=pe):pe=e[59];let Ue;e[60]===Symbol.for("react.memo_cache_sentinel")?(Ue=l=>M(l===!0),e[60]=Ue):Ue=e[60];let xe;e[61]!==w?(xe=t.jsx(kt,{id:"use-built-in-editor",checked:w,onCheckedChange:Ue,disabled:!p}),e[61]=w,e[62]=xe):xe=e[62];let Oe;e[63]===Symbol.for("react.memo_cache_sentinel")?(Oe=t.jsxs(lt,{children:[t.jsxs(Ae,{htmlFor:"use-built-in-editor",children:[t.jsx(Xt,{"data-icon":"inline-start",className:"size-4 text-muted-foreground"}),"Open files in Cogpit"]}),t.jsx(ne,{children:"Files and diffs open in Cogpit’s file workspace instead of launching an external editor."})]}),e[63]=Oe):Oe=e[63];let ge;e[64]!==xe?(ge=t.jsxs(le,{orientation:"horizontal",children:[xe,Oe]}),e[64]=xe,e[65]=ge):ge=e[65];let Ve;e[66]===Symbol.for("react.memo_cache_sentinel")?(Ve=t.jsxs(Ae,{htmlFor:"editor-application",children:[t.jsx(Gt,{"data-icon":"inline-start",className:"size-4 text-muted-foreground"}),"Editor application"]}),e[66]=Ve):Ve=e[66];const Ke=w?"Not used while files open in Cogpit.":"Leave blank to use $VISUAL or automatic detection.";let be;e[67]!==Ke?(be=t.jsx(ne,{children:Ke}),e[67]=Ke,e[68]=be):be=e[68];let Me;e[69]===Symbol.for("react.memo_cache_sentinel")?(Me=l=>re(l.target.value),e[69]=Me):Me=e[69];const Je=!p||w;let je;e[70]!==z||e[71]!==Je?(je=t.jsx(Qe,{id:"editor-application",value:z,onChange:Me,placeholder:"cursor, code, zed, or /path/to/binary",disabled:Je}),e[70]=z,e[71]=Je,e[72]=je):je=e[72];let ve;e[73]!==be||e[74]!==je?(ve=t.jsxs(le,{children:[Ve,be,je]}),e[73]=be,e[74]=je,e[75]=ve):ve=e[75];let we;e[76]!==N||e[77]!==O?(we=ds.map(l=>t.jsx(ls,{kind:l,value:N,onChange:X,disabled:!p,reportVersion:O},l)),e[76]=N,e[77]=O,e[78]=we):we=e[78];let Ne;e[79]!==ee||e[80]!==Q||e[81]!==y||e[82]!==d||e[83]!==m||e[84]!==L?(Ne=!h&&p&&t.jsx(Zt,{networkAccess:d,setNetworkAccess:v,networkPassword:m,setNetworkPassword:E,showNetworkPassword:L,setShowNetworkPassword:B,hasExistingPassword:Q,initialNetworkAccess:y,connectedDevices:ee,minPasswordLength:16}),e[79]=ee,e[80]=Q,e[81]=y,e[82]=d,e[83]=m,e[84]=L,e[85]=Ne):Ne=e[85];let Se;e[86]!==he||e[87]!==pe||e[88]!==ge||e[89]!==ve||e[90]!==we||e[91]!==Ne?(Se=t.jsxs(yt,{children:[he,pe,ge,ve,we,Ne]}),e[86]=he,e[87]=pe,e[88]=ge,e[89]=ve,e[90]=we,e[91]=Ne,e[92]=Se):Se=e[92];let Ce;e[93]!==a?(Ce=t.jsx(Te,{variant:"outline",onClick:a,children:"Cancel"}),e[93]=a,e[94]=Ce):Ce=e[94];let ke;e[95]!==W||e[96]!==te||e[97]!==u?(ke=p&&t.jsx(Te,{disabled:!W||u,onClick:te,children:u?t.jsxs(t.Fragment,{children:[t.jsx(ot,{"data-icon":"inline-start",className:"size-4 animate-spin"}),"Saving..."]}):"Save"}),e[95]=W,e[96]=te,e[97]=u,e[98]=ke):ke=e[98];let ye;e[99]!==Ce||e[100]!==ke?(ye=t.jsxs(_t,{children:[Ce,ke]}),e[99]=Ce,e[100]=ke,e[101]=ye):ye=e[101];let _e;e[102]!==Se||e[103]!==ye?(_e=t.jsxs(Et,{className:"max-h-[calc(100dvh-2rem)] overflow-y-auto sm:max-w-lg",children:[Ie,Se,ye]}),e[102]=Se,e[103]=ye,e[104]=_e):_e=e[104];let Xe;return e[105]!==n||e[106]!==_e||e[107]!==de?(Xe=t.jsx(At,{open:n,onOpenChange:de,children:_e}),e[105]=n,e[106]=_e,e[107]=de,e[108]=Xe):Xe=e[108],Xe}function fs(s){return s+1}function hs(){}function ps(){}function xs(s){return s.json()}function gs(s){return s.json()}export{Ss as ConfigDialog};