@staff0rd/assist 0.948.0 → 0.948.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.
|
@@ -4019,7 +4019,7 @@ ${f.join(`
|
|
|
4019
4019
|
`,uni=po`
|
|
4020
4020
|
0%, 100% { transform: scale(1); }
|
|
4021
4021
|
50% { transform: scale(1.08); }
|
|
4022
|
-
`,ewr={content:'""',position:"absolute",borderRadius:"inherit",background:"conic-gradient(from calc(var(--rainbow-pill-h) * 1deg) in oklch longer hue, oklch(66% 0.21 0), oklch(66% 0.21 0))",animation:`${cni} 1.8s linear infinite`},fni={display:"inline-flex",alignItems:"center",px:1.5,py:"3px",borderRadius:999,position:"relative",isolation:"isolate",fontWeight:700,animation:`${uni} 1.6s ease-in-out infinite`,"&::before":{...ewr,inset:0,zIndex:-1},"&::after":{...ewr,inset:"-5px",zIndex:-2,filter:"blur(9px)",opacity:.85},"& span":{color:ol.rainbowPill.text,textShadow:ol.rainbowPill.shadow},"@media (prefers-reduced-motion: reduce)":{animation:"none","&::before, &::after":{animation:"none"}}};function twr({children:e}){return(0,qA.jsxs)(qA.Fragment,{children:[(0,qA.jsx)(i5,{styles:lni}),(0,qA.jsx)(J,{component:"span","data-testid":"rainbow-pill",sx:fni,children:e})]})}function rwr({pct:e,timeLabel:t}){return[Math.round(e),...(t.match(/\d+/g)??[]).map(Number)].join(",")}function nwr(e){if(e.length!==2)return!1;let[t,r]=e;return rwr(t)===rwr(r)}var pT=E($(),1);function owr({rateLimits:e}){let t=GF(3e4),r=[{window:e.five_hour,windowSeconds:18e3,fallbackLabel:"5h"},{window:e.seven_day,windowSeconds:604800,fallbackLabel:"7d"}].filter(o=>o.window?.used_percentage!=null),n=nwr(r.map(o=>({pct:o.window?.used_percentage??0,timeLabel:ove(o.window?.resets_at,o.fallbackLabel,t)}))),i=r.map((o,a)=>(0,pT.jsxs)(iwr.Fragment,{children:[a>0?(0,pT.jsx)(J,{component:"span",sx:{color:u$,mr:.5},children:","}):null,(0,pT.jsx)(JCr,{window:o.window,windowSeconds:o.windowSeconds,fallbackLabel:o.fallbackLabel,now:t})]},o.fallbackLabel));return n?(0,pT.jsx)(twr,{children:i}):(0,pT.jsx)(pT.Fragment,{children:i})}var A_=E($(),1);function swr({groups:e}){return(0,A_.jsx)(A_.Fragment,{children:e.map((t,r)=>(0,A_.jsxs)(awr.Fragment,{children:[(0,A_.jsx)(J,{component:"span",sx:{color:u$,ml:r>0?1:0,mr:.5},children:Iu(t.harness)}),(0,A_.jsx)(owr,{rateLimits:t.rateLimits})]},t.harness))})}var lwr={root:{fontFamily:"fontFamilyMono",fontSize:12,display:"grid",gap:1},group:{display:"grid",gap:"2px"},heading:{color:e=>e.tokens.color.onAppBar.secondary},foot:{pt:.75,opacity:.6,borderTop:"1px solid color-mix(in srgb, currentColor 18%, transparent)"}};function dni(e){if(e==="over")return{level:"warn",boundary:100};if(e==="warn")return{level:"ok",boundary:75}}function hni(e){if(e==="ok")return{level:"warn",boundary:75};if(e==="warn")return{level:"over",boundary:100}}function pni(e,t,r,n){if(e>=t)return;let i=e/t;return Math.round(r-n*(1-i))}function fwr(e,t,r,n){if(t==null)return{kind:"unprojectable"};let i=HWe(t,r,n);if(i==null)return{kind:"unprojectable"};let o=h_(e,t,r,n),a=dni(o),s=hni(o);return{kind:"projected",recovery:a&&{level:a.level,pct:a.boundary*i,at:pni(e,a.boundary,t,r)},worse:s&&{level:s.level,pct:s.boundary*i}}}function sve(e){return t=>t.tokens.color.onAppBar.level[e]}function dwr(e,t){return e.at==null?"not before reset":`${e.level==="ok"?"green":"under"} in ${T1e(e.at,t)}`}var P_=E($(),1),hwr={display:"contents"};function cGe({direction:e,threshold:t}){let r=e==="back";if(!t)return(0,P_.jsxs)(J,{component:"span",sx:hwr,children:[(0,P_.jsx)("span",{}),(0,P_.jsx)("span",{})]});let n=(0,P_.jsx)(J,{component:"span",sx:{opacity:.6},children:r?"\u2190":"\u2192"}),i=(0,P_.jsxs)(J,{component:"span",sx:{color:sve(t.level),textAlign:"right"},children:[Math.round(t.pct),"%"]});return(0,P_.jsxs)(J,{component:"span",sx:hwr,children:[r?i:n,r?n:i]})}var pwr={row:{display:"grid",gridTemplateColumns:"2.5ch 4ch 1ch 4ch 1ch 4ch auto",alignItems:"baseline",gap:.75,fontVariantNumeric:"tabular-nums"},pctWeight:500,note:{pl:.75,color:e=>e.tokens.color.onAppBar.secondary}};var L_=E($(),1);function mwr({label:e,pct:t,resetsAt:r,windowSeconds:n,now:i}){let o=pwr,a=h_(t,r,n,i),s=fwr(t,r,n,i),l=s.kind==="projected"?s:void 0;return(0,L_.jsxs)(J,{sx:o.row,children:[(0,L_.jsx)(J,{component:"span",sx:{minWidth:"2ch"},children:e}),(0,L_.jsx)(cGe,{direction:"back",threshold:l?.recovery}),(0,L_.jsxs)(J,{component:"span",sx:{minWidth:"4ch",textAlign:"right",fontWeight:o.pctWeight,color:sve(a)},children:[Math.round(t),"%"]}),(0,L_.jsx)(cGe,{direction:"forward",threshold:l?.worse}),(0,L_.jsx)(J,{component:"span",sx:o.note,children:l?l.recovery&&dwr(l.recovery,i):"no projection yet"})]})}function gwr(e){return[{label:"5h",window:e.five_hour,windowSeconds:18e3},{label:"7d",window:e.seven_day,windowSeconds:604800}].flatMap(t=>t.window?.used_percentage==null?[]:[{label:t.label,pct:t.window.used_percentage,resetsAt:t.window.resets_at,windowSeconds:t.windowSeconds}])}var vwr=E($(),1);function ywr({rateLimits:e,now:t}){return gwr(e).map(r=>(0,vwr.jsx)(mwr,{label:r.label,pct:r.pct,resetsAt:r.resetsAt,windowSeconds:r.windowSeconds,now:t},r.label))}var jA=E($(),1);function bwr({groups:e}){let t=GF(3e4),r=lwr;return(0,jA.jsxs)(J,{sx:r.root,children:[e.map(n=>(0,jA.jsxs)(J,{sx:r.group,children:[(0,jA.jsx)(J,{sx:r.heading,children:Iu(n.harness)}),(0,jA.jsx)(ywr,{rateLimits:n.rateLimits,now:t})]},n.harness)),(0,jA.jsx)(J,{sx:r.foot,children:"Account usage per harness \u2014 view history"})]})}var uGe=E($(),1),mni="Claude account usage (5h / 7d windows) \u2014 view history";function xwr(e){return e.length===0?{title:mni,content:"Usage"}:{title:(0,uGe.jsx)(bwr,{groups:e}),content:(0,uGe.jsx)(swr,{groups:e})}}var Twr={display:"flex",alignItems:"center",height:22,px:1,borderRadius:1,fontSize:"inherit","&:hover, &:focus-visible":{bgcolor:e=>e.tokens.color.statusBar.hover,color:e=>e.tokens.color.statusBar.hoverText}},Swr={tooltip:{sx:{p:"10px 12px",minWidth:300,maxWidth:"none"}}};var fGe=E($(),1),gni={};function Cwr({rateLimits:e,harnessRateLimits:t=gni}){let{title:r,content:n}=xwr(ZCr(e,t));return(0,fGe.jsx)(lr,{title:r,placement:"top-start",slotProps:Swr,children:(0,fGe.jsx)(rn,{component:ws,to:"/usage",underline:"none",color:"inherit",sx:Twr,children:n})})}var _wr=E(fe(),1);var M_="0.948.0";var lve=E(fe(),1),dGe=(0,lve.createContext)(null);function cve(){return(0,lve.useContext)(dGe)}var hGe=E($(),1);function wwr(){let e=cve();return!e||e===M_?null:(0,hGe.jsx)(lr,{title:`Daemon is running v${e}, but this page was served by v${M_}. Restart the daemon to match.`,children:(0,hGe.jsx)(Z1e,{fontSize:"small",color:"warning","aria-label":"Version mismatch"})})}var kwr=e=>({display:"inline-flex",alignItems:"center",gap:.75,px:1,py:0,height:22,borderRadius:1,fontSize:"inherit",lineHeight:1.5,color:"inherit",opacity:1,bgcolor:t=>e?kv(t).active:"transparent",transition:"opacity .2s ease, background-color .2s ease, color .2s ease","&:hover, &:focus-visible":{bgcolor:t=>kv(t).hover,color:t=>kv(t).hoverText},"& .ready-dot":{width:6,height:6,borderRadius:"50%",bgcolor:t=>kv(t).dot,boxShadow:t=>`0 0 0 3px ${kv(t).dotRing}`},"& .ready-count":{fontWeight:500,color:t=>kv(t).readyText}});var lg=E($(),1);function Ewr(){let{entries:e}=RF(),t=Ni(),r=(0,_wr.useCallback)(()=>t("/updates"),[t]),{matches:n,chords:i}=jn("openUpdates");if(Eo(n,r),!M_)return null;let o=e.filter(NF).length;return(0,lg.jsxs)(lg.Fragment,{children:[(0,lg.jsx)(lr,{describeChild:!0,placement:"top-end",title:(0,lg.jsx)(Nu,{label:"Updates",chords:i}),children:(0,lg.jsxs)(ln,{component:ws,to:"/updates","aria-label":o?`Updates: ${o} node${o>1?"s have":" has"} an update ready`:"Updates",sx:kwr(o>0),children:[o>0&&(0,lg.jsx)("span",{className:"ready-dot","aria-hidden":!0}),(0,lg.jsxs)("span",{children:["v",M_]}),o>0&&(0,lg.jsxs)("span",{className:"ready-count",children:[o," ready"]})]})}),(0,lg.jsx)(wwr,{})]})}var uve=E($(),1);function Rwr({socket:e}){return(0,uve.jsx)(KCr,{start:(0,uve.jsx)(Cwr,{rateLimits:e.rateLimits,harnessRateLimits:e.harnessRateLimits}),end:(0,uve.jsx)(Ewr,{})})}var mve=E(fe(),1);var pve=E(fe(),1);function Awr(e,t,r){if(!e)return"Select a repo to search files.";if(r.error)return"Couldn't search files in this repo.";if(!(r.files.length>0||r.loading))return t?"No matching files.":"No files in this repo."}var I_=E($(),1),yni={display:"flex",gap:1,alignItems:"center",minWidth:0},vni={display:"flex",gap:1,alignItems:"baseline",minWidth:0,overflow:"hidden"},bni={fontFamily:"fontFamilyMono",fontSize:13,whiteSpace:"nowrap"},xni={fontFamily:"fontFamilyMono",fontSize:11,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"};function Tni(e){let t=e.lastIndexOf("/");return t===-1?{dir:"",basename:e}:{dir:e.slice(0,t),basename:e.slice(t+1)}}function Pwr({files:e,highlight:t,onHighlight:r,onSelect:n}){return(0,I_.jsx)(zp,{dense:!0,sx:{py:0},children:e.map((i,o)=>{let{dir:a,basename:s}=Tni(i);return(0,I_.jsxs)(dn,{selected:o===t,onMouseEnter:()=>r(o),onClick:()=>n(i),sx:yni,children:[(0,I_.jsx)(ige,{path:i}),(0,I_.jsxs)(J,{sx:vni,children:[(0,I_.jsx)(Me,{component:"span",sx:bni,children:s}),(0,I_.jsx)(Me,{component:"span",color:"text.secondary",sx:xni,children:a})]})]},i)})})}var fve=E($(),1),Sni={maxHeight:420,overflowY:"auto"},Cni={px:2,py:2,fontSize:13};function Lwr({message:e,files:t,highlight:r,onHighlight:n,onSelect:i}){return(0,fve.jsx)(J,{sx:Sni,children:e?(0,fve.jsx)(Me,{color:"text.secondary",sx:Cni,children:e}):(0,fve.jsx)(Pwr,{files:t,highlight:r,onHighlight:n,onSelect:i})})}var Mwr=E($(),1),wni={mt:6,alignSelf:"flex-start"};function dve({onClose:e,onEntered:t,centered:r=!1,children:n}){return(0,Mwr.jsx)(Gl,{open:!0,onClose:e,maxWidth:"sm",fullWidth:!0,slotProps:{paper:{sx:r?void 0:wni},transition:{onEntered:t}},children:n})}var hve=E(fe(),1);var Iwr={files:[],loading:!1,error:!1};function Dwr(e,t){let[r,n]=(0,hve.useState)(Iwr),i=yr();return(0,hve.useEffect)(()=>{if(!e){n(Iwr);return}let o=!1;return n(s=>({...s,loading:!0})),(async()=>{try{let s=await fetch(jr(`/api/files?cwd=${encodeURIComponent(e)}&q=${encodeURIComponent(t)}`,i));if(!s.ok)throw new Error(`HTTP ${s.status}`);let l=await s.json();if(o)return;n({files:Array.isArray(l.files)?l.files:[],loading:!1,error:!1})}catch{o||n({files:[],loading:!1,error:!0})}})(),()=>{o=!0}},[e,t,i]),r}var YA=E($(),1);function kni(e,t,r){let n=new URLSearchParams({path:e});return t&&n.set("cwd",t),t&&r&&n.set("node",r),`/file?${n}`}function Nwr({onClose:e}){let{worktreeNode:t}=Fn();return(0,YA.jsx)(gf.Provider,{value:t,children:(0,YA.jsx)(_ni,{onClose:e})})}function _ni({onClose:e}){let{worktreeCwd:t,worktreeNode:r}=Fn(),[n,i]=(0,pve.useState)(""),o=Dwr(t,n),a=Ni(),s=(0,pve.useRef)(null),l=p=>a(kni(p,t,r)),{highlight:u,setHighlight:f,onKeyDown:d}=x_(o.files,n,l,e),h=p=>{l(p),e()};return(0,YA.jsxs)(dve,{onClose:e,onEntered:()=>s.current?.focus(),children:[(0,YA.jsx)(SS,{autoFocus:!0,inputRef:s,value:n,onChange:i,onKeyDown:d,placeholder:"Search files by name..."}),(0,YA.jsx)(Lwr,{message:Awr(t,n,o),files:o.files,highlight:u,onHighlight:f,onSelect:h})]})}function Owr(e){Eo(jn("quickOpen").matches,e)}var Fwr=E($(),1);function Bwr(){let[e,t]=(0,mve.useState)(!1);return Owr((0,mve.useCallback)(()=>t(!0),[])),e?(0,Fwr.jsx)(Nwr,{onClose:()=>t(!1)}):null}var gve=E($(),1);function $wr({notice:e,onClose:t,onView:r}){let n=e?.sessionId??null;return(0,gve.jsx)(Dh,{open:e!==null,autoHideDuration:6e3,onClose:t,children:(0,gve.jsx)(yi,{severity:"success",variant:"filled",onClose:t,action:n!==null?(0,gve.jsx)(Dt,{color:"inherit",size:"small",onClick:()=>r(n),children:"View"}):void 0,children:e?.message})})}var PX=E(fe(),1);function zwr(e){let t=["claude"];return e.exposeCodexActions&&t.push("codex"),e.exposePiActions&&t.push("pi"),t}var Jwr=E(fe(),1);var Hwr=E($(),1),Uwr=ut((0,Hwr.jsx)("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2"}),"Circle");var Eni={connected:"success.main",connecting:"warning.main",disconnected:"error.main","version-blocked":"error.main"};function Wwr(e){return e?Eni[e]:"success.main"}function Gwr(e){return e.split("-")[0].split(".").map(Number)}function Vwr(e,t){if(!e||!t||e===t)return;let r=Gwr(e),n=Gwr(t);for(let i=0;i<Math.max(r.length,n.length);i++){let o=(r[i]??0)-(n[i]??0);if(Number.isNaN(o))return;if(o!==0)return o<0?"behind":"ahead"}}var KA=E($(),1),Rni={height:16,fontSize:10},Ani={opacity:.6,fontSize:"0.85em"};function Pni(e,t){if(t===e.local)return"this machine";let r=e.links.find(n=>n.name===t);return r?r.error?`${r.state}: ${r.error}`:r.state:""}function RX({nodes:e,name:t,showVersion:r=!1}){let n=cve()??M_,i=e.links.find(a=>a.name===t),o=Vwr(i?.peerVersion,n);return(0,KA.jsx)(lr,{title:Pni(e,t),placement:"right",children:(0,KA.jsxs)(J,{component:"span",sx:{display:"inline-flex",alignItems:"center",gap:.75},children:[(0,KA.jsx)(Uwr,{sx:{fontSize:8,color:Wwr(i?.state)}}),t,r&&i?.peerVersion&&(0,KA.jsxs)(J,{component:"span",sx:Ani,children:["v",i.peerVersion]}),o&&(0,KA.jsx)(qn,{label:o,size:"small",color:o==="behind"?"warning":"info",sx:Rni})]})})}var XA=E($(),1),Lni={opacity:.6},Mni={display:"inline-flex",alignItems:"center",gap:.5,px:.5,border:1,borderStyle:"dashed",borderRadius:1};function qwr({nodes:e,name:t,clone:r}){let n=(0,XA.jsx)(RX,{nodes:e,name:t});return r.kind==="cloned"?n:r.kind==="unavailable"?(0,XA.jsx)(J,{component:"span",sx:Lni,children:n}):(0,XA.jsx)(lr,{title:KF(t,r.cloneTarget),children:(0,XA.jsxs)(J,{component:"span",sx:Mni,children:[(0,XA.jsx)(YF,{sx:{fontSize:14}}),n]})})}var Ywr=E($(),1),Ini={px:1.5,borderRadius:.75,fontSize:12,fontWeight:600,color:"text.secondary","&:hover":{color:"text.primary",bgcolor:"action.hover"},"&[aria-checked='true']":{color:"primary.main",bgcolor:"action.selected"},"&.Mui-focusVisible":{outline:2,outlineColor:"primary.main"}};function jwr({value:e,label:t,checked:r,autoFocus:n,onSelect:i}){return(0,Ywr.jsx)(ln,{role:"radio","aria-checked":r,"data-value":e,tabIndex:r?0:-1,autoFocus:n&&r,onClick:i,sx:Ini,children:t})}var Kwr={ArrowRight:1,ArrowLeft:-1};function Dni(e,t,r){if(e.key==="Tab"){let n=t+(e.shiftKey?-1:1);return n>=0&&n<r?n:void 0}return(t+Kwr[e.key]+r)%r}function Xwr(e,t,r,n){return i=>{if(i.key==="ArrowUp"||i.key==="ArrowDown"){if(!n)return;i.preventDefault(),n();return}if(i.key!=="Tab"&&!Kwr[i.key]){P2(i);return}let o=Dni(i,e.indexOf(t),e.length);o!==void 0&&(i.preventDefault(),r(e[o]),i.currentTarget.querySelector(`[data-value="${e[o]}"]`)?.focus())}}var Zwr=E(fe(),1);function f$(e){return e?.querySelector('[aria-checked="true"]')}function Qwr(e,t){(0,Zwr.useEffect)(()=>{let r=e.current;if(!r?.contains(document.activeElement))return;let n=f$(r);n&&n!==document.activeElement&&n.focus()},[e,t])}var pGe=E($(),1),Nni={border:1,borderColor:"divider",borderRadius:1,height:40,p:"2px",flexShrink:0};function yve({label:e,options:t,value:r,onChange:n,optionLabel:i=u=>u,groupRef:o,autoFocus:a,onTrack:s,onToggleRow:l}){return Qwr(o,r),(0,pGe.jsx)(Lt,{ref:o,direction:"row",role:"radiogroup","aria-label":e,spacing:"2px",onFocus:s,onKeyDown:Xwr(t,r,n,l),sx:Nni,children:t.map(u=>(0,pGe.jsx)(jwr,{value:u,label:i(u),checked:u===r,autoFocus:a,onSelect:()=>n(u)},u))})}var mGe=E($(),1);function ekr({value:e,onChange:t,cloneState:r}){let{nodes:n,names:i,visible:o}=Ec(),a=(0,Jwr.useRef)(null);return!o||!n||!e?null:(0,mGe.jsx)(yve,{label:"Machine",options:i,value:e,onChange:t,optionLabel:s=>(0,mGe.jsx)(qwr,{nodes:n,name:s,clone:r(s)}),groupRef:a,autoFocus:!1,onTrack:()=>{}})}var vve=E($(),1);function tkr({prompt:e,children:t}){return(0,vve.jsxs)(Lt,{children:[e,(0,vve.jsx)(Lt,{spacing:1,sx:{px:1.5,pb:1.5},children:t})]})}var nkr=E($(),1),Oni=".MuiOutlinedInput-notchedOutline",Bni={"& .MuiOutlinedInput-root":{px:"18px",py:2,minHeight:92,alignItems:"flex-start",bgcolor:"transparent",borderRadius:0,fontSize:15},[`&&& ${Oni}`]:{border:0},"& textarea::placeholder":{color:"text.disabled",opacity:1}};function rkr({value:e,onChange:t,placeholder:r,inputRef:n,autoFocus:i,onTrack:o}){return(0,nkr.jsx)(ei,{sx:Bni,value:e,onChange:a=>t(a.target.value),onKeyDown:P2,onFocus:o,onSelect:o,inputRef:n,placeholder:r,autoFocus:i,fullWidth:!0,multiline:!0,minRows:3,maxRows:12,slotProps:{htmlInput:{"aria-label":"Prompt"}}})}var skr=E(fe(),1);var mT={draft:{placeholder:"Describe the backlog item to draft...",submitLabel:"Start draft",sessionMode:"assist-draft"},bug:{placeholder:"Describe the bug: what happened, what you expected...",submitLabel:"File bug",sessionMode:"assist-bug"},prompt:{placeholder:Jge,submitLabel:"Start session"},design:{placeholder:"Describe the design task...",submitLabel:"Start design"}},ikr=Object.keys(mT);var gGe=E($(),1);function okr({anchor:e,harness:t,harnesses:r,onPick:n,onClose:i}){return(0,gGe.jsx)(Os,{open:e!==null,anchorEl:e,onClose:i,slotProps:{list:{dense:!0,"aria-label":"Harness"}},children:r.map(o=>(0,gGe.jsx)(dn,{role:"menuitemradio","aria-checked":o===t,selected:o===t,onClick:()=>{n(o),i()},sx:{fontSize:13},children:Iu(o)},o))})}var ZA=E($(),1);function akr(e){return t=>t==="prompt"&&e?(0,ZA.jsxs)(ZA.Fragment,{children:["prompt",(0,ZA.jsx)(J,{component:"span",sx:{fontWeight:400,whiteSpace:"pre"},children:` \xB7 ${Iu(e)}`}),(0,ZA.jsx)(bd,{sx:{fontSize:18,mr:-.75}})]}):t}var QA=E($(),1);function lkr({draft:e,harness:t,harnesses:r,focus:n}){let[i,o]=(0,skr.useState)(null),a=e.mode==="prompt"&&r.length>1,s=()=>o(f$(n.modeRef.current)??null),l=u=>{a&&u==="prompt"?s():e.setMode(u)};return(0,QA.jsxs)(QA.Fragment,{children:[(0,QA.jsx)(yve,{label:"Mode",options:ikr,value:e.mode,onChange:l,optionLabel:akr(r.length>1?t:void 0),groupRef:n.modeRef,autoFocus:n.autoFocus==="mode",onTrack:n.trackMode,onToggleRow:a?s:void 0}),(0,QA.jsx)(okr,{anchor:i,harness:t,harnesses:r,onPick:e.setHarness,onClose:()=>o(null)})]})}var Tkr=E(fe(),1);var yGe=E($(),1),Fni={zIndex:e=>e.zIndex.modal+1};function ckr({open:e,anchor:t,children:r}){return(0,yGe.jsx)(iP,{open:e,anchorEl:t,placement:"bottom-start",sx:Fni,children:(0,yGe.jsx)(tn,{sx:{maxHeight:240,overflowY:"auto",width:t?.clientWidth},onMouseDown:n=>n.preventDefault(),children:r})})}var ukr=E($(),1),fkr=ut((0,ukr.jsx)("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6z"}),"KeyboardArrowDown");var vGe=E($(),1),$ni={fontSize:13,height:36,pr:1,cursor:"pointer","& input":{cursor:"text"}},zni={fontSize:16,color:"text.disabled"};function dkr(e){return{htmlInput:{role:"combobox","aria-label":"Repo","aria-expanded":e},input:{sx:$ni,endAdornment:(0,vGe.jsx)(s2e,{position:"end",children:(0,vGe.jsx)(fkr,{sx:zni})})}}}var hkr=E(W6(),1);function pkr({open:e,highlighted:t,accept:r,close:n,navigate:i,openList:o}){return a=>{if(!e){if(a.key==="ArrowDown"){a.preventDefault(),o();return}P2(a);return}if(a.key!=="Escape"){if(a.key==="Enter"){if(a.preventDefault(),t===void 0)return;(0,hkr.flushSync)(()=>{r(t),n()}),P2(a);return}if(a.key!=="Tab"){i(a);return}t!==void 0&&r(t),n()}}}function mkr(e,t){let r=t.trim().toLowerCase();return r?e.filter(n=>gv(n).toLowerCase().includes(r)):e}var bGe=E(fe(),1);function gkr(){let[e,t]=(0,bGe.useState)(!1),[r,n]=(0,bGe.useState)("");return{open:e,query:r,show:()=>t(!0),filterBy:i=>{n(i),t(!0)},close:()=>{t(!1),n("")}}}var vkr=E(fe(),1);var ykr=e=>e?gv(e):"";function bkr(e){let[t,r]=(0,vkr.useState)(()=>ykr(e));return{text:t,setText:r,showRepo:n=>r(ykr(n))}}function xkr(e,t,r){let n=gkr(),i=bkr(t),o=mkr(e,n.query),a=f=>{r(f),i.showRepo(f)},s=x_(o,n.query,a,n.close),l=()=>s.setHighlight(Math.max(e.indexOf(t),0)),u=()=>{l(),n.show()};return{open:n.open,text:i.text,filtered:o,highlight:s.highlight,setHighlight:s.setHighlight,onKeyDown:pkr({open:n.open,highlighted:o[s.highlight],accept:a,close:n.close,navigate:s.onKeyDown,openList:u}),onClick:()=>{n.open||u()},onType:f=>{i.setText(f),n.filterBy(f)},onFocus:l,onBlur:()=>{n.close(),i.showRepo(t)},pick:f=>{a(f),n.close()}}}var d$=E($(),1);function Skr({repos:e,value:t,onChange:r,inputRef:n,autoFocus:i,onTrack:o}){let a=xkr(e,t,r),s=(0,Tkr.useRef)(null);return(0,d$.jsxs)(J,{ref:s,sx:{flex:1,minWidth:0},children:[(0,d$.jsx)(ei,{value:a.text,onChange:l=>a.onType(l.target.value),onFocus:l=>{l.target.select(),a.onFocus(),o()},inputRef:n,autoFocus:i,onClick:a.onClick,onBlur:a.onBlur,onKeyDown:a.onKeyDown,placeholder:"Repo",size:"small",fullWidth:!0,slotProps:dkr(a.open)}),(0,d$.jsx)(ckr,{open:a.open,anchor:s.current,children:(0,d$.jsx)(q1e,{repos:a.filtered,selected:t,highlight:a.highlight,onHighlight:a.setHighlight,onSelect:a.pick})})]})}var D_=E($(),1);function Ckr({cloneState:e,...t}){let{draft:r,focus:n}=t,{repos:i}=Fn();return(0,D_.jsxs)(tkr,{prompt:(0,D_.jsx)(rkr,{value:r.prompt,onChange:r.setPrompt,placeholder:mT[r.mode].placeholder,inputRef:n.promptRef,autoFocus:n.autoFocus==="prompt",onTrack:n.trackPrompt}),children:[(0,D_.jsxs)(Lt,{direction:"row",spacing:1,sx:{alignItems:"flex-start"},children:[(0,D_.jsx)(Skr,{repos:i,value:r.cwd,onChange:r.setCwd,inputRef:n.repoRef,autoFocus:n.autoFocus==="repo",onTrack:n.trackRepo}),(0,D_.jsx)(lkr,{...t})]}),(0,D_.jsx)(ekr,{value:r.node,onChange:r.setNode,cloneState:e})]})}var _kr=E($(),1),wkr=[["Enter","start"],["Shift+Enter","newline"],["Esc","close"]];function kkr({submitLabel:e,disabled:t=!1,loading:r=!1}){return(0,_kr.jsx)(Dt,{type:"submit",variant:"contained",disabled:t,loading:r,children:e})}var JA=E($(),1),Hni=e=>({alignItems:"center",flexWrap:"wrap",gap:"14px",py:"10px",pl:"18px",pr:1.5,borderTop:1,borderColor:e.tokens.color.lineSoft,bgcolor:"background.default",fontSize:12,color:"text.secondary"}),Uni=e=>({mr:.5,px:"5px",border:1,borderColor:"divider",borderRadius:"4px",fontFamily:e.typography.fontFamilyMono,fontSize:10.5,color:"text.primary"});function Ekr(e){return(0,JA.jsxs)(Lt,{direction:"row",sx:Hni,children:[wkr.map(([t,r])=>(0,JA.jsxs)("span",{children:[(0,JA.jsx)(J,{component:"kbd",sx:Uni,children:t}),r]},t)),(0,JA.jsx)(J,{sx:{flex:1}}),(0,JA.jsx)(kkr,{...e})]})}var e6=E(fe(),1);function Rkr(e,t){let r=(0,e6.useRef)(e),n=(0,e6.useRef)(null),i=(0,e6.useRef)(null),o=(0,e6.useRef)(null),a=(0,e6.useCallback)(u=>{n.current=u;let{field:f,selectionStart:d,selectionEnd:h}=r.current;u&&f==="prompt"&&u.setSelectionRange(d,h)},[]),s=u=>{let f=u.target;t({field:"prompt",selectionStart:f.selectionStart,selectionEnd:f.selectionEnd})},l=()=>{if(o.current?.closest("form")?.contains(document.activeElement))return;let{field:u}=r.current;({repo:i.current,mode:f$(o.current),prompt:n.current}[u]??n.current)?.focus()};return{autoFocus:e.field,promptRef:a,repoRef:i,modeRef:o,trackPrompt:s,trackRepo:()=>t({...e,field:"repo"}),trackMode:()=>t({...e,field:"mode"}),restore:l}}function Wni(e,t,r){return e?r.kind==="cloned"?{kind:"launch",cwd:r.cwd}:r.kind==="clonable"?{kind:"clone",prompt:Y1e(r,t)}:{kind:"blocked"}:{kind:"launch",cwd:e}}function Akr(e,t){let{names:r,visible:n}=Ec(),i=W1e(t,n?r:[void 0]);return{cloneState:i,target:Wni(t,e,i(e))}}function Pkr({mode:e,harness:t,prompt:r,cwd:n,node:i},o){let a=n||void 0,s=i?[i]:[];if(e==="prompt"){t==="claude"?o.onCreate(r,a,...s):o.onCreateHarness(t,r,a,...s);return}if(e==="design"){o.onCreateDesign(r,a,...s);return}let l=i?[{node:i}]:[];Sfr(mT[e].sessionMode,n,(u,f)=>o.onCreateAssist(u,f,...l),()=>{},r)}function Lkr(e,t,r,n){return r.kind==="blocked"||e.modePending?!1:r.kind==="clone"?(N1e(r.prompt,n.onCreateAssist),!0):(Pkr({mode:e.mode,harness:t,prompt:e.prompt,cwd:r.cwd,node:e.node},n),e.clear(),!0)}var bve=E(fe(),1);function Mkr(e,t){let[r,n]=(0,bve.useState)(!1);return(0,bve.useEffect)(()=>{!r||e.modePending||(n(!1),t())},[r,e.modePending,t]),()=>{e.modePending?n(!0):t()}}function Ikr(e,t,r,n,i){let o=Mkr(e,()=>{Lkr(e,t,r,n)&&i()});return a=>{a.preventDefault(),o()}}var AX=E(fe(),1);function Dkr(e,t){let r=(0,AX.useRef)(e),n=(0,AX.useRef)(null);return(0,AX.useEffect)(()=>{if(r.current&&!e){let i=n.current;i?.isConnected?i.focus():t()}r.current=e},[e,t]),i=>{n.current=i.target}}var Okr=E($(),1),Gni={border:0,margin:0,padding:0,minWidth:0};function Nkr({loading:e,restoreFocus:t,children:r}){let n=Dkr(e,t);return(0,Okr.jsx)("fieldset",{disabled:e,style:Gni,onFocus:n,children:r})}var t6=E($(),1);function Bkr({draft:e,launchers:t,onClose:r}){let n=Rkr(e.focus,e.setFocus),i=zwr(m_()),o=i.includes(e.harness)?e.harness:"claude",{target:a,cloneState:s}=Akr(e.node,e.cwd),l=Ikr(e,o,a,t,r);return(0,t6.jsx)(dve,{onClose:r,onEntered:n.restore,centered:!0,children:(0,t6.jsx)("form",{onSubmit:l,children:(0,t6.jsxs)(Nkr,{loading:e.modePending,restoreFocus:n.restore,children:[(0,t6.jsx)(Ckr,{draft:e,harness:o,harnesses:i,focus:n,cloneState:s}),(0,t6.jsx)(Ekr,{submitLabel:a.kind==="clone"?"Clone":mT[e.mode].submitLabel,disabled:a.kind==="blocked",loading:e.modePending})]})})})}var xve=E(fe(),1);var Vni=1e3;async function qni(e){try{let t=e?`?cwd=${encodeURIComponent(e)}`:"",n=await(await fetch(`/api/new-session-defaults${t}`)).json();return Object.hasOwn(mT,n?.mode)?n.mode:null}catch{return null}}function Fkr(e,t=0){let[r,n]=(0,xve.useState)(null);return(0,xve.useEffect)(()=>{let i=!1,o,a=async()=>{let s=await qni(e);i||(s?n({cwd:e,opens:t,mode:s}):o=setTimeout(a,Vni))};return a(),()=>{i=!0,clearTimeout(o)}},[e,t]),r?{mode:r.mode,pending:r.cwd!==e||r.opens!==t}:null}function $kr(e,{visible:t,names:r,selected:n}){if(t)return e&&r.includes(e)?e:n}var gT=E(fe(),1),zkr={field:"prompt",selectionStart:0,selectionEnd:0};function Hkr(){let[e,t]=(0,gT.useState)(""),[r,n]=(0,gT.useState)(),[i,o]=(0,gT.useState)(),[a,s]=(0,gT.useState)("claude"),[l,u]=(0,gT.useState)(),[f,d]=(0,gT.useState)(zkr),h=(0,gT.useCallback)(()=>{t(""),n(void 0),o(void 0),u(void 0),d(zkr)},[]);return{prompt:e,cwd:r,mode:i,harness:a,node:l,focus:f,setPrompt:t,setNode:u,setCwd:n,setMode:o,setHarness:s,setFocus:d,clear:h}}function Ukr(e,t=Fkr){let{selectedCwd:r}=Fn(),n=Ec(),i=Hkr(),o=i.cwd??r,a=t(o,e);return a?{...i,cwd:o,mode:i.mode??a.mode,modePending:i.mode===void 0&&a.pending,node:$kr(i.node,n)}:null}function Wkr(e){Eo(jn("newSession").matches,e)}var Gkr=E(fe(),1);function Vkr(e,t){let{selectedCwd:r}=Fn(),[n,i]=Wc(),o=n.get("new"),a=n.get("newCwd")??r,{setPrompt:s,setCwd:l,setFocus:u}=e??{};(0,Gkr.useEffect)(()=>{o===null||!s||!l||!u||(o&&(s(o),l(a),u({field:"prompt",selectionStart:o.length,selectionEnd:o.length})),t(),i(f=>(f.delete("new"),f.delete("newCwd"),f),{replace:!0}))},[o,a,s,l,u,t,i])}var jkr=E($(),1);function qkr({launchers:e}){let[t,r]=(0,PX.useState)(!1),[n,i]=(0,PX.useState)(0),o=Ukr(n),a=(0,PX.useCallback)(()=>{r(!0),i(s=>s+1)},[]);return Wkr(a),Vkr(o,a),!t||!o?null:(0,jkr.jsx)(Bkr,{draft:o,launchers:e,onClose:()=>r(!1)})}var Tve=E($(),1);function Ykr({reconnecting:e}){return(0,Tve.jsx)(Dh,{open:e,children:(0,Tve.jsx)(yi,{severity:"info",variant:"filled",icon:(0,Tve.jsx)(oo,{size:16,color:"inherit"}),children:"Reconnecting\u2026"})})}var _v=E($(),1);function Kkr({socket:e,onViewLaunchedSession:t}){return(0,_v.jsxs)(_v.Fragment,{children:[(0,_v.jsx)(Bwr,{}),(0,_v.jsx)(qkr,{launchers:{onCreate:e.createSession,onCreateDesign:e.createDesignSession,onCreateHarness:e.createHarnessSession,onCreateAssist:e.createAssistSession}}),(0,_v.jsx)(Ykr,{reconnecting:e.reconnecting}),(0,_v.jsx)(Ql,{error:e.error,onClose:e.clearError}),(0,_v.jsx)($wr,{notice:e.success,onClose:e.clearSuccess,onView:t})]})}var Ev=E(fe(),1);var jni=6e4;function Yni(e,t,r){return t.map(n=>e.find(i=>i.name===n)??{name:n,local:n===r,loading:!0})}function Xkr(e){let t=e.nodes?.local,r=e.names.join(`
|
|
4022
|
+
`,ewr={content:'""',position:"absolute",borderRadius:"inherit",background:"conic-gradient(from calc(var(--rainbow-pill-h) * 1deg) in oklch longer hue, oklch(66% 0.21 0), oklch(66% 0.21 0))",animation:`${cni} 1.8s linear infinite`},fni={display:"inline-flex",alignItems:"center",px:1.5,py:"3px",borderRadius:999,position:"relative",isolation:"isolate",fontWeight:700,animation:`${uni} 1.6s ease-in-out infinite`,"&::before":{...ewr,inset:0,zIndex:-1},"&::after":{...ewr,inset:"-5px",zIndex:-2,filter:"blur(9px)",opacity:.85},"& span":{color:ol.rainbowPill.text,textShadow:ol.rainbowPill.shadow},"@media (prefers-reduced-motion: reduce)":{animation:"none","&::before, &::after":{animation:"none"}}};function twr({children:e}){return(0,qA.jsxs)(qA.Fragment,{children:[(0,qA.jsx)(i5,{styles:lni}),(0,qA.jsx)(J,{component:"span","data-testid":"rainbow-pill",sx:fni,children:e})]})}function rwr({pct:e,timeLabel:t}){return[Math.round(e),...(t.match(/\d+/g)??[]).map(Number)].join(",")}function nwr(e){if(e.length!==2)return!1;let[t,r]=e;return rwr(t)===rwr(r)}var pT=E($(),1);function owr({rateLimits:e}){let t=GF(3e4),r=[{window:e.five_hour,windowSeconds:18e3,fallbackLabel:"5h"},{window:e.seven_day,windowSeconds:604800,fallbackLabel:"7d"}].filter(o=>o.window?.used_percentage!=null),n=nwr(r.map(o=>({pct:o.window?.used_percentage??0,timeLabel:ove(o.window?.resets_at,o.fallbackLabel,t)}))),i=r.map((o,a)=>(0,pT.jsxs)(iwr.Fragment,{children:[a>0?(0,pT.jsx)(J,{component:"span",sx:{color:u$,mr:.5},children:","}):null,(0,pT.jsx)(JCr,{window:o.window,windowSeconds:o.windowSeconds,fallbackLabel:o.fallbackLabel,now:t})]},o.fallbackLabel));return n?(0,pT.jsx)(twr,{children:i}):(0,pT.jsx)(pT.Fragment,{children:i})}var A_=E($(),1);function swr({groups:e}){return(0,A_.jsx)(A_.Fragment,{children:e.map((t,r)=>(0,A_.jsxs)(awr.Fragment,{children:[(0,A_.jsx)(J,{component:"span",sx:{color:u$,ml:r>0?1:0,mr:.5},children:Iu(t.harness)}),(0,A_.jsx)(owr,{rateLimits:t.rateLimits})]},t.harness))})}var lwr={root:{fontFamily:"fontFamilyMono",fontSize:12,display:"grid",gap:1},group:{display:"grid",gap:"2px"},heading:{color:e=>e.tokens.color.onAppBar.secondary},foot:{pt:.75,opacity:.6,borderTop:"1px solid color-mix(in srgb, currentColor 18%, transparent)"}};function dni(e){if(e==="over")return{level:"warn",boundary:100};if(e==="warn")return{level:"ok",boundary:75}}function hni(e){if(e==="ok")return{level:"warn",boundary:75};if(e==="warn")return{level:"over",boundary:100}}function pni(e,t,r,n){if(e>=t)return;let i=e/t;return Math.round(r-n*(1-i))}function fwr(e,t,r,n){if(t==null)return{kind:"unprojectable"};let i=HWe(t,r,n);if(i==null)return{kind:"unprojectable"};let o=h_(e,t,r,n),a=dni(o),s=hni(o);return{kind:"projected",recovery:a&&{level:a.level,pct:a.boundary*i,at:pni(e,a.boundary,t,r)},worse:s&&{level:s.level,pct:s.boundary*i}}}function sve(e){return t=>t.tokens.color.onAppBar.level[e]}function dwr(e,t){return e.at==null?"not before reset":`${e.level==="ok"?"green":"under"} in ${T1e(e.at,t)}`}var P_=E($(),1),hwr={display:"contents"};function cGe({direction:e,threshold:t}){let r=e==="back";if(!t)return(0,P_.jsxs)(J,{component:"span",sx:hwr,children:[(0,P_.jsx)("span",{}),(0,P_.jsx)("span",{})]});let n=(0,P_.jsx)(J,{component:"span",sx:{opacity:.6},children:r?"\u2190":"\u2192"}),i=(0,P_.jsxs)(J,{component:"span",sx:{color:sve(t.level),textAlign:"right"},children:[Math.round(t.pct),"%"]});return(0,P_.jsxs)(J,{component:"span",sx:hwr,children:[r?i:n,r?n:i]})}var pwr={row:{display:"grid",gridTemplateColumns:"2.5ch 4ch 1ch 4ch 1ch 4ch auto",alignItems:"baseline",gap:.75,fontVariantNumeric:"tabular-nums"},pctWeight:500,note:{pl:.75,color:e=>e.tokens.color.onAppBar.secondary}};var L_=E($(),1);function mwr({label:e,pct:t,resetsAt:r,windowSeconds:n,now:i}){let o=pwr,a=h_(t,r,n,i),s=fwr(t,r,n,i),l=s.kind==="projected"?s:void 0;return(0,L_.jsxs)(J,{sx:o.row,children:[(0,L_.jsx)(J,{component:"span",sx:{minWidth:"2ch"},children:e}),(0,L_.jsx)(cGe,{direction:"back",threshold:l?.recovery}),(0,L_.jsxs)(J,{component:"span",sx:{minWidth:"4ch",textAlign:"right",fontWeight:o.pctWeight,color:sve(a)},children:[Math.round(t),"%"]}),(0,L_.jsx)(cGe,{direction:"forward",threshold:l?.worse}),(0,L_.jsx)(J,{component:"span",sx:o.note,children:l?l.recovery&&dwr(l.recovery,i):"no projection yet"})]})}function gwr(e){return[{label:"5h",window:e.five_hour,windowSeconds:18e3},{label:"7d",window:e.seven_day,windowSeconds:604800}].flatMap(t=>t.window?.used_percentage==null?[]:[{label:t.label,pct:t.window.used_percentage,resetsAt:t.window.resets_at,windowSeconds:t.windowSeconds}])}var vwr=E($(),1);function ywr({rateLimits:e,now:t}){return gwr(e).map(r=>(0,vwr.jsx)(mwr,{label:r.label,pct:r.pct,resetsAt:r.resetsAt,windowSeconds:r.windowSeconds,now:t},r.label))}var jA=E($(),1);function bwr({groups:e}){let t=GF(3e4),r=lwr;return(0,jA.jsxs)(J,{sx:r.root,children:[e.map(n=>(0,jA.jsxs)(J,{sx:r.group,children:[(0,jA.jsx)(J,{sx:r.heading,children:Iu(n.harness)}),(0,jA.jsx)(ywr,{rateLimits:n.rateLimits,now:t})]},n.harness)),(0,jA.jsx)(J,{sx:r.foot,children:"Account usage per harness \u2014 view history"})]})}var uGe=E($(),1),mni="Claude account usage (5h / 7d windows) \u2014 view history";function xwr(e){return e.length===0?{title:mni,content:"Usage"}:{title:(0,uGe.jsx)(bwr,{groups:e}),content:(0,uGe.jsx)(swr,{groups:e})}}var Twr={display:"flex",alignItems:"center",height:22,px:1,borderRadius:1,fontSize:"inherit","&:hover, &:focus-visible":{bgcolor:e=>e.tokens.color.statusBar.hover,color:e=>e.tokens.color.statusBar.hoverText}},Swr={tooltip:{sx:{p:"10px 12px",minWidth:300,maxWidth:"none"}}};var fGe=E($(),1),gni={};function Cwr({rateLimits:e,harnessRateLimits:t=gni}){let{title:r,content:n}=xwr(ZCr(e,t));return(0,fGe.jsx)(lr,{title:r,placement:"top-start",slotProps:Swr,children:(0,fGe.jsx)(rn,{component:ws,to:"/usage",underline:"none",color:"inherit",sx:Twr,children:n})})}var _wr=E(fe(),1);var M_="0.948.1";var lve=E(fe(),1),dGe=(0,lve.createContext)(null);function cve(){return(0,lve.useContext)(dGe)}var hGe=E($(),1);function wwr(){let e=cve();return!e||e===M_?null:(0,hGe.jsx)(lr,{title:`Daemon is running v${e}, but this page was served by v${M_}. Restart the daemon to match.`,children:(0,hGe.jsx)(Z1e,{fontSize:"small",color:"warning","aria-label":"Version mismatch"})})}var kwr=e=>({display:"inline-flex",alignItems:"center",gap:.75,px:1,py:0,height:22,borderRadius:1,fontSize:"inherit",lineHeight:1.5,color:"inherit",opacity:1,bgcolor:t=>e?kv(t).active:"transparent",transition:"opacity .2s ease, background-color .2s ease, color .2s ease","&:hover, &:focus-visible":{bgcolor:t=>kv(t).hover,color:t=>kv(t).hoverText},"& .ready-dot":{width:6,height:6,borderRadius:"50%",bgcolor:t=>kv(t).dot,boxShadow:t=>`0 0 0 3px ${kv(t).dotRing}`},"& .ready-count":{fontWeight:500,color:t=>kv(t).readyText}});var lg=E($(),1);function Ewr(){let{entries:e}=RF(),t=Ni(),r=(0,_wr.useCallback)(()=>t("/updates"),[t]),{matches:n,chords:i}=jn("openUpdates");if(Eo(n,r),!M_)return null;let o=e.filter(NF).length;return(0,lg.jsxs)(lg.Fragment,{children:[(0,lg.jsx)(lr,{describeChild:!0,placement:"top-end",title:(0,lg.jsx)(Nu,{label:"Updates",chords:i}),children:(0,lg.jsxs)(ln,{component:ws,to:"/updates","aria-label":o?`Updates: ${o} node${o>1?"s have":" has"} an update ready`:"Updates",sx:kwr(o>0),children:[o>0&&(0,lg.jsx)("span",{className:"ready-dot","aria-hidden":!0}),(0,lg.jsxs)("span",{children:["v",M_]}),o>0&&(0,lg.jsxs)("span",{className:"ready-count",children:[o," ready"]})]})}),(0,lg.jsx)(wwr,{})]})}var uve=E($(),1);function Rwr({socket:e}){return(0,uve.jsx)(KCr,{start:(0,uve.jsx)(Cwr,{rateLimits:e.rateLimits,harnessRateLimits:e.harnessRateLimits}),end:(0,uve.jsx)(Ewr,{})})}var mve=E(fe(),1);var pve=E(fe(),1);function Awr(e,t,r){if(!e)return"Select a repo to search files.";if(r.error)return"Couldn't search files in this repo.";if(!(r.files.length>0||r.loading))return t?"No matching files.":"No files in this repo."}var I_=E($(),1),yni={display:"flex",gap:1,alignItems:"center",minWidth:0},vni={display:"flex",gap:1,alignItems:"baseline",minWidth:0,overflow:"hidden"},bni={fontFamily:"fontFamilyMono",fontSize:13,whiteSpace:"nowrap"},xni={fontFamily:"fontFamilyMono",fontSize:11,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"};function Tni(e){let t=e.lastIndexOf("/");return t===-1?{dir:"",basename:e}:{dir:e.slice(0,t),basename:e.slice(t+1)}}function Pwr({files:e,highlight:t,onHighlight:r,onSelect:n}){return(0,I_.jsx)(zp,{dense:!0,sx:{py:0},children:e.map((i,o)=>{let{dir:a,basename:s}=Tni(i);return(0,I_.jsxs)(dn,{selected:o===t,onMouseEnter:()=>r(o),onClick:()=>n(i),sx:yni,children:[(0,I_.jsx)(ige,{path:i}),(0,I_.jsxs)(J,{sx:vni,children:[(0,I_.jsx)(Me,{component:"span",sx:bni,children:s}),(0,I_.jsx)(Me,{component:"span",color:"text.secondary",sx:xni,children:a})]})]},i)})})}var fve=E($(),1),Sni={maxHeight:420,overflowY:"auto"},Cni={px:2,py:2,fontSize:13};function Lwr({message:e,files:t,highlight:r,onHighlight:n,onSelect:i}){return(0,fve.jsx)(J,{sx:Sni,children:e?(0,fve.jsx)(Me,{color:"text.secondary",sx:Cni,children:e}):(0,fve.jsx)(Pwr,{files:t,highlight:r,onHighlight:n,onSelect:i})})}var Mwr=E($(),1),wni={mt:6,alignSelf:"flex-start"};function dve({onClose:e,onEntered:t,centered:r=!1,children:n}){return(0,Mwr.jsx)(Gl,{open:!0,onClose:e,maxWidth:"sm",fullWidth:!0,slotProps:{paper:{sx:r?void 0:wni},transition:{onEntered:t}},children:n})}var hve=E(fe(),1);var Iwr={files:[],loading:!1,error:!1};function Dwr(e,t){let[r,n]=(0,hve.useState)(Iwr),i=yr();return(0,hve.useEffect)(()=>{if(!e){n(Iwr);return}let o=!1;return n(s=>({...s,loading:!0})),(async()=>{try{let s=await fetch(jr(`/api/files?cwd=${encodeURIComponent(e)}&q=${encodeURIComponent(t)}`,i));if(!s.ok)throw new Error(`HTTP ${s.status}`);let l=await s.json();if(o)return;n({files:Array.isArray(l.files)?l.files:[],loading:!1,error:!1})}catch{o||n({files:[],loading:!1,error:!0})}})(),()=>{o=!0}},[e,t,i]),r}var YA=E($(),1);function kni(e,t,r){let n=new URLSearchParams({path:e});return t&&n.set("cwd",t),t&&r&&n.set("node",r),`/file?${n}`}function Nwr({onClose:e}){let{worktreeNode:t}=Fn();return(0,YA.jsx)(gf.Provider,{value:t,children:(0,YA.jsx)(_ni,{onClose:e})})}function _ni({onClose:e}){let{worktreeCwd:t,worktreeNode:r}=Fn(),[n,i]=(0,pve.useState)(""),o=Dwr(t,n),a=Ni(),s=(0,pve.useRef)(null),l=p=>a(kni(p,t,r)),{highlight:u,setHighlight:f,onKeyDown:d}=x_(o.files,n,l,e),h=p=>{l(p),e()};return(0,YA.jsxs)(dve,{onClose:e,onEntered:()=>s.current?.focus(),children:[(0,YA.jsx)(SS,{autoFocus:!0,inputRef:s,value:n,onChange:i,onKeyDown:d,placeholder:"Search files by name..."}),(0,YA.jsx)(Lwr,{message:Awr(t,n,o),files:o.files,highlight:u,onHighlight:f,onSelect:h})]})}function Owr(e){Eo(jn("quickOpen").matches,e)}var Fwr=E($(),1);function Bwr(){let[e,t]=(0,mve.useState)(!1);return Owr((0,mve.useCallback)(()=>t(!0),[])),e?(0,Fwr.jsx)(Nwr,{onClose:()=>t(!1)}):null}var gve=E($(),1);function $wr({notice:e,onClose:t,onView:r}){let n=e?.sessionId??null;return(0,gve.jsx)(Dh,{open:e!==null,autoHideDuration:6e3,onClose:t,children:(0,gve.jsx)(yi,{severity:"success",variant:"filled",onClose:t,action:n!==null?(0,gve.jsx)(Dt,{color:"inherit",size:"small",onClick:()=>r(n),children:"View"}):void 0,children:e?.message})})}var PX=E(fe(),1);function zwr(e){let t=["claude"];return e.exposeCodexActions&&t.push("codex"),e.exposePiActions&&t.push("pi"),t}var Jwr=E(fe(),1);var Hwr=E($(),1),Uwr=ut((0,Hwr.jsx)("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2"}),"Circle");var Eni={connected:"success.main",connecting:"warning.main",disconnected:"error.main","version-blocked":"error.main"};function Wwr(e){return e?Eni[e]:"success.main"}function Gwr(e){return e.split("-")[0].split(".").map(Number)}function Vwr(e,t){if(!e||!t||e===t)return;let r=Gwr(e),n=Gwr(t);for(let i=0;i<Math.max(r.length,n.length);i++){let o=(r[i]??0)-(n[i]??0);if(Number.isNaN(o))return;if(o!==0)return o<0?"behind":"ahead"}}var KA=E($(),1),Rni={height:16,fontSize:10},Ani={opacity:.6,fontSize:"0.85em"};function Pni(e,t){if(t===e.local)return"this machine";let r=e.links.find(n=>n.name===t);return r?r.error?`${r.state}: ${r.error}`:r.state:""}function RX({nodes:e,name:t,showVersion:r=!1}){let n=cve()??M_,i=e.links.find(a=>a.name===t),o=Vwr(i?.peerVersion,n);return(0,KA.jsx)(lr,{title:Pni(e,t),placement:"right",children:(0,KA.jsxs)(J,{component:"span",sx:{display:"inline-flex",alignItems:"center",gap:.75},children:[(0,KA.jsx)(Uwr,{sx:{fontSize:8,color:Wwr(i?.state)}}),t,r&&i?.peerVersion&&(0,KA.jsxs)(J,{component:"span",sx:Ani,children:["v",i.peerVersion]}),o&&(0,KA.jsx)(qn,{label:o,size:"small",color:o==="behind"?"warning":"info",sx:Rni})]})})}var XA=E($(),1),Lni={opacity:.6},Mni={display:"inline-flex",alignItems:"center",gap:.5,px:.5,border:1,borderStyle:"dashed",borderRadius:1};function qwr({nodes:e,name:t,clone:r}){let n=(0,XA.jsx)(RX,{nodes:e,name:t});return r.kind==="cloned"?n:r.kind==="unavailable"?(0,XA.jsx)(J,{component:"span",sx:Lni,children:n}):(0,XA.jsx)(lr,{title:KF(t,r.cloneTarget),children:(0,XA.jsxs)(J,{component:"span",sx:Mni,children:[(0,XA.jsx)(YF,{sx:{fontSize:14}}),n]})})}var Ywr=E($(),1),Ini={px:1.5,borderRadius:.75,fontSize:12,fontWeight:600,color:"text.secondary","&:hover":{color:"text.primary",bgcolor:"action.hover"},"&[aria-checked='true']":{color:"primary.main",bgcolor:"action.selected"},"&.Mui-focusVisible":{outline:2,outlineColor:"primary.main"}};function jwr({value:e,label:t,checked:r,autoFocus:n,onSelect:i}){return(0,Ywr.jsx)(ln,{role:"radio","aria-checked":r,"data-value":e,tabIndex:r?0:-1,autoFocus:n&&r,onClick:i,sx:Ini,children:t})}var Kwr={ArrowRight:1,ArrowLeft:-1};function Dni(e,t,r){if(e.key==="Tab"){let n=t+(e.shiftKey?-1:1);return n>=0&&n<r?n:void 0}return(t+Kwr[e.key]+r)%r}function Xwr(e,t,r,n){return i=>{if(i.key==="ArrowUp"||i.key==="ArrowDown"){if(!n)return;i.preventDefault(),n();return}if(i.key!=="Tab"&&!Kwr[i.key]){P2(i);return}let o=Dni(i,e.indexOf(t),e.length);o!==void 0&&(i.preventDefault(),r(e[o]),i.currentTarget.querySelector(`[data-value="${e[o]}"]`)?.focus())}}var Zwr=E(fe(),1);function f$(e){return e?.querySelector('[aria-checked="true"]')}function Qwr(e,t){(0,Zwr.useEffect)(()=>{let r=e.current;if(!r?.contains(document.activeElement))return;let n=f$(r);n&&n!==document.activeElement&&n.focus()},[e,t])}var pGe=E($(),1),Nni={border:1,borderColor:"divider",borderRadius:1,height:40,p:"2px",flexShrink:0};function yve({label:e,options:t,value:r,onChange:n,optionLabel:i=u=>u,groupRef:o,autoFocus:a,onTrack:s,onToggleRow:l}){return Qwr(o,r),(0,pGe.jsx)(Lt,{ref:o,direction:"row",role:"radiogroup","aria-label":e,spacing:"2px",onFocus:s,onKeyDown:Xwr(t,r,n,l),sx:Nni,children:t.map(u=>(0,pGe.jsx)(jwr,{value:u,label:i(u),checked:u===r,autoFocus:a,onSelect:()=>n(u)},u))})}var mGe=E($(),1);function ekr({value:e,onChange:t,cloneState:r}){let{nodes:n,names:i,visible:o}=Ec(),a=(0,Jwr.useRef)(null);return!o||!n||!e?null:(0,mGe.jsx)(yve,{label:"Machine",options:i,value:e,onChange:t,optionLabel:s=>(0,mGe.jsx)(qwr,{nodes:n,name:s,clone:r(s)}),groupRef:a,autoFocus:!1,onTrack:()=>{}})}var vve=E($(),1);function tkr({prompt:e,children:t}){return(0,vve.jsxs)(Lt,{children:[e,(0,vve.jsx)(Lt,{spacing:1,sx:{px:1.5,pb:1.5},children:t})]})}var nkr=E($(),1),Oni=".MuiOutlinedInput-notchedOutline",Bni={"& .MuiOutlinedInput-root":{px:"18px",py:2,minHeight:92,alignItems:"flex-start",bgcolor:"transparent",borderRadius:0,fontSize:15},[`&&& ${Oni}`]:{border:0},"& textarea::placeholder":{color:"text.disabled",opacity:1}};function rkr({value:e,onChange:t,placeholder:r,inputRef:n,autoFocus:i,onTrack:o}){return(0,nkr.jsx)(ei,{sx:Bni,value:e,onChange:a=>t(a.target.value),onKeyDown:P2,onFocus:o,onSelect:o,inputRef:n,placeholder:r,autoFocus:i,fullWidth:!0,multiline:!0,minRows:3,maxRows:12,slotProps:{htmlInput:{"aria-label":"Prompt"}}})}var skr=E(fe(),1);var mT={draft:{placeholder:"Describe the backlog item to draft...",submitLabel:"Start draft",sessionMode:"assist-draft"},bug:{placeholder:"Describe the bug: what happened, what you expected...",submitLabel:"File bug",sessionMode:"assist-bug"},prompt:{placeholder:Jge,submitLabel:"Start session"},design:{placeholder:"Describe the design task...",submitLabel:"Start design"}},ikr=Object.keys(mT);var gGe=E($(),1);function okr({anchor:e,harness:t,harnesses:r,onPick:n,onClose:i}){return(0,gGe.jsx)(Os,{open:e!==null,anchorEl:e,onClose:i,slotProps:{list:{dense:!0,"aria-label":"Harness"}},children:r.map(o=>(0,gGe.jsx)(dn,{role:"menuitemradio","aria-checked":o===t,selected:o===t,onClick:()=>{n(o),i()},sx:{fontSize:13},children:Iu(o)},o))})}var ZA=E($(),1);function akr(e){return t=>t==="prompt"&&e?(0,ZA.jsxs)(ZA.Fragment,{children:["prompt",(0,ZA.jsx)(J,{component:"span",sx:{fontWeight:400,whiteSpace:"pre"},children:` \xB7 ${Iu(e)}`}),(0,ZA.jsx)(bd,{sx:{fontSize:18,mr:-.75}})]}):t}var QA=E($(),1);function lkr({draft:e,harness:t,harnesses:r,focus:n}){let[i,o]=(0,skr.useState)(null),a=e.mode==="prompt"&&r.length>1,s=()=>o(f$(n.modeRef.current)??null),l=u=>{a&&u==="prompt"?s():e.setMode(u)};return(0,QA.jsxs)(QA.Fragment,{children:[(0,QA.jsx)(yve,{label:"Mode",options:ikr,value:e.mode,onChange:l,optionLabel:akr(r.length>1?t:void 0),groupRef:n.modeRef,autoFocus:n.autoFocus==="mode",onTrack:n.trackMode,onToggleRow:a?s:void 0}),(0,QA.jsx)(okr,{anchor:i,harness:t,harnesses:r,onPick:e.setHarness,onClose:()=>o(null)})]})}var Tkr=E(fe(),1);var yGe=E($(),1),Fni={zIndex:e=>e.zIndex.modal+1};function ckr({open:e,anchor:t,children:r}){return(0,yGe.jsx)(iP,{open:e,anchorEl:t,placement:"bottom-start",sx:Fni,children:(0,yGe.jsx)(tn,{sx:{maxHeight:240,overflowY:"auto",width:t?.clientWidth},onMouseDown:n=>n.preventDefault(),children:r})})}var ukr=E($(),1),fkr=ut((0,ukr.jsx)("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6z"}),"KeyboardArrowDown");var vGe=E($(),1),$ni={fontSize:13,height:36,pr:1,cursor:"pointer","& input":{cursor:"text"}},zni={fontSize:16,color:"text.disabled"};function dkr(e){return{htmlInput:{role:"combobox","aria-label":"Repo","aria-expanded":e},input:{sx:$ni,endAdornment:(0,vGe.jsx)(s2e,{position:"end",children:(0,vGe.jsx)(fkr,{sx:zni})})}}}var hkr=E(W6(),1);function pkr({open:e,highlighted:t,accept:r,close:n,navigate:i,openList:o}){return a=>{if(!e){if(a.key==="ArrowDown"){a.preventDefault(),o();return}P2(a);return}if(a.key!=="Escape"){if(a.key==="Enter"){if(a.preventDefault(),t===void 0)return;(0,hkr.flushSync)(()=>{r(t),n()}),P2(a);return}if(a.key!=="Tab"){i(a);return}t!==void 0&&r(t),n()}}}function mkr(e,t){let r=t.trim().toLowerCase();return r?e.filter(n=>gv(n).toLowerCase().includes(r)):e}var bGe=E(fe(),1);function gkr(){let[e,t]=(0,bGe.useState)(!1),[r,n]=(0,bGe.useState)("");return{open:e,query:r,show:()=>t(!0),filterBy:i=>{n(i),t(!0)},close:()=>{t(!1),n("")}}}var vkr=E(fe(),1);var ykr=e=>e?gv(e):"";function bkr(e){let[t,r]=(0,vkr.useState)(()=>ykr(e));return{text:t,setText:r,showRepo:n=>r(ykr(n))}}function xkr(e,t,r){let n=gkr(),i=bkr(t),o=mkr(e,n.query),a=f=>{r(f),i.showRepo(f)},s=x_(o,n.query,a,n.close),l=()=>s.setHighlight(Math.max(e.indexOf(t),0)),u=()=>{l(),n.show()};return{open:n.open,text:i.text,filtered:o,highlight:s.highlight,setHighlight:s.setHighlight,onKeyDown:pkr({open:n.open,highlighted:o[s.highlight],accept:a,close:n.close,navigate:s.onKeyDown,openList:u}),onClick:()=>{n.open||u()},onType:f=>{i.setText(f),n.filterBy(f)},onFocus:l,onBlur:()=>{n.close(),i.showRepo(t)},pick:f=>{a(f),n.close()}}}var d$=E($(),1);function Skr({repos:e,value:t,onChange:r,inputRef:n,autoFocus:i,onTrack:o}){let a=xkr(e,t,r),s=(0,Tkr.useRef)(null);return(0,d$.jsxs)(J,{ref:s,sx:{flex:1,minWidth:0},children:[(0,d$.jsx)(ei,{value:a.text,onChange:l=>a.onType(l.target.value),onFocus:l=>{l.target.select(),a.onFocus(),o()},inputRef:n,autoFocus:i,onClick:a.onClick,onBlur:a.onBlur,onKeyDown:a.onKeyDown,placeholder:"Repo",size:"small",fullWidth:!0,slotProps:dkr(a.open)}),(0,d$.jsx)(ckr,{open:a.open,anchor:s.current,children:(0,d$.jsx)(q1e,{repos:a.filtered,selected:t,highlight:a.highlight,onHighlight:a.setHighlight,onSelect:a.pick})})]})}var D_=E($(),1);function Ckr({cloneState:e,...t}){let{draft:r,focus:n}=t,{repos:i}=Fn();return(0,D_.jsxs)(tkr,{prompt:(0,D_.jsx)(rkr,{value:r.prompt,onChange:r.setPrompt,placeholder:mT[r.mode].placeholder,inputRef:n.promptRef,autoFocus:n.autoFocus==="prompt",onTrack:n.trackPrompt}),children:[(0,D_.jsxs)(Lt,{direction:"row",spacing:1,sx:{alignItems:"flex-start"},children:[(0,D_.jsx)(Skr,{repos:i,value:r.cwd,onChange:r.setCwd,inputRef:n.repoRef,autoFocus:n.autoFocus==="repo",onTrack:n.trackRepo}),(0,D_.jsx)(lkr,{...t})]}),(0,D_.jsx)(ekr,{value:r.node,onChange:r.setNode,cloneState:e})]})}var _kr=E($(),1),wkr=[["Enter","start"],["Shift+Enter","newline"],["Esc","close"]];function kkr({submitLabel:e,disabled:t=!1,loading:r=!1}){return(0,_kr.jsx)(Dt,{type:"submit",variant:"contained",disabled:t,loading:r,children:e})}var JA=E($(),1),Hni=e=>({alignItems:"center",flexWrap:"wrap",gap:"14px",py:"10px",pl:"18px",pr:1.5,borderTop:1,borderColor:e.tokens.color.lineSoft,bgcolor:"background.default",fontSize:12,color:"text.secondary"}),Uni=e=>({mr:.5,px:"5px",border:1,borderColor:"divider",borderRadius:"4px",fontFamily:e.typography.fontFamilyMono,fontSize:10.5,color:"text.primary"});function Ekr(e){return(0,JA.jsxs)(Lt,{direction:"row",sx:Hni,children:[wkr.map(([t,r])=>(0,JA.jsxs)("span",{children:[(0,JA.jsx)(J,{component:"kbd",sx:Uni,children:t}),r]},t)),(0,JA.jsx)(J,{sx:{flex:1}}),(0,JA.jsx)(kkr,{...e})]})}var e6=E(fe(),1);function Rkr(e,t){let r=(0,e6.useRef)(e),n=(0,e6.useRef)(null),i=(0,e6.useRef)(null),o=(0,e6.useRef)(null),a=(0,e6.useCallback)(u=>{n.current=u;let{field:f,selectionStart:d,selectionEnd:h}=r.current;u&&f==="prompt"&&u.setSelectionRange(d,h)},[]),s=u=>{let f=u.target;t({field:"prompt",selectionStart:f.selectionStart,selectionEnd:f.selectionEnd})},l=()=>{if(o.current?.closest("form")?.contains(document.activeElement))return;let{field:u}=r.current;({repo:i.current,mode:f$(o.current),prompt:n.current}[u]??n.current)?.focus()};return{autoFocus:e.field,promptRef:a,repoRef:i,modeRef:o,trackPrompt:s,trackRepo:()=>t({...e,field:"repo"}),trackMode:()=>t({...e,field:"mode"}),restore:l}}function Wni(e,t,r){return e?r.kind==="cloned"?{kind:"launch",cwd:r.cwd}:r.kind==="clonable"?{kind:"clone",prompt:Y1e(r,t)}:{kind:"blocked"}:{kind:"launch",cwd:e}}function Akr(e,t){let{names:r,visible:n}=Ec(),i=W1e(t,n?r:[void 0]);return{cloneState:i,target:Wni(t,e,i(e))}}function Pkr({mode:e,harness:t,prompt:r,cwd:n,node:i},o){let a=n||void 0,s=i?[i]:[];if(e==="prompt"){t==="claude"?o.onCreate(r,a,...s):o.onCreateHarness(t,r,a,...s);return}if(e==="design"){o.onCreateDesign(r,a,...s);return}let l=i?[{node:i}]:[];Sfr(mT[e].sessionMode,n,(u,f)=>o.onCreateAssist(u,f,...l),()=>{},r)}function Lkr(e,t,r,n){return r.kind==="blocked"||e.modePending?!1:r.kind==="clone"?(N1e(r.prompt,n.onCreateAssist),!0):(Pkr({mode:e.mode,harness:t,prompt:e.prompt,cwd:r.cwd,node:e.node},n),e.clear(),!0)}var bve=E(fe(),1);function Mkr(e,t){let[r,n]=(0,bve.useState)(!1);return(0,bve.useEffect)(()=>{!r||e.modePending||(n(!1),t())},[r,e.modePending,t]),()=>{e.modePending?n(!0):t()}}function Ikr(e,t,r,n,i){let o=Mkr(e,()=>{Lkr(e,t,r,n)&&i()});return a=>{a.preventDefault(),o()}}var AX=E(fe(),1);function Dkr(e,t){let r=(0,AX.useRef)(e),n=(0,AX.useRef)(null);return(0,AX.useEffect)(()=>{if(r.current&&!e){let i=n.current;i?.isConnected?i.focus():t()}r.current=e},[e,t]),i=>{n.current=i.target}}var Okr=E($(),1),Gni={border:0,margin:0,padding:0,minWidth:0};function Nkr({loading:e,restoreFocus:t,children:r}){let n=Dkr(e,t);return(0,Okr.jsx)("fieldset",{disabled:e,style:Gni,onFocus:n,children:r})}var t6=E($(),1);function Bkr({draft:e,launchers:t,onClose:r}){let n=Rkr(e.focus,e.setFocus),i=zwr(m_()),o=i.includes(e.harness)?e.harness:"claude",{target:a,cloneState:s}=Akr(e.node,e.cwd),l=Ikr(e,o,a,t,r);return(0,t6.jsx)(dve,{onClose:r,onEntered:n.restore,centered:!0,children:(0,t6.jsx)("form",{onSubmit:l,children:(0,t6.jsxs)(Nkr,{loading:e.modePending,restoreFocus:n.restore,children:[(0,t6.jsx)(Ckr,{draft:e,harness:o,harnesses:i,focus:n,cloneState:s}),(0,t6.jsx)(Ekr,{submitLabel:a.kind==="clone"?"Clone":mT[e.mode].submitLabel,disabled:a.kind==="blocked",loading:e.modePending})]})})})}var xve=E(fe(),1);var Vni=1e3;async function qni(e){try{let t=e?`?cwd=${encodeURIComponent(e)}`:"",n=await(await fetch(`/api/new-session-defaults${t}`)).json();return Object.hasOwn(mT,n?.mode)?n.mode:null}catch{return null}}function Fkr(e,t=0){let[r,n]=(0,xve.useState)(null);return(0,xve.useEffect)(()=>{let i=!1,o,a=async()=>{let s=await qni(e);i||(s?n({cwd:e,opens:t,mode:s}):o=setTimeout(a,Vni))};return a(),()=>{i=!0,clearTimeout(o)}},[e,t]),r?{mode:r.mode,pending:r.cwd!==e||r.opens!==t}:null}function $kr(e,{visible:t,names:r,selected:n}){if(t)return e&&r.includes(e)?e:n}var gT=E(fe(),1),zkr={field:"prompt",selectionStart:0,selectionEnd:0};function Hkr(){let[e,t]=(0,gT.useState)(""),[r,n]=(0,gT.useState)(),[i,o]=(0,gT.useState)(),[a,s]=(0,gT.useState)("claude"),[l,u]=(0,gT.useState)(),[f,d]=(0,gT.useState)(zkr),h=(0,gT.useCallback)(()=>{t(""),n(void 0),o(void 0),u(void 0),d(zkr)},[]);return{prompt:e,cwd:r,mode:i,harness:a,node:l,focus:f,setPrompt:t,setNode:u,setCwd:n,setMode:o,setHarness:s,setFocus:d,clear:h}}function Ukr(e,t=Fkr){let{selectedCwd:r}=Fn(),n=Ec(),i=Hkr(),o=i.cwd??r,a=t(o,e);return a?{...i,cwd:o,mode:i.mode??a.mode,modePending:i.mode===void 0&&a.pending,node:$kr(i.node,n)}:null}function Wkr(e){Eo(jn("newSession").matches,e)}var Gkr=E(fe(),1);function Vkr(e,t){let{selectedCwd:r}=Fn(),[n,i]=Wc(),o=n.get("new"),a=n.get("newCwd")??r,{setPrompt:s,setCwd:l,setFocus:u}=e??{};(0,Gkr.useEffect)(()=>{o===null||!s||!l||!u||(o&&(s(o),l(a),u({field:"prompt",selectionStart:o.length,selectionEnd:o.length})),t(),i(f=>(f.delete("new"),f.delete("newCwd"),f),{replace:!0}))},[o,a,s,l,u,t,i])}var jkr=E($(),1);function qkr({launchers:e}){let[t,r]=(0,PX.useState)(!1),[n,i]=(0,PX.useState)(0),o=Ukr(n),a=(0,PX.useCallback)(()=>{r(!0),i(s=>s+1)},[]);return Wkr(a),Vkr(o,a),!t||!o?null:(0,jkr.jsx)(Bkr,{draft:o,launchers:e,onClose:()=>r(!1)})}var Tve=E($(),1);function Ykr({reconnecting:e}){return(0,Tve.jsx)(Dh,{open:e,children:(0,Tve.jsx)(yi,{severity:"info",variant:"filled",icon:(0,Tve.jsx)(oo,{size:16,color:"inherit"}),children:"Reconnecting\u2026"})})}var _v=E($(),1);function Kkr({socket:e,onViewLaunchedSession:t}){return(0,_v.jsxs)(_v.Fragment,{children:[(0,_v.jsx)(Bwr,{}),(0,_v.jsx)(qkr,{launchers:{onCreate:e.createSession,onCreateDesign:e.createDesignSession,onCreateHarness:e.createHarnessSession,onCreateAssist:e.createAssistSession}}),(0,_v.jsx)(Ykr,{reconnecting:e.reconnecting}),(0,_v.jsx)(Ql,{error:e.error,onClose:e.clearError}),(0,_v.jsx)($wr,{notice:e.success,onClose:e.clearSuccess,onView:t})]})}var Ev=E(fe(),1);var jni=6e4;function Yni(e,t,r){return t.map(n=>e.find(i=>i.name===n)??{name:n,local:n===r,loading:!0})}function Xkr(e){let t=e.nodes?.local,r=e.names.join(`
|
|
4023
4023
|
`),[n,i]=(0,Ev.useState)([]),o=(0,Ev.useRef)(0),a=(0,Ev.useCallback)(()=>{let l=r?r.split(`
|
|
4024
4024
|
`):[];if(l.length===0)return;let u=++o.current;i(f=>Yni(f,l,t));for(let f of l)h1e(f,f===t).then(d=>{u===o.current&&i(h=>h.map(p=>p.name===f?d:p))})},[r,t]);(0,Ev.useEffect)(()=>{a();let l=setInterval(a,jni);return()=>clearInterval(l)},[a]);let s=n.length===0;return(0,Ev.useMemo)(()=>({entries:n,loading:s,refresh:a}),[n,s,a])}var N_=E($(),1);function Zkr({shell:e,children:t}){let{socket:r,selection:n,launch:i,sidebarCollapse:o}=e,a=Xkr(r.nodeSelection);return(0,N_.jsx)(MWe.Provider,{value:a,children:(0,N_.jsx)(Awe.Provider,{value:o,children:(0,N_.jsx)(cU.Provider,{value:n,children:(0,N_.jsx)(ZWe.Provider,{value:r.nodeSelection,children:(0,N_.jsx)(gf.Provider,{value:n.selectedNode,children:(0,N_.jsx)(yze.Provider,{value:i,children:(0,N_.jsx)(kit,{children:t})})})})})})})}var Qkr=E($(),1),Jkr=ut((0,Qkr.jsx)("path",{d:"M20 18c1.1 0 1.99-.9 1.99-2L22 6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2H0v2h24v-2zM4 6h16v10H4z"}),"Computer");var e_r=E(fe(),1);var D0=E($(),1),Kni={ml:1,textTransform:"none",fontSize:12};function t_r(){let{nodes:e,names:t,visible:r,selected:n,select:i}=Ec(),[o,a]=(0,e_r.useState)(null);return!r||!e||!n?null:(0,D0.jsxs)(D0.Fragment,{children:[(0,D0.jsx)(Dt,{size:"small",color:"inherit",startIcon:(0,D0.jsx)(Jkr,{fontSize:"small"}),"aria-label":"Machine","aria-haspopup":"menu",onClick:s=>a(s.currentTarget),sx:Kni,children:(0,D0.jsx)(RX,{nodes:e,name:n})}),(0,D0.jsx)(Os,{anchorEl:o,open:!!o,onClose:()=>a(null),children:t.map(s=>(0,D0.jsx)(dn,{selected:s===n,onClick:()=>{i(s),a(null)},sx:{fontSize:13},children:(0,D0.jsx)(RX,{nodes:e,name:s,showVersion:!0})},s))})]})}var LX=E(fe(),1);function r_r(e,t){return[...e[0].slice(0,-1),String(t+1)]}var Sve=E($(),1);function n_r({index:e,label:t,...r}){let{chords:n}=jn("navTab");return(0,Sve.jsx)(lr,{describeChild:!0,title:(0,Sve.jsx)(Nu,{label:t,chords:[r_r(n,e)]}),children:(0,Sve.jsx)(Qv,{label:t,...r})})}var xGe=E(fe(),1);function i_r(e,t){let{bound:r}=jn("navTab"),n=e.length,i=(0,xGe.useCallback)(a=>(bU(a,r)??n)<n,[r,n]),o=(0,xGe.useCallback)(a=>{let s=e[bU(a,r)??-1];s&&t(s)},[e,t,r]);Eo(i,o)}var Cve=E(fe(),1);function o_r(){let[e,t]=(0,Cve.useState)(!1);return(0,Cve.useEffect)(()=>{let r=!1;return(async()=>{try{let i=await(await fetch("/api/news/nav")).json();r||t(i?.showInNav===!0)}catch{r||t(!1)}})(),()=>{r=!0}},[]),e}var wve=E(fe(),1);async function Xni(e,t){let r=await fetch(jr(`/api/releases/configured?cwd=${encodeURIComponent(e)}`,t));return r.ok?(await r.json())?.configured===!0:void 0}function a_r(e){let[t,r]=(0,wve.useState)(null),n=yr(),i=`${n??""}\0${e}`;return(0,wve.useEffect)(()=>{if(!e)return;let o=!1;return Xni(e,n).catch(()=>{}).then(a=>{o||r({key:i,configured:a})}),()=>{o=!0}},[e,n,i]),t?.key===i?t.configured:void 0}var s_r=E(fe(),1);function l_r(e){let{pathname:t}=Uo(),r=Ni(),n=t==="/releases"||t.startsWith("/releases/");(0,s_r.useEffect)(()=>{e===!1&&n&&r("/sessions",{replace:!0})},[e,n,r])}var Zni={path:"/sessions",label:"Sessions"},Qni={path:"/backlog",label:"Backlog"},Jni={path:"/next",label:"Next"},eii={path:"/releases",label:"Releases"},tii={path:"/news",label:"News"};function c_r(e,t){return[Zni,Qni,Jni,...e?[eii]:[],...t?[tii]:[]]}var TGe=E($(),1),rii={mx:"6px"};function u_r({cwd:e}){let t=Uo(),r=Ni(),n=a_r(e),i=o_r();l_r(n);let o=n===!0,a=(0,LX.useMemo)(()=>c_r(o,i),[o,i]),s=(0,LX.useMemo)(()=>a.map(f=>f.path),[a]),l=a.findIndex(f=>t.pathname.startsWith(f.path)),u=(0,LX.useCallback)(f=>{t.pathname!==f&&r(f)},[t.pathname,r]);return i_r(s,u),(0,TGe.jsx)(N5,{sx:rii,value:l===-1?!1:l,textColor:"inherit",indicatorColor:"secondary",children:a.map((f,d)=>(0,TGe.jsx)(n_r,{index:d,label:f.label,onClick:()=>u(f.path)},f.path))})}var MX=E($(),1),nii={ml:.75,bgcolor:"primary.main",color:"primary.contrastText",transition:"filter 0.2s ease, transform 0.2s ease","& .MuiSvgIcon-root":{fontSize:18},"&:hover":{bgcolor:"primary.main",filter:"brightness(1.08)"},"&:active":{transform:"translateY(1px)"}};function f_r(){let[,e]=Wc(),{label:t,chords:r}=jn("newSession");return(0,MX.jsx)(lr,{title:(0,MX.jsx)(Nu,{label:t,chords:r}),children:(0,MX.jsx)(ar,{sx:nii,"aria-label":"New session",onClick:()=>e(i=>(i.set("new",""),i),{replace:!0}),children:(0,MX.jsx)(OS,{})})})}var kve=E(fe(),1);var IX=E($(),1),iii={strokeWidth:2};function d_r(e){return(0,IX.jsxs)(r0e,{viewBox:"0 0 24 24",sx:iii,...e,children:[(0,IX.jsx)("path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 3.5c-.3 1.15-.3 2.35 0 3.5A5.4 5.4 0 0 0 4 10.5c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4"}),(0,IX.jsx)("path",{d:"M9 18c-4.51 2-5-2-7-2"})]})}var DX=E($(),1);function h_r({cwd:e}){let[t,r]=(0,kve.useState)(null),n=yr();return(0,kve.useEffect)(()=>{if(!e){r(null);return}let i=!1;return(async()=>{try{let a=await(await fetch(jr(`/api/github-url?cwd=${encodeURIComponent(e)}`,n))).json();i||r(a?.url??null)}catch{i||r(null)}})(),()=>{i=!0}},[e,n]),t?(0,DX.jsx)(lr,{title:"Open in GitHub",children:(0,DX.jsx)(J,{component:"span",sx:n0e,children:(0,DX.jsx)(ar,{onClick:()=>window.open(t,"_blank"),children:(0,DX.jsx)(d_r,{})})})}):null}var N0=E($(),1),oii={color:"inherit",mr:1.5};function p_r({reconnecting:e}){let{pending:t,error:r,clearError:n,restart:i}=d_("webserver",e);return(0,N0.jsxs)(N0.Fragment,{children:[(0,N0.jsx)(lr,{title:"Restart web server",children:(0,N0.jsx)("span",{children:(0,N0.jsx)(ar,{sx:oii,disabled:t,onClick:i,children:t?(0,N0.jsx)(oo,{size:24}):(0,N0.jsx)(f1e,{})})})}),(0,N0.jsx)(Ql,{error:r,onClose:n})]})}var y_r=E(fe(),1);var m_r=E(fe(),1);function g_r(e){let t=Xn().palette.primary.main;Eo(jn("focusRepoPicker").matches,(0,m_r.useCallback)(()=>Kl({locate:()=>e.current?.querySelector("button")??null,focus:r=>r.focus()},t),[e,t]))}var NX=E($(),1),aii={width:240,ml:2};function v_r({repos:e,selected:t,onSelect:r}){let n=(0,y_r.useRef)(null);g_r(n);let{chords:i}=jn("focusRepoPicker");return(0,NX.jsx)(J,{ref:n,sx:aii,children:(0,NX.jsx)(e0e,{label:t?gv(t):"Select repo...",tooltip:(0,NX.jsx)(Nu,{label:"Repo",chords:i}),typeToOpen:!0,children:(o,a)=>(0,NX.jsx)(zTr,{repos:e,selected:t,onSelect:r,close:o,initialFilter:a})})})}var R_r=E(fe(),1);var OX=E(fe(),1);function _ve(e){let[t,r]=(0,OX.useState)([]),[n,i]=(0,OX.useState)(!0),o=yr();return(0,OX.useEffect)(()=>{if(!e){r([]),i(!1);return}let a=!1;return i(!0),fetch(jr(`/api/pr-list?cwd=${encodeURIComponent(e)}`,o)).then(s=>s.json()).then(s=>{a||(r(Array.isArray(s?.prs)?s.prs:[]),i(!1))}).catch(()=>{a||(r([]),i(!1))}),()=>{a=!0}},[e,o]),{prs:t,loading:n}}var SGe=E($(),1);function CGe({text:e}){return(0,SGe.jsx)(J,{sx:{p:1.5},children:(0,SGe.jsx)(Me,{sx:{fontSize:13,color:"text.secondary"},children:e})})}var r6=E($(),1);function b_r({pr:e,highlighted:t,onHover:r,onPick:n}){let i=V1e(t);return(0,r6.jsx)(dn,{ref:i,selected:t,onMouseDown:o=>o.preventDefault(),onMouseEnter:r,onClick:()=>n(e),sx:{alignItems:"flex-start",py:.75,whiteSpace:"normal"},children:(0,r6.jsxs)(Lt,{spacing:.25,sx:{minWidth:0},children:[(0,r6.jsxs)(Me,{sx:{fontSize:13,lineHeight:1.3,fontWeight:500},children:[e.title,e.isDraft&&(0,r6.jsx)(qn,{label:"Draft",size:"small",variant:"outlined",sx:{ml:.75,height:18,fontSize:10,verticalAlign:"middle"}})]}),(0,r6.jsxs)(Me,{sx:{fontSize:11,color:"text.secondary"},children:["#",e.number," \xB7 ",e.author," \xB7 ",_o(e.createdAt)]})]})})}var wGe=E($(),1);function x_r({prs:e,highlight:t,onHighlight:r,onPick:n}){return(0,wGe.jsx)(zp,{dense:!0,disablePadding:!0,sx:{maxHeight:200,overflowY:"auto"},children:e.map((i,o)=>(0,wGe.jsx)(b_r,{pr:i,highlighted:o===t,onHover:()=>r(o),onPick:n},i.number))})}var S_r=E(fe(),1);function T_r(e,t){let r=t.trim().toLowerCase();if(!r)return e;let n=r.replace(/^#/,"");return e.filter(i=>i.title.toLowerCase().includes(r)||i.author.toLowerCase().includes(r)||n!==""&&String(i.number).includes(n))}function C_r(e,t,r){let[n,i]=(0,S_r.useState)(""),o=T_r(e,n),{highlight:a,setHighlight:s,onKeyDown:l}=x_(o,n,t,r);return{filter:n,setFilter:i,filtered:o,highlight:a,setHighlight:s,onKeyDown:l,select:f=>{t(f),r()}}}var O_=E($(),1),w_r={...$B,left:"auto",width:320,maxHeight:"none",overflowY:"visible"};function k_r({cwd:e,onPick:t,close:r}){let{prs:n,loading:i}=_ve(e),o=C_r(n,t,r);return i||n.length===0?(0,O_.jsx)(tn,{elevation:4,sx:w_r,children:(0,O_.jsx)(CGe,{text:i?"Loading open PRs\u2026":"No open PRs"})}):(0,O_.jsxs)(tn,{elevation:4,sx:w_r,children:[(0,O_.jsx)(SS,{autoFocus:!0,value:o.filter,onChange:o.setFilter,onKeyDown:o.onKeyDown,placeholder:"Filter PRs..."}),o.filtered.length===0?(0,O_.jsx)(CGe,{text:"No PRs match"}):(0,O_.jsx)(x_r,{prs:o.filtered,highlight:o.highlight,onHighlight:o.setHighlight,onPick:o.select})]})}var E_r=E($(),1);function __r({cwd:e,onPick:t,close:r}){return(0,E_r.jsx)(k_r,{cwd:e,onPick:t,close:r})}var B_=E($(),1);function A_r({cwd:e,disabled:t,onSelect:r}){let{prs:n,loading:i}=_ve(e),[o,a]=(0,R_r.useState)(null);return i||n.length===0?null:(0,B_.jsxs)(B_.Fragment,{children:[(0,B_.jsx)(e0e,{label:"prs",disabled:t,children:s=>(0,B_.jsx)(__r,{cwd:e,onPick:a,close:s})}),o&&(0,B_.jsx)(Age,{pr:o,onSelect:s=>{r(o,s),a(null)},onCancel:()=>a(null)})]})}var L_r=E($(),1);function P_r({onStartRun:e,cwd:t}){let r=Kge(t);return!t||r.length===0?null:(0,L_r.jsx)(jge,{runs:r,onSelect:n=>e(n,t)})}var BX=E($(),1);function M_r({onCreateAssist:e,onStartRun:t}){let{selectedCwd:r,selectedNode:n}=Fn();return(0,BX.jsxs)(Lt,{direction:"row",spacing:.5,sx:{alignItems:"center","&:not(:empty)":{ml:2}},children:[(0,BX.jsx)(A_r,{cwd:r,disabled:!r,onSelect:(i,o)=>e([...o,String(i.number)],r,{...CB(i),node:n})}),(0,BX.jsx)(P_r,{onStartRun:(i,o)=>t(i,o,void 0,void 0,n),cwd:r})]})}var kp=E($(),1),sii={minHeight:48,pl:1,pr:14};function I_r({socket:e,selection:t}){let{collapsed:r,onToggleCollapsed:n}=NS();return(0,kp.jsxs)(D5,{variant:"dense",disableGutters:!0,sx:sii,children:[r&&(0,kp.jsx)(Dre,{collapsed:r,onToggleCollapsed:n}),(0,kp.jsx)(p_r,{reconnecting:e.reconnecting}),(0,kp.jsx)(u_r,{cwd:t.selectedCwd}),(0,kp.jsx)(t_r,{}),(0,kp.jsx)(v_r,{repos:t.repos,selected:t.selectedCwd,onSelect:t.setSelectedCwd}),(0,kp.jsxs)(J,{sx:{display:"flex",alignItems:"center",ml:1},children:[(0,kp.jsx)(i0e,{cwd:t.selectedCwd}),(0,kp.jsx)(h_r,{cwd:t.selectedCwd}),(0,kp.jsx)(f_r,{})]}),(0,kp.jsx)(M_r,{onCreateAssist:e.createAssistSession,onStartRun:e.startRun})]})}var Eve=E(fe(),1);function D_r(){let[e,t]=(0,Eve.useState)(null);return(0,Eve.useEffect)(()=>{let r=!1;return(async()=>{try{let i=await(await fetch("/api/health")).json();!r&&typeof i?.nodeName=="string"&&t(i.nodeName)}catch{}})(),()=>{r=!0}},[]),e}var O_r=E($(),1),lii={lineHeight:"32px",bgcolor:"transparent"};function N_r(){let e=D_r();return e?(0,O_r.jsx)($xe,{sx:lii,children:e}):null}var B_r=E($(),1),F_r=ut((0,B_r.jsx)("path",{d:"M20 5H4c-1.1 0-1.99.9-1.99 2L2 17c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2m-9 3h2v2h-2zm0 3h2v2h-2zM8 8h2v2H8zm0 3h2v2H8zm-1 2H5v-2h2zm0-3H5V8h2zm9 7H8v-2h8zm0-4h-2v-2h2zm0-3h-2V8h2zm3 3h-2v-2h2zm0-3h-2V8h2z"}),"Keyboard");var $_r=E($(),1),z_r=ut((0,$_r.jsx)("path",{d:"m12 16.5 4-4h-3v-9h-2v9H8zm9-13h-6v1.99h6v14.03H3V5.49h6V3.5H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2v-14c0-1.1-.9-2-2-2"}),"SystemUpdateAlt");var H_r=E($(),1),U_r=ut((0,H_r.jsx)("path",{d:"M20 8.69V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20v-4.69L23.31 12zM12 18c-.89 0-1.74-.2-2.5-.55C11.56 16.5 13 14.42 13 12s-1.44-4.5-3.5-5.45C10.26 6.2 11.11 6 12 6c3.31 0 6 2.69 6 6s-2.69 6-6 6"}),"Brightness4");var W_r=E($(),1),G_r=ut((0,W_r.jsx)("path",{d:"M20 8.69V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20v-4.69L23.31 12zM12 18c-3.31 0-6-2.69-6-6s2.69-6 6-6 6 2.69 6 6-2.69 6-6 6m0-10c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4"}),"Brightness7");var kGe=E($(),1);function V_r({mode:e}){return e==="dark"?(0,kGe.jsx)(G_r,{fontSize:"small"}):(0,kGe.jsx)(U_r,{fontSize:"small"})}var q_r=E($(),1),j_r=ut((0,q_r.jsx)("path",{d:"m20.38 8.57-1.23 1.85a8 8 0 0 1-.22 7.58H5.07A8 8 0 0 1 15.58 6.85l1.85-1.23A10 10 0 0 0 3.35 19a2 2 0 0 0 1.72 1h13.85a2 2 0 0 0 1.74-1 10 10 0 0 0-.27-10.44zm-9.79 6.84a2 2 0 0 0 2.83 0l5.66-8.49-8.49 5.66a2 2 0 0 0 0 2.83"}),"Speed");var h$=E($(),1);function Y_r(){let e=Bge();return(0,h$.jsxs)(dn,{onClick:()=>Vmt(!e),children:[(0,h$.jsx)(HT,{children:(0,h$.jsx)(j_r,{fontSize:"small"})}),(0,h$.jsx)($p,{children:e?"Hide render HUD":"Show render HUD"})]})}var fl=E($(),1);function K_r({mode:e,restartLabel:t,updateLabel:r,onToggleColorMode:n,onShowShortcuts:i,onRestart:o,onUpdate:a}){return[(0,fl.jsxs)(dn,{onClick:n,children:[(0,fl.jsx)(HT,{children:(0,fl.jsx)(V_r,{mode:e})}),(0,fl.jsx)($p,{children:"Toggle dark mode"})]},"color-mode"),(0,fl.jsx)(Y_r,{},"render-hud"),(0,fl.jsxs)(dn,{onClick:i,children:[(0,fl.jsx)(HT,{children:(0,fl.jsx)(F_r,{fontSize:"small"})}),(0,fl.jsx)($p,{children:"Keyboard shortcuts"})]},"shortcuts"),(0,fl.jsx)(qi,{},"restart-divider"),(0,fl.jsxs)(dn,{onClick:o,children:[(0,fl.jsx)(HT,{children:(0,fl.jsx)(qL,{fontSize:"small"})}),(0,fl.jsx)($p,{children:t})]},"restart"),(0,fl.jsxs)(dn,{onClick:a,children:[(0,fl.jsx)(HT,{children:(0,fl.jsx)(z_r,{fontSize:"small"})}),(0,fl.jsx)($p,{children:r})]},"update")]}var X_r=E(fe(),1);var Q_r=E($(),1);function Z_r({peer:e,onRestart:t,onClose:r}){let[n,i]=(0,X_r.useState)(!1);return(0,Q_r.jsx)(bi,{title:`Restart ${e}?`,message:`Restarts the sessions daemon and web server on ${e}. Its sessions resume when the daemon is back. This page stays open.`,confirmLabel:"Restart",busy:n,autoFocusConfirm:!0,onConfirm:()=>{i(!0),t(e).finally(r)},onCancel:r})}function J_r(e){let t=new Map;for(let r of e){let n=t.get(r.group)??[];n.push(r),t.set(r.group,n)}return[...t].map(([r,n])=>({name:r,shortcuts:n}))}var cii=Object.keys(HL);function e5r(){let e=UL();return J_r(cii.map(t=>AS(t,e)))}var _p=E($(),1),uii={display:"flex",alignItems:"center",justifyContent:"space-between",pr:1},fii={display:"flex",alignItems:"center",justifyContent:"space-between",gap:2,py:.5};function t5r({onClose:e}){let t=e5r();return(0,_p.jsxs)(Gl,{open:!0,onClose:e,maxWidth:"xs",fullWidth:!0,"aria-labelledby":"shortcuts-dialog-title",children:[(0,_p.jsxs)(_u,{id:"shortcuts-dialog-title",sx:uii,children:["Keyboard shortcuts",(0,_p.jsx)(ar,{size:"small","aria-label":"Close",onClick:e,children:(0,_p.jsx)(Wo,{fontSize:"small"})})]}),(0,_p.jsx)(ku,{dividers:!0,children:t.map(r=>(0,_p.jsxs)(J,{component:"section",sx:{mb:1.5},children:[(0,_p.jsx)(Me,{variant:"overline",color:"text.secondary",children:r.name}),r.shortcuts.map(n=>(0,_p.jsxs)(J,{sx:fii,children:[(0,_p.jsx)(Me,{variant:"body2",children:n.label}),(0,_p.jsx)(Lt,{direction:"row",spacing:.5,children:(0,_p.jsx)(ure,{chords:n.chords})})]},n.label))]},r.name))})]})}var n6=E($(),1);function r5r({reconnecting:e,onClose:t}){let{pending:r,error:n,clearError:i,restart:o}=d_(FF.target,e);return(0,n6.jsxs)(n6.Fragment,{children:[(0,n6.jsx)(bi,{title:FF.label,message:FF.message,confirmLabel:"Restart",busy:r,autoFocusConfirm:!0,onConfirm:()=>{o()},onCancel:t}),(0,n6.jsx)(Ql,{error:n,onClose:i})]})}var i5r=E($(),1);function dii(e){return e?{title:`Update assist on ${e}?`,message:`This runs 'assist update' on ${e} as a new session, then restarts its web server. This page stays open.`}:{title:"Update assist",message:"This starts a new session running 'assist update'. Its output will appear in the terminal."}}function n5r({peer:e,onConfirm:t,onClose:r}){return(0,i5r.jsx)(bi,{...dii(e),confirmLabel:"Update",onConfirm:()=>{t(),r()},onCancel:r})}var O0=E(fe(),1);async function hii(e){try{let t=await fetch(`/api/node-doctor?link=${encodeURIComponent(e)}`);return t.ok?(await t.json()).hop:null}catch{return null}}async function o5r(e,t){let r=await hii(e);if(!r)return t;let n=r.remediation?` \u2014 ${r.remediation}`:"";return`${t}: ${r.hop} hop failed: ${r.error}${n}`}var yT=E(fe(),1);function a5r(e){let{nodes:t}=Ec(),[r,n]=(0,yT.useState)(null),i=(0,yT.useRef)(!1),o=r?t?.links.find(l=>l.name===r.peer):void 0;(0,yT.useEffect)(()=>{if(!(!r||!o)){if(o.state!=="connected"){i.current=!0;return}i.current&&(n(null),e(r.describe(r.peer,o.peerVersion)))}},[r,o,e]);let a=(0,yT.useCallback)((l,u)=>{i.current=!1,n({peer:l,describe:u})},[]),s=(0,yT.useCallback)(()=>n(null),[]);return{watch:a,stop:s}}var pii=9e4;function Rve(){let[e,t]=(0,O0.useState)(null),[r,n]=(0,O0.useState)(null),i=(0,O0.useRef)(void 0),o=(0,O0.useCallback)(f=>{clearTimeout(i.current),t(f)},[]),{watch:a,stop:s}=a5r(o);(0,O0.useEffect)(()=>()=>clearTimeout(i.current),[]);let l=(0,O0.useCallback)(async(f,d)=>{n(await o5r(f,d))},[]);return{requestThenAwait:(0,O0.useCallback)(async(f,d,h,p)=>{let m;try{m=await h()}catch{}return m?.ok?(a(f,p),clearTimeout(i.current),i.current=setTimeout(()=>{s(),l(f,`${f} did not come back`)},pii),!0):(await l(f,`${d} failed (${await BF(m)})`),!1)},[l,a,s]),back:e,clearBack:()=>t(null),error:r,clearError:()=>n(null)}}var mii=(e,t)=>t?`${e} is back (v${t})`:`${e} is back`;function s5r(){let{requestThenAwait:e,...t}=Rve();return{restart:n=>e(n,`Restart ${n}`,()=>f_("both",n),mii),...t}}var FX=E(fe(),1);var B0=E(fe(),1);function l5r(e){return e.commandType==="assist"&&e.assistArgs?.[0]==="update"&&e.status==="done"}function Ave(e,t,r){let[n,i]=(0,B0.useState)(!1),[o,a]=(0,B0.useState)(!1),s=(0,B0.useRef)(!1),l=(0,B0.useRef)(e);l.current=e;let u=(0,B0.useRef)(new Set),f=(0,B0.useCallback)(()=>{s.current=!1,a(!1),u.current=new Set(l.current.filter(l5r).map(d=>d.id)),i(!0)},[]);return(0,B0.useEffect)(()=>{if(!n||o)return;if(t){s.current=!0;return}if(!s.current)return;e.some(h=>l5r(h)&&h.node===r&&!u.current.has(h.id))&&a(!0)},[n,o,t,e,r]),{arm:f,completed:o}}var c5r=(e,t)=>t?`${e} updated to v${t}`:`${e} updated`;function gii(e){return fetch(`/api/self-update?node=${encodeURIComponent(e)}`,{method:"POST"})}function u5r(e){let{nodes:t}=Ec(),{launchAssist:r}=al(),{requestThenAwait:n,...i}=Rve(),[o,a]=(0,FX.useState)(null),[s,l]=(0,FX.useState)(),u=m=>t?.links.find(g=>g.name===m)?.state,{arm:f,completed:d}=Ave(e,u(s)!=="connected",s);(0,FX.useEffect)(()=>{!d||!s||(l(void 0),n(s,`Restart ${s}'s web server`,()=>f_("webserver",s),c5r))},[d,s,n]);let h=async m=>{a(`Updating assist on ${m}\u2026`),await n(m,`Update ${m}`,()=>gii(m),c5r),a(null)};return{update:m=>{if(u(m)!=="connected"){h(m);return}l(m),f(),r(["update"],void 0,{node:m})},progress:o,...i}}var F0=E($(),1);function f5r({dialog:e,peer:t,sessions:r,reconnecting:n,onClose:i}){let{launchAssist:o,armUpdateReload:a}=al(),s=s5r(),l=u5r(r);return(0,F0.jsxs)(F0.Fragment,{children:[e==="shortcuts"&&(0,F0.jsx)(t5r,{onClose:i}),e==="restart"&&t&&(0,F0.jsx)(Z_r,{peer:t,onRestart:s.restart,onClose:i}),e==="restart"&&!t&&(0,F0.jsx)(r5r,{reconnecting:n,onClose:i}),e==="update"&&(0,F0.jsx)(n5r,{peer:t,onConfirm:()=>{if(t){l.update(t);return}a(),o(["update"])},onClose:i}),(0,F0.jsx)(QK,{notices:s}),(0,F0.jsx)(QK,{notices:l})]})}var d5r=E($(),1),h5r=ut((0,d5r.jsx)("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6"}),"Settings");var p5r=E(fe(),1);var $X=E($(),1);function m5r(){let e=Ni(),t=(0,p5r.useCallback)(()=>e("/config"),[e]),{matches:r,chords:n}=jn("openConfig");return Eo(r,t),(0,$X.jsx)(lr,{describeChild:!0,title:(0,$X.jsx)(Nu,{label:"Config",chords:n}),children:(0,$X.jsx)(ar,{size:"small",sx:{color:"inherit"},"aria-label":"Config",onClick:t,children:(0,$X.jsx)(h5r,{fontSize:"small"})})})}var g5r=E($(),1),y5r=ut((0,g5r.jsx)("path",{d:"M3 18h18v-2H3zm0-5h18v-2H3zm0-7v2h18V6z"}),"Menu");var Pve=E(fe(),1);var zX=E($(),1);function v5r({open:e,onOpen:t}){let r=(0,Pve.useRef)(null),{matches:n,chords:i}=jn("openMenu");return Eo(n,(0,Pve.useCallback)(()=>{r.current&&t(r.current)},[t])),(0,zX.jsx)(lr,{describeChild:!0,title:(0,zX.jsx)(Nu,{label:"Menu",chords:i}),children:(0,zX.jsx)(ar,{ref:r,onClick:o=>t(o.currentTarget),size:"small",sx:{color:"inherit"},"aria-label":"Open menu","aria-haspopup":"true","aria-expanded":e?"true":void 0,children:(0,zX.jsx)(y5r,{fontSize:"small"})})})}var HX=E($(),1);function b5r({open:e,onOpen:t}){return(0,HX.jsxs)(J,{sx:{position:"fixed",top:8,right:16,zIndex:r=>r.zIndex.drawer+2,display:"flex",alignItems:"center",gap:.5,color:"inherit"},children:[(0,HX.jsx)(m5r,{}),(0,HX.jsx)(v5r,{open:e,onOpen:t})]})}var i6=E(fe(),1);var T5r=E(fe(),1);var x5r=!0,yii=new Set(["openMenu","cycleCards"]),vii=Object.keys(HL).filter(e=>!yii.has(e));function S5r(e,t){let r=UL();(0,T5r.useEffect)(()=>{if(!e)return;let n=i=>{vii.some(o=>AS(o,r).matches(i))&&t()};return globalThis.addEventListener("keydown",n,x5r),()=>globalThis.removeEventListener("keydown",n,x5r)},[e,t,r])}function C5r(){let[e,t]=(0,i6.useState)(null),[r,n]=(0,i6.useState)(!0),i=!!e,o=(0,i6.useCallback)(()=>t(null),[]),a=(0,i6.useCallback)(s=>{n(!0),t(s)},[]);return S5r(i,(0,i6.useCallback)(()=>{n(!1),t(null)},[])),{anchorEl:e,open:i,close:o,openAt:a,restoreFocus:r}}var UX=E(fe(),1);function w5r(e){Eo(jn("shortcutsSheet").matches,e)}function k5r(){let[e,t]=(0,UX.useState)(null);w5r((0,UX.useCallback)(()=>t("shortcuts"),[]));let r=(0,UX.useCallback)(()=>t(null),[]);return{dialog:e,showDialog:t,closeDialog:r}}function _5r(){let{nodes:e,selected:t}=Ec();return e&&t&&t!==e.local?t:void 0}function E5r(e){return{restartLabel:e?`Restart ${e}`:FF.label,updateLabel:e?`Update assist on ${e}`:"Update assist"}}var vT=E($(),1);function R5r({mode:e,toggle:t,sessions:r,reconnecting:n}){let{anchorEl:i,open:o,close:a,openAt:s,restoreFocus:l}=C5r(),{dialog:u,showDialog:f,closeDialog:d}=k5r(),h=_5r(),p=m=>()=>{a(),f(m)};return(0,vT.jsxs)(vT.Fragment,{children:[(0,vT.jsx)(b5r,{open:o,onOpen:s}),(0,vT.jsxs)(Os,{anchorEl:i,open:o,onClose:a,disableRestoreFocus:!l,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:[(0,vT.jsx)(N_r,{}),K_r({mode:e,...E5r(h),onToggleColorMode:()=>{t(),a()},onShowShortcuts:p("shortcuts"),onRestart:p("restart"),onUpdate:p("update")})]}),(0,vT.jsx)(f5r,{dialog:u,peer:h,sessions:r,reconnecting:n,onClose:d})]})}var L5r=E(fe(),1);var P5r=E($(),1);function A5r({conflict:e,onConfirm:t,onCancel:r}){let{name:n,cwd:i,port:o,group:a}=e.existing,s=rm(i),l=o?` on port ${o}`:"",u=s?` in ${s}`:"",f=a?`, holding the ${a} server slot`:"";return(0,P5r.jsx)(bi,{title:a?`Replace the ${a} server?`:"Replace running server?",message:`"${n}" is already serving${l}${u}${f}. Replace it \u2014 stop the running server and start this one?`,confirmLabel:"Replace",confirmColor:"error",onConfirm:t,onCancel:r})}var Lve=E($(),1);function M5r({socket:e,children:t}){let{serverConflict:r,clearServerConflict:n,retrySession:i,stopSession:o,startRun:a,discardSession:s}=e,l=(0,L5r.useMemo)(()=>({onStop:o,onStart:a,onDiscard:s}),[o,a,s]),u=()=>{r&&(r.runName?a(r.runName,r.cwd,!0,r.launchedFrom,r.node):r.sessionId&&i(r.sessionId,!0),n())};return(0,Lve.jsxs)(Twe.Provider,{value:l,children:[t,r&&(0,Lve.jsx)(A5r,{conflict:r,onConfirm:u,onCancel:n})]})}var I5r=new Map;function D5r(e,t){if(!xie())return;let r=I5r.get(e);if(I5r.set(e,t),!!r)for(let[n,i]of Object.entries(t))Object.is(i,r[n])||Cy(`\u0394 ${e}.${n}`)}var Ive=E(fe(),1);function N5r(e,t,r){if(!t)return null;let n=e[t];if(!n)return null;let i=r.find(o=>o.id===n);return!i||nm(i)!==t?null:n}function Rv(e,t,r){if(e)return t.find(n=>n.id===e)??r.find(n=>n.sessionId===e)}function Mve(){let{pathname:e}=Uo();return e.startsWith("/backlog")||e.startsWith("/usage")}function O5r({selectedCwd:e,selectedCardId:t,sessions:r,history:n,activeByRepo:i,onSelect:o}){let a=Rv(t,r,n),s=a&&nm(a),l=!!(s&&s===e),u=N5r(i,e,r),f=(0,Ive.useRef)(t),d=Mve();(0,Ive.useEffect)(()=>{let h=f.current!==t&&!!s;f.current=t,!(d||h||l||!u)&&o(u)},[t,s,l,u,o,d])}var Ove=E(fe(),1);function B5r(e,t,r,n){return Rv(e,t,r)?.cwd||n}function F5r(e,t,r,n){let i=B5r(e,t,r,n.cwd),o=Rv(e,t,r);return{cwd:i,node:o?.cwd?o.node:n.node}}var _Ge=E(fe(),1);function $5r(e,t,r){let{cwd:n,node:i,origin:o}=r,a=(0,_Ge.useCallback)((l,u)=>{let f=fT(u,t),d=bX(e,l);return d?d.clones[f]:f===(l===n?i:wp)?l:void 0},[e,t,n,i]),s=(0,_Ge.useCallback)(l=>bX(e,l)?.origin??(l===n?o:void 0),[e,n,o]);return{cloneOn:a,originOf:s}}var Dve=E(fe(),1);function z5r(e,t,r,n){let i=(0,Dve.useRef)(e);(0,Dve.useEffect)(()=>{if(i.current===e)return;i.current=e;let o=bX(t,r)?.clones[e];o&&n(o,e)},[e,t,r,n])}var p$=E(fe(),1);function H5r(e,t,r){if(t.node!==void 0)return t.node;let n=new Set(e.flatMap(i=>Object.entries(i.clones).filter(([,o])=>o===t.cwd).map(([o])=>o)));return n.has(r)?r:n.size===0||n.has(wp)?wp:[...n][0]}function U5r(e,t,r,n){let[i,o]=(0,p$.useState)({cwd:e}),a=(0,p$.useCallback)((l,u,f)=>o({cwd:l,node:u,origin:f}),[]);(0,p$.useEffect)(()=>{e&&!i.cwd&&o({cwd:e})},[e,i.cwd]);let s=H5r(t,{cwd:i.cwd,node:i.node===void 0?void 0:fT(i.node,n)},r);return{selectedCwd:i.cwd,selectedNode:s||void 0,selectedPick:{cwd:i.cwd,node:s,origin:i.origin},setSelectedCwd:a}}var W5r=E(fe(),1);function Nve(e,t,r){let n=Rv(e,t,r);return n&&nm(n)}function G5r(e,t,r,n){let i=Nve(e,t,r),o=Rv(e,t,r),a=o?.node??wp,s=o?.repoGroup?.origin;(0,W5r.useEffect)(()=>{i&&n(i,a,s)},[i,a,s,n])}function V5r(e,t,r,n,i){let o=i.nodes?.local,a=fT(i.selected,o),s=(0,Ove.useMemo)(()=>dSr(e,t),[e,t]),{selectedCwd:l,selectedNode:u,selectedPick:f,setSelectedCwd:d}=U5r(e,s,a,o);G5r(r,n,t,d),z5r(a,s,l,d);let{cloneOn:h,originOf:p}=$5r(s,o,f),m=(0,Ove.useMemo)(()=>s.map(v=>hSr(v,a)),[s,a]),{cwd:g,node:y}=F5r(r,n,t,{cwd:l,node:u});return(0,Ove.useMemo)(()=>({repos:m,selectedCwd:l,selectedNode:u,worktreeCwd:g,worktreeNode:y,setSelectedCwd:d,cloneOn:h,originOf:p}),[m,l,u,g,y,d,h,p])}var Fve=E(fe(),1);var F_=E(fe(),1);var q5r=E(fe(),1),Bve="assist:reloaded-after-update";function j5r(e){(0,q5r.useEffect)(()=>{globalThis.sessionStorage?.getItem(Bve)&&(globalThis.sessionStorage.removeItem(Bve),e({message:"Reloaded after updating assist",sessionId:null}))},[e])}function Y5r(e,t,r,n){let{arm:i,completed:o}=Ave(e,t),a=(0,F_.useRef)(!1),s=(0,F_.useCallback)(()=>{globalThis.sessionStorage?.setItem(Bve,"1")},[]),{error:l,restart:u}=d_("webserver",t,s);return j5r(r),(0,F_.useEffect)(()=>{l&&n(l)},[l,n]),(0,F_.useEffect)(()=>{!o||a.current||(a.current=!0,u())},[o,u]),{armUpdateReload:(0,F_.useCallback)(()=>{a.current=!1,i()},[i])}}function K5r(e){let{armUpdateReload:t}=Y5r(e.sessions,e.reconnecting,e.setSuccess,e.setError),r=py(e.selectSession),n=(0,Fve.useMemo)(()=>({launchAssist:e.createAssistSession,launchAgentInStream:e.createSessionInStream,resumeSession:e.resumeSession,armUpdateReload:t,activateSession:r,sendInput:e.sendInput}),[e.createAssistSession,e.createSessionInStream,e.resumeSession,t,r,e.sendInput]),i=Ni(),o=(0,Fve.useCallback)(a=>{e.selectSession(a),i("/sessions"),e.clearSuccess()},[i,e.selectSession,e.clearSuccess]);return{launch:n,viewLaunchedSession:o}}var X5r=E(fe(),1);function Z5r(e,t,r,n){let i=Nve(e,t,r);(0,X5r.useEffect)(()=>{e&&i&&n({type:"set-active",cwd:i,sessionId:e})},[e,i,n])}var $ve=E(fe(),1);function Q5r(e,t){let r=(0,$ve.useRef)(new Map);(0,$ve.useEffect)(()=>{let n=new Set;for(let{id:i,status:o}of e)n.add(i),r.current.get(i)!==o&&(r.current.set(i,o),console.debug(`[sessions] render session ${i} status=${o}`),t({type:"ui-status",sessionId:i,status:o}));for(let i of r.current.keys())n.has(i)||r.current.delete(i)},[e,t])}var m$=E(fe(),1),J5r="assist.sessions.node";function bii(){try{return localStorage.getItem(J5r)}catch{return null}}function xii(e){try{localStorage.setItem(J5r,e)}catch{}}function eEr(e){let[t,r]=(0,m$.useState)(bii),n=(0,m$.useCallback)(i=>{r(i),xii(i)},[]);return(0,m$.useMemo)(()=>{let i=e?[e.local,...e.links.map(o=>o.name)]:[];return{nodes:e,names:i,visible:i.length>1,selected:t&&i.includes(t)?t:e?.local,select:n}},[e,t,n])}var rEr=E(fe(),1);function tEr(e){let t=e;if(t.type==="create")return{cwd:t.cwd,title:t.prompt?.trim()||(t.design?"New design session":"New session"),node:t.node};if(t.type==="create-assist"){let r=t.title?.trim();return{cwd:t.cwd,title:r||"New session",named:!!r,node:t.node}}return null}function nEr(e,t){return(0,rEr.useCallback)(r=>{let n=e.current;n?.readyState===WebSocket.OPEN&&n.send(JSON.stringify(r));let i=tEr(r);i&&t(i)},[e,t])}var Av=E(fe(),1);function zve(e,t,r,n,i){e({type:"create",prompt:r||void 0,cwd:n,...t,...i?{node:i}:{}})}function iEr(e){return(t,r,n)=>zve(e,{design:!0},t,r,n)}function oEr(e){return(t,r,n,i)=>zve(e,{harness:t},r,n,i)}function aEr(e){return(t,r,n)=>zve(e,{auto:!0},t,r,n)}function sEr(e){return(t,r,n)=>e({type:"create-assist",assistArgs:t,cwd:r,...n})}function lEr(e){return(t,r,n,i,o)=>e({type:"resume",sessionId:t,cwd:r,name:n,harness:i,node:o})}function cEr(e,t){return(r,n)=>{t.delete(r),e({type:"retry",sessionId:r,replace:n})}}function uEr(e,t){return r=>{t.delete(r),e({type:"restart",sessionId:r})}}function fEr(e,t){return r=>{e({type:"dismiss",sessionId:r}),t.delete(r)}}function dEr(e,t){return r=>{e({type:"discard",sessionId:r}),t.delete(r)}}function hEr(e){return t=>e({type:"stop",sessionId:t})}function pEr(e){return(t,r,n,i,o)=>e({type:"create-run",runName:t,cwd:r,replace:n,launchedFrom:i,node:o})}function mEr(e){return(t,r)=>e({type:"set-autoapprove",sessionId:t,enabled:r})}function gEr(e){return(t,r)=>e({type:"set-autoadvance",sessionId:t,enabled:r})}function yEr(e){return(t,r)=>e({type:"set-starred",sessionId:t,starred:r})}function vEr(e){return(t,r)=>e({type:"input",sessionId:t,data:r,viewerId:ZK})}function bEr(e){return(t,r,n,i)=>e({type:"resize",sessionId:t,cols:r,rows:n,viewerId:ZK,claim:i==="claim",refresh:i==="refresh"})}function xEr(e){return(t,r,n,i)=>e({type:"pr-decision",sessionId:t,requestId:r,decision:n,...i})}var o6=E(fe(),1);function TEr(e){return(t,r,n)=>e({type:"create",prompt:r||void 0,cwd:n,joinSessionId:t,auto:!0})}function SEr(e){return{createSession:(0,o6.useMemo)(()=>aEr(e),[e]),createSessionInStream:(0,o6.useMemo)(()=>TEr(e),[e]),createDesignSession:(0,o6.useMemo)(()=>iEr(e),[e]),createHarnessSession:(0,o6.useMemo)(()=>oEr(e),[e]),createAssistSession:(0,o6.useMemo)(()=>sEr(e),[e]),resumeSession:(0,o6.useMemo)(()=>lEr(e),[e])}}var WX=E(fe(),1);function CEr(e,t){let r=(0,WX.useCallback)((a,s)=>{cEr(e,t.current)(a,s)},[e,t]),n=(0,WX.useCallback)(a=>{uEr(e,t.current)(a)},[e,t]),i=(0,WX.useCallback)(a=>{fEr(e,t.current)(a)},[e,t]),o=(0,WX.useCallback)(a=>{dEr(e,t.current)(a)},[e,t]);return{retrySession:r,restartSession:n,dismissSession:i,discardSession:o}}function wEr(e,t,r){return(n,i)=>{let o=t.get(n);return o&&(i(o),e({type:"snapshot",sessionId:n})),r.set(n,i),()=>r.delete(n)}}function kEr(e,t,r){let n={...SEr(e),sendInput:(0,Av.useMemo)(()=>vEr(e),[e]),sendResize:(0,Av.useMemo)(()=>bEr(e),[e]),sendPrDecision:(0,Av.useMemo)(()=>xEr(e),[e]),setAutoApprove:(0,Av.useMemo)(()=>mEr(e),[e]),setAutoAdvance:(0,Av.useMemo)(()=>gEr(e),[e]),setStarred:(0,Av.useMemo)(()=>yEr(e),[e]),stopSession:(0,Av.useMemo)(()=>hEr(e),[e]),startRun:(0,Av.useMemo)(()=>pEr(e),[e])},i=(0,Av.useMemo)(()=>wEr(e,t.current,r.current),[e,t,r]);return{...n,...CEr(e,t),onOutput:i}}var GX=E(fe(),1);function _Er(e,t,r){let n=(0,GX.useCallback)(s=>{r(s),e({type:"fetch-transcript",sessionId:s})},[e,r]),i=(0,GX.useCallback)(s=>e({type:"fetch-user-messages",sessionId:s}),[e]),o=(0,GX.useCallback)(()=>{r(null)},[r]),a=(0,GX.useCallback)(s=>{r(null),t(s)},[t,r]);return{viewTranscript:n,fetchUserMessages:i,clearTranscript:o,selectSession:a}}var Gve=E(fe(),1);function EEr(e,t){let r=new Set(t.map(i=>i.id)),n=null;for(let i of Object.values(e))r.has(i)&&(n=i);return n}var g$=E(fe(),1);function REr(){let[e,t]=(0,g$.useState)(null),r=(0,g$.useRef)(e);r.current=e;let n=(0,g$.useCallback)(()=>r.current,[]);return{activeId:e,setActiveId:t,getActiveId:n}}var PEr=E(fe(),1);function AEr(e,t,r=null){return t!==null?e.some(n=>n.id===t)?t:e[0]?.id??null:r&&e.some(n=>n.id===r)?r:e[0]?.id??null}function LEr(e,t,r){let n=Mve();(0,PEr.useEffect)(()=>{if(n){t(null);return}t(i=>AEr(e,i,r))},[e,t,r,n])}var Hve=E(fe(),1);function MEr(){let[e,t]=(0,Hve.useState)({}),[r,n]=(0,Hve.useState)(null),[i,o]=(0,Hve.useState)(null);return{activeByRepo:e,setActiveByRepo:t,daemonVersion:r,setDaemonVersion:n,nodes:i,setNodes:o}}var $0=E(fe(),1);function IEr(e,t){for(let r of t)clearTimeout(e.get(r)),e.delete(r)}function DEr(e,t){let r=new Set(t.map(n=>n.id));return[...e.keys()].filter(n=>!r.has(n))}function NEr(e,t){if(!t.some(n=>e.has(n)))return e;let r=new Set(e);for(let n of t)r.delete(n);return r}function OEr(e,t){let r=[];for(let n of t){let i=e.get(n.id);i!==void 0&&i!==n.startedAt&&r.push(n.id)}return r}function BEr(e,t){return t.filter(r=>r.commandType==="run"&&e.get(r.id)!==r.startedAt).map(r=>r.id)}var Tii=1500;function FEr(){let[e,t]=(0,$0.useState)(new Set),r=(0,$0.useRef)(new Map),n=(0,$0.useRef)(new Map),i=(0,$0.useCallback)(s=>{t(l=>l.has(s)?l:new Set(l).add(s))},[]),o=(0,$0.useCallback)(s=>{let l=n.current;for(let u of s)clearTimeout(l.get(u)),l.set(u,setTimeout(()=>{l.delete(u),i(u)},Tii))},[i]);(0,$0.useEffect)(()=>{let s=n.current;return()=>{for(let l of s.values())clearTimeout(l)}},[]);let a=(0,$0.useCallback)(s=>{let l=DEr(r.current,s),u=[...OEr(r.current,s),...l],f=BEr(r.current,s);r.current=new Map(s.map(d=>[d.id,d.startedAt])),IEr(n.current,l),u.length&&t(d=>NEr(d,u)),o(f)},[o]);return{initialized:e,markInitialized:i,syncSessions:a}}var $_=E(fe(),1);function $Er(){let[e,t]=(0,$_.useState)(null),[r,n]=(0,$_.useState)(null),[i,o]=(0,$_.useState)(null),a=(0,$_.useCallback)(()=>t(null),[]),s=(0,$_.useCallback)(()=>n(null),[]),l=(0,$_.useCallback)(()=>o(null),[]);return{error:e,setError:t,clearError:a,success:r,setSuccess:n,clearSuccess:s,serverConflict:i,setServerConflict:o,clearServerConflict:l}}var Pv=E(fe(),1);function zEr(e,t){return[...e,{...t,status:"launching"}]}function Uve(e){return e.find(t=>t.status==="launching")}function HEr(e){let t=Uve(e);return t?e.filter(r=>r.id!==t.id):e}function UEr(e,t){let r=Uve(e);return r?EGe(e,r.id,t):e}function EGe(e,t,r){return e.map(n=>n.id===t&&n.status==="launching"?{...n,status:"error",error:r}:n)}function WEr(e,t){return e.filter(r=>r.id!==t)}var GEr=E(fe(),1);var Sii=6e4,Cii="Launch timed out \u2014 the session did not start.";function VEr(e,t){(0,GEr.useEffect)(()=>{let r=e.filter(i=>i.status==="launching");if(r.length===0)return;let n=r.map(i=>setTimeout(()=>t(o=>EGe(o,i.id,Cii)),Math.max(0,Sii-(Date.now()-i.startedAt))));return()=>n.forEach(clearTimeout)},[e,t])}function qEr(){let[e,t]=(0,Pv.useState)([]),r=(0,Pv.useRef)([]),n=(0,Pv.useCallback)(l=>{r.current=l(r.current),t(r.current)},[]),i=(0,Pv.useCallback)(l=>{n(u=>zEr(u,{id:crypto.randomUUID(),startedAt:Date.now(),...l}))},[n]),o=(0,Pv.useCallback)(()=>{let l=Uve(r.current);return n(HEr),l?.named?l.title:void 0},[n]),a=(0,Pv.useCallback)(l=>n(u=>UEr(u,l)),[n]),s=(0,Pv.useCallback)(l=>n(u=>WEr(u,l)),[n]);return VEr(e,n),{pendingLaunches:e,addPendingLaunch:i,resolvePendingLaunch:o,failPendingLaunch:a,dismissPendingLaunch:s}}var VX=E(fe(),1);function jEr(){let[e,t]=(0,VX.useState)(null),[r,n]=(0,VX.useState)({}),i=(0,VX.useCallback)((o,a)=>{o!=="claude"&&n(s=>({...s,[o]:a}))},[]);return{rateLimits:e,setRateLimits:t,harnessRateLimits:r,setHarnessRateLimits:i}}var YEr=E(fe(),1);function KEr(e,t){return(0,YEr.useCallback)(r=>{e(r),t(r)},[e,t])}var RGe=E(fe(),1);function XEr(){let e=(0,RGe.useRef)(new Map),t=(0,RGe.useRef)(new Map);return{buffers:e,handlers:t}}var Wve=E(fe(),1);function ZEr(){let[e,t]=(0,Wve.useState)(null),[r,n]=(0,Wve.useState)(null),[i,o]=(0,Wve.useState)(null);return{transcript:e,setTranscript:t,viewingTranscriptSessionId:r,setViewingTranscriptSessionId:n,userMessages:i,setUserMessages:o}}var z_=E(fe(),1);function QEr(e,t){let r=e.sessionId;t.buffers.current?.delete(r),t.handlers.current?.get(r)?.("\x1Bc")}function JEr(e,t){let r=e.sessionId,n=t.resolvePendingLaunch();e.isNew&&t.getActiveId()!==null||(t.setViewingTranscriptSessionId(null),t.setActiveId(r)),e.isNew&&t.setSuccess({message:n?`Started ${n}`:"New session started",sessionId:r})}function e4r(e,t){let r=e.message;t.setError(r),t.failPendingLaunch(r)}function t4r(e,t){let r=e.rateLimits,n=e.harness;!n||n==="claude"?t.setRateLimits(r):t.setHarnessRateLimits?.(n,r)}function r4r(e,t){t.setNodes({local:e.local,links:e.links??[]})}function n4r(e,t){t.setSuccess({message:e.message,sessionId:null})}function i4r(e,t){let r=e.sessionId,n=t.buffers.current?.get(r)??"";t.buffers.current?.set(r,n+e.data),t.handlers.current?.get(r)?.(e.data),t.markInitialized(r)}function o4r(e,t){t.setServerConflict({existing:e.existing,runName:e.runName,cwd:e.cwd,sessionId:e.sessionId,launchedFrom:e.launchedFrom,node:e.node})}function a4r(e,t){let r=e.sessions;t.setSessions(r),e.cwd&&t.setCurrentCwd(e.cwd),t.setActiveByRepo(e.active??{})}function s4r(e,t){let r=e.sessionId,n=e.data;t.buffers.current?.set(r,n),t.handlers.current?.get(r)?.(`\x1Bc${n}`)}var wii={sessions:a4r,created:JEr,history:(e,t)=>t.setHistory(e.sessions),transcript:(e,t)=>t.setTranscript({sessionId:e.sessionId,messages:e.messages}),"user-messages":(e,t)=>t.setUserMessages({sessionId:e.sessionId,messages:e.messages}),hello:(e,t)=>t.setDaemonVersion(e.version),nodes:r4r,error:e4r,notice:n4r,"run-conflict":o4r,limits:t4r,clear:QEr,output:i4r,snapshot:s4r};function l4r(e,t){wii[e.type]?.(e,t)}function c4r(e,t={}){let r=location.protocol==="https:"?"wss:":"ws:",n=new WebSocket(`${r}//${location.host}/ws`);return n.onopen=()=>{t.onOpen?.(),n.send(JSON.stringify({type:"hello"})),n.send(JSON.stringify({type:"history"}))},n.onmessage=i=>{l4r(JSON.parse(i.data),e)},n.onclose=()=>t.onClose?.(),n}function u4r(e,t,r,n){let i=!1,o,a=0,s=!1,l=()=>{i||t(c4r(e,{onOpen:()=>{s&&r(),s=!1,n(!1),a=0},onClose:()=>{if(i)return;s=!0,n(!0);let u=Math.min(300*2**a,2e3);a+=1,o=setTimeout(l,u)}}))};return l(),()=>{i=!0,o&&clearTimeout(o)}}function f4r(e){let t=(0,z_.useRef)(null),[r,n]=(0,z_.useState)(!1),{handleSessions:i,markInitialized:o,buffers:a,handlers:s}=e;(0,z_.useEffect)(()=>{let u=()=>{a.current?.clear();let d=s.current;if(d)for(let h of d.values())h("\x1Bc")},f=u4r({...e,setSessions:i},d=>{t.current=d},u,n);return()=>{f(),t.current?.close()}},[i,o,a,s]);let l=(0,z_.useCallback)(()=>{let u=t.current;u?.readyState===WebSocket.OPEN&&u.send(JSON.stringify({type:"history"}))},[]);return{wsRef:t,requestHistory:l,reconnecting:r}}function d4r(){let[e,t]=(0,Gve.useState)([]),[r,n]=(0,Gve.useState)([]),{activeId:i,setActiveId:o,getActiveId:a}=REr(),s=MEr(),l=ZEr(),[u,f]=(0,Gve.useState)(""),d=$Er(),h=qEr(),p=jEr(),{initialized:m,markInitialized:g,syncSessions:y}=FEr(),v=XEr(),b=KEr(y,t),{wsRef:x,requestHistory:C,reconnecting:S}=f4r({handleSessions:b,setHistory:n,getActiveId:a,setActiveId:o,...s,...l,setCurrentCwd:f,...d,...h,...p,markInitialized:g,...v});return LEr(e,o,EEr(s.activeByRepo,e)),{sessions:e,history:r,activeId:i,setActiveId:o,...s,...l,currentCwd:u,...d,...h,...p,initialized:m,wsRef:x,...v,requestHistory:C,reconnecting:S}}function h4r(){let e=d4r(),{wsRef:t,buffers:r,handlers:n,addPendingLaunch:i,activeId:o,sessions:a}=e,s=eEr(e.nodes),l=nEr(t,i),u=kEr(l,r,n);Z5r(o,a,e.history,l),Q5r(a,l);let f=_Er(l,e.setActiveId,e.setViewingTranscriptSessionId);return{...e,...u,...f,nodeSelection:s}}var y$=E(fe(),1);var p4r="assist:sidebar-collapsed";function m4r(){let[e,t]=(0,y$.useState)(()=>Qu(p4r).length>0),r=(0,y$.useCallback)(()=>{t(n=>{let i=!n;return Ju(p4r,i?[!0]:[]),i})},[]);return(0,y$.useMemo)(()=>({collapsed:e,onToggleCollapsed:r}),[e,r])}var g4r=E(fe(),1);function y4r(){(0,g4r.useEffect)(()=>{let e=!1;return(async()=>{try{let t=await fetch("/api/hotkeys");if(!t.ok)return;let r=await t.json();e||dE.set(r)}catch{}})(),()=>{e=!0}},[])}function v4r(){let e=h4r(),t=Kme(e),r=V5r(e.currentCwd,e.history,t,e.sessions,e.nodeSelection);O5r({selectedCwd:r.selectedCwd,selectedCardId:t,sessions:e.sessions,history:e.history,activeByRepo:e.activeByRepo,onSelect:e.selectSession});let{launch:n,viewLaunchedSession:i}=K5r(e);y4r();let o=m4r();return D5r("shell",{...e,selection:r,launch:n,sidebarCollapse:o}),{socket:e,selection:r,launch:n,viewLaunchedSession:i,sidebarCollapse:o}}var cg=E($(),1),kii={zIndex:e=>e.zIndex.drawer+1},_ii={minHeight:48};function b4r({mode:e,toggle:t}){let r=v4r(),{socket:n,selection:i,viewLaunchedSession:o}=r;return(0,cg.jsx)(Zkr,{shell:r,children:(0,cg.jsxs)(dGe.Provider,{value:n.daemonVersion,children:[(0,cg.jsx)(R5r,{mode:e,toggle:t,sessions:n.sessions,reconnecting:n.reconnecting}),(0,cg.jsx)(Cxe,{position:"fixed",sx:kii,"data-testid":"toolbar",children:(0,cg.jsx)(I_r,{socket:n,selection:i})}),(0,cg.jsx)(D5,{variant:"dense",sx:_ii}),(0,cg.jsx)(M5r,{socket:n,children:(0,cg.jsx)(qCr,{socket:n})}),(0,cg.jsx)(Rwr,{socket:n}),(0,cg.jsx)(Kkr,{socket:n,onViewLaunchedSession:o})]})})}var x4r=E(fe(),1);function T4r(){let[e,t]=(0,x4r.useState)(()=>{try{return localStorage.getItem("theme-mode")??"dark"}catch{return"dark"}});return{mode:e,toggle:()=>t(n=>{let i=n==="dark"?"light":"dark";try{localStorage.setItem("theme-mode",i)}catch{}return i})}}function S4r({color:e,radius:t}){return{MuiMenu:{styleOverrides:{paper:{borderRadius:t.md},list:{padding:4}}},MuiMenuItem:{styleOverrides:{root:{minHeight:30,padding:"5px 10px",borderRadius:4,fontSize:13,"&:hover":{backgroundColor:e.raised},"& .MuiListItemIcon-root":{minWidth:28},"& .MuiSvgIcon-root":{fontSize:16},"& .MuiListItemText-primary":{fontSize:13}}}}}}function C4r(e){let{color:t,radius:r,elevation:n,type:i}=e,o={border:`1px solid ${t.line}`};return{...S4r(e),MuiTooltip:{styleOverrides:{tooltip:{...o,backgroundColor:t.overlay.background,color:t.overlay.text,borderRadius:r.md,boxShadow:n.overlay,fontSize:`${i.scale.caption/16}rem`,padding:"6px 10px"},arrow:{color:t.overlay.background}}},MuiPopover:{styleOverrides:{paper:{...o,boxShadow:n.overlay}}},MuiBackdrop:{styleOverrides:{root:{"&:not(.MuiBackdrop-invisible)":{backgroundColor:t.scrim,backdropFilter:"blur(2px)"}}}},MuiDialog:{styleOverrides:{paper:{...o,backgroundColor:t.surface,borderRadius:r.md+4,boxShadow:n.dialog}}}}}var w4r=({variant:e})=>e==="outlined"||e==="tonal",k4r=[{props:{size:"small"},style:{minHeight:26,padding:"4px 9px",fontSize:12}},{props:w4r,style:{padding:"5px 11px"}},{props:e=>w4r(e)&&e.size==="small",style:{padding:"3px 8px"}}];var Vve=["primary","secondary","success","warning","error","info"];function qX(e,t){return{backgroundColor:Ir(e,t),borderColor:Ir(e,.35),color:e}}function _4r({color:e}){return[{props:{variant:"tonal"},style:{backgroundColor:e.raised,border:`1px solid ${e.line}`,color:e.text.primary,"&:hover":{backgroundColor:e.raised,borderColor:e.text.disabled}}},...Vve.filter(t=>t!=="primary").map(t=>({props:{variant:"tonal",color:t},style:{...qX(e[t].main,.16),"&:hover":qX(e[t].main,.24)}}))]}var E4r={"& > *:nth-of-type(1)":{fontSize:16}};function R4r(e){let{color:t,radius:r}=e;return{MuiButton:{defaultProps:{disableElevation:!0},styleOverrides:{root:{minHeight:30,padding:"6px 12px",borderRadius:r.sm,fontSize:13,fontWeight:600,lineHeight:"18px"},startIcon:{marginLeft:-2,marginRight:6,...E4r},endIcon:{marginLeft:6,marginRight:-2,...E4r}},variants:[...k4r,{props:{variant:"text",color:"primary"},style:{color:t.text.secondary,"&:hover":{backgroundColor:t.raised,color:t.text.primary}}},..._4r(e),{props:{variant:"outlined",color:"error"},style:{borderColor:Ir(t.error.main,.35),"&:hover":{borderColor:t.error.main,backgroundColor:Ir(t.error.main,.1)}}}]}}}function AGe({color:e},t){return[{props:{variant:t,color:"default"},style:{backgroundColor:"transparent",border:`1px solid ${e.line}`,color:e.text.secondary,"&.MuiChip-clickable:hover":{backgroundColor:e.raised}}},...Vve.map(r=>({props:{variant:t,color:r},style:{...qX(e[r].main,.14),borderColor:"transparent","& .MuiChip-deleteIcon":{color:Ir(e[r].main,.7),"&:hover, &:active":{color:e[r].main}},"&.MuiChip-clickable:hover":{backgroundColor:Ir(e[r].main,.22)}}}))]}function A4r(e){return{MuiChip:{styleOverrides:{root:{height:20,fontSize:11,fontWeight:600,borderRadius:999},sizeSmall:{height:20,"& .MuiChip-label":{padding:"0 7px"}},label:{padding:"0 8px"},icon:{fontSize:14,marginLeft:6,marginRight:-2},deleteIcon:{fontSize:14,marginLeft:-2,marginRight:4},outlined:{borderColor:e.color.line}},variants:[...AGe(e,"tonal"),...AGe(e,"filled")]}}}function P4r(e){return{...R4r(e),MuiButtonGroup:{defaultProps:{disableElevation:!0},variants:[{props:{variant:"tonal"},style:{"& .MuiButtonGroup-middleButton, & .MuiButtonGroup-lastButton":{marginLeft:-1}}}]},...A4r(e)}}var PGe=e=>`color-mix(in srgb, currentColor ${e}%, transparent)`,Eii={".MuiAppBar-root &":{color:"inherit","&:hover":{backgroundColor:PGe(8)},"&.Mui-selected":{color:"inherit",backgroundColor:PGe(12),boxShadow:`inset 0 0 0 1px ${PGe(18)}`}}};function L4r({color:e,radius:t}){return{MuiTabs:{styleOverrides:{root:{minHeight:40,alignItems:"center"},list:{gap:2},indicator:{display:"none"}}},MuiTab:{styleOverrides:{root:{minHeight:30,padding:"6px 10px",borderRadius:t.sm,textTransform:"none",fontSize:13,fontWeight:500,opacity:1,color:e.text.secondary,"&:hover":{backgroundColor:e.raised,color:e.text.primary},"&.Mui-selected":{color:e.text.primary,backgroundColor:e.raised,boxShadow:`inset 0 0 0 1px ${e.line}`},...!e.appBar&&Eii}}}}}var M4r=(e,t)=>({width:e,height:e,"& .MuiSvgIcon-root":{fontSize:t}});function I4r({color:e,radius:t}){return{MuiIconButton:{styleOverrides:{root:{...M4r(30,18),padding:0,borderRadius:t.sm,"&:hover":{backgroundColor:e.raised}}},variants:[{props:{size:"small"},style:M4r(26,16)},{props:{color:"default"},style:{color:e.text.secondary,"&:hover":{color:e.text.primary}}}]}}}function D4r({color:e,radius:t}){return{MuiToggleButtonGroup:{styleOverrides:{root:{padding:2,gap:2,border:`1px solid ${e.line}`,borderRadius:t.sm,backgroundColor:e.background},grouped:{margin:0,border:0,borderRadius:4}}},MuiToggleButton:{styleOverrides:{root:{padding:"3px 8px",border:0,borderRadius:4,fontSize:13,fontWeight:500,lineHeight:"18px",textTransform:"none",color:e.text.secondary,"& .MuiSvgIcon-root":{fontSize:16},"&:hover":{backgroundColor:"transparent",color:e.text.primary},"&.Mui-selected, &.Mui-selected:hover":{backgroundColor:e.raised,color:e.text.primary}}}}}}var qve=".MuiOutlinedInput-notchedOutline";function N4r({color:e,radius:t}){return{MuiOutlinedInput:{styleOverrides:{root:{backgroundColor:e.background,borderRadius:t.sm,fontSize:13,color:e.text.primary,[`& ${qve}`]:{borderColor:e.line},[`&:hover ${qve}`]:{borderColor:e.text.disabled},[`&.Mui-focused ${qve}`]:{borderColor:e.primary.main,borderWidth:1},[`&.Mui-error ${qve}`]:{borderColor:e.error.main}}}},MuiInputLabel:{styleOverrides:{root:{fontSize:13,color:e.text.secondary,"&.Mui-focused":{color:e.primary.main}}}},MuiSelect:{styleOverrides:{icon:{color:e.text.disabled}}}}}function O4r({color:e}){return{MuiSwitch:{styleOverrides:{root:{width:34,height:20,padding:0,"& .MuiSwitch-switchBase":{padding:2,color:e.text.secondary,"&.Mui-checked":{transform:"translateX(14px)",color:e.primary.contrastText},"&.Mui-checked + .MuiSwitch-track":{backgroundColor:e.primary.main,opacity:1}},"& .MuiSwitch-thumb":{width:16,height:16,boxShadow:"none"},"& .MuiSwitch-track":{borderRadius:10,backgroundColor:e.line,opacity:1}}}},MuiFormControlLabel:{styleOverrides:{root:{"&:has(.MuiSwitch-root)":{marginLeft:0,gap:8}}}}}}function B4r(e){let{appBar:t}=e.color;return{...C4r(e),...P4r(e),...I4r(e),...D4r(e),...N4r(e),...O4r(e),...L4r(e),MuiPaper:{styleOverrides:{root:{backgroundImage:"none"},outlined:{borderColor:e.color.line}}},MuiAppBar:{defaultProps:{elevation:e.elevation.appBar},styleOverrides:{root:t&&{backgroundColor:t.background,color:t.text,borderBottom:`1px solid ${e.color.line}`}}}}}var Lv="#0e1116",LGe="#141820",jve="#1b202a",Yve="#e3e7ee",MGe="#8a93a3",jX="#8b9cff",Kve="#5fd0a0",Xve="#f2b45a",Zve="#f27a7a",F4r={secondary:"rgba(255, 255, 255, 0.7)",hover:"rgba(255, 255, 255, 0.12)",active:"rgba(255, 255, 255, 0.16)",dot:"#ffb74d",dotRing:"rgba(0, 0, 0, 0.15)"},Qve={dark:{color:{background:Lv,surface:LGe,raised:jve,line:"#262c37",lineSoft:"#1d222b",text:{primary:Yve,secondary:MGe,disabled:"#5c6473"},selected:"rgba(139, 156, 255, 0.14)",wash:{warning:"rgba(242, 180, 90, 0.09)",error:"rgba(242, 122, 122, 0.09)"},well:Lv,stripe:jve,overlay:{background:jve,text:Yve},scrim:"rgba(0, 0, 0, 0.5)",appBar:{background:LGe,text:Yve},onAppBar:{...F4r,secondary:MGe,level:{ok:Kve,warn:Xve,over:Zve}},statusBar:{background:LGe,text:MGe,hoverText:Yve,secondary:"#5c6473",hover:jve,active:"transparent",dot:jX,dotRing:"rgba(139, 156, 255, 0.14)",readyText:jX,level:{ok:Kve,warn:Xve,over:Zve}},primary:{main:jX,contrastText:Lv},secondary:{main:"#c99bff",contrastText:Lv},success:{main:Kve,contrastText:Lv},warning:{main:Xve,contrastText:Lv},error:{main:Zve,contrastText:Lv},info:{main:"#6cb6ff",contrastText:Lv}},terminal:{background:Lv,foreground:"#d6dbe4",cursor:jX,cursorAccent:Lv,selectionBackground:"rgba(139, 156, 255, 0.28)",black:"#1b2029",red:Zve,green:Kve,yellow:Xve,blue:jX,magenta:"#c99bff",cyan:"#6cc8d8",white:"#c3c9d4",brightBlack:"#5c6473",brightRed:"#ff9a9a",brightGreen:"#82e0b6",brightYellow:"#ffc97a",brightBlue:"#a9b6ff",brightMagenta:"#dcb8ff",brightCyan:"#8fdbe8",brightWhite:"#eef1f6"},elevation:{appBar:0,overlay:"0 14px 34px rgba(0, 0, 0, 0.45)",dialog:"0 30px 60px rgba(0, 0, 0, 0.5)"}},light:{color:{background:"#fff",surface:"#fff",raised:"rgba(0, 0, 0, 0.04)",line:"rgba(0, 0, 0, 0.12)",lineSoft:"rgba(0, 0, 0, 0.12)",text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},selected:"rgba(0, 0, 0, 0.08)",wash:{warning:"rgba(255, 167, 38, 0.09)",error:"rgba(244, 67, 54, 0.09)"},well:"#f3f4f6",stripe:"rgba(0, 0, 0, 0.1)",overlay:{background:"rgba(97, 97, 97, 0.92)",text:"#fff"},onAppBar:{...F4r,level:{ok:"#b9f6ca",warn:"#ffe57f",over:"#ffcdd2"}},primary:{main:"#1976d2",light:"#42a5f5",dark:"#1565c0",contrastText:"#fff"},secondary:{main:"#9c27b0",light:"#ba68c8",dark:"#7b1fa2",contrastText:"#fff"},success:{main:"#2e7d32",light:"#4caf50",dark:"#1b5e20",contrastText:"#fff"},warning:{main:"#ed6c02",light:"#ff9800",dark:"#e65100",contrastText:"#fff"},error:{main:"#d32f2f",light:"#ef5350",dark:"#c62828",contrastText:"#fff"},info:{main:"#0288d1",light:"#03a9f4",dark:"#01579b",contrastText:"#fff"},scrim:"rgba(15, 23, 42, 0.32)",statusBar:{background:"#f3f4f6",text:"rgba(0, 0, 0, 0.6)",hoverText:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.38)",hover:"rgba(0, 0, 0, 0.06)",active:"transparent",dot:"#1976d2",dotRing:"rgba(25, 118, 210, 0.16)",readyText:"#1976d2",level:{ok:"#2e7d32",warn:"#ed6c02",over:"#d32f2f"}}},terminal:{background:"#ffffff",foreground:"#333333",cursor:"#333333",cursorAccent:"#ffffff",selectionBackground:"#add6ff",black:"#000000",red:"#cd3131",green:"#107c10",yellow:"#949800",blue:"#0451a5",magenta:"#bc05bc",cyan:"#0598bc",white:"#555555",brightBlack:"#666666",brightRed:"#cd3131",brightGreen:"#14ce14",brightYellow:"#b5ba00",brightBlue:"#0451a5",brightMagenta:"#bc05bc",brightCyan:"#0598bc",brightWhite:"#a5a5a5"},elevation:{appBar:0,overlay:"0 8px 24px rgba(15, 23, 42, 0.12)",dialog:"0 24px 48px rgba(15, 23, 42, 0.18)"}},font:{ui:'"Geist Variable", "Segoe UI", system-ui, sans-serif',mono:'"Geist Mono Variable", ui-monospace, Menlo, Consolas, monospace',terminal:'"Geist Mono Variable", ui-monospace, Menlo, Consolas, monospace'},type:{fontSize:14,terminalFontSize:13,scale:{caption:12,body2:14,body1:15,subtitle2:14,subtitle1:15,h6:16,h5:18,h4:24,button:14},button:{textTransform:"none",fontWeight:600}},radius:{sm:6,md:8},spacing:8};var bT=e=>`${e/16}rem`;function $4r({font:e,type:t}){let{scale:r}=t;return{fontFamily:e.ui,fontFamilyMono:e.mono,fontSize:t.fontSize,button:{...t.button,fontSize:bT(r.button)},caption:{fontSize:bT(r.caption)},body2:{fontSize:bT(r.body2)},body1:{fontSize:bT(r.body1)},subtitle2:{fontSize:bT(r.subtitle2)},subtitle1:{fontSize:bT(r.subtitle1)},h6:{fontSize:bT(r.h6)},h5:{fontSize:bT(r.h5)},h4:{fontSize:bT(r.h4)}}}function z4r(e){return{MuiButtonBase:{styleOverrides:{root:{cursor:"pointer","&.Mui-disabled":{cursor:"default"}}}},MuiLink:{styleOverrides:{root:{cursor:"pointer"}}},MuiAppBar:{defaultProps:{elevation:e.elevation.appBar}}}}function Rii(e){let{dark:t,light:r,...n}=Qve;return{...n,...e==="dark"?t:r,mode:e}}function H4r(e){let t=Rii(e),{color:r}=t;return q0({tokens:t,palette:{mode:e,background:{default:r.background,paper:r.surface},primary:r.primary,secondary:r.secondary,success:r.success,warning:r.warning,error:r.error,info:r.info,text:r.text,divider:r.line,action:{hover:r.raised,selected:r.selected}},typography:$4r(t),shape:{borderRadius:t.radius.sm},spacing:t.spacing,components:{...z4r(t),...B4r(t)}})}function U4r(){if(typeof document>"u"||!document.fonts)return Promise.resolve();let{font:e,type:t}=Qve;return Promise.allSettled([document.fonts.load(`${t.fontSize}px ${e.ui}`),document.fonts.load(`${t.terminalFontSize}px ${e.terminal}`)])}var W4r=E(fe(),1);var Jve=E($(),1),Aii=5;function G4r({children:e}){let[t,r]=(0,W4r.useState)(null);return(0,Jve.jsxs)(Ywe.Provider,{value:t,children:[e,(0,Jve.jsx)(J,{ref:r,"data-testid":"toast-stack",sx:{position:"fixed",zIndex:"snackbar",bottom:{xs:1,sm:3},left:{xs:1,sm:"50%"},right:{xs:1,sm:"auto"},transform:{sm:"translateX(-50%)"},display:"flex",flexDirection:"column",alignItems:{xs:"stretch",sm:"center"},gap:1,pointerEvents:"none","& > *":{pointerEvents:"auto"},[`& > :nth-last-of-type(n+${Aii+1})`]:{display:"none"}}})]})}var xT=E($(),1);function Pii(){let{mode:e,toggle:t}=T4r(),r=(0,q4r.useMemo)(()=>H4r(e),[e]);return(0,xT.jsxs)(tQ,{theme:r,children:[(0,xT.jsx)(UQ,{}),(0,xT.jsx)(G4r,{children:(0,xT.jsx)(b4r,{mode:e,toggle:t})})]})}var Lii=KCe([{path:"*",element:(0,xT.jsx)(Pii,{})}]);function Mii(){return(0,xT.jsx)(HCe,{router:Lii})}var V4r=document.getElementById("app");V4r&&U4r().then(()=>{(0,j4r.createRoot)(V4r).render((0,xT.jsx)(Mii,{}))});})();
|
|
4025
4025
|
/*! Bundled license information:
|
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { Command } from "commander";
|
|
|
6
6
|
// package.json
|
|
7
7
|
var package_default = {
|
|
8
8
|
name: "@staff0rd/assist",
|
|
9
|
-
version: "0.948.
|
|
9
|
+
version: "0.948.1",
|
|
10
10
|
type: "module",
|
|
11
11
|
main: "dist/index.js",
|
|
12
12
|
bin: {
|
|
@@ -19935,7 +19935,7 @@ var PATTERN_DENIES = [
|
|
|
19935
19935
|
},
|
|
19936
19936
|
{
|
|
19937
19937
|
pattern: "gh issue edit",
|
|
19938
|
-
message: "Do not run 'gh issue edit' directly. Use 'assist github issue edit <number> [-R <owner>/<repo>] [--body <body>]' instead \u2014 it opens the body in the assist web preview pane and pushes nothing back until the user approves it. When you already know the body you want, pass it with --body (--body - reads stdin) so the first preview shows your proposal; without --body the pane shows the issue's current body. To make a targeted change to the current body, run it with --fetch first, which writes that body to a working file and prints its path without opening a preview; edit the file, then re-run without --fetch so the first preview shows your revision. Run 'assist github issue edit --help' for how the working file and the preview pane fit together; it is authoritative on how approval is handled in this environment. To remove
|
|
19938
|
+
message: "Do not run 'gh issue edit' directly. Use 'assist github issue edit <number> [-R <owner>/<repo>] [--body <body>]' instead \u2014 it opens the body in the assist web preview pane and pushes nothing back until the user approves it. When you already know the body you want, pass it with --body (--body - reads stdin) so the first preview shows your proposal; without --body the pane shows the issue's current body. To make a targeted change to the current body, run it with --fetch first, which writes that body to a working file and prints its path without opening a preview; edit the file, then re-run without --fetch so the first preview shows your revision. Run 'assist github issue edit --help' for how the working file and the preview pane fit together; it is authoritative on how approval is handled in this environment. To remove an assignee, use 'assist github issue unassign <number> [-R <owner>/<repo>] [--assignee <login>...]' (it removes you when --assignee is omitted)."
|
|
19939
19939
|
},
|
|
19940
19940
|
{
|
|
19941
19941
|
pattern: "gh issue comment",
|
|
@@ -19951,7 +19951,7 @@ var PATTERN_DENIES = [
|
|
|
19951
19951
|
enabled: () => loadConfig().cliHook?.blockNpmRun !== false
|
|
19952
19952
|
}
|
|
19953
19953
|
];
|
|
19954
|
-
var GH_ISSUE_API_MESSAGE = "Do not write to GitHub issues with 'gh api' (REST issue endpoints or GraphQL issue mutations) \u2014 it bypasses the content validation and the approval pane that every outward-facing issue write goes through. Use 'assist github issue create --title <title> --body <body>' to open an issue, 'assist github issue edit <number>' to rework one's body, 'assist github issue comment <number> --body <body>' to post a comment, or 'assist github issue edit-comment <comment-id> --body <body>' to amend a comment that is already posted. Each validates the content and gates it on the user's approval before anything reaches GitHub; run the command's --help for how to compose it. To remove
|
|
19954
|
+
var GH_ISSUE_API_MESSAGE = "Do not write to GitHub issues with 'gh api' (REST issue endpoints or GraphQL issue mutations) \u2014 it bypasses the content validation and the approval pane that every outward-facing issue write goes through. Use 'assist github issue create --title <title> --body <body>' to open an issue, 'assist github issue edit <number>' to rework one's body, 'assist github issue comment <number> --body <body>' to post a comment, or 'assist github issue edit-comment <comment-id> --body <body>' to amend a comment that is already posted. Each validates the content and gates it on the user's approval before anything reaches GitHub; run the command's --help for how to compose it. To remove an assignee, use 'assist github issue unassign <number> [-R <owner>/<repo>] [--assignee <login>...]' (it removes you when --assignee is omitted).";
|
|
19955
19955
|
var BRANCH_CREATION_MESSAGE = "Do not create branches with raw git. Use the /branch command, or 'assist branch <slug> [--jira <KEY>]' \u2014 it branches off the fresh remote default and enforces the team naming convention.";
|
|
19956
19956
|
var CLOSE_WITH_COMMENT_MESSAGE = "Do not post a comment through 'gh issue close', 'gh issue reopen' or 'gh pr close' with --comment/-c \u2014 it goes to GitHub without the approval pane. Post the comment first with 'assist github issue comment <number> --body <body> [-R <owner>/<repo>]', which validates it and gates it on the user's approval, then run the same close/reopen without --comment.";
|
|
19957
19957
|
var CLOSE_WITH_COMMENT_REGEX = /gh (?:issue (?:close|reopen)|pr close)[^;&|]*? (?:--comment|-c)/;
|