@staff0rd/assist 0.963.0 → 0.964.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -150,7 +150,7 @@ Every command supports `--help` for full detail on its flags and behaviour.
150
150
  - `--checkout-only` - Skip the review; check the PR out and leave an idle Claude session in it. In a clone whose remote is on Azure DevOps it checks out with `az repos pr checkout` instead of `gh` (see [Azure DevOps PRs](#azure-devops-prs))
151
151
  - `--high-level` - Open the high-level review checklist in the web preview pane and post it to the PR as an Approve, Comment or Request changes review. Comments on lines selected in a diff or a test's source are either sent to the agent or added to the review, where those on lines in the PR diff post as line-level comments. See [docs/high-level-review.md](docs/high-level-review.md)
152
152
  - `--configure` - With `--high-level`: configure the checklist's `review.highLevel.*` keys instead of reviewing
153
- - `--scope <repo|project>` - With `--configure`: write to this repo's override in the shared assist database or the project `assist.yml` instead of asking
153
+ - `--scope <db|git>` - With `--configure`: write to repo (db), this repo's override in the shared assist database, or repo (git), the repo's `assist.yml`, instead of asking
154
154
  - `--answer <key=value>` - With `--configure`: answer one key without prompting, repeatable; an empty value leaves the key unset
155
155
  - `--address-comments` - Start an Address Comments session for the PR once comments are posted and the review submitted
156
156
  - `--announce` - Announce the PR in Slack at the end of the chain
@@ -176,7 +176,7 @@ Every command supports `--help` for full detail on its flags and behaviour.
176
176
  - `assist news remove <url>` - Remove a feed URL from `news.feeds`
177
177
  - `news.feeds` - The feed URLs, stored in the assist database so every machine shares them; `assist config set news.feeds <url1>,<url2>` replaces the whole list
178
178
  - `assist releases [list]` - Print the release promotion streams declared in `releases.streams`
179
- - `assist releases configure --streams <file> [--scope <project|repo>]` - Write release streams from a JSON or YAML file (`-` for stdin) to `releases.streams`, in the project `assist.yml` (default) or this repo's shared override in the assist database
179
+ - `assist releases configure --streams <file> [--scope <git|db>]` - Write release streams from a JSON or YAML file (`-` for stdin) to `releases.streams`, in repo (git), the repo's `assist.yml` (default), or repo (db), this repo's shared override in the assist database
180
180
 
181
181
  ### Backlog
182
182
 
@@ -35,8 +35,8 @@ A job with `uses: <owner>/<name>/.github/workflows/<file>@<ref>` calls a reusabl
35
35
 
36
36
  Show the nodes and edges you intend to write, and say which workflow file each node came from — including the reusable ones, so the user can see the chain you followed. Ask them to accept or edit, and ask which config file it goes to:
37
37
 
38
- - `project` — the repo's own `assist.yml`, checked in, so the team sees the same graph
39
- - `repo` — this repo's block in `~/.assist.yml`, personal to this machine
38
+ - `git` — repo (git), the repo's own `assist.yml`, checked in, so the team sees the same graph
39
+ - `db` — repo (db), this repo's override in the shared assist database, personal to the user and seen by every node
40
40
 
41
41
  Ask rather than guess: which jobs deserve a node at all, how jobs split into streams, what to call a stream, and any environment name that is computed rather than written literally.
42
42
 
@@ -45,7 +45,7 @@ Ask rather than guess: which jobs deserve a node at all, how jobs split into str
45
45
  Write the accepted streams to a JSON file and pass it in. Run the command from the repo you are in, never from another checkout: the config it writes belongs to the directory it runs in, whichever repos its streams point at. Set `repo` on any stream that releases another repo; one left out defaults to the repo you are in.
46
46
 
47
47
  ```
48
- assist releases configure --scope project --streams /tmp/streams.json
48
+ assist releases configure --scope git --streams /tmp/streams.json
49
49
  ```
50
50
 
51
51
  ```json
@@ -35,8 +35,8 @@ Do not ask in chat. Write the proposal as markdown to a scratch file with the Wr
35
35
  - `descriptionWordCap` with its value
36
36
  - `collapsedPaths`, each glob as its own bullet like the others
37
37
  - the scope you propose, with the other one named so the user can swap it:
38
- - `repo` — this repo's override in the shared assist database, personal to the user and seen by every node (propose this unless the user has said otherwise)
39
- - `project` — the repo's own `assist.yml`, a file to check in so the team reviews against the same globs; only when the user asks for it, since it leaves a new file in a repo they may not own
38
+ - `db` — repo (db), this repo's override in the shared assist database, personal to the user and seen by every node (propose this unless the user has said otherwise)
39
+ - `git` — repo (git), the repo's own `assist.yml`, a file to check in so the team reviews against the same globs; only when the user asks for it, since it leaves a new file in a repo they may not own
40
40
 
41
41
  Then run, **as a background task**, doing no other work until it returns:
42
42
 
@@ -55,7 +55,7 @@ Outside a web session `assist ask` only prints the markdown and exits 0 without
55
55
  Pass every key, so nothing is prompted for — you have already asked:
56
56
 
57
57
  ```
58
- assist review --high-level --configure --scope repo \
58
+ assist review --high-level --configure --scope db \
59
59
  --answer 'review.highLevel.criticalPaths=**/*.graphql,en-AU/translation.json' \
60
60
  --answer 'review.highLevel.uiPaths=src/ui/**' \
61
61
  --answer 'review.highLevel.descriptionWordCap=300' \
@@ -4019,7 +4019,7 @@ ${f.join(`
4019
4019
  `,isi=go`
4020
4020
  0%, 100% { transform: scale(1); }
4021
4021
  50% { transform: scale(1.08); }
4022
- `,b_r={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:`${nsi} 1.8s linear infinite`},osi={display:"inline-flex",alignItems:"center",px:1.5,py:"3px",borderRadius:999,position:"relative",isolation:"isolate",fontWeight:700,animation:`${isi} 1.6s ease-in-out infinite`,"&::before":{...b_r,inset:0,zIndex:-1},"&::after":{...b_r,inset:"-5px",zIndex:-2,filter:"blur(9px)",opacity:.85},"& span":{color:ul.rainbowPill.text,textShadow:ul.rainbowPill.shadow},"@media (prefers-reduced-motion: reduce)":{animation:"none","&::before, &::after":{animation:"none"}}};function x_r({children:e}){return(0,S6.jsxs)(S6.Fragment,{children:[(0,S6.jsx)(L5,{styles:rsi}),(0,S6.jsx)(X,{component:"span","data-testid":"rainbow-pill",sx:osi,children:e})]})}function S_r({pct:e,timeLabel:t}){return[Math.round(e),...(t.match(/\d+/g)??[]).map(Number)].join(",")}function T_r(e){if(e.length!==2)return!1;let[t,r]=e;return S_r(t)===S_r(r)}var LS=E(F(),1);function w_r({rateLimits:e}){let t=D_(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=T_r(r.map(o=>({pct:o.window?.used_percentage??0,timeLabel:ybe(o.window?.resets_at,o.fallbackLabel,t)}))),i=r.map((o,a)=>(0,LS.jsxs)(C_r.Fragment,{children:[a>0?(0,LS.jsx)(X,{component:"span",sx:{color:Q$,mr:.5},children:","}):null,(0,LS.jsx)(v_r,{window:o.window,windowSeconds:o.windowSeconds,fallbackLabel:o.fallbackLabel,now:t})]},o.fallbackLabel));return n?(0,LS.jsx)(x_r,{children:i}):(0,LS.jsx)(LS.Fragment,{children:i})}var X_=E(F(),1);function __r({groups:e}){return(0,X_.jsx)(X_.Fragment,{children:e.map((t,r)=>(0,X_.jsxs)(k_r.Fragment,{children:[(0,X_.jsx)(X,{component:"span",sx:{color:Q$,ml:r>0?1:0,mr:.5},children:Bu(t.harness)}),(0,X_.jsx)(w_r,{rateLimits:t.rateLimits})]},t.harness))})}var E_r={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 asi(e){if(e==="over")return{level:"warn",boundary:100};if(e==="warn")return{level:"ok",boundary:75}}function ssi(e){if(e==="ok")return{level:"warn",boundary:75};if(e==="warn")return{level:"over",boundary:100}}function lsi(e,t,r,n){if(e>=t)return;let i=e/t;return Math.round(r-n*(1-i))}function P_r(e,t,r,n){if(t==null)return{kind:"unprojectable"};let i=gVe(t,r,n);if(i==null)return{kind:"unprojectable"};let o=I_(e,t,r,n),a=asi(o),s=ssi(o);return{kind:"projected",recovery:a&&{level:a.level,pct:a.boundary*i,at:lsi(e,a.boundary,t,r)},worse:s&&{level:s.level,pct:s.boundary*i}}}function bbe(e){return t=>t.tokens.color.onAppBar.level[e]}function L_r(e,t){return e.at==null?"not before reset":`${e.level==="ok"?"green":"under"} in ${Mve(e.at,t)}`}var Z_=E(F(),1),M_r={display:"contents"};function $Ve({direction:e,threshold:t}){let r=e==="back";if(!t)return(0,Z_.jsxs)(X,{component:"span",sx:M_r,children:[(0,Z_.jsx)("span",{}),(0,Z_.jsx)("span",{})]});let n=(0,Z_.jsx)(X,{component:"span",sx:{opacity:.6},children:r?"\u2190":"\u2192"}),i=(0,Z_.jsxs)(X,{component:"span",sx:{color:bbe(t.level),textAlign:"right"},children:[Math.round(t.pct),"%"]});return(0,Z_.jsxs)(X,{component:"span",sx:M_r,children:[r?i:n,r?n:i]})}var I_r={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 Q_=E(F(),1);function D_r({label:e,pct:t,resetsAt:r,windowSeconds:n,now:i}){let o=I_r,a=I_(t,r,n,i),s=P_r(t,r,n,i),l=s.kind==="projected"?s:void 0;return(0,Q_.jsxs)(X,{sx:o.row,children:[(0,Q_.jsx)(X,{component:"span",sx:{minWidth:"2ch"},children:e}),(0,Q_.jsx)($Ve,{direction:"back",threshold:l?.recovery}),(0,Q_.jsxs)(X,{component:"span",sx:{minWidth:"4ch",textAlign:"right",fontWeight:o.pctWeight,color:bbe(a)},children:[Math.round(t),"%"]}),(0,Q_.jsx)($Ve,{direction:"forward",threshold:l?.worse}),(0,Q_.jsx)(X,{component:"span",sx:o.note,children:l?l.recovery&&L_r(l.recovery,i):"no projection yet"})]})}function N_r(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 B_r=E(F(),1);function O_r({rateLimits:e,now:t}){return N_r(e).map(r=>(0,B_r.jsx)(D_r,{label:r.label,pct:r.pct,resetsAt:r.resetsAt,windowSeconds:r.windowSeconds,now:t},r.label))}var T6=E(F(),1);function F_r({groups:e}){let t=D_(3e4),r=E_r;return(0,T6.jsxs)(X,{sx:r.root,children:[e.map(n=>(0,T6.jsxs)(X,{sx:r.group,children:[(0,T6.jsx)(X,{sx:r.heading,children:Bu(n.harness)}),(0,T6.jsx)(O_r,{rateLimits:n.rateLimits,now:t})]},n.harness)),(0,T6.jsx)(X,{sx:r.foot,children:"Account usage per harness \u2014 view history"})]})}var zVe=E(F(),1),csi="Claude account usage (5h / 7d windows) \u2014 view history";function $_r(e){return e.length===0?{title:csi,content:"Usage"}:{title:(0,zVe.jsx)(F_r,{groups:e}),content:(0,zVe.jsx)(__r,{groups:e})}}var z_r={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}},H_r={tooltip:{sx:{p:"10px 12px",minWidth:300,maxWidth:"none"}}};var HVe=E(F(),1),usi={};function U_r({rateLimits:e,harnessRateLimits:t=usi}){let{title:r,content:n}=$_r(g_r(e,t));return(0,HVe.jsx)(sr,{title:r,placement:"top-start",slotProps:H_r,children:(0,HVe.jsx)(Qr,{component:Es,to:"/usage",underline:"none",color:"inherit",sx:z_r,children:n})})}var V_r=E(le(),1);var J_="0.963.0";var xbe=E(le(),1),UVe=(0,xbe.createContext)(null);function Sbe(){return(0,xbe.useContext)(UVe)}var WVe=E(F(),1);function W_r(){let e=Sbe();return!e||e===J_?null:(0,WVe.jsx)(sr,{title:`Daemon is running v${e}, but this page was served by v${J_}. Restart the daemon to match.`,children:(0,WVe.jsx)(lbe,{fontSize:"small",color:"warning","aria-label":"Version mismatch"})})}var G_r=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?Bv(t).active:"transparent",transition:"opacity .2s ease, background-color .2s ease, color .2s ease","&:hover, &:focus-visible":{bgcolor:t=>Bv(t).hover,color:t=>Bv(t).hoverText},"& .ready-dot":{width:6,height:6,borderRadius:"50%",bgcolor:t=>Bv(t).dot,boxShadow:t=>`0 0 0 3px ${Bv(t).dotRing}`},"& .ready-count":{fontWeight:500,color:t=>Bv(t).readyText}});var pg=E(F(),1);function q_r(){let{entries:e}=y$(),t=Xn(),r=(0,V_r.useCallback)(()=>t("/updates"),[t]),{matches:n,chords:i}=Zn("openUpdates");if(Po(n,r),!J_)return null;let o=e.filter(w$).length;return(0,pg.jsxs)(pg.Fragment,{children:[(0,pg.jsx)(sr,{describeChild:!0,placement:"top-end",title:(0,pg.jsx)(Fu,{label:"Updates",chords:i}),children:(0,pg.jsxs)(Or,{component:Es,to:"/updates","aria-label":o?`Updates: ${o} node${o>1?"s have":" has"} an update ready`:"Updates",sx:G_r(o>0),children:[o>0&&(0,pg.jsx)("span",{className:"ready-dot","aria-hidden":!0}),(0,pg.jsxs)("span",{children:["v",J_]}),o>0&&(0,pg.jsxs)("span",{className:"ready-count",children:[o," ready"]})]})}),(0,pg.jsx)(W_r,{})]})}var Tbe=E(F(),1);function j_r({socket:e}){return(0,Tbe.jsx)(p_r,{start:(0,Tbe.jsx)(U_r,{rateLimits:e.rateLimits,harnessRateLimits:e.harnessRateLimits}),end:(0,Tbe.jsx)(q_r,{})})}var Ebe=E(le(),1);var _be=E(le(),1);function Y_r(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 e5=E(F(),1),fsi={display:"flex",gap:1,alignItems:"center",minWidth:0},dsi={display:"flex",gap:1,alignItems:"baseline",minWidth:0,overflow:"hidden"},hsi={fontFamily:"fontFamilyMono",fontSize:13,whiteSpace:"nowrap"},psi={fontFamily:"fontFamilyMono",fontSize:11,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"};function msi(e){let t=e.lastIndexOf("/");return t===-1?{dir:"",basename:e}:{dir:e.slice(0,t),basename:e.slice(t+1)}}function K_r({files:e,highlight:t,onHighlight:r,onSelect:n}){return(0,e5.jsx)(Yp,{dense:!0,sx:{py:0},children:e.map((i,o)=>{let{dir:a,basename:s}=msi(i);return(0,e5.jsxs)(pn,{selected:o===t,onMouseEnter:()=>r(o),onClick:()=>n(i),sx:fsi,children:[(0,e5.jsx)(c0e,{path:i}),(0,e5.jsxs)(X,{sx:dsi,children:[(0,e5.jsx)(Le,{component:"span",sx:hsi,children:s}),(0,e5.jsx)(Le,{component:"span",color:"text.secondary",sx:psi,children:a})]})]},i)})})}var Cbe=E(F(),1),gsi={maxHeight:420,overflowY:"auto"},ysi={px:2,py:2,fontSize:13};function X_r({message:e,files:t,highlight:r,onHighlight:n,onSelect:i}){return(0,Cbe.jsx)(X,{sx:gsi,children:e?(0,Cbe.jsx)(Le,{color:"text.secondary",sx:ysi,children:e}):(0,Cbe.jsx)(K_r,{files:t,highlight:r,onHighlight:n,onSelect:i})})}var Z_r=E(F(),1),vsi={mt:6,alignSelf:"flex-start"};function wbe({onClose:e,onEntered:t,centered:r=!1,children:n}){return(0,Z_r.jsx)(Xl,{open:!0,onClose:e,maxWidth:"sm",fullWidth:!0,slotProps:{paper:{sx:r?void 0:vsi},transition:{onEntered:t}},children:n})}var kbe=E(le(),1);var Q_r={files:[],loading:!1,error:!1};function J_r(e,t){let[r,n]=(0,kbe.useState)(Q_r),i=vr();return(0,kbe.useEffect)(()=>{if(!e){n(Q_r);return}let o=!1;return n(s=>({...s,loading:!0})),(async()=>{try{let s=await hr(Kr(`/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 C6=E(F(),1);function bsi(e,t,r){let n=new URLSearchParams({path:e});return t&&n.set("cwd",t),t&&r&&n.set("node",r),`/file?${n}`}function e5r({onClose:e}){let{worktreeNode:t}=zn();return(0,C6.jsx)(xf.Provider,{value:t,children:(0,C6.jsx)(xsi,{onClose:e})})}function xsi({onClose:e}){let{worktreeCwd:t,worktreeNode:r}=zn(),[n,i]=(0,_be.useState)(""),o=J_r(t,n),a=Xn(),s=(0,_be.useRef)(null),l=p=>a(bsi(p,t,r)),{highlight:u,setHighlight:f,onKeyDown:d}=H_(o.files,n,l,e),h=p=>{l(p),e()};return(0,C6.jsxs)(wbe,{onClose:e,onEntered:()=>s.current?.focus(),children:[(0,C6.jsx)(UT,{autoFocus:!0,inputRef:s,value:n,onChange:i,onKeyDown:d,placeholder:"Search files by name..."}),(0,C6.jsx)(X_r,{message:Y_r(t,n,o),files:o.files,highlight:u,onHighlight:f,onSelect:h})]})}function t5r(e){Po(Zn("quickOpen").matches,e)}var n5r=E(F(),1);function r5r(){let[e,t]=(0,Ebe.useState)(!1);return t5r((0,Ebe.useCallback)(()=>t(!0),[])),e?(0,n5r.jsx)(e5r,{onClose:()=>t(!1)}):null}var Rbe=E(F(),1);function i5r({notice:e,onClose:t,onView:r}){let n=e?.sessionId??null;return(0,Rbe.jsx)(zh,{open:e!==null,autoHideDuration:6e3,onClose:t,children:(0,Rbe.jsx)(Ci,{severity:"success",variant:"filled",onClose:t,action:n!==null?(0,Rbe.jsx)(Mt,{color:"inherit",size:"small",onClick:()=>r(n),children:"View"}):void 0,children:e?.message})})}var LZ=E(le(),1);function o5r(e){let t=["claude"];return e.exposeCodexActions&&t.push("codex"),e.exposePiActions&&t.push("pi"),t}var v5r=E(le(),1);var a5r=E(F(),1),s5r=at((0,a5r.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 Ssi={connected:"success.main",connecting:"warning.main",disconnected:"error.main","version-blocked":"error.main"};function l5r(e){return e?Ssi[e]:"success.main"}function c5r(e){return e.split("-")[0].split(".").map(Number)}function u5r(e,t){if(!e||!t||e===t)return;let r=c5r(e),n=c5r(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 w6=E(F(),1),Tsi={height:16,fontSize:10},Csi={opacity:.6,fontSize:"0.85em"};function wsi(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 AZ({nodes:e,name:t,showVersion:r=!1}){let n=Sbe()??J_,i=e.links.find(a=>a.name===t),o=u5r(i?.peerVersion,n);return(0,w6.jsx)(sr,{title:wsi(e,t),placement:"right",children:(0,w6.jsxs)(X,{component:"span",sx:{display:"inline-flex",alignItems:"center",gap:.75},children:[(0,w6.jsx)(s5r,{sx:{fontSize:8,color:l5r(i?.state)}}),t,r&&i?.peerVersion&&(0,w6.jsxs)(X,{component:"span",sx:Csi,children:["v",i.peerVersion]}),o&&(0,w6.jsx)(Un,{label:o,size:"small",color:o==="behind"?"warning":"info",sx:Tsi})]})})}var k6=E(F(),1),ksi={opacity:.6},_si={display:"inline-flex",alignItems:"center",gap:.5,px:.5,border:1,borderStyle:"dashed",borderRadius:1};function f5r({nodes:e,name:t,clone:r}){let n=(0,k6.jsx)(AZ,{nodes:e,name:t});return r.kind==="cloned"?n:r.kind==="unavailable"?(0,k6.jsx)(X,{component:"span",sx:ksi,children:n}):(0,k6.jsx)(sr,{title:B$(t,r.cloneTarget),children:(0,k6.jsxs)(X,{component:"span",sx:_si,children:[(0,k6.jsx)(O$,{sx:{fontSize:14}}),n]})})}var h5r=E(F(),1),Esi={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 d5r({value:e,label:t,checked:r,autoFocus:n,onSelect:i}){return(0,h5r.jsx)(Or,{role:"radio","aria-checked":r,"data-value":e,tabIndex:r?0:-1,autoFocus:n&&r,onClick:i,sx:Esi,children:t})}var p5r={ArrowRight:1,ArrowLeft:-1};function Rsi(e,t,r){if(e.key==="Tab"){let n=t+(e.shiftKey?-1:1);return n>=0&&n<r?n:void 0}return(t+p5r[e.key]+r)%r}function m5r(e,t,r,n){return i=>{if(i.key==="ArrowUp"||i.key==="ArrowDown"){if(!n)return;i.preventDefault(),n();return}if(i.key!=="Tab"&&!p5r[i.key]){j2(i);return}let o=Rsi(i,e.indexOf(t),e.length);o!==void 0&&(i.preventDefault(),r(e[o]),i.currentTarget.querySelector(`[data-value="${e[o]}"]`)?.focus())}}var g5r=E(le(),1);function J$(e){return e?.querySelector('[aria-checked="true"]')}function y5r(e,t){(0,g5r.useEffect)(()=>{let r=e.current;if(!r?.contains(document.activeElement))return;let n=J$(r);n&&n!==document.activeElement&&n.focus()},[e,t])}var GVe=E(F(),1),Asi={border:1,borderColor:"divider",borderRadius:1,height:40,p:"2px",flexShrink:0};function Abe({label:e,options:t,value:r,onChange:n,optionLabel:i=u=>u,groupRef:o,autoFocus:a,onTrack:s,onToggleRow:l}){return y5r(o,r),(0,GVe.jsx)(_t,{ref:o,direction:"row",role:"radiogroup","aria-label":e,spacing:"2px",onFocus:s,onKeyDown:m5r(t,r,n,l),sx:Asi,children:t.map(u=>(0,GVe.jsx)(d5r,{value:u,label:i(u),checked:u===r,autoFocus:a,onSelect:()=>n(u)},u))})}var VVe=E(F(),1);function b5r({value:e,onChange:t,cloneState:r}){let{nodes:n,names:i,visible:o}=Ic(),a=(0,v5r.useRef)(null);return!o||!n||!e?null:(0,VVe.jsx)(Abe,{label:"Machine",options:i,value:e,onChange:t,optionLabel:s=>(0,VVe.jsx)(f5r,{nodes:n,name:s,clone:r(s)}),groupRef:a,autoFocus:!1,onTrack:()=>{}})}var Pbe=E(F(),1);function x5r({prompt:e,children:t}){return(0,Pbe.jsxs)(_t,{children:[e,(0,Pbe.jsx)(_t,{spacing:1,sx:{px:1.5,pb:1.5},children:t})]})}var T5r=E(F(),1),Psi=".MuiOutlinedInput-notchedOutline",Lsi={"& .MuiOutlinedInput-root":{px:"18px",py:2,minHeight:92,alignItems:"flex-start",bgcolor:"transparent",borderRadius:0,fontSize:15},[`&&& ${Psi}`]:{border:0},"& textarea::placeholder":{color:"text.disabled",opacity:1}};function S5r({value:e,onChange:t,placeholder:r,inputRef:n,autoFocus:i,onTrack:o}){return(0,T5r.jsx)(Gn,{sx:Lsi,value:e,onChange:a=>t(a.target.value),onKeyDown:j2,onFocus:o,onSelect:o,inputRef:n,placeholder:r,autoFocus:i,fullWidth:!0,multiline:!0,minRows:3,maxRows:12,slotProps:{htmlInput:{"aria-label":"Prompt"}}})}var _5r=E(le(),1);var MS={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:aye,submitLabel:"Start session"},design:{placeholder:"Describe the design task...",submitLabel:"Start design"}},C5r=Object.keys(MS);var qVe=E(F(),1);function w5r({anchor:e,harness:t,harnesses:r,onPick:n,onClose:i}){return(0,qVe.jsx)($s,{open:e!==null,anchorEl:e,onClose:i,slotProps:{list:{dense:!0,"aria-label":"Harness"}},children:r.map(o=>(0,qVe.jsx)(pn,{role:"menuitemradio","aria-checked":o===t,selected:o===t,onClick:()=>{n(o),i()},sx:{fontSize:13},children:Bu(o)},o))})}var _6=E(F(),1);function k5r(e){return t=>t==="prompt"&&e?(0,_6.jsxs)(_6.Fragment,{children:["prompt",(0,_6.jsx)(X,{component:"span",sx:{fontWeight:400,whiteSpace:"pre"},children:` \xB7 ${Bu(e)}`}),(0,_6.jsx)(_d,{sx:{fontSize:18,mr:-.75}})]}):t}var E6=E(F(),1);function E5r({draft:e,harness:t,harnesses:r,focus:n}){let[i,o]=(0,_5r.useState)(null),a=e.mode==="prompt"&&r.length>1,s=()=>o(J$(n.modeRef.current)??null),l=u=>{a&&u==="prompt"?s():e.setMode(u)};return(0,E6.jsxs)(E6.Fragment,{children:[(0,E6.jsx)(Abe,{label:"Mode",options:C5r,value:e.mode,onChange:l,optionLabel:k5r(r.length>1?t:void 0),groupRef:n.modeRef,autoFocus:n.autoFocus==="mode",onTrack:n.trackMode,onToggleRow:a?s:void 0}),(0,E6.jsx)(w5r,{anchor:i,harness:t,harnesses:r,onPick:e.setHarness,onClose:()=>o(null)})]})}var z5r=E(le(),1);var jVe=E(F(),1),Msi={zIndex:e=>e.zIndex.modal+1};function R5r({open:e,anchor:t,children:r}){return(0,jVe.jsx)(zP,{open:e,anchorEl:t,placement:"bottom-start",sx:Msi,children:(0,jVe.jsx)(on,{sx:{maxHeight:240,overflowY:"auto",width:t?.clientWidth},onMouseDown:n=>n.preventDefault(),children:r})})}var A5r=E(F(),1),P5r=at((0,A5r.jsx)("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6z"}),"KeyboardArrowDown");var YVe=E(F(),1),Isi={fontSize:13,height:36,pr:1,cursor:"pointer","& input":{cursor:"text"}},Dsi={fontSize:16,color:"text.disabled"};function L5r(e){return{htmlInput:{role:"combobox","aria-label":"Repo","aria-expanded":e},input:{sx:Isi,endAdornment:(0,YVe.jsx)(MSe,{position:"end",children:(0,YVe.jsx)(P5r,{sx:Dsi})})}}}var M5r=E(kP(),1);function I5r({open:e,highlighted:t,accept:r,close:n,navigate:i,openList:o}){return a=>{if(!e){if(a.key==="ArrowDown"){a.preventDefault(),o();return}j2(a);return}if(a.key!=="Escape"){if(a.key==="Enter"){if(a.preventDefault(),t===void 0)return;(0,M5r.flushSync)(()=>{r(t),n()}),j2(a);return}if(a.key!=="Tab"){i(a);return}t!==void 0&&r(t),n()}}}function D5r(e,t){let r=t.trim().toLowerCase();return r?e.filter(n=>Rv(n).toLowerCase().includes(r)):e}var KVe=E(le(),1);function N5r(){let[e,t]=(0,KVe.useState)(!1),[r,n]=(0,KVe.useState)("");return{open:e,query:r,show:()=>t(!0),filterBy:i=>{n(i),t(!0)},close:()=>{t(!1),n("")}}}var B5r=E(le(),1);var O5r=e=>e?Rv(e):"";function F5r(e){let[t,r]=(0,B5r.useState)(()=>O5r(e));return{text:t,setText:r,showRepo:n=>r(O5r(n))}}function $5r(e,t,r){let n=N5r(),i=F5r(t),o=D5r(e,n.query),a=f=>{r(f),i.showRepo(f)},s=H_(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:I5r({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 ez=E(F(),1);function H5r({repos:e,value:t,onChange:r,inputRef:n,autoFocus:i,onTrack:o}){let a=$5r(e,t,r),s=(0,z5r.useRef)(null);return(0,ez.jsxs)(X,{ref:s,sx:{flex:1,minWidth:0},children:[(0,ez.jsx)(Gn,{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:L5r(a.open)}),(0,ez.jsx)(R5r,{open:a.open,anchor:s.current,children:(0,ez.jsx)(nbe,{repos:a.filtered,selected:t,highlight:a.highlight,onHighlight:a.setHighlight,onSelect:a.pick})})]})}var t5=E(F(),1);function U5r({cloneState:e,...t}){let{draft:r,focus:n}=t,{repos:i}=zn();return(0,t5.jsxs)(x5r,{prompt:(0,t5.jsx)(S5r,{value:r.prompt,onChange:r.setPrompt,placeholder:MS[r.mode].placeholder,inputRef:n.promptRef,autoFocus:n.autoFocus==="prompt",onTrack:n.trackPrompt}),children:[(0,t5.jsxs)(_t,{direction:"row",spacing:1,sx:{alignItems:"flex-start"},children:[(0,t5.jsx)(H5r,{repos:i,value:r.cwd,onChange:r.setCwd,inputRef:n.repoRef,autoFocus:n.autoFocus==="repo",onTrack:n.trackRepo}),(0,t5.jsx)(E5r,{...t})]}),(0,t5.jsx)(b5r,{value:r.node,onChange:r.setNode,cloneState:e})]})}var V5r=E(F(),1),W5r=[["Enter","start"],["Shift+Enter","newline"],["Esc","close"]];function G5r({submitLabel:e,disabled:t=!1,loading:r=!1}){return(0,V5r.jsx)(Mt,{type:"submit",variant:"contained",disabled:t,loading:r,children:e})}var R6=E(F(),1),Nsi=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"}),Osi=e=>({mr:.5,px:"5px",border:1,borderColor:"divider",borderRadius:"4px",fontFamily:e.typography.fontFamilyMono,fontSize:10.5,color:"text.primary"});function q5r(e){return(0,R6.jsxs)(_t,{direction:"row",sx:Nsi,children:[W5r.map(([t,r])=>(0,R6.jsxs)("span",{children:[(0,R6.jsx)(X,{component:"kbd",sx:Osi,children:t}),r]},t)),(0,R6.jsx)(X,{sx:{flex:1}}),(0,R6.jsx)(G5r,{...e})]})}var A6=E(le(),1);function j5r(e,t){let r=(0,A6.useRef)(e),n=(0,A6.useRef)(null),i=(0,A6.useRef)(null),o=(0,A6.useRef)(null),a=(0,A6.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:J$(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 Bsi(e,t,r){return e?r.kind==="cloned"?{kind:"launch",cwd:r.cwd}:r.kind==="clonable"?{kind:"clone",prompt:obe(r,t)}:{kind:"blocked"}:{kind:"launch",cwd:e}}function Y5r(e,t){let{names:r,visible:n}=Ic(),i=ebe(t,n?r:[void 0]);return{cloneState:i,target:Bsi(t,e,i(e))}}function K5r({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}]:[];Rhr(MS[e].sessionMode,n,(u,f)=>o.onCreateAssist(u,f,...l),()=>{},r)}function X5r(e,t,r,n){return r.kind==="blocked"||e.modePending?!1:r.kind==="clone"?(qve(r.prompt,n.onCreateAssist),!0):(K5r({mode:e.mode,harness:t,prompt:e.prompt,cwd:r.cwd,node:e.node},n),e.clear(),!0)}var Lbe=E(le(),1);function Z5r(e,t){let[r,n]=(0,Lbe.useState)(!1);return(0,Lbe.useEffect)(()=>{!r||e.modePending||(n(!1),t())},[r,e.modePending,t]),()=>{e.modePending?n(!0):t()}}function Q5r(e,t,r,n,i){let o=Z5r(e,()=>{X5r(e,t,r,n)&&i()});return a=>{a.preventDefault(),o()}}var PZ=E(le(),1);function J5r(e,t){let r=(0,PZ.useRef)(e),n=(0,PZ.useRef)(null);return(0,PZ.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 tEr=E(F(),1),Fsi={border:0,margin:0,padding:0,minWidth:0};function eEr({loading:e,restoreFocus:t,children:r}){let n=J5r(e,t);return(0,tEr.jsx)("fieldset",{disabled:e,style:Fsi,onFocus:n,children:r})}var P6=E(F(),1);function rEr({draft:e,launchers:t,onClose:r}){let n=j5r(e.focus,e.setFocus),i=o5r(O_()),o=i.includes(e.harness)?e.harness:"claude",{target:a,cloneState:s}=Y5r(e.node,e.cwd),l=Q5r(e,o,a,t,r);return(0,P6.jsx)(wbe,{onClose:r,onEntered:n.restore,centered:!0,children:(0,P6.jsx)("form",{onSubmit:l,children:(0,P6.jsxs)(eEr,{loading:e.modePending,restoreFocus:n.restore,children:[(0,P6.jsx)(U5r,{draft:e,harness:o,harnesses:i,focus:n,cloneState:s}),(0,P6.jsx)(q5r,{submitLabel:a.kind==="clone"?"Clone":MS[e.mode].submitLabel,disabled:a.kind==="blocked",loading:e.modePending})]})})})}var Mbe=E(le(),1);var $si=1e3;async function zsi(e){try{let t=e?`?cwd=${encodeURIComponent(e)}`:"",n=await(await hr(`/api/new-session-defaults${t}`)).json();return Object.hasOwn(MS,n?.mode)?n.mode:null}catch{return null}}function nEr(e,t=0){let[r,n]=(0,Mbe.useState)(null);return(0,Mbe.useEffect)(()=>{let i=!1,o,a=async()=>{let s=await zsi(e);i||(s?n({cwd:e,opens:t,mode:s}):o=setTimeout(a,$si))};return a(),()=>{i=!0,clearTimeout(o)}},[e,t]),r?{mode:r.mode,pending:r.cwd!==e||r.opens!==t}:null}function iEr(e,{visible:t,names:r,selected:n}){if(t)return e&&r.includes(e)?e:n}var IS=E(le(),1),oEr={field:"prompt",selectionStart:0,selectionEnd:0};function aEr(){let[e,t]=(0,IS.useState)(""),[r,n]=(0,IS.useState)(),[i,o]=(0,IS.useState)(),[a,s]=(0,IS.useState)("claude"),[l,u]=(0,IS.useState)(),[f,d]=(0,IS.useState)(oEr),h=(0,IS.useCallback)(()=>{t(""),n(void 0),o(void 0),u(void 0),d(oEr)},[]);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 sEr(e,t=nEr){let{selectedCwd:r}=zn(),n=Ic(),i=aEr(),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:iEr(i.node,n)}:null}function lEr(e){Po(Zn("newSession").matches,e)}var cEr=E(le(),1);function uEr(e,t){let{selectedCwd:r}=zn(),[n,i]=Kc(),o=n.get("new"),a=n.get("newCwd")??r,{setPrompt:s,setCwd:l,setFocus:u}=e??{};(0,cEr.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 dEr=E(F(),1);function fEr({launchers:e}){let[t,r]=(0,LZ.useState)(!1),[n,i]=(0,LZ.useState)(0),o=sEr(n),a=(0,LZ.useCallback)(()=>{r(!0),i(s=>s+1)},[]);return lEr(a),uEr(o,a),!t||!o?null:(0,dEr.jsx)(rEr,{draft:o,launchers:e,onClose:()=>r(!1)})}var Ibe=E(F(),1);function hEr({reconnecting:e}){return(0,Ibe.jsx)(zh,{open:e,children:(0,Ibe.jsx)(Ci,{severity:"info",variant:"filled",icon:(0,Ibe.jsx)(Fi,{size:16,color:"inherit"}),children:"Reconnecting\u2026"})})}var Fv=E(F(),1);function pEr({socket:e,onViewLaunchedSession:t}){return(0,Fv.jsxs)(Fv.Fragment,{children:[(0,Fv.jsx)(r5r,{}),(0,Fv.jsx)(fEr,{launchers:{onCreate:e.createSession,onCreateDesign:e.createDesignSession,onCreateHarness:e.createHarnessSession,onCreateAssist:e.createAssistSession}}),(0,Fv.jsx)(hEr,{reconnecting:e.reconnecting}),(0,Fv.jsx)(ic,{error:e.error,onClose:e.clearError}),(0,Fv.jsx)(i5r,{notice:e.success,onClose:e.clearSuccess,onView:t})]})}var $v=E(le(),1);var Hsi=6e4;function Usi(e,t,r){return t.map(n=>e.find(i=>i.name===n)??{name:n,local:n===r,loading:!0})}function mEr(e){let t=e.nodes?.local,r=e.names.join(`
4022
+ `,b_r={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:`${nsi} 1.8s linear infinite`},osi={display:"inline-flex",alignItems:"center",px:1.5,py:"3px",borderRadius:999,position:"relative",isolation:"isolate",fontWeight:700,animation:`${isi} 1.6s ease-in-out infinite`,"&::before":{...b_r,inset:0,zIndex:-1},"&::after":{...b_r,inset:"-5px",zIndex:-2,filter:"blur(9px)",opacity:.85},"& span":{color:ul.rainbowPill.text,textShadow:ul.rainbowPill.shadow},"@media (prefers-reduced-motion: reduce)":{animation:"none","&::before, &::after":{animation:"none"}}};function x_r({children:e}){return(0,S6.jsxs)(S6.Fragment,{children:[(0,S6.jsx)(L5,{styles:rsi}),(0,S6.jsx)(X,{component:"span","data-testid":"rainbow-pill",sx:osi,children:e})]})}function S_r({pct:e,timeLabel:t}){return[Math.round(e),...(t.match(/\d+/g)??[]).map(Number)].join(",")}function T_r(e){if(e.length!==2)return!1;let[t,r]=e;return S_r(t)===S_r(r)}var LS=E(F(),1);function w_r({rateLimits:e}){let t=D_(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=T_r(r.map(o=>({pct:o.window?.used_percentage??0,timeLabel:ybe(o.window?.resets_at,o.fallbackLabel,t)}))),i=r.map((o,a)=>(0,LS.jsxs)(C_r.Fragment,{children:[a>0?(0,LS.jsx)(X,{component:"span",sx:{color:Q$,mr:.5},children:","}):null,(0,LS.jsx)(v_r,{window:o.window,windowSeconds:o.windowSeconds,fallbackLabel:o.fallbackLabel,now:t})]},o.fallbackLabel));return n?(0,LS.jsx)(x_r,{children:i}):(0,LS.jsx)(LS.Fragment,{children:i})}var X_=E(F(),1);function __r({groups:e}){return(0,X_.jsx)(X_.Fragment,{children:e.map((t,r)=>(0,X_.jsxs)(k_r.Fragment,{children:[(0,X_.jsx)(X,{component:"span",sx:{color:Q$,ml:r>0?1:0,mr:.5},children:Bu(t.harness)}),(0,X_.jsx)(w_r,{rateLimits:t.rateLimits})]},t.harness))})}var E_r={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 asi(e){if(e==="over")return{level:"warn",boundary:100};if(e==="warn")return{level:"ok",boundary:75}}function ssi(e){if(e==="ok")return{level:"warn",boundary:75};if(e==="warn")return{level:"over",boundary:100}}function lsi(e,t,r,n){if(e>=t)return;let i=e/t;return Math.round(r-n*(1-i))}function P_r(e,t,r,n){if(t==null)return{kind:"unprojectable"};let i=gVe(t,r,n);if(i==null)return{kind:"unprojectable"};let o=I_(e,t,r,n),a=asi(o),s=ssi(o);return{kind:"projected",recovery:a&&{level:a.level,pct:a.boundary*i,at:lsi(e,a.boundary,t,r)},worse:s&&{level:s.level,pct:s.boundary*i}}}function bbe(e){return t=>t.tokens.color.onAppBar.level[e]}function L_r(e,t){return e.at==null?"not before reset":`${e.level==="ok"?"green":"under"} in ${Mve(e.at,t)}`}var Z_=E(F(),1),M_r={display:"contents"};function $Ve({direction:e,threshold:t}){let r=e==="back";if(!t)return(0,Z_.jsxs)(X,{component:"span",sx:M_r,children:[(0,Z_.jsx)("span",{}),(0,Z_.jsx)("span",{})]});let n=(0,Z_.jsx)(X,{component:"span",sx:{opacity:.6},children:r?"\u2190":"\u2192"}),i=(0,Z_.jsxs)(X,{component:"span",sx:{color:bbe(t.level),textAlign:"right"},children:[Math.round(t.pct),"%"]});return(0,Z_.jsxs)(X,{component:"span",sx:M_r,children:[r?i:n,r?n:i]})}var I_r={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 Q_=E(F(),1);function D_r({label:e,pct:t,resetsAt:r,windowSeconds:n,now:i}){let o=I_r,a=I_(t,r,n,i),s=P_r(t,r,n,i),l=s.kind==="projected"?s:void 0;return(0,Q_.jsxs)(X,{sx:o.row,children:[(0,Q_.jsx)(X,{component:"span",sx:{minWidth:"2ch"},children:e}),(0,Q_.jsx)($Ve,{direction:"back",threshold:l?.recovery}),(0,Q_.jsxs)(X,{component:"span",sx:{minWidth:"4ch",textAlign:"right",fontWeight:o.pctWeight,color:bbe(a)},children:[Math.round(t),"%"]}),(0,Q_.jsx)($Ve,{direction:"forward",threshold:l?.worse}),(0,Q_.jsx)(X,{component:"span",sx:o.note,children:l?l.recovery&&L_r(l.recovery,i):"no projection yet"})]})}function N_r(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 B_r=E(F(),1);function O_r({rateLimits:e,now:t}){return N_r(e).map(r=>(0,B_r.jsx)(D_r,{label:r.label,pct:r.pct,resetsAt:r.resetsAt,windowSeconds:r.windowSeconds,now:t},r.label))}var T6=E(F(),1);function F_r({groups:e}){let t=D_(3e4),r=E_r;return(0,T6.jsxs)(X,{sx:r.root,children:[e.map(n=>(0,T6.jsxs)(X,{sx:r.group,children:[(0,T6.jsx)(X,{sx:r.heading,children:Bu(n.harness)}),(0,T6.jsx)(O_r,{rateLimits:n.rateLimits,now:t})]},n.harness)),(0,T6.jsx)(X,{sx:r.foot,children:"Account usage per harness \u2014 view history"})]})}var zVe=E(F(),1),csi="Claude account usage (5h / 7d windows) \u2014 view history";function $_r(e){return e.length===0?{title:csi,content:"Usage"}:{title:(0,zVe.jsx)(F_r,{groups:e}),content:(0,zVe.jsx)(__r,{groups:e})}}var z_r={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}},H_r={tooltip:{sx:{p:"10px 12px",minWidth:300,maxWidth:"none"}}};var HVe=E(F(),1),usi={};function U_r({rateLimits:e,harnessRateLimits:t=usi}){let{title:r,content:n}=$_r(g_r(e,t));return(0,HVe.jsx)(sr,{title:r,placement:"top-start",slotProps:H_r,children:(0,HVe.jsx)(Qr,{component:Es,to:"/usage",underline:"none",color:"inherit",sx:z_r,children:n})})}var V_r=E(le(),1);var J_="0.964.0";var xbe=E(le(),1),UVe=(0,xbe.createContext)(null);function Sbe(){return(0,xbe.useContext)(UVe)}var WVe=E(F(),1);function W_r(){let e=Sbe();return!e||e===J_?null:(0,WVe.jsx)(sr,{title:`Daemon is running v${e}, but this page was served by v${J_}. Restart the daemon to match.`,children:(0,WVe.jsx)(lbe,{fontSize:"small",color:"warning","aria-label":"Version mismatch"})})}var G_r=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?Bv(t).active:"transparent",transition:"opacity .2s ease, background-color .2s ease, color .2s ease","&:hover, &:focus-visible":{bgcolor:t=>Bv(t).hover,color:t=>Bv(t).hoverText},"& .ready-dot":{width:6,height:6,borderRadius:"50%",bgcolor:t=>Bv(t).dot,boxShadow:t=>`0 0 0 3px ${Bv(t).dotRing}`},"& .ready-count":{fontWeight:500,color:t=>Bv(t).readyText}});var pg=E(F(),1);function q_r(){let{entries:e}=y$(),t=Xn(),r=(0,V_r.useCallback)(()=>t("/updates"),[t]),{matches:n,chords:i}=Zn("openUpdates");if(Po(n,r),!J_)return null;let o=e.filter(w$).length;return(0,pg.jsxs)(pg.Fragment,{children:[(0,pg.jsx)(sr,{describeChild:!0,placement:"top-end",title:(0,pg.jsx)(Fu,{label:"Updates",chords:i}),children:(0,pg.jsxs)(Or,{component:Es,to:"/updates","aria-label":o?`Updates: ${o} node${o>1?"s have":" has"} an update ready`:"Updates",sx:G_r(o>0),children:[o>0&&(0,pg.jsx)("span",{className:"ready-dot","aria-hidden":!0}),(0,pg.jsxs)("span",{children:["v",J_]}),o>0&&(0,pg.jsxs)("span",{className:"ready-count",children:[o," ready"]})]})}),(0,pg.jsx)(W_r,{})]})}var Tbe=E(F(),1);function j_r({socket:e}){return(0,Tbe.jsx)(p_r,{start:(0,Tbe.jsx)(U_r,{rateLimits:e.rateLimits,harnessRateLimits:e.harnessRateLimits}),end:(0,Tbe.jsx)(q_r,{})})}var Ebe=E(le(),1);var _be=E(le(),1);function Y_r(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 e5=E(F(),1),fsi={display:"flex",gap:1,alignItems:"center",minWidth:0},dsi={display:"flex",gap:1,alignItems:"baseline",minWidth:0,overflow:"hidden"},hsi={fontFamily:"fontFamilyMono",fontSize:13,whiteSpace:"nowrap"},psi={fontFamily:"fontFamilyMono",fontSize:11,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"};function msi(e){let t=e.lastIndexOf("/");return t===-1?{dir:"",basename:e}:{dir:e.slice(0,t),basename:e.slice(t+1)}}function K_r({files:e,highlight:t,onHighlight:r,onSelect:n}){return(0,e5.jsx)(Yp,{dense:!0,sx:{py:0},children:e.map((i,o)=>{let{dir:a,basename:s}=msi(i);return(0,e5.jsxs)(pn,{selected:o===t,onMouseEnter:()=>r(o),onClick:()=>n(i),sx:fsi,children:[(0,e5.jsx)(c0e,{path:i}),(0,e5.jsxs)(X,{sx:dsi,children:[(0,e5.jsx)(Le,{component:"span",sx:hsi,children:s}),(0,e5.jsx)(Le,{component:"span",color:"text.secondary",sx:psi,children:a})]})]},i)})})}var Cbe=E(F(),1),gsi={maxHeight:420,overflowY:"auto"},ysi={px:2,py:2,fontSize:13};function X_r({message:e,files:t,highlight:r,onHighlight:n,onSelect:i}){return(0,Cbe.jsx)(X,{sx:gsi,children:e?(0,Cbe.jsx)(Le,{color:"text.secondary",sx:ysi,children:e}):(0,Cbe.jsx)(K_r,{files:t,highlight:r,onHighlight:n,onSelect:i})})}var Z_r=E(F(),1),vsi={mt:6,alignSelf:"flex-start"};function wbe({onClose:e,onEntered:t,centered:r=!1,children:n}){return(0,Z_r.jsx)(Xl,{open:!0,onClose:e,maxWidth:"sm",fullWidth:!0,slotProps:{paper:{sx:r?void 0:vsi},transition:{onEntered:t}},children:n})}var kbe=E(le(),1);var Q_r={files:[],loading:!1,error:!1};function J_r(e,t){let[r,n]=(0,kbe.useState)(Q_r),i=vr();return(0,kbe.useEffect)(()=>{if(!e){n(Q_r);return}let o=!1;return n(s=>({...s,loading:!0})),(async()=>{try{let s=await hr(Kr(`/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 C6=E(F(),1);function bsi(e,t,r){let n=new URLSearchParams({path:e});return t&&n.set("cwd",t),t&&r&&n.set("node",r),`/file?${n}`}function e5r({onClose:e}){let{worktreeNode:t}=zn();return(0,C6.jsx)(xf.Provider,{value:t,children:(0,C6.jsx)(xsi,{onClose:e})})}function xsi({onClose:e}){let{worktreeCwd:t,worktreeNode:r}=zn(),[n,i]=(0,_be.useState)(""),o=J_r(t,n),a=Xn(),s=(0,_be.useRef)(null),l=p=>a(bsi(p,t,r)),{highlight:u,setHighlight:f,onKeyDown:d}=H_(o.files,n,l,e),h=p=>{l(p),e()};return(0,C6.jsxs)(wbe,{onClose:e,onEntered:()=>s.current?.focus(),children:[(0,C6.jsx)(UT,{autoFocus:!0,inputRef:s,value:n,onChange:i,onKeyDown:d,placeholder:"Search files by name..."}),(0,C6.jsx)(X_r,{message:Y_r(t,n,o),files:o.files,highlight:u,onHighlight:f,onSelect:h})]})}function t5r(e){Po(Zn("quickOpen").matches,e)}var n5r=E(F(),1);function r5r(){let[e,t]=(0,Ebe.useState)(!1);return t5r((0,Ebe.useCallback)(()=>t(!0),[])),e?(0,n5r.jsx)(e5r,{onClose:()=>t(!1)}):null}var Rbe=E(F(),1);function i5r({notice:e,onClose:t,onView:r}){let n=e?.sessionId??null;return(0,Rbe.jsx)(zh,{open:e!==null,autoHideDuration:6e3,onClose:t,children:(0,Rbe.jsx)(Ci,{severity:"success",variant:"filled",onClose:t,action:n!==null?(0,Rbe.jsx)(Mt,{color:"inherit",size:"small",onClick:()=>r(n),children:"View"}):void 0,children:e?.message})})}var LZ=E(le(),1);function o5r(e){let t=["claude"];return e.exposeCodexActions&&t.push("codex"),e.exposePiActions&&t.push("pi"),t}var v5r=E(le(),1);var a5r=E(F(),1),s5r=at((0,a5r.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 Ssi={connected:"success.main",connecting:"warning.main",disconnected:"error.main","version-blocked":"error.main"};function l5r(e){return e?Ssi[e]:"success.main"}function c5r(e){return e.split("-")[0].split(".").map(Number)}function u5r(e,t){if(!e||!t||e===t)return;let r=c5r(e),n=c5r(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 w6=E(F(),1),Tsi={height:16,fontSize:10},Csi={opacity:.6,fontSize:"0.85em"};function wsi(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 AZ({nodes:e,name:t,showVersion:r=!1}){let n=Sbe()??J_,i=e.links.find(a=>a.name===t),o=u5r(i?.peerVersion,n);return(0,w6.jsx)(sr,{title:wsi(e,t),placement:"right",children:(0,w6.jsxs)(X,{component:"span",sx:{display:"inline-flex",alignItems:"center",gap:.75},children:[(0,w6.jsx)(s5r,{sx:{fontSize:8,color:l5r(i?.state)}}),t,r&&i?.peerVersion&&(0,w6.jsxs)(X,{component:"span",sx:Csi,children:["v",i.peerVersion]}),o&&(0,w6.jsx)(Un,{label:o,size:"small",color:o==="behind"?"warning":"info",sx:Tsi})]})})}var k6=E(F(),1),ksi={opacity:.6},_si={display:"inline-flex",alignItems:"center",gap:.5,px:.5,border:1,borderStyle:"dashed",borderRadius:1};function f5r({nodes:e,name:t,clone:r}){let n=(0,k6.jsx)(AZ,{nodes:e,name:t});return r.kind==="cloned"?n:r.kind==="unavailable"?(0,k6.jsx)(X,{component:"span",sx:ksi,children:n}):(0,k6.jsx)(sr,{title:B$(t,r.cloneTarget),children:(0,k6.jsxs)(X,{component:"span",sx:_si,children:[(0,k6.jsx)(O$,{sx:{fontSize:14}}),n]})})}var h5r=E(F(),1),Esi={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 d5r({value:e,label:t,checked:r,autoFocus:n,onSelect:i}){return(0,h5r.jsx)(Or,{role:"radio","aria-checked":r,"data-value":e,tabIndex:r?0:-1,autoFocus:n&&r,onClick:i,sx:Esi,children:t})}var p5r={ArrowRight:1,ArrowLeft:-1};function Rsi(e,t,r){if(e.key==="Tab"){let n=t+(e.shiftKey?-1:1);return n>=0&&n<r?n:void 0}return(t+p5r[e.key]+r)%r}function m5r(e,t,r,n){return i=>{if(i.key==="ArrowUp"||i.key==="ArrowDown"){if(!n)return;i.preventDefault(),n();return}if(i.key!=="Tab"&&!p5r[i.key]){j2(i);return}let o=Rsi(i,e.indexOf(t),e.length);o!==void 0&&(i.preventDefault(),r(e[o]),i.currentTarget.querySelector(`[data-value="${e[o]}"]`)?.focus())}}var g5r=E(le(),1);function J$(e){return e?.querySelector('[aria-checked="true"]')}function y5r(e,t){(0,g5r.useEffect)(()=>{let r=e.current;if(!r?.contains(document.activeElement))return;let n=J$(r);n&&n!==document.activeElement&&n.focus()},[e,t])}var GVe=E(F(),1),Asi={border:1,borderColor:"divider",borderRadius:1,height:40,p:"2px",flexShrink:0};function Abe({label:e,options:t,value:r,onChange:n,optionLabel:i=u=>u,groupRef:o,autoFocus:a,onTrack:s,onToggleRow:l}){return y5r(o,r),(0,GVe.jsx)(_t,{ref:o,direction:"row",role:"radiogroup","aria-label":e,spacing:"2px",onFocus:s,onKeyDown:m5r(t,r,n,l),sx:Asi,children:t.map(u=>(0,GVe.jsx)(d5r,{value:u,label:i(u),checked:u===r,autoFocus:a,onSelect:()=>n(u)},u))})}var VVe=E(F(),1);function b5r({value:e,onChange:t,cloneState:r}){let{nodes:n,names:i,visible:o}=Ic(),a=(0,v5r.useRef)(null);return!o||!n||!e?null:(0,VVe.jsx)(Abe,{label:"Machine",options:i,value:e,onChange:t,optionLabel:s=>(0,VVe.jsx)(f5r,{nodes:n,name:s,clone:r(s)}),groupRef:a,autoFocus:!1,onTrack:()=>{}})}var Pbe=E(F(),1);function x5r({prompt:e,children:t}){return(0,Pbe.jsxs)(_t,{children:[e,(0,Pbe.jsx)(_t,{spacing:1,sx:{px:1.5,pb:1.5},children:t})]})}var T5r=E(F(),1),Psi=".MuiOutlinedInput-notchedOutline",Lsi={"& .MuiOutlinedInput-root":{px:"18px",py:2,minHeight:92,alignItems:"flex-start",bgcolor:"transparent",borderRadius:0,fontSize:15},[`&&& ${Psi}`]:{border:0},"& textarea::placeholder":{color:"text.disabled",opacity:1}};function S5r({value:e,onChange:t,placeholder:r,inputRef:n,autoFocus:i,onTrack:o}){return(0,T5r.jsx)(Gn,{sx:Lsi,value:e,onChange:a=>t(a.target.value),onKeyDown:j2,onFocus:o,onSelect:o,inputRef:n,placeholder:r,autoFocus:i,fullWidth:!0,multiline:!0,minRows:3,maxRows:12,slotProps:{htmlInput:{"aria-label":"Prompt"}}})}var _5r=E(le(),1);var MS={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:aye,submitLabel:"Start session"},design:{placeholder:"Describe the design task...",submitLabel:"Start design"}},C5r=Object.keys(MS);var qVe=E(F(),1);function w5r({anchor:e,harness:t,harnesses:r,onPick:n,onClose:i}){return(0,qVe.jsx)($s,{open:e!==null,anchorEl:e,onClose:i,slotProps:{list:{dense:!0,"aria-label":"Harness"}},children:r.map(o=>(0,qVe.jsx)(pn,{role:"menuitemradio","aria-checked":o===t,selected:o===t,onClick:()=>{n(o),i()},sx:{fontSize:13},children:Bu(o)},o))})}var _6=E(F(),1);function k5r(e){return t=>t==="prompt"&&e?(0,_6.jsxs)(_6.Fragment,{children:["prompt",(0,_6.jsx)(X,{component:"span",sx:{fontWeight:400,whiteSpace:"pre"},children:` \xB7 ${Bu(e)}`}),(0,_6.jsx)(_d,{sx:{fontSize:18,mr:-.75}})]}):t}var E6=E(F(),1);function E5r({draft:e,harness:t,harnesses:r,focus:n}){let[i,o]=(0,_5r.useState)(null),a=e.mode==="prompt"&&r.length>1,s=()=>o(J$(n.modeRef.current)??null),l=u=>{a&&u==="prompt"?s():e.setMode(u)};return(0,E6.jsxs)(E6.Fragment,{children:[(0,E6.jsx)(Abe,{label:"Mode",options:C5r,value:e.mode,onChange:l,optionLabel:k5r(r.length>1?t:void 0),groupRef:n.modeRef,autoFocus:n.autoFocus==="mode",onTrack:n.trackMode,onToggleRow:a?s:void 0}),(0,E6.jsx)(w5r,{anchor:i,harness:t,harnesses:r,onPick:e.setHarness,onClose:()=>o(null)})]})}var z5r=E(le(),1);var jVe=E(F(),1),Msi={zIndex:e=>e.zIndex.modal+1};function R5r({open:e,anchor:t,children:r}){return(0,jVe.jsx)(zP,{open:e,anchorEl:t,placement:"bottom-start",sx:Msi,children:(0,jVe.jsx)(on,{sx:{maxHeight:240,overflowY:"auto",width:t?.clientWidth},onMouseDown:n=>n.preventDefault(),children:r})})}var A5r=E(F(),1),P5r=at((0,A5r.jsx)("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6z"}),"KeyboardArrowDown");var YVe=E(F(),1),Isi={fontSize:13,height:36,pr:1,cursor:"pointer","& input":{cursor:"text"}},Dsi={fontSize:16,color:"text.disabled"};function L5r(e){return{htmlInput:{role:"combobox","aria-label":"Repo","aria-expanded":e},input:{sx:Isi,endAdornment:(0,YVe.jsx)(MSe,{position:"end",children:(0,YVe.jsx)(P5r,{sx:Dsi})})}}}var M5r=E(kP(),1);function I5r({open:e,highlighted:t,accept:r,close:n,navigate:i,openList:o}){return a=>{if(!e){if(a.key==="ArrowDown"){a.preventDefault(),o();return}j2(a);return}if(a.key!=="Escape"){if(a.key==="Enter"){if(a.preventDefault(),t===void 0)return;(0,M5r.flushSync)(()=>{r(t),n()}),j2(a);return}if(a.key!=="Tab"){i(a);return}t!==void 0&&r(t),n()}}}function D5r(e,t){let r=t.trim().toLowerCase();return r?e.filter(n=>Rv(n).toLowerCase().includes(r)):e}var KVe=E(le(),1);function N5r(){let[e,t]=(0,KVe.useState)(!1),[r,n]=(0,KVe.useState)("");return{open:e,query:r,show:()=>t(!0),filterBy:i=>{n(i),t(!0)},close:()=>{t(!1),n("")}}}var B5r=E(le(),1);var O5r=e=>e?Rv(e):"";function F5r(e){let[t,r]=(0,B5r.useState)(()=>O5r(e));return{text:t,setText:r,showRepo:n=>r(O5r(n))}}function $5r(e,t,r){let n=N5r(),i=F5r(t),o=D5r(e,n.query),a=f=>{r(f),i.showRepo(f)},s=H_(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:I5r({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 ez=E(F(),1);function H5r({repos:e,value:t,onChange:r,inputRef:n,autoFocus:i,onTrack:o}){let a=$5r(e,t,r),s=(0,z5r.useRef)(null);return(0,ez.jsxs)(X,{ref:s,sx:{flex:1,minWidth:0},children:[(0,ez.jsx)(Gn,{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:L5r(a.open)}),(0,ez.jsx)(R5r,{open:a.open,anchor:s.current,children:(0,ez.jsx)(nbe,{repos:a.filtered,selected:t,highlight:a.highlight,onHighlight:a.setHighlight,onSelect:a.pick})})]})}var t5=E(F(),1);function U5r({cloneState:e,...t}){let{draft:r,focus:n}=t,{repos:i}=zn();return(0,t5.jsxs)(x5r,{prompt:(0,t5.jsx)(S5r,{value:r.prompt,onChange:r.setPrompt,placeholder:MS[r.mode].placeholder,inputRef:n.promptRef,autoFocus:n.autoFocus==="prompt",onTrack:n.trackPrompt}),children:[(0,t5.jsxs)(_t,{direction:"row",spacing:1,sx:{alignItems:"flex-start"},children:[(0,t5.jsx)(H5r,{repos:i,value:r.cwd,onChange:r.setCwd,inputRef:n.repoRef,autoFocus:n.autoFocus==="repo",onTrack:n.trackRepo}),(0,t5.jsx)(E5r,{...t})]}),(0,t5.jsx)(b5r,{value:r.node,onChange:r.setNode,cloneState:e})]})}var V5r=E(F(),1),W5r=[["Enter","start"],["Shift+Enter","newline"],["Esc","close"]];function G5r({submitLabel:e,disabled:t=!1,loading:r=!1}){return(0,V5r.jsx)(Mt,{type:"submit",variant:"contained",disabled:t,loading:r,children:e})}var R6=E(F(),1),Nsi=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"}),Osi=e=>({mr:.5,px:"5px",border:1,borderColor:"divider",borderRadius:"4px",fontFamily:e.typography.fontFamilyMono,fontSize:10.5,color:"text.primary"});function q5r(e){return(0,R6.jsxs)(_t,{direction:"row",sx:Nsi,children:[W5r.map(([t,r])=>(0,R6.jsxs)("span",{children:[(0,R6.jsx)(X,{component:"kbd",sx:Osi,children:t}),r]},t)),(0,R6.jsx)(X,{sx:{flex:1}}),(0,R6.jsx)(G5r,{...e})]})}var A6=E(le(),1);function j5r(e,t){let r=(0,A6.useRef)(e),n=(0,A6.useRef)(null),i=(0,A6.useRef)(null),o=(0,A6.useRef)(null),a=(0,A6.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:J$(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 Bsi(e,t,r){return e?r.kind==="cloned"?{kind:"launch",cwd:r.cwd}:r.kind==="clonable"?{kind:"clone",prompt:obe(r,t)}:{kind:"blocked"}:{kind:"launch",cwd:e}}function Y5r(e,t){let{names:r,visible:n}=Ic(),i=ebe(t,n?r:[void 0]);return{cloneState:i,target:Bsi(t,e,i(e))}}function K5r({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}]:[];Rhr(MS[e].sessionMode,n,(u,f)=>o.onCreateAssist(u,f,...l),()=>{},r)}function X5r(e,t,r,n){return r.kind==="blocked"||e.modePending?!1:r.kind==="clone"?(qve(r.prompt,n.onCreateAssist),!0):(K5r({mode:e.mode,harness:t,prompt:e.prompt,cwd:r.cwd,node:e.node},n),e.clear(),!0)}var Lbe=E(le(),1);function Z5r(e,t){let[r,n]=(0,Lbe.useState)(!1);return(0,Lbe.useEffect)(()=>{!r||e.modePending||(n(!1),t())},[r,e.modePending,t]),()=>{e.modePending?n(!0):t()}}function Q5r(e,t,r,n,i){let o=Z5r(e,()=>{X5r(e,t,r,n)&&i()});return a=>{a.preventDefault(),o()}}var PZ=E(le(),1);function J5r(e,t){let r=(0,PZ.useRef)(e),n=(0,PZ.useRef)(null);return(0,PZ.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 tEr=E(F(),1),Fsi={border:0,margin:0,padding:0,minWidth:0};function eEr({loading:e,restoreFocus:t,children:r}){let n=J5r(e,t);return(0,tEr.jsx)("fieldset",{disabled:e,style:Fsi,onFocus:n,children:r})}var P6=E(F(),1);function rEr({draft:e,launchers:t,onClose:r}){let n=j5r(e.focus,e.setFocus),i=o5r(O_()),o=i.includes(e.harness)?e.harness:"claude",{target:a,cloneState:s}=Y5r(e.node,e.cwd),l=Q5r(e,o,a,t,r);return(0,P6.jsx)(wbe,{onClose:r,onEntered:n.restore,centered:!0,children:(0,P6.jsx)("form",{onSubmit:l,children:(0,P6.jsxs)(eEr,{loading:e.modePending,restoreFocus:n.restore,children:[(0,P6.jsx)(U5r,{draft:e,harness:o,harnesses:i,focus:n,cloneState:s}),(0,P6.jsx)(q5r,{submitLabel:a.kind==="clone"?"Clone":MS[e.mode].submitLabel,disabled:a.kind==="blocked",loading:e.modePending})]})})})}var Mbe=E(le(),1);var $si=1e3;async function zsi(e){try{let t=e?`?cwd=${encodeURIComponent(e)}`:"",n=await(await hr(`/api/new-session-defaults${t}`)).json();return Object.hasOwn(MS,n?.mode)?n.mode:null}catch{return null}}function nEr(e,t=0){let[r,n]=(0,Mbe.useState)(null);return(0,Mbe.useEffect)(()=>{let i=!1,o,a=async()=>{let s=await zsi(e);i||(s?n({cwd:e,opens:t,mode:s}):o=setTimeout(a,$si))};return a(),()=>{i=!0,clearTimeout(o)}},[e,t]),r?{mode:r.mode,pending:r.cwd!==e||r.opens!==t}:null}function iEr(e,{visible:t,names:r,selected:n}){if(t)return e&&r.includes(e)?e:n}var IS=E(le(),1),oEr={field:"prompt",selectionStart:0,selectionEnd:0};function aEr(){let[e,t]=(0,IS.useState)(""),[r,n]=(0,IS.useState)(),[i,o]=(0,IS.useState)(),[a,s]=(0,IS.useState)("claude"),[l,u]=(0,IS.useState)(),[f,d]=(0,IS.useState)(oEr),h=(0,IS.useCallback)(()=>{t(""),n(void 0),o(void 0),u(void 0),d(oEr)},[]);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 sEr(e,t=nEr){let{selectedCwd:r}=zn(),n=Ic(),i=aEr(),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:iEr(i.node,n)}:null}function lEr(e){Po(Zn("newSession").matches,e)}var cEr=E(le(),1);function uEr(e,t){let{selectedCwd:r}=zn(),[n,i]=Kc(),o=n.get("new"),a=n.get("newCwd")??r,{setPrompt:s,setCwd:l,setFocus:u}=e??{};(0,cEr.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 dEr=E(F(),1);function fEr({launchers:e}){let[t,r]=(0,LZ.useState)(!1),[n,i]=(0,LZ.useState)(0),o=sEr(n),a=(0,LZ.useCallback)(()=>{r(!0),i(s=>s+1)},[]);return lEr(a),uEr(o,a),!t||!o?null:(0,dEr.jsx)(rEr,{draft:o,launchers:e,onClose:()=>r(!1)})}var Ibe=E(F(),1);function hEr({reconnecting:e}){return(0,Ibe.jsx)(zh,{open:e,children:(0,Ibe.jsx)(Ci,{severity:"info",variant:"filled",icon:(0,Ibe.jsx)(Fi,{size:16,color:"inherit"}),children:"Reconnecting\u2026"})})}var Fv=E(F(),1);function pEr({socket:e,onViewLaunchedSession:t}){return(0,Fv.jsxs)(Fv.Fragment,{children:[(0,Fv.jsx)(r5r,{}),(0,Fv.jsx)(fEr,{launchers:{onCreate:e.createSession,onCreateDesign:e.createDesignSession,onCreateHarness:e.createHarnessSession,onCreateAssist:e.createAssistSession}}),(0,Fv.jsx)(hEr,{reconnecting:e.reconnecting}),(0,Fv.jsx)(ic,{error:e.error,onClose:e.clearError}),(0,Fv.jsx)(i5r,{notice:e.success,onClose:e.clearSuccess,onView:t})]})}var $v=E(le(),1);var Hsi=6e4;function Usi(e,t,r){return t.map(n=>e.find(i=>i.name===n)??{name:n,local:n===r,loading:!0})}function mEr(e){let t=e.nodes?.local,r=e.names.join(`
4023
4023
  `),[n,i]=(0,$v.useState)([]),o=(0,$v.useRef)(0),a=(0,$v.useCallback)(()=>{let l=r?r.split(`
4024
4024
  `):[];if(l.length===0)return;let u=++o.current;i(f=>Usi(f,l,t));for(let f of l)wve(f,f===t).then(d=>{u===o.current&&i(h=>h.map(p=>p.name===f?d:p))})},[r,t]);(0,$v.useEffect)(()=>{a();let l=setInterval(a,Hsi);return()=>clearInterval(l)},[a]);let s=n.length===0;return(0,$v.useMemo)(()=>({entries:n,loading:s,refresh:a}),[n,s,a])}var r5=E(F(),1);function gEr({shell:e,children:t}){let{socket:r,selection:n,launch:i,sidebarCollapse:o}=e,a=mEr(r.nodeSelection);return(0,r5.jsx)(sVe.Provider,{value:a,children:(0,r5.jsx)(t_e.Provider,{value:o,children:(0,r5.jsx)(sW.Provider,{value:n,children:(0,r5.jsx)(_Ve.Provider,{value:r.nodeSelection,children:(0,r5.jsx)(xf.Provider,{value:n.selectedNode,children:(0,r5.jsx)(VHe.Provider,{value:i,children:(0,r5.jsx)(Tat,{children:t})})})})})})})}var yEr=E(F(),1),vEr=at((0,yEr.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 bEr=E(le(),1);var H0=E(F(),1),Wsi={ml:1,textTransform:"none",fontSize:12};function xEr(){let{nodes:e,names:t,visible:r,selected:n,select:i}=Ic(),[o,a]=(0,bEr.useState)(null);return!r||!e||!n?null:(0,H0.jsxs)(H0.Fragment,{children:[(0,H0.jsx)(Mt,{size:"small",color:"inherit",startIcon:(0,H0.jsx)(vEr,{fontSize:"small"}),"aria-label":"Machine","aria-haspopup":"menu",onClick:s=>a(s.currentTarget),sx:Wsi,children:(0,H0.jsx)(AZ,{nodes:e,name:n})}),(0,H0.jsx)($s,{anchorEl:o,open:!!o,onClose:()=>a(null),children:t.map(s=>(0,H0.jsx)(pn,{selected:s===n,onClick:()=>{i(s),a(null)},sx:{fontSize:13},children:(0,H0.jsx)(AZ,{nodes:e,name:s,showVersion:!0})},s))})]})}var MZ=E(le(),1);function SEr(e,t){return[...e[0].slice(0,-1),String(t+1)]}var L6=E(F(),1),Gsi=[Ua("secondary"),{ml:.75}];function TEr({index:e,label:t,count:r,...n}){let{chords:i}=Zn("navTab");return(0,L6.jsx)(sr,{describeChild:!0,title:(0,L6.jsx)(Fu,{label:t,chords:[SEr(i,e)]}),children:(0,L6.jsx)(hb,{label:r?(0,L6.jsxs)("span",{children:[t,(0,L6.jsx)(X,{component:"span",sx:Gsi,children:r})]}):t,...n})})}var CEr=E(le(),1);var Vsi=6e4;function wEr(){let e=h0e();return(0,CEr.useEffect)(()=>{B2.refresh();let t=setInterval(()=>{B2.refresh()},Vsi);return()=>clearInterval(t)},[]),e?.length??0}var XVe=E(le(),1);function kEr(e,t){let{bound:r}=Zn("navTab"),n=e.length,i=(0,XVe.useCallback)(a=>(yW(a,r)??n)<n,[r,n]),o=(0,XVe.useCallback)(a=>{let s=e[yW(a,r)??-1];s&&t(s)},[e,t,r]);Po(i,o)}var Dbe=E(le(),1);function _Er(){let[e,t]=(0,Dbe.useState)(!1);return(0,Dbe.useEffect)(()=>{let r=!1;return(async()=>{try{let i=await(await hr("/api/news/nav")).json();r||t(i?.showInNav===!0)}catch{r||t(!1)}})(),()=>{r=!0}},[]),e}var Nbe=E(le(),1);async function qsi(e,t){let r=await hr(Kr(`/api/releases/configured?cwd=${encodeURIComponent(e)}`,t));return r.ok?(await r.json())?.configured===!0:void 0}function EEr(e){let[t,r]=(0,Nbe.useState)(null),n=vr(),i=`${n??""}\0${e}`;return(0,Nbe.useEffect)(()=>{if(!e)return;let o=!1;return qsi(e,n).catch(()=>{}).then(a=>{o||r({key:i,configured:a})}),()=>{o=!0}},[e,n,i]),t?.key===i?t.configured:void 0}var REr=E(le(),1);function AEr(e){let{pathname:t}=Vo(),r=Xn(),n=t==="/releases"||t.startsWith("/releases/");(0,REr.useEffect)(()=>{e===!1&&n&&r("/sessions",{replace:!0})},[e,n,r])}var jsi={path:"/sessions",label:"Sessions"},Ysi={path:"/backlog",label:"Backlog"},Ksi={path:"/next",label:"Next"},Xsi={path:"/releases",label:"Releases"},Zsi={path:"/news",label:"News"},Qsi={path:"/inbox",label:"Inbox"};function PEr(e,t){return[jsi,Ysi,Ksi,...e?[Xsi]:[],...t?[Zsi]:[],Qsi]}var ZVe=E(F(),1),Jsi={mx:"6px"};function LEr({cwd:e}){let t=Vo(),r=Xn(),n=EEr(e),i=_Er(),o=wEr();AEr(n);let a=n===!0,s=(0,MZ.useMemo)(()=>PEr(a,i),[a,i]),l=(0,MZ.useMemo)(()=>s.map(d=>d.path),[s]),u=s.findIndex(d=>t.pathname.startsWith(d.path)),f=(0,MZ.useCallback)(d=>{t.pathname!==d&&r(d)},[t.pathname,r]);return kEr(l,f),(0,ZVe.jsx)(lE,{sx:Jsi,value:u===-1?!1:u,textColor:"inherit",indicatorColor:"secondary",children:s.map((d,h)=>(0,ZVe.jsx)(TEr,{index:h,label:d.label,count:d.path==="/inbox"?o:void 0,onClick:()=>f(d.path)},d.path))})}var IZ=E(F(),1),MEr=(e,t)=>({bgcolor:e,color:t,"& .MuiSvgIcon-root":{color:t},transition:"filter 0.2s ease, transform 0.2s ease","&:hover":{bgcolor:e,color:t,filter:"brightness(1.08)"},"&:active":{transform:"translateY(1px)"}}),eli=e=>({ml:.75,...e.tokens.color.appBar?MEr("primary.main","primary.contrastText"):MEr("primary.contrastText","primary.main")});function IEr(){let[,e]=Kc(),{label:t,chords:r}=Zn("newSession");return(0,IZ.jsx)(sr,{title:(0,IZ.jsx)(Fu,{label:t,chords:r}),children:(0,IZ.jsx)(Qt,{sx:eli,"aria-label":"New session",onClick:()=>e(i=>(i.set("new",""),i),{replace:!0}),children:(0,IZ.jsx)(rC,{})})})}var Obe=E(le(),1);var DZ=E(F(),1),tli={strokeWidth:2};function DEr(e){return(0,DZ.jsxs)(cye,{viewBox:"0 0 24 24",sx:tli,...e,children:[(0,DZ.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,DZ.jsx)("path",{d:"M9 18c-4.51 2-5-2-7-2"})]})}var NZ=E(F(),1);function NEr({cwd:e}){let[t,r]=(0,Obe.useState)(null),n=vr();return(0,Obe.useEffect)(()=>{if(!e){r(null);return}let i=!1;return(async()=>{try{let a=await(await hr(Kr(`/api/github-url?cwd=${encodeURIComponent(e)}`,n))).json();i||r(a?.url??null)}catch{i||r(null)}})(),()=>{i=!0}},[e,n]),t?(0,NZ.jsx)(sr,{title:"Open in GitHub",children:(0,NZ.jsx)(X,{component:"span",sx:uye,children:(0,NZ.jsx)(Qt,{onClick:()=>window.open(t,"_blank"),children:(0,NZ.jsx)(DEr,{})})})}):null}var U0=E(F(),1),rli={color:"inherit",mr:1.5};function OEr({reconnecting:e}){let{pending:t,error:r,clearError:n,restart:i}=M_("webserver",e);return(0,U0.jsxs)(U0.Fragment,{children:[(0,U0.jsx)(sr,{title:"Restart web server",children:(0,U0.jsx)("span",{children:(0,U0.jsx)(Qt,{sx:rli,disabled:t,onClick:i,children:t?(0,U0.jsx)(Fi,{size:24}):(0,U0.jsx)(Tve,{})})})}),(0,U0.jsx)(ic,{error:r,onClose:n})]})}var $Er=E(le(),1);var BEr=E(le(),1);function FEr(e){let t=$n().palette.primary.main;Po(Zn("focusRepoPicker").matches,(0,BEr.useCallback)(()=>rc({locate:()=>e.current?.querySelector("button")??null,focus:r=>r.focus()},t),[e,t]))}var OZ=E(F(),1),nli={width:240,ml:2};function zEr({repos:e,selected:t,onSelect:r}){let n=(0,$Er.useRef)(null);FEr(n);let{chords:i}=Zn("focusRepoPicker");return(0,OZ.jsx)(X,{ref:n,sx:nli,children:(0,OZ.jsx)(sye,{label:t?Rv(t):"Select repo...",tooltip:(0,OZ.jsx)(Fu,{label:"Repo",chords:i}),typeToOpen:!0,children:(o,a)=>(0,OZ.jsx)(awr,{repos:e,selected:t,onSelect:r,close:o,initialFilter:a})})})}var XEr=E(le(),1);var BZ=E(le(),1);function Bbe(e){let[t,r]=(0,BZ.useState)([]),[n,i]=(0,BZ.useState)(!0),o=vr();return(0,BZ.useEffect)(()=>{if(!e){r([]),i(!1);return}let a=!1;return i(!0),hr(Kr(`/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 QVe=E(F(),1);function JVe({text:e}){return(0,QVe.jsx)(X,{sx:{p:1.5},children:(0,QVe.jsx)(Le,{sx:{fontSize:13,color:"text.secondary"},children:e})})}var M6=E(F(),1);function HEr({pr:e,highlighted:t,onHover:r,onPick:n}){let i=rbe(t);return(0,M6.jsx)(pn,{ref:i,selected:t,onMouseDown:o=>o.preventDefault(),onMouseEnter:r,onClick:()=>n(e),sx:{alignItems:"flex-start",py:.75,whiteSpace:"normal"},children:(0,M6.jsxs)(_t,{spacing:.25,sx:{minWidth:0},children:[(0,M6.jsxs)(Le,{sx:{fontSize:13,lineHeight:1.3,fontWeight:500},children:[e.title,e.isDraft&&(0,M6.jsx)(Un,{label:"Draft",size:"small",variant:"outlined",sx:{ml:.75,height:18,fontSize:10,verticalAlign:"middle"}})]}),(0,M6.jsxs)(Le,{sx:{fontSize:11,color:"text.secondary"},children:["#",e.number," \xB7 ",e.author," \xB7 ",zi(e.createdAt)]})]})})}var eqe=E(F(),1);function UEr({prs:e,highlight:t,onHighlight:r,onPick:n}){return(0,eqe.jsx)(Yp,{dense:!0,disablePadding:!0,sx:{maxHeight:200,overflowY:"auto"},children:e.map((i,o)=>(0,eqe.jsx)(HEr,{pr:i,highlighted:o===t,onHover:()=>r(o),onPick:n},i.number))})}var GEr=E(le(),1);function WEr(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 VEr(e,t,r){let[n,i]=(0,GEr.useState)(""),o=WEr(e,n),{highlight:a,setHighlight:s,onKeyDown:l}=H_(o,n,t,r);return{filter:n,setFilter:i,filtered:o,highlight:a,setHighlight:s,onKeyDown:l,select:f=>{t(f),r()}}}var n5=E(F(),1),qEr={...kF,left:"auto",width:320,maxHeight:"none",overflowY:"visible"};function jEr({cwd:e,onPick:t,close:r}){let{prs:n,loading:i}=Bbe(e),o=VEr(n,t,r);return i||n.length===0?(0,n5.jsx)(on,{elevation:4,sx:qEr,children:(0,n5.jsx)(JVe,{text:i?"Loading open PRs\u2026":"No open PRs"})}):(0,n5.jsxs)(on,{elevation:4,sx:qEr,children:[(0,n5.jsx)(UT,{autoFocus:!0,value:o.filter,onChange:o.setFilter,onKeyDown:o.onKeyDown,placeholder:"Filter PRs..."}),o.filtered.length===0?(0,n5.jsx)(JVe,{text:"No PRs match"}):(0,n5.jsx)(UEr,{prs:o.filtered,highlight:o.highlight,onHighlight:o.setHighlight,onPick:o.select})]})}var KEr=E(F(),1);function YEr({cwd:e,onPick:t,close:r}){return(0,KEr.jsx)(jEr,{cwd:e,onPick:t,close:r})}var i5=E(F(),1);function ZEr({cwd:e,disabled:t,onSelect:r}){let{prs:n,loading:i}=Bbe(e),[o,a]=(0,XEr.useState)(null);return i||n.length===0?null:(0,i5.jsxs)(i5.Fragment,{children:[(0,i5.jsx)(sye,{label:"prs",disabled:t,children:s=>(0,i5.jsx)(YEr,{cwd:e,onPick:a,close:s})}),o&&(0,i5.jsx)(B0e,{pr:o,onSelect:s=>{r(o,s),a(null)},onCancel:()=>a(null)})]})}var JEr=E(F(),1);function QEr({onStartRun:e,cwd:t}){let r=rye(t);return!t||r.length===0?null:(0,JEr.jsx)(eye,{runs:r,onSelect:n=>e(n,t)})}var FZ=E(F(),1);function e4r({onCreateAssist:e,onStartRun:t}){let{selectedCwd:r,selectedNode:n}=zn();return(0,FZ.jsxs)(_t,{direction:"row",spacing:.5,sx:{alignItems:"center","&:not(:empty)":{ml:1.5}},children:[(0,FZ.jsx)(ZEr,{cwd:r,disabled:!r,onSelect:(i,o)=>e([...o,String(i.number)],r,{...lF(i),node:n})}),(0,FZ.jsx)(QEr,{onStartRun:(i,o)=>t(i,o,void 0,void 0,n),cwd:r})]})}var Lp=E(F(),1),ili={minHeight:48,pl:1,pr:14};function t4r({socket:e,selection:t}){let{collapsed:r,onToggleCollapsed:n}=tC();return(0,Lp.jsxs)(sE,{variant:"dense",disableGutters:!0,sx:ili,children:[r&&(0,Lp.jsx)(Hne,{collapsed:r,onToggleCollapsed:n}),(0,Lp.jsx)(OEr,{reconnecting:e.reconnecting}),(0,Lp.jsx)(LEr,{cwd:t.selectedCwd}),(0,Lp.jsx)(xEr,{}),(0,Lp.jsx)(zEr,{repos:t.repos,selected:t.selectedCwd,onSelect:t.setSelectedCwd}),(0,Lp.jsxs)(X,{sx:{display:"flex",alignItems:"center",ml:1},children:[(0,Lp.jsx)(fye,{cwd:t.selectedCwd}),(0,Lp.jsx)(NEr,{cwd:t.selectedCwd}),(0,Lp.jsx)(IEr,{})]}),(0,Lp.jsx)(e4r,{onCreateAssist:e.createAssistSession,onStartRun:e.startRun})]})}var Fbe=E(le(),1);function r4r(){let[e,t]=(0,Fbe.useState)(null);return(0,Fbe.useEffect)(()=>{let r=!1;return(async()=>{try{let i=await(await hr("/api/health")).json();!r&&typeof i?.nodeName=="string"&&t(i.nodeName)}catch{}})(),()=>{r=!0}},[]),e}var i4r=E(F(),1),oli={lineHeight:"32px",bgcolor:"transparent"};function n4r(){let e=r4r();return e?(0,i4r.jsx)(uSe,{sx:oli,children:e}):null}var o4r=E(F(),1),a4r=at((0,o4r.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 s4r=E(F(),1),l4r=at((0,s4r.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 c4r=E(F(),1),u4r=at((0,c4r.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 f4r=E(F(),1),d4r=at((0,f4r.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 tqe=E(F(),1);function h4r({mode:e}){return e==="dark"?(0,tqe.jsx)(d4r,{fontSize:"small"}):(0,tqe.jsx)(u4r,{fontSize:"small"})}var p4r=E(F(),1),m4r=at((0,p4r.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 tz=E(F(),1);function g4r(){let e=V0e();return(0,tz.jsxs)(pn,{onClick:()=>q0t(!e),children:[(0,tz.jsx)(sT,{children:(0,tz.jsx)(m4r,{fontSize:"small"})}),(0,tz.jsx)(jp,{children:e?"Hide render HUD":"Show render HUD"})]})}var gl=E(F(),1);function y4r({mode:e,restartLabel:t,updateLabel:r,onToggleColorMode:n,onShowShortcuts:i,onRestart:o,onUpdate:a}){return[(0,gl.jsxs)(pn,{onClick:n,children:[(0,gl.jsx)(sT,{children:(0,gl.jsx)(h4r,{mode:e})}),(0,gl.jsx)(jp,{children:"Toggle dark mode"})]},"color-mode"),(0,gl.jsx)(g4r,{},"render-hud"),(0,gl.jsxs)(pn,{onClick:i,children:[(0,gl.jsx)(sT,{children:(0,gl.jsx)(a4r,{fontSize:"small"})}),(0,gl.jsx)(jp,{children:"Keyboard shortcuts"})]},"shortcuts"),(0,gl.jsx)(ni,{},"restart-divider"),(0,gl.jsxs)(pn,{onClick:o,children:[(0,gl.jsx)(sT,{children:(0,gl.jsx)(A7,{fontSize:"small"})}),(0,gl.jsx)(jp,{children:t})]},"restart"),(0,gl.jsxs)(pn,{onClick:a,children:[(0,gl.jsx)(sT,{children:(0,gl.jsx)(l4r,{fontSize:"small"})}),(0,gl.jsx)(jp,{children:r})]},"update")]}var v4r=E(le(),1);var x4r=E(F(),1);function b4r({peer:e,onRestart:t,onClose:r}){let[n,i]=(0,v4r.useState)(!1);return(0,x4r.jsx)(wi,{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 S4r(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 ali=Object.keys(w7);function T4r(){let e=k7();return S4r(ali.map(t=>YT(t,e)))}var Mp=E(F(),1),sli={display:"flex",alignItems:"center",justifyContent:"space-between",pr:1},lli={display:"flex",alignItems:"center",justifyContent:"space-between",gap:2,py:.5};function C4r({onClose:e}){let t=T4r();return(0,Mp.jsxs)(Xl,{open:!0,onClose:e,maxWidth:"xs",fullWidth:!0,"aria-labelledby":"shortcuts-dialog-title",children:[(0,Mp.jsxs)(Lu,{id:"shortcuts-dialog-title",sx:sli,children:["Keyboard shortcuts",(0,Mp.jsx)(Qt,{size:"small","aria-label":"Close",onClick:e,children:(0,Mp.jsx)(Ao,{fontSize:"small"})})]}),(0,Mp.jsx)(Pu,{dividers:!0,children:t.map(r=>(0,Mp.jsxs)(X,{component:"section",sx:{mb:1.5},children:[(0,Mp.jsx)(Le,{variant:"overline",color:"text.secondary",children:r.name}),r.shortcuts.map(n=>(0,Mp.jsxs)(X,{sx:lli,children:[(0,Mp.jsx)(Le,{variant:"body2",children:n.label}),(0,Mp.jsx)(_t,{direction:"row",spacing:.5,children:(0,Mp.jsx)(yne,{chords:n.chords})})]},n.label))]},r.name))})]})}var I6=E(F(),1);function w4r({reconnecting:e,onClose:t}){let{pending:r,error:n,clearError:i,restart:o}=M_(E$.target,e);return(0,I6.jsxs)(I6.Fragment,{children:[(0,I6.jsx)(wi,{title:E$.label,message:E$.message,confirmLabel:"Restart",busy:r,autoFocusConfirm:!0,onConfirm:()=>{o()},onCancel:t}),(0,I6.jsx)(ic,{error:n,onClose:i})]})}var _4r=E(F(),1);function cli(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 k4r({peer:e,onConfirm:t,onClose:r}){return(0,_4r.jsx)(wi,{...cli(e),confirmLabel:"Update",onConfirm:()=>{t(),r()},onCancel:r})}var W0=E(le(),1);async function uli(e){try{let t=await hr(`/api/node-doctor?link=${encodeURIComponent(e)}`);return t.ok?(await t.json()).hop:null}catch{return null}}async function E4r(e,t){let r=await uli(e);if(!r)return t;let n=r.remediation?` \u2014 ${r.remediation}`:"";return`${t}: ${r.hop} hop failed: ${r.error}${n}`}var DS=E(le(),1);function R4r(e){let{nodes:t}=Ic(),[r,n]=(0,DS.useState)(null),i=(0,DS.useRef)(!1),o=r?t?.links.find(l=>l.name===r.peer):void 0;(0,DS.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,DS.useCallback)((l,u)=>{i.current=!1,n({peer:l,describe:u})},[]),s=(0,DS.useCallback)(()=>n(null),[]);return{watch:a,stop:s}}var fli=9e4;function $be(){let[e,t]=(0,W0.useState)(null),[r,n]=(0,W0.useState)(null),i=(0,W0.useRef)(void 0),o=(0,W0.useCallback)(f=>{clearTimeout(i.current),t(f)},[]),{watch:a,stop:s}=R4r(o);(0,W0.useEffect)(()=>()=>clearTimeout(i.current),[]);let l=(0,W0.useCallback)(async(f,d)=>{n(await E4r(f,d))},[]);return{requestThenAwait:(0,W0.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`)},fli),!0):(await l(f,`${d} failed (${await _$(m)})`),!1)},[l,a,s]),back:e,clearBack:()=>t(null),error:r,clearError:()=>n(null)}}var dli=(e,t)=>t?`${e} is back (v${t})`:`${e} is back`;function A4r(){let{requestThenAwait:e,...t}=$be();return{restart:n=>e(n,`Restart ${n}`,()=>L_("both",n),dli),...t}}var $Z=E(le(),1);var G0=E(le(),1);function P4r(e){return e.commandType==="assist"&&e.assistArgs?.[0]==="update"&&e.status==="done"}function zbe(e,t,r){let[n,i]=(0,G0.useState)(!1),[o,a]=(0,G0.useState)(!1),s=(0,G0.useRef)(!1),l=(0,G0.useRef)(e);l.current=e;let u=(0,G0.useRef)(new Set),f=(0,G0.useCallback)(()=>{s.current=!1,a(!1),u.current=new Set(l.current.filter(P4r).map(d=>d.id)),i(!0)},[]);return(0,G0.useEffect)(()=>{if(!n||o)return;if(t){s.current=!0;return}if(!s.current)return;e.some(h=>P4r(h)&&h.node===r&&!u.current.has(h.id))&&a(!0)},[n,o,t,e,r]),{arm:f,completed:o}}var L4r=(e,t)=>t?`${e} updated to v${t}`:`${e} updated`;function hli(e){return hr(`/api/self-update?node=${encodeURIComponent(e)}`,{method:"POST"})}function M4r(e){let{nodes:t}=Ic(),{launchAssist:r}=fl(),{requestThenAwait:n,...i}=$be(),[o,a]=(0,$Z.useState)(null),[s,l]=(0,$Z.useState)(),u=m=>t?.links.find(g=>g.name===m)?.state,{arm:f,completed:d}=zbe(e,u(s)!=="connected",s);(0,$Z.useEffect)(()=>{!d||!s||(l(void 0),n(s,`Restart ${s}'s web server`,()=>L_("webserver",s),L4r))},[d,s,n]);let h=async m=>{a(`Updating assist on ${m}\u2026`),await n(m,`Update ${m}`,()=>hli(m),L4r),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 V0=E(F(),1);function I4r({dialog:e,peer:t,sessions:r,reconnecting:n,onClose:i}){let{launchAssist:o,armUpdateReload:a}=fl(),s=A4r(),l=M4r(r);return(0,V0.jsxs)(V0.Fragment,{children:[e==="shortcuts"&&(0,V0.jsx)(C4r,{onClose:i}),e==="restart"&&t&&(0,V0.jsx)(b4r,{peer:t,onRestart:s.restart,onClose:i}),e==="restart"&&!t&&(0,V0.jsx)(w4r,{reconnecting:n,onClose:i}),e==="update"&&(0,V0.jsx)(k4r,{peer:t,onConfirm:()=>{if(t){l.update(t);return}a(),o(["update"])},onClose:i}),(0,V0.jsx)(QX,{notices:s}),(0,V0.jsx)(QX,{notices:l})]})}var D4r=E(F(),1),N4r=at((0,D4r.jsx)("path",{d:"M11 18h2v-2h-2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4"}),"HelpOutlineOutlined");var Hbe=E(F(),1),pli="https://staffordwilliams.com/assist";function O4r(){return(0,Hbe.jsx)(sr,{title:"Help",children:(0,Hbe.jsx)(Qt,{component:"a",href:pli,target:"_blank",rel:"noopener noreferrer","aria-label":"Help",size:"small",sx:{color:"inherit"},children:(0,Hbe.jsx)(N4r,{fontSize:"small"})})})}var B4r=E(F(),1),F4r=at((0,B4r.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 $4r=E(le(),1);var zZ=E(F(),1);function z4r(){let e=Xn(),t=(0,$4r.useCallback)(()=>e("/config"),[e]),{matches:r,chords:n}=Zn("openConfig");return Po(r,t),(0,zZ.jsx)(sr,{describeChild:!0,title:(0,zZ.jsx)(Fu,{label:"Config",chords:n}),children:(0,zZ.jsx)(Qt,{size:"small",sx:{color:"inherit"},"aria-label":"Config",onClick:t,children:(0,zZ.jsx)(F4r,{fontSize:"small"})})})}var H4r=E(F(),1),U4r=at((0,H4r.jsx)("path",{d:"M3 18h18v-2H3zm0-5h18v-2H3zm0-7v2h18V6z"}),"Menu");var Ube=E(le(),1);var HZ=E(F(),1);function W4r({open:e,onOpen:t}){let r=(0,Ube.useRef)(null),{matches:n,chords:i}=Zn("openMenu");return Po(n,(0,Ube.useCallback)(()=>{r.current&&t(r.current)},[t])),(0,HZ.jsx)(sr,{describeChild:!0,title:(0,HZ.jsx)(Fu,{label:"Menu",chords:i}),children:(0,HZ.jsx)(Qt,{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,HZ.jsx)(U4r,{fontSize:"small"})})})}var rz=E(F(),1);function G4r({open:e,onOpen:t}){return(0,rz.jsxs)(X,{sx:{position:"fixed",top:8,right:16,zIndex:r=>r.zIndex.drawer+2,display:"flex",alignItems:"center",gap:.5,color:r=>r.tokens.color.appBar?.text??r.palette.primary.contrastText},children:[(0,rz.jsx)(O4r,{}),(0,rz.jsx)(z4r,{}),(0,rz.jsx)(W4r,{open:e,onOpen:t})]})}var D6=E(le(),1);var q4r=E(le(),1);var V4r=!0,mli=new Set(["openMenu","cycleCards"]),gli=Object.keys(w7).filter(e=>!mli.has(e));function j4r(e,t){let r=k7();(0,q4r.useEffect)(()=>{if(!e)return;let n=i=>{gli.some(o=>YT(o,r).matches(i))&&t()};return globalThis.addEventListener("keydown",n,V4r),()=>globalThis.removeEventListener("keydown",n,V4r)},[e,t,r])}function Y4r(){let[e,t]=(0,D6.useState)(null),[r,n]=(0,D6.useState)(!0),i=!!e,o=(0,D6.useCallback)(()=>t(null),[]),a=(0,D6.useCallback)(s=>{n(!0),t(s)},[]);return j4r(i,(0,D6.useCallback)(()=>{n(!1),t(null)},[])),{anchorEl:e,open:i,close:o,openAt:a,restoreFocus:r}}var UZ=E(le(),1);function K4r(e){Po(Zn("shortcutsSheet").matches,e)}function X4r(){let[e,t]=(0,UZ.useState)(null);K4r((0,UZ.useCallback)(()=>t("shortcuts"),[]));let r=(0,UZ.useCallback)(()=>t(null),[]);return{dialog:e,showDialog:t,closeDialog:r}}function Z4r(){let{nodes:e,selected:t}=Ic();return e&&t&&t!==e.local?t:void 0}function Q4r(e){return{restartLabel:e?`Restart ${e}`:E$.label,updateLabel:e?`Update assist on ${e}`:"Update assist"}}var NS=E(F(),1);function J4r({mode:e,toggle:t,sessions:r,reconnecting:n}){let{anchorEl:i,open:o,close:a,openAt:s,restoreFocus:l}=Y4r(),{dialog:u,showDialog:f,closeDialog:d}=X4r(),h=Z4r(),p=m=>()=>{a(),f(m)};return(0,NS.jsxs)(NS.Fragment,{children:[(0,NS.jsx)(G4r,{open:o,onOpen:s}),(0,NS.jsxs)($s,{anchorEl:i,open:o,onClose:a,disableRestoreFocus:!l,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:[(0,NS.jsx)(n4r,{}),y4r({mode:e,...Q4r(h),onToggleColorMode:()=>{t(),a()},onShowShortcuts:p("shortcuts"),onRestart:p("restart"),onUpdate:p("update")})]}),(0,NS.jsx)(I4r,{dialog:u,peer:h,sessions:r,reconnecting:n,onClose:d})]})}var r3r=E(le(),1);var t3r=E(F(),1);function e3r({conflict:e,onConfirm:t,onCancel:r}){let{name:n,cwd:i,port:o,group:a}=e.existing,s=tc(i),l=o?` on port ${o}`:"",u=s?` in ${s}`:"",f=a?`, holding the ${a} server slot`:"";return(0,t3r.jsx)(wi,{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 Wbe=E(F(),1);function n3r({socket:e,children:t}){let{serverConflict:r,clearServerConflict:n,retrySession:i,stopSession:o,startRun:a,discardSession:s}=e,l=(0,r3r.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,Wbe.jsxs)(jke.Provider,{value:l,children:[t,r&&(0,Wbe.jsx)(e3r,{conflict:r,onConfirm:u,onCancel:n})]})}var i3r=new Map;function o3r(e,t){if(!koe())return;let r=i3r.get(e);if(i3r.set(e,t),!!r)for(let[n,i]of Object.entries(t))Object.is(i,r[n])||My(`\u0394 ${e}.${n}`)}var Vbe=E(le(),1);function a3r(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||um(i)!==t?null:n}function zv(e,t,r){if(e)return t.find(n=>n.id===e)??r.find(n=>n.sessionId===e)}function Gbe(){let{pathname:e}=Vo();return e.startsWith("/backlog")||e.startsWith("/usage")}function s3r({selectedCwd:e,selectedCardId:t,sessions:r,history:n,activeByRepo:i,onSelect:o}){let a=zv(t,r,n),s=a&&um(a),l=!!(s&&s===e),u=a3r(i,e,r),f=(0,Vbe.useRef)(t),d=Gbe();(0,Vbe.useEffect)(()=>{let h=f.current!==t&&!!s;f.current=t,!(d||h||l||!u)&&o(u)},[t,s,l,u,o,d])}var Ybe=E(le(),1);function l3r(e,t,r,n){return zv(e,t,r)?.cwd||n}function c3r(e,t,r,n){let i=l3r(e,t,r,n.cwd),o=zv(e,t,r);return{cwd:i,node:o?.cwd?o.node:n.node}}var rqe=E(le(),1);function u3r(e,t,r){let{cwd:n,node:i,origin:o}=r,a=(0,rqe.useCallback)((l,u)=>{let f=RS(u,t),d=xZ(e,l);return d?d.clones[f]:f===(l===n?i:Pp)?l:void 0},[e,t,n,i]),s=(0,rqe.useCallback)(l=>xZ(e,l)?.origin??(l===n?o:void 0),[e,n,o]);return{cloneOn:a,originOf:s}}var qbe=E(le(),1);function f3r(e,t,r,n){let i=(0,qbe.useRef)(e);(0,qbe.useEffect)(()=>{if(i.current===e)return;i.current=e;let o=xZ(t,r)?.clones[e];o&&n(o,e)},[e,t,r,n])}var nz=E(le(),1);function d3r(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(Pp)?Pp:[...n][0]}function h3r(e,t,r,n){let[i,o]=(0,nz.useState)({cwd:e}),a=(0,nz.useCallback)((l,u,f)=>o({cwd:l,node:u,origin:f}),[]);(0,nz.useEffect)(()=>{e&&!i.cwd&&o({cwd:e})},[e,i.cwd]);let s=d3r(t,{cwd:i.cwd,node:i.node===void 0?void 0:RS(i.node,n)},r);return{selectedCwd:i.cwd,selectedNode:s||void 0,selectedPick:{cwd:i.cwd,node:s,origin:i.origin},setSelectedCwd:a}}var p3r=E(le(),1);function jbe(e,t,r){let n=zv(e,t,r);return n&&um(n)}function m3r(e,t,r,n){let i=jbe(e,t,r),o=zv(e,t,r),a=o?.node??Pp,s=o?.repoGroup?.origin;(0,p3r.useEffect)(()=>{i&&n(i,a,s)},[i,a,s,n])}function g3r(e,t,r,n,i){let o=i.nodes?.local,a=RS(i.selected,o),s=(0,Ybe.useMemo)(()=>Lwr(e,t),[e,t]),{selectedCwd:l,selectedNode:u,selectedPick:f,setSelectedCwd:d}=h3r(e,s,a,o);m3r(r,n,t,d),f3r(a,s,l,d);let{cloneOn:h,originOf:p}=u3r(s,o,f),m=(0,Ybe.useMemo)(()=>s.map(v=>Mwr(v,a)),[s,a]),{cwd:g,node:y}=c3r(r,n,t,{cwd:l,node:u});return(0,Ybe.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 Xbe=E(le(),1);var o5=E(le(),1);var y3r=E(le(),1),Kbe="assist:reloaded-after-update";function v3r(e){(0,y3r.useEffect)(()=>{globalThis.sessionStorage?.getItem(Kbe)&&(globalThis.sessionStorage.removeItem(Kbe),e({message:"Reloaded after updating assist",sessionId:null}))},[e])}function b3r(e,t,r,n){let{arm:i,completed:o}=zbe(e,t),a=(0,o5.useRef)(!1),s=(0,o5.useCallback)(()=>{globalThis.sessionStorage?.setItem(Kbe,"1")},[]),{error:l,restart:u}=M_("webserver",t,s);return v3r(r),(0,o5.useEffect)(()=>{l&&n(l)},[l,n]),(0,o5.useEffect)(()=>{!o||a.current||(a.current=!0,u())},[o,u]),{armUpdateReload:(0,o5.useCallback)(()=>{a.current=!1,i()},[i])}}function x3r(e){let{armUpdateReload:t}=b3r(e.sessions,e.reconnecting,e.setSuccess,e.setError),r=Cy(e.selectSession),n=(0,Xbe.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=Xn(),o=(0,Xbe.useCallback)(a=>{e.selectSession(a),i("/sessions"),e.clearSuccess()},[i,e.selectSession,e.clearSuccess]);return{launch:n,viewLaunchedSession:o}}var S3r=E(le(),1);function T3r(e,t,r,n){let i=jbe(e,t,r);(0,S3r.useEffect)(()=>{e&&i&&n({type:"set-active",cwd:i,sessionId:e})},[e,i,n])}var Zbe=E(le(),1);function C3r(e,t){let r=(0,Zbe.useRef)(new Map);(0,Zbe.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 iz=E(le(),1),w3r="assist.sessions.node";function yli(){try{return localStorage.getItem(w3r)}catch{return null}}function vli(e){try{localStorage.setItem(w3r,e)}catch{}}function k3r(e){let[t,r]=(0,iz.useState)(yli),n=(0,iz.useCallback)(i=>{r(i),vli(i)},[]);return(0,iz.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 E3r=E(le(),1);function _3r(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 R3r(e,t){return(0,E3r.useCallback)(r=>{let n=e.current;n?.readyState===WebSocket.OPEN&&n.send(JSON.stringify(r));let i=_3r(r);i&&t(i)},[e,t])}var Hv=E(le(),1);function Qbe(e,t,r,n,i){e({type:"create",prompt:r||void 0,cwd:n,...t,...i?{node:i}:{}})}function A3r(e){return(t,r,n)=>Qbe(e,{design:!0},t,r,n)}function P3r(e){return(t,r,n,i)=>Qbe(e,{harness:t},r,n,i)}function L3r(e){return(t,r,n)=>Qbe(e,{auto:!0},t,r,n)}function M3r(e){return(t,r,n)=>e({type:"create-assist",assistArgs:t,cwd:r,...n})}function I3r(e){return(t,r,n,i,o)=>e({type:"resume",sessionId:t,cwd:r,name:n,harness:i,node:o})}function D3r(e,t){return(r,n)=>{t.delete(r),e({type:"retry",sessionId:r,replace:n})}}function N3r(e,t){return r=>{t.delete(r),e({type:"restart",sessionId:r})}}function O3r(e,t){return r=>{e({type:"dismiss",sessionId:r}),t.delete(r)}}function B3r(e,t){return r=>{e({type:"discard",sessionId:r}),t.delete(r)}}function F3r(e){return t=>e({type:"stop",sessionId:t})}function $3r(e){return(t,r,n,i,o)=>e({type:"create-run",runName:t,cwd:r,replace:n,launchedFrom:i,node:o})}function z3r(e){return(t,r)=>e({type:"set-autoapprove",sessionId:t,enabled:r})}function H3r(e){return(t,r)=>e({type:"set-autoadvance",sessionId:t,enabled:r})}function U3r(e){return(t,r)=>e({type:"set-starred",sessionId:t,starred:r})}function W3r(e){return(t,r)=>e({type:"input",sessionId:t,data:r,viewerId:ZX})}function G3r(e){return(t,r,n,i)=>e({type:"resize",sessionId:t,cols:r,rows:n,viewerId:ZX,claim:i==="claim",refresh:i==="refresh"})}function V3r(e){return(t,r,n,i)=>e({type:"pr-decision",sessionId:t,requestId:r,decision:n,...i})}var N6=E(le(),1);function q3r(e){return(t,r,n)=>e({type:"create",prompt:r||void 0,cwd:n,joinSessionId:t,auto:!0})}function j3r(e){return{createSession:(0,N6.useMemo)(()=>L3r(e),[e]),createSessionInStream:(0,N6.useMemo)(()=>q3r(e),[e]),createDesignSession:(0,N6.useMemo)(()=>A3r(e),[e]),createHarnessSession:(0,N6.useMemo)(()=>P3r(e),[e]),createAssistSession:(0,N6.useMemo)(()=>M3r(e),[e]),resumeSession:(0,N6.useMemo)(()=>I3r(e),[e])}}var WZ=E(le(),1);function Y3r(e,t){let r=(0,WZ.useCallback)((a,s)=>{D3r(e,t.current)(a,s)},[e,t]),n=(0,WZ.useCallback)(a=>{N3r(e,t.current)(a)},[e,t]),i=(0,WZ.useCallback)(a=>{O3r(e,t.current)(a)},[e,t]),o=(0,WZ.useCallback)(a=>{B3r(e,t.current)(a)},[e,t]);return{retrySession:r,restartSession:n,dismissSession:i,discardSession:o}}function K3r(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 X3r(e,t,r){let n={...j3r(e),sendInput:(0,Hv.useMemo)(()=>W3r(e),[e]),sendResize:(0,Hv.useMemo)(()=>G3r(e),[e]),sendPrDecision:(0,Hv.useMemo)(()=>V3r(e),[e]),setAutoApprove:(0,Hv.useMemo)(()=>z3r(e),[e]),setAutoAdvance:(0,Hv.useMemo)(()=>H3r(e),[e]),setStarred:(0,Hv.useMemo)(()=>U3r(e),[e]),stopSession:(0,Hv.useMemo)(()=>F3r(e),[e]),startRun:(0,Hv.useMemo)(()=>$3r(e),[e])},i=(0,Hv.useMemo)(()=>K3r(e,t.current,r.current),[e,t,r]);return{...n,...Y3r(e,t),onOutput:i}}var GZ=E(le(),1);function Z3r(e,t,r){let n=(0,GZ.useCallback)(s=>{r(s),e({type:"fetch-transcript",sessionId:s})},[e,r]),i=(0,GZ.useCallback)(s=>e({type:"fetch-user-messages",sessionId:s}),[e]),o=(0,GZ.useCallback)(()=>{r(null)},[r]),a=(0,GZ.useCallback)(s=>{r(null),t(s)},[t,r]);return{viewTranscript:n,fetchUserMessages:i,clearTranscript:o,selectSession:a}}var rxe=E(le(),1);function Q3r(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 oz=E(le(),1);function J3r(){let[e,t]=(0,oz.useState)(null),r=(0,oz.useRef)(e);r.current=e;let n=(0,oz.useCallback)(()=>r.current,[]);return{activeId:e,setActiveId:t,getActiveId:n}}var tRr=E(le(),1);function eRr(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 rRr(e,t,r){let n=Gbe();(0,tRr.useEffect)(()=>{if(n){t(null);return}t(i=>eRr(e,i,r))},[e,t,r,n])}var Jbe=E(le(),1);function nRr(){let[e,t]=(0,Jbe.useState)({}),[r,n]=(0,Jbe.useState)(null),[i,o]=(0,Jbe.useState)(null);return{activeByRepo:e,setActiveByRepo:t,daemonVersion:r,setDaemonVersion:n,nodes:i,setNodes:o}}var q0=E(le(),1);function iRr(e,t){for(let r of t)clearTimeout(e.get(r)),e.delete(r)}function oRr(e,t){let r=new Set(t.map(n=>n.id));return[...e.keys()].filter(n=>!r.has(n))}function aRr(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 sRr(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 lRr(e,t){return t.filter(r=>r.commandType==="run"&&e.get(r.id)!==r.startedAt).map(r=>r.id)}var bli=1500;function cRr(){let[e,t]=(0,q0.useState)(new Set),r=(0,q0.useRef)(new Map),n=(0,q0.useRef)(new Map),i=(0,q0.useCallback)(s=>{t(l=>l.has(s)?l:new Set(l).add(s))},[]),o=(0,q0.useCallback)(s=>{let l=n.current;for(let u of s)clearTimeout(l.get(u)),l.set(u,setTimeout(()=>{l.delete(u),i(u)},bli))},[i]);(0,q0.useEffect)(()=>{let s=n.current;return()=>{for(let l of s.values())clearTimeout(l)}},[]);let a=(0,q0.useCallback)(s=>{let l=oRr(r.current,s),u=[...sRr(r.current,s),...l],f=lRr(r.current,s);r.current=new Map(s.map(d=>[d.id,d.startedAt])),iRr(n.current,l),u.length&&t(d=>aRr(d,u)),o(f)},[o]);return{initialized:e,markInitialized:i,syncSessions:a}}var a5=E(le(),1);function uRr(){let[e,t]=(0,a5.useState)(null),[r,n]=(0,a5.useState)(null),[i,o]=(0,a5.useState)(null),a=(0,a5.useCallback)(()=>t(null),[]),s=(0,a5.useCallback)(()=>n(null),[]),l=(0,a5.useCallback)(()=>o(null),[]);return{error:e,setError:t,clearError:a,success:r,setSuccess:n,clearSuccess:s,serverConflict:i,setServerConflict:o,clearServerConflict:l}}var Uv=E(le(),1);function fRr(e,t){return[...e,{...t,status:"launching"}]}function exe(e){return e.find(t=>t.status==="launching")}function dRr(e){let t=exe(e);return t?e.filter(r=>r.id!==t.id):e}function hRr(e,t){let r=exe(e);return r?nqe(e,r.id,t):e}function nqe(e,t,r){return e.map(n=>n.id===t&&n.status==="launching"?{...n,status:"error",error:r}:n)}function pRr(e,t){return e.filter(r=>r.id!==t)}var mRr=E(le(),1);var xli=6e4,Sli="Launch timed out \u2014 the session did not start.";function gRr(e,t){(0,mRr.useEffect)(()=>{let r=e.filter(i=>i.status==="launching");if(r.length===0)return;let n=r.map(i=>setTimeout(()=>t(o=>nqe(o,i.id,Sli)),Math.max(0,xli-(Date.now()-i.startedAt))));return()=>n.forEach(clearTimeout)},[e,t])}function yRr(){let[e,t]=(0,Uv.useState)([]),r=(0,Uv.useRef)([]),n=(0,Uv.useCallback)(l=>{r.current=l(r.current),t(r.current)},[]),i=(0,Uv.useCallback)(l=>{n(u=>fRr(u,{id:crypto.randomUUID(),startedAt:Date.now(),...l}))},[n]),o=(0,Uv.useCallback)(()=>{let l=exe(r.current);return n(dRr),l?.named?l.title:void 0},[n]),a=(0,Uv.useCallback)(l=>n(u=>hRr(u,l)),[n]),s=(0,Uv.useCallback)(l=>n(u=>pRr(u,l)),[n]);return gRr(e,n),{pendingLaunches:e,addPendingLaunch:i,resolvePendingLaunch:o,failPendingLaunch:a,dismissPendingLaunch:s}}var VZ=E(le(),1);function vRr(){let[e,t]=(0,VZ.useState)(null),[r,n]=(0,VZ.useState)({}),i=(0,VZ.useCallback)((o,a)=>{o!=="claude"&&n(s=>({...s,[o]:a}))},[]);return{rateLimits:e,setRateLimits:t,harnessRateLimits:r,setHarnessRateLimits:i}}var bRr=E(le(),1);function xRr(e,t){return(0,bRr.useCallback)(r=>{e(r),t(r)},[e,t])}var iqe=E(le(),1);function SRr(){let e=(0,iqe.useRef)(new Map),t=(0,iqe.useRef)(new Map);return{buffers:e,handlers:t}}var txe=E(le(),1);function TRr(){let[e,t]=(0,txe.useState)(null),[r,n]=(0,txe.useState)(null),[i,o]=(0,txe.useState)(null);return{transcript:e,setTranscript:t,viewingTranscriptSessionId:r,setViewingTranscriptSessionId:n,userMessages:i,setUserMessages:o}}var s5=E(le(),1);function CRr(e,t){let r=e.sessionId;t.buffers.current?.delete(r),t.handlers.current?.get(r)?.("\x1Bc")}function wRr(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 kRr(e,t){let r=e.message;t.setError(r),t.failPendingLaunch(r)}function _Rr(e,t){let r=e.rateLimits,n=e.harness;!n||n==="claude"?t.setRateLimits(r):t.setHarnessRateLimits?.(n,r)}function ERr(e,t){t.setNodes({local:e.local,links:e.links??[]})}function RRr(e,t){t.setSuccess({message:e.message,sessionId:null})}function ARr(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 PRr(e,t){t.setServerConflict({existing:e.existing,runName:e.runName,cwd:e.cwd,sessionId:e.sessionId,launchedFrom:e.launchedFrom,node:e.node})}function LRr(e,t){let r=e.sessions;t.setSessions(r),e.cwd&&t.setCurrentCwd(e.cwd),t.setActiveByRepo(e.active??{})}function MRr(e,t){let r=e.sessionId,n=e.data;t.buffers.current?.set(r,n),t.handlers.current?.get(r)?.(`\x1Bc${n}`)}var Tli={sessions:LRr,created:wRr,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:ERr,error:kRr,notice:RRr,"run-conflict":PRr,limits:_Rr,clear:CRr,output:ARr,snapshot:MRr};function IRr(e,t){Tli[e.type]?.(e,t)}function DRr(e,t={}){let r=new WebSocket(Gat("/ws"));return r.onopen=()=>{t.onOpen?.(),r.send(JSON.stringify({type:"hello"})),r.send(JSON.stringify({type:"history"}))},r.onmessage=n=>{IRr(JSON.parse(n.data),e)},r.onclose=()=>t.onClose?.(),r}function NRr(e,t,r,n){let i=!1,o,a=0,s=!1,l=()=>{i||t(DRr(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 ORr(e){let t=(0,s5.useRef)(null),[r,n]=(0,s5.useState)(!1),{handleSessions:i,markInitialized:o,buffers:a,handlers:s}=e;(0,s5.useEffect)(()=>{let u=()=>{a.current?.clear();let d=s.current;if(d)for(let h of d.values())h("\x1Bc")},f=NRr({...e,setSessions:i},d=>{t.current=d},u,n);return()=>{f(),t.current?.close()}},[i,o,a,s]);let l=(0,s5.useCallback)(()=>{let u=t.current;u?.readyState===WebSocket.OPEN&&u.send(JSON.stringify({type:"history"}))},[]);return{wsRef:t,requestHistory:l,reconnecting:r}}function BRr(){let[e,t]=(0,rxe.useState)([]),[r,n]=(0,rxe.useState)([]),{activeId:i,setActiveId:o,getActiveId:a}=J3r(),s=nRr(),l=TRr(),[u,f]=(0,rxe.useState)(""),d=uRr(),h=yRr(),p=vRr(),{initialized:m,markInitialized:g,syncSessions:y}=cRr(),v=SRr(),b=xRr(y,t),{wsRef:x,requestHistory:C,reconnecting:T}=ORr({handleSessions:b,setHistory:n,getActiveId:a,setActiveId:o,...s,...l,setCurrentCwd:f,...d,...h,...p,markInitialized:g,...v});return rRr(e,o,Q3r(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:T}}function nxe(){let e=BRr(),{wsRef:t,buffers:r,handlers:n,addPendingLaunch:i,activeId:o,sessions:a}=e,s=k3r(e.nodes),l=R3r(t,i),u=X3r(l,r,n);T3r(o,a,e.history,l),C3r(a,l);let f=Z3r(l,e.setActiveId,e.setViewingTranscriptSessionId);return{...e,...u,...f,nodeSelection:s}}var az=E(le(),1);var FRr="assist:sidebar-collapsed";function $Rr(){let[e,t]=(0,az.useState)(()=>rf(FRr).length>0),r=(0,az.useCallback)(()=>{t(n=>{let i=!n;return nf(FRr,i?[!0]:[]),i})},[]);return(0,az.useMemo)(()=>({collapsed:e,onToggleCollapsed:r}),[e,r])}var zRr=E(le(),1);function HRr(){(0,zRr.useEffect)(()=>{let e=!1;return(async()=>{try{let t=await hr("/api/hotkeys");if(!t.ok)return;let r=await t.json();e||$E.set(r)}catch{}})(),()=>{e=!0}},[])}function URr(){let e=nxe(),t=e0e(e),r=g3r(e.currentCwd,e.history,t,e.sessions,e.nodeSelection);s3r({selectedCwd:r.selectedCwd,selectedCardId:t,sessions:e.sessions,history:e.history,activeByRepo:e.activeByRepo,onSelect:e.selectSession});let{launch:n,viewLaunchedSession:i}=x3r(e);HRr();let o=$Rr();return o3r("shell",{...e,selection:r,launch:n,sidebarCollapse:o}),{socket:e,selection:r,launch:n,viewLaunchedSession:i,sidebarCollapse:o}}var mg=E(F(),1),Cli={zIndex:e=>e.zIndex.drawer+1},wli={minHeight:48};function WRr({mode:e,toggle:t}){let r=URr(),{socket:n,selection:i,viewLaunchedSession:o}=r;return(0,mg.jsx)(gEr,{shell:r,children:(0,mg.jsxs)(UVe.Provider,{value:n.daemonVersion,children:[(0,mg.jsx)(J4r,{mode:e,toggle:t,sessions:n.sessions,reconnecting:n.reconnecting}),(0,mg.jsx)(Y2e,{position:"fixed",sx:Cli,"data-testid":"toolbar",children:(0,mg.jsx)(t4r,{socket:n,selection:i})}),(0,mg.jsx)(sE,{variant:"dense",sx:wli}),(0,mg.jsx)(n3r,{socket:n,children:(0,mg.jsx)(f_r,{socket:n})}),(0,mg.jsx)(j_r,{socket:n}),(0,mg.jsx)(pEr,{socket:n,onViewLaunchedSession:o})]})})}var GRr=E(le(),1);function VRr(){let[e,t]=(0,GRr.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 qRr({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 jRr(e){let{color:t,radius:r,elevation:n,type:i}=e,o={border:`1px solid ${t.line}`};return{...qRr(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 YRr=({variant:e})=>e==="outlined"||e==="tonal",KRr=[{props:{size:"small"},style:{minHeight:26,padding:"4px 9px",fontSize:12}},{props:YRr,style:{padding:"5px 11px"}},{props:e=>YRr(e)&&e.size==="small",style:{padding:"3px 8px"}}];var ixe=["primary","secondary","success","warning","error","info"];function qZ(e,t){return{backgroundColor:Dr(e,t),borderColor:Dr(e,.35),color:e}}function XRr({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}}},...ixe.filter(t=>t!=="primary").map(t=>({props:{variant:"tonal",color:t},style:{...qZ(e[t].main,.16),"&:hover":qZ(e[t].main,.24)}}))]}var ZRr={"& > *:nth-of-type(1)":{fontSize:16}};function QRr(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,...ZRr},endIcon:{marginLeft:6,marginRight:-2,...ZRr}},variants:[...KRr,{props:{variant:"text",color:"primary"},style:{color:t.text.secondary,"&:hover":{backgroundColor:t.raised,color:t.text.primary}}},...XRr(e),{props:{variant:"outlined",color:"error"},style:{borderColor:Dr(t.error.main,.35),"&:hover":{borderColor:t.error.main,backgroundColor:Dr(t.error.main,.1)}}}]}}}function oqe({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}}},...ixe.map(r=>({props:{variant:t,color:r},style:{...qZ(e[r].main,.14),borderColor:"transparent","& .MuiChip-deleteIcon":{color:Dr(e[r].main,.7),"&:hover, &:active":{color:e[r].main}},"&.MuiChip-clickable:hover":{backgroundColor:Dr(e[r].main,.22)}}}))]}function JRr(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:[...oqe(e,"tonal"),...oqe(e,"filled")]}}}function eAr(e){return{...QRr(e),MuiButtonGroup:{defaultProps:{disableElevation:!0},variants:[{props:{variant:"tonal"},style:{"& .MuiButtonGroup-middleButton, & .MuiButtonGroup-lastButton":{marginLeft:-1}}}]},...JRr(e)}}var aqe=e=>`color-mix(in srgb, currentColor ${e}%, transparent)`,kli={".MuiAppBar-root &":{color:"inherit","&:hover":{backgroundColor:aqe(8)},"&.Mui-selected":{color:"inherit",backgroundColor:aqe(12),boxShadow:`inset 0 0 0 1px ${aqe(18)}`}}};function tAr({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&&kli}}}}}var rAr=(e,t)=>({width:e,height:e,"& .MuiSvgIcon-root":{fontSize:t}});function nAr({color:e,radius:t}){return{MuiIconButton:{styleOverrides:{root:{...rAr(30,18),padding:0,borderRadius:t.sm,"&:hover":{backgroundColor:e.raised}}},variants:[{props:{size:"small"},style:rAr(26,16)},{props:{color:"default"},style:{color:e.text.secondary,"&:hover":{color:e.text.primary},...!e.appBar&&{".MuiAppBar-root &, .MuiAppBar-root &:hover":{color:"inherit"}}}}]}}}function iAr({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 oxe=".MuiOutlinedInput-notchedOutline";function oAr({color:e,radius:t}){return{MuiOutlinedInput:{styleOverrides:{root:{backgroundColor:e.background,borderRadius:t.sm,fontSize:13,color:e.text.primary,[`& ${oxe}`]:{borderColor:e.line},[`&:hover ${oxe}`]:{borderColor:e.text.disabled},[`&.Mui-focused ${oxe}`]:{borderColor:e.primary.main,borderWidth:1},[`&.Mui-error ${oxe}`]:{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 aAr({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 sAr(e){let{appBar:t}=e.color;return{...jRr(e),...eAr(e),...nAr(e),...iAr(e),...oAr(e),...aAr(e),...tAr(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 Wv="#0e1116",sqe="#141820",axe="#1b202a",sxe="#e3e7ee",lqe="#8a93a3",jZ="#8b9cff",lxe="#5fd0a0",cxe="#f2b45a",uxe="#f27a7a",lAr={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)"},fxe={dark:{color:{background:Wv,surface:sqe,raised:axe,line:"#262c37",lineSoft:"#1d222b",text:{primary:sxe,secondary:lqe,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:Wv,stripe:axe,codeWash:"rgba(255, 255, 255, 0.08)",overlay:{background:axe,text:sxe},scrim:"rgba(0, 0, 0, 0.5)",appBar:{background:sqe,text:sxe},onAppBar:{...lAr,secondary:lqe,level:{ok:lxe,warn:cxe,over:uxe}},statusBar:{background:sqe,text:lqe,hoverText:sxe,secondary:"#5c6473",hover:axe,active:"transparent",dot:jZ,dotRing:"rgba(139, 156, 255, 0.14)",readyText:jZ,level:{ok:lxe,warn:cxe,over:uxe}},primary:{main:jZ,contrastText:Wv},secondary:{main:"#c99bff",contrastText:Wv},success:{main:lxe,contrastText:Wv},warning:{main:cxe,contrastText:Wv},error:{main:uxe,contrastText:Wv},info:{main:"#6cb6ff",contrastText:Wv}},terminal:{background:Wv,foreground:"#d6dbe4",cursor:jZ,cursorAccent:Wv,selectionBackground:"rgba(139, 156, 255, 0.28)",black:"#1b2029",red:uxe,green:lxe,yellow:cxe,blue:jZ,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)",stuckHeader:"0 8px 8px -9px rgba(0, 0, 0, 0.8)"}},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)",codeWash:"rgba(0, 0, 0, 0.06)",overlay:{background:"rgba(97, 97, 97, 0.92)",text:"#fff"},onAppBar:{...lAr,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)",stuckHeader:"0 6px 6px -7px rgba(0, 0, 0, 0.2)"}},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 OS=e=>`${e/16}rem`;function cAr({font:e,type:t}){let{scale:r}=t;return{fontFamily:e.ui,fontFamilyMono:e.mono,fontSize:t.fontSize,button:{...t.button,fontSize:OS(r.button)},caption:{fontSize:OS(r.caption)},body2:{fontSize:OS(r.body2)},body1:{fontSize:OS(r.body1)},subtitle2:{fontSize:OS(r.subtitle2)},subtitle1:{fontSize:OS(r.subtitle1)},h6:{fontSize:OS(r.h6)},h5:{fontSize:OS(r.h5)},h4:{fontSize:OS(r.h4)}}}function uAr(e){return{MuiButtonBase:{styleOverrides:{root:{cursor:"pointer","&.Mui-disabled":{cursor:"default"}}}},MuiLink:{styleOverrides:{root:{cursor:"pointer"}}},MuiAppBar:{defaultProps:{elevation:e.elevation.appBar}}}}function _li(e){let{dark:t,light:r,...n}=fxe;return{...n,...e==="dark"?t:r,mode:e}}function fAr(e){let t=_li(e),{color:r}=t;return ry({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:cAr(t),shape:{borderRadius:t.radius.sm},spacing:t.spacing,components:{...uAr(t),...sAr(t)}})}function dAr(){if(typeof document>"u"||!document.fonts)return Promise.resolve();let{font:e,type:t}=fxe;return Promise.allSettled([document.fonts.load(`${t.fontSize}px ${e.ui}`),document.fonts.load(`${t.terminalFontSize}px ${e.terminal}`)])}lz();lz();var hqe=F6("Preferences",{web:()=>Promise.resolve().then(()=>(vAr(),yAr)).then(e=>new e.PreferencesWeb)});var dxe=E(le(),1);var pqe=E(le(),1);var xAr=E(F(),1);function bAr({value:e,error:t,onChange:r}){return(0,xAr.jsx)(Gn,{autoFocus:!0,label:"Node URL",placeholder:"https://mac.tail1234.ts.net:3100",value:e,onChange:n=>r(n.target.value),error:!!t,helperText:t,slotProps:{htmlInput:{autoCapitalize:"none",autoCorrect:"off",inputMode:"url"}}})}var Dli=/^[a-z]+:[/]{2}/i;function SAr(e){let t=e.trim(),r=Dli.test(t)?t:`https://${t}`;try{let n=new URL(r);return n.protocol!=="https:"&&n.protocol!=="http:"?void 0:n.origin}catch{return}}var l5=E(F(),1),Nli={height:"100%",boxSizing:"border-box",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",p:2,bgcolor:"background.default"};function TAr({onSave:e}){let[t,r]=(0,pqe.useState)(""),[n,i]=(0,pqe.useState)();return(0,l5.jsx)(X,{component:"form",onSubmit:a=>{a.preventDefault();let s=SAr(t);s?e(s):i("Enter an http(s) URL, e.g. https://mac.tail1234.ts.net:3100")},sx:Nli,children:(0,l5.jsxs)(_t,{spacing:2,sx:{width:"100%",maxWidth:420},children:[(0,l5.jsx)(Le,{variant:"h6",children:"Connect to a home node"}),(0,l5.jsx)(Le,{variant:"body2",color:"text.secondary",children:"Enter the Tailscale URL of the assist web server to view its sessions and those of the nodes it links to."}),(0,l5.jsx)(bAr,{value:t,error:n,onChange:a=>{r(a),i(void 0)}}),(0,l5.jsx)(Mt,{type:"submit",variant:"contained",disabled:!t.trim(),children:"Connect"})]})})}var _Ar=E(F(),1),CAr="homeNodeUrl",wAr=O6.isNativePlatform();function kAr({children:e}){let[t,r]=(0,dxe.useState)(wAr?void 0:""),n=i=>{Wat(i),r(i)};return(0,dxe.useEffect)(()=>{wAr&&hqe.get({key:CAr}).then(({value:i})=>{i?n(i):r(null)}).catch(()=>r(null))},[]),t===void 0?null:t===null?(0,_Ar.jsx)(TAr,{onSave:i=>{hqe.set({key:CAr,value:i}),n(i)}}):e}lz();var hxe=O6.isNativePlatform();var d6r=E(le(),1);var LAr=E(le(),1);var Gv={top:"env(safe-area-inset-top, 0px)",bottom:"env(safe-area-inset-bottom, 0px)"};var EAr=E(F(),1),RAr=at((0,EAr.jsx)("path",{d:"M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"}),"ChevronLeft");var pxe=E(F(),1),Oli={minHeight:44,px:.5,gap:.25,color:"primary.main",fontSize:16,borderRadius:1};function c5({label:e,to:t}){let r=Xn();return(0,pxe.jsxs)(Or,{sx:Oli,onClick:()=>r(t),children:[(0,pxe.jsx)(RAr,{}),e]})}var Bli={width:"100%",display:"grid",gridTemplateColumns:"18px 1fr auto",columnGap:1.25,rowGap:.25,alignItems:"start",textAlign:"left",px:2,py:1.375,borderBottom:1,borderColor:e=>e.tokens.color.lineSoft};function mxe(e){return{...Bli,bgcolor:e==="waiting"?r=>r.tokens.color.wash.warning:e==="error"?r=>r.tokens.color.wash.error:"background.default"}}var gxe={gridColumn:2,gridRow:1,fontSize:16,fontWeight:500,lineHeight:"21px",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",minWidth:0},yxe={gridColumn:3,gridRow:"1 / span 3",alignSelf:"center",color:"text.disabled"},vxe={gridColumn:2,display:"flex",flexWrap:"wrap",alignItems:"center",gap:.75,fontSize:13,color:"text.secondary",minWidth:0},AAr={gridColumn:2,mt:.25,fontSize:14,lineHeight:"19px",color:"text.primary",display:"-webkit-box",WebkitLineClamp:3,WebkitBoxOrient:"vertical",overflow:"hidden",whiteSpace:"pre-line"};var BS=E(F(),1);function PAr({entry:e,localNode:t}){let r=Xn();return(0,BS.jsxs)(Or,{sx:mxe("done"),onClick:()=>r(`/history/${e.sessionId}`),children:[(0,BS.jsx)(X,{sx:gxe,children:e.title??e.name}),(0,BS.jsx)(Vs,{fontSize:"small",sx:yxe}),(0,BS.jsxs)(X,{sx:vxe,children:[(0,BS.jsx)("span",{children:tc(e.cwd)}),(0,BS.jsx)("span",{children:zi(e.timestamp)}),e.node&&e.node!==t&&(0,BS.jsx)(X,{component:"span",sx:Ua("neutral"),children:e.node})]})]})}var FS=E(F(),1),Fli={flex:"none",pt:Gv.top,bgcolor:"background.default"},$li={height:44,display:"grid",gridTemplateColumns:"1fr auto 1fr",alignItems:"center",px:1},zli={textAlign:"center",minWidth:0,maxWidth:220},Hli={fontSize:15,fontWeight:600,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},Uli={fontSize:12,color:"text.secondary",fontFamily:"fontFamilyMono",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"};function Vv({left:e,title:t,subtitle:r,right:n}){return(0,FS.jsx)(X,{component:"header",sx:Fli,children:(0,FS.jsxs)(X,{sx:$li,children:[(0,FS.jsx)(X,{sx:{justifySelf:"start",minWidth:0},children:e}),(0,FS.jsxs)(X,{sx:zli,children:[(0,FS.jsx)(X,{sx:Hli,children:t}),r&&(0,FS.jsx)(X,{sx:Uli,children:r})]}),(0,FS.jsx)(X,{sx:{justifySelf:"end",display:"flex",gap:.25},children:n})]})})}var $S=E(F(),1),Wli={flex:1,minHeight:0,overflowY:"auto",pb:Gv.bottom};function MAr({history:e,localNode:t,requestHistory:r}){return(0,LAr.useEffect)(()=>r(),[r]),(0,$S.jsxs)($S.Fragment,{children:[(0,$S.jsx)(Vv,{left:(0,$S.jsx)(c5,{label:"Sessions",to:"/"}),title:"History"}),(0,$S.jsx)(X,{sx:Wli,children:e.map(n=>(0,$S.jsx)(PAr,{entry:n,localNode:t},`${n.node??""}:${n.sessionId}`))})]})}var IAr=E(F(),1),DAr=at((0,IAr.jsx)("path",{d:"M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9m-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8z"}),"History");var WAr=E(le(),1);var cz=e=>e.tokens.color.raised;var bxe=E(F(),1),Gli={display:"inline-flex",alignItems:"center",gap:.75,height:32,px:1.25,borderRadius:"16px",border:1,borderColor:"divider",bgcolor:cz,fontFamily:"fontFamilyMono",fontSize:13,maxWidth:120,overflow:"hidden",whiteSpace:"nowrap"};function NAr({name:e,reconnecting:t}){return(0,bxe.jsxs)(X,{sx:Gli,"data-testid":"phone-node-chip",children:[(0,bxe.jsx)(X,{sx:{width:8,height:8,flex:"none",borderRadius:"50%",bgcolor:r=>t?r.palette.warning.main:r.palette.success.main}}),e??"\u2026"]})}var $Ar=E(le(),1);function OAr(e){let t={needsYou:[],running:[],done:[]};for(let r of e){let n=Gs(r);n==="waiting"||n==="error"?t.needsYou.push(r):n==="running"?t.running.push(r):t.done.push(r)}return t}var u5=E(F(),1),Vli={width:"100%",display:"flex",justifyContent:"space-between",alignItems:"center",px:2,py:1.5,fontSize:15,color:"text.secondary",borderBottom:1,borderColor:e=>e.tokens.color.lineSoft};function BAr({count:e,expanded:t,onToggle:r}){return(0,u5.jsxs)(Or,{sx:Vli,onClick:r,"aria-expanded":t,children:[(0,u5.jsxs)(X,{component:"span",sx:{display:"flex",gap:1},children:[(0,u5.jsx)(X,{component:"span",sx:{color:Tf.done},children:wd.done}),"Done",(0,u5.jsx)(X,{component:"span",sx:{fontFamily:"fontFamilyMono"},children:e})]}),t?(0,u5.jsx)(u8,{fontSize:"small"}):(0,u5.jsx)(rs,{fontSize:"small"})]})}var $6=E(F(),1);function xxe({session:e,localNode:t}){let r=e.activity?.kind==="backlog"?e.activity.itemId:void 0,n=e.node&&e.node!==t?e.node:void 0;return(0,$6.jsxs)($6.Fragment,{children:[r!==void 0&&(0,$6.jsx)(X,{component:"span",sx:Ua("primary"),children:$i(r)}),n&&(0,$6.jsx)(X,{component:"span",sx:Ua("neutral"),"data-testid":"node-badge",children:n})]})}function Sxe({activity:e}){if(!(e?.kind!=="backlog"||!e.phase))return e.totalPhases?`${e.phase}/${e.totalPhases}`:`${e.phase}`}var j0=E(F(),1);function qli(e){return e.status==="error"?e.error:e.pendingPrPreview?.title??e.lastAssistantMessage}function Txe({session:e,localNode:t,showMessage:r}){let n=Xn(),i=Gs(e),o=tc(e.cwd),a=Sxe(e),s=r?qli(e):void 0;return(0,j0.jsxs)(Or,{sx:mxe(i),onClick:()=>n(`/session/${e.id}`),"data-testid":"phone-session-row",children:[(0,j0.jsx)(Bne,{status:i}),(0,j0.jsx)(X,{sx:gxe,children:eC(e)}),(0,j0.jsx)(Vs,{fontSize:"small",sx:yxe}),(0,j0.jsxs)(X,{sx:vxe,children:[o&&(0,j0.jsx)("span",{children:o}),a&&(0,j0.jsx)("span",{children:a}),(0,j0.jsx)(xxe,{session:e,localNode:t})]}),s&&(0,j0.jsx)(X,{sx:AAr,children:s})]})}var KZ=E(F(),1),jli={display:"flex",justifyContent:"space-between",alignItems:"baseline",px:2,pt:1.75,pb:.75,fontSize:13,fontWeight:600,letterSpacing:"0.04em",textTransform:"uppercase"};function FAr({label:e,count:t,attention:r}){return(0,KZ.jsxs)(X,{sx:{...jli,color:r?"warning.main":"text.secondary"},children:[(0,KZ.jsx)("span",{children:e}),(0,KZ.jsx)(X,{component:"span",sx:{fontFamily:"fontFamilyMono"},children:t})]})}var z6=E(F(),1);function mqe({label:e,sessions:t,localNode:r,attention:n}){return t.length===0?null:(0,z6.jsxs)(z6.Fragment,{children:[(0,z6.jsx)(FAr,{label:e,count:t.length,attention:n}),t.map(i=>(0,z6.jsx)(Txe,{session:i,localNode:r,showMessage:n},i.id))]})}var qv=E(F(),1),Yli={p:4,textAlign:"center",color:"text.secondary",fontSize:15};function zAr({sessions:e,localNode:t}){let[r,n]=(0,$Ar.useState)(!1);if(e.length===0)return(0,qv.jsx)(X,{sx:Yli,children:"No sessions"});let{needsYou:i,running:o,done:a}=OAr(e);return(0,qv.jsxs)(qv.Fragment,{children:[(0,qv.jsx)(mqe,{label:`${wd.waiting} Needs you`,sessions:i,localNode:t,attention:!0}),(0,qv.jsx)(mqe,{label:"Running",sessions:o,localNode:t}),a.length>0&&(0,qv.jsx)(BAr,{count:a.length,expanded:r,onToggle:()=>n(s=>!s)}),r&&a.map(s=>(0,qv.jsx)(Txe,{session:s,localNode:t},s.id))]})}var gqe=E(F(),1);function HAr({pull:e,refreshing:t}){return e<=0&&!t?null:(0,gqe.jsx)(X,{sx:{display:"flex",justifyContent:"center",py:1},children:(0,gqe.jsx)(Fi,{size:20,variant:t?"indeterminate":"determinate",value:Math.min(100,e)})})}var XZ=E(le(),1),Kli=70,Xli=100,Zli=800;function UAr(e,t){let[r,n]=(0,XZ.useState)(0),[i,o]=(0,XZ.useState)(!1);return(0,XZ.useEffect)(()=>{let a=e.current;if(!a)return;let s=null,l=0,u=h=>{s=a.scrollTop<=0?h.touches[0].clientY:null},f=h=>{s!==null&&(l=Math.min(Xli,h.touches[0].clientY-s),n(Math.max(0,l)))},d=()=>{s!==null&&l>=Kli&&(o(!0),t(),setTimeout(()=>o(!1),Zli)),s=null,l=0,n(0)};return a.addEventListener("touchstart",u,{passive:!0}),a.addEventListener("touchmove",f,{passive:!0}),a.addEventListener("touchend",d,{passive:!0}),()=>{a.removeEventListener("touchstart",u),a.removeEventListener("touchmove",f),a.removeEventListener("touchend",d)}},[e,t]),{pull:r,refreshing:i}}var gg=E(F(),1),Qli={flex:1,minHeight:0,overflowY:"auto",WebkitOverflowScrolling:"touch",pb:Gv.bottom};function GAr({sessions:e,localNode:t,reconnecting:r,onRefresh:n}){let i=Xn(),o=(0,WAr.useRef)(null),{pull:a,refreshing:s}=UAr(o,n);return(0,gg.jsxs)(gg.Fragment,{children:[(0,gg.jsx)(Vv,{left:(0,gg.jsx)(NAr,{name:t,reconnecting:r}),title:"Sessions",right:(0,gg.jsx)(Qt,{"aria-label":"History",sx:{color:"primary.main"},onClick:()=>i("/history"),children:(0,gg.jsx)(DAr,{})})}),(0,gg.jsxs)(X,{ref:o,sx:Qli,children:[(0,gg.jsx)(HAr,{pull:a,refreshing:s}),(0,gg.jsx)(zAr,{sessions:e,localNode:t})]})]})}var VAr={label:"\u23CE",data:"\r"},qAr={label:"esc",data:"\x1B"},jAr={label:"\u2191",data:"\x1B[A"},YAr={label:"\u2193",data:"\x1B[B"};function KAr(e){return e?[{label:"1",data:"1"},{label:"2",data:"2"},{label:"3",data:"3"},jAr,YAr,VAr,qAr]:[qAr,{label:"tab",data:" "},{label:"\u21E7tab",data:"\x1B[Z"},jAr,YAr,{label:"\u2303C",data:"",warn:!0},{label:"/",data:"/"},VAr]}var yqe=E(F(),1),Jli={flex:"none",display:"flex",gap:.75,px:1,py:.75,overflowX:"auto",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"},bgcolor:"background.paper",borderTop:1,borderColor:"divider"},eci={flex:"none",minWidth:44,height:36,px:1,borderRadius:1,border:1,borderColor:"divider",bgcolor:cz,color:"text.primary",fontFamily:"fontFamilyMono",fontSize:13},tci=e=>e.preventDefault();function XAr({waiting:e,onKey:t}){return(0,yqe.jsx)(X,{sx:Jli,"data-testid":"phone-key-strip",children:KAr(e).map(r=>(0,yqe.jsx)(Or,{sx:{...eci,...r.warn&&{color:"error.main"}},onPointerDown:tci,onClick:()=>t(r.data),children:r.label},r.label))})}var ZAr=E(le(),1);var uz=E(F(),1),rci={flex:"none",display:"flex",alignItems:"flex-end",gap:1,px:1.5,py:1.25,bgcolor:"background.paper"},nci={flex:1,minHeight:40,px:1.75,py:1,borderRadius:"20px",border:1,borderColor:"divider",bgcolor:"background.default",fontSize:16,"&.Mui-focused":{borderColor:"primary.main"}},ici={width:40,height:40,flex:"none",bgcolor:"primary.main",color:"primary.contrastText","&:hover":{bgcolor:"primary.main"},"&.Mui-disabled":{bgcolor:cz,color:"text.disabled"}},oci=e=>e.preventDefault();function QAr({onSend:e}){let[t,r]=(0,ZAr.useState)(""),n=()=>{t.trim()&&(e(t),r(""))};return(0,uz.jsxs)(X,{sx:rci,children:[(0,uz.jsx)(Kl,{multiline:!0,maxRows:5,value:t,onChange:i=>r(i.target.value),placeholder:"Reply to Claude\u2026",sx:nci,inputProps:{"aria-label":"Reply"}}),(0,uz.jsx)(Qt,{"aria-label":"Send",sx:ici,disabled:!t.trim(),onPointerDown:oci,onClick:n,children:(0,uz.jsx)(Sve,{fontSize:"small"})})]})}var fz=E(F(),1);function JAr({waiting:e,keyboardOpen:t,onKey:r,onSend:n}){return(0,fz.jsxs)(X,{sx:{flex:"none",display:"flex",flexDirection:"column",bgcolor:"background.paper",pb:t?0:Gv.bottom},children:[(0,fz.jsx)(X,{sx:{order:t?1:0},children:(0,fz.jsx)(XAr,{waiting:e,onKey:r})}),(0,fz.jsx)(QAr,{onSend:n})]})}var f5=E(F(),1),aci={flex:1,p:3,color:"text.secondary",textAlign:"center"};function e6r(){return(0,f5.jsxs)(f5.Fragment,{children:[(0,f5.jsx)(Vv,{left:(0,f5.jsx)(c5,{label:"Sessions",to:"/"}),title:"Session"}),(0,f5.jsx)(X,{sx:aci,children:"This session has ended."})]})}var H6=E(F(),1),sci={flex:"none",display:"flex",alignItems:"center",flexWrap:"wrap",gap:1,px:2,pt:.75,pb:1,borderBottom:1,borderColor:"divider",fontSize:13,color:"text.secondary"},lci={ml:"auto",fontFamily:"fontFamilyMono",fontSize:12};function cci(e,t){let r=Math.max(0,Math.floor((t*1e3-e)/6e4));return r<60?`${r}m`:`${Math.floor(r/60)}h`}function t6r({session:e,localNode:t}){let r=D_(3e4),n=Gs(e),i=Sxe(e);return(0,H6.jsxs)(X,{sx:sci,children:[(0,H6.jsxs)(X,{component:"span",sx:[SF(Tf[n]),{fontSize:12}],children:[wd[n]," ",n[0].toUpperCase()+n.slice(1)]}),(0,H6.jsx)(xxe,{session:e,localNode:t}),i&&(0,H6.jsxs)("span",{children:["phase ",i]}),(0,H6.jsx)(X,{component:"span",sx:lci,children:cci(e.startedAt,r)})]})}var QZ=E(le(),1);function r6r(e,t,r,n){let i=e/(t*r)*.97,o=Math.floor(i*n*4)/4;return Math.min(24,Math.max(9,o))}function n6r(e){let t=document.createElement("canvas").getContext("2d");if(!t)return .6;t.font=`100px ${e}`;let r=t.measureText("W").width;return r>0?r/100:.6}var ZZ=E(le(),1),uci=24;function i6r(e){let t=(0,ZZ.useRef)(!0),r=(0,ZZ.useCallback)(()=>{let i=e.current;i&&t.current&&(i.scrollTop=i.scrollHeight)},[e]),n=(0,ZZ.useCallback)(()=>{let i=e.current;i&&(t.current=i.scrollHeight-i.scrollTop-i.clientHeight<uci)},[e]);return{follow:r,trackStick:n}}var d5=E(le(),1);function o6r(e,t,{cols:r,rows:n},i,o,a){let{tokens:s}=$n(),l=(0,d5.useRef)(null),u=(0,d5.useRef)({tokens:s,fontSize:i,cols:r,rows:n}),f=(0,d5.useRef)(a);f.current=a,(0,d5.useEffect)(()=>{let d=e.current;if(!d)return;let{tokens:h,...p}=u.current,m=new sve({...KX(h),...p,disableStdin:!0,cursorBlink:!1,scrollback:5e3});m.open(d),l.current=m;let g=o(t,y=>m.write(y,()=>f.current()));return()=>{g(),m.dispose(),l.current=null}},[e,t,o]),(0,d5.useEffect)(()=>{l.current?.resize(r,n)},[r,n]),(0,d5.useEffect)(()=>{let d=l.current;d&&Object.assign(d.options,{...KX(s),fontSize:i})},[s,i])}var dz=E(le(),1),vqe=1,fci=3;function a6r(e){let[t,r]=[e[0],e[1]];return Math.hypot(t.clientX-r.clientX,t.clientY-r.clientY)}function s6r(e){let[t,r]=(0,dz.useState)(vqe),n=(0,dz.useRef)(vqe);return(0,dz.useEffect)(()=>{let i=e.current;if(!i)return;let o=null,a=u=>{u.touches.length===2&&(o={distance:a6r(u.touches),zoom:n.current})},s=u=>{if(!o||u.touches.length!==2)return;u.preventDefault();let f=o.zoom*a6r(u.touches)/o.distance;n.current=Math.min(fci,Math.max(vqe,f)),r(n.current)},l=u=>{u.touches.length<2&&(o=null)};return i.addEventListener("touchstart",a,{passive:!0}),i.addEventListener("touchmove",s,{passive:!1}),i.addEventListener("touchend",l,{passive:!0}),i.addEventListener("touchcancel",l,{passive:!0}),()=>{i.removeEventListener("touchstart",a),i.removeEventListener("touchmove",s),i.removeEventListener("touchend",l),i.removeEventListener("touchcancel",l)}},[e]),t}var bqe=E(F(),1),dci={flex:1,minHeight:0,overflow:"auto",overscrollBehavior:"contain",WebkitOverflowScrolling:"touch",bgcolor:e=>e.tokens.terminal.background,px:.5,"& .xterm":{width:"max-content"}};function l6r({sessionId:e,cols:t=120,rows:r=30,onOutput:n}){let i=(0,QZ.useRef)(null),o=(0,QZ.useRef)(null),{tokens:a}=$n(),s=(0,QZ.useMemo)(()=>n6r(a.font.terminal),[a.font.terminal]),l=x8(i)??window.innerWidth,u=s6r(i),f=r6r(l,t,s,u),{follow:d,trackStick:h}=i6r(i);return o6r(o,e,{cols:t,rows:r},f,n,d),(0,bqe.jsx)(X,{ref:i,sx:dci,onScroll:h,"data-testid":"phone-terminal",children:(0,bqe.jsx)(X,{ref:o})})}var Y0=E(F(),1);function c6r({socket:e,keyboardOpen:t}){let{id:r}=NE(),n=e.sessions.find(a=>a.id===r);if(!n)return(0,Y0.jsx)(e6r,{});let i=e.nodes?.local,o=[tc(n.cwd),n.node??i].filter(Boolean).join(" \xB7 ");return(0,Y0.jsxs)(Y0.Fragment,{children:[(0,Y0.jsx)(Vv,{left:(0,Y0.jsx)(c5,{label:"Sessions",to:"/"}),title:eC(n),subtitle:o}),(0,Y0.jsx)(t6r,{session:n,localNode:i}),(0,Y0.jsx)(l6r,{sessionId:n.id,cols:n.cols,rows:n.rows,onOutput:e.onOutput},n.id),(0,Y0.jsx)(JAr,{waiting:Gs(n)==="waiting",keyboardOpen:t,onKey:a=>e.sendInput(n.id,a),onSend:a=>tf(e.sendInput,n.id,a)})]})}var u6r=E(le(),1);var zS=E(F(),1),hci={flex:1,minHeight:0,display:"flex",pb:Gv.bottom};function f6r({socket:e}){let{id:t=""}=NE(),{viewTranscript:r,clearTranscript:n}=e,i=e.history.find(o=>o.sessionId===t);return(0,u6r.useEffect)(()=>(r(t),n),[t,r,n]),(0,zS.jsxs)(zS.Fragment,{children:[(0,zS.jsx)(Vv,{left:(0,zS.jsx)(c5,{label:"History",to:"/history"}),title:i?.title??i?.name??"Transcript"}),(0,zS.jsx)(X,{sx:hci,children:(0,zS.jsx)(hve,{sessionId:t,transcript:e.transcript})})]})}var Ip=E(F(),1);function h6r({socket:e,keyboardOpen:t}){let r=e.nodes?.local,{wsRef:n,requestHistory:i}=e,o=(0,d6r.useCallback)(()=>{n.current?.close(),i()},[n,i]);return(0,Ip.jsxs)($b,{children:[(0,Ip.jsx)(Ro,{index:!0,element:(0,Ip.jsx)(GAr,{sessions:e.sessions,localNode:r,reconnecting:e.reconnecting,onRefresh:o})}),(0,Ip.jsx)(Ro,{path:"session/:id",element:(0,Ip.jsx)(c6r,{socket:e,keyboardOpen:t})}),(0,Ip.jsx)(Ro,{path:"history",element:(0,Ip.jsx)(MAr,{history:e.history,localNode:r,requestHistory:i})}),(0,Ip.jsx)(Ro,{path:"history/:id",element:(0,Ip.jsx)(f6r,{socket:e})}),(0,Ip.jsx)(Ro,{path:"*",element:(0,Ip.jsx)(tW,{to:"/",replace:!0})})]})}var Cxe=E(le(),1),pci=120;function p6r(){let e=window.visualViewport,t=e?.height??window.innerHeight;return{height:t,offsetTop:e?.offsetTop??0,keyboardOpen:window.innerHeight-t>pci}}function m6r(){let[e,t]=(0,Cxe.useState)(p6r);return(0,Cxe.useEffect)(()=>{let r=window.visualViewport;if(!r)return;let n=()=>t(p6r());return r.addEventListener("resize",n),r.addEventListener("scroll",n),()=>{r.removeEventListener("resize",n),r.removeEventListener("scroll",n)}},[]),e}var xqe=E(F(),1),mci={position:"fixed",left:0,right:0,display:"flex",flexDirection:"column",overflow:"hidden",bgcolor:"background.default",color:"text.primary"};function g6r(){let e=nxe(),t=m6r();return(0,xqe.jsx)(X,{sx:mci,style:{top:t.offsetTop,height:t.height},"data-testid":"phone-shell",children:(0,xqe.jsx)(h6r,{socket:e,keyboardOpen:t.keyboardOpen})})}var y6r=E(le(),1);var wxe=E(F(),1),gci=5;function v6r({children:e}){let[t,r]=(0,y6r.useState)(null);return(0,wxe.jsxs)(x_e.Provider,{value:t,children:[e,(0,wxe.jsx)(X,{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+${gci+1})`]:{display:"none"}}})]})}lz();var JZ;(function(e){e.Dark="DARK",e.Light="LIGHT",e.Default="DEFAULT"})(JZ||(JZ={}));var b6r;(function(e){e.None="NONE",e.Slide="SLIDE",e.Fade="FADE"})(b6r||(b6r={}));var x6r=F6("StatusBar");var S6r=E(le(),1);function T6r(e){(0,S6r.useEffect)(()=>{hxe&&x6r.setStyle({style:e==="dark"?JZ.Dark:JZ.Light}).catch(()=>{})},[e])}var K0=E(F(),1);function yci(){let{mode:e,toggle:t}=VRr(),r=(0,w6r.useMemo)(()=>fAr(e),[e]);return T6r(e),(0,K0.jsxs)(sJ,{theme:r,children:[(0,K0.jsx)(jJ,{}),(0,K0.jsx)(v6r,{children:(0,K0.jsx)(kAr,{children:hxe?(0,K0.jsx)(g6r,{}):(0,K0.jsx)(WRr,{mode:e,toggle:t})})})]})}var vci=Ske([{path:"*",element:(0,K0.jsx)(yci,{})}]);function bci(){return(0,K0.jsx)(pke,{router:vci})}var C6r=document.getElementById("app");C6r&&dAr().then(()=>{(0,k6r.createRoot)(C6r).render((0,K0.jsx)(bci,{}))});})();
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.963.0",
9
+ version: "0.964.0",
10
10
  type: "module",
11
11
  main: "dist/index.js",
12
12
  bin: {
@@ -26137,6 +26137,7 @@ function candidateStrings(input, existingContent) {
26137
26137
  }
26138
26138
  }
26139
26139
  function decideOverrideGuard(input, existingContent) {
26140
+ if (/\.mdx?$/i.test(input.tool_input.file_path ?? "")) return void 0;
26140
26141
  const touchesMarker = candidateStrings(input, existingContent).some(
26141
26142
  (s) => s.includes(MAINTAINABILITY_OVERRIDE_MARKER)
26142
26143
  );
@@ -33885,6 +33886,15 @@ function registerRavendb(program) {
33885
33886
  // src/commands/releases/releasesConfigure.ts
33886
33887
  import chalk211 from "chalk";
33887
33888
 
33889
+ // src/commands/config/parseRepoScopeFlag.ts
33890
+ var REPO_SCOPE_FLAGS = {
33891
+ git: "project",
33892
+ db: "repo"
33893
+ };
33894
+ function parseRepoScopeFlag(value) {
33895
+ return value === void 0 ? void 0 : REPO_SCOPE_FLAGS[value];
33896
+ }
33897
+
33888
33898
  // src/commands/releases/checkStreamGraph.ts
33889
33899
  function nodeIds(stream) {
33890
33900
  const nodes = Array.isArray(stream.nodes) ? stream.nodes : [];
@@ -34068,7 +34078,8 @@ function reportWritten(incoming, target) {
34068
34078
  );
34069
34079
  }
34070
34080
  async function releasesConfigure(options2 = {}) {
34071
- const scope = options2.scope === "repo" ? "repo" : "project";
34081
+ const scope = parseRepoScopeFlag(options2.scope ?? "git");
34082
+ if (!scope) return fail7("--scope must be 'git' or 'db'");
34072
34083
  const input = readStreamsInput(options2.streams ?? "-");
34073
34084
  if ("error" in input) return fail7(`Could not read --streams: ${input.error}`);
34074
34085
  const incoming = withCurrentRepo(input.streams);
@@ -34127,9 +34138,9 @@ function registerReleases(parent) {
34127
34138
  "--streams <file>",
34128
34139
  "JSON or YAML array of streams to declare; '-' reads stdin"
34129
34140
  ).option(
34130
- "--scope <project|repo>",
34131
- "project assist.yml or this repo's shared db override",
34132
- "project"
34141
+ "--scope <git|db>",
34142
+ "repo (git), the repo's assist.yml, or repo (db), this repo's shared db override",
34143
+ "git"
34133
34144
  ).action(releasesConfigure),
34134
34145
  "/releases-configure"
34135
34146
  );
@@ -37413,7 +37424,7 @@ async function configureHighLevelReview(options2 = {}) {
37413
37424
  },
37414
37425
  proposed
37415
37426
  );
37416
- const scope = asConfigKeyScope(options2.scope);
37427
+ const scope = parseRepoScopeFlag(options2.scope);
37417
37428
  reportConfigured(
37418
37429
  await configureConfigKeys(questions, {
37419
37430
  answers,
@@ -37421,10 +37432,6 @@ async function configureHighLevelReview(options2 = {}) {
37421
37432
  })
37422
37433
  );
37423
37434
  }
37424
- function asConfigKeyScope(value) {
37425
- if (value === "project" || value === "repo") return value;
37426
- return void 0;
37427
- }
37428
37435
  function reportConfigured(result) {
37429
37436
  for (const write of result.written)
37430
37437
  console.log(
@@ -41075,8 +41082,8 @@ function validateConfigureOptions(options2) {
41075
41082
  console.error("Error: --configure takes no PR number.");
41076
41083
  process.exit(1);
41077
41084
  }
41078
- if (options2.scope && options2.scope !== "project" && options2.scope !== "repo") {
41079
- console.error("Error: --scope must be 'project' or 'repo'.");
41085
+ if (options2.scope && !parseRepoScopeFlag(options2.scope)) {
41086
+ console.error("Error: --scope must be 'git' or 'db'.");
41080
41087
  process.exit(1);
41081
41088
  }
41082
41089
  }
@@ -41165,7 +41172,7 @@ function addReviewModeOptions(command) {
41165
41172
  "With --high-level: review nothing and instead ask for review.highLevel.criticalPaths, uiPaths and descriptionWordCap one at a time, each prefilled with its current value or, when unset, globs Claude proposes from this repo's own tree (for criticalPaths, merged with its defaults), then write the answers in one pass to either this repo's override in the shared assist database or the project assist.yml. A blank answer leaves that key unset"
41166
41173
  ).option(
41167
41174
  "--scope <scope>",
41168
- "With --configure: write to 'repo' (this repo's override in the shared assist database) or 'project' (the repo's own assist.yml) instead of asking which"
41175
+ "With --configure: write to 'db' (repo (db), this repo's override in the shared assist database) or 'git' (repo (git), the repo's own assist.yml) instead of asking which"
41169
41176
  ).option(
41170
41177
  "--answer <key=value>",
41171
41178
  "With --configure: answer one key without prompting, for an agent that has already put the choice to the user (repeatable); an empty value leaves that key unset. Answer all three and nothing is prompted for and no globs are proposed",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@staff0rd/assist",
3
- "version": "0.963.0",
3
+ "version": "0.964.0",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "bin": {