cogpit 2.3.0 → 2.4.2
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.js +5644 -4349
- package/dist/web/assets/{CommandPaletteHost-D-VvT_HL.js → CommandPaletteHost-DJghey7B.js} +1 -1
- package/dist/web/assets/{ConfigBrowser-Cc2lrh85.js → ConfigBrowser-x0UdXG0K.js} +1 -1
- package/dist/web/assets/{HighlightedEditor-DWNz1Jcz.js → HighlightedEditor-D0TDZx8S.js} +1 -1
- package/dist/web/assets/{KeyboardShortcutsDialog-yOs1u5D6.js → KeyboardShortcutsDialog-2606YXAx.js} +1 -1
- package/dist/web/assets/{MobileFileChanges-B1dtcdSZ.js → MobileFileChanges-B4dwGXMS.js} +1 -1
- package/dist/web/assets/{PreviewPanel-BJwfunf9.js → PreviewPanel-CJdf-VLC.js} +1 -1
- package/dist/web/assets/{ProjectFilesPanel-DppuIFEt.js → ProjectFilesPanel-3GzuQyp3.js} +1 -1
- package/dist/web/assets/{ProjectSwitcherModal-DgsuH5CY.js → ProjectSwitcherModal-D8boI2Qx.js} +1 -1
- package/dist/web/assets/{TerminalOutput-DlGDS0Wx.js → TerminalOutput-C-6RWc6C.js} +1 -1
- package/dist/web/assets/{ThemeSelectorModal-oI9Vm3EH.js → ThemeSelectorModal-DZ9JuT6j.js} +1 -1
- package/dist/web/assets/{WorkflowsPanel-SKbsv_IK.js → WorkflowsPanel-i3GanFyN.js} +1 -1
- package/dist/web/assets/{WorktreePanel-CcSLupr7.js → WorktreePanel-D-BUTFL2.js} +1 -1
- package/dist/web/assets/{index-BVkjlOVU.js → index-BBKPLXTq.js} +1 -1
- package/dist/web/assets/index-CMQcske6.js +1 -0
- package/dist/web/assets/index-C_0XOtqJ.css +1 -0
- package/dist/web/assets/index-D6p4gVB_.js +154 -0
- package/dist/web/assets/{index-7FuVzOBC.js → index-ztb2qsgi.js} +1 -1
- package/dist/web/assets/{session-parser.worker-RMitC4X_.js → session-parser.worker-D3MwyNH5.js} +1 -1
- package/dist/web/assets/vendor-ui-RwWl1mlR.js +882 -0
- package/dist/web/index.html +3 -3
- package/package.json +1 -1
- package/dist/web/assets/index-Bw-DFQut.js +0 -1
- package/dist/web/assets/index-Du17HzQD.js +0 -151
- package/dist/web/assets/index-xdv0cIL2.css +0 -1
- package/dist/web/assets/vendor-ui-CdA11Wfh.js +0 -817
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as h,j as e}from"./vendor-react-gGw_S5I_.js";import{ak as K,B as d,_ as A,l as Q,E as V,y as Y,z as Z,G as _,H as ee,a2 as se,al as ne,am as te,an as ae,ao as re,a9 as R,aa as z,ab as E,ap as ie,ac as S,ad as U,ae as F,af as T,ag as $,w as u,aq as c}from"./index-
|
|
1
|
+
import{r as h,j as e}from"./vendor-react-gGw_S5I_.js";import{ak as K,B as d,_ as A,l as Q,E as V,y as Y,z as Z,G as _,H as ee,a2 as se,al as ne,am as te,an as ae,ao as re,a9 as R,aa as z,ab as E,ap as ie,ac as S,ad as U,ae as F,af as T,ag as $,w as u,aq as c}from"./index-D6p4gVB_.js";import{G as P,m as le,b as oe,X as ce,c as de,n as me,o as O,C as he,l as xe}from"./vendor-ui-RwWl1mlR.js";import"./vendor-shiki-DOn6sF-i.js";import"./vendor-markdown-BE1gYnO9.js";const ue={M:"text-warning",A:"text-success",D:"text-destructive",R:"text-info"};function ve({worktrees:v,loading:p,dirName:r,onRefetch:g,onOpenSession:I,onClose:M}){const o=K("hostFiles"),[B,y]=h.useState(null),[G,b]=h.useState(null),[H,x]=h.useState(!1),[n,m]=h.useState(null),[a,j]=h.useState(null),C=async s=>{if(!(!o||!r)){y(s.name);try{await u(`/api/worktrees/${encodeURIComponent(r)}/${encodeURIComponent(s.name)}`,{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({force:s.isDirty})}),g()}catch(t){c.error(`Failed to delete worktree: ${t instanceof Error?t.message:"Unknown error"}`)}finally{y(null)}}},J=s=>{if(!(!o||!r)){if(s.isDirty){m({worktree:s,reason:"dirty"});return}if(s.commitsAhead>0){m({worktree:s,reason:"unpushed"});return}C(s)}},W=()=>{if(!n)return;const{worktree:s,reason:t}=n;if(t==="dirty"&&s.commitsAhead>0){m({worktree:s,reason:"unpushed"});return}m(null),C(s)},L=async s=>{if(!(!o||!r)){b(s.name);try{const t=await u(`/api/worktrees/${encodeURIComponent(r)}/create-pr`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({worktreeName:s.name,title:s.name.replace(/-/g," ")})});if(t.ok){const l=await t.json();l.url?window.open(l.url,"_blank","noopener,noreferrer"):c.warning("PR created but no URL was returned")}else{const l=await t.json().catch(()=>({error:"Unknown error"}));c.error(`Failed to create PR: ${l.error||"Unknown error"}`)}}catch(t){c.error(`Error creating PR: ${t instanceof Error?t.message:"Unknown error"}`)}finally{b(null)}}},q=async()=>{if(!(!o||!r)){x(!0);try{const s=await u(`/api/worktrees/${encodeURIComponent(r)}/cleanup`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})});if(s.ok){const{stale:t}=await s.json();t.length===0?c.info("No stale worktrees found"):j(t.map(l=>l.name))}}catch(s){c.error(`Cleanup failed: ${s instanceof Error?s.message:"Unknown error"}`)}finally{x(!1)}}},X=async()=>{if(!o||!r||!a)return;const s=a;j(null),x(!0);try{await u(`/api/worktrees/${encodeURIComponent(r)}/cleanup`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({confirm:!0,names:s})}),g()}catch(t){c.error(`Cleanup failed: ${t instanceof Error?t.message:"Unknown error"}`)}finally{x(!1)}};return e.jsxs(e.Fragment,{children:[e.jsxs("aside",{"aria-label":"Worktrees",className:"flex size-full min-h-0 flex-col bg-background",children:[e.jsxs("div",{className:"flex h-10 shrink-0 items-center gap-2 px-3",children:[e.jsx(P,{"data-icon":"inline-start","aria-hidden":"true",className:"size-4 text-muted-foreground"}),e.jsx("h2",{className:"text-sm font-medium",children:"Worktrees"}),e.jsx("div",{className:"flex-1"}),o&&e.jsx(d,{variant:"ghost",size:"icon-sm",onClick:q,disabled:H,"aria-label":"Cleanup stale worktrees",children:e.jsx(le,{"data-icon":"inline-start"})}),e.jsx(d,{variant:"ghost",size:"icon-sm",onClick:g,disabled:p,"aria-label":"Refresh worktrees",children:e.jsx(oe,{"data-icon":"inline-start",className:A(p&&"animate-spin")})}),e.jsx(d,{variant:"ghost",size:"icon-sm",onClick:M,"aria-label":"Close worktrees",children:e.jsx(ce,{"data-icon":"inline-start"})})]}),e.jsx(Q,{}),e.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto p-3",children:[!r&&e.jsx("div",{className:"flex items-center justify-center h-full text-sm text-muted-foreground",children:"Select a project to view worktrees"}),r&&v.length===0&&!p&&e.jsx(V,{className:"border-0 py-16",children:e.jsxs(Y,{children:[e.jsx(Z,{variant:"icon",children:e.jsx(P,{})}),e.jsx(_,{children:"No worktrees"}),e.jsx(ee,{children:"Create a new session with “Isolate in worktree” enabled"})]})}),v.map(s=>{var N,w,D;const t=((N=s.changedFiles)==null?void 0:N.reduce((i,k)=>i+k.additions,0))??0,l=((w=s.changedFiles)==null?void 0:w.reduce((i,k)=>i+k.deletions,0))??0,f=((D=s.changedFiles)==null?void 0:D.length)??0;return e.jsxs("div",{className:"rounded-lg border bg-card p-3 transition-colors hover:bg-accent/40",children:[e.jsxs("div",{className:"mb-1.5 flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:s.name}),s.isDirty&&e.jsx("span",{className:"flex size-2 shrink-0 rounded-full bg-warning",title:"Uncommitted changes"}),s.commitsAhead>0&&e.jsxs(se,{variant:"outline",className:"h-5 shrink-0 px-1.5 text-xs",children:[s.commitsAhead," ahead"]})]}),e.jsxs("div",{className:"flex shrink-0 items-center gap-0.5",children:[s.linkedSessions.length>0&&e.jsx(d,{variant:"ghost",size:"icon-xs",onClick:()=>I(s.linkedSessions[0]),"aria-label":"Open session",children:e.jsx(de,{"data-icon":"inline-start"})}),o&&e.jsxs(e.Fragment,{children:[e.jsx(d,{variant:"ghost",size:"icon-xs",onClick:()=>L(s),disabled:G===s.name||s.commitsAhead===0,"aria-label":"Create PR",children:e.jsx(me,{"data-icon":"inline-start"})}),e.jsx(d,{variant:"ghost",size:"icon-xs",onClick:()=>J(s),disabled:B===s.name,className:"text-destructive hover:bg-destructive/10 hover:text-destructive","aria-label":"Delete worktree",children:e.jsx(O,{"data-icon":"inline-start"})})]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[e.jsx("span",{className:"shrink-0 font-mono",children:s.head}),e.jsx("span",{className:"truncate",children:s.headMessage})]}),s.createdAt&&e.jsx("div",{className:"mt-0.5 text-xs text-muted-foreground",children:ne(s.createdAt)}),f>0&&e.jsxs(te,{className:"mt-2",children:[e.jsxs(ae,{className:"group flex w-full items-center gap-1.5 text-xs text-muted-foreground transition-colors hover:text-foreground",children:[e.jsx(he,{"data-icon":"inline-start",className:"size-3 transition-transform group-data-panel-open:rotate-90 motion-reduce:transition-none"}),e.jsx(xe,{"data-icon":"inline-start",className:"size-3"}),e.jsxs("span",{children:[f," file",f!==1?"s":""," changed"]}),e.jsxs("span",{className:"ml-1",children:[e.jsxs("span",{className:"text-success",children:["+",t]})," ",e.jsxs("span",{className:"text-destructive",children:["-",l]})]})]}),e.jsx(re,{children:e.jsx("div",{className:"mt-1.5 flex flex-col gap-px rounded-md bg-muted/40 p-1.5",children:s.changedFiles.map(i=>e.jsxs("div",{className:"flex items-center gap-2 px-1 py-0.5 font-mono text-xs",children:[e.jsx("span",{className:A("shrink-0 w-3 text-center",ue[i.status]??"text-muted-foreground"),children:i.status}),e.jsx("span",{className:"truncate text-foreground/80",children:i.path}),e.jsxs("span",{className:"ml-auto shrink-0 text-muted-foreground",children:[e.jsxs("span",{className:"text-success",children:["+",i.additions]})," ",e.jsxs("span",{className:"text-destructive",children:["-",i.deletions]})]})]},i.path))})})]})]},s.name)})]})]}),e.jsx(R,{open:n!==null,onOpenChange:s=>{s||m(null)},children:e.jsxs(z,{size:"sm",children:[e.jsxs(E,{children:[e.jsx(ie,{className:"bg-destructive/10 text-destructive",children:e.jsx(O,{})}),e.jsx(S,{children:(n==null?void 0:n.reason)==="dirty"?"Delete worktree with uncommitted changes?":"Delete worktree with unpushed commits?"}),e.jsxs(U,{children:[(n==null?void 0:n.reason)==="dirty"?`"${n.worktree.name}" has uncommitted changes.`:`"${n==null?void 0:n.worktree.name}" has ${n==null?void 0:n.worktree.commitsAhead} unpushed commit(s).`," "," ","Deleting it cannot be undone."]})]}),e.jsxs(F,{children:[e.jsx(T,{size:"sm",children:"Cancel"}),e.jsx($,{variant:"destructive",size:"sm",onClick:W,children:(n==null?void 0:n.reason)==="dirty"&&n.worktree.commitsAhead>0?"Continue":"Delete worktree"})]})]})}),e.jsx(R,{open:a!==null,onOpenChange:s=>{s||j(null)},children:e.jsxs(z,{children:[e.jsxs(E,{children:[e.jsx(S,{children:"Remove stale worktrees?"}),e.jsxs(U,{children:[a==null?void 0:a.length," stale worktree",(a==null?void 0:a.length)===1?"":"s"," will be removed: ",a==null?void 0:a.join(", "),"."]})]}),e.jsxs(F,{children:[e.jsx(T,{size:"sm",children:"Cancel"}),e.jsx($,{variant:"destructive",size:"sm",onClick:()=>void X(),children:"Remove worktrees"})]})]})})]})}export{ve as WorktreePanel};
|
|
@@ -1 +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};
|
|
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-D6p4gVB_.js";import{c as St,aj as It,aq as Pe,C as $e,ar as Se,ag as _t,as as qt,L as Ct,at as Tt,au as kt,b as At,i as Et}from"./vendor-ui-RwWl1mlR.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 Y,j as t,r as v}from"./vendor-react-gGw_S5I_.js";import{_ as Ye,V as le,aV as Ee,aW as J,m as dt,n as ut,I as ft,W as Ct,X as _t,aX as At,B as ce,aY as mt,w as Ie,aZ as ht,am as xt,an as pt,ao as gt,a_ as nt,a2 as et,a$ as $t,aw as Et,ax as zt,b0 as jt,i as Tt,j as It,k as Dt,b1 as Pt,U as Lt,a8 as Ft,h as Rt,D as Ut}from"./index-D6p4gVB_.js";import{a5 as Bt,a6 as Ot,a7 as Vt,a8 as Mt,e as Ht,T as Gt,M as Wt,a9 as Xt,aa as qt,ab as Kt,$ as bt,C as vt,ac as it,ad as Jt,F as Yt,A as Zt,ae as Qt,J as es,af as ts,ag as ss}from"./vendor-ui-RwWl1mlR.js";import"./vendor-shiki-DOn6sF-i.js";import"./vendor-markdown-BE1gYnO9.js";function ns(s){const e=Y.c(11);let n,a,i;e[0]!==s?({className:n,size:i,...a}=s,e[0]=s,e[1]=n,e[2]=a,e[3]=i):(n=e[1],a=e[2],i=e[3]);const r=i===void 0?"default":i;let l;e[4]!==n?(l=Ye("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]=l):l=e[5];let f;e[6]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(Ot,{"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 c;return e[7]!==a||e[8]!==r||e[9]!==l?(c=t.jsx(Bt,{"data-slot":"switch","data-size":r,className:l,...a,children:f}),e[7]=a,e[8]=r,e[9]=l,e[10]=c):c=e[10],c}function as(s){const e=Y.c(3),{name:n}=s,a=n.toLowerCase();if(a.includes("iphone")||a.includes("android")){let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Ht,{"data-icon":"inline-start",className:"size-4 text-muted-foreground"}),e[0]=r):r=e[0],r}if(a.includes("ipad")||a.includes("tablet")){let r;return e[1]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Gt,{"data-icon":"inline-start",className:"size-4 text-muted-foreground"}),e[1]=r):r=e[1],r}let i;return e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Wt,{"data-icon":"inline-start",className:"size-4 text-muted-foreground"}),e[2]=i):i=e[2],i}function at(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 a=Math.floor(n/60);return a<24?`${a}h ago`:`${Math.floor(a/24)}d ago`}function is(s){const e=[`Shared ${at(s.createdAt)}`,s.lastAccessAt>0?`opened ${at(s.lastAccessAt)}`:"never opened"];return s.guests>0&&e.push(s.guests===1?"1 guest":`${s.guests} guests`),e.join(" · ")}function ls(){const s=Y.c(12),{shares:e,revoke:n,revokeAll:a}=At();let i;s[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("p",{className:"text-xs text-muted-foreground",children:"Shared sessions"}),s[0]=i):i=s[0];let r;s[1]!==a||s[2]!==e.length?(r=e.length>0&&t.jsx(ce,{variant:"ghost",size:"xs",className:"text-destructive hover:text-destructive",onClick:()=>void a(),children:"Revoke all"}),s[1]=a,s[2]=e.length,s[3]=r):r=s[3];let l;s[4]!==r?(l=t.jsxs("div",{className:"flex h-6 items-center justify-between",children:[i,r]}),s[4]=r,s[5]=l):l=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(o=>{const m=o.title||o.sessionId;return t.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-lg border px-3 py-2",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"truncate text-sm text-foreground",children:m}),t.jsx("p",{className:"text-xs text-muted-foreground",children:is(o)})]}),t.jsx(ce,{variant:"ghost",size:"xs","aria-label":`Revoke share of ${m}`,className:"text-destructive hover:text-destructive",onClick:()=>void n(o.sessionId),children:"Revoke"})]},o.sessionId)})}),s[6]=n,s[7]=e,s[8]=f):f=s[8];let c;return s[9]!==l||s[10]!==f?(c=t.jsxs("div",{className:"flex flex-col gap-2",children:[l,f]}),s[9]=l,s[10]=f,s[11]=c):c=s[11],c}function rs(s){const e=Y.c(30),{networkAccess:n,setNetworkAccess:a,networkPassword:i,setNetworkPassword:r,showNetworkPassword:l,setShowNetworkPassword:f,hasExistingPassword:c,initialNetworkAccess:o,connectedDevices:m,minPasswordLength:b}=s;let x;e[0]!==n?(x=n?t.jsx(Xt,{"data-icon":"inline-start",className:"size-4 text-success"}):t.jsx(qt,{"data-icon":"inline-start",className:"size-4 text-muted-foreground"}),e[0]=n,e[1]=x):x=e[1];let j;e[2]===Symbol.for("react.memo_cache_sentinel")?(j=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]=j):j=e[2];let y;e[3]!==x?(y=t.jsxs("div",{className:"flex items-center gap-2",children:[x,j]}),e[3]=x,e[4]=y):y=e[4];let C;e[5]!==a?(C=_=>a(_),e[5]=a,e[6]=C):C=e[6];let w;e[7]!==n||e[8]!==C?(w=t.jsx(ns,{"aria-label":"Network Access",checked:n,onCheckedChange:C}),e[7]=n,e[8]=C,e[9]=w):w=e[9];let N;e[10]!==y||e[11]!==w?(N=t.jsxs("div",{className:"flex items-center justify-between",children:[y,w]}),e[10]=y,e[11]=w,e[12]=N):N=e[12];let p;e[13]!==c||e[14]!==b||e[15]!==n||e[16]!==i||e[17]!==r||e[18]!==f||e[19]!==l?(p=n&&t.jsxs(le,{"data-invalid":i.length>0&&i.length<b,children:[t.jsx(Ee,{htmlFor:"network-password",children:"Password"}),t.jsx(J,{children:c&&i.length===0?"A password is already set. Leave blank to keep it.":`Use at least ${b} characters.`}),t.jsxs(dt,{children:[t.jsx(ut,{id:"network-password",type:l?"text":"password",value:i,onChange:_=>r(_.target.value),placeholder:c?"Enter new password to change":"Set a password for remote access"}),t.jsx(ft,{align:"inline-end",children:t.jsx(Ct,{size:"icon-xs","aria-label":l?"Hide password":"Show password",onClick:()=>f(!l),children:l?t.jsx(Vt,{"data-icon":"inline-start"}):t.jsx(Mt,{"data-icon":"inline-start"})})})]}),i.length>0&&i.length<b&&t.jsxs(_t,{children:["Password must be at least ",b," characters (",i.length,"/",b,")"]}),t.jsx(J,{children:"Requires app restart. Remote browsers need an HTTPS reverse proxy; port 19384 remains available to Cogpit hubs and device clients."})]}),e[13]=c,e[14]=b,e[15]=n,e[16]=i,e[17]=r,e[18]=f,e[19]=l,e[20]=p):p=e[20];let u;e[21]!==m||e[22]!==o||e[23]!==n?(u=n&&o&&m.length>0&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("p",{className:"text-xs text-muted-foreground",children:"Connected devices"}),t.jsx("div",{className:"flex flex-col gap-1.5",children:m.map(os)})]}),e[21]=m,e[22]=o,e[23]=n,e[24]=u):u=e[24];let S;e[25]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(ls,{}),e[25]=S):S=e[25];let h;return e[26]!==N||e[27]!==p||e[28]!==u?(h=t.jsxs("div",{className:"flex flex-col gap-4 border-t pt-5",children:[N,p,u,S]}),e[26]=N,e[27]=p,e[28]=u,e[29]=h):h=e[29],h}function os(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(as,{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:at(s.lastActivity)})]})]},`${s.ip}-${e}`)}const cs=["auto","path","npm","bundled","custom"],tt={source:"auto"},ds=["path","npm","bundled"];function us(s){return cs.includes(s)}function fs(s){if(!s||typeof s!="object")return;const{source:e,path:n}=s;if(!(!us(e)||e==="auto"))return e==="custom"?typeof n=="string"&&n.trim()?{source:e,path:n.trim()}:void 0:{source:e}}const Te={auto:"Automatic",path:"Installed on PATH",npm:"Global npm install",bundled:"Bundled with Cogpit",custom:"Custom path"};function wt(s,e){return e?`v${e} · ${s}`:s}function ms(s,e){return s===null?"Checking installed binaries…":e?e.version===null?`${e.path} did not report a version — check the path.`:`Now running: ${wt(e.path,e.version)}`:"No launchable binary for the saved choice — sessions cannot start."}function hs(s){return s!==null&&s.version!==null}function xs(s){const e=Y.c(92),{kind:n,value:a,onChange:i,disabled:r,reportVersion:l}=s;let f;e[0]!==n?(f=mt(n),e[0]=n,e[1]=f):f=e[1];const{displayName:c}=f,[o,m]=v.useState(null),[b,x]=v.useState(!1),j=`agent-executable-${n}`;let y;e[2]!==n?(y=()=>{let I=!1;return Ie(`/api/agent-executable/${n}`).then(js).then(te=>{I||m(te)}).catch(gs),()=>{I=!0}},e[2]=n,e[3]=y):y=e[3];let C;e[4]!==n||e[5]!==l?(C=[n,l],e[4]=n,e[5]=l,e[6]=C):C=e[6],v.useEffect(y,C);let w,N,p,u,S,h,_,z,T,k,A,D,g;if(e[7]!==r||e[8]!==c||e[9]!==j||e[10]!==i||e[11]!==b||e[12]!==(o==null?void 0:o.active)||e[13]!==(o==null?void 0:o.candidates)||e[14]!==a.path||e[15]!==a.source){const I=new Map((o==null?void 0:o.candidates.map(ps))??[]);u=(o==null?void 0:o.active)??null;let te;e[29]!==r||e[30]!==j||e[31]!==i||e[32]!==a.path||e[33]!==a.source?(te=(L,B,ae,oe)=>{const lt=oe===void 0?!0:oe,K=`${j}-${L}`;return t.jsxs(le,{orientation:"horizontal",children:[t.jsx("input",{type:"radio",id:K,name:j,className:"mt-1 size-4 shrink-0 accent-primary",checked:a.source===L,disabled:r||!lt,onChange:()=>i(L==="custom"?{source:L,path:a.path??""}:{source:L})}),t.jsxs(ht,{children:[t.jsx(Ee,{htmlFor:K,children:B}),t.jsx(J,{className:"break-all",children:ae})]})]},L)},e[29]=r,e[30]=j,e[31]=i,e[32]=a.path,e[33]=a.source,e[34]=te):te=e[34],S=te;const se=L=>{const B=I.get(L);return S(L,Te[L],B?wt(B.path,B.version):"Not found on this machine.",B!==void 0||a.source===L)},ze=u?`${Te[a.source]} · v${u.version??"?"}`:Te[a.source];p=xt,D=b,g=x,h="flex flex-col gap-2";let X;e[35]===Symbol.for("react.memo_cache_sentinel")?(X=t.jsx(ce,{type:"button",variant:"ghost",className:"h-auto w-full justify-between px-0 font-medium hover:bg-transparent"}),e[35]=X):X=e[35];let ne;e[36]===Symbol.for("react.memo_cache_sentinel")?(ne=t.jsx(Kt,{"data-icon":"inline-start",className:"size-4 text-muted-foreground"}),e[36]=ne):ne=e[36];let q;e[37]!==c?(q=t.jsxs("span",{className:"flex items-center gap-2",children:[ne,c," executable"]}),e[37]=c,e[38]=q):q=e[38];let F;e[39]!==ze?(F=t.jsx("span",{className:"truncate",children:ze}),e[39]=ze,e[40]=F):F=e[40];let R;e[41]!==b?(R=b?t.jsx(bt,{className:"size-4 shrink-0"}):t.jsx(vt,{className:"size-4 shrink-0"}),e[41]=b,e[42]=R):R=e[42];let U;e[43]!==F||e[44]!==R?(U=t.jsxs("span",{className:"flex min-w-0 items-center gap-1 text-xs font-normal text-muted-foreground",children:[F,R]}),e[43]=F,e[44]=R,e[45]=U):U=e[45],e[46]!==q||e[47]!==U?(_=t.jsxs(pt,{render:X,children:[q,U]}),e[46]=q,e[47]=U,e[48]=_):_=e[48],N=gt,w=le,e[49]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(J,{children:"Which binary new sessions run. Automatic uses your installed CLI unless it is older than the copy bundled with Cogpit."}),e[49]=A):A=e[49],z="flex flex-col gap-2 pl-1",e[50]!==S?(T=S("auto",Te.auto,"Recommended."),e[50]=S,e[51]=T):T=e[51],k=ds.map(se),e[7]=r,e[8]=c,e[9]=j,e[10]=i,e[11]=b,e[12]=o==null?void 0:o.active,e[13]=o==null?void 0:o.candidates,e[14]=a.path,e[15]=a.source,e[16]=w,e[17]=N,e[18]=p,e[19]=u,e[20]=S,e[21]=h,e[22]=_,e[23]=z,e[24]=T,e[25]=k,e[26]=A,e[27]=D,e[28]=g}else w=e[16],N=e[17],p=e[18],u=e[19],S=e[20],h=e[21],_=e[22],z=e[23],T=e[24],k=e[25],A=e[26],D=e[27],g=e[28];const P=`${c} executable path`,H=a.source==="custom"?a.path??"":"",re=r||a.source!=="custom";let Z;e[52]!==i?(Z=I=>i({source:"custom",path:I.target.value}),e[52]=i,e[53]=Z):Z=e[53];let $;e[54]!==P||e[55]!==H||e[56]!==re||e[57]!==Z?($=t.jsx(nt,{"aria-label":P,value:H,placeholder:"/path/to/binary",disabled:re,onChange:Z,className:"mt-1"}),e[54]=P,e[55]=H,e[56]=re,e[57]=Z,e[58]=$):$=e[58];let G;e[59]!==S||e[60]!==$?(G=S("custom",Te.custom,$),e[59]=S,e[60]=$,e[61]=G):G=e[61];let O;e[62]!==G||e[63]!==z||e[64]!==T||e[65]!==k?(O=t.jsxs("div",{className:z,children:[T,k,G]}),e[62]=G,e[63]=z,e[64]=T,e[65]=k,e[66]=O):O=e[66];let Q;e[67]!==u?(Q=hs(u)?"text-muted-foreground":"text-destructive",e[67]=u,e[68]=Q):Q=e[68];let E;e[69]!==Q?(E=Ye("text-xs",Q),e[69]=Q,e[70]=E):E=e[70];let W;e[71]!==u||e[72]!==o?(W=ms(o,u),e[71]=u,e[72]=o,e[73]=W):W=e[73];let V;e[74]!==E||e[75]!==W?(V=t.jsx("p",{className:E,"aria-live":"polite",children:W}),e[74]=E,e[75]=W,e[76]=V):V=e[76];let ee;e[77]!==w||e[78]!==O||e[79]!==V||e[80]!==A?(ee=t.jsxs(w,{children:[A,O,V]}),e[77]=w,e[78]=O,e[79]=V,e[80]=A,e[81]=ee):ee=e[81];let M;e[82]!==N||e[83]!==ee?(M=t.jsx(N,{children:ee}),e[82]=N,e[83]=ee,e[84]=M):M=e[84];let de;return e[85]!==p||e[86]!==h||e[87]!==_||e[88]!==M||e[89]!==D||e[90]!==g?(de=t.jsxs(p,{open:D,onOpenChange:g,className:h,children:[_,M]}),e[85]=p,e[86]=h,e[87]=_,e[88]=M,e[89]=D,e[90]=g,e[91]=de):de=e[91],de}function ps(s){return[s.source,s]}function gs(){}function js(s){return s.ok?s.json():null}function Nt(s){return s instanceof Error?s.message:String(s)}async function St(s){const e=await s.json().catch(()=>null);return typeof(e==null?void 0:e.error)=="string"?e.error:`Request failed (${s.status})`}async function rt(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 St(e)}}catch(e){return{status:"error",error:Nt(e)}}}function bs(s){const[e,n]=v.useState(null),[a,i]=v.useState(null),[r,l]=v.useState(null);v.useEffect(()=>{let c=!1;return rt(s).then(o=>{c||n(o)}),()=>{c=!0}},[s]);const f=v.useCallback(async c=>{i(c),l(null);try{const o=await Ie(`/api/agent-accounts/${s}/switch`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({slot:c})});if(!o.ok){l({kind:"failed",error:await St(o)});return}l({kind:"switched",result:await o.json()}),n(await rt(s))}catch(o){l({kind:"failed",error:Nt(o)})}finally{i(null)}},[s]);return{report:e,switchingSlot:a,outcome:r,switchTo:f}}const vs={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 st(s){return s.alias??s.email}function ot(s){const e=Y.c(18),{label:n,window:a}=s;if(!a)return null;const i=a.pct>=80,r=a.resetsIn?`${n} window resets in ${a.resetsIn}`:void 0;let l;e[0]!==n?(l=t.jsx("span",{className:"w-5",children:n}),e[0]=n,e[1]=l):l=e[1];const f=i?"bg-destructive":"bg-primary";let c;e[2]!==f?(c=Ye("absolute inset-y-0 left-0 rounded-full",f),e[2]=f,e[3]=c):c=e[3];const o=`${a.pct}%`;let m;e[4]!==o?(m={width:o},e[4]=o,e[5]=m):m=e[5];let b;e[6]!==c||e[7]!==m?(b=t.jsx("span",{className:"relative h-1 w-16 overflow-hidden rounded-full bg-muted",children:t.jsx("span",{className:c,style:m})}),e[6]=c,e[7]=m,e[8]=b):b=e[8];let x;e[9]!==a.pct?(x=Math.round(a.pct),e[9]=a.pct,e[10]=x):x=e[10];let j;e[11]!==x?(j=t.jsxs("span",{className:"tabular-nums",children:[x,"%"]}),e[11]=x,e[12]=j):j=e[12];let y;return e[13]!==r||e[14]!==l||e[15]!==b||e[16]!==j?(y=t.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",title:r,children:[l,b,j]}),e[13]=r,e[14]=l,e[15]=b,e[16]=j,e[17]=y):y=e[17],y}function ct(s){return/[.!?]$/.test(s)?s:`${s}.`}function ws(s,e){if(s.kind==="failed")return`Switch failed: ${s.error}`;const{result:n}=s,a=[ct(n.message)];return n.switched&&a.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.`),[...a,...n.warnings.map(ct)].join(" ")}function Ns(s){const e=Y.c(41),{kind:n,disabled:a}=s;let i;e[0]!==n?(i=mt(n),e[0]=n,e[1]=i):i=e[1];const{displayName:r}=i,{report:l,switchingSlot:f,outcome:c,switchTo:o}=bs(n),[m,b]=v.useState(!1);if(l===null||l.status==="missing")return null;let x,j;if(e[2]!==l.accounts||e[3]!==l.status){x=l.status==="ok"?l.accounts:[];const g=x.find(Ss)??null;j=l.status==="error"?"Unavailable":g?`${st(g)} · ${x.length} account${x.length===1?"":"s"}`:`${x.length} account${x.length===1?"":"s"}`,e[2]=l.accounts,e[3]=l.status,e[4]=x,e[5]=j}else x=e[4],j=e[5];const y=j;let C;e[6]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(ce,{type:"button",variant:"ghost",className:"h-auto w-full justify-between px-0 font-medium hover:bg-transparent"}),e[6]=C):C=e[6];let w;e[7]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(Jt,{"data-icon":"inline-start",className:"size-4 text-muted-foreground"}),e[7]=w):w=e[7];let N;e[8]!==r?(N=t.jsxs("span",{className:"flex items-center gap-2",children:[w,r," accounts"]}),e[8]=r,e[9]=N):N=e[9];let p;e[10]!==y?(p=t.jsx("span",{className:"truncate",children:y}),e[10]=y,e[11]=p):p=e[11];let u;e[12]!==m?(u=m?t.jsx(bt,{className:"size-4 shrink-0"}):t.jsx(vt,{className:"size-4 shrink-0"}),e[12]=m,e[13]=u):u=e[13];let S;e[14]!==p||e[15]!==u?(S=t.jsxs("span",{className:"flex min-w-0 items-center gap-1 text-xs font-normal text-muted-foreground",children:[p,u]}),e[14]=p,e[15]=u,e[16]=S):S=e[16];let h;e[17]!==N||e[18]!==S?(h=t.jsxs(pt,{render:C,children:[N,S]}),e[17]=N,e[18]=S,e[19]=h):h=e[19];const _=l.status==="ok"&&`Logins managed by ${l.tool}${l.version?` ${l.version}`:""}. `;let z;e[20]!==r||e[21]!==_?(z=t.jsxs(J,{children:[_,"Switching changes which login ",r," sessions authenticate with."]}),e[20]=r,e[21]=_,e[22]=z):z=e[22];let T;e[23]!==x||e[24]!==a||e[25]!==l.error||e[26]!==l.status||e[27]!==o||e[28]!==f?(T=l.status==="error"?t.jsx("p",{className:"text-xs text-destructive",role:"alert",children:l.error}):t.jsx("ul",{className:"flex flex-col divide-y divide-border rounded-md border border-border",children:x.map(g=>{const P=f===g.slot,H=vs[g.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:g.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:st(g)}),g.alias&&t.jsx("span",{className:"truncate text-xs text-muted-foreground",children:g.email}),g.active&&t.jsx(et,{children:"Active"}),g.disabled&&t.jsx(et,{variant:"outline",children:"Disabled"}),H&&t.jsx(et,{variant:"destructive",children:H})]}),g.organization&&t.jsx("span",{className:"truncate text-xs text-muted-foreground",children:g.organization}),g.usage&&t.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1",children:[t.jsx(ot,{label:"5h",window:g.usage.fiveHour}),t.jsx(ot,{label:"7d",window:g.usage.sevenDay})]})]}),!a&&!g.active&&t.jsx(ce,{type:"button",size:"sm",variant:"outline",disabled:f!==null,onClick:()=>o(g.slot),"aria-label":`Switch to ${st(g)}`,children:P?t.jsxs(t.Fragment,{children:[t.jsx(it,{"data-icon":"inline-start",className:"size-3.5 animate-spin"}),"Switching…"]}):"Switch"})]},g.slot)})}),e[23]=x,e[24]=a,e[25]=l.error,e[26]=l.status,e[27]=o,e[28]=f,e[29]=T):T=e[29];let k;e[30]!==r||e[31]!==c?(k=c&&t.jsx("p",{className:Ye("text-xs",c.kind==="failed"?"text-destructive":"text-muted-foreground"),"aria-live":"polite",role:c.kind==="failed"?"alert":"status",children:ws(c,r)}),e[30]=r,e[31]=c,e[32]=k):k=e[32];let A;e[33]!==z||e[34]!==T||e[35]!==k?(A=t.jsx(gt,{children:t.jsxs(le,{children:[z,T,k]})}),e[33]=z,e[34]=T,e[35]=k,e[36]=A):A=e[36];let D;return e[37]!==m||e[38]!==A||e[39]!==h?(D=t.jsxs(xt,{open:m,onOpenChange:b,className:"flex flex-col gap-2",children:[h,A]}),e[37]=m,e[38]=A,e[39]=h,e[40]=D):D=e[40],D}function Ss(s){return s.active}const ys=jt().filter(s=>s.cli.bundledBySdk).map(s=>s.kind),ks=jt().filter(s=>s.capabilities.accountSwitching).map(s=>s.kind);function Cs(s,e){return s.source===e.source&&(s.source!=="custom"||s.path===e.path)}function _s(s){const e=Y.c(5),{status:n,error:a}=s;if(n==="validating"){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[t.jsx(it,{"data-icon":"inline-start",className:"size-3.5 animate-spin"}),"Checking path..."]}),e[0]=i):i=e[0],i}if(n==="valid"){let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsxs("div",{className:"flex items-center gap-2 text-sm text-success",children:[t.jsx(ts,{"data-icon":"inline-start",className:"size-3.5"}),"Valid .claude directory found"]}),e[1]=i):i=e[1],i}if(n==="invalid"&&a){let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(ss,{"data-icon":"inline-start",className:"size-3.5"}),e[2]=i):i=e[2];let r;return e[3]!==a?(r=t.jsxs("div",{className:"flex items-center gap-2 text-sm text-destructive",children:[i,a]}),e[3]=a,e[4]=r):r=e[4],r}return null}function Rs(s){const e=Y.c(110),{open:n,currentPath:a,onClose:i,onSaved:r}=s,[l,f]=v.useState(a),[c,o]=v.useState(!1),{status:m,error:b,debouncedValidate:x,reset:j,save:y}=$t();let C;e[0]===Symbol.for("react.memo_cache_sentinel")?(C=Et(),e[0]=C):C=e[0];const w=C;let N;e[1]===Symbol.for("react.memo_cache_sentinel")?(N=zt("configWrite"),e[1]=N):N=e[1];const p=N,[u,S]=v.useState(!1),[h,_]=v.useState(""),[z,T]=v.useState(!1),[k,A]=v.useState(""),[D,g]=v.useState(""),[P,H]=v.useState(""),[re,Z]=v.useState(""),[$,G]=v.useState(!1),[O,Q]=v.useState(!1),[E,W]=v.useState(tt),[V,ee]=v.useState(0),[M,de]=v.useState(tt),[I,te]=v.useState(!1),[se,ze]=v.useState(!1);let X;e[2]===Symbol.for("react.memo_cache_sentinel")?(X=[],e[2]=X):X=e[2];const[ne,q]=v.useState(X);let F,R;e[3]!==a||e[4]!==n||e[5]!==j?(F=()=>{n&&(f(a),j(),Ie("/api/config").then(Ts).then(d=>{const ie=(d==null?void 0:d.networkAccess)||!1;S(ie),te(ie),ze(!!(d!=null&&d.networkPassword)),_("");const Xe=(d==null?void 0:d.terminalApp)||"";A(Xe),g(Xe);const qe=(d==null?void 0:d.editorApp)||"";H(qe),Z(qe);const Ke=(d==null?void 0:d.useBuiltInEditor)===!0;G(Ke),Q(Ke);const Je=fs(d==null?void 0:d.agentExecutable)??tt;W(Je),de(Je),ie&&(d!=null&&d.networkPassword)&&!w?Ie("/api/connected-devices").then(zs).then($e=>q(($e==null?void 0:$e.devices)||[])).catch(Es):q([])}).catch($s))},R=[n,a,j,w],e[3]=a,e[4]=n,e[5]=j,e[6]=F,e[7]=R):(F=e[6],R=e[7]),v.useEffect(F,R);let U;e[8]!==x?(U=d=>{const ie=d.target.value;f(ie),x(ie)},e[8]=x,e[9]=U):U=e[9];const L=U;let B;e[10]!==E||e[11]!==P||e[12]!==I||e[13]!==u||e[14]!==h||e[15]!==r||e[16]!==l||e[17]!==y||e[18]!==k||e[19]!==$?(B=async()=>{o(!0);const d=await y(l,{networkAccess:w?I:u,networkPassword:!w&&u&&h.length>0?h:void 0,terminalApp:k.trim()||void 0,editorApp:P.trim()||void 0,useBuiltInEditor:$,agentExecutable:E});d.success&&d.claudeDir&&(ee(As),r(d.claudeDir)),o(!1)},e[10]=E,e[11]=P,e[12]=I,e[13]=u,e[14]=h,e[15]=r,e[16]=l,e[17]=y,e[18]=k,e[19]=$,e[20]=B):B=e[20];const ae=B;let oe;e[21]!==E||e[22]!==P||e[23]!==se||e[24]!==M||e[25]!==re||e[26]!==I||e[27]!==D||e[28]!==O||e[29]!==u||e[30]!==h||e[31]!==m||e[32]!==k||e[33]!==$?(oe=function(){var $e;if(m==="validating"||m==="invalid")return!1;const ie=m==="valid",Xe=!w&&(u!==I||u&&h.length>0),qe=k!==D,Ke=P!==re||$!==O,Je=!Cs(E,M);if(!ie&&!Xe&&!qe&&!Ke&&!Je||E.source==="custom"&&!(($e=E.path)!=null&&$e.trim()))return!1;if(!w&&u){const yt=h.length>0&&h.length<16,kt=!se&&h.length===0;if(yt||kt)return!1}return!0},e[21]=E,e[22]=P,e[23]=se,e[24]=M,e[25]=re,e[26]=I,e[27]=D,e[28]=O,e[29]=u,e[30]=h,e[31]=m,e[32]=k,e[33]=$,e[34]=oe):oe=e[34];const K=oe();let ue;e[35]!==i?(ue=d=>{d||i()},e[35]=i,e[36]=ue):ue=e[36];let De;e[37]===Symbol.for("react.memo_cache_sentinel")?(De=t.jsxs(Tt,{children:[t.jsx(It,{className:"text-foreground",children:"Configuration"}),t.jsx(Dt,{className:"text-muted-foreground",children:"Manage local paths, preferred apps, and remote access."})]}),e[37]=De):De=e[37];let Pe,Le;e[38]===Symbol.for("react.memo_cache_sentinel")?(Pe=t.jsx(Ee,{htmlFor:"claude-directory",children:"Claude directory"}),Le=t.jsx(J,{children:"The directory containing your Claude configuration."}),e[38]=Pe,e[39]=Le):(Pe=e[38],Le=e[39]);let Fe;e[40]===Symbol.for("react.memo_cache_sentinel")?(Fe=t.jsx(ft,{children:t.jsx(Yt,{"data-icon":"inline-start"})}),e[40]=Fe):Fe=e[40];let fe;e[41]!==K||e[42]!==ae||e[43]!==c?(fe=d=>{d.key==="Enter"&&K&&!c&&ae()},e[41]=K,e[42]=ae,e[43]=c,e[44]=fe):fe=e[44];let me;e[45]!==L||e[46]!==l||e[47]!==fe?(me=t.jsxs(dt,{children:[Fe,t.jsx(ut,{id:"claude-directory",value:l,onChange:L,placeholder:"/Users/you/.claude",disabled:!p,onKeyDown:fe})]}),e[45]=L,e[46]=l,e[47]=fe,e[48]=me):me=e[48];let he;e[49]!==b||e[50]!==m?(he=t.jsx("div",{"aria-live":"polite",children:t.jsx(_s,{status:m,error:b})}),e[49]=b,e[50]=m,e[51]=he):he=e[51];let xe;e[52]!==me||e[53]!==he?(xe=t.jsxs(le,{children:[Pe,Le,me,he]}),e[52]=me,e[53]=he,e[54]=xe):xe=e[54];let Re,Ue;e[55]===Symbol.for("react.memo_cache_sentinel")?(Re=t.jsxs(Ee,{htmlFor:"terminal-application",children:[t.jsx(Zt,{"data-icon":"inline-start",className:"size-4 text-muted-foreground"}),"Terminal application"]}),Ue=t.jsx(J,{children:"Leave blank to use the system default for Ctrl+Cmd+T."}),e[55]=Re,e[56]=Ue):(Re=e[55],Ue=e[56]);let Be;e[57]===Symbol.for("react.memo_cache_sentinel")?(Be=d=>A(d.target.value),e[57]=Be):Be=e[57];let pe;e[58]!==k?(pe=t.jsxs(le,{children:[Re,Ue,t.jsx(nt,{id:"terminal-application",value:k,onChange:Be,placeholder:"Ghostty, iTerm, or /path/to/binary",disabled:!p})]}),e[58]=k,e[59]=pe):pe=e[59];let Oe;e[60]===Symbol.for("react.memo_cache_sentinel")?(Oe=d=>G(d===!0),e[60]=Oe):Oe=e[60];let ge;e[61]!==$?(ge=t.jsx(Pt,{id:"use-built-in-editor",checked:$,onCheckedChange:Oe,disabled:!p}),e[61]=$,e[62]=ge):ge=e[62];let Ve;e[63]===Symbol.for("react.memo_cache_sentinel")?(Ve=t.jsxs(ht,{children:[t.jsxs(Ee,{htmlFor:"use-built-in-editor",children:[t.jsx(Qt,{"data-icon":"inline-start",className:"size-4 text-muted-foreground"}),"Open files in Cogpit"]}),t.jsx(J,{children:"Files and diffs open in Cogpit’s file workspace instead of launching an external editor."})]}),e[63]=Ve):Ve=e[63];let je;e[64]!==ge?(je=t.jsxs(le,{orientation:"horizontal",children:[ge,Ve]}),e[64]=ge,e[65]=je):je=e[65];let Me;e[66]===Symbol.for("react.memo_cache_sentinel")?(Me=t.jsxs(Ee,{htmlFor:"editor-application",children:[t.jsx(es,{"data-icon":"inline-start",className:"size-4 text-muted-foreground"}),"Editor application"]}),e[66]=Me):Me=e[66];const Ze=$?"Not used while files open in Cogpit.":"Leave blank to use $VISUAL or automatic detection.";let be;e[67]!==Ze?(be=t.jsx(J,{children:Ze}),e[67]=Ze,e[68]=be):be=e[68];let He;e[69]===Symbol.for("react.memo_cache_sentinel")?(He=d=>H(d.target.value),e[69]=He):He=e[69];const Qe=!p||$;let ve;e[70]!==P||e[71]!==Qe?(ve=t.jsx(nt,{id:"editor-application",value:P,onChange:He,placeholder:"cursor, code, zed, or /path/to/binary",disabled:Qe}),e[70]=P,e[71]=Qe,e[72]=ve):ve=e[72];let we;e[73]!==be||e[74]!==ve?(we=t.jsxs(le,{children:[Me,be,ve]}),e[73]=be,e[74]=ve,e[75]=we):we=e[75];let Ne;e[76]!==E||e[77]!==V?(Ne=ys.map(d=>t.jsx(xs,{kind:d,value:E,onChange:W,disabled:!p,reportVersion:V},d)),e[76]=E,e[77]=V,e[78]=Ne):Ne=e[78];let Ge;e[79]===Symbol.for("react.memo_cache_sentinel")?(Ge=ks.map(d=>t.jsx(Ns,{kind:d,disabled:!p},d)),e[79]=Ge):Ge=e[79];let Se;e[80]!==ne||e[81]!==se||e[82]!==I||e[83]!==u||e[84]!==h||e[85]!==z?(Se=!w&&p&&t.jsx(rs,{networkAccess:u,setNetworkAccess:S,networkPassword:h,setNetworkPassword:_,showNetworkPassword:z,setShowNetworkPassword:T,hasExistingPassword:se,initialNetworkAccess:I,connectedDevices:ne,minPasswordLength:16}),e[80]=ne,e[81]=se,e[82]=I,e[83]=u,e[84]=h,e[85]=z,e[86]=Se):Se=e[86];let ye;e[87]!==xe||e[88]!==pe||e[89]!==je||e[90]!==we||e[91]!==Ne||e[92]!==Se?(ye=t.jsxs(Lt,{children:[xe,pe,je,we,Ne,Ge,Se]}),e[87]=xe,e[88]=pe,e[89]=je,e[90]=we,e[91]=Ne,e[92]=Se,e[93]=ye):ye=e[93];let ke;e[94]!==i?(ke=t.jsx(ce,{variant:"outline",onClick:i,children:"Cancel"}),e[94]=i,e[95]=ke):ke=e[95];let Ce;e[96]!==K||e[97]!==ae||e[98]!==c?(Ce=p&&t.jsx(ce,{disabled:!K||c,onClick:ae,children:c?t.jsxs(t.Fragment,{children:[t.jsx(it,{"data-icon":"inline-start",className:"size-4 animate-spin"}),"Saving..."]}):"Save"}),e[96]=K,e[97]=ae,e[98]=c,e[99]=Ce):Ce=e[99];let _e;e[100]!==ke||e[101]!==Ce?(_e=t.jsxs(Ft,{children:[ke,Ce]}),e[100]=ke,e[101]=Ce,e[102]=_e):_e=e[102];let Ae;e[103]!==ye||e[104]!==_e?(Ae=t.jsxs(Rt,{className:"max-h-[calc(100dvh-2rem)] overflow-y-auto sm:max-w-lg",children:[De,ye,_e]}),e[103]=ye,e[104]=_e,e[105]=Ae):Ae=e[105];let We;return e[106]!==n||e[107]!==Ae||e[108]!==ue?(We=t.jsx(Ut,{open:n,onOpenChange:ue,children:Ae}),e[106]=n,e[107]=Ae,e[108]=ue,e[109]=We):We=e[109],We}function As(s){return s+1}function $s(){}function Es(){}function zs(s){return s.json()}function Ts(s){return s.json()}export{Rs as ConfigDialog};
|