cogpit 2.2.1 → 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 (30) hide show
  1. package/dist/cli.js +938 -585
  2. package/dist/web/assets/{CommandPaletteHost--_g3tlgk.js → CommandPaletteHost-D-VvT_HL.js} +1 -1
  3. package/dist/web/assets/ConfigBrowser-Cc2lrh85.js +1 -0
  4. package/dist/web/assets/{HighlightedEditor-Byq8pOUC.js → HighlightedEditor-DWNz1Jcz.js} +2 -2
  5. package/dist/web/assets/{KeyboardShortcutsDialog-CFhdeGBw.js → KeyboardShortcutsDialog-yOs1u5D6.js} +1 -1
  6. package/dist/web/assets/{MobileFileChanges-uxpxh1W6.js → MobileFileChanges-B1dtcdSZ.js} +1 -1
  7. package/dist/web/assets/PreviewPanel-BJwfunf9.js +1 -0
  8. package/dist/web/assets/{ProjectFilesPanel-ByyaiSGy.js → ProjectFilesPanel-DppuIFEt.js} +3 -3
  9. package/dist/web/assets/{ProjectSwitcherModal-BRbFj3Dd.js → ProjectSwitcherModal-DgsuH5CY.js} +1 -1
  10. package/dist/web/assets/{TerminalOutput-Aavw8QCx.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-C-5Kgwol.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/{vendor-ui-CyII6N5s.js → vendor-ui-CdA11Wfh.js} +158 -148
  20. package/dist/web/index.html +3 -3
  21. package/package.json +1 -1
  22. package/dist/web/assets/ConfigBrowser-DrAZQBx8.js +0 -1
  23. package/dist/web/assets/PreviewPanel-DC6OTZfZ.js +0 -1
  24. package/dist/web/assets/ThemeSelectorModal-CxGMhlkF.js +0 -1
  25. package/dist/web/assets/WorkflowsPanel-Beg1AAtq.js +0 -1
  26. package/dist/web/assets/WorktreePanel-B17_SlFC.js +0 -1
  27. package/dist/web/assets/index-CJcccHRp.js +0 -1
  28. package/dist/web/assets/index-CTpAqQye.js +0 -1
  29. package/dist/web/assets/index-DB1wEO_I.js +0 -148
  30. package/dist/web/assets/index-DU9XxwBy.css +0 -1
@@ -0,0 +1 @@
1
+ import{r as V,a as Qe,c as P,j as s}from"./vendor-react-gGw_S5I_.js";import{w as He,B as U,a_ as Ke,aP as _e,A as qe,b1 as We,bf as Le,Z as ke,Y as ze,a2 as Te,bg as Xe,b5 as Ze,b4 as Je,b3 as et,bh as tt,bi as st,bj as nt,bk as it,_ as ue,bl as lt,al as ot,a5 as at,bm as rt,bn as ct,bo as dt,v as ut,$ as ft,bp as mt,E as xt,y as ht,z as gt,G as pt,H as bt,a3 as jt,p as wt,bq as vt,br as Nt,q as yt}from"./index-Du17HzQD.js";import{c as St,ai as It,ap as Pe,C as $e,aq as Se,af as _t,ar as qt,L as Ct,as as Tt,at as kt,b as At,i as Et}from"./vendor-ui-CdA11Wfh.js";import"./vendor-shiki-DOn6sF-i.js";import"./vendor-markdown-BE1gYnO9.js";const Rt=4e3;function Mt(){const[l,e]=V.useState([]),[t,n]=V.useState(!1),[i,r]=V.useState(null),o=V.useRef(!1);V.useEffect(()=>(o.current=!1,()=>{o.current=!0}),[]);const c=V.useCallback(async()=>{try{const m=await He("/api/mission-control");if(o.current)return;if(!m.ok)throw new Error(`Mission Control request failed (${m.status})`);const x=await m.json();if(o.current)return;e(Array.isArray(x.summaries)?x.summaries:[]),r(null)}catch(m){if(o.current)return;r(m instanceof Error?m.message:"Failed to load Mission Control")}finally{o.current||n(!1)}},[]);V.useEffect(()=>{n(!0);const m=()=>{(typeof document>"u"||document.visibilityState==="visible")&&c()},x=()=>{document.visibilityState==="visible"&&c()};m();const j=setInterval(m,Rt);return document.addEventListener("visibilitychange",x),()=>{clearInterval(j),document.removeEventListener("visibilitychange",x)}},[c]);const d=V.useMemo(()=>{const m=new Map;for(const x of l)m.set(x.sessionId,x);return m},[l]),g=V.useCallback(()=>{c()},[c]);return{summaries:d,loading:t,error:i,refresh:g}}const Ae="data-view-transition-kind",Lt="(prefers-reduced-motion: reduce)";let de=null,Fe=null;function Dt(l,e,t){t===null?l.removeAttribute(e):l.setAttribute(e,t)}function $t(l,e){const t={root:l,kind:e,previousKind:l.getAttribute(Ae)};return l.setAttribute(Ae,e),Fe=t,t}function Ie(l){Fe===l&&(l.root.getAttribute(Ae)===l.kind&&Dt(l.root,Ae,l.previousKind),Fe=null)}function Ft(){const l=de;if(l){de=null;try{l.transition.skipTransition()}catch{Ie(l.tag);return}Ie(l.tag)}}function zt(){if(typeof window>"u"||typeof window.matchMedia!="function")return!1;try{return window.matchMedia(Lt).matches}catch{return!1}}function Ot(l,{kind:e}){Ft();const t=typeof document>"u"?null:document,n=t==null?void 0:t.startViewTransition;if(!t||!(typeof n=="function")||zt())return l(),null;const r=$t(t.documentElement,e);let o=!1,c=!1,d;const g=m=>{if(!o){o=!0;try{m?Qe.flushSync(l):l()}catch(x){throw c=!0,d=x,x}}};try{const m=n.call(t,()=>g(!0)),x={transition:m,tag:r};return de=x,m.ready.catch(()=>{}),m.updateCallbackDone.catch(()=>{}),m.finished.then(()=>{de===x&&(de=null),Ie(r)},()=>{de===x&&(de=null),Ie(r)}),m}catch{if(Ie(r),c)throw d;return g(!1),null}}function Vt(l){const e={};for(const t of l)t.type==="boolean"?e[t.name]=t.defaultValue===!0:t.defaultValue!==void 0?e[t.name]=String(t.defaultValue):e[t.name]="";return e}function Ut(l,e){const t={};for(const n of l){const i=e[n.name];if(typeof i=="boolean"){t[n.name]=i;continue}i!==""&&(t[n.name]=n.type==="number"||n.type==="integer"?Number(i):i)}return t}function Yt(l,e){return l.every(t=>{if(!t.required)return!0;const n=e[t.name];return typeof n=="boolean"?!0:n===""?!1:t.type==="number"||t.type==="integer"?Number.isFinite(Number(n)):!0})}function Pt(l){const e=P.c(64),{request:t,responding:n,onAnswer:i}=l;let r;e[0]!==t.fields?(r=()=>Vt(t.fields),e[0]=t.fields,e[1]=r):r=e[1];const[o,c]=V.useState(r);let d;e[2]!==t.fields||e[3]!==o?(d=Yt(t.fields,o),e[2]=t.fields,e[3]=o,e[4]=d):d=e[4];const g=d,m=t.displayName||t.title||t.serverName;let x;e[5]===Symbol.for("react.memo_cache_sentinel")?(x=(q,S)=>{c(w=>({...w,[q]:S}))},e[5]=x):x=e[5];const j=x;let p;e[6]!==i||e[7]!==t.requestId?(p=()=>i(t.requestId,{action:"decline"}),e[6]=i,e[7]=t.requestId,e[8]=p):p=e[8];const u=p;if(t.mode==="url"&&t.url){const q=t.url;let S;e[9]!==t.message?(S=s.jsx("p",{className:"text-sm leading-relaxed text-foreground",children:t.message}),e[9]=t.message,e[10]=S):S=e[10];let w;e[11]!==q?(w=s.jsx("p",{className:"mt-1 truncate font-mono text-xs text-muted-foreground",title:q,children:q}),e[11]=q,e[12]=w):w=e[12];let I;e[13]!==i||e[14]!==t.requestId||e[15]!==q?(I=()=>{window.open(q,"_blank","noopener,noreferrer"),i(t.requestId,{action:"accept"})},e[13]=i,e[14]=t.requestId,e[15]=q,e[16]=I):I=e[16];let z;e[17]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsx(St,{"data-icon":"inline-end"}),e[17]=z):z=e[17];let L;e[18]!==n||e[19]!==I?(L=s.jsxs(U,{size:"sm",disabled:n,onClick:I,children:["Open link",z]}),e[18]=n,e[19]=I,e[20]=L):L=e[20];let k;e[21]!==u||e[22]!==n?(k=s.jsx(U,{variant:"ghost",size:"sm",disabled:n,onClick:u,children:"Decline"}),e[21]=u,e[22]=n,e[23]=k):k=e[23];let R;e[24]!==k||e[25]!==L?(R=s.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[L,k]}),e[24]=k,e[25]=L,e[26]=R):R=e[26];let $;return e[27]!==m||e[28]!==R||e[29]!==S||e[30]!==w?($=s.jsxs(Ve,{server:m,children:[S,w,R]}),e[27]=m,e[28]=R,e[29]=S,e[30]=w,e[31]=$):$=e[31],$}let a;e[32]!==t.message?(a=s.jsx("p",{className:"text-sm leading-relaxed text-foreground",children:t.message}),e[32]=t.message,e[33]=a):a=e[33];let h;if(e[34]!==t.fields||e[35]!==t.requestId||e[36]!==n||e[37]!==o){let q;e[39]!==t.requestId||e[40]!==n||e[41]!==o?(q=S=>s.jsx(Bt,{id:`elicit-${t.requestId}-${S.name}`,field:S,value:o[S.name],disabled:n,onChange:w=>j(S.name,w)},S.name),e[39]=t.requestId,e[40]=n,e[41]=o,e[42]=q):q=e[42],h=t.fields.map(q),e[34]=t.fields,e[35]=t.requestId,e[36]=n,e[37]=o,e[38]=h}else h=e[38];let f;e[43]!==h?(f=s.jsx("div",{className:"mt-3 flex flex-col gap-3",children:h}),e[43]=h,e[44]=f):f=e[44];const y=n||!g;let v;e[45]!==i||e[46]!==t.fields||e[47]!==t.requestId||e[48]!==o?(v=()=>i(t.requestId,{action:"accept",content:Ut(t.fields,o)}),e[45]=i,e[46]=t.fields,e[47]=t.requestId,e[48]=o,e[49]=v):v=e[49];let _;e[50]!==y||e[51]!==v?(_=s.jsx(U,{size:"sm",disabled:y,onClick:v,children:"Send"}),e[50]=y,e[51]=v,e[52]=_):_=e[52];let T;e[53]!==u||e[54]!==n?(T=s.jsx(U,{variant:"ghost",size:"sm",disabled:n,onClick:u,children:"Decline"}),e[53]=u,e[54]=n,e[55]=T):T=e[55];let N;e[56]!==_||e[57]!==T?(N=s.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[_,T]}),e[56]=_,e[57]=T,e[58]=N):N=e[58];let b;return e[59]!==m||e[60]!==N||e[61]!==a||e[62]!==f?(b=s.jsxs(Ve,{server:m,children:[a,f,N]}),e[59]=m,e[60]=N,e[61]=a,e[62]=f,e[63]=b):b=e[63],b}function Bt(l){const e=P.c(55),{id:t,field:n,value:i,disabled:r,onChange:o}=l;if(n.type==="boolean"){const u=i===!0;let a;e[0]!==o?(a=v=>o(v===!0),e[0]=o,e[1]=a):a=e[1];let h;e[2]!==r||e[3]!==t||e[4]!==u||e[5]!==a?(h=s.jsx(We,{id:t,checked:u,disabled:r,onCheckedChange:a}),e[2]=r,e[3]=t,e[4]=u,e[5]=a,e[6]=h):h=e[6];let f;e[7]!==n?(f=s.jsx(De,{field:n}),e[7]=n,e[8]=f):f=e[8];let y;return e[9]!==t||e[10]!==h||e[11]!==f?(y=s.jsxs(Le,{htmlFor:t,className:"items-start gap-2 font-normal",children:[h,f]}),e[9]=t,e[10]=h,e[11]=f,e[12]=y):y=e[12],y}if(n.type==="enum"){let u;e[13]!==n?(u=s.jsx(De,{field:n}),e[13]=n,e[14]=u):u=e[14];let a;e[15]!==t||e[16]!==u?(a=s.jsx(Le,{htmlFor:t,children:u}),e[15]=t,e[16]=u,e[17]=a):a=e[17];let h;e[18]!==i?(h=typeof i=="string"&&i?[i]:[],e[18]=i,e[19]=h):h=e[19];let f;e[20]!==o?(f=b=>{b[0]&&o(b[0])},e[20]=o,e[21]=f):f=e[21];const y=n.label;let v;e[22]!==n.options?(v=n.options??[],e[22]=n.options,e[23]=v):v=e[23];let _;if(e[24]!==r||e[25]!==v){let b;e[27]!==r?(b=q=>s.jsx(ke,{value:q.value,disabled:r,className:"w-full justify-start px-3",children:q.label},q.value),e[27]=r,e[28]=b):b=e[28],_=v.map(b),e[24]=r,e[25]=v,e[26]=_}else _=e[26];let T;e[29]!==n.label||e[30]!==t||e[31]!==h||e[32]!==f||e[33]!==_?(T=s.jsx(ze,{id:t,value:h,onValueChange:f,orientation:"vertical",variant:"outline",size:"sm",className:"w-full items-stretch","aria-label":y,children:_}),e[29]=n.label,e[30]=t,e[31]=h,e[32]=f,e[33]=_,e[34]=T):T=e[34];let N;return e[35]!==a||e[36]!==T?(N=s.jsxs("div",{className:"flex flex-col gap-1.5",children:[a,T]}),e[35]=a,e[36]=T,e[37]=N):N=e[37],N}let c;e[38]!==n?(c=s.jsx(De,{field:n}),e[38]=n,e[39]=c):c=e[39];let d;e[40]!==t||e[41]!==c?(d=s.jsx(Le,{htmlFor:t,children:c}),e[40]=t,e[41]=c,e[42]=d):d=e[42];const g=n.type==="string"?"text":"number",m=typeof i=="string"?i:"";let x;e[43]!==o?(x=u=>o(u.target.value),e[43]=o,e[44]=x):x=e[44];let j;e[45]!==r||e[46]!==n.label||e[47]!==t||e[48]!==g||e[49]!==m||e[50]!==x?(j=s.jsx(Ke,{id:t,"aria-label":n.label,type:g,value:m,disabled:r,onChange:x}),e[45]=r,e[46]=n.label,e[47]=t,e[48]=g,e[49]=m,e[50]=x,e[51]=j):j=e[51];let p;return e[52]!==d||e[53]!==j?(p=s.jsxs("div",{className:"flex flex-col gap-1.5",children:[d,j]}),e[52]=d,e[53]=j,e[54]=p):p=e[54],p}function De(l){const e=P.c(8),{field:t}=l;let n;e[0]!==t.required?(n=t.required&&s.jsx("span",{className:"ml-0.5 text-warning",children:"*"}),e[0]=t.required,e[1]=n):n=e[1];let i;e[2]!==t.description?(i=t.description&&s.jsx("span",{className:"block text-xs font-normal text-muted-foreground",children:t.description}),e[2]=t.description,e[3]=i):i=e[3];let r;return e[4]!==t.label||e[5]!==n||e[6]!==i?(r=s.jsxs("span",{className:"min-w-0",children:[t.label,n,i]}),e[4]=t.label,e[5]=n,e[6]=i,e[7]=r):r=e[7],r}function Ve(l){const e=P.c(8),{server:t,children:n}=l;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(It,{className:"text-info"}),e[0]=i):i=e[0];let r;e[1]!==t?(r=s.jsxs(_e,{children:[t," needs input"]}),e[1]=t,e[2]=r):r=e[2];let o;e[3]!==n?(o=s.jsx("div",{className:"col-start-2 mt-1 min-w-0",children:n}),e[3]=n,e[4]=o):o=e[4];let c;return e[5]!==r||e[6]!==o?(c=s.jsxs(qe,{className:"border-info/40 bg-info/5",children:[i,r,o]}),e[5]=r,e[6]=o,e[7]=c):c=e[7],c}const Gt=["allow","allow_always","deny"],Qt=[{decision:"allow",label:"Allow",variant:"default"},{decision:"deny",label:"Deny",variant:"destructive"},{decision:"allow_always",label:"Always",variant:"outline"}];function Ht(l,e){return(l.availableDecisions??Gt).includes(e)}function Kt(l){const e=P.c(22),{request:t,queued:n,responding:i,onRespond:r}=l;let o;if(e[0]!==r||e[1]!==n||e[2]!==t||e[3]!==i){let c;e[5]!==t?(c=y=>Ht(t,y.decision),e[5]=t,e[6]=c):c=e[6];const d=Qt.filter(c),g=d.some(Wt);let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(Pe,{className:"text-warning"}),e[7]=m):m=e[7];const x=t.title||`Allow ${t.toolName}?`;let j;e[8]!==x?(j=s.jsx("span",{className:"min-w-0 flex-1 truncate",children:x}),e[8]=x,e[9]=j):j=e[9];let p;e[10]!==n?(p=n>0&&s.jsxs("span",{className:"shrink-0 font-mono text-xs text-warning",children:["+",n]}),e[10]=n,e[11]=p):p=e[11];let u;e[12]!==j||e[13]!==p?(u=s.jsxs(_e,{className:"flex min-w-0 items-center gap-2",children:[j,p]}),e[12]=j,e[13]=p,e[14]=u):u=e[14];let a;e[15]!==t.toolName?(a=s.jsx("span",{className:"shrink-0 font-mono text-xs text-muted-foreground",children:t.toolName}),e[15]=t.toolName,e[16]=a):a=e[16];let h;e[17]!==t.summary?(h=t.summary&&s.jsx("code",{className:"min-w-0 flex-1 truncate rounded bg-muted px-2 py-1 font-mono text-xs text-foreground",children:t.summary}),e[17]=t.summary,e[18]=h):h=e[18];let f;e[19]!==a||e[20]!==h?(f=s.jsxs("div",{className:"col-start-2 mt-2 flex min-w-0 items-center gap-2",children:[a,h]}),e[19]=a,e[20]=h,e[21]=f):f=e[21],o=s.jsxs(qe,{className:"border-warning/40 bg-warning/5",children:[m,u,f,g?s.jsx("div",{className:"col-start-2 mt-3 flex items-center gap-2",children:d.map(y=>{const{decision:v,label:_,variant:T}=y;return s.jsx(U,{size:"xs",variant:T,disabled:i,onClick:()=>r(t.requestId,v),children:_},v)})}):s.jsx("p",{className:"col-start-2 mt-2 text-xs text-warning",children:"Resolve this approval in its own provider"})]}),e[0]=r,e[1]=n,e[2]=t,e[3]=i,e[4]=o}else o=e[4];return o}function Wt(l){return l.decision!=="allow_always"}function Xt(l){return l.some(e=>e.options.length===0||e.options.some(t=>t.hasPreview))}function Zt(l){const e=P.c(63),{request:t,responding:n,gone:i,onAnswer:r,onOpenSession:o}=l,c=t.questions,[d,g]=V.useState(0);let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m={},e[0]=m):m=e[0];const x=V.useRef(m);let j;e[1]===Symbol.for("react.memo_cache_sentinel")?(j=new Set,e[1]=j):j=e[1];const[p,u]=V.useState(j);if(c.length===0)return null;if(Xt(c)){let E;e[2]!==c[0].question?(E=s.jsx("p",{className:"text-sm leading-relaxed text-foreground",children:c[0].question}),e[2]=c[0].question,e[3]=E):E=e[3];let C;e[4]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx($e,{"data-icon":"inline-end"}),e[4]=C):C=e[4];let D;e[5]!==o?(D=s.jsxs(U,{variant:"outline",size:"sm",onClick:o,className:"mt-3",children:["Open full question",C]}),e[5]=o,e[6]=D):D=e[6];let O;return e[7]!==E||e[8]!==D?(O=s.jsxs(Ue,{children:[E,D]}),e[7]=E,e[8]=D,e[9]=O):O=e[9],O}const a=c[d];let h;e[10]!==a.question||e[11]!==d||e[12]!==r||e[13]!==c.length||e[14]!==t.toolUseId?(h=function(C){const D={...x.current,[a.question]:C};if(d+1<c.length){x.current=D,u(new Set),g(d+1);return}r(t.toolUseId,D)},e[10]=a.question,e[11]=d,e[12]=r,e[13]=c.length,e[14]=t.toolUseId,e[15]=h):h=e[15];const f=h;let y;e[16]!==a.header?(y=a.header&&s.jsx(Te,{variant:"outline",className:"border-info/40 text-info",children:a.header}),e[16]=a.header,e[17]=y):y=e[17];let v;e[18]!==d||e[19]!==c.length?(v=c.length>1&&s.jsxs("span",{className:"ml-auto shrink-0 font-mono text-xs text-muted-foreground",children:[d+1," of ",c.length]}),e[18]=d,e[19]=c.length,e[20]=v):v=e[20];let _;e[21]!==y||e[22]!==v?(_=s.jsxs("div",{className:"flex items-baseline gap-1.5",children:[y,v]}),e[21]=y,e[22]=v,e[23]=_):_=e[23];let T;e[24]!==a.question?(T=s.jsx("p",{className:"mt-2 line-clamp-3 text-sm leading-relaxed text-foreground",title:a.question,children:a.question}),e[24]=a.question,e[25]=T):T=e[25];let N;e[26]!==p?(N=[...p],e[26]=p,e[27]=N):N=e[27];let b;e[28]!==f||e[29]!==a.multiSelect?(b=E=>{a.multiSelect?u(new Set(E)):E[0]&&f(E[0])},e[28]=f,e[29]=a.multiSelect,e[30]=b):b=e[30];const q=a.multiSelect,S=a.question;let w;if(e[31]!==a.options||e[32]!==n){let E;e[34]!==n?(E=C=>s.jsx(Jt,{option:C,disabled:n},C.label),e[34]=n,e[35]=E):E=e[35],w=a.options.map(E),e[31]=a.options,e[32]=n,e[33]=w}else w=e[33];let I;e[36]!==a.multiSelect||e[37]!==a.question||e[38]!==w||e[39]!==N||e[40]!==b?(I=s.jsx(ze,{value:N,onValueChange:b,multiple:q,orientation:"vertical",variant:"outline",size:"sm",className:"mt-3 w-full items-stretch","aria-label":S,children:w}),e[36]=a.multiSelect,e[37]=a.question,e[38]=w,e[39]=N,e[40]=b,e[41]=I):I=e[41];let z;e[42]!==f||e[43]!==a.multiSelect||e[44]!==d||e[45]!==c.length||e[46]!==n||e[47]!==p?(z=a.multiSelect&&s.jsx(U,{size:"sm",disabled:n||p.size===0,onClick:()=>f(Xe(p)),children:d+1<c.length?"Next":"Send"}),e[42]=f,e[43]=a.multiSelect,e[44]=d,e[45]=c.length,e[46]=n,e[47]=p,e[48]=z):z=e[48];let L;e[49]===Symbol.for("react.memo_cache_sentinel")?(L=s.jsx($e,{"data-icon":"inline-end"}),e[49]=L):L=e[49];let k;e[50]!==o?(k=s.jsxs(U,{variant:"ghost",size:"sm",onClick:o,className:"ml-auto text-muted-foreground",children:["Open session",L]}),e[50]=o,e[51]=k):k=e[51];let R;e[52]!==z||e[53]!==k?(R=s.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[z,k]}),e[52]=z,e[53]=k,e[54]=R):R=e[54];let $;e[55]!==i?($=i&&s.jsx("p",{className:"mt-2 text-xs text-warning",children:"This question may already be answered. Open the session to check."}),e[55]=i,e[56]=$):$=e[56];let A;return e[57]!==I||e[58]!==R||e[59]!==$||e[60]!==_||e[61]!==T?(A=s.jsxs(Ue,{children:[_,T,I,R,$]}),e[57]=I,e[58]=R,e[59]=$,e[60]=_,e[61]=T,e[62]=A):A=e[62],A}function Jt(l){const e=P.c(17),{option:t,disabled:n}=l;let i;e[0]!==t.label?(i=s.jsx("span",{className:"min-w-0 flex-1 truncate text-left",children:t.label}),e[0]=t.label,e[1]=i):i=e[1];const r=i;if(!t.description){let m;return e[2]!==n||e[3]!==r||e[4]!==t.label?(m=s.jsx(ke,{value:t.label,disabled:n,className:"w-full justify-start px-3",children:r}),e[2]=n,e[3]=r,e[4]=t.label,e[5]=m):m=e[5],m}let o;e[6]!==n||e[7]!==t.label?(o=s.jsx(ke,{value:t.label,disabled:n,className:"w-full justify-start px-3"}),e[6]=n,e[7]=t.label,e[8]=o):o=e[8];let c;e[9]!==r||e[10]!==o?(c=s.jsx(Je,{render:o,children:r}),e[9]=r,e[10]=o,e[11]=c):c=e[11];let d;e[12]!==t.description?(d=s.jsx(Ze,{side:"right",className:"max-w-72 text-left",children:t.description}),e[12]=t.description,e[13]=d):d=e[13];let g;return e[14]!==c||e[15]!==d?(g=s.jsxs(et,{children:[c,d]}),e[14]=c,e[15]=d,e[16]=g):g=e[16],g}function Ue(l){const e=P.c(4),{children:t}=l;let n,i;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Se,{className:"text-info"}),i=s.jsx(_e,{children:"Answer to continue"}),e[0]=n,e[1]=i):(n=e[0],i=e[1]);let r;return e[2]!==t?(r=s.jsxs(qe,{className:"border-info/40 bg-info/5",children:[n,i,s.jsx("div",{className:"col-start-2 mt-1 min-w-0",children:t})]}),e[2]=t,e[3]=r):r=e[3],r}function es(l){const e=P.c(33),{request:t,responding:n,onChoose:i}=l;let r,o;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Pe,{className:"text-warning"}),o=s.jsx(_e,{children:"Claude declined this request"}),e[0]=r,e[1]=o):(r=e[0],o=e[1]);let c;e[2]!==t.originalModel?(c=s.jsxs("p",{className:"text-sm leading-relaxed text-foreground",children:[t.originalModel," would not answer. Retrying on a fallback model may work."]}),e[2]=t.originalModel,e[3]=c):c=e[3];let d;e[4]!==t.guidanceText?(d=t.guidanceText&&s.jsx("p",{className:"mt-1 text-sm leading-relaxed text-muted-foreground",children:t.guidanceText}),e[4]=t.guidanceText,e[5]=d):d=e[5];let g;e[6]!==i||e[7]!==t.requestId?(g=()=>i(t.requestId,"retry_fallback"),e[6]=i,e[7]=t.requestId,e[8]=g):g=e[8];let m;e[9]!==t.fallbackModel||e[10]!==n||e[11]!==g?(m=s.jsxs(U,{size:"sm",disabled:n,onClick:g,children:["Retry on ",t.fallbackModel]}),e[9]=t.fallbackModel,e[10]=n,e[11]=g,e[12]=m):m=e[12];let x;e[13]!==i||e[14]!==t.requestId?(x=()=>i(t.requestId,"edit_prompt"),e[13]=i,e[14]=t.requestId,e[15]=x):x=e[15];let j;e[16]!==n||e[17]!==x?(j=s.jsx(U,{variant:"outline",size:"sm",disabled:n,onClick:x,children:"Edit prompt"}),e[16]=n,e[17]=x,e[18]=j):j=e[18];let p;e[19]!==i||e[20]!==t.requestId?(p=()=>i(t.requestId,"cancelled"),e[19]=i,e[20]=t.requestId,e[21]=p):p=e[21];let u;e[22]!==n||e[23]!==p?(u=s.jsx(U,{variant:"ghost",size:"sm",disabled:n,className:"ml-auto text-muted-foreground",onClick:p,children:"Dismiss"}),e[22]=n,e[23]=p,e[24]=u):u=e[24];let a;e[25]!==u||e[26]!==m||e[27]!==j?(a=s.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[m,j,u]}),e[25]=u,e[26]=m,e[27]=j,e[28]=a):a=e[28];let h;return e[29]!==a||e[30]!==c||e[31]!==d?(h=s.jsxs(qe,{className:"border-warning/40 bg-warning/5",children:[r,o,s.jsxs("div",{className:"col-start-2 mt-1 min-w-0",children:[c,d,a]})]}),e[29]=a,e[30]=c,e[31]=d,e[32]=h):h=e[32],h}function Be(l){return l==="awaiting_approval"||l==="awaiting_prompt"||l==="awaiting_question"||l==="awaiting_answer"}function Ee(l){return l==="done"||l==="failed"}const Ye={awaiting_approval:0,awaiting_prompt:1,awaiting_question:2,awaiting_answer:3,running:4,failed:5,done:6};function ts(l,e,t,n,i,r){return t?"awaiting_approval":n?"awaiting_prompt":i?"awaiting_question":r||l.agentStatus==="deferred"||l.agentStatus==="idle"&&e?"awaiting_answer":l.agentTerminalReason?"failed":e&&l.agentStatus&&nt.has(l.agentStatus)?"running":"done"}const ss=6;function ns({sessions:l,procBySession:e,summaries:t,permissionsBySession:n,questionsBySession:i,elicitationsBySession:r,dialogsBySession:o,awaitingPlan:c,newlyCompleted:d,finishedLimit:g=ss,now:m=Date.now()}){const x=[];for(const u of tt(l)){const a=n.get(u.sessionId)??[],h=i.get(u.sessionId)??[],f=r.get(u.sessionId)??[],y=o.get(u.sessionId)??[],v=c.has(u.sessionId),_=a.length+h.length+f.length+y.length+Number(v);u.teamName&&u.agentName&&_===0||x.push({session:u,state:ts(u,st(u,e,m),a.length>0,f.length>0||y.length>0,h.length>0,v),summary:t.get(u.sessionId)??null,permissions:a,questions:h,elicitations:f,dialogs:y})}const j=x.filter(u=>Ee(u.state)),p=[...j.filter(u=>d.has(u.session.sessionId)),...j.filter(u=>!d.has(u.session.sessionId))].slice(0,g);return[...x.filter(u=>!Ee(u.state)),...p].sort((u,a)=>Ye[u.state]-Ye[a.state])}function is(l,e){switch(e){case"running":return l.filter(t=>t.state==="running");case"needs-you":return l.filter(t=>Be(t.state));case"finished":return l.filter(t=>Ee(t.state));default:return l}}function ls(l){const e={total:l.length,running:0,needsYou:0,finished:0,failed:0};for(const t of l)t.state==="running"&&e.running++,Be(t.state)&&e.needsYou++,Ee(t.state)&&e.finished++,t.state==="failed"&&e.failed++;return e}function os(l){return l>=90?"text-destructive":l>=70?"text-warning":"text-muted-foreground"}const as={awaiting_approval:{label:"Waiting for approval",text:"text-warning",shell:"border-warning/40 bg-warning/5",icon:Se},awaiting_prompt:{label:"Waiting for your input",text:"text-info",shell:"border-info/40 bg-info/5",icon:Se},awaiting_question:{label:"Waiting for your answer",text:"text-info",shell:"border-info/40 bg-info/5",icon:Se},awaiting_answer:{label:"Waiting for your answer",text:"text-warning",shell:"border-warning/40 bg-warning/5",icon:Se},running:{label:"Running",text:"text-info",shell:"border-border",icon:null},done:{label:"Done",text:"text-success",shell:"border-border",icon:qt},failed:{label:"Failed",text:"text-destructive",shell:"border-destructive/40",icon:_t}};function rs(l){const e=P.c(3),{icon:t}=l;if(!t){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("span",{className:"size-2 shrink-0 rounded-full bg-info"}),e[0]=i):i=e[0],i}let n;return e[1]!==t?(n=s.jsx(t,{className:"size-3.5 shrink-0"}),e[1]=t,e[2]=n):n=e[2],n}const cs=V.memo(function(e){const t=P.c(88),{card:n,customName:i,projectLabel:r,responding:o,goneQuestions:c,compact:d,onOpen:g,onRespond:m,onAnswerQuestion:x,onAnswerElicitation:j,onChooseDialog:p}=e,u=d===void 0?!1:d,{session:a,state:h,summary:f,permissions:y,questions:v,elicitations:_,dialogs:T}=n,N=as[h],b=y[0],q=v[0],S=_[0],w=T[0],I=!!(b||q||S||w);let z;t[0]!==i||t[1]!==a?(z=it(a,i),t[0]=i,t[1]=a,t[2]=z):z=t[2];const L=z,k=u&&"gap-1.5 py-2";let R;t[3]!==N.shell||t[4]!==k?(R=ue("motion-card motion-list-item group flex min-w-0 flex-col gap-2 rounded-lg border bg-card p-3 text-left transition-colors hover:border-foreground/20",N.shell,k),t[3]=N.shell,t[4]=k,t[5]=R):R=t[5];const $=`Open session ${L}`;let A;t[6]!==r?(A=s.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",children:r}),t[6]=r,t[7]=A):A=t[7];let E;t[8]!==f?(E=(f==null?void 0:f.model)&&s.jsx("span",{className:"shrink-0 font-mono text-xs text-muted-foreground",children:lt(f.model)}),t[8]=f,t[9]=E):E=t[9];let C;t[10]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx($e,{"data-icon":"inline-end",className:"shrink-0 text-transparent transition-colors group-hover:text-muted-foreground"}),t[10]=C):C=t[10];let D;t[11]!==A||t[12]!==E?(D=s.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[A,E,C]}),t[11]=A,t[12]=E,t[13]=D):D=t[13];const O=u?"truncate":"line-clamp-2";let se;t[14]!==O?(se=ue("text-sm font-medium leading-snug text-foreground",O),t[14]=O,t[15]=se):se=t[15];let B;t[16]!==se||t[17]!==L?(B=s.jsx("span",{className:se,children:L}),t[16]=se,t[17]=L,t[18]=B):B=t[18];let ne;t[19]!==g||t[20]!==B||t[21]!==$||t[22]!==D?(ne=s.jsxs(U,{variant:"ghost",onClick:g,className:"-m-1 h-auto min-w-0 flex-col items-stretch justify-start gap-1 whitespace-normal p-1 text-left","aria-label":$,children:[D,B]}),t[19]=g,t[20]=B,t[21]=$,t[22]=D,t[23]=ne):ne=t[23];let ie;t[24]!==N.text?(ie=ue("flex items-center gap-1.5 text-xs font-medium",N.text),t[24]=N.text,t[25]=ie):ie=t[25];let le;t[26]!==N.icon?(le=s.jsx(rs,{icon:N.icon}),t[26]=N.icon,t[27]=le):le=t[27];let te;t[28]!==N.label?(te=s.jsx("span",{className:"truncate",children:N.label}),t[28]=N.label,t[29]=te):te=t[29];const ce=a.lastActivityAt||a.lastModified;let G;t[30]!==ce?(G=ot(ce),t[30]=ce,t[31]=G):G=t[31];let oe;t[32]!==G?(oe=s.jsx("span",{className:"ml-auto shrink-0 font-mono text-xs font-normal text-muted-foreground",children:G}),t[32]=G,t[33]=oe):oe=t[33];let Q;t[34]!==ie||t[35]!==le||t[36]!==te||t[37]!==oe?(Q=s.jsxs("div",{className:ie,children:[le,te,oe]}),t[34]=ie,t[35]=le,t[36]=te,t[37]=oe,t[38]=Q):Q=t[38];let H;t[39]!==m||t[40]!==y.length||t[41]!==b||t[42]!==o||t[43]!==a.sessionId?(H=b&&s.jsx(Kt,{request:b,queued:y.length-1,responding:o.has(b.requestId),onRespond:(re,Y)=>m(a.sessionId,re,Y)}),t[39]=m,t[40]=y.length,t[41]=b,t[42]=o,t[43]=a.sessionId,t[44]=H):H=t[44];let K;t[45]!==w||t[46]!==p||t[47]!==b||t[48]!==o||t[49]!==a.sessionId?(K=!b&&w&&s.jsx(es,{request:w,responding:o.has(w.requestId),onChoose:(re,Y)=>p(a.sessionId,re,Y)},w.requestId),t[45]=w,t[46]=p,t[47]=b,t[48]=o,t[49]=a.sessionId,t[50]=K):K=t[50];let W;t[51]!==w||t[52]!==S||t[53]!==j||t[54]!==b||t[55]!==o||t[56]!==a.sessionId?(W=!b&&!w&&S&&s.jsx(Pt,{request:S,responding:o.has(S.requestId),onAnswer:(re,Y)=>j(a.sessionId,re,Y)},S.requestId),t[51]=w,t[52]=S,t[53]=j,t[54]=b,t[55]=o,t[56]=a.sessionId,t[57]=W):W=t[57];let X;t[58]!==w||t[59]!==S||t[60]!==c||t[61]!==x||t[62]!==g||t[63]!==q||t[64]!==b||t[65]!==o||t[66]!==a.sessionId?(X=!b&&!w&&!S&&q&&s.jsx(Zt,{request:q,responding:o.has(q.toolUseId),gone:c.has(q.toolUseId),onAnswer:(re,Y)=>x(a.sessionId,re,Y),onOpenSession:g},q.toolUseId),t[58]=w,t[59]=S,t[60]=c,t[61]=x,t[62]=g,t[63]=q,t[64]=b,t[65]=o,t[66]=a.sessionId,t[67]=X):X=t[67];let Z;t[68]!==I||t[69]!==f?(Z=!I&&(f==null?void 0:f.currentTool)&&s.jsx(ds,{tool:f.currentTool}),t[68]=I,t[69]=f,t[70]=Z):Z=t[70];let J;t[71]!==I||t[72]!==u||t[73]!==f?(J=!u&&!I&&(f==null?void 0:f.lastAssistantText)&&s.jsx("p",{className:"line-clamp-4 text-sm leading-relaxed text-muted-foreground",children:f.lastAssistantText}),t[71]=I,t[72]=u,t[73]=f,t[74]=J):J=t[74];let ee;t[75]!==f?(ee=f&&s.jsx(us,{summary:f}),t[75]=f,t[76]=ee):ee=t[76];let ae;return t[77]!==ne||t[78]!==Q||t[79]!==H||t[80]!==K||t[81]!==W||t[82]!==X||t[83]!==Z||t[84]!==J||t[85]!==ee||t[86]!==R?(ae=s.jsxs("div",{className:R,children:[ne,Q,H,K,W,X,Z,J,ee]}),t[77]=ne,t[78]=Q,t[79]=H,t[80]=K,t[81]=W,t[82]=X,t[83]=Z,t[84]=J,t[85]=ee,t[86]=R,t[87]=ae):ae=t[87],ae});function ds(l){const e=P.c(7),{tool:t}=l;let n;e[0]!==t.name?(n=s.jsx("span",{className:"shrink-0 font-mono text-xs text-muted-foreground",children:t.name}),e[0]=t.name,e[1]=n):n=e[1];let i;e[2]!==t.summary?(i=s.jsx("code",{className:"min-w-0 flex-1 truncate font-mono text-xs text-foreground/80",children:t.summary}),e[2]=t.summary,e[3]=i):i=e[3];let r;return e[4]!==n||e[5]!==i?(r=s.jsxs("div",{className:"flex min-w-0 items-center gap-2 rounded-md bg-muted/50 px-2.5 py-2",children:[n,i]}),e[4]=n,e[5]=i,e[6]=r):r=e[6],r}function us(l){const e=P.c(11),{summary:t}=l,n=t.filesTotal,i=t.context,r=n.count>0,o=i!==null&&i.used>0;if(!r&&!o)return null;let c;e[0]!==n.additions||e[1]!==n.count||e[2]!==n.deletions||e[3]!==r?(c=r&&s.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[s.jsxs("span",{className:"truncate",children:[n.count," file",n.count===1?"":"s"]}),s.jsx(at,{add:n.additions,del:n.deletions})]}),e[0]=n.additions,e[1]=n.count,e[2]=n.deletions,e[3]=r,e[4]=c):c=e[4];let d;e[5]!==i||e[6]!==o?(d=o&&s.jsxs("span",{className:ue("ml-auto shrink-0",os(i.percent)),children:["ctx ",i.percent,"%"]}),e[5]=i,e[6]=o,e[7]=d):d=e[7];let g;return e[8]!==c||e[9]!==d?(g=s.jsxs("div",{className:"mt-auto flex items-center gap-2 border-t pt-2 font-mono text-xs text-muted-foreground",children:[c,d]}),e[8]=c,e[9]=d,e[10]=g):g=e[10],g}const fs=8e3,ms=12,xs="Start Claude Code, Codex, or Copilot and every session shows up here",hs=[{id:"all",label:"All"},{id:"running",label:"Running"},{id:"needs-you",label:"Needs you"},{id:"finished",label:"Finished"}],gs=[{id:"grid",label:"Grid layout",Icon:Ct},{id:"list",label:"List layout",Icon:Tt}];function Ns(l){const e=P.c(118),{onSelectSession:t}=l,{sessions:n,procBySession:i,newlyCompleted:r,refresh:o}=rt(),{summaries:c,loading:d,error:g,refresh:m}=Mt(),{permissionsBySession:x,questionsBySession:j,elicitationsBySession:p,dialogsBySession:u,awaitingPlan:a,responding:h,respond:f,answerQuestion:y,answerElicitation:v,answerDialog:_,refresh:T}=ct();let N;e[0]===Symbol.for("react.memo_cache_sentinel")?(N=new Set,e[0]=N):N=e[0];const[b,q]=V.useState(N),{names:S}=dt(),{names:w}=ut(),[I,z]=V.useState("all");let L;e[1]===Symbol.for("react.memo_cache_sentinel")?(L=ft("mission-control-layout"),e[1]=L):L=e[1];const[k,R]=mt(L,"grid");let $;e[2]!==a||e[3]!==u||e[4]!==p||e[5]!==r||e[6]!==x||e[7]!==i||e[8]!==j||e[9]!==n||e[10]!==c?($=ns({sessions:n,procBySession:i,summaries:c,permissionsBySession:x,questionsBySession:j,elicitationsBySession:p,dialogsBySession:u,awaitingPlan:a,newlyCompleted:r}),e[2]=a,e[3]=u,e[4]=p,e[5]=r,e[6]=x,e[7]=i,e[8]=j,e[9]=n,e[10]=c,e[11]=$):$=e[11];const A=$;let E;e[12]!==A?(E=ls(A),e[12]=A,e[13]=E):E=e[13];const C=E;let D;e[14]!==A||e[15]!==I?(D=is(A,I),e[14]=A,e[15]=I,e[16]=D):D=e[16];const O=D;let se;e[17]!==T||e[18]!==o||e[19]!==m?(se=()=>{o(),m(),T()},e[17]=T,e[18]=o,e[19]=m,e[20]=se):se=e[20];const B=se;let ne,ie;e[21]!==o?(ne=()=>{const F=setInterval(()=>{document.visibilityState==="visible"&&o()},fs);return()=>clearInterval(F)},ie=[o],e[21]=o,e[22]=ne,e[23]=ie):(ne=e[22],ie=e[23]),V.useEffect(ne,ie);let le;e[24]!==y?(le=async(F,M,Me)=>{(await y(F,M,Me)).ok||q(Ge=>new Set(Ge).add(M))},e[24]=y,e[25]=le):le=e[25];const te=le;let ce;e[26]!==A.length?(ce=function(M){A.length<=ms?Ot(M,{kind:"fade"}):V.startTransition(M)},e[26]=A.length,e[27]=ce):ce=e[27];const G=ce;let oe;e[28]===Symbol.for("react.memo_cache_sentinel")?(oe=s.jsx("h2",{className:"truncate text-sm font-semibold",children:"Mission Control"}),e[28]=oe):oe=e[28];let Q;e[29]!==C.total?(Q=s.jsx(Te,{variant:"secondary",children:C.total}),e[29]=C.total,e[30]=Q):Q=e[30];let H;e[31]!==C.needsYou?(H=C.needsYou>0&&s.jsxs(Te,{variant:"outline",className:"border-warning/40 text-warning",children:[C.needsYou," need you"]}),e[31]=C.needsYou,e[32]=H):H=e[32];let K;e[33]!==C.failed?(K=C.failed>0&&s.jsxs(Te,{variant:"destructive",children:[C.failed," failed"]}),e[33]=C.failed,e[34]=K):K=e[34];let W;e[35]!==Q||e[36]!==H||e[37]!==K?(W=s.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[oe,Q,H,K]}),e[35]=Q,e[36]=H,e[37]=K,e[38]=W):W=e[38];let X;e[39]!==I?(X=[I],e[39]=I,e[40]=X):X=e[40];let Z;e[41]!==I||e[42]!==G?(Z=F=>{const M=F.at(-1);M&&M!==I&&G(()=>z(M))},e[41]=I,e[42]=G,e[43]=Z):Z=e[43];let J;e[44]!==C.needsYou?(J=hs.map(F=>s.jsxs(ke,{value:F.id,"aria-label":`Show ${F.label.toLowerCase()} sessions`,children:[F.label,F.id==="needs-you"&&C.needsYou>0&&s.jsx("span",{className:"font-mono text-warning",children:C.needsYou})]},F.id)),e[44]=C.needsYou,e[45]=J):J=e[45];let ee;e[46]!==X||e[47]!==Z||e[48]!==J?(ee=s.jsx(ze,{value:X,onValueChange:Z,variant:"outline",size:"sm",spacing:0,"aria-label":"Filter sessions",children:J}),e[46]=X,e[47]=Z,e[48]=J,e[49]=ee):ee=e[49];let ae;e[50]!==k||e[51]!==R||e[52]!==G?(ae=gs.map(F=>{const{id:M,label:Me,Icon:Oe}=F;return s.jsx(U,{variant:"ghost",size:"icon-xs","aria-label":Me,"aria-pressed":k===M,onClick:()=>{M!==k&&G(()=>R(M))},className:ue(k===M&&"bg-accent text-accent-foreground"),children:s.jsx(Oe,{"data-icon":"inline-start"})},M)}),e[50]=k,e[51]=R,e[52]=G,e[53]=ae):ae=e[53];const re=d&&"animate-spin";let Y;e[54]!==re?(Y=ue(re),e[54]=re,e[55]=Y):Y=e[55];let fe;e[56]!==Y?(fe=s.jsx(At,{"data-icon":"inline-start",className:Y}),e[56]=Y,e[57]=fe):fe=e[57];let me;e[58]!==B||e[59]!==fe?(me=s.jsx(U,{variant:"ghost",size:"icon-xs","aria-label":"Refresh Mission Control",onClick:B,children:fe}),e[58]=B,e[59]=fe,e[60]=me):me=e[60];let xe;e[61]!==ae||e[62]!==me?(xe=s.jsxs("div",{className:"flex items-center gap-1",children:[ae,me]}),e[61]=ae,e[62]=me,e[63]=xe):xe=e[63];let he;e[64]!==ee||e[65]!==xe?(he=s.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[ee,xe]}),e[64]=ee,e[65]=xe,e[66]=he):he=e[66];let ge;e[67]!==W||e[68]!==he?(ge=s.jsxs("header",{className:"flex min-h-12 shrink-0 flex-wrap items-center gap-3 border-b px-4 py-2",children:[W,he]}),e[67]=W,e[68]=he,e[69]=ge):ge=e[69];let pe;e[70]!==g||e[71]!==B?(pe=g&&s.jsxs(qe,{variant:"destructive",className:"mb-4",children:[s.jsx(Et,{}),s.jsx(_e,{children:"Mission Control could not refresh"}),s.jsx(wt,{className:"truncate",children:g}),s.jsx(vt,{children:s.jsx(U,{variant:"outline",size:"xs",onClick:B,children:"Retry"})})]}),e[70]=g,e[71]=B,e[72]=pe):pe=e[72];let be;e[73]!==A.length||e[74]!==I||e[75]!==d||e[76]!==O.length?(be=O.length===0&&!d&&s.jsx(xt,{className:"min-h-64",children:s.jsxs(ht,{children:[s.jsx(gt,{variant:"icon",children:s.jsx(kt,{})}),s.jsx(pt,{children:A.length===0?"No live sessions":`Nothing matches "${I}"`}),s.jsx(bt,{children:A.length===0?xs:"Try a different filter."})]})}),e[73]=A.length,e[74]=I,e[75]=d,e[76]=O.length,e[77]=be):be=e[77];let je;e[78]!==A.length||e[79]!==d||e[80]!==O.length?(je=O.length===0&&d&&A.length===0&&s.jsxs("div",{className:"flex items-center justify-center gap-2 py-16 text-sm text-muted-foreground",children:[s.jsx(jt,{}),"Loading sessions…"]}),e[78]=A.length,e[79]=d,e[80]=O.length,e[81]=je):je=e[81];const Re=k==="grid"&&"md:grid-cols-2 2xl:grid-cols-3";let we;e[82]!==Re?(we=ue("grid grid-cols-1 gap-3",Re),e[82]=Re,e[83]=we):we=e[83];let ve;if(e[84]!==_||e[85]!==v||e[86]!==b||e[87]!==te||e[88]!==k||e[89]!==t||e[90]!==w||e[91]!==f||e[92]!==h||e[93]!==S||e[94]!==O){let F;e[96]!==_||e[97]!==v||e[98]!==b||e[99]!==te||e[100]!==k||e[101]!==t||e[102]!==w||e[103]!==f||e[104]!==h||e[105]!==S?(F=M=>s.jsx(cs,{card:M,compact:k==="list",customName:S[M.session.sessionId],projectLabel:w[M.session.dirName]??Nt(M.session),responding:h,goneQuestions:b,onOpen:()=>t(M.session.dirName,M.session.fileName),onRespond:f,onAnswerQuestion:te,onAnswerElicitation:v,onChooseDialog:_},M.session.sessionId),e[96]=_,e[97]=v,e[98]=b,e[99]=te,e[100]=k,e[101]=t,e[102]=w,e[103]=f,e[104]=h,e[105]=S,e[106]=F):F=e[106],ve=O.map(F),e[84]=_,e[85]=v,e[86]=b,e[87]=te,e[88]=k,e[89]=t,e[90]=w,e[91]=f,e[92]=h,e[93]=S,e[94]=O,e[95]=ve}else ve=e[95];let Ne;e[107]!==we||e[108]!==ve?(Ne=s.jsx("div",{className:we,children:ve}),e[107]=we,e[108]=ve,e[109]=Ne):Ne=e[109];let ye;e[110]!==pe||e[111]!==be||e[112]!==je||e[113]!==Ne?(ye=s.jsx(yt,{className:"flex-1",children:s.jsxs("div",{className:"p-4",children:[pe,be,je,Ne]})}),e[110]=pe,e[111]=be,e[112]=je,e[113]=Ne,e[114]=ye):ye=e[114];let Ce;return e[115]!==ge||e[116]!==ye?(Ce=s.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[ge,ye]}),e[115]=ge,e[116]=ye,e[117]=Ce):Ce=e[117],Ce}export{Ns as MissionControl};
@@ -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};