cogpit 3.5.2 → 3.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli-runtime.js +1917 -1515
- package/dist/instance-worker.js +21 -5
- package/dist/web/assets/{AutomationsPanel-B3zT5G5K.js → AutomationsPanel-D7XmgTgZ.js} +1 -1
- package/dist/web/assets/{CogpitBlock-d05YgSdQ.js → CogpitBlock-CiS2M1Q_.js} +14 -14
- package/dist/web/assets/{CommandPaletteHost-D8fk5Qkq.js → CommandPaletteHost-Dj06VjlP.js} +1 -1
- package/dist/web/assets/{ConfigBrowser-BRsvua8m.js → ConfigBrowser-DqQo1F4o.js} +1 -1
- package/dist/web/assets/{CrewPanel-C1Yq8jMT.js → CrewPanel-DzLPmS6o.js} +1 -1
- package/dist/web/assets/{HighlightedEditor-clIIwmWB.js → HighlightedEditor-DPrSCx1c.js} +2 -2
- package/dist/web/assets/{KeyboardShortcutsDialog-0VokzXOy.js → KeyboardShortcutsDialog-BdXPWBJw.js} +1 -1
- package/dist/web/assets/{MissionHome-CNjhPZva.js → MissionHome-CTcx5vR7.js} +1 -1
- package/dist/web/assets/{MobileFileChanges-iLhOAdgx.js → MobileFileChanges-Ngv9AlhR.js} +1 -1
- package/dist/web/assets/PluginsDialog-CWRSNNll.js +1 -0
- package/dist/web/assets/{PreviewPanel-DF4kUYpX.js → PreviewPanel-CQcJIdef.js} +1 -1
- package/dist/web/assets/{ProjectFilesPanel-D9_OzQi2.js → ProjectFilesPanel-D5EKIBD7.js} +4 -4
- package/dist/web/assets/{ProjectSwitcherModal-DMEEWm7Q.js → ProjectSwitcherModal-BoSCOiv9.js} +1 -1
- package/dist/web/assets/{TerminalOutput-CrGF3VWW.js → TerminalOutput-DYZJD2WR.js} +1 -1
- package/dist/web/assets/{ThemeSelectorModal-BLBet6sQ.js → ThemeSelectorModal-8sO11Ob-.js} +1 -1
- package/dist/web/assets/{WorkflowsPanel-DkXoYVsK.js → WorkflowsPanel-qv6TkN7g.js} +1 -1
- package/dist/web/assets/WorktreePanel-Dr82TWOP.js +1 -0
- package/dist/web/assets/{edition-ui-CvFxsVfJ.js → edition-ui-DQHX5fm4.js} +1 -1
- package/dist/web/assets/{index-CAupRX51.js → index-BGSPI7dK.js} +1 -1
- package/dist/web/assets/index-BVmNox_3.js +504 -0
- package/dist/web/assets/{index-DxZSG7e3.js → index-CHtH7TlZ.js} +2 -2
- package/dist/web/assets/index-DKDki7Rz.css +1 -0
- package/dist/web/assets/index-DU4gWgPu.js +3 -0
- package/dist/web/assets/{index-DueGSx7L.js → index-zhwBlO_8.js} +2 -2
- package/dist/web/assets/{session-parser.worker-Dv5Kch9n.js → session-parser.worker-DCsmYUeX.js} +22 -22
- package/dist/web/assets/{switch-BHG6oFbM.js → switch-gTnbAJaZ.js} +1 -1
- package/dist/web/assets/{vendor-ui-keo4oB2X.js → vendor-ui-CKjyvB3_.js} +201 -196
- package/dist/web/index.html +3 -3
- package/package.json +1 -1
- package/dist/web/assets/PluginsDialog-xM9uR8bB.js +0 -1
- package/dist/web/assets/WorktreePanel-DvFGKfAn.js +0 -1
- package/dist/web/assets/index-BvNyEUVG.js +0 -506
- package/dist/web/assets/index-D6HYPdiw.css +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/PluginsDialog-
|
|
2
|
-
import{ae as W,ac as ne,av as M,az as yt,aw as Nt,ax as St,ay as Dt,at as Rt,bt as Lt,B as J,z as Ot,bu as kt,c as ht,F as ie,bv as Ct,y as xt,A as pt,au as ft,Z as it,k as Te,bw as Ut,aH as Ft,aY as Bt,bx as Mt,by as $t,bz as Ht,l as Vt,D as Gt,j as qt,bA as Wt,aC as Xt,aE as Kt,n as Jt,o as Zt}from"./index-BvNyEUVG.js";import{c as H,j as t,r as v}from"./vendor-react-gGw_S5I_.js";import{S as At}from"./switch-BHG6oFbM.js";import{bD as Qt,aC as Yt,dh as es,di as ts,dj as ss,dk as ns,cZ as is,C as ls,A as as,cQ as os,L as lt,ab as rs,dl as cs,V as ds,bn as us,aH as fs,cT as ms,c2 as hs,ay as xs,bo as ps}from"./vendor-ui-keo4oB2X.js";import{P as jt}from"./password-BV9mqUzz.js";import"./vendor-markdown-BEJ8yVzA.js";function gs(s){const e=H.c(3),{name:n}=s,i=n.toLowerCase();if(i.includes("iphone")||i.includes("android")){let c;return e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(es,{"data-icon":"inline-start",className:"size-4 text-muted-foreground"}),e[0]=c):c=e[0],c}if(i.includes("ipad")||i.includes("tablet")){let c;return e[1]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(ts,{"data-icon":"inline-start",className:"size-4 text-muted-foreground"}),e[1]=c):c=e[1],c}let l;return e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(ss,{"data-icon":"inline-start",className:"size-4 text-muted-foreground"}),e[2]=l):l=e[2],l}function mt(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 js(s){const e=[`Shared ${mt(s.createdAt)}`,s.lastAccessAt>0?`opened ${mt(s.lastAccessAt)}`:"never opened"];return s.guests>0&&e.push(s.guests===1?"1 guest":`${s.guests} guests`),e.join(" · ")}function bs(){const s=H.c(12),{shares:e,revoke:n,revokeAll:i}=Lt();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 c;s[1]!==i||s[2]!==e.length?(c=e.length>0&&t.jsx(J,{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]=c):c=s[3];let a;s[4]!==c?(a=t.jsxs("div",{className:"flex h-6 items-center justify-between",children:[l,c]}),s[4]=c,s[5]=a):a=s[5];let u;s[6]!==n||s[7]!==e?(u=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 h=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:h}),t.jsx("p",{className:"text-xs text-muted-foreground",children:js(o)})]}),t.jsx(J,{variant:"ghost",size:"xs","aria-label":`Revoke share of ${h}`,className:"text-destructive hover:text-destructive",onClick:()=>void n(o.sessionId),children:"Revoke"})]},o.sessionId)})}),s[6]=n,s[7]=e,s[8]=u):u=s[8];let d;return s[9]!==a||s[10]!==u?(d=t.jsxs("div",{className:"flex flex-col gap-2",children:[a,u]}),s[9]=a,s[10]=u,s[11]=d):d=s[11],d}function vs(s){const e=H.c(30),{networkAccess:n,setNetworkAccess:i,networkPassword:l,setNetworkPassword:c,showNetworkPassword:a,setShowNetworkPassword:u,hasExistingPassword:d,initialNetworkAccess:o,connectedDevices:h,minPasswordLength:r}=s;let f;e[0]!==n?(f=n?t.jsx(ns,{"data-icon":"inline-start",className:"size-4 text-success"}):t.jsx(is,{"data-icon":"inline-start",className:"size-4 text-muted-foreground"}),e[0]=n,e[1]=f):f=e[1];let m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=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]=m):m=e[2];let y;e[3]!==f?(y=t.jsxs("div",{className:"flex items-center gap-2",children:[f,m]}),e[3]=f,e[4]=y):y=e[4];let C;e[5]!==i?(C=b=>i(b),e[5]=i,e[6]=C):C=e[6];let j;e[7]!==n||e[8]!==C?(j=t.jsx(At,{"aria-label":"Network Access",checked:n,onCheckedChange:C}),e[7]=n,e[8]=C,e[9]=j):j=e[9];let k;e[10]!==y||e[11]!==j?(k=t.jsxs("div",{className:"flex items-center justify-between",children:[y,j]}),e[10]=y,e[11]=j,e[12]=k):k=e[12];let x;e[13]!==d||e[14]!==r||e[15]!==n||e[16]!==l||e[17]!==c||e[18]!==u||e[19]!==a?(x=n&&t.jsxs(W,{"data-invalid":l.length>0&&l.length<r,children:[t.jsx(ne,{htmlFor:"network-password",children:"Password"}),t.jsx(M,{children:d&&l.length===0?"A password is already set. Leave blank to keep it.":`Use at least ${r} characters.`}),t.jsxs(yt,{children:[t.jsx(Nt,{id:"network-password",type:a?"text":"password",value:l,onChange:b=>c(b.target.value),placeholder:d?"Enter new password to change":"Set a password for remote access"}),t.jsx(St,{align:"inline-end",children:t.jsx(Dt,{size:"icon-xs","aria-label":a?"Hide password":"Show password",onClick:()=>u(!a),children:a?t.jsx(Qt,{"data-icon":"inline-start"}):t.jsx(Yt,{"data-icon":"inline-start"})})})]}),l.length>0&&l.length<r&&t.jsxs(Rt,{children:["Password must be at least ",r," characters (",l.length,"/",r,")"]}),t.jsx(M,{children:"Requires app restart. Remote browsers need an HTTPS reverse proxy; port 19384 remains available to Cogpit hubs and device clients."})]}),e[13]=d,e[14]=r,e[15]=n,e[16]=l,e[17]=c,e[18]=u,e[19]=a,e[20]=x):x=e[20];let p;e[21]!==h||e[22]!==o||e[23]!==n?(p=n&&o&&h.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:h.map(ws)})]}),e[21]=h,e[22]=o,e[23]=n,e[24]=p):p=e[24];let w;e[25]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(bs,{}),e[25]=w):w=e[25];let N;return e[26]!==k||e[27]!==x||e[28]!==p?(N=t.jsxs("div",{className:"flex flex-col gap-4 border-t pt-5",children:[k,x,p,w]}),e[26]=k,e[27]=x,e[28]=p,e[29]=N):N=e[29],N}function ws(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(gs,{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:mt(s.lastActivity)})]})]},`${s.ip}-${e}`)}const ys=["auto","path","npm","bundled","custom"],dt={source:"auto"},Ns=["path","npm","bundled"];function Ss(s){return ys.includes(s)}function ks(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}}function gt(s){const e=H.c(16),{icon:n,title:i,summary:l,open:c}=s;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(J,{type:"button",variant:"ghost",className:"h-auto w-full justify-between px-0 font-medium hover:bg-transparent"}),e[0]=a):a=e[0];let u;e[1]!==n?(u=t.jsx(n,{"data-icon":"inline-start",className:"size-4 text-muted-foreground"}),e[1]=n,e[2]=u):u=e[2];let d;e[3]!==u||e[4]!==i?(d=t.jsxs("span",{className:"flex items-center gap-2",children:[u,i]}),e[3]=u,e[4]=i,e[5]=d):d=e[5];let o;e[6]!==l?(o=t.jsx("span",{className:"truncate",children:l}),e[6]=l,e[7]=o):o=e[7];let h;e[8]!==c?(h=c?t.jsx(ls,{className:"size-4 shrink-0"}):t.jsx(as,{className:"size-4 shrink-0"}),e[8]=c,e[9]=h):h=e[9];let r;e[10]!==o||e[11]!==h?(r=t.jsxs("span",{className:"flex min-w-0 items-center gap-1 text-xs font-normal text-muted-foreground",children:[o,h]}),e[10]=o,e[11]=h,e[12]=r):r=e[12];let f;return e[13]!==d||e[14]!==r?(f=t.jsxs(Ot,{render:a,children:[d,r]}),e[13]=d,e[14]=r,e[15]=f):f=e[15],f}const Ie={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 Cs(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 $s(s){return s!==null&&s.version!==null}function As(s){const e=H.c(82),{kind:n,value:i,onChange:l,disabled:c,reportVersion:a}=s;let u;e[0]!==n?(u=kt(n),e[0]=n,e[1]=u):u=e[1];const{displayName:d}=u,[o,h]=v.useState(null),[r,f]=v.useState(!1),m=`agent-executable-${n}`;let y;e[2]!==n?(y=()=>{let Y=!1;return ie(`/api/agent-executable/${n}`).then(Is).then(q=>{Y||h(q)}).catch(_s),()=>{Y=!0}},e[2]=n,e[3]=y):y=e[3];let C;e[4]!==n||e[5]!==a?(C=[n,a],e[4]=n,e[5]=a,e[6]=C):C=e[6],v.useEffect(y,C);let j,k,x,p,w,N,b,S,$,_,I,R,A;if(e[7]!==c||e[8]!==d||e[9]!==m||e[10]!==l||e[11]!==r||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 Y=new Map((o==null?void 0:o.candidates.map(Es))??[]);p=(o==null?void 0:o.active)??null;let q;e[29]!==c||e[30]!==m||e[31]!==l||e[32]!==i.path||e[33]!==i.source?(q=(D,ee,le,ae)=>{const ze=ae===void 0?!0:ae,se=`${m}-${D}`;return t.jsxs(W,{orientation:"horizontal",children:[t.jsx("input",{type:"radio",id:se,name:m,className:"mt-1 size-4 shrink-0 accent-primary",checked:i.source===D,disabled:c||!ze,onChange:()=>l(D==="custom"?{source:D,path:i.path??""}:{source:D})}),t.jsxs(Ct,{children:[t.jsx(ne,{htmlFor:se,children:ee}),t.jsx(M,{className:"break-all",children:le})]})]},D)},e[29]=c,e[30]=m,e[31]=l,e[32]=i.path,e[33]=i.source,e[34]=q):q=e[34],w=q;const at=D=>{const ee=Y.get(D);return w(D,Ie[D],ee?Et(ee.path,ee.version):"Not found on this machine.",ee!==void 0||i.source===D)},O=p?`${Ie[i.source]} · v${p.version??"?"}`:Ie[i.source];x=xt,R=r,A=f,N="flex flex-col gap-2";const _e=`${d} executable`;e[35]!==r||e[36]!==O||e[37]!==_e?(b=t.jsx(gt,{icon:os,title:_e,summary:O,open:r}),e[35]=r,e[36]=O,e[37]=_e,e[38]=b):b=e[38],k=pt,j=W,e[39]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(M,{children:"Which binary new sessions run. Automatic uses your installed CLI unless it is older than the copy bundled with Cogpit."}),e[39]=I):I=e[39],S="flex flex-col gap-2 pl-1",e[40]!==w?($=w("auto",Ie.auto,"Recommended."),e[40]=w,e[41]=$):$=e[41],_=Ns.map(at),e[7]=c,e[8]=d,e[9]=m,e[10]=l,e[11]=r,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]=j,e[17]=k,e[18]=x,e[19]=p,e[20]=w,e[21]=N,e[22]=b,e[23]=S,e[24]=$,e[25]=_,e[26]=I,e[27]=R,e[28]=A}else j=e[16],k=e[17],x=e[18],p=e[19],w=e[20],N=e[21],b=e[22],S=e[23],$=e[24],_=e[25],I=e[26],R=e[27],A=e[28];const B=`${d} executable path`,V=i.source==="custom"?i.path??"":"",U=c||i.source!=="custom";let E;e[42]!==l?(E=Y=>l({source:"custom",path:Y.target.value}),e[42]=l,e[43]=E):E=e[43];let L;e[44]!==B||e[45]!==V||e[46]!==U||e[47]!==E?(L=t.jsx(ft,{"aria-label":B,value:V,placeholder:"/path/to/binary",disabled:U,onChange:E,className:"mt-1"}),e[44]=B,e[45]=V,e[46]=U,e[47]=E,e[48]=L):L=e[48];let T;e[49]!==w||e[50]!==L?(T=w("custom",Ie.custom,L),e[49]=w,e[50]=L,e[51]=T):T=e[51];let F;e[52]!==T||e[53]!==S||e[54]!==$||e[55]!==_?(F=t.jsxs("div",{className:S,children:[$,_,T]}),e[52]=T,e[53]=S,e[54]=$,e[55]=_,e[56]=F):F=e[56];let P;e[57]!==p?(P=$s(p)?"text-muted-foreground":"text-destructive",e[57]=p,e[58]=P):P=e[58];let X;e[59]!==P?(X=ht("text-xs",P),e[59]=P,e[60]=X):X=e[60];let G;e[61]!==p||e[62]!==o?(G=Cs(o,p),e[61]=p,e[62]=o,e[63]=G):G=e[63];let Z;e[64]!==X||e[65]!==G?(Z=t.jsx("p",{className:X,"aria-live":"polite",children:G}),e[64]=X,e[65]=G,e[66]=Z):Z=e[66];let z;e[67]!==j||e[68]!==F||e[69]!==Z||e[70]!==I?(z=t.jsxs(j,{children:[I,F,Z]}),e[67]=j,e[68]=F,e[69]=Z,e[70]=I,e[71]=z):z=e[71];let K;e[72]!==k||e[73]!==z?(K=t.jsx(k,{children:z}),e[72]=k,e[73]=z,e[74]=K):K=e[74];let Q;return e[75]!==x||e[76]!==N||e[77]!==b||e[78]!==K||e[79]!==R||e[80]!==A?(Q=t.jsxs(x,{open:R,onOpenChange:A,className:N,children:[b,K]}),e[75]=x,e[76]=N,e[77]=b,e[78]=K,e[79]=R,e[80]=A,e[81]=Q):Q=e[81],Q}function Es(s){return[s.source,s]}function _s(){}function Is(s){return s.ok?s.json():null}function _t(s){return s instanceof Error?s.message:String(s)}async function bt(s){try{const e=await ie(`/api/agent-accounts/${s}`);return e.status===404?{status:"missing"}:e.ok?await e.json():{status:"error",error:await it(e,`Request failed (${e.status})`)}}catch(e){return{status:"error",error:_t(e)}}}function Ts(s){const[e,n]=v.useState(null),[i,l]=v.useState(null),[c,a]=v.useState(null);v.useEffect(()=>{let d=!1;return bt(s).then(o=>{d||n(o)}),()=>{d=!0}},[s]);const u=v.useCallback(async d=>{l(d),a(null);try{const o=await ie(`/api/agent-accounts/${s}/switch`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({slot:d})});if(!o.ok){a({kind:"failed",error:await it(o,`Request failed (${o.status})`)});return}a({kind:"switched",result:await o.json()}),n(await bt(s))}catch(o){a({kind:"failed",error:_t(o)})}finally{l(null)}},[s]);return{report:e,switchingSlot:i,outcome:c,switchTo:u}}const Ps={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 ut(s){return s.alias??s.email}function vt(s){const e=H.c(18),{label:n,window:i}=s;if(!i)return null;const l=i.pct>=80,c=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 u=l?"bg-destructive":"bg-primary";let d;e[2]!==u?(d=ht("absolute inset-y-0 left-0 rounded-full",u),e[2]=u,e[3]=d):d=e[3];const o=`${i.pct}%`;let h;e[4]!==o?(h={width:o},e[4]=o,e[5]=h):h=e[5];let r;e[6]!==d||e[7]!==h?(r=t.jsx("span",{className:"relative h-1 w-16 overflow-hidden rounded-full bg-muted",children:t.jsx("span",{className:d,style:h})}),e[6]=d,e[7]=h,e[8]=r):r=e[8];let f;e[9]!==i.pct?(f=Math.round(i.pct),e[9]=i.pct,e[10]=f):f=e[10];let m;e[11]!==f?(m=t.jsxs("span",{className:"tabular-nums",children:[f,"%"]}),e[11]=f,e[12]=m):m=e[12];let y;return e[13]!==c||e[14]!==a||e[15]!==r||e[16]!==m?(y=t.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",title:c,children:[a,r,m]}),e[13]=c,e[14]=a,e[15]=r,e[16]=m,e[17]=y):y=e[17],y}function wt(s){return/[.!?]$/.test(s)?s:`${s}.`}function zs(s,e){if(s.kind==="failed")return`Switch failed: ${s.error}`;const{result:n}=s,i=[wt(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(wt)].join(" ")}function Ds(s){const e=H.c(31),{kind:n,disabled:i}=s;let l;e[0]!==n?(l=kt(n),e[0]=n,e[1]=l):l=e[1];const{displayName:c}=l,{report:a,switchingSlot:u,outcome:d,switchTo:o}=Ts(n),[h,r]=v.useState(!1);if(a===null||a.status==="missing")return null;let f,m;if(e[2]!==a.accounts||e[3]!==a.status){f=a.status==="ok"?a.accounts:[];const S=f.find(Rs)??null;m=a.status==="error"?"Unavailable":S?`${ut(S)} · ${f.length} account${f.length===1?"":"s"}`:`${f.length} account${f.length===1?"":"s"}`,e[2]=a.accounts,e[3]=a.status,e[4]=f,e[5]=m}else f=e[4],m=e[5];const y=m,C=`${c} accounts`;let j;e[6]!==h||e[7]!==y||e[8]!==C?(j=t.jsx(gt,{icon:rs,title:C,summary:y,open:h}),e[6]=h,e[7]=y,e[8]=C,e[9]=j):j=e[9];const k=a.status==="ok"&&`Logins managed by ${a.tool}${a.version?` ${a.version}`:""}. `;let x;e[10]!==c||e[11]!==k?(x=t.jsxs(M,{children:[k,"Switching changes which login ",c," sessions authenticate with."]}),e[10]=c,e[11]=k,e[12]=x):x=e[12];let p;e[13]!==f||e[14]!==i||e[15]!==a.error||e[16]!==a.status||e[17]!==o||e[18]!==u?(p=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:f.map(S=>{const $=u===S.slot,_=Ps[S.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:S.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:ut(S)}),S.alias&&t.jsx("span",{className:"truncate text-xs text-muted-foreground",children:S.email}),S.active&&t.jsx(Te,{children:"Active"}),S.disabled&&t.jsx(Te,{variant:"outline",children:"Disabled"}),_&&t.jsx(Te,{variant:"destructive",children:_})]}),S.organization&&t.jsx("span",{className:"truncate text-xs text-muted-foreground",children:S.organization}),S.usage&&t.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1",children:[t.jsx(vt,{label:"5h",window:S.usage.fiveHour}),t.jsx(vt,{label:"7d",window:S.usage.sevenDay})]})]}),!i&&!S.active&&t.jsx(J,{type:"button",size:"sm",variant:"outline",disabled:u!==null,onClick:()=>o(S.slot),"aria-label":`Switch to ${ut(S)}`,children:$?t.jsxs(t.Fragment,{children:[t.jsx(lt,{"data-icon":"inline-start",className:"size-3.5 animate-spin"}),"Switching…"]}):"Switch"})]},S.slot)})}),e[13]=f,e[14]=i,e[15]=a.error,e[16]=a.status,e[17]=o,e[18]=u,e[19]=p):p=e[19];let w;e[20]!==c||e[21]!==d?(w=d&&t.jsx("p",{className:ht("text-xs",d.kind==="failed"?"text-destructive":"text-muted-foreground"),"aria-live":"polite",role:d.kind==="failed"?"alert":"status",children:zs(d,c)}),e[20]=c,e[21]=d,e[22]=w):w=e[22];let N;e[23]!==x||e[24]!==p||e[25]!==w?(N=t.jsx(pt,{children:t.jsxs(W,{children:[x,p,w]})}),e[23]=x,e[24]=p,e[25]=w,e[26]=N):N=e[26];let b;return e[27]!==h||e[28]!==j||e[29]!==N?(b=t.jsxs(xt,{open:h,onOpenChange:r,className:"flex flex-col gap-2",children:[j,N]}),e[27]=h,e[28]=j,e[29]=N,e[30]=b):b=e[30],b}function Rs(s){return s.active}function It(s){return s instanceof Error?s.message:String(s)}async function Ls(){try{const s=await ie("/api/slack");return s.ok?{status:"ok",report:await s.json()}:{status:"error",error:await it(s,`Request failed (${s.status})`)}}catch(s){return{status:"error",error:It(s)}}}function Os(){const[s,e]=v.useState({status:"loading"}),[n,i]=v.useState(null),[l,c]=v.useState(null),a=v.useRef(0),u=v.useCallback(async()=>{const r=++a.current,f=await Ls();r===a.current&&e(f)},[]);v.useEffect(()=>{const r=a;return u(),()=>{r.current++}},[u]);const d=v.useCallback(async(r,f)=>{i(r),c(null),a.current++;try{const m=await ie("/api/slack",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:r,...f})});m.ok||c(await it(m,`Request failed (${m.status})`)),await u()}catch(m){c(It(m))}finally{i(null)}},[u]),o=v.useCallback((r,f)=>d(r,{action:"update",autoPost:f}),[d]),h=v.useCallback(r=>d(r,{action:"unlink"}),[d]);return{state:s,busy:n,error:l,refresh:u,setAutoPost:o,unlink:h}}const Tt={connected:{label:"Connected",variant:"default"},connecting:{label:"Connecting",variant:"outline"},reconnecting:{label:"Reconnecting",variant:"outline"},stopped:{label:"Stopped",variant:"destructive"},failed:{label:"Failed",variant:"destructive"}};function Pe(s,e){return`${s} ${e}${s===1?"":"s"}`}function Us(s){const e=[Pe(s.dms.length,"DM"),...s.channels.length?[Pe(s.channels.length,"channel")]:[]].join(" and ");return`Listens to ${s.allow.join(", ")} · posts to ${e} · ${s.postedToday}/${s.dailyCap} posts today`}function Fs(s){var n;const e=[];if(s.connection.lastError&&s.connection.state!=="connected"&&e.push(s.connection.lastError),s.pending.length){const i=(n=s.pending.find(l=>l.lastError))==null?void 0:n.lastError;e.push(`${Pe(s.pending.length,"message")} waiting to reach the session${i?`: ${i}`:""}`)}return s.uncertain.length&&e.push(`${Pe(s.uncertain.length,"message")} may not have arrived; check the session's queue`),e}function Bs(s){if(!s)return"Unavailable";const{links:e}=s;return e.length===0?"No links":e.length===1?`1 link · ${Tt[e[0].connection.state].label}`:`${Pe(e.length,"link")} · ${e.filter(n=>n.connection.state==="connected").length} connected`}function Ms(s){const e=H.c(40),{link:n,disabled:i,busy:l,onAutoPost:c,onUnlink:a}=s,u=Tt[n.connection.state],d=n.title??n.sessionId;let o;e[0]!==n.sessionId||e[1]!==n.title?(o=n.title??`Session ${n.sessionId.slice(0,8)}`,e[0]=n.sessionId,e[1]=n.title,e[2]=o):o=e[2];let h;e[3]!==n.sessionId||e[4]!==o?(h=t.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",title:n.sessionId,children:o}),e[3]=n.sessionId,e[4]=o,e[5]=h):h=e[5];let r;e[6]!==n.bot?(r=t.jsx(Te,{variant:"outline",children:n.bot}),e[6]=n.bot,e[7]=r):r=e[7];let f;e[8]!==u.label||e[9]!==u.variant?(f=t.jsx(Te,{variant:u.variant,children:u.label}),e[8]=u.label,e[9]=u.variant,e[10]=f):f=e[10];let m;e[11]!==h||e[12]!==r||e[13]!==f?(m=t.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[h,r,f]}),e[11]=h,e[12]=r,e[13]=f,e[14]=m):m=e[14];let y;e[15]!==n?(y=Us(n),e[15]=n,e[16]=y):y=e[16];let C;e[17]!==y?(C=t.jsx("p",{className:"text-xs text-muted-foreground",children:y}),e[17]=y,e[18]=C):C=e[18];let j;e[19]!==n?(j=Fs(n).map(Hs),e[19]=n,e[20]=j):j=e[20];const k=`Post the session’s answer in the thread for ${d}`,x=i||l;let p;e[21]!==n.autoPost||e[22]!==c||e[23]!==x||e[24]!==k?(p=t.jsxs("span",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[t.jsx(At,{size:"sm","aria-label":k,checked:n.autoPost,disabled:x,onCheckedChange:c}),"Post the session’s answer in the thread"]}),e[21]=n.autoPost,e[22]=c,e[23]=x,e[24]=k,e[25]=p):p=e[25];let w;e[26]!==l||e[27]!==i||e[28]!==n.bot||e[29]!==d||e[30]!==a?(w=!i&&t.jsxs(J,{type:"button",size:"sm",variant:"outline",disabled:l,onClick:a,"aria-label":`Unlink ${d} from ${n.bot}`,children:[l&&t.jsx(lt,{"data-icon":"inline-start",className:"size-3.5 animate-spin"}),"Unlink"]}),e[26]=l,e[27]=i,e[28]=n.bot,e[29]=d,e[30]=a,e[31]=w):w=e[31];let N;e[32]!==p||e[33]!==w?(N=t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[p,w]}),e[32]=p,e[33]=w,e[34]=N):N=e[34];let b;return e[35]!==N||e[36]!==m||e[37]!==C||e[38]!==j?(b=t.jsxs("li",{className:"flex flex-col gap-2 px-3 py-2",children:[m,C,j,N]}),e[35]=N,e[36]=m,e[37]=C,e[38]=j,e[39]=b):b=e[39],b}function Hs(s){return t.jsx("p",{className:"text-xs text-destructive",children:s},s)}function Vs(s){const e=H.c(62),{disabled:n}=s,{state:i,busy:l,error:c,refresh:a,setAutoPost:u,unlink:d}=Os(),[o,h]=v.useState(!1);if(i.status==="loading")return null;const r=i.status==="ok"?i.report:null;if(r&&!r.available)return null;let f;e[0]!==(r==null?void 0:r.links)?(f=(r==null?void 0:r.links)??[],e[0]=r==null?void 0:r.links,e[1]=f):f=e[1];const m=f;let y,C,j,k,x,p,w,N,b,S,$;if(e[2]!==l||e[3]!==n||e[4]!==m||e[5]!==o||e[6]!==a||e[7]!==r||e[8]!==u||e[9]!==i.error||e[10]!==i.status||e[11]!==d){let B;e[23]!==m?(B=T=>!m.some(F=>F.bot===T.name),e[23]=m,e[24]=B):B=e[24];const V=((r==null?void 0:r.bots)??[]).filter(B);j=xt,N=o,b=h,S="flex flex-col gap-2";let U;e[25]!==r?(U=Bs(r),e[25]=r,e[26]=U):U=e[26],e[27]!==o||e[28]!==U?($=t.jsx(gt,{icon:cs,title:"Slack links",summary:U,open:o}),e[27]=o,e[28]=U,e[29]=$):$=e[29],C=pt,y=W;let E;e[30]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsxs(M,{children:["A linked session receives DMs, Assistant threads, thread replies and mentions from the people it listens to, and may post only to their DMs and the channels it lists. Add bots and link sessions with ",t.jsx("code",{children:"cogpit-session slack"}),"."]}),e[30]=E):E=e[30];let L;e[31]===Symbol.for("react.memo_cache_sentinel")?(L=t.jsx(ds,{className:"size-3.5"}),e[31]=L):L=e[31],e[32]!==a?(k=t.jsxs("div",{className:"flex items-start justify-between gap-2",children:[E,t.jsx(J,{type:"button",size:"icon-sm",variant:"ghost",onClick:a,"aria-label":"Refresh Slack links",children:L})]}),e[32]=a,e[33]=k):k=e[33],e[34]!==i.error||e[35]!==i.status?(x=i.status==="error"&&t.jsx("p",{className:"text-xs text-destructive",role:"alert",children:i.error}),e[34]=i.error,e[35]=i.status,e[36]=x):x=e[36],e[37]!==l||e[38]!==n||e[39]!==m||e[40]!==u||e[41]!==d?(p=m.length>0&&t.jsx("ul",{className:"flex flex-col divide-y divide-border rounded-md border border-border",children:m.map(T=>t.jsx(Ms,{link:T,disabled:n,busy:l===T.sessionId,onAutoPost:F=>u(T.sessionId,F),onUnlink:()=>d(T.sessionId)},T.sessionId))}),e[37]=l,e[38]=n,e[39]=m,e[40]=u,e[41]=d,e[42]=p):p=e[42],w=V.length>0&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:["Not linked: ",V.map(Gs).join(", ")]}),e[2]=l,e[3]=n,e[4]=m,e[5]=o,e[6]=a,e[7]=r,e[8]=u,e[9]=i.error,e[10]=i.status,e[11]=d,e[12]=y,e[13]=C,e[14]=j,e[15]=k,e[16]=x,e[17]=p,e[18]=w,e[19]=N,e[20]=b,e[21]=S,e[22]=$}else y=e[12],C=e[13],j=e[14],k=e[15],x=e[16],p=e[17],w=e[18],N=e[19],b=e[20],S=e[21],$=e[22];let _;e[43]!==c?(_=c&&t.jsx("p",{className:"text-xs text-destructive",role:"alert",children:c}),e[43]=c,e[44]=_):_=e[44];let I;e[45]!==y||e[46]!==_||e[47]!==k||e[48]!==x||e[49]!==p||e[50]!==w?(I=t.jsxs(y,{children:[k,x,p,w,_]}),e[45]=y,e[46]=_,e[47]=k,e[48]=x,e[49]=p,e[50]=w,e[51]=I):I=e[51];let R;e[52]!==C||e[53]!==I?(R=t.jsx(C,{children:I}),e[52]=C,e[53]=I,e[54]=R):R=e[54];let A;return e[55]!==j||e[56]!==R||e[57]!==N||e[58]!==b||e[59]!==S||e[60]!==$?(A=t.jsxs(j,{open:N,onOpenChange:b,className:S,children:[$,R]}),e[55]=j,e[56]=R,e[57]=N,e[58]=b,e[59]=S,e[60]=$,e[61]=A):A=e[61],A}function Gs(s){return`${s.name}${s.teamName?` (${s.teamName})`:""}`}const qs=v.lazy(()=>Ht(()=>import("./PluginsDialog-xM9uR8bB.js"),__vite__mapDeps([0,1,2,3,4,5])).then(s=>({default:s.PluginsDialog}))),Ws=$t().filter(s=>s.cli.bundledBySdk).map(s=>s.kind),Xs=$t().filter(s=>s.capabilities.accountSwitching).map(s=>s.kind);function Ks(s,e){return s.source===e.source&&(s.source!=="custom"||s.path===e.path)}function Js(s){const e=H.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(lt,{"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(xs,{"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(ps,{"data-icon":"inline-start",className:"size-3.5"}),e[2]=l):l=e[2];let c;return e[3]!==i?(c=t.jsxs("div",{className:"flex items-center gap-2 text-sm text-destructive",children:[l,i]}),e[3]=i,e[4]=c):c=e[4],c}return null}function dn(s){const e=H.c(119),{open:n,currentPath:i,onClose:l,onSaved:c}=s,[a,u]=v.useState(i),[d,o]=v.useState(!1),{status:h,error:r,debouncedValidate:f,reset:m,save:y}=Ut();let C;e[0]===Symbol.for("react.memo_cache_sentinel")?(C=Ft(),e[0]=C):C=e[0];const j=C;let k;e[1]===Symbol.for("react.memo_cache_sentinel")?(k=Bt("configWrite"),e[1]=k):k=e[1];const x=k,[p,w]=v.useState(!1),N=Mt(n&&p&&x),[b,S]=v.useState(!1),[$,_]=v.useState(""),[I,R]=v.useState(!1),[A,B]=v.useState(""),[V,U]=v.useState(""),[E,L]=v.useState(""),[T,F]=v.useState(""),[P,X]=v.useState(!1),[G,Z]=v.useState(!1),[z,K]=v.useState(dt),[Q,Y]=v.useState(0),[q,at]=v.useState(dt),[O,_e]=v.useState(!1),[D,ee]=v.useState(!1);let le;e[2]===Symbol.for("react.memo_cache_sentinel")?(le=[],e[2]=le):le=e[2];const[ae,ze]=v.useState(le);let se,De;e[3]!==i||e[4]!==n||e[5]!==m?(se=()=>{n&&(u(i),m(),ie("/api/config").then(tn).then(g=>{const te=(g==null?void 0:g.networkAccess)||!1;S(te),_e(te),ee(!!(g!=null&&g.networkPassword)),_("");const et=(g==null?void 0:g.terminalApp)||"";B(et),U(et);const tt=(g==null?void 0:g.editorApp)||"";L(tt),F(tt);const st=(g==null?void 0:g.useBuiltInEditor)===!0;X(st),Z(st);const nt=ks(g==null?void 0:g.agentExecutable)??dt;K(nt),at(nt),te&&(g!=null&&g.networkPassword)&&!j?ie("/api/connected-devices").then(en).then(Ee=>ze((Ee==null?void 0:Ee.devices)||[])).catch(Ys):ze([])}).catch(Qs))},De=[n,i,m,j],e[3]=i,e[4]=n,e[5]=m,e[6]=se,e[7]=De):(se=e[6],De=e[7]),v.useEffect(se,De);let Re;e[8]!==f?(Re=g=>{const te=g.target.value;u(te),f(te)},e[8]=f,e[9]=Re):Re=e[9];const ot=Re;let Le;e[10]!==z||e[11]!==E||e[12]!==O||e[13]!==b||e[14]!==$||e[15]!==c||e[16]!==a||e[17]!==y||e[18]!==A||e[19]!==P?(Le=async()=>{o(!0);const g=await y(a,{networkAccess:j?O:b,networkPassword:!j&&b&&$.length>0?$:void 0,terminalApp:A.trim()||void 0,editorApp:E.trim()||void 0,useBuiltInEditor:P,agentExecutable:z});g.success&&g.claudeDir&&(Y(Zs),c(g.claudeDir)),o(!1)},e[10]=z,e[11]=E,e[12]=O,e[13]=b,e[14]=$,e[15]=c,e[16]=a,e[17]=y,e[18]=A,e[19]=P,e[20]=Le):Le=e[20];const oe=Le;let Oe;e[21]!==z||e[22]!==E||e[23]!==D||e[24]!==q||e[25]!==T||e[26]!==O||e[27]!==V||e[28]!==G||e[29]!==b||e[30]!==$||e[31]!==h||e[32]!==A||e[33]!==P?(Oe=function(){var Ee;if(h==="validating"||h==="invalid")return!1;const te=h==="valid",et=!j&&(b!==O||b&&$.length>0),tt=A!==V,st=E!==T||P!==G,nt=!Ks(z,q);if(!te&&!et&&!tt&&!st&&!nt||z.source==="custom"&&!((Ee=z.path)!=null&&Ee.trim()))return!1;if(!j&&b){const Pt=$.length>0&&$.length<jt,zt=!D&&$.length===0;if(Pt||zt)return!1}return!0},e[21]=z,e[22]=E,e[23]=D,e[24]=q,e[25]=T,e[26]=O,e[27]=V,e[28]=G,e[29]=b,e[30]=$,e[31]=h,e[32]=A,e[33]=P,e[34]=Oe):Oe=e[34];const re=Oe();let ce;e[35]!==l?(ce=g=>{g||l()},e[35]=l,e[36]=ce):ce=e[36];let Ue;e[37]===Symbol.for("react.memo_cache_sentinel")?(Ue=t.jsxs(Vt,{children:[t.jsx(Gt,{className:"text-foreground",children:"Configuration"}),t.jsx(qt,{className:"text-muted-foreground",children:"Manage local paths, preferred apps, and remote access."})]}),e[37]=Ue):Ue=e[37];let Fe;e[38]===Symbol.for("react.memo_cache_sentinel")?(Fe=x&&t.jsxs(W,{children:[t.jsx(ne,{children:"Plugins"}),t.jsx(M,{children:"Manage installed plugins, their settings, and service connections."}),t.jsx(J,{type:"button",variant:"outline",onClick:()=>w(!0),children:"Manage plugins"})]}),e[38]=Fe):Fe=e[38];let Be,Me;e[39]===Symbol.for("react.memo_cache_sentinel")?(Be=t.jsx(ne,{htmlFor:"claude-directory",children:"Claude directory"}),Me=t.jsx(M,{children:"The directory containing your Claude configuration."}),e[39]=Be,e[40]=Me):(Be=e[39],Me=e[40]);let He;e[41]===Symbol.for("react.memo_cache_sentinel")?(He=t.jsx(St,{children:t.jsx(us,{"data-icon":"inline-start"})}),e[41]=He):He=e[41];let de;e[42]!==re||e[43]!==oe||e[44]!==d?(de=g=>{g.key==="Enter"&&re&&!d&&oe()},e[42]=re,e[43]=oe,e[44]=d,e[45]=de):de=e[45];let ue;e[46]!==ot||e[47]!==a||e[48]!==de?(ue=t.jsxs(yt,{children:[He,t.jsx(Nt,{id:"claude-directory",value:a,onChange:ot,placeholder:"/Users/you/.claude",disabled:!x,onKeyDown:de})]}),e[46]=ot,e[47]=a,e[48]=de,e[49]=ue):ue=e[49];let fe;e[50]!==r||e[51]!==h?(fe=t.jsx("div",{"aria-live":"polite",children:t.jsx(Js,{status:h,error:r})}),e[50]=r,e[51]=h,e[52]=fe):fe=e[52];let me;e[53]!==ue||e[54]!==fe?(me=t.jsxs(W,{children:[Be,Me,ue,fe]}),e[53]=ue,e[54]=fe,e[55]=me):me=e[55];let Ve,Ge;e[56]===Symbol.for("react.memo_cache_sentinel")?(Ve=t.jsxs(ne,{htmlFor:"terminal-application",children:[t.jsx(fs,{"data-icon":"inline-start",className:"size-4 text-muted-foreground"}),"Terminal application"]}),Ge=t.jsx(M,{children:"Leave blank to use the system default for Ctrl+Cmd+T."}),e[56]=Ve,e[57]=Ge):(Ve=e[56],Ge=e[57]);let qe;e[58]===Symbol.for("react.memo_cache_sentinel")?(qe=g=>B(g.target.value),e[58]=qe):qe=e[58];let he;e[59]!==A?(he=t.jsxs(W,{children:[Ve,Ge,t.jsx(ft,{id:"terminal-application",value:A,onChange:qe,placeholder:"Ghostty, iTerm, or /path/to/binary",disabled:!x})]}),e[59]=A,e[60]=he):he=e[60];let We;e[61]===Symbol.for("react.memo_cache_sentinel")?(We=g=>X(g===!0),e[61]=We):We=e[61];let xe;e[62]!==P?(xe=t.jsx(Wt,{id:"use-built-in-editor",checked:P,onCheckedChange:We,disabled:!x}),e[62]=P,e[63]=xe):xe=e[63];let Xe;e[64]===Symbol.for("react.memo_cache_sentinel")?(Xe=t.jsxs(Ct,{children:[t.jsxs(ne,{htmlFor:"use-built-in-editor",children:[t.jsx(ms,{"data-icon":"inline-start",className:"size-4 text-muted-foreground"}),"Open files in Cogpit"]}),t.jsx(M,{children:"Files and diffs open in Cogpit’s file workspace instead of launching an external editor."})]}),e[64]=Xe):Xe=e[64];let pe;e[65]!==xe?(pe=t.jsxs(W,{orientation:"horizontal",children:[xe,Xe]}),e[65]=xe,e[66]=pe):pe=e[66];let Ke;e[67]===Symbol.for("react.memo_cache_sentinel")?(Ke=t.jsxs(ne,{htmlFor:"editor-application",children:[t.jsx(hs,{"data-icon":"inline-start",className:"size-4 text-muted-foreground"}),"Editor application"]}),e[67]=Ke):Ke=e[67];const rt=P?"Not used while files open in Cogpit.":"Leave blank to use $VISUAL or automatic detection.";let ge;e[68]!==rt?(ge=t.jsx(M,{children:rt}),e[68]=rt,e[69]=ge):ge=e[69];let Je;e[70]===Symbol.for("react.memo_cache_sentinel")?(Je=g=>L(g.target.value),e[70]=Je):Je=e[70];const ct=!x||P;let je;e[71]!==E||e[72]!==ct?(je=t.jsx(ft,{id:"editor-application",value:E,onChange:Je,placeholder:"cursor, code, zed, or /path/to/binary",disabled:ct}),e[71]=E,e[72]=ct,e[73]=je):je=e[73];let be;e[74]!==ge||e[75]!==je?(be=t.jsxs(W,{children:[Ke,ge,je]}),e[74]=ge,e[75]=je,e[76]=be):be=e[76];let ve;e[77]!==z||e[78]!==Q?(ve=Ws.map(g=>t.jsx(As,{kind:g,value:z,onChange:K,disabled:!x,reportVersion:Q},g)),e[77]=z,e[78]=Q,e[79]=ve):ve=e[79];let Ze,Qe;e[80]===Symbol.for("react.memo_cache_sentinel")?(Ze=Xs.map(g=>t.jsx(Ds,{kind:g,disabled:!x},g)),Qe=t.jsx(Vs,{disabled:!x}),e[80]=Ze,e[81]=Qe):(Ze=e[80],Qe=e[81]);let we;e[82]!==ae||e[83]!==D||e[84]!==O||e[85]!==b||e[86]!==$||e[87]!==I?(we=!j&&x&&t.jsx(vs,{networkAccess:b,setNetworkAccess:S,networkPassword:$,setNetworkPassword:_,showNetworkPassword:I,setShowNetworkPassword:R,hasExistingPassword:D,initialNetworkAccess:O,connectedDevices:ae,minPasswordLength:jt}),e[82]=ae,e[83]=D,e[84]=O,e[85]=b,e[86]=$,e[87]=I,e[88]=we):we=e[88];let ye;e[89]!==me||e[90]!==he||e[91]!==pe||e[92]!==be||e[93]!==ve||e[94]!==we?(ye=t.jsxs(Xt,{children:[Fe,me,he,pe,be,ve,Ze,Qe,we]}),e[89]=me,e[90]=he,e[91]=pe,e[92]=be,e[93]=ve,e[94]=we,e[95]=ye):ye=e[95];let Ne;e[96]!==l?(Ne=t.jsx(J,{variant:"outline",onClick:l,children:"Cancel"}),e[96]=l,e[97]=Ne):Ne=e[97];let Se;e[98]!==re||e[99]!==oe||e[100]!==d?(Se=x&&t.jsx(J,{disabled:!re||d,onClick:oe,children:d?t.jsxs(t.Fragment,{children:[t.jsx(lt,{"data-icon":"inline-start",className:"size-4 animate-spin"}),"Saving..."]}):"Save"}),e[98]=re,e[99]=oe,e[100]=d,e[101]=Se):Se=e[101];let ke;e[102]!==Ne||e[103]!==Se?(ke=t.jsxs(Kt,{children:[Ne,Se]}),e[102]=Ne,e[103]=Se,e[104]=ke):ke=e[104];let Ce;e[105]!==ye||e[106]!==ke?(Ce=t.jsxs(Jt,{className:"max-h-[calc(100dvh-2rem)] overflow-y-auto sm:max-w-lg",children:[Ue,ye,ke]}),e[105]=ye,e[106]=ke,e[107]=Ce):Ce=e[107];let $e;e[108]!==n||e[109]!==Ce||e[110]!==ce?($e=t.jsx(Zt,{open:n,onOpenChange:ce,children:Ce}),e[108]=n,e[109]=Ce,e[110]=ce,e[111]=$e):$e=e[111];let Ae;e[112]!==n||e[113]!==p||e[114]!==N?(Ae=n&&p&&x&&t.jsx(v.Suspense,{fallback:null,children:t.jsx(qs,{client:N.client,state:N,currentPath:null,onClose:()=>w(!1)})}),e[112]=n,e[113]=p,e[114]=N,e[115]=Ae):Ae=e[115];let Ye;return e[116]!==$e||e[117]!==Ae?(Ye=t.jsxs(t.Fragment,{children:[$e,Ae]}),e[116]=$e,e[117]=Ae,e[118]=Ye):Ye=e[118],Ye}function Zs(s){return s+1}function Qs(){}function Ys(){}function en(s){return s.json()}function tn(s){return s.json()}export{dn as ConfigDialog};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/PluginsDialog-CWRSNNll.js","assets/vendor-react-gGw_S5I_.js","assets/index-BVmNox_3.js","assets/vendor-ui-CKjyvB3_.js","assets/vendor-markdown-BEJ8yVzA.js","assets/index-DKDki7Rz.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{ae as W,ac as ne,av as M,az as yt,aw as Nt,ax as St,ay as Dt,at as Rt,bt as Lt,B as J,z as Ot,bu as kt,c as ht,F as ie,bv as Ct,y as xt,A as pt,au as ft,Z as it,k as Te,bw as Ut,aH as Ft,aY as Bt,bx as Mt,by as $t,bz as Ht,l as Vt,D as Gt,j as qt,bA as Wt,aC as Xt,aE as Kt,n as Jt,o as Zt}from"./index-BVmNox_3.js";import{c as H,j as t,r as v}from"./vendor-react-gGw_S5I_.js";import{S as At}from"./switch-gTnbAJaZ.js";import{bB as Qt,aC as Yt,dh as es,di as ts,dj as ss,dk as ns,cZ as is,C as ls,A as as,cQ as os,L as lt,ab as rs,dl as cs,V as ds,bl as us,aF as fs,cT as ms,c0 as hs,ay as xs,bm as ps}from"./vendor-ui-CKjyvB3_.js";import{P as jt}from"./password-BV9mqUzz.js";import"./vendor-markdown-BEJ8yVzA.js";function gs(s){const e=H.c(3),{name:n}=s,i=n.toLowerCase();if(i.includes("iphone")||i.includes("android")){let c;return e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(es,{"data-icon":"inline-start",className:"size-4 text-muted-foreground"}),e[0]=c):c=e[0],c}if(i.includes("ipad")||i.includes("tablet")){let c;return e[1]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(ts,{"data-icon":"inline-start",className:"size-4 text-muted-foreground"}),e[1]=c):c=e[1],c}let l;return e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(ss,{"data-icon":"inline-start",className:"size-4 text-muted-foreground"}),e[2]=l):l=e[2],l}function mt(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 js(s){const e=[`Shared ${mt(s.createdAt)}`,s.lastAccessAt>0?`opened ${mt(s.lastAccessAt)}`:"never opened"];return s.guests>0&&e.push(s.guests===1?"1 guest":`${s.guests} guests`),e.join(" · ")}function bs(){const s=H.c(12),{shares:e,revoke:n,revokeAll:i}=Lt();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 c;s[1]!==i||s[2]!==e.length?(c=e.length>0&&t.jsx(J,{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]=c):c=s[3];let a;s[4]!==c?(a=t.jsxs("div",{className:"flex h-6 items-center justify-between",children:[l,c]}),s[4]=c,s[5]=a):a=s[5];let u;s[6]!==n||s[7]!==e?(u=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 h=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:h}),t.jsx("p",{className:"text-xs text-muted-foreground",children:js(o)})]}),t.jsx(J,{variant:"ghost",size:"xs","aria-label":`Revoke share of ${h}`,className:"text-destructive hover:text-destructive",onClick:()=>void n(o.sessionId),children:"Revoke"})]},o.sessionId)})}),s[6]=n,s[7]=e,s[8]=u):u=s[8];let d;return s[9]!==a||s[10]!==u?(d=t.jsxs("div",{className:"flex flex-col gap-2",children:[a,u]}),s[9]=a,s[10]=u,s[11]=d):d=s[11],d}function vs(s){const e=H.c(30),{networkAccess:n,setNetworkAccess:i,networkPassword:l,setNetworkPassword:c,showNetworkPassword:a,setShowNetworkPassword:u,hasExistingPassword:d,initialNetworkAccess:o,connectedDevices:h,minPasswordLength:r}=s;let f;e[0]!==n?(f=n?t.jsx(ns,{"data-icon":"inline-start",className:"size-4 text-success"}):t.jsx(is,{"data-icon":"inline-start",className:"size-4 text-muted-foreground"}),e[0]=n,e[1]=f):f=e[1];let m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=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]=m):m=e[2];let y;e[3]!==f?(y=t.jsxs("div",{className:"flex items-center gap-2",children:[f,m]}),e[3]=f,e[4]=y):y=e[4];let C;e[5]!==i?(C=b=>i(b),e[5]=i,e[6]=C):C=e[6];let j;e[7]!==n||e[8]!==C?(j=t.jsx(At,{"aria-label":"Network Access",checked:n,onCheckedChange:C}),e[7]=n,e[8]=C,e[9]=j):j=e[9];let k;e[10]!==y||e[11]!==j?(k=t.jsxs("div",{className:"flex items-center justify-between",children:[y,j]}),e[10]=y,e[11]=j,e[12]=k):k=e[12];let x;e[13]!==d||e[14]!==r||e[15]!==n||e[16]!==l||e[17]!==c||e[18]!==u||e[19]!==a?(x=n&&t.jsxs(W,{"data-invalid":l.length>0&&l.length<r,children:[t.jsx(ne,{htmlFor:"network-password",children:"Password"}),t.jsx(M,{children:d&&l.length===0?"A password is already set. Leave blank to keep it.":`Use at least ${r} characters.`}),t.jsxs(yt,{children:[t.jsx(Nt,{id:"network-password",type:a?"text":"password",value:l,onChange:b=>c(b.target.value),placeholder:d?"Enter new password to change":"Set a password for remote access"}),t.jsx(St,{align:"inline-end",children:t.jsx(Dt,{size:"icon-xs","aria-label":a?"Hide password":"Show password",onClick:()=>u(!a),children:a?t.jsx(Qt,{"data-icon":"inline-start"}):t.jsx(Yt,{"data-icon":"inline-start"})})})]}),l.length>0&&l.length<r&&t.jsxs(Rt,{children:["Password must be at least ",r," characters (",l.length,"/",r,")"]}),t.jsx(M,{children:"Requires app restart. Remote browsers need an HTTPS reverse proxy; port 19384 remains available to Cogpit hubs and device clients."})]}),e[13]=d,e[14]=r,e[15]=n,e[16]=l,e[17]=c,e[18]=u,e[19]=a,e[20]=x):x=e[20];let p;e[21]!==h||e[22]!==o||e[23]!==n?(p=n&&o&&h.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:h.map(ws)})]}),e[21]=h,e[22]=o,e[23]=n,e[24]=p):p=e[24];let w;e[25]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(bs,{}),e[25]=w):w=e[25];let N;return e[26]!==k||e[27]!==x||e[28]!==p?(N=t.jsxs("div",{className:"flex flex-col gap-4 border-t pt-5",children:[k,x,p,w]}),e[26]=k,e[27]=x,e[28]=p,e[29]=N):N=e[29],N}function ws(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(gs,{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:mt(s.lastActivity)})]})]},`${s.ip}-${e}`)}const ys=["auto","path","npm","bundled","custom"],dt={source:"auto"},Ns=["path","npm","bundled"];function Ss(s){return ys.includes(s)}function ks(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}}function gt(s){const e=H.c(16),{icon:n,title:i,summary:l,open:c}=s;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(J,{type:"button",variant:"ghost",className:"h-auto w-full justify-between px-0 font-medium hover:bg-transparent"}),e[0]=a):a=e[0];let u;e[1]!==n?(u=t.jsx(n,{"data-icon":"inline-start",className:"size-4 text-muted-foreground"}),e[1]=n,e[2]=u):u=e[2];let d;e[3]!==u||e[4]!==i?(d=t.jsxs("span",{className:"flex items-center gap-2",children:[u,i]}),e[3]=u,e[4]=i,e[5]=d):d=e[5];let o;e[6]!==l?(o=t.jsx("span",{className:"truncate",children:l}),e[6]=l,e[7]=o):o=e[7];let h;e[8]!==c?(h=c?t.jsx(ls,{className:"size-4 shrink-0"}):t.jsx(as,{className:"size-4 shrink-0"}),e[8]=c,e[9]=h):h=e[9];let r;e[10]!==o||e[11]!==h?(r=t.jsxs("span",{className:"flex min-w-0 items-center gap-1 text-xs font-normal text-muted-foreground",children:[o,h]}),e[10]=o,e[11]=h,e[12]=r):r=e[12];let f;return e[13]!==d||e[14]!==r?(f=t.jsxs(Ot,{render:a,children:[d,r]}),e[13]=d,e[14]=r,e[15]=f):f=e[15],f}const Ie={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 Cs(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 $s(s){return s!==null&&s.version!==null}function As(s){const e=H.c(82),{kind:n,value:i,onChange:l,disabled:c,reportVersion:a}=s;let u;e[0]!==n?(u=kt(n),e[0]=n,e[1]=u):u=e[1];const{displayName:d}=u,[o,h]=v.useState(null),[r,f]=v.useState(!1),m=`agent-executable-${n}`;let y;e[2]!==n?(y=()=>{let Y=!1;return ie(`/api/agent-executable/${n}`).then(Is).then(q=>{Y||h(q)}).catch(_s),()=>{Y=!0}},e[2]=n,e[3]=y):y=e[3];let C;e[4]!==n||e[5]!==a?(C=[n,a],e[4]=n,e[5]=a,e[6]=C):C=e[6],v.useEffect(y,C);let j,k,x,p,w,N,b,S,$,_,I,R,A;if(e[7]!==c||e[8]!==d||e[9]!==m||e[10]!==l||e[11]!==r||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 Y=new Map((o==null?void 0:o.candidates.map(Es))??[]);p=(o==null?void 0:o.active)??null;let q;e[29]!==c||e[30]!==m||e[31]!==l||e[32]!==i.path||e[33]!==i.source?(q=(D,ee,le,ae)=>{const ze=ae===void 0?!0:ae,se=`${m}-${D}`;return t.jsxs(W,{orientation:"horizontal",children:[t.jsx("input",{type:"radio",id:se,name:m,className:"mt-1 size-4 shrink-0 accent-primary",checked:i.source===D,disabled:c||!ze,onChange:()=>l(D==="custom"?{source:D,path:i.path??""}:{source:D})}),t.jsxs(Ct,{children:[t.jsx(ne,{htmlFor:se,children:ee}),t.jsx(M,{className:"break-all",children:le})]})]},D)},e[29]=c,e[30]=m,e[31]=l,e[32]=i.path,e[33]=i.source,e[34]=q):q=e[34],w=q;const at=D=>{const ee=Y.get(D);return w(D,Ie[D],ee?Et(ee.path,ee.version):"Not found on this machine.",ee!==void 0||i.source===D)},O=p?`${Ie[i.source]} · v${p.version??"?"}`:Ie[i.source];x=xt,R=r,A=f,N="flex flex-col gap-2";const _e=`${d} executable`;e[35]!==r||e[36]!==O||e[37]!==_e?(b=t.jsx(gt,{icon:os,title:_e,summary:O,open:r}),e[35]=r,e[36]=O,e[37]=_e,e[38]=b):b=e[38],k=pt,j=W,e[39]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(M,{children:"Which binary new sessions run. Automatic uses your installed CLI unless it is older than the copy bundled with Cogpit."}),e[39]=I):I=e[39],S="flex flex-col gap-2 pl-1",e[40]!==w?($=w("auto",Ie.auto,"Recommended."),e[40]=w,e[41]=$):$=e[41],_=Ns.map(at),e[7]=c,e[8]=d,e[9]=m,e[10]=l,e[11]=r,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]=j,e[17]=k,e[18]=x,e[19]=p,e[20]=w,e[21]=N,e[22]=b,e[23]=S,e[24]=$,e[25]=_,e[26]=I,e[27]=R,e[28]=A}else j=e[16],k=e[17],x=e[18],p=e[19],w=e[20],N=e[21],b=e[22],S=e[23],$=e[24],_=e[25],I=e[26],R=e[27],A=e[28];const B=`${d} executable path`,V=i.source==="custom"?i.path??"":"",U=c||i.source!=="custom";let E;e[42]!==l?(E=Y=>l({source:"custom",path:Y.target.value}),e[42]=l,e[43]=E):E=e[43];let L;e[44]!==B||e[45]!==V||e[46]!==U||e[47]!==E?(L=t.jsx(ft,{"aria-label":B,value:V,placeholder:"/path/to/binary",disabled:U,onChange:E,className:"mt-1"}),e[44]=B,e[45]=V,e[46]=U,e[47]=E,e[48]=L):L=e[48];let T;e[49]!==w||e[50]!==L?(T=w("custom",Ie.custom,L),e[49]=w,e[50]=L,e[51]=T):T=e[51];let F;e[52]!==T||e[53]!==S||e[54]!==$||e[55]!==_?(F=t.jsxs("div",{className:S,children:[$,_,T]}),e[52]=T,e[53]=S,e[54]=$,e[55]=_,e[56]=F):F=e[56];let P;e[57]!==p?(P=$s(p)?"text-muted-foreground":"text-destructive",e[57]=p,e[58]=P):P=e[58];let X;e[59]!==P?(X=ht("text-xs",P),e[59]=P,e[60]=X):X=e[60];let G;e[61]!==p||e[62]!==o?(G=Cs(o,p),e[61]=p,e[62]=o,e[63]=G):G=e[63];let Z;e[64]!==X||e[65]!==G?(Z=t.jsx("p",{className:X,"aria-live":"polite",children:G}),e[64]=X,e[65]=G,e[66]=Z):Z=e[66];let z;e[67]!==j||e[68]!==F||e[69]!==Z||e[70]!==I?(z=t.jsxs(j,{children:[I,F,Z]}),e[67]=j,e[68]=F,e[69]=Z,e[70]=I,e[71]=z):z=e[71];let K;e[72]!==k||e[73]!==z?(K=t.jsx(k,{children:z}),e[72]=k,e[73]=z,e[74]=K):K=e[74];let Q;return e[75]!==x||e[76]!==N||e[77]!==b||e[78]!==K||e[79]!==R||e[80]!==A?(Q=t.jsxs(x,{open:R,onOpenChange:A,className:N,children:[b,K]}),e[75]=x,e[76]=N,e[77]=b,e[78]=K,e[79]=R,e[80]=A,e[81]=Q):Q=e[81],Q}function Es(s){return[s.source,s]}function _s(){}function Is(s){return s.ok?s.json():null}function _t(s){return s instanceof Error?s.message:String(s)}async function bt(s){try{const e=await ie(`/api/agent-accounts/${s}`);return e.status===404?{status:"missing"}:e.ok?await e.json():{status:"error",error:await it(e,`Request failed (${e.status})`)}}catch(e){return{status:"error",error:_t(e)}}}function Ts(s){const[e,n]=v.useState(null),[i,l]=v.useState(null),[c,a]=v.useState(null);v.useEffect(()=>{let d=!1;return bt(s).then(o=>{d||n(o)}),()=>{d=!0}},[s]);const u=v.useCallback(async d=>{l(d),a(null);try{const o=await ie(`/api/agent-accounts/${s}/switch`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({slot:d})});if(!o.ok){a({kind:"failed",error:await it(o,`Request failed (${o.status})`)});return}a({kind:"switched",result:await o.json()}),n(await bt(s))}catch(o){a({kind:"failed",error:_t(o)})}finally{l(null)}},[s]);return{report:e,switchingSlot:i,outcome:c,switchTo:u}}const Ps={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 ut(s){return s.alias??s.email}function vt(s){const e=H.c(18),{label:n,window:i}=s;if(!i)return null;const l=i.pct>=80,c=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 u=l?"bg-destructive":"bg-primary";let d;e[2]!==u?(d=ht("absolute inset-y-0 left-0 rounded-full",u),e[2]=u,e[3]=d):d=e[3];const o=`${i.pct}%`;let h;e[4]!==o?(h={width:o},e[4]=o,e[5]=h):h=e[5];let r;e[6]!==d||e[7]!==h?(r=t.jsx("span",{className:"relative h-1 w-16 overflow-hidden rounded-full bg-muted",children:t.jsx("span",{className:d,style:h})}),e[6]=d,e[7]=h,e[8]=r):r=e[8];let f;e[9]!==i.pct?(f=Math.round(i.pct),e[9]=i.pct,e[10]=f):f=e[10];let m;e[11]!==f?(m=t.jsxs("span",{className:"tabular-nums",children:[f,"%"]}),e[11]=f,e[12]=m):m=e[12];let y;return e[13]!==c||e[14]!==a||e[15]!==r||e[16]!==m?(y=t.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",title:c,children:[a,r,m]}),e[13]=c,e[14]=a,e[15]=r,e[16]=m,e[17]=y):y=e[17],y}function wt(s){return/[.!?]$/.test(s)?s:`${s}.`}function zs(s,e){if(s.kind==="failed")return`Switch failed: ${s.error}`;const{result:n}=s,i=[wt(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(wt)].join(" ")}function Ds(s){const e=H.c(31),{kind:n,disabled:i}=s;let l;e[0]!==n?(l=kt(n),e[0]=n,e[1]=l):l=e[1];const{displayName:c}=l,{report:a,switchingSlot:u,outcome:d,switchTo:o}=Ts(n),[h,r]=v.useState(!1);if(a===null||a.status==="missing")return null;let f,m;if(e[2]!==a.accounts||e[3]!==a.status){f=a.status==="ok"?a.accounts:[];const S=f.find(Rs)??null;m=a.status==="error"?"Unavailable":S?`${ut(S)} · ${f.length} account${f.length===1?"":"s"}`:`${f.length} account${f.length===1?"":"s"}`,e[2]=a.accounts,e[3]=a.status,e[4]=f,e[5]=m}else f=e[4],m=e[5];const y=m,C=`${c} accounts`;let j;e[6]!==h||e[7]!==y||e[8]!==C?(j=t.jsx(gt,{icon:rs,title:C,summary:y,open:h}),e[6]=h,e[7]=y,e[8]=C,e[9]=j):j=e[9];const k=a.status==="ok"&&`Logins managed by ${a.tool}${a.version?` ${a.version}`:""}. `;let x;e[10]!==c||e[11]!==k?(x=t.jsxs(M,{children:[k,"Switching changes which login ",c," sessions authenticate with."]}),e[10]=c,e[11]=k,e[12]=x):x=e[12];let p;e[13]!==f||e[14]!==i||e[15]!==a.error||e[16]!==a.status||e[17]!==o||e[18]!==u?(p=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:f.map(S=>{const $=u===S.slot,_=Ps[S.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:S.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:ut(S)}),S.alias&&t.jsx("span",{className:"truncate text-xs text-muted-foreground",children:S.email}),S.active&&t.jsx(Te,{children:"Active"}),S.disabled&&t.jsx(Te,{variant:"outline",children:"Disabled"}),_&&t.jsx(Te,{variant:"destructive",children:_})]}),S.organization&&t.jsx("span",{className:"truncate text-xs text-muted-foreground",children:S.organization}),S.usage&&t.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1",children:[t.jsx(vt,{label:"5h",window:S.usage.fiveHour}),t.jsx(vt,{label:"7d",window:S.usage.sevenDay})]})]}),!i&&!S.active&&t.jsx(J,{type:"button",size:"sm",variant:"outline",disabled:u!==null,onClick:()=>o(S.slot),"aria-label":`Switch to ${ut(S)}`,children:$?t.jsxs(t.Fragment,{children:[t.jsx(lt,{"data-icon":"inline-start",className:"size-3.5 animate-spin"}),"Switching…"]}):"Switch"})]},S.slot)})}),e[13]=f,e[14]=i,e[15]=a.error,e[16]=a.status,e[17]=o,e[18]=u,e[19]=p):p=e[19];let w;e[20]!==c||e[21]!==d?(w=d&&t.jsx("p",{className:ht("text-xs",d.kind==="failed"?"text-destructive":"text-muted-foreground"),"aria-live":"polite",role:d.kind==="failed"?"alert":"status",children:zs(d,c)}),e[20]=c,e[21]=d,e[22]=w):w=e[22];let N;e[23]!==x||e[24]!==p||e[25]!==w?(N=t.jsx(pt,{children:t.jsxs(W,{children:[x,p,w]})}),e[23]=x,e[24]=p,e[25]=w,e[26]=N):N=e[26];let b;return e[27]!==h||e[28]!==j||e[29]!==N?(b=t.jsxs(xt,{open:h,onOpenChange:r,className:"flex flex-col gap-2",children:[j,N]}),e[27]=h,e[28]=j,e[29]=N,e[30]=b):b=e[30],b}function Rs(s){return s.active}function It(s){return s instanceof Error?s.message:String(s)}async function Ls(){try{const s=await ie("/api/slack");return s.ok?{status:"ok",report:await s.json()}:{status:"error",error:await it(s,`Request failed (${s.status})`)}}catch(s){return{status:"error",error:It(s)}}}function Os(){const[s,e]=v.useState({status:"loading"}),[n,i]=v.useState(null),[l,c]=v.useState(null),a=v.useRef(0),u=v.useCallback(async()=>{const r=++a.current,f=await Ls();r===a.current&&e(f)},[]);v.useEffect(()=>{const r=a;return u(),()=>{r.current++}},[u]);const d=v.useCallback(async(r,f)=>{i(r),c(null),a.current++;try{const m=await ie("/api/slack",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:r,...f})});m.ok||c(await it(m,`Request failed (${m.status})`)),await u()}catch(m){c(It(m))}finally{i(null)}},[u]),o=v.useCallback((r,f)=>d(r,{action:"update",autoPost:f}),[d]),h=v.useCallback(r=>d(r,{action:"unlink"}),[d]);return{state:s,busy:n,error:l,refresh:u,setAutoPost:o,unlink:h}}const Tt={connected:{label:"Connected",variant:"default"},connecting:{label:"Connecting",variant:"outline"},reconnecting:{label:"Reconnecting",variant:"outline"},stopped:{label:"Stopped",variant:"destructive"},failed:{label:"Failed",variant:"destructive"}};function Pe(s,e){return`${s} ${e}${s===1?"":"s"}`}function Us(s){const e=[Pe(s.dms.length,"DM"),...s.channels.length?[Pe(s.channels.length,"channel")]:[]].join(" and ");return`Listens to ${s.allow.join(", ")} · posts to ${e} · ${s.postedToday}/${s.dailyCap} posts today`}function Fs(s){var n;const e=[];if(s.connection.lastError&&s.connection.state!=="connected"&&e.push(s.connection.lastError),s.pending.length){const i=(n=s.pending.find(l=>l.lastError))==null?void 0:n.lastError;e.push(`${Pe(s.pending.length,"message")} waiting to reach the session${i?`: ${i}`:""}`)}return s.uncertain.length&&e.push(`${Pe(s.uncertain.length,"message")} may not have arrived; check the session's queue`),e}function Bs(s){if(!s)return"Unavailable";const{links:e}=s;return e.length===0?"No links":e.length===1?`1 link · ${Tt[e[0].connection.state].label}`:`${Pe(e.length,"link")} · ${e.filter(n=>n.connection.state==="connected").length} connected`}function Ms(s){const e=H.c(40),{link:n,disabled:i,busy:l,onAutoPost:c,onUnlink:a}=s,u=Tt[n.connection.state],d=n.title??n.sessionId;let o;e[0]!==n.sessionId||e[1]!==n.title?(o=n.title??`Session ${n.sessionId.slice(0,8)}`,e[0]=n.sessionId,e[1]=n.title,e[2]=o):o=e[2];let h;e[3]!==n.sessionId||e[4]!==o?(h=t.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",title:n.sessionId,children:o}),e[3]=n.sessionId,e[4]=o,e[5]=h):h=e[5];let r;e[6]!==n.bot?(r=t.jsx(Te,{variant:"outline",children:n.bot}),e[6]=n.bot,e[7]=r):r=e[7];let f;e[8]!==u.label||e[9]!==u.variant?(f=t.jsx(Te,{variant:u.variant,children:u.label}),e[8]=u.label,e[9]=u.variant,e[10]=f):f=e[10];let m;e[11]!==h||e[12]!==r||e[13]!==f?(m=t.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[h,r,f]}),e[11]=h,e[12]=r,e[13]=f,e[14]=m):m=e[14];let y;e[15]!==n?(y=Us(n),e[15]=n,e[16]=y):y=e[16];let C;e[17]!==y?(C=t.jsx("p",{className:"text-xs text-muted-foreground",children:y}),e[17]=y,e[18]=C):C=e[18];let j;e[19]!==n?(j=Fs(n).map(Hs),e[19]=n,e[20]=j):j=e[20];const k=`Post the session’s answer in the thread for ${d}`,x=i||l;let p;e[21]!==n.autoPost||e[22]!==c||e[23]!==x||e[24]!==k?(p=t.jsxs("span",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[t.jsx(At,{size:"sm","aria-label":k,checked:n.autoPost,disabled:x,onCheckedChange:c}),"Post the session’s answer in the thread"]}),e[21]=n.autoPost,e[22]=c,e[23]=x,e[24]=k,e[25]=p):p=e[25];let w;e[26]!==l||e[27]!==i||e[28]!==n.bot||e[29]!==d||e[30]!==a?(w=!i&&t.jsxs(J,{type:"button",size:"sm",variant:"outline",disabled:l,onClick:a,"aria-label":`Unlink ${d} from ${n.bot}`,children:[l&&t.jsx(lt,{"data-icon":"inline-start",className:"size-3.5 animate-spin"}),"Unlink"]}),e[26]=l,e[27]=i,e[28]=n.bot,e[29]=d,e[30]=a,e[31]=w):w=e[31];let N;e[32]!==p||e[33]!==w?(N=t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[p,w]}),e[32]=p,e[33]=w,e[34]=N):N=e[34];let b;return e[35]!==N||e[36]!==m||e[37]!==C||e[38]!==j?(b=t.jsxs("li",{className:"flex flex-col gap-2 px-3 py-2",children:[m,C,j,N]}),e[35]=N,e[36]=m,e[37]=C,e[38]=j,e[39]=b):b=e[39],b}function Hs(s){return t.jsx("p",{className:"text-xs text-destructive",children:s},s)}function Vs(s){const e=H.c(62),{disabled:n}=s,{state:i,busy:l,error:c,refresh:a,setAutoPost:u,unlink:d}=Os(),[o,h]=v.useState(!1);if(i.status==="loading")return null;const r=i.status==="ok"?i.report:null;if(r&&!r.available)return null;let f;e[0]!==(r==null?void 0:r.links)?(f=(r==null?void 0:r.links)??[],e[0]=r==null?void 0:r.links,e[1]=f):f=e[1];const m=f;let y,C,j,k,x,p,w,N,b,S,$;if(e[2]!==l||e[3]!==n||e[4]!==m||e[5]!==o||e[6]!==a||e[7]!==r||e[8]!==u||e[9]!==i.error||e[10]!==i.status||e[11]!==d){let B;e[23]!==m?(B=T=>!m.some(F=>F.bot===T.name),e[23]=m,e[24]=B):B=e[24];const V=((r==null?void 0:r.bots)??[]).filter(B);j=xt,N=o,b=h,S="flex flex-col gap-2";let U;e[25]!==r?(U=Bs(r),e[25]=r,e[26]=U):U=e[26],e[27]!==o||e[28]!==U?($=t.jsx(gt,{icon:cs,title:"Slack links",summary:U,open:o}),e[27]=o,e[28]=U,e[29]=$):$=e[29],C=pt,y=W;let E;e[30]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsxs(M,{children:["A linked session receives DMs, Assistant threads, thread replies and mentions from the people it listens to, and may post only to their DMs and the channels it lists. Add bots and link sessions with ",t.jsx("code",{children:"cogpit-session slack"}),"."]}),e[30]=E):E=e[30];let L;e[31]===Symbol.for("react.memo_cache_sentinel")?(L=t.jsx(ds,{className:"size-3.5"}),e[31]=L):L=e[31],e[32]!==a?(k=t.jsxs("div",{className:"flex items-start justify-between gap-2",children:[E,t.jsx(J,{type:"button",size:"icon-sm",variant:"ghost",onClick:a,"aria-label":"Refresh Slack links",children:L})]}),e[32]=a,e[33]=k):k=e[33],e[34]!==i.error||e[35]!==i.status?(x=i.status==="error"&&t.jsx("p",{className:"text-xs text-destructive",role:"alert",children:i.error}),e[34]=i.error,e[35]=i.status,e[36]=x):x=e[36],e[37]!==l||e[38]!==n||e[39]!==m||e[40]!==u||e[41]!==d?(p=m.length>0&&t.jsx("ul",{className:"flex flex-col divide-y divide-border rounded-md border border-border",children:m.map(T=>t.jsx(Ms,{link:T,disabled:n,busy:l===T.sessionId,onAutoPost:F=>u(T.sessionId,F),onUnlink:()=>d(T.sessionId)},T.sessionId))}),e[37]=l,e[38]=n,e[39]=m,e[40]=u,e[41]=d,e[42]=p):p=e[42],w=V.length>0&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:["Not linked: ",V.map(Gs).join(", ")]}),e[2]=l,e[3]=n,e[4]=m,e[5]=o,e[6]=a,e[7]=r,e[8]=u,e[9]=i.error,e[10]=i.status,e[11]=d,e[12]=y,e[13]=C,e[14]=j,e[15]=k,e[16]=x,e[17]=p,e[18]=w,e[19]=N,e[20]=b,e[21]=S,e[22]=$}else y=e[12],C=e[13],j=e[14],k=e[15],x=e[16],p=e[17],w=e[18],N=e[19],b=e[20],S=e[21],$=e[22];let _;e[43]!==c?(_=c&&t.jsx("p",{className:"text-xs text-destructive",role:"alert",children:c}),e[43]=c,e[44]=_):_=e[44];let I;e[45]!==y||e[46]!==_||e[47]!==k||e[48]!==x||e[49]!==p||e[50]!==w?(I=t.jsxs(y,{children:[k,x,p,w,_]}),e[45]=y,e[46]=_,e[47]=k,e[48]=x,e[49]=p,e[50]=w,e[51]=I):I=e[51];let R;e[52]!==C||e[53]!==I?(R=t.jsx(C,{children:I}),e[52]=C,e[53]=I,e[54]=R):R=e[54];let A;return e[55]!==j||e[56]!==R||e[57]!==N||e[58]!==b||e[59]!==S||e[60]!==$?(A=t.jsxs(j,{open:N,onOpenChange:b,className:S,children:[$,R]}),e[55]=j,e[56]=R,e[57]=N,e[58]=b,e[59]=S,e[60]=$,e[61]=A):A=e[61],A}function Gs(s){return`${s.name}${s.teamName?` (${s.teamName})`:""}`}const qs=v.lazy(()=>Ht(()=>import("./PluginsDialog-CWRSNNll.js"),__vite__mapDeps([0,1,2,3,4,5])).then(s=>({default:s.PluginsDialog}))),Ws=$t().filter(s=>s.cli.bundledBySdk).map(s=>s.kind),Xs=$t().filter(s=>s.capabilities.accountSwitching).map(s=>s.kind);function Ks(s,e){return s.source===e.source&&(s.source!=="custom"||s.path===e.path)}function Js(s){const e=H.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(lt,{"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(xs,{"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(ps,{"data-icon":"inline-start",className:"size-3.5"}),e[2]=l):l=e[2];let c;return e[3]!==i?(c=t.jsxs("div",{className:"flex items-center gap-2 text-sm text-destructive",children:[l,i]}),e[3]=i,e[4]=c):c=e[4],c}return null}function dn(s){const e=H.c(119),{open:n,currentPath:i,onClose:l,onSaved:c}=s,[a,u]=v.useState(i),[d,o]=v.useState(!1),{status:h,error:r,debouncedValidate:f,reset:m,save:y}=Ut();let C;e[0]===Symbol.for("react.memo_cache_sentinel")?(C=Ft(),e[0]=C):C=e[0];const j=C;let k;e[1]===Symbol.for("react.memo_cache_sentinel")?(k=Bt("configWrite"),e[1]=k):k=e[1];const x=k,[p,w]=v.useState(!1),N=Mt(n&&p&&x),[b,S]=v.useState(!1),[$,_]=v.useState(""),[I,R]=v.useState(!1),[A,B]=v.useState(""),[V,U]=v.useState(""),[E,L]=v.useState(""),[T,F]=v.useState(""),[P,X]=v.useState(!1),[G,Z]=v.useState(!1),[z,K]=v.useState(dt),[Q,Y]=v.useState(0),[q,at]=v.useState(dt),[O,_e]=v.useState(!1),[D,ee]=v.useState(!1);let le;e[2]===Symbol.for("react.memo_cache_sentinel")?(le=[],e[2]=le):le=e[2];const[ae,ze]=v.useState(le);let se,De;e[3]!==i||e[4]!==n||e[5]!==m?(se=()=>{n&&(u(i),m(),ie("/api/config").then(tn).then(g=>{const te=(g==null?void 0:g.networkAccess)||!1;S(te),_e(te),ee(!!(g!=null&&g.networkPassword)),_("");const et=(g==null?void 0:g.terminalApp)||"";B(et),U(et);const tt=(g==null?void 0:g.editorApp)||"";L(tt),F(tt);const st=(g==null?void 0:g.useBuiltInEditor)===!0;X(st),Z(st);const nt=ks(g==null?void 0:g.agentExecutable)??dt;K(nt),at(nt),te&&(g!=null&&g.networkPassword)&&!j?ie("/api/connected-devices").then(en).then(Ee=>ze((Ee==null?void 0:Ee.devices)||[])).catch(Ys):ze([])}).catch(Qs))},De=[n,i,m,j],e[3]=i,e[4]=n,e[5]=m,e[6]=se,e[7]=De):(se=e[6],De=e[7]),v.useEffect(se,De);let Re;e[8]!==f?(Re=g=>{const te=g.target.value;u(te),f(te)},e[8]=f,e[9]=Re):Re=e[9];const ot=Re;let Le;e[10]!==z||e[11]!==E||e[12]!==O||e[13]!==b||e[14]!==$||e[15]!==c||e[16]!==a||e[17]!==y||e[18]!==A||e[19]!==P?(Le=async()=>{o(!0);const g=await y(a,{networkAccess:j?O:b,networkPassword:!j&&b&&$.length>0?$:void 0,terminalApp:A.trim()||void 0,editorApp:E.trim()||void 0,useBuiltInEditor:P,agentExecutable:z});g.success&&g.claudeDir&&(Y(Zs),c(g.claudeDir)),o(!1)},e[10]=z,e[11]=E,e[12]=O,e[13]=b,e[14]=$,e[15]=c,e[16]=a,e[17]=y,e[18]=A,e[19]=P,e[20]=Le):Le=e[20];const oe=Le;let Oe;e[21]!==z||e[22]!==E||e[23]!==D||e[24]!==q||e[25]!==T||e[26]!==O||e[27]!==V||e[28]!==G||e[29]!==b||e[30]!==$||e[31]!==h||e[32]!==A||e[33]!==P?(Oe=function(){var Ee;if(h==="validating"||h==="invalid")return!1;const te=h==="valid",et=!j&&(b!==O||b&&$.length>0),tt=A!==V,st=E!==T||P!==G,nt=!Ks(z,q);if(!te&&!et&&!tt&&!st&&!nt||z.source==="custom"&&!((Ee=z.path)!=null&&Ee.trim()))return!1;if(!j&&b){const Pt=$.length>0&&$.length<jt,zt=!D&&$.length===0;if(Pt||zt)return!1}return!0},e[21]=z,e[22]=E,e[23]=D,e[24]=q,e[25]=T,e[26]=O,e[27]=V,e[28]=G,e[29]=b,e[30]=$,e[31]=h,e[32]=A,e[33]=P,e[34]=Oe):Oe=e[34];const re=Oe();let ce;e[35]!==l?(ce=g=>{g||l()},e[35]=l,e[36]=ce):ce=e[36];let Ue;e[37]===Symbol.for("react.memo_cache_sentinel")?(Ue=t.jsxs(Vt,{children:[t.jsx(Gt,{className:"text-foreground",children:"Configuration"}),t.jsx(qt,{className:"text-muted-foreground",children:"Manage local paths, preferred apps, and remote access."})]}),e[37]=Ue):Ue=e[37];let Fe;e[38]===Symbol.for("react.memo_cache_sentinel")?(Fe=x&&t.jsxs(W,{children:[t.jsx(ne,{children:"Plugins"}),t.jsx(M,{children:"Manage installed plugins, their settings, and service connections."}),t.jsx(J,{type:"button",variant:"outline",onClick:()=>w(!0),children:"Manage plugins"})]}),e[38]=Fe):Fe=e[38];let Be,Me;e[39]===Symbol.for("react.memo_cache_sentinel")?(Be=t.jsx(ne,{htmlFor:"claude-directory",children:"Claude directory"}),Me=t.jsx(M,{children:"The directory containing your Claude configuration."}),e[39]=Be,e[40]=Me):(Be=e[39],Me=e[40]);let He;e[41]===Symbol.for("react.memo_cache_sentinel")?(He=t.jsx(St,{children:t.jsx(us,{"data-icon":"inline-start"})}),e[41]=He):He=e[41];let de;e[42]!==re||e[43]!==oe||e[44]!==d?(de=g=>{g.key==="Enter"&&re&&!d&&oe()},e[42]=re,e[43]=oe,e[44]=d,e[45]=de):de=e[45];let ue;e[46]!==ot||e[47]!==a||e[48]!==de?(ue=t.jsxs(yt,{children:[He,t.jsx(Nt,{id:"claude-directory",value:a,onChange:ot,placeholder:"/Users/you/.claude",disabled:!x,onKeyDown:de})]}),e[46]=ot,e[47]=a,e[48]=de,e[49]=ue):ue=e[49];let fe;e[50]!==r||e[51]!==h?(fe=t.jsx("div",{"aria-live":"polite",children:t.jsx(Js,{status:h,error:r})}),e[50]=r,e[51]=h,e[52]=fe):fe=e[52];let me;e[53]!==ue||e[54]!==fe?(me=t.jsxs(W,{children:[Be,Me,ue,fe]}),e[53]=ue,e[54]=fe,e[55]=me):me=e[55];let Ve,Ge;e[56]===Symbol.for("react.memo_cache_sentinel")?(Ve=t.jsxs(ne,{htmlFor:"terminal-application",children:[t.jsx(fs,{"data-icon":"inline-start",className:"size-4 text-muted-foreground"}),"Terminal application"]}),Ge=t.jsx(M,{children:"Leave blank to use the system default for Ctrl+Cmd+T."}),e[56]=Ve,e[57]=Ge):(Ve=e[56],Ge=e[57]);let qe;e[58]===Symbol.for("react.memo_cache_sentinel")?(qe=g=>B(g.target.value),e[58]=qe):qe=e[58];let he;e[59]!==A?(he=t.jsxs(W,{children:[Ve,Ge,t.jsx(ft,{id:"terminal-application",value:A,onChange:qe,placeholder:"Ghostty, iTerm, or /path/to/binary",disabled:!x})]}),e[59]=A,e[60]=he):he=e[60];let We;e[61]===Symbol.for("react.memo_cache_sentinel")?(We=g=>X(g===!0),e[61]=We):We=e[61];let xe;e[62]!==P?(xe=t.jsx(Wt,{id:"use-built-in-editor",checked:P,onCheckedChange:We,disabled:!x}),e[62]=P,e[63]=xe):xe=e[63];let Xe;e[64]===Symbol.for("react.memo_cache_sentinel")?(Xe=t.jsxs(Ct,{children:[t.jsxs(ne,{htmlFor:"use-built-in-editor",children:[t.jsx(ms,{"data-icon":"inline-start",className:"size-4 text-muted-foreground"}),"Open files in Cogpit"]}),t.jsx(M,{children:"Files and diffs open in Cogpit’s file workspace instead of launching an external editor."})]}),e[64]=Xe):Xe=e[64];let pe;e[65]!==xe?(pe=t.jsxs(W,{orientation:"horizontal",children:[xe,Xe]}),e[65]=xe,e[66]=pe):pe=e[66];let Ke;e[67]===Symbol.for("react.memo_cache_sentinel")?(Ke=t.jsxs(ne,{htmlFor:"editor-application",children:[t.jsx(hs,{"data-icon":"inline-start",className:"size-4 text-muted-foreground"}),"Editor application"]}),e[67]=Ke):Ke=e[67];const rt=P?"Not used while files open in Cogpit.":"Leave blank to use $VISUAL or automatic detection.";let ge;e[68]!==rt?(ge=t.jsx(M,{children:rt}),e[68]=rt,e[69]=ge):ge=e[69];let Je;e[70]===Symbol.for("react.memo_cache_sentinel")?(Je=g=>L(g.target.value),e[70]=Je):Je=e[70];const ct=!x||P;let je;e[71]!==E||e[72]!==ct?(je=t.jsx(ft,{id:"editor-application",value:E,onChange:Je,placeholder:"cursor, code, zed, or /path/to/binary",disabled:ct}),e[71]=E,e[72]=ct,e[73]=je):je=e[73];let be;e[74]!==ge||e[75]!==je?(be=t.jsxs(W,{children:[Ke,ge,je]}),e[74]=ge,e[75]=je,e[76]=be):be=e[76];let ve;e[77]!==z||e[78]!==Q?(ve=Ws.map(g=>t.jsx(As,{kind:g,value:z,onChange:K,disabled:!x,reportVersion:Q},g)),e[77]=z,e[78]=Q,e[79]=ve):ve=e[79];let Ze,Qe;e[80]===Symbol.for("react.memo_cache_sentinel")?(Ze=Xs.map(g=>t.jsx(Ds,{kind:g,disabled:!x},g)),Qe=t.jsx(Vs,{disabled:!x}),e[80]=Ze,e[81]=Qe):(Ze=e[80],Qe=e[81]);let we;e[82]!==ae||e[83]!==D||e[84]!==O||e[85]!==b||e[86]!==$||e[87]!==I?(we=!j&&x&&t.jsx(vs,{networkAccess:b,setNetworkAccess:S,networkPassword:$,setNetworkPassword:_,showNetworkPassword:I,setShowNetworkPassword:R,hasExistingPassword:D,initialNetworkAccess:O,connectedDevices:ae,minPasswordLength:jt}),e[82]=ae,e[83]=D,e[84]=O,e[85]=b,e[86]=$,e[87]=I,e[88]=we):we=e[88];let ye;e[89]!==me||e[90]!==he||e[91]!==pe||e[92]!==be||e[93]!==ve||e[94]!==we?(ye=t.jsxs(Xt,{children:[Fe,me,he,pe,be,ve,Ze,Qe,we]}),e[89]=me,e[90]=he,e[91]=pe,e[92]=be,e[93]=ve,e[94]=we,e[95]=ye):ye=e[95];let Ne;e[96]!==l?(Ne=t.jsx(J,{variant:"outline",onClick:l,children:"Cancel"}),e[96]=l,e[97]=Ne):Ne=e[97];let Se;e[98]!==re||e[99]!==oe||e[100]!==d?(Se=x&&t.jsx(J,{disabled:!re||d,onClick:oe,children:d?t.jsxs(t.Fragment,{children:[t.jsx(lt,{"data-icon":"inline-start",className:"size-4 animate-spin"}),"Saving..."]}):"Save"}),e[98]=re,e[99]=oe,e[100]=d,e[101]=Se):Se=e[101];let ke;e[102]!==Ne||e[103]!==Se?(ke=t.jsxs(Kt,{children:[Ne,Se]}),e[102]=Ne,e[103]=Se,e[104]=ke):ke=e[104];let Ce;e[105]!==ye||e[106]!==ke?(Ce=t.jsxs(Jt,{className:"max-h-[calc(100dvh-2rem)] overflow-y-auto sm:max-w-lg",children:[Ue,ye,ke]}),e[105]=ye,e[106]=ke,e[107]=Ce):Ce=e[107];let $e;e[108]!==n||e[109]!==Ce||e[110]!==ce?($e=t.jsx(Zt,{open:n,onOpenChange:ce,children:Ce}),e[108]=n,e[109]=Ce,e[110]=ce,e[111]=$e):$e=e[111];let Ae;e[112]!==n||e[113]!==p||e[114]!==N?(Ae=n&&p&&x&&t.jsx(v.Suspense,{fallback:null,children:t.jsx(qs,{client:N.client,state:N,currentPath:null,onClose:()=>w(!1)})}),e[112]=n,e[113]=p,e[114]=N,e[115]=Ae):Ae=e[115];let Ye;return e[116]!==$e||e[117]!==Ae?(Ye=t.jsxs(t.Fragment,{children:[$e,Ae]}),e[116]=$e,e[117]=Ae,e[118]=Ye):Ye=e[118],Ye}function Zs(s){return s+1}function Qs(){}function Ys(){}function en(s){return s.json()}function tn(s){return s.json()}export{dn as ConfigDialog};
|