@sma1lboy/rove 0.9.279-next.27 → 0.9.280

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.
Files changed (48) hide show
  1. package/dist/cli/{chunk-6908yyyk.js → chunk-02x0ahxk.js} +1 -1
  2. package/dist/cli/{chunk-k04qvy42.js → chunk-0g1h35mr.js} +1 -1
  3. package/dist/cli/{chunk-v3yf3gmy.js → chunk-2pfh3zm0.js} +1 -1
  4. package/dist/cli/{chunk-4a82zjaq.js → chunk-2wrt80ft.js} +1 -1
  5. package/dist/cli/{chunk-a60qwvyq.js → chunk-3a7x7jg7.js} +3 -3
  6. package/dist/cli/{chunk-90qathy6.js → chunk-4drm07mp.js} +1 -1
  7. package/dist/cli/{chunk-cydytp2v.js → chunk-4z1a65bz.js} +1 -1
  8. package/dist/cli/{chunk-zbdwz30h.js → chunk-5dq0n3h7.js} +1 -1
  9. package/dist/cli/{chunk-37wbxna9.js → chunk-5g6v6tq5.js} +1 -1
  10. package/dist/cli/{chunk-cntrqw1e.js → chunk-5kgq379z.js} +1 -1
  11. package/dist/cli/{chunk-7tbemfgm.js → chunk-6mk6ceb6.js} +2 -2
  12. package/dist/cli/{chunk-e2zv4b2x.js → chunk-7aaw17vr.js} +1 -1
  13. package/dist/cli/{chunk-jtf8ag8v.js → chunk-7fya3y0n.js} +1 -1
  14. package/dist/cli/{chunk-mfp8ax3c.js → chunk-7nnpp89t.js} +1 -1
  15. package/dist/cli/{chunk-z8eg7tnp.js → chunk-amq030gb.js} +2 -2
  16. package/dist/cli/{chunk-t9x54xs5.js → chunk-azt0c2b5.js} +1 -1
  17. package/dist/cli/{chunk-2m22fy6d.js → chunk-bw2y7670.js} +1 -1
  18. package/dist/cli/{chunk-692jsg07.js → chunk-byh32qnx.js} +1 -1
  19. package/dist/cli/{chunk-ney5fnem.js → chunk-d2wndk4q.js} +1 -1
  20. package/dist/cli/{chunk-9192at57.js → chunk-f262ywvg.js} +1 -1
  21. package/dist/cli/{chunk-hqpfg53t.js → chunk-fkgemeww.js} +1 -1
  22. package/dist/cli/{chunk-bv7z8jsy.js → chunk-gk8efsx0.js} +1 -1
  23. package/dist/cli/{chunk-1pcqw0x7.js → chunk-hd1szhba.js} +1 -1
  24. package/dist/cli/{chunk-apgfbg20.js → chunk-j54c5a0a.js} +1 -1
  25. package/dist/cli/{chunk-5wt8ect1.js → chunk-jk4f0xsh.js} +1 -1
  26. package/dist/cli/{chunk-tw3hfkbv.js → chunk-jkgp816v.js} +1 -1
  27. package/dist/cli/{chunk-g2wwgt6t.js → chunk-mey3vksj.js} +1 -1
  28. package/dist/cli/{chunk-hzqfb00a.js → chunk-mjzjah9d.js} +1 -1
  29. package/dist/cli/{chunk-np765y1f.js → chunk-q6tsx6zc.js} +1 -1
  30. package/dist/cli/{chunk-y7ypda6a.js → chunk-qc9sj5wh.js} +1 -1
  31. package/dist/cli/{chunk-3btnwykt.js → chunk-qzhfs668.js} +1 -1
  32. package/dist/cli/{chunk-ngq02svt.js → chunk-r98h6b42.js} +2 -2
  33. package/dist/cli/{chunk-hg8c3ze3.js → chunk-rvjnafyt.js} +1 -1
  34. package/dist/cli/{chunk-a5dqhn9k.js → chunk-t7dyf50m.js} +1 -1
  35. package/dist/cli/{chunk-02bcfavz.js → chunk-tqxbbg3k.js} +1 -1
  36. package/dist/cli/{chunk-q3wzpn85.js → chunk-txvjg1g9.js} +1 -1
  37. package/dist/cli/{chunk-1pk5genq.js → chunk-w003rpr2.js} +1 -1
  38. package/dist/cli/{chunk-qg5wexks.js → chunk-wz307hf6.js} +1 -1
  39. package/dist/cli/{chunk-qd97s6pt.js → chunk-xmjknfy2.js} +1 -1
  40. package/dist/cli/{chunk-tt47sn82.js → chunk-xy5mrrqk.js} +1 -1
  41. package/dist/cli/{chunk-phmt9a1k.js → chunk-zkby63ej.js} +1 -1
  42. package/dist/cli/{chunk-dsm31j1n.js → chunk-zp0q931y.js} +1 -1
  43. package/dist/cli/{chunk-56rjpxzc.js → chunk-zv0rrhck.js} +1 -1
  44. package/dist/cli/index.js +2 -2
  45. package/dist/cli/rove.js +1 -1
  46. package/dist/web/assets/{index-CcqHr-Sc.js → index-DIN0Lz5C.js} +1 -1
  47. package/dist/web/index.html +1 -1
  48. package/package.json +3 -3
@@ -111,7 +111,7 @@ void main() {
111
111
  `)}),i===`gate`&&a&&(0,V.jsx)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1`,children:a.options.map(e=>(0,V.jsxs)(H,{disabled:d,title:e.detail,onClick:()=>void p(()=>TT(t,a.id,{option:e.key})),children:[`[ `,e.key===a.recommended?`★ `:``,e.label,` ]`]},e.key))}),i===`menu`&&r&&(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1`,children:[Dv.map(e=>(0,V.jsxs)(H,{disabled:d,onClick:()=>void p(()=>wT(t,n,r,e.bytes(!1))),children:[`[ `,e.cap,` ]`]},e.id)),(0,V.jsx)(H,{onClick:e.onOpenTab,children:z(`inbox.openTab`)})]}),(i===`reply`||i===`gate`)&&(0,V.jsxs)(`form`,{className:`flex min-w-0 items-center gap-2`,onSubmit:e=>{e.preventDefault(),m()},children:[(0,V.jsx)(`input`,{className:`min-w-0 flex-1 rounded-sm border-hairline border-line bg-paper px-2 py-1.5 font-mono text-ink focus-visible:border-line-active focus-visible:outline-none touch:min-h-10 touch:text-display`,value:l,disabled:d,placeholder:z(`inbox.replyPlaceholder`),"aria-label":z(`inbox.replyPlaceholder`),autoComplete:`off`,enterKeyHint:`send`,onChange:e=>u(e.target.value)}),(0,V.jsx)(H,{type:`submit`,disabled:d||l.trim()===``,children:z(`inbox.send`)})]})]})}function AT({text:e}){return(0,V.jsx)(`span`,{className:`inline-flex flex-wrap gap-x-3 gap-y-0`,children:e.split(`·`).map(e=>e.trim()).filter(Boolean).map(e=>(0,V.jsx)(`span`,{children:e},e))})}var jT={accent:`text-accent`,muted:`text-subtle`,attention:`text-error`,warning:`text-warning`,info:`text-info`,success:`text-success`,added:`text-diff-added`,removed:`text-diff-removed`},MT={accent:`text-accent`,muted:`text-subtle`,attention:`text-error`,warning:`text-warning`,success:`text-success`,info:`text-accent`,ink:`text-ink`},NT=6;function PT(e,t){return e?`${e.repo.split(`/`).filter(Boolean).pop()??e.repo} › ${e.label}`:t}function FT({model:e}){B();let t=v(e.tasks),n=v(e.visits),r=v(e.tabs),[i,a]=(0,g.useState)(0),[o,s]=(0,g.useState)(null),[c,l]=(0,g.useState)(Date.now());(0,g.useEffect)(()=>{let e=window.setInterval(()=>l(Date.now()),3e4);return()=>window.clearInterval(e)},[]);let u=new Map((t?.tasks??[]).map(e=>[e.id,e])),d=(e,t)=>e&&t&&r[e]?.find(e=>e.id===t)?.title||``,f=Bo(t?.attention??[],t?.tasks.map(e=>e.id)??[]).map((e,t)=>{let n=e.taskId?u.get(e.taskId):void 0;return{key:`a${t}:${e.taskId}:${e.tabId}`,section:`attention`,taskId:e.taskId,tabId:e.tabId,identity:PT(n,e.label??e.taskId??``),subtitle:d(e.taskId,e.tabId)||n?.branch||``,at:e.at,attention:e}}),p=new Set(f.map(e=>`${e.taskId}:${e.tabId}`)),m=n.filter(e=>u.has(e.taskId)&&!p.has(`${e.taskId}:${e.tabId}`)).slice(0,NT).map(e=>({key:`r:${e.taskId}:${e.tabId}`,section:`recent`,taskId:e.taskId,tabId:e.tabId,identity:PT(u.get(e.taskId),e.taskId),subtitle:d(e.taskId,e.tabId)||u.get(e.taskId)?.branch||``,at:e.at})),h=[...f,...m],_=h[Math.min(i,h.length-1)],y=async t=>{if(t.attention&&Ro(t.attention.state))return Po(e,t.attention);!t.attention?.taskId||t.attention.gateId||await e.client.request(`attention.dismiss`,{taskId:t.attention.taskId,...t.tabId?{tabId:t.tabId}:{}}).catch(e=>G(String(e),`error`))},b=t=>{if(t.attention&&Ro(t.attention.state))return Fo(e,t.attention);t.attention&&y(t),t.taskId&&u.has(t.taskId)&&(e.select(t.taskId,t.tabId),Cn())};(0,g.useEffect)(()=>{let e=e=>{if(!(e.target instanceof HTMLElement&&e.target.closest(`input, textarea`))){if(e.key===`ArrowDown`||e.key===`j`)a(e=>Math.min(h.length-1,e+1));else if(e.key===`ArrowUp`||e.key===`k`)a(e=>Math.max(0,e-1));else if(e.key===`Enter`&&_)b(_);else if(e.key===`d`&&_?.attention)y(_);else return;e.preventDefault()}};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)});let x=n=>{let r=n.attention?Io(n.attention.state):null,i=n===_,l=n.attention,d=n.taskId?u.get(n.taskId):void 0,f=l?.gateId?t?.gates?.find(e=>e.id===l.gateId&&e.status===`open`):void 0,p=n.tabId??f?.tabId??null,m=!!l&&!!d&&!d.machine&&!Ro(l.state)&&(!l.gateId||!!f)&&(!!p||!!f),g=l?.state===`permission_needed`||!!p&&d?.tabStatus?.[p]?.kind===`needs-input`,v=f?`gate`:l?.state===`dead`?`readonly`:g?`menu`:`reply`,y=`${n.taskId}:${n.tabId}:${l?.gateId??``}`,x=m&&o===y;return(0,V.jsxs)(`li`,{children:[(0,V.jsxs)(`div`,{className:Qn,children:[(0,V.jsxs)(`button`,{type:`button`,className:`${nr({selected:i,stack:!0})} ${$n}`,onMouseEnter:()=>a(h.indexOf(n)),onClick:()=>b(n),children:[(0,V.jsxs)(`span`,{className:Xn,children:[(0,V.jsx)(`span`,{className:rr,children:n.identity}),r&&(0,V.jsxs)(`span`,{className:`flex-none font-mono text-meta font-normal normal-nums ${MT[r.tone]}`,children:[r.glyph,` `,z(r.stateKey)]}),(0,V.jsx)(`span`,{className:Zn,children:Lo(c-n.at)})]}),n.subtitle&&(0,V.jsx)(`span`,{className:`truncate font-mono text-meta font-normal normal-nums text-muted`,children:n.subtitle})]}),m&&(0,V.jsx)(H,{className:`flex-none whitespace-nowrap pr-2 font-mono text-meta`,"aria-expanded":x,onClick:()=>{a(h.indexOf(n)),s(x?null:y)},children:z(x?`inbox.hide`:`inbox.reply`)})]}),x&&n.taskId&&(0,V.jsx)(kT,{model:e,taskId:n.taskId,tabId:p,mode:v,gate:f,onOpenTab:()=>b(n)})]},n.key)};return(0,V.jsx)(cr,{title:z(`inbox.title`),wide:!0,children:(0,V.jsxs)(`div`,{className:Rn,children:[(0,V.jsx)(`p`,{className:`${U} text-muted ${qn} touch:hidden!`,children:(0,V.jsx)(AT,{text:z(`inbox.hints`)})}),(0,V.jsx)(`h2`,{className:`${U} text-muted ${Jn}`,children:z(`inbox.attention`)}),f.length===0?(0,V.jsx)(`p`,{className:`mono text-muted`,children:z(`inbox.empty`)}):(0,V.jsx)(`ul`,{className:Yn,children:f.map(x)}),m.length>0&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`h2`,{className:`m-0 font-sans text-meta font-medium normal-nums text-muted mt-1`,children:z(`inbox.recent`)}),(0,V.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-0.5 p-0`,children:m.map(x)})]})]})})}var IT=[`project`,`state`],LT=`rove.railGroup`,RT=_(IT.find(e=>e===localStorage.getItem(LT))??`project`);function zT(e){RT.set(e),localStorage.setItem(LT,e)}var BT=`rove.activeSortMode`;function VT(){let e=localStorage.getItem(BT);return rw.find(t=>t===e)??`recent`}var HT=_(VT());function UT(e){HT.set(e),localStorage.setItem(BT,e)}function WT(){UT(rw[(rw.indexOf(HT.get())+1)%rw.length]??`default`)}var GT=_(!1),KT=_(null);function qT(e){e&&(HT.get()!=="default"||RT.get()===`state`)&&(UT(`default`),zT(`project`),G(q(`tasks`,`sort.reorderSwitched`))),e||KT.set(null),GT.set(e)}async function JT(e,t,n){let r=n<0?`up`:`down`;try{await e.client.request(`task.move`,{taskId:t.task.id,direction:r})}catch(e){G(q(`tasks`,`toast.moveFailed`,{error:e instanceof Error?e.message:String(e)}),`error`)}}async function YT(e,t,n){let r=n<0?`up`:`down`;try{for(let i=0;i<Math.abs(n);i++)await e.client.request(`task.move`,{taskId:t,direction:r})}catch(e){G(q(`tasks`,`toast.moveFailed`,{error:e instanceof Error?e.message:String(e)}),`error`)}}async function XT(e,t,n){if(n.pin!==void 0)try{await e.client.request(`task.pin`,{taskId:t,pinned:n.pin})}catch(e){G(q(`tasks`,`toast.moveFailed`,{error:e instanceof Error?e.message:String(e)}),`error`);return}await YT(e,t,n.steps)}var ZT=`-my-0.75 -mr-0.5 ml-0 flex flex-none self-stretch`,QT=`before:absolute before:top-0 before:left-1 before:content-[''] before:[border-left:var(--hairline)_solid_var(--line-active)]`,$T={blank:``,pipe:`${QT} before:bottom-0`,tee:`${QT} before:bottom-0`,elbow:`${QT} before:right-0 before:bottom-1/2 before:rounded-bl-[6px] before:[border-bottom:var(--hairline)_solid_var(--line-active)]`},eE=e=>`relative w-3 ${$T[e]}`,tE=`-mx-1 inline-flex min-w-6 cursor-pointer items-center justify-center gap-1 self-stretch rounded-xs px-2 font-mono hover:bg-hover`,nE=`inline-flex items-center gap-1`,rE=e=>`fixed z-35 flex max-h-[min(380px,60vh)] w-85 max-w-[calc(100vw-24px)] animate-pr-list-in flex-col overflow-y-auto overscroll-contain rounded-md border-hairline border-line bg-surface p-1.5 shadow-popover transition-[opacity,translate] duration-120 ease-in motion-reduce:animate-none motion-reduce:transition-none ${e?`-translate-x-1 opacity-0`:``}`,iE=`pointer-events-none fixed z-35 max-w-80 -translate-y-1/2 animate-row-tip-in rounded-sm border-hairline border-line bg-inset px-2.5 py-1.5 text-meta leading-[1.4] whitespace-normal wrap-anywhere text-ink shadow-popover motion-reduce:animate-none`,aE=`inline-flex flex-none items-center text-subtle`,oE=`group/rail rail @container row-1 flex min-h-0 flex-col focus:outline-none ${He}`,sE=`flex min-w-0 items-center gap-2.5 overflow-hidden px-3.5 pt-3.5 pb-2.5 whitespace-nowrap`,cE=`flex gap-1 px-3.5 pb-2 text-meta`,lE=`min-w-0 flex-1 border-none bg-transparent p-0 text-ink [font:inherit] outline-none placeholder:text-subtle`,uE=e=>`flex-1 overflow-y-auto px-1.5 pt-1 pb-3 scrollbar-none ${e?`[&>[data-row]]:[transition:transform_150ms_ease-out] motion-reduce:[&>[data-row]]:transition-none`:``}`,dE=`group-focus-within/rail:[box-shadow:inset_0_0_0_1px_var(--focus)]`,fE=e=>`group/head mx-2 mt-1.5 mb-1 flex items-center gap-1 font-mono text-meta font-semibold normal-nums text-subtle not-first:mt-4.5 ${e.moving||e.dragging?`bg-accent-soft`:``} ${e.moving?`after:font-mono after:text-meta after:font-medium after:normal-nums after:text-accent after:content-['move']`:``}`,pE=`touch:relative touch:after:absolute touch:after:-inset-x-1.5 touch:after:-inset-y-3 touch:after:content-['']`,mE=`group/toggle -ml-1 inline-flex min-w-0 cursor-pointer items-center gap-1 rounded-xs border-none bg-transparent px-1 py-0.5 text-inherit [font:inherit] hover:text-ink ${pE}`,hE=e=>e?``:`opacity-0 group-hover/head:opacity-100 group-focus-visible/toggle:opacity-100 touch:opacity-100`,gE=`-mr-[4.5px] ml-auto size-5 cursor-pointer rounded-xs border-none bg-transparent text-muted opacity-0 [font:400_var(--fs-display)/1_var(--sans)] group-hover/head:opacity-100 hover:bg-hover hover:text-ink focus-visible:opacity-100 touch:opacity-100 ${pE}`,_E=1e4;function vE(e,t){let n=e.hostLabel||e.alias;if(e.state===`online`)return e.version?`${n} · v${e.version}`:n;let r=t[e.state];return e.state===`mismatch`?e.version?`${n} · ⚠ v${e.version} (${r})`:`${n} · ⚠ ${r}`:`${n} · ${r}`}function yE(e,t,n,r=e){let i=t?.hostLabel&&t.hostLabel!==e?` (${t.hostLabel})`:``,a=n.runsOn.replace(`{host}`,t?`${e}${i}`:r);return!t||t.state===`online`?a:`${a}${vE(t,n).slice((t.hostLabel||t.alias).length)}`}function bE(e,t,n){if(e.kind!==`task`||e.machine===void 0)return null;let r=e.machine;return yE(r,t.find(e=>e.alias===r),n,e.task.machine?.label)}function xE({label:e}){return(0,V.jsx)(`span`,{className:aE,title:e,role:`img`,"aria-label":e,children:(0,V.jsx)(`svg`,{viewBox:`0 0 16 16`,width:`12`,height:`12`,"aria-hidden":`true`,children:(0,V.jsx)(`path`,{d:`M4.5 13a3 3 0 0 1-.4-5.97A4.5 4.5 0 0 1 12.8 6.6 3.2 3.2 0 0 1 12.3 13Z`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.4`,strokeLinejoin:`round`})})})}function SE({host:e,onMachines:t}){return B(),(0,V.jsxs)(`div`,{className:qt,children:[(0,V.jsx)(`p`,{className:`text-muted`,children:q(`tasks`,`machine.filesElsewhere`,{host:e})}),(0,V.jsx)(`p`,{className:`text-muted`,children:q(`tasks`,`machine.filesHint`,{host:e})}),(0,V.jsx)(`div`,{children:(0,V.jsx)(H,{hit:`tight`,onClick:t,children:z(`machines.open`)})})]})}function CE(e){let t=v(e.client.conn),n=v(e.remote),[r,i]=(0,g.useState)(()=>Hs(e,`machines.list`)?.machines??[]),a=[...new Set(n.map(e=>`${e.machine?.id}:${e.machine?.stale??!1}`))].join();return(0,g.useEffect)(()=>{if(t.state!==`open`)return;let n=!0,r=()=>Ws(e,`machines.list`).then(e=>n&&i(e.machines),()=>{});r();let a=window.setInterval(r,_E);return()=>{n=!1,window.clearInterval(a)}},[e.client,t.state,a]),r}var wE=`flex min-h-0 min-w-0 flex-1 flex-col p-4 font-mono text-meta leading-[1.5] font-normal not-italic normal-nums`,TE=`flex flex-1 flex-col items-center justify-center gap-1.5 text-center`,EE=`mx-auto flex w-full max-w-[104ch] flex-col gap-2`,DE=`flex flex-col gap-2 rounded-md border-hairline border-line bg-surface px-3 py-2.5 focus-within:border-line-active`,OE=`flex flex-wrap items-center justify-end gap-1.5`,kE=`max-h-[40vh] min-h-[4.5em] w-full bg-transparent text-ink [border:0] [outline:0]`,AE=`flex flex-wrap items-center gap-1.5 px-1`,jE=`flex-1`,ME=`size-3.25 flex-none fill-none stroke-current [stroke-linecap:round] [stroke-linejoin:round] [stroke-width:1.3]`,NE=(e=!1)=>`inline-flex max-w-[28ch] items-center gap-1.5 overflow-hidden rounded-full border-hairline px-2.5 py-0.75 text-ellipsis whitespace-nowrap touch:py-1.75 [&:hover]:bg-hover [&:hover]:text-ink aria-expanded:bg-hover aria-expanded:text-ink ${e?`border-[color-mix(in_srgb,var(--accent)_45%,transparent)] bg-accent-soft text-accent`:`border-line text-muted`}`,PE=`disabled:cursor-default disabled:opacity-60`,FE=`group/chip relative inline-flex`,IE=`flex min-h-0 flex-col gap-1 overflow-y-auto p-1.5 [outline:0]`,LE=`flex min-h-0 flex-col overflow-y-auto`,RE=`sticky top-0 z-1 m-0 bg-surface px-1.5 pt-1.5 pb-0.5 text-left`,zE=e=>`flex w-full items-baseline gap-2 rounded-[calc(var(--radius)-6px)] px-2 py-1 text-left touch:py-2.5 disabled:cursor-default disabled:opacity-50 ${e.dim?`text-subtle`:`text-ink`} ${e.cursor?`bg-hover`:``}`,BE=`flex-[0_0_1.5ch] text-accent`,VE=`ml-auto pl-3 inline-flex items-center gap-1`,HE=`flex-none whitespace-nowrap`,UE=`flex flex-col gap-0.5 px-1.5 py-0.5`,WE=`min-w-[36ch]`,GE=`flex items-center gap-1.5 p-1.5`;function KE(){return(0,V.jsx)(`svg`,{className:ME,viewBox:`0 0 16 16`,"aria-hidden":`true`,children:(0,V.jsx)(`path`,{d:`M2 4.5a1 1 0 0 1 1-1h3l1.5 1.5H13a1 1 0 0 1 1 1V12a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1z`})})}function qE(){return(0,V.jsxs)(`svg`,{className:ME,viewBox:`0 0 16 16`,"aria-hidden":`true`,children:[(0,V.jsx)(`circle`,{cx:`4.5`,cy:`3.5`,r:`1.5`}),(0,V.jsx)(`circle`,{cx:`4.5`,cy:`12.5`,r:`1.5`}),(0,V.jsx)(`circle`,{cx:`11.5`,cy:`5`,r:`1.5`}),(0,V.jsx)(`path`,{d:`M4.5 5v6M11.5 6.5c0 3-7 2-7 4.5`})]})}function JE(){return(0,V.jsx)(`svg`,{className:ME,viewBox:`0 0 16 16`,"aria-hidden":`true`,children:(0,V.jsx)(`path`,{d:`M10.5 4.5 5.8 9.2a1.4 1.4 0 0 0 2 2l5-5a2.8 2.8 0 0 0-4-4l-5.2 5.2a4.2 4.2 0 0 0 6 6L13 9`})})}function YE(){return(0,V.jsxs)(`svg`,{className:ME,viewBox:`0 0 16 16`,"aria-hidden":`true`,children:[(0,V.jsx)(`circle`,{cx:`8`,cy:`8`,r:`5.75`}),(0,V.jsx)(`path`,{d:`M8 4.75V8l2.25 1.5`})]})}function XE(e){let[t,n]=(0,g.useState)(!1),r=(0,g.useRef)(null),i=(0,g.useRef)(null),a=(0,g.useRef)(null);(0,g.useLayoutEffect)(()=>{let e=a.current;if(!t||!e)return;let n=e.getBoundingClientRect(),r=n.right>window.innerWidth-8?window.innerWidth-8-n.right:n.left<8?8-n.left:0;r&&(e.style.transform=`translateX(${Math.round(r)}px)`)},[t]);let o=()=>{n(!1),i.current?.focus()};return(0,g.useEffect)(()=>{if(!t)return;let e=e=>{r.current?.contains(e.target)||n(!1)};return window.addEventListener(`mousedown`,e),()=>window.removeEventListener(`mousedown`,e)},[t]),(0,V.jsxs)(`span`,{ref:r,className:FE,onKeyDown:e=>{e.key!==`Escape`||!t||(e.preventDefault(),e.stopPropagation(),o())},children:[(0,V.jsx)(`button`,{ref:i,type:`button`,className:NE(),"data-field":e.field,title:e.title,"aria-haspopup":`menu`,"aria-expanded":t,disabled:e.disabled,onClick:()=>n(e=>!e),children:e.label}),t&&(0,V.jsx)(`div`,{ref:a,className:`absolute bottom-[calc(100%+6px)] left-0 z-20 flex max-h-[min(50vh,420px)] max-w-[min(52ch,calc(100vw-16px))] min-w-[min(34ch,calc(100vw-16px))] flex-col overflow-hidden rounded-md border-hairline border-line-active bg-surface shadow-popover group-last-of-type/chip:right-0 group-last-of-type/chip:left-auto`,children:e.children(o)})]})}function ZE(e){let[t,n]=(0,g.useState)(0),r=[...e.extra?[e.extra]:[],...e.rows,...e.more??[]],i=Math.min(t,Math.max(0,r.length-1)),a=(0,g.useRef)(null);return(0,g.useEffect)(()=>{a.current?.scrollIntoView({block:`nearest`})},[i,e.rows]),(0,V.jsxs)(`div`,{className:IE,children:[(0,V.jsx)(`input`,{className:nn,autoFocus:!0,spellCheck:!1,placeholder:e.placeholder,value:e.query,onChange:t=>{n(0),e.onQuery(t.target.value)},onKeyDown:t=>{if(!t.nativeEvent.isComposing){if(t.key===`ArrowDown`||t.key===`ArrowUp`)t.preventDefault(),n(Math.max(0,Math.min(r.length-1,i+(t.key===`ArrowDown`?1:-1))));else if(t.key===`Enter`){t.preventDefault();let n=r[i];n&&e.onPick(n.key)}}}}),(0,V.jsxs)(`div`,{className:LE,children:[r.length===0&&(0,V.jsx)(`p`,{className:`mx-2 my-1 text-muted`,children:e.empty}),r.map((t,r)=>(0,V.jsxs)(g.Fragment,{children:[e.moreLabel&&t===e.more?.[0]&&(0,V.jsx)(`p`,{className:`mx-2 mt-2 mb-0.5 text-muted`,children:e.moreLabel}),(0,V.jsxs)(`button`,{type:`button`,"aria-current":t.checked===!0,ref:r===i?a:void 0,tabIndex:-1,title:t.title,className:zE({cursor:r===i}),onMouseMove:()=>n(r),onClick:()=>e.onPick(t.key),children:[(0,V.jsx)(`span`,{className:BE,children:t.checked?`✓`:``}),(0,V.jsx)(`span`,{className:HE,children:t.text}),t.dim&&(0,V.jsx)(`span`,{className:`ml-auto pl-3 text-muted ${t.title?`min-w-0 overflow-hidden text-ellipsis whitespace-nowrap`:``}`,children:t.dim})]})]},t.key))]})]})}function QE(e){return(0,V.jsxs)(`button`,{type:`button`,role:e.multi?`menuitemcheckbox`:`menuitemradio`,"aria-checked":e.checked,tabIndex:-1,disabled:e.option.disabled,className:zE({cursor:e.cursor,dim:e.option.dim}),onMouseMove:e.onHover,onClick:e.onPick,children:[(0,V.jsx)(`span`,{className:BE,children:e.checked?`✓`:``}),(0,V.jsx)(`span`,{children:e.option.label}),!e.checked&&e.digit!==void 0&&!e.option.disabled&&(0,V.jsx)(`span`,{className:`ml-auto pl-3 text-muted`,children:e.digit})]})}function $E(e){let[t,n]=(0,g.useState)(()=>Math.max(0,e.options.findIndex(t=>t.id===e.value))),r=(0,g.useRef)(null);return(0,g.useEffect)(()=>r.current?.focus(),[]),(0,V.jsxs)(`div`,{ref:r,role:`menu`,tabIndex:-1,className:IE,onKeyDown:r=>{if(!(r.ctrlKey||r.metaKey||r.altKey||r.nativeEvent.isComposing)){if(r.key===`ArrowDown`||r.key===`ArrowUp`)r.preventDefault(),n(Math.max(0,Math.min(e.options.length-1,t+(r.key===`ArrowDown`?1:-1))));else if(r.key===`Enter`){r.preventDefault();let n=e.options[t];n&&!n.disabled&&e.onPick(n.id)}else if(e.onBack&&(r.key===`Escape`||r.key===`ArrowLeft`))r.preventDefault(),r.stopPropagation(),e.onBack();else{let t=e.digits?Ns(r.key,e.options.length):null,n=t===null?void 0:e.options[t];if(!n||n.disabled)return;r.preventDefault(),e.onPick(n.id)}}},children:[e.onBack?(0,V.jsxs)(`button`,{type:`button`,className:`${RE} ${U} text-muted`,tabIndex:-1,onClick:e.onBack,children:[`‹ `,e.heading]}):(0,V.jsx)(`p`,{className:`${RE} ${U} text-muted`,children:e.heading}),e.options.map((r,i)=>(0,V.jsx)(QE,{option:r,checked:e.values?e.values.includes(r.id):r.id===e.value,multi:e.values!==void 0,cursor:i===t,digit:e.digits&&i<9?i+1:void 0,onHover:()=>n(i),onPick:()=>e.onPick(r.id)},r.id)),e.footer]})}function eD(e){let[t,n]=(0,g.useState)(`root`),r=e.models.length+ +(e.efforts.length>0),[i,a]=(0,g.useState)(()=>Math.max(0,e.models.findIndex(t=>t.id===e.model))),o=(0,g.useRef)(null);if((0,g.useEffect)(()=>{t===`root`&&o.current?.focus()},[t]),t===`effort`)return(0,V.jsx)($E,{heading:z(`newSession.effort`),options:e.efforts,value:e.effort,onBack:()=>n(`root`),onPick:t=>{e.onEffort(t),e.close()}});let s=t=>{e.onModel(t),e.close()},c=e.efforts.find(t=>t.id===e.effort)?.label??``;return(0,V.jsxs)(`div`,{ref:o,role:`menu`,tabIndex:-1,className:IE,onKeyDown:t=>{if(!(t.ctrlKey||t.metaKey||t.altKey||t.nativeEvent.isComposing)){if(t.key===`ArrowDown`||t.key===`ArrowUp`)t.preventDefault(),a(Math.max(0,Math.min(r-1,i+(t.key===`ArrowDown`?1:-1))));else if(t.key===`Enter`||t.key===`ArrowRight`&&i>=e.models.length){t.preventDefault();let r=e.models[i];r?s(r.id):e.efforts.length>0&&n(`effort`)}else{let n=Ns(t.key,e.models.length),r=n===null?void 0:e.models[n];if(!r)return;t.preventDefault(),s(r.id)}}},children:[(0,V.jsx)(`p`,{className:`${RE} ${U} text-muted`,children:z(`newSession.modelHeading`)}),e.models.map((t,n)=>(0,V.jsx)(QE,{option:t,checked:t.id===e.model,multi:!1,cursor:n===i,digit:n<9?n+1:void 0,onHover:()=>a(n),onPick:()=>s(t.id)},t.id)),e.efforts.length>0&&(0,V.jsxs)(`button`,{type:`button`,role:`menuitem`,tabIndex:-1,className:`${zE({cursor:i===e.models.length})} mt-1 border-t-hairline border-t-line`,onMouseMove:()=>a(e.models.length),onClick:()=>n(`effort`),children:[(0,V.jsx)(`span`,{className:`flex-[0_0_1.5ch] text-accent`}),(0,V.jsx)(`span`,{children:z(`newSession.effort`)}),(0,V.jsxs)(`span`,{className:`${VE} text-muted`,children:[c,(0,V.jsx)(Ia,{right:!0})]})]})]})}function tD(e){return(0,V.jsxs)(`div`,{className:`${IE} ${WE}`,children:[(0,V.jsx)(`p`,{className:`${RE} ${U} text-muted`,children:z(`newSession.branches`)}),(0,V.jsxs)(`label`,{className:UE,children:[(0,V.jsx)(`span`,{className:`text-muted`,children:z(`newSession.branchName`)}),(0,V.jsx)(`input`,{className:nn,autoFocus:!0,spellCheck:!1,placeholder:z(`newSession.branchNamePlaceholder`),value:e.branch,onChange:t=>e.onBranch(t.target.value)})]}),e.repos.map(t=>(0,V.jsxs)(`label`,{className:UE,children:[(0,V.jsxs)(`span`,{children:[t.name,t.primary&&(0,V.jsxs)(`span`,{className:`text-muted`,children:[` `,z(`newSession.primary`)]})]}),(0,V.jsx)(`select`,{className:nn,"aria-label":t.name,value:t.base||t.current,onChange:n=>e.onBase(t.path,n.target.value),children:(t.branches.includes(t.base||t.current)?t.branches:[t.base||t.current,...t.branches]).filter(e=>e!==``).map(e=>(0,V.jsx)(`option`,{value:e,children:e},e))})]},t.path))]})}function nD(e){return e.id.startsWith(`root:`)?e.primary??e.checkouts[0]??e.id:e.id}function rD(e,t){if(!e)return null;let n=t.find(t=>t.id===e||t.checkouts.includes(e));return n?{ref:nD(n),clone:!1}:e.startsWith(`/`)?{ref:e,clone:!1}:null}function iD(e,t,n){let r=t.toLowerCase();return n?e.some(e=>e.toLowerCase()===`github.com/${r}`):e.some(e=>os(e).base.toLowerCase()===(r.split(`/`)[1]??``))}function aD(e){let t=e.begin?``:as(e.prompt);return{repo:e.pick.ref,machine:e.machine,...e.pick.clone?{clone:!0}:{},...e.baseRef?{baseBranch:e.baseRef}:{},...e.begin&&e.prompt?{prompt:e.prompt}:{},...t?{title:t}:{},...e.engine?{engine:e.engine}:{}}}var oD={offline:`newSession.remoteOffline`,outdated:`newSession.remoteOutdated`},sD=(e,t)=>Ws(e,`machines.repos`,{machine:t});function cD(e,t){let n=t.filter(e=>e.state===`online`).map(e=>e.alias).join(`
112
112
  `);(0,g.useEffect)(()=>{for(let t of n?n.split(`
113
113
  `):[])sD(e,t).catch(()=>{})},[e,n])}function lD(e,t){B();let[n,r]=(0,g.useState)(null);if((0,g.useEffect)(()=>{if(!t)return;let n=!1;return sD(e,t).then(e=>!n&&r({machine:t,reply:e,failed:``})).catch(e=>!n&&r({machine:t,reply:null,failed:String(e)})),()=>{n=!0}},[e,t]),!t)return{repos:[],loaded:!0,problem:``};let i=n?.machine===t?n:void 0,a=Hs(e,`machines.repos`,{machine:t});if(!i&&!a)return{repos:[],loaded:!1,problem:``};let o=i?i.reply:a;if(!o)return{repos:[],loaded:!0,problem:z(`newSession.remoteFailed`,{machine:t,message:i?.failed??``})};let s=o.reason?oD[o.reason]:void 0,c=o.reason?s?z(s,{machine:t}):z(`newSession.remoteFailed`,{machine:t,message:o.message??o.reason}):``;return{repos:o.repos,loaded:!0,problem:c}}function uD(e,t){return t.problem?t.problem:t.loaded?z(`newSession.remoteNone`,{machine:e}):z(`newSession.remoteLoading`,{machine:e})}function dD(){return(0,V.jsxs)(`svg`,{className:ME,viewBox:`0 0 16 16`,"aria-hidden":`true`,children:[(0,V.jsx)(`rect`,{x:`2`,y:`3`,width:`12`,height:`8`,rx:`1`}),(0,V.jsx)(`path`,{d:`M5.5 13.5h5M8 11v2.5`})]})}function fD(e){let t=(B()===`zh`?jr:Ar).machine,n=e.machines.find(t=>t.alias===e.value),r=e.value?n?.hostLabel||e.value:z(`newSession.thisMachine`);return(0,V.jsx)(XE,{field:`machine`,title:z(`newSession.machine`),label:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(dD,{}),r]}),children:n=>(0,V.jsx)($E,{heading:z(`newSession.machine`),options:[{id:``,label:z(`newSession.thisMachine`)},...e.machines.map(e=>({id:e.alias,label:vE(e,t),disabled:e.state!==`online`}))],value:e.value,digits:!0,onPick:t=>{e.onPick(t),n()}})})}function pD(e){let[t,n]=(0,g.useState)(``),r=t.trim();return(0,V.jsx)(XE,{field:`branch`,title:z(`newSession.branch`),label:e.value||z(`newSession.branch`),children:i=>(0,V.jsx)(ZE,{placeholder:z(`newSession.branchTypeRef`),empty:``,rows:[{key:``,text:z(`newSession.branchRemoteDefault`),checked:e.value===``}],query:t,onQuery:n,extra:r?{key:r,text:r,checked:e.value===r}:null,onPick:t=>{e.onPick(t),n(``),i()}})})}async function mD(e,t){return(await e.client.request(`task.spawn`,aD(t))).taskIds[0]}function hD(e){return e instanceof d_&&e.code===`CLONE_FAILED`?q(`newTask`,`error.cloneFailed`,{error:e.message}):e instanceof Error?e.message:String(e)}function gD(e){let[t,n]=(0,g.useState)(``);if(e.ungrouped)return null;if(e.remote)return e.remotePick&&(0,V.jsx)(pD,{value:e.remoteBase,onPick:e.onRemoteBase});let{repos:r,bases:i,inPlace:a}=e,o=r[0]??``,s=e.probes[o]??null,c=i[o]||s?.current||``,l=ss(s?.branches??[],t).map(e=>({key:e,text:e,checked:e===(i[o]||s?.current)})),u=r.map(t=>({path:t,name:os(t).base,primary:t===o,branches:e.probes[t]?.branches??[],current:e.probes[t]?.current??``,base:i[t]??``}));return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`button`,{type:`button`,className:`${NE(!a)} ${PE}`,"aria-pressed":!a,disabled:r.length>1,title:r.length>1?z(`newSession.worktreeMulti`):z(a?`newSession.worktreeOff`:`newSession.worktreeOn`),onClick:e.onToggleWorktree,children:[(0,V.jsx)(qE,{}),z(`newSession.worktree`)]}),r.length>1?(0,V.jsx)(XE,{field:`branch`,title:z(`newSession.branches`),label:z(`newSession.branches`),children:()=>(0,V.jsx)(tD,{repos:u,branch:e.branchName,onBranch:e.onBranchName,onBase:e.onBase})}):!a&&s?.ok&&c&&(0,V.jsx)(XE,{field:`branch`,title:z(`newSession.branch`),label:c,children:r=>(0,V.jsx)(ZE,{placeholder:z(`newSession.branchSearch`),empty:z(`newSession.branchEmpty`),rows:l,query:t,onQuery:n,onPick:t=>{e.onBase(o,t),n(``),r()}})})]})}function _D(e,t){let[n,r]=(0,g.useState)(null),i=t&&n!==null,a=i?n:e.engine?[e.engine]:[];return{ids:a,comparing:i,setComparing:e=>r(e?a:null),toggle(t){let n=Os(a,t);r(n),n[0]&&n[0]!==e.engine&&e.setEngine(n[0])}}}function vD(e){let{picks:t,choice:n}=e,r=n.engines;if(r.length<2)return null;let i=t.ids.map(e=>r.find(t=>t.id===e)?.name??e);return(0,V.jsx)(XE,{field:`engine`,title:z(`newSession.engine`),label:ks(i)||z(`newSession.engine`),children:i=>(0,V.jsx)($E,{heading:z(`newSession.engine`),options:r.map(e=>({id:e.id,label:e.name,dim:e.ready===!1})),value:n.engine,...t.comparing?{values:t.ids}:{},onPick:e=>{if(t.comparing)return t.toggle(e);n.setEngine(e),i()},footer:e.available&&r.length>1?(0,V.jsx)(H,{className:`mx-2 mt-1 mb-0.5 self-start font-mono`,"data-field":`compare-engines`,hit:`tight`,onClick:()=>t.setComparing(!t.comparing),children:z(t.comparing?`compare.oneEngine`:`compare.severalEngines`)}):null})})}function yD(e){return(0,V.jsx)(XE,{field:`model`,title:z(`newSession.model`),label:Ds(e.models,e.model,e.effort,z(`newSession.modelDefault`)),children:t=>(0,V.jsx)(eD,{...e,close:t})})}var bD=6e4,xD=/^(?:(today|tomorrow|今天|明天)\s*)?(\d{1,2})(?::(\d{2}))?\s*(am|pm)?$/i,SD=/^\+\s*(?:(\d+)\s*h)?\s*(?:(\d+)\s*m)?$/i;function CD(e,t){let n=e.trim(),r=SD.exec(n);if(r&&(r[1]||r[2])){let e=Number(r[1]??0)*60+Number(r[2]??0);return e>0?new Date(t.getTime()+e*bD):null}let i=xD.exec(n);if(!i)return null;let a=i[1]?.toLowerCase(),o=Number(i[2]),s=Number(i[3]??0),c=i[4]?.toLowerCase();if(c){if(o<1||o>12)return null;o=o%12+(c===`pm`?12:0)}if(o>23||s>59)return null;let l=new Date(t.getFullYear(),t.getMonth(),t.getDate(),o,s);if(a===`tomorrow`||a===`明天`)l.setDate(l.getDate()+1);else if(l.getTime()<=t.getTime()){if(a)return null;l.setDate(l.getDate()+1)}return l.getTime()>t.getTime()?l:null}function wD(e,t=new Date){let n=e.toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`});return e.toDateString()===t.toDateString()?n:`${e.toLocaleDateString([],{weekday:`short`})} ${n}`}async function TD(e,t,n,r){await e.request(`task.scheduleStart`,{taskId:t,at:n.toISOString(),prompt:r})}function ED(e){let[t,n]=(0,g.useState)(``);return(0,V.jsx)(XE,{field:`later`,title:z(`newSession.later`),disabled:e.disabled,label:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(YE,{}),z(`newSession.later`)]}),children:r=>{let i=()=>{let n=CD(t,new Date);if(!n)return e.onInvalid(z(`newSession.laterBad`));r(),e.onSchedule(n)};return(0,V.jsxs)(`div`,{className:GE,children:[(0,V.jsx)(`input`,{className:`${nn} min-w-0 flex-1`,value:t,placeholder:z(`newSession.laterPlaceholder`),"aria-label":z(`newSession.later`),spellCheck:!1,autoComplete:`off`,autoFocus:!0,onChange:e=>n(e.target.value),onKeyDown:e=>{e.key!==`Enter`||e.nativeEvent.isComposing||(e.preventDefault(),e.stopPropagation(),i())}}),(0,V.jsx)(H,{variant:`filled`,disabled:!t.trim(),onClick:i,children:z(`newSession.laterConfirm`)})]})}})}var DD=`clone:`;function OD(e){let{model:t,saved:n,picked:r,primary:i,home:a,query:o,remote:s}=e,[c,l]=(0,g.useState)(()=>Hs(t,`github.repos`)??null);(0,g.useEffect)(()=>{let e=!1;return Ws(t,`github.repos`).then(t=>!e&&l(t)).catch(()=>!e&&l({repos:[],reason:`failed`})),()=>{e=!0}},[t]);let u=o.trim(),d=ss(n,o),f=z(`rail.noProject`),p=e.ungrouped&&(!u||f.toLowerCase().includes(u.toLowerCase()))?[{key:fw,text:f,dim:a,checked:e.ungrouped.on}]:[],m=d.map(e=>{let{base:t,dir:n}=os(e);return{key:e,text:t,dim:e===i&&r.length>1?`${z(`newSession.primary`)}, ${n}`:n,checked:r.includes(e)}}),h=bs(u),_=h&&(h.includes(`:`)||d.length===0)?h:null,v=!_&&cs(u)&&!n.includes(u)&&(!s||u.startsWith(`/`))?us(ls(u,a)):``,y=_?{key:DD+_,text:s?z(`newSession.cloneRowOn`,{source:_,machine:s.name}):z(`newSession.cloneRow`,{source:_})}:v?{key:v,text:v,checked:r.includes(v)}:null,b=u.toLowerCase(),x=(c?.repos??[]).filter(e=>e.nameWithOwner.toLowerCase().includes(b)).filter(e=>!iD(n,e.nameWithOwner,s!==void 0)).map(e=>({key:DD+e.nameWithOwner,text:e.nameWithOwner,dim:e.description,title:e.description}));return(0,V.jsx)(ZE,{placeholder:z(s?`newSession.repoSearchRemote`:`newSession.repoSearch`),empty:s?.empty??z(`newSession.repoEmpty`),rows:s?.blocked?[]:[...p,...m],query:o,onQuery:e.onQuery,extra:s?.blocked?null:y,more:s?.blocked?[]:x,moreLabel:z(`newSession.githubGroup`),onPick:t=>{if(t===`~scratch`)return e.ungrouped?.pick(),e.close();if(!t.startsWith(`clone:`))return e.onToggle(t);e.onClone(t.slice(6)),e.close()}})}function kD(e){document.querySelector(`.dialog [data-field="${e}"]:not([hidden] *)`)?.focus()}function AD(e){let[t,n]=(0,g.useState)(0),r=e.open&&e.items.length>0,i=Math.min(t,Math.max(0,e.items.length-1)),a=(0,g.useRef)(null),{onCursor:o}=e;return(0,g.useEffect)(()=>o?.(i),[i,o]),(0,g.useEffect)(()=>{a.current?.scrollIntoView({block:`nearest`})},[i,e.items]),(0,V.jsxs)(`div`,{className:`relative`,children:[(0,V.jsx)(`input`,{className:nn,"data-field":e.field,spellCheck:!1,autoComplete:`off`,autoFocus:e.autoFocus,placeholder:e.placeholder,value:e.value,onChange:t=>{n(0),e.onChange(t.target.value.replace(/[\r\n]+/g,``))},onKeyDown:t=>{if(!t.nativeEvent.isComposing){if(t.key===`ArrowDown`||t.key===`ArrowUp`){if(!r)return;t.preventDefault(),n(Math.max(0,Math.min(e.items.length-1,i+(t.key===`ArrowDown`?1:-1))))}else t.key===`Tab`&&!t.shiftKey&&r&&e.onComplete?.(i)?(t.preventDefault(),n(0)):t.key===`Enter`&&!t.ctrlKey&&!t.metaKey&&(t.preventDefault(),r?((e.onEnterRow??e.onPick)(i),n(0)):e.onEnter?.())}}}),r&&(0,V.jsx)(`ul`,{className:`mx-0 mt-1 mb-0 max-h-47 list-none overflow-y-auto rounded-sm border-hairline border-line bg-inset p-0.5 font-mono text-meta`,children:e.items.map((t,n)=>(0,V.jsx)(`li`,{ref:n===i?a:void 0,children:(0,V.jsxs)(`button`,{type:`button`,tabIndex:-1,"aria-pressed":n===i,className:$t({cursor:n===i,accent:!!t.accent}),onMouseDown:t=>{t.preventDefault(),e.onPick(n)},children:[(0,V.jsx)(`span`,{children:t.text}),t.dim&&(0,V.jsxs)(`span`,{className:`text-muted`,children:[` `,t.dim]})]})},t.key))})]})}function jD({model:e,engine:t,busy:n,error:r,run:i}){let[a,o]=(0,g.useState)(``),[s,c]=(0,g.useState)(()=>localStorage.getItem(`rove.web.cloneParent`)||`~/`),[l,u]=(0,g.useState)(null),[d,f]=(0,g.useState)(`main`),[p,m]=(0,g.useState)(``),[h,_]=(0,g.useState)(!1),[v,y]=(0,g.useState)({base:``,home:``,names:[]});(0,g.useEffect)(()=>{let t=!1,n=setTimeout(()=>{e.client.request(`fs.subdirs`,{path:s}).then(e=>!t&&y(e)).catch(()=>{})},60);return()=>{t=!0,clearTimeout(n)}},[e,s]);let b=l??gs(a),x=ls(s.trim(),v.home),S=()=>i(async()=>{if(!a.trim())throw kD(`url`),Error(q(`newTask`,`error.gitUrlRequired`));let n;try{m(``),n=await e.client.request(`repo.clone`,{url:a.trim(),parentDir:x,...l?.trim()?{folder:l.trim()}:{}},m)}catch(e){throw e instanceof d_&&e.code===`CLONE_FAILED`?Error(q(`newTask`,`error.cloneFailed`,{error:e.message})):e}localStorage.setItem(_s,s.trim());let r=(await e.client.request(`task.spawn`,{repo:n.path,...t?{engine:t}:{},...d.trim()?{baseBranch:d.trim()}:{}})).taskIds[0];r&&e.selectWhenListed(r)});return(0,V.jsxs)(`form`,{className:Rn,onSubmit:e=>{e.preventDefault(),S()},children:[(0,V.jsxs)(`div`,{className:On,children:[(0,V.jsx)(`span`,{className:`${U} text-muted`,children:q(`newTask`,`field.gitUrl`)}),(0,V.jsx)(`input`,{className:nn,"data-field":`url`,spellCheck:!1,placeholder:`https://github.com/user/repo.git`,value:a,onChange:e=>o(e.target.value.replace(/[\r\n]+/g,``)),onKeyDown:e=>{e.key!==`Enter`||e.ctrlKey||e.metaKey||(e.preventDefault(),a.trim()&&kD(`parent`))}})]}),(0,V.jsxs)(`div`,{className:On,children:[(0,V.jsx)(`span`,{className:`${U} text-muted`,children:q(`newTask`,`field.parentDir`)}),(0,V.jsx)(AD,{field:`parent`,value:s,placeholder:`~/`,onChange:e=>{_(!0),c(e)},items:v.names.map(e=>({key:e,text:`${e}/`})),open:h,onPick:e=>{let t=v.names[e];t!==void 0&&c(fs(s,v.base,t,v.home)),_(!1),kD(`folder`)},onComplete:e=>{let t=v.names[e];if(t===void 0)return!1;let n=`${fs(s,v.base,t,v.home)}/`;return n!==s&&(c(n),!0)},onEnter:()=>kD(`folder`)}),(0,V.jsx)(`span`,{className:`text-muted`,children:q(`newTask`,`hint.remembered`)})]}),(0,V.jsxs)(`div`,{className:On,children:[(0,V.jsx)(`span`,{className:`${U} text-muted`,children:q(`newTask`,`field.folderName`)}),(0,V.jsx)(`input`,{className:nn,"data-field":`folder`,spellCheck:!1,placeholder:q(`newTask`,`placeholder.folderName`),value:b,onChange:e=>u(e.target.value.replace(/[\r\n]+/g,``)),onKeyDown:e=>{e.key!==`Enter`||e.ctrlKey||e.metaKey||(e.preventDefault(),kD(`clone-base`))}})]}),(0,V.jsxs)(`div`,{className:On,children:[(0,V.jsx)(`span`,{className:`${U} text-muted`,children:q(`newTask`,`field.baseBranch`)}),(0,V.jsx)(`input`,{className:nn,"data-field":`clone-base`,spellCheck:!1,placeholder:`main`,value:d,onChange:e=>f(e.target.value.replace(/[\r\n]+/g,``))})]}),n&&(0,V.jsx)(`p`,{className:`text-muted`,"data-field":`clone-progress`,children:p||q(`newTask`,`clone.progressInto`,{target:`${x}/${b}`})}),r&&(0,V.jsxs)(`p`,{className:`text-error`,children:[`※ `,r]}),(0,V.jsx)(pr,{busy:n,submitLabel:q(`newTask`,n?`button.cloning`:`button.create`)})]})}function MD({model:e,engine:t,busy:n,error:r,run:i,repo:a,active:o}){let[s,c]=(0,g.useState)(``),[l,u]=(0,g.useState)(null),[d,f]=(0,g.useState)(new Set),[p,m]=(0,g.useState)(0),h=a.expanded;(0,g.useEffect)(()=>{if(!o||!h)return;let t=!1;return u(null),f(new Set),e.client.request(`repo.probe`,{path:h,adoptable:!0}).then(e=>!t&&u(e.worktrees??[])).catch(()=>!t&&u([])),()=>{t=!0}},[e,o,h]);let _=Ss(l??[],s),v=e=>f(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n}),y=()=>i(async()=>{let n=d.size>0?_.filter(e=>d.has(e.path)):_.slice(p,p+1);if(n.length===0)throw Error(q(`newTask`,`error.noAdoptable`));let r=0,i,a;for(let o of n){let n={repo:h,worktreePath:o.path,branch:o.branch,...t?{engine:t}:{}};try{let t;try{t=await e.client.request(`worktree.adopt`,n)}catch(r){if(!(r instanceof d_&&r.code===`UNKNOWN_REPO`))throw r;await e.client.request(`task.openMain`,{repo:h}),t=await e.client.request(`worktree.adopt`,n)}a=t.taskId,r++}catch(e){i??=e instanceof Error?e.message:String(e)}}if(r===0)throw Error(q(`newTask`,`adopt.summaryNone`,{error:i??``}));G(r<n.length?q(`newTask`,`adopt.summaryPartial`,{done:r,total:n.length}):q(`newTask`,`adopt.summaryAll`,{count:r})),a&&e.selectWhenListed(a)}),b=d.size>0?q(`newTask`,`adopt.hintSelected`,{count:d.size}):q(`newTask`,`adopt.hintDefault`);return(0,V.jsxs)(`form`,{className:Rn,onSubmit:e=>{e.preventDefault(),y()},onKeyDown:e=>{e.ctrlKey&&!e.shiftKey&&!e.metaKey&&e.key.toLowerCase()===`a`&&(e.preventDefault(),e.stopPropagation(),f(e=>_.every(t=>e.has(t.path))?new Set:new Set(_.map(e=>e.path))))},children:[(0,V.jsxs)(`div`,{className:On,children:[(0,V.jsx)(`span`,{className:`${U} text-muted`,children:q(`newTask`,`field.adoptFilter`)}),(0,V.jsx)(AD,{field:`filter`,value:s,placeholder:q(`newTask`,`placeholder.adoptFilter`),onChange:c,items:_.map(e=>{let t=[e.dirty===!0?`dirty`:e.dirty===null?`dirty?`:``,e.roveManaged?``:`external`].filter(Boolean).join(`,`);return{key:e.path,text:`${d.has(e.path)?`[x]`:`[ ]`} ${e.branch}${t?` (${t})`:``}`,dim:e.path,accent:d.has(e.path)}}),open:!0,onPick:e=>{let t=_[e];t&&v(t.path)},onCursor:m,onEnter:()=>{}}),(0,V.jsx)(`span`,{className:`text-muted`,children:q(`newTask`,`adopt.repoLine`,{path:h||q(`newTask`,`adopt.repoNone`)})}),l===null&&h&&(0,V.jsx)(`span`,{className:`text-muted`,children:q(`newTask`,`hint.scanningWorktrees`)}),l!==null&&_.length===0&&(0,V.jsx)(`span`,{className:`text-muted`,children:q(`newTask`,l.length===0?`adopt.noUnlinked`:`adopt.noMatch`)}),_.length>0&&(0,V.jsx)(`span`,{className:`text-muted`,children:(0,V.jsx)(AT,{text:is(b)})})]}),r&&(0,V.jsxs)(`p`,{className:`text-error`,children:[`※ `,r]}),(0,V.jsx)(pr,{busy:n,submitLabel:q(`newTask`,`button.create`)})]})}var ND=[`existing`,`clone`,`adopt`];function PD(e,t){let n=Hs(e,`repos.list`)?.repos,[r,i]=(0,g.useState)(n??[]),[a,o]=(0,g.useState)(()=>Hs(e,`fs.subdirs`,{path:`~/`})?.home??``),[s,c]=(0,g.useState)(()=>{let e=t??n?.[0];return e?hs(e,n??[]):``}),[l,u]=(0,g.useState)(!1),[d,f]=(0,g.useState)(null),[p,m]=(0,g.useState)(null);(0,g.useEffect)(()=>{Promise.all([Ws(e,`repos.list`),Ws(e,`fs.subdirs`,{path:`~/`})]).then(([e,n])=>{i(e.repos),o(n.home);let r=t??e.repos[0]??``;c(t=>t||hs(r,e.repos))}).catch(()=>{})},[e,t]);let h=cs(s.trim())&&!r.includes(s.trim());(0,g.useEffect)(()=>{if(!h)return;let t=!1,n=setTimeout(()=>{e.client.request(`fs.subdirs`,{path:s}).then(e=>!t&&f({base:e.base,names:e.names})).catch(()=>!t&&f({base:``,names:[]}))},60);return()=>{t=!0,clearTimeout(n)}},[e,h,s]);let _=ms(s,r),v=_.kind===`path`?_.path:``,y=v.startsWith(`~`)&&!a?``:v.replace(/^~(?=\/|$)/,a).replace(/(.)\/+$/,`$1`);(0,g.useEffect)(()=>{if(m(null),!y)return;let t=!1,n=setTimeout(()=>{e.client.request(`repo.probe`,{path:y}).then(e=>!t&&m(e)).catch(()=>{})},150);return()=>{t=!0,clearTimeout(n)}},[e,y]);let b=new Set((e.tasks.get()?.tasks??[]).filter(e=>e.kind===`main`).map(e=>e.repo.replace(/\/+$/,``))),x=h?d?.names??[]:[],S=ss(r,s),C=h?x.map(e=>({key:e,text:`${e}/`})):S.map(e=>{let{base:t,dir:n}=os(e);return{key:e,text:t,dim:n,accent:e===y}});return{text:s,saved:r,home:a,expanded:y,ambiguous:_.kind===`ambiguous`?_.name:null,mainRepos:b,open:!l,items:C,probe:p,setText:e=>{u(!1),c(e)},pick:e=>{if(h){let t=x[e];t!==void 0&&c(fs(s,d?.base??``,t,a))}else{let t=S[e];t!==void 0&&c(hs(t,r))}u(!0),kD(`branch`)},complete:e=>{if(l)return!1;if(h){let t=x[e];if(t===void 0)return!1;let n=ps(s,d?.base??``,t,a);return n!==s&&(c(n),!0)}let t=S[e];if(t===void 0)return!1;let n=hs(t,r);return n!==s.trim()&&(c(n),u(!0),!0)},reopen:()=>u(!1)}}function FD(e){let{model:t,repo:n}=e,[r,i]=(0,g.useState)(``),[a,o]=(0,g.useState)(!1),[s,c]=(0,g.useState)(!0),[l,u]=(0,g.useState)(`task`),d=n.mainRepos.has(n.expanded),f=n.probe?.ok?n.probe:null,p=f?.branches??[];(0,g.useEffect)(()=>{!a&&f?.current&&i(f.current)},[a,f]),(0,g.useEffect)(()=>u(`task`),[n.expanded]);let m=ss(p,r),h=i=>e.run(async()=>{if(n.ambiguous)throw n.reopen(),kD(`repo`),Error(q(`newTask`,`error.repoAmbiguous`,{name:n.ambiguous}));if(!n.expanded)throw kD(`repo`),Error(z(`newTask.needRepo`));let e=await t.client.request(`repo.probe`,{path:n.expanded});if(!e.ok)throw kD(`repo`),Error(e.reason??n.expanded);if(l===`project`&&d){let n=await t.client.request(`task.openMain`,{repo:e.repo});t.selectWhenListed(n.taskId);return}gn(e.repo,(i??r).trim())});return(0,V.jsxs)(`form`,{className:Rn,onSubmit:e=>{e.preventDefault(),h()},children:[(0,V.jsxs)(`div`,{className:On,children:[(0,V.jsx)(`span`,{className:`${U} text-muted`,children:q(`newTask`,`field.repo`)}),(0,V.jsx)(AD,{field:`repo`,value:n.text,onChange:n.setText,items:n.items,open:n.open,onPick:n.pick,onComplete:n.complete,onEnter:()=>kD(`branch`)})]}),d&&(0,V.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,V.jsx)(`span`,{className:`m-0 font-sans text-meta font-medium normal-nums text-muted`,children:q(`newTask`,`field.opens`)}),(0,V.jsx)(es,{label:q(`newTask`,`field.opens`),field:`intent`,value:l,onChange:e=>u(e===`project`?`project`:`task`),choices:[{id:`task`,label:q(`newTask`,`intent.task`)},{id:`project`,label:q(`newTask`,`intent.project`)}]})]}),!(l===`project`&&d)&&(0,V.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,V.jsx)(`span`,{className:`m-0 font-sans text-meta font-medium normal-nums text-muted`,children:q(`newTask`,`field.fromBranch`)}),(0,V.jsx)(AD,{field:`branch`,value:r,placeholder:`main`,onChange:e=>{o(!0),c(!0),i(e)},items:m.map(e=>({key:e,text:e,accent:e===r.trim()})),open:s,onPick:e=>{let t=m[e];t!==void 0&&(i(t),o(!0),c(!1),kD(`create`))},onEnterRow:e=>{let t=r.trim(),n=t?m.find(e=>e.toLowerCase()===t.toLowerCase()):void 0;h(n??m[e]??t)},onEnter:()=>void h()}),m.length===0&&e.error==null&&(0,V.jsx)(`span`,{className:`text-muted`,children:q(`newTask`,p.length===0?`hint.noBranchesFound`:`hint.noMatchBranch`)})]}),e.error&&(0,V.jsxs)(`p`,{className:`text-error`,children:[`※ `,e.error]}),(0,V.jsx)(pr,{busy:e.busy,submitLabel:q(`newTask`,`button.create`)})]})}function ID({model:e,repo:t}){B();let[n,r]=(0,g.useState)(`existing`),{busy:i,error:a,setError:o,submit:s}=lr(),c=e.selection.get().taskId,l=e.tasks.get()?.tasks.find(e=>e.id===c)?.repo,u=NC(e,t??l),d=PD(e,t??l),f=(0,g.useRef)(null),p=(0,g.useRef)(!0);(0,g.useEffect)(()=>{if(o(null),p.current){p.current=!1,f.current?.querySelector(`[data-field=mode] [aria-pressed=true]`)?.focus();return}kD(n===`existing`?`repo`:n===`clone`?`url`:`filter`)},[n]);let m=u.engines.filter(e=>e.ready!==!1),h=()=>{let e=m.length>0?m:u.engines,t=e[(e.findIndex(e=>e.id===u.engine)+1)%e.length];t&&u.setEngine(t.id)},_=e=>r(t=>ND[(ND.indexOf(t)+e+ND.length)%ND.length]),v={model:e,engine:u.engine,busy:i,error:a,setError:o,run:s};return(0,V.jsx)(cr,{title:q(`newTask`,`title`),wide:!0,children:(0,V.jsxs)(`div`,{ref:f,onKeyDown:e=>{if(!(!e.ctrlKey||e.metaKey||e.altKey)){if(e.key===`]`||e.key===`[`)_(e.key===`]`?1:-1);else if(e.key.toLowerCase()===`e`&&!e.shiftKey)h();else return;e.preventDefault(),e.stopPropagation()}},children:[(0,V.jsxs)(`div`,{className:Rn,children:[(0,V.jsxs)(`div`,{className:On,children:[(0,V.jsx)(`span`,{className:`${U} text-muted`,children:q(`newTask`,`field.mode`)}),(0,V.jsx)(es,{label:q(`newTask`,`field.mode`),field:`mode`,value:n,onChange:e=>r(e),choices:ND.map(e=>({id:e,label:q(`newTask`,`tabs.${e}`)}))})]}),(0,V.jsxs)(`div`,{className:On,children:[(0,V.jsx)(`span`,{className:`${U} text-muted`,children:q(`newTask`,`field.engine`)}),(0,V.jsx)(zC,{engines:u.engines,value:u.engine,onChange:u.setEngine})]})]}),(0,V.jsx)(`div`,{hidden:n!==`existing`,children:(0,V.jsx)(FD,{...v,repo:d})}),(0,V.jsx)(`div`,{hidden:n!==`clone`,children:(0,V.jsx)(jD,{...v})}),(0,V.jsx)(`div`,{hidden:n!==`adopt`,children:(0,V.jsx)(MD,{...v,repo:d,active:n===`adopt`})}),(0,V.jsx)(`p`,{className:`keys-only mx-0 mt-2 mb-0 ${Yt}`,children:q(`newTask`,`legend`,{enter:q(`newTask`,`enterNext`)})})]})})}function LD(e,t){let n=e.scratch||e.noProject,r=n?[]:t.extraRepos??[];return{...n?{ungrouped:!0}:{repo:t.repo},...t.baseRef?{baseBranch:t.baseRef}:{},...r.length>0?{extras:r}:{},...e.machine?{machine:e.machine.id}:{},prompt:t.prompt,...t.engine?{engine:t.engine}:{},worktree:e.kind===`task`,retryOf:{id:e.id,label:e.label}}}function RD(e,t){return e?[e,...(t.extras??[]).map(e=>e.repo)]:[]}function zD(e,t){return e?{...t.baseBranch?{[e]:t.baseBranch}:{},...Object.fromEntries((t.extras??[]).flatMap(e=>e.baseRef?[[e.repo,e.baseRef]]:[]))}:{}}function BD(e,t){return e.retryOf&&e.engine&&e.engine===t?e.retryOf.id:void 0}async function VD(e,t){try{let{task:n}=await e.client.request(`task.get`,{taskId:t.id});if(!n.prompt)return void G(z(`menu.retryNoPrompt`),`error`);_n(LD(t,{...n,prompt:n.prompt}))}catch(e){G(K(e),`error`)}}function HD(e,t){let n=async n=>{await e.client.request(`task.archive`,{taskId:t.id,archived:!0,...n?{force:n}:{}}),G(q(`tasks`,`archive.done`,{title:t.label}))};W.set((0,V.jsx)(dr,{title:z(`newSession.retryArchiveTitle`,{title:t.label}),body:z(`newSession.retryArchiveBody`),confirmLabel:q(`tasks`,`menu.archive`),onConfirm:()=>n(!1),escalate:{when:e=>e instanceof d_&&e.code===`TASK_BUSY`,label:q(`tasks`,`archive.busyConfirm`),title:q(`tasks`,`archive.busyTitle`),body:()=>q(`tasks`,`archive.busyBody`,{title:t.label}),run:()=>n(!0)}}))}var UD=_([]),WD=()=>v(UD);async function GD(e){UD.set((await e.request(`snippets.get`)).snippets)}async function KD(e,t){UD.set((await e.request(`snippets.save`,{name:t.name,text:t.text})).snippets)}async function qD(e,t){UD.set((await e.request(`snippets.remove`,{name:t})).snippets)}var JD=/^[A-Za-z0-9][\w-]{0,31}$/;function YD(e,t){let n=t;for(;n>0&&/[\w-]/.test(e[n-1]??``);)n--;if(n===0||e[n-1]!==`@`)return null;let r=e[n-2];if(r!==void 0&&!/\s/.test(r))return null;let i=t;for(;i<e.length&&/[\w-]/.test(e[i]??``);)i++;return{start:n-1,end:i,query:e.slice(n,t)}}function XD(e,t){let n=t.toLowerCase(),r=e.filter(e=>e.name.toLowerCase().startsWith(n));return[...r.filter(e=>e.name.toLowerCase()===n),...r.filter(e=>e.name.toLowerCase()!==n)]}function ZD(e,t,n){return{text:e.slice(0,t.start)+n.text+e.slice(t.end),caret:t.start+n.text.length}}var QD=e=>e.split(`
114
- `,1)[0]??``;function $D(e){return(0,V.jsx)(`ul`,{className:`${Qt} ${e.className}`,children:e.items.map((t,n)=>(0,V.jsx)(`li`,{children:(0,V.jsxs)(H,{variant:`row`,tabIndex:-1,"aria-pressed":n===e.at,className:$t({cursor:n===e.at,accent:!1}),onMouseDown:t=>{t.preventDefault(),e.onPick(n)},children:[(0,V.jsxs)(`span`,{className:`text-accent`,children:[`@`,t.name]}),(0,V.jsxs)(`span`,{className:`text-muted`,children:[` `,QD(t.text)]})]})},t.name))})}function eO(e){let t=WD(),[n,r]=(0,g.useState)(0),[i,a]=(0,g.useState)(0),[o,s]=(0,g.useState)(null),c=(0,g.useRef)(null),l=YD(e.value,Math.min(n,e.value.length)),u=l?XD(t,l.query):[],d=l!==null&&u.length>0&&o!==l.start,f=Math.min(i,Math.max(0,u.length-1));(0,g.useLayoutEffect)(()=>{let t=c.current,n=e.area.current;t===null||!n||(c.current=null,n.setSelectionRange(t,t),r(t))});let p=t=>{let n=u[t];if(!l||!n)return;let r=ZD(e.value,l,n);c.current=r.caret,a(0),e.onChange(r.text)},m=e=>{if(!d||e.nativeEvent.isComposing)return!1;if(e.key===`ArrowDown`||e.key===`ArrowUp`)a(Math.max(0,Math.min(u.length-1,f+(e.key===`ArrowDown`?1:-1))));else if(e.key===`Tab`&&!e.shiftKey||e.key===`Enter`&&!e.shiftKey&&!e.ctrlKey&&!e.metaKey)p(f);else if(e.key===`Escape`)s(l?.start??null),e.stopPropagation();else return!1;return e.preventDefault(),!0};return{list:d?(0,V.jsx)($D,{items:u,at:f,className:e.listClassName??``,onPick:p}):null,field:{onChange:t=>{r(t.target.selectionStart),a(0),e.onChange(t.target.value)},onSelect:e=>r(e.currentTarget.selectionStart),onKeyDown:t=>{m(t)||!e.onEnter||t.key!==`Enter`||t.shiftKey||t.nativeEvent.isComposing||(t.preventDefault(),e.onEnter())}}}}function tO(e,t){gn(e,void 0,t)}function nO(){gn(void 0,void 0,void 0,void 0,!0)}var rO=`rove.web.newSession.worktree`,iO=``;function aO({model:e,seed:t}){let n=t.repo;B();let r=v(e.selection).taskId,i=e.tasks.get()?.tasks.find(e=>e.id===r)?.repo,a=NC(e,n??i,t.engine),o=Hs(e,`repos.list`)?.repos,s=e=>t.ungrouped?void 0:(t.machine?void 0:n)??i??e?.[0],[c,l]=(0,g.useState)(o??[]),[u,d]=(0,g.useState)(()=>Hs(e,`fs.subdirs`,{path:`~/`})?.home??``),[f,p]=(0,g.useState)(()=>RD(s(o),t)),[m,h]=(0,g.useState)(()=>Object.fromEntries(f.flatMap(t=>{let n=Hs(e,`repo.probe`,{path:t});return n?[[t,n]]:[]}))),_=(0,g.useRef)(new Set),[y,b]=(0,g.useState)(t.ungrouped===!0),x=()=>{b(!0),p([])},[S,C]=(0,g.useState)(()=>zD(s(o),t)),[w,T]=(0,g.useState)(``),[E,D]=(0,g.useState)(``),[O,k]=(0,g.useState)(()=>(t.prompt!==void 0&&(iO=t.prompt),iO)),A=e=>{iO=e,k(e)},[j,ee]=(0,g.useState)(``),[M,N]=(0,g.useState)(``),[P,F]=(0,g.useState)(!1),[I,te]=(0,g.useState)(``),[L,ne]=(0,g.useState)(()=>t.worktree??localStorage.getItem(rO)!==`0`),re=e=>{localStorage.setItem(rO,e?`1`:`0`),ne(e)},[ie,R]=(0,g.useState)(null),{attachments:ae,attach:oe,remove:se,clear:ce}=Qo(e,R),le=(0,g.useRef)(null),ue=CE(e),[de,fe]=(0,g.useState)(t.machine??``),pe=de!==``,me=pe?null:Jo(e=>void oe(e)),he=ue.find(e=>e.alias===de)?.hostLabel||de,ge=lD(e,de);cD(e,ue);let[_e,ve]=(0,g.useState)(null),[ye,be]=(0,g.useState)(``);(0,g.useEffect)(()=>{Promise.all([Ws(e,`repos.list`),Ws(e,`fs.subdirs`,{path:`~/`})]).then(([e,n])=>{l(e.repos),d(n.home);let r=s(e.repos);p(e=>e.length>0||!r?e:RD(r,t)),C(e=>({...e,...zD(r,t)}))}).catch(()=>{})},[e,n]);let xe=!pe&&!L&&f.length===1,Se=f[0]??``;(0,g.useEffect)(()=>{for(let t of f)_.current.has(t)||(_.current.add(t),Ws(e,`repo.probe`,{path:t}).then(e=>h(n=>({...n,[t]:e}))).catch(()=>{}))},[e,f]),(0,g.useEffect)(()=>{!pe||!ge.loaded||de!==t.machine||ve(e=>e??rD(n,ge.repos))},[ge.loaded]),(0,g.useEffect)(()=>le.current?.focus(),[]);let Ce=!pe&&!y&&!xe,we=_D(a,Ce),Te=a.engines.find(e=>e.id===a.engine),Ee=Ts(Te,z(`newSession.modelDefault`)),De=Es(Te,z(`newSession.effortDefault`)),Oe=Ee.some(e=>e.id===j)?j:``,ke=De.some(e=>e.id===M)?M:``,Ae=async t=>{R(null),F(!0),te(z(`newSession.cloning`,{source:t}));try{let n=us(ls((localStorage.getItem(`rove.web.cloneParent`)||`~/`).trim(),u)),r=await e.client.request(`repo.clone`,{url:t,parentDir:n},te);l(e=>e.includes(r.path)?e:[...e,r.path]),p(e=>e.includes(r.path)?e:Ms(e,r.path)),b(!1),D(``)}catch(e){R(hD(e))}finally{F(!1),te(``)}},je=async n=>{if(!_e)return R(z(`newSession.needRepo`));if(n&&!O.trim())return R(z(`newSession.needPrompt`));F(!0),te(_e.clone?z(`newSession.cloningOn`,{source:_e.ref,machine:he}):z(`newSession.startingOn`,{machine:he}));try{let r=await mD(e,{pick:_e,machine:de,engine:a.engine,prompt:O.trim(),begin:n,baseRef:ye});iO=``,hn.set(null),r&&e.selectWhenListed(r),t.retryOf&&r&&HD(e,t.retryOf)}catch(e){R(hD(e))}finally{F(!1),te(``)}},Me=async(n=!0,r)=>{if(R(null),pe)return je(n);if(!Se&&!y)return R(z(`newSession.needRepo`));if((n||r)&&!O.trim())return R(z(`newSession.needPrompt`));F(!0);let i=Xo(O.trim(),ae);try{let o=await Promise.all(f.map(t=>e.client.request(`repo.probe`,{path:t}))),s=o.find(e=>!e.ok);if(s)throw Error(s.reason??s.repo);let c,l;if(y)c=await Fs(e.client.request.bind(e.client),a.engine,O,n);else if(xe)c=await Is(e.client.request.bind(e.client),o[0]?.repo??Se,a.engine,O,n,i);else{let r=await e.client.request(`task.spawn`,Ps({repos:f.map((e,t)=>({repo:o[t]?.repo??e,baseRef:S[e]??``})),branch:w.trim(),engine:a.engine,commandFrom:BD(t,a.engine),engines:n?we.ids:[],prompt:i,begin:n,model:Oe,effort:ke}));c=r.taskIds[0],l=r.groupId}r&&c&&await TD(e.client,c,r,i).then(()=>G(z(`newSession.laterSet`,{time:wD(r)}))).catch(e=>G(hD(e),`error`)),iO=``,ce(),hn.set(null),l?ba(l):c&&e.selectWhenListed(c),t.retryOf&&c&&HD(e,t.retryOf)}catch(e){let t=As(e);t?(iO=``,ce(),hn.set(null),G(e instanceof Error?e.message:String(e),`error`),ba(t)):R(e instanceof Error?e.message:String(e))}finally{F(!1)}},Ne=eO({value:O,onChange:A,area:le,onEnter:()=>void Me()});return(0,V.jsxs)(`div`,{className:wE,children:[(0,V.jsxs)(`div`,{className:TE,children:[(0,V.jsx)(`h1`,{className:`m-0 font-sans text-title font-semibold text-accent`,children:z(`newSession.title`)}),(0,V.jsx)(`p`,{className:`m-0 text-muted`,children:z(`newSession.tagline`)})]}),(0,V.jsxs)(`form`,{className:EE,onSubmit:e=>{e.preventDefault(),Me()},children:[(0,V.jsxs)(`div`,{className:DE,...me?.drop,children:[!pe&&(0,V.jsx)($o,{attachments:ae,onRemove:se}),(0,V.jsx)(`textarea`,{ref:le,className:kE,rows:4,spellCheck:!1,placeholder:z(`newSession.placeholder`),value:O,disabled:P,onPaste:me?.onPaste,...Ne.field}),Ne.list,(0,V.jsxs)(`div`,{className:OE,children:[(0,V.jsx)(`button`,{type:`button`,className:NE(),disabled:P||we.comparing,title:we.comparing?z(`compare.needsPrompt`):void 0,onClick:()=>void Me(!1),children:z(`newSession.createOnly`)}),(0,V.jsx)(`button`,{type:`submit`,className:Pe(),disabled:P,children:z(`newSession.start`)})]})]}),(0,V.jsxs)(`div`,{className:AE,children:[(0,V.jsx)(fD,{machines:ue,value:de,onPick:e=>{fe(e),ve(null),be(``),D(``),R(null),b(!1)}}),(0,V.jsx)(XE,{field:`repo`,title:!pe&&f.length>1?z(`newSession.repoCount`,{count:f.length}):z(`newSession.repo`),label:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(KE,{}),js(pe?_e?[_e.ref]:[]:f)||z(y?`rail.noProject`:`newSession.repo`),_e?.clone&&(0,V.jsxs)(`span`,{className:`text-muted`,children:[` `,z(`newSession.cloneTag`)]})]}),children:t=>(0,V.jsx)(OD,{model:e,saved:pe?ge.repos.map(nD):c,picked:pe?_e?[_e.ref]:[]:f,primary:pe?``:Se,home:pe?``:u,query:E,onQuery:D,onToggle:e=>{if(R(null),!pe)return b(!1),p(t=>Ms(t,e));ve({ref:e,clone:!1}),t()},onClone:e=>pe?ve({ref:e,clone:!0}):void Ae(e),close:t,remote:pe?{name:he,empty:uD(de,ge),blocked:ge.problem!==``}:void 0,ungrouped:pe?void 0:{on:y,pick:x}})}),(0,V.jsx)(gD,{remote:pe,remotePick:_e,remoteBase:ye,onRemoteBase:be,ungrouped:y,inPlace:xe,onToggleWorktree:()=>re(!L),repos:f,probes:m,bases:S,onBase:(e,t)=>C(n=>({...n,[e]:t})),branchName:w,onBranchName:T}),me&&(0,V.jsxs)(Yo,{className:`${NE(ae.length>0)} cursor-pointer`,title:z(`newSession.attachHint`),disabled:P,onFiles:e=>void oe(e),children:[(0,V.jsx)(JE,{}),z(`newSession.attach`)]}),!pe&&!y&&!we.comparing&&(0,V.jsx)(ED,{disabled:P,onSchedule:e=>void Me(!1,e),onInvalid:R}),(0,V.jsx)(`span`,{className:jE}),(0,V.jsx)(vD,{choice:a,picks:we,available:Ce}),!xe&&!pe&&!y&&!we.comparing&&(Ee.length>0||De.length>0)&&(0,V.jsx)(yD,{models:Ee,model:Oe,onModel:ee,efforts:De,effort:ke,onEffort:N})]}),P&&I&&(0,V.jsx)(`p`,{className:`text-muted`,"data-field":`clone-progress`,children:I}),ie&&(0,V.jsxs)(`p`,{className:`text-error`,children:[`※ `,ie]})]}),!pe&&(0,V.jsx)(`button`,{type:`button`,className:`mt-2 self-center px-1.5 py-0.5 text-subtle focus-visible:text-ink touch:mt-0.5 touch:py-2 [&:hover]:text-ink`,onClick:()=>W.set((0,V.jsx)(ID,{model:e,repo:Se||void 0})),children:z(`newSession.moreWays`)})]})}var oO=[`needs`,`working`,`ready`,`idle`],sO=`~state:`;function cO(e){switch(e.rowStatus?.kind){case`attention`:case`needs-input`:case`unseen`:return`needs`;case`busy`:case`running`:return`working`}switch(e.group){case`waiting-on-you`:return`needs`;case`working`:return`working`;case`landing`:case`ready-for-review`:return`ready`}return e.pr?.lifecycle===`open`||e.status===`done`?`ready`:`idle`}var lO=e=>e&&e.kind!==`main`&&!pw(e)?qC(e.repo):void 0;function uO(e,t){let n=mw(e,t.sort),{children:r,nested:i}=yw([{repo:``,label:``,tasks:n}]),a=n.filter(e=>!i.has(e.id)),o=ew(a),s=e=>{let t=[],n=new Set,i=e=>{if(!n.has(e.id)){n.add(e.id),t.push(e);for(let t of r.get(e.id)??[])i(t)}};return i(e),t},c=new Map;for(let e of a){let t=$C(e),n=((t===null?void 0:o.get(t))??[e]).map(s),r=n.flat().map(cO).reduce((e,t)=>oO.indexOf(t)<oO.indexOf(e)?t:e);for(let e of n)for(let t of e)c.set(t.id,r)}return oO.flatMap(e=>{let t=n.filter(t=>c.get(t.id)===e);return t.length===0?[]:[{repo:``,label:z(`rail.state.${e}`),key:`${sO}${e}`,tasks:t}]})}function dO(e){let t=new Set(e.machines.map(e=>e.alias));return{rows:fO(Sw(uO([...e.tasks.filter(e=>!e.routine),...e.remote.filter(e=>!e.routine&&e.machine!==void 0&&t.has(e.machine.id))],e),e.query,e.fold).map(e=>{if(e.kind!==`project`)return e;let t=e.id.slice(`project:${sO}`.length);return{id:`state:${t}`,kind:`state`,state:t,label:e.label,count:0}})),groups:[]}}function fO(e){let t=new Map,n=``;for(let r of e)r.kind===`state`?n=r.id:r.kind===`task`&&t.set(n,(t.get(n)??0)+1);return e.map(e=>e.kind===`state`?{...e,count:t.get(e.id)??0}:e)}var pO=new Set([`refused`,`timeout`,`host-key-changed`,`host-key-unverified`,`auth-denied`,`unresolved`,`ssh-failed`,`no-rove`,`no-daemon`,`bad-status`,`handshake`,`no-forwarding`,`lost`]);function mO(e){return e&&pO.has(e)?`machines.reason.${e}`:null}function hO(e,t){return e.filter(e=>e.machine?.id===t&&!e.routine&&!e.deleting)}function gO(e){let t=oO.map(e=>({state:e,tasks:[]}));for(let n of e)t[oO.indexOf(cO(n))]?.tasks.push(n);return t.filter(e=>e.tasks.length>0)}var _O=`flex flex-col font-mono text-meta`,vO=`flex flex-col gap-1 border-t-hairline border-line py-2.5 first:border-t-0 first:pt-0`,yO=`flex flex-wrap items-baseline gap-x-2.5 gap-y-0.5`,bO=`min-w-0 text-ink wrap-anywhere`,xO=`m-0 text-muted wrap-anywhere`,SO=`flex flex-wrap gap-x-3.5 gap-y-1 pt-0.5 whitespace-nowrap`,CO=`mt-1.5 mb-0.5 text-subtle`,wO=`flex min-w-0 items-baseline gap-2 pl-2`,TO=`min-w-0 flex-1 truncate text-left`,EO=`min-w-0 max-w-[55%] flex-none truncate text-muted`;function DO(e){W.set((0,V.jsx)(jO,{model:e}))}function OO({model:e,tasks:t}){let n=t=>{Cn(),e.select(t.id),_a()};return gO(t).map(e=>(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`p`,{className:`${CO} m-0`,children:z(`rail.state.${e.state}`)}),e.tasks.map(e=>(0,V.jsxs)(H,{variant:`row`,className:`${wO} w-full rounded-sm py-0.5 hover:bg-hover`,onClick:()=>n(e),children:[(0,V.jsx)(`span`,{className:TO,children:e.label}),(0,V.jsx)(`span`,{className:EO,children:e.branch})]},e.id))]},e.state))}function kO({model:e,alias:t}){let[n,r]=(0,g.useState)(null);return(0,g.useEffect)(()=>{let n=!0;return Ws(e,`machines.repos`,{machine:t}).then(e=>n&&r(e),e=>n&&r({failed:e instanceof Error?e.message:String(e)})),()=>{n=!1}},[e,t]),n?`failed`in n?(0,V.jsx)(`p`,{className:xO,children:z(`machines.reposFailed`,{message:n.failed})}):n.reason?(0,V.jsx)(`p`,{className:xO,children:z(`machines.reposFailed`,{message:n.message??n.reason})}):n.repos.length===0?(0,V.jsx)(`p`,{className:xO,children:z(`machines.noRepos`)}):n.repos.map(e=>(0,V.jsxs)(`div`,{className:wO,children:[(0,V.jsx)(`span`,{className:TO,children:e.id}),(0,V.jsx)(`span`,{className:EO,title:e.primary??e.checkouts[0],children:e.primary??e.checkouts[0]??``})]},e.id)):(0,V.jsx)(`p`,{className:xO,children:z(`machines.loading`)})}function AO(e){let{model:t,row:n,tasks:r,words:i}=e,[a,o]=(0,g.useState)(null),s=n.state===`online`,c=mO(n.reason),l=gO(r).map(e=>`${e.tasks.length} ${z(`rail.state.${e.state}`)}`),u=e=>o(a===e?null:e);return(0,V.jsxs)(`section`,{className:vO,children:[(0,V.jsxs)(`div`,{className:yO,children:[(0,V.jsx)(`span`,{className:`${bO} ${s?``:jT.warning}`,children:vE(n,i)}),(0,V.jsx)(`span`,{className:`text-muted`,children:l.length>0?l.join(` · `):z(`machines.noTasks`)})]}),c&&(0,V.jsx)(`p`,{className:`m-0 text-muted wrap-anywhere`,children:z(c)}),(0,V.jsxs)(`div`,{className:SO,children:[s&&(0,V.jsx)(H,{hit:`tight`,onClick:()=>{Cn(),tO(void 0,n.alias)},children:z(`machines.newHere`)}),r.length>0&&(0,V.jsx)(H,{hit:`tight`,"aria-expanded":a===`tasks`,onClick:()=>u(`tasks`),children:z(a===`tasks`?`machines.hide`:`machines.tasks`)}),s&&(0,V.jsx)(H,{hit:`tight`,"aria-expanded":a===`repos`,onClick:()=>u(`repos`),children:z(a===`repos`?`machines.hide`:`machines.repos`)})]}),a===`tasks`&&(0,V.jsx)(OO,{model:t,tasks:r}),a===`repos`&&(0,V.jsx)(kO,{model:t,alias:n.alias})]})}function jO({model:e}){let t=B(),n=CE(e),r=v(e.remote),i=(t===`zh`?jr:Ar).machine;return(0,V.jsx)(cr,{title:z(`machines.title`),wide:!0,children:(0,V.jsxs)(`div`,{className:`${Rn} ${_O}`,children:[n.length===0&&(0,V.jsx)(`p`,{className:`m-0 text-muted wrap-anywhere`,children:z(`machines.none`)}),n.map(t=>(0,V.jsx)(AO,{model:e,row:t,tasks:hO(r,t.alias),words:i},t.alias))]})})}function MO(e,t,n=300){let r=0,i,a=()=>{r++,i?.(),i=void 0};return{stop:a,run:o=>{a();let s=o.trim();if(s.length<2){t({kind:`idle`});return}let c=r,l=setTimeout(()=>{t({kind:`searching`}),e(s).then(e=>c===r&&t({kind:`done`,query:s,reply:e}),e=>c===r&&t({kind:`failed`,message:e instanceof Error?e.message:String(e)}))},n);i=()=>clearTimeout(l)}}}var NO=`mx-1.5 mt-2 mb-0.5 font-mono text-meta font-semibold normal-nums text-subtle first:mt-0`,PO=`mx-1.5 my-1 text-meta text-muted [overflow-wrap:anywhere]`,FO=e=>`flex w-full min-w-0 cursor-pointer flex-col gap-0.5 rounded-sm px-1.5 py-1.5 text-left text-ink [font:inherit] touch:py-2.5 ${e?`is-selected bg-hover`:``}`,IO=`flex min-w-0 items-baseline gap-2`,LO=`min-w-0 flex-1 truncate text-body`,RO=`whitespace-nowrap text-meta text-muted`,zO=`text-meta text-muted [overflow-wrap:anywhere]`,BO=`rounded-xs bg-accent/25 text-ink`;function VO(e,t){let[n,r]=(0,g.useState)({kind:`idle`});return(0,g.useEffect)(()=>{let n=MO(t=>e.client.request(`sessions.search`,{query:t}),r);return n.run(t),n.stop},[e,t]),n}function HO(e,t){let n=[],r=e.toLowerCase(),i=t.toLowerCase(),a=0;for(let t=r.indexOf(i);i&&t>=0;t=r.indexOf(i,t+i.length))t>a&&n.push(e.slice(a,t)),n.push({hit:e.slice(t,t+i.length),at:t}),a=t+i.length;return n.push(e.slice(a)),n.map(e=>typeof e==`string`?e:(0,V.jsx)(`mark`,{className:BO,children:e.hit},e.at))}function UO({children:e}){return(0,V.jsx)(`h3`,{className:NO,children:e})}function WO({children:e,error:t}){return(0,V.jsx)(`p`,{className:`${PO} ${t?`text-error`:``}`,children:e})}function GO(e){return(0,V.jsx)(H,{variant:`row`,className:FO(e.selected),onMouseEnter:e.onHover,onClick:e.onOpen,children:(0,V.jsxs)(`span`,{className:IO,children:[(0,V.jsx)(`span`,{className:LO,children:e.title}),(0,V.jsx)(`span`,{className:RO,children:e.repo})]})})}function KO(e){let{hit:t}=e;return(0,V.jsxs)(H,{variant:`row`,className:FO(e.selected),onMouseEnter:e.onHover,onClick:e.onOpen,children:[(0,V.jsxs)(`span`,{className:IO,children:[(0,V.jsx)(`span`,{className:LO,children:t.title}),(0,V.jsxs)(`span`,{className:RO,children:[z(t.role===`user`?`search.you`:`search.agent`),` · `,Lo(Date.now()-Date.parse(t.at))]})]}),(0,V.jsx)(`span`,{className:zO,children:HO(t.snippet,e.query)})]})}var qO=_(`issues`);function JO(e,t,n){return{repo:e.repo,baseBranch:t,prompt:n,worktree:!0}}var YO=.2,XO=[`files`,`chat`,`diff`,`browser`,`quota`];function ZO(){return{top:{tabs:[{id:`t1`,kind:`files`}],active:`t1`},bottom:null,ratio:.5,focus:`top`,recent:[`t1`],next:2}}function QO(e){return e.bottom?[[`top`,e.top],[`bottom`,e.bottom]]:[[`top`,e.top]]}function $O(e){let t=e=>Number(e.id.slice(1));return QO(e).flatMap(([,e])=>e.tabs).sort((e,n)=>t(e)-t(n))}function ek(e,t){for(let[n,r]of QO(e)){let e=r.tabs.find(e=>e.id===t);if(e)return{tab:e,name:n,group:r}}return null}function tk(e,t){let n=$O(e).filter(e=>e.kind===t);for(let t of[...e.recent].reverse()){let e=n.find(e=>e.id===t);if(e)return e}return n[0]??null}function nk(e){return e.urls[e.at]??``}function rk(e){return e.slice(e.lastIndexOf(`/`)+1)}function ik(e){try{return new URL(e).host.replace(/^www\./,``)}catch{return e}}function ak(e,t){for(let[n,r]of QO(e))if(r.tabs.some(e=>e.kind===t))return n;return e.bottom?e.focus:`top`}function ok(e,t,n){let r=e.tabs.filter(e=>e.id!==n).map(e=>e.id);for(let e of[...t].reverse())if(r.includes(e))return e;return r[0]??null}function sk(e){let{top:t,bottom:n}=e;n&&n.tabs.length===0&&(n=null),t.tabs.length===0&&n&&([t,n]=[n,null]);let r=new Set([...t.tabs,...n?.tabs??[]].map(e=>e.id)),i=e.recent.filter(e=>r.has(e)),a=e=>e.active&&e.tabs.some(t=>t.id===e.active)?e:{...e,active:ok(e,i)};return{...e,top:a(t),bottom:n&&a(n),recent:i,focus:n?e.focus:`top`}}function ck(e,t,n){return t===`top`?{...e,top:n}:{...e,bottom:n}}function lk(e,t){let n=ek(e,t);if(!n)return e;let{group:r,name:i}=n,a=[...e.recent.filter(e=>e!==t),t];return r.active===t&&e.focus===i&&e.recent.at(-1)===t?e:{...ck(e,i,{...r,active:t}),focus:i,recent:a}}function uk(e){let t=$O(e);if(t.length<=12)return e;let n=new Set(QO(e).map(([,e])=>e.active)),r=t.filter(e=>!n.has(e.id)).sort((t,n)=>e.recent.indexOf(t.id)-e.recent.indexOf(n.id))[0];return r?Ck(e,r.id):e}function dk(e,t,n){let r=`t${e.next}`,i=t===`bottom`&&e.bottom?`bottom`:`top`,a=i===`bottom`&&e.bottom?e.bottom:e.top;return uk(lk(ck({...e,next:e.next+1},i,{...a,tabs:[...a.tabs,n(r)]}),r))}var fk=e=>({id:e,kind:`browser`,urls:[],at:-1});function pk(e,t){return dk(e,t,e=>({id:e,kind:`files`}))}function mk(e,t){return dk(e,t,fk)}function hk(e,t,n){let r=$O(e).find(e=>e.kind===`diff`&&e.path===t);return r?r.kind===`diff`&&r.scope!==n?lk(bk(e,{...r,scope:n}),r.id):lk(e,r.id):dk(e,ak(e,`diff`),e=>({id:e,kind:`diff`,path:t,scope:n}))}function gk(e,t){let n=$O(e).filter(e=>e.kind===`browser`),r=n.find(e=>nk(e)===t);if(r)return lk(e,r.id);let i=n.find(e=>nk(e)===``);return i?xk(e,i.id,t):xk(dk(e,ak(e,`browser`),fk),`t${e.next}`,t)}function _k(e,t){let n=tk(e,t);return n?lk(e,n.id):t===`diff`?hk(e,`.`,`working`):dk(e,ak(e,t),e=>t===`files`||t===`chat`||t===`quota`?{id:e,kind:t}:fk(e))}function vk(e){let t=e.recent.at(-1),n=t?ek(e,t):null,r=n&&n.group.active===t?t:e.top.active;return(r?ek(e,r)?.tab.kind:null)??null}function yk(e,t,n){return t&&vk(e)===n?{panel:e,open:!1}:{panel:_k(e,n),open:!0}}function bk(e,t){let n=e=>({...e,tabs:e.tabs.map(e=>e.id===t.id?t:e)});return{...e,top:n(e.top),bottom:e.bottom&&n(e.bottom)}}function xk(e,t,n){let r=ek(e,t)?.tab;if(r?.kind!==`browser`||nk(r)===n)return e;let i=[...r.urls.slice(0,r.at+1),n].slice(-30);return bk(e,{...r,urls:i,at:i.length-1})}function Sk(e,t,n){let r=ek(e,t)?.tab;return r?.kind!==`browser`||n===r.at||n<0||n>=r.urls.length?e:bk(e,{...r,at:n})}function Ck(e,t){let n=ek(e,t);if(!n)return e;let{group:r}=n,i=r.tabs.filter(e=>e.id!==t),a=e.recent.filter(e=>e!==t),o=r.active===t?ok(r,a,t):r.active;return sk({...ck(e,n.name,{tabs:i,active:o}),recent:a})}function wk(e,t){return $O(e).reduce((e,n)=>n.id===t?e:Ck(e,n.id),e)}function Tk(e,t,n,r){let i=ek(e,t);if(!i)return e;let a=i.group,o=a.tabs.filter(e=>e.id!==t),s=a.tabs.findIndex(e=>e.id===t);if(i.name===n){let c=Math.max(0,Math.min(o.length,(r??o.length)-+(r!==void 0&&r>s)));return lk(c===s?e:ck(e,n,{...a,tabs:[...o.slice(0,c),i.tab,...o.slice(c)]}),t)}let c=e.recent.filter(e=>e!==t),l=ck(e,i.name,{tabs:o,active:a.active===t?ok(a,c,t):a.active}),u=(n===`top`?l.top:l.bottom)?.tabs??[],d=Math.max(0,Math.min(u.length,r??u.length));return lk(sk(ck({...l,recent:c},n,{tabs:[...u.slice(0,d),i.tab,...u.slice(d)],active:t})),t)}function Ek(e,t){let n=Math.max(YO,Math.min(.8,t));return Math.abs(n-e.ratio)<.001?e:{...e,ratio:n}}function Dk(e,t,n){let r=new Map(n.map(e=>[e.id,e.kind])),i=[...e.filter(e=>r.has(e)&&!t.includes(e)),...t.filter(e=>r.has(e))],a=i.filter(e=>r.get(e)===`browser`),o=new Set(a.slice(0,Math.max(0,a.length-3)).filter(e=>!t.includes(e)));return i=i.filter(e=>!o.has(e)),i}function Ok(e){if(!e||typeof e!=`object`)return null;let t=e;if(typeof t.id!=`string`||!/^t\d+$/.test(t.id))return null;if(t.kind===`files`||t.kind===`chat`||t.kind===`quota`)return{id:t.id,kind:t.kind};if(t.kind===`diff`&&typeof t.path==`string`&&t.path!==``){let e=t.scope===`branch`||t.scope===`task`?t.scope:`working`;return{id:t.id,kind:`diff`,path:t.path,scope:e}}if(t.kind===`browser`&&Array.isArray(t.urls)){let e=t.urls.filter(e=>typeof e==`string`&&e!==``).slice(-30),n=typeof t.at==`number`&&Number.isInteger(t.at)?Math.min(e.length-1,Math.max(-1,t.at)):e.length-1;return{id:t.id,kind:`browser`,urls:e,at:e.length===0?-1:Math.max(0,n)}}return null}function kk(e,t){if(!e||typeof e!=`object`||!(`tabs`in e)||!Array.isArray(e.tabs))return null;let n=[];for(let r of e.tabs){let e=Ok(r);!e||t.has(e.id)||(t.add(e.id),n.push(e))}return{tabs:n,active:`active`in e&&typeof e.active==`string`?e.active:null}}function Ak(e){if(!e||typeof e!=`object`)return null;let t=e,n=new Set,r=kk(t.top,n);if(!r)return null;let i=kk(t.bottom,n),a=Math.max(0,...[...n].map(e=>Number(e.slice(1)))),o=typeof t.ratio==`number`&&Number.isFinite(t.ratio)?t.ratio:.5;return sk({top:r,bottom:i,ratio:Math.max(YO,Math.min(.8,o)),focus:t.focus===`bottom`?`bottom`:`top`,recent:Array.isArray(t.recent)?t.recent.filter(e=>typeof e==`string`):[],next:Math.max(a+1,typeof t.next==`number`&&Number.isInteger(t.next)?t.next:0)})}function jk(e,t){let n=ZO(),r=typeof t==`string`&&t!==``?t:``;if(e!==`browser`&&!r)return n;let i=mk(n,`top`),a=r?xk(i,`t2`,r):i;return e===`browser`?a:lk(a,`t1`)}function Mk(e){try{let t=JSON.parse(e??`{}`);return t&&typeof t==`object`&&!Array.isArray(t)?Object.entries(t):[]}catch{return[]}}function Nk(e,t,n){let r=Object.fromEntries(Object.entries(e).filter(([e])=>e!==t));r[t]=n;for(let e of Object.keys(r).slice(0,-50))delete r[e];return r}function Pk(e,t){let n={};for(let[t,r]of Mk(e)){let e=Ak(r);e&&(n[t]=e)}let r=new Map(Mk(t.tab).filter(([,e])=>XO.includes(e))),i=new Map(Mk(t.url)),a=[...new Set([...r.keys(),...i.keys()])].filter(e=>!(e in n));n={...Object.fromEntries(a.map(e=>[e,jk(r.get(e),i.get(e))])),...n};for(let e of Object.keys(n).slice(0,-50))delete n[e];return n}var Fk=[`files`,`diff`,`browser`];function Ik(e){if(!e||typeof e!=`object`)return!1;let t=e;return typeof t.taskId==`string`&&t.taskId!==``&&Fk.includes(t.view)&&typeof t.at==`number`&&(t.url===void 0||typeof t.url==`string`)&&(t.path===void 0||typeof t.path==`string`)}function Lk(e){return e.narrow?{panel:!1,panelOpen:!1,narrow:!0}:{panel:!0,panelOpen:e.panelOpen&&!e.zen,narrow:!1}}function Rk(e,t){return{tab:e.path?`diff`:e.view,...e.view===`browser`&&e.url?{url:e.url}:{},...e.view!==`browser`&&e.path?{diff:e.path}:{},show:t.taskId===e.taskId&&!t.narrow}}function zk(e,t){return t.url?gk(e,t.url):t.diff?hk(e,t.diff,`working`):_k(e,t.tab)}var Bk=`rove.web.panels`,Vk=`rove.web.panelTab`,Hk=`rove.web.panelUrl`;function Uk(){let e={tab:localStorage.getItem(Vk),url:localStorage.getItem(Hk)},t=Pk(localStorage.getItem(Bk),e);return(e.tab!==null||e.url!==null)&&(localStorage.setItem(Bk,JSON.stringify(t)),localStorage.removeItem(Vk),localStorage.removeItem(Hk)),t}var Wk=_(Uk()),Gk=ZO();function Kk(e){return v(Wk)[e]??Gk}function qk(e,t){let n=Wk.get()[e]??Gk,r=t(n);if(r===n)return;let i=Nk(Wk.get(),e,r);Wk.set(i),localStorage.setItem(Bk,JSON.stringify(i))}function Jk(e,t){qk(e,e=>_k(e,t)),qa.set(!0),Ca()&&Ua.set(t)}function Yk(e,t){let n=yk(Wk.get()[e]??Gk,qa.get()&&!mn.get(),t);qk(e,()=>n.panel),qa.set(n.open),n.open&&mn.get()&&mn.set(!1)}function Xk(e){qk(e.taskId,t=>hk(t,e.path,e.scope)),qa.set(!0),mn.get()&&mn.set(!1),Ca()&&Ua.set(`diff`)}function Zk(e,t){qk(e,e=>gk(e,t)),qa.set(!0),mn.get()&&mn.set(!1),Ca()&&Ua.set(`browser`)}function Qk(e,t){qk(e,e=>Ck(e,t));let n=Ua.get();Ca()&&n!==`terminal`&&!tk(Wk.get()[e]??Gk,n)&&Jk(e,`files`)}function $k(e,t){let n=Rk(e,{taskId:t,narrow:Ca()});qk(e.taskId,e=>zk(e,n)),n.show&&(qa.set(!0),mn.get()&&mn.set(!1))}var eA=_(null),tA=0;function nA(e,t){eA.set({taskId:e,hit:t,nonce:++tA}),Jk(e,`chat`),mn.get()&&mn.set(!1)}var rA=10;function iA(e,t){let n=e=>e.surface===t?0:e.surface?1:2,r=$i().filter(n=>ea(n,t)&&n.live?.(e)!==!1).map((e,t)=>({command:e,index:t})).sort((e,t)=>n(e.command)-n(t.command)||Number(e.command.prefix)-Number(t.command.prefix)||e.index-t.index),i=new Set,a=[];for(let{command:e}of r){let t=e.chords[0];!t||e.id===`palette.open`||i.has(e.id)||(i.add(e.id),a.push({command:e,name:To(e.id),raw:e.prefix?`${ti()} + ${t}`:t}))}return a}function aA(e){let t=document.activeElement instanceof HTMLElement?document.activeElement:null;W.set((0,V.jsx)(sA,{model:e,surface:na(),origin:t}))}var oA=8;function sA({model:e,surface:t,origin:n}){B();let[r,i]=(0,g.useState)(``),[a,o]=(0,g.useState)(0),s=(0,g.useRef)(null),c=v(Xr),l=v(e.tasks),u=v(e.remote),d=(0,g.useMemo)(()=>iA(e,t),[e,t,c]).filter(e=>fo(r,e.name,e.raw)),f=(CE(e).length>0?[{name:z(`machines.title`)}]:[]).filter(e=>fo(r,e.name,``)),p=r.trim(),m=p===``?[]:[...l?.tasks??[],...u].filter(e=>!e.routine&&!e.deleting&&[e.label,e.title,e.branch,qC(e.repo)].some(e=>e!==``&&no(p,e))).slice(0,oA),h=v(e.installedMods).has(`issues`),_=[{id:`usage`,name:z(`usage.title`)},...h?[{id:`issues`,name:z(`reviewQueue.palette`),source:`reviews`}]:[]].filter(e=>p===``||no(p,e.name)),y=VO(e,r),b=y.kind===`done`?y.reply.matches:[],x=[...d.map(e=>({kind:`command`,row:e})),..._.map(e=>({kind:`page`,...e})),...f.map(e=>({kind:`machines`,...e})),...m.map(e=>({kind:`task`,task:e})),...b.map(e=>({kind:`hit`,hit:e}))],S=Math.min(a,Math.max(0,x.length-1));(0,g.useEffect)(()=>()=>n?.focus(),[n]),(0,g.useEffect)(()=>{s.current?.querySelector(`.is-selected`)?.scrollIntoView({block:`nearest`})},[S]);let C=t=>{if(t.kind===`machines`){DO(e);return}if(Cn(),n?.focus(),t.kind===`command`){t.row.command.live?.(e)===!1?G(So(`unavailable`),`error`):t.row.command.run(e);return}if(t.kind===`page`){t.source&&qO.set(t.source),ya(t.id);return}t.kind===`task`?e.select(t.task.id):e.select(t.hit.taskId,t.hit.tabId??null),_a(),t.kind===`hit`&&nA(t.hit.taskId,t.hit)},w=e=>{if(e.key===`ArrowDown`)o(Math.min(x.length-1,S+1));else if(e.key===`ArrowUp`)o(Math.max(0,S-1));else if(e.key===`Enter`){let e=x[S];e&&C(e)}else return;e.preventDefault()},T=p!==``&&(m.length>0||p.length>=2),E=0,D=()=>E++;return(0,V.jsx)(cr,{title:So(`palette`),wide:!0,children:(0,V.jsxs)(`div`,{className:`${Rn} palette`,onKeyDown:w,children:[(0,V.jsx)(`input`,{className:pt,autoFocus:!0,spellCheck:!1,value:r,placeholder:So(`search`),onChange:e=>{i(e.target.value),o(0)}}),(0,V.jsxs)(`div`,{className:ut,ref:s,style:{maxHeight:`${(T?18:rA)*1.9}em`},children:[x.length===0&&y.kind!==`searching`&&(0,V.jsx)(`p`,{className:`text-muted`,children:So(`noResults`)}),T&&d.length>0&&(0,V.jsx)(UO,{children:z(`search.commands`)}),d.map(e=>{let t=D();return(0,V.jsx)(`button`,{type:`button`,className:dt(t===S),title:e.name,onMouseEnter:()=>o(t),onClick:()=>C({kind:`command`,row:e}),children:(0,V.jsx)(`span`,{className:ft,children:`${t===S?`› `:` `}${e.name}`})},e.command.id)}),_.map(e=>{let t=D();return(0,V.jsx)(H,{variant:`row`,className:dt(t===S),title:e.name,onMouseEnter:()=>o(t),onClick:()=>C({kind:`page`,...e}),children:(0,V.jsx)(`span`,{className:ft,children:`${t===S?`› `:` `}${e.name}`})},e.id)}),f.map(e=>{let t=D();return(0,V.jsx)(H,{variant:`row`,className:dt(t===S),title:e.name,onMouseEnter:()=>o(t),onClick:()=>C({kind:`machines`,...e}),children:(0,V.jsx)(`span`,{className:ft,children:`${t===S?`› `:` `}${e.name}`})},`machines`)}),m.length>0&&(0,V.jsx)(UO,{children:z(`search.tasks`)}),m.map(e=>{let t=D();return(0,V.jsx)(GO,{title:e.label,repo:qC(e.repo),selected:t===S,onHover:()=>o(t),onOpen:()=>C({kind:`task`,task:e})},e.id)}),y.kind!==`idle`&&(0,V.jsx)(UO,{children:z(`search.inConversations`)}),y.kind===`searching`&&(0,V.jsx)(WO,{children:z(`search.searching`)}),y.kind===`failed`&&(0,V.jsx)(WO,{error:!0,children:y.message}),y.kind===`done`&&b.length===0&&(0,V.jsx)(WO,{children:z(`search.none`,{query:y.query})}),b.map(e=>{let t=D();return(0,V.jsx)(KO,{hit:e,query:y.kind===`done`?y.query:``,selected:t===S,onHover:()=>o(t),onOpen:()=>C({kind:`hit`,hit:e})},`${e.taskId}:${e.tabId??``}:${e.at}:${t}`)}),y.kind===`done`&&y.reply.truncated&&(0,V.jsx)(WO,{children:z(`search.truncated`)}),y.kind===`done`&&y.reply.skipped.length>0&&(0,V.jsx)(WO,{children:z(`search.skipped`,{count:y.reply.skipped.length})})]}),(0,V.jsx)(`p`,{className:`keys-only text-muted`,children:So(`run`)})]})})}var cA=_(null);function lA(e){let t=(document.activeElement?.closest(`.rail`)==null?null:cA.get())??e.selection.get().taskId;return e.tasks.get()?.tasks.find(e=>e.id===t)??null}t(((e,t)=>{t.exports={}}))();var uA={$schema:`https://json.schemastore.org/package.json`,name:`@sma1lboy/rove`,version:`0.9.278`,description:`Rove — the agent multiplexer for your terminal. Run coding agents on parallel tasks with isolated worktrees and persistent sessions.`,keywords:[`terminal`,`tui`,`cli`,`multiplexer`,`ai-agents`,`coding-agent`,`ai-coding-assistant`,`agentic-ai`,`parallel-agents`,`git-worktree`,`claude-code`,`codex`,`llm`,`developer-tools`],type:`module`,packageManager:`bun@1.3.13`,bin:{rove:`dist/cli/rove.js`},files:[`dist/cli`,`dist/completions`,`dist/web`,`dist/web-ui`,`dist/skills`,`dist/*.wav`,`README.md`,`LICENSE`],publishConfig:{access:`public`},repository:{type:`git`,url:`git+https://github.com/Sma1lboy/rove.git`},homepage:`https://rove.run`,bugs:{url:`https://github.com/Sma1lboy/rove/issues`},engines:{bun:`>=1.3.11`},scripts:{dev:`ROVE_DEV=1 bun --conditions=browser ./src/cli/rove.ts`,"dev:mock":`ROVE_DEV=1 bun ./src/tui-react/mock/host.tsx`,"dev:sandbox":`bun run scripts/dev-sandbox.ts run`,"dev:sandbox:reset":`bun run scripts/dev-sandbox.ts reset`,build:`bun run scripts/build.ts`,"build:rubric":`bun run scripts/build-tier-rubric.ts`,compile:`bun run scripts/compile.ts`,typecheck:`tsc --noEmit`,"check-i18n":`bun run scripts/check-i18n.ts`,test:`bun run test:fast && bun run test:socket`,"perf:golden":`bun scripts/perf-golden.ts`,"pty:soak":`bun scripts/pty-soak.ts`,"test:fast":`vitest run --passWithNoTests --minWorkers=1 --maxWorkers=8`,"test:socket":`ROVE_INCLUDE_SOCKET=1 vitest run test/daemon --pool forks --minWorkers=1 --maxWorkers=4 --passWithNoTests`,"test:socket:coverage":`ROVE_INCLUDE_SOCKET=1 ROVE_COVERAGE_DAEMON=1 vitest run test/daemon --coverage --pool forks --minWorkers=1 --maxWorkers=4 --passWithNoTests`,"test:behavior":`ROVE_INCLUDE_BEHAVIOR=1 vitest run test/behavior --pool forks --minWorkers=1 --maxWorkers=1 --retry=2 --passWithNoTests`,"test:render":`bun scripts/render-track.mjs`,coverage:`vitest run --coverage --passWithNoTests`,bench:`vitest bench --run`,lint:`biome check .`,knip:`knip-bun`,postinstall:`bun run scripts/check-preview-deps.ts || true`,prepublishOnly:`bun run typecheck && bun run build`,"plugin-sandbox":`bun run scripts/plugin-sandbox.ts`},"//":`biome.json + bunfig.toml live at the monorepo root since they apply repo-wide; bun.lock also lives at root (workspace-shared).`,dependencies:{"@ansi-tools/parser":`^1.0.15`,"@opentui/core":`0.4.3`,"@opentui/react":`0.4.3`,"@xterm/addon-serialize":`^0.14.0`,"@xterm/addon-unicode11":`^0.9.0`,"@xterm/headless":`^6.0.0`,react:`^19.2.8`,"smol-toml":`^1.7.1`,ws:`^8.21.3`},optionalDependencies:{"node-pty":`^1.1.0`},devDependencies:{"@biomejs/biome":`1.9.4`,"@sma1lboy/rove-daemon":`0.7.23`,"@tsconfig/bun":`1.0.11`,"@types/bun":`1.3.14`,"@types/node":`25.6.2`,"@types/react":`^19.2.0`,"@vitest/coverage-v8":`2.1.9`,knip:`^6.14.2`,"react-devtools-core":`^7.0.1`,"rove-bridge":`0.0.39`,"rove-weixin":`0.0.39`,typescript:`5.8.2`,vitest:`2.1.9`},trustedDependencies:[]};uA.version,uA.name;var dA=[`latest`,`next`,`nightly`],fA={autoRouting:{title:`Auto routing`,hint:"Routing by depth: a task says how deep the work is — swift, standard, deep — and this table says which engine, model and reasoning effort that depth runs on. Pick a depth in the new-task dialog (or `rove api add --tier`) and Rove fills those three fields from the row; you still see them and can change them before the task starts. enter (or click) a row to point it somewhere else, with the same picker a task uses. A row whose target cannot start says why here, not at launch.",unconfigured:`Auto routing is off: a depth has nowhere to route — its engine is blank. Point it somewhere below, or remove the empty autoRouting.<tier>.engine from state.json.`,engineDefault:`engine default`,ready:`● ready`,unavailable:`! unavailable — {reason}`,classifierTitle:`Classifier`,classifierHint:"The rows above say what each depth RUNS. This says who CHOOSES one: switch it on and `rove api add --tier auto` reads the task's first message and picks the depth for you. It is off by default, it is never required, and it can never fail a create — no key, no network, a timeout, or an answer it is not confident enough about all leave you on the depth you would have had.",classifierDataFlow:"! Turning the classifier on sends the task's first message to a third party that is NOT the engine vendor you picked — TypeSafe System One for `jev`, or whatever address you point `custom` at. It reads the text before your engine does. Nothing leaves this machine while it is off.",classifierLabel:`Choose with`,classifierOff:`off`,classifierCustomLabel:`custom`,classifierOffHint:`— nothing is sent anywhere`,classifierJevHint:`— TypeSafe System One, billed to your own key`,classifierCustomHint:`— your endpoint: POST the text, answer with a depth and a confidence`,endpointLabel:`Endpoint`,endpointUnset:`(none — enter one, then set Choose with to custom)`,endpointTitle:`Custom classifier endpoint`,endpointField:`URL`,endpointInvalidTitle:`Not a URL`,endpointInvalidBody:`The endpoint has to start with https://, or http:// for a loopback address (127.0.0.1, localhost, ::1) — over a network, plain http would carry the task's first 1,200 characters in cleartext. Leave it empty to clear it.`,thresholdLabel:`Confidence floor`,thresholdHint:`— below this, the depth is left alone`,thresholdTitle:`Confidence floor`,thresholdField:`0 to 1`,thresholdInvalidTitle:`Not a confidence`,thresholdInvalidBody:`The floor is a number between 0 and 1. 0.5 is the shipped default.`,keyLabel:`API key`,keyStored:`stored {hint} — enter to replace, empty to clear`,keyFromEnv:"from ${env} — the environment wins over a stored key",keyNone:`not set — enter to paste one`,keyTitle:`{env}`,keyPlaceholder:`paste the key; leave empty to clear the stored one`,keySaved:`● key stored in ~/.rove/secrets.json (owner-only, never in state.json)`,keyCustomUnused:`● no Authorization header is sent to a custom endpoint — set autoRouting.classifierCustomKeyEnv to the variable holding its key if it needs one`,keyNoVariableTitle:`No key variable for this endpoint`,keyNoVariableBody:`A custom classifier endpoint is sent no Authorization header until autoRouting.classifierCustomKeyEnv names the variable its key lives in. Set that first — a key stored under a name nothing reads is a key at rest for no purpose.`,keyWriteFailedTitle:`Key not saved`,keyWriteFailedBody:`~/.rove/secrets.json could not be written: {reason}. Check directory permissions and disk space, then save again.`,keyMissing:`! no key — nothing is chosen and tasks keep their usual depth`,keyPresentEnv:"● key read from ${env} in this process's environment"}},pA={autoRouting:{title:`自动路由`,hint:"按深度路由:任务说明这活有多深——轻快、标准、深入——这张表说明那一档跑在哪个引擎、哪个模型、哪个推理强度上。在新建任务对话框里选一档(或 `rove api add --tier`),Rove 就照那一行填进这三个字段;任务启动前你仍然看得见、改得了。enter(或点击)某一行,用和任务一样的选择器把它指到别处。目标起不来的行会在这里说明原因,而不是等到启动时才炸。",unconfigured:`自动路由已关闭:有一档无处可去——它的引擎是空的。在下面把它指到某个引擎,或从 state.json 里删掉空的 autoRouting.<tier>.engine。`,engineDefault:`引擎默认`,ready:`● 可用`,unavailable:`! 不可用——{reason}`,classifierTitle:`分类器`,classifierHint:"上面几行说的是每一档**跑什么**,这里决定**由谁来选**:打开之后,`rove api add --tier auto` 会读任务的第一句话替你选档。默认关着,从来不是必需的,也永远不会让建 task 失败——没 key、断网、超时、或者它自己没把握,都只是让你停在本来就会用的那一档上。",classifierDataFlow:"! 打开分类器,任务的第一句话会发给一个**不是你选的那个引擎厂商**的第三方——`jev` 是 TypeSafe System One,`custom` 是你自己填的地址。它比你的引擎更早读到这段文字。关着的时候什么都不发。",classifierLabel:`选档方式`,classifierOff:`关`,classifierCustomLabel:`自定义`,classifierOffHint:`——不向任何地方发送`,classifierJevHint:`——TypeSafe System One,走你自己的 key 计费`,classifierCustomHint:`——你自己的接口:POST 那段文本,返回一个档位加一个置信度`,endpointLabel:`接口地址`,endpointUnset:`(未填——先填一个,再把「选档方式」切到自定义)`,endpointTitle:`自定义分类器接口`,endpointField:`URL`,endpointInvalidTitle:`不是一个 URL`,endpointInvalidBody:`接口地址要以 https:// 开头;http:// 只在回环地址(127.0.0.1、localhost、::1)上接受——发到网络上的话,明文 http 会把任务的前 1200 个字符原样带走。留空则清除。`,thresholdLabel:`置信度下限`,thresholdHint:`——低于这个值就不动档位`,thresholdTitle:`置信度下限`,thresholdField:`0 到 1`,thresholdInvalidTitle:`不是一个置信度`,thresholdInvalidBody:`下限是 0 到 1 之间的数。出厂默认 0.5。`,keyLabel:`API key`,keyStored:`已存 {hint}——enter 可替换,留空清除`,keyFromEnv:"来自环境变量 ${env}——环境变量优先于存起来的那个",keyNone:`未设置——enter 粘贴一个`,keyTitle:`{env}`,keyPlaceholder:`粘贴 key;留空则清除已存的那个`,keySaved:`● key 存在 ~/.rove/secrets.json(仅本人可读,不会进 state.json)`,keyCustomUnused:`● 自定义接口不会收到 Authorization 头——它若需要凭据,把 autoRouting.classifierCustomKeyEnv 指向存它的变量`,keyNoVariableTitle:`这个接口还没有 key 变量`,keyNoVariableBody:`在 autoRouting.classifierCustomKeyEnv 指定存 key 的变量之前,自定义分类器接口不会收到任何 Authorization 头。先设那个——存在一个没人读的名字下面的 key,只是白白落在盘上。`,keyWriteFailedTitle:`key 没存下`,keyWriteFailedBody:`写不了 ~/.rove/secrets.json:{reason}。请检查目录权限和磁盘空间,再次保存。`,keyMissing:`! 没有 key——不会替你选档,任务保持原来的档位`,keyPresentEnv:"● key 来自本进程环境变量 ${env}"}},mA={dev:{reset:`Reset UI state`,resetHint:`Clears ~/.config/rove/state.json and ~/.rove/tasks.json, then quits Rove — relaunch to start fresh. Working session list, pane sizes, theme, model picks all reset. Worktrees on disk and engine session history are not touched.`,resetButton:`[enter] Reset`,restart:`Restart backend`,restartHint:`Stops the Rove daemon and relaunches this window on the installed build — picks up daemon / orchestrator / engine edits without quitting by hand. Running engine sessions live in the PTY host and survive it; other attached Rove windows reconnect on their own.`,restartButton:`[enter] Restart`,reload:`Reload settings`,reloadHint:"Applies hand edits to ~/.config/rove/state.json (from `rove config`) to this window without a restart.",reloadButton:`[enter] Reload`,reloadDone:`Reloaded: {count} changed.`,reloadUnchanged:`Already matches state.json; nothing changed.`,reloadFailed:`state.json could not be read, nothing changed: {error}`,doctorHint:"Daemon wedged or unresponsive? Restart backend above does it from here; from a shell it is `rove daemon restart`. Hosted engine sessions stay alive across a daemon restart.",experimental:`Experimental`,remoteHint:"Remote projects (SSH): register a project whose git worktrees live on another host, driven from this local Rove. Unfinished — Hosted PTY engine launch over SSH is not implemented, and file/diff panes still degrade. Enables `rove add --remote`.",remote:`Remote projects`,autoStatusHint:`Auto status flow: a backlog task moves to in_progress when its engine starts a turn, and new sessions get a system-prompt note telling the agent to set in_review itself when the work is done. Never touches done/canceled.`,autoStatus:`Auto status flow`,dispatcherHint:"Field-notes dispatcher: task sessions file one-line gotchas (`rove api note`), the daemon forwards each to the repo's main session, and that session relays them to the in-flight tasks that benefit (`rove api dispatch`). Web-hosted sessions receive the relays today.",dispatcher:`Field-notes dispatcher`}},hA={dev:{reset:`重置 UI 状态`,resetHint:`清空 ~/.config/rove/state.json 和 ~/.rove/tasks.json,然后退出 Rove——重新启动即可从头开始。工作会话列表、面板尺寸、主题、模型选择都会重置。磁盘上的 worktree 和引擎会话历史不受影响。`,resetButton:`[enter] 重置`,restart:`重启后端`,restartHint:`停止 Rove daemon,并以已安装的版本重新启动当前窗口——无需手动退出即可应用 daemon / orchestrator / engine 的改动。正在运行的引擎会话由 PTY host 托管,不受影响;其他已连接的 Rove 窗口会自行重连。`,restartButton:`[enter] 重启`,reload:`重新加载设置`,reloadHint:"把对 ~/.config/rove/state.json 的手动修改(来自 `rove config`)应用到当前窗口,无需重启。",reloadButton:`[enter] 重新加载`,reloadDone:`已重新加载:{count} 项有变化。`,reloadUnchanged:`已与 state.json 一致,没有变化。`,reloadFailed:`无法读取 state.json,未做任何改动:{error}`,doctorHint:"daemon 卡住或无响应?上面的「重启后端」就能在这里完成;在 shell 里则是 `rove daemon restart`。Hosted PTY 引擎会话不会因 daemon 重启而退出。",experimental:`实验性`,remoteHint:"远程项目(SSH):注册一个 git worktree + 引擎都通过 SSH 跑在另一台主机上、由本地 Rove 驱动的项目。尚未完成——文件/diff 面板对远程仍会降级。启用 `rove add --remote`。",remote:`远程项目`,autoStatusHint:`自动状态流转:backlog 任务在其引擎开始一轮时移到 in_progress,新会话会拿到一条系统提示,告诉 agent 完成后自行设为 in_review。绝不触碰 done/canceled。`,autoStatus:`自动状态流转`,dispatcherHint:"现场笔记调度器:任务会话提交一行经验(`rove api note`),daemon 将每条转发给仓库的主会话,主会话再把它们转达给能受益的进行中任务(`rove api dispatch`)。目前由 Web 托管的会话会收到转达。",dispatcher:`现场笔记调度器`}},gA={engines:{title:`Engines`,hint:`Engines Rove can start on this machine. New tasks start with the default engine; switch an engine off to stop offering it.`,keys:`space available · d default · enter launch command · r rename · x reset/remove`,customTag:`custom`,available:`available`,off:`off`,defaultMark:`default`,makeDefault:`Make default`,status:{checking:`Checking…`,unknown:`Status unknown`,ready:`Ready`,notInstalled:`Not installed`,notOnPath:`Not on PATH`,signIn:`Sign in needed`,integrationMissing:`Integration not installed`,integrationOutdated:`Integration outdated`,integrationBlocked:`Integration blocked`},detail:{program:`Program`,command:`Command`,signIn:`Sign-in`,reporting:`Live status`,adapter:`Adapter`,programFound:`{binary} found at {path}.`,programMissing:`{binary} is not on PATH. Install the engine's CLI, or point its launch command at it.`,programUnknown:`Rove could not check for {binary}.`,commandDefault:`{command} (the default)`,commandCustom:`{command} (yours)`,signedIn:`Signed in.`,signedInAs:`Signed in as {who}.`,apiKey:`An API key is configured.`,token:`A token is configured ({source}).`,signedOut:`Not signed in. Sign in with the engine's own CLI.`,signInUnknown:`Rove can't see whether this engine is signed in.`,signInFailed:`Sign-in check failed: {error}`,hooksInstalled:`Rove's hooks are installed, so tabs report their state as it changes.`,hooksOutdated:`Rove's hooks are from an older version; reinstall them under Engine integrations.`,hooksMissing:`Rove's hooks are not installed; install them under Engine integrations.`,hooksAwaitEngine:`Rove's hooks can be installed once the engine is.`,hooksUnsupported:`This engine has no hooks for Rove to install.`,hooksBlocked:`Rove can't write its hooks into {file}: {reason}`,hooksBlockedHere:`Rove can't write its hooks into the engine's config: {reason}`,markersYes:`It leaves turn-complete markers that Rove reads back.`,markersNo:`It leaves no turn-complete markers.`,screenYes:`Screen rules cover what the hooks don't.`,screenNo:`No screen rules.`,screenNotNeeded:`No screen rules; the hooks report everything.`,adapterDeclared:`Borrows the {protocol} adapter.`,adapterGeneric:`Generic adapter: no transcript reader, sign-in check or resume.`,skill:`Rove skill`,skillInstalled:`Installed in {dir}.`,skillInstalledHere:`Installed and current.`,skillOutdated:`From an older Rove; reinstall it under Rove agent skill.`,skillMissing:`Not installed; install it under Rove agent skill.`},skill:{title:`Rove agent skill`,hint:`Teaches the agent in each engine to drive Rove itself (rove api): start tasks, read other sessions, message them.`,install:`Install ({count})`,noEngines:`No engine here takes the skill`,failed:`Install failed: {reason}`,bannerTitle:`ROVE SKILL NOT INSTALLED`,bannerHint:`{engines} can't drive Rove yet (start tasks, read other sessions). Click here to install.`,bannerHintWeb:`{engines} can't drive Rove yet (start tasks, read other sessions).`},integrations:{title:`Engine integrations`,hint:`Hooks Rove writes into each engine's own config, so a tab shows working, waiting or done the moment it happens.`,summary:`{installed} of {total} installed`,install:`Install missing ({count})`,upToDate:`All up to date`,remove:`Remove all ({count})`,noneInstalled:`Nothing to remove`},addEngine:`+ Add engine`,launchCommandTitle:`{name} launch command`,displayNameTitle:`{name} display name (blank = default)`,addTitle:`Add engine`,addStepTitle:`Add engine · {id}`,protocolTitle:`Add engine · {id} — protocol`,protocolNone:`None — generic adapter`,protocolFooter:`↑↓ choose · enter pick · esc cancel`,protocolRow:`protocol {protocol}`,protocolGeneric:`generic`,idPlaceholder:`lowercase slug, e.g. aider`,commandPlaceholder:`e.g. aider --model sonnet`,hookTrustHint:`Open {command} in the engine and approve hooks yourself. Written hooks are not proof of trust.`,readiness:`CLI: {cli} · login: {login} · hooks: {hooks}`,cliReady:`available`,cliMissing:`missing; install the engine CLI`,loginReady:`detected`,loginMissing:`sign in with the engine CLI`,readinessUnknown:`not observable`,hooksWritten:`written`,hooksMissing:`not written; Settings → Engines`,hooksOutdated:`outdated; Settings → Engines`,hookWaiting:`No hook event received yet. After approval, send a short prompt to verify activity.`,hookReceived:`Hook event recorded for this tab. Send a short prompt to check current reporting; current trust is not inferred.`,readinessFailed:`Readiness check unavailable; run rove doctor. No authorization is inferred.`},accounts:{checking:`Checking…`,notLoggedIn:`○ Not logged in`,loggedIn:`● Logged in: {email}`,apiKeyConfigured:`● API key configured`,chatgptLogin:`● ChatGPT login: {email}`,tokenConfigured:`● Token configured ({source})`,detected:`● Login detected`}},_A={engines:{title:`引擎`,hint:`Rove 能在这台机器上启动的引擎。新任务默认用「默认」引擎;关掉某个引擎,选引擎时就不再列出它。`,keys:`space 可用 · d 设为默认 · enter 启动命令 · r 重命名 · x 重置/移除`,customTag:`自定义`,available:`可用`,off:`已关`,defaultMark:`默认`,makeDefault:`设为默认`,status:{checking:`检查中…`,unknown:`状态未知`,ready:`就绪`,notInstalled:`未安装`,notOnPath:`不在 PATH 上`,signIn:`需要登录`,integrationMissing:`未安装接入`,integrationOutdated:`接入已过期`,integrationBlocked:`接入被拒绝`},detail:{program:`程序`,command:`命令`,signIn:`登录`,reporting:`实时状态`,adapter:`适配器`,programFound:`{binary} 位于 {path}。`,programMissing:`{binary} 不在 PATH 上。请安装引擎 CLI,或把启动命令指向它。`,programUnknown:`Rove 无法检查 {binary}。`,commandDefault:`{command}(默认)`,commandCustom:`{command}(自定义)`,signedIn:`已登录。`,signedInAs:`已登录:{who}。`,apiKey:`已配置 API key。`,token:`已配置 Token({source})。`,signedOut:`未登录。请用引擎自己的命令行登录。`,signInUnknown:`Rove 无法得知该引擎是否已登录。`,signInFailed:`登录检查失败:{error}`,hooksInstalled:`Rove 的钩子已安装,标签页的状态会实时上报。`,hooksOutdated:`Rove 的钩子来自旧版本;请在「引擎接入」里重新安装。`,hooksMissing:`Rove 的钩子未安装;请在「引擎接入」里安装。`,hooksAwaitEngine:`引擎安装后才能装 Rove 的钩子。`,hooksUnsupported:`该引擎没有可供 Rove 安装的钩子。`,hooksBlocked:`Rove 无法把钩子写入 {file}:{reason}`,hooksBlockedHere:`Rove 无法把钩子写入引擎配置:{reason}`,markersYes:`它会留下回合完成标记,Rove 可以读回。`,markersNo:`它不留下回合完成标记。`,screenYes:`读屏规则兜底钩子覆盖不到的状态。`,screenNo:`没有读屏规则。`,screenNotNeeded:`没有读屏规则;钩子已报全所有状态。`,adapterDeclared:`借用 {protocol} 适配器。`,adapterGeneric:`通用适配器:没有会话记录读取、登录检查和恢复。`,skill:`Rove 技能`,skillInstalled:`已安装在 {dir}。`,skillInstalledHere:`已安装,是最新版。`,skillOutdated:`来自旧版 Rove;请在「Rove 智能体技能」里重新安装。`,skillMissing:`未安装;请在「Rove 智能体技能」里安装。`},skill:{title:`Rove 智能体技能`,hint:`教会各引擎里的智能体自己操作 Rove(rove api):开任务、读其他会话、给它们发消息。`,install:`安装({count})`,noEngines:`这台机器上没有能装技能的引擎`,failed:`安装失败:{reason}`,bannerTitle:`ROVE 技能未安装`,bannerHint:`{engines} 还不能操作 Rove(开任务、读其他会话)。点这里安装。`,bannerHintWeb:`{engines} 还不能操作 Rove(开任务、读其他会话)。`},integrations:{title:`引擎接入`,hint:`Rove 写进各引擎自身配置的钩子,让标签页在工作、等待、完成的那一刻就显示出来。`,summary:`已安装 {installed}/{total}`,install:`安装缺失的({count})`,upToDate:`全部已是最新`,remove:`全部移除({count})`,noneInstalled:`没有可移除的`},addEngine:`+ 添加引擎`,launchCommandTitle:`{name} 的启动命令`,displayNameTitle:`{name} 的显示名称(留空 = 默认)`,addTitle:`添加引擎`,addStepTitle:`添加引擎 · {id}`,protocolTitle:`添加引擎 · {id} —— 协议`,protocolNone:`无 —— 通用适配器`,protocolFooter:`↑↓ 选择 · enter 确认 · esc 取消`,protocolRow:`协议 {protocol}`,protocolGeneric:`通用`,idPlaceholder:`小写短名,如 aider`,commandPlaceholder:`如 aider --model sonnet`,hookTrustHint:`在引擎中打开 {command},由你自行批准 hooks。写入不代表已授权。`,readiness:`CLI:{cli} · 登录:{login} · hooks:{hooks}`,cliReady:`可用`,cliMissing:`缺失;请安装引擎 CLI`,loginReady:`已检测到`,loginMissing:`请通过引擎 CLI 登录`,readinessUnknown:`无法观测`,hooksWritten:`已写入`,hooksMissing:`未写入;设置 → 引擎`,hooksOutdated:`已过时;设置 → 引擎`,hookWaiting:`尚未收到 hook 事件。授权后发送一条简短提示,验证活动状态。`,hookReceived:`已记录此标签页的 hook 事件。发送简短提示以检查当前上报;不据此推断当前授权。`,readinessFailed:`无法检查就绪状态;请运行 rove doctor。不会据此推断已授权。`},accounts:{checking:`检查中…`,notLoggedIn:`○ 未登录`,loggedIn:`● 已登录: {email}`,apiKeyConfigured:`● 已配置 API key`,chatgptLogin:`● ChatGPT 登录: {email}`,tokenConfigured:`● 已配置 Token ({source})`,detected:`● 检测到登录`}},vA={plugins:{title:`Plugins`,hint:"Rove's first-party mods first: enter (or click) installs or uninstalls one, and uninstalling keeps its data on disk. Then the plugins registered in ~/.rove/plugins.json: enter toggles one on or off — the daemon watches the file, so the change applies live. Rows indented under a plugin are the settings it declares; enter edits one, and the value reaches the plugin on its next run. Install and remove them from the shell: `rove plugin install <owner/repo>`, `rove plugin link <dir>`.",empty:"Kanban and Issues are first-party mods: enter (or click) installs one. No other plugins registered; add one with `rove plugin install <owner/repo>` — browse the `rove-plugin` topic on GitHub.",sourceLink:`linked {path}`,sourceGithub:`{spec}`,sourceBuiltIn:`first-party mod · not installed`,sourceBuiltInInstalled:`first-party mod · installed`,updateAvailable:`update available — rove plugin update`,declares:`{actions} actions · {events} events · {panes} panes`,declaresWithEngines:`{actions} actions · {events} events · {panes} panes · {engines} engines`,declaresPages:`· {pages} pages`,pageFailed:`page {detail}`,manifestUnreadable:`manifest unreadable; check the rove-plugin.toml path and TOML syntax`,unsupportedPlatform:`· not supported on this platform`,noHooks:`· no hooks declared`,lastRun:`· last run {label} {status} {ago} ago`,neverRun:`· never run`,runOk:`ok`,runRunning:`still running`,runFailed:"failed to start; inspect `rove plugin log <id>`",runExit:`exit {code}`,settingUnset:`(unset — enter to edit)`,settingInvalidTitle:`Not a number`,settingInvalidBody:`{label} only accepts a number. Keeping the previous value.`},marketplace:{title:`Marketplace`,hint:"Plugins published under the `rove-plugin` topic on GitHub, most-starred first. enter (or click) shows what the install would run and asks before running any of it. The listing is re-queried each time you open this section.",loading:`Searching GitHub…`,empty:`No plugins listed.`,offline:`GitHub is unreachable — showing first-party plugins only. Re-open this section to retry.`,installedTag:`installed`,firstParty:`first-party`,preparing:`cloning {ref}…`,installing:`building and registering {name}…`,installed:`installed {id} v{version} — it is enabled, and appears under Plugins.`,cancelled:`install cancelled; nothing was run.`,failed:`install failed: {error}. Check the build output and retry from Marketplace.`,alreadyInstalled:`already installed as {id} — manage it under Plugins.`,confirmTitle:`Install {name}?`,confirmInstall:`install`,previewSource:`source: {source}`,previewCommands:`Commands this plugin declares:`,previewNoCommands:`This plugin declares no commands.`,previewWarning:`warning: {warning}`,previewTrust:`Installing runs the build commands above, and the rest run later on the events they declare. They run as you, with your environment, and nothing is sandboxed.`}},yA={plugins:{title:`插件`,hint:"先列 Rove 官方 mod:enter(或点击)安装或卸载,卸载后数据仍留在磁盘上。再列在 ~/.rove/plugins.json 里注册的插件:enter 切换启用/禁用——daemon 监听该文件,改动实时生效。插件下方缩进的行是它声明的设置项,enter 编辑,新值在插件下次运行时生效。安装与移除在 shell 里做:`rove plugin install <owner/repo>`、`rove plugin link <dir>`。",empty:"Kanban 和 Issues 是官方 mod:enter(或点击)安装。尚未注册其他插件;用 `rove plugin install <owner/repo>` 安装一个——可在 GitHub 的 `rove-plugin` 话题下浏览。",sourceLink:`本地链接 {path}`,sourceGithub:`{spec}`,sourceBuiltIn:`官方 mod · 未安装`,sourceBuiltInInstalled:`官方 mod · 已安装`,updateAvailable:`有新版本 — rove plugin update`,declares:`{actions} 个动作 · {events} 个事件 · {panes} 个面板`,declaresWithEngines:`{actions} 个动作 · {events} 个事件 · {panes} 个面板 · {engines} 个引擎`,declaresPages:`· {pages} 个页面`,pageFailed:`页面 {detail}`,manifestUnreadable:`manifest 无法解析;请检查rove-plugin.toml 的路径和 TOML 语法`,unsupportedPlatform:`· 不支持当前平台`,noHooks:`· 未声明钩子`,lastRun:`· 上次运行 {label} {status} {ago}前`,neverRun:`· 尚未运行过`,runOk:`成功`,runRunning:`仍在运行`,runFailed:"启动失败;请查看 `rove plugin log <id>`",runExit:`退出码 {code}`,settingUnset:`(未设置 — enter 编辑)`,settingInvalidTitle:`不是数字`,settingInvalidBody:`{label} 只接受数字,保留原值。`},marketplace:{title:`插件市场`,hint:"GitHub 上 `rove-plugin` 话题下发布的插件,按 star 数排序。enter(或点击)会先列出安装会执行的命令,确认后才真正执行。每次进入本区块都会重新查询列表。",loading:`正在搜索 GitHub…`,empty:`列表为空。`,offline:`GitHub 不可达——只显示首方插件。重新进入本区块可再试一次。`,installedTag:`已安装`,firstParty:`首方`,preparing:`正在克隆 {ref}…`,installing:`正在构建并注册 {name}…`,installed:`已安装 {id} v{version}——已启用,可在「插件」区块管理。`,cancelled:`已取消安装,没有执行任何命令。`,failed:`安装失败:{error}。请检查构建输出,再从插件市场重试。`,alreadyInstalled:`已安装为 {id}——在「插件」区块管理。`,confirmTitle:`安装 {name}?`,confirmInstall:`安装`,previewSource:`来源:{source}`,previewCommands:`该插件声明的命令:`,previewNoCommands:`该插件未声明任何命令。`,previewWarning:`警告:{warning}`,previewTrust:`安装会执行上面的 build 命令,其余命令会在它们声明的事件发生时执行。它们以你的身份、带你的环境变量运行,没有任何沙箱。`}},bA={en:{appearance:{enabled:`On`,disabled:`Off`,borderFlow:`Flowing gradient`,borderStill:`Still`,glyphsBraille:`Braille`,glyphsStarburst:`Starburst (needs a font with the Dingbats block)`,glyphsAscii:`ASCII`,titleShimmer:`Shimmer`,titleStill:`Still`,preview:`Workspace preview`,tasks:`Tasks`,terminal:`Terminal`,files:`Files`,testsPassed:`Tests passed`,transparent:`Transparent background`,opaque:`Opaque background`,modeDark:`Dark`,modeLight:`Light`,modeAuto:`Auto (follow the terminal)`,openHint:`Enter to choose an option and preview it.`,chooseHint:`↑/↓ or j/k preview · enter apply · esc cancel`},title:`Settings`,esc:`esc`,nav:{default:`j/k pick · h/l switch level · enter activate · esc close`,feedback:`tab next field · enter sends on Send · esc close`},sections:{general:`General`,engines:`Engines`,autoRouting:`Auto routing`,plugins:`Plugins`,marketplace:`Marketplace`,keys:`Keybindings`,feedback:`Feedback`,dev:`Dev`},general:{usage:`USAGE`,theme:`Theme`,themeMode:`Mode`,themeHint:`l to enter list · j/k to highlight · enter to apply`,language:`Language`,languageHint:`Display language for Rove's UI. l to enter list · j/k to highlight · enter to apply.`,transparent:`Transparent background`,transparentHint:`Drops the renderer's bg fill so the host terminal shows through. enter toggles.`,on:`[x] on`,off:`[ ] off`,focusAccent:`Focus accent`,focusAccentHint:`Color of focused pane title, ▌ marker, and split borders.`,accentPrimary:`Primary (brand accent)`,accentSuccess:`Success (legacy green)`,accentInfo:`Info (cool blue)`,appearance:`Appearance`,appearanceHint:`How split panes draw.`,splitStyle:`Split panes`,workingBorder:`Working border`,taskColors:`Task colors`,glyphSet:`State glyphs`,colorblind:`Colorblind diff colours`,runningTitle:`Running title`,splitBox:`Box frames`,splitLine:`Divider line`,splitRail:`Accent rail`,splitRule:`Top rule`,notifications:`Notifications`,notificationsHint:`When a background tab finishes or pauses on an approval.`,toast:`Toast`,toastHint:`bottom-right popup`,sound:`Sound`,soundHint:`bell + chime + an OSC 9 desktop notification (rides SSH)`,soundVolume:`Chime volume — {percent}%`,soundVolumeHint:`enter cycles; applies to the next chime`,crossTask:`Cross-task`,crossTaskHint:`also for a task you switched away from`,finishedAlerts:`Finished turns`,finishedAlertsHint:`off: only approvals and errors alert; the unread dot stays`,keyHints:`Keyboard hints`,keyHintsHint:`The status-bar reminder and the first-use hints in the sidebar and files panes.`,keyHintsShow:`Show keyboard hints`,keyHintsShowHint:`re-enabling relights hints dismissed by use`,zen:`Zen mode`,zenHint:"The `zen` chip and `prefix`+z hide Files, keeping the Tasks rail and workspace.",zenDefaultOn:`Start in zen mode`,updates:`Updates`,updatesHint:`Stable is the default channel; next previews the coming release; nightly is built from main every day.`,updateChannelTitle:`Release channel`,updateChannel:`Channel: {channel}`,updateChannelHint:"enter cycles stable / next / nightly; `rove update` follows it",updateChannelName:{latest:`stable`,next:`next preview`,nightly:`nightly preview`},updateNotify:`Notify on updates`,updateNotifyHint:`new versions on this channel; off hides the update chip, and checking by hand still reports`,updateCheck:`[ Check for updates ]`,updateCheckHint:`asks npm for the newest release on this channel right now`,updateCheckButton:`Check for updates`,updateChecking:`Checking…`,updateOpenPage:`Open Update page`,updateOpenPageRow:`[ Open Update page ]`,railFold:`Folded task rail`,railFoldHint:`What the rail shows once folded away from its corner control.`,railFoldRow:`Folded rail shows: {style}`,railFoldRowHint:`enter cycles`,railFoldGlyphs:`status glyphs`,railFoldInitials:`glyph + initials`,railFoldHairline:`colour band only`,editor:`Editor`,editorHint:`What enter opens a file with in the file tree — diff mode when the editor supports it, the read-only preview when it isn't installed.`,editorRow:`editor: < {kind} >`,editorRowHint:`auto follows $VISUAL / $EDITOR, else nvim / vim / emacs / nano`,editorCustom:`custom: {cmd}`,editorCustomUnset:`(unset — enter to edit)`,worktree:`Worktree location`,worktreeHint:`Where new task worktrees are created. New tasks only.`,worktreeBase:`location: < {kind} >`,worktreeBaseHint:"custom takes `~`, a relative path, or a leading `$project_dir`",worktreeKindDefault:`default ~/.rove/worktrees`,worktreeKindNext:`next to project`,worktreeKindCustom:`custom`,worktreeCustom:`custom: {path}`,worktreeCustomUnset:`(unset — enter to edit)`,worktreeBaseTitle:`Custom worktree location (blank = default; $project_dir = project root)`,worktreeBaseField:`PATH`,editorCustomTitle:`Custom editor command (use {file} for the path)`,worktreeBaseInvalidTitle:`Can't use that worktree location`,worktreeBaseTokenBody:`{token} only expands as the leading path segment (e.g. {token}/../rove-worktrees). Keeping the previous setting.`,worktreeBaseUnusableBody:`{path} isn't usable ({error}). Keeping the previous setting — pick a writable directory.`,terminal:`Terminal`,terminalHint:`Applies to terminals opened after the change.`,scrollbackRow:`scrollback: {rows} rows`,scrollbackRowHint:`100–100000 · larger costs proportionally more CPU per redraw`,scrollbackTitle:`Terminal scrollback rows (100–100000)`,scrollbackField:`ROWS`,scrollbackInvalidTitle:`Not a number`,scrollbackInvalidBody:`Scrollback must be a number of rows (e.g. 1000). Keeping the previous setting.`,tabStripRow:`tab strip: {mode}`,tabStripMode:{never:`off — the sidebar tree lists tabs`,multipleOnly:`only with 2+ tabs`,always:`always`}},field:{command:`COMMAND`,name:`NAME`,id:`ID`},action:{save:`save`,next:`next`,add:`add`},reset:{title:`Reset UI state?`,body:`Wipes ~/.config/rove/state.json and ~/.rove/tasks.json, then quits Rove — relaunch for a fresh start with an empty working session list. Worktrees on disk and engine session history are NOT touched.`,done:`Rove: UI state reset. Relaunch Rove to start fresh.`,failedTitle:`UI state was not reset`,failedBody:`Could not write the settings file. Your settings and tasks have been kept. Try resetting again.`},restart:{title:`Restart backend?`,body:`Stops the daemon and relaunches this Rove on the installed build, so daemon / orchestrator / engine edits take effect. Running engine sessions live in the PTY host and keep going; open tabs come back. Any other attached windows reconnect on their own.`,done:`Rove: restarting the backend...`},stateWrite:{failedTitle:`Settings were not saved`,failedBody:`{file} could not be written ({keys}). Check its directory permissions and free disk space, then save again.`},...fA,...gA,...vA,keybindings:{title:`Keybindings`,hint:`Rebind direct and prefix chords in your own YAML file; changes reload live. Press F1 anywhere for the live keymap with every binding id.`,configFile:`Config file`,notCreated:` (not created yet)`,prefixTitle:`Command layer ({prefix})`,prefixHint:`Bare keys act in the focused pane; a small one-press set covers frequent Rove actions; {prefix} opens the command layer ({timeout}ms second-stroke window). Prefix bindings keep their pane scope and modal rules.`,tapPresentation:`Prefix tap`,tapPresentationHint:`Choose whether the complete guide also marks controls already on screen.`,tapPresentationLocal:`On-screen entries + complete guide (default)`,tapPresentationGuide:`Complete guide only`,prefixDisabled:`disabled`,fixed:`Fixed (not rebindable): {ids}.`,createHint:`No overrides file yet. Rove can write one for you, fully commented — nothing is rebound until you uncomment a line.`,createFile:`[enter] Create keybindings.yaml`,overridesApplied:`Overrides applied`,none:`none`,unbound:`(unbound)`,defaultKeys:`default: {keys}`,warnings:`Warnings`},feedback:{title:`Feedback`,hint:"Sends a GitHub Discussion to the Rove repo through `gh`. Requires `gh auth login`; category defaults to Feedback.",titleLabel:`title`,titlePlaceholder:`Short summary`,descriptionLabel:`description`,descriptionPlaceholder:`What happened? (enter for a new line · tab to Send)`,send:`[enter] Send to GitHub Discussions`},...mA},zh:{appearance:{enabled:`开启`,disabled:`关闭`,borderFlow:`流动渐变`,borderStill:`静止`,glyphsBraille:`盲文点`,glyphsStarburst:`星芒(需要含 Dingbats 符号区的字体)`,glyphsAscii:`ASCII`,titleShimmer:`流光`,titleStill:`静止`,preview:`工作区预览`,tasks:`任务`,terminal:`终端`,files:`文件`,testsPassed:`测试通过`,transparent:`透明背景`,opaque:`不透明背景`,modeDark:`深色`,modeLight:`浅色`,modeAuto:`自动(跟随终端)`,openHint:`按 Enter 打开选项和预览。`,chooseHint:`↑/↓ 或 j/k 预览 · enter 应用 · esc 取消`},title:`设置`,esc:`esc`,nav:{default:`j/k 选择 · h/l 切换层级 · enter 确认 · esc 关闭`,feedback:`tab 下一项 · enter 在发送项发送 · esc 关闭`},sections:{general:`通用`,autoRouting:`自动路由`,engines:`引擎`,plugins:`插件`,marketplace:`插件市场`,keys:`快捷键`,feedback:`反馈`,dev:`开发`},general:{usage:`用量`,theme:`主题`,themeMode:`明暗`,themeHint:`l 进入列表 · j/k 高亮 · enter 应用`,language:`语言`,languageHint:`Rove 界面的显示语言。l 进入列表 · j/k 高亮 · enter 应用。`,transparent:`透明背景`,transparentHint:`去掉渲染器的背景填充,让宿主终端透出来。按 enter 切换。`,on:`[x] 开`,off:`[ ] 关`,focusAccent:`聚焦强调色`,focusAccentHint:`聚焦面板标题、▌ 标记和分隔边框的颜色。`,accentPrimary:`主色(品牌强调色)`,accentSuccess:`成功色(传统绿)`,accentInfo:`信息色(冷蓝)`,appearance:`外观`,appearanceHint:`分屏面板怎么画边。`,splitStyle:`分屏面板`,workingBorder:`运行中边框`,taskColors:`任务配色`,glyphSet:`状态符号`,colorblind:`色盲友好的增删配色`,runningTitle:`运行中标题`,splitBox:`方框边框`,splitLine:`单线分隔`,splitRail:`左侧强调条`,splitRule:`顶部横线`,notifications:`通知`,notificationsHint:`后台标签完成或在审批处暂停时触发。`,toast:`Toast 弹窗`,toastHint:`右下角弹窗`,sound:`声音`,soundHint:`响铃 + 提示音 + OSC 9 桌面通知(经 SSH 直达本地)`,soundVolume:`提示音音量 — {percent}%`,soundVolumeHint:`回车循环切换;下一声提示音生效`,crossTask:`跨任务`,crossTaskHint:`你已切走的任务也通知`,finishedAlerts:`回合完成`,finishedAlertsHint:`关闭后只有审批和错误会提醒;未读标记照常`,keyHints:`键盘提示`,keyHintsHint:`状态栏提醒,以及侧栏和文件面板的首用提示。`,keyHintsShow:`显示键盘提示`,keyHintsShowHint:`重新开启会点亮已因使用而熄灭的提示`,zen:`禅模式`,zenHint:"`zen` 标记和 `prefix`+z 隐藏 Files,保留 Tasks 侧栏与 workspace。",zenDefaultOn:`启动即进入禅模式`,updates:`更新`,updatesHint:`稳定版是默认渠道;next 预览即将发布的版本;nightly 每天从 main 自动构建。`,updateChannelTitle:`发布渠道`,updateChannel:`渠道:{channel}`,updateChannelHint:"enter 在稳定版 / next / nightly 间切换;`rove update` 跟随它",updateChannelName:{latest:`稳定版`,next:`next 预览版`,nightly:`nightly 预览版`},updateNotify:`有新版本时通知我`,updateNotifyHint:`只针对所选渠道;关闭后不再显示更新标记,手动检查仍会给出结果`,updateCheck:`[ 检查更新 ]`,updateCheckHint:`立即向 npm 查询所选渠道的最新版本`,updateCheckButton:`检查更新`,updateChecking:`检查中…`,updateOpenPage:`打开更新页`,updateOpenPageRow:`[ 打开更新页 ]`,railFold:`折叠后的任务栏`,railFoldHint:`任务栏从角标折叠之后显示什么。`,railFoldRow:`折叠后显示:{style}`,railFoldRowHint:`enter 切换`,railFoldGlyphs:`状态字形`,railFoldInitials:`字形 + 首字母`,railFoldHairline:`仅色带`,editor:`编辑器`,editorHint:`文件树里按 enter 用什么打开文件——支持时走编辑器 diff 模式,未安装时回退到只读预览。`,editorRow:`编辑器: < {kind} >`,editorRowHint:`auto 跟随 $VISUAL / $EDITOR,否则 nvim / vim / emacs / nano`,editorCustom:`自定义: {cmd}`,editorCustomUnset:`(未设置 — enter 编辑)`,worktree:`工作树位置`,worktreeHint:`新任务工作树的创建位置。仅对新任务生效。`,worktreeBase:`位置: < {kind} >`,worktreeBaseHint:"自定义可填 `~`、相对路径或以 `$project_dir` 开头",worktreeKindDefault:`默认 ~/.rove/worktrees`,worktreeKindNext:`项目旁边`,worktreeKindCustom:`自定义`,worktreeCustom:`自定义: {path}`,worktreeCustomUnset:`(未设置 — enter 编辑)`,worktreeBaseTitle:`自定义工作树位置(留空 = 默认;$project_dir = 项目根目录)`,worktreeBaseField:`路径`,editorCustomTitle:`自定义编辑器命令(用 {file} 代表文件路径)`,worktreeBaseInvalidTitle:`无法使用该工作树位置`,worktreeBaseTokenBody:`{token} 只能作为路径的第一段展开(如 {token}/../rove-worktrees)。保留原设置。`,worktreeBaseUnusableBody:`{path} 不可用({error})。保留原设置 —— 请选择一个可写目录。`,terminal:`终端`,terminalHint:`对修改后新打开的终端生效。`,scrollbackRow:`回滚行数: {rows} 行`,scrollbackRowHint:`100–100000 · 调大会按比例增加每次重绘的 CPU`,scrollbackTitle:`终端回滚行数(100–100000)`,scrollbackField:`行数`,scrollbackInvalidTitle:`不是数字`,scrollbackInvalidBody:`回滚行数必须是数字(如 1000)。保留原设置。`,tabStripRow:`标签栏: {mode}`,tabStripMode:{never:`关闭 — 标签在左侧树里`,multipleOnly:`仅 2 个以上标签时显示`,always:`始终显示`}},field:{command:`命令`,name:`名称`,id:`标识`},action:{save:`保存`,next:`下一步`,add:`添加`},reset:{title:`重置界面状态?`,body:`将清除 ~/.config/rove/state.json 和 ~/.rove/tasks.json 并退出 Rove —— 重新启动后会是一个干净的开始,工作会话列表为空。磁盘上的工作树和引擎会话历史不受影响。`,done:`Rove:界面状态已重置。重新启动 Rove 即可从头开始。`,failedTitle:`UI 状态未能重置`,failedBody:`无法写入设置文件。设置和任务均已保留,请稍后重新尝试重置。`},restart:{title:`重启后端?`,body:`会停掉 daemon,并以已安装的版本重新启动当前 Rove 窗口,从而让 daemon / orchestrator / 引擎的改动生效。正在运行的引擎会话由 PTY host 托管,不会中断;已打开的标签页会恢复。其他已连接的窗口会自行重连。`,done:`Rove:正在重启后端……`},stateWrite:{failedTitle:`设置未能保存`,failedBody:`{file} 写入失败({keys})。请检查目录权限和磁盘空间,再次保存。`},...pA,..._A,...yA,keybindings:{title:`快捷键`,hint:`在你自己的 YAML 文件里重绑定直接按键和 prefix 组合;修改会实时加载。任意位置按 F1 查看带每个绑定 id 的实时键位表。`,configFile:`配置文件`,notCreated:` (尚未创建)`,prefixTitle:`命令层({prefix})`,prefixHint:`裸键作用于当前聚焦面板;少量单次快捷键覆盖高频 Rove 操作;{prefix} 打开命令层(第二击窗口 {timeout}ms)。Prefix 绑定保持原有的面板作用域和 modal 规则。`,tapPresentation:`点按 Prefix`,tapPresentationHint:`选择完整指南是否同时标记当前屏幕上的入口。`,tapPresentationLocal:`屏幕入口 + 完整指南(默认)`,tapPresentationGuide:`仅完整指南`,prefixDisabled:`已禁用`,fixed:`固定(不可重绑定):{ids}。`,createHint:`还没有覆盖文件。Rove 可以帮你写一份带完整注释的——在你取消注释之前不会改动任何按键。`,createFile:`[enter] 创建 keybindings.yaml`,overridesApplied:`已应用的覆盖`,none:`无`,unbound:`(已解绑)`,defaultKeys:`默认: {keys}`,warnings:`警告`},feedback:{title:`反馈`,hint:"通过 `gh` 向 Rove 仓库发一条 GitHub Discussion。需要 `gh auth login`;分类默认为 Feedback。",titleLabel:`标题`,titlePlaceholder:`简短概括`,descriptionLabel:`描述`,descriptionPlaceholder:`发生了什么?(enter 换行 · tab 跳到发送)`,send:`[enter] 发送到 GitHub Discussions`},...hA}},xA={en:Ar,zh:jr};function $(e,t){return Ae(bA,e,t)}function SA(e,t){return Ae(xA,e,t)}function CA({label:e,value:t,picks:n,onPick:r}){return(0,V.jsx)(`fieldset`,{"aria-label":e,className:`m-0 inline-flex min-w-0 flex-wrap gap-0.5 rounded-sm border-hairline border-line bg-inset p-0.5`,children:n.map(e=>{let n=e.value===t;return(0,V.jsx)(`button`,{type:`button`,"aria-pressed":n,className:Me(`rounded-xs px-2.5 py-1 font-sans text-meta whitespace-nowrap touch:min-h-9`,`focus-visible:outline-1 focus-visible:outline-offset-1 focus-visible:outline-focus`,n?`bg-menu text-ink`:`text-muted hover:bg-hover`),onClick:()=>!n&&r(e.value),children:e.label},e.value)})})}function wA({label:e,value:t,picks:n,onPick:r}){return(0,V.jsxs)(`span`,{className:`relative inline-flex max-w-full min-w-0 text-ink`,children:[(0,V.jsx)(`select`,{"aria-label":e,value:t,className:`max-w-full min-w-0 truncate rounded-sm border-hairline border-line bg-paper py-1.25 pr-7 pl-2.5 font-sans text-meta hover:border-line-active focus-visible:border-line-active focus-visible:outline-none touch:min-h-10`,onChange:e=>{let t=n.find(t=>String(t.value)===e.target.value);t&&r(t.value)},children:n.map(e=>(0,V.jsx)(`option`,{value:e.value,children:e.label},e.value))}),(0,V.jsx)(Ia,{className:`pointer-events-none absolute top-1/2 right-2.5 -translate-y-1/2 text-subtle`})]})}var TA=`${Nn} w-narrow:pt-0`,EA=`dialog relative m-0 flex h-[min(640px,80vh)] w-[min(880px,calc(100vw-32px))] overflow-hidden rounded-md border-hairline border-line bg-surface text-inherit shadow-dialog focus:outline-none motion-safe:animate-rise-in [.is-leaving_&]:animate-sink-out w-narrow:h-dvh w-narrow:w-screen w-narrow:flex-col w-narrow:rounded-none w-narrow:border-0 short:h-[calc(100dvh-24px)]`,DA=`absolute top-3 right-3 z-1 grid size-7 place-items-center rounded-sm text-display leading-none text-muted hover:bg-inset hover:text-ink focus-visible:bg-inset focus-visible:text-ink touch:size-10`,OA=`flex w-56 flex-none flex-col gap-5 overflow-y-auto scrollbar-none [border-right:var(--hairline)_solid_var(--line)] px-2.5 py-4 w-narrow:w-full w-narrow:flex-1 w-narrow:[border-right:none] w-narrow:px-3 w-narrow:py-3`,kA=`m-0 px-2 pb-0.5 font-sans text-title font-semibold normal-nums text-ink`,AA=`flex flex-col gap-0.5`,jA=`m-0 px-2 pb-1 font-mono text-meta font-normal text-subtle`,MA=(e,t)=>`flex items-center rounded-sm px-2 py-1.25 text-left font-sans text-body touch:min-h-10 w-narrow:min-h-11 w-narrow:px-3 ${e?`bg-menu text-ink`:`${t?`text-muted`:`text-ink`} [&:hover]:bg-hover`}`,NA=`ml-auto hidden text-subtle w-narrow:block`,PA=`flex flex-col`,FA=`m-0 pb-2 text-meta text-subtle`,IA=`flex flex-col border-t-hairline border-t-line [&>*]:border-b-hairline [&>*]:border-b-line`,LA=`flex items-center justify-between gap-x-6 gap-y-2 py-3 w-narrow:flex-col w-narrow:items-stretch`,RA=`flex items-center justify-between gap-x-6 py-3`,zA=`flex flex-col gap-3 py-3`,BA=`flex min-w-0 flex-1 flex-col gap-0.5`,VA=`text-body text-ink`,HA=`text-meta text-muted [&_a]:text-accent`,UA=`max-w-90 min-w-0 truncate font-mono text-meta text-muted [overflow-wrap:anywhere]`,WA=`m-0 py-3 text-body text-muted`,GA=`rounded-sm border-hairline border-line bg-paper px-2.5 py-1.5 font-sans text-body text-ink focus-visible:border-line-active focus-visible:outline-none`,KA=`${GA} w-24 text-right`,qA=`flex flex-col gap-1.5`,JA=`text-meta font-medium text-muted`,YA=`min-h-30 max-h-[50vh] leading-[1.45]`,XA=`flex flex-wrap items-center justify-end gap-2.5`,ZA=`flex items-center gap-2.5 rounded-sm bg-inset px-3 py-2 text-meta`,QA=`grid grid-cols-[minmax(0,1fr)_104px_72px] items-center gap-3`,$A=`flex flex-col`,ej=`${QA} pb-1.5 pl-7.5 font-sans text-meta font-medium normal-nums text-subtle [&>span:not(:first-child)]:text-center`,tj=`border-b-hairline border-b-line first:border-t-hairline first:border-t-line`,nj=`${QA} group/eng rounded-sm py-1.5 pr-1 pl-0`,rj=`flex min-w-0 items-center gap-2 rounded-sm py-1.5 pr-0 pl-1.5 text-left focus-visible:outline-1 focus-visible:outline-offset-1 focus-visible:outline-focus`,ij=e=>`mx-0.5 ${e?`text-muted`:`text-subtle`}`,aj=`flex min-w-0 flex-col gap-0.5`,oj=e=>`truncate text-body leading-[inherit] font-medium ${e?`text-muted`:`text-ink`}`,sj=`ml-2 text-meta leading-[inherit] font-normal text-subtle`,cj={ready:`bg-success`,attention:`bg-warning`,error:`bg-error`,absent:`bg-subtle`},lj=e=>`inline-flex items-center gap-1.5 text-meta leading-[inherit] ${e===`error`?`text-error`:`text-muted`}`,uj=e=>`size-1.75 flex-none rounded-full ${cj[e]}`,dj=`flex justify-center`,fj=`rounded-full bg-accent-soft px-2.5 py-0.5 font-sans text-meta font-medium normal-nums capitalize text-accent`,pj=`rounded-full border-hairline border-line px-2.5 py-0.5 text-meta leading-[inherit] whitespace-nowrap text-muted opacity-0 transition-opacity duration-120 ease-[ease] group-hover/eng:opacity-100 group-focus-within/eng:opacity-100 hover:border-line-active hover:text-ink motion-reduce:transition-none touch:opacity-100`,mj=`mt-0 mr-1 mb-3 ml-7 flex flex-col gap-2.5 px-1.5 py-1`,hj=`m-0 grid grid-cols-[max-content_minmax(0,1fr)] gap-x-3.5 gap-y-1.5 text-meta leading-[1.5]`,gj=`text-subtle`,_j=e=>`m-0 wrap-anywhere ${e?`text-warning`:`text-ink`}`,vj=`flex items-center gap-2`,yj=`flex-1 px-2 py-1.25`,bj=`text-meta leading-[inherit] text-success`,xj=`flex items-center gap-3 py-2.5`,Sj=`flex min-w-0 flex-1 flex-col gap-0.5`,Cj=(e=!1)=>`overflow-hidden text-ellipsis text-meta text-muted ${e?`whitespace-normal`:`whitespace-nowrap`}`,wj=`flex flex-col gap-1 py-3`,Tj=`flex items-baseline gap-3`,Ej=`flex flex-col gap-2.5 pt-2`,Dj=`grid grid-cols-[repeat(auto-fill,minmax(96px,1fr))] gap-2`,Oj=`m-0 pb-1.5 text-meta font-medium text-subtle`,kj=e=>e?`border-accent bg-accent-soft`:`border-line hover:bg-hover`,Aj=`flex h-9 overflow-hidden rounded-xs border-hairline`,jj=`flex w-2/5 flex-col gap-0.75 p-1`,Mj=`flex min-w-0 flex-1 flex-col gap-0.75 p-1`,Nj=`h-0.75 rounded-xs`,Pj=`mt-auto flex gap-0.75`,Fj=`size-1 rounded-xs`,Ij=`flex min-w-0 items-baseline gap-1.5 font-sans text-meta`,Lj=`group relative h-4.5 w-7.5 flex-none justify-self-center rounded-full border-hairline border-line bg-inset transition-[background,border-color] duration-120 ease-[ease] aria-checked:border-accent aria-checked:bg-accent motion-reduce:transition-none`,Rj=`absolute top-0.5 left-0.5 size-3 rounded-full bg-muted transition-[transform,background] duration-120 ease-[ease] group-aria-checked:[transform:translateX(12px)] group-aria-checked:bg-paper motion-reduce:transition-none`;function zj({on:e,...t}){return(0,V.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":e,className:Lj,...t,children:(0,V.jsx)(`span`,{className:Rj})})}function Bj(e){return(0,V.jsxs)(`section`,{className:PA,children:[e.title&&(0,V.jsx)(`h2`,{className:`m-0 pb-1.5 font-sans text-meta font-medium normal-nums text-muted`,children:e.title}),e.hint&&(0,V.jsx)(`p`,{className:`m-0 pb-2 text-meta text-subtle`,children:e.hint}),(0,V.jsx)(`div`,{className:IA,children:e.children})]})}function Vj(e){let t=(0,V.jsxs)(`div`,{className:BA,children:[(0,V.jsx)(`span`,{id:e.labelId,className:VA,children:e.label}),e.hint&&(0,V.jsx)(`span`,{className:`text-meta text-muted [&_a]:text-accent`,children:e.hint})]});return e.stack?(0,V.jsxs)(`div`,{className:zA,children:[t,e.children]}):(0,V.jsxs)(`div`,{className:e.inline?RA:LA,children:[t,e.children&&(0,V.jsx)(`div`,{className:`flex min-w-0 flex-none items-center justify-end gap-2 w-narrow:justify-start`,children:e.children})]})}function Hj(e){let t=(0,g.useId)();return(0,V.jsx)(Vj,{label:e.label,hint:e.hint,labelId:t,inline:!0,children:(0,V.jsx)(zj,{on:e.checked,"aria-labelledby":t,disabled:e.disabled,onClick:()=>e.onChange(!e.checked)})})}var Uj=36;function Wj(e){let t=e.picks.length<=4&&e.picks.reduce((e,t)=>e+t.label.length,0)<=Uj?CA:wA;return(0,V.jsx)(Vj,{label:e.label,hint:e.hint,children:(0,V.jsx)(t,{label:e.label,value:e.value,picks:e.picks,onPick:e.onPick})})}function Gj(e){return(0,V.jsx)(Vj,{label:e.label,hint:e.note,children:(0,V.jsx)(`span`,{className:UA,children:e.value})})}var Kj=`flex items-baseline justify-between`,qj=`[&_b]:mr-2.5`,Jj=`my-2.5 flex flex-col`,Yj=e=>`flex gap-3 rounded-sm px-2 py-1 text-left text-[length:var(--fs-body)] ${e?`bg-menu`:``}`,Xj=`min-w-[14ch]`,Zj=`whitespace-nowrap text-[length:var(--fs-meta)] text-warning`,Qj=`rail-tight:hidden`,$j=`[&_h2]:mx-0 [&_h2]:mt-3.5 [&_h2]:mb-1 [&_h2]:text-[length:var(--fs-body)]`,eM=`max-h-[55vh] overflow-x-hidden overflow-y-auto`,tM=`mr-auto text-[length:var(--fs-meta)]`,nM=`text-[length:var(--fs-body)] leading-[1.55] wrap-anywhere [&_h3]:mx-0 [&_h3]:mt-3 [&_h3]:mb-1.5 [&_h3]:font-sans [&_h3]:text-meta [&_h3]:font-medium [&_h3]:normal-nums [&_h3]:text-muted [&_h3:first-child]:mt-0 [&_ul]:m-0 [&_ul]:pl-4.5 [&_li+li]:mt-2 [&_p]:mx-0 [&_p]:mt-0 [&_p]:mb-2 [&_a]:text-accent [&_a]:underline [&_a]:underline-offset-2 [&_code]:rounded-sm [&_code]:bg-inset [&_code]:px-1 [&_code]:py-0 [&_code]:font-mono [&_code]:text-meta [&_code]:font-normal [&_code]:normal-nums`,rM=`mt-3`,iM=e=>`rounded-sm px-2 py-1.25 ${e?`bg-menu`:``}`,aM=`flex items-baseline gap-2 text-[length:var(--fs-body)]`,oM=`flex items-baseline justify-between gap-2`,sM=`font-mono`,cM=`truncate`,lM=`mt-4 text-[length:var(--fs-meta)]`;function uM(e){return e.replace(/\[`[0-9a-f]{7,40}`\]\([^)]*\)\s*/g,``).replace(/\s+[—-]\s+\[@[^\]]+\]\([^)]*\)\s*$/,``).trim()}function dM(e){let t=[],n=(e,n)=>t.push({kind:e,text:n,id:t.length});for(let r of e.split(/\r?\n/)){let e=r.trimEnd();if(e.trim()===``)continue;let i=/^#{1,6}\s+(.*)$/.exec(e);if(i){n(`heading`,i[1]??``);continue}let a=/^\s*[-*]\s+(.*)$/.exec(e);if(a){n(`item`,a[1]??``);continue}let o=t.at(-1);o&&o.kind!==`heading`?o.text=`${o.text} ${e.trim()}`:n(`para`,e.trim())}return t.map(e=>e.kind===`item`?{...e,text:uM(e.text)}:e)}var fM=/\[([^\]]+)\]\((https?:\/\/[^)\s]+)\)|`([^`]+)`|\*\*([^*]+)\*\*/g;function pM(e){let t=[],n=0;for(let r of e.matchAll(fM)){let i=r.index??0;i>n&&t.push(e.slice(n,i));let[a,o,s,c,l]=r;o!==void 0&&s!==void 0?t.push((0,V.jsx)(`a`,{href:s,target:`_blank`,rel:`noopener noreferrer`,children:pM(o)},i)):c===void 0?l!==void 0&&t.push((0,V.jsx)(`b`,{children:l},i)):t.push((0,V.jsx)(`code`,{children:c},i)),n=i+a.length}return n<e.length&&t.push(e.slice(n)),t}function mM({body:e}){let t=dM(e),n=[],r=[],i=()=>{r.length>0&&n.push((0,V.jsx)(`ul`,{children:r},`ul-${n.length}`)),r=[]};for(let e of t){if(e.kind===`item`){r.push((0,V.jsx)(`li`,{children:pM(e.text)},e.id));continue}i(),n.push(e.kind===`heading`?(0,V.jsx)(`h3`,{children:e.text},e.id):(0,V.jsx)(`p`,{children:pM(e.text)},e.id))}return i(),(0,V.jsx)(`div`,{className:nM,children:n})}var hM=`page min-h-0 flex-1 rounded-md border-hairline border-line bg-paper px-4.5 py-3.5 focus:outline-none`,gM=`${hM} overflow-y-auto`,_M=`page-title mx-0 mt-0 mb-1.5 font-sans text-title font-bold normal-nums`,vM=`flex items-baseline justify-between gap-4 [&_.page-title]:m-0`,yM=e=>`min-w-0 truncate text-meta ${e?``:`leading-[inherit]`}`,bM=`flex flex-wrap items-center gap-2`,xM={row:`touch:after:-inset-x-0.75 touch:after:-inset-y-0.5`,kanban:`touch:after:-inset-x-0.75 touch:after:-top-1.5 touch:after:-bottom-1`,header:`touch:after:-inset-x-0.75 touch:after:-top-2.5 touch:after:-bottom-1.25`},SM=`mt-2.5 flex flex-col gap-1.5`,CM=e=>`flex cursor-pointer flex-col gap-0.5 rounded-sm px-2.5 py-1.5 ${e?`bg-menu`:``}`,wM=`flex min-w-0 items-baseline gap-2.5`,TM=`whitespace-nowrap text-muted`,EM=`flex gap-2.5 pl-[4ch] text-meta leading-[inherit] text-muted`,DM=`min-w-0 flex-1 truncate`,OM=`flex flex-col px-1.5 pb-2`,kM=`flex flex-col border-t-hairline border-t-line px-1.5 pt-0.5 pb-0.5`,AM=`relative flex flex-col`,jM=e=>`flex items-center rounded-sm px-2 py-0.75 text-left touch:min-h-10 ${e?`bg-menu text-ink`:`text-muted [&:hover]:bg-hover`}`,MM=`ml-auto -mr-[4.5px] w-5 text-center font-sans text-display leading-none font-normal text-accent normal-nums`,NM=`mr-[7px] size-3.5 flex-none fill-none stroke-current stroke-[1.75] [stroke-linecap:round] [stroke-linejoin:round]`,PM=_(null),FM=(e,t)=>e.replace(/\{(\w+)\}/g,(e,n)=>t[n]??e),IM=e=>`https://github.com/Sma1lboy/rove/releases/tag/v${e}`;function LM(){return B()===`zh`?Fr:Pr}function RM(e,t){return e.request(`update.check`,{force:!0,locale:Ee.get(),channel:t}).then(e=>(PM.set(e),!0),()=>!1)}function zM(){let e=LM(),t=v(PM),{prefs:n}=R_();return!n.updateNotify||!t?.info?.hasUpdate?null:(0,V.jsxs)(`button`,{type:`button`,className:`${U} text-muted ${Zj} ${Ge}`,title:FM(e.chip,{version:t.info.latest}),onClick:()=>ya(`update`),children:[`↑`,(0,V.jsxs)(`span`,{className:Qj,children:[` `,t.info.latest]})]})}function BM({client:e}){let t=LM(),n=v(PM),[r,i]=(0,g.useState)(!1),[a,o]=(0,g.useState)(`release`),[s,c]=(0,g.useState)(null),l=(0,g.useRef)(null);(0,g.useEffect)(()=>{l.current?.focus(),RM(e).finally(()=>i(!0))},[e]);let u=n?.info??null,d=n?.current??``,f=u?.latest??d,p=u?.hasUpdate===!0,m=r&&u===null,h=r&&u!==null&&!p,_=n?.notes??[],y=_[0]?.url??(f?IM(f):null),b=[{id:`release`,key:`R`,label:t.actions.openRelease,detail:y??t.releaseUrlUnavailable},{id:`close`,key:`Q`,label:t.actions.close,detail:t.actions.closeDetail}],x=e=>{if(e===`close`)return un.set(null);c(y&&window.open(y,`_blank`,`noopener`)!==null?t.statusReleaseOpened:t.statusReleaseError)};return(0,V.jsxs)(`div`,{className:gM,tabIndex:0,ref:l,onKeyDown:e=>{if(e.ctrlKey&&!e.metaKey&&!e.altKey&&e.key.toLowerCase()===`c`&&!window.getSelection()?.toString())return e.preventDefault(),x(`close`);if(e.metaKey||e.ctrlKey||e.altKey)return;let t=b.findIndex(e=>e.id===a);if(e.key===`j`||e.key===`ArrowDown`)o(b[(t+1)%b.length]?.id??`close`);else if(e.key===`k`||e.key===`ArrowUp`)o(b[(t-1+b.length)%b.length]?.id??`close`);else if(e.key===`Enter`)x(a);else if(e.key===`r`)x(`release`);else if(e.key===`q`||e.key===`Escape`)x(`close`);else return;e.preventDefault()},children:[(0,V.jsxs)(`div`,{className:Kj,children:[(0,V.jsx)(`h1`,{className:_M,children:t.pageTitle}),(0,V.jsx)(`button`,{type:`button`,className:`${en} mono`,onClick:()=>x(`close`),children:ts()?z(`dialog.close`):t.closeHint})]}),(0,V.jsxs)(`p`,{className:`mono ${qj}`,children:[(0,V.jsx)(`span`,{className:`text-muted`,children:t.current}),` `,(0,V.jsxs)(`b`,{children:[`v`,d]}),` `,(0,V.jsx)(`span`,{className:`text-muted`,children:t.latest}),` `,m?(0,V.jsx)(`b`,{className:`text-muted`,children:t.latestUnknown}):r?(0,V.jsxs)(`b`,{className:p?`text-warning`:`text-success`,children:[`v`,f]}):(0,V.jsx)(`span`,{className:`text-muted`,children:`…`})]}),m&&(0,V.jsx)(`p`,{className:`text-muted`,children:t.registryRetry}),h&&(0,V.jsx)(`p`,{className:`text-success`,children:t.upToDate}),p&&(0,V.jsx)(`p`,{className:`mono text-muted`,children:`rove update`}),(0,V.jsx)(`div`,{className:Jj,children:b.map(e=>(0,V.jsxs)(`button`,{type:`button`,className:Yj(a===e.id),onClick:()=>x(e.id),children:[(0,V.jsxs)(`span`,{className:`mono keys-only text-accent`,children:[`[`,e.key,`]`]}),(0,V.jsx)(`span`,{className:Xj,children:e.label}),(0,V.jsx)(`span`,{className:`text-muted`,children:e.detail})]},e.id))}),s&&(0,V.jsx)(`p`,{className:`mono text-accent`,children:s}),p&&(0,V.jsx)(`p`,{className:`mono text-muted`,children:FM(t.changesSectionHeader,{from:d,to:f})}),!r&&(0,V.jsx)(`p`,{className:`text-muted`,children:t.loadingNotes}),r&&p&&_.length===0&&(0,V.jsx)(`p`,{className:`text-muted`,children:t.notesUnavailable}),_.map(e=>(0,V.jsxs)(`section`,{className:$j,children:[(0,V.jsxs)(`h2`,{className:`mono`,children:[`v`,e.version]}),(0,V.jsx)(mM,{body:e.body})]},e.version))]})}var VM=`rove.whatsNewSeenVersion`,HM=e=>e.split(/[.-]/).slice(0,3).map(Number),UM=(e,t)=>{let[n,r]=[HM(e),HM(t)];for(let e=0;e<3;e++)if((n[e]??0)!==(r[e]??0))return(n[e]??0)>(r[e]??0);return!1};function WM(e,t){let n=localStorage.getItem(VM);localStorage.setItem(VM,t),!(!n||!UM(t,n))&&e.request(`release.notes`,{version:t.replace(/-.*$/,``),locale:Ee.get()}).then(e=>W.set((0,V.jsx)(GM,{from:n,to:t,notes:e.notes})),()=>W.set((0,V.jsx)(GM,{from:n,to:t,notes:null})))}function GM(e){let t=LM(),n=(0,g.useRef)(null);return(0,g.useEffect)(()=>n.current?.focus(),[]),(0,g.useEffect)(()=>{let e=e=>{e.key===`q`&&W.set(null)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),(0,V.jsxs)(cr,{title:t.whatsNew.title,wide:!0,children:[(0,V.jsx)(`p`,{className:`text-muted`,children:FM(t.whatsNew.upgraded,{from:e.from,to:e.to})}),(0,V.jsx)(`div`,{className:eM,children:e.notes?(0,V.jsx)(mM,{body:e.notes.body}):(0,V.jsx)(`p`,{className:`text-muted`,children:t.whatsNew.notesUnavailable})}),(0,V.jsxs)(`div`,{className:rn,children:[(0,V.jsx)(`span`,{className:`mono text-muted ${tM} touch:hidden!`,children:z(`whatsNew.keys`)}),(0,V.jsx)(`a`,{className:en,href:e.notes?.url??IM(e.to),target:`_blank`,rel:`noopener noreferrer`,children:z(`whatsNew.openRelease`)}),(0,V.jsx)(`button`,{ref:n,type:`button`,className:Pe(),onClick:()=>W.set(null),children:z(`whatsNew.continue`)})]})]})}var KM=(e,t)=>e.replace(`{version}`,t);function qM({client:e}){let t=LM(),n=v(PM),{prefs:r}=R_(),[i,a]=(0,g.useState)(`idle`),o=()=>{a(`checking`),RM(e,r.updateChannel).then(e=>a(e?`done`:`failed`))},s=t=>{a(`idle`),L_(e,`updateChannel`,t)},c=n?.info??null,l=i===`failed`||i===`done`&&c===null,u=i===`done`&&n&&c?c.hasUpdate?KM(t.available,c.latest):t.upToDate:l?t.latestUnknown:void 0,d=l?`text-muted`:c?.hasUpdate?`text-warning`:`text-success`;return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Wj,{label:$(`general.updateChannelTitle`),hint:$(`general.updatesHint`),value:r.updateChannel,picks:dA.map(e=>({value:e,label:$(`general.updateChannelName.${e}`)})),onPick:s}),(0,V.jsx)(Hj,{label:$(`general.updateNotify`),hint:$(`general.updateNotifyHint`),checked:r.updateNotify,onChange:t=>void L_(e,`updateNotify`,t)}),(0,V.jsxs)(Vj,{label:$(`general.updates`),hint:$(`general.updateCheckHint`),children:[i===`done`&&c?.hasUpdate&&(0,V.jsx)(H,{variant:`action`,onClick:()=>ya(`update`),children:$(`general.updateOpenPage`)}),(0,V.jsx)(H,{variant:`action`,disabled:i===`checking`,onClick:o,children:$(i===`checking`?`general.updateChecking`:`general.updateCheckButton`)})]}),u&&(0,V.jsx)(Vj,{label:(0,V.jsx)(`span`,{className:d,children:u}),hint:c?.hasUpdate?(0,V.jsx)(`code`,{className:`font-mono`,children:`rove update`}):void 0,children:i===`done`&&n&&c&&(0,V.jsx)(`span`,{className:`max-w-90 min-w-0 truncate font-mono text-meta text-muted [overflow-wrap:anywhere]`,title:`${t.latest} v${c.latest}`,children:`${t.current} v${n.current} · ${t.latest} v${c.latest}`})})]})}function JM({client:e}){let[t,n]=(0,g.useState)(()=>Hs(e,`daemon.info`)??null);return(0,g.useEffect)(()=>{Ws(e,`daemon.info`).then(n,()=>n(null))},[e]),(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(Bj,{title:z(`settings.about.groupRove`),children:[t?.daemonVersion&&(0,V.jsx)(Vj,{label:z(`settings.about.daemon`),hint:z(t.stale?`settings.about.daemonStale`:`settings.about.daemonCurrent`,{version:t.daemonVersion})}),(0,V.jsx)(qM,{client:e})]}),(0,V.jsx)(Bj,{title:z(`settings.about.browser`),children:(0,V.jsx)(Vj,{label:z(`settings.about.signOut`),hint:z(`settings.about.browserHint`),children:(0,V.jsx)(H,{variant:`action`,onClick:()=>void Na().then(()=>window.location.reload()),children:z(`settings.about.signOut`)})})})]})}async function YM(e,t){let{taskId:n}=await e.client.request(`task.openScratch`);await VC(e,n,{kind:`engine`,prompt:t}),Cn()}var XM=_(null);function ZM({theme:e,mode:t}){let n=e[t],r=(e,t)=>({background:e,width:t});return(0,V.jsxs)(`span`,{className:Aj,style:{background:n.background,borderColor:n.border},"aria-hidden":!0,children:[(0,V.jsxs)(`span`,{className:jj,style:{background:n.backgroundPanel},children:[(0,V.jsx)(`span`,{className:Nj,style:r(n.primary,`70%`)}),(0,V.jsx)(`span`,{className:Nj,style:r(n.textMuted,`85%`)}),(0,V.jsx)(`span`,{className:Nj,style:r(n.textMuted,`55%`)})]}),(0,V.jsxs)(`span`,{className:Mj,children:[(0,V.jsx)(`span`,{className:Nj,style:r(n.text,`90%`)}),(0,V.jsx)(`span`,{className:Nj,style:r(n.textMuted,`65%`)}),(0,V.jsx)(`span`,{className:Nj,style:r(n.accent??n.primary,`40%`)}),(0,V.jsx)(`span`,{className:Pj,children:[n.success,n.warning,n.error,n.info].map((e,t)=>(0,V.jsx)(`span`,{className:Fj,style:{background:e}},t))})]})]})}function QM(e){return(0,V.jsxs)(H,{variant:`card`,"aria-pressed":e.active,className:kj(e.active),onMouseEnter:()=>k_.set(e.theme),onFocus:()=>k_.set(e.theme),onClick:e.onClick,children:[(0,V.jsx)(ZM,{theme:e.theme,mode:e.mode}),(0,V.jsxs)(`span`,{className:Ij,children:[(0,V.jsx)(`span`,{className:`truncate text-ink`,children:e.theme.name}),e.tag&&(0,V.jsx)(`span`,{className:`text-subtle`,children:e.tag})]})]})}function $M({children:e}){return(0,V.jsx)(`div`,{className:Dj,onMouseLeave:()=>k_.set(null),onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||k_.set(null)},children:e})}function eN(e){let{model:t}=e,{client:n}=t,r=v(XM),[i,a]=(0,g.useState)(null),[o,s]=(0,g.useState)(null),[c,l]=(0,g.useState)(!1),[u,d]=(0,g.useState)(!1);(0,g.useEffect)(()=>()=>k_.set(null),[]),(0,g.useEffect)(()=>void I_(n).catch(()=>void 0),[n]),(0,g.useEffect)(()=>{XM.get()===null&&n.request(`theme.hosted`).then(e=>XM.set(e),()=>XM.set({themes:[],dir:null}))},[n]);let f=e=>{l(!1),YM(t,z(`prefs.themeAgentPrompt`,{dir:e})).catch(()=>l(!0))},p=r?.dir??null,m=async e=>{a(e),s(null);try{await n.request(`theme.install`,{name:e}),await I_(n),await L_(n,`theme`,e)}catch{s(e)}finally{a(null)}},h=new Set(e.themes.map(e=>e.name)),_=(r?.themes??[]).filter(e=>!h.has(e.name));return(0,V.jsxs)(Vj,{label:e.label,hint:z(`prefs.themePreviewHint`),stack:!0,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`p`,{className:Oj,children:z(`prefs.themeInstalled`)}),(0,V.jsx)($M,{children:e.themes.map(t=>(0,V.jsx)(QM,{theme:t,mode:e.mode,active:t.name===e.value,tag:t.bundled?void 0:z(`prefs.themeUser`),onClick:()=>t.name!==e.value&&void L_(n,`theme`,t.name)},t.name))})]}),_.length>0&&(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(H,{className:`inline-flex items-center gap-1.5`,"aria-expanded":u,onClick:()=>d(!u),children:[(0,V.jsx)(Ia,{right:!u}),u?z(`prefs.themeHide`):z(`prefs.themeBrowse`,{count:_.length})]}),u&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`p`,{className:`m-0 pb-1.5 text-meta font-medium text-subtle mt-2.5`,children:z(`prefs.themeMoreHint`)}),(0,V.jsx)($M,{children:_.map(t=>(0,V.jsx)(QM,{theme:t,mode:e.mode,active:!1,tag:i===t.name?z(`prefs.themeInstalling`):o===t.name?z(`prefs.themeInstallFailed`):z(`prefs.themeGet`),onClick:()=>i===null&&void m(t.name)},t.name))})]})]}),p&&(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2.5`,children:[(0,V.jsx)(H,{variant:`action`,onClick:()=>f(p),children:z(`prefs.themeAgent`)}),(0,V.jsx)(`span`,{className:`text-meta text-muted [&_a]:text-accent`,children:z(c?`prefs.themeAgentFailed`:`prefs.themeAgentHint`)})]})]})}var tN=_({}),nN=``,rN=`(prefers-color-scheme: dark)`;function iN(e){let t=window.matchMedia(rN);return t.addEventListener(`change`,e),()=>t.removeEventListener(`change`,e)}function aN(){return(0,g.useSyncExternalStore)(iN,()=>window.matchMedia(rN).matches)}function oN(){let e=aN();return __(R_().prefs.themeMode,e)}function sN(e){let t=oN(),n=R_();(0,g.useEffect)(()=>{if(!n.loaded||n.prefs.taskColors!==`on`)return;let r=`${n.prefs.theme}/${t}`;r!==nN&&(nN=r,tN.set({}));let i=()=>{let i=tN.get(),a=e.tasks.get(),o=[...a?.tasks??[],...a?.archived??[]].map(e=>e.id).filter(e=>!(e in i));o.length!==0&&e.client.request(`theme.taskColors`,{theme:n.prefs.theme,mode:t,taskIds:o}).then(e=>{nN===r&&tN.set({...tN.get(),...e.colors})}).catch(()=>void 0)};return i(),e.tasks.subscribe(i)},[e,t,n.loaded,n.prefs.taskColors,n.prefs.theme])}function cN(e){let t=R_(),n=v(tN);return e&&t.prefs.taskColors===`on`?n[e]:void 0}var lN={themeMode:{dark:`appearance.modeDark`,light:`appearance.modeLight`,auto:`appearance.modeAuto`},focusAccent:{primary:`general.accentPrimary`,success:`general.accentSuccess`,info:`general.accentInfo`},splitStyle:{box:`general.splitBox`,line:`general.splitLine`,rail:`general.splitRail`,rule:`general.splitRule`},railFold:{glyphs:`general.railFoldGlyphs`,initials:`general.railFoldInitials`,hairline:`general.railFoldHairline`},workingBorder:{flow:`appearance.borderFlow`,still:`appearance.borderStill`},glyphSet:{braille:`appearance.glyphsBraille`,starburst:`appearance.glyphsStarburst`,ascii:`appearance.glyphsAscii`},runningTitle:{shimmer:`appearance.titleShimmer`,still:`appearance.titleStill`}};function uN({model:e}){let{client:t}=e,n=R_(),r=oN(),i=v(RT),a=(e,n)=>void L_(t,e,n),o=(e,t,r)=>(0,V.jsx)(Wj,{label:$(t),hint:r,value:n.prefs[e],picks:z_(n,e).map(t=>({value:t,label:e===`themeMode`&&t===`auto`?z(`prefs.modeAuto`):$(lN[e]?.[String(t)]??String(t))})),onPick:t=>a(e,t)}),s=(e,t,r)=>(0,V.jsx)(Hj,{label:$(t),hint:r,checked:e===`transparent`?n.prefs.transparent:n.prefs[e]===`on`,onChange:t=>a(e,e===`transparent`?t:t?`on`:`off`)});return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(Bj,{children:[(0,V.jsx)(eN,{model:e,label:$(`general.theme`),themes:n.themes,value:n.prefs.theme,mode:r}),o(`themeMode`,`general.themeMode`)]}),(0,V.jsxs)(Bj,{title:z(`settings.appearance.groupColours`),children:[o(`focusAccent`,`general.focusAccent`,$(`general.focusAccentHint`)),s(`taskColors`,`general.taskColors`,z(`settings.appearance.taskColorsNote`)),s(`colorblind`,`general.colorblind`,z(`settings.appearance.colorblindNote`))]}),(0,V.jsxs)(Bj,{title:z(`settings.appearance.groupTasks`),children:[o(`workingBorder`,`general.workingBorder`,z(`settings.appearance.workingBorderNote`)),o(`runningTitle`,`general.runningTitle`),o(`glyphSet`,`general.glyphSet`),o(`railFold`,`general.railFold`,$(`general.railFoldHint`)),(0,V.jsx)(Wj,{label:z(`settings.appearance.railGroup`),value:i,picks:IT.map(e=>({value:e,label:z(e===`state`?`settings.appearance.railGroupState`:`settings.appearance.railGroupProject`)})),onPick:zT})]}),(0,V.jsxs)(Bj,{title:z(`settings.appearance.groupTerminal`),hint:z(`prefs.terminalOnly`),children:[s(`transparent`,`general.transparent`),o(`splitStyle`,`general.splitStyle`)]})]})}function dN(e,t,n){if(t===`offline`)return`offline`;if(t===`unsupported`||t===`mismatch`)return`outdated`;if(!e)return`loading`;let r=e.status;return r?r.gh?r.account?r.account===n?`same`:`different`:`signedOut`:`noGh`:e.reason===`failed`||!e.reason?`failed`:e.reason}var fN=2e3,pN=e=>e?.login?.state===`pending`||e?.login?.state===`syncing`;function mN(e){let{client:t}=e,n=CE(e),[r,i]=(0,g.useState)({}),a=n.flatMap(e=>e.state===`online`?[e.alias]:[]).join(`
114
+ `,1)[0]??``;function $D(e){return(0,V.jsx)(`ul`,{className:`${Qt} ${e.className}`,children:e.items.map((t,n)=>(0,V.jsx)(`li`,{children:(0,V.jsxs)(H,{variant:`row`,tabIndex:-1,"aria-pressed":n===e.at,className:$t({cursor:n===e.at,accent:!1}),onMouseDown:t=>{t.preventDefault(),e.onPick(n)},children:[(0,V.jsxs)(`span`,{className:`text-accent`,children:[`@`,t.name]}),(0,V.jsxs)(`span`,{className:`text-muted`,children:[` `,QD(t.text)]})]})},t.name))})}function eO(e){let t=WD(),[n,r]=(0,g.useState)(0),[i,a]=(0,g.useState)(0),[o,s]=(0,g.useState)(null),c=(0,g.useRef)(null),l=YD(e.value,Math.min(n,e.value.length)),u=l?XD(t,l.query):[],d=l!==null&&u.length>0&&o!==l.start,f=Math.min(i,Math.max(0,u.length-1));(0,g.useLayoutEffect)(()=>{let t=c.current,n=e.area.current;t===null||!n||(c.current=null,n.setSelectionRange(t,t),r(t))});let p=t=>{let n=u[t];if(!l||!n)return;let r=ZD(e.value,l,n);c.current=r.caret,a(0),e.onChange(r.text)},m=e=>{if(!d||e.nativeEvent.isComposing)return!1;if(e.key===`ArrowDown`||e.key===`ArrowUp`)a(Math.max(0,Math.min(u.length-1,f+(e.key===`ArrowDown`?1:-1))));else if(e.key===`Tab`&&!e.shiftKey||e.key===`Enter`&&!e.shiftKey&&!e.ctrlKey&&!e.metaKey)p(f);else if(e.key===`Escape`)s(l?.start??null),e.stopPropagation();else return!1;return e.preventDefault(),!0};return{list:d?(0,V.jsx)($D,{items:u,at:f,className:e.listClassName??``,onPick:p}):null,field:{onChange:t=>{r(t.target.selectionStart),a(0),e.onChange(t.target.value)},onSelect:e=>r(e.currentTarget.selectionStart),onKeyDown:t=>{m(t)||!e.onEnter||t.key!==`Enter`||t.shiftKey||t.nativeEvent.isComposing||(t.preventDefault(),e.onEnter())}}}}function tO(e,t){gn(e,void 0,t)}function nO(){gn(void 0,void 0,void 0,void 0,!0)}var rO=`rove.web.newSession.worktree`,iO=``;function aO({model:e,seed:t}){let n=t.repo;B();let r=v(e.selection).taskId,i=e.tasks.get()?.tasks.find(e=>e.id===r)?.repo,a=NC(e,n??i,t.engine),o=Hs(e,`repos.list`)?.repos,s=e=>t.ungrouped?void 0:(t.machine?void 0:n)??i??e?.[0],[c,l]=(0,g.useState)(o??[]),[u,d]=(0,g.useState)(()=>Hs(e,`fs.subdirs`,{path:`~/`})?.home??``),[f,p]=(0,g.useState)(()=>RD(s(o),t)),[m,h]=(0,g.useState)(()=>Object.fromEntries(f.flatMap(t=>{let n=Hs(e,`repo.probe`,{path:t});return n?[[t,n]]:[]}))),_=(0,g.useRef)(new Set),[y,b]=(0,g.useState)(t.ungrouped===!0),x=()=>{b(!0),p([])},[S,C]=(0,g.useState)(()=>zD(s(o),t)),[w,T]=(0,g.useState)(``),[E,D]=(0,g.useState)(``),[O,k]=(0,g.useState)(()=>(t.prompt!==void 0&&(iO=t.prompt),iO)),A=e=>{iO=e,k(e)},[j,ee]=(0,g.useState)(``),[M,N]=(0,g.useState)(``),[P,F]=(0,g.useState)(!1),[I,te]=(0,g.useState)(``),[L,ne]=(0,g.useState)(()=>t.worktree??localStorage.getItem(rO)!==`0`),re=e=>{localStorage.setItem(rO,e?`1`:`0`),ne(e)},[ie,R]=(0,g.useState)(null),{attachments:ae,attach:oe,remove:se,clear:ce}=Qo(e,R),le=(0,g.useRef)(null),ue=CE(e),[de,fe]=(0,g.useState)(t.machine??``),pe=de!==``,me=pe?null:Jo(e=>void oe(e)),he=ue.find(e=>e.alias===de)?.hostLabel||de,ge=lD(e,de);cD(e,ue);let[_e,ve]=(0,g.useState)(null),[ye,be]=(0,g.useState)(``);(0,g.useEffect)(()=>{Promise.all([Ws(e,`repos.list`),Ws(e,`fs.subdirs`,{path:`~/`})]).then(([e,n])=>{l(e.repos),d(n.home);let r=s(e.repos);p(e=>e.length>0||!r?e:RD(r,t)),C(e=>({...e,...zD(r,t)}))}).catch(()=>{})},[e,n]);let xe=!pe&&!L&&f.length===1,Se=f[0]??``;(0,g.useEffect)(()=>{for(let t of f)_.current.has(t)||(_.current.add(t),Ws(e,`repo.probe`,{path:t}).then(e=>h(n=>({...n,[t]:e}))).catch(()=>{}))},[e,f]),(0,g.useEffect)(()=>{!pe||!ge.loaded||de!==t.machine||ve(e=>e??rD(n,ge.repos))},[ge.loaded]),(0,g.useEffect)(()=>le.current?.focus(),[]);let Ce=!pe&&!y&&!xe,we=_D(a,Ce),Te=a.engines.find(e=>e.id===a.engine),Ee=Ts(Te,z(`newSession.modelDefault`)),De=Es(Te,z(`newSession.effortDefault`)),Oe=Ee.some(e=>e.id===j)?j:``,ke=De.some(e=>e.id===M)?M:``,Ae=async t=>{R(null),F(!0),te(z(`newSession.cloning`,{source:t}));try{let n=us(ls((localStorage.getItem(`rove.web.cloneParent`)||`~/`).trim(),u)),r=await e.client.request(`repo.clone`,{url:t,parentDir:n},te);l(e=>e.includes(r.path)?e:[...e,r.path]),p(e=>e.includes(r.path)?e:Ms(e,r.path)),b(!1),D(``)}catch(e){R(hD(e))}finally{F(!1),te(``)}},je=async n=>{if(!_e)return R(z(`newSession.needRepo`));if(n&&!O.trim())return R(z(`newSession.needPrompt`));F(!0),te(_e.clone?z(`newSession.cloningOn`,{source:_e.ref,machine:he}):z(`newSession.startingOn`,{machine:he}));try{let r=await mD(e,{pick:_e,machine:de,engine:a.engine,prompt:O.trim(),begin:n,baseRef:ye});iO=``,hn.set(null),r&&e.selectWhenListed(r),t.retryOf&&r&&HD(e,t.retryOf)}catch(e){R(hD(e))}finally{F(!1),te(``)}},Me=async(n=!0,r)=>{if(R(null),pe)return je(n);if(!Se&&!y)return R(z(`newSession.needRepo`));if((n||r)&&!O.trim())return R(z(`newSession.needPrompt`));F(!0);let i=Xo(O.trim(),ae);try{let o=await Promise.all(f.map(t=>e.client.request(`repo.probe`,{path:t}))),s=o.find(e=>!e.ok);if(s)throw Error(s.reason??s.repo);let c,l;if(y)c=await Fs(e.client.request.bind(e.client),a.engine,O,n);else if(xe)c=await Is(e.client.request.bind(e.client),o[0]?.repo??Se,a.engine,O,n,i);else{let r=await e.client.request(`task.spawn`,Ps({repos:f.map((e,t)=>({repo:o[t]?.repo??e,baseRef:S[e]??``})),branch:w.trim(),engine:a.engine,commandFrom:BD(t,a.engine),engines:n?we.ids:[],prompt:i,begin:n,model:Oe,effort:ke}));c=r.taskIds[0],l=r.groupId}r&&c&&await TD(e.client,c,r,i).then(()=>G(z(`newSession.laterSet`,{time:wD(r)}))).catch(e=>G(hD(e),`error`)),iO=``,ce(),hn.set(null),l?ba(l):c&&e.selectWhenListed(c),t.retryOf&&c&&HD(e,t.retryOf)}catch(e){let t=As(e);t?(iO=``,ce(),hn.set(null),G(e instanceof Error?e.message:String(e),`error`),ba(t)):R(e instanceof Error?e.message:String(e))}finally{F(!1)}},Ne=eO({value:O,onChange:A,area:le,onEnter:()=>void Me()});return(0,V.jsxs)(`div`,{className:wE,children:[(0,V.jsxs)(`div`,{className:TE,children:[(0,V.jsx)(`h1`,{className:`m-0 font-sans text-title font-semibold text-accent`,children:z(`newSession.title`)}),(0,V.jsx)(`p`,{className:`m-0 text-muted`,children:z(`newSession.tagline`)})]}),(0,V.jsxs)(`form`,{className:EE,onSubmit:e=>{e.preventDefault(),Me()},children:[(0,V.jsxs)(`div`,{className:DE,...me?.drop,children:[!pe&&(0,V.jsx)($o,{attachments:ae,onRemove:se}),(0,V.jsx)(`textarea`,{ref:le,className:kE,rows:4,spellCheck:!1,placeholder:z(`newSession.placeholder`),value:O,disabled:P,onPaste:me?.onPaste,...Ne.field}),Ne.list,(0,V.jsxs)(`div`,{className:OE,children:[(0,V.jsx)(`button`,{type:`button`,className:NE(),disabled:P||we.comparing,title:we.comparing?z(`compare.needsPrompt`):void 0,onClick:()=>void Me(!1),children:z(`newSession.createOnly`)}),(0,V.jsx)(`button`,{type:`submit`,className:Pe(),disabled:P,children:z(`newSession.start`)})]})]}),(0,V.jsxs)(`div`,{className:AE,children:[(0,V.jsx)(fD,{machines:ue,value:de,onPick:e=>{fe(e),ve(null),be(``),D(``),R(null),b(!1)}}),(0,V.jsx)(XE,{field:`repo`,title:!pe&&f.length>1?z(`newSession.repoCount`,{count:f.length}):z(`newSession.repo`),label:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(KE,{}),js(pe?_e?[_e.ref]:[]:f)||z(y?`rail.noProject`:`newSession.repo`),_e?.clone&&(0,V.jsxs)(`span`,{className:`text-muted`,children:[` `,z(`newSession.cloneTag`)]})]}),children:t=>(0,V.jsx)(OD,{model:e,saved:pe?ge.repos.map(nD):c,picked:pe?_e?[_e.ref]:[]:f,primary:pe?``:Se,home:pe?``:u,query:E,onQuery:D,onToggle:e=>{if(R(null),!pe)return b(!1),p(t=>Ms(t,e));ve({ref:e,clone:!1}),t()},onClone:e=>pe?ve({ref:e,clone:!0}):void Ae(e),close:t,remote:pe?{name:he,empty:uD(de,ge),blocked:ge.problem!==``}:void 0,ungrouped:pe?void 0:{on:y,pick:x}})}),(0,V.jsx)(gD,{remote:pe,remotePick:_e,remoteBase:ye,onRemoteBase:be,ungrouped:y,inPlace:xe,onToggleWorktree:()=>re(!L),repos:f,probes:m,bases:S,onBase:(e,t)=>C(n=>({...n,[e]:t})),branchName:w,onBranchName:T}),me&&(0,V.jsxs)(Yo,{className:`${NE(ae.length>0)} cursor-pointer`,title:z(`newSession.attachHint`),disabled:P,onFiles:e=>void oe(e),children:[(0,V.jsx)(JE,{}),z(`newSession.attach`)]}),!pe&&!y&&!we.comparing&&(0,V.jsx)(ED,{disabled:P,onSchedule:e=>void Me(!1,e),onInvalid:R}),(0,V.jsx)(`span`,{className:jE}),(0,V.jsx)(vD,{choice:a,picks:we,available:Ce}),!xe&&!pe&&!y&&!we.comparing&&(Ee.length>0||De.length>0)&&(0,V.jsx)(yD,{models:Ee,model:Oe,onModel:ee,efforts:De,effort:ke,onEffort:N})]}),P&&I&&(0,V.jsx)(`p`,{className:`text-muted`,"data-field":`clone-progress`,children:I}),ie&&(0,V.jsxs)(`p`,{className:`text-error`,children:[`※ `,ie]})]}),!pe&&(0,V.jsx)(`button`,{type:`button`,className:`mt-2 self-center px-1.5 py-0.5 text-subtle focus-visible:text-ink touch:mt-0.5 touch:py-2 [&:hover]:text-ink`,onClick:()=>W.set((0,V.jsx)(ID,{model:e,repo:Se||void 0})),children:z(`newSession.moreWays`)})]})}var oO=[`needs`,`working`,`ready`,`idle`],sO=`~state:`;function cO(e){switch(e.rowStatus?.kind){case`attention`:case`needs-input`:case`unseen`:return`needs`;case`busy`:case`running`:return`working`}switch(e.group){case`waiting-on-you`:return`needs`;case`working`:return`working`;case`landing`:case`ready-for-review`:return`ready`}return e.pr?.lifecycle===`open`||e.status===`done`?`ready`:`idle`}var lO=e=>e&&e.kind!==`main`&&!pw(e)?qC(e.repo):void 0;function uO(e,t){let n=mw(e,t.sort),{children:r,nested:i}=yw([{repo:``,label:``,tasks:n}]),a=n.filter(e=>!i.has(e.id)),o=ew(a),s=e=>{let t=[],n=new Set,i=e=>{if(!n.has(e.id)){n.add(e.id),t.push(e);for(let t of r.get(e.id)??[])i(t)}};return i(e),t},c=new Map;for(let e of a){let t=$C(e),n=((t===null?void 0:o.get(t))??[e]).map(s),r=n.flat().map(cO).reduce((e,t)=>oO.indexOf(t)<oO.indexOf(e)?t:e);for(let e of n)for(let t of e)c.set(t.id,r)}return oO.flatMap(e=>{let t=n.filter(t=>c.get(t.id)===e);return t.length===0?[]:[{repo:``,label:z(`rail.state.${e}`),key:`${sO}${e}`,tasks:t}]})}function dO(e){let t=new Set(e.machines.map(e=>e.alias));return{rows:fO(Sw(uO([...e.tasks.filter(e=>!e.routine),...e.remote.filter(e=>!e.routine&&e.machine!==void 0&&t.has(e.machine.id))],e),e.query,e.fold).map(e=>{if(e.kind!==`project`)return e;let t=e.id.slice(`project:${sO}`.length);return{id:`state:${t}`,kind:`state`,state:t,label:e.label,count:0}})),groups:[]}}function fO(e){let t=new Map,n=``;for(let r of e)r.kind===`state`?n=r.id:r.kind===`task`&&t.set(n,(t.get(n)??0)+1);return e.map(e=>e.kind===`state`?{...e,count:t.get(e.id)??0}:e)}var pO=new Set([`refused`,`timeout`,`host-key-changed`,`host-key-unverified`,`auth-denied`,`unresolved`,`ssh-failed`,`no-rove`,`no-daemon`,`bad-status`,`handshake`,`no-forwarding`,`lost`]);function mO(e){return e&&pO.has(e)?`machines.reason.${e}`:null}function hO(e,t){return e.filter(e=>e.machine?.id===t&&!e.routine&&!e.deleting)}function gO(e){let t=oO.map(e=>({state:e,tasks:[]}));for(let n of e)t[oO.indexOf(cO(n))]?.tasks.push(n);return t.filter(e=>e.tasks.length>0)}var _O=`flex flex-col font-mono text-meta`,vO=`flex flex-col gap-1 border-t-hairline border-line py-2.5 first:border-t-0 first:pt-0`,yO=`flex flex-wrap items-baseline gap-x-2.5 gap-y-0.5`,bO=`min-w-0 text-ink wrap-anywhere`,xO=`m-0 text-muted wrap-anywhere`,SO=`flex flex-wrap gap-x-3.5 gap-y-1 pt-0.5 whitespace-nowrap`,CO=`mt-1.5 mb-0.5 text-subtle`,wO=`flex min-w-0 items-baseline gap-2 pl-2`,TO=`min-w-0 flex-1 truncate text-left`,EO=`min-w-0 max-w-[55%] flex-none truncate text-muted`;function DO(e){W.set((0,V.jsx)(jO,{model:e}))}function OO({model:e,tasks:t}){let n=t=>{Cn(),e.select(t.id),_a()};return gO(t).map(e=>(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`p`,{className:`${CO} m-0`,children:z(`rail.state.${e.state}`)}),e.tasks.map(e=>(0,V.jsxs)(H,{variant:`row`,className:`${wO} w-full rounded-sm py-0.5 hover:bg-hover`,onClick:()=>n(e),children:[(0,V.jsx)(`span`,{className:TO,children:e.label}),(0,V.jsx)(`span`,{className:EO,children:e.branch})]},e.id))]},e.state))}function kO({model:e,alias:t}){let[n,r]=(0,g.useState)(null);return(0,g.useEffect)(()=>{let n=!0;return Ws(e,`machines.repos`,{machine:t}).then(e=>n&&r(e),e=>n&&r({failed:e instanceof Error?e.message:String(e)})),()=>{n=!1}},[e,t]),n?`failed`in n?(0,V.jsx)(`p`,{className:xO,children:z(`machines.reposFailed`,{message:n.failed})}):n.reason?(0,V.jsx)(`p`,{className:xO,children:z(`machines.reposFailed`,{message:n.message??n.reason})}):n.repos.length===0?(0,V.jsx)(`p`,{className:xO,children:z(`machines.noRepos`)}):n.repos.map(e=>(0,V.jsxs)(`div`,{className:wO,children:[(0,V.jsx)(`span`,{className:TO,children:e.id}),(0,V.jsx)(`span`,{className:EO,title:e.primary??e.checkouts[0],children:e.primary??e.checkouts[0]??``})]},e.id)):(0,V.jsx)(`p`,{className:xO,children:z(`machines.loading`)})}function AO(e){let{model:t,row:n,tasks:r,words:i}=e,[a,o]=(0,g.useState)(null),s=n.state===`online`,c=mO(n.reason),l=gO(r).map(e=>`${e.tasks.length} ${z(`rail.state.${e.state}`)}`),u=e=>o(a===e?null:e);return(0,V.jsxs)(`section`,{className:vO,children:[(0,V.jsxs)(`div`,{className:yO,children:[(0,V.jsx)(`span`,{className:`${bO} ${s?``:jT.warning}`,children:vE(n,i)}),(0,V.jsx)(`span`,{className:`text-muted`,children:l.length>0?l.join(` · `):z(`machines.noTasks`)})]}),c&&(0,V.jsx)(`p`,{className:`m-0 text-muted wrap-anywhere`,children:z(c)}),(0,V.jsxs)(`div`,{className:SO,children:[s&&(0,V.jsx)(H,{hit:`tight`,onClick:()=>{Cn(),tO(void 0,n.alias)},children:z(`machines.newHere`)}),r.length>0&&(0,V.jsx)(H,{hit:`tight`,"aria-expanded":a===`tasks`,onClick:()=>u(`tasks`),children:z(a===`tasks`?`machines.hide`:`machines.tasks`)}),s&&(0,V.jsx)(H,{hit:`tight`,"aria-expanded":a===`repos`,onClick:()=>u(`repos`),children:z(a===`repos`?`machines.hide`:`machines.repos`)})]}),a===`tasks`&&(0,V.jsx)(OO,{model:t,tasks:r}),a===`repos`&&(0,V.jsx)(kO,{model:t,alias:n.alias})]})}function jO({model:e}){let t=B(),n=CE(e),r=v(e.remote),i=(t===`zh`?jr:Ar).machine;return(0,V.jsx)(cr,{title:z(`machines.title`),wide:!0,children:(0,V.jsxs)(`div`,{className:`${Rn} ${_O}`,children:[n.length===0&&(0,V.jsx)(`p`,{className:`m-0 text-muted wrap-anywhere`,children:z(`machines.none`)}),n.map(t=>(0,V.jsx)(AO,{model:e,row:t,tasks:hO(r,t.alias),words:i},t.alias))]})})}function MO(e,t,n=300){let r=0,i,a=()=>{r++,i?.(),i=void 0};return{stop:a,run:o=>{a();let s=o.trim();if(s.length<2){t({kind:`idle`});return}let c=r,l=setTimeout(()=>{t({kind:`searching`}),e(s).then(e=>c===r&&t({kind:`done`,query:s,reply:e}),e=>c===r&&t({kind:`failed`,message:e instanceof Error?e.message:String(e)}))},n);i=()=>clearTimeout(l)}}}var NO=`mx-1.5 mt-2 mb-0.5 font-mono text-meta font-semibold normal-nums text-subtle first:mt-0`,PO=`mx-1.5 my-1 text-meta text-muted [overflow-wrap:anywhere]`,FO=e=>`flex w-full min-w-0 cursor-pointer flex-col gap-0.5 rounded-sm px-1.5 py-1.5 text-left text-ink [font:inherit] touch:py-2.5 ${e?`is-selected bg-hover`:``}`,IO=`flex min-w-0 items-baseline gap-2`,LO=`min-w-0 flex-1 truncate text-body`,RO=`whitespace-nowrap text-meta text-muted`,zO=`text-meta text-muted [overflow-wrap:anywhere]`,BO=`rounded-xs bg-accent/25 text-ink`;function VO(e,t){let[n,r]=(0,g.useState)({kind:`idle`});return(0,g.useEffect)(()=>{let n=MO(t=>e.client.request(`sessions.search`,{query:t}),r);return n.run(t),n.stop},[e,t]),n}function HO(e,t){let n=[],r=e.toLowerCase(),i=t.toLowerCase(),a=0;for(let t=r.indexOf(i);i&&t>=0;t=r.indexOf(i,t+i.length))t>a&&n.push(e.slice(a,t)),n.push({hit:e.slice(t,t+i.length),at:t}),a=t+i.length;return n.push(e.slice(a)),n.map(e=>typeof e==`string`?e:(0,V.jsx)(`mark`,{className:BO,children:e.hit},e.at))}function UO({children:e}){return(0,V.jsx)(`h3`,{className:NO,children:e})}function WO({children:e,error:t}){return(0,V.jsx)(`p`,{className:`${PO} ${t?`text-error`:``}`,children:e})}function GO(e){return(0,V.jsx)(H,{variant:`row`,className:FO(e.selected),onMouseEnter:e.onHover,onClick:e.onOpen,children:(0,V.jsxs)(`span`,{className:IO,children:[(0,V.jsx)(`span`,{className:LO,children:e.title}),(0,V.jsx)(`span`,{className:RO,children:e.repo})]})})}function KO(e){let{hit:t}=e;return(0,V.jsxs)(H,{variant:`row`,className:FO(e.selected),onMouseEnter:e.onHover,onClick:e.onOpen,children:[(0,V.jsxs)(`span`,{className:IO,children:[(0,V.jsx)(`span`,{className:LO,children:t.title}),(0,V.jsxs)(`span`,{className:RO,children:[z(t.role===`user`?`search.you`:`search.agent`),` · `,Lo(Date.now()-Date.parse(t.at))]})]}),(0,V.jsx)(`span`,{className:zO,children:HO(t.snippet,e.query)})]})}var qO=_(`issues`);function JO(e,t,n){return{repo:e.repo,baseBranch:t,prompt:n,worktree:!0}}var YO=.2,XO=[`files`,`chat`,`diff`,`browser`,`quota`];function ZO(){return{top:{tabs:[{id:`t1`,kind:`files`}],active:`t1`},bottom:null,ratio:.5,focus:`top`,recent:[`t1`],next:2}}function QO(e){return e.bottom?[[`top`,e.top],[`bottom`,e.bottom]]:[[`top`,e.top]]}function $O(e){let t=e=>Number(e.id.slice(1));return QO(e).flatMap(([,e])=>e.tabs).sort((e,n)=>t(e)-t(n))}function ek(e,t){for(let[n,r]of QO(e)){let e=r.tabs.find(e=>e.id===t);if(e)return{tab:e,name:n,group:r}}return null}function tk(e,t){let n=$O(e).filter(e=>e.kind===t);for(let t of[...e.recent].reverse()){let e=n.find(e=>e.id===t);if(e)return e}return n[0]??null}function nk(e){return e.urls[e.at]??``}function rk(e){return e.slice(e.lastIndexOf(`/`)+1)}function ik(e){try{return new URL(e).host.replace(/^www\./,``)}catch{return e}}function ak(e,t){for(let[n,r]of QO(e))if(r.tabs.some(e=>e.kind===t))return n;return e.bottom?e.focus:`top`}function ok(e,t,n){let r=e.tabs.filter(e=>e.id!==n).map(e=>e.id);for(let e of[...t].reverse())if(r.includes(e))return e;return r[0]??null}function sk(e){let{top:t,bottom:n}=e;n&&n.tabs.length===0&&(n=null),t.tabs.length===0&&n&&([t,n]=[n,null]);let r=new Set([...t.tabs,...n?.tabs??[]].map(e=>e.id)),i=e.recent.filter(e=>r.has(e)),a=e=>e.active&&e.tabs.some(t=>t.id===e.active)?e:{...e,active:ok(e,i)};return{...e,top:a(t),bottom:n&&a(n),recent:i,focus:n?e.focus:`top`}}function ck(e,t,n){return t===`top`?{...e,top:n}:{...e,bottom:n}}function lk(e,t){let n=ek(e,t);if(!n)return e;let{group:r,name:i}=n,a=[...e.recent.filter(e=>e!==t),t];return r.active===t&&e.focus===i&&e.recent.at(-1)===t?e:{...ck(e,i,{...r,active:t}),focus:i,recent:a}}function uk(e){let t=$O(e);if(t.length<=12)return e;let n=new Set(QO(e).map(([,e])=>e.active)),r=t.filter(e=>!n.has(e.id)).sort((t,n)=>e.recent.indexOf(t.id)-e.recent.indexOf(n.id))[0];return r?Ck(e,r.id):e}function dk(e,t,n){let r=`t${e.next}`,i=t===`bottom`&&e.bottom?`bottom`:`top`,a=i===`bottom`&&e.bottom?e.bottom:e.top;return uk(lk(ck({...e,next:e.next+1},i,{...a,tabs:[...a.tabs,n(r)]}),r))}var fk=e=>({id:e,kind:`browser`,urls:[],at:-1});function pk(e,t){return dk(e,t,e=>({id:e,kind:`files`}))}function mk(e,t){return dk(e,t,fk)}function hk(e,t,n){let r=$O(e).find(e=>e.kind===`diff`&&e.path===t);return r?r.kind===`diff`&&r.scope!==n?lk(bk(e,{...r,scope:n}),r.id):lk(e,r.id):dk(e,ak(e,`diff`),e=>({id:e,kind:`diff`,path:t,scope:n}))}function gk(e,t){let n=$O(e).filter(e=>e.kind===`browser`),r=n.find(e=>nk(e)===t);if(r)return lk(e,r.id);let i=n.find(e=>nk(e)===``);return i?xk(e,i.id,t):xk(dk(e,ak(e,`browser`),fk),`t${e.next}`,t)}function _k(e,t){let n=tk(e,t);return n?lk(e,n.id):t===`diff`?hk(e,`.`,`working`):dk(e,ak(e,t),e=>t===`files`||t===`chat`||t===`quota`?{id:e,kind:t}:fk(e))}function vk(e){let t=e.recent.at(-1),n=t?ek(e,t):null,r=n&&n.group.active===t?t:e.top.active;return(r?ek(e,r)?.tab.kind:null)??null}function yk(e,t,n){return t&&vk(e)===n?{panel:e,open:!1}:{panel:_k(e,n),open:!0}}function bk(e,t){let n=e=>({...e,tabs:e.tabs.map(e=>e.id===t.id?t:e)});return{...e,top:n(e.top),bottom:e.bottom&&n(e.bottom)}}function xk(e,t,n){let r=ek(e,t)?.tab;if(r?.kind!==`browser`||nk(r)===n)return e;let i=[...r.urls.slice(0,r.at+1),n].slice(-30);return bk(e,{...r,urls:i,at:i.length-1})}function Sk(e,t,n){let r=ek(e,t)?.tab;return r?.kind!==`browser`||n===r.at||n<0||n>=r.urls.length?e:bk(e,{...r,at:n})}function Ck(e,t){let n=ek(e,t);if(!n)return e;let{group:r}=n,i=r.tabs.filter(e=>e.id!==t),a=e.recent.filter(e=>e!==t),o=r.active===t?ok(r,a,t):r.active;return sk({...ck(e,n.name,{tabs:i,active:o}),recent:a})}function wk(e,t){return $O(e).reduce((e,n)=>n.id===t?e:Ck(e,n.id),e)}function Tk(e,t,n,r){let i=ek(e,t);if(!i)return e;let a=i.group,o=a.tabs.filter(e=>e.id!==t),s=a.tabs.findIndex(e=>e.id===t);if(i.name===n){let c=Math.max(0,Math.min(o.length,(r??o.length)-+(r!==void 0&&r>s)));return lk(c===s?e:ck(e,n,{...a,tabs:[...o.slice(0,c),i.tab,...o.slice(c)]}),t)}let c=e.recent.filter(e=>e!==t),l=ck(e,i.name,{tabs:o,active:a.active===t?ok(a,c,t):a.active}),u=(n===`top`?l.top:l.bottom)?.tabs??[],d=Math.max(0,Math.min(u.length,r??u.length));return lk(sk(ck({...l,recent:c},n,{tabs:[...u.slice(0,d),i.tab,...u.slice(d)],active:t})),t)}function Ek(e,t){let n=Math.max(YO,Math.min(.8,t));return Math.abs(n-e.ratio)<.001?e:{...e,ratio:n}}function Dk(e,t,n){let r=new Map(n.map(e=>[e.id,e.kind])),i=[...e.filter(e=>r.has(e)&&!t.includes(e)),...t.filter(e=>r.has(e))],a=i.filter(e=>r.get(e)===`browser`),o=new Set(a.slice(0,Math.max(0,a.length-3)).filter(e=>!t.includes(e)));return i=i.filter(e=>!o.has(e)),i}function Ok(e){if(!e||typeof e!=`object`)return null;let t=e;if(typeof t.id!=`string`||!/^t\d+$/.test(t.id))return null;if(t.kind===`files`||t.kind===`chat`||t.kind===`quota`)return{id:t.id,kind:t.kind};if(t.kind===`diff`&&typeof t.path==`string`&&t.path!==``){let e=t.scope===`branch`||t.scope===`task`?t.scope:`working`;return{id:t.id,kind:`diff`,path:t.path,scope:e}}if(t.kind===`browser`&&Array.isArray(t.urls)){let e=t.urls.filter(e=>typeof e==`string`&&e!==``).slice(-30),n=typeof t.at==`number`&&Number.isInteger(t.at)?Math.min(e.length-1,Math.max(-1,t.at)):e.length-1;return{id:t.id,kind:`browser`,urls:e,at:e.length===0?-1:Math.max(0,n)}}return null}function kk(e,t){if(!e||typeof e!=`object`||!(`tabs`in e)||!Array.isArray(e.tabs))return null;let n=[];for(let r of e.tabs){let e=Ok(r);!e||t.has(e.id)||(t.add(e.id),n.push(e))}return{tabs:n,active:`active`in e&&typeof e.active==`string`?e.active:null}}function Ak(e){if(!e||typeof e!=`object`)return null;let t=e,n=new Set,r=kk(t.top,n);if(!r)return null;let i=kk(t.bottom,n),a=Math.max(0,...[...n].map(e=>Number(e.slice(1)))),o=typeof t.ratio==`number`&&Number.isFinite(t.ratio)?t.ratio:.5;return sk({top:r,bottom:i,ratio:Math.max(YO,Math.min(.8,o)),focus:t.focus===`bottom`?`bottom`:`top`,recent:Array.isArray(t.recent)?t.recent.filter(e=>typeof e==`string`):[],next:Math.max(a+1,typeof t.next==`number`&&Number.isInteger(t.next)?t.next:0)})}function jk(e,t){let n=ZO(),r=typeof t==`string`&&t!==``?t:``;if(e!==`browser`&&!r)return n;let i=mk(n,`top`),a=r?xk(i,`t2`,r):i;return e===`browser`?a:lk(a,`t1`)}function Mk(e){try{let t=JSON.parse(e??`{}`);return t&&typeof t==`object`&&!Array.isArray(t)?Object.entries(t):[]}catch{return[]}}function Nk(e,t,n){let r=Object.fromEntries(Object.entries(e).filter(([e])=>e!==t));r[t]=n;for(let e of Object.keys(r).slice(0,-50))delete r[e];return r}function Pk(e,t){let n={};for(let[t,r]of Mk(e)){let e=Ak(r);e&&(n[t]=e)}let r=new Map(Mk(t.tab).filter(([,e])=>XO.includes(e))),i=new Map(Mk(t.url)),a=[...new Set([...r.keys(),...i.keys()])].filter(e=>!(e in n));n={...Object.fromEntries(a.map(e=>[e,jk(r.get(e),i.get(e))])),...n};for(let e of Object.keys(n).slice(0,-50))delete n[e];return n}var Fk=[`files`,`diff`,`browser`];function Ik(e){if(!e||typeof e!=`object`)return!1;let t=e;return typeof t.taskId==`string`&&t.taskId!==``&&Fk.includes(t.view)&&typeof t.at==`number`&&(t.url===void 0||typeof t.url==`string`)&&(t.path===void 0||typeof t.path==`string`)}function Lk(e){return e.narrow?{panel:!1,panelOpen:!1,narrow:!0}:{panel:!0,panelOpen:e.panelOpen&&!e.zen,narrow:!1}}function Rk(e,t){return{tab:e.path?`diff`:e.view,...e.view===`browser`&&e.url?{url:e.url}:{},...e.view!==`browser`&&e.path?{diff:e.path}:{},show:t.taskId===e.taskId&&!t.narrow}}function zk(e,t){return t.url?gk(e,t.url):t.diff?hk(e,t.diff,`working`):_k(e,t.tab)}var Bk=`rove.web.panels`,Vk=`rove.web.panelTab`,Hk=`rove.web.panelUrl`;function Uk(){let e={tab:localStorage.getItem(Vk),url:localStorage.getItem(Hk)},t=Pk(localStorage.getItem(Bk),e);return(e.tab!==null||e.url!==null)&&(localStorage.setItem(Bk,JSON.stringify(t)),localStorage.removeItem(Vk),localStorage.removeItem(Hk)),t}var Wk=_(Uk()),Gk=ZO();function Kk(e){return v(Wk)[e]??Gk}function qk(e,t){let n=Wk.get()[e]??Gk,r=t(n);if(r===n)return;let i=Nk(Wk.get(),e,r);Wk.set(i),localStorage.setItem(Bk,JSON.stringify(i))}function Jk(e,t){qk(e,e=>_k(e,t)),qa.set(!0),Ca()&&Ua.set(t)}function Yk(e,t){let n=yk(Wk.get()[e]??Gk,qa.get()&&!mn.get(),t);qk(e,()=>n.panel),qa.set(n.open),n.open&&mn.get()&&mn.set(!1)}function Xk(e){qk(e.taskId,t=>hk(t,e.path,e.scope)),qa.set(!0),mn.get()&&mn.set(!1),Ca()&&Ua.set(`diff`)}function Zk(e,t){qk(e,e=>gk(e,t)),qa.set(!0),mn.get()&&mn.set(!1),Ca()&&Ua.set(`browser`)}function Qk(e,t){qk(e,e=>Ck(e,t));let n=Ua.get();Ca()&&n!==`terminal`&&!tk(Wk.get()[e]??Gk,n)&&Jk(e,`files`)}function $k(e,t){let n=Rk(e,{taskId:t,narrow:Ca()});qk(e.taskId,e=>zk(e,n)),n.show&&(qa.set(!0),mn.get()&&mn.set(!1))}var eA=_(null),tA=0;function nA(e,t){eA.set({taskId:e,hit:t,nonce:++tA}),Jk(e,`chat`),mn.get()&&mn.set(!1)}var rA=10;function iA(e,t){let n=e=>e.surface===t?0:e.surface?1:2,r=$i().filter(n=>ea(n,t)&&n.live?.(e)!==!1).map((e,t)=>({command:e,index:t})).sort((e,t)=>n(e.command)-n(t.command)||Number(e.command.prefix)-Number(t.command.prefix)||e.index-t.index),i=new Set,a=[];for(let{command:e}of r){let t=e.chords[0];!t||e.id===`palette.open`||i.has(e.id)||(i.add(e.id),a.push({command:e,name:To(e.id),raw:e.prefix?`${ti()} + ${t}`:t}))}return a}function aA(e){let t=document.activeElement instanceof HTMLElement?document.activeElement:null;W.set((0,V.jsx)(sA,{model:e,surface:na(),origin:t}))}var oA=8;function sA({model:e,surface:t,origin:n}){B();let[r,i]=(0,g.useState)(``),[a,o]=(0,g.useState)(0),s=(0,g.useRef)(null),c=v(Xr),l=v(e.tasks),u=v(e.remote),d=(0,g.useMemo)(()=>iA(e,t),[e,t,c]).filter(e=>fo(r,e.name,e.raw)),f=(CE(e).length>0?[{name:z(`machines.title`)}]:[]).filter(e=>fo(r,e.name,``)),p=r.trim(),m=p===``?[]:[...l?.tasks??[],...u].filter(e=>!e.routine&&!e.deleting&&[e.label,e.title,e.branch,qC(e.repo)].some(e=>e!==``&&no(p,e))).slice(0,oA),h=v(e.installedMods).has(`issues`),_=[{id:`usage`,name:z(`usage.title`)},...h?[{id:`issues`,name:z(`reviewQueue.palette`),source:`reviews`}]:[]].filter(e=>p===``||no(p,e.name)),y=VO(e,r),b=y.kind===`done`?y.reply.matches:[],x=[...d.map(e=>({kind:`command`,row:e})),..._.map(e=>({kind:`page`,...e})),...f.map(e=>({kind:`machines`,...e})),...m.map(e=>({kind:`task`,task:e})),...b.map(e=>({kind:`hit`,hit:e}))],S=Math.min(a,Math.max(0,x.length-1));(0,g.useEffect)(()=>()=>n?.focus(),[n]),(0,g.useEffect)(()=>{s.current?.querySelector(`.is-selected`)?.scrollIntoView({block:`nearest`})},[S]);let C=t=>{if(t.kind===`machines`){DO(e);return}if(Cn(),n?.focus(),t.kind===`command`){t.row.command.live?.(e)===!1?G(So(`unavailable`),`error`):t.row.command.run(e);return}if(t.kind===`page`){t.source&&qO.set(t.source),ya(t.id);return}t.kind===`task`?e.select(t.task.id):e.select(t.hit.taskId,t.hit.tabId??null),_a(),t.kind===`hit`&&nA(t.hit.taskId,t.hit)},w=e=>{if(e.key===`ArrowDown`)o(Math.min(x.length-1,S+1));else if(e.key===`ArrowUp`)o(Math.max(0,S-1));else if(e.key===`Enter`){let e=x[S];e&&C(e)}else return;e.preventDefault()},T=p!==``&&(m.length>0||p.length>=2),E=0,D=()=>E++;return(0,V.jsx)(cr,{title:So(`palette`),wide:!0,children:(0,V.jsxs)(`div`,{className:`${Rn} palette`,onKeyDown:w,children:[(0,V.jsx)(`input`,{className:pt,autoFocus:!0,spellCheck:!1,value:r,placeholder:So(`search`),onChange:e=>{i(e.target.value),o(0)}}),(0,V.jsxs)(`div`,{className:ut,ref:s,style:{maxHeight:`${(T?18:rA)*1.9}em`},children:[x.length===0&&y.kind!==`searching`&&(0,V.jsx)(`p`,{className:`text-muted`,children:So(`noResults`)}),T&&d.length>0&&(0,V.jsx)(UO,{children:z(`search.commands`)}),d.map(e=>{let t=D();return(0,V.jsx)(`button`,{type:`button`,className:dt(t===S),title:e.name,onMouseEnter:()=>o(t),onClick:()=>C({kind:`command`,row:e}),children:(0,V.jsx)(`span`,{className:ft,children:`${t===S?`› `:` `}${e.name}`})},e.command.id)}),_.map(e=>{let t=D();return(0,V.jsx)(H,{variant:`row`,className:dt(t===S),title:e.name,onMouseEnter:()=>o(t),onClick:()=>C({kind:`page`,...e}),children:(0,V.jsx)(`span`,{className:ft,children:`${t===S?`› `:` `}${e.name}`})},e.id)}),f.map(e=>{let t=D();return(0,V.jsx)(H,{variant:`row`,className:dt(t===S),title:e.name,onMouseEnter:()=>o(t),onClick:()=>C({kind:`machines`,...e}),children:(0,V.jsx)(`span`,{className:ft,children:`${t===S?`› `:` `}${e.name}`})},`machines`)}),m.length>0&&(0,V.jsx)(UO,{children:z(`search.tasks`)}),m.map(e=>{let t=D();return(0,V.jsx)(GO,{title:e.label,repo:qC(e.repo),selected:t===S,onHover:()=>o(t),onOpen:()=>C({kind:`task`,task:e})},e.id)}),y.kind!==`idle`&&(0,V.jsx)(UO,{children:z(`search.inConversations`)}),y.kind===`searching`&&(0,V.jsx)(WO,{children:z(`search.searching`)}),y.kind===`failed`&&(0,V.jsx)(WO,{error:!0,children:y.message}),y.kind===`done`&&b.length===0&&(0,V.jsx)(WO,{children:z(`search.none`,{query:y.query})}),b.map(e=>{let t=D();return(0,V.jsx)(KO,{hit:e,query:y.kind===`done`?y.query:``,selected:t===S,onHover:()=>o(t),onOpen:()=>C({kind:`hit`,hit:e})},`${e.taskId}:${e.tabId??``}:${e.at}:${t}`)}),y.kind===`done`&&y.reply.truncated&&(0,V.jsx)(WO,{children:z(`search.truncated`)}),y.kind===`done`&&y.reply.skipped.length>0&&(0,V.jsx)(WO,{children:z(`search.skipped`,{count:y.reply.skipped.length})})]}),(0,V.jsx)(`p`,{className:`keys-only text-muted`,children:So(`run`)})]})})}var cA=_(null);function lA(e){let t=(document.activeElement?.closest(`.rail`)==null?null:cA.get())??e.selection.get().taskId;return e.tasks.get()?.tasks.find(e=>e.id===t)??null}t(((e,t)=>{t.exports={}}))();var uA={$schema:`https://json.schemastore.org/package.json`,name:`@sma1lboy/rove`,version:`0.9.280`,description:`Rove — the agent multiplexer for your terminal. Run coding agents on parallel tasks with isolated worktrees and persistent sessions.`,keywords:[`terminal`,`tui`,`cli`,`multiplexer`,`ai-agents`,`coding-agent`,`ai-coding-assistant`,`agentic-ai`,`parallel-agents`,`git-worktree`,`claude-code`,`codex`,`llm`,`developer-tools`],type:`module`,packageManager:`bun@1.3.13`,bin:{rove:`dist/cli/rove.js`},files:[`dist/cli`,`dist/completions`,`dist/web`,`dist/web-ui`,`dist/skills`,`dist/*.wav`,`README.md`,`LICENSE`],publishConfig:{access:`public`},repository:{type:`git`,url:`git+https://github.com/Sma1lboy/rove.git`},homepage:`https://rove.run`,bugs:{url:`https://github.com/Sma1lboy/rove/issues`},engines:{bun:`>=1.3.11`},scripts:{dev:`ROVE_DEV=1 bun --conditions=browser ./src/cli/rove.ts`,"dev:mock":`ROVE_DEV=1 bun ./src/tui-react/mock/host.tsx`,"dev:sandbox":`bun run scripts/dev-sandbox.ts run`,"dev:sandbox:reset":`bun run scripts/dev-sandbox.ts reset`,build:`bun run scripts/build.ts`,"build:rubric":`bun run scripts/build-tier-rubric.ts`,compile:`bun run scripts/compile.ts`,typecheck:`tsc --noEmit`,"check-i18n":`bun run scripts/check-i18n.ts`,test:`bun run test:fast && bun run test:socket`,"perf:golden":`bun scripts/perf-golden.ts`,"pty:soak":`bun scripts/pty-soak.ts`,"test:fast":`vitest run --passWithNoTests --minWorkers=1 --maxWorkers=8`,"test:socket":`ROVE_INCLUDE_SOCKET=1 vitest run test/daemon --pool forks --minWorkers=1 --maxWorkers=4 --passWithNoTests`,"test:socket:coverage":`ROVE_INCLUDE_SOCKET=1 ROVE_COVERAGE_DAEMON=1 vitest run test/daemon --coverage --pool forks --minWorkers=1 --maxWorkers=4 --passWithNoTests`,"test:behavior":`ROVE_INCLUDE_BEHAVIOR=1 vitest run test/behavior --pool forks --minWorkers=1 --maxWorkers=1 --retry=2 --passWithNoTests`,"test:render":`bun scripts/render-track.mjs`,coverage:`vitest run --coverage --passWithNoTests`,bench:`vitest bench --run`,lint:`biome check .`,knip:`knip-bun`,postinstall:`bun run scripts/check-preview-deps.ts || true`,prepublishOnly:`bun run typecheck && bun run build`,"plugin-sandbox":`bun run scripts/plugin-sandbox.ts`},"//":`biome.json + bunfig.toml live at the monorepo root since they apply repo-wide; bun.lock also lives at root (workspace-shared).`,dependencies:{"@ansi-tools/parser":`^1.0.15`,"@opentui/core":`0.4.3`,"@opentui/react":`0.4.3`,"@xterm/addon-serialize":`^0.14.0`,"@xterm/addon-unicode11":`^0.9.0`,"@xterm/headless":`^6.0.0`,react:`^19.2.8`,"smol-toml":`^1.7.1`,ws:`^8.21.3`},optionalDependencies:{"node-pty":`^1.1.0`},devDependencies:{"@biomejs/biome":`1.9.4`,"@sma1lboy/rove-daemon":`0.7.23`,"@tsconfig/bun":`1.0.11`,"@types/bun":`1.3.14`,"@types/node":`25.6.2`,"@types/react":`^19.2.0`,"@vitest/coverage-v8":`2.1.9`,knip:`^6.14.2`,"react-devtools-core":`^7.0.1`,"rove-bridge":`0.0.41`,"rove-weixin":`0.0.41`,typescript:`5.8.2`,vitest:`2.1.9`},trustedDependencies:[]};uA.version,uA.name;var dA=[`latest`,`next`,`nightly`],fA={autoRouting:{title:`Auto routing`,hint:"Routing by depth: a task says how deep the work is — swift, standard, deep — and this table says which engine, model and reasoning effort that depth runs on. Pick a depth in the new-task dialog (or `rove api add --tier`) and Rove fills those three fields from the row; you still see them and can change them before the task starts. enter (or click) a row to point it somewhere else, with the same picker a task uses. A row whose target cannot start says why here, not at launch.",unconfigured:`Auto routing is off: a depth has nowhere to route — its engine is blank. Point it somewhere below, or remove the empty autoRouting.<tier>.engine from state.json.`,engineDefault:`engine default`,ready:`● ready`,unavailable:`! unavailable — {reason}`,classifierTitle:`Classifier`,classifierHint:"The rows above say what each depth RUNS. This says who CHOOSES one: switch it on and `rove api add --tier auto` reads the task's first message and picks the depth for you. It is off by default, it is never required, and it can never fail a create — no key, no network, a timeout, or an answer it is not confident enough about all leave you on the depth you would have had.",classifierDataFlow:"! Turning the classifier on sends the task's first message to a third party that is NOT the engine vendor you picked — TypeSafe System One for `jev`, or whatever address you point `custom` at. It reads the text before your engine does. Nothing leaves this machine while it is off.",classifierLabel:`Choose with`,classifierOff:`off`,classifierCustomLabel:`custom`,classifierOffHint:`— nothing is sent anywhere`,classifierJevHint:`— TypeSafe System One, billed to your own key`,classifierCustomHint:`— your endpoint: POST the text, answer with a depth and a confidence`,endpointLabel:`Endpoint`,endpointUnset:`(none — enter one, then set Choose with to custom)`,endpointTitle:`Custom classifier endpoint`,endpointField:`URL`,endpointInvalidTitle:`Not a URL`,endpointInvalidBody:`The endpoint has to start with https://, or http:// for a loopback address (127.0.0.1, localhost, ::1) — over a network, plain http would carry the task's first 1,200 characters in cleartext. Leave it empty to clear it.`,thresholdLabel:`Confidence floor`,thresholdHint:`— below this, the depth is left alone`,thresholdTitle:`Confidence floor`,thresholdField:`0 to 1`,thresholdInvalidTitle:`Not a confidence`,thresholdInvalidBody:`The floor is a number between 0 and 1. 0.5 is the shipped default.`,keyLabel:`API key`,keyStored:`stored {hint} — enter to replace, empty to clear`,keyFromEnv:"from ${env} — the environment wins over a stored key",keyNone:`not set — enter to paste one`,keyTitle:`{env}`,keyPlaceholder:`paste the key; leave empty to clear the stored one`,keySaved:`● key stored in ~/.rove/secrets.json (owner-only, never in state.json)`,keyCustomUnused:`● no Authorization header is sent to a custom endpoint — set autoRouting.classifierCustomKeyEnv to the variable holding its key if it needs one`,keyNoVariableTitle:`No key variable for this endpoint`,keyNoVariableBody:`A custom classifier endpoint is sent no Authorization header until autoRouting.classifierCustomKeyEnv names the variable its key lives in. Set that first — a key stored under a name nothing reads is a key at rest for no purpose.`,keyWriteFailedTitle:`Key not saved`,keyWriteFailedBody:`~/.rove/secrets.json could not be written: {reason}. Check directory permissions and disk space, then save again.`,keyMissing:`! no key — nothing is chosen and tasks keep their usual depth`,keyPresentEnv:"● key read from ${env} in this process's environment"}},pA={autoRouting:{title:`自动路由`,hint:"按深度路由:任务说明这活有多深——轻快、标准、深入——这张表说明那一档跑在哪个引擎、哪个模型、哪个推理强度上。在新建任务对话框里选一档(或 `rove api add --tier`),Rove 就照那一行填进这三个字段;任务启动前你仍然看得见、改得了。enter(或点击)某一行,用和任务一样的选择器把它指到别处。目标起不来的行会在这里说明原因,而不是等到启动时才炸。",unconfigured:`自动路由已关闭:有一档无处可去——它的引擎是空的。在下面把它指到某个引擎,或从 state.json 里删掉空的 autoRouting.<tier>.engine。`,engineDefault:`引擎默认`,ready:`● 可用`,unavailable:`! 不可用——{reason}`,classifierTitle:`分类器`,classifierHint:"上面几行说的是每一档**跑什么**,这里决定**由谁来选**:打开之后,`rove api add --tier auto` 会读任务的第一句话替你选档。默认关着,从来不是必需的,也永远不会让建 task 失败——没 key、断网、超时、或者它自己没把握,都只是让你停在本来就会用的那一档上。",classifierDataFlow:"! 打开分类器,任务的第一句话会发给一个**不是你选的那个引擎厂商**的第三方——`jev` 是 TypeSafe System One,`custom` 是你自己填的地址。它比你的引擎更早读到这段文字。关着的时候什么都不发。",classifierLabel:`选档方式`,classifierOff:`关`,classifierCustomLabel:`自定义`,classifierOffHint:`——不向任何地方发送`,classifierJevHint:`——TypeSafe System One,走你自己的 key 计费`,classifierCustomHint:`——你自己的接口:POST 那段文本,返回一个档位加一个置信度`,endpointLabel:`接口地址`,endpointUnset:`(未填——先填一个,再把「选档方式」切到自定义)`,endpointTitle:`自定义分类器接口`,endpointField:`URL`,endpointInvalidTitle:`不是一个 URL`,endpointInvalidBody:`接口地址要以 https:// 开头;http:// 只在回环地址(127.0.0.1、localhost、::1)上接受——发到网络上的话,明文 http 会把任务的前 1200 个字符原样带走。留空则清除。`,thresholdLabel:`置信度下限`,thresholdHint:`——低于这个值就不动档位`,thresholdTitle:`置信度下限`,thresholdField:`0 到 1`,thresholdInvalidTitle:`不是一个置信度`,thresholdInvalidBody:`下限是 0 到 1 之间的数。出厂默认 0.5。`,keyLabel:`API key`,keyStored:`已存 {hint}——enter 可替换,留空清除`,keyFromEnv:"来自环境变量 ${env}——环境变量优先于存起来的那个",keyNone:`未设置——enter 粘贴一个`,keyTitle:`{env}`,keyPlaceholder:`粘贴 key;留空则清除已存的那个`,keySaved:`● key 存在 ~/.rove/secrets.json(仅本人可读,不会进 state.json)`,keyCustomUnused:`● 自定义接口不会收到 Authorization 头——它若需要凭据,把 autoRouting.classifierCustomKeyEnv 指向存它的变量`,keyNoVariableTitle:`这个接口还没有 key 变量`,keyNoVariableBody:`在 autoRouting.classifierCustomKeyEnv 指定存 key 的变量之前,自定义分类器接口不会收到任何 Authorization 头。先设那个——存在一个没人读的名字下面的 key,只是白白落在盘上。`,keyWriteFailedTitle:`key 没存下`,keyWriteFailedBody:`写不了 ~/.rove/secrets.json:{reason}。请检查目录权限和磁盘空间,再次保存。`,keyMissing:`! 没有 key——不会替你选档,任务保持原来的档位`,keyPresentEnv:"● key 来自本进程环境变量 ${env}"}},mA={dev:{reset:`Reset UI state`,resetHint:`Clears ~/.config/rove/state.json and ~/.rove/tasks.json, then quits Rove — relaunch to start fresh. Working session list, pane sizes, theme, model picks all reset. Worktrees on disk and engine session history are not touched.`,resetButton:`[enter] Reset`,restart:`Restart backend`,restartHint:`Stops the Rove daemon and relaunches this window on the installed build — picks up daemon / orchestrator / engine edits without quitting by hand. Running engine sessions live in the PTY host and survive it; other attached Rove windows reconnect on their own.`,restartButton:`[enter] Restart`,reload:`Reload settings`,reloadHint:"Applies hand edits to ~/.config/rove/state.json (from `rove config`) to this window without a restart.",reloadButton:`[enter] Reload`,reloadDone:`Reloaded: {count} changed.`,reloadUnchanged:`Already matches state.json; nothing changed.`,reloadFailed:`state.json could not be read, nothing changed: {error}`,doctorHint:"Daemon wedged or unresponsive? Restart backend above does it from here; from a shell it is `rove daemon restart`. Hosted engine sessions stay alive across a daemon restart.",experimental:`Experimental`,remoteHint:"Remote projects (SSH): register a project whose git worktrees live on another host, driven from this local Rove. Unfinished — Hosted PTY engine launch over SSH is not implemented, and file/diff panes still degrade. Enables `rove add --remote`.",remote:`Remote projects`,autoStatusHint:`Auto status flow: a backlog task moves to in_progress when its engine starts a turn, and new sessions get a system-prompt note telling the agent to set in_review itself when the work is done. Never touches done/canceled.`,autoStatus:`Auto status flow`,dispatcherHint:"Field-notes dispatcher: task sessions file one-line gotchas (`rove api note`), the daemon forwards each to the repo's main session, and that session relays them to the in-flight tasks that benefit (`rove api dispatch`). Web-hosted sessions receive the relays today.",dispatcher:`Field-notes dispatcher`}},hA={dev:{reset:`重置 UI 状态`,resetHint:`清空 ~/.config/rove/state.json 和 ~/.rove/tasks.json,然后退出 Rove——重新启动即可从头开始。工作会话列表、面板尺寸、主题、模型选择都会重置。磁盘上的 worktree 和引擎会话历史不受影响。`,resetButton:`[enter] 重置`,restart:`重启后端`,restartHint:`停止 Rove daemon,并以已安装的版本重新启动当前窗口——无需手动退出即可应用 daemon / orchestrator / engine 的改动。正在运行的引擎会话由 PTY host 托管,不受影响;其他已连接的 Rove 窗口会自行重连。`,restartButton:`[enter] 重启`,reload:`重新加载设置`,reloadHint:"把对 ~/.config/rove/state.json 的手动修改(来自 `rove config`)应用到当前窗口,无需重启。",reloadButton:`[enter] 重新加载`,reloadDone:`已重新加载:{count} 项有变化。`,reloadUnchanged:`已与 state.json 一致,没有变化。`,reloadFailed:`无法读取 state.json,未做任何改动:{error}`,doctorHint:"daemon 卡住或无响应?上面的「重启后端」就能在这里完成;在 shell 里则是 `rove daemon restart`。Hosted PTY 引擎会话不会因 daemon 重启而退出。",experimental:`实验性`,remoteHint:"远程项目(SSH):注册一个 git worktree + 引擎都通过 SSH 跑在另一台主机上、由本地 Rove 驱动的项目。尚未完成——文件/diff 面板对远程仍会降级。启用 `rove add --remote`。",remote:`远程项目`,autoStatusHint:`自动状态流转:backlog 任务在其引擎开始一轮时移到 in_progress,新会话会拿到一条系统提示,告诉 agent 完成后自行设为 in_review。绝不触碰 done/canceled。`,autoStatus:`自动状态流转`,dispatcherHint:"现场笔记调度器:任务会话提交一行经验(`rove api note`),daemon 将每条转发给仓库的主会话,主会话再把它们转达给能受益的进行中任务(`rove api dispatch`)。目前由 Web 托管的会话会收到转达。",dispatcher:`现场笔记调度器`}},gA={engines:{title:`Engines`,hint:`Engines Rove can start on this machine. New tasks start with the default engine; switch an engine off to stop offering it.`,keys:`space available · d default · enter launch command · r rename · x reset/remove`,customTag:`custom`,available:`available`,off:`off`,defaultMark:`default`,makeDefault:`Make default`,status:{checking:`Checking…`,unknown:`Status unknown`,ready:`Ready`,notInstalled:`Not installed`,notOnPath:`Not on PATH`,signIn:`Sign in needed`,integrationMissing:`Integration not installed`,integrationOutdated:`Integration outdated`,integrationBlocked:`Integration blocked`},detail:{program:`Program`,command:`Command`,signIn:`Sign-in`,reporting:`Live status`,adapter:`Adapter`,programFound:`{binary} found at {path}.`,programMissing:`{binary} is not on PATH. Install the engine's CLI, or point its launch command at it.`,programUnknown:`Rove could not check for {binary}.`,commandDefault:`{command} (the default)`,commandCustom:`{command} (yours)`,signedIn:`Signed in.`,signedInAs:`Signed in as {who}.`,apiKey:`An API key is configured.`,token:`A token is configured ({source}).`,signedOut:`Not signed in. Sign in with the engine's own CLI.`,signInUnknown:`Rove can't see whether this engine is signed in.`,signInFailed:`Sign-in check failed: {error}`,hooksInstalled:`Rove's hooks are installed, so tabs report their state as it changes.`,hooksOutdated:`Rove's hooks are from an older version; reinstall them under Engine integrations.`,hooksMissing:`Rove's hooks are not installed; install them under Engine integrations.`,hooksAwaitEngine:`Rove's hooks can be installed once the engine is.`,hooksUnsupported:`This engine has no hooks for Rove to install.`,hooksBlocked:`Rove can't write its hooks into {file}: {reason}`,hooksBlockedHere:`Rove can't write its hooks into the engine's config: {reason}`,markersYes:`It leaves turn-complete markers that Rove reads back.`,markersNo:`It leaves no turn-complete markers.`,screenYes:`Screen rules cover what the hooks don't.`,screenNo:`No screen rules.`,screenNotNeeded:`No screen rules; the hooks report everything.`,adapterDeclared:`Borrows the {protocol} adapter.`,adapterGeneric:`Generic adapter: no transcript reader, sign-in check or resume.`,skill:`Rove skill`,skillInstalled:`Installed in {dir}.`,skillInstalledHere:`Installed and current.`,skillOutdated:`From an older Rove; reinstall it under Rove agent skill.`,skillMissing:`Not installed; install it under Rove agent skill.`},skill:{title:`Rove agent skill`,hint:`Teaches the agent in each engine to drive Rove itself (rove api): start tasks, read other sessions, message them.`,install:`Install ({count})`,noEngines:`No engine here takes the skill`,failed:`Install failed: {reason}`,bannerTitle:`ROVE SKILL NOT INSTALLED`,bannerHint:`{engines} can't drive Rove yet (start tasks, read other sessions). Click here to install.`,bannerHintWeb:`{engines} can't drive Rove yet (start tasks, read other sessions).`},integrations:{title:`Engine integrations`,hint:`Hooks Rove writes into each engine's own config, so a tab shows working, waiting or done the moment it happens.`,summary:`{installed} of {total} installed`,install:`Install missing ({count})`,upToDate:`All up to date`,remove:`Remove all ({count})`,noneInstalled:`Nothing to remove`},addEngine:`+ Add engine`,launchCommandTitle:`{name} launch command`,displayNameTitle:`{name} display name (blank = default)`,addTitle:`Add engine`,addStepTitle:`Add engine · {id}`,protocolTitle:`Add engine · {id} — protocol`,protocolNone:`None — generic adapter`,protocolFooter:`↑↓ choose · enter pick · esc cancel`,protocolRow:`protocol {protocol}`,protocolGeneric:`generic`,idPlaceholder:`lowercase slug, e.g. aider`,commandPlaceholder:`e.g. aider --model sonnet`,hookTrustHint:`Open {command} in the engine and approve hooks yourself. Written hooks are not proof of trust.`,readiness:`CLI: {cli} · login: {login} · hooks: {hooks}`,cliReady:`available`,cliMissing:`missing; install the engine CLI`,loginReady:`detected`,loginMissing:`sign in with the engine CLI`,readinessUnknown:`not observable`,hooksWritten:`written`,hooksMissing:`not written; Settings → Engines`,hooksOutdated:`outdated; Settings → Engines`,hookWaiting:`No hook event received yet. After approval, send a short prompt to verify activity.`,hookReceived:`Hook event recorded for this tab. Send a short prompt to check current reporting; current trust is not inferred.`,readinessFailed:`Readiness check unavailable; run rove doctor. No authorization is inferred.`},accounts:{checking:`Checking…`,notLoggedIn:`○ Not logged in`,loggedIn:`● Logged in: {email}`,apiKeyConfigured:`● API key configured`,chatgptLogin:`● ChatGPT login: {email}`,tokenConfigured:`● Token configured ({source})`,detected:`● Login detected`}},_A={engines:{title:`引擎`,hint:`Rove 能在这台机器上启动的引擎。新任务默认用「默认」引擎;关掉某个引擎,选引擎时就不再列出它。`,keys:`space 可用 · d 设为默认 · enter 启动命令 · r 重命名 · x 重置/移除`,customTag:`自定义`,available:`可用`,off:`已关`,defaultMark:`默认`,makeDefault:`设为默认`,status:{checking:`检查中…`,unknown:`状态未知`,ready:`就绪`,notInstalled:`未安装`,notOnPath:`不在 PATH 上`,signIn:`需要登录`,integrationMissing:`未安装接入`,integrationOutdated:`接入已过期`,integrationBlocked:`接入被拒绝`},detail:{program:`程序`,command:`命令`,signIn:`登录`,reporting:`实时状态`,adapter:`适配器`,programFound:`{binary} 位于 {path}。`,programMissing:`{binary} 不在 PATH 上。请安装引擎 CLI,或把启动命令指向它。`,programUnknown:`Rove 无法检查 {binary}。`,commandDefault:`{command}(默认)`,commandCustom:`{command}(自定义)`,signedIn:`已登录。`,signedInAs:`已登录:{who}。`,apiKey:`已配置 API key。`,token:`已配置 Token({source})。`,signedOut:`未登录。请用引擎自己的命令行登录。`,signInUnknown:`Rove 无法得知该引擎是否已登录。`,signInFailed:`登录检查失败:{error}`,hooksInstalled:`Rove 的钩子已安装,标签页的状态会实时上报。`,hooksOutdated:`Rove 的钩子来自旧版本;请在「引擎接入」里重新安装。`,hooksMissing:`Rove 的钩子未安装;请在「引擎接入」里安装。`,hooksAwaitEngine:`引擎安装后才能装 Rove 的钩子。`,hooksUnsupported:`该引擎没有可供 Rove 安装的钩子。`,hooksBlocked:`Rove 无法把钩子写入 {file}:{reason}`,hooksBlockedHere:`Rove 无法把钩子写入引擎配置:{reason}`,markersYes:`它会留下回合完成标记,Rove 可以读回。`,markersNo:`它不留下回合完成标记。`,screenYes:`读屏规则兜底钩子覆盖不到的状态。`,screenNo:`没有读屏规则。`,screenNotNeeded:`没有读屏规则;钩子已报全所有状态。`,adapterDeclared:`借用 {protocol} 适配器。`,adapterGeneric:`通用适配器:没有会话记录读取、登录检查和恢复。`,skill:`Rove 技能`,skillInstalled:`已安装在 {dir}。`,skillInstalledHere:`已安装,是最新版。`,skillOutdated:`来自旧版 Rove;请在「Rove 智能体技能」里重新安装。`,skillMissing:`未安装;请在「Rove 智能体技能」里安装。`},skill:{title:`Rove 智能体技能`,hint:`教会各引擎里的智能体自己操作 Rove(rove api):开任务、读其他会话、给它们发消息。`,install:`安装({count})`,noEngines:`这台机器上没有能装技能的引擎`,failed:`安装失败:{reason}`,bannerTitle:`ROVE 技能未安装`,bannerHint:`{engines} 还不能操作 Rove(开任务、读其他会话)。点这里安装。`,bannerHintWeb:`{engines} 还不能操作 Rove(开任务、读其他会话)。`},integrations:{title:`引擎接入`,hint:`Rove 写进各引擎自身配置的钩子,让标签页在工作、等待、完成的那一刻就显示出来。`,summary:`已安装 {installed}/{total}`,install:`安装缺失的({count})`,upToDate:`全部已是最新`,remove:`全部移除({count})`,noneInstalled:`没有可移除的`},addEngine:`+ 添加引擎`,launchCommandTitle:`{name} 的启动命令`,displayNameTitle:`{name} 的显示名称(留空 = 默认)`,addTitle:`添加引擎`,addStepTitle:`添加引擎 · {id}`,protocolTitle:`添加引擎 · {id} —— 协议`,protocolNone:`无 —— 通用适配器`,protocolFooter:`↑↓ 选择 · enter 确认 · esc 取消`,protocolRow:`协议 {protocol}`,protocolGeneric:`通用`,idPlaceholder:`小写短名,如 aider`,commandPlaceholder:`如 aider --model sonnet`,hookTrustHint:`在引擎中打开 {command},由你自行批准 hooks。写入不代表已授权。`,readiness:`CLI:{cli} · 登录:{login} · hooks:{hooks}`,cliReady:`可用`,cliMissing:`缺失;请安装引擎 CLI`,loginReady:`已检测到`,loginMissing:`请通过引擎 CLI 登录`,readinessUnknown:`无法观测`,hooksWritten:`已写入`,hooksMissing:`未写入;设置 → 引擎`,hooksOutdated:`已过时;设置 → 引擎`,hookWaiting:`尚未收到 hook 事件。授权后发送一条简短提示,验证活动状态。`,hookReceived:`已记录此标签页的 hook 事件。发送简短提示以检查当前上报;不据此推断当前授权。`,readinessFailed:`无法检查就绪状态;请运行 rove doctor。不会据此推断已授权。`},accounts:{checking:`检查中…`,notLoggedIn:`○ 未登录`,loggedIn:`● 已登录: {email}`,apiKeyConfigured:`● 已配置 API key`,chatgptLogin:`● ChatGPT 登录: {email}`,tokenConfigured:`● 已配置 Token ({source})`,detected:`● 检测到登录`}},vA={plugins:{title:`Plugins`,hint:"Rove's first-party mods first: enter (or click) installs or uninstalls one, and uninstalling keeps its data on disk. Then the plugins registered in ~/.rove/plugins.json: enter toggles one on or off — the daemon watches the file, so the change applies live. Rows indented under a plugin are the settings it declares; enter edits one, and the value reaches the plugin on its next run. Install and remove them from the shell: `rove plugin install <owner/repo>`, `rove plugin link <dir>`.",empty:"Kanban and Issues are first-party mods: enter (or click) installs one. No other plugins registered; add one with `rove plugin install <owner/repo>` — browse the `rove-plugin` topic on GitHub.",sourceLink:`linked {path}`,sourceGithub:`{spec}`,sourceBuiltIn:`first-party mod · not installed`,sourceBuiltInInstalled:`first-party mod · installed`,updateAvailable:`update available — rove plugin update`,declares:`{actions} actions · {events} events · {panes} panes`,declaresWithEngines:`{actions} actions · {events} events · {panes} panes · {engines} engines`,declaresPages:`· {pages} pages`,pageFailed:`page {detail}`,manifestUnreadable:`manifest unreadable; check the rove-plugin.toml path and TOML syntax`,unsupportedPlatform:`· not supported on this platform`,noHooks:`· no hooks declared`,lastRun:`· last run {label} {status} {ago} ago`,neverRun:`· never run`,runOk:`ok`,runRunning:`still running`,runFailed:"failed to start; inspect `rove plugin log <id>`",runExit:`exit {code}`,settingUnset:`(unset — enter to edit)`,settingInvalidTitle:`Not a number`,settingInvalidBody:`{label} only accepts a number. Keeping the previous value.`},marketplace:{title:`Marketplace`,hint:"Plugins published under the `rove-plugin` topic on GitHub, most-starred first. enter (or click) shows what the install would run and asks before running any of it. The listing is re-queried each time you open this section.",loading:`Searching GitHub…`,empty:`No plugins listed.`,offline:`GitHub is unreachable — showing first-party plugins only. Re-open this section to retry.`,installedTag:`installed`,firstParty:`first-party`,preparing:`cloning {ref}…`,installing:`building and registering {name}…`,installed:`installed {id} v{version} — it is enabled, and appears under Plugins.`,cancelled:`install cancelled; nothing was run.`,failed:`install failed: {error}. Check the build output and retry from Marketplace.`,alreadyInstalled:`already installed as {id} — manage it under Plugins.`,confirmTitle:`Install {name}?`,confirmInstall:`install`,previewSource:`source: {source}`,previewCommands:`Commands this plugin declares:`,previewNoCommands:`This plugin declares no commands.`,previewWarning:`warning: {warning}`,previewTrust:`Installing runs the build commands above, and the rest run later on the events they declare. They run as you, with your environment, and nothing is sandboxed.`}},yA={plugins:{title:`插件`,hint:"先列 Rove 官方 mod:enter(或点击)安装或卸载,卸载后数据仍留在磁盘上。再列在 ~/.rove/plugins.json 里注册的插件:enter 切换启用/禁用——daemon 监听该文件,改动实时生效。插件下方缩进的行是它声明的设置项,enter 编辑,新值在插件下次运行时生效。安装与移除在 shell 里做:`rove plugin install <owner/repo>`、`rove plugin link <dir>`。",empty:"Kanban 和 Issues 是官方 mod:enter(或点击)安装。尚未注册其他插件;用 `rove plugin install <owner/repo>` 安装一个——可在 GitHub 的 `rove-plugin` 话题下浏览。",sourceLink:`本地链接 {path}`,sourceGithub:`{spec}`,sourceBuiltIn:`官方 mod · 未安装`,sourceBuiltInInstalled:`官方 mod · 已安装`,updateAvailable:`有新版本 — rove plugin update`,declares:`{actions} 个动作 · {events} 个事件 · {panes} 个面板`,declaresWithEngines:`{actions} 个动作 · {events} 个事件 · {panes} 个面板 · {engines} 个引擎`,declaresPages:`· {pages} 个页面`,pageFailed:`页面 {detail}`,manifestUnreadable:`manifest 无法解析;请检查rove-plugin.toml 的路径和 TOML 语法`,unsupportedPlatform:`· 不支持当前平台`,noHooks:`· 未声明钩子`,lastRun:`· 上次运行 {label} {status} {ago}前`,neverRun:`· 尚未运行过`,runOk:`成功`,runRunning:`仍在运行`,runFailed:"启动失败;请查看 `rove plugin log <id>`",runExit:`退出码 {code}`,settingUnset:`(未设置 — enter 编辑)`,settingInvalidTitle:`不是数字`,settingInvalidBody:`{label} 只接受数字,保留原值。`},marketplace:{title:`插件市场`,hint:"GitHub 上 `rove-plugin` 话题下发布的插件,按 star 数排序。enter(或点击)会先列出安装会执行的命令,确认后才真正执行。每次进入本区块都会重新查询列表。",loading:`正在搜索 GitHub…`,empty:`列表为空。`,offline:`GitHub 不可达——只显示首方插件。重新进入本区块可再试一次。`,installedTag:`已安装`,firstParty:`首方`,preparing:`正在克隆 {ref}…`,installing:`正在构建并注册 {name}…`,installed:`已安装 {id} v{version}——已启用,可在「插件」区块管理。`,cancelled:`已取消安装,没有执行任何命令。`,failed:`安装失败:{error}。请检查构建输出,再从插件市场重试。`,alreadyInstalled:`已安装为 {id}——在「插件」区块管理。`,confirmTitle:`安装 {name}?`,confirmInstall:`安装`,previewSource:`来源:{source}`,previewCommands:`该插件声明的命令:`,previewNoCommands:`该插件未声明任何命令。`,previewWarning:`警告:{warning}`,previewTrust:`安装会执行上面的 build 命令,其余命令会在它们声明的事件发生时执行。它们以你的身份、带你的环境变量运行,没有任何沙箱。`}},bA={en:{appearance:{enabled:`On`,disabled:`Off`,borderFlow:`Flowing gradient`,borderStill:`Still`,glyphsBraille:`Braille`,glyphsStarburst:`Starburst (needs a font with the Dingbats block)`,glyphsAscii:`ASCII`,titleShimmer:`Shimmer`,titleStill:`Still`,preview:`Workspace preview`,tasks:`Tasks`,terminal:`Terminal`,files:`Files`,testsPassed:`Tests passed`,transparent:`Transparent background`,opaque:`Opaque background`,modeDark:`Dark`,modeLight:`Light`,modeAuto:`Auto (follow the terminal)`,openHint:`Enter to choose an option and preview it.`,chooseHint:`↑/↓ or j/k preview · enter apply · esc cancel`},title:`Settings`,esc:`esc`,nav:{default:`j/k pick · h/l switch level · enter activate · esc close`,feedback:`tab next field · enter sends on Send · esc close`},sections:{general:`General`,engines:`Engines`,autoRouting:`Auto routing`,plugins:`Plugins`,marketplace:`Marketplace`,keys:`Keybindings`,feedback:`Feedback`,dev:`Dev`},general:{usage:`USAGE`,theme:`Theme`,themeMode:`Mode`,themeHint:`l to enter list · j/k to highlight · enter to apply`,language:`Language`,languageHint:`Display language for Rove's UI. l to enter list · j/k to highlight · enter to apply.`,transparent:`Transparent background`,transparentHint:`Drops the renderer's bg fill so the host terminal shows through. enter toggles.`,on:`[x] on`,off:`[ ] off`,focusAccent:`Focus accent`,focusAccentHint:`Color of focused pane title, ▌ marker, and split borders.`,accentPrimary:`Primary (brand accent)`,accentSuccess:`Success (legacy green)`,accentInfo:`Info (cool blue)`,appearance:`Appearance`,appearanceHint:`How split panes draw.`,splitStyle:`Split panes`,workingBorder:`Working border`,taskColors:`Task colors`,glyphSet:`State glyphs`,colorblind:`Colorblind diff colours`,runningTitle:`Running title`,splitBox:`Box frames`,splitLine:`Divider line`,splitRail:`Accent rail`,splitRule:`Top rule`,notifications:`Notifications`,notificationsHint:`When a background tab finishes or pauses on an approval.`,toast:`Toast`,toastHint:`bottom-right popup`,sound:`Sound`,soundHint:`bell + chime + an OSC 9 desktop notification (rides SSH)`,soundVolume:`Chime volume — {percent}%`,soundVolumeHint:`enter cycles; applies to the next chime`,crossTask:`Cross-task`,crossTaskHint:`also for a task you switched away from`,finishedAlerts:`Finished turns`,finishedAlertsHint:`off: only approvals and errors alert; the unread dot stays`,keyHints:`Keyboard hints`,keyHintsHint:`The status-bar reminder and the first-use hints in the sidebar and files panes.`,keyHintsShow:`Show keyboard hints`,keyHintsShowHint:`re-enabling relights hints dismissed by use`,zen:`Zen mode`,zenHint:"The `zen` chip and `prefix`+z hide Files, keeping the Tasks rail and workspace.",zenDefaultOn:`Start in zen mode`,updates:`Updates`,updatesHint:`Stable is the default channel; next previews the coming release; nightly is built from main every day.`,updateChannelTitle:`Release channel`,updateChannel:`Channel: {channel}`,updateChannelHint:"enter cycles stable / next / nightly; `rove update` follows it",updateChannelName:{latest:`stable`,next:`next preview`,nightly:`nightly preview`},updateNotify:`Notify on updates`,updateNotifyHint:`new versions on this channel; off hides the update chip, and checking by hand still reports`,updateCheck:`[ Check for updates ]`,updateCheckHint:`asks npm for the newest release on this channel right now`,updateCheckButton:`Check for updates`,updateChecking:`Checking…`,updateOpenPage:`Open Update page`,updateOpenPageRow:`[ Open Update page ]`,railFold:`Folded task rail`,railFoldHint:`What the rail shows once folded away from its corner control.`,railFoldRow:`Folded rail shows: {style}`,railFoldRowHint:`enter cycles`,railFoldGlyphs:`status glyphs`,railFoldInitials:`glyph + initials`,railFoldHairline:`colour band only`,editor:`Editor`,editorHint:`What enter opens a file with in the file tree — diff mode when the editor supports it, the read-only preview when it isn't installed.`,editorRow:`editor: < {kind} >`,editorRowHint:`auto follows $VISUAL / $EDITOR, else nvim / vim / emacs / nano`,editorCustom:`custom: {cmd}`,editorCustomUnset:`(unset — enter to edit)`,worktree:`Worktree location`,worktreeHint:`Where new task worktrees are created. New tasks only.`,worktreeBase:`location: < {kind} >`,worktreeBaseHint:"custom takes `~`, a relative path, or a leading `$project_dir`",worktreeKindDefault:`default ~/.rove/worktrees`,worktreeKindNext:`next to project`,worktreeKindCustom:`custom`,worktreeCustom:`custom: {path}`,worktreeCustomUnset:`(unset — enter to edit)`,worktreeBaseTitle:`Custom worktree location (blank = default; $project_dir = project root)`,worktreeBaseField:`PATH`,editorCustomTitle:`Custom editor command (use {file} for the path)`,worktreeBaseInvalidTitle:`Can't use that worktree location`,worktreeBaseTokenBody:`{token} only expands as the leading path segment (e.g. {token}/../rove-worktrees). Keeping the previous setting.`,worktreeBaseUnusableBody:`{path} isn't usable ({error}). Keeping the previous setting — pick a writable directory.`,terminal:`Terminal`,terminalHint:`Applies to terminals opened after the change.`,scrollbackRow:`scrollback: {rows} rows`,scrollbackRowHint:`100–100000 · larger costs proportionally more CPU per redraw`,scrollbackTitle:`Terminal scrollback rows (100–100000)`,scrollbackField:`ROWS`,scrollbackInvalidTitle:`Not a number`,scrollbackInvalidBody:`Scrollback must be a number of rows (e.g. 1000). Keeping the previous setting.`,tabStripRow:`tab strip: {mode}`,tabStripMode:{never:`off — the sidebar tree lists tabs`,multipleOnly:`only with 2+ tabs`,always:`always`}},field:{command:`COMMAND`,name:`NAME`,id:`ID`},action:{save:`save`,next:`next`,add:`add`},reset:{title:`Reset UI state?`,body:`Wipes ~/.config/rove/state.json and ~/.rove/tasks.json, then quits Rove — relaunch for a fresh start with an empty working session list. Worktrees on disk and engine session history are NOT touched.`,done:`Rove: UI state reset. Relaunch Rove to start fresh.`,failedTitle:`UI state was not reset`,failedBody:`Could not write the settings file. Your settings and tasks have been kept. Try resetting again.`},restart:{title:`Restart backend?`,body:`Stops the daemon and relaunches this Rove on the installed build, so daemon / orchestrator / engine edits take effect. Running engine sessions live in the PTY host and keep going; open tabs come back. Any other attached windows reconnect on their own.`,done:`Rove: restarting the backend...`},stateWrite:{failedTitle:`Settings were not saved`,failedBody:`{file} could not be written ({keys}). Check its directory permissions and free disk space, then save again.`},...fA,...gA,...vA,keybindings:{title:`Keybindings`,hint:`Rebind direct and prefix chords in your own YAML file; changes reload live. Press F1 anywhere for the live keymap with every binding id.`,configFile:`Config file`,notCreated:` (not created yet)`,prefixTitle:`Command layer ({prefix})`,prefixHint:`Bare keys act in the focused pane; a small one-press set covers frequent Rove actions; {prefix} opens the command layer ({timeout}ms second-stroke window). Prefix bindings keep their pane scope and modal rules.`,tapPresentation:`Prefix tap`,tapPresentationHint:`Choose whether the complete guide also marks controls already on screen.`,tapPresentationLocal:`On-screen entries + complete guide (default)`,tapPresentationGuide:`Complete guide only`,prefixDisabled:`disabled`,fixed:`Fixed (not rebindable): {ids}.`,createHint:`No overrides file yet. Rove can write one for you, fully commented — nothing is rebound until you uncomment a line.`,createFile:`[enter] Create keybindings.yaml`,overridesApplied:`Overrides applied`,none:`none`,unbound:`(unbound)`,defaultKeys:`default: {keys}`,warnings:`Warnings`},feedback:{title:`Feedback`,hint:"Sends a GitHub Discussion to the Rove repo through `gh`. Requires `gh auth login`; category defaults to Feedback.",titleLabel:`title`,titlePlaceholder:`Short summary`,descriptionLabel:`description`,descriptionPlaceholder:`What happened? (enter for a new line · tab to Send)`,send:`[enter] Send to GitHub Discussions`},...mA},zh:{appearance:{enabled:`开启`,disabled:`关闭`,borderFlow:`流动渐变`,borderStill:`静止`,glyphsBraille:`盲文点`,glyphsStarburst:`星芒(需要含 Dingbats 符号区的字体)`,glyphsAscii:`ASCII`,titleShimmer:`流光`,titleStill:`静止`,preview:`工作区预览`,tasks:`任务`,terminal:`终端`,files:`文件`,testsPassed:`测试通过`,transparent:`透明背景`,opaque:`不透明背景`,modeDark:`深色`,modeLight:`浅色`,modeAuto:`自动(跟随终端)`,openHint:`按 Enter 打开选项和预览。`,chooseHint:`↑/↓ 或 j/k 预览 · enter 应用 · esc 取消`},title:`设置`,esc:`esc`,nav:{default:`j/k 选择 · h/l 切换层级 · enter 确认 · esc 关闭`,feedback:`tab 下一项 · enter 在发送项发送 · esc 关闭`},sections:{general:`通用`,autoRouting:`自动路由`,engines:`引擎`,plugins:`插件`,marketplace:`插件市场`,keys:`快捷键`,feedback:`反馈`,dev:`开发`},general:{usage:`用量`,theme:`主题`,themeMode:`明暗`,themeHint:`l 进入列表 · j/k 高亮 · enter 应用`,language:`语言`,languageHint:`Rove 界面的显示语言。l 进入列表 · j/k 高亮 · enter 应用。`,transparent:`透明背景`,transparentHint:`去掉渲染器的背景填充,让宿主终端透出来。按 enter 切换。`,on:`[x] 开`,off:`[ ] 关`,focusAccent:`聚焦强调色`,focusAccentHint:`聚焦面板标题、▌ 标记和分隔边框的颜色。`,accentPrimary:`主色(品牌强调色)`,accentSuccess:`成功色(传统绿)`,accentInfo:`信息色(冷蓝)`,appearance:`外观`,appearanceHint:`分屏面板怎么画边。`,splitStyle:`分屏面板`,workingBorder:`运行中边框`,taskColors:`任务配色`,glyphSet:`状态符号`,colorblind:`色盲友好的增删配色`,runningTitle:`运行中标题`,splitBox:`方框边框`,splitLine:`单线分隔`,splitRail:`左侧强调条`,splitRule:`顶部横线`,notifications:`通知`,notificationsHint:`后台标签完成或在审批处暂停时触发。`,toast:`Toast 弹窗`,toastHint:`右下角弹窗`,sound:`声音`,soundHint:`响铃 + 提示音 + OSC 9 桌面通知(经 SSH 直达本地)`,soundVolume:`提示音音量 — {percent}%`,soundVolumeHint:`回车循环切换;下一声提示音生效`,crossTask:`跨任务`,crossTaskHint:`你已切走的任务也通知`,finishedAlerts:`回合完成`,finishedAlertsHint:`关闭后只有审批和错误会提醒;未读标记照常`,keyHints:`键盘提示`,keyHintsHint:`状态栏提醒,以及侧栏和文件面板的首用提示。`,keyHintsShow:`显示键盘提示`,keyHintsShowHint:`重新开启会点亮已因使用而熄灭的提示`,zen:`禅模式`,zenHint:"`zen` 标记和 `prefix`+z 隐藏 Files,保留 Tasks 侧栏与 workspace。",zenDefaultOn:`启动即进入禅模式`,updates:`更新`,updatesHint:`稳定版是默认渠道;next 预览即将发布的版本;nightly 每天从 main 自动构建。`,updateChannelTitle:`发布渠道`,updateChannel:`渠道:{channel}`,updateChannelHint:"enter 在稳定版 / next / nightly 间切换;`rove update` 跟随它",updateChannelName:{latest:`稳定版`,next:`next 预览版`,nightly:`nightly 预览版`},updateNotify:`有新版本时通知我`,updateNotifyHint:`只针对所选渠道;关闭后不再显示更新标记,手动检查仍会给出结果`,updateCheck:`[ 检查更新 ]`,updateCheckHint:`立即向 npm 查询所选渠道的最新版本`,updateCheckButton:`检查更新`,updateChecking:`检查中…`,updateOpenPage:`打开更新页`,updateOpenPageRow:`[ 打开更新页 ]`,railFold:`折叠后的任务栏`,railFoldHint:`任务栏从角标折叠之后显示什么。`,railFoldRow:`折叠后显示:{style}`,railFoldRowHint:`enter 切换`,railFoldGlyphs:`状态字形`,railFoldInitials:`字形 + 首字母`,railFoldHairline:`仅色带`,editor:`编辑器`,editorHint:`文件树里按 enter 用什么打开文件——支持时走编辑器 diff 模式,未安装时回退到只读预览。`,editorRow:`编辑器: < {kind} >`,editorRowHint:`auto 跟随 $VISUAL / $EDITOR,否则 nvim / vim / emacs / nano`,editorCustom:`自定义: {cmd}`,editorCustomUnset:`(未设置 — enter 编辑)`,worktree:`工作树位置`,worktreeHint:`新任务工作树的创建位置。仅对新任务生效。`,worktreeBase:`位置: < {kind} >`,worktreeBaseHint:"自定义可填 `~`、相对路径或以 `$project_dir` 开头",worktreeKindDefault:`默认 ~/.rove/worktrees`,worktreeKindNext:`项目旁边`,worktreeKindCustom:`自定义`,worktreeCustom:`自定义: {path}`,worktreeCustomUnset:`(未设置 — enter 编辑)`,worktreeBaseTitle:`自定义工作树位置(留空 = 默认;$project_dir = 项目根目录)`,worktreeBaseField:`路径`,editorCustomTitle:`自定义编辑器命令(用 {file} 代表文件路径)`,worktreeBaseInvalidTitle:`无法使用该工作树位置`,worktreeBaseTokenBody:`{token} 只能作为路径的第一段展开(如 {token}/../rove-worktrees)。保留原设置。`,worktreeBaseUnusableBody:`{path} 不可用({error})。保留原设置 —— 请选择一个可写目录。`,terminal:`终端`,terminalHint:`对修改后新打开的终端生效。`,scrollbackRow:`回滚行数: {rows} 行`,scrollbackRowHint:`100–100000 · 调大会按比例增加每次重绘的 CPU`,scrollbackTitle:`终端回滚行数(100–100000)`,scrollbackField:`行数`,scrollbackInvalidTitle:`不是数字`,scrollbackInvalidBody:`回滚行数必须是数字(如 1000)。保留原设置。`,tabStripRow:`标签栏: {mode}`,tabStripMode:{never:`关闭 — 标签在左侧树里`,multipleOnly:`仅 2 个以上标签时显示`,always:`始终显示`}},field:{command:`命令`,name:`名称`,id:`标识`},action:{save:`保存`,next:`下一步`,add:`添加`},reset:{title:`重置界面状态?`,body:`将清除 ~/.config/rove/state.json 和 ~/.rove/tasks.json 并退出 Rove —— 重新启动后会是一个干净的开始,工作会话列表为空。磁盘上的工作树和引擎会话历史不受影响。`,done:`Rove:界面状态已重置。重新启动 Rove 即可从头开始。`,failedTitle:`UI 状态未能重置`,failedBody:`无法写入设置文件。设置和任务均已保留,请稍后重新尝试重置。`},restart:{title:`重启后端?`,body:`会停掉 daemon,并以已安装的版本重新启动当前 Rove 窗口,从而让 daemon / orchestrator / 引擎的改动生效。正在运行的引擎会话由 PTY host 托管,不会中断;已打开的标签页会恢复。其他已连接的窗口会自行重连。`,done:`Rove:正在重启后端……`},stateWrite:{failedTitle:`设置未能保存`,failedBody:`{file} 写入失败({keys})。请检查目录权限和磁盘空间,再次保存。`},...pA,..._A,...yA,keybindings:{title:`快捷键`,hint:`在你自己的 YAML 文件里重绑定直接按键和 prefix 组合;修改会实时加载。任意位置按 F1 查看带每个绑定 id 的实时键位表。`,configFile:`配置文件`,notCreated:` (尚未创建)`,prefixTitle:`命令层({prefix})`,prefixHint:`裸键作用于当前聚焦面板;少量单次快捷键覆盖高频 Rove 操作;{prefix} 打开命令层(第二击窗口 {timeout}ms)。Prefix 绑定保持原有的面板作用域和 modal 规则。`,tapPresentation:`点按 Prefix`,tapPresentationHint:`选择完整指南是否同时标记当前屏幕上的入口。`,tapPresentationLocal:`屏幕入口 + 完整指南(默认)`,tapPresentationGuide:`仅完整指南`,prefixDisabled:`已禁用`,fixed:`固定(不可重绑定):{ids}。`,createHint:`还没有覆盖文件。Rove 可以帮你写一份带完整注释的——在你取消注释之前不会改动任何按键。`,createFile:`[enter] 创建 keybindings.yaml`,overridesApplied:`已应用的覆盖`,none:`无`,unbound:`(已解绑)`,defaultKeys:`默认: {keys}`,warnings:`警告`},feedback:{title:`反馈`,hint:"通过 `gh` 向 Rove 仓库发一条 GitHub Discussion。需要 `gh auth login`;分类默认为 Feedback。",titleLabel:`标题`,titlePlaceholder:`简短概括`,descriptionLabel:`描述`,descriptionPlaceholder:`发生了什么?(enter 换行 · tab 跳到发送)`,send:`[enter] 发送到 GitHub Discussions`},...hA}},xA={en:Ar,zh:jr};function $(e,t){return Ae(bA,e,t)}function SA(e,t){return Ae(xA,e,t)}function CA({label:e,value:t,picks:n,onPick:r}){return(0,V.jsx)(`fieldset`,{"aria-label":e,className:`m-0 inline-flex min-w-0 flex-wrap gap-0.5 rounded-sm border-hairline border-line bg-inset p-0.5`,children:n.map(e=>{let n=e.value===t;return(0,V.jsx)(`button`,{type:`button`,"aria-pressed":n,className:Me(`rounded-xs px-2.5 py-1 font-sans text-meta whitespace-nowrap touch:min-h-9`,`focus-visible:outline-1 focus-visible:outline-offset-1 focus-visible:outline-focus`,n?`bg-menu text-ink`:`text-muted hover:bg-hover`),onClick:()=>!n&&r(e.value),children:e.label},e.value)})})}function wA({label:e,value:t,picks:n,onPick:r}){return(0,V.jsxs)(`span`,{className:`relative inline-flex max-w-full min-w-0 text-ink`,children:[(0,V.jsx)(`select`,{"aria-label":e,value:t,className:`max-w-full min-w-0 truncate rounded-sm border-hairline border-line bg-paper py-1.25 pr-7 pl-2.5 font-sans text-meta hover:border-line-active focus-visible:border-line-active focus-visible:outline-none touch:min-h-10`,onChange:e=>{let t=n.find(t=>String(t.value)===e.target.value);t&&r(t.value)},children:n.map(e=>(0,V.jsx)(`option`,{value:e.value,children:e.label},e.value))}),(0,V.jsx)(Ia,{className:`pointer-events-none absolute top-1/2 right-2.5 -translate-y-1/2 text-subtle`})]})}var TA=`${Nn} w-narrow:pt-0`,EA=`dialog relative m-0 flex h-[min(640px,80vh)] w-[min(880px,calc(100vw-32px))] overflow-hidden rounded-md border-hairline border-line bg-surface text-inherit shadow-dialog focus:outline-none motion-safe:animate-rise-in [.is-leaving_&]:animate-sink-out w-narrow:h-dvh w-narrow:w-screen w-narrow:flex-col w-narrow:rounded-none w-narrow:border-0 short:h-[calc(100dvh-24px)]`,DA=`absolute top-3 right-3 z-1 grid size-7 place-items-center rounded-sm text-display leading-none text-muted hover:bg-inset hover:text-ink focus-visible:bg-inset focus-visible:text-ink touch:size-10`,OA=`flex w-56 flex-none flex-col gap-5 overflow-y-auto scrollbar-none [border-right:var(--hairline)_solid_var(--line)] px-2.5 py-4 w-narrow:w-full w-narrow:flex-1 w-narrow:[border-right:none] w-narrow:px-3 w-narrow:py-3`,kA=`m-0 px-2 pb-0.5 font-sans text-title font-semibold normal-nums text-ink`,AA=`flex flex-col gap-0.5`,jA=`m-0 px-2 pb-1 font-mono text-meta font-normal text-subtle`,MA=(e,t)=>`flex items-center rounded-sm px-2 py-1.25 text-left font-sans text-body touch:min-h-10 w-narrow:min-h-11 w-narrow:px-3 ${e?`bg-menu text-ink`:`${t?`text-muted`:`text-ink`} [&:hover]:bg-hover`}`,NA=`ml-auto hidden text-subtle w-narrow:block`,PA=`flex flex-col`,FA=`m-0 pb-2 text-meta text-subtle`,IA=`flex flex-col border-t-hairline border-t-line [&>*]:border-b-hairline [&>*]:border-b-line`,LA=`flex items-center justify-between gap-x-6 gap-y-2 py-3 w-narrow:flex-col w-narrow:items-stretch`,RA=`flex items-center justify-between gap-x-6 py-3`,zA=`flex flex-col gap-3 py-3`,BA=`flex min-w-0 flex-1 flex-col gap-0.5`,VA=`text-body text-ink`,HA=`text-meta text-muted [&_a]:text-accent`,UA=`max-w-90 min-w-0 truncate font-mono text-meta text-muted [overflow-wrap:anywhere]`,WA=`m-0 py-3 text-body text-muted`,GA=`rounded-sm border-hairline border-line bg-paper px-2.5 py-1.5 font-sans text-body text-ink focus-visible:border-line-active focus-visible:outline-none`,KA=`${GA} w-24 text-right`,qA=`flex flex-col gap-1.5`,JA=`text-meta font-medium text-muted`,YA=`min-h-30 max-h-[50vh] leading-[1.45]`,XA=`flex flex-wrap items-center justify-end gap-2.5`,ZA=`flex items-center gap-2.5 rounded-sm bg-inset px-3 py-2 text-meta`,QA=`grid grid-cols-[minmax(0,1fr)_104px_72px] items-center gap-3`,$A=`flex flex-col`,ej=`${QA} pb-1.5 pl-7.5 font-sans text-meta font-medium normal-nums text-subtle [&>span:not(:first-child)]:text-center`,tj=`border-b-hairline border-b-line first:border-t-hairline first:border-t-line`,nj=`${QA} group/eng rounded-sm py-1.5 pr-1 pl-0`,rj=`flex min-w-0 items-center gap-2 rounded-sm py-1.5 pr-0 pl-1.5 text-left focus-visible:outline-1 focus-visible:outline-offset-1 focus-visible:outline-focus`,ij=e=>`mx-0.5 ${e?`text-muted`:`text-subtle`}`,aj=`flex min-w-0 flex-col gap-0.5`,oj=e=>`truncate text-body leading-[inherit] font-medium ${e?`text-muted`:`text-ink`}`,sj=`ml-2 text-meta leading-[inherit] font-normal text-subtle`,cj={ready:`bg-success`,attention:`bg-warning`,error:`bg-error`,absent:`bg-subtle`},lj=e=>`inline-flex items-center gap-1.5 text-meta leading-[inherit] ${e===`error`?`text-error`:`text-muted`}`,uj=e=>`size-1.75 flex-none rounded-full ${cj[e]}`,dj=`flex justify-center`,fj=`rounded-full bg-accent-soft px-2.5 py-0.5 font-sans text-meta font-medium normal-nums capitalize text-accent`,pj=`rounded-full border-hairline border-line px-2.5 py-0.5 text-meta leading-[inherit] whitespace-nowrap text-muted opacity-0 transition-opacity duration-120 ease-[ease] group-hover/eng:opacity-100 group-focus-within/eng:opacity-100 hover:border-line-active hover:text-ink motion-reduce:transition-none touch:opacity-100`,mj=`mt-0 mr-1 mb-3 ml-7 flex flex-col gap-2.5 px-1.5 py-1`,hj=`m-0 grid grid-cols-[max-content_minmax(0,1fr)] gap-x-3.5 gap-y-1.5 text-meta leading-[1.5]`,gj=`text-subtle`,_j=e=>`m-0 wrap-anywhere ${e?`text-warning`:`text-ink`}`,vj=`flex items-center gap-2`,yj=`flex-1 px-2 py-1.25`,bj=`text-meta leading-[inherit] text-success`,xj=`flex items-center gap-3 py-2.5`,Sj=`flex min-w-0 flex-1 flex-col gap-0.5`,Cj=(e=!1)=>`overflow-hidden text-ellipsis text-meta text-muted ${e?`whitespace-normal`:`whitespace-nowrap`}`,wj=`flex flex-col gap-1 py-3`,Tj=`flex items-baseline gap-3`,Ej=`flex flex-col gap-2.5 pt-2`,Dj=`grid grid-cols-[repeat(auto-fill,minmax(96px,1fr))] gap-2`,Oj=`m-0 pb-1.5 text-meta font-medium text-subtle`,kj=e=>e?`border-accent bg-accent-soft`:`border-line hover:bg-hover`,Aj=`flex h-9 overflow-hidden rounded-xs border-hairline`,jj=`flex w-2/5 flex-col gap-0.75 p-1`,Mj=`flex min-w-0 flex-1 flex-col gap-0.75 p-1`,Nj=`h-0.75 rounded-xs`,Pj=`mt-auto flex gap-0.75`,Fj=`size-1 rounded-xs`,Ij=`flex min-w-0 items-baseline gap-1.5 font-sans text-meta`,Lj=`group relative h-4.5 w-7.5 flex-none justify-self-center rounded-full border-hairline border-line bg-inset transition-[background,border-color] duration-120 ease-[ease] aria-checked:border-accent aria-checked:bg-accent motion-reduce:transition-none`,Rj=`absolute top-0.5 left-0.5 size-3 rounded-full bg-muted transition-[transform,background] duration-120 ease-[ease] group-aria-checked:[transform:translateX(12px)] group-aria-checked:bg-paper motion-reduce:transition-none`;function zj({on:e,...t}){return(0,V.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":e,className:Lj,...t,children:(0,V.jsx)(`span`,{className:Rj})})}function Bj(e){return(0,V.jsxs)(`section`,{className:PA,children:[e.title&&(0,V.jsx)(`h2`,{className:`m-0 pb-1.5 font-sans text-meta font-medium normal-nums text-muted`,children:e.title}),e.hint&&(0,V.jsx)(`p`,{className:`m-0 pb-2 text-meta text-subtle`,children:e.hint}),(0,V.jsx)(`div`,{className:IA,children:e.children})]})}function Vj(e){let t=(0,V.jsxs)(`div`,{className:BA,children:[(0,V.jsx)(`span`,{id:e.labelId,className:VA,children:e.label}),e.hint&&(0,V.jsx)(`span`,{className:`text-meta text-muted [&_a]:text-accent`,children:e.hint})]});return e.stack?(0,V.jsxs)(`div`,{className:zA,children:[t,e.children]}):(0,V.jsxs)(`div`,{className:e.inline?RA:LA,children:[t,e.children&&(0,V.jsx)(`div`,{className:`flex min-w-0 flex-none items-center justify-end gap-2 w-narrow:justify-start`,children:e.children})]})}function Hj(e){let t=(0,g.useId)();return(0,V.jsx)(Vj,{label:e.label,hint:e.hint,labelId:t,inline:!0,children:(0,V.jsx)(zj,{on:e.checked,"aria-labelledby":t,disabled:e.disabled,onClick:()=>e.onChange(!e.checked)})})}var Uj=36;function Wj(e){let t=e.picks.length<=4&&e.picks.reduce((e,t)=>e+t.label.length,0)<=Uj?CA:wA;return(0,V.jsx)(Vj,{label:e.label,hint:e.hint,children:(0,V.jsx)(t,{label:e.label,value:e.value,picks:e.picks,onPick:e.onPick})})}function Gj(e){return(0,V.jsx)(Vj,{label:e.label,hint:e.note,children:(0,V.jsx)(`span`,{className:UA,children:e.value})})}var Kj=`flex items-baseline justify-between`,qj=`[&_b]:mr-2.5`,Jj=`my-2.5 flex flex-col`,Yj=e=>`flex gap-3 rounded-sm px-2 py-1 text-left text-[length:var(--fs-body)] ${e?`bg-menu`:``}`,Xj=`min-w-[14ch]`,Zj=`whitespace-nowrap text-[length:var(--fs-meta)] text-warning`,Qj=`rail-tight:hidden`,$j=`[&_h2]:mx-0 [&_h2]:mt-3.5 [&_h2]:mb-1 [&_h2]:text-[length:var(--fs-body)]`,eM=`max-h-[55vh] overflow-x-hidden overflow-y-auto`,tM=`mr-auto text-[length:var(--fs-meta)]`,nM=`text-[length:var(--fs-body)] leading-[1.55] wrap-anywhere [&_h3]:mx-0 [&_h3]:mt-3 [&_h3]:mb-1.5 [&_h3]:font-sans [&_h3]:text-meta [&_h3]:font-medium [&_h3]:normal-nums [&_h3]:text-muted [&_h3:first-child]:mt-0 [&_ul]:m-0 [&_ul]:pl-4.5 [&_li+li]:mt-2 [&_p]:mx-0 [&_p]:mt-0 [&_p]:mb-2 [&_a]:text-accent [&_a]:underline [&_a]:underline-offset-2 [&_code]:rounded-sm [&_code]:bg-inset [&_code]:px-1 [&_code]:py-0 [&_code]:font-mono [&_code]:text-meta [&_code]:font-normal [&_code]:normal-nums`,rM=`mt-3`,iM=e=>`rounded-sm px-2 py-1.25 ${e?`bg-menu`:``}`,aM=`flex items-baseline gap-2 text-[length:var(--fs-body)]`,oM=`flex items-baseline justify-between gap-2`,sM=`font-mono`,cM=`truncate`,lM=`mt-4 text-[length:var(--fs-meta)]`;function uM(e){return e.replace(/\[`[0-9a-f]{7,40}`\]\([^)]*\)\s*/g,``).replace(/\s+[—-]\s+\[@[^\]]+\]\([^)]*\)\s*$/,``).trim()}function dM(e){let t=[],n=(e,n)=>t.push({kind:e,text:n,id:t.length});for(let r of e.split(/\r?\n/)){let e=r.trimEnd();if(e.trim()===``)continue;let i=/^#{1,6}\s+(.*)$/.exec(e);if(i){n(`heading`,i[1]??``);continue}let a=/^\s*[-*]\s+(.*)$/.exec(e);if(a){n(`item`,a[1]??``);continue}let o=t.at(-1);o&&o.kind!==`heading`?o.text=`${o.text} ${e.trim()}`:n(`para`,e.trim())}return t.map(e=>e.kind===`item`?{...e,text:uM(e.text)}:e)}var fM=/\[([^\]]+)\]\((https?:\/\/[^)\s]+)\)|`([^`]+)`|\*\*([^*]+)\*\*/g;function pM(e){let t=[],n=0;for(let r of e.matchAll(fM)){let i=r.index??0;i>n&&t.push(e.slice(n,i));let[a,o,s,c,l]=r;o!==void 0&&s!==void 0?t.push((0,V.jsx)(`a`,{href:s,target:`_blank`,rel:`noopener noreferrer`,children:pM(o)},i)):c===void 0?l!==void 0&&t.push((0,V.jsx)(`b`,{children:l},i)):t.push((0,V.jsx)(`code`,{children:c},i)),n=i+a.length}return n<e.length&&t.push(e.slice(n)),t}function mM({body:e}){let t=dM(e),n=[],r=[],i=()=>{r.length>0&&n.push((0,V.jsx)(`ul`,{children:r},`ul-${n.length}`)),r=[]};for(let e of t){if(e.kind===`item`){r.push((0,V.jsx)(`li`,{children:pM(e.text)},e.id));continue}i(),n.push(e.kind===`heading`?(0,V.jsx)(`h3`,{children:e.text},e.id):(0,V.jsx)(`p`,{children:pM(e.text)},e.id))}return i(),(0,V.jsx)(`div`,{className:nM,children:n})}var hM=`page min-h-0 flex-1 rounded-md border-hairline border-line bg-paper px-4.5 py-3.5 focus:outline-none`,gM=`${hM} overflow-y-auto`,_M=`page-title mx-0 mt-0 mb-1.5 font-sans text-title font-bold normal-nums`,vM=`flex items-baseline justify-between gap-4 [&_.page-title]:m-0`,yM=e=>`min-w-0 truncate text-meta ${e?``:`leading-[inherit]`}`,bM=`flex flex-wrap items-center gap-2`,xM={row:`touch:after:-inset-x-0.75 touch:after:-inset-y-0.5`,kanban:`touch:after:-inset-x-0.75 touch:after:-top-1.5 touch:after:-bottom-1`,header:`touch:after:-inset-x-0.75 touch:after:-top-2.5 touch:after:-bottom-1.25`},SM=`mt-2.5 flex flex-col gap-1.5`,CM=e=>`flex cursor-pointer flex-col gap-0.5 rounded-sm px-2.5 py-1.5 ${e?`bg-menu`:``}`,wM=`flex min-w-0 items-baseline gap-2.5`,TM=`whitespace-nowrap text-muted`,EM=`flex gap-2.5 pl-[4ch] text-meta leading-[inherit] text-muted`,DM=`min-w-0 flex-1 truncate`,OM=`flex flex-col px-1.5 pb-2`,kM=`flex flex-col border-t-hairline border-t-line px-1.5 pt-0.5 pb-0.5`,AM=`relative flex flex-col`,jM=e=>`flex items-center rounded-sm px-2 py-0.75 text-left touch:min-h-10 ${e?`bg-menu text-ink`:`text-muted [&:hover]:bg-hover`}`,MM=`ml-auto -mr-[4.5px] w-5 text-center font-sans text-display leading-none font-normal text-accent normal-nums`,NM=`mr-[7px] size-3.5 flex-none fill-none stroke-current stroke-[1.75] [stroke-linecap:round] [stroke-linejoin:round]`,PM=_(null),FM=(e,t)=>e.replace(/\{(\w+)\}/g,(e,n)=>t[n]??e),IM=e=>`https://github.com/Sma1lboy/rove/releases/tag/v${e}`;function LM(){return B()===`zh`?Fr:Pr}function RM(e,t){return e.request(`update.check`,{force:!0,locale:Ee.get(),channel:t}).then(e=>(PM.set(e),!0),()=>!1)}function zM(){let e=LM(),t=v(PM),{prefs:n}=R_();return!n.updateNotify||!t?.info?.hasUpdate?null:(0,V.jsxs)(`button`,{type:`button`,className:`${U} text-muted ${Zj} ${Ge}`,title:FM(e.chip,{version:t.info.latest}),onClick:()=>ya(`update`),children:[`↑`,(0,V.jsxs)(`span`,{className:Qj,children:[` `,t.info.latest]})]})}function BM({client:e}){let t=LM(),n=v(PM),[r,i]=(0,g.useState)(!1),[a,o]=(0,g.useState)(`release`),[s,c]=(0,g.useState)(null),l=(0,g.useRef)(null);(0,g.useEffect)(()=>{l.current?.focus(),RM(e).finally(()=>i(!0))},[e]);let u=n?.info??null,d=n?.current??``,f=u?.latest??d,p=u?.hasUpdate===!0,m=r&&u===null,h=r&&u!==null&&!p,_=n?.notes??[],y=_[0]?.url??(f?IM(f):null),b=[{id:`release`,key:`R`,label:t.actions.openRelease,detail:y??t.releaseUrlUnavailable},{id:`close`,key:`Q`,label:t.actions.close,detail:t.actions.closeDetail}],x=e=>{if(e===`close`)return un.set(null);c(y&&window.open(y,`_blank`,`noopener`)!==null?t.statusReleaseOpened:t.statusReleaseError)};return(0,V.jsxs)(`div`,{className:gM,tabIndex:0,ref:l,onKeyDown:e=>{if(e.ctrlKey&&!e.metaKey&&!e.altKey&&e.key.toLowerCase()===`c`&&!window.getSelection()?.toString())return e.preventDefault(),x(`close`);if(e.metaKey||e.ctrlKey||e.altKey)return;let t=b.findIndex(e=>e.id===a);if(e.key===`j`||e.key===`ArrowDown`)o(b[(t+1)%b.length]?.id??`close`);else if(e.key===`k`||e.key===`ArrowUp`)o(b[(t-1+b.length)%b.length]?.id??`close`);else if(e.key===`Enter`)x(a);else if(e.key===`r`)x(`release`);else if(e.key===`q`||e.key===`Escape`)x(`close`);else return;e.preventDefault()},children:[(0,V.jsxs)(`div`,{className:Kj,children:[(0,V.jsx)(`h1`,{className:_M,children:t.pageTitle}),(0,V.jsx)(`button`,{type:`button`,className:`${en} mono`,onClick:()=>x(`close`),children:ts()?z(`dialog.close`):t.closeHint})]}),(0,V.jsxs)(`p`,{className:`mono ${qj}`,children:[(0,V.jsx)(`span`,{className:`text-muted`,children:t.current}),` `,(0,V.jsxs)(`b`,{children:[`v`,d]}),` `,(0,V.jsx)(`span`,{className:`text-muted`,children:t.latest}),` `,m?(0,V.jsx)(`b`,{className:`text-muted`,children:t.latestUnknown}):r?(0,V.jsxs)(`b`,{className:p?`text-warning`:`text-success`,children:[`v`,f]}):(0,V.jsx)(`span`,{className:`text-muted`,children:`…`})]}),m&&(0,V.jsx)(`p`,{className:`text-muted`,children:t.registryRetry}),h&&(0,V.jsx)(`p`,{className:`text-success`,children:t.upToDate}),p&&(0,V.jsx)(`p`,{className:`mono text-muted`,children:`rove update`}),(0,V.jsx)(`div`,{className:Jj,children:b.map(e=>(0,V.jsxs)(`button`,{type:`button`,className:Yj(a===e.id),onClick:()=>x(e.id),children:[(0,V.jsxs)(`span`,{className:`mono keys-only text-accent`,children:[`[`,e.key,`]`]}),(0,V.jsx)(`span`,{className:Xj,children:e.label}),(0,V.jsx)(`span`,{className:`text-muted`,children:e.detail})]},e.id))}),s&&(0,V.jsx)(`p`,{className:`mono text-accent`,children:s}),p&&(0,V.jsx)(`p`,{className:`mono text-muted`,children:FM(t.changesSectionHeader,{from:d,to:f})}),!r&&(0,V.jsx)(`p`,{className:`text-muted`,children:t.loadingNotes}),r&&p&&_.length===0&&(0,V.jsx)(`p`,{className:`text-muted`,children:t.notesUnavailable}),_.map(e=>(0,V.jsxs)(`section`,{className:$j,children:[(0,V.jsxs)(`h2`,{className:`mono`,children:[`v`,e.version]}),(0,V.jsx)(mM,{body:e.body})]},e.version))]})}var VM=`rove.whatsNewSeenVersion`,HM=e=>e.split(/[.-]/).slice(0,3).map(Number),UM=(e,t)=>{let[n,r]=[HM(e),HM(t)];for(let e=0;e<3;e++)if((n[e]??0)!==(r[e]??0))return(n[e]??0)>(r[e]??0);return!1};function WM(e,t){let n=localStorage.getItem(VM);localStorage.setItem(VM,t),!(!n||!UM(t,n))&&e.request(`release.notes`,{version:t.replace(/-.*$/,``),locale:Ee.get()}).then(e=>W.set((0,V.jsx)(GM,{from:n,to:t,notes:e.notes})),()=>W.set((0,V.jsx)(GM,{from:n,to:t,notes:null})))}function GM(e){let t=LM(),n=(0,g.useRef)(null);return(0,g.useEffect)(()=>n.current?.focus(),[]),(0,g.useEffect)(()=>{let e=e=>{e.key===`q`&&W.set(null)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),(0,V.jsxs)(cr,{title:t.whatsNew.title,wide:!0,children:[(0,V.jsx)(`p`,{className:`text-muted`,children:FM(t.whatsNew.upgraded,{from:e.from,to:e.to})}),(0,V.jsx)(`div`,{className:eM,children:e.notes?(0,V.jsx)(mM,{body:e.notes.body}):(0,V.jsx)(`p`,{className:`text-muted`,children:t.whatsNew.notesUnavailable})}),(0,V.jsxs)(`div`,{className:rn,children:[(0,V.jsx)(`span`,{className:`mono text-muted ${tM} touch:hidden!`,children:z(`whatsNew.keys`)}),(0,V.jsx)(`a`,{className:en,href:e.notes?.url??IM(e.to),target:`_blank`,rel:`noopener noreferrer`,children:z(`whatsNew.openRelease`)}),(0,V.jsx)(`button`,{ref:n,type:`button`,className:Pe(),onClick:()=>W.set(null),children:z(`whatsNew.continue`)})]})]})}var KM=(e,t)=>e.replace(`{version}`,t);function qM({client:e}){let t=LM(),n=v(PM),{prefs:r}=R_(),[i,a]=(0,g.useState)(`idle`),o=()=>{a(`checking`),RM(e,r.updateChannel).then(e=>a(e?`done`:`failed`))},s=t=>{a(`idle`),L_(e,`updateChannel`,t)},c=n?.info??null,l=i===`failed`||i===`done`&&c===null,u=i===`done`&&n&&c?c.hasUpdate?KM(t.available,c.latest):t.upToDate:l?t.latestUnknown:void 0,d=l?`text-muted`:c?.hasUpdate?`text-warning`:`text-success`;return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Wj,{label:$(`general.updateChannelTitle`),hint:$(`general.updatesHint`),value:r.updateChannel,picks:dA.map(e=>({value:e,label:$(`general.updateChannelName.${e}`)})),onPick:s}),(0,V.jsx)(Hj,{label:$(`general.updateNotify`),hint:$(`general.updateNotifyHint`),checked:r.updateNotify,onChange:t=>void L_(e,`updateNotify`,t)}),(0,V.jsxs)(Vj,{label:$(`general.updates`),hint:$(`general.updateCheckHint`),children:[i===`done`&&c?.hasUpdate&&(0,V.jsx)(H,{variant:`action`,onClick:()=>ya(`update`),children:$(`general.updateOpenPage`)}),(0,V.jsx)(H,{variant:`action`,disabled:i===`checking`,onClick:o,children:$(i===`checking`?`general.updateChecking`:`general.updateCheckButton`)})]}),u&&(0,V.jsx)(Vj,{label:(0,V.jsx)(`span`,{className:d,children:u}),hint:c?.hasUpdate?(0,V.jsx)(`code`,{className:`font-mono`,children:`rove update`}):void 0,children:i===`done`&&n&&c&&(0,V.jsx)(`span`,{className:`max-w-90 min-w-0 truncate font-mono text-meta text-muted [overflow-wrap:anywhere]`,title:`${t.latest} v${c.latest}`,children:`${t.current} v${n.current} · ${t.latest} v${c.latest}`})})]})}function JM({client:e}){let[t,n]=(0,g.useState)(()=>Hs(e,`daemon.info`)??null);return(0,g.useEffect)(()=>{Ws(e,`daemon.info`).then(n,()=>n(null))},[e]),(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(Bj,{title:z(`settings.about.groupRove`),children:[t?.daemonVersion&&(0,V.jsx)(Vj,{label:z(`settings.about.daemon`),hint:z(t.stale?`settings.about.daemonStale`:`settings.about.daemonCurrent`,{version:t.daemonVersion})}),(0,V.jsx)(qM,{client:e})]}),(0,V.jsx)(Bj,{title:z(`settings.about.browser`),children:(0,V.jsx)(Vj,{label:z(`settings.about.signOut`),hint:z(`settings.about.browserHint`),children:(0,V.jsx)(H,{variant:`action`,onClick:()=>void Na().then(()=>window.location.reload()),children:z(`settings.about.signOut`)})})})]})}async function YM(e,t){let{taskId:n}=await e.client.request(`task.openScratch`);await VC(e,n,{kind:`engine`,prompt:t}),Cn()}var XM=_(null);function ZM({theme:e,mode:t}){let n=e[t],r=(e,t)=>({background:e,width:t});return(0,V.jsxs)(`span`,{className:Aj,style:{background:n.background,borderColor:n.border},"aria-hidden":!0,children:[(0,V.jsxs)(`span`,{className:jj,style:{background:n.backgroundPanel},children:[(0,V.jsx)(`span`,{className:Nj,style:r(n.primary,`70%`)}),(0,V.jsx)(`span`,{className:Nj,style:r(n.textMuted,`85%`)}),(0,V.jsx)(`span`,{className:Nj,style:r(n.textMuted,`55%`)})]}),(0,V.jsxs)(`span`,{className:Mj,children:[(0,V.jsx)(`span`,{className:Nj,style:r(n.text,`90%`)}),(0,V.jsx)(`span`,{className:Nj,style:r(n.textMuted,`65%`)}),(0,V.jsx)(`span`,{className:Nj,style:r(n.accent??n.primary,`40%`)}),(0,V.jsx)(`span`,{className:Pj,children:[n.success,n.warning,n.error,n.info].map((e,t)=>(0,V.jsx)(`span`,{className:Fj,style:{background:e}},t))})]})]})}function QM(e){return(0,V.jsxs)(H,{variant:`card`,"aria-pressed":e.active,className:kj(e.active),onMouseEnter:()=>k_.set(e.theme),onFocus:()=>k_.set(e.theme),onClick:e.onClick,children:[(0,V.jsx)(ZM,{theme:e.theme,mode:e.mode}),(0,V.jsxs)(`span`,{className:Ij,children:[(0,V.jsx)(`span`,{className:`truncate text-ink`,children:e.theme.name}),e.tag&&(0,V.jsx)(`span`,{className:`text-subtle`,children:e.tag})]})]})}function $M({children:e}){return(0,V.jsx)(`div`,{className:Dj,onMouseLeave:()=>k_.set(null),onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||k_.set(null)},children:e})}function eN(e){let{model:t}=e,{client:n}=t,r=v(XM),[i,a]=(0,g.useState)(null),[o,s]=(0,g.useState)(null),[c,l]=(0,g.useState)(!1),[u,d]=(0,g.useState)(!1);(0,g.useEffect)(()=>()=>k_.set(null),[]),(0,g.useEffect)(()=>void I_(n).catch(()=>void 0),[n]),(0,g.useEffect)(()=>{XM.get()===null&&n.request(`theme.hosted`).then(e=>XM.set(e),()=>XM.set({themes:[],dir:null}))},[n]);let f=e=>{l(!1),YM(t,z(`prefs.themeAgentPrompt`,{dir:e})).catch(()=>l(!0))},p=r?.dir??null,m=async e=>{a(e),s(null);try{await n.request(`theme.install`,{name:e}),await I_(n),await L_(n,`theme`,e)}catch{s(e)}finally{a(null)}},h=new Set(e.themes.map(e=>e.name)),_=(r?.themes??[]).filter(e=>!h.has(e.name));return(0,V.jsxs)(Vj,{label:e.label,hint:z(`prefs.themePreviewHint`),stack:!0,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`p`,{className:Oj,children:z(`prefs.themeInstalled`)}),(0,V.jsx)($M,{children:e.themes.map(t=>(0,V.jsx)(QM,{theme:t,mode:e.mode,active:t.name===e.value,tag:t.bundled?void 0:z(`prefs.themeUser`),onClick:()=>t.name!==e.value&&void L_(n,`theme`,t.name)},t.name))})]}),_.length>0&&(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(H,{className:`inline-flex items-center gap-1.5`,"aria-expanded":u,onClick:()=>d(!u),children:[(0,V.jsx)(Ia,{right:!u}),u?z(`prefs.themeHide`):z(`prefs.themeBrowse`,{count:_.length})]}),u&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`p`,{className:`m-0 pb-1.5 text-meta font-medium text-subtle mt-2.5`,children:z(`prefs.themeMoreHint`)}),(0,V.jsx)($M,{children:_.map(t=>(0,V.jsx)(QM,{theme:t,mode:e.mode,active:!1,tag:i===t.name?z(`prefs.themeInstalling`):o===t.name?z(`prefs.themeInstallFailed`):z(`prefs.themeGet`),onClick:()=>i===null&&void m(t.name)},t.name))})]})]}),p&&(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2.5`,children:[(0,V.jsx)(H,{variant:`action`,onClick:()=>f(p),children:z(`prefs.themeAgent`)}),(0,V.jsx)(`span`,{className:`text-meta text-muted [&_a]:text-accent`,children:z(c?`prefs.themeAgentFailed`:`prefs.themeAgentHint`)})]})]})}var tN=_({}),nN=``,rN=`(prefers-color-scheme: dark)`;function iN(e){let t=window.matchMedia(rN);return t.addEventListener(`change`,e),()=>t.removeEventListener(`change`,e)}function aN(){return(0,g.useSyncExternalStore)(iN,()=>window.matchMedia(rN).matches)}function oN(){let e=aN();return __(R_().prefs.themeMode,e)}function sN(e){let t=oN(),n=R_();(0,g.useEffect)(()=>{if(!n.loaded||n.prefs.taskColors!==`on`)return;let r=`${n.prefs.theme}/${t}`;r!==nN&&(nN=r,tN.set({}));let i=()=>{let i=tN.get(),a=e.tasks.get(),o=[...a?.tasks??[],...a?.archived??[]].map(e=>e.id).filter(e=>!(e in i));o.length!==0&&e.client.request(`theme.taskColors`,{theme:n.prefs.theme,mode:t,taskIds:o}).then(e=>{nN===r&&tN.set({...tN.get(),...e.colors})}).catch(()=>void 0)};return i(),e.tasks.subscribe(i)},[e,t,n.loaded,n.prefs.taskColors,n.prefs.theme])}function cN(e){let t=R_(),n=v(tN);return e&&t.prefs.taskColors===`on`?n[e]:void 0}var lN={themeMode:{dark:`appearance.modeDark`,light:`appearance.modeLight`,auto:`appearance.modeAuto`},focusAccent:{primary:`general.accentPrimary`,success:`general.accentSuccess`,info:`general.accentInfo`},splitStyle:{box:`general.splitBox`,line:`general.splitLine`,rail:`general.splitRail`,rule:`general.splitRule`},railFold:{glyphs:`general.railFoldGlyphs`,initials:`general.railFoldInitials`,hairline:`general.railFoldHairline`},workingBorder:{flow:`appearance.borderFlow`,still:`appearance.borderStill`},glyphSet:{braille:`appearance.glyphsBraille`,starburst:`appearance.glyphsStarburst`,ascii:`appearance.glyphsAscii`},runningTitle:{shimmer:`appearance.titleShimmer`,still:`appearance.titleStill`}};function uN({model:e}){let{client:t}=e,n=R_(),r=oN(),i=v(RT),a=(e,n)=>void L_(t,e,n),o=(e,t,r)=>(0,V.jsx)(Wj,{label:$(t),hint:r,value:n.prefs[e],picks:z_(n,e).map(t=>({value:t,label:e===`themeMode`&&t===`auto`?z(`prefs.modeAuto`):$(lN[e]?.[String(t)]??String(t))})),onPick:t=>a(e,t)}),s=(e,t,r)=>(0,V.jsx)(Hj,{label:$(t),hint:r,checked:e===`transparent`?n.prefs.transparent:n.prefs[e]===`on`,onChange:t=>a(e,e===`transparent`?t:t?`on`:`off`)});return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(Bj,{children:[(0,V.jsx)(eN,{model:e,label:$(`general.theme`),themes:n.themes,value:n.prefs.theme,mode:r}),o(`themeMode`,`general.themeMode`)]}),(0,V.jsxs)(Bj,{title:z(`settings.appearance.groupColours`),children:[o(`focusAccent`,`general.focusAccent`,$(`general.focusAccentHint`)),s(`taskColors`,`general.taskColors`,z(`settings.appearance.taskColorsNote`)),s(`colorblind`,`general.colorblind`,z(`settings.appearance.colorblindNote`))]}),(0,V.jsxs)(Bj,{title:z(`settings.appearance.groupTasks`),children:[o(`workingBorder`,`general.workingBorder`,z(`settings.appearance.workingBorderNote`)),o(`runningTitle`,`general.runningTitle`),o(`glyphSet`,`general.glyphSet`),o(`railFold`,`general.railFold`,$(`general.railFoldHint`)),(0,V.jsx)(Wj,{label:z(`settings.appearance.railGroup`),value:i,picks:IT.map(e=>({value:e,label:z(e===`state`?`settings.appearance.railGroupState`:`settings.appearance.railGroupProject`)})),onPick:zT})]}),(0,V.jsxs)(Bj,{title:z(`settings.appearance.groupTerminal`),hint:z(`prefs.terminalOnly`),children:[s(`transparent`,`general.transparent`),o(`splitStyle`,`general.splitStyle`)]})]})}function dN(e,t,n){if(t===`offline`)return`offline`;if(t===`unsupported`||t===`mismatch`)return`outdated`;if(!e)return`loading`;let r=e.status;return r?r.gh?r.account?r.account===n?`same`:`different`:`signedOut`:`noGh`:e.reason===`failed`||!e.reason?`failed`:e.reason}var fN=2e3,pN=e=>e?.login?.state===`pending`||e?.login?.state===`syncing`;function mN(e){let{client:t}=e,n=CE(e),[r,i]=(0,g.useState)({}),a=n.flatMap(e=>e.state===`online`?[e.alias]:[]).join(`
115
115
  `),o=(0,g.useMemo)(()=>a?a.split(`
116
116
  `):[],[a]),s=(0,g.useRef)(new Set),c=(0,g.useCallback)(async e=>{let n=e===``?{}:{machine:e},r=await t.request(`github.status`,n).catch(e=>({status:null,reason:`failed`,message:K(e)}));i(t=>({...t,[e]:r}))},[t]),l=(0,g.useCallback)(()=>Promise.all([``,...o].map(c)).then(()=>{}),[c,o]);return(0,g.useEffect)(()=>{l()},[l]),(0,g.useEffect)(()=>{let e=new Set(Object.entries(r).flatMap(([e,t])=>pN(t.status)?[e]:[])),t=[...s.current].some(t=>!e.has(t));if(s.current=e,t&&l(),e.size===0)return;let n=window.setTimeout(()=>{for(let t of e)c(t)},fN);return()=>window.clearTimeout(n)},[r,c,l]),{machines:n,probes:r,refresh:l,probe:c,act:(0,g.useCallback)(async(e,n)=>{try{let r=await t.request(e,n);return r.ok||G(r.message,`error`),r}catch(e){return G(K(e),`error`),null}},[t])}}var hN={same:`markSame`,different:`markDifferent`,signedOut:`markSignedOut`,noGh:`markNoGh`,outdated:`markOutdated`,offline:`markOffline`,denied:`markDenied`,failed:`markFailed`},gN=(e,t)=>z(`settings.connectors.${e}`,t),_N={same:`text-diff-added`,signedOut:`text-diff-removed`,failed:`text-diff-removed`,denied:`text-diff-removed`,different:`text-warning`,outdated:`text-warning`,offline:`text-muted`,noGh:`text-muted`,loading:`text-muted`};function vN(e,t){return e===`loading`?gN(`loading`):gN(hN[e],{login:t?.account??``})}function yN(e){if(!e?.gh)return``;let t=e.ssh.ok?`✓ ${e.ssh.user??``}`.trim():`✗`;return gN(`detail`,{protocol:e.protocol??`—`,ssh:t})}function bN(){return(0,V.jsx)(`svg`,{className:`flex-none`,viewBox:`0 0 16 16`,width:`22`,height:`22`,"aria-hidden":`true`,children:(0,V.jsx)(`path`,{fill:`currentColor`,d:`M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z`})})}function xN(e){navigator.clipboard.writeText(e).then(()=>G(gN(`codeCopied`)),()=>{})}function SN({login:e,onCancel:t}){return e.state===`failed`?(0,V.jsxs)(`div`,{className:ZA,children:[(0,V.jsx)(`span`,{className:`text-muted`,children:gN(`loginFailed`,{error:e.error??``})}),(0,V.jsx)(H,{className:`ml-auto`,onClick:t,children:gN(`dismiss`)})]}):e.state===`syncing`?(0,V.jsx)(`div`,{className:ZA,children:(0,V.jsx)(`span`,{className:`text-muted`,children:gN(`syncing`)})}):(0,V.jsxs)(`div`,{className:ZA,children:[e.code?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`button`,{type:`button`,className:`font-mono font-normal normal-nums rounded-sm border-hairline border-dashed border-line px-2 py-0.5 text-display tracking-code`,title:gN(`codeHint`),onClick:()=>xN(e.code??``),children:e.code}),(0,V.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer`,children:gN(`openGithub`)})]}):(0,V.jsx)(`span`,{className:`text-muted`,children:gN(`loading`)}),(0,V.jsx)(H,{className:`ml-auto`,onClick:t,children:z(`dialog.cancel`)})]})}function CN(e){let t=dN(e.probe,e.machine,e.rove),n=e.probe?.status??null,r=pN(n),i=t===`different`||t===`signedOut`,a=n?.login;return(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`div`,{className:xj,children:[(0,V.jsxs)(`div`,{className:Sj,children:[(0,V.jsx)(`span`,{className:VA,children:e.name}),(0,V.jsx)(`span`,{className:Cj(),title:[n?.authDetail,n?.ssh.detail].filter(Boolean).join(`, `)||void 0,children:yN(n)})]}),(0,V.jsx)(`span`,{className:`whitespace-nowrap text-meta ${_N[t]}`,title:e.probe?.message,children:vN(t,n)}),e.onSync&&i&&e.rove&&!r&&(0,V.jsx)(H,{variant:`action`,disabled:e.busy,onClick:e.onSync,children:gN(`useRove`)}),e.onLogin&&i&&!r&&(0,V.jsx)(H,{variant:`action`,disabled:e.busy,onClick:e.onLogin,children:gN(`loginThere`)})]}),a&&(0,V.jsx)(`div`,{className:`pb-3`,children:(0,V.jsx)(SN,{login:a,onCancel:e.onCancel})})]})}function wN({model:e}){let{machines:t,probes:n,refresh:r,probe:i,act:a}=mN(e),[o,s]=(0,g.useState)(null),[c,l]=(0,g.useState)(!1),u=n[``],d=u?.status?.account??null,f=pN(u?.status),p=async(e,t)=>{s(e);try{await t()}finally{s(null)}},m=e=>p(e,async()=>{await a(`github.login`,e===``?{}:{machine:e}),await i(e)}),h=e=>p(e,async()=>{await a(`github.login`,e===``?{cancel:!0}:{machine:e,cancel:!0}),await i(e)}),_=e=>p(e,async()=>{(await a(`github.sync`,{machine:e}))?.ok&&G(gN(`synced`,{machine:e,login:d??``})),await i(e)}),v=()=>p(``,async()=>{(await a(`github.logout`,{}))?.ok&&l(!1),await r()});return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Bj,{children:(0,V.jsxs)(`div`,{children:[(0,V.jsx)(Vj,{label:(0,V.jsxs)(`span`,{className:`flex items-center gap-2.5`,children:[(0,V.jsx)(bN,{}),`GitHub`]}),hint:gN(`githubDescription`),children:d?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`span`,{className:UA,children:[`@`,d]}),(0,V.jsx)(H,{variant:`action`,disabled:o!==null,onClick:()=>l(!0),children:gN(`disconnect`)})]}):!f&&(0,V.jsx)(H,{variant:`filled`,disabled:o!==null||!u,onClick:()=>void m(``),children:gN(`connect`)})}),c&&(0,V.jsx)(`div`,{className:`pb-3`,children:(0,V.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-sm border-hairline border-line bg-inset px-3 py-2.5 [&_p]:m-0 [&_p]:text-meta [&_p]:text-muted`,children:[(0,V.jsx)(`p`,{children:gN(`disconnectBody`)}),(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-2.5`,children:[(0,V.jsx)(H,{onClick:()=>l(!1),children:z(`dialog.cancel`)}),(0,V.jsx)(H,{variant:`danger`,disabled:o!==null,onClick:()=>void v(),children:gN(`disconnect`)})]})]})}),!d&&u?.status?.login&&(0,V.jsx)(`div`,{className:`pb-3`,children:(0,V.jsx)(SN,{login:u.status.login,onCancel:()=>void h(``)})})]})}),d&&(0,V.jsxs)(Bj,{title:gN(`machines`),children:[(0,V.jsx)(CN,{name:gN(`thisMachine`),probe:u,machine:null,rove:d,busy:o!==null,onCancel:()=>void h(``)}),t.map(e=>(0,V.jsx)(CN,{name:e.alias,probe:n[e.alias],machine:e.state,rove:d,busy:o!==null,onSync:()=>void _(e.alias),onLogin:()=>void m(e.alias),onCancel:()=>void h(e.alias)},e.alias)),(0,V.jsx)(`div`,{className:`py-2.5`,children:(0,V.jsx)(H,{onClick:()=>void r(),children:gN(`refresh`)})})]})]})}function TN({model:e}){return(0,V.jsx)(wN,{model:e})}var EN=[{key:`remoteProjects`,label:`dev.remote`,hint:`dev.remoteHint`},{key:`autoStatus`,label:`dev.autoStatus`,hint:`dev.autoStatusHint`},{key:`dispatcher`,label:`dev.dispatcher`,hint:`dev.dispatcherHint`}];function DN({client:e}){let{prefs:t}=R_(),[n,r]=(0,g.useState)(null),[i,a]=(0,g.useState)(!1),o=async()=>{if(n){a(!0);try{if(n===`reset`){await e.request(`dev.reset`),localStorage.removeItem(`rove.prefs`),window.location.reload();return}await e.request(`daemon.restart`),G($(`restart.done`)),r(null)}catch(e){G(K(e),`error`)}finally{a(!1)}}},s=(e,t,a,s,c)=>(0,V.jsxs)(`div`,{children:[(0,V.jsx)(Vj,{label:t,hint:a,children:(0,V.jsx)(H,{variant:`action`,onClick:()=>r(e),children:s})}),n===e&&(0,V.jsx)(`div`,{className:`pb-3`,children:(0,V.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-sm border-hairline border-line bg-inset px-3 py-2.5 [&_p]:m-0 [&_p]:text-meta [&_p]:text-muted`,children:[(0,V.jsx)(`strong`,{children:$(`${e}.title`)}),(0,V.jsx)(`p`,{children:z(e===`reset`?`prefs.resetBody`:`prefs.restartBody`)}),(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-2.5`,children:[(0,V.jsx)(H,{onClick:()=>r(null),children:z(`dialog.cancel`)}),(0,V.jsx)(H,{variant:c?`danger`:`filled`,disabled:i,onClick:()=>void o(),children:s})]})]})})]});return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Bj,{title:$(`dev.experimental`),children:EN.map(n=>(0,V.jsx)(Hj,{label:$(n.label),hint:$(n.hint),checked:t[n.key],onChange:t=>void L_(e,n.key,t)},n.key))}),(0,V.jsxs)(Bj,{hint:$(`dev.doctorHint`),children:[s(`restart`,$(`dev.restart`),z(`prefs.restartHint`),z(`prefs.restartButton`),!1),s(`reset`,$(`dev.reset`),z(`prefs.resetHint`),z(`prefs.resetButton`),!0)]})]})}function ON(e){return e.binaryFound===void 0?{key:`settings.engines.status.checking`,tone:`unknown`}:e.binaryFound===null?{key:`settings.engines.status.unknown`,tone:`unknown`}:e.binaryFound?e.configIssue?{key:`settings.engines.status.integrationBlocked`,tone:`error`}:e.login===`no`?{key:`settings.engines.status.signIn`,tone:`attention`}:e.hooks===`outdated`?{key:`settings.engines.status.integrationOutdated`,tone:`attention`}:e.hooks===`not-installed`?{key:`settings.engines.status.integrationMissing`,tone:`attention`}:{key:`settings.engines.status.ready`,tone:`ready`}:e.commandChosen?{key:`settings.engines.status.notOnPath`,tone:`attention`}:{key:`settings.engines.status.notInstalled`,tone:`absent`}}var kN=_([]),AN=3e4;function jN(e){return e.request(`skill.missing`).then(e=>kN.set(e.engines),()=>{})}function MN(e){(0,g.useEffect)(()=>{let t=e.onOpen(()=>void jN(e)),n=window.setInterval(()=>void jN(e),AN);return()=>{t(),window.clearInterval(n)}},[e])}function NN(e){return e.request(`skill.install`).then(e=>{e.error&&G($(`engines.skill.failed`,{reason:e.error}),`error`)}).catch(e=>G(K(e),`error`)).then(()=>jN(e))}function PN(e){return ON({binaryFound:e.binaryFound,login:e.login,hooks:e.hooks,configIssue:e.configIssue,commandChosen:e.custom||e.customized})}var FN={ready:`ready`,attention:`attention`,error:`error`,absent:`absent`,unknown:`absent`};function IN({client:e}){let[t,n]=(0,g.useState)(()=>Hs(e,`engines.settings`)?.engines??null),[r,i]=(0,g.useState)(null),a=(0,g.useCallback)(()=>Ws(e,`engines.settings`).then(e=>n(e.engines),e=>G(K(e),`error`)),[e]);(0,g.useEffect)(()=>{a()},[a]);let o=(t,n={})=>void e.request(t,n).then(a).catch(e=>G(K(e),`error`));return t?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`p`,{className:FA,children:$(`engines.hint`)}),(0,V.jsxs)(`div`,{className:$A,children:[(0,V.jsxs)(`div`,{className:ej,"aria-hidden":`true`,children:[(0,V.jsx)(`span`,{}),(0,V.jsx)(`span`,{children:$(`engines.defaultMark`)}),(0,V.jsx)(`span`,{children:$(`engines.available`)})]}),t.map(e=>(0,V.jsx)(LN,{engine:e,open:r===e.id,onToggleOpen:()=>i(r===e.id?null:e.id),run:o},e.id))]})]}),(0,V.jsx)(BN,{engines:t,run:o}),(0,V.jsx)(VN,{engines:t,client:e,reload:a})]}):(0,V.jsx)(`p`,{className:WA,children:z(`preview.loading`)})}function LN(e){let{engine:t,run:n}=e,r=(0,g.useId)(),i=PN(t);return(0,V.jsxs)(`div`,{className:tj,children:[(0,V.jsxs)(`div`,{className:nj,children:[(0,V.jsxs)(`button`,{type:`button`,className:rj,"aria-expanded":e.open,"aria-controls":r,onClick:e.onToggleOpen,children:[(0,V.jsx)(Ia,{right:!e.open,className:ij(e.open)}),(0,V.jsxs)(`span`,{className:aj,children:[(0,V.jsxs)(`span`,{className:oj(!t.enabled),children:[t.name,t.renamedFrom?(0,V.jsx)(`span`,{className:sj,children:t.renamedFrom}):null,t.custom&&!t.renamedFrom?(0,V.jsx)(`span`,{className:sj,children:$(`engines.customTag`)}):null]}),(0,V.jsxs)(`span`,{className:lj(FN[i.tone]),children:[(0,V.jsx)(`span`,{className:uj(FN[i.tone]),"aria-hidden":`true`}),$(i.key.slice(9))]})]})]}),(0,V.jsx)(`div`,{className:dj,children:t.isDefault?(0,V.jsx)(`span`,{className:fj,children:$(`engines.defaultMark`)}):t.canBeDefault?(0,V.jsx)(`button`,{type:`button`,className:pj,"aria-label":z(`settings.engines.default`,{name:t.name}),onClick:()=>n(`engine.setDefault`,{id:t.id}),children:$(`engines.makeDefault`)}):null}),(0,V.jsx)(zj,{on:t.enabled,"aria-label":z(`settings.engines.enabled`,{name:t.name}),onClick:()=>n(`engine.setEnabled`,{id:t.id,enabled:!t.enabled})})]}),e.open?(0,V.jsx)(zN,{id:r,engine:t,run:n}):null]})}function RN(e){if(e.configIssue)return $(`engines.detail.hooksBlockedHere`,{reason:e.configIssue});switch(e.hooks){case`installed`:return $(`engines.detail.hooksInstalled`);case`outdated`:return $(`engines.detail.hooksOutdated`);case`not-installed`:return e.binaryFound===!1?$(`engines.detail.hooksAwaitEngine`):$(`engines.detail.hooksMissing`);default:return $(`engines.detail.hooksUnsupported`)}}function zN(e){let{engine:t,run:n}=e,[r,i]=(0,g.useState)(null),a=t.binaryFound===!0?$(`engines.detail.programFound`,{binary:t.binary,path:t.binaryPath??t.binary}):t.binaryFound===!1?$(`engines.detail.programMissing`,{binary:t.binary}):$(`engines.detail.programUnknown`,{binary:t.binary}),o=t.login===`yes`?$(`engines.detail.signedIn`):t.login===`no`?$(`engines.detail.signedOut`):$(`engines.detail.signInUnknown`),s=[RN(t),$(t.markers?`engines.detail.markersYes`:`engines.detail.markersNo`),$(t.screen?`engines.detail.screenYes`:t.hooks===`installed`?`engines.detail.screenNotNeeded`:`engines.detail.screenNo`)];return(0,V.jsxs)(`div`,{id:e.id,className:mj,children:[(0,V.jsxs)(`dl`,{className:hj,children:[(0,V.jsx)(`dt`,{className:gj,children:$(`engines.detail.program`)}),(0,V.jsx)(`dd`,{className:_j(t.binaryFound===!1),children:a}),(0,V.jsx)(`dt`,{className:gj,children:$(`engines.detail.signIn`)}),(0,V.jsx)(`dd`,{className:_j(t.login===`no`),children:o}),(0,V.jsx)(`dt`,{className:gj,children:$(`engines.detail.reporting`)}),(0,V.jsx)(`dd`,{className:_j(!1),children:s.map(e=>(0,V.jsx)(`span`,{className:`block`,children:e},e))}),t.skill===`unsupported`?null:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`dt`,{className:gj,children:$(`engines.detail.skill`)}),(0,V.jsx)(`dd`,{className:_j(t.skill!==`installed`),children:$(t.skill===`installed`?`engines.detail.skillInstalledHere`:t.skill===`outdated`?`engines.detail.skillOutdated`:`engines.detail.skillMissing`)})]}),t.custom?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`dt`,{className:gj,children:$(`engines.detail.adapter`)}),(0,V.jsx)(`dd`,{className:_j(!1),children:t.protocol?$(`engines.detail.adapterDeclared`,{protocol:t.protocol}):$(`engines.detail.adapterGeneric`)})]}):null]}),r===null?(0,V.jsxs)(`div`,{className:vj,children:[(0,V.jsx)(H,{variant:`action`,onClick:()=>i(t.name),children:z(`settings.engines.rename`)}),t.custom||t.customized?(0,V.jsx)(H,{variant:`action`,onClick:()=>n(`engine.reset`,{id:t.id}),children:t.custom?z(`settings.engines.remove`):z(`settings.engines.reset`)}):null]}):(0,V.jsxs)(`form`,{className:vj,onSubmit:e=>{e.preventDefault(),n(`engine.rename`,{id:t.id,name:r}),i(null)},children:[(0,V.jsx)(`input`,{className:`${tn} w-full ${yj}`,autoFocus:!0,value:r,"aria-label":z(`settings.engines.rename`),placeholder:z(`settings.engines.namePlaceholder`),onChange:e=>i(e.target.value),onKeyDown:e=>{e.key===`Escape`&&(e.stopPropagation(),i(null))}}),(0,V.jsx)(H,{variant:`filled`,type:`submit`,children:z(`settings.engines.save`)}),(0,V.jsx)(H,{variant:`action`,onClick:()=>i(null),children:z(`settings.engines.cancel`)})]})]})}function BN({engines:e,run:t}){let n=e.filter(e=>e.hooks!==`unsupported`),r=n.filter(e=>e.binaryFound!==!1),i=r.filter(e=>e.hooks===`installed`).length,a=r.length-i,o=n.filter(e=>e.hooks!==`not-installed`).length;return n.length===0?null:(0,V.jsx)(Bj,{title:$(`engines.integrations.title`),hint:$(`engines.integrations.hint`),children:(0,V.jsx)(Vj,{label:$(`engines.integrations.summary`,{installed:i,total:r.length}),children:(0,V.jsxs)(`div`,{className:XA,children:[a>0?(0,V.jsx)(H,{variant:`filled`,onClick:()=>t(`engines.hooks.install`),children:$(`engines.integrations.install`,{count:a})}):(0,V.jsx)(`span`,{className:bj,children:$(`engines.integrations.upToDate`)}),o>0?(0,V.jsx)(H,{variant:`action`,onClick:()=>t(`engines.hooks.uninstall`),children:$(`engines.integrations.remove`,{count:o})}):null]})})})}function VN(e){let t=e.engines.filter(e=>e.skill!==`unsupported`),n=t.filter(e=>e.skill===`installed`).length,r=t.length-n;return(0,V.jsx)(Bj,{title:$(`engines.skill.title`),hint:$(`engines.skill.hint`),children:(0,V.jsx)(Vj,{label:t.length>0?$(`engines.integrations.summary`,{installed:n,total:t.length}):$(`engines.skill.noEngines`),children:r>0?(0,V.jsx)(H,{variant:`filled`,onClick:()=>void NN(e.client).then(e.reload),children:$(`engines.skill.install`,{count:r})}):t.length>0?(0,V.jsx)(`span`,{className:bj,children:$(`engines.integrations.upToDate`)}):null})})}function HN({client:e}){let[t,n]=(0,g.useState)(``),[r,i]=(0,g.useState)(``),[a,o]=(0,g.useState)(!1);return(0,V.jsxs)(`form`,{className:`flex flex-col gap-4`,onSubmit:a=>{a.preventDefault(),!(!t.trim()||!r.trim())&&(o(!0),e.request(`feedback.send`,{title:t.trim(),body:r}).then(e=>{G(z(`settings.feedback.sent`,{url:e.discussion?.url??``})),n(``),i(``)}).catch(e=>G(K(e),`error`)).finally(()=>o(!1)))},children:[(0,V.jsx)(`p`,{className:`m-0 ${HA}`,children:z(`settings.feedback.hint`)}),(0,V.jsxs)(`label`,{className:qA,children:[(0,V.jsx)(`span`,{className:JA,children:z(`settings.feedback.titleLabel`)}),(0,V.jsx)(`input`,{className:`${GA} w-full`,value:t,onChange:e=>n(e.target.value)})]}),(0,V.jsxs)(`label`,{className:qA,children:[(0,V.jsx)(`span`,{className:JA,children:z(`settings.feedback.body`)}),(0,V.jsx)(`textarea`,{className:`${GA} ${YA} w-full`,rows:6,value:r,onChange:e=>i(e.target.value)})]}),(0,V.jsx)(`div`,{className:XA,children:(0,V.jsx)(H,{variant:`filled`,type:`submit`,disabled:a||!t.trim()||!r.trim(),children:z(`settings.feedback.send`)})})]})}var UN=[{value:`en`,label:`English`},{value:`zh`,label:`中文`}],WN={default:`general.worktreeKindDefault`,nextToProject:`general.worktreeKindNext`,custom:`general.worktreeKindCustom`};function GN({model:e}){let{client:t}=e,n=R_(),{prefs:r,info:i}=n,a=(e,n)=>void L_(t,e,n),o=[`default`,`nextToProject`];(i.worktreeCustomPath||r.worktreeBase===`custom`)&&o.push(`custom`);let s=o.map(e=>({value:e,label:$(WN[e])}));return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(Bj,{title:z(`settings.general.groupInterface`),children:[(0,V.jsx)(Wj,{label:$(`general.language`),hint:z(`prefs.languageHint`),value:r.locale,picks:UN,onPick:e=>a(`locale`,e)}),(0,V.jsx)(Hj,{label:$(`general.keyHintsShow`),hint:$(`general.keyHintsHint`),checked:r.keyHints,onChange:e=>a(`keyHints`,e)}),(0,V.jsx)(Hj,{label:$(`general.zenDefaultOn`),hint:z(`prefs.zenHint`),checked:r.zen,onChange:e=>a(`zen`,e)}),(0,V.jsx)(Wj,{label:z(`settings.general.tabStrip`),value:r.tabStrip,picks:z_(n,`tabStrip`).map(e=>({value:e,label:$(`general.tabStripMode.${e}`)})),onPick:e=>a(`tabStrip`,e)})]}),(0,V.jsxs)(Bj,{title:z(`settings.general.groupFiles`),children:[(0,V.jsx)(Wj,{label:$(`general.editor`),hint:z(`settings.general.editorNote`),value:r.editorKind,picks:z_(n,`editorKind`).map(e=>({value:e,label:e})),onPick:e=>a(`editorKind`,e)}),(0,V.jsx)(Wj,{label:$(`general.worktree`),hint:$(`general.worktreeHint`),value:r.worktreeBase,picks:s,onPick:e=>a(`worktreeBase`,e)})]}),(0,V.jsx)(Bj,{title:z(`settings.general.groupTerminal`),hint:$(`general.terminalHint`),children:(0,V.jsx)(KN,{client:t})})]})}function KN({client:e}){let t=R_(),n=t.options.scrollbackRows,r=n&&`min`in n?n:{min:100,max:1e5},[i,a]=(0,g.useState)(String(t.prefs.scrollbackRows));return(0,g.useEffect)(()=>a(String(t.prefs.scrollbackRows)),[t.prefs.scrollbackRows]),(0,V.jsx)(Vj,{label:z(`settings.general.scrollback`),hint:$(`general.scrollbackRowHint`),children:(0,V.jsx)(`input`,{className:KA,inputMode:`numeric`,value:i,"aria-label":$(`general.scrollbackTitle`),onChange:e=>a(e.target.value),onBlur:()=>{let n=Number(i);if(i.trim()===``||!Number.isInteger(n)){a(String(t.prefs.scrollbackRows));return}let o=Math.min(r.max,Math.max(r.min,n));o===t.prefs.scrollbackRows?a(String(o)):L_(e,`scrollbackRows`,o)},onKeyDown:e=>e.key===`Enter`&&e.currentTarget.blur()})})}[...Array.from({length:12},(e,t)=>`f${t+1}`)];var qN={"diff.review.cursor":`diff-review cursor is a fixed raw binding (j/k), not keymap-driven`,"diff.review.range":`diff-review range anchor is a fixed raw binding (v), not keymap-driven`,"diff.review.note":`diff-review note is a fixed raw binding (c), not keymap-driven`,"diff.review.send":`diff-review send is a fixed raw binding (s), not keymap-driven`,"diff.review.drop":`diff-review drop-note is a fixed raw binding (x), not keymap-driven`,"diff.review.reload":`preview reload is a fixed raw binding (r), not keymap-driven`};function JN(e,t){let n=`alternating [${e}, ${t}] pairs`;return{layout:n,validateCount:e=>e>=2&&e%2==0?null:`needs ${n} (an even number of chords — got ${e})`}}JN(`top (double-tap)`,`bottom`),JN(`down`,`up`),JN(`down`,`up`),JN(`down`,`up`),JN(`collapse`,`expand`),JN(`previous tab`,`next tab`);async function YN(e){try{(await e.request(`keybindings.createFile`)).created||G(z(`keys.exists`),`error`),await $r(e)}catch(e){G(K(e),`error`)}}function XN({model:e}){let{client:t}=e,{prefs:n}=R_(),r=v(Xr),[i,a]=(0,g.useState)(!1);(0,g.useEffect)(()=>void $r(t),[t]);let o=r.prefix.key??$(`keybindings.prefixDisabled`),s=Object.keys(qN).sort();return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(Bj,{children:[(0,V.jsx)(Wj,{label:$(`keybindings.tapPresentation`),hint:$(`keybindings.tapPresentationHint`),value:n.prefixTap,picks:[{value:`local`,label:$(`keybindings.tapPresentationLocal`)},{value:`guide`,label:$(`keybindings.tapPresentationGuide`)}],onPick:e=>void L_(t,`prefixTap`,e)}),(0,V.jsx)(Vj,{label:$(`keybindings.prefixTitle`,{prefix:o}),hint:$(`keybindings.prefixHint`,{prefix:o,timeout:r.prefix.timeoutMs})})]}),(0,V.jsxs)(Bj,{title:$(`keybindings.configFile`),hint:`${$(`keybindings.hint`)} ${z(`prefs.keysYaml`)}`,children:[(0,V.jsx)(Vj,{label:(0,V.jsx)(`span`,{className:`font-mono break-all`,children:r.path+(r.exists?``:$(`keybindings.notCreated`))})}),!r.exists&&(0,V.jsx)(Vj,{label:z(`keys.createFile`),hint:$(`keybindings.createHint`),children:(0,V.jsx)(H,{variant:`action`,onClick:()=>void YN(t),children:z(`keys.createFile`)})}),(0,V.jsx)(Vj,{label:z(`keys.agent`),hint:z(i?`keys.agentFailed`:`keys.agentHint`),children:(0,V.jsx)(H,{variant:`action`,onClick:()=>{a(!1),YM(e,z(`keys.agentPrompt`,{path:r.path})).catch(()=>a(!0))},children:z(`keys.agent`)})})]}),r.exists&&(0,V.jsxs)(Bj,{title:$(`keybindings.overridesApplied`),children:[r.applied.length===0&&(0,V.jsx)(Vj,{label:$(`keybindings.none`)}),r.applied.map(e=>(0,V.jsx)(Vj,{label:(0,V.jsx)(`span`,{className:`font-mono`,children:e.id}),hint:`${e.keys.length>0?e.keys.join(` / `):$(`keybindings.unbound`)} (${$(`keybindings.defaultKeys`,{keys:e.defaultKeys.join(` / `)})})`},e.id))]}),r.warnings.length>0&&(0,V.jsx)(Bj,{title:$(`keybindings.warnings`),children:r.warnings.map(e=>(0,V.jsx)(Vj,{label:(0,V.jsx)(`span`,{className:`text-warning`,children:e})},e))}),r.plugins.length>0&&(0,V.jsx)(Bj,{title:z(`keys.pluginChords`),children:r.plugins.map(e=>(0,V.jsx)(Vj,{label:(0,V.jsx)(`span`,{className:`font-mono`,children:e.chord}),hint:(0,V.jsx)(`span`,{className:`font-mono`,children:`${e.kind}:${e.target}`})},e.chord))}),(0,V.jsx)(`p`,{className:FA,children:$(`keybindings.fixed`,{ids:s.join(`, `)})})]})}var ZN=`/assets/pulse-3XJkP4CJ.wav`;function QN(e,t){return e===`error`||t}function $N(e,t){return t||e.kind!==`done`||e.turnEnd!==!0}function eP(e,t){return t&&e.silent!==!0}function tP(e){return e===`permission_needed`?`needs_input`:e===`error`||e===`rate_limited`||e===`dead`?`error`:e===`turn_complete`?`done`:null}function nP(e,t,n,r){if(e===null)return[];let i=[];for(let[a,o]of t){if(a===n||e.get(a)===o)continue;let t=r(o);t&&i.push({key:a,kind:t})}return i}function rP(){return window.isSecureContext&&`serviceWorker`in navigator&&`PushManager`in window&&`Notification`in window}var iP=()=>navigator.serviceWorker.register(`sw.js`);async function aP(e){if(!rP())return`unsupported`;if(Notification.permission===`denied`)return`blocked`;let t=await(await navigator.serviceWorker.getRegistration())?.pushManager.getSubscription();if(!t)return`off`;let{subscribed:n}=await e.request(`push.status`,{endpoint:t.endpoint});return n?`on`:`off`}async function oP(e){if(!rP())return`unsupported`;if(await Notification.requestPermission()!==`granted`)return`blocked`;let t=await iP();await navigator.serviceWorker.ready;let{publicKey:n}=await e.request(`push.key`),r=await t.pushManager.getSubscription();return r?.options.applicationServerKey&&dP(r.options.applicationServerKey)!==n&&(await r.unsubscribe(),r=null),r??=await t.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:uP(n)}),await e.request(`push.subscribe`,{subscription:r.toJSON()}),`on`}async function sP(e){let t=await(await navigator.serviceWorker.getRegistration())?.pushManager.getSubscription();return t&&(await e.request(`push.unsubscribe`,{endpoint:t.endpoint}),await t.unsubscribe()),`off`}async function cP(e,t,n,r){let i={body:r,tag:`task:${e}:${t}`,icon:`icon-192.png`,data:{taskId:e}},a=`serviceWorker`in navigator?await navigator.serviceWorker.getRegistration():void 0;a?await a.showNotification(`Rove — ${n}`,i):new Notification(`Rove — ${n}`,i)}function lP(e){let t=new URLSearchParams(window.location.search),n=t.get(`task`);if(n){t.delete(`task`);let r=t.toString();history.replaceState(null,``,`${window.location.pathname}${r?`?${r}`:``}${window.location.hash}`),e.selectWhenListed(n)}if(!(`serviceWorker`in navigator))return()=>{};let r=t=>{let n=t.data;n?.type===`rove.openTask`&&typeof n.taskId==`string`&&n.taskId&&e.selectWhenListed(n.taskId)};return navigator.serviceWorker.addEventListener(`message`,r),()=>navigator.serviceWorker.removeEventListener(`message`,r)}function uP(e){let t=atob(e.replace(/-/g,`+`).replace(/_/g,`/`));return Uint8Array.from(t,e=>e.charCodeAt(0))}function dP(e){return btoa(String.fromCharCode(...new Uint8Array(e))).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``)}var fP={done:`✓`,needs_input:`?`,error:`✕`};function pP(e){let t=new Audio(ZN);t.volume=Math.min(1,Math.max(0,e)),t.play().catch(()=>void 0)}function mP(e,t,n){!document.hidden||typeof Notification>`u`||Notification.permission!==`granted`||cP(e,t,n,fP[t]).catch(()=>void 0)}function hP(){typeof Notification<`u`&&Notification.permission==="default"&&Notification.requestPermission()}function gP(e){let t=new Map;for(let n of e.tasks)n.activity&&t.set(n.id,n.activity.state);return t}function _P(e){let t=(0,g.useRef)(null);(0,g.useEffect)(()=>{let n=()=>{let n=e.tasks.get();if(!n)return;let r=gP(n),i=nP(t.current,r,null,tP);t.current=r;let{prefs:a}=N_.get();if(!a.crossTask)return;let o=e.selection.get().taskId,s=new Map(n.tasks.map(e=>[e.id,e.label]));for(let{key:e,kind:t}of i){if(e===o||!$N({kind:t,turnEnd:!0},a.finishedAlerts))continue;let n=s.get(e)??e;QN(t,a.toast)&&G(`${fP[t]} ${n}`,t===`error`?`error`:`info`),eP({},a.sound)&&(pP(a.soundVolume),mP(e,t,n))}};return n(),e.tasks.subscribe(n)},[e])}function vP({client:e}){let[t,n]=(0,g.useState)(null),[r,i]=(0,g.useState)(null);(0,g.useEffect)(()=>{aP(e).then(n,()=>n(`off`))},[e]);let a=t=>{i(null),(t?oP(e):sP(e)).then(n,e=>i(e instanceof Error?e.message:String(e)))},o=r?z(`prefs.pushFailed`,{error:r}):z(t===`unsupported`?`prefs.pushUnsupported`:t===`blocked`?`prefs.pushBlocked`:`prefs.pushHint`);return(0,V.jsx)(Hj,{label:z(`prefs.push`),hint:o,checked:t===`on`,disabled:t===null||t===`unsupported`||t===`blocked`,onChange:a})}function yP({model:e}){let{client:t}=e,n=R_(),{prefs:r}=n,i=(e,n)=>void L_(t,e,n);return(0,V.jsxs)(Bj,{children:[(0,V.jsx)(Hj,{label:$(`general.toast`),hint:z(`settings.notifications.toastNote`),checked:r.toast,onChange:e=>i(`toast`,e)}),(0,V.jsx)(Hj,{label:$(`general.sound`),hint:z(`prefs.soundHint`),checked:r.sound,onChange:e=>{e&&hP(),i(`sound`,e)}}),(0,V.jsx)(Wj,{label:z(`settings.notifications.volume`),hint:z(`prefs.soundVolumeHint`),value:r.soundVolume,picks:z_(n,`soundVolume`).map(e=>({value:e,label:`${Math.round(e*100)}%`})),onPick:e=>{N_.get().prefs.sound&&pP(e),i(`soundVolume`,e)}}),(0,V.jsx)(Hj,{label:$(`general.crossTask`),hint:$(`general.crossTaskHint`),checked:r.crossTask,onChange:e=>i(`crossTask`,e)}),(0,V.jsx)(Hj,{label:$(`general.finishedAlerts`),hint:$(`general.finishedAlertsHint`),checked:r.finishedAlerts,onChange:e=>i(`finishedAlerts`,e)}),(0,V.jsx)(vP,{client:t})]})}var bP={kanban:`kanban`,issues:`issues`};function xP({model:e}){let t=v(e.installedMods),[n,r]=(0,g.useState)(()=>Hs(e,`builtinMods.list`)?.mods??null);if((0,g.useEffect)(()=>{Ws(e,`builtinMods.list`).then(e=>r(e.mods),()=>r([])),e.refreshMods()},[e]),!n||n.length===0)return null;let i=n=>{let r=!t.has(n.id);e.client.request(`builtinMod.setInstalled`,{id:n.id,installed:r}).then(()=>(!r&&un.get()===bP[n.id]&&un.set(null),e.refreshMods())).catch(e=>G(K(e),`error`))};return(0,V.jsx)(Bj,{title:z(`settings.plugins.builtIn`),hint:z(`settings.plugins.builtInHint`),children:n.map(e=>(0,V.jsx)(Vj,{label:e.name,hint:e.description,inline:!0,children:(0,V.jsx)(zj,{on:t.has(e.id),"aria-label":z(`settings.plugins.turnOn`,{name:e.name}),onClick:()=>i(e)})},e.id))})}function SP({model:e}){let{client:t}=e,[n,r]=(0,g.useState)(()=>Hs(t,`plugins.list`)?.plugins??null),i=(0,g.useCallback)(()=>Ws(t,`plugins.list`).then(e=>r(e.plugins),e=>G(K(e),`error`)),[t]);return(0,g.useEffect)(()=>{i()},[i]),(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(xP,{model:e}),(0,V.jsx)(Bj,{title:z(`settings.plugins.registered`),children:n?n.length===0?(0,V.jsx)(`p`,{className:WA,children:z(`settings.plugins.empty`)}):n.map(e=>(0,V.jsx)(Vj,{label:e.id,hint:[e.version,e.linked?z(`settings.plugins.linked`):null,e.platformOk===!1?z(`settings.plugins.unsupportedPlatform`):null].filter(Boolean).join(`, `),inline:!0,children:(0,V.jsx)(zj,{on:e.enabled,"aria-label":e.id,onClick:()=>void t.request(`plugin.setEnabled`,{id:e.id,enabled:!e.enabled}).then(i).catch(e=>G(K(e),`error`))})},e.id)):(0,V.jsx)(`p`,{className:WA,children:z(`preview.loading`)})})]})}function CP(e){let[t,n]=(0,g.useState)(e.tier.engine),[r,i]=(0,g.useState)(e.tier.model??``),[a,o]=(0,g.useState)(e.tier.effort??``),s=e.engines.find(e=>e.id===t);return(0,V.jsxs)(`form`,{className:Ej,onSubmit:n=>{n.preventDefault(),e.onSave(t,s?.takesModel?r.trim():``,a)},onKeyDown:t=>{t.key===`Escape`&&(t.stopPropagation(),e.onCancel())},children:[(0,V.jsx)(CA,{label:$(`sections.engines`),value:t,picks:e.engines.map(e=>({value:e.id,label:e.name})),onPick:t=>{let r=e.engines.find(e=>e.id===t);n(t),r&&!r.effortLevels.includes(a)&&o(``),r&&!r.takesModel&&i(``)}}),s&&s.effortLevels.length>0&&(0,V.jsx)(CA,{label:z(`prefs.tierEffort`),value:a,picks:[``,...s.effortLevels].map(e=>({value:e,label:e||$(`autoRouting.engineDefault`)})),onPick:o}),s?.takesModel&&(0,V.jsx)(`input`,{className:`rounded-sm border-hairline border-line bg-paper px-2.5 py-1.5 font-sans text-body text-ink focus-visible:border-line-active focus-visible:outline-none`,value:r,spellCheck:!1,placeholder:$(`autoRouting.engineDefault`),"aria-label":z(`prefs.tierModel`),onChange:e=>i(e.target.value)}),(0,V.jsxs)(`div`,{className:XA,children:[(0,V.jsx)(H,{onClick:e.onCancel,children:z(`dialog.cancel`)}),(0,V.jsx)(H,{variant:`filled`,type:`submit`,children:$(`action.save`)})]})]})}function wP({client:e}){let[t,n]=(0,g.useState)(()=>Hs(e,`autoRouting.get`)??null),[r,i]=(0,g.useState)(null),a=(0,g.useCallback)(()=>Ws(e,`autoRouting.get`).then(n,e=>G(K(e),`error`)),[e]);(0,g.useEffect)(()=>{a()},[a]);let o=(t,n)=>e.request(t,n).then(a).catch(e=>G(K(e),`error`));if(!t)return(0,V.jsx)(`p`,{className:WA,children:z(`preview.loading`)});let s=t.classifier,c=[{value:`off`,label:$(`autoRouting.classifierOff`)},{value:`jev`,label:`jev`},...s.canCustom||s.mode===`custom`?[{value:`custom`,label:$(`autoRouting.classifierCustomLabel`)}]:[]],l=s.mode===`off`?$(`autoRouting.classifierOffHint`):s.mode===`jev`?$(`autoRouting.classifierJevHint`):$(`autoRouting.classifierCustomHint`),u=s.keySource===`env`?$(`autoRouting.keyPresentEnv`,{env:s.keyEnv??``}):s.keySource===`file`?$(`autoRouting.keySaved`):s.keyConfigured?$(`autoRouting.keyMissing`):$(`autoRouting.keyCustomUnused`);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(Bj,{hint:$(`autoRouting.hint`),children:[!t.configured&&(0,V.jsx)(Vj,{label:(0,V.jsx)(`span`,{className:`text-warning`,children:$(`autoRouting.unconfigured`)})}),t.tiers.map(e=>(0,V.jsxs)(`div`,{className:wj,children:[(0,V.jsxs)(`div`,{className:Tj,children:[(0,V.jsx)(`span`,{className:VA,children:SA(`tier.${e.tier}`)}),(0,V.jsx)(`span`,{className:`${HA} min-w-0 truncate`,children:[e.engineName,e.model??$(`autoRouting.engineDefault`),e.effort??$(`autoRouting.engineDefault`)].join(` · `)}),(0,V.jsx)(H,{className:`ml-auto`,onClick:()=>i(r===e.tier?null:e.tier),children:z(`prefs.tierEdit`)})]}),(0,V.jsx)(`span`,{className:HA,children:SA(`tierDesc.${e.tier}`)}),(0,V.jsx)(`span`,{className:`text-meta ${e.block?`text-warning`:`text-success`}`,children:e.block?$(`autoRouting.unavailable`,{reason:e.block}):$(`autoRouting.ready`)}),r===e.tier&&(0,V.jsx)(CP,{tier:e,engines:t.engines,onCancel:()=>i(null),onSave:(t,n,r)=>{i(null),o(`autoRouting.setTier`,{tier:e.tier,engine:t,model:n,effort:r})}})]},e.tier))]}),(0,V.jsxs)(Bj,{title:$(`autoRouting.classifierTitle`),hint:$(`autoRouting.classifierHint`),children:[(0,V.jsx)(Vj,{label:(0,V.jsx)(`span`,{className:s.mode===`off`?`text-muted`:`text-warning`,children:$(`autoRouting.classifierDataFlow`)})}),(0,V.jsx)(Wj,{label:$(`autoRouting.classifierLabel`),hint:l.replace(/^[—\s]+/,``),value:s.mode,picks:c,onPick:e=>void o(`autoRouting.setClassifier`,{mode:e})})]}),(0,V.jsxs)(Bj,{title:z(`prefs.classifierConnection`),hint:z(`prefs.editInTui`),children:[(0,V.jsx)(Gj,{label:$(`autoRouting.endpointLabel`),value:s.endpointHost||z(`prefs.unset`)}),(0,V.jsx)(Gj,{label:$(`autoRouting.thresholdLabel`),value:s.threshold.toFixed(2)}),(0,V.jsx)(Vj,{label:$(`autoRouting.keyLabel`),hint:u})]})]})}var TP=[{id:`preferences`,sections:[`general`,`appearance`,`notifications`,`snippets`,`keys`]},{id:`agents`,sections:[`engines`,`autoRouting`,`connectors`,`plugins`]},{id:`more`,sections:[`about`,`feedback`,`dev`]}],EP=e=>({section:e??`general`,drilled:e!==void 0});function DP(e,t){return t&&e.drilled?`list`:`close`}var OP=e=>e.split(`
117
117
  `,1)[0]??``;function kP(e){let[t,n]=(0,g.useState)(e.editing?.name??``),[r,i]=(0,g.useState)(e.editing?.text??``),[a,o]=(0,g.useState)(!1),s=JD.test(t)&&r.trim()!==``;return(0,V.jsxs)(`form`,{className:`flex flex-col gap-3`,onSubmit:n=>{n.preventDefault(),s&&(o(!0),KD(e.client,{name:t,text:r}).then(e.onDone).catch(e=>{G(K(e),`error`),o(!1)}))},children:[(0,V.jsxs)(`label`,{className:qA,children:[(0,V.jsx)(`span`,{className:JA,children:z(`snippets.name`)}),(0,V.jsx)(`input`,{className:`${GA} w-full font-mono`,value:t,maxLength:32,spellCheck:!1,autoComplete:`off`,autoFocus:!e.editing,readOnly:e.editing!==void 0,placeholder:z(`snippets.namePlaceholder`),onChange:e=>n(e.target.value)}),t!==``&&!JD.test(t)&&(0,V.jsx)(`span`,{className:`text-meta text-muted [&_a]:text-accent`,children:z(`snippets.badName`)})]}),(0,V.jsxs)(`label`,{className:qA,children:[(0,V.jsx)(`span`,{className:JA,children:z(`snippets.text`)}),(0,V.jsx)(`textarea`,{className:`${GA} ${YA} w-full`,rows:5,value:r,maxLength:8e3,placeholder:z(`snippets.textPlaceholder`),onChange:e=>i(e.target.value)})]}),(0,V.jsxs)(`div`,{className:XA,children:[(0,V.jsx)(H,{onClick:e.onDone,children:z(`snippets.cancel`)}),(0,V.jsx)(H,{type:`submit`,disabled:a||!s,children:z(`snippets.save`)})]})]})}function AP({model:e}){let{client:t}=e,n=WD(),[r,i]=(0,g.useState)(null);return(0,g.useEffect)(()=>void GD(t).catch(()=>void 0),[t]),(0,V.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,V.jsxs)(Bj,{children:[n.length===0&&r===null&&(0,V.jsx)(Vj,{label:z(`snippets.empty`)}),n.map(e=>(0,V.jsxs)(Vj,{label:(0,V.jsxs)(`span`,{className:`font-mono`,children:[`@`,e.name]}),hint:OP(e.text),children:[(0,V.jsx)(H,{onClick:()=>i(e),children:z(`snippets.edit`)}),(0,V.jsx)(H,{onClick:()=>void qD(t,e.name).then(()=>{i(null),G(z(`snippets.removed`,{name:e.name}))}).catch(e=>G(K(e),`error`)),children:z(`snippets.remove`)})]},e.name))]}),r===null?(0,V.jsx)(`div`,{className:XA,children:(0,V.jsx)(H,{onClick:()=>i(`new`),children:z(`snippets.add`)})}):(0,V.jsx)(kP,{client:t,editing:r===`new`?void 0:r,onDone:()=>i(null)},r===`new`?`new`:r.name)]})}var jP=e=>e>=95?`crit`:e>=75?`warn`:`ok`,MP=e=>String(e).padStart(2,`0`);function NP(e,t){if(e==null||e<=t)return``;let n=new Date(e),r=`${MP(n.getHours())}:${MP(n.getMinutes())}`;return e-t<864e5?`→ ${r}`:`→ ${n.getMonth()+1}/${n.getDate()} ${r}`}function PP(e,t){let n=e.windows.find(e=>e.kind===`session`)??e.windows[0];return n?{label:n.label,percentText:`${n.percent}%`,resetText:NP(n.resetsAt,t),tone:jP(n.percent)}:null}var FP=1e4;function IP({client:e,inset:t=!0}){let n=v(e.conn),[r,i]=(0,g.useState)(null);(0,g.useEffect)(()=>{if(n.state!==`open`)return;let t=!0,r=()=>e.request(`usage.get`,{}).then(e=>{t&&i(e.usage)}).catch(()=>{});r();let a=window.setInterval(r,FP);return()=>{t=!1,window.clearInterval(a)}},[e,n.state]);let a=Date.now(),o=(r??[]).flatMap(e=>{let t=PP({capturedAt:e.capturedAt,windows:e.windows},a);return t?[{vendor:e.vendor,name:e.name,chip:t}]:[]});return o.length===0?null:(0,V.jsx)(`div`,{className:`${Rt} ${t?`px-2`:``}`,children:o.map(({vendor:e,name:t,chip:n})=>{let r=Math.min(100,Math.max(0,Number.parseInt(n.percentText,10)||0));return(0,V.jsxs)(H,{variant:`row`,className:zt,title:`${t} · ${n.label} ${n.percentText} ${n.resetText}`.trim(),"aria-label":`${z(`usage.open`)}: ${t}`,onClick:()=>{Cn(),ya(`usage`)},children:[(0,V.jsx)(`span`,{className:`truncate`,children:t}),(0,V.jsx)(`span`,{className:Ht(n.tone),style:{"--fill":`${r}%`}}),(0,V.jsxs)(`span`,{children:[n.label,` `,(0,V.jsx)(`span`,{className:Bt[n.tone],children:n.percentText})]})]},e)})})}var LP={general:e=>(0,V.jsx)(GN,{model:e}),appearance:e=>(0,V.jsx)(uN,{model:e}),notifications:e=>(0,V.jsx)(yP,{model:e}),snippets:e=>(0,V.jsx)(AP,{model:e}),keys:e=>(0,V.jsx)(XN,{model:e}),engines:e=>(0,V.jsx)(IN,{client:e.client}),autoRouting:e=>(0,V.jsx)(wP,{client:e.client}),connectors:e=>(0,V.jsx)(TN,{model:e}),plugins:e=>(0,V.jsx)(SP,{model:e}),about:e=>(0,V.jsx)(JM,{client:e.client}),feedback:e=>(0,V.jsx)(HN,{client:e.client}),dev:e=>(0,V.jsx)(DN,{client:e.client})},RP={general:`sections.general`,engines:`sections.engines`,autoRouting:`sections.autoRouting`,plugins:`sections.plugins`,keys:`sections.keys`,feedback:`sections.feedback`,dev:`sections.dev`},zP=e=>{let t=RP[e];return t?$(t):z(`settings.sections.${e}`)};function BP(e){return(0,V.jsxs)(`nav`,{className:OA,"aria-label":z(`settings.title`),children:[(0,V.jsx)(`h1`,{className:kA,children:z(`settings.title`)}),TP.map(t=>(0,V.jsxs)(`div`,{className:AA,children:[(0,V.jsx)(`p`,{className:jA,children:z(`settings.groups.${t.id}`)}),t.sections.map(n=>(0,V.jsxs)(H,{variant:`row`,className:MA(!e.narrow&&e.current===n,t.id===`more`),"aria-current":!e.narrow&&e.current===n?`page`:void 0,onClick:()=>e.onPick(n),children:[zP(n),(0,V.jsx)(Ia,{right:!0,className:NA})]},n))]},t.id))]})}function VP({model:e,section:t}){B();let[n,r]=(0,g.useState)(()=>EP(t)),i=Ta(),a=()=>DP(n,i)===`list`?r({...n,drilled:!1}):Cn();(0,g.useEffect)(()=>{let e=document.querySelector(`.dialog`);e&&!e.contains(document.activeElement)&&e.focus()},[]),(0,g.useEffect)(()=>{let e=e=>{e.key!==`Escape`||e.defaultPrevented||(e.preventDefault(),a())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)});let o=!i||!n.drilled,s=!i||n.drilled;return(0,V.jsx)(`div`,{className:TA,onMouseDown:e=>e.target===e.currentTarget&&Cn(),children:(0,V.jsxs)(`dialog`,{tabIndex:-1,open:!0,className:EA,"aria-label":z(`settings.title`),onKeyDown:e=>{let t=e.target;e.key===`Escape`&&(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement)&&(t.blur(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation())},children:[(0,V.jsx)(H,{variant:`row`,className:DA,"aria-label":z(`dialog.close`),title:z(`dialog.close`),onClick:Cn,children:`×`}),i&&n.drilled&&(0,V.jsx)(H,{variant:`row`,className:`hidden flex-none items-center px-4 py-3 pr-12 text-left font-mono text-meta font-bold text-accent w-narrow:flex touch:min-h-11`,onClick:a,children:`‹ ${z(`settings.title`)}`}),o&&(0,V.jsx)(BP,{current:n.section,narrow:i,onPick:e=>r({section:e,drilled:!0})}),i&&o&&(0,V.jsx)(IP,{client:e.client,inset:!1}),s&&(0,V.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-y-auto scrollbar-none`,children:(0,V.jsxs)(`div`,{className:`flex w-full flex-col gap-7 px-8 pt-7 pb-10 w-narrow:gap-6 w-narrow:px-4 w-narrow:pt-1 w-narrow:pb-10`,children:[(0,V.jsxs)(`header`,{className:`flex flex-col gap-1 pr-8`,children:[(0,V.jsx)(`h1`,{className:`m-0 font-sans text-display font-semibold normal-nums text-ink`,children:zP(n.section)}),(0,V.jsx)(`p`,{className:`m-0 text-body text-muted`,children:z(`settings.pages.${n.section}`)})]}),(0,V.jsx)(`div`,{className:`flex flex-col gap-7 w-narrow:gap-6`,children:LP[n.section](e)})]})},n.section)]})})}function HP(e){let t=e.todos;return!t||t.length===0?null:{done:t.filter(e=>e.done).length,total:t.length}}function UP(e){return(e.todos??[]).filter(e=>!e.done)}var WP=/LAND_CONFLICT/,GP=/MAIN_CHECKOUT_DIRTY/,KP=/SYNC_CONFLICT(?:: )?(.*)/,qP=/SYNC_WORKTREE_DIRTY(?:: )?(.*)/;function JP(e){let t=K(e);return WP.test(t)?q(`worktrees`,`land.conflict`,{files:t}):GP.test(t)?q(`worktrees`,`land.dirtyBase`):q(`worktrees`,`land.failed`,{error:t})}async function YP(e,t,n){if(t.machine){XP(e,t,t.machine.label,n);return}let r;try{r=await e.client.request(`task.landPreflight`,{taskId:t.id})}catch(e){G(q(`worktrees`,`land.failed`,{error:K(e)}),`error`);return}if(r.refusal){G(r.refusal===`MAIN_CHECKOUT_DIRTY`?q(`worktrees`,`land.dirtyBase`):q(`worktrees`,`land.failed`,{error:r.message??r.refusal}),`error`);return}let i=t.branch||t.title,a=UP(e.tasks.get()?.tasks.find(e=>e.id===t.id)??{}).length;W.set((0,V.jsx)(dr,{title:q(`worktrees`,`land.confirmTitle`),body:[q(`worktrees`,r.ahead===1?`land.confirmBodyOne`:`land.confirmBody`,{branch:i,landedOn:r.landedOn,commits:r.ahead??`?`}),...a>0?[z(`files.landTodos`,{count:a})]:[]].join(`