cogpit 3.3.6 → 3.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli-runtime.js +878 -371
- package/dist/instance-worker.js +219 -20
- package/dist/web/assets/{CogpitBlock-DTcsvTF0.js → CogpitBlock-BycygJkN.js} +1 -1
- package/dist/web/assets/{CommandPaletteHost-DnjXwwFv.js → CommandPaletteHost-BgKoDHcE.js} +1 -1
- package/dist/web/assets/{ConfigBrowser-C6-RV3dj.js → ConfigBrowser-Bg_4DTXP.js} +1 -1
- package/dist/web/assets/{CrewPanel-CdPeA3WX.js → CrewPanel-zGPJa0nm.js} +1 -1
- package/dist/web/assets/{HighlightedEditor-ptPSiZXt.js → HighlightedEditor-C2wqN7Xw.js} +1 -1
- package/dist/web/assets/{KeyboardShortcutsDialog-CNsqP3xD.js → KeyboardShortcutsDialog-CUUxScBc.js} +1 -1
- package/dist/web/assets/{MissionHome-CJ8aY60N.js → MissionHome-BTxUBbuU.js} +1 -1
- package/dist/web/assets/{MobileFileChanges-xDTu0VVe.js → MobileFileChanges-BN7bdxse.js} +1 -1
- package/dist/web/assets/PluginsDialog-XdukDCaQ.js +1 -0
- package/dist/web/assets/{PreviewPanel-CXZkRGUI.js → PreviewPanel-u6bXlEMm.js} +1 -1
- package/dist/web/assets/{ProjectFilesPanel-DxTA4CcL.js → ProjectFilesPanel-BMSrF4EP.js} +1 -1
- package/dist/web/assets/{ProjectSwitcherModal-DVRB-R0l.js → ProjectSwitcherModal-Ph5R0C2t.js} +1 -1
- package/dist/web/assets/{TerminalOutput-D_7Mor6c.js → TerminalOutput-w6mgZ5a7.js} +1 -1
- package/dist/web/assets/{ThemeSelectorModal-Bhkx5ikh.js → ThemeSelectorModal-DB69FVzW.js} +1 -1
- package/dist/web/assets/{WorkflowsPanel-Dexz6c1y.js → WorkflowsPanel-DFIpG32k.js} +1 -1
- package/dist/web/assets/{WorktreePanel-DS4svy6H.js → WorktreePanel-B_9oCuoW.js} +1 -1
- package/dist/web/assets/{edition-ui-D6tmWJW3.js → edition-ui-ZYzlZ7yi.js} +1 -1
- package/dist/web/assets/index-BYjv05SI.js +498 -0
- package/dist/web/assets/{index-DUyWfgZU.js → index-C1aZnlGg.js} +1 -1
- package/dist/web/assets/{index-BZiOTcnb.js → index-CKeIY-uM.js} +1 -1
- package/dist/web/assets/index-hGMtuUNI.css +1 -0
- package/dist/web/assets/index-vyOkk7K_.js +2 -0
- package/dist/web/assets/session-parser.worker-B1_qLRIm.js +31 -0
- package/dist/web/assets/{switch-Bm0VDZET.js → switch-DkwGVNAF.js} +1 -1
- package/dist/web/assets/{vendor-ui-DKYSMrjf.js → vendor-ui-DkzcTXCS.js} +190 -195
- package/dist/web/index.html +3 -3
- package/package.json +2 -2
- package/dist/web/assets/PluginsDialog-U4WQVeyc.js +0 -1
- package/dist/web/assets/index-BKROBJD1.js +0 -1
- package/dist/web/assets/index-C6tWmbrY.css +0 -1
- package/dist/web/assets/index-COB3e1_W.js +0 -496
- package/dist/web/assets/session-parser.worker-DqoBsPjk.js +0 -30
package/dist/web/index.html
CHANGED
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
.dark body { background: var(--canvas, #09090b); color: var(--foreground, #fafafa); }
|
|
15
15
|
body { background: var(--canvas, #fafafa); color: var(--foreground, #09090b); }
|
|
16
16
|
</style>
|
|
17
|
-
<script type="module" crossorigin src="/assets/index-
|
|
17
|
+
<script type="module" crossorigin src="/assets/index-BYjv05SI.js"></script>
|
|
18
18
|
<link rel="modulepreload" crossorigin href="/assets/vendor-react-gGw_S5I_.js">
|
|
19
|
-
<link rel="modulepreload" crossorigin href="/assets/vendor-ui-
|
|
19
|
+
<link rel="modulepreload" crossorigin href="/assets/vendor-ui-DkzcTXCS.js">
|
|
20
20
|
<link rel="modulepreload" crossorigin href="/assets/vendor-markdown-BE1gYnO9.js">
|
|
21
21
|
<link rel="modulepreload" crossorigin href="/assets/vendor-shiki-DOn6sF-i.js">
|
|
22
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
22
|
+
<link rel="stylesheet" crossorigin href="/assets/index-hGMtuUNI.css">
|
|
23
23
|
<script src="/theme-bootstrap.js"></script>
|
|
24
24
|
</head>
|
|
25
25
|
<body>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cogpit",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.0",
|
|
4
4
|
"description": "Run Cogpit's local Claude Code, Codex, and GitHub Copilot CLI interface without installing it",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"ws": "^8.21.1",
|
|
45
45
|
"semver": "7.8.5",
|
|
46
46
|
"tuf-js": "3.1.0",
|
|
47
|
-
"zod": "4.6.
|
|
47
|
+
"zod": "4.6.6",
|
|
48
48
|
"proper-lockfile": "4.1.2",
|
|
49
49
|
"ipaddr.js": "2.5.0",
|
|
50
50
|
"js-yaml": "4.3.2",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as ue,r as C,j as t}from"./vendor-react-gGw_S5I_.js";import{C as Q,bf as Ie,b6 as X,c2 as Qe,b7 as Re,c3 as Xe,bb as de,B as E,z as _e,c4 as et,c5 as Ge,c6 as Ke,c7 as Je,c8 as We,c9 as Ye,ca as Ze,A as se,p as ne,cb as tt,Z as $e,cc as st,cd as Me,a9 as nt,aa as it,ad as lt,a7 as at,ac as ot,ab as rt,a6 as ct,a5 as dt,b0 as De,ce as ut,cf as ft,D as ht,h as mt,i as pt,j as xt,k as gt,cg as jt,bX as bt,bY as vt,bZ as Ae,b_ as Oe,L as yt,M as Ct,N as wt,O as Nt,Q as St}from"./index-COB3e1_W.js";import{a as kt,av as $t}from"./vendor-ui-DKYSMrjf.js";import"./vendor-shiki-DOn6sF-i.js";import"./vendor-markdown-BE1gYnO9.js";function Be(l){const e=l.trim().replace(/^v/i,"").match(/^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?/);return e?{parts:[Number(e[1]),Number(e[2]),Number(e[3])],prerelease:e[4]?e[4].split("."):[]}:null}function Dt(l,e){if(l.length===0&&e.length===0)return 0;if(l.length===0)return 1;if(e.length===0)return-1;for(let s=0;s<Math.max(l.length,e.length);s+=1){const i=l[s],r=e[s];if(i===void 0)return-1;if(r===void 0)return 1;const a=/^\d+$/.test(i),n=/^\d+$/.test(r);if(a&&n){if(Number(i)!==Number(r))return Number(i)<Number(r)?-1:1;continue}if(a!==n)return a?-1:1;if(i!==r)return i<r?-1:1}return 0}function It(l,e){const s=Be(l),i=Be(e);if(!s||!i)return null;for(let r=0;r<3;r+=1)if(s.parts[r]!==i.parts[r])return s.parts[r]<i.parts[r]?-1:1;return Dt(s.prerelease,i.prerelease)}function qe(l){const e=ue.c(33),{value:s,onChange:i,projects:r,disabled:a}=l,n=a===void 0?!1:a,d=C.useId();let o;e[0]!==s.projectIds||e[1]!==s.type?(o=s.type==="projects"?s.projectIds:[],e[0]=s.projectIds,e[1]=s.type,e[2]=o):o=e[2];let v;e[3]!==o?(v=new Set(o),e[3]=o,e[4]=v):v=e[4];const y=v;let h;e[5]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(Qe,{children:"Available in"}),e[5]=h):h=e[5];const w=`${d}-all`,j=s.type==="all";let c;e[6]!==i?(c=N=>i(N?{type:"all"}:{type:"projects",projectIds:[]}),e[6]=i,e[7]=c):c=e[7];let p;e[8]!==n||e[9]!==w||e[10]!==j||e[11]!==c?(p=t.jsx(Ie,{id:w,checked:j,disabled:n,onCheckedChange:c}),e[8]=n,e[9]=w,e[10]=j,e[11]=c,e[12]=p):p=e[12];const m=`${d}-all`;let x;e[13]!==m?(x=t.jsx(X,{htmlFor:m,children:"All projects on this host, including new projects"}),e[13]=m,e[14]=x):x=e[14];let g;e[15]!==x||e[16]!==p?(g=t.jsxs(Q,{orientation:"horizontal",children:[p,x]}),e[15]=x,e[16]=p,e[17]=g):g=e[17];let b;e[18]!==n||e[19]!==d||e[20]!==i||e[21]!==r||e[22]!==y||e[23]!==s.projectIds||e[24]!==s.type?(b=s.type==="projects"&&t.jsx("div",{className:"flex max-h-40 flex-col gap-3 overflow-y-auto",children:r.map(N=>t.jsxs(Q,{orientation:"horizontal",children:[t.jsx(Ie,{id:`${d}-${N.id}`,checked:y.has(N.id),disabled:n,onCheckedChange:D=>i({type:"projects",projectIds:D?[...s.projectIds,N.id]:s.projectIds.filter(R=>R!==N.id)})}),t.jsx(X,{htmlFor:`${d}-${N.id}`,children:N.name})]},N.id))}),e[18]=n,e[19]=d,e[20]=i,e[21]=r,e[22]=y,e[23]=s.projectIds,e[24]=s.type,e[25]=b):b=e[25];const k=s.type==="projects"&&s.projectIds.length===0?"Installed but hidden until you choose a project.":"This setting is shared by every client connected to this host.";let S;e[26]!==k?(S=t.jsx(Re,{children:k}),e[26]=k,e[27]=S):S=e[27];let u;return e[28]!==n||e[29]!==g||e[30]!==b||e[31]!==S?(u=t.jsxs(Xe,{disabled:n,children:[h,g,b,S]}),e[28]=n,e[29]=g,e[30]=b,e[31]=S,e[32]=u):u=e[32],u}function Rt(l){const e=ue.c(69),{client:s,run:i,busy:r}=l,a=C.useId(),[n,d]=C.useState(""),[o,v]=C.useState(""),[y,h]=C.useState(null),[w,j]=C.useState(""),[c,p]=C.useState(!1);let m;e[0]!==s||e[1]!==w||e[2]!==o||e[3]!==n||e[4]!==y||e[5]!==i?(m=Y=>{Y.preventDefault(),i(async()=>{var ce;if(!y||y.size>262144)throw new Error("Choose a root metadata file smaller than 256 KiB");if(!((ce=globalThis.crypto)!=null&&ce.subtle))throw new Error("Publisher enrollment requires HTTPS or localhost");const B=await y.arrayBuffer(),re=Array.from(new Uint8Array(await crypto.subtle.digest("SHA-256",B)),Et).join("");if(re!==w.trim().toLowerCase())throw new Error("The root file does not match the fingerprint you entered");await s.enrollDeveloper({publisher:n,label:o,root:new TextDecoder("utf-8",{fatal:!0}).decode(B),fingerprint:re}),p(!1),d(""),v(""),j("")})},e[0]=s,e[1]=w,e[2]=o,e[3]=n,e[4]=y,e[5]=i,e[6]=m):m=e[6];const x=`${a}-name`;let g;e[7]!==x?(g=t.jsx(X,{htmlFor:x,children:"Development publisher"}),e[7]=x,e[8]=g):g=e[8];const b=`${a}-name`;let k;e[9]===Symbol.for("react.memo_cache_sentinel")?(k=Y=>d(Y.target.value),e[9]=k):k=e[9];let S;e[10]!==r||e[11]!==n||e[12]!==b?(S=t.jsx(de,{id:b,value:n,onChange:k,placeholder:"dev-your-name",pattern:"dev-[a-z0-9-]+",maxLength:64,required:!0,disabled:r}),e[10]=r,e[11]=n,e[12]=b,e[13]=S):S=e[13];let u;e[14]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(Re,{children:"Development publishers have a separate namespace from official plugins."}),e[14]=u):u=e[14];let N;e[15]!==g||e[16]!==S?(N=t.jsxs(Q,{children:[g,S,u]}),e[15]=g,e[16]=S,e[17]=N):N=e[17];const D=`${a}-label`;let R;e[18]!==D?(R=t.jsx(X,{htmlFor:D,children:"Display name"}),e[18]=D,e[19]=R):R=e[19];const A=`${a}-label`;let O;e[20]===Symbol.for("react.memo_cache_sentinel")?(O=Y=>v(Y.target.value),e[20]=O):O=e[20];let I;e[21]!==r||e[22]!==o||e[23]!==A?(I=t.jsx(de,{id:A,value:o,onChange:O,maxLength:100,required:!0,disabled:r}),e[21]=r,e[22]=o,e[23]=A,e[24]=I):I=e[24];let U;e[25]!==R||e[26]!==I?(U=t.jsxs(Q,{children:[R,I]}),e[25]=R,e[26]=I,e[27]=U):U=e[27];const H=`${a}-root`;let z;e[28]!==H?(z=t.jsx(X,{htmlFor:H,children:"Publisher root file"}),e[28]=H,e[29]=z):z=e[29];const ee=`${a}-root`;let G;e[30]===Symbol.for("react.memo_cache_sentinel")?(G=Y=>{var B;h(((B=Y.target.files)==null?void 0:B[0])??null),p(!1)},e[30]=G):G=e[30];let _;e[31]!==r||e[32]!==ee?(_=t.jsx(de,{id:ee,type:"file",accept:".json,application/json",onChange:G,required:!0,disabled:r}),e[31]=r,e[32]=ee,e[33]=_):_=e[33];let K;e[34]!==z||e[35]!==_?(K=t.jsxs(Q,{children:[z,_]}),e[34]=z,e[35]=_,e[36]=K):K=e[36];const te=`${a}-fingerprint`;let F;e[37]!==te?(F=t.jsx(X,{htmlFor:te,children:"Verified SHA-256 fingerprint"}),e[37]=te,e[38]=F):F=e[38];const J=`${a}-fingerprint`;let L;e[39]===Symbol.for("react.memo_cache_sentinel")?(L=Y=>{j(Y.target.value),p(!1)},e[39]=L):L=e[39];let q;e[40]!==r||e[41]!==w||e[42]!==J?(q=t.jsx(de,{id:J,value:w,onChange:L,placeholder:"64 hexadecimal characters",pattern:"[a-fA-F0-9]{64}",required:!0,disabled:r}),e[40]=r,e[41]=w,e[42]=J,e[43]=q):q=e[43];let T;e[44]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(Re,{children:"Get this fingerprint from the publisher through a source you trust."}),e[44]=T):T=e[44];let V;e[45]!==F||e[46]!==q?(V=t.jsxs(Q,{children:[F,q,T]}),e[45]=F,e[46]=q,e[47]=V):V=e[47];const f=`${a}-trust`;let $;e[48]!==r||e[49]!==f||e[50]!==c?($=t.jsx(Ie,{id:f,checked:c,onCheckedChange:p,disabled:r}),e[48]=r,e[49]=f,e[50]=c,e[51]=$):$=e[51];const W=`${a}-trust`;let M;e[52]!==W?(M=t.jsx(X,{htmlFor:W,children:"I verified the publisher and trust packages signed by this root."}),e[52]=W,e[53]=M):M=e[53];let Z;e[54]!==$||e[55]!==M?(Z=t.jsxs(Q,{orientation:"horizontal",children:[$,M]}),e[54]=$,e[55]=M,e[56]=Z):Z=e[56];const ae=r||!c||!y;let ie;e[57]!==ae?(ie=t.jsx(E,{type:"submit",disabled:ae,children:"Trust development publisher"}),e[57]=ae,e[58]=ie):ie=e[58];let le;e[59]!==U||e[60]!==K||e[61]!==V||e[62]!==Z||e[63]!==ie||e[64]!==N?(le=t.jsxs(_e,{children:[N,U,K,V,Z,ie]}),e[59]=U,e[60]=K,e[61]=V,e[62]=Z,e[63]=ie,e[64]=N,e[65]=le):le=e[65];let oe;return e[66]!==m||e[67]!==le?(oe=t.jsx("form",{onSubmit:m,children:le}),e[66]=m,e[67]=le,e[68]=oe):oe=e[68],oe}function Et(l){return l.toString(16).padStart(2,"0")}const Pt={project:null,theme:{mode:"light",tokens:{}},locale:"en",reducedMotion:!0,visible:!1};function Tt({client:l,preview:e,activation:s,key:i,onFrame:r,onComplete:a,onError:n}){const d=new AbortController;let o="loading",v,y=0;const h=()=>new Error("The installation check expired. Review the package again to retry.");function w(m){o==="canceled"||o==="finished"||(o="canceled",clearTimeout(v),d.abort(),r(null),n(m))}function j(){o==="canceled"||o==="finished"||(o="finished",clearTimeout(v),a())}async function c(m){if(o==="committing"){o="recovering",clearTimeout(v);try{const x=await l.transactionOutcome(e);if(o!=="recovering")return;x.status==="committed"?(await l.refresh(),o==="recovering"&&j()):w(m)}catch{o==="recovering"&&w(new Error("The host did not confirm the installation result. Check Installed after reconnecting before trying again."))}}}async function p(){if(o==="trial"){if(Date.now()>y){w(h());return}o="committing";try{await l.commit(e,d.signal),o==="committing"&&j()}catch(m){await c(m instanceof Error?m:new Error("Plugin installation failed"))}}}return s&&(async()=>{try{const m=await l.payload(e.transactionId,d.signal);if(d.signal.aborted||(y=await l.beginTrial(e,d.signal),d.signal.aborted))return;const x=y-Date.now();if(x<=0){w(h());return}o="trial",v=setTimeout(()=>{o==="committing"?(d.abort(),c(h())):o==="trial"&&w(h())},x),r({key:i,client:l,props:{payload:m,digest:e.digest,activationKey:i,context:Pt,active:!1,title:"Plugin installation check",execute:async(g,b)=>{if(d.signal.throwIfAborted(),b.throwIfAborted(),g.method!=="lifecycle.ready")throw new Error("This action is unavailable during installation");return null},onReady:()=>{p()},onError:w}})}catch(m){w(m instanceof Error?m:new Error("Plugin trial failed"))}})(),()=>{o="canceled",clearTimeout(v),d.abort()}}function At(l){const e=ue.c(22),{client:s,preview:i,activation:r,onComplete:a,onError:n}=l,d=`${r}:trial:${i.transactionId}:${i.digest}:${i.registryRevision}`,[o,v]=C.useState(null);let y;e[0]!==a||e[1]!==n?(y={onComplete:a,onError:n},e[0]=a,e[1]=n,e[2]=y):y=e[2];const h=C.useRef(y);let w;e[3]!==a||e[4]!==n?(w=()=>{h.current={onComplete:a,onError:n}},e[3]=a,e[4]=n,e[5]=w):w=e[5],C.useLayoutEffect(w);let j,c;e[6]!==r||e[7]!==s||e[8]!==d||e[9]!==i?(j=()=>Tt({client:s,preview:i,activation:r,key:d,onFrame:v,onComplete:()=>h.current.onComplete(),onError:g=>h.current.onError(g)}),c=[s,i,r,d],e[6]=r,e[7]=s,e[8]=d,e[9]=i,e[10]=j,e[11]=c):(j=e[10],c=e[11]),C.useLayoutEffect(j,c);let p;e[12]!==i.manifest.name?(p=t.jsxs("p",{children:["Checking that ",i.manifest.name," starts correctly…"]}),e[12]=i.manifest.name,e[13]=p):p=e[13];let m;e[14]!==r||e[15]!==s||e[16]!==o||e[17]!==d?(m=r&&(o==null?void 0:o.key)===d&&o.client===s&&t.jsx(et,{...o.props}),e[14]=r,e[15]=s,e[16]=o,e[17]=d,e[18]=m):m=e[18];let x;return e[19]!==p||e[20]!==m?(x=t.jsxs("div",{role:"status",className:"flex flex-col gap-2",children:[p,m]}),e[19]=p,e[20]=m,e[21]=x):x=e[21],x}function Ot({connection:l,resourceId:e,target:s,client:i,disabled:r,save:a}){const n=C.useId(),d=l.definition.resources[e],o=l.selected[e],[v,y]=C.useState(""),[h,w]=C.useState(null),[j,c]=C.useState(!1),[p,m]=C.useState(null),x=C.useRef(null);C.useEffect(()=>()=>{var u;return(u=x.current)==null?void 0:u.abort()},[]);const g=tt(l.definition,e).find(u=>!l.selected[u]),b=r||!!g||d.scope==="project"&&!s.projectId;async function k(){var N;(N=x.current)==null||N.abort();const u=new AbortController;x.current=u,c(!0),m(null);try{const D=await i.connectionOptions(s,l.id,e,u.signal);u.signal.aborted||w(D)}catch(D){u.signal.aborted||m(D instanceof Error?D.message:"Unable to load choices")}finally{u.signal.aborted||c(!1)}}const S=o&&!(h!=null&&h.some(u=>u.id===o.id))?[o,...h??[]]:h??[];return t.jsxs(Q,{"data-disabled":b,"data-invalid":!!p,children:[t.jsx(X,{htmlFor:`${n}-resource`,children:d.label}),t.jsx(Re,{children:d.scope==="project"?"Applies to the selected project.":"Applies to all projects using this connection."}),o&&t.jsxs("p",{className:"text-sm",children:["Selected: ",o.label]}),g&&t.jsxs("p",{className:"text-sm text-muted-foreground",children:["Choose ",l.definition.resources[g].label," first."]}),d.scope==="project"&&!s.projectId&&t.jsx("p",{className:"text-sm text-muted-foreground",children:"Choose a Cogpit project above."}),d.options&&t.jsxs("div",{className:"flex flex-wrap gap-2",children:[t.jsx(E,{type:"button",variant:"outline",size:"sm",disabled:b||j,onClick:()=>{k()},children:j?"Loading choices…":h?"Refresh choices":"Browse choices"}),h&&t.jsxs(Ze,{items:S.map(u=>({value:u.id,label:u.label})),value:(o==null?void 0:o.id)??null,disabled:b||j,onValueChange:u=>{u&&u!==(o==null?void 0:o.id)&&a(l.id,"select",{resourceId:e,value:u})},children:[t.jsx(Ye,{id:`${n}-resource`,"aria-invalid":!!p,children:t.jsx(We,{placeholder:`Choose ${d.label}`})}),t.jsx(Ge,{children:t.jsx(Ke,{children:S.map(u=>t.jsx(Je,{value:u.id,children:u.label},u.id))})})]}),(h==null?void 0:h.length)===0&&t.jsx("p",{className:"text-sm text-muted-foreground",children:"No choices were returned."})]}),d.input&&t.jsxs("form",{className:"flex flex-wrap gap-2",onSubmit:u=>{u.preventDefault(),a(l.id,"select",{resourceId:e,value:v.trim()})},children:[t.jsx(de,{id:d.options?`${n}-input`:`${n}-resource`,"aria-label":`${d.label} ${d.input.urls?"URL or ID":"ID"}`,value:v,onChange:u=>y(u.target.value),maxLength:2048,disabled:b,autoComplete:"off",spellCheck:!1,placeholder:d.input.urls?"Paste a URL or ID":"Enter an ID"}),t.jsx(E,{type:"submit",size:"sm",variant:"outline",disabled:b||!v.trim(),children:"Validate and select"})]}),o&&t.jsxs(E,{type:"button",size:"sm",variant:"ghost",disabled:b,onClick:()=>{a(l.id,"select",{resourceId:e,value:null})},children:["Clear ",d.label]}),p&&t.jsx("p",{role:"alert",className:"text-sm text-destructive",children:p})]})}function _t(l){const e=ue.c(45),{connection:s,target:i,client:r,disabled:a,save:n}=l,d=C.useId(),[o,v]=C.useState(""),[y,h]=C.useState(!1),w=s.label;let j;e[0]!==s.label?(j=t.jsx("h3",{className:"font-medium",children:s.label}),e[0]=s.label,e[1]=j):j=e[1];const c=s.status==="disconnected"?"Needs connection":s.readOnly?"Configured by host":"Connected";let p;e[2]!==c?(p=t.jsx($e,{variant:"outline",children:c}),e[2]=c,e[3]=p):p=e[3];let m;e[4]!==j||e[5]!==p?(m=t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[j,p]}),e[4]=j,e[5]=p,e[6]=m):m=e[6];let x;e[7]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("p",{className:"text-sm text-muted-foreground",children:"Cogpit keeps this credential on the selected host. Plugin code cannot read it."}),e[7]=x):x=e[7];let g;e[8]!==s.definition.operations?(g=new Set(Object.values(s.definition.operations).map(Ft)),e[8]=s.definition.operations,e[9]=g):g=e[9];let b;e[10]!==g?(b=[...g],e[10]=g,e[11]=b):b=e[11];const k=b.join(", ");let S;e[12]!==k?(S=t.jsxs("p",{className:"break-all text-xs text-muted-foreground",children:["Credential destinations: ",k]}),e[12]=k,e[13]=S):S=e[13];let u;e[14]!==s.id||e[15]!==s.legacyImportAvailable||e[16]!==s.readOnly||e[17]!==s.status||e[18]!==a||e[19]!==d||e[20]!==y||e[21]!==n?(u=s.legacyImportAvailable&&t.jsxs("div",{className:"flex flex-col gap-3 rounded-md bg-muted p-3",children:[t.jsx("p",{className:"text-sm",children:"An existing host connection has saved settings available to import."}),s.status==="connected"&&!s.readOnly&&t.jsxs(Q,{orientation:"horizontal",children:[t.jsx(Ie,{id:`${d}-replace`,checked:y,onCheckedChange:h,disabled:a}),t.jsx(X,{htmlFor:`${d}-replace`,children:"Allow replacing my current connection with these saved settings"})]}),t.jsx(E,{type:"button",size:"sm",variant:"outline",disabled:a,onClick:()=>{n(s.id,"import-legacy",{replaceExisting:y})},children:"Import saved host settings"})]}),e[14]=s.id,e[15]=s.legacyImportAvailable,e[16]=s.readOnly,e[17]=s.status,e[18]=a,e[19]=d,e[20]=y,e[21]=n,e[22]=u):u=e[22];let N;e[23]!==s.definition.secret||e[24]!==s.id||e[25]!==s.readOnly||e[26]!==s.status||e[27]!==a||e[28]!==d||e[29]!==n||e[30]!==o?(N=s.readOnly?t.jsx("p",{className:"text-sm",children:"The host environment supplies this credential. Change it on the host."}):t.jsx("form",{onSubmit:A=>{A.preventDefault();const O=o.trim();v(""),n(s.id,"credential",{secret:O})},children:t.jsxs(_e,{children:[t.jsxs(Q,{"data-disabled":a,children:[t.jsx(X,{htmlFor:`${d}-secret`,children:s.definition.secret.label}),t.jsx(de,{id:`${d}-secret`,type:"password",autoComplete:"off",spellCheck:!1,maxLength:4096,disabled:a,value:o,onChange:A=>v(A.target.value)})]}),t.jsxs("div",{className:"flex flex-wrap gap-2",children:[t.jsx(E,{type:"submit",size:"sm",disabled:a||!o.trim(),children:s.status==="disconnected"?"Validate and connect":"Replace credential"}),s.status!=="disconnected"&&t.jsx(E,{type:"button",size:"sm",variant:"outline",disabled:a,onClick:()=>{n(s.id,"disconnect",{})},children:"Disconnect"})]})]})}),e[23]=s.definition.secret,e[24]=s.id,e[25]=s.readOnly,e[26]=s.status,e[27]=a,e[28]=d,e[29]=n,e[30]=o,e[31]=N):N=e[31];let D;e[32]!==r||e[33]!==s||e[34]!==a||e[35]!==n||e[36]!==i?(D=s.status!=="disconnected"&&t.jsx(_e,{children:Object.keys(s.definition.resources).map(A=>t.jsx(Ot,{connection:s,resourceId:A,target:i,client:r,disabled:a,save:n},A))}),e[32]=r,e[33]=s,e[34]=a,e[35]=n,e[36]=i,e[37]=D):D=e[37];let R;return e[38]!==s.label||e[39]!==S||e[40]!==u||e[41]!==N||e[42]!==D||e[43]!==m?(R=t.jsxs("section",{className:"flex flex-col gap-4 rounded-lg border p-4","aria-label":w,children:[m,x,S,u,N,D]}),e[38]=s.label,e[39]=S,e[40]=u,e[41]=N,e[42]=D,e[43]=m,e[44]=R):R=e[44],R}function Ft(l){return l.origin}function zt({client:l,target:e}){const[s,i]=C.useState(null),[r,a]=C.useState(null),[n,d]=C.useState(!1),o=C.useRef(null),v=C.useRef(!1),y=e.pluginId,h=e.projectId;C.useEffect(()=>{const j=new AbortController;return o.current=j,l.connections({pluginId:y,projectId:h},j.signal).then(c=>{j.signal.aborted||i(c)}).catch(c=>{j.signal.aborted||a(c instanceof Error?c.message:"Unable to load connections")}),()=>{j.abort(),o.current=null}},[l,y,h]);async function w(j,c,p){if(!s||v.current||!o.current||o.current.signal.aborted)return;v.current=!0;const m=o.current.signal;d(!0),a(null);try{const x=await l.changeConnection(e,j,c,p,s.revision,m);m.aborted||i(x)}catch(x){m.aborted||a(x instanceof Error?x.message:"Connection change failed")}finally{v.current=!1,m.aborted||d(!1)}}return t.jsxs("div",{className:"flex flex-col gap-4",children:[r&&t.jsx(se,{variant:"destructive",children:t.jsx(ne,{children:r})}),!s&&!r&&t.jsx("p",{role:"status",className:"text-sm text-muted-foreground",children:"Loading connections…"}),s==null?void 0:s.connections.map(j=>t.jsx(_t,{connection:j,target:e,client:l,disabled:n,save:w},`${j.id}:${s.revision}`)),(s==null?void 0:s.connections.length)===0&&t.jsx("p",{className:"text-sm text-muted-foreground",children:"This plugin does not use provider connections."})]})}function Lt(l){const e=ue.c(32),{client:s,status:i,pluginId:r,initialProjectId:a}=l,[n,d]=C.useState(a),o=C.useId();let v;e[0]===Symbol.for("react.memo_cache_sentinel")?(v={value:"",label:"Host connections only"},e[0]=v):v=e[0];let y;e[1]!==i.projects?(y=[v,...i.projects.map(Ut)],e[1]=i.projects,e[2]=y):y=e[2];const h=y;let w;e[3]!==o?(w=t.jsx(X,{htmlFor:o,children:"Project settings"}),e[3]=o,e[4]=w):w=e[4];const j=n??"";let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=R=>d(R||null),e[5]=c):c=e[5];let p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(We,{}),e[6]=p):p=e[6];let m;e[7]!==o?(m=t.jsx(Ye,{id:o,children:p}),e[7]=o,e[8]=m):m=e[8];let x;e[9]!==h?(x=t.jsx(Ge,{children:t.jsx(Ke,{children:h.map(Vt)})}),e[9]=h,e[10]=x):x=e[10];let g;e[11]!==h||e[12]!==j||e[13]!==m||e[14]!==x?(g=t.jsxs(Ze,{items:h,value:j,onValueChange:c,children:[m,x]}),e[11]=h,e[12]=j,e[13]=m,e[14]=x,e[15]=g):g=e[15];let b;e[16]!==i.host.name?(b=t.jsxs(Re,{children:["Connection credentials belong to ",i.host.name,". Project resources stay within the project you choose."]}),e[16]=i.host.name,e[17]=b):b=e[17];let k;e[18]!==b||e[19]!==w||e[20]!==g?(k=t.jsxs(Q,{children:[w,g,b]}),e[18]=b,e[19]=w,e[20]=g,e[21]=k):k=e[21];const S=`${r}:${n??"host"}:${i.connectionRevision??0}`;let u;e[22]!==r||e[23]!==n?(u={pluginId:r,projectId:n},e[22]=r,e[23]=n,e[24]=u):u=e[24];let N;e[25]!==s||e[26]!==S||e[27]!==u?(N=t.jsx(zt,{client:s,target:u},S),e[25]=s,e[26]=S,e[27]=u,e[28]=N):N=e[28];let D;return e[29]!==k||e[30]!==N?(D=t.jsxs("div",{className:"flex flex-col gap-4",children:[k,N]}),e[29]=k,e[30]=N,e[31]=D):D=e[31],D}function Vt(l){return t.jsx(Je,{value:l.value,children:l.label},l.value)}function Ut(l){return{value:l.id,label:l.name}}function qt(l){var ie;const e=ue.c(174),{plugin:s,status:i,client:r,busy:a,run:n,onPreview:d,onConnections:o,onUpdate:v}=l,y=C.useId(),[h,w]=C.useState(s.scope),[j,c]=C.useState(!1),[p,m]=C.useState(!1);let x,g,b,k,S,u,N,D,R,A,O,I;if(e[0]!==a||e[1]!==r||e[2]!==o||e[3]!==d||e[4]!==v||e[5]!==s||e[6]!==n||e[7]!==h||e[8]!==i.host.name||e[9]!==i.projects||e[10]!==i.runtime||e[11]!==i.store){const le=st(),oe=Me(s.manifest,le,i.runtime,{allowPrerelease:s.manifest.publisher.startsWith("dev-")});let Y;e[24]!==r||e[25]!==s.id||e[26]!==n||e[27]!==i.store?(Y=(P,Te)=>n(()=>r.changeInstalled(s.id,P,Te,i.store.revision)),e[24]=r,e[25]=s.id,e[26]=n,e[27]=i.store,e[28]=Y):Y=e[28];const B=Y,re=s.lastError?"Needs recovery":oe.compatible?s.enabled?"Enabled":"Disabled":"Incompatible";let ce;e[29]!==s.id||e[30]!==s.lastError||e[31]!==s.selectedDigest||e[32]!==i.store?(ce=s.lastError&&((ie=i.store.availableSeeds)==null?void 0:ie.find(P=>P.manifest.id===s.id&&P.digest===s.selectedDigest)),e[29]=s.id,e[30]=s.lastError,e[31]=s.selectedDigest,e[32]=i.store,e[33]=ce):ce=e[33];const Fe=ce;A="flex flex-col gap-3 rounded-lg border p-4";let fe;e[34]!==s.manifest.name?(fe=t.jsx("h3",{className:"font-medium",children:s.manifest.name}),e[34]=s.manifest.name,e[35]=fe):fe=e[35];let he;e[36]!==s.id||e[37]!==s.manifest.version?(he=t.jsxs("p",{className:"break-all text-xs text-muted-foreground",children:[s.id," · ",s.manifest.version]}),e[36]=s.id,e[37]=s.manifest.version,e[38]=he):he=e[38];let me;e[39]!==fe||e[40]!==he?(me=t.jsxs("div",{className:"flex min-w-0 flex-col gap-1",children:[fe,he]}),e[39]=fe,e[40]=he,e[41]=me):me=e[41];const ze=re==="Enabled"?"secondary":"outline";let pe;e[42]!==re||e[43]!==ze?(pe=t.jsx($e,{variant:ze,children:re}),e[42]=re,e[43]=ze,e[44]=pe):pe=e[44],e[45]!==me||e[46]!==pe?(O=t.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[me,pe]}),e[45]=me,e[46]=pe,e[47]=O):O=e[47],e[48]!==s.lastError?(I=s.lastError&&t.jsx(se,{variant:"destructive",children:t.jsx(ne,{children:s.lastError})}),e[48]=s.lastError,e[49]=I):I=e[49],g=!oe.compatible&&t.jsx(se,{variant:"destructive",children:t.jsxs(ne,{children:[oe.issues.map(P=>t.jsxs("p",{children:[P.side==="client"?"This client":P.side==="host"?i.host.name:"This package",": ",P.name," requires ",P.required,"; available ",P.actual??"none","."]},`${P.side}:${P.code}:${P.name}`)),t.jsx("p",{children:"Keep the saved data and update the affected app, or choose a compatible retained version below."})]})});let xe;e[50]!==B||e[51]!==s.enabled?(xe=()=>B("enabled",{enabled:!s.enabled}),e[50]=B,e[51]=s.enabled,e[52]=xe):xe=e[52];const Le=s.enabled?"Disable":"Enable";let ge;e[53]!==a||e[54]!==xe||e[55]!==Le?(ge=t.jsx(E,{size:"sm",variant:"outline",disabled:a,onClick:xe,children:Le}),e[53]=a,e[54]=xe,e[55]=Le,e[56]=ge):ge=e[56];let je;e[57]!==a||e[58]!==o||e[59]!==s.id||e[60]!==s.manifest.permissions.connections.length?(je=s.manifest.permissions.connections.length>0&&t.jsx(E,{size:"sm",variant:"outline",disabled:a,onClick:()=>o(s.id),children:"Connections"}),e[57]=a,e[58]=o,e[59]=s.id,e[60]=s.manifest.permissions.connections.length,e[61]=je):je=e[61];const Ve=a||s.pinned;let be;e[62]!==v||e[63]!==s?(be=()=>v(s),e[62]=v,e[63]=s,e[64]=be):be=e[64];let ve;e[65]!==Ve||e[66]!==be?(ve=t.jsx(E,{size:"sm",variant:"outline",disabled:Ve,onClick:be,children:"Update from file"}),e[65]=Ve,e[66]=be,e[67]=ve):ve=e[67];let ye;e[68]!==a||e[69]!==r||e[70]!==d||e[71]!==s.id||e[72]!==s.scope||e[73]!==Fe||e[74]!==n?(ye=Fe&&t.jsx(E,{size:"sm",variant:"outline",disabled:a,onClick:()=>n(async()=>d(await r.stageSeed(s.id,s.scope))),children:"Review bundled repair"}),e[68]=a,e[69]=r,e[70]=d,e[71]=s.id,e[72]=s.scope,e[73]=Fe,e[74]=n,e[75]=ye):ye=e[75];let Ce;e[76]!==B||e[77]!==s.pinned?(Ce=()=>B("pin",{pinned:!s.pinned}),e[76]=B,e[77]=s.pinned,e[78]=Ce):Ce=e[78];const Ue=s.pinned?"Unpin version":"Pin version";let we;e[79]!==a||e[80]!==Ce||e[81]!==Ue?(we=t.jsx(E,{size:"sm",variant:"outline",disabled:a,onClick:Ce,children:Ue}),e[79]=a,e[80]=Ce,e[81]=Ue,e[82]=we):we=e[82];let Ee;e[83]===Symbol.for("react.memo_cache_sentinel")?(Ee=()=>{m(!1),c(!0)},e[83]=Ee):Ee=e[83];let Ne;e[84]!==a?(Ne=t.jsx(E,{size:"sm",variant:"ghost",disabled:a,onClick:Ee,children:"Uninstall"}),e[84]=a,e[85]=Ne):Ne=e[85],e[86]!==ge||e[87]!==je||e[88]!==ve||e[89]!==ye||e[90]!==we||e[91]!==Ne?(b=t.jsxs("div",{className:"flex flex-wrap gap-2",children:[ge,je,ve,ye,we,Ne]}),e[86]=ge,e[87]=je,e[88]=ve,e[89]=ye,e[90]=we,e[91]=Ne,e[92]=b):b=e[92],e[93]!==s.pinned?(k=s.pinned&&t.jsx("p",{className:"text-xs text-muted-foreground",children:"Unpin this version before updating or rolling back. Revoked packages remain blocked."}),e[93]=s.pinned,e[94]=k):k=e[94],D="text-sm",e[95]===Symbol.for("react.memo_cache_sentinel")?(R=t.jsx("summary",{className:"cursor-pointer",children:"Projects and previous versions"}),e[95]=R):R=e[95],x="flex flex-col gap-4 pt-4",e[96]!==a||e[97]!==h||e[98]!==i.projects?(S=t.jsx(qe,{value:h,onChange:w,projects:i.projects,disabled:a}),e[96]=a,e[97]=h,e[98]=i.projects,e[99]=S):S=e[99];let Se;e[100]!==a||e[101]!==s.scope||e[102]!==h?(Se=a||JSON.stringify(h)===JSON.stringify(s.scope),e[100]=a,e[101]=s.scope,e[102]=h,e[103]=Se):Se=e[103];let ke;e[104]!==B||e[105]!==h?(ke=()=>B("scope",{scope:h}),e[104]=B,e[105]=h,e[106]=ke):ke=e[106],e[107]!==i.host.name||e[108]!==Se||e[109]!==ke?(u=t.jsxs(E,{size:"sm",variant:"outline",disabled:Se,onClick:ke,children:["Save projects on ",i.host.name]}),e[107]=i.host.name,e[108]=Se,e[109]=ke,e[110]=u):u=e[110];let Pe;e[111]!==s.selectedDigest?(Pe=P=>P.digest!==s.selectedDigest,e[111]=s.selectedDigest,e[112]=Pe):Pe=e[112],N=s.versions.filter(Pe).map(P=>{const Te=!P.unavailableReason&&Me(P.manifest,le,i.runtime,{allowPrerelease:P.manifest.publisher.startsWith("dev-")}).compatible;return t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsxs(E,{size:"sm",variant:"outline",disabled:a||s.pinned||!Te,onClick:()=>n(async()=>d({...await r.rollback(s.id,P.digest,s.scope),operation:"rollback"})),children:["Review rollback to ",P.manifest.version]}),!Te&&t.jsx("p",{className:"text-xs text-muted-foreground",children:P.unavailableReason??"This version is incompatible with the connected host or client."})]},P.digest)}),e[0]=a,e[1]=r,e[2]=o,e[3]=d,e[4]=v,e[5]=s,e[6]=n,e[7]=h,e[8]=i.host.name,e[9]=i.projects,e[10]=i.runtime,e[11]=i.store,e[12]=x,e[13]=g,e[14]=b,e[15]=k,e[16]=S,e[17]=u,e[18]=N,e[19]=D,e[20]=R,e[21]=A,e[22]=O,e[23]=I}else x=e[12],g=e[13],b=e[14],k=e[15],S=e[16],u=e[17],N=e[18],D=e[19],R=e[20],A=e[21],O=e[22],I=e[23];let U;e[113]===Symbol.for("react.memo_cache_sentinel")?(U=t.jsx("p",{className:"text-xs text-muted-foreground",children:"Rollback keeps current settings. Disabling keeps the installation and its saved data."}),e[113]=U):U=e[113];let H;e[114]!==x||e[115]!==S||e[116]!==u||e[117]!==N?(H=t.jsxs("div",{className:x,children:[S,u,N,U]}),e[114]=x,e[115]=S,e[116]=u,e[117]=N,e[118]=H):H=e[118];let z;e[119]!==H||e[120]!==D||e[121]!==R?(z=t.jsxs("details",{className:D,children:[R,H]}),e[119]=H,e[120]=D,e[121]=R,e[122]=z):z=e[122];let ee;e[123]!==s.manifest.name?(ee=t.jsxs(nt,{children:["Uninstall ",s.manifest.name,"?"]}),e[123]=s.manifest.name,e[124]=ee):ee=e[124];let G;e[125]!==i.host.name?(G=t.jsxs(it,{children:["This removes the plugin from ",i.host.name," for every connected client and project. Saved data is retained unless you choose deletion."]}),e[125]=i.host.name,e[126]=G):G=e[126];let _;e[127]!==ee||e[128]!==G?(_=t.jsxs(at,{children:[ee,G]}),e[127]=ee,e[128]=G,e[129]=_):_=e[129];const K=`${y}-delete`,te=a||i.connectionRevision===void 0;let F;e[130]!==p||e[131]!==K||e[132]!==te?(F=t.jsx(Ie,{id:K,checked:p,onCheckedChange:m,disabled:te}),e[130]=p,e[131]=K,e[132]=te,e[133]=F):F=e[133];const J=`${y}-delete`;let L;e[134]!==J?(L=t.jsx(X,{htmlFor:J,children:"Delete my saved settings and connections on this host"}),e[134]=J,e[135]=L):L=e[135];let q;e[136]!==F||e[137]!==L?(q=t.jsxs(Q,{orientation:"horizontal",children:[F,L]}),e[136]=F,e[137]=L,e[138]=q):q=e[138];let T;e[139]!==p?(T=p&&t.jsx("p",{className:"text-sm text-muted-foreground",children:"This cannot be undone. Other administrators' saved data is retained. Provider tokens and legacy backup files are not removed."}),e[139]=p,e[140]=T):T=e[140];let V;e[141]!==a?(V=t.jsx(ot,{disabled:a,children:"Cancel"}),e[141]=a,e[142]=V):V=e[142];let f;e[143]!==r||e[144]!==p||e[145]!==s.id||e[146]!==n||e[147]!==i.connectionRevision||e[148]!==i.store?(f=()=>{c(!1),n(()=>r.changeInstalled(s.id,"uninstall",p?{deleteData:!0,expectedConnectionRevision:i.connectionRevision}:{deleteData:!1},i.store.revision))},e[143]=r,e[144]=p,e[145]=s.id,e[146]=n,e[147]=i.connectionRevision,e[148]=i.store,e[149]=f):f=e[149];let $;e[150]!==a||e[151]!==i.host.name||e[152]!==f?($=t.jsxs(lt,{variant:"destructive",disabled:a,onClick:f,children:["Uninstall from ",i.host.name]}),e[150]=a,e[151]=i.host.name,e[152]=f,e[153]=$):$=e[153];let W;e[154]!==V||e[155]!==$?(W=t.jsxs(rt,{children:[V,$]}),e[154]=V,e[155]=$,e[156]=W):W=e[156];let M;e[157]!==_||e[158]!==q||e[159]!==T||e[160]!==W?(M=t.jsxs(ct,{children:[_,q,T,W]}),e[157]=_,e[158]=q,e[159]=T,e[160]=W,e[161]=M):M=e[161];let Z;e[162]!==j||e[163]!==M?(Z=t.jsx(dt,{open:j,onOpenChange:c,children:M}),e[162]=j,e[163]=M,e[164]=Z):Z=e[164];let ae;return e[165]!==g||e[166]!==b||e[167]!==k||e[168]!==z||e[169]!==Z||e[170]!==A||e[171]!==O||e[172]!==I?(ae=t.jsxs("article",{className:A,children:[O,I,g,b,k,z,Z]}),e[165]=g,e[166]=b,e[167]=k,e[168]=z,e[169]=Z,e[170]=A,e[171]=O,e[172]=I,e[173]=ae):ae=e[173],ae}const Mt={github:"GitHub",vercel:"Vercel",cloudflare:"Cloudflare"},Bt={actions:"workflow runs",actionJobs:"workflow jobs and steps",pulls:"pull requests",pullFiles:"pull request files",issues:"issues",deployments:"deployments",buildLogs:"build logs",workspace:"Worker configuration and account",version:"version details"};function Ht(l,e){return e==="pullSessions"?"Read related Cogpit sessions for the selected GitHub repository":e==="mergePull"?"Merge pull requests in the selected GitHub repository when you confirm, using this host's signed-in CLI":`Read ${Mt[l]} ${Bt[e]} using this host's signed-in CLI`}function He(l){const e=l.permissions;return[...e.context.map(s=>s==="session.identity"?"Recognise the open session among related sessions, by handle only":"Read the selected project's name and plugin identifier"),...e.composer.map(()=>"Append text to your draft message"),...e.navigation.map(s=>s==="external"?"Ask Cogpit to open HTTPS links":"Open permitted sessions"),...e.storage?[`Store up to ${e.storage.quotaKiB} KiB of ${e.storage.scope} settings`]:[],...e.connections.flatMap(s=>s.operations.map(i=>`Use connection ${s.id}: ${i}`)),...e.integrations.flatMap(s=>s.operations.map(i=>Ht(s.id,i)))]}function Gt(l){var j;const e=ue.c(32),{preview:s}=l;let i,r,a,n,d,o;if(e[0]!==s.connectionDefinitions||e[1]!==s.manifest||e[2]!==s.oldVersion||e[3]!==s.operation||e[4]!==s.previousConnectionDefinitions||e[5]!==s.previousManifest){const c=He(s.manifest),p=s.previousManifest?He(s.previousManifest):null,m=p?c.filter(b=>!p.includes(b)):[],x=p?p.filter(b=>!c.includes(b)):[],g=s.previousConnectionDefinitions?s.connectionDefinitions.filter(b=>{var S;const k=(S=s.previousConnectionDefinitions)==null?void 0:S.find(u=>u.id===b.id);return!k||JSON.stringify(k)!==JSON.stringify(b)}):[];i="flex flex-col gap-3 text-sm",e[12]!==s.oldVersion||e[13]!==s.operation?(r=s.oldVersion&&t.jsxs(se,{children:[t.jsx(De,{children:s.operation==="rollback"?"Rollback keeps current settings":"Update on this host"}),t.jsxs(ne,{children:["Saved settings and connections are retained. This version replaces ",s.oldVersion," in every enabled project and connected client. A failed trial leaves the current version selected."]})]}),e[12]=s.oldVersion,e[13]=s.operation,e[14]=r):r=e[14],a=p&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("h3",{className:"font-medium",children:"Access changes"}),m.length===0&&x.length===0&&g.length===0&&t.jsx("p",{children:"No changes to requested access or connection definitions."}),m.map(Xt),x.map(Qt),g.map(Zt)]}),n=s.oldVersion&&!p&&t.jsx(se,{children:t.jsx(ne,{children:"This host does not report previous permissions. Review all requested access before continuing."})}),e[15]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("h3",{className:"font-medium",children:"Requested access"}),e[15]=d):d=e[15],o=c.length?t.jsx("ul",{className:"ml-4 flex list-disc flex-col gap-1",children:c.map(Yt)}):t.jsx("p",{className:"text-muted-foreground",children:"No project, connection, storage, or composer access requested."}),e[0]=s.connectionDefinitions,e[1]=s.manifest,e[2]=s.oldVersion,e[3]=s.operation,e[4]=s.previousConnectionDefinitions,e[5]=s.previousManifest,e[6]=i,e[7]=r,e[8]=a,e[9]=n,e[10]=d,e[11]=o}else i=e[6],r=e[7],a=e[8],n=e[9],d=e[10],o=e[11];let v;e[16]!==s.connectionDefinitions?(v=s.connectionDefinitions.map(Kt),e[16]=s.connectionDefinitions,e[17]=v):v=e[17];let y;e[18]!==s.incompatibleClients?(y=!!((j=s.incompatibleClients)!=null&&j.length)&&t.jsxs(se,{children:[t.jsx(De,{children:"Some connected clients cannot run this version"}),t.jsxs(ne,{children:[s.incompatibleClients.join(", "),". Their plugin panels will be unavailable until those clients are updated. Offline clients are checked when they reconnect."]})]}),e[18]=s.incompatibleClients,e[19]=y):y=e[19];let h;e[20]!==s.digest?(h=t.jsxs("p",{className:"break-all text-xs text-muted-foreground",children:["SHA-256: ",s.digest]}),e[20]=s.digest,e[21]=h):h=e[21];let w;return e[22]!==i||e[23]!==r||e[24]!==a||e[25]!==n||e[26]!==d||e[27]!==o||e[28]!==v||e[29]!==y||e[30]!==h?(w=t.jsxs("div",{className:i,children:[r,a,n,d,o,v,y,h]}),e[22]=i,e[23]=r,e[24]=a,e[25]=n,e[26]=d,e[27]=o,e[28]=v,e[29]=y,e[30]=h,e[31]=w):w=e[31],w}function Kt(l){return t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("p",{className:"font-medium",children:l.label}),t.jsxs("p",{children:["Access to ",Object.values(l.resources).map(Wt).join(", ")||"the connected account","."]}),t.jsxs("p",{className:"break-all text-muted-foreground",children:["Credential destinations: ",[...new Set(Object.values(l.operations).map(Jt))].join(", ")]})]},l.id)}function Jt(l){return l.origin}function Wt(l){return l.label}function Yt(l){return t.jsx("li",{children:l},l)}function Zt(l){return t.jsxs("p",{children:["Changed connection: ",l.label,". Review its destinations and access below."]},l.id)}function Qt(l){return t.jsxs("p",{children:["Removed: ",l]},`remove:${l}`)}function Xt(l){return t.jsxs("p",{children:["Added: ",l]},`add:${l}`)}function ls({client:l,state:e,currentPath:s,onClose:i,initialPluginId:r}){var V;const a=C.useId(),n=e.status,d=ut(),o=(n==null?void 0:n.safeMode)||d,{project:v,resolving:y}=ft({client:l,status:n,activation:e.activation,projectPath:s}),[h,w]=C.useState(null),j=h??{type:"projects",projectIds:v?[v.id]:[]},[c,p]=C.useState(null),[m,x]=C.useState({activation:"",hostName:""}),[g,b]=C.useState(!1),[k,S]=C.useState(!1),[u,N]=C.useState(null),[D,R]=C.useState(null),[A,O]=C.useState("installed"),[I,U]=C.useState(null),[H,z]=C.useState(null),[ee,G]=C.useState(r),_=n==null?void 0:n.store.plugins.find(f=>f.id===ee),K=C.useRef(!1),te=!!(n!=null&&n.store.available)&&m.activation===e.activation;function F(f){x({activation:e.activation,hostName:(n==null?void 0:n.host.name)??"the selected host"}),p(f)}C.useEffect(()=>{!c||te&&!(o&&g)||(b(!1),p(null),N("The host connection or plugin execution state changed. Review the package again before installing."),l.cancel(c).catch(()=>{}))},[l,c,te,o,g]),C.useEffect(()=>()=>{c&&l.cancel(c).catch(()=>{})},[l,c]);async function J(f){if(!K.current){K.current=!0,S(!0),N(null),R(null);try{await f()}catch($){N($ instanceof Error?$.message:"Plugin action failed")}finally{K.current=!1,S(!1)}}}function L(){const f=c;b(!1),p(null),f&&l.cancel(f).catch(()=>{})}async function q(){if(!H||!I&&!h&&y)return;const f=await l.stage(H,(I==null?void 0:I.scope)??j);if(I&&f.manifest.id!==I.id)throw await l.cancel(f),new Error(`Choose a package for ${I.manifest.name} (${I.id}).`);F(f)}const T=k||g||!(n!=null&&n.store.available);return t.jsx(ht,{open:!0,onOpenChange:f=>{!f&&!k&&!g&&(L(),i())},children:t.jsxs(mt,{className:"flex max-h-[85dvh] flex-col sm:max-w-2xl",showCloseButton:!k&&!g,children:[t.jsxs(pt,{children:[t.jsx(xt,{children:"Plugins"}),t.jsx(gt,{children:n?`Installed on ${n.host.name}. Changes apply to every client connected to this host.`:"Connecting to the selected host…"})]}),t.jsxs("div",{className:"flex min-h-0 flex-col gap-4 overflow-y-auto",children:[(e.error||u||(n==null?void 0:n.store.error))&&t.jsxs(se,{variant:"destructive",children:[t.jsx(De,{children:n!=null&&n.store.available&&!u&&!e.error?"Plugin setup needs attention":"Plugin action unavailable"}),t.jsx(ne,{children:u??e.error??(n==null?void 0:n.store.error)})]}),D&&t.jsx(se,{children:t.jsx(ne,{children:D})}),o&&t.jsxs(se,{children:[t.jsx(De,{children:"Plugin safe mode"}),t.jsxs(ne,{children:["Plugin panels are stopped. You can disable or uninstall plugins here.",(n==null?void 0:n.safeMode)&&" The host owner must restart Cogpit without COGPIT_DISABLE_PLUGINS=1 to resume plugins on this host."]})]}),t.jsx(E,{size:"sm",variant:"outline",disabled:k||g||(n==null?void 0:n.safeMode),onClick:()=>jt(!d),children:d?"Resume plugins in this browser":"Pause plugins in this browser"}),(n==null?void 0:n.store.recoveryCode)&&t.jsx("p",{className:"text-sm text-muted-foreground",children:n.store.recoveryCode==="STORE_LOCKED"?"Close the other Cogpit process using this data directory, then restart this host.":n.store.recoveryCode==="STORE_VERSION"?"Open this host with the Cogpit version that last used its plugin store, or a newer compatible version.":"Keep the plugin data directory intact. Restart with plugin safe mode enabled and check the host log before restoring a verified backup."}),!n&&t.jsxs(E,{variant:"outline",disabled:k,onClick:()=>{J(()=>l.refresh())},children:[t.jsx(kt,{"data-icon":"inline-start"}),"Retry connection"]}),n&&_&&!c&&t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[t.jsxs("h2",{className:"font-medium",children:[_.manifest.name," connections"]}),t.jsx(E,{variant:"outline",size:"sm",onClick:()=>G(void 0),children:"Back to installed"})]}),t.jsx(Lt,{client:l,status:n,pluginId:_.id,initialProjectId:(v==null?void 0:v.id)??null},`${_.id}:${n.store.revision}`)]}),n&&!_&&!c&&t.jsxs(bt,{value:A,onValueChange:f=>{O(String(f)),U(null),z(null)},children:[t.jsxs(vt,{className:"h-auto flex-wrap",children:[t.jsx(Ae,{value:"installed",children:"Installed"}),t.jsx(Ae,{value:"browse",children:"Browse"}),t.jsx(Ae,{value:"install",children:"Install from file"}),t.jsx(Ae,{value:"publishers",children:"Publishers"})]}),t.jsx(Oe,{value:"installed",children:t.jsx("div",{className:"flex flex-col gap-3 pt-4",children:n.store.plugins.length?n.store.plugins.map(f=>t.jsx(qt,{plugin:f,status:n,client:l,busy:T,run:$=>{J($)},onPreview:F,onConnections:G,onUpdate:$=>{U($),z(null),O("install")}},`${f.id}:${n.store.revision}`)):t.jsx(yt,{children:t.jsxs(Ct,{children:[t.jsx(wt,{variant:"icon",children:t.jsx($t,{})}),t.jsx(Nt,{children:"No installed plugins"}),t.jsx(St,{children:"Browse available plugins or install a signed package to add panels to this host."})]})})})}),t.jsx(Oe,{value:"browse",children:t.jsxs("div",{className:"flex flex-col gap-4 pt-4",children:[t.jsxs("p",{className:"text-sm text-muted-foreground",children:["These optional plugins are available with this Cogpit release. Choose which ones to install on ",n.host.name,"."]}),t.jsx(qe,{value:j,onChange:w,projects:n.projects,disabled:T}),(n.store.availableSeeds??[]).map(f=>{const $=n.store.plugins.find(M=>M.id===f.manifest.id),W=$&&It(f.manifest.version,$.manifest.version)===1;return t.jsxs("article",{className:"flex flex-wrap items-center justify-between gap-3 rounded-lg border p-4",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"font-medium",children:f.manifest.name}),t.jsxs("p",{className:"text-xs text-muted-foreground",children:[f.manifest.version," · ",f.manifest.publisher]})]}),W?t.jsx(E,{size:"sm",disabled:T||$.pinned,onClick:()=>{J(async()=>F(await l.stageSeed(f.manifest.id,$.scope)))},children:$.pinned?"Pinned to installed version":"Review update"}):$?t.jsx($e,{variant:"outline",children:"Installed"}):t.jsx(E,{size:"sm",disabled:T||!h&&y,onClick:()=>{J(async()=>F(await l.stageSeed(f.manifest.id,j)))},children:"Review installation"})]},f.manifest.id)}),!((V=n.store.availableSeeds)!=null&&V.length)&&t.jsx("p",{className:"text-sm text-muted-foreground",children:"This host has no bundled plugin packages. You can install a signed package from a file."})]})}),t.jsx(Oe,{value:"install",children:t.jsx("form",{className:"pt-4",onSubmit:f=>{f.preventDefault(),J(q)},children:t.jsxs(_e,{children:[I&&t.jsxs("p",{className:"text-sm",children:["Update ",I.manifest.name," from ",I.manifest.version,". Existing project access is retained."]}),t.jsxs(Q,{children:[t.jsx(X,{htmlFor:`${a}-package`,children:"Signed plugin package"}),t.jsx(de,{id:`${a}-package`,type:"file",accept:".cogpit-plugin",disabled:T,required:!0,onChange:f=>{var $;return z((($=f.target.files)==null?void 0:$[0])??null)}})]}),!I&&t.jsx(qe,{value:j,onChange:w,projects:n.projects,disabled:T}),t.jsxs(E,{type:"submit",disabled:T||!H||!I&&!h&&y,children:["Review ",I?"update":"installation"," on ",n.host.name]})]})})}),t.jsx(Oe,{value:"publishers",children:t.jsxs("div",{className:"flex flex-col gap-4 pt-4",children:[n.store.publishers.map(f=>t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsxs("p",{className:"text-sm font-medium",children:[f.label," ",t.jsx($e,{variant:"outline",children:f.kind})]}),t.jsxs("p",{className:"break-all text-xs text-muted-foreground",children:[f.id," · ",f.fingerprint]})]},f.id)),t.jsxs("details",{children:[t.jsx("summary",{className:"cursor-pointer text-sm",children:"Trust a development publisher"}),t.jsx("div",{className:"pt-4",children:t.jsx(Rt,{client:l,busy:T,run:f=>{J(f)}})})]})]})})]}),c&&t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("h2",{className:"text-lg font-medium",children:[c.manifest.name," ",c.manifest.version]}),t.jsxs("p",{className:"text-sm text-muted-foreground",children:[c.oldVersion?`Replaces ${c.oldVersion}`:"New installation"," on ",m.hostName]}),t.jsx($e,{variant:"outline",children:c.publisherKind==="development"?"Development publisher":"Official publisher"})]}),t.jsx(Gt,{preview:c}),t.jsxs("p",{className:"text-sm",children:["Available in: ",c.scope.type==="all"?"all projects on this host, including new projects":c.scope.projectIds.length?c.scope.projectIds.map(f=>{var $;return(($=n==null?void 0:n.projects.find(W=>W.id===f))==null?void 0:$.name)??"unavailable project"}).join(", "):"no projects until you choose one","."]}),!c.compatibility.compatible&&t.jsxs(se,{variant:"destructive",children:[t.jsx(De,{children:"Incompatible version"}),t.jsx(ne,{children:t.jsx("ul",{className:"flex flex-col gap-1",children:c.compatibility.issues.map(f=>t.jsxs("li",{children:[f.side,": ",f.name," requires ",f.required,"; available ",f.actual??"none","."]},`${f.side}:${f.code}:${f.name}`))})})]}),c.compatibility.unavailableOptional.length>0&&t.jsx(se,{children:t.jsxs(ne,{children:["Some optional features are unavailable: ",c.compatibility.unavailableOptional.map(f=>f.name).join(", "),"."]})}),g&&te&&!o?t.jsxs(t.Fragment,{children:[t.jsx(At,{client:l,preview:c,activation:e.activation,onComplete:()=>{b(!1),p(null),R(`${c.manifest.name} ${c.manifest.version} is ${c.operation==="rollback"?"restored":c.oldVersion?"updated":"installed"} on ${m.hostName}.`),O("installed"),U(null)},onError:f=>{N(f.message),L()}}),t.jsxs(E,{variant:"outline",onClick:L,children:["Cancel ",c.operation==="rollback"?"rollback":c.oldVersion?"update":"installation"]})]}):t.jsxs("div",{className:"flex flex-wrap justify-end gap-2",children:[t.jsx(E,{variant:"outline",disabled:k,onClick:L,children:"Cancel"}),t.jsxs(E,{disabled:T||!te||!c.compatibility.compatible||o,onClick:()=>{N(null),b(!0)},children:[c.operation==="rollback"?"Roll back":c.oldVersion?"Update":"Install"," on ",m.hostName]})]})]})]})]})})}export{ls as PluginsDialog};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as ae,j as t,r as v}from"./vendor-react-gGw_S5I_.js";import{C as le,b6 as $e,b7 as J,m as ut,n as mt,I as ft,E as _t,G as Et,b8 as At,B as ce,b9 as ht,J as it,U as ze,ba as xt,a0 as pt,a1 as gt,a4 as jt,bb as st,bc as bt,Z as Ye,bd as $t,at as Tt,au as It,be as vt,i as zt,j as Dt,k as Pt,bf as Lt,z as Rt,aL as Ut,h as Ft,D as Ot}from"./index-COB3e1_W.js";import{S as Bt}from"./switch-Bm0VDZET.js";import{aa as Mt,ab as Gt,d as Ht,T as Vt,M as Wt,ac as Xt,ad as qt,ae as Kt,a5 as wt,C as Nt,af as lt,ag as Jt,n as Zt,z as Qt,ah as Yt,I as es,ai as ts,aj as ss}from"./vendor-ui-DKYSMrjf.js";import{P as rt}from"./password-BV9mqUzz.js";import"./vendor-shiki-DOn6sF-i.js";import"./vendor-markdown-BE1gYnO9.js";function ns(s){const e=ae.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(Ht,{"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(Vt,{"data-icon":"inline-start",className:"size-4 text-muted-foreground"}),e[1]=r):r=e[1],r}let l;return e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(Wt,{"data-icon":"inline-start",className:"size-4 text-muted-foreground"}),e[2]=l):l=e[2],l}function nt(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 is(s){const e=[`Shared ${nt(s.createdAt)}`,s.lastAccessAt>0?`opened ${nt(s.lastAccessAt)}`:"never opened"];return s.guests>0&&e.push(s.guests===1?"1 guest":`${s.guests} guests`),e.join(" · ")}function ls(){const s=ae.c(12),{shares:e,revoke:n,revokeAll:i}=At();let l;s[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("p",{className:"text-xs text-muted-foreground",children:"Shared sessions"}),s[0]=l):l=s[0];let 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 a;s[4]!==r?(a=t.jsxs("div",{className:"flex h-6 items-center justify-between",children:[l,r]}),s[4]=r,s[5]=a):a=s[5];let x;s[6]!==n||s[7]!==e?(x=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]=x):x=s[8];let c;return s[9]!==a||s[10]!==x?(c=t.jsxs("div",{className:"flex flex-col gap-2",children:[a,x]}),s[9]=a,s[10]=x,s[11]=c):c=s[11],c}function as(s){const e=ae.c(30),{networkAccess:n,setNetworkAccess:i,networkPassword:l,setNetworkPassword:r,showNetworkPassword:a,setShowNetworkPassword:x,hasExistingPassword:c,initialNetworkAccess:o,connectedDevices:m,minPasswordLength:b}=s;let h;e[0]!==n?(h=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]=h):h=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]!==h?(y=t.jsxs("div",{className:"flex items-center gap-2",children:[h,j]}),e[3]=h,e[4]=y):y=e[4];let k;e[5]!==i?(k=_=>i(_),e[5]=i,e[6]=k):k=e[6];let w;e[7]!==n||e[8]!==k?(w=t.jsx(Bt,{"aria-label":"Network Access",checked:n,onCheckedChange:k}),e[7]=n,e[8]=k,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]!==l||e[17]!==r||e[18]!==x||e[19]!==a?(p=n&&t.jsxs(le,{"data-invalid":l.length>0&&l.length<b,children:[t.jsx($e,{htmlFor:"network-password",children:"Password"}),t.jsx(J,{children:c&&l.length===0?"A password is already set. Leave blank to keep it.":`Use at least ${b} characters.`}),t.jsxs(ut,{children:[t.jsx(mt,{id:"network-password",type:a?"text":"password",value:l,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(_t,{size:"icon-xs","aria-label":a?"Hide password":"Show password",onClick:()=>x(!a),children:a?t.jsx(Mt,{"data-icon":"inline-start"}):t.jsx(Gt,{"data-icon":"inline-start"})})})]}),l.length>0&&l.length<b&&t.jsxs(Et,{children:["Password must be at least ",b," characters (",l.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]=l,e[17]=r,e[18]=x,e[19]=a,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(rs)})]}),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 f;return e[26]!==N||e[27]!==p||e[28]!==u?(f=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]=f):f=e[29],f}function rs(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(ns,{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:nt(s.lastActivity)})]})]},`${s.ip}-${e}`)}const os=["auto","path","npm","bundled","custom"],et={source:"auto"},cs=["path","npm","bundled"];function ds(s){return os.includes(s)}function us(s){if(!s||typeof s!="object")return;const{source:e,path:n}=s;if(!(!ds(e)||e==="auto"))return e==="custom"?typeof n=="string"&&n.trim()?{source:e,path:n.trim()}:void 0:{source:e}}const Ie={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 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: ${St(e.path,e.version)}`:"No launchable binary for the saved choice — sessions cannot start."}function fs(s){return s!==null&&s.version!==null}function hs(s){const e=ae.c(92),{kind:n,value:i,onChange:l,disabled:r,reportVersion:a}=s;let x;e[0]!==n?(x=ht(n),e[0]=n,e[1]=x):x=e[1];const{displayName:c}=x,[o,m]=v.useState(null),[b,h]=v.useState(!1),j=`agent-executable-${n}`;let y;e[2]!==n?(y=()=>{let z=!1;return ze(`/api/agent-executable/${n}`).then(gs).then(ee=>{z||m(ee)}).catch(ps),()=>{z=!0}},e[2]=n,e[3]=y):y=e[3];let k;e[4]!==n||e[5]!==a?(k=[n,a],e[4]=n,e[5]=a,e[6]=k):k=e[6],v.useEffect(y,k);let w,N,p,u,S,f,_,T,I,C,E,D,g;if(e[7]!==r||e[8]!==c||e[9]!==j||e[10]!==l||e[11]!==b||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 z=new Map((o==null?void 0:o.candidates.map(xs))??[]);u=(o==null?void 0:o.active)??null;let ee;e[29]!==r||e[30]!==j||e[31]!==l||e[32]!==i.path||e[33]!==i.source?(ee=(L,O,ne,oe)=>{const at=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:i.source===L,disabled:r||!at,onChange:()=>l(L==="custom"?{source:L,path:i.path??""}:{source:L})}),t.jsxs(xt,{children:[t.jsx($e,{htmlFor:K,children:O}),t.jsx(J,{className:"break-all",children:ne})]})]},L)},e[29]=r,e[30]=j,e[31]=l,e[32]=i.path,e[33]=i.source,e[34]=ee):ee=e[34],S=ee;const te=L=>{const O=z.get(L);return S(L,Ie[L],O?St(O.path,O.version):"Not found on this machine.",O!==void 0||i.source===L)},Te=u?`${Ie[i.source]} · v${u.version??"?"}`:Ie[i.source];p=pt,D=b,g=h,f="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 se;e[36]===Symbol.for("react.memo_cache_sentinel")?(se=t.jsx(Kt,{"data-icon":"inline-start",className:"size-4 text-muted-foreground"}),e[36]=se):se=e[36];let q;e[37]!==c?(q=t.jsxs("span",{className:"flex items-center gap-2",children:[se,c," executable"]}),e[37]=c,e[38]=q):q=e[38];let R;e[39]!==Te?(R=t.jsx("span",{className:"truncate",children:Te}),e[39]=Te,e[40]=R):R=e[40];let U;e[41]!==b?(U=b?t.jsx(wt,{className:"size-4 shrink-0"}):t.jsx(Nt,{className:"size-4 shrink-0"}),e[41]=b,e[42]=U):U=e[42];let F;e[43]!==R||e[44]!==U?(F=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]=F):F=e[45],e[46]!==q||e[47]!==F?(_=t.jsxs(gt,{render:X,children:[q,F]}),e[46]=q,e[47]=F,e[48]=_):_=e[48],N=jt,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],T="flex flex-col gap-2 pl-1",e[50]!==S?(I=S("auto",Ie.auto,"Recommended."),e[50]=S,e[51]=I):I=e[51],C=cs.map(te),e[7]=r,e[8]=c,e[9]=j,e[10]=l,e[11]=b,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]=f,e[22]=_,e[23]=T,e[24]=I,e[25]=C,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],f=e[21],_=e[22],T=e[23],I=e[24],C=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 Z;e[52]!==l?(Z=z=>l({source:"custom",path:z.target.value}),e[52]=l,e[53]=Z):Z=e[53];let A;e[54]!==P||e[55]!==H||e[56]!==re||e[57]!==Z?(A=t.jsx(st,{"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]=A):A=e[58];let V;e[59]!==S||e[60]!==A?(V=S("custom",Ie.custom,A),e[59]=S,e[60]=A,e[61]=V):V=e[61];let B;e[62]!==V||e[63]!==T||e[64]!==I||e[65]!==C?(B=t.jsxs("div",{className:T,children:[I,C,V]}),e[62]=V,e[63]=T,e[64]=I,e[65]=C,e[66]=B):B=e[66];let Q;e[67]!==u?(Q=fs(u)?"text-muted-foreground":"text-destructive",e[67]=u,e[68]=Q):Q=e[68];let $;e[69]!==Q?($=it("text-xs",Q),e[69]=Q,e[70]=$):$=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 M;e[74]!==$||e[75]!==W?(M=t.jsx("p",{className:$,"aria-live":"polite",children:W}),e[74]=$,e[75]=W,e[76]=M):M=e[76];let Y;e[77]!==w||e[78]!==B||e[79]!==M||e[80]!==E?(Y=t.jsxs(w,{children:[E,B,M]}),e[77]=w,e[78]=B,e[79]=M,e[80]=E,e[81]=Y):Y=e[81];let G;e[82]!==N||e[83]!==Y?(G=t.jsx(N,{children:Y}),e[82]=N,e[83]=Y,e[84]=G):G=e[84];let de;return e[85]!==p||e[86]!==f||e[87]!==_||e[88]!==G||e[89]!==D||e[90]!==g?(de=t.jsxs(p,{open:D,onOpenChange:g,className:f,children:[_,G]}),e[85]=p,e[86]=f,e[87]=_,e[88]=G,e[89]=D,e[90]=g,e[91]=de):de=e[91],de}function xs(s){return[s.source,s]}function ps(){}function gs(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 ze(`/api/agent-accounts/${s}`);return e.status===404?{status:"missing"}:e.ok?await e.json():{status:"error",error:await bt(e,`Request failed (${e.status})`)}}catch(e){return{status:"error",error:yt(e)}}}function js(s){const[e,n]=v.useState(null),[i,l]=v.useState(null),[r,a]=v.useState(null);v.useEffect(()=>{let c=!1;return ot(s).then(o=>{c||n(o)}),()=>{c=!0}},[s]);const x=v.useCallback(async c=>{l(c),a(null);try{const o=await ze(`/api/agent-accounts/${s}/switch`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({slot:c})});if(!o.ok){a({kind:"failed",error:await bt(o,`Request failed (${o.status})`)});return}a({kind:"switched",result:await o.json()}),n(await ot(s))}catch(o){a({kind:"failed",error:yt(o)})}finally{l(null)}},[s]);return{report:e,switchingSlot:i,outcome:r,switchTo:x}}const bs={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 tt(s){return s.alias??s.email}function ct(s){const e=ae.c(18),{label:n,window:i}=s;if(!i)return null;const l=i.pct>=80,r=i.resetsIn?`${n} window resets in ${i.resetsIn}`:void 0;let a;e[0]!==n?(a=t.jsx("span",{className:"w-5",children:n}),e[0]=n,e[1]=a):a=e[1];const x=l?"bg-destructive":"bg-primary";let c;e[2]!==x?(c=it("absolute inset-y-0 left-0 rounded-full",x),e[2]=x,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 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 h;e[9]!==i.pct?(h=Math.round(i.pct),e[9]=i.pct,e[10]=h):h=e[10];let j;e[11]!==h?(j=t.jsxs("span",{className:"tabular-nums",children:[h,"%"]}),e[11]=h,e[12]=j):j=e[12];let y;return e[13]!==r||e[14]!==a||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:[a,b,j]}),e[13]=r,e[14]=a,e[15]=b,e[16]=j,e[17]=y):y=e[17],y}function dt(s){return/[.!?]$/.test(s)?s:`${s}.`}function vs(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 ws(s){const e=ae.c(41),{kind:n,disabled:i}=s;let l;e[0]!==n?(l=ht(n),e[0]=n,e[1]=l):l=e[1];const{displayName:r}=l,{report:a,switchingSlot:x,outcome:c,switchTo:o}=js(n),[m,b]=v.useState(!1);if(a===null||a.status==="missing")return null;let h,j;if(e[2]!==a.accounts||e[3]!==a.status){h=a.status==="ok"?a.accounts:[];const g=h.find(Ns)??null;j=a.status==="error"?"Unavailable":g?`${tt(g)} · ${h.length} account${h.length===1?"":"s"}`:`${h.length} account${h.length===1?"":"s"}`,e[2]=a.accounts,e[3]=a.status,e[4]=h,e[5]=j}else h=e[4],j=e[5];const y=j;let k;e[6]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(ce,{type:"button",variant:"ghost",className:"h-auto w-full justify-between px-0 font-medium hover:bg-transparent"}),e[6]=k):k=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(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 f;e[17]!==N||e[18]!==S?(f=t.jsxs(gt,{render:k,children:[N,S]}),e[17]=N,e[18]=S,e[19]=f):f=e[19];const _=a.status==="ok"&&`Logins managed by ${a.tool}${a.version?` ${a.version}`:""}. `;let T;e[20]!==r||e[21]!==_?(T=t.jsxs(J,{children:[_,"Switching changes which login ",r," sessions authenticate with."]}),e[20]=r,e[21]=_,e[22]=T):T=e[22];let I;e[23]!==h||e[24]!==i||e[25]!==a.error||e[26]!==a.status||e[27]!==o||e[28]!==x?(I=a.status==="error"?t.jsx("p",{className:"text-xs text-destructive",role:"alert",children:a.error}):t.jsx("ul",{className:"flex flex-col divide-y divide-border rounded-md border border-border",children:h.map(g=>{const P=x===g.slot,H=bs[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:tt(g)}),g.alias&&t.jsx("span",{className:"truncate text-xs text-muted-foreground",children:g.email}),g.active&&t.jsx(Ye,{children:"Active"}),g.disabled&&t.jsx(Ye,{variant:"outline",children:"Disabled"}),H&&t.jsx(Ye,{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:x!==null,onClick:()=>o(g.slot),"aria-label":`Switch to ${tt(g)}`,children:P?t.jsxs(t.Fragment,{children:[t.jsx(lt,{"data-icon":"inline-start",className:"size-3.5 animate-spin"}),"Switching…"]}):"Switch"})]},g.slot)})}),e[23]=h,e[24]=i,e[25]=a.error,e[26]=a.status,e[27]=o,e[28]=x,e[29]=I):I=e[29];let C;e[30]!==r||e[31]!==c?(C=c&&t.jsx("p",{className:it("text-xs",c.kind==="failed"?"text-destructive":"text-muted-foreground"),"aria-live":"polite",role:c.kind==="failed"?"alert":"status",children:vs(c,r)}),e[30]=r,e[31]=c,e[32]=C):C=e[32];let E;e[33]!==T||e[34]!==I||e[35]!==C?(E=t.jsx(jt,{children:t.jsxs(le,{children:[T,I,C]})}),e[33]=T,e[34]=I,e[35]=C,e[36]=E):E=e[36];let D;return e[37]!==m||e[38]!==E||e[39]!==f?(D=t.jsxs(pt,{open:m,onOpenChange:b,className:"flex flex-col gap-2",children:[f,E]}),e[37]=m,e[38]=E,e[39]=f,e[40]=D):D=e[40],D}function Ns(s){return s.active}const Ss=vt().filter(s=>s.cli.bundledBySdk).map(s=>s.kind),ys=vt().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 ks(s){const e=ae.c(5),{status:n,error:i}=s;if(n==="validating"){let l;return e[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[t.jsx(lt,{"data-icon":"inline-start",className:"size-3.5 animate-spin"}),"Checking path..."]}),e[0]=l):l=e[0],l}if(n==="valid"){let l;return e[1]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsxs("div",{className:"flex items-center gap-2 text-sm text-success",children:[t.jsx(ts,{"data-icon":"inline-start",className:"size-3.5"}),"Valid .claude directory found"]}),e[1]=l):l=e[1],l}if(n==="invalid"&&i){let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(ss,{"data-icon":"inline-start",className:"size-3.5"}),e[2]=l):l=e[2];let r;return e[3]!==i?(r=t.jsxs("div",{className:"flex items-center gap-2 text-sm text-destructive",children:[l,i]}),e[3]=i,e[4]=r):r=e[4],r}return null}function Fs(s){const e=ae.c(110),{open:n,currentPath:i,onClose:l,onSaved:r}=s,[a,x]=v.useState(i),[c,o]=v.useState(!1),{status:m,error:b,debouncedValidate:h,reset:j,save:y}=$t();let k;e[0]===Symbol.for("react.memo_cache_sentinel")?(k=Tt(),e[0]=k):k=e[0];const w=k;let N;e[1]===Symbol.for("react.memo_cache_sentinel")?(N=It("configWrite"),e[1]=N):N=e[1];const p=N,[u,S]=v.useState(!1),[f,_]=v.useState(""),[T,I]=v.useState(!1),[C,E]=v.useState(""),[D,g]=v.useState(""),[P,H]=v.useState(""),[re,Z]=v.useState(""),[A,V]=v.useState(!1),[B,Q]=v.useState(!1),[$,W]=v.useState(et),[M,Y]=v.useState(0),[G,de]=v.useState(et),[z,ee]=v.useState(!1),[te,Te]=v.useState(!1);let X;e[2]===Symbol.for("react.memo_cache_sentinel")?(X=[],e[2]=X):X=e[2];const[se,q]=v.useState(X);let R,U;e[3]!==i||e[4]!==n||e[5]!==j?(R=()=>{n&&(x(i),j(),ze("/api/config").then(Ts).then(d=>{const ie=(d==null?void 0:d.networkAccess)||!1;S(ie),ee(ie),Te(!!(d!=null&&d.networkPassword)),_("");const Xe=(d==null?void 0:d.terminalApp)||"";E(Xe),g(Xe);const qe=(d==null?void 0:d.editorApp)||"";H(qe),Z(qe);const Ke=(d==null?void 0:d.useBuiltInEditor)===!0;V(Ke),Q(Ke);const Je=us(d==null?void 0:d.agentExecutable)??et;W(Je),de(Je),ie&&(d!=null&&d.networkPassword)&&!w?ze("/api/connected-devices").then($s).then(Ae=>q((Ae==null?void 0:Ae.devices)||[])).catch(As):q([])}).catch(Es))},U=[n,i,j,w],e[3]=i,e[4]=n,e[5]=j,e[6]=R,e[7]=U):(R=e[6],U=e[7]),v.useEffect(R,U);let F;e[8]!==h?(F=d=>{const ie=d.target.value;x(ie),h(ie)},e[8]=h,e[9]=F):F=e[9];const L=F;let O;e[10]!==$||e[11]!==P||e[12]!==z||e[13]!==u||e[14]!==f||e[15]!==r||e[16]!==a||e[17]!==y||e[18]!==C||e[19]!==A?(O=async()=>{o(!0);const d=await y(a,{networkAccess:w?z:u,networkPassword:!w&&u&&f.length>0?f:void 0,terminalApp:C.trim()||void 0,editorApp:P.trim()||void 0,useBuiltInEditor:A,agentExecutable:$});d.success&&d.claudeDir&&(Y(_s),r(d.claudeDir)),o(!1)},e[10]=$,e[11]=P,e[12]=z,e[13]=u,e[14]=f,e[15]=r,e[16]=a,e[17]=y,e[18]=C,e[19]=A,e[20]=O):O=e[20];const ne=O;let oe;e[21]!==$||e[22]!==P||e[23]!==te||e[24]!==G||e[25]!==re||e[26]!==z||e[27]!==D||e[28]!==B||e[29]!==u||e[30]!==f||e[31]!==m||e[32]!==C||e[33]!==A?(oe=function(){var Ae;if(m==="validating"||m==="invalid")return!1;const ie=m==="valid",Xe=!w&&(u!==z||u&&f.length>0),qe=C!==D,Ke=P!==re||A!==B,Je=!Cs($,G);if(!ie&&!Xe&&!qe&&!Ke&&!Je||$.source==="custom"&&!((Ae=$.path)!=null&&Ae.trim()))return!1;if(!w&&u){const Ct=f.length>0&&f.length<rt,kt=!te&&f.length===0;if(Ct||kt)return!1}return!0},e[21]=$,e[22]=P,e[23]=te,e[24]=G,e[25]=re,e[26]=z,e[27]=D,e[28]=B,e[29]=u,e[30]=f,e[31]=m,e[32]=C,e[33]=A,e[34]=oe):oe=e[34];const K=oe();let ue;e[35]!==l?(ue=d=>{d||l()},e[35]=l,e[36]=ue):ue=e[36];let De;e[37]===Symbol.for("react.memo_cache_sentinel")?(De=t.jsxs(zt,{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($e,{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(ft,{children:t.jsx(Zt,{"data-icon":"inline-start"})}),e[40]=Re):Re=e[40];let me;e[41]!==K||e[42]!==ne||e[43]!==c?(me=d=>{d.key==="Enter"&&K&&!c&&ne()},e[41]=K,e[42]=ne,e[43]=c,e[44]=me):me=e[44];let fe;e[45]!==L||e[46]!==a||e[47]!==me?(fe=t.jsxs(ut,{children:[Re,t.jsx(mt,{id:"claude-directory",value:a,onChange:L,placeholder:"/Users/you/.claude",disabled:!p,onKeyDown:me})]}),e[45]=L,e[46]=a,e[47]=me,e[48]=fe):fe=e[48];let he;e[49]!==b||e[50]!==m?(he=t.jsx("div",{"aria-live":"polite",children:t.jsx(ks,{status:m,error:b})}),e[49]=b,e[50]=m,e[51]=he):he=e[51];let xe;e[52]!==fe||e[53]!==he?(xe=t.jsxs(le,{children:[Pe,Le,fe,he]}),e[52]=fe,e[53]=he,e[54]=xe):xe=e[54];let Ue,Fe;e[55]===Symbol.for("react.memo_cache_sentinel")?(Ue=t.jsxs($e,{htmlFor:"terminal-application",children:[t.jsx(Qt,{"data-icon":"inline-start",className:"size-4 text-muted-foreground"}),"Terminal application"]}),Fe=t.jsx(J,{children:"Leave blank to use the system default for Ctrl+Cmd+T."}),e[55]=Ue,e[56]=Fe):(Ue=e[55],Fe=e[56]);let Oe;e[57]===Symbol.for("react.memo_cache_sentinel")?(Oe=d=>E(d.target.value),e[57]=Oe):Oe=e[57];let pe;e[58]!==C?(pe=t.jsxs(le,{children:[Ue,Fe,t.jsx(st,{id:"terminal-application",value:C,onChange:Oe,placeholder:"Ghostty, iTerm, or /path/to/binary",disabled:!p})]}),e[58]=C,e[59]=pe):pe=e[59];let Be;e[60]===Symbol.for("react.memo_cache_sentinel")?(Be=d=>V(d===!0),e[60]=Be):Be=e[60];let ge;e[61]!==A?(ge=t.jsx(Lt,{id:"use-built-in-editor",checked:A,onCheckedChange:Be,disabled:!p}),e[61]=A,e[62]=ge):ge=e[62];let Me;e[63]===Symbol.for("react.memo_cache_sentinel")?(Me=t.jsxs(xt,{children:[t.jsxs($e,{htmlFor:"use-built-in-editor",children:[t.jsx(Yt,{"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 je;e[64]!==ge?(je=t.jsxs(le,{orientation:"horizontal",children:[ge,Me]}),e[64]=ge,e[65]=je):je=e[65];let Ge;e[66]===Symbol.for("react.memo_cache_sentinel")?(Ge=t.jsxs($e,{htmlFor:"editor-application",children:[t.jsx(es,{"data-icon":"inline-start",className:"size-4 text-muted-foreground"}),"Editor application"]}),e[66]=Ge):Ge=e[66];const Ze=A?"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||A;let ve;e[70]!==P||e[71]!==Qe?(ve=t.jsx(st,{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:[Ge,be,ve]}),e[73]=be,e[74]=ve,e[75]=we):we=e[75];let Ne;e[76]!==$||e[77]!==M?(Ne=Ss.map(d=>t.jsx(hs,{kind:d,value:$,onChange:W,disabled:!p,reportVersion:M},d)),e[76]=$,e[77]=M,e[78]=Ne):Ne=e[78];let Ve;e[79]===Symbol.for("react.memo_cache_sentinel")?(Ve=ys.map(d=>t.jsx(ws,{kind:d,disabled:!p},d)),e[79]=Ve):Ve=e[79];let Se;e[80]!==se||e[81]!==te||e[82]!==z||e[83]!==u||e[84]!==f||e[85]!==T?(Se=!w&&p&&t.jsx(as,{networkAccess:u,setNetworkAccess:S,networkPassword:f,setNetworkPassword:_,showNetworkPassword:T,setShowNetworkPassword:I,hasExistingPassword:te,initialNetworkAccess:z,connectedDevices:se,minPasswordLength:rt}),e[80]=se,e[81]=te,e[82]=z,e[83]=u,e[84]=f,e[85]=T,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(Rt,{children:[xe,pe,je,we,Ne,Ve,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 Ce;e[94]!==l?(Ce=t.jsx(ce,{variant:"outline",onClick:l,children:"Cancel"}),e[94]=l,e[95]=Ce):Ce=e[95];let ke;e[96]!==K||e[97]!==ne||e[98]!==c?(ke=p&&t.jsx(ce,{disabled:!K||c,onClick:ne,children:c?t.jsxs(t.Fragment,{children:[t.jsx(lt,{"data-icon":"inline-start",className:"size-4 animate-spin"}),"Saving..."]}):"Save"}),e[96]=K,e[97]=ne,e[98]=c,e[99]=ke):ke=e[99];let _e;e[100]!==Ce||e[101]!==ke?(_e=t.jsxs(Ut,{children:[Ce,ke]}),e[100]=Ce,e[101]=ke,e[102]=_e):_e=e[102];let Ee;e[103]!==ye||e[104]!==_e?(Ee=t.jsxs(Ft,{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(Ot,{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 Es(){}function As(){}function $s(s){return s.json()}function Ts(s){return s.json()}export{Fs as ConfigDialog};
|