cogpit 3.0.0 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +136 -90
- package/dist/web/assets/CommandPaletteHost-B-n0sXM6.js +1 -0
- package/dist/web/assets/{ConfigBrowser-CXvr5BFb.js → ConfigBrowser-DOdqaQra.js} +1 -1
- package/dist/web/assets/{HighlightedEditor-DWc-xoSc.js → HighlightedEditor-D75svkum.js} +1 -1
- package/dist/web/assets/{KeyboardShortcutsDialog-C1of2PBc.js → KeyboardShortcutsDialog-DeIXxXmj.js} +1 -1
- package/dist/web/assets/{MobileFileChanges-BAEIKapA.js → MobileFileChanges-Dze0jsvc.js} +1 -1
- package/dist/web/assets/{PluginsDialog-BgnTB0-z.js → PluginsDialog-qcJTbfeg.js} +1 -1
- package/dist/web/assets/{PreviewPanel-DgbgRibz.js → PreviewPanel-DChL85Uq.js} +1 -1
- package/dist/web/assets/{ProjectFilesPanel-BGpyS_aw.js → ProjectFilesPanel-DJ-_Lb_R.js} +3 -3
- package/dist/web/assets/{ProjectSwitcherModal-CEypvUNm.js → ProjectSwitcherModal-BUV_fZ5V.js} +1 -1
- package/dist/web/assets/{TerminalOutput-Dq6QP83Y.js → TerminalOutput-BCG6Ppu3.js} +1 -1
- package/dist/web/assets/{ThemeSelectorModal-DeYABHF9.js → ThemeSelectorModal-t2P0tZVJ.js} +1 -1
- package/dist/web/assets/WorkflowsPanel-Bv2RwtYI.js +1 -0
- package/dist/web/assets/WorktreePanel-F9QlbnAH.js +1 -0
- package/dist/web/assets/{edition-ui-CFlDe2_U.js → edition-ui-C0x29noh.js} +1 -1
- package/dist/web/assets/index-BO-Nd-ib.css +1 -0
- package/dist/web/assets/{index-DYugSKH5.js → index-BtmLHL6v.js} +4 -4
- package/dist/web/assets/{index-Ch-IpPaH.js → index-C4W7tiDS.js} +1 -1
- package/dist/web/assets/{index-Bm91RnFy.js → index-CRUYvx2l.js} +1 -1
- package/dist/web/assets/{index-DsnL-sXV.js → index-CW9tjG1S.js} +86 -86
- package/dist/web/assets/index-bXbR7jwp.js +1 -0
- package/dist/web/assets/{session-parser.worker-CXlsiJzz.js → session-parser.worker-CkTPpg3t.js} +11 -11
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
- package/dist/web/assets/CommandPaletteHost-fa5vgo7-.js +0 -1
- package/dist/web/assets/WorkflowsPanel-CNxUSC9Q.js +0 -1
- package/dist/web/assets/WorktreePanel-DJYEUobs.js +0 -1
- package/dist/web/assets/index-DVp2Xjmx.js +0 -1
- package/dist/web/assets/index-TCQKag8a.css +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as G,j as s,r as T}from"./vendor-react-gGw_S5I_.js";import{J as le,aQ as Le,aR as mt,aG as ft,aC as xt,aS as Ve,Z as pe,aT as He,aU as Qe,af as je,$ as Se,a0 as Ce,B as ne,a2 as Te,U as Re,aO as Ee,aK as Fe,aL as De,l as Ue,aM as Be,A as Ze,aV as pt,p as Ge,aW as ht,aX as gt,aY as jt,L as ze,M as We,O as Ae,Q as Oe,aZ as bt,d as Nt,c as wt,S as yt,a as vt,a_ as kt,b as St,q as Ct,N as Tt,_ as Rt}from"./index-DsnL-sXV.js";import{M as It}from"./vendor-markdown-BE1gYnO9.js";import{_ as Xe,$ as et,a0 as tt,a1 as $t,a2 as Ie,R as _t,I as st,z as lt,a3 as qe,g as zt,a4 as Wt,a5 as At,B as Ot,a6 as Ye,a as Pt,W as Mt}from"./vendor-ui-Br3ZTAXZ.js";import"./vendor-shiki-DOn6sF-i.js";const Lt=new Set(["done","error","skipped"]);function Ke(l){return Lt.has(l)}function Et(l){return l!=="completed"&&l!=="failed"&&l!=="killed"}function nt(l){switch(l){case"completed":return{label:"Completed",badge:"border-success/30 bg-success/10 text-success",dot:"bg-success"};case"failed":return{label:"Failed",badge:"border-destructive/30 bg-destructive/10 text-destructive",dot:"bg-destructive"};case"killed":return{label:"Stopped",badge:"border-warning/30 bg-warning/10 text-warning",dot:"bg-warning"};default:return{label:"Running",badge:"border-info/30 bg-info/10 text-info",dot:"bg-info"}}}function Ft(l){switch(l){case"done":return{label:"Done",badge:"border-success/30 bg-success/10 text-success",dot:"bg-success"};case"skipped":return{label:"Skipped",badge:"border-border bg-muted/30 text-muted-foreground",dot:"bg-muted-foreground"};case"error":return{label:"Error",badge:"border-destructive/30 bg-destructive/10 text-destructive",dot:"bg-destructive"};case"queued":return{label:"Queued",badge:"border-border bg-muted/30 text-muted-foreground",dot:"bg-muted-foreground"};default:return{label:"Running",badge:"border-info/30 bg-info/10 text-info",dot:"bg-info"}}}function Dt(l){const e=new Map;l.phases.forEach((a,n)=>{const o=n+1;e.set(o,{index:o,title:a.title,detail:a.detail,agents:[]})});const t=[];for(const a of l.agents){const n=e.get(a.phaseIndex);n?n.agents.push(a):t.push(a)}const r=[...e.values()];t.length>0&&r.push({index:r.length+1,title:t[0].phaseTitle||"Other",agents:t});for(const a of r)a.agents.sort((n,o)=>n.index-o.index);return r}function Ut(l){return l.total===0?0:(l.done+l.error)/l.total}const at=["headline","oneLineSell","verdict","summary","name","lens"],Bt=new Set(["title","name"]),Jt=new Set(["headline","oneLineSell","verdict"]);function rt(l){const e=l.trim();if(!e.startsWith("{")&&!e.startsWith("["))return l;try{return JSON.parse(e)}catch{return l}}function qt(l){try{return JSON.parse(`"${l}"`)}catch{return l.replace(/\\n/g," ").replace(/\\"/g,'"')}}function Yt(l){const e=rt(l);if(e!==l)return $e(e);for(const t of at){const r=l.match(new RegExp(`"${t}"\\s*:\\s*"((?:\\\\.|[^"\\\\])*)"`));if(r!=null&&r[1])return qt(r[1])}return l.replace(/^[#>*\s-]+/,"").replace(/[`*_#]/g,"").split(/\n\s*\n|\n/)[0].trim()}function $e(l){if(typeof l=="string")return Yt(l);if(typeof l=="number"||typeof l=="boolean")return String(l);if(Array.isArray(l))return l.length>0?$e(l[0]):"";if(Le(l))for(const e of at){const t=l[e];if(typeof t=="string"&&t.trim())return t.trim()}return""}function Je(l){if(typeof l=="string")return l;try{return JSON.stringify(l,null,2)}catch{return String(l)}}function Kt(l){const e={oneLineSell:"In one line",quickWins:"Quick wins",whatIsLost:"What is lost",whyItHurts:"Why it hurts",restingState:"Resting state",fatalFlaws:"Fatal flaws",bestIdeasRegardlessOfConcept:"Best ideas across concepts"};return e[l]?e[l]:l.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").replace(/^./,t=>t.toUpperCase())}function it(l){const e=G.c(4),{children:t}=l;let r;e[0]!==t?(r=mt(t),e[0]=t,e[1]=r):r=e[1];const a=r;let n;return e[2]!==a?(n=s.jsx(It,{components:xt,remarkPlugins:ft,children:a}),e[2]=a,e[3]=n):n=e[3],n}function ot(l){const e=G.c(7),{value:t}=l;if(typeof t=="string"){let n;return e[0]!==t?(n=s.jsx(it,{children:t}),e[0]=t,e[1]=n):n=e[1],n}if(t===null){let n;return e[2]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("span",{className:"text-muted-foreground",children:"None"}),e[2]=n):n=e[2],n}if(typeof t=="boolean"){const n=t?"Yes":"No";let o;return e[3]!==n?(o=s.jsx("span",{children:n}),e[3]=n,e[4]=o):o=e[4],o}const r=String(t);let a;return e[5]!==r?(a=s.jsx("span",{children:r}),e[5]=r,e[6]=a):a=e[6],a}function Pe(l){const e=G.c(21),{value:t,depth:r}=l,a=r===void 0?0:r;if(!Le(t)&&!Array.isArray(t)){let o;return e[0]!==t?(o=s.jsx(ot,{value:t}),e[0]=t,e[1]=o):o=e[1],o}if(a>5){let o;e[2]!==t?(o=Je(t),e[2]=t,e[3]=o):o=e[3];let i;return e[4]!==o?(i=s.jsx("pre",{className:"overflow-x-auto whitespace-pre-wrap break-words rounded-lg bg-muted p-3 text-xs text-muted-foreground",children:o}),e[4]=o,e[5]=i):i=e[5],i}if(Array.isArray(t)){if(t.length===0){let d;return e[6]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx("p",{className:"text-sm text-muted-foreground",children:"No items"}),e[6]=d):d=e[6],d}if(t.every(Qt)){let d;e[7]!==t?(d=t.map(Ht),e[7]=t,e[8]=d):d=e[8];let m;return e[9]!==d?(m=s.jsx("ul",{className:"flex list-disc flex-col gap-2 pl-5 marker:text-muted-foreground",children:d}),e[9]=d,e[10]=m):m=e[10],m}let i;if(e[11]!==a||e[12]!==t){let d;e[14]!==a?(d=(m,c)=>s.jsx("article",{className:"border-l pl-4",children:s.jsx(Pe,{value:m,depth:a+1})},c),e[14]=a,e[15]=d):d=e[15],i=t.map(d),e[11]=a,e[12]=t,e[13]=i}else i=e[13];let u;return e[16]!==i?(u=s.jsx("div",{className:"flex flex-col gap-3",children:i}),e[16]=i,e[17]=u):u=e[17],u}let n;if(e[18]!==a||e[19]!==t){const o=Object.entries(t),i=o.find(Vt),u=o.filter(d=>{const[m]=d;return m!==(i==null?void 0:i[0])});n=s.jsxs("div",{className:"flex flex-col gap-4",children:[i&&s.jsx("h3",{className:le("font-semibold text-foreground",a===0?"text-lg":"text-base"),children:i[1]}),u.map(d=>{const[m,c]=d;return c===void 0?null:Jt.has(m)&&typeof c=="string"?s.jsx("div",{className:"border-l-2 border-foreground/30 pl-4 text-sm font-medium leading-relaxed",children:s.jsx(it,{children:c})},m):s.jsxs("section",{className:"flex min-w-0 flex-col gap-2",children:[s.jsx("h4",{className:"text-xs font-medium text-muted-foreground",children:Kt(m)}),s.jsx("div",{className:"min-w-0 text-sm leading-relaxed",children:s.jsx(Pe,{value:c,depth:a+1})})]},m)})]}),e[18]=a,e[19]=t,e[20]=n}else n=e[20];return n}function Vt(l){const[e,t]=l;return Bt.has(e)&&typeof t=="string"&&t.trim().length>0}function Ht(l,e){return s.jsx("li",{className:"pl-1 text-sm leading-relaxed",children:s.jsx(ot,{value:l})},e)}function Qt(l){return!Le(l)&&!Array.isArray(l)}function Me(l){const e=G.c(19),{value:t,className:r}=l;let a;e[0]!==t?(a=typeof t=="string"?rt(t):t,e[0]=t,e[1]=a):a=e[1];const n=a;if(typeof n=="string"&&(n.trim().startsWith("{")||n.trim().startsWith("["))){let m;e[2]!==n?(m=$e(n),e[2]=n,e[3]=m):m=e[3];const c=m;let x;e[4]!==r?(x=le("flex flex-col gap-2",r),e[4]=r,e[5]=x):x=e[5];let f;e[6]!==c?(f=c&&s.jsx("p",{className:"text-sm leading-relaxed text-foreground",children:c}),e[6]=c,e[7]=f):f=e[7];let h;e[8]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx("p",{className:"text-xs text-muted-foreground",children:"Only a shortened preview was saved for this response."}),e[8]=h):h=e[8];let p;return e[9]!==x||e[10]!==f?(p=s.jsxs("div",{className:x,children:[f,h]}),e[9]=x,e[10]=f,e[11]=p):p=e[11],p}let i;e[12]!==r?(i=le("min-w-0 text-sm",r),e[12]=r,e[13]=i):i=e[13];let u;e[14]!==n?(u=s.jsx(Pe,{value:n}),e[14]=n,e[15]=u):u=e[15];let d;return e[16]!==i||e[17]!==u?(d=s.jsx("div",{className:i,children:u}),e[16]=i,e[17]=u,e[18]=d):d=e[18],d}function Zt(l){return l.replace(/\[[0-9;]*m\]/g,"")}function Gt(l){return(l.includes(":")?l.slice(l.indexOf(":")+1):l).replace(/[-_]+/g," ")}function Xt(l){const e=G.c(135),{agent:t,dirName:r,sessionId:a,runId:n}=l,[o,i]=T.useState(!1),[u,d]=T.useState(!1);let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m={status:"idle"},e[0]=m):m=e[0];const[c,x]=T.useState(m),[f,h]=Ve();let p,g,j,b,S,C,y,N,v,R,A,Y,I,W,w,k,$,_,O,P,z;if(e[1]!==t||e[2]!==r||e[3]!==o||e[4]!==c.status||e[5]!==c.value||e[6]!==n||e[7]!==a){v=Ft(t.state);let Ne;e[29]!==t.state?(Ne=!Ke(t.state)&&t.state!=="queued",e[29]=t.state,e[30]=Ne):Ne=e[30],N=Ne;let we;e[31]!==t.resultPreview?(we=t.resultPreview?$e(t.resultPreview):"",e[31]=t.resultPreview,e[32]=we):we=e[32];const ye=we;let ve;e[33]!==t.agentId||e[34]!==r||e[35]!==n||e[36]!==a?(ve=async()=>{x({status:"loading"});try{const he=await Re(`/api/workflow-agent-result/${encodeURIComponent(r)}/${encodeURIComponent(a)}/${encodeURIComponent(n)}/${encodeURIComponent(t.agentId)}`);if(!he.ok){x({status:"unavailable"});return}const ut=await he.json();x({status:"loaded",value:ut.result})}catch{x({status:"unavailable"})}},e[33]=t.agentId,e[34]=r,e[35]=n,e[36]=a,e[37]=ve):ve=e[37],y=ve;let ke;e[38]!==t.state||e[39]!==y||e[40]!==c.status?(ke=he=>{i(he),he&&c.status==="idle"&&Ke(t.state)&&y()},e[38]=t.state,e[39]=y,e[40]=c.status,e[41]=ke):ke=e[41];const ct=ke;z=c.status==="loaded"?c.value:t.resultPreview,C=c.status==="unavailable",S=Se,A=o,Y=ct,b=Ee,P="sm",R="motion-card motion-list-item gap-0 py-0",j=Fe,O="px-0 py-0",g=Ce,k="group flex w-full items-start gap-3 rounded-lg px-3.5 py-3 text-left outline-none transition-colors hover:bg-muted/40 focus-visible:ring-2 focus-visible:ring-ring/50",$=s.jsx("span",{className:le("mt-1.5 size-2 shrink-0 rounded-full",v.dot)});const dt=t.label;let ae;e[42]!==t.label?(ae=Gt(t.label),e[42]=t.label,e[43]=ae):ae=e[43];let re;e[44]!==t.label||e[45]!==ae?(re=s.jsx(De,{className:"truncate capitalize",title:dt,children:ae}),e[44]=t.label,e[45]=ae,e[46]=re):re=e[46];let ie;e[47]!==t.attempt?(ie=t.attempt&&t.attempt>1&&s.jsxs(pe,{variant:"outline",className:"text-muted-foreground",children:["Attempt ",t.attempt]}),e[47]=t.attempt,e[48]=ie):ie=e[48];let oe;e[49]!==re||e[50]!==ie?(oe=s.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[re,ie]}),e[49]=re,e[50]=ie,e[51]=oe):oe=e[51];let ce;e[52]!==t.lastToolName||e[53]!==t.lastToolSummary||e[54]!==N||e[55]!==ye?(ce=ye?s.jsx("p",{className:"mt-1 line-clamp-2 max-w-3xl text-xs leading-relaxed text-muted-foreground",children:ye}):N&&t.lastToolName?s.jsxs("p",{className:"mt-1 truncate text-xs text-muted-foreground",children:["Working in ",t.lastToolName,t.lastToolSummary?`: ${t.lastToolSummary}`:""]}):null,e[52]=t.lastToolName,e[53]=t.lastToolSummary,e[54]=N,e[55]=ye,e[56]=ce):ce=e[56];let de;e[57]!==t.model?(de=t.model&&s.jsx("span",{children:Zt(t.model)}),e[57]=t.model,e[58]=de):de=e[58];let ue;e[59]!==t.tokens?(ue=typeof t.tokens=="number"&&t.tokens>0&&s.jsxs(_e,{icon:Xe,children:[He(t.tokens)," tokens"]}),e[59]=t.tokens,e[60]=ue):ue=e[60];let me;e[61]!==t.toolCalls?(me=typeof t.toolCalls=="number"&&t.toolCalls>0&&s.jsxs(_e,{icon:et,children:[t.toolCalls," tools"]}),e[61]=t.toolCalls,e[62]=me):me=e[62];let fe;e[63]!==t.durationMs?(fe=typeof t.durationMs=="number"&&s.jsx(_e,{icon:tt,children:Qe(t.durationMs)}),e[63]=t.durationMs,e[64]=fe):fe=e[64];let xe;e[65]!==de||e[66]!==ue||e[67]!==me||e[68]!==fe?(xe=s.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-muted-foreground",children:[de,ue,me,fe]}),e[65]=de,e[66]=ue,e[67]=me,e[68]=fe,e[69]=xe):xe=e[69],e[70]!==oe||e[71]!==ce||e[72]!==xe?(_=s.jsxs("div",{className:"min-w-0 flex-1",children:[oe,ce,xe]}),e[70]=oe,e[71]=ce,e[72]=xe,e[73]=_):_=e[73],w="flex shrink-0 items-center gap-2",p=pe,I="outline",W=le("hidden sm:inline-flex",v.badge),e[1]=t,e[2]=r,e[3]=o,e[4]=c.status,e[5]=c.value,e[6]=n,e[7]=a,e[8]=p,e[9]=g,e[10]=j,e[11]=b,e[12]=S,e[13]=C,e[14]=y,e[15]=N,e[16]=v,e[17]=R,e[18]=A,e[19]=Y,e[20]=I,e[21]=W,e[22]=w,e[23]=k,e[24]=$,e[25]=_,e[26]=O,e[27]=P,e[28]=z}else p=e[8],g=e[9],j=e[10],b=e[11],S=e[12],C=e[13],y=e[14],N=e[15],v=e[16],R=e[17],A=e[18],Y=e[19],I=e[20],W=e[21],w=e[22],k=e[23],$=e[24],_=e[25],O=e[26],P=e[27],z=e[28];let M;e[74]!==N?(M=N&&s.jsx(je,{"data-icon":"inline-start"}),e[74]=N,e[75]=M):M=e[75];let X;e[76]!==p||e[77]!==v.label||e[78]!==M||e[79]!==I||e[80]!==W?(X=s.jsxs(p,{variant:I,className:W,children:[M,v.label]}),e[76]=p,e[77]=v.label,e[78]=M,e[79]=I,e[80]=W,e[81]=X):X=e[81];let K;e[82]===Symbol.for("react.memo_cache_sentinel")?(K=s.jsx(Ie,{className:"mt-0.5 size-4 text-muted-foreground transition-transform group-data-panel-open:rotate-180 motion-reduce:transition-none"}),e[82]=K):K=e[82];let L;e[83]!==X||e[84]!==w?(L=s.jsxs("div",{className:w,children:[X,K]}),e[83]=X,e[84]=w,e[85]=L):L=e[85];let E;e[86]!==g||e[87]!==L||e[88]!==k||e[89]!==$||e[90]!==_?(E=s.jsxs(g,{className:k,children:[$,_,L]}),e[86]=g,e[87]=L,e[88]=k,e[89]=$,e[90]=_,e[91]=E):E=e[91];let ee;e[92]!==j||e[93]!==E||e[94]!==O?(ee=s.jsx(j,{className:O,children:E}),e[92]=j,e[93]=E,e[94]=O,e[95]=ee):ee=e[95];let V;e[96]===Symbol.for("react.memo_cache_sentinel")?(V=s.jsx(Ue,{}),e[96]=V):V=e[96];let H;e[97]===Symbol.for("react.memo_cache_sentinel")?(H=s.jsx("h5",{className:"text-sm font-semibold text-foreground",children:"Response"}),e[97]=H):H=e[97];const te=c.status==="loaded"?"Complete agent response":"Saved response preview";let F;e[98]!==te?(F=s.jsxs("div",{children:[H,s.jsx("p",{className:"text-xs text-muted-foreground",children:te})]}),e[98]=te,e[99]=F):F=e[99];let D;e[100]!==C||e[101]!==y?(D=C&&s.jsxs(ne,{variant:"ghost",size:"sm",onClick:()=>void y(),children:[s.jsx(_t,{"data-icon":"inline-start"}),"Retry"]}),e[100]=C,e[101]=y,e[102]=D):D=e[102];let U;e[103]!==f||e[104]!==h||e[105]!==z?(U=z!==void 0&&s.jsx(ne,{variant:"ghost",size:"icon-sm",onClick:()=>h(Je(z)),"aria-label":f?"Response copied":"Copy response",title:f?"Copied":"Copy response",children:f?s.jsx(st,{"data-icon":"inline-start"}):s.jsx(lt,{"data-icon":"inline-start"})}),e[103]=f,e[104]=h,e[105]=z,e[106]=U):U=e[106];let B;e[107]!==D||e[108]!==U?(B=s.jsxs("div",{className:"flex items-center gap-1",children:[D,U]}),e[107]=D,e[108]=U,e[109]=B):B=e[109];let J;e[110]!==F||e[111]!==B?(J=s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[F,B]}),e[110]=F,e[111]=B,e[112]=J):J=e[112];let q;e[113]!==c.status||e[114]!==N||e[115]!==z?(q=c.status==="loading"?s.jsxs("div",{className:"flex items-center gap-2 py-5 text-sm text-muted-foreground",children:[s.jsx(je,{}),"Loading the complete response…"]}):z!==void 0?s.jsx(Me,{value:z}):s.jsx("p",{className:"text-sm text-muted-foreground",children:N?"This agent has not returned a response yet.":"No response was saved for this agent."}),e[113]=c.status,e[114]=N,e[115]=z,e[116]=q):q=e[116];let Q;e[117]!==t.promptPreview||e[118]!==u?(Q=t.promptPreview&&s.jsxs(Se,{open:u,onOpenChange:d,children:[s.jsxs(Ce,{render:s.jsx(ne,{variant:"ghost",size:"sm",className:"w-full justify-start"}),children:[s.jsx($t,{"data-icon":"inline-start"}),"Agent prompt",s.jsx(Ie,{"data-icon":"inline-end",className:le("ml-auto transition-transform",u&&"rotate-180")})]}),s.jsx(Te,{className:"pt-2",children:s.jsx("div",{className:"rounded-md border bg-muted/30 p-3 text-xs leading-relaxed text-muted-foreground",children:s.jsx(Me,{value:t.promptPreview})})})]}),e[117]=t.promptPreview,e[118]=u,e[119]=Q):Q=e[119];let Z;e[120]!==J||e[121]!==q||e[122]!==Q?(Z=s.jsxs(Te,{children:[V,s.jsxs(Be,{className:"flex flex-col gap-4 px-4 py-4",children:[J,q,Q]})]}),e[120]=J,e[121]=q,e[122]=Q,e[123]=Z):Z=e[123];let se;e[124]!==b||e[125]!==R||e[126]!==ee||e[127]!==Z||e[128]!==P?(se=s.jsxs(b,{size:P,className:R,children:[ee,Z]}),e[124]=b,e[125]=R,e[126]=ee,e[127]=Z,e[128]=P,e[129]=se):se=e[129];let be;return e[130]!==S||e[131]!==A||e[132]!==Y||e[133]!==se?(be=s.jsx(S,{open:A,onOpenChange:Y,children:se}),e[130]=S,e[131]=A,e[132]=Y,e[133]=se,e[134]=be):be=e[134],be}function _e(l){const e=G.c(5),{icon:t,children:r}=l;let a;e[0]!==t?(a=s.jsx(t,{className:"size-3"}),e[0]=t,e[1]=a):a=e[1];let n;return e[2]!==r||e[3]!==a?(n=s.jsxs("span",{className:"inline-flex items-center gap-1",children:[a,r]}),e[2]=r,e[3]=a,e[4]=n):n=e[4],n}function es(l){const e=G.c(102),{detail:t,dirName:r,sessionId:a,stopping:n,confirming:o,onForceStop:i}=l;let u,d,m,c,x,f,h,p;if(e[0]!==o||e[1]!==t||e[2]!==r||e[3]!==i||e[4]!==a||e[5]!==n){const C=nt(t.status);let y;e[14]!==t.status?(y=Et(t.status),e[14]=t.status,e[15]=y):y=e[15];const N=y,v=Dt(t),R=Ut(t.agentCounts),A=N&&t.controllable!==!1;x="flex flex-col gap-6 pb-6";const Y=N&&s.jsx("span",{className:le("size-1.5 rounded-full",C.dot)});let I;e[16]!==C||e[17]!==Y?(I=s.jsxs(pe,{variant:"outline",className:C.badge,children:[Y,C.label]}),e[16]=C,e[17]=Y,e[18]=I):I=e[18];let W;e[19]===Symbol.for("react.memo_cache_sentinel")?(W=s.jsx("span",{className:"text-xs text-muted-foreground",children:"Workflow run"}),e[19]=W):W=e[19];let w;e[20]!==I?(w=s.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[I,W]}),e[20]=I,e[21]=w):w=e[21];let k;e[22]!==t.workflowName?(k=s.jsx("h2",{className:"text-xl font-semibold tracking-tight text-foreground",title:t.workflowName,children:t.workflowName}),e[22]=t.workflowName,e[23]=k):k=e[23];let $;e[24]!==t.summary?($=t.summary&&s.jsx("p",{className:"mt-1.5 max-w-3xl text-sm leading-relaxed text-muted-foreground",children:t.summary}),e[24]=t.summary,e[25]=$):$=e[25];let _;e[26]!==w||e[27]!==k||e[28]!==$?(_=s.jsxs("div",{className:"min-w-0",children:[w,k,$]}),e[26]=w,e[27]=k,e[28]=$,e[29]=_):_=e[29];let O;e[30]!==N||e[31]!==A||e[32]!==o||e[33]!==i||e[34]!==n?(O=N&&i&&s.jsxs("div",{className:"flex shrink-0 flex-col items-start gap-1 sm:items-end",children:[s.jsxs(ne,{variant:o?"destructive":"outline",size:"sm",disabled:!A||n,onClick:i,children:[n?s.jsx(je,{"data-icon":"inline-start"}):s.jsx(qe,{"data-icon":"inline-start"}),o?"Confirm stop":"Stop workflow"]}),!A&&s.jsx("span",{className:"text-xs text-muted-foreground",children:"This run is not controlled by Cogpit"})]}),e[30]=N,e[31]=A,e[32]=o,e[33]=i,e[34]=n,e[35]=O):O=e[35];let P;e[36]!==_||e[37]!==O?(P=s.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[_,O]}),e[36]=_,e[37]=O,e[38]=P):P=e[38];const z=`${t.agentCounts.done+t.agentCounts.error}/${t.agentCount}`;let M;e[39]!==z?(M=s.jsx(ge,{icon:Wt,value:z,label:"Agents finished"}),e[39]=z,e[40]=M):M=e[40];const X=String(t.phaseCount);let K;e[41]!==X?(K=s.jsx(ge,{icon:At,value:X,label:"Phases"}),e[41]=X,e[42]=K):K=e[42];let L;e[43]!==t.totalTokens?(L=He(t.totalTokens),e[43]=t.totalTokens,e[44]=L):L=e[44];let E;e[45]!==L?(E=s.jsx(ge,{icon:Xe,value:L,label:"Tokens"}),e[45]=L,e[46]=E):E=e[46];const ee=String(t.totalToolCalls);let V;e[47]!==ee?(V=s.jsx(ge,{icon:et,value:ee,label:"Tool calls"}),e[47]=ee,e[48]=V):V=e[48];let H;e[49]!==t.durationMs?(H=typeof t.durationMs=="number"?Qe(t.durationMs):"In progress",e[49]=t.durationMs,e[50]=H):H=e[50];let te;e[51]!==H?(te=s.jsx(ge,{icon:tt,value:H,label:"Duration",className:"col-span-2 sm:col-span-1"}),e[51]=H,e[52]=te):te=e[52];let F;e[53]!==M||e[54]!==K||e[55]!==E||e[56]!==V||e[57]!==te?(F=s.jsxs("div",{className:"grid grid-cols-2 gap-px overflow-hidden rounded-lg border bg-border sm:grid-cols-5",children:[M,K,E,V,te]}),e[53]=M,e[54]=K,e[55]=E,e[56]=V,e[57]=te,e[58]=F):F=e[58];let D;e[59]!==R?(D=Math.round(R*100),e[59]=R,e[60]=D):D=e[60];let U;e[61]!==D?(U=s.jsx(jt,{value:D,"aria-label":"Workflow progress",className:"flex-1"}),e[61]=D,e[62]=U):U=e[62];let B;e[63]!==R?(B=Math.round(R*100),e[63]=R,e[64]=B):B=e[64];let J;e[65]!==B?(J=s.jsxs("span",{className:"w-9 text-right text-xs tabular-nums text-muted-foreground",children:[B,"%"]}),e[65]=B,e[66]=J):J=e[66];let q;e[67]!==U||e[68]!==J?(q=s.jsxs("div",{className:"flex items-center gap-3",children:[U,J]}),e[67]=U,e[68]=J,e[69]=q):q=e[69],e[70]!==P||e[71]!==F||e[72]!==q?(f=s.jsxs("section",{className:"flex flex-col gap-4",children:[P,F,q]}),e[70]=P,e[71]=F,e[72]=q,e[73]=f):f=e[73],e[74]!==t.error?(h=t.error&&s.jsxs(Ze,{variant:"destructive",children:[s.jsx(qe,{}),s.jsx(pt,{children:"Workflow error"}),s.jsx(Ge,{children:s.jsx("pre",{className:"max-h-40 overflow-auto whitespace-pre-wrap break-words font-mono text-xs",children:t.error})})]}),e[74]=t.error,e[75]=h):h=e[75],e[76]!==t.resultPreview||e[77]!==t.runId||e[78]!==r||e[79]!==a?(p=t.resultPreview&&s.jsx(ns,{preview:t.resultPreview,dirName:r,sessionId:a,runId:t.runId}),e[76]=t.resultPreview,e[77]=t.runId,e[78]=r,e[79]=a,e[80]=p):p=e[80],m="grid items-start gap-6 md:grid-cols-[180px_minmax(0,1fr)]";let Q;e[81]===Symbol.for("react.memo_cache_sentinel")?(Q=s.jsx("p",{className:"px-2 pb-2 pt-1 text-xs font-medium text-muted-foreground",children:"Run outline"}),e[81]=Q):Q=e[81],c=s.jsxs("nav",{className:"sticky top-0 hidden rounded-lg border bg-popover p-2 md:block","aria-label":"Workflow phases",children:[Q,s.jsx("div",{className:"flex flex-col gap-1",children:v.map(ts)})]}),u="flex min-w-0 flex-col gap-8";let Z;e[82]!==t.runId||e[83]!==r||e[84]!==a?(Z=se=>s.jsx(ss,{group:se,dirName:r,sessionId:a,runId:t.runId},`${se.index}-${se.title}`),e[82]=t.runId,e[83]=r,e[84]=a,e[85]=Z):Z=e[85],d=v.map(Z),e[0]=o,e[1]=t,e[2]=r,e[3]=i,e[4]=a,e[5]=n,e[6]=u,e[7]=d,e[8]=m,e[9]=c,e[10]=x,e[11]=f,e[12]=h,e[13]=p}else u=e[6],d=e[7],m=e[8],c=e[9],x=e[10],f=e[11],h=e[12],p=e[13];let g;e[86]!==u||e[87]!==d?(g=s.jsx("div",{className:u,children:d}),e[86]=u,e[87]=d,e[88]=g):g=e[88];let j;e[89]!==m||e[90]!==c||e[91]!==g?(j=s.jsxs("div",{className:m,children:[c,g]}),e[89]=m,e[90]=c,e[91]=g,e[92]=j):j=e[92];let b;e[93]!==t.script?(b=t.script&&s.jsx(as,{script:t.script}),e[93]=t.script,e[94]=b):b=e[94];let S;return e[95]!==j||e[96]!==b||e[97]!==x||e[98]!==f||e[99]!==h||e[100]!==p?(S=s.jsxs("div",{className:x,children:[f,h,p,j,b]}),e[95]=j,e[96]=b,e[97]=x,e[98]=f,e[99]=h,e[100]=p,e[101]=S):S=e[101],S}function ts(l){return s.jsxs(ne,{variant:"ghost",size:"sm",type:"button",onClick:()=>{var e;return(e=document.getElementById(`workflow-phase-${l.index}`))==null?void 0:e.scrollIntoView({behavior:"smooth",block:"start"})},className:"h-auto w-full justify-start gap-2 px-2 py-2 text-left text-xs text-muted-foreground",children:[s.jsx("span",{className:"flex size-5 shrink-0 items-center justify-center rounded-md bg-muted text-xs font-medium text-foreground",children:l.index}),s.jsx("span",{className:"min-w-0 flex-1 truncate",children:l.title}),s.jsx("span",{className:"tabular-nums",children:l.agents.length})]},`${l.index}-${l.title}`)}function ge(l){const e=G.c(15),{icon:t,value:r,label:a,className:n}=l;let o;e[0]!==n?(o=le("flex items-center gap-2.5 bg-card px-3 py-3",n),e[0]=n,e[1]=o):o=e[1];let i;e[2]!==t?(i=s.jsx(t,{className:"size-4 shrink-0 text-muted-foreground"}),e[2]=t,e[3]=i):i=e[3];let u;e[4]!==r?(u=s.jsx("p",{className:"truncate text-sm font-semibold tabular-nums text-foreground",children:r}),e[4]=r,e[5]=u):u=e[5];let d;e[6]!==a?(d=s.jsx("p",{className:"truncate text-xs text-muted-foreground",children:a}),e[6]=a,e[7]=d):d=e[7];let m;e[8]!==u||e[9]!==d?(m=s.jsxs("div",{className:"min-w-0",children:[u,d]}),e[8]=u,e[9]=d,e[10]=m):m=e[10];let c;return e[11]!==o||e[12]!==i||e[13]!==m?(c=s.jsxs("div",{className:o,children:[i,m]}),e[11]=o,e[12]=i,e[13]=m,e[14]=c):c=e[14],c}function ss(l){const e=G.c(29),{group:t,dirName:r,sessionId:a,runId:n}=l;let o;e[0]!==t.agents?(o=t.agents.filter(ls),e[0]=t.agents,e[1]=o):o=e[1];const i=o.length,u=`workflow-phase-${t.index}`;let d;e[2]!==t.index?(d=s.jsx("span",{className:"flex size-7 shrink-0 items-center justify-center rounded-lg bg-primary text-xs font-semibold text-primary-foreground",children:t.index}),e[2]=t.index,e[3]=d):d=e[3];let m;e[4]!==t.title?(m=s.jsx("h3",{className:"text-base font-semibold text-foreground",children:t.title}),e[4]=t.title,e[5]=m):m=e[5];let c;e[6]!==i||e[7]!==t.agents.length?(c=s.jsxs("span",{className:"text-xs text-muted-foreground",children:[i,"/",t.agents.length," complete"]}),e[6]=i,e[7]=t.agents.length,e[8]=c):c=e[8];let x;e[9]!==m||e[10]!==c?(x=s.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1",children:[m,c]}),e[9]=m,e[10]=c,e[11]=x):x=e[11];let f;e[12]!==t.detail?(f=t.detail&&s.jsx("p",{className:"mt-0.5 text-xs leading-relaxed text-muted-foreground",children:t.detail}),e[12]=t.detail,e[13]=f):f=e[13];let h;e[14]!==x||e[15]!==f?(h=s.jsxs("div",{className:"min-w-0 flex-1",children:[x,f]}),e[14]=x,e[15]=f,e[16]=h):h=e[16];let p;e[17]!==d||e[18]!==h?(p=s.jsxs("div",{className:"mb-3 flex items-start gap-3",children:[d,h]}),e[17]=d,e[18]=h,e[19]=p):p=e[19];let g;e[20]!==r||e[21]!==t.agents||e[22]!==n||e[23]!==a?(g=t.agents.length===0?s.jsx(ze,{className:"border py-6",children:s.jsxs(We,{children:[s.jsx(Ae,{children:"No agents yet"}),s.jsx(Oe,{children:"No agents have started this phase."})]})}):s.jsx("div",{className:"flex flex-col gap-2",children:t.agents.map(b=>s.jsx(Xt,{agent:b,dirName:r,sessionId:a,runId:n},`${n}:${b.agentId||b.index}`))}),e[20]=r,e[21]=t.agents,e[22]=n,e[23]=a,e[24]=g):g=e[24];let j;return e[25]!==g||e[26]!==u||e[27]!==p?(j=s.jsxs("section",{id:u,className:"scroll-mt-4",children:[p,g]}),e[25]=g,e[26]=u,e[27]=p,e[28]=j):j=e[28],j}function ls(l){return l.state==="done"||l.state==="skipped"}function ns({preview:l,dirName:e,sessionId:t,runId:r}){const[a,n]=T.useState(!0),[o,i]=T.useState(),[u,d]=T.useState(!1),[m,c]=T.useState(!1),[x,f]=Ve(),h=l.endsWith("…"),p=o??l,g=T.useCallback(async()=>{d(!0),c(!1);try{const j=await Re(`/api/workflow-result/${encodeURIComponent(e)}/${encodeURIComponent(t)}/${encodeURIComponent(r)}`);if(!j.ok){c(!0);return}const b=await j.json();i(b.result)}catch{c(!0)}finally{d(!1)}},[e,r,t]);return s.jsx(Se,{open:a,onOpenChange:n,children:s.jsxs(Ee,{className:"motion-enter gap-0 py-0",children:[s.jsxs(Fe,{className:"py-4",children:[s.jsxs(Ce,{className:"group flex min-w-0 items-center gap-3 text-left outline-none",children:[s.jsx("span",{className:"flex size-9 shrink-0 items-center justify-center rounded-lg bg-muted text-muted-foreground",children:s.jsx(zt,{className:"size-4"})}),s.jsxs("span",{className:"min-w-0",children:[s.jsx(De,{children:"Workflow outcome"}),s.jsx(ht,{children:"The synthesized answer from this run"})]}),s.jsx(Ie,{className:"size-4 shrink-0 text-muted-foreground transition-transform group-data-panel-open:rotate-180 motion-reduce:transition-none"})]}),s.jsxs(gt,{className:"flex items-center gap-1",children:[h&&o===void 0&&s.jsxs(ne,{variant:"outline",size:"sm",disabled:u,onClick:()=>void g(),children:[u&&s.jsx(je,{"data-icon":"inline-start"}),m?"Retry full result":"Load full result"]}),s.jsx(ne,{variant:"ghost",size:"icon-sm",onClick:()=>f(Je(p)),"aria-label":x?"Outcome copied":"Copy outcome",title:x?"Copied":"Copy outcome",children:x?s.jsx(st,{"data-icon":"inline-start"}):s.jsx(lt,{"data-icon":"inline-start"})})]})]}),s.jsxs(Te,{children:[s.jsx(Ue,{}),s.jsx(Be,{className:"py-5",children:s.jsx(Me,{value:p})})]})]})})}function as(l){const e=G.c(7),{script:t}=l,[r,a]=T.useState(!1);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Fe,{className:"px-0 py-0",children:s.jsxs(Ce,{className:"group flex w-full items-center gap-2 px-3 py-3 text-left text-sm font-medium text-muted-foreground outline-none transition-colors hover:bg-muted/40 hover:text-foreground",children:[s.jsx(Ot,{className:"size-4"}),s.jsx(De,{children:"Orchestration script"}),s.jsx(Ie,{className:"ml-auto size-4 transition-transform group-data-panel-open:rotate-180"})]})}),e[0]=n):n=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Ue,{}),e[1]=o):o=e[1];let i;e[2]!==t?(i=s.jsxs(Ee,{size:"sm",className:"gap-0 py-0",children:[n,s.jsxs(Te,{children:[o,s.jsx(Be,{className:"py-3",children:s.jsx("pre",{className:"max-h-96 overflow-auto whitespace-pre-wrap break-words rounded-lg bg-muted p-3 text-xs leading-relaxed text-muted-foreground",children:t})})]})]}),e[2]=t,e[3]=i):i=e[3];let u;return e[4]!==r||e[5]!==i?(u=s.jsx(Se,{open:r,onOpenChange:a,children:i}),e[4]=r,e[5]=i,e[6]=u):u=e[6],u}function ms({open:l,onOpenChange:e,dirName:t,sessionId:r,workflows:a,isLive:n,canStop:o,onRefetchList:i}){var W;const[u,d]=T.useState(null),[m,c]=T.useState(!1),[x,f]=T.useState(null),[h,p]=T.useState(!1),[g,j]=T.useState(!1),[b,S]=T.useState(!1),[C,y]=T.useState(null),N=T.useRef(0),v=m?null:u&&a.some(w=>w.runId===u)?u:((W=a[0])==null?void 0:W.runId)??null,R=T.useCallback(async()=>{const w=++N.current;if(!t||!r||!v){f(null);return}try{const k=await Re(`/api/workflow-detail/${encodeURIComponent(t)}/${encodeURIComponent(r)}/${encodeURIComponent(v)}`);if(!k.ok){w===N.current&&f(null);return}const $=await k.json();w===N.current&&f($)}catch{w===N.current&&f(null)}finally{w===N.current&&p(!1)}},[t,r,v]);T.useEffect(()=>{if(!v){f(null);return}f(null),p(!0),S(!1),y(null),R()},[v,R]),bt(l?t:null,l?r:null,l?v:null,()=>{R(),i()});const A=T.useCallback(async()=>{if(!b){S(!0);return}if(!(!r||!v)){j(!0),y(null);try{const k=await(await Re("/api/workflow-stop",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:r,runId:v})})).json().catch(()=>({}));k!=null&&k.success?y("Stop signal sent."):(k==null?void 0:k.controllable)===!1?y("This workflow runs in a session Cogpit doesn't control."):y("Couldn't stop. The session may have already exited."),R(),i()}catch{y("Stop request failed.")}finally{j(!1),S(!1)}}},[b,r,v,R,i]),Y=a.length>1,I=a.find(w=>w.runId===v);return s.jsx(Nt,{open:l,onOpenChange:e,children:s.jsxs(wt,{side:"right",className:"w-full data-[side=right]:max-w-[1120px]",children:[s.jsx(yt,{className:"min-h-14 justify-center border-b py-3",children:s.jsxs("div",{className:"flex items-center justify-between gap-3 pr-9",children:[s.jsxs(vt,{className:"flex items-center gap-2",children:[s.jsx(Ye,{className:"size-4"}),"Workflows",a.length>0&&s.jsx(pe,{variant:"secondary",children:a.length}),n&&s.jsxs(pe,{variant:"outline",className:"border-info/30 text-info",children:[s.jsx(kt,{className:"size-1.5"}),"Live"]})]}),s.jsx(St,{className:"sr-only",children:"Inspect workflow runs, agent progress, and run controls for this session."}),s.jsx(ne,{variant:"ghost",size:"icon-sm",onClick:i,"aria-label":"Refresh workflows",title:"Refresh workflows",children:s.jsx(Pt,{"data-icon":"inline-start"})})]})}),s.jsx(Ct,{className:"h-[calc(100dvh-3.5rem)]",children:s.jsx("div",{className:"px-5 py-6 sm:px-6",children:a.length===0?s.jsx(ze,{className:"min-h-[60dvh]",children:s.jsxs(We,{children:[s.jsx(Tt,{variant:"icon",children:s.jsx(Ye,{})}),s.jsx(Ae,{children:"No workflows in this session"}),s.jsx(Oe,{children:"Phases, agents, and their responses will appear here when this session starts a workflow."})]})}):s.jsxs(s.Fragment,{children:[Y&&s.jsxs("div",{className:"mb-6 flex flex-col gap-2",children:[v&&x&&s.jsxs(ne,{variant:"ghost",size:"sm",onClick:()=>c(!0),className:"w-fit px-2 text-muted-foreground",children:[s.jsx(Mt,{"data-icon":"inline-start"}),"All runs"]}),(!v||!x)&&a.map(w=>s.jsx(rs,{workflow:w,active:w.runId===v,onClick:()=>{d(w.runId),c(!1)}},w.runId))]}),h&&!x?s.jsxs("div",{className:"flex min-h-[50dvh] items-center justify-center gap-2 text-sm text-muted-foreground",children:[s.jsx(je,{}),"Loading workflow…"]}):x?s.jsxs(s.Fragment,{children:[C&&s.jsx(Ze,{className:"mb-4",children:s.jsx(Ge,{children:C})}),s.jsx(es,{detail:x,dirName:t??"",sessionId:r??"",stopping:g,confirming:b,onForceStop:o?A:void 0})]}):I?s.jsx(ze,{className:"min-h-[50dvh]",children:s.jsxs(We,{children:[s.jsx(Ae,{children:"Could not load this workflow"}),s.jsx(Oe,{children:"The journal may have moved or the run may no longer be available."})]})}):null]})})})]})})}function rs(l){const e=G.c(45),{workflow:t,active:r,onClick:a}=l;let n,o,i,u,d,m,c;if(e[0]!==r||e[1]!==a||e[2]!==t.agentCounts.done||e[3]!==t.agentCounts.error||e[4]!==t.status){i=nt(t.status),o=t.agentCounts.done+t.agentCounts.error,n=ne,d="ghost",m=a;const N=r?"border-foreground/20 bg-accent":"bg-background hover:bg-muted/50";e[12]!==N?(c=le("h-auto w-full justify-start gap-3 whitespace-normal border px-3 py-3 text-left",N),e[12]=N,e[13]=c):c=e[13],u=le("size-2 shrink-0 rounded-full",i.dot),e[0]=r,e[1]=a,e[2]=t.agentCounts.done,e[3]=t.agentCounts.error,e[4]=t.status,e[5]=n,e[6]=o,e[7]=i,e[8]=u,e[9]=d,e[10]=m,e[11]=c}else n=e[5],o=e[6],i=e[7],u=e[8],d=e[9],m=e[10],c=e[11];let x;e[14]!==u?(x=s.jsx("span",{className:u}),e[14]=u,e[15]=x):x=e[15];let f;e[16]!==t.workflowName?(f=s.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:t.workflowName}),e[16]=t.workflowName,e[17]=f):f=e[17];let h;e[18]!==i.badge||e[19]!==i.label?(h=s.jsx(pe,{variant:"outline",className:i.badge,children:i.label}),e[18]=i.badge,e[19]=i.label,e[20]=h):h=e[20];let p;e[21]!==f||e[22]!==h?(p=s.jsxs("div",{className:"flex items-center gap-2",children:[f,h]}),e[21]=f,e[22]=h,e[23]=p):p=e[23];let g;e[24]!==t.summary?(g=t.summary&&s.jsx("p",{className:"mt-1 line-clamp-1 text-xs text-muted-foreground",children:t.summary}),e[24]=t.summary,e[25]=g):g=e[25];let j;e[26]!==o||e[27]!==t.agentCount?(j=s.jsxs("span",{children:[o,"/",t.agentCount," agents"]}),e[26]=o,e[27]=t.agentCount,e[28]=j):j=e[28];let b;e[29]!==t.startTime?(b=t.startTime>0&&s.jsx("span",{children:Rt(new Date(t.startTime).toISOString())}),e[29]=t.startTime,e[30]=b):b=e[30];let S;e[31]!==j||e[32]!==b?(S=s.jsxs("div",{className:"mt-1.5 flex items-center gap-2 text-xs text-muted-foreground",children:[j,b]}),e[31]=j,e[32]=b,e[33]=S):S=e[33];let C;e[34]!==S||e[35]!==p||e[36]!==g?(C=s.jsxs("div",{className:"min-w-0 flex-1",children:[p,g,S]}),e[34]=S,e[35]=p,e[36]=g,e[37]=C):C=e[37];let y;return e[38]!==n||e[39]!==C||e[40]!==d||e[41]!==m||e[42]!==c||e[43]!==x?(y=s.jsxs(n,{variant:d,onClick:m,className:c,children:[x,C]}),e[38]=n,e[39]=C,e[40]=d,e[41]=m,e[42]=c,e[43]=x,e[44]=y):y=e[44],y}export{ms as WorkflowsPanel};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as h,j as e}from"./vendor-react-gGw_S5I_.js";import{Y,B as d,J as A,l as Z,L as K,M as V,N as _,O as ee,Q as se,Z as ne,_ as te,$ as ae,a0 as re,a1 as R,a2 as ie,a3 as S,a4 as z,a5 as E,a6 as oe,a7 as U,a8 as F,a9 as $,aa as T,ab as P,U as u,ac as c}from"./index-DsnL-sXV.js";import{G as O,g as le,a as ce,X as de,b as me,h as he,i as I,C as xe,F as ue}from"./vendor-ui-Br3ZTAXZ.js";import"./vendor-shiki-DOn6sF-i.js";import"./vendor-markdown-BE1gYnO9.js";const pe={M:"text-warning",A:"text-success",D:"text-destructive",R:"text-info"};function ye({worktrees:v,loading:p,dirName:r,onRefetch:g,onOpenSession:M,onClose:J}){const l=Y("hostFiles"),[L,y]=h.useState(null),[B,b]=h.useState(null),[W,x]=h.useState(!1),[n,m]=h.useState(null),[a,j]=h.useState(null),C=async s=>{if(!(!l||!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)}}},G=s=>{if(!(!l||!r)){if(s.isDirty){m({worktree:s,reason:"dirty"});return}if(s.commitsAhead>0){m({worktree:s,reason:"unpushed"});return}C(s)}},H=()=>{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)},q=async s=>{if(!(!l||!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 o=await t.json();o.url?window.open(o.url,"_blank","noopener,noreferrer"):c.warning("PR created but no URL was returned")}else{const o=await t.json().catch(()=>({error:"Unknown error"}));c.error(`Failed to create PR: ${o.error||"Unknown error"}`)}}catch(t){c.error(`Error creating PR: ${t instanceof Error?t.message:"Unknown error"}`)}finally{b(null)}}},Q=async()=>{if(!(!l||!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(o=>o.name))}}catch(s){c.error(`Cleanup failed: ${s instanceof Error?s.message:"Unknown error"}`)}finally{x(!1)}}},X=async()=>{if(!l||!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-canvas",children:[e.jsxs("div",{className:"flex h-10 shrink-0 items-center gap-2 px-3",children:[e.jsx(O,{"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"}),l&&e.jsx(d,{variant:"ghost",size:"icon-sm",onClick:Q,disabled:W,"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(ce,{"data-icon":"inline-start",className:A(p&&"animate-spin")})}),e.jsx(d,{variant:"ghost",size:"icon-sm",onClick:J,"aria-label":"Close worktrees",children:e.jsx(de,{"data-icon":"inline-start"})})]}),e.jsx(Z,{}),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(K,{className:"border-0 py-16",children:e.jsxs(V,{children:[e.jsx(_,{variant:"icon",children:e.jsx(O,{})}),e.jsx(ee,{children:"No worktrees"}),e.jsx(se,{children:"Create a new session with “Isolate in worktree” enabled"})]})}),v.map(s=>{var w,N,D;const t=((w=s.changedFiles)==null?void 0:w.reduce((i,k)=>i+k.additions,0))??0,o=((N=s.changedFiles)==null?void 0:N.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(ne,{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:()=>M(s.linkedSessions[0]),"aria-label":"Open session",children:e.jsx(me,{"data-icon":"inline-start"})}),l&&e.jsxs(e.Fragment,{children:[e.jsx(d,{variant:"ghost",size:"icon-xs",onClick:()=>q(s),disabled:B===s.name||s.commitsAhead===0,"aria-label":"Create PR",children:e.jsx(he,{"data-icon":"inline-start"})}),e.jsx(d,{variant:"ghost",size:"icon-xs",onClick:()=>G(s),disabled:L===s.name,className:"text-destructive hover:bg-destructive/10 hover:text-destructive","aria-label":"Delete worktree",children:e.jsx(I,{"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:te(s.createdAt)}),f>0&&e.jsxs(ae,{className:"mt-2",children:[e.jsxs(re,{className:"group flex w-full items-center gap-1.5 text-xs text-muted-foreground transition-colors hover:text-foreground",children:[e.jsx(xe,{"data-icon":"inline-start",className:"size-3 transition-transform group-data-panel-open:rotate-90 motion-reduce:transition-none"}),e.jsx(ue,{"data-icon":"inline-start",className:"size-3"}),e.jsxs("span",{children:[f," file",f!==1?"s":""," changed"]}),e.jsx(R,{add:t,del:o,className:"ml-1"})]}),e.jsx(ie,{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",pe[i.status]??"text-muted-foreground"),children:i.status}),e.jsx("span",{className:"truncate text-foreground/80",children:i.path}),e.jsx(R,{add:i.additions,del:i.deletions,className:"ml-auto text-muted-foreground"})]},i.path))})})]})]},s.name)})]})]}),e.jsx(S,{open:n!==null,onOpenChange:s=>{s||m(null)},children:e.jsxs(z,{size:"sm",children:[e.jsxs(E,{children:[e.jsx(oe,{className:"bg-destructive/10 text-destructive",children:e.jsx(I,{})}),e.jsx(U,{children:(n==null?void 0:n.reason)==="dirty"?"Delete worktree with uncommitted changes?":"Delete worktree with unpushed commits?"}),e.jsxs(F,{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($,{children:[e.jsx(T,{size:"sm",children:"Cancel"}),e.jsx(P,{variant:"destructive",size:"sm",onClick:H,children:(n==null?void 0:n.reason)==="dirty"&&n.worktree.commitsAhead>0?"Continue":"Delete worktree"})]})]})}),e.jsx(S,{open:a!==null,onOpenChange:s=>{s||j(null)},children:e.jsxs(z,{children:[e.jsxs(E,{children:[e.jsx(U,{children:"Remove stale worktrees?"}),e.jsxs(F,{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($,{children:[e.jsx(T,{size:"sm",children:"Cancel"}),e.jsx(P,{variant:"destructive",size:"sm",onClick:()=>void X(),children:"Remove worktrees"})]})]})})]})}export{ye as WorktreePanel};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as Z,j as t,r as v}from"./vendor-react-gGw_S5I_.js";import{J as Ze,C as le,a$ as Ae,b0 as J,m as ut,n as ft,I as mt,E as _t,G as Et,b1 as $t,B as ce,b2 as ht,U as Ie,b3 as xt,$ as pt,a0 as gt,a2 as bt,b4 as nt,b5 as jt,Z as et,b6 as At,aq as zt,ar as Tt,b7 as vt,i as It,j as Dt,k as Pt,b8 as Lt,z as Rt,aI as Ut,h as Bt,D as Ft}from"./index-DsnL-sXV.js";import{a7 as Ot,a8 as Mt,a9 as Gt,aa as Ht,d as Vt,T as Wt,M as qt,ab as Xt,ac as Kt,ad as Jt,a2 as wt,C as Nt,ae as at,af as Zt,l as Qt,x as Yt,ag as es,B as ts,ah as ss,ai as ns}from"./vendor-ui-Br3ZTAXZ.js";import{P as rt}from"./password-BV9mqUzz.js";import"./vendor-shiki-DOn6sF-i.js";import"./vendor-markdown-BE1gYnO9.js";function is(s){const e=Z.c(11);let n,i,a;e[0]!==s?({className:n,size:a,...i}=s,e[0]=s,e[1]=n,e[2]=i,e[3]=a):(n=e[1],i=e[2],a=e[3]);const r=a===void 0?"default":a;let l;e[4]!==n?(l=Ze("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 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(Mt,{"data-slot":"switch-thumb",className:"pointer-events-none block rounded-full bg-foreground 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)] 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"}),e[6]=f):f=e[6];let c;return e[7]!==i||e[8]!==r||e[9]!==l?(c=t.jsx(Ot,{"data-slot":"switch","data-size":r,className:l,...i,children:f}),e[7]=i,e[8]=r,e[9]=l,e[10]=c):c=e[10],c}function as(s){const e=Z.c(3),{name:n}=s,i=n.toLowerCase();if(i.includes("iphone")||i.includes("android")){let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Vt,{"data-icon":"inline-start",className:"size-4 text-muted-foreground"}),e[0]=r):r=e[0],r}if(i.includes("ipad")||i.includes("tablet")){let r;return e[1]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Wt,{"data-icon":"inline-start",className:"size-4 text-muted-foreground"}),e[1]=r):r=e[1],r}let a;return e[2]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(qt,{"data-icon":"inline-start",className:"size-4 text-muted-foreground"}),e[2]=a):a=e[2],a}function it(s){const e=Math.floor((Date.now()-s)/1e3);if(e<60)return"just now";const n=Math.floor(e/60);if(n<60)return`${n}m ago`;const i=Math.floor(n/60);return i<24?`${i}h ago`:`${Math.floor(i/24)}d ago`}function ls(s){const e=[`Shared ${it(s.createdAt)}`,s.lastAccessAt>0?`opened ${it(s.lastAccessAt)}`:"never opened"];return s.guests>0&&e.push(s.guests===1?"1 guest":`${s.guests} guests`),e.join(" · ")}function rs(){const s=Z.c(12),{shares:e,revoke:n,revokeAll:i}=$t();let a;s[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("p",{className:"text-xs text-muted-foreground",children:"Shared sessions"}),s[0]=a):a=s[0];let r;s[1]!==i||s[2]!==e.length?(r=e.length>0&&t.jsx(ce,{variant:"ghost",size:"xs",className:"text-destructive hover:text-destructive",onClick:()=>void i(),children:"Revoke all"}),s[1]=i,s[2]=e.length,s[3]=r):r=s[3];let l;s[4]!==r?(l=t.jsxs("div",{className:"flex h-6 items-center justify-between",children:[a,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:ls(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 os(s){const e=Z.c(30),{networkAccess:n,setNetworkAccess:i,networkPassword:a,setNetworkPassword:r,showNetworkPassword:l,setShowNetworkPassword:f,hasExistingPassword:c,initialNetworkAccess:o,connectedDevices:m,minPasswordLength:j}=s;let x;e[0]!==n?(x=n?t.jsx(Xt,{"data-icon":"inline-start",className:"size-4 text-success"}):t.jsx(Kt,{"data-icon":"inline-start",className:"size-4 text-muted-foreground"}),e[0]=n,e[1]=x):x=e[1];let b;e[2]===Symbol.for("react.memo_cache_sentinel")?(b=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]=b):b=e[2];let y;e[3]!==x?(y=t.jsxs("div",{className:"flex items-center gap-2",children:[x,b]}),e[3]=x,e[4]=y):y=e[4];let C;e[5]!==i?(C=_=>i(_),e[5]=i,e[6]=C):C=e[6];let w;e[7]!==n||e[8]!==C?(w=t.jsx(is,{"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]!==j||e[15]!==n||e[16]!==a||e[17]!==r||e[18]!==f||e[19]!==l?(p=n&&t.jsxs(le,{"data-invalid":a.length>0&&a.length<j,children:[t.jsx(Ae,{htmlFor:"network-password",children:"Password"}),t.jsx(J,{children:c&&a.length===0?"A password is already set. Leave blank to keep it.":`Use at least ${j} characters.`}),t.jsxs(ut,{children:[t.jsx(ft,{id:"network-password",type:l?"text":"password",value:a,onChange:_=>r(_.target.value),placeholder:c?"Enter new password to change":"Set a password for remote access"}),t.jsx(mt,{align:"inline-end",children:t.jsx(_t,{size:"icon-xs","aria-label":l?"Hide password":"Show password",onClick:()=>f(!l),children:l?t.jsx(Gt,{"data-icon":"inline-start"}):t.jsx(Ht,{"data-icon":"inline-start"})})})]}),a.length>0&&a.length<j&&t.jsxs(Et,{children:["Password must be at least ",j," characters (",a.length,"/",j,")"]}),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]=j,e[15]=n,e[16]=a,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(cs)})]}),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(rs,{}),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 cs(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:it(s.lastActivity)})]})]},`${s.ip}-${e}`)}const ds=["auto","path","npm","bundled","custom"],tt={source:"auto"},us=["path","npm","bundled"];function fs(s){return ds.includes(s)}function ms(s){if(!s||typeof s!="object")return;const{source:e,path:n}=s;if(!(!fs(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 St(s,e){return e?`v${e} · ${s}`:s}function hs(s,e){return s===null?"Checking installed binaries…":e?e.version===null?`${e.path} did not report a version — check the path.`:`Now running: ${St(e.path,e.version)}`:"No launchable binary for the saved choice — sessions cannot start."}function xs(s){return s!==null&&s.version!==null}function ps(s){const e=Z.c(92),{kind:n,value:i,onChange:a,disabled:r,reportVersion:l}=s;let f;e[0]!==n?(f=ht(n),e[0]=n,e[1]=f):f=e[1];const{displayName:c}=f,[o,m]=v.useState(null),[j,x]=v.useState(!1),b=`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(bs),()=>{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,E,D,g;if(e[7]!==r||e[8]!==c||e[9]!==b||e[10]!==a||e[11]!==j||e[12]!==(o==null?void 0:o.active)||e[13]!==(o==null?void 0:o.candidates)||e[14]!==i.path||e[15]!==i.source){const I=new Map((o==null?void 0:o.candidates.map(gs))??[]);u=(o==null?void 0:o.active)??null;let te;e[29]!==r||e[30]!==b||e[31]!==a||e[32]!==i.path||e[33]!==i.source?(te=(L,F,ie,oe)=>{const lt=oe===void 0?!0:oe,K=`${b}-${L}`;return t.jsxs(le,{orientation:"horizontal",children:[t.jsx("input",{type:"radio",id:K,name:b,className:"mt-1 size-4 shrink-0 accent-primary",checked:i.source===L,disabled:r||!lt,onChange:()=>a(L==="custom"?{source:L,path:i.path??""}:{source:L})}),t.jsxs(xt,{children:[t.jsx(Ae,{htmlFor:K,children:F}),t.jsx(J,{className:"break-all",children:ie})]})]},L)},e[29]=r,e[30]=b,e[31]=a,e[32]=i.path,e[33]=i.source,e[34]=te):te=e[34],S=te;const se=L=>{const F=I.get(L);return S(L,Te[L],F?St(F.path,F.version):"Not found on this machine.",F!==void 0||i.source===L)},ze=u?`${Te[i.source]} · v${u.version??"?"}`:Te[i.source];p=pt,D=j,g=x,h="flex flex-col gap-2";let q;e[35]===Symbol.for("react.memo_cache_sentinel")?(q=t.jsx(ce,{type:"button",variant:"ghost",className:"h-auto w-full justify-between px-0 font-medium hover:bg-transparent"}),e[35]=q):q=e[35];let ne;e[36]===Symbol.for("react.memo_cache_sentinel")?(ne=t.jsx(Jt,{"data-icon":"inline-start",className:"size-4 text-muted-foreground"}),e[36]=ne):ne=e[36];let X;e[37]!==c?(X=t.jsxs("span",{className:"flex items-center gap-2",children:[ne,c," executable"]}),e[37]=c,e[38]=X):X=e[38];let R;e[39]!==ze?(R=t.jsx("span",{className:"truncate",children:ze}),e[39]=ze,e[40]=R):R=e[40];let U;e[41]!==j?(U=j?t.jsx(wt,{className:"size-4 shrink-0"}):t.jsx(Nt,{className:"size-4 shrink-0"}),e[41]=j,e[42]=U):U=e[42];let B;e[43]!==R||e[44]!==U?(B=t.jsxs("span",{className:"flex min-w-0 items-center gap-1 text-xs font-normal text-muted-foreground",children:[R,U]}),e[43]=R,e[44]=U,e[45]=B):B=e[45],e[46]!==X||e[47]!==B?(_=t.jsxs(gt,{render:q,children:[X,B]}),e[46]=X,e[47]=B,e[48]=_):_=e[48],N=bt,w=le,e[49]===Symbol.for("react.memo_cache_sentinel")?(E=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]=E):E=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=us.map(se),e[7]=r,e[8]=c,e[9]=b,e[10]=a,e[11]=j,e[12]=o==null?void 0:o.active,e[13]=o==null?void 0:o.candidates,e[14]=i.path,e[15]=i.source,e[16]=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]=E,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],E=e[26],D=e[27],g=e[28];const P=`${c} executable path`,H=i.source==="custom"?i.path??"":"",re=r||i.source!=="custom";let Q;e[52]!==a?(Q=I=>a({source:"custom",path:I.target.value}),e[52]=a,e[53]=Q):Q=e[53];let $;e[54]!==P||e[55]!==H||e[56]!==re||e[57]!==Q?($=t.jsx(nt,{"aria-label":P,value:H,placeholder:"/path/to/binary",disabled:re,onChange:Q,className:"mt-1"}),e[54]=P,e[55]=H,e[56]=re,e[57]=Q,e[58]=$):$=e[58];let V;e[59]!==S||e[60]!==$?(V=S("custom",Te.custom,$),e[59]=S,e[60]=$,e[61]=V):V=e[61];let O;e[62]!==V||e[63]!==z||e[64]!==T||e[65]!==k?(O=t.jsxs("div",{className:z,children:[T,k,V]}),e[62]=V,e[63]=z,e[64]=T,e[65]=k,e[66]=O):O=e[66];let Y;e[67]!==u?(Y=xs(u)?"text-muted-foreground":"text-destructive",e[67]=u,e[68]=Y):Y=e[68];let A;e[69]!==Y?(A=Ze("text-xs",Y),e[69]=Y,e[70]=A):A=e[70];let W;e[71]!==u||e[72]!==o?(W=hs(o,u),e[71]=u,e[72]=o,e[73]=W):W=e[73];let M;e[74]!==A||e[75]!==W?(M=t.jsx("p",{className:A,"aria-live":"polite",children:W}),e[74]=A,e[75]=W,e[76]=M):M=e[76];let ee;e[77]!==w||e[78]!==O||e[79]!==M||e[80]!==E?(ee=t.jsxs(w,{children:[E,O,M]}),e[77]=w,e[78]=O,e[79]=M,e[80]=E,e[81]=ee):ee=e[81];let G;e[82]!==N||e[83]!==ee?(G=t.jsx(N,{children:ee}),e[82]=N,e[83]=ee,e[84]=G):G=e[84];let de;return e[85]!==p||e[86]!==h||e[87]!==_||e[88]!==G||e[89]!==D||e[90]!==g?(de=t.jsxs(p,{open:D,onOpenChange:g,className:h,children:[_,G]}),e[85]=p,e[86]=h,e[87]=_,e[88]=G,e[89]=D,e[90]=g,e[91]=de):de=e[91],de}function gs(s){return[s.source,s]}function bs(){}function js(s){return s.ok?s.json():null}function yt(s){return s instanceof Error?s.message:String(s)}async function ot(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 jt(e,`Request failed (${e.status})`)}}catch(e){return{status:"error",error:yt(e)}}}function vs(s){const[e,n]=v.useState(null),[i,a]=v.useState(null),[r,l]=v.useState(null);v.useEffect(()=>{let c=!1;return ot(s).then(o=>{c||n(o)}),()=>{c=!0}},[s]);const f=v.useCallback(async c=>{a(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 jt(o,`Request failed (${o.status})`)});return}l({kind:"switched",result:await o.json()}),n(await ot(s))}catch(o){l({kind:"failed",error:yt(o)})}finally{a(null)}},[s]);return{report:e,switchingSlot:i,outcome:r,switchTo:f}}const ws={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 ct(s){const e=Z.c(18),{label:n,window:i}=s;if(!i)return null;const a=i.pct>=80,r=i.resetsIn?`${n} window resets in ${i.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=a?"bg-destructive":"bg-primary";let c;e[2]!==f?(c=Ze("absolute inset-y-0 left-0 rounded-full",f),e[2]=f,e[3]=c):c=e[3];const o=`${i.pct}%`;let m;e[4]!==o?(m={width:o},e[4]=o,e[5]=m):m=e[5];let j;e[6]!==c||e[7]!==m?(j=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]=j):j=e[8];let x;e[9]!==i.pct?(x=Math.round(i.pct),e[9]=i.pct,e[10]=x):x=e[10];let b;e[11]!==x?(b=t.jsxs("span",{className:"tabular-nums",children:[x,"%"]}),e[11]=x,e[12]=b):b=e[12];let y;return e[13]!==r||e[14]!==l||e[15]!==j||e[16]!==b?(y=t.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",title:r,children:[l,j,b]}),e[13]=r,e[14]=l,e[15]=j,e[16]=b,e[17]=y):y=e[17],y}function dt(s){return/[.!?]$/.test(s)?s:`${s}.`}function Ns(s,e){if(s.kind==="failed")return`Switch failed: ${s.error}`;const{result:n}=s,i=[dt(n.message)];return n.switched&&i.push(n.credentialStore==="keychain"?`Running ${e} sessions pick it up within about 30 seconds; restart one to apply it immediately.`:`New messages in ${e} use it from now on.`),[...i,...n.warnings.map(dt)].join(" ")}function Ss(s){const e=Z.c(41),{kind:n,disabled:i}=s;let a;e[0]!==n?(a=ht(n),e[0]=n,e[1]=a):a=e[1];const{displayName:r}=a,{report:l,switchingSlot:f,outcome:c,switchTo:o}=vs(n),[m,j]=v.useState(!1);if(l===null||l.status==="missing")return null;let x,b;if(e[2]!==l.accounts||e[3]!==l.status){x=l.status==="ok"?l.accounts:[];const g=x.find(ys)??null;b=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]=b}else x=e[4],b=e[5];const y=b;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(Zt,{"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(wt,{className:"size-4 shrink-0"}):t.jsx(Nt,{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(gt,{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]!==i||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=ws[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(ct,{label:"5h",window:g.usage.fiveHour}),t.jsx(ct,{label:"7d",window:g.usage.sevenDay})]})]}),!i&&!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(at,{"data-icon":"inline-start",className:"size-3.5 animate-spin"}),"Switching…"]}):"Switch"})]},g.slot)})}),e[23]=x,e[24]=i,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:Ze("text-xs",c.kind==="failed"?"text-destructive":"text-muted-foreground"),"aria-live":"polite",role:c.kind==="failed"?"alert":"status",children:Ns(c,r)}),e[30]=r,e[31]=c,e[32]=k):k=e[32];let E;e[33]!==z||e[34]!==T||e[35]!==k?(E=t.jsx(bt,{children:t.jsxs(le,{children:[z,T,k]})}),e[33]=z,e[34]=T,e[35]=k,e[36]=E):E=e[36];let D;return e[37]!==m||e[38]!==E||e[39]!==h?(D=t.jsxs(pt,{open:m,onOpenChange:j,className:"flex flex-col gap-2",children:[h,E]}),e[37]=m,e[38]=E,e[39]=h,e[40]=D):D=e[40],D}function ys(s){return s.active}const ks=vt().filter(s=>s.cli.bundledBySdk).map(s=>s.kind),Cs=vt().filter(s=>s.capabilities.accountSwitching).map(s=>s.kind);function _s(s,e){return s.source===e.source&&(s.source!=="custom"||s.path===e.path)}function Es(s){const e=Z.c(5),{status:n,error:i}=s;if(n==="validating"){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[t.jsx(at,{"data-icon":"inline-start",className:"size-3.5 animate-spin"}),"Checking path..."]}),e[0]=a):a=e[0],a}if(n==="valid"){let a;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsxs("div",{className:"flex items-center gap-2 text-sm text-success",children:[t.jsx(ss,{"data-icon":"inline-start",className:"size-3.5"}),"Valid .claude directory found"]}),e[1]=a):a=e[1],a}if(n==="invalid"&&i){let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(ns,{"data-icon":"inline-start",className:"size-3.5"}),e[2]=a):a=e[2];let r;return e[3]!==i?(r=t.jsxs("div",{className:"flex items-center gap-2 text-sm text-destructive",children:[a,i]}),e[3]=i,e[4]=r):r=e[4],r}return null}function Fs(s){const e=Z.c(110),{open:n,currentPath:i,onClose:a,onSaved:r}=s,[l,f]=v.useState(i),[c,o]=v.useState(!1),{status:m,error:j,debouncedValidate:x,reset:b,save:y}=At();let C;e[0]===Symbol.for("react.memo_cache_sentinel")?(C=zt(),e[0]=C):C=e[0];const w=C;let N;e[1]===Symbol.for("react.memo_cache_sentinel")?(N=Tt("configWrite"),e[1]=N):N=e[1];const p=N,[u,S]=v.useState(!1),[h,_]=v.useState(""),[z,T]=v.useState(!1),[k,E]=v.useState(""),[D,g]=v.useState(""),[P,H]=v.useState(""),[re,Q]=v.useState(""),[$,V]=v.useState(!1),[O,Y]=v.useState(!1),[A,W]=v.useState(tt),[M,ee]=v.useState(0),[G,de]=v.useState(tt),[I,te]=v.useState(!1),[se,ze]=v.useState(!1);let q;e[2]===Symbol.for("react.memo_cache_sentinel")?(q=[],e[2]=q):q=e[2];const[ne,X]=v.useState(q);let R,U;e[3]!==i||e[4]!==n||e[5]!==b?(R=()=>{n&&(f(i),b(),Ie("/api/config").then(Is).then(d=>{const ae=(d==null?void 0:d.networkAccess)||!1;S(ae),te(ae),ze(!!(d!=null&&d.networkPassword)),_("");const qe=(d==null?void 0:d.terminalApp)||"";E(qe),g(qe);const Xe=(d==null?void 0:d.editorApp)||"";H(Xe),Q(Xe);const Ke=(d==null?void 0:d.useBuiltInEditor)===!0;V(Ke),Y(Ke);const Je=ms(d==null?void 0:d.agentExecutable)??tt;W(Je),de(Je),ae&&(d!=null&&d.networkPassword)&&!w?Ie("/api/connected-devices").then(Ts).then($e=>X(($e==null?void 0:$e.devices)||[])).catch(zs):X([])}).catch(As))},U=[n,i,b,w],e[3]=i,e[4]=n,e[5]=b,e[6]=R,e[7]=U):(R=e[6],U=e[7]),v.useEffect(R,U);let B;e[8]!==x?(B=d=>{const ae=d.target.value;f(ae),x(ae)},e[8]=x,e[9]=B):B=e[9];const L=B;let F;e[10]!==A||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]!==$?(F=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:A});d.success&&d.claudeDir&&(ee($s),r(d.claudeDir)),o(!1)},e[10]=A,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]=F):F=e[20];const ie=F;let oe;e[21]!==A||e[22]!==P||e[23]!==se||e[24]!==G||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 ae=m==="valid",qe=!w&&(u!==I||u&&h.length>0),Xe=k!==D,Ke=P!==re||$!==O,Je=!_s(A,G);if(!ae&&!qe&&!Xe&&!Ke&&!Je||A.source==="custom"&&!(($e=A.path)!=null&&$e.trim()))return!1;if(!w&&u){const kt=h.length>0&&h.length<rt,Ct=!se&&h.length===0;if(kt||Ct)return!1}return!0},e[21]=A,e[22]=P,e[23]=se,e[24]=G,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]!==a?(ue=d=>{d||a()},e[35]=a,e[36]=ue):ue=e[36];let De;e[37]===Symbol.for("react.memo_cache_sentinel")?(De=t.jsxs(It,{children:[t.jsx(Dt,{className:"text-foreground",children:"Configuration"}),t.jsx(Pt,{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(Ae,{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 Re;e[40]===Symbol.for("react.memo_cache_sentinel")?(Re=t.jsx(mt,{children:t.jsx(Qt,{"data-icon":"inline-start"})}),e[40]=Re):Re=e[40];let fe;e[41]!==K||e[42]!==ie||e[43]!==c?(fe=d=>{d.key==="Enter"&&K&&!c&&ie()},e[41]=K,e[42]=ie,e[43]=c,e[44]=fe):fe=e[44];let me;e[45]!==L||e[46]!==l||e[47]!==fe?(me=t.jsxs(ut,{children:[Re,t.jsx(ft,{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]!==j||e[50]!==m?(he=t.jsx("div",{"aria-live":"polite",children:t.jsx(Es,{status:m,error:j})}),e[49]=j,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 Ue,Be;e[55]===Symbol.for("react.memo_cache_sentinel")?(Ue=t.jsxs(Ae,{htmlFor:"terminal-application",children:[t.jsx(Yt,{"data-icon":"inline-start",className:"size-4 text-muted-foreground"}),"Terminal application"]}),Be=t.jsx(J,{children:"Leave blank to use the system default for Ctrl+Cmd+T."}),e[55]=Ue,e[56]=Be):(Ue=e[55],Be=e[56]);let Fe;e[57]===Symbol.for("react.memo_cache_sentinel")?(Fe=d=>E(d.target.value),e[57]=Fe):Fe=e[57];let pe;e[58]!==k?(pe=t.jsxs(le,{children:[Ue,Be,t.jsx(nt,{id:"terminal-application",value:k,onChange:Fe,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=>V(d===!0),e[60]=Oe):Oe=e[60];let ge;e[61]!==$?(ge=t.jsx(Lt,{id:"use-built-in-editor",checked:$,onCheckedChange:Oe,disabled:!p}),e[61]=$,e[62]=ge):ge=e[62];let Me;e[63]===Symbol.for("react.memo_cache_sentinel")?(Me=t.jsxs(xt,{children:[t.jsxs(Ae,{htmlFor:"use-built-in-editor",children:[t.jsx(es,{"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]=Me):Me=e[63];let be;e[64]!==ge?(be=t.jsxs(le,{orientation:"horizontal",children:[ge,Me]}),e[64]=ge,e[65]=be):be=e[65];let Ge;e[66]===Symbol.for("react.memo_cache_sentinel")?(Ge=t.jsxs(Ae,{htmlFor:"editor-application",children:[t.jsx(ts,{"data-icon":"inline-start",className:"size-4 text-muted-foreground"}),"Editor application"]}),e[66]=Ge):Ge=e[66];const Qe=$?"Not used while files open in Cogpit.":"Leave blank to use $VISUAL or automatic detection.";let je;e[67]!==Qe?(je=t.jsx(J,{children:Qe}),e[67]=Qe,e[68]=je):je=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 Ye=!p||$;let ve;e[70]!==P||e[71]!==Ye?(ve=t.jsx(nt,{id:"editor-application",value:P,onChange:He,placeholder:"cursor, code, zed, or /path/to/binary",disabled:Ye}),e[70]=P,e[71]=Ye,e[72]=ve):ve=e[72];let we;e[73]!==je||e[74]!==ve?(we=t.jsxs(le,{children:[Ge,je,ve]}),e[73]=je,e[74]=ve,e[75]=we):we=e[75];let Ne;e[76]!==A||e[77]!==M?(Ne=ks.map(d=>t.jsx(ps,{kind:d,value:A,onChange:W,disabled:!p,reportVersion:M},d)),e[76]=A,e[77]=M,e[78]=Ne):Ne=e[78];let Ve;e[79]===Symbol.for("react.memo_cache_sentinel")?(Ve=Cs.map(d=>t.jsx(Ss,{kind:d,disabled:!p},d)),e[79]=Ve):Ve=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(os,{networkAccess:u,setNetworkAccess:S,networkPassword:h,setNetworkPassword:_,showNetworkPassword:z,setShowNetworkPassword:T,hasExistingPassword:se,initialNetworkAccess:I,connectedDevices:ne,minPasswordLength:rt}),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]!==be||e[90]!==we||e[91]!==Ne||e[92]!==Se?(ye=t.jsxs(Rt,{children:[xe,pe,be,we,Ne,Ve,Se]}),e[87]=xe,e[88]=pe,e[89]=be,e[90]=we,e[91]=Ne,e[92]=Se,e[93]=ye):ye=e[93];let ke;e[94]!==a?(ke=t.jsx(ce,{variant:"outline",onClick:a,children:"Cancel"}),e[94]=a,e[95]=ke):ke=e[95];let Ce;e[96]!==K||e[97]!==ie||e[98]!==c?(Ce=p&&t.jsx(ce,{disabled:!K||c,onClick:ie,children:c?t.jsxs(t.Fragment,{children:[t.jsx(at,{"data-icon":"inline-start",className:"size-4 animate-spin"}),"Saving..."]}):"Save"}),e[96]=K,e[97]=ie,e[98]=c,e[99]=Ce):Ce=e[99];let _e;e[100]!==ke||e[101]!==Ce?(_e=t.jsxs(Ut,{children:[ke,Ce]}),e[100]=ke,e[101]=Ce,e[102]=_e):_e=e[102];let Ee;e[103]!==ye||e[104]!==_e?(Ee=t.jsxs(Bt,{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]=Ee):Ee=e[105];let We;return e[106]!==n||e[107]!==Ee||e[108]!==ue?(We=t.jsx(Ft,{open:n,onOpenChange:ue,children:Ee}),e[106]=n,e[107]=Ee,e[108]=ue,e[109]=We):We=e[109],We}function $s(s){return s+1}function As(){}function zs(){}function Ts(s){return s.json()}function Is(s){return s.json()}export{Fs as ConfigDialog};
|