@sma1lboy/rove 0.9.292 → 0.9.293-next.281
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/{chunk-m5shy4k4.js → chunk-0hx7edgs.js} +1 -1
- package/dist/cli/{chunk-96p0jny3.js → chunk-2sstba6g.js} +1 -1
- package/dist/cli/{chunk-kex13y9f.js → chunk-2yj4spwj.js} +1 -1
- package/dist/cli/{chunk-5cha5xs2.js → chunk-43q00rjy.js} +1 -1
- package/dist/cli/{chunk-3tsjwh25.js → chunk-65a6thbr.js} +1 -1
- package/dist/cli/{chunk-0wwe63cs.js → chunk-6qqpxcs6.js} +1 -1
- package/dist/cli/{chunk-w86mcaca.js → chunk-8drzyswa.js} +1 -1
- package/dist/cli/{chunk-59vxrk4q.js → chunk-bkg3a9xz.js} +1 -1
- package/dist/cli/{chunk-06j0tret.js → chunk-dcf3dkce.js} +1 -1
- package/dist/cli/{chunk-177grt5c.js → chunk-e39g567y.js} +1 -1
- package/dist/cli/{chunk-tf3gyw23.js → chunk-fxkt45w4.js} +1 -1
- package/dist/cli/{chunk-dzvhbkf7.js → chunk-j2ke5kts.js} +1 -1
- package/dist/cli/{chunk-39jxefkk.js → chunk-jg11rygj.js} +1 -1
- package/dist/cli/{chunk-ztkkgqdf.js → chunk-jqcq8tva.js} +1 -1
- package/dist/cli/{chunk-sjt7rnyh.js → chunk-jt18qp04.js} +1 -1
- package/dist/cli/chunk-k6rt287h.js +6 -0
- package/dist/cli/{chunk-1c9ky3vd.js → chunk-mfp023gv.js} +1 -1
- package/dist/cli/{chunk-kjby0vw9.js → chunk-mrbd9shn.js} +1 -1
- package/dist/cli/{chunk-wnn4b26b.js → chunk-my3dg722.js} +1 -1
- package/dist/cli/{chunk-353dn425.js → chunk-njg814fz.js} +1 -1
- package/dist/cli/{chunk-wfs559d9.js → chunk-q9sft6vh.js} +1 -1
- package/dist/cli/{chunk-p50fdez0.js → chunk-ra5z8g1m.js} +1 -1
- package/dist/cli/{chunk-92gxfhb9.js → chunk-sn2xxqv5.js} +1 -1
- package/dist/cli/{chunk-yctdtmzv.js → chunk-ta7dhr7k.js} +2 -2
- package/dist/cli/{chunk-h3j0hjyh.js → chunk-v5qxh1c5.js} +1 -1
- package/dist/cli/{chunk-8xhdav77.js → chunk-vdxr9f4c.js} +3 -3
- package/dist/cli/{chunk-58hp9xg6.js → chunk-xxh11aft.js} +1 -1
- package/dist/cli/{chunk-t2rdttbz.js → chunk-z31h22wd.js} +2 -2
- package/dist/cli/index.js +3 -3
- package/dist/web/assets/{index-D1Nhe_Cb.js → index-CQKjG1BH.js} +3 -3
- package/dist/web/assets/{term-mount-C4uT8Hft.js → term-mount-D7niAZe0.js} +1 -1
- package/dist/web/index.html +1 -1
- package/package.json +1 -1
- package/dist/cli/chunk-jq254wah.js +0 -6
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/term-mount-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/term-mount-D7niAZe0.js","assets/term-mount-BrP-ENHg.css"])))=>i.map(i=>d[i]);
|
|
2
2
|
var e=Object.defineProperty,t=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),n=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r};(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var r=`rove.bridge.token`;if(typeof window<`u`){let e=new URLSearchParams(window.location.hash.slice(1)).get(`token`);e&&(localStorage.setItem(r,e),history.replaceState(null,``,window.location.pathname+window.location.search))}function i(){return localStorage.getItem(r)}function a(e){localStorage.setItem(r,e)}function o(){localStorage.removeItem(r)}var s=t((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function ee(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function j(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function te(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,te(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+ee(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),te(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+ee(a,u),c+=te(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+ee(a,u++),c+=te(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return te(j(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function M(e,t,n){if(e==null)return e;var r=[],i=0;return te(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function N(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var P=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},F={map:M,forEach:function(e,t,n){M(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return M(e,function(){t++}),t},toArray:function(e){return M(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=F,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:N}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,P)}catch(e){P(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.8`})),c=t(((e,t)=>{t.exports=s()})),l=t((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&ee(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&ee(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function ee(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,ee(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),u=t(((e,t)=>{t.exports=l()})),d=t((e=>{var t=c();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=l(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=l(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.8`})),f=t(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=d()})),p=t((e=>{var t=u(),n=c(),r=f();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function d(e){if(o(e)!==e)throw Error(i(188))}function p(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return d(a),e;if(s===r)return d(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,l=a.child;l;){if(l===n){c=!0,n=a,r=s;break}if(l===r){c=!0,r=a,n=s;break}l=l.sibling}if(!c){for(l=s.child;l;){if(l===n){c=!0,n=s,r=a;break}if(l===r){c=!0,r=s,n=a;break}l=l.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function m(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=m(e),t!==null)return t;e=e.sibling}return null}var h=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),E=Symbol.for(`react.suspense_list`),D=Symbol.for(`react.memo`),O=Symbol.for(`react.lazy`),k=Symbol.for(`react.activity`),A=Symbol.for(`react.memo_cache_sentinel`),ee=Symbol.iterator;function j(e){return typeof e!=`object`||!e?null:(e=ee&&e[ee]||e[`@@iterator`],typeof e==`function`?e:null)}var te=Symbol.for(`react.client.reference`);function M(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===te?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case T:return`Suspense`;case E:return`SuspenseList`;case k:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case D:return t=e.displayName||null,t===null?M(e.type)||`Memo`:t;case O:t=e._payload,e=e._init;try{return M(e(t))}catch{}}return null}var N=Array.isArray,P=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ne={pending:!1,data:null,method:null,action:null},re=[],ie=-1;function ae(e){return{current:e}}function I(e){0>ie||(e.current=re[ie],re[ie]=null,ie--)}function L(e,t){ie++,re[ie]=e.current,e.current=t}var oe=ae(null),R=ae(null),se=ae(null),ce=ae(null);function le(e,t){switch(L(se,t),L(R,e),L(oe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Ud(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Ud(t),e=Wd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}I(oe),L(oe,e)}function ue(){I(oe),I(R),I(se)}function de(e){e.memoizedState!==null&&L(ce,e);var t=oe.current,n=Wd(t,e.type);t!==n&&(L(R,e),L(oe,n))}function fe(e){R.current===e&&(I(oe),I(R)),ce.current===e&&(I(ce),ep._currentValue=ne)}var pe,me;function he(e){if(pe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);pe=t&&t[1]||``,me=-1<e.stack.indexOf(`
|
|
3
3
|
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
4
4
|
`+pe+e+me}var ge=!1;function _e(e,t){if(!e||ge)return``;ge=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
@@ -36,12 +36,12 @@ Then look for the hook that older version installed. Check my engine settings fi
|
|
|
36
36
|
`)})}async function rs(e){if(Zo||$o())return;Zo=!0;let{tasks:t}=await e.client.request(`worktree.legacyAdopted`,{}).catch(()=>({tasks:[]}));t.length!==0&&C.get()===null&&C.set((0,V.jsx)(is,{model:e,tasks:t}))}function is(e){let[t,n]=(0,h.useState)(!1),[r,i]=(0,h.useState)(null),a=async()=>{n(!0),i(null);try{let{taskId:t}=await e.model.client.request(`worktree.legacyCleanup`,{title:G(`tasks`,`confirm.legacyAdoptSessionTitle`),prompt:ns(e.tasks)});R(),e.model.selectWhenListed(t)}catch(e){i(G(`tasks`,`confirm.legacyAdoptFailed`,{message:Jo(e)}))}finally{n(!1)}};return(0,V.jsx)(bi,{title:G(`tasks`,`confirm.legacyAdoptTitle`,{count:e.tasks.length}),children:(0,V.jsxs)(`div`,{className:Wr,children:[(0,V.jsx)(`p`,{className:`text-muted whitespace-pre-wrap`,children:G(`tasks`,`confirm.legacyAdoptBody`,{list:ts(e.tasks)})}),r&&(0,V.jsx)(`p`,{className:`text-error`,children:r}),(0,V.jsxs)(`div`,{className:Mr,children:[(0,V.jsx)(H,{onClick:()=>{es(),R()},children:G(`tasks`,`confirm.legacyAdoptNever`)}),(0,V.jsx)(H,{onClick:R,children:G(`tasks`,`confirm.legacyAdoptLater`)}),(0,V.jsx)(H,{variant:`filled`,disabled:t,autoFocus:!0,onClick:()=>void a(),children:G(`tasks`,`confirm.legacyAdoptClean`)})]})]})})}function as(e,t){let n=t&&typeof t==`object`?t:{};if(e===200&&typeof n.token==`string`&&/^[A-Za-z0-9_-]{43}$/.test(n.token))return{kind:`ok`,token:n.token};if(e===429){if(n.locked===`global`)return{kind:`lockedHost`};let e=typeof n.retryAfterSeconds==`number`?n.retryAfterSeconds:900;return{kind:`locked`,minutes:Math.max(1,Math.ceil(e/60))}}return e===401?{kind:`wrong`}:{kind:`unreachable`}}async function os(e=Bo){try{let t=await e(`/login`,{headers:{Accept:`application/json`},cache:`no-store`});return!t.ok||!(t.headers.get(`content-type`)??``).includes(`application/json`)?!1:(await t.json()).password===!0}catch{return!1}}async function ss(e=Bo){try{let t=await e(`/auth`,{headers:{Accept:`application/json`},cache:`no-store`});return!t.ok||!(t.headers.get(`content-type`)??``).includes(`application/json`)?!1:(await t.json()).open===!0}catch{return!1}}async function cs(e,t=Bo){try{let n=await t(`/login`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({password:e}),credentials:`omit`}),r=as(n.status,await n.json().catch(()=>null));return r.kind===`ok`&&a(r.token),r}catch{return{kind:`unreachable`}}}async function ls(e=Bo){let t=i();o(),t&&await e(`/logout`,{method:`POST`,headers:{Authorization:`Bearer ${t}`}}).catch(()=>{})}function us(e){if(!e)return null;switch(e.kind){case`ok`:return null;case`wrong`:return z(`login.wrong`);case`locked`:return z(`login.locked`,{minutes:e.minutes});case`lockedHost`:return z(`login.lockedHost`);case`unreachable`:return z(`login.unreachable`)}}function ds(){B();let[e,t]=(0,h.useState)(``),[n,r]=(0,h.useState)(!1),[i,a]=(0,h.useState)(null),o=us(i);return(0,V.jsx)(`div`,{className:Gn,children:(0,V.jsxs)(`form`,{className:Kn,onSubmit:async i=>{if(i.preventDefault(),n||!e)return;r(!0);let o=await cs(e);if(o.kind===`ok`){window.location.reload();return}t(``),a(o),r(!1)},children:[(0,V.jsxs)(`span`,{className:Un,children:[(0,V.jsx)(`span`,{className:Wn,children:`[`}),` rove `,(0,V.jsx)(`span`,{className:Wn,children:`]`})]}),(0,V.jsx)(`h1`,{className:`${U} text-muted`,children:z(`login.title`)}),(0,V.jsx)(`p`,{className:`text-muted`,children:z(`login.body`)}),(0,V.jsx)(`input`,{className:jr,type:`password`,autoComplete:`current-password`,"aria-label":z(`login.field`),placeholder:z(`login.field`),autoFocus:!0,value:e,disabled:n,onChange:e=>{t(e.target.value),a(null)}}),o&&(0,V.jsx)(`p`,{className:`text-error`,role:`alert`,children:o}),(0,V.jsx)(`div`,{className:Mr,children:(0,V.jsx)(`button`,{type:`submit`,className:br(),disabled:n||!e,children:z(n?`login.checking`:`login.submit`)})})]})})}function fs(e){return(0,V.jsx)(`svg`,{className:`block size-2.5 flex-none transition-[rotate,opacity] duration-120 ease-[ease] motion-reduce:transition-none ${e.right?`-rotate-90 is-right`:``} ${e.className??``}`,viewBox:`0 0 10 10`,"aria-hidden":`true`,children:(0,V.jsx)(`path`,{d:`M2.5 3.75 5 6.25l2.5-2.5`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.3`,strokeLinecap:`round`,strokeLinejoin:`round`})})}var ps=120;function ms(e,t,n,r=e-t){return e+t+8<=n?e:Math.max(8,Math.min(r,n-t-8))}function hs(e){let{item:t}=e;return(0,V.jsxs)(`button`,{ref:e.rowRef,type:`button`,role:t.checked===void 0?`menuitem`:`menuitemradio`,"aria-checked":t.checked,"aria-haspopup":t.children?`menu`:void 0,"aria-expanded":t.children?!!e.open:void 0,className:Kr({selected:e.selected,open:e.open,danger:t.danger}),onMouseEnter:e.onEnter,onMouseLeave:e.onLeave,onClick:e.onPick,children:[(0,V.jsx)(`span`,{children:t.label}),t.children?(0,V.jsx)(fs,{right:!0,className:Yr(!!(e.selected||e.open))}):t.checked?(0,V.jsx)(`span`,{className:Xr,"aria-hidden":!0,children:`✓`}):t.key&&(0,V.jsx)(`span`,{className:Jr({selected:e.selected,danger:t.danger}),children:t.key})]})}function gs(){let e=y(S),[t,n]=(0,h.useState)(0),[r,i]=(0,h.useState)(null),[a,o]=(0,h.useState)(-1),[s,c]=(0,h.useState)(!1),l=(0,h.useRef)(null),u=(0,h.useRef)(null),d=(0,h.useRef)([]),f=(0,h.useRef)(void 0),[p,m]=(0,h.useState)({x:0,y:0}),[g,_]=(0,h.useState)({x:0,y:0});if((0,h.useLayoutEffect)(()=>{if(!e||!l.current)return;n(e.start??(e.fromKeyboard?0:-1)),i(null),c(!1);let{width:t,height:r}=l.current.getBoundingClientRect(),a=e.right===void 0?e.x:Math.max(e.right-l.current.offsetWidth,0);m({x:ms(a,t,window.innerWidth),y:ms(e.y,r,window.innerHeight)});let o=e.target;return o?.setAttribute(`data-menu-open`,``),()=>o?.removeAttribute(`data-menu-open`)},[e]),(0,h.useLayoutEffect)(()=>{let e=r===null?null:d.current[r];if(!e||!l.current||!u.current)return;let t=l.current.getBoundingClientRect(),n=e.getBoundingClientRect(),{width:i,height:a}=u.current.getBoundingClientRect();_({x:ms(t.right+2,i,window.innerWidth,t.left-i-2),y:ms(n.top-5,a,window.innerHeight,n.bottom+5-a)})},[r]),(0,h.useEffect)(()=>()=>window.clearTimeout(f.current),[]),(0,h.useEffect)(()=>{if(!e)return;let d=e.items,f=r===null?[]:d[r]?.children??[],p=()=>S.set(null),m=e=>{e?.run&&(p(),e.run())},h=(e,t,n)=>e(e=>n===1?e>=t?0:e+1:e<=0?t:e-1),g=e=>{let l=e.key;if(s&&r!==null){let t=f.length-1;if(l===`Escape`||l===`ArrowLeft`||l===`h`)i(null),c(!1);else if(l===`ArrowDown`||l===`j`)h(o,t,1);else if(l===`ArrowUp`||l===`k`)h(o,t,-1);else if(l===`Home`)o(0);else if(l===`End`)o(t);else if(l===`Enter`)m(f[a]);else return;e.preventDefault(),e.stopPropagation();return}let u=d.length-1,g=d[t],_=()=>{i(t),c(!0),o(0)};if(l===`Escape`)p();else if(l===`ArrowDown`||l===`j`)h(n,u,1);else if(l===`ArrowUp`||l===`k`)h(n,u,-1);else if(l===`Home`)n(0);else if(l===`End`)n(u);else if((l===`ArrowRight`||l===`l`)&&g?.children)_();else if(l===`Enter`)g?.children?_():m(g);else return;e.preventDefault(),e.stopPropagation()},_=e=>{e.target instanceof Node&&(l.current?.contains(e.target)||u.current?.contains(e.target))||p()};return window.addEventListener(`keydown`,g,!0),window.addEventListener(`mousedown`,_),()=>{window.removeEventListener(`keydown`,g,!0),window.removeEventListener(`mousedown`,_)}},[e,t,r,a,s]),!e)return null;let v=r===null?null:e.items[r]?.children,b=e=>{e.run&&(S.set(null),e.run())},x=e=>{window.clearTimeout(f.current),i(e),c(!1),o(-1)};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`div`,{ref:l,className:Gr(),role:`menu`,style:{left:p.x,top:p.y,minWidth:e.minWidth},children:e.items.map((a,o)=>(0,V.jsxs)(h.Fragment,{children:[o>0&&a.section!==e.items[o-1]?.section&&(0,V.jsx)(`hr`,{className:`-mx-1 my-1 h-px flex-none border-none bg-line`}),(0,V.jsx)(hs,{item:a,rowRef:e=>{d.current[o]=e},selected:o===t,open:o===r,onEnter:()=>{n(o),window.clearTimeout(f.current),a.children?f.current=window.setTimeout(()=>x(o),ps):i(null)},onLeave:()=>{window.clearTimeout(f.current),o!==r&&n(-1)},onPick:()=>a.children?x(o):b(a)})]},a.label))}),v&&(0,V.jsx)(`div`,{ref:u,className:Gr(!0),role:`menu`,style:{left:g.x,top:g.y},children:v.map((e,t)=>(0,V.jsx)(hs,{item:e,selected:t===a,onEnter:()=>{o(t),c(!0)},onLeave:()=>o(-1),onPick:()=>b(e)},e.label))})]})}function _s(){let e=y(C),t=y(T);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(gs,{}),e,(0,V.jsx)(`div`,{className:Zr,"aria-live":`polite`,children:t.map(e=>{let t=`${$r(e.tone===`error`)} ${e.leaving?`is-leaving`:``}`,n=e.action;return n?(0,V.jsxs)(`div`,{className:`${t} ${Qr}`,children:[(0,V.jsx)(`span`,{children:e.text}),(0,V.jsx)(H,{onClick:()=>{oe(e.id),n.run()},children:`[ ${n.label} ]`})]},e.id):(0,V.jsx)(`button`,{type:`button`,className:t,onClick:()=>oe(e.id),children:e.text},e.id)})})]})}function vs(e){return e.urls[e.at]??``}function ys(e){try{return new URL(e).host.replace(/^www\./,``)}catch{return e}}function bs(){return{kind:`browser`,tabs:[{id:`t1`,urls:[],at:-1}],active:`t1`,recent:[`t1`],next:2}}function xs(e,t){return!e.tabs.some(e=>e.id===t)||e.active===t&&e.recent.at(-1)===t?e:{...e,active:t,recent:[...e.recent.filter(e=>e!==t),t]}}function Ss(e){let t=e;for(;t.tabs.length>12;){let e=t.tabs.filter(e=>e.id!==t.active).sort((e,n)=>t.recent.indexOf(e.id)-t.recent.indexOf(n.id))[0];if(!e)break;t=ks(t,e.id)??t}return t}function Cs(e,t){let n=`t${e.next}`,r={id:n,urls:t,at:t.length-1};return Ss(xs({...e,tabs:[...e.tabs,r],next:e.next+1},n))}function ws(e){return Cs(e,[])}function Ts(e,t){return{...e,tabs:e.tabs.map(e=>e.id===t.id?t:e)}}function Es(e,t,n){let r=e.tabs.find(e=>e.id===t);if(!r||vs(r)===n)return e;let i=[...r.urls.slice(0,r.at+1),n].slice(-30);return Ts(e,{...r,urls:i,at:i.length-1})}function Ds(e,t,n){let r=e.tabs.find(e=>e.id===t);return!r||n===r.at||n<0||n>=r.urls.length?e:Ts(e,{...r,at:n})}function Os(e,t){let n=e.tabs.find(e=>vs(e)===t);if(n)return xs(e,n.id);let r=e.tabs.find(e=>vs(e)===``);return r?Es(xs(e,r.id),r.id,t):Cs(e,[t])}function ks(e,t){let n=e.tabs.filter(e=>e.id!==t);if(n.length===0)return null;let r=e.recent.filter(e=>e!==t);if(e.active!==t)return{...e,tabs:n,recent:r};let i=[...r].reverse().find(e=>n.some(t=>t.id===e))??n[0].id;return{...e,tabs:n,active:i,recent:[...r.filter(e=>e!==i),i]}}function As(e,t){return e.tabs.some(e=>e.id===t)?ks(e,t):e}function js(e,t){let n=e.tabs.find(e=>e.id===t);return n?{...e,tabs:[n],active:t,recent:[t]}:e}function Ms(e,t,n){let r=new Set(n.map(e=>e.id)),i=[...e.filter(e=>r.has(e)&&e!==t),...r.has(t)?[t]:[]];return i.slice(Math.max(0,i.length-3))}function Ns(e,t,n,r){if(!Array.isArray(e))return null;let i=[];for(let t of e){if(!t||typeof t!=`object`)continue;let e=t;if(typeof e.id!=`string`||!/^t\d+$/.test(e.id)||i.some(t=>t.id===e.id))continue;let n=Array.isArray(e.urls)?e.urls.filter(e=>typeof e==`string`&&e!==``).slice(-30):[],r=typeof e.at==`number`&&Number.isInteger(e.at)?e.at:n.length-1;i.push({id:e.id,urls:n,at:n.length===0?-1:Math.min(n.length-1,Math.max(0,r))})}let a=i[0];if(!a)return null;let o=new Set(i.map(e=>e.id)),s=Array.isArray(n)?n.filter(e=>typeof e==`string`&&o.has(e)):[],c=typeof t==`string`&&o.has(t)?t:s.at(-1)??a.id,l=Math.max(...i.map(e=>Number(e.id.slice(1))));return{kind:`browser`,tabs:i,active:c,recent:[...s.filter(e=>e!==c),c],next:Math.max(l+1,typeof r==`number`&&Number.isInteger(r)?r:0)}}var Ps=[`quota`,`files`,`file`,`diff`,`chat`,`browser`],Fs=1e3;function Is(){return{columns:[{kind:`files`}],weights:{}}}function Ls(e,t){return e.columns.find(e=>e.kind===t)}function Rs(e){return e.slice(e.lastIndexOf(`/`)+1)}function zs(e,t){return{...e,columns:e.columns.map(e=>e.kind===t.kind?t:e)}}function Bs(e){return[...e].sort((e,t)=>Ps.indexOf(e.kind)-Ps.indexOf(t.kind))}function Vs(e,t){return{...e,columns:Bs([...e.columns,t])}}function Hs(e,t){return Ls(e,t)||t===`file`?e:Vs(e,t===`diff`?{kind:t,path:`.`,scope:`working`}:t===`browser`?bs():{kind:t})}function Us(e,t,n){let r=n===void 0?{kind:`file`,path:t}:{kind:`file`,path:t,at:n},i=Ls(e,`file`);return i?i.kind===`file`&&i.path===t&&(n===void 0||i.at===n)?e:zs(e,r):Vs(e,r)}function Ws(e,t,n,r){let i=r===void 0?{kind:`diff`,path:t,scope:n}:{kind:`diff`,path:t,scope:n,at:r},a=Ls(e,`diff`);return a?a.kind===`diff`&&a.path===t&&a.scope===n&&(r===void 0||a.at===r)?e:zs(e,i):Vs(e,i)}function Gs(e,t){let n=Ls(e,`browser`);return n?.kind===`browser`?zs(e,Os(n,t)):Vs(e,Os(bs(),t))}function Ks(e,t){if(!Ls(e,t))return e;let{[t]:n,...r}=e.weights;return{columns:e.columns.filter(e=>e.kind!==t),weights:r}}function qs(e,t){let n=Ls(e,`browser`);if(n?.kind!==`browser`)return e;let r=t(n);return r===n?e:r?zs(e,r):Ks(e,`browser`)}function Js(e,t,n,r=!1){if(t&&Ls(e,n)){let t=Ks(e,n);return{panel:t,open:t.columns.length>0}}if(r){let t=e.columns.filter(e=>e.kind===n);return{panel:Hs({...e,columns:t},n),open:!0}}return{panel:Hs(e,n),open:!0}}function Ys(e){let t=e.columns.flatMap(t=>{let n=e.weights[t.kind];return n!==void 0&&n>0?[n]:[]}),n=t.length>0?t.reduce((e,t)=>e+t,0)/t.length:1,r=e.columns.map(t=>e.weights[t.kind]||n),i=r.reduce((e,t)=>e+t,0);return r.map(e=>e/i*Fs)}function Xs(e,t){let n=t.reduce((e,t)=>e+t,0);if(t.length!==e.columns.length||!(n>0))return e;let r=Object.fromEntries(e.columns.map((e,r)=>[e.kind,Math.round(t[r]/n*1e3)/1e3]));return e.columns.every(t=>Math.abs((e.weights[t.kind]??0)-(r[t.kind]??0))<.001)?e:{...e,weights:r}}function Zs(e){return Object.keys(e.weights).length===0?e:{...e,weights:{}}}function Qs(e,t,n,r){let i=e[t],a=e[t+1];if(i===void 0||a===void 0)return[...e];let o=i+a,s=Math.min(r,o/2),c=Math.max(s,Math.min(o-s,i+n));return e.map((e,n)=>n===t?c:n===t+1?o-c:e)}var $s=Ps.filter(e=>e!==`chat`&&e!==`file`),ec=v(`terminal`),tc=`rove.web.panelWidth`,nc=`rove.web.panelOpen`,rc=v((()=>{let e=Number(localStorage.getItem(tc));return Number.isFinite(e)&&e>0?e:null})());rc.subscribe(()=>{let e=rc.get();e===null?localStorage.removeItem(tc):localStorage.setItem(tc,String(Math.round(e)))}),rc.subscribe(le);var ic=v(localStorage.getItem(nc)===`1`);ic.subscribe(()=>localStorage.setItem(nc,ic.get()?`1`:`0`));var ac=v(!1);ic.subscribe(()=>{ic.get()||ac.set(!1)});function oc(e,t,n=window.innerWidth){let r=Math.max(280,n-t-320);return Math.max(280,Math.min(r,Math.round(e)))}function sc(e,t,n=window.innerWidth){return e<2?null:oc(Math.max(300,Math.min(440,n*.28))*e,t,n)}var cc=[`files`,`diff`,`browser`];function lc(e){if(!e||typeof e!=`object`)return!1;let t=e;return typeof t.taskId==`string`&&t.taskId!==``&&cc.includes(t.view)&&typeof t.at==`number`&&(t.url===void 0||typeof t.url==`string`)&&(t.path===void 0||typeof t.path==`string`)}function uc(e){return e.narrow?{panel:!1,panelOpen:!1,narrow:!0}:{panel:!0,panelOpen:e.panelOpen&&!e.zen,narrow:!1}}function dc(e,t){return{tab:e.path?e.view===`files`?`file`:`diff`:e.view,...e.view===`browser`&&e.url?{url:e.url}:{},...e.view!==`browser`&&e.path?{path:e.path}:{},show:t.taskId===e.taskId&&!t.narrow}}function fc(e,t,n){return t.url?Gs(e,t.url):t.path?t.tab===`file`?Us(e,t.path,n):Ws(e,t.path,`working`,n):Hs(e,t.tab)}var pc=[`files`,`chat`,`diff`,`browser`,`quota`],mc=e=>e===`branch`||e===`task`?e:`working`;function hc(e){if(!e||typeof e!=`object`)return null;let t=e;return t.kind===`files`||t.kind===`chat`||t.kind===`quota`?{kind:t.kind}:t.kind===`file`&&typeof t.path==`string`&&t.path!==``&&t.path!==`.`?{kind:`file`,path:t.path}:t.kind===`diff`&&typeof t.path==`string`&&t.path!==``?{kind:`diff`,path:t.path,scope:mc(t.scope)}:t.kind===`browser`?Ns(t.tabs,t.active,t.recent,t.next):null}function gc(e,t){if(!e||typeof e!=`object`)return{};let n=e,r=t.flatMap(({kind:e})=>{let t=n[e];return typeof t==`number`&&Number.isFinite(t)&&t>0?[[e,t]]:[]});return Object.fromEntries(r)}function _c(e){let t=[e.top,e.bottom].map(e=>e&&typeof e==`object`&&`tabs`in e&&Array.isArray(e.tabs)?e.tabs:null);return t[0]?{tabs:t.flatMap(e=>e??[]).filter(e=>!!e&&typeof e==`object`&&/^t\d+$/.test(String(e.id))),recent:Array.isArray(e.recent)?e.recent.filter(e=>typeof e==`string`):[]}:null}function vc(e){let t=_c(e);if(!t)return null;let n=[...new Set(t.tabs.map(e=>e.kind))],r=[];for(let i of n){if((i===`files`||i===`chat`||i===`quota`)&&r.push({kind:i}),i===`diff`){let e=t.tabs.filter(e=>e.kind===`diff`&&typeof e.path==`string`&&e.path!==``),n=[...t.recent].reverse().map(t=>e.find(e=>e.id===t)).find(e=>e)??e[0];n&&r.push({kind:`diff`,path:n.path,scope:mc(n.scope)})}if(i===`browser`){let n=Ns(t.tabs.filter(e=>e.kind===`browser`),void 0,t.recent,e.next);n&&r.push(n)}}return{columns:Bs(r),weights:{}}}function yc(e){if(!e||typeof e!=`object`)return null;let t=e;if(!Array.isArray(t.columns))return vc(t);let n=[];for(let e of t.columns){let t=hc(e);t&&!n.some(e=>e.kind===t.kind)&&n.push(t)}return{columns:Bs(n),weights:gc(t.weights,n)}}function bc(e,t){let n=Is(),r=typeof t==`string`&&t!==``?t:``;return e!==`browser`&&!r?n:{...n,columns:[...n.columns,r?Os(bs(),r):bs()]}}function xc(e){try{let t=JSON.parse(e??`{}`);return t&&typeof t==`object`&&!Array.isArray(t)?Object.entries(t):[]}catch{return[]}}function Sc(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 Cc(e,t){let n={};for(let[t,r]of xc(e)){let e=yc(r);e&&(n[t]=e)}let r=new Map(xc(t.tab).filter(([,e])=>pc.includes(e))),i=new Map(xc(t.url)),a=[...new Set([...r.keys(),...i.keys()])].filter(e=>!(e in n));n={...Object.fromEntries(a.map(e=>[e,bc(r.get(e),i.get(e))])),...n};for(let e of Object.keys(n).slice(0,-50))delete n[e];return n}var wc=`rove.web.panels`,Tc=`rove.web.panelTab`,Ec=`rove.web.panelUrl`;function Dc(){let e={tab:localStorage.getItem(Tc),url:localStorage.getItem(Ec)},t=Cc(localStorage.getItem(wc),e);return(e.tab!==null||e.url!==null)&&(localStorage.setItem(wc,JSON.stringify(t)),localStorage.removeItem(Tc),localStorage.removeItem(Ec)),t}var Oc=v(Dc()),kc={columns:[],weights:{}};function Ac(e){return y(Oc)[e]??kc}function jc(e){let t=Ac(e??``);return y(ic)&&(e===null||t.columns.length>0)}function Mc(e){return ic.get()&&(e===null||(Oc.get()[e]??kc).columns.length>0)}var Nc=e=>Oc.subscribe(e);function Pc(e,t){let n=Oc.get()[e]??kc,r=t(n);if(r===n)return;let i=Sc(Oc.get(),e,r);Oc.set(i),localStorage.setItem(wc,JSON.stringify(i))}function Fc(e,t){Pc(e,e=>Hs(e,t)),ic.set(!0),ye()&&ec.set(t)}function Ic(e,t){let n=ic.get(),r=Js(Oc.get()[e]??kc,n&&!j.get(),t,!n);Pc(e,()=>r.panel),r.open?ic.set(!0):ac.set(!1),r.open&&j.get()&&j.set(!1)}function Lc(e){Pc(e.taskId,t=>Ws(t,e.path,e.scope)),ic.set(!0),j.get()&&j.set(!1),ye()&&ec.set(`diff`)}function Rc(e,t){Pc(e,e=>Us(e,t)),ic.set(!0),j.get()&&j.set(!1),ye()&&ec.set(`file`)}function zc(e,t){Pc(e,e=>Gs(e,t)),ic.set(!0),j.get()&&j.set(!1),ye()&&ec.set(`browser`)}function Bc(e,t){let n=Oc.get()[e]??kc;!ye()&&n.columns.length===0&&ac.set(!1),ye()&&ec.get()===t&&!Ls(n,t)&&Fc(e,`files`)}function Vc(e,t){Pc(e,e=>Ks(e,t)),Bc(e,t)}function Hc(e,t){Pc(e,e=>qs(e,t)),Bc(e,`browser`)}function Uc(e,t){Hc(e,e=>As(e,t))}function Wc(e,t){let n=dc(e,{taskId:t,narrow:ye()});Pc(e.taskId,t=>fc(t,n,e.at)),n.show&&(ic.set(!0),j.get()&&j.set(!1))}var Gc={Enter:`return`," ":`space`,Escape:`escape`,ArrowUp:`up`,ArrowDown:`down`,ArrowLeft:`left`,ArrowRight:`right`,PageUp:`pageup`,PageDown:`pagedown`};function Kc(e){if(e.altKey&&e.code){let t=/^Key([A-Z])$/.exec(e.code);if(t?.[1])return t[1].toLowerCase();let n=/^Digit(\d)$/.exec(e.code);if(n?.[1])return n[1]}return Gc[e.key]??e.key.toLowerCase()}function qc(e){let t=Kc(e),n=t===`return`?[`return`,`enter`]:[t],r=[];e.ctrlKey&&r.push(`ctrl`),e.metaKey&&r.push(`cmd`),e.altKey&&r.push(`alt`);let i=t.length===1;return e.shiftKey&&!i&&r.push(`shift`),r.length===0?e.shiftKey&&i?[...n.map(e=>`shift+${e}`),...n]:n:e.shiftKey&&i?[]:n.map(e=>`${r.join(`+`)}+${e}`)}function Jc(e){return e.startsWith(`shift+`)&&e.length===7?e.slice(6).toUpperCase():e}var Yc=new Map(ia.map(e=>[e.id,{keys:[...e.keys],prefixKeys:e.prefixKeys&&[...e.prefixKeys],hint:e.hint?{...e.hint}:void 0}]));function Xc(){return ia.map(e=>{let t=Yc.get(e.id);return{id:e.id,scope:e.scope,category:e.category,...e.bareKeys?{bareKeys:!0}:{},keys:[...t?.keys??[]],...t?.prefixKeys?{prefixKeys:[...t.prefixKeys]}:{},...t?.hint?{hint:{...t.hint}}:{}}})}var Zc=new Map(ia.map(e=>[e.id,e]));function Qc(e){return Zc.get(e)}function $c(e,t){if(!e)return!0;let n=e.toLowerCase(),r=t.toLowerCase(),i=0;for(let e=0;e<r.length&&i<n.length;e++)r.charCodeAt(e)===n.charCodeAt(i)&&i++;return i===n.length}function el(e){let t=[],n=new Map;for(let r of e){let e=n.get(r.category);e||(e=[],n.set(r.category,e),t.push({category:r.category,rows:e})),e.push(r)}return t}function tl(e){return e.hint?.keys??e.keys[0]}function nl(e){let t=Qc(e);if(!t)return null;let n=tl(t);return n&&n.length>0?n:null}function rl(e){return e.keys.length>0?e.hint?.keys??e.keys[0]??null:e.prefixKeys?.length?null:e.hint?.keys??null}function il(e,t){return e.scope===`global`?!0:t===null?!1:e.scope===t||t===`terminal`&&e.scope===`workspace`}function al(e,t,n,r){let i=[],a=[],o=[],s=new Map;for(let c of e){let e=rl(c),l=il(c,t),u=r?r.direct.has(c.id):l,d=r?r.prefix.has(c.id):l;if(e){let t={binding:c,primary:e,aliases:c.keys.filter(t=>t!==e)};if(u&&(l||c.presentation===`onePress`))c.presentation===`onePress`?a.push(t):i.push(t);else if(!l&&c.scope!==`global`){let e=s.get(c.scope);e?e.push(t):s.set(c.scope,[t])}}n&&d&&c.prefixKeys?.length&&o.push({binding:c,primary:`${n} + ${c.prefixKeys[0]}`,aliases:c.prefixKeys.slice(1).map(e=>`${n} + ${e}`)})}let c=[];i.length&&c.push({kind:`here`,scope:t??void 0,rows:i}),a.length&&c.push({kind:`direct`,rows:a}),o.length&&c.push({kind:`prefix`,rows:o});for(let[e,t]of s)c.push({kind:`other`,scope:e,rows:t});return c}var ol={global:`Global`,sidebar:`Sidebar`,workspace:`Workspace`,files:`Files`,inbox:`Inbox`,terminal:`Terminal`};function sl(e){return e?ol[e]:`Global`}function cl(e){return[`kanban.open`,`automations.open`,`workItems.open`].includes(e)?`Views`:e.startsWith(`focus.`)?`Navigation`:e.startsWith(`inbox.`)||e.startsWith(`attention.`)?`Attention`:e.startsWith(`chat.tab.`)||e.startsWith(`chat.session.`)?`Sessions`:e.startsWith(`chat.fork.`)||e.startsWith(`task.`)?`Tasks`:e.startsWith(`settings.`)||e===`workspace.zenToggle`?`Tools`:Qc(e)?.category??`Global`}function ll(e,t,n){let r=e.trim();return $c(r,t)||$c(r,n)}var ul={title:`Rove — keybindings`,palette:`Search commands`,search:`Type an action name or chord…`,filter:`/ filter actions`,noResults:`No matching actions. Try another name or clear the filter.`,run:`↑↓ select · enter run · esc cancel`,reportProblem:`Report a problem`,reportPrompt:"You are helping the user report a problem with Rove itself (not their own project) as a GitHub issue. First ask what they were doing and what felt wrong: one to three short questions, one at a time. Then collect context: run `rove --version` and `rove daemon status`, and read the last ~50 lines of {logPath} only if the problem could involve the daemon. Draft an issue title and body (what happened, what they expected, steps, relevant output) and show it to the user. Only after they say OK, file it with a heredoc: `rove feedback --kind bug|idea|question --title \"...\" --body-file - <<'EOF'` followed by the body and `EOF`. Then share the issue URL. If it prints a prefilled link instead (gh missing or signed out), give the user that link and tell them to run `gh auth login`.",unavailable:`This action is no longer available. Close and reopen the palette.`,esc:`esc`,scrollKeys:`↑↓ ⇞⇟ scroll`,commandLayer:`{prefix} — more Rove commands`,escCancel:`esc cancel`,directLayer:`Hold ctrl — Rove shortcuts`,releaseCtrl:`release ctrl to close`,overflow:`… F1 for all shortcuts`,moreCommandsPrefix:`More commands (prefix)`,focused:`Focused: {surface}`,allBindings:`All keybinding contexts`,grammar:`Use keys here · one-press Rove shortcuts · {prefix} for more commands · right-click a row for its menu`,disabled:`prefix disabled`,here:`HERE — only in {surface}`,direct:`ONE PRESS — Rove shortcuts`,afterPrefix:`AFTER PREFIX — more Rove commands`,otherPane:`OTHER PANE — {surface}`,marks:{rows:`MARKS — task and tab rows`,inbox:`MARKS — tab strip and Inbox`,pr:`MARKS — pull request chip`},mark:{spinner:`working: an engine turn or a task job is running`,needsInput:`waiting on your answer: a permission prompt or a question`,attention:`needs you: an error, a rate limit, an exited engine or a failed deletion`,unseen:`a turn finished and you have not looked yet`,idle:`quiet`,subagent:`running subagents, in front of the branch`,remote:`the task lives on another machine`,done:`the turn finished`,rateLimited:`rate limited; it resumes on its own`,dead:`the engine process exited`,routineFailed:`a routine run failed`,conflict:`merge conflicts`,checksFailing:`checks failing`,checksPassing:`checks passing`}},dl={title:`Rove — 快捷键`,palette:`搜索命令`,search:`输入操作名称或快捷键…`,filter:`/ 筛选操作`,noResults:`没有匹配的操作。请换个名称或清空筛选。`,run:`↑↓ 选择 · enter 执行 · esc 取消`,reportProblem:`报告问题`,reportPrompt:"你在帮用户把 Rove 本身的问题(不是他们自己项目的问题)提成一个 GitHub issue。先问清楚他们当时在做什么、哪里不对劲:一到三个简短的问题,一次问一个。然后收集上下文:运行 `rove --version` 和 `rove daemon status`,只有问题可能和 daemon 有关时才读 {logPath} 的最后约 50 行。起草 issue 的标题和正文(发生了什么、期望什么、复现步骤、相关输出)并展示给用户。用户确认之后才提交,用 heredoc:`rove feedback --kind bug|idea|question --title \"...\" --body-file - <<'EOF'`,接正文,最后一行 `EOF`。然后把 issue 链接发给用户。如果输出的是预填链接(没装 gh 或没登录),把链接给用户,并告诉他运行 `gh auth login`。",unavailable:`此操作已不可用。请关闭并重新打开命令面板。`,esc:`esc`,scrollKeys:`↑↓ ⇞⇟ 滚动`,commandLayer:`{prefix} — 更多 Rove 命令`,escCancel:`esc 取消`,directLayer:`按住 ctrl — Rove 快捷键`,releaseCtrl:`松开 ctrl 关闭`,overflow:`… 按 F1 查看全部快捷键`,moreCommandsPrefix:`更多命令(prefix)`,focused:`当前焦点:{surface}`,allBindings:`所有快捷键上下文`,grammar:`当前区域直接按 · Rove 单次快捷键 · {prefix} 打开更多命令 · 右键任务行打开菜单`,disabled:`Prefix 已禁用`,here:`当前区域 — 仅在{surface}`,direct:`一次按下 — Rove 快捷键`,afterPrefix:`按下 Prefix 后 — 更多 Rove 命令`,otherPane:`其他区域 — {surface}`,marks:{rows:`标记 — 任务行和标签行`,inbox:`标记 — 标签栏和收件箱`,pr:`标记 — PR 标记`},mark:{spinner:`运行中:引擎正在执行一轮,或任务作业正在运行`,needsInput:`等你回答:权限确认或提问`,attention:`需要你处理:出错、限流、引擎已退出或删除失败`,unseen:`一轮已结束,你还没看过`,idle:`空闲`,subagent:`正在运行的子代理,显示在分支名前`,remote:`任务在另一台机器上`,done:`这一轮已结束`,rateLimited:`被限流,会自动恢复`,dead:`引擎进程已退出`,routineFailed:`例行任务运行失败`,conflict:`存在合并冲突`,checksFailing:`检查未通过`,checksPassing:`检查已通过`}},fl={status:{commands:`{key} commands`,help:`{key} help`,sidebar:`{key} sidebar`,settings:`settings`},pane:{move:`move`,open:`open`,collapse:`collapse`,diff:`diff`}},pl={status:{commands:`{key} 命令`,help:`{key} 帮助`,sidebar:`{key} 侧栏`,settings:`设置`},pane:{move:`移动`,open:`打开`,collapse:`折叠`,diff:`差异`}},ml={category:{Global:`Global`,Sidebar:`Sidebar`,Workspace:`Workspace`,Navigation:`Navigation`,"Tasks pane":`Tasks pane`,Files:`Files`,Terminal:`Terminal`,Views:`Views`,Tasks:`Tasks`,Sessions:`Sessions`,Attention:`Attention`,Tools:`Tools`,"Diff review":`Diff review`,Inbox:`Inbox`},desc:{"palette.open":`Search commands`,"help.open":`Show keybindings help`,"task.new":`New task`,"task.new.global":`New task`,"task.openEditor":`Open active Task directory in editor`,"task.moveMode":`Reorder sidebar rows (then j/k — tab, task, or project)`,"settings.open":`Open settings`,"app.refresh":`Refresh Rove onto the installed build (after an update)`,"settings.open.sidebar":`Open settings`,"inbox.show":`Open Inbox`,"worktrees.open.sidebar":`Open worktrees`,"kanban.open":`Open kanban (issues board)`,"automations.open":`Open routines (scheduled tasks)`,"workItems.open":`Open GitHub issues (external tracker)`,"app.quit":`Quit (with confirm)`,"focus.sidebar":`Back to sidebar (tasks)`,"focus.previous":`Focus previous pane (files → workspace → sidebar)`,"focus.next":`Focus next pane (sidebar → workspace → files)`,"workspace.zenToggle":`Toggle zen mode`,"view.redraw":`Redraw the screen`,"attention.next":`Jump to the next Inbox item`,"sidebar.nav":`Move cursor up/down`,"sidebar.select":`Open the selected task`,"sidebar.tree.open":`Open the row under the cursor`,"sidebar.goto":`Top / bottom of list (gg or shift-G)`,"sidebar.rename":`Rename task`,"sidebar.localMerge":`Reorder row (Shift+M, then j/k — tab, task, or project)`,"sidebar.pin":`Pin / unpin task at top (Shift+P)`,"sidebar.sort":`Cycle task sort (default → recent → attention → name)`,"sidebar.delete":`Remove session (with confirm)`,"sidebar.search.enter":`Search tasks (fuzzy filter)`,"sidebar.search.nav":`Move highlight in search results`,"sidebar.search.submit":`Select search match and exit search`,"sidebar.search.cancel":`Cancel search (restore prior selection)`,"tasks.openWorktree":`Open selected Task directory in your editor`,"tasks.renameBranch":`Rename the selected task's git branch`,"tasks.cycleEngine":`Cycle engine vendor — applies on reopen`,"tasks.update":`Open the update page (when a new version is available)`,"tasks.focusEngine":`Focus the engine pane of the current window`,"chat.tab.new":`New conversation here (a child task sharing this directory)`,"chat.tab.chooseEngine":`New conversation — engine/shell picker with destination + context toggles`,"chat.tab.fork":`Continue this chat in a new child task (same directory, keeps the conversation)`,"chat.fork.new":`Quick-fork: create child task seeded with current repo/branch/model`,"chat.tab.close":`Close chat tab`,"chat.tab.rename":`Rename active chat tab`,"chat.tab.cycle-next":`Next chat tab`,"chat.tab.cycle-prev":`Previous chat tab`,"chat.tab.goto":`Go to chat tab N`,"workspace.split.right":`Split right`,"workspace.split.down":`Split down`,"workspace.split.focus-next":`Focus next split`,"workspace.split.close":`Close active split (tab when unsplit)`,"workspace.split.rename":`Rename active split (tab when unsplit)`,"workspace.reopenSession":`Reopen a session in a task whose tabs are all closed`,"files.nav":`Move cursor up/down`,"files.hierarchy":`Collapse / expand tree level`,"files.open":`Open file in configured editor (diff when supported)`,"files.tab":`Switch tab (cycle All / Changes)`,"files.refresh":`Refresh`,"files.scope":`Toggle Changes scope (working ↔ branch vs base)`,"files.diff":`Open a read-only diff in a workspace tab`,"files.diffAll":`Open the whole worktree's diff in one workspace tab`,"files.openExternal":`Open file in system default app (audio / video / pdf preview)`,"files.mention":`Inject @<path> mention into the engine pane`,"files.createPR":`Ask the agent to create a PR from the current task`,"files.fixChecks":`Ask the agent to fix the failing PR checks`,"files.syncBase":`Merge the base branch into this task's worktree`,"diff.review.cursor":`Move the line cursor over the diff`,"diff.review.range":`Toggle range anchor at the cursor`,"diff.review.note":`Add a review note at the cursor`,"diff.review.send":`Send all unsent review notes to the engine`,"diff.review.drop":`Drop the review note the cursor sits inside`,"diff.review.reload":`Reload the previewed file from disk`,"inbox.nav":`Move through Inbox items`,"inbox.open":`Open the selected Inbox item`,"inbox.delete":`Ack the selected Inbox item`,"inbox.deleteAll":`Ack every ATTENTION item`,"terminal.scroll-up":`Scroll scrollback up`,"terminal.scroll-down":`Scroll scrollback down`,"terminal.reset":`Reset terminal — kill the current shell and respawn`}},hl={category:{Global:`全局`,Sidebar:`侧边栏`,Workspace:`工作区`,Navigation:`导航`,"Tasks pane":`任务面板`,Files:`文件`,Terminal:`终端`,Views:`视图`,Tasks:`任务`,Sessions:`会话`,Attention:`提醒`,Tools:`工具`,"Diff review":`差异审阅`,Inbox:`收件箱`},desc:{"palette.open":`搜索命令`,"help.open":`显示快捷键帮助`,"task.new":`新建任务`,"task.new.global":`新建任务`,"task.openEditor":`在编辑器中打开当前 Task 的目录`,"task.moveMode":`调整侧边栏行顺序(然后 j/k——tab / 任务 / 项目)`,"settings.open":`打开设置`,"app.refresh":`让 Rove 刷新到已安装的版本(更新之后)`,"settings.open.sidebar":`打开设置`,"inbox.show":`打开收件箱`,"worktrees.open.sidebar":`打开 worktrees`,"kanban.open":`打开看板(issues)`,"automations.open":`打开例行任务(定时任务)`,"workItems.open":`打开 GitHub issues(外部跟踪器)`,"app.quit":`退出(需确认)`,"focus.sidebar":`返回侧边栏(任务列表)`,"focus.previous":`聚焦上一个面板(文件 → 工作区 → 侧边栏)`,"focus.next":`聚焦下一个面板(侧边栏 → 工作区 → 文件)`,"workspace.zenToggle":`切换禅模式`,"view.redraw":`重绘屏幕`,"attention.next":`跳到下一个收件箱条目`,"sidebar.nav":`上下移动光标`,"sidebar.select":`打开选中的任务`,"sidebar.tree.open":`打开光标所在行`,"sidebar.goto":`跳到列表顶部 / 底部(gg 或 shift-G)`,"sidebar.rename":`重命名任务`,"sidebar.localMerge":`调整当前行顺序(Shift+M,然后 j/k——tab / 任务 / 项目)`,"sidebar.pin":`置顶 / 取消置顶任务(Shift+P)`,"sidebar.sort":`切换任务排序方式(默认 → 最近 → 关注 → 名称)`,"sidebar.delete":`移除会话(需确认)`,"sidebar.search.enter":`搜索任务(模糊过滤)`,"sidebar.search.nav":`在搜索结果中移动高亮`,"sidebar.search.submit":`选中搜索匹配项并退出搜索`,"sidebar.search.cancel":`取消搜索(恢复之前的选中项)`,"tasks.openWorktree":`在编辑器中打开选中 Task 的目录`,"tasks.renameBranch":`重命名选中任务的 git 分支`,"tasks.cycleEngine":`循环切换引擎厂商——重新打开后生效`,"tasks.update":`打开更新页面(有新版本时)`,"tasks.focusEngine":`聚焦当前窗口的引擎面板`,"chat.tab.new":`在此新建对话(共享当前目录的子任务)`,"chat.tab.chooseEngine":`新建对话 —— 选择引擎或 shell,可切换落点与上下文`,"chat.tab.fork":`把当前对话接到新子任务(同一目录,带上已有对话)`,"chat.fork.new":`快速派生:以当前仓库/分支/模型创建子任务`,"chat.tab.close":`关闭聊天标签页`,"chat.tab.rename":`重命名当前聊天标签页`,"chat.tab.cycle-next":`下一个聊天标签页`,"chat.tab.cycle-prev":`上一个聊天标签页`,"chat.tab.goto":`跳到第 N 个聊天标签页`,"workspace.split.right":`向右分屏`,"workspace.split.down":`向下分屏`,"workspace.split.focus-next":`聚焦下一个分屏`,"workspace.split.close":`关闭当前分屏(未分屏时关闭标签页)`,"workspace.split.rename":`重命名当前分屏(未分屏时重命名标签页)`,"workspace.reopenSession":`在标签页全部关闭的任务中重新打开会话`,"files.nav":`上下移动光标`,"files.hierarchy":`折叠 / 展开树层级`,"files.open":`在已配置的编辑器中打开文件(支持时显示 diff)`,"files.tab":`切换标签页(循环 全部 / 变更)`,"files.refresh":`刷新`,"files.scope":`切换变更范围(工作区 ↔ 分支对比 base)`,"files.diff":`在工作区标签页中打开只读 diff`,"files.diffAll":`把整个 worktree 的 diff 打开在一个工作区标签页里`,"files.openExternal":`在系统默认应用中打开文件(音频 / 视频 / pdf 预览)`,"files.mention":`将 @<path> 提及注入引擎面板`,"files.createPR":`让 agent 从当前任务创建 PR`,"files.fixChecks":`让 agent 修复失败的 PR 检查`,"files.syncBase":`把基础分支合并进该任务的工作树`,"diff.review.cursor":`在 diff 中移动行光标`,"diff.review.range":`在光标处切换范围锚点`,"diff.review.note":`在光标处添加审阅备注`,"diff.review.send":`将所有未发送的审阅备注发给引擎`,"diff.review.drop":`删除光标所在的评审备注`,"diff.review.reload":`从磁盘重新加载当前预览的文件`,"inbox.nav":`在收件箱条目之间移动`,"inbox.open":`打开选中的收件箱条目`,"inbox.delete":`将选中的收件箱条目标为已阅`,"inbox.deleteAll":`将所有待处理条目标为已阅`,"terminal.scroll-up":`向上滚动回滚`,"terminal.scroll-down":`向下滚动回滚`,"terminal.reset":`重置终端——关闭当前 shell 并重新启动`}};function gl(e,t){let n=e;for(let e of t.split(`.`)){if(!n||typeof n!=`object`||!(e in n))return;n=Reflect.get(n,e)}return typeof n==`string`?n:void 0}function _l(e,t){return kt.get()===`zh`?t:e}function vl(e,t){return t?e.replace(/\{(\w+)\}/g,(e,n)=>String(t[n]??e)):e}var yl=(e,t)=>vl(gl(_l(ul,dl),e)??gl(ul,e)??e,t),bl=(e,t)=>vl(gl(_l(fl,pl),e)??gl(fl,e)??e,t),xl=(e,t)=>vl(gl(_l(Gi,Ki),e)??gl(Gi,e)??e,t);function Sl(e){return _l(ml,hl).desc[e]??ml.desc[e]??e}function Cl(e){let t=Sl(e),n=t.search(/\s—\s|——/);return n>0?t.slice(0,n):t}function wl(e){return _l(ml,hl).category[e]??e}var Tl=(e,t)=>vl(gl(_l(Yi,Xi),e)??gl(Yi,e)??e,t),El=(e,t)=>vl(gl(_l(Ui,Wi),e)??gl(Ui,e)??e,t),Dl=e=>e.split(` + `).map(e=>ca(e)).join(` + `);function Ol(e){let t=wl(sl(e.scope));return e.kind===`here`?yl(`here`,{surface:t}):e.kind===`direct`?yl(`direct`):e.kind===`prefix`?yl(`afterPrefix`):yl(`otherPane`,{surface:t})}function kl(e){let t=document.activeElement instanceof HTMLElement?document.activeElement:null;C.set((0,V.jsx)(Al,{model:e,surface:Do(),origin:t}))}function Al({model:e,surface:t,origin:n}){B();let r=y(ua),[i,a]=(0,h.useState)(!1),[o,s]=(0,h.useState)(``),c=(0,h.useRef)(null),l=(0,h.useMemo)(()=>Oo(e,t),[e,t]),u=(0,h.useMemo)(()=>al(ko(),t===`terminal`?`terminal`:t,ha(),l),[l,t,r]).map(e=>({...e,rows:e.rows.filter(e=>ll(o,Sl(e.binding.id),e.primary))})).filter(e=>e.rows.length>0);return(0,h.useEffect)(()=>()=>n?.focus(),[n]),(0,h.useEffect)(()=>{let e=c.current,t=t=>{if(!e||t.ctrlKey||t.metaKey||t.altKey)return;let n=e.clientHeight;if(t.key===`ArrowUp`)e.scrollBy({top:-24});else if(t.key===`ArrowDown`)e.scrollBy({top:24});else if(t.key===`PageUp`)e.scrollBy({top:-n});else if(t.key===`PageDown`)e.scrollBy({top:n});else if(t.key===`Home`)e.scrollTo({top:0});else if(t.key===`End`)e.scrollTo({top:e.scrollHeight});else if(!i&&t.key===`?`)R();else if(!i&&t.key===`/`)a(!0);else return;t.preventDefault()};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[i]),(0,V.jsx)(bi,{title:yl(`title`),wide:!0,children:(0,V.jsxs)(`div`,{className:`${Wr} help`,children:[(0,V.jsxs)(`div`,{className:mn,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`p`,{className:`text-muted`,children:t?yl(`focused`,{surface:wl(sl(t))}):yl(`allBindings`)}),(0,V.jsx)(`p`,{className:`text-muted`,children:yl(`grammar`,{prefix:ga()})})]}),(0,V.jsxs)(`div`,{className:hn,children:[(0,V.jsx)(`span`,{className:`subtle`,children:yl(`scrollKeys`)}),(0,V.jsx)(`button`,{type:`button`,className:kr,onClick:R,children:yl(`esc`)})]})]}),i?(0,V.jsx)(`input`,{className:jr,autoFocus:!0,spellCheck:!1,value:o,placeholder:yl(`search`),onChange:e=>{s(e.target.value),c.current?.scrollTo({top:0})}}):(0,V.jsx)(`p`,{className:`text-muted`,children:yl(`filter`)}),u.length===0&&(0,V.jsx)(`p`,{className:`text-muted`,children:yl(`noResults`)}),(0,V.jsx)(`div`,{className:gn,ref:c,children:u.map((e,t)=>(0,V.jsxs)(`section`,{className:_n,children:[(0,V.jsx)(`h2`,{className:vn,children:Ol(e)}),e.rows.map(t=>(0,V.jsxs)(`div`,{className:yn,children:[(0,V.jsx)(`span`,{className:`mono ${bn}`,children:Dl(t.primary)}),(0,V.jsx)(`span`,{className:`flex-1`,children:Sl(t.binding.id)}),t.aliases.length>0&&(0,V.jsx)(`span`,{className:`text-muted`,children:`(${t.aliases.map(Dl).join(`, `)})`})]},`${e.kind}-${t.binding.id}`))]},`${e.kind}-${e.scope??t}`))})]})})}function jl(e){switch(e){case`permission_needed`:return{glyph:`?`,tone:`warning`,stateKey:`inbox.state.needsInput`};case`turn_complete`:return{glyph:`✓`,tone:`success`,stateKey:`inbox.state.done`};case`rate_limited`:return{glyph:`◷`,tone:`warning`,stateKey:`inbox.state.rateLimited`};case`dead`:return{glyph:`†`,tone:`attention`,stateKey:`inbox.state.dead`};case`decision_needed`:return{glyph:`?`,tone:`warning`,stateKey:`inbox.state.decision`};case`routine_failed`:return{glyph:`↻`,tone:`attention`,stateKey:`inbox.state.routineFailed`};case`report_missing`:return{glyph:`!`,tone:`warning`,stateKey:`inbox.state.reportMissing`};default:return{glyph:`!`,tone:`attention`,stateKey:`inbox.state.error`}}}function Ml(e){let t=Math.max(0,Math.round(e/1e3));if(t<60)return`${t}s`;let n=Math.round(t/60);if(n<60)return`${n}m`;let r=Math.round(n/60);return r<48?`${r}h`:`${Math.round(r/24)}d`}var Nl=e=>e===`routine_failed`,Pl=e=>`${e.taskId??``}:${e.tabId??``}`;function Fl(e,t){let n=new Map(t.map((e,t)=>[e,t])),r=e=>+(e.state===`turn_complete`),i=e=>n.get(e.taskId??``)??2**53-1;return[...e].sort((e,t)=>r(e)-r(t)||e.at-t.at||i(e)-i(t)||Pl(e).localeCompare(Pl(t)))}function Il(e,t,n){let r=new Set(t),i=Fl(e,t).filter(e=>e.taskId===null||r.has(e.taskId));if(i.length===0)return null;let a=n.taskId===null?-1:i.findIndex(e=>Pl(e)===Pl(n));return a<0||i.length===1?i[0]??null:i[(a+1)%i.length]??null}function Ll(e){let t=(e.terminal?.tail??[]).map(e=>e.trimEnd()),n=t.length;for(;n>0&&t[n-1]===``;)n--;let r=0;for(;r<n&&t[r]===``;)r++;return t.slice(Math.max(r,n-12),n)}async function Rl(e,t,n=!1){let r=`attention.dismiss`,i;if(Nl(t.state)){if(!t.automationId)return;r=`attention.dismissRoutine`,i={automationId:t.automationId}}else{if(t.gateId||t.state===`decision_needed`||t.state===`report_missing`&&!n||t.taskId===null)return;i={taskId:t.taskId,...t.tabId?{tabId:t.tabId}:{},...t.deliveryId?{deliveryId:t.deliveryId}:{}}}await e.client.request(r,i).catch(e=>I(String(e),`error`))}function zl(e,t){Rl(e,t),R(),k.set(t.automationId??null),O.set(`routines`)}var q=524288e3,J=1048576;function Bl(e,t){return/\.pdf$/i.test(e)?`pdf[${t}]`:/\.(png|jpe?g|gif|webp)$/i.test(e)?`images[${t}]`:`files[${t}]`}function Vl(e){let t=-1;for(let n of e.matchAll(/^(?:images|pdf|files)\[(\d+)\]:/gm)){let e=Number.parseInt(n[1],10);e>t&&(t=e)}return t+1}function Hl(e,t){let n=e.replace(/\s+$/,``),r=Vl(e);for(let e of t){let t=`${Bl(e,r)}: ${e}`;n=n.length>0?`${n}\n${t}`:t,r+=1}return n}function Ul(e){let t=``;for(let n=0;n<e.length;n+=32768)t+=String.fromCharCode(...e.subarray(n,n+32768));return btoa(t)}async function Wl(e,t){if(t.size>524288e3)throw Error(z(`pages.attachTooLarge`,{name:t.name}));let n={mime:t.type,name:t.name},r=async(e,n)=>Ul(new Uint8Array(await t.slice(e,n).arrayBuffer()));if(t.size<=1048576)return e.request(`attachment.put`,{...n,data:await r(0,t.size)});let i;for(let a=0;;){let o=Math.min(a+J,t.size),s=await e.request(`attachment.part`,{...n,...i?{upload:i}:{},offset:a,data:await r(a,o),done:o===t.size});if(s.path!==void 0)return{path:s.path,kind:s.kind??`file`};i=s.upload,a=o}}async function Gl(e,t){return(await Wl(e,t)).path}function Kl(e){if(e<1024)return`${e} B`;let t=[`KB`,`MB`,`GB`,`TB`],n=e/1024,r=0;for(;n>=1023.5&&r<t.length-1;)n/=1024,r++;let i=n.toFixed(1);return`${Number(i)>=100?Math.round(n):i} ${t[r]}`}var ql=`size-14 rounded-sm border-hairline border-line object-cover`;function Jl({name:e,thumb:t}){if(t)return(0,V.jsx)(`img`,{src:t,alt:``,draggable:!1,className:ql});let n=e.includes(`.`)?e.split(`.`).pop()??``:``;return(0,V.jsx)(`span`,{className:`${ql} flex items-center justify-center font-mono text-meta uppercase text-muted`,children:n.slice(0,4)||`file`})}function Yl({item:e,onRemove:t}){let[n]=(0,h.useState)(e.pending);return(0,V.jsxs)(`li`,{className:`group relative size-14 shrink-0 ${n?`motion-safe:animate-rise-in`:``}`,title:`${e.name} · ${Kl(e.size)}`,children:[(0,V.jsx)(`div`,{className:`transition-opacity duration-150 motion-reduce:transition-none ${e.pending?`opacity-50`:``}`,children:(0,V.jsx)(Jl,{...e})}),(0,V.jsx)(`button`,{type:`button`,"aria-label":z(`newSession.removeAttachment`,{name:e.name}),className:`absolute top-0.5 right-0.5 flex size-5 cursor-pointer items-center justify-center rounded-full border-hairline border-line bg-paper p-0 text-meta leading-none text-ink opacity-0 group-focus-within:opacity-100 group-hover:opacity-100 touch:size-7 touch:opacity-100 touch:after:absolute touch:after:-inset-2 touch:after:content-['']`,onClick:()=>t(e.id),children:`×`})]})}function Xl({items:e,onRemove:t}){return e.length===0?null:(0,V.jsx)(`ul`,{className:`m-0 flex min-w-0 list-none flex-wrap gap-1.5 p-0`,"data-field":`attachments`,children:e.map(e=>(0,V.jsx)(Yl,{item:e,onRemove:t},e.id))})}function Zl(e){return{drop:{onDragOver:e=>e.dataTransfer.types.includes(`Files`)&&e.preventDefault(),onDrop:t=>{t.dataTransfer.files.length!==0&&(t.preventDefault(),e(Array.from(t.dataTransfer.files)))}},onPaste:t=>{let n=Array.from(t.clipboardData.files);n.length!==0&&(t.preventDefault(),e(n))}}}function Ql(e){return(0,V.jsxs)(`label`,{className:e.className,title:e.title,children:[e.children,(0,V.jsx)(`input`,{type:`file`,multiple:!0,className:`sr-only`,disabled:e.disabled,onChange:t=>{let n=Array.from(t.target.files??[]);t.target.value=``,n.length>0&&e.onFiles(n)}})]})}var $l={image:`images`,pdf:`pdf`};function eu(e,t){let n=t.filter(e=>e.path!==void 0);return n.length===0?e:`${e}\n\n${n.map((e,t)=>`${$l[e.kind??`image`]??`files`}[${t}]: ${e.path}`).join(`
|
|
37
37
|
`)}`}var tu=112;async function nu(e){if(e.type.startsWith(`image/`))try{let t=await createImageBitmap(e),n=Math.min(1,tu/Math.min(t.width,t.height)),r=document.createElement(`canvas`);return r.width=Math.round(t.width*n),r.height=Math.round(t.height*n),r.getContext(`2d`)?.drawImage(t,0,0,r.width,r.height),t.close(),r.toDataURL(`image/webp`,.8)}catch{return}}function ru(e){if(!e)return[];try{let t=JSON.parse(sessionStorage.getItem(e)??`[]`);return Array.isArray(t)?t:[]}catch{return[]}}var iu=0;function au(e,t,n){let[r,i]=(0,h.useState)(()=>ru(n)),a=(0,h.useRef)(r),o=(0,h.useRef)(new Set),s=e=>{if(a.current=e(a.current),i(a.current),n)try{sessionStorage.setItem(n,JSON.stringify(a.current.filter(e=>e.path!==void 0)))}catch{}},c=async n=>{let r=`${Date.now()}-${iu++}`,i=await nu(n);s(e=>[...e,{id:r,name:n.name,size:n.size,mime:n.type,...i?{thumb:i}:{}}]);try{let t=await Wl(e.client,n);s(e=>e.map(e=>e.id===r?{...e,path:t.path,kind:t.kind}:e))}catch(e){s(e=>e.filter(e=>e.id!==r)),t(e instanceof Error?e.message:String(e))}};return{attachments:r,attach:e=>{for(let t of e){let e=c(t);o.current.add(e),e.finally(()=>o.current.delete(e))}},remove:e=>s(t=>t.filter(t=>t.id!==e)),ready:async()=>(await Promise.all(o.current),a.current),clear:()=>s(()=>[])}}function ou(e){return(0,V.jsx)(Xl,{items:e.attachments.map(e=>({...e,pending:e.path===void 0})),onRemove:e.onRemove})}function su(e){let t=(0,h.useRef)(null),n=(0,h.useRef)(e.value);n.current=e.value;let r=(r,i)=>{r.preventDefault();let a=e.choices.findIndex(e=>e.id===n.current),o=e.choices[(a+i+e.choices.length)%e.choices.length];o&&(n.current=o.id,e.onChange(o.id),requestAnimationFrame(()=>t.current?.querySelector(`[aria-pressed=true]`)?.focus()))};return(0,V.jsx)(`div`,{ref:t,className:Ir,"aria-label":e.label,"data-field":e.field,onKeyDown:t=>{t.ctrlKey||t.metaKey||t.altKey||e.choices.length===0||(t.key===`ArrowRight`||t.key===`l`?r(t,1):(t.key===`ArrowLeft`||t.key===`h`)&&r(t,-1))},children:e.choices.map(t=>(0,V.jsx)(`button`,{type:`button`,"aria-pressed":t.id===e.value,tabIndex:t.id===e.value||!e.choices.some(t=>t.id===e.value)?0:-1,className:Lr(t.id===e.value,t.dim),title:t.title,onClick:()=>e.onChange(t.id),children:t.label},t.id))})}function cu(){return typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(`(hover: none) and (pointer: coarse)`).matches}var lu=/^(?:enter|return|tab|esc|space|shift|ctrl\+\S+|cmd\+\S+|alt\+\S+|[↑↓←→]+(?:\/[↑↓←→]+)?|[b-hj-z](?:\/[b-hj-z])?)(?:\/\S+)?(?:\s|$)/i;function uu(e){return e.split(`·`).map(e=>e.trim()).filter(e=>e&&!lu.test(e)).join(` · `)}function du(e){return cu()?uu(e):e}function fu(e){if(typeof e!=`string`)return``;let t=e.replace(/\s+/g,` `).trim();if(t.length===0)return``;let n=[...t];return n.length<=40?t:`${n.slice(0,40).join(``)}…`}function pu(e){let t=hu(e);return t<0||t===e.length-1?{base:e,dir:``}:{base:e.slice(t+1),dir:e.slice(0,t+1)}}function mu(e){return/^(?:[A-Za-z]:(?:[\\/]|$)|\\\\)/.test(e)}function hu(e){return mu(e)||/^~\\/.test(e)?Math.max(e.lastIndexOf(`/`),e.lastIndexOf(`\\`)):e.lastIndexOf(`/`)}function gu(e,t){let n=t.trim().toLowerCase();return n?e.filter(e=>e.toLowerCase().includes(n)):e}function _u(e){return e.startsWith(`~`)||e.includes(`/`)||mu(e)}function vu(e,t){return t?e===`~`?t:e.startsWith(`~/`)||e.startsWith(`~\\`)?t+e.slice(1):e:e}function yu(e){let t=mu(e),n=t&&/^[A-Za-z]:/.test(e)?3:1,r=e.length;for(;r>n&&(e[r-1]===`/`||t&&e[r-1]===`\\`);)r--;return e.slice(0,r)}var bu=/^(?:(?:https?|ssh|git):\/\/[A-Za-z0-9[]\S*|[A-Za-z0-9._-]+@[A-Za-z0-9][A-Za-z0-9.-]*:\S+)$/i,xu=/^[A-Za-z0-9][A-Za-z0-9-]{0,38}\/(?![.]+(?:git)?$)[A-Za-z0-9._-]{1,100}$/i;function Su(e){let t=e.trim();return bu.test(t)||xu.test(t)?t:null}var Cu=/^(?:https?:\/\/(?:www\.)?github\.com\/|(?:ssh:\/\/)?git@github\.com[:/])/i;function wu(e){let t=e.trim(),n=t.replace(Cu,``);if(n===t)return xu.test(t)?t.replace(/\.git$/i,``).toLowerCase():null;let[r,i]=n.split(/[/?#]/),a=i?.replace(/\.git$/i,``);return r&&a?`${r}/${a}`.toLowerCase():null}function Tu(e,t){return e.filter(e=>e.enabled!==!1||e.id===t)}function Eu(e,t){return(e.find(e=>e.id===t)??e.find(e=>e.ready!==!1)??e[0])?.id??``}function Du(e,t){return!e||e.acceptsModel===!1?[]:[{id:``,label:t},...(e.models??[]).map(e=>({id:e.id,label:e.label??e.id}))]}function Ou(e,t,n){return t?e.find(e=>e.id===t)?.label??t:n}function ku(e,t){return e.includes(t)?e.length>1?e.filter(e=>e!==t):e:[...e,t]}function Au(e){let[t,n,...r]=e;return!t||!n?t??``:r.length>0?`${t} + ${n} +${r.length}`:`${t} + ${n}`}function ju(e){if(!(e instanceof Error)||!(`code`in e)||e.code!==`PARTIAL_FANOUT`)return;let t=`detail`in e&&e.detail&&typeof e.detail==`object`?e.detail:void 0;return t&&`groupId`in t&&typeof t.groupId==`string`&&t.groupId?t.groupId:void 0}function Mu(e){let[t,...n]=e;if(!t)return``;let r=pu(t).base;return n.length>0?`${r} +${n.length}`:r}function Nu(e,t){return e.includes(t)?e.filter(e=>e!==t):e.length>=8?e:[...e,t]}function Pu(e,t){if(!/^[1-9]$/.test(e))return null;let n=Number(e)-1;return n<t?n:null}function Fu(e){let[t,...n]=e.repos;if(!t)throw Error(`no repo`);let r=e.at?fu(e.prompt):``,i=(e.engines?.length??0)>1;return{repo:t.repo,...t.baseRef?{baseBranch:t.baseRef}:{},...n.length>0?{extraRepos:n.map(e=>({repo:e.repo,...e.baseRef?{baseRef:e.baseRef}:{}}))}:{},...!i&&n.length>0&&e.branch?{branch:e.branch}:{},...e.at?{scheduleAt:e.at.toISOString(),schedulePrompt:e.prompt}:e.prompt?{prompt:e.prompt}:{},...r?{title:r}:{},...i?{agents:(e.engines??[]).map(e=>`${e}:1`).join(`,`)}:{},...!i&&e.engine?{engine:e.engine}:{},...!i&&e.engine&&e.commandFrom?{commandFrom:e.commandFrom}:{},...!i&&e.model?{model:e.model}:{}}}async function Iu(e,t,n){let r=t?{engine:t}:{},{taskId:i}=await e(`task.openScratch`,r);return await e(`tab.new`,{taskId:i,kind:`engine`,...r,prompt:n.trim()}),i}async function Lu(e,t,n,r,i=r.trim(),a){let o=n?{engine:n}:{},s=r.trim()?fu(r):``,{taskId:c}=await e(`task.openCheckout`,{repo:t,...o,...s?{title:s}:{},...a?{scheduleAt:a.toISOString(),schedulePrompt:i}:{}});if(!(a||!c))return await e(`tab.new`,{taskId:c,kind:`engine`,...o,prompt:i}),c}function Ru(e,t){let n=e.querySelector(`[data-field="${t}"]`);(n?.matches(`input, textarea`)?n:n?.querySelector(`[tabindex='0']`))?.focus()}function zu(e,t,n){let r=document.activeElement?.closest(`[data-field]`)?.getAttribute(`data-field`),i=t.findIndex(e=>e===r),a=t[i<0?0:(i+n+t.length)%t.length];a&&Ru(e,a)}var Bu=new WeakMap,Vu=200,Hu=e=>`client`in e?e.client:e,Uu=(e,t)=>t?`${e} ${JSON.stringify(t)}`:e;function Y(e,t,n){return Bu.get(Hu(e))?.get(Uu(t,n))}function Wu(e,t,n,r){let i=Hu(e),a=Bu.get(i)??new Map,o=Uu(t,n);a.delete(o),a.set(o,r),Bu.set(i,a);for(let e of a.keys()){if(a.size<=Vu)break;a.delete(e)}return r}function Gu(e,t,n){return Hu(e).request(t,n).then(r=>Wu(e,t,n,r))}function X(e,t,n){return n&&n!==`leaf-1`?`${e}::${t}::${n}`:`${e}::${t}`}function Ku(e,t,n){let r=t?{repo:t}:{},[i]=(0,h.useState)(()=>{let t=Y(e,`engines.list`,r),i=t?Tu(t.engines):[];return{offered:i,engine:t?Eu(i,n??t.preferred):``}}),[a,o]=(0,h.useState)(i.offered),[s,c]=(0,h.useState)(i.engine);return(0,h.useEffect)(()=>{Gu(e,`engines.list`,r).then(e=>{let t=Tu(e.engines);o(t),c(Eu(t,n??e.preferred))}).catch(()=>o([]))},[e]),{engines:a,engine:s,setEngine:c}}var qu=`shell`,Ju=`pane:`,Yu=e=>e.startsWith(Ju),Xu=e=>e.slice(5);function Zu(e){let[t,n]=(0,h.useState)(()=>Y(e,`plugin.panes`)?.panes??[]);return(0,h.useEffect)(()=>{Gu(e,`plugin.panes`).then(e=>n(e.panes)).catch(()=>n([]))},[e]),t}function Qu(e){let t=[...e.engines,...e.withShell?[{id:qu,name:z(`tab.shell`)}]:[],...(e.panes??[]).map(e=>({id:Ju+e.id,name:e.title}))];return(0,V.jsx)(su,{label:z(`newTask.engine`),field:`engine`,value:e.value,onChange:e.onChange,choices:t.map(e=>({id:e.id,label:e.name,dim:`ready`in e&&e.ready===!1,title:`ready`in e&&e.ready===!1?z(`newTask.notReady`):void 0}))})}function $u(e,t){return ed(e,t,{kind:`engine`,latest:!0}).catch(e=>I(String(e),`error`))}async function ed(e,t,n){let{tabId:r,taskId:i}=await e.client.request(`tab.new`,{taskId:t,kind:n.kind,...n.engine?{engine:n.engine}:{},...n.prompt?{prompt:n.prompt}:{},...n.latest?{latest:!0}:{},...n.replaceTab?{replaceTab:n.replaceTab}:{}});if(i){e.selectWhenListed(i);return}await e.refreshTabsNow(t),n.replaceTab&&await No(X(t,r))?.reattach(),e.select(t,r)}async function td(e){await ed(e,(await e.client.request(`task.openScratch`,{})).taskId,{kind:`shell`})}var nd=[`1`,`2`,`3`,`4`,`5`],rd=[`tab`,`fork`,`scratch`],id=[`message`,`attempts`,`engine`,`fork-base`,`destination`];function ad(e){B();let{model:t,taskId:n}=e,r=t.tasks.get()?.tasks.find(e=>e.id===n),i=Ku(t,r?.repo),[a,o]=(0,h.useState)(e.destination??`tab`),[s,c]=(0,h.useState)(e.context??`fresh`),[l,u]=(0,h.useState)(``),[d,f]=(0,h.useState)(`1`),[p,m]=(0,h.useState)(r?.branch??`main`),{busy:g,error:_,setError:v,submit:y}=xi(),{attachments:b,attach:x,remove:S,ready:C}=au(t,v),w=s===`fresh`&&a!==`fork`,T=a===`tab`&&s===`fresh`,E=Zu(t),D=i.engine===`shell`&&!w||Yu(i.engine)&&!T?``:i.engine,O=D===qu,k=Yu(D),A=a===`fork`,ee=(e,t)=>{let n=e===`scratch`&&t===`continue`&&a===`scratch`?`tab`:e;o(n),c(n===`scratch`?`fresh`:t)},j=()=>{let r=t.selection.get();return e.sourceTabId??(r.taskId===n?r.tabId:null)??`tab-1`},te=()=>t.tasks.get()?.tasks.find(e=>e.id===n)?.tabStatus?.[j()]?.reason===`dead`,M=async()=>{let e=await t.client.request(`tab.handoff`,{taskId:n,tabId:j()});if(e.kind===`handoff`&&e.prompt)return e.prompt;throw Error(e.kind===`no-transcript`?G(`terminal`,`tab.noTranscriptToHandOff`,{engine:e.engine??``}):G(`terminal`,`tab.nothingToFork`))},N=()=>y(async()=>{let e=s===`continue`&&a===`tab`&&!O&&!k&&te(),i=[s===`continue`&&!e?await M():``,eu(l.trim(),await C())].filter(Boolean).join(`
|
|
38
38
|
|
|
39
|
-
`);if(a===`scratch`){let e=await t.client.request(`task.openScratch`,O?{}:{engine:D});O?await ed(t,e.taskId,{kind:`shell`}):t.selectWhenListed(e.taskId)}else if(A){if(!r)throw Error(G(`terminal`,`tab.tabGone`));if(!l.trim())throw Error(z(`taskops.forkNeedsMessage`));let e=p.trim()||r.branch,a;try{a=await t.client.request(`tab.forkTask`,{repo:r.repo,baseBranch:e,prompt:i,...D?{engine:D}:{},...Number(d)>1?{count:Number(d)}:{},...e===r.branch?{forkFrom:n}:{}})}catch(e){let t=ju(e);if(!t)throw e;I(e instanceof Error?e.message:String(e),`error`),ge(t);return}a.forkRefused&&I(z(`taskops.forkLeftBehind`,{reason:a.forkRefused}));let o=a.taskIds[0];a.groupId?ge(a.groupId):o&&t.selectWhenListed(o)}else if(O)await ed(t,n,{kind:`shell`});else if(k){let{selection:e}=t,r=e.get().taskId===n?e.get().tabId:null,i=await t.client.request(`plugin.paneOpen`,{taskId:n,pane:Xu(D),...r?{tabId:r}:{}});await t.refreshTabsNow(n),t.select(n,i.tabId)}else await ed(t,n,{kind:`engine`,engine:D,prompt:i,...e?{replaceTab:j()}:{}})});return(0,V.jsx)(bi,{title:G(`terminal`,`tab.newChat.title`),wide:!0,children:(0,V.jsxs)(`form`,{className:Wr,onKeyDown:e=>{if(e.key===`Tab`&&!e.ctrlKey&&!e.metaKey&&!e.altKey&&(A||!e.shiftKey))e.preventDefault(),e.stopPropagation(),A?zu(e.currentTarget,id,e.shiftKey?-1:1):ee(rd[(rd.indexOf(a)+1)%rd.length]??`tab`,s);else if(e.ctrlKey&&!e.metaKey&&!e.altKey&&e.key.toLowerCase()===`e`){e.preventDefault(),e.stopPropagation();let t=i.engines.filter(e=>e.ready!==!1),n=t[(t.findIndex(e=>e.id===i.engine)+1)%t.length];n&&i.setEngine(n.id)}else e.ctrlKey&&!e.metaKey&&!e.altKey&&e.key.toLowerCase()===`f`?(e.preventDefault(),e.stopPropagation(),ee(a,s===`fresh`?`continue`:`fresh`)):e.key===`Enter`&&A&&e.target.closest(`[data-field=attempts], [data-field=engine]`)&&(e.preventDefault(),e.currentTarget.requestSubmit())},onSubmit:e=>{e.preventDefault(),N()},onDragOver:e=>e.preventDefault(),onDrop:e=>{e.preventDefault(),x(Array.from(e.dataTransfer.files))},children:[(0,V.jsxs)(`div`,{className:Pr,children:[(0,V.jsx)(`span`,{className:`${U} text-muted`,children:G(`terminal`,`tab.newChat.engine`)}),(0,V.jsx)(Qu,{engines:i.engines,value:D,onChange:i.setEngine,withShell:w,panes:T?E:[]})]}),(0,V.jsxs)(`div`,{className:Pr,children:[(0,V.jsx)(`span`,{className:`${U} text-muted`,children:G(`terminal`,`tab.newChat.destLabel`)}),(0,V.jsx)(su,{label:G(`terminal`,`tab.newChat.destLabel`),field:`destination`,value:a,onChange:e=>ee(e,s),choices:rd.map(e=>({id:e,label:G(`terminal`,`tab.newChat.dest${e===`tab`?`Tab`:e===`fork`?`Fork`:`Scratch`}`)}))})]}),(0,V.jsxs)(`div`,{className:Pr,children:[(0,V.jsxs)(`span`,{className:`${U} text-muted`,children:[G(`terminal`,`tab.newChat.ctxLabel`),` `,(0,V.jsx)(`span`,{className:`keys-only`,children:`ctrl+f`})]}),(0,V.jsx)(su,{label:G(`terminal`,`tab.newChat.ctxLabel`),field:`context`,value:s,onChange:e=>ee(a,e===`continue`?`continue`:`fresh`),choices:[`fresh`,`continue`].map(e=>({id:e,label:G(`terminal`,`tab.newChat.ctx${e===`fresh`?`Fresh`:`Continue`}`)}))})]}),A&&(0,V.jsxs)(V.Fragment,{children:[(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:G(`quickTask`,`attemptsLabel`)}),(0,V.jsx)(su,{label:G(`quickTask`,`attemptsLabel`),field:`attempts`,value:d,onChange:f,choices:nd.map(e=>({id:e,label:e}))})]}),(0,V.jsxs)(`label`,{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:z(`taskops.forkBranch`)}),(0,V.jsx)(`input`,{className:jr,"data-field":`fork-base`,spellCheck:!1,value:p,onChange:e=>m(e.target.value)})]})]}),!O&&!k&&a!==`scratch`&&(0,V.jsxs)(`label`,{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:z(`newChat.prompt`)}),(0,V.jsx)(`textarea`,{className:`${jr} min-h-18 max-h-[50vh] leading-[1.45]`,"data-field":`message`,autoFocus:!0,rows:4,placeholder:z(`newChat.promptPlaceholder`),value:l,onChange:e=>u(e.target.value),onPaste:e=>{let t=Array.from(e.clipboardData.files);t.length!==0&&(e.preventDefault(),x(t))},onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&e.currentTarget.form?.requestSubmit()}})]}),(0,V.jsx)(ou,{attachments:b,onRemove:S}),cu()?(0,V.jsx)(`p`,{className:`text-muted`,children:z(`pages.attachHintTouch`)}):(0,V.jsx)(`p`,{className:`keys-only mx-0 mt-2 mb-0 ${wr}`,children:G(`quickTask`,`legend`)}),_&&(0,V.jsx)(`p`,{className:`text-error`,children:_}),(0,V.jsx)(Ti,{busy:g,submitLabel:z(`newChat.start`)})]})})}var od=e=>e.split(`/`).filter(Boolean).pop()??e;function sd(e,t,n=``){let r=od(e),i=t.filter(t=>(t.repo!==e||t.host!==n)&&od(t.repo)===r);if(i.length===0)return r;let a=e=>e.split(`/`).filter(Boolean).slice(-2).join(`/`);return i.some(e=>e.host===n)?i.some(t=>t.host!==n&&a(t.repo)===a(e))&&n?`${n}:${a(e)}`:a(e):n?`${n}:${r}`:r}var cd=e=>e.startsWith(`root:`)?null:e.split(`/`).slice(-2).join(`/`);function ld(e,t){let n=od(e.repo),r=t.filter(t=>t!==e&&od(t.repo)===n);if(r.length===0)return n;let i=e.repoId,a=i?cd(i):null;return i&&a?r.some(e=>e.repoId&&e.repoId!==i&&cd(e.repoId)===a)?i:a:sd(e.repo,[e,...r].map(e=>({repo:e.repo,host:``})))}var ud=/\s+#\d+\/\d+$/,dd=(e,t)=>(e.createdAt??``).localeCompare(t.createdAt??``)||e.id.localeCompare(t.id),fd=e=>e.groupId&&e.kind!==`main`?`${e.machine?.id??``}\0${e.groupId}`:null;function pd(e){let t=new Map;for(let n of e){let e=fd(n);if(e===null)continue;let r=t.get(e);r?r.push(n):t.set(e,[n])}for(let[e,n]of t)n.length<2?t.delete(e):n.sort(dd);return t}function md(e){return(e[0]?.label??``).replace(ud,``)}function hd(e){let t=e=>e.engine?.name??e.label,n=new Map;for(let r of e)n.set(t(r),(n.get(t(r))??0)+1);let r=new Map;return new Map(e.map(e=>{let i=t(e),a=(r.get(i)??0)+1;return r.set(i,a),[e.id,(n.get(i)??0)>1?`${i} #${a}`:i]}))}var gd=[`default`,`recent`,`attention`,`name`],_d={folded:new Set,opened:new Set},vd=e=>{let t=Date.parse(e??``);return Number.isFinite(t)?t:0},yd=e=>vd(e.updatedAt??e.createdAt),bd=e=>vd(e.createdAt),Z=(e,t)=>bd(t)-bd(e)||t.id.localeCompare(e.id),xd=(e,t)=>yd(t)-yd(e)||t.id.localeCompare(e.id),Sd=new Intl.Collator(void 0,{numeric:!0,sensitivity:`base`}),Cd={default:null,recent:Z,attention:(e,t)=>e.rank-t.rank||xd(e,t),name:(e,t)=>Sd.compare(e.label.trim(),t.label.trim())||e.id.localeCompare(t.id)},wd=`~scratch`,Td=e=>e.kind===`dir`&&(e.scratch===!0||e.noProject===!0);function Ed(e,t){return[...e].sort((e,t)=>(e.order??e.rank)-(t.order??t.rank)).sort(kd(Cd[t]))}function Dd(e,t=`default`){let n=[...e].sort((e,t)=>(e.order??e.rank)-(t.order??t.rank)),r=new Map;for(let e of n){let t=Td(e)?wd:e.repo,n=r.get(t);n?n.push(e):r.set(t,[e])}let i=Cd[t],a=[...r].map(([e,t])=>{let n=t.sort(kd(i));if(e===`~scratch`&&t.every(Td))return{repo:``,label:z(`rail.noProject`),tasks:n,key:wd,noProject:!0};let r=t.find(e=>e.repoId)?.repoId;return{repo:e,label:od(e),tasks:n,...r?{repoId:r}:{}}});return[...a.filter(e=>e.noProject),...a.filter(e=>!e.noProject)]}var Od=e=>e.kind===`main`?0:e.pinned?1:2,kd=e=>(t,n)=>Od(t)-Od(n)||(e?e(t,n):0);function Ad(e,t){let n=new Set([e.id]);for(let r=e.parentTaskId;r!==void 0;r=t.get(r)?.parentTaskId){if(n.has(r))return r===e.id;n.add(r)}return!1}function jd(e){let t=new Map;for(let n of e)for(let e of n.tasks)t.set(e.id,e);let n=new Map,r=new Set;for(let e of t.values()){let i=e.parentTaskId;if(i===void 0||!t.has(i)||Ad(e,t))continue;r.add(e.id);let a=n.get(i);a?a.push(e):n.set(i,[e])}return{children:n,nested:r}}function Md(e,t,n=[]){for(let r of e.get(t)??[])n.push(r.id),Md(e,r.id,n);return n}function Nd(e,t,n,r){return r.folded.has(e)?!0:r.opened.has(e)||t<=5?!1:r.selectedId===void 0||!n.includes(r.selectedId)}function Pd(e,t=``,n=_d,r=0,i=!0){let a=t.trim(),o=(...e)=>e.some(e=>e!==``&&$c(a,e)),{children:s,nested:c}=jd(e),l=[];for(let t of e){let e=a===``||o(t.label),u=t.machine===void 0?{}:{machine:t.machine},d=t.key??t.repo,f=t=>e||o(t.label,t.title,t.branch,od(t.repo)),p=e=>f(e)||(s.get(e.id)??[]).some(p),m=(e,t,r,i=!1,o)=>{let c=r+1,l=t.machine?{machine:t.machine.id}:{},u=s.get(t.id),d=u?Md(s,t.id):[],m=u!==void 0&&a===``&&Nd(t.id,u.length,d,n);e.push({id:t.id,kind:`task`,task:t,depth:Math.min(c,3),...c>3?{level:c}:{},...u?{fold:{count:d.length,collapsed:m,descendantIds:d}}:{},...o===void 0?{}:{attempt:o},...l});let g=i||f(t);m||h(e,(u??[]).filter(e=>g||p(e)),r+1,g)},h=(e,t,n,r)=>{let a=i?pd(t):new Map,o=new Set;for(let i of t){let t=fd(i),s=t===null?void 0:a.get(t);if(t===null||!s){m(e,i,n,r);continue}if(o.has(t))continue;o.add(t);let c=s[0];if(!c)continue;let l=n+1;e.push({id:`round:${c.machine?.id??``}:${c.groupId}`,kind:`round`,groupId:c.groupId??``,title:md(s),tasks:s,depth:Math.min(l,3),...c.machine?{machine:c.machine.id}:{}});let u=hd(s);for(let t of s)m(e,t,n+1,r,u.get(t.id))}},g=[];h(g,t.tasks.filter(e=>!c.has(e.id)&&p(e)),r,!1),!(g.length===0&&!e)&&l.push({id:`project:${d}`,kind:`project`,repo:t.repo,label:t.label,...t.noProject?{noProject:!0}:{},...u},...g)}return l}var Fd=e=>Math.max(0,...e.tasks.map(bd));function Id(e){let t=e.tasks.filter(e=>!e.routine),n=e.remote.filter(e=>!e.routine),r=[...Dd(t,e.sort).map(e=>({group:e})),...e.machines.flatMap(t=>Dd(n.filter(e=>e.machine?.id===t.alias),e.sort).map(e=>({group:e,machine:t.alias})))],i=new Map;for(let e of r){let{repoId:t,repo:n}=e.group,r=e.group.noProject?wd:t??(e.machine===void 0?n:`${e.machine}\0${n}`),a=i.get(r);a?a.push(e):i.set(r,[e])}let a=Cd[e.sort],o=new Map,s=[];for(let[e,t]of i){let n=t[0];if(!n)continue;let r=t.flatMap(e=>e.group.tasks),i=n.group.noProject===!0,c={repo:n.group.repo,label:i?n.group.label:``,key:e,tasks:t.length===1?n.group.tasks:r.sort(kd(a)),...n.group.repoId?{repoId:n.group.repoId}:{},...n.machine===void 0||i?{}:{machine:n.machine},...i?{noProject:!0}:{}};s.push(c);for(let e of t)o.set(e,c)}let c=new Map(s.map(e=>[e,e.noProject?e.label:ld(e,s)])),l=s.map(e=>({...e,label:c.get(e)??e.label}));return e.sort===`recent`&&l.sort((e,t)=>Fd(t)-Fd(e)),e.sort===`name`&&l.sort((e,t)=>Sd.compare(e.label,t.label)),l.sort((e,t)=>Number(t.noProject===!0)-Number(e.noProject===!0)),{rows:Pd(l,e.query,e.fold),groups:r.filter(e=>e.machine===void 0).map(e=>{let t=o.get(e);return{...e.group,label:(t&&c.get(t))??e.group.label}})}}function Ld(e){return e.title??e.engineName??(e.kind===`engine`?z(`tab.engine`):z(`tab.shell`))}function Rd(e,t){if(t.size===0)return e;let n=!1;return e.filter(e=>e.kind===`project`||e.kind===`state`?(n=t.has(e.id),!0):!n)}function zd(e){return e.kind===`leaf`?[e]:e.children.flatMap(zd)}function Bd(e){return!!e&&zd(e.root).length>1}function Vd(e){let t=[],n=(e,r,i,a,o,s,c)=>{if(e.kind===`leaf`){t.push({id:e.id,x:r,y:i,w:a,h:o,left:s,top:c});return}let l=e.children.length;e.children.forEach((t,u)=>{e.orientation===`row`?n(t,r+a*u/l,i,a/l,o,u>0||s,c):n(t,r,i+o*u/l,a,o/l,s,u>0||c)})};return n(e,0,0,1,1,!1,!1),t}function Hd(e,t,n=1){let r=zd(e.root).map(e=>e.id),i=r.indexOf(t);return r[(Math.max(0,i)+n+r.length)%r.length]??t}function Ud(e,t){let n=new Map,r=new Map;for(let i of zd(e.root)){if(i.title){r.set(i.id,i.title);continue}let e=i.own?t:`shell`,a=(n.get(e)??0)+1;n.set(e,a),r.set(i.id,a===1?e:`${e} ${a}`)}return r}function Wd(e,t,n){return e.kind===`engine`&&zd(t.root).some(e=>e.id===n&&e.own)}function Gd(e){return e.alive!==!1||!!e.split&&!zd(e.split.root).some(e=>e.own)}function Kd(e){return zd(e.root).map(e=>e.id).join(`,`)}function qd(e){return!(e instanceof HTMLElement)||e.closest(`.xterm`)?!1:e.isContentEditable||[`INPUT`,`TEXTAREA`,`SELECT`].includes(e.tagName)}function Jd(e){return e instanceof HTMLElement&&!!e.closest(`.rail, button, a`)}var Yd=e=>e.tabs.get()[e.selection.get().taskId??``]??[];function Xd(e){let{taskId:t,tabId:n}=e.selection.get(),r=Yd(e);return{taskId:t,tabs:r,at:r.findIndex(e=>e.id===n)}}function Zd(e,t){let{taskId:n,tabs:r}=Xd(e),i=r[t];!n||!i||e.select(n,i.id)}function Qd(e){let{taskId:t,tabs:n,at:r}=Xd(e),i=n[r];!t||!i||C.set((0,V.jsx)(Si,{title:z(`menu.renameTab`),initial:Ld(i),submitLabel:z(`dialog.save`),onSubmit:async n=>{await e.renameTab(t,i.id,n)}}))}var $d=e=>!!e.selection.get().taskId,ef=e=>Yd(e).length>0,tf=[{id:`help.open`,chords:[`f1`],prefix:!1,run:kl},{id:`focus.next`,chords:[`f4`],prefix:!1,run:()=>bo(1)},{id:`chat.tab.chooseEngine`,chords:[`ctrl+e`],prefix:!1,surface:`workspace`,live:$d,run:e=>{let{taskId:t}=e.selection.get();t&&C.set((0,V.jsx)(ad,{model:e,taskId:t}))}},{id:`chat.tab.rename`,chords:[`f2`],prefix:!1,surface:`workspace`,live:e=>{let{tabs:t,at:n}=Xd(e);return!!t[n]&&!Bd(t[n]?.split)},run:Qd},{id:`chat.tab.cycle-next`,chords:[`ctrl+]`],prefix:!1,surface:`workspace`,live:ef,run:e=>Zd(e,(Xd(e).at+1)%Yd(e).length)},{id:`chat.tab.cycle-prev`,chords:[`ctrl+[`],prefix:!1,surface:`workspace`,live:ef,run:e=>Zd(e,(Xd(e).at-1+Yd(e).length)%Yd(e).length)},{id:`chat.tab.goto`,chords:[`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`].map(e=>`ctrl+${e}`),prefix:!1,surface:`workspace`,live:ef,run:(e,t=``)=>{let n=wo().find(e=>e.id===`chat.tab.goto`&&!e.prefix)?.chords.indexOf(t)??-1;n>=0&&Zd(e,n)}},{id:`attention.next`,chords:[`f7`],prefix:!1,run:e=>rf(e)}];So(()=>tf);function nf(e){(0,h.useEffect)(()=>{let t=t=>{if(C.get()||qd(t.target))return;let n=O.get();if(n===`worktrees`)return;let r=Do()??($d(e)?`workspace`:`sidebar`),{taskId:i}=e.selection.get();if(!n&&i&&!t.ctrlKey&&!t.shiftKey&&!t.metaKey&&!t.altKey&&t.key===`Enter`&&!ef(e)&&!Jd(t.target)){t.preventDefault(),t.stopPropagation(),C.set((0,V.jsx)(ad,{model:e,taskId:i}));return}let a=qc(t),o=wo().filter(t=>!t.prefix&&!t.native&&t.chords.some(e=>a.includes(e))&&To(t,r)&&!(n&&t.surface)&&t.live?.(e)!==!1).sort((e,t)=>Eo(e,r)-Eo(t,r))[0];o&&(t.preventDefault(),t.stopPropagation(),o.run(e,a.find(e=>o.chords.includes(e))))};return window.addEventListener(`keydown`,t,{capture:!0}),()=>window.removeEventListener(`keydown`,t,{capture:!0})},[e])}function rf(e){let t=e.tasks.get();if(!t)return;let n=Il(t.attention,t.tasks.map(e=>e.id),e.selection.get());if(!n){I(z(`inbox.empty`));return}if(Nl(n.state)){zl(e,n);return}n.taskId!==null&&(e.select(n.taskId,n.tabId),Rl(e,n))}async function af(e,t){try{if(t.kind===`action`){await e.client.request(`plugin.chordAction`,{chord:t.chord});return}let{taskId:n,tabId:r}=e.selection.get();if(!n){I(z(`keys.pluginNoTask`),`error`);return}let i=await e.client.request(`plugin.paneOpen`,{taskId:n,pane:t.target,...r?{tabId:r}:{}});await e.refreshTabsNow(n),e.select(n,i.tabId)}catch(e){I(W(e),`error`)}}function of(e){(0,h.useEffect)(()=>{let t=t=>{let n=ua.get().plugins;if(n.length===0||!Ca({dialog:C.get()!==null,page:O.get()})||qd(t.target))return;let r=Sa(n,qc(t));r&&(t.preventDefault(),t.stopImmediatePropagation(),af(e,r))};return window.addEventListener(`keydown`,t,{capture:!0}),()=>window.removeEventListener(`keydown`,t,{capture:!0})},[e])}var sf=`prefix.moreCommands`,cf=/^ctrl\+[^+]+$/;function lf(e){return cf.test(e)?e.slice(5):null}function uf(e){let t=Qc(e.bindingId);if(!t)return null;if(e.reachability.direct.has(e.bindingId)){let e=t.keys[0];if(e)return ca(e)}if(e.prefixKey&&e.reachability.prefix.has(e.bindingId)){let n=t.prefixKeys?.[0];if(n)return`${ca(e.prefixKey)} ${ca(n)}`}return null}function df(e,t){let n=ia.filter(t=>e.direct.has(t.id)).flatMap(e=>{let t=e.keys.flatMap(e=>lf(e)??[]);return t.length>2?[{stroke:`${t[0]}-${t.at(-1)}`,action:e.id}]:t.map(t=>({stroke:t,action:e.id}))}),r=t?lf(t):null;return r&&e.prefix.size>0&&n.push({stroke:r,action:sf}),n}var ff=4e3,pf=180,mf=ff,hf=v({guide:null,entries:[]}),gf=1;function _f(e,t){let n={id:gf++,stroke:e,action:t,at:Date.now()};hf.set({guide:null,entries:[...hf.get().entries,n].slice(-3)})}var vf=`modulepreload`,yf=function(e){return`/`+e},bf={},xf=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=yf(t,n),t=s(t),t in bf)return;bf[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:vf,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Sf=8,Cf=32,wf=3e3,Tf=100,Ef=new WeakMap,Df=null;function Of(e){let t=Ef.get(e);return t||(t={entries:new Map,snapshots:new Map,left:null},Ef.set(e,t)),t}function kf(){return Df||(Df=document.createElement(`div`),Df.style.display=`none`,document.body.append(Df)),Df}function Af(e,t,n){e.snapshots.delete(t),e.snapshots.set(t,n);for(let t of e.snapshots.keys()){if(e.snapshots.size<=Cf)break;e.snapshots.delete(t)}}function jf(e,t,n){e.entries.delete(t.key),t.leaving!==null&&window.clearTimeout(t.leaving),t.leaving=null,n?Af(e,t.key,t.handle.snapshot()):e.snapshots.delete(t.key),t.handle.dispose(),t.box.remove()}function Mf(e){let t=[...e.entries.values()].filter(e=>e.slot.parkedAt!==null);t.sort((e,t)=>(e.slot.parkedAt??0)-(t.slot.parkedAt??0));for(let n of t.slice(0,Math.max(0,t.length-Sf)))jf(e,n,!0)}function Nf(e,t){return Of(e).entries.get(t)?.handle??null}function Pf(e,t,n,r){return Of(e).entries.get(X(t,n,r))?.slot.parkedAt!=null}async function Ff(e,t){let n=Of(e.client),r=X(e.taskId,e.tabId,e.leafId),i=n.entries.get(r);if(i&&i.slot.parkedAt!==null){let{slot:r,handle:a,box:o}=i;return r.parkedAt=null,r.binding=t,i.leaving!==null&&(window.clearTimeout(i.leaving),i.leaving=null,o.classList.remove(`is-leaving`)),n.left=null,zf(n),e.host.append(o),t.setNotice(r.notice),t.onScrolled(r.scrolled),a.term.refresh(0,a.term.rows-1),e.focusOnMount&&a.term.focus(),{handle:a,release:()=>If(n,i)}}let a=document.createElement(`div`);a.className=Nn,e.host.append(a),Lf(n,e.host);let o=!i,s={binding:t,notice:{kind:`none`},scrolled:0,parkedAt:null},c=null,l=o?n.snapshots.get(r):void 0;l&&n.snapshots.delete(r);let{mountTerminal:u}=await xf(async()=>{let{mountTerminal:e}=await import(`./term-mount-C4uT8Hft.js`);return{mountTerminal:e}},__vite__mapDeps([0,1])),d=u({...e,el:a,snapshot:l,onPainted:()=>zf(n),setNotice:e=>{s.notice=e,s.binding?.setNotice(e)},onScrolled:e=>{s.scrolled=e,s.binding?.onScrolled(e)},onFocusChange:e=>s.binding?.onFocusChange(e),onExit:e=>{s.binding?s.binding.onExit(e):c&&n.entries.get(r)===c&&jf(n,c,!1)},copyText:e=>s.binding?.copyText(e)??Promise.resolve(!1),pasteImage:()=>s.binding?.pasteImage()??Promise.resolve()});if(!o)return{handle:d,release:()=>{d.dispose(),a.remove()}};let f={key:r,handle:d,box:a,slot:s,leaving:null};return c=f,n.entries.set(r,f),{handle:d,release:()=>If(n,f)}}function If(e,t){let{slot:n}=t;e.entries.get(t.key)===t&&n.parkedAt===null&&(n.binding?.onFocusChange(!1),n.binding=null,t.handle.term.blur(),n.parkedAt=performance.now(),kf().append(t.box),e.left=t,Mf(e))}function Lf(e,t){let n=e.left;e.left=null,!(!n||n.slot.parkedAt===null||performance.now()-n.slot.parkedAt>Tf)&&e.entries.get(n.key)===n&&(n.box.classList.add(`is-leaving`),t.append(n.box),n.leaving=window.setTimeout(()=>Rf(e,n),wf))}function Rf(e,t){t.leaving!==null&&(window.clearTimeout(t.leaving),t.leaving=null,t.box.classList.remove(`is-leaving`),e.entries.get(t.key)===t&&t.slot.parkedAt!==null&&kf().append(t.box))}function zf(e){for(let t of e.entries.values())Rf(e,t)}async function Bf(e,t,n){return Ll(await e.request(`output.read`,{taskId:t,tab:n,source:`terminal`,limit:12}))}async function Vf(e,t,n,r){try{let i=await e.client.request(`tab.send`,{taskId:t,tabId:n,prompt:r});return i.delivered?!0:(I(z(`layout.composerNotSent`,{reason:i.reason??``}),`error`),!1)}catch(e){let t=e instanceof Ho?e.code:void 0;return I(t===`UNKNOWN_OP`?z(`layout.composerOldBridge`):t===`AWAITING_PERMISSION`?z(`layout.composerAtMenu`):e instanceof Error?e.message:String(e),`error`),!1}}async function Hf(e,t,n,r){let{client:i}=e,a=X(t,n),o=No(a)!==void 0||Pf(i,t,n);try{return o||await i.request(`term.attach`,{taskId:t,tabId:n}),await i.request(`term.input`,{stream:a,data:r}),!0}catch(e){return I(e instanceof Error?e.message:String(e),`error`),!1}finally{o||await i.request(`term.detach`,{stream:a}).catch(()=>{})}}async function Uf(e,t,n){try{return(await e.client.request(`gate.answer`,{gateId:t,...n})).delivered||I(z(`inbox.gateKept`)),!0}catch(e){return I(e instanceof Error?e.message:String(e),`error`),!1}}var Wf=(e,t,n)=>({id:e,cap:t,bytes:e=>`\x1b${e?`O`:`[`}${n}`}),Gf={id:`enter`,cap:`⏎`,bytes:()=>`\r`},Kf=[{id:`esc`,cap:`esc`,bytes:()=>`\x1B`},{id:`tab`,cap:`tab`,bytes:()=>` `},{id:`backtab`,cap:`⇧tab`,bytes:()=>`\x1B[Z`},{id:`interrupt`,cap:`^C`,bytes:()=>``},Wf(`up`,`↑`,`A`),Wf(`down`,`↓`,`B`),Wf(`left`,`←`,`D`),Wf(`right`,`→`,`C`),Gf],qf=e=>({id:`option-${e}`,cap:String(e),bytes:()=>String(e)}),Jf=[qf(1),qf(2),qf(3),qf(4),Gf];function Yf(e){if(e.length!==1)return e;let t=e.toUpperCase().charCodeAt(0);return t===32?`\0`:t===63?``:t>=64&&t<=95?String.fromCharCode(t&31):e}var Xf=`mx-2.5 mt-0.5 mb-1.5 flex min-w-0 flex-col gap-1.5 font-mono text-meta`,Zf=2e3;function Qf(e,t,n){let[r,i]=(0,h.useState)(null),[a,o]=(0,h.useState)(0);return(0,h.useEffect)(()=>{if(!n)return;let r=!0,a=0,o=async()=>{try{let a=await Bf(e.client,t,n);r&&i(a)}catch{r&&i(e=>e??[])}r&&(a=window.setTimeout(o,Zf))};return o(),()=>{r=!1,window.clearTimeout(a)}},[e,t,n,a]),{lines:r,refresh:()=>o(e=>e+1)}}function $f(e){B();let{model:t,taskId:n,tabId:r,mode:i,gate:a}=e,{lines:o,refresh:s}=Qf(t,n,r),c=(0,h.useRef)(null),[l,u]=(0,h.useState)(``),[d,f]=(0,h.useState)(!1);(0,h.useEffect)(()=>{let e=c.current;e&&(e.scrollTop=e.scrollHeight)},[o]);let p=async e=>{f(!0);let t=await e();return f(!1),t&&window.setTimeout(s,600),t},m=async()=>{let e=l.trim();!e||d||await p(()=>i===`gate`&&a?Uf(t,a.id,{text:e}):r?Vf(t,n,r,e):Promise.resolve(!1))&&u(``)};return(0,V.jsxs)(`div`,{className:Xf,children:[a&&(0,V.jsx)(`p`,{className:`m-0 whitespace-pre-wrap wrap-anywhere text-ink`,children:a.question}),r&&(0,V.jsx)(`pre`,{ref:c,className:`m-0 max-h-60 overflow-y-auto rounded-sm border-hairline border-line bg-inset px-2 py-1.5 text-ink whitespace-pre-wrap wrap-anywhere`,"data-peek-lines":12,children:o===null?`…`:o.length===0?z(`inbox.noOutput`):o.join(`
|
|
39
|
+
`);if(a===`scratch`){let e=await t.client.request(`task.openScratch`,O?{}:{engine:D});O?await ed(t,e.taskId,{kind:`shell`}):t.selectWhenListed(e.taskId)}else if(A){if(!r)throw Error(G(`terminal`,`tab.tabGone`));if(!l.trim())throw Error(z(`taskops.forkNeedsMessage`));let e=p.trim()||r.branch,a;try{a=await t.client.request(`tab.forkTask`,{repo:r.repo,baseBranch:e,prompt:i,...D?{engine:D}:{},...Number(d)>1?{count:Number(d)}:{},...e===r.branch?{forkFrom:n}:{}})}catch(e){let t=ju(e);if(!t)throw e;I(e instanceof Error?e.message:String(e),`error`),ge(t);return}a.forkRefused&&I(z(`taskops.forkLeftBehind`,{reason:a.forkRefused}));let o=a.taskIds[0];a.groupId?ge(a.groupId):o&&t.selectWhenListed(o)}else if(O)await ed(t,n,{kind:`shell`});else if(k){let{selection:e}=t,r=e.get().taskId===n?e.get().tabId:null,i=await t.client.request(`plugin.paneOpen`,{taskId:n,pane:Xu(D),...r?{tabId:r}:{}});await t.refreshTabsNow(n),t.select(n,i.tabId)}else await ed(t,n,{kind:`engine`,engine:D,prompt:i,...e?{replaceTab:j()}:{}})});return(0,V.jsx)(bi,{title:G(`terminal`,`tab.newChat.title`),wide:!0,children:(0,V.jsxs)(`form`,{className:Wr,onKeyDown:e=>{if(e.key===`Tab`&&!e.ctrlKey&&!e.metaKey&&!e.altKey&&(A||!e.shiftKey))e.preventDefault(),e.stopPropagation(),A?zu(e.currentTarget,id,e.shiftKey?-1:1):ee(rd[(rd.indexOf(a)+1)%rd.length]??`tab`,s);else if(e.ctrlKey&&!e.metaKey&&!e.altKey&&e.key.toLowerCase()===`e`){e.preventDefault(),e.stopPropagation();let t=i.engines.filter(e=>e.ready!==!1),n=t[(t.findIndex(e=>e.id===i.engine)+1)%t.length];n&&i.setEngine(n.id)}else e.ctrlKey&&!e.metaKey&&!e.altKey&&e.key.toLowerCase()===`f`?(e.preventDefault(),e.stopPropagation(),ee(a,s===`fresh`?`continue`:`fresh`)):e.key===`Enter`&&A&&e.target.closest(`[data-field=attempts], [data-field=engine]`)&&(e.preventDefault(),e.currentTarget.requestSubmit())},onSubmit:e=>{e.preventDefault(),N()},onDragOver:e=>e.preventDefault(),onDrop:e=>{e.preventDefault(),x(Array.from(e.dataTransfer.files))},children:[(0,V.jsxs)(`div`,{className:Pr,children:[(0,V.jsx)(`span`,{className:`${U} text-muted`,children:G(`terminal`,`tab.newChat.engine`)}),(0,V.jsx)(Qu,{engines:i.engines,value:D,onChange:i.setEngine,withShell:w,panes:T?E:[]})]}),(0,V.jsxs)(`div`,{className:Pr,children:[(0,V.jsx)(`span`,{className:`${U} text-muted`,children:G(`terminal`,`tab.newChat.destLabel`)}),(0,V.jsx)(su,{label:G(`terminal`,`tab.newChat.destLabel`),field:`destination`,value:a,onChange:e=>ee(e,s),choices:rd.map(e=>({id:e,label:G(`terminal`,`tab.newChat.dest${e===`tab`?`Tab`:e===`fork`?`Fork`:`Scratch`}`)}))})]}),(0,V.jsxs)(`div`,{className:Pr,children:[(0,V.jsxs)(`span`,{className:`${U} text-muted`,children:[G(`terminal`,`tab.newChat.ctxLabel`),` `,(0,V.jsx)(`span`,{className:`keys-only`,children:`ctrl+f`})]}),(0,V.jsx)(su,{label:G(`terminal`,`tab.newChat.ctxLabel`),field:`context`,value:s,onChange:e=>ee(a,e===`continue`?`continue`:`fresh`),choices:[`fresh`,`continue`].map(e=>({id:e,label:G(`terminal`,`tab.newChat.ctx${e===`fresh`?`Fresh`:`Continue`}`)}))})]}),A&&(0,V.jsxs)(V.Fragment,{children:[(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:G(`quickTask`,`attemptsLabel`)}),(0,V.jsx)(su,{label:G(`quickTask`,`attemptsLabel`),field:`attempts`,value:d,onChange:f,choices:nd.map(e=>({id:e,label:e}))})]}),(0,V.jsxs)(`label`,{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:z(`taskops.forkBranch`)}),(0,V.jsx)(`input`,{className:jr,"data-field":`fork-base`,spellCheck:!1,value:p,onChange:e=>m(e.target.value)})]})]}),!O&&!k&&a!==`scratch`&&(0,V.jsxs)(`label`,{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:z(`newChat.prompt`)}),(0,V.jsx)(`textarea`,{className:`${jr} min-h-18 max-h-[50vh] leading-[1.45]`,"data-field":`message`,autoFocus:!0,rows:4,placeholder:z(`newChat.promptPlaceholder`),value:l,onChange:e=>u(e.target.value),onPaste:e=>{let t=Array.from(e.clipboardData.files);t.length!==0&&(e.preventDefault(),x(t))},onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&e.currentTarget.form?.requestSubmit()}})]}),(0,V.jsx)(ou,{attachments:b,onRemove:S}),cu()?(0,V.jsx)(`p`,{className:`text-muted`,children:z(`pages.attachHintTouch`)}):(0,V.jsx)(`p`,{className:`keys-only mx-0 mt-2 mb-0 ${wr}`,children:G(`quickTask`,`legend`)}),_&&(0,V.jsx)(`p`,{className:`text-error`,children:_}),(0,V.jsx)(Ti,{busy:g,submitLabel:z(`newChat.start`)})]})})}var od=e=>e.split(`/`).filter(Boolean).pop()??e;function sd(e,t,n=``){let r=od(e),i=t.filter(t=>(t.repo!==e||t.host!==n)&&od(t.repo)===r);if(i.length===0)return r;let a=e=>e.split(`/`).filter(Boolean).slice(-2).join(`/`);return i.some(e=>e.host===n)?i.some(t=>t.host!==n&&a(t.repo)===a(e))&&n?`${n}:${a(e)}`:a(e):n?`${n}:${r}`:r}var cd=e=>e.startsWith(`root:`)?null:e.split(`/`).slice(-2).join(`/`);function ld(e,t){let n=od(e.repo),r=t.filter(t=>t!==e&&od(t.repo)===n);if(r.length===0)return n;let i=e.repoId,a=i?cd(i):null;return i&&a?r.some(e=>e.repoId&&e.repoId!==i&&cd(e.repoId)===a)?i:a:sd(e.repo,[e,...r].map(e=>({repo:e.repo,host:``})))}var ud=/\s+#\d+\/\d+$/,dd=(e,t)=>(e.createdAt??``).localeCompare(t.createdAt??``)||e.id.localeCompare(t.id),fd=e=>e.groupId&&e.kind!==`main`?`${e.machine?.id??``}\0${e.groupId}`:null;function pd(e){let t=new Map;for(let n of e){let e=fd(n);if(e===null)continue;let r=t.get(e);r?r.push(n):t.set(e,[n])}for(let[e,n]of t)n.length<2?t.delete(e):n.sort(dd);return t}function md(e){return(e[0]?.label??``).replace(ud,``)}function hd(e){let t=e=>e.engine?.name??e.label,n=new Map;for(let r of e)n.set(t(r),(n.get(t(r))??0)+1);let r=new Map;return new Map(e.map(e=>{let i=t(e),a=(r.get(i)??0)+1;return r.set(i,a),[e.id,(n.get(i)??0)>1?`${i} #${a}`:i]}))}var gd=[`default`,`recent`,`attention`,`name`],_d={folded:new Set,opened:new Set},vd=e=>{let t=Date.parse(e??``);return Number.isFinite(t)?t:0},yd=e=>vd(e.updatedAt??e.createdAt),bd=e=>vd(e.createdAt),Z=(e,t)=>bd(t)-bd(e)||t.id.localeCompare(e.id),xd=(e,t)=>yd(t)-yd(e)||t.id.localeCompare(e.id),Sd=new Intl.Collator(void 0,{numeric:!0,sensitivity:`base`}),Cd={default:null,recent:Z,attention:(e,t)=>e.rank-t.rank||xd(e,t),name:(e,t)=>Sd.compare(e.label.trim(),t.label.trim())||e.id.localeCompare(t.id)},wd=`~scratch`,Td=e=>e.kind===`dir`&&(e.scratch===!0||e.noProject===!0);function Ed(e,t){return[...e].sort((e,t)=>(e.order??e.rank)-(t.order??t.rank)).sort(kd(Cd[t]))}function Dd(e,t=`default`){let n=[...e].sort((e,t)=>(e.order??e.rank)-(t.order??t.rank)),r=new Map;for(let e of n){let t=Td(e)?wd:e.repo,n=r.get(t);n?n.push(e):r.set(t,[e])}let i=Cd[t],a=[...r].map(([e,t])=>{let n=t.sort(kd(i));if(e===`~scratch`&&t.every(Td))return{repo:``,label:z(`rail.noProject`),tasks:n,key:wd,noProject:!0};let r=t.find(e=>e.repoId)?.repoId;return{repo:e,label:od(e),tasks:n,...r?{repoId:r}:{}}});return[...a.filter(e=>e.noProject),...a.filter(e=>!e.noProject)]}var Od=e=>e.kind===`main`?0:e.pinned?1:2,kd=e=>(t,n)=>Od(t)-Od(n)||(e?e(t,n):0);function Ad(e,t){let n=new Set([e.id]);for(let r=e.parentTaskId;r!==void 0;r=t.get(r)?.parentTaskId){if(n.has(r))return r===e.id;n.add(r)}return!1}function jd(e){let t=new Map;for(let n of e)for(let e of n.tasks)t.set(e.id,e);let n=new Map,r=new Set;for(let e of t.values()){let i=e.parentTaskId;if(i===void 0||!t.has(i)||Ad(e,t))continue;r.add(e.id);let a=n.get(i);a?a.push(e):n.set(i,[e])}return{children:n,nested:r}}function Md(e,t,n=[]){for(let r of e.get(t)??[])n.push(r.id),Md(e,r.id,n);return n}function Nd(e,t,n,r){return r.folded.has(e)?!0:r.opened.has(e)||t<=5?!1:r.selectedId===void 0||!n.includes(r.selectedId)}function Pd(e,t=``,n=_d,r=0,i=!0){let a=t.trim(),o=(...e)=>e.some(e=>e!==``&&$c(a,e)),{children:s,nested:c}=jd(e),l=[];for(let t of e){let e=a===``||o(t.label),u=t.machine===void 0?{}:{machine:t.machine},d=t.key??t.repo,f=t=>e||o(t.label,t.title,t.branch,od(t.repo)),p=e=>f(e)||(s.get(e.id)??[]).some(p),m=(e,t,r,i=!1,o)=>{let c=r+1,l=t.machine?{machine:t.machine.id}:{},u=s.get(t.id),d=u?Md(s,t.id):[],m=u!==void 0&&a===``&&Nd(t.id,u.length,d,n);e.push({id:t.id,kind:`task`,task:t,depth:Math.min(c,3),...c>3?{level:c}:{},...u?{fold:{count:d.length,collapsed:m,descendantIds:d}}:{},...o===void 0?{}:{attempt:o},...l});let g=i||f(t);m||h(e,(u??[]).filter(e=>g||p(e)),r+1,g)},h=(e,t,n,r)=>{let a=i?pd(t):new Map,o=new Set;for(let i of t){let t=fd(i),s=t===null?void 0:a.get(t);if(t===null||!s){m(e,i,n,r);continue}if(o.has(t))continue;o.add(t);let c=s[0];if(!c)continue;let l=n+1;e.push({id:`round:${c.machine?.id??``}:${c.groupId}`,kind:`round`,groupId:c.groupId??``,title:md(s),tasks:s,depth:Math.min(l,3),...c.machine?{machine:c.machine.id}:{}});let u=hd(s);for(let t of s)m(e,t,n+1,r,u.get(t.id))}},g=[];h(g,t.tasks.filter(e=>!c.has(e.id)&&p(e)),r,!1),!(g.length===0&&!e)&&l.push({id:`project:${d}`,kind:`project`,repo:t.repo,label:t.label,...t.noProject?{noProject:!0}:{},...u},...g)}return l}var Fd=e=>Math.max(0,...e.tasks.map(bd));function Id(e){let t=e.tasks.filter(e=>!e.routine),n=e.remote.filter(e=>!e.routine),r=[...Dd(t,e.sort).map(e=>({group:e})),...e.machines.flatMap(t=>Dd(n.filter(e=>e.machine?.id===t.alias),e.sort).map(e=>({group:e,machine:t.alias})))],i=new Map;for(let e of r){let{repoId:t,repo:n}=e.group,r=e.group.noProject?wd:t??(e.machine===void 0?n:`${e.machine}\0${n}`),a=i.get(r);a?a.push(e):i.set(r,[e])}let a=Cd[e.sort],o=new Map,s=[];for(let[e,t]of i){let n=t[0];if(!n)continue;let r=t.flatMap(e=>e.group.tasks),i=n.group.noProject===!0,c={repo:n.group.repo,label:i?n.group.label:``,key:e,tasks:t.length===1?n.group.tasks:r.sort(kd(a)),...n.group.repoId?{repoId:n.group.repoId}:{},...n.machine===void 0||i?{}:{machine:n.machine},...i?{noProject:!0}:{}};s.push(c);for(let e of t)o.set(e,c)}let c=new Map(s.map(e=>[e,e.noProject?e.label:ld(e,s)])),l=s.map(e=>({...e,label:c.get(e)??e.label}));return e.sort===`recent`&&l.sort((e,t)=>Fd(t)-Fd(e)),e.sort===`name`&&l.sort((e,t)=>Sd.compare(e.label,t.label)),l.sort((e,t)=>Number(t.noProject===!0)-Number(e.noProject===!0)),{rows:Pd(l,e.query,e.fold),groups:r.filter(e=>e.machine===void 0).map(e=>{let t=o.get(e);return{...e.group,label:(t&&c.get(t))??e.group.label}})}}function Ld(e){return e.title??e.engineName??(e.kind===`engine`?z(`tab.engine`):z(`tab.shell`))}function Rd(e,t){if(t.size===0)return e;let n=!1;return e.filter(e=>e.kind===`project`||e.kind===`state`?(n=t.has(e.id),!0):!n)}function zd(e){return e.kind===`leaf`?[e]:e.children.flatMap(zd)}function Bd(e){return!!e&&zd(e.root).length>1}function Vd(e){let t=[],n=(e,r,i,a,o,s,c)=>{if(e.kind===`leaf`){t.push({id:e.id,x:r,y:i,w:a,h:o,left:s,top:c});return}let l=e.children.length;e.children.forEach((t,u)=>{e.orientation===`row`?n(t,r+a*u/l,i,a/l,o,u>0||s,c):n(t,r,i+o*u/l,a,o/l,s,u>0||c)})};return n(e,0,0,1,1,!1,!1),t}function Hd(e,t,n=1){let r=zd(e.root).map(e=>e.id),i=r.indexOf(t);return r[(Math.max(0,i)+n+r.length)%r.length]??t}function Ud(e,t){let n=new Map,r=new Map;for(let i of zd(e.root)){if(i.title){r.set(i.id,i.title);continue}let e=i.own?t:`shell`,a=(n.get(e)??0)+1;n.set(e,a),r.set(i.id,a===1?e:`${e} ${a}`)}return r}function Wd(e,t,n){return e.kind===`engine`&&zd(t.root).some(e=>e.id===n&&e.own)}function Gd(e){return e.alive!==!1||!!e.split&&!zd(e.split.root).some(e=>e.own)}function Kd(e){return zd(e.root).map(e=>e.id).join(`,`)}function qd(e){return!(e instanceof HTMLElement)||e.closest(`.xterm`)?!1:e.isContentEditable||[`INPUT`,`TEXTAREA`,`SELECT`].includes(e.tagName)}function Jd(e){return e instanceof HTMLElement&&!!e.closest(`.rail, button, a`)}var Yd=e=>e.tabs.get()[e.selection.get().taskId??``]??[];function Xd(e){let{taskId:t,tabId:n}=e.selection.get(),r=Yd(e);return{taskId:t,tabs:r,at:r.findIndex(e=>e.id===n)}}function Zd(e,t){let{taskId:n,tabs:r}=Xd(e),i=r[t];!n||!i||e.select(n,i.id)}function Qd(e){let{taskId:t,tabs:n,at:r}=Xd(e),i=n[r];!t||!i||C.set((0,V.jsx)(Si,{title:z(`menu.renameTab`),initial:Ld(i),submitLabel:z(`dialog.save`),onSubmit:async n=>{await e.renameTab(t,i.id,n)}}))}var $d=e=>!!e.selection.get().taskId,ef=e=>Yd(e).length>0,tf=[{id:`help.open`,chords:[`f1`],prefix:!1,run:kl},{id:`focus.next`,chords:[`f4`],prefix:!1,run:()=>bo(1)},{id:`chat.tab.chooseEngine`,chords:[`ctrl+e`],prefix:!1,surface:`workspace`,live:$d,run:e=>{let{taskId:t}=e.selection.get();t&&C.set((0,V.jsx)(ad,{model:e,taskId:t}))}},{id:`chat.tab.rename`,chords:[`f2`],prefix:!1,surface:`workspace`,live:e=>{let{tabs:t,at:n}=Xd(e);return!!t[n]&&!Bd(t[n]?.split)},run:Qd},{id:`chat.tab.cycle-next`,chords:[`ctrl+]`],prefix:!1,surface:`workspace`,live:ef,run:e=>Zd(e,(Xd(e).at+1)%Yd(e).length)},{id:`chat.tab.cycle-prev`,chords:[`ctrl+[`],prefix:!1,surface:`workspace`,live:ef,run:e=>Zd(e,(Xd(e).at-1+Yd(e).length)%Yd(e).length)},{id:`chat.tab.goto`,chords:[`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`].map(e=>`ctrl+${e}`),prefix:!1,surface:`workspace`,live:ef,run:(e,t=``)=>{let n=wo().find(e=>e.id===`chat.tab.goto`&&!e.prefix)?.chords.indexOf(t)??-1;n>=0&&Zd(e,n)}},{id:`attention.next`,chords:[`f7`],prefix:!1,run:e=>rf(e)}];So(()=>tf);function nf(e){(0,h.useEffect)(()=>{let t=t=>{if(C.get()||qd(t.target))return;let n=O.get();if(n===`worktrees`)return;let r=Do()??($d(e)?`workspace`:`sidebar`),{taskId:i}=e.selection.get();if(!n&&i&&!t.ctrlKey&&!t.shiftKey&&!t.metaKey&&!t.altKey&&t.key===`Enter`&&!ef(e)&&!Jd(t.target)){t.preventDefault(),t.stopPropagation(),C.set((0,V.jsx)(ad,{model:e,taskId:i}));return}let a=qc(t),o=wo().filter(t=>!t.prefix&&!t.native&&t.chords.some(e=>a.includes(e))&&To(t,r)&&!(n&&t.surface)&&t.live?.(e)!==!1).sort((e,t)=>Eo(e,r)-Eo(t,r))[0];o&&(t.preventDefault(),t.stopPropagation(),o.run(e,a.find(e=>o.chords.includes(e))))};return window.addEventListener(`keydown`,t,{capture:!0}),()=>window.removeEventListener(`keydown`,t,{capture:!0})},[e])}function rf(e){let t=e.tasks.get();if(!t)return;let n=Il(t.attention,t.tasks.map(e=>e.id),e.selection.get());if(!n){I(z(`inbox.empty`));return}if(Nl(n.state)){zl(e,n);return}n.taskId!==null&&(e.select(n.taskId,n.tabId),Rl(e,n))}async function af(e,t){try{if(t.kind===`action`){await e.client.request(`plugin.chordAction`,{chord:t.chord});return}let{taskId:n,tabId:r}=e.selection.get();if(!n){I(z(`keys.pluginNoTask`),`error`);return}let i=await e.client.request(`plugin.paneOpen`,{taskId:n,pane:t.target,...r?{tabId:r}:{}});await e.refreshTabsNow(n),e.select(n,i.tabId)}catch(e){I(W(e),`error`)}}function of(e){(0,h.useEffect)(()=>{let t=t=>{let n=ua.get().plugins;if(n.length===0||!Ca({dialog:C.get()!==null,page:O.get()})||qd(t.target))return;let r=Sa(n,qc(t));r&&(t.preventDefault(),t.stopImmediatePropagation(),af(e,r))};return window.addEventListener(`keydown`,t,{capture:!0}),()=>window.removeEventListener(`keydown`,t,{capture:!0})},[e])}var sf=`prefix.moreCommands`,cf=/^ctrl\+[^+]+$/;function lf(e){return cf.test(e)?e.slice(5):null}function uf(e){let t=Qc(e.bindingId);if(!t)return null;if(e.reachability.direct.has(e.bindingId)){let e=t.keys[0];if(e)return ca(e)}if(e.prefixKey&&e.reachability.prefix.has(e.bindingId)){let n=t.prefixKeys?.[0];if(n)return`${ca(e.prefixKey)} ${ca(n)}`}return null}function df(e,t){let n=ia.filter(t=>e.direct.has(t.id)).flatMap(e=>{let t=e.keys.flatMap(e=>lf(e)??[]);return t.length>2?[{stroke:`${t[0]}-${t.at(-1)}`,action:e.id}]:t.map(t=>({stroke:t,action:e.id}))}),r=t?lf(t):null;return r&&e.prefix.size>0&&n.push({stroke:r,action:sf}),n}var ff=4e3,pf=180,mf=ff,hf=v({guide:null,entries:[]}),gf=1;function _f(e,t){let n={id:gf++,stroke:e,action:t,at:Date.now()};hf.set({guide:null,entries:[...hf.get().entries,n].slice(-3)})}var vf=`modulepreload`,yf=function(e){return`/`+e},bf={},xf=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=yf(t,n),t=s(t),t in bf)return;bf[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:vf,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Sf=8,Cf=32,wf=3e3,Tf=100,Ef=new WeakMap,Df=null;function Of(e){let t=Ef.get(e);return t||(t={entries:new Map,snapshots:new Map,left:null},Ef.set(e,t)),t}function kf(){return Df||(Df=document.createElement(`div`),Df.style.display=`none`,document.body.append(Df)),Df}function Af(e,t,n){e.snapshots.delete(t),e.snapshots.set(t,n);for(let t of e.snapshots.keys()){if(e.snapshots.size<=Cf)break;e.snapshots.delete(t)}}function jf(e,t,n){e.entries.delete(t.key),t.leaving!==null&&window.clearTimeout(t.leaving),t.leaving=null,n?Af(e,t.key,t.handle.snapshot()):e.snapshots.delete(t.key),t.handle.dispose(),t.box.remove()}function Mf(e){let t=[...e.entries.values()].filter(e=>e.slot.parkedAt!==null);t.sort((e,t)=>(e.slot.parkedAt??0)-(t.slot.parkedAt??0));for(let n of t.slice(0,Math.max(0,t.length-Sf)))jf(e,n,!0)}function Nf(e,t){return Of(e).entries.get(t)?.handle??null}function Pf(e,t,n,r){return Of(e).entries.get(X(t,n,r))?.slot.parkedAt!=null}async function Ff(e,t){let n=Of(e.client),r=X(e.taskId,e.tabId,e.leafId),i=n.entries.get(r);if(i&&i.slot.parkedAt!==null){let{slot:r,handle:a,box:o}=i;return r.parkedAt=null,r.binding=t,i.leaving!==null&&(window.clearTimeout(i.leaving),i.leaving=null,o.classList.remove(`is-leaving`)),n.left=null,zf(n),e.host.append(o),t.setNotice(r.notice),t.onScrolled(r.scrolled),a.term.refresh(0,a.term.rows-1),e.focusOnMount&&a.term.focus(),{handle:a,release:()=>If(n,i)}}let a=document.createElement(`div`);a.className=Nn,e.host.append(a),Lf(n,e.host);let o=!i,s={binding:t,notice:{kind:`none`},scrolled:0,parkedAt:null},c=null,l=o?n.snapshots.get(r):void 0;l&&n.snapshots.delete(r);let{mountTerminal:u}=await xf(async()=>{let{mountTerminal:e}=await import(`./term-mount-D7niAZe0.js`);return{mountTerminal:e}},__vite__mapDeps([0,1])),d=u({...e,el:a,snapshot:l,onPainted:()=>zf(n),setNotice:e=>{s.notice=e,s.binding?.setNotice(e)},onScrolled:e=>{s.scrolled=e,s.binding?.onScrolled(e)},onFocusChange:e=>s.binding?.onFocusChange(e),onExit:e=>{s.binding?s.binding.onExit(e):c&&n.entries.get(r)===c&&jf(n,c,!1)},copyText:e=>s.binding?.copyText(e)??Promise.resolve(!1),pasteImage:()=>s.binding?.pasteImage()??Promise.resolve()});if(!o)return{handle:d,release:()=>{d.dispose(),a.remove()}};let f={key:r,handle:d,box:a,slot:s,leaving:null};return c=f,n.entries.set(r,f),{handle:d,release:()=>If(n,f)}}function If(e,t){let{slot:n}=t;e.entries.get(t.key)===t&&n.parkedAt===null&&(n.binding?.onFocusChange(!1),n.binding=null,t.handle.term.blur(),n.parkedAt=performance.now(),kf().append(t.box),e.left=t,Mf(e))}function Lf(e,t){let n=e.left;e.left=null,!(!n||n.slot.parkedAt===null||performance.now()-n.slot.parkedAt>Tf)&&e.entries.get(n.key)===n&&(n.box.classList.add(`is-leaving`),t.append(n.box),n.leaving=window.setTimeout(()=>Rf(e,n),wf))}function Rf(e,t){t.leaving!==null&&(window.clearTimeout(t.leaving),t.leaving=null,t.box.classList.remove(`is-leaving`),e.entries.get(t.key)===t&&t.slot.parkedAt!==null&&kf().append(t.box))}function zf(e){for(let t of e.entries.values())Rf(e,t)}async function Bf(e,t,n){return Ll(await e.request(`output.read`,{taskId:t,tab:n,source:`terminal`,limit:12}))}async function Vf(e,t,n,r){try{let i=await e.client.request(`tab.send`,{taskId:t,tabId:n,prompt:r});return i.delivered?!0:(I(z(`layout.composerNotSent`,{reason:i.reason??``}),`error`),!1)}catch(e){let t=e instanceof Ho?e.code:void 0;return I(t===`UNKNOWN_OP`?z(`layout.composerOldBridge`):t===`AWAITING_PERMISSION`?z(`layout.composerAtMenu`):e instanceof Error?e.message:String(e),`error`),!1}}async function Hf(e,t,n,r){let{client:i}=e,a=X(t,n),o=No(a)!==void 0||Pf(i,t,n);try{return o||await i.request(`term.attach`,{taskId:t,tabId:n}),await i.request(`term.input`,{stream:a,data:r}),!0}catch(e){return I(e instanceof Error?e.message:String(e),`error`),!1}finally{o||await i.request(`term.detach`,{stream:a}).catch(()=>{})}}async function Uf(e,t,n){try{return(await e.client.request(`gate.answer`,{gateId:t,...n})).delivered||I(z(`inbox.gateKept`)),!0}catch(e){return I(e instanceof Error?e.message:String(e),`error`),!1}}var Wf=(e,t,n)=>({id:e,cap:t,bytes:e=>`\x1b${e?`O`:`[`}${n}`}),Gf={id:`enter`,cap:`⏎`,bytes:()=>`\r`},Kf=[{id:`esc`,cap:`esc`,bytes:()=>`\x1B`},{id:`tab`,cap:`tab`,bytes:()=>` `},{id:`backtab`,cap:`⇧tab`,bytes:()=>`\x1B[Z`},{id:`interrupt`,cap:`^C`,bytes:()=>``},Wf(`up`,`↑`,`A`),Wf(`down`,`↓`,`B`),Wf(`left`,`←`,`D`),Wf(`right`,`→`,`C`),Gf],qf=e=>({id:`option-${e}`,cap:String(e),bytes:()=>String(e)}),Jf=[qf(1),qf(2),qf(3),qf(4),Gf];function Yf(e){if(e.length!==1)return e;let t=e.toUpperCase().charCodeAt(0);return t===32?`\0`:t===63?``:t>=64&&t<=95?String.fromCharCode(t&31):e}var Xf=`mx-2.5 mt-0.5 mb-1.5 flex min-w-0 flex-col gap-1.5 font-mono text-meta`,Zf=2e3;function Qf(e,t,n){let[r,i]=(0,h.useState)(null),[a,o]=(0,h.useState)(0);return(0,h.useEffect)(()=>{if(!n)return;let r=!0,a=0,o=async()=>{try{let a=await Bf(e.client,t,n);r&&i(a)}catch{r&&i(e=>e??[])}r&&(a=window.setTimeout(o,Zf))};return o(),()=>{r=!1,window.clearTimeout(a)}},[e,t,n,a]),{lines:r,refresh:()=>o(e=>e+1)}}function $f(e){B();let{model:t,taskId:n,tabId:r,mode:i,gate:a}=e,{lines:o,refresh:s}=Qf(t,n,r),c=(0,h.useRef)(null),[l,u]=(0,h.useState)(``),[d,f]=(0,h.useState)(!1);(0,h.useEffect)(()=>{let e=c.current;e&&(e.scrollTop=e.scrollHeight)},[o]);let p=async e=>{f(!0);let t=await e();return f(!1),t&&window.setTimeout(s,600),t},m=async()=>{let e=l.trim();!e||d||await p(()=>i===`gate`&&a?Uf(t,a.id,{text:e}):r?Vf(t,n,r,e):Promise.resolve(!1))&&u(``)};return(0,V.jsxs)(`div`,{className:Xf,children:[a&&(0,V.jsx)(`p`,{className:`m-0 whitespace-pre-wrap wrap-anywhere text-ink`,children:a.question}),r&&(0,V.jsx)(`pre`,{ref:c,className:`m-0 max-h-60 overflow-y-auto rounded-sm border-hairline border-line bg-inset px-2 py-1.5 text-ink whitespace-pre-wrap wrap-anywhere`,"data-peek-lines":12,children:o===null?`…`:o.length===0?z(`inbox.noOutput`):o.join(`
|
|
40
40
|
`)}),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(()=>Uf(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:[Jf.map(e=>(0,V.jsxs)(H,{disabled:d,onClick:()=>void p(()=>Hf(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 ep({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 tp={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`},np={accent:`text-accent`,muted:`text-subtle`,attention:`text-error`,warning:`text-warning`,success:`text-success`,info:`text-accent`,ink:`text-ink`},rp=6;function ip(e,t){return e?`${e.repo.split(`/`).filter(Boolean).pop()??e.repo} › ${e.label}`:t}function ap({model:e}){B();let t=y(e.tasks),n=y(e.visits),r=y(e.tabs),[i,a]=(0,h.useState)(0),[o,s]=(0,h.useState)(null),[c,l]=(0,h.useState)(Date.now());(0,h.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=Fl(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:ip(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,rp).map(e=>({key:`r:${e.taskId}:${e.tabId}`,section:`recent`,taskId:e.taskId,tabId:e.tabId,identity:ip(u.get(e.taskId),e.taskId),subtitle:d(e.taskId,e.tabId)||u.get(e.taskId)?.branch||``,at:e.at})),g=[...f,...m],_=g[Math.min(i,g.length-1)],v=t=>{if(t.attention&&Nl(t.attention.state))return zl(e,t.attention);t.attention&&Rl(e,t.attention),t.taskId&&u.has(t.taskId)&&(e.select(t.taskId,t.tabId),R())},b=()=>void Promise.all(f.map(t=>t.attention&&Rl(e,t.attention,!0)));(0,h.useEffect)(()=>{let t=t=>{if(!(t.target instanceof HTMLElement&&t.target.closest(`input, textarea`))){if(t.key===`ArrowDown`||t.key===`j`)a(e=>Math.min(g.length-1,e+1));else if(t.key===`ArrowUp`||t.key===`k`)a(e=>Math.max(0,e-1));else if(t.key===`Enter`&&_)v(_);else if(t.key===`d`&&_?.attention)Rl(e,_.attention,!0);else if(t.key===`D`)b();else return;t.preventDefault()}};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)});let x=n=>{let r=n.attention?jl(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&&!Nl(l.state)&&(!l.gateId||!!f)&&(!!p||!!f),h=l?.state===`permission_needed`||!!p&&d?.tabStatus?.[p]?.kind===`needs-input`,y=f?`gate`:l?.state===`dead`?`readonly`:h?`menu`:`reply`,b=`${n.taskId}:${n.tabId}:${l?.gateId??``}`,x=m&&o===b;return(0,V.jsxs)(`li`,{children:[(0,V.jsxs)(`div`,{className:oi,children:[(0,V.jsxs)(`button`,{type:`button`,className:`${pi({selected:i,stack:!0})} ${si}`,onMouseEnter:()=>a(g.indexOf(n)),onClick:()=>v(n),children:[(0,V.jsxs)(`span`,{className:ii,children:[(0,V.jsx)(`span`,{className:mi,children:n.identity}),r&&(0,V.jsxs)(`span`,{className:`flex-none font-mono text-meta font-normal normal-nums ${np[r.tone]}`,children:[r.glyph,` `,z(r.stateKey)]}),(0,V.jsx)(`span`,{className:ai,children:Ml(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:ci,"aria-expanded":x,onClick:()=>{a(g.indexOf(n)),s(x?null:b)},children:z(x?`inbox.hide`:`inbox.reply`)}):(0,V.jsx)(`span`,{"aria-hidden":!0,className:ci})]}),x&&n.taskId&&(0,V.jsx)($f,{model:e,taskId:n.taskId,tabId:p,mode:y,gate:f,onOpenTab:()=>v(n)})]},n.key)};return(0,V.jsx)(bi,{title:z(`inbox.title`),wide:!0,children:(0,V.jsxs)(`div`,{className:Wr,children:[(0,V.jsxs)(`div`,{className:ti,children:[(0,V.jsx)(`p`,{className:`${U} text-muted ${ei} touch:hidden!`,children:(0,V.jsx)(ep,{text:z(`inbox.hints`)})}),f.length>0&&(0,V.jsx)(H,{className:`flex-none min-w-[calc(9ch+0.5rem)] whitespace-nowrap pr-2 text-right font-mono text-meta`,onClick:b,children:z(`inbox.ackAll`)})]}),(0,V.jsx)(`h2`,{className:`${U} text-muted ${ni}`,children:z(`inbox.attention`)}),f.length===0?(0,V.jsx)(`p`,{className:`mono text-muted`,children:z(`inbox.empty`)}):(0,V.jsx)(`ul`,{className:ri,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 op=`rove.prefs`,sp={locale:`en`,theme:`claude`,themeMode:`dark`,transparent:!0,focusAccent:`primary`,splitStyle:`line`,railFold:`glyphs`,workingBorder:`flow`,taskColors:`on`,glyphSet:`braille`,colorblind:`off`,runningTitle:`shimmer`,statusMark:`both`,statusMarkNoticeSeen:!0,railSort:`recent`,railGroup:`project`,toast:!0,sound:!0,soundVolume:.4,crossTask:!0,finishedAlerts:!0,keyHints:!0,zen:!0,editorKind:`auto`,worktreeBase:`default`,scrollbackRows:1e3,tabStrip:`never`,prefixTap:`local`,remoteProjects:!1,autoStatus:!1,dispatcher:!1,updateChannel:`latest`,updateNotify:!0};function cp(){try{let e=JSON.parse(localStorage.getItem(op)??`null`);if(e&&typeof e==`object`&&`prefs`in e&&`themes`in e){let t=e;return{...t,prefs:{...sp,...t.prefs},loaded:!0}}}catch{}return{loaded:!1,prefs:sp,options:{},info:{editorCustomSet:!1,worktreeCustomPath:``},themes:[],glyphSets:{}}}var lp=v(cp());function up(e){(e.locale===`en`||e.locale===`zh`)&&kt.set(e.locale)}up(lp.get().prefs);function dp(e){let t={loaded:!0,prefs:e.prefs,options:e.options,info:e.info,themes:e.themes,glyphSets:e.glyphSets};lp.set(t),up(t.prefs),localStorage.setItem(op,JSON.stringify(t))}var fp=null;async function pp(e){fp=e,dp(await e.request(`prefs.get`))}async function mp(e,t,n){let r=lp.get();lp.set({...r,prefs:{...r.prefs,[t]:n}}),up(lp.get().prefs);try{let r=await e.request(`prefs.set`,{key:t,value:n});dp({...lp.get(),prefs:r.prefs})}catch(e){lp.set(r),up(r.prefs),I(e instanceof Error?e.message:String(e),`error`)}}function hp(e,t){if(fp)return void mp(fp,e,t);let n=lp.get();lp.set({...n,prefs:{...n.prefs,[e]:t}})}function gp(){return y(lp)}function _p(e,t){let n=e.options[t];return Array.isArray(n)?n:[]}var vp=[`project`,`state`],yp=`rove.railGroup`,bp=v(vp.find(e=>e===localStorage.getItem(yp))??`project`);function xp(e){e!==bp.get()&&(bp.set(e),localStorage.setItem(yp,e))}lp.subscribe(()=>{let{loaded:e,prefs:t}=lp.get();e&&vp.includes(t.railGroup)&&xp(t.railGroup)});function Sp(e){xp(e),hp(`railGroup`,e)}var Cp=`rove.activeSortMode`;function wp(){let e=localStorage.getItem(Cp);return gd.find(t=>t===e)??`recent`}var Tp=v(wp());function Ep(e){e!==Tp.get()&&(Tp.set(e),localStorage.setItem(Cp,e))}lp.subscribe(()=>{let{loaded:e,prefs:t}=lp.get();e&&gd.includes(t.railSort)&&Ep(t.railSort)});function Dp(e){Ep(e),hp(`railSort`,e)}function Op(){Dp(gd[(gd.indexOf(Tp.get())+1)%gd.length]??`default`)}var kp=v(!1),Ap=v(null);function jp(e){e&&(Tp.get()!=="default"||bp.get()===`state`)&&(Dp(`default`),Sp(`project`),I(G(`tasks`,`sort.reorderSwitched`))),e||Ap.set(null),kp.set(e)}async function Mp(e,t,n){let r=n<0?`up`:`down`;try{await e.client.request(`task.move`,{taskId:t.task.id,direction:r})}catch(e){I(G(`tasks`,`toast.moveFailed`,{error:e instanceof Error?e.message:String(e)}),`error`)}}async function Np(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){I(G(`tasks`,`toast.moveFailed`,{error:e instanceof Error?e.message:String(e)}),`error`)}}var Pp=`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`,Fp=`flex min-h-0 flex-1 flex-col items-center justify-center gap-1.5 overflow-hidden text-center keyboard:hidden`,Ip=`relative mx-auto flex w-full max-w-[104ch] flex-none flex-col gap-2 keyboard:mt-auto`,Lp=`pointer-events-none absolute bottom-full left-0 mb-2 flex flex-col gap-1`,Rp=`flex flex-col gap-2 rounded-md border-hairline border-line bg-surface px-3 py-2.5 focus-within:border-line-active`,zp=`flex flex-wrap items-center justify-end gap-1.5`,Bp=`max-h-[40vh] min-h-[4.5em] w-full bg-transparent text-ink [border:0] [outline:0]`,Vp=`flex items-center gap-1.5 px-1`,Hp=`flex min-w-0 items-center gap-1.5`,Up=`${Hp} group/end ml-auto narrow:ml-0`,Wp=(e=!1)=>`flex h-7 min-w-7 cursor-pointer items-center justify-center rounded-sm px-1 has-[:disabled]:opacity-60 disabled:opacity-60 [&:hover]:bg-hover [&:hover]:text-ink ${e?`text-accent`:`text-muted`}`,Gp=`size-3.25 flex-none fill-none stroke-current [stroke-linecap:round] [stroke-linejoin:round] [stroke-width:1.3]`,Kp=`narrow:sr-only`,qp=(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`}`,Jp=`disabled:cursor-default disabled:opacity-60`,Yp=e=>`${qp(e)} min-w-[9ch] justify-center ${Jp}`,Xp=`touch-none select-none [-webkit-touch-callout:none]`,Zp=`group/chip relative inline-flex`,Qp=`flex min-h-0 flex-col gap-1 overflow-x-hidden overflow-y-auto p-1.5 [outline:0]`,$p=`flex min-h-0 flex-col overflow-x-hidden overflow-y-auto`,em=`sticky top-0 z-1 m-0 bg-surface px-1.5 pt-1.5 pb-0.5 text-left`,tm=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`:``}`,nm=`flex-[0_0_1.5ch] text-accent`,rm=`ml-auto pl-3 inline-flex items-center gap-1`,im=`min-w-0 overflow-hidden text-ellipsis whitespace-nowrap`,am=`${im} narrow:max-w-[13ch]`,om=`${im} [direction:rtl]`,sm=`flex-none whitespace-nowrap`,cm=`mx-2 my-1`,lm=`flex flex-col gap-0.5 px-1.5 py-0.5`,um=`min-w-[36ch]`,dm=`flex items-center gap-1.5 p-1.5`;function fm(){return(0,V.jsx)(`svg`,{className:Gp,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 pm(){return(0,V.jsxs)(`svg`,{className:Gp,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 mm(e){return e instanceof Error?e.message:String(e)}function hm(e){return/no space left on device|ENOSPC|disk quota exceeded/i.test(mm(e))}var gm=`-my-0.75 -mr-0.5 ml-0 flex flex-none self-stretch`,_m=`before:absolute before:top-0 before:left-1 before:content-[''] before:[border-left:var(--hairline)_solid_var(--line-active)]`,vm={blank:``,pipe:`${_m} before:bottom-0`,tee:`${_m} before:bottom-0`,elbow:`${_m} before:right-0 before:bottom-1/2 before:rounded-bl-[6px] before:[border-bottom:var(--hairline)_solid_var(--line-active)]`},ym=e=>`relative w-3 ${vm[e]}`,bm=`-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`,xm=`inline-flex items-center gap-1`,Sm=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`:``}`,Cm=`inline-flex flex-none items-center text-subtle`,wm=`group/rail rail @container row-1 flex min-h-0 flex-col focus:outline-none ${Vt}`,Tm=`flex min-w-0 items-center gap-2.5 overflow-hidden px-3.5 pt-3.5 pb-2.5 whitespace-nowrap`,Em=`flex gap-1 px-3.5 pb-2 text-meta`,Dm=`min-w-0 flex-1 border-none bg-transparent p-0 text-ink [font:inherit] outline-none placeholder:text-subtle`,Om=e=>`flex-1 overflow-y-auto px-1.5 pt-1 pb-3 scrollbar-none ${e?`[&>[data-row]]:[transition:transform_150ms_ease-out,scale_150ms_ease-out,opacity_150ms_ease-out] motion-reduce:[&>[data-row]]:transition-none [&>[data-row]]:[box-shadow:none]! [&>[data-row]:not([data-lifted])]:opacity-45`:``}`,km=`group-focus-within/rail:[box-shadow:inset_0_0_0_1px_var(--focus)]`,Am=e=>`group/head mx-2 mt-1.5 mb-1 flex items-center gap-1 font-mono text-meta font-semibold normal-nums not-first:mt-4.5 ${e.dragging?`origin-left scale-[1.03] cursor-grabbing text-ink motion-reduce:scale-none`:`text-subtle`} ${e.grab&&!e.dragging?`relative cursor-grab before:-left-1.5 [&>button:first-child]:cursor-grab ${fi}`:``} ${e.moving?`bg-accent-soft after:font-mono after:text-meta after:font-medium after:normal-nums after:text-accent after:content-['move']`:``}`,jm=`touch:relative touch:after:absolute touch:after:-inset-x-1.5 touch:after:-inset-y-3 touch:after:content-['']`,Mm=`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 ${jm}`,Nm=e=>e?``:`opacity-0 group-hover/head:opacity-100 group-focus-visible/toggle:opacity-100 touch:opacity-100`,Pm=`-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 ${jm}`,Fm=1e4;function Im(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 Lm(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}${Im(t,n).slice((t.hostLabel||t.alias).length)}`}function Rm(e,t,n){if(e.kind!==`task`||e.machine===void 0)return null;let r=e.machine;return Lm(r,t.find(e=>e.alias===r),n,e.task.machine?.label)}function zm({label:e}){return(0,V.jsx)(`span`,{className:Cm,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 Bm({host:e,onMachines:t}){return B(),(0,V.jsxs)(`div`,{className:qn,children:[(0,V.jsx)(`p`,{className:`text-muted`,children:G(`tasks`,`machine.filesElsewhere`,{host:e})}),(0,V.jsx)(`p`,{className:`text-muted`,children:G(`tasks`,`machine.filesHint`,{host:e})}),(0,V.jsx)(`div`,{children:(0,V.jsx)(H,{hit:`tight`,onClick:t,children:z(`machines.open`)})})]})}function Vm(e){let t=y(e.client.conn),n=y(e.remote),[r,i]=(0,h.useState)(()=>Y(e,`machines.list`)?.machines??[]),a=[...new Set(n.map(e=>`${e.machine?.id}:${e.machine?.stale??!1}`))].join();return(0,h.useEffect)(()=>{if(t.state!==`open`)return;let n=!0,r=()=>Gu(e,`machines.list`).then(e=>n&&i(e.machines),()=>{});r();let a=Ei(Fm,r);return()=>{n=!1,a()}},[e.client,t.state,a]),r}function Hm(e){let[t,n]=(0,h.useState)(!1),r=(0,h.useRef)(e.onClose);r.current=e.onClose,(0,h.useEffect)(()=>{t||r.current?.()},[t]);let i=(0,h.useRef)(null),a=(0,h.useRef)(null),o=(0,h.useRef)(null);(0,h.useLayoutEffect)(()=>{let e=o.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 s=()=>{n(!1),a.current?.focus()};return(0,h.useEffect)(()=>{if(!t)return;let e=e=>{i.current?.contains(e.target)||n(!1)};return window.addEventListener(`mousedown`,e),()=>window.removeEventListener(`mousedown`,e)},[t]),(0,V.jsxs)(`span`,{ref:i,className:Zp,onKeyDown:e=>{e.key!==`Escape`||!t||(e.preventDefault(),e.stopPropagation(),s())},children:[(0,V.jsx)(`button`,{ref:a,type:`button`,className:qp(),"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:o,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-[&]/end:group-last-of-type/chip:right-0 group-[&]/end:group-last-of-type/chip:left-auto`,children:e.children(s)})]})}function Um(e){let[t,n]=(0,h.useState)(0),r=[...e.extra?[e.extra]:[],...e.rows,...e.more??[]],i=Math.min(t,Math.max(0,r.length-1)),a=(0,h.useRef)(null);return(0,h.useEffect)(()=>{a.current?.scrollIntoView({block:`nearest`})},[i,e.rows]),(0,V.jsxs)(`div`,{className:Qp,children:[(0,V.jsx)(`input`,{className:pn,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,t.shiftKey||t.metaKey||t.ctrlKey)}}}}),(0,V.jsxs)(`div`,{className:$p,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)(h.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}),t.ruled&&r>0&&(0,V.jsx)(`div`,{className:`mx-2 my-1 flex-none border-t-hairline border-t-line`}),(0,V.jsxs)(`button`,{type:`button`,"aria-current":t.checked===!0,ref:r===i?a:void 0,tabIndex:-1,title:t.title,className:tm({cursor:r===i}),onMouseMove:()=>n(r),onClick:n=>e.onPick(t.key,n.shiftKey||n.metaKey||n.ctrlKey),children:[(0,V.jsx)(`span`,{className:nm,children:t.checked?`✓`:``}),(0,V.jsx)(`span`,{className:sm,children:t.text}),t.dim&&(0,V.jsx)(`span`,{className:`ml-auto pl-3 text-muted ${t.dimPath?om:`min-w-0 overflow-hidden text-ellipsis whitespace-nowrap`}`,children:t.dimPath?(0,V.jsx)(`bdi`,{children:t.dim}):t.dim})]})]},t.key))]}),e.hint&&(0,V.jsx)(`p`,{className:`m-0 flex-none border-t-hairline border-t-line px-2 pt-1.5 pb-0.5 text-subtle`,children:e.hint})]})}function Wm(e){return(0,V.jsxs)(`button`,{type:`button`,role:e.multi?`menuitemcheckbox`:`menuitemradio`,"aria-checked":e.checked,tabIndex:-1,disabled:e.option.disabled,className:tm({cursor:e.cursor,dim:e.option.dim}),onMouseMove:e.onHover,onClick:e.onPick,children:[(0,V.jsx)(`span`,{className:nm,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 Gm(e){let[t,n]=(0,h.useState)(()=>Math.max(0,e.options.findIndex(t=>t.id===e.value))),r=(0,h.useRef)(null);return(0,h.useEffect)(()=>r.current?.focus(),[]),(0,V.jsxs)(`div`,{ref:r,role:`menu`,tabIndex:-1,className:Qp,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?Pu(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:`${em} ${U} text-muted`,tabIndex:-1,onClick:e.onBack,children:[`‹ `,e.heading]}):(0,V.jsx)(`p`,{className:`${em} ${U} text-muted`,children:e.heading}),e.options.map((r,i)=>(0,V.jsx)(Wm,{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 Km(e){return(0,V.jsxs)(`div`,{className:`${Qp} ${um}`,children:[(0,V.jsx)(`p`,{className:`${em} ${U} text-muted`,children:z(`newSession.branches`)}),(0,V.jsxs)(`label`,{className:lm,children:[(0,V.jsx)(`span`,{className:`text-muted`,children:z(`newSession.branchName`)}),(0,V.jsx)(`input`,{className:jr,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:lm,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:jr,"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 qm(e){return e.replace(/\.git$/,``).split(/[/:]/).filter(Boolean).slice(-2).join(`/`)}function Jm(e){return e.id.startsWith(`root:`)?e.primary??e.checkouts[0]??e.id:e.id}function Ym(e,t){if(!e)return null;let n=t.find(t=>t.id===e||t.checkouts.includes(e));return n?{ref:Jm(n),clone:!1}:e.startsWith(`/`)?{ref:e,clone:!1}:null}function Xm(e,t,n){let r=t.toLowerCase();return n?e.some(e=>e.toLowerCase()===`github.com/${r}`):e.some(e=>pu(e).base.toLowerCase()===(r.split(`/`)[1]??``))}function Zm(e,t,n){let r=t.find(t=>t.id===e||t.checkouts.includes(e))?.id??e,i=n.find(e=>e.id===r);return i?{ref:Jm(i),clone:!1}:r.startsWith(`root:`)||r.startsWith(`/`)?null:{ref:r,clone:!0}}function Qm(e,t){let n=new Set(t.filter(e=>e.installed!==!1).map(e=>e.id)),r=new Set(t.length>0?e.filter(e=>!n.has(e.id)).map(e=>e.id):[]),i=new Set(e.map(e=>e.id)),a=t.filter(e=>n.has(e.id)&&!i.has(e.id)).map(e=>({id:e.id,name:e.name??e.id}));return{rows:[...e,...a],missing:r}}function $m(e){return{repo:e.pick.ref,machine:e.machine,...e.pick.clone?{clone:!0}:{},...e.baseRef?{baseBranch:e.baseRef}:{},...e.prompt?{prompt:e.prompt}:{},...e.engine?{engine:e.engine}:{},...e.engineThere?{engineThere:!0}:{},...!e.engineThere&&e.model?{model:e.model}:{}}}var eh=1.2,th=.3,nh=20,rh=.35,ih=.25,ah=.12,oh=2,sh=1,ch={error:{dots:[0,4,8,2,6],bright:1},done:{dots:[3,7,5,2],bright:1},idle:{dots:[1,2,5,8,7,6,3,0],bright:.6}},lh=Array.from({length:9},(e,t)=>Math.hypot(t%3-1,Math.floor(t/3)-1));function uh(e){return rh+.65*(.5+.5*Math.cos(2*Math.PI*e/eh))}function dh(e,t,n,r=1){switch(e){case`working`:{let e=t*80/1e3/r;return lh.map(t=>uh(e-t*th))}case`waiting`:{let e=[0,1,4,5].includes(Math.floor(t/r)%nh);return Array(9).fill(e?ih:1)}default:{let t=ch[e],r=Array(9).fill(ah);return t?.dots.forEach((e,i)=>{let a=Math.min(Math.max(n-i*sh,0),oh)/oh;r[e]=t.bright*a+ah*(1-a)}),r}}}function fh(e,t){let n=ch[e];return!n||t<(n.dots.length-1)*sh+oh}var ph={working:`info`,waiting:`warning`,error:`attention`,done:`success`,idle:`muted`},mh={prOpen:``,prMerged:``,prClosed:``};function hh(e){let t=gh(e);return{look:t,tone:ph[t]}}function gh(e){switch(e?.kind){case`busy`:case`running`:return`working`;case`needs-input`:return`waiting`;case`attention`:return e.reason===`rate_limited`?`waiting`:`error`;case`unseen`:return`done`;default:return`idle`}}function _h(e){return e.rowStatus?.kind===`needs-input`||e.rowStatus?.kind===`attention`}var vh={busy:0,attention:1,"needs-input":2,running:3,unseen:4,idle:5};function yh(e){let t;for(let{rowStatus:n}of e)n&&(!t||vh[n.kind]<vh[t.kind]||n.kind===t.kind&&n.since>t.since)&&(t=n);return t}function bh(e,t,n){if(!e)return null;if(e.lifecycle===`merged`)return{glyph:mh.prMerged,tone:n?`text-muted`:`text-merged`,state:`merged`};if(e.lifecycle===`closed`)return{glyph:mh.prClosed,tone:`text-muted`,state:`closed`};if(e.lifecycle!==`open`&&e.lifecycle!==`ready_to_merge`&&e.lifecycle!==`unknown`)return null;let r=t===`conflict`?`conflict`:t===`failing`?`failing`:t===`passing`?`passing`:e.checkState===`pending`?`pending`:void 0,i=n?`text-muted`:r===`conflict`?`text-warning`:r===`failing`?`text-error`:r===`passing`?`text-success`:`text-muted`;return{glyph:mh.prOpen,tone:i,state:`open`,...r?{checks:r}:{}}}function xh(e){return bh(e.pr,e.prChip,e.prChipStale===!0)}function Sh(e){return bh(e,(e.mergeable??``).toUpperCase()===`CONFLICTING`?`conflict`:e.checkState===`failing`?`failing`:e.checkState===`passing`?`passing`:null,!1)}function Ch(e){let t=e=>e.state===`open`?e.checks===`conflict`||e.checks===`failing`?0:1:e.state===`merged`?2:3;return[...e].sort((e,n)=>t(e)-t(n))[0]}var wh=3,Th=new Set,Eh;function Dh(e,t){let n=typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches,r=1/0,i=e.held+t-e.step,a=fh(e.look,n?r:i);return dh(e.look,t,n?r:i,n?wh:1).forEach((t,n)=>{let r=e.el.children[n].style;r.opacity=t.toFixed(3)}),a}function Oh(){let e=Math.floor(performance.now()/80);for(let t of Th)Dh(t,e)||Th.delete(t);kh()}function kh(){Eh=Th.size?window.setTimeout(Oh,80-performance.now()%80+2):void 0}function Ah(e,t,n){let r=Math.floor(performance.now()/80),i=n>0?Math.max(Date.now()-n,0):1/0,a={el:e,look:t,step:r,held:Math.floor(i/80)};return Dh(a,r)&&(Th.add(a),Eh===void 0&&kh()),()=>{Th.delete(a)}}function jh({status:e}){let{look:t,tone:n}=hh(e);return(0,V.jsx)(Ph,{look:t,tone:n,since:e?.since??0},t)}var Mh=e=>e===`muted`?`text-muted`:e===`ink`?`text-ink`:tp[e];function Nh(){return(0,V.jsx)(Ph,{look:`working`,tone:`info`,since:Date.now()})}function Ph({look:e,tone:t,since:n}){let r=(0,h.useRef)(null),[i]=(0,h.useState)(n);return(0,h.useLayoutEffect)(()=>{let t=r.current;return t?Ah(t,e,i):void 0},[e,i]),(0,V.jsx)(`span`,{ref:r,className:`inline-grid flex-none grid-cols-[repeat(3,3px)] auto-rows-[3px] gap-px self-center ${Mh(t)}`,"aria-hidden":`true`,children:Array.from({length:9},(e,t)=>(0,V.jsx)(`i`,{className:`rounded-full bg-current opacity-12`},t))})}var Fh={offline:`newSession.remoteOffline`,outdated:`newSession.remoteOutdated`},Ih=`local`,Lh=`auto`,Rh=`rove.newSession.autoMachine`;function zh(){try{return localStorage.getItem(Rh)===`1`}catch{return!1}}var Bh=(e,t)=>Gu(e,`machines.repos`,{machine:t});function Vh(e,t){let n=t.filter(e=>e.state===`online`).map(e=>e.alias).join(`
|
|
41
41
|
`);(0,h.useEffect)(()=>{for(let t of n?[Ih,...n.split(`
|
|
42
42
|
`)]:[])Bh(e,t).catch(()=>{})},[e,n])}function Hh(e,t){let[n,r]=(0,h.useState)(null);return(0,h.useEffect)(()=>{if(!t)return;let n=!1;return Gu(e,`machines.engines`,{machine:t}).then(e=>!n&&r({machine:t,reply:e})).catch(()=>{}),()=>{n=!0}},[e,t]),t?(n?.machine===t?n.reply:Y(e,`machines.engines`,{machine:t}))?.engines??[]:[]}function Uh(e,t,n){let r=Qm(n.engines,Hh(e,t)),i=r.rows.filter(e=>!r.missing.has(e.id)),a=i.some(e=>e.id===n.engine)?n.engine:i[0]?.id??n.engine;return{engines:r.rows,engine:a,setEngine:n.setEngine,missing:t?r.missing:void 0}}function Wh(e,t,n){let[r,i]=(0,h.useState)(null),a=Kh(e,r?.from??``);return(0,h.useEffect)(()=>{!r||!a.loaded||!t.loaded||(t.problem||n(Zm(r.ref,a.repos,t.repos)),i(null))},[r,a,t,n]),(e,t)=>i(e&&t?{from:e,ref:t}:null)}function Gh(e,t,n){let r=Vm(e),[i,a]=(0,h.useState)(t.machine??``),[o,s]=(0,h.useState)(()=>!t.machine&&zh()),c=Kh(e,i),[l,u]=(0,h.useState)(!1),d=Uh(e,l?i:``,n);Vh(e,r);let[f,p]=(0,h.useState)(null),[m,g]=(0,h.useState)(``),_=Wh(e,c,e=>p(t=>t??e));return(0,h.useEffect)(()=>{!i||!c.loaded||i!==t.machine||p(e=>e??Ym(t.repo,c.repos))},[c.loaded]),{machines:r,machine:i,auto:o,remote:i!==``,machineName:r.find(e=>e.alias===i)?.hostLabel||i,remoteList:c,engineThere:l,setEngineThere:u,shown:d,pick:f,setPick:p,base:m,setBase:g,switchTo(e,t){let n=e===`auto`?``:e;s(e===Lh);try{localStorage.setItem(Rh,e===`auto`?`1`:`0`)}catch{}_(n&&(i||`local`),i?f?.ref:t),a(n),p(null),g(``)}}}function Kh(e,t){B();let[n,r]=(0,h.useState)(null);if((0,h.useEffect)(()=>{if(!t)return;let n=!1;return Bh(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=Y(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?Fh[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 qh(e,t){return t.problem?t.problem:t.loaded?z(`newSession.remoteNone`,{machine:e}):z(`newSession.remoteLoading`,{machine:e})}function Jh(){return(0,V.jsxs)(`svg`,{className:Gp,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 Yh(e){let t=(B()===`zh`?Wi:Ui).machine,n=e.machines.find(t=>t.alias===e.value),r=e.value===`auto`?z(`newSession.machineAuto`):e.value?n?.hostLabel||e.value:z(`newSession.thisMachine`);return(0,V.jsx)(Hm,{field:`machine`,title:z(`newSession.machine`),label:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Jh,{}),(0,V.jsx)(`span`,{className:Kp,children:r})]}),children:n=>(0,V.jsx)(Gm,{heading:z(`newSession.machine`),options:[{id:Lh,label:z(`newSession.machineAuto`)},{id:``,label:z(`newSession.thisMachine`)},...e.machines.map(e=>({id:e.alias,label:Im(e,t),disabled:e.state!==`online`}))],footer:e.value===`auto`?(0,V.jsx)(`p`,{className:`${cm} text-muted`,children:z(`newSession.machineAutoNote`)}):null,value:e.value,digits:!0,onPick:t=>{e.onPick(t),n()}})})}function Xh(e){let{machine:t}=e;return(0,V.jsx)(Gm,{heading:z(`newSession.agentPlace`),options:[{id:``,label:z(`newSession.thisMachine`)},{id:`there`,label:t}],value:e.there?`there`:``,digits:!0,onBack:e.onBack,onPick:t=>e.onPick(t!==``),footer:(0,V.jsx)(`p`,{className:`${cm} text-muted`,children:z(e.there?`newSession.agentThereNote`:`newSession.agentHereNote`,{machine:t})})})}function Zh(e){let[t,n]=(0,h.useState)(``),r=t.trim();return(0,V.jsx)(Hm,{field:`branch`,title:z(`newSession.branch`),label:e.value||z(`newSession.branch`),children:i=>(0,V.jsx)(Um,{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 Qh(e,t){return(await e.client.request(`task.spawn`,$m(t))).taskIds[0]}function $h(e){let{progress:t,error:n}=e;return!t&&!n?null:(0,V.jsxs)(`div`,{className:Lp,children:[t&&(0,V.jsxs)(`p`,{className:`m-0 flex items-center gap-2 text-muted`,"data-field":`clone-progress`,children:[(0,V.jsx)(Nh,{}),(0,V.jsx)(`span`,{className:`running-shimmer:bg-[linear-gradient(90deg,var(--ink)_0%,var(--ink)_35%,var(--accent)_50%,var(--ink)_65%,var(--ink)_100%)] running-shimmer:bg-size-[300%_100%] running-shimmer:bg-clip-text running-shimmer:text-transparent running-shimmer:animate-shimmer`,children:t})]}),n&&!hm(n)&&(0,V.jsxs)(`p`,{className:`m-0 text-error`,children:[`※ `,n]}),n&&hm(n)&&(0,V.jsxs)(`p`,{className:`pointer-events-auto m-0 text-error`,"data-field":`no-disk-space`,children:[`※ `,G(`tasks`,`toast.noDiskSpace`),` `,(0,V.jsx)(H,{hit:`tight`,disabled:e.busy,onClick:e.onRetry,children:z(`newSession.retry`)})]})]})}function eg(e){return e instanceof Ho&&e.code===`CLONE_FAILED`?G(`newTask`,`error.cloneFailed`,{error:e.message}):e instanceof Error?e.message:String(e)}function tg({on:e,...t}){return(0,V.jsx)(`button`,{type:`button`,className:`${qp(e)} ${Jp}`,"aria-pressed":e,...t})}function ng(e){let[t,n]=(0,h.useState)(``);if(e.ungrouped)return null;if(e.remote)return e.remotePick&&(0,V.jsx)(Zh,{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=gu(s?.branches??[],t).map(e=>({key:e,text:e,checked:e===(i[o]||s?.current)})),u=r.map(t=>({path:t,name:pu(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)(tg,{on:!a,disabled:r.length>1||e.plain,title:e.plain?z(`newSession.worktreeNoGit`):r.length>1?z(`newSession.worktreeMulti`):z(a?`newSession.worktreeOff`:`newSession.worktreeOn`),onClick:e.onToggleWorktree,children:[(0,V.jsx)(pm,{}),(0,V.jsx)(`span`,{className:Kp,children:z(`newSession.worktree`)})]}),r.length>1?(0,V.jsx)(Hm,{field:`branch`,title:z(`newSession.branches`),label:z(`newSession.branches`),children:()=>(0,V.jsx)(Km,{repos:u,branch:e.branchName,onBranch:e.onBranchName,onBase:e.onBase})}):!a&&s?.ok&&c&&(0,V.jsx)(Hm,{field:`branch`,title:z(`newSession.branch`),label:c,children:r=>(0,V.jsx)(Um,{placeholder:z(`newSession.branchSearch`),empty:z(`newSession.branchEmpty`),rows:l,query:t,onQuery:n,onPick:t=>{e.onBase(o,t),n(``),r()}})})]})}var rg=`rove.web.newSession.prompt`,ig=`rove.web.newSession.attachments`,ag=sessionStorage.getItem(rg)??``;function og(){return ag}function sg(e){ag=e;try{sessionStorage.setItem(rg,e)}catch{}}function cg(e,t){let[n,r]=(0,h.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=ku(a,t);r(n),n[0]&&n[0]!==e.engine&&e.setEngine(n[0])}}}function lg(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)(Hm,{field:`engine`,title:z(`newSession.engine`),label:Au(i)||z(`newSession.engine`),children:i=>(0,V.jsx)(Gm,{heading:z(`newSession.engine`),options:r.map(t=>{if(!e.missing)return{id:t.id,label:t.name,dim:t.ready===!1};let n=e.missing.has(t.id);return{id:t.id,label:n?z(`newSession.engineMissing`,{engine:t.name}):t.name,disabled:n}}),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 ug(e){return(0,V.jsx)(Hm,{field:`model`,title:z(`newSession.model`),label:Ou(e.models,e.model,z(`newSession.model`)),children:t=>(0,V.jsx)(Gm,{heading:z(`newSession.modelHeading`),options:e.models,value:e.model,digits:!0,onPick:n=>{e.onModel(n),t()}})})}var dg=6e4,fg=/^(?:(today|tomorrow|今天|明天)\s*)?(\d{1,2})(?::(\d{2}))?\s*(am|pm)?$/i,pg=/^\+\s*(?:(\d+)\s*h)?\s*(?:(\d+)\s*m)?$/i;function mg(e,t){let n=e.trim(),r=pg.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*dg):null}let i=fg.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 hg(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}`}function gg(e){let[t,n]=(0,h.useState)(``),r=()=>{let n=mg(t,new Date);if(!n)return e.onInvalid(z(`newSession.laterBad`));e.onSchedule(n)};return(0,V.jsxs)(`div`,{className:dm,children:[(0,V.jsx)(`input`,{className:`${jr} 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:t=>{if(t.key===`Escape`)return t.preventDefault(),t.stopPropagation(),e.onBack();t.key!==`Enter`||t.nativeEvent.isComposing||(t.preventDefault(),t.stopPropagation(),r())}}),(0,V.jsx)(H,{variant:`filled`,disabled:!t.trim(),onClick:r,children:z(`newSession.laterConfirm`)})]})}function _g(e){let[t,n]=(0,h.useState)(`root`),r=e.agentPlace;return(0,V.jsx)(Hm,{field:`more`,title:z(`newSession.more`),label:(0,V.jsx)(`span`,{"aria-hidden":`true`,children:`⋯`}),onClose:()=>n(`root`),children:i=>t===`later`?(0,V.jsxs)(`div`,{className:Qp,children:[(0,V.jsxs)(`button`,{type:`button`,className:`${em} ${U} text-muted`,onClick:()=>n(`root`),children:[`‹ `,z(`newSession.later`)]}),(0,V.jsx)(gg,{onBack:()=>n(`root`),onInvalid:e.onInvalid,onSchedule:t=>{i(),e.onLater?.(t)}})]}):t===`agent`&&r?(0,V.jsx)(Xh,{...r,onBack:()=>n(`root`),onPick:e=>{r.onPick(e),i()}}):(0,V.jsxs)(`div`,{role:`menu`,className:Qp,children:[r&&(0,V.jsx)(vg,{label:z(`newSession.agentPlace`),dim:r.there?r.machine:z(`newSession.thisMachine`),sub:!0,disabled:e.busy,onClick:()=>n(`agent`)}),e.onLater&&(0,V.jsx)(vg,{label:z(`newSession.later`),sub:!0,disabled:e.busy,onClick:()=>n(`later`)})]})})}function vg(e){return(0,V.jsxs)(`button`,{type:`button`,role:`menuitem`,className:`${tm({cursor:!1})} [&:hover:not(:disabled)]:bg-hover`,disabled:e.disabled,onClick:e.onClick,children:[(0,V.jsx)(`span`,{className:im,children:e.label}),(e.dim!==void 0||e.sub)&&(0,V.jsxs)(`span`,{className:`${rm} text-muted`,children:[e.dim,e.sub&&(0,V.jsx)(fs,{right:!0})]})]})}var yg=128,bg=80,xg=3,Sg=2,Cg=yg/2,wg=bg/2,Tg=25,Eg=(1-1.2/Tg)**2,Dg=1e3/30,Og=7,kg=0,Ag=1,jg=2,Mg=3,Ng=4,Pg=[``,`--color-subtle`,`--color-muted`,`--color-ink`,`--color-accent`],Fg=[0,8,2,10,12,4,14,6,3,11,1,9,15,7,13,5],Ig=Array.from({length:64},(e,t)=>{let n=t%8,r=t>>3;return(4*(Fg[(r&3)*4+(n&3)]??0)+([0,2,3,1][(r>>2)*2+(n>>2)]??0)+.5)/64}),Lg=(e,t)=>Ig[(t&7)*8+(e&7)]??1,Rg=[{radius:1.55,lift:.3,roll:-.42,speed:.9,phase:.4,ink:Ng},{radius:1.95,lift:.22,roll:.3,speed:-.55,phase:2.6,ink:Mg},{radius:2.4,lift:.36,roll:-.12,speed:.38,phase:4.4,ink:Mg}],zg=1.9,Bg=[[6,9,.3],[22,68,2.1],[37,4,4],[95,7,1.2],[118,20,3.3],[122,62,5.1],[11,40,2.8],[83,75,.9]];function Vg(e,t){e.fill(kg);let n=(t,n,r)=>{t>=0&&t<yg&&n>=0&&n<bg&&(e[n*yg+t]=r)};for(let[e,r,i]of Bg)Math.sin(t*.8+i)>-.5&&n(e,r,Ag);let r=-.55+.25*Math.sin(t*.3),i=-.5,a=.67,o=Math.hypot(r,i,a),s=t*.35,c=Math.sin(s),l=Math.cos(s),u=.4,d=Math.sin(u),f=Math.cos(u);for(let e=0;e<bg;e++)for(let t=0;t<yg;t++){let s=(t+.5-Cg)/Tg,u=(e+.5-wg)/Tg,p=s*s+u*u;if(p>=1)continue;let m=Math.sqrt(1-p),h=Math.max(0,(s*r+u*i+m*a)/o),g=s*f+u*d,_=u*f-s*d,v=Math.atan2(g*l+m*c,m*l-g*c),y=Math.asin(Math.max(-1,Math.min(1,_))),b=.5+.5*Math.sin(y*9+1.3*Math.sin(v*2+y*3));h**.75*(.4+.6*b)>Lg(t,e)?n(t,e,h>.4?Mg:jg):p>Eg&&n(t,e,Ag)}for(let e of Rg){let r=Math.sin(e.roll),i=Math.cos(e.roll),a=t=>{let n=e.radius*Math.cos(t),a=e.radius*Math.sin(t),o=a*e.lift,s=n*i-o*r,c=n*r+o*i,l=s*s+c*c<1;return a<0&&l?null:[Math.floor(Cg+s*Tg),Math.floor(wg+c*Tg),l]},o=Math.round(Math.PI*e.radius*Tg);for(let e=0;e<o;e++){let t=a(e/o*Math.PI*2);t&&!t[2]&&n(t[0],t[1],Ag)}let s=e.phase+t*e.speed,c=.5/(e.radius*Tg),l=-Math.sign(e.speed)*c;for(let e=zg/c;e>=0;e--){let t=a(s+e*l);if(t?.[2])for(let e=-2;e<=2;e++)for(let r=-2;r<=2;r++)n(t[0]+r,t[1]+e,kg)}for(let t=zg/c;t>0;t--){let r=a(s+t*l),i=1-t*c/zg;r&&i>Lg(r[0],r[1])&&n(r[0],r[1],i>.6?e.ink:jg)}let u=a(s);if(u)for(let t=-1;t<=1;t++)for(let r=-1;r<=1;r++)n(u[0]+r,u[1]+t,e.ink)}}function Hg(e,t){let n=e.getContext(`2d`);if(!n)return;let r=window.devicePixelRatio||1,i=Math.round(384*r);e.width!==i&&(e.width=i,e.height=Math.round(240*r)),n.setTransform(r,0,0,r,0,0),n.clearRect(0,0,384,240);let a=getComputedStyle(e);for(let e=Ag;e<=Ng;e++){n.fillStyle=a.getPropertyValue(Pg[e]??``)||a.color;for(let r=0;r<t.length;r++)t[r]===e&&n.fillRect(r%yg*xg,Math.floor(r/yg)*xg,Sg,Sg)}}function Ug(){let e=(0,h.useRef)(null);return(0,h.useEffect)(()=>{let t=e.current;if(!t)return;let n=new Uint8Array(10240);if(typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches){Vg(n,Og),Hg(t,n);return}let r=0,i=0,a=e=>{r=requestAnimationFrame(a),!(e-i<Dg)&&(i=e,Vg(n,e/1e3),Hg(t,n))};return r=requestAnimationFrame(a),()=>cancelAnimationFrame(r)},[]),(0,V.jsx)(`div`,{"aria-hidden":`true`,className:`mb-3 max-w-full`,children:(0,V.jsx)(`canvas`,{ref:e,width:384,height:240,"data-plate":`rove`,className:`h-auto w-96 max-w-full text-muted`})})}var Wg=`clone:`;function Gg(e){let{model:t,saved:n,picked:r,primary:i,home:a,query:o,remote:s}=e,[c,l]=(0,h.useState)(()=>Y(t,`github.repos`)??null);(0,h.useEffect)(()=>{let e=!1,n=t.client.onOpen(()=>{Gu(t,`github.repos`).then(t=>!e&&l(t)).catch(()=>!e&&l(e=>e??{repos:[],reason:`failed`}))});return()=>{e=!0,n()}},[t]);let u=o.trim(),d=u.toLowerCase(),f=wu(u),p=n.filter(e=>e.toLowerCase().includes(d)||f!==null&&`/${pu(e).base.toLowerCase()}`===f.slice(f.indexOf(`/`))),m=z(`newSession.noFolder`),g=e.ungrouped&&(!u||m.toLowerCase().includes(u.toLowerCase()))?[{key:wd,text:m,checked:e.ungrouped.on}]:[],_=p.map((e,t)=>{let{base:n,dir:a}=pu(e);return{key:e,text:n,dim:e===i&&r.length>1?`${z(`newSession.primary`)}, ${a}`:a,dimPath:!0,title:e,checked:r.includes(e),ruled:t===0&&g.length>0}}),v=Su(u),y=v&&(v.includes(`:`)||p.length===0)?v:null,b=!y&&_u(u)&&!n.includes(u)&&(!s||u.startsWith(`/`))?yu(vu(u,a)):``,x=(c?.repos??[]).filter(e=>e.nameWithOwner.toLowerCase().includes(f??d)).filter(e=>!Xm(n,e.nameWithOwner,s!==void 0)).sort((e,t)=>Number(t.nameWithOwner.toLowerCase()===f)-Number(e.nameWithOwner.toLowerCase()===f)).map(t=>({key:Wg+t.nameWithOwner,text:t.nameWithOwner,dim:t.description,title:t.description,checked:e.cloning===t.nameWithOwner})),S=f!==null&&!/^(?:ssh:|git@)/i.test(u)&&x[0]?.text.toLowerCase()===f?null:y?{key:Wg+y,text:s?z(`newSession.cloneRowOn`,{source:y,machine:s.name}):z(`newSession.cloneRow`,{source:y})}:b?{key:b,text:b,checked:r.includes(b)}:null;return(0,V.jsx)(Um,{placeholder:z(s?`newSession.repoSearchRemote`:`newSession.repoSearch`),empty:s?.empty??z(`newSession.repoEmpty`),rows:s?.blocked?[]:[...g,..._],query:o,onQuery:e.onQuery,extra:s?.blocked?null:S,more:s?.blocked?[]:x,moreLabel:z(`newSession.githubGroup`),hint:s?void 0:z(`newSession.repoMultiHint`),onPick:(t,n)=>{if(t===`~scratch`)return e.ungrouped?.pick(),e.close();if(!t.startsWith(`clone:`))return e.onToggle(t,n);e.onClone(t.slice(6)),e.close()}})}function Kg(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 qg(e,t){return e?[e,...(t.extras??[]).map(e=>e.repo)]:[]}function Jg(e,t){return e?{...t.baseBranch?{[e]:t.baseBranch}:{},...Object.fromEntries((t.extras??[]).flatMap(e=>e.baseRef?[[e.repo,e.baseRef]]:[]))}:{}}function Yg(e){return[e.machine??``,e.repo??``,e.ungrouped?`u`:``,e.retryOf?.id??``,e.baseBranch??``,e.worktree===void 0?``:String(e.worktree)].join(`\0`)}function Xg(e,t){return e.retryOf&&e.engine&&e.engine===t?e.retryOf.id:void 0}async function Zg(e,t){try{let{task:n}=await e.client.request(`task.get`,{taskId:t.id});if(!n.prompt)return void I(z(`menu.retryNoPrompt`),`error`);F(Kg(t,{...n,prompt:n.prompt}))}catch(e){I(W(e),`error`)}}function Qg(e,t){let n=async n=>{await e.act(`task.archive`,{taskId:t.id,archived:!0,...n?{force:n}:{}}),I(G(`tasks`,`archive.done`,{title:t.label}))};C.set((0,V.jsx)(Ci,{title:z(`newSession.retryArchiveTitle`,{title:t.label}),body:z(`newSession.retryArchiveBody`),confirmLabel:G(`tasks`,`menu.archive`),onConfirm:()=>n(!1),escalate:{when:e=>e instanceof Ho&&e.code===`TASK_BUSY`,label:G(`tasks`,`archive.busyConfirm`),title:G(`tasks`,`archive.busyTitle`),body:()=>G(`tasks`,`archive.busyBody`,{title:t.label}),run:()=>n(!0)}}))}var $g=v([]),e_=()=>y($g);async function t_(e){$g.set((await e.request(`snippets.get`)).snippets)}async function n_(e,t){$g.set((await e.request(`snippets.save`,{name:t.name,text:t.text})).snippets)}async function r_(e,t){$g.set((await e.request(`snippets.remove`,{name:t})).snippets)}var i_=/^[A-Za-z0-9][\w-]{0,31}$/;function a_(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 o_(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 s_(e,t,n){return{text:e.slice(0,t.start)+n.text+e.slice(t.end),caret:t.start+n.text.length}}var c_=e=>e.split(`
|
|
43
43
|
`,1)[0]??``;function l_(e){return(0,V.jsx)(`ul`,{className:`${Dr} ${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:Or({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:[` `,c_(t.text)]})]})},t.name))})}function u_(e){let t=e_(),[n,r]=(0,h.useState)(0),[i,a]=(0,h.useState)(0),[o,s]=(0,h.useState)(null),c=(0,h.useRef)(null),l=a_(e.value,Math.min(n,e.value.length)),u=l?o_(t,l.query):[],d=l!==null&&u.length>0&&o!==l.start,f=Math.min(i,Math.max(0,u.length-1));(0,h.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=s_(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)(l_,{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())}}}}var d_=`relative hidden [border-top:var(--hairline)_solid_var(--line)] bg-surface px-3 pt-2.5 pb-3.5 touch:flex`,f_=`absolute inset-x-3 bottom-full z-5 mb-1`,p_=`absolute inset-x-3 bottom-full z-6 mb-1`,m_=`flex min-w-0 flex-1 items-center gap-2.5`,h_=`flex h-11 min-w-0 flex-1 items-center rounded-[12px] border-hairline border-line bg-inset focus-within:border-focus has-[textarea:disabled]:opacity-60`,g_=`h-full min-w-0 flex-1 resize-none bg-transparent py-0 pr-3.5 pl-3.5 font-sans text-display leading-[42px] text-ink outline-none [border:0] has-[+button]:pr-0`,__=`transition-transform duration-100 active:scale-94 motion-reduce:transition-none motion-reduce:active:scale-none`,v_=`transition-[scale,background-color,border-color,color] duration-150 active:scale-[0.98] motion-reduce:transition-none motion-reduce:active:scale-none`,y_=`flex size-11 shrink-0 items-center justify-center rounded-[12px] border-hairline border-accent text-accent touch-manipulation disabled:border-line disabled:text-muted disabled:opacity-60 ${__}`,b_=`flex size-11 shrink-0 cursor-pointer items-center justify-center rounded-[10px] touch-manipulation active:bg-inset disabled:opacity-60 has-[:disabled]:opacity-60 ${__}`,x_=`size-4.5 flex-none fill-none stroke-current stroke-[1.5] [stroke-linecap:round] [stroke-linejoin:round]`,S_=(e=!1)=>`${b_} -mr-1.5 -ml-3.25 ${e?`text-accent`:`text-muted`}`,C_=e=>`${b_} ${e?`text-accent`:`text-muted`}`,w_=(e,t)=>`relative z-6 flex h-11 min-w-0 flex-1 items-center gap-2.5 rounded-[12px] border-hairline px-3.5 font-sans touch-manipulation disabled:text-muted ${v_} ${t?`border-accent bg-accent text-paper`:e?`border-accent bg-accent-soft text-accent`:`border-line bg-inset text-ink`}`;function T_({d:e}){return(0,V.jsx)(`svg`,{viewBox:`0 0 16 16`,className:x_,"aria-hidden":`true`,children:(0,V.jsx)(`path`,{d:e})})}var E_=`M8 1.5a2.5 2.5 0 0 1 2.5 2.5v4.5a2.5 2.5 0 0 1-5 0V4A2.5 2.5 0 0 1 8 1.5zM3 8a5 5 0 0 0 10 0M8 13v1.5`,D_=`M8 13V3M3.5 7.5 8 3l4.5 4.5`;function O_(){return(0,V.jsx)(T_,{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 k_(e){return(0,V.jsxs)(`button`,{type:`submit`,className:y_,title:e.label,disabled:e.disabled,children:[(0,V.jsx)(`span`,{className:`sr-only`,children:e.label}),(0,V.jsx)(T_,{d:D_})]})}function A_(e,t){let n=(0,h.useRef)(e);e!==null&&(n.current=e);let r=e===null,[i,a]=(0,h.useState)(r);return(0,h.useEffect)(()=>{if(!r)return a(!1);let e=window.setTimeout(()=>a(!0),t);return()=>window.clearTimeout(e)},[r,t]),{shown:e??(i?null:n.current),leaving:r&&!i}}function j_(e){return typeof Intl.Segmenter==`function`?[...new Intl.Segmenter(void 0,{granularity:`word`}).segment(e)].map(e=>e.segment):e.split(/(\s+)/)}function M_({level:e,seconds:t,wide:n}){let r=n?120:80,i=(0,h.useRef)([]),a=(0,h.useRef)(-1);t!==a.current&&(a.current=t,i.current=[...i.current,e].slice(-r));let o=[...Array(r-i.current.length).fill(0),...i.current];return(0,V.jsx)(`span`,{className:`flex min-w-0 flex-1 items-center justify-end overflow-hidden ${n?`h-10 gap-[3px]`:`h-5.5 gap-[2.5px]`}`,"aria-hidden":`true`,children:o.map((e,t)=>(0,V.jsx)(`i`,{className:`block h-full flex-none rounded-full bg-current transition-transform duration-100 ease-linear motion-reduce:transition-none ${n?`w-[3px]`:`w-[2.5px]`}`,style:{transform:`scaleY(${Math.max(n?.08:.12,Math.min(1,e*10))})`}},t))})}function N_(){return(0,V.jsx)(`span`,{className:`inline-flex items-center gap-[3px] align-middle`,"aria-hidden":`true`,children:[0,160,320].map(e=>(0,V.jsx)(`i`,{className:`block size-1 rounded-full bg-current motion-safe:animate-dot`,style:{animationDelay:`${e}ms`}},e))})}var P_=`pointer-events-none absolute inset-x-0 bottom-full z-6 mb-2.5 flex min-h-17 origin-bottom items-center rounded-[16px] border-hairline bg-surface px-4 py-3 text-left shadow-dialog transition-colors duration-150`;function F_({bubble:e,leaving:t}){return(0,V.jsx)(`span`,{className:`${P_} ${t?`motion-safe:animate-sink-out`:`motion-safe:animate-bubble-in`} ${e.armed?`border-accent`:`border-line`}`,children:e.text?(0,V.jsx)(`span`,{className:`flex max-h-[5.8em] min-w-0 flex-1 flex-col justify-end overflow-hidden font-sans text-display leading-[1.45] transition-colors duration-150 motion-safe:animate-fade-in ${e.waiting?`text-muted`:`text-ink`}`,children:(0,V.jsx)(`span`,{children:j_(e.text).map((e,t)=>(0,V.jsx)(`span`,{className:`motion-safe:animate-fade-in`,children:e},t))})},`words`):(0,V.jsx)(`span`,{className:`flex min-w-0 flex-1 text-accent`,children:(0,V.jsx)(M_,{level:e.level,seconds:e.seconds,wide:!0})},`wave`)})}var I_=`flex min-w-0 flex-1 items-center gap-2.5 motion-safe:animate-fade-in`;function L_(e){let{state:t}=e,n=t.phase===`recording`,r=t.phase===`transcribing`,i=e.slide!==void 0,a=n&&t.held,o=(0,h.useRef)(``);n&&(o.current=t.partial);let{shown:s,leaving:c}=A_(i&&(a||(n||r)&&o.current!==``)?{text:o.current,armed:a&&t.armed,waiting:!a,level:t.level,seconds:t.seconds}:null,140),l=s&&(0,V.jsx)(F_,{bubble:s,leaving:c}),u=(0,V.jsxs)(`span`,{className:`${I_} justify-center gap-2 text-body`,children:[e.working.replace(/…$/,``),(0,V.jsx)(N_,{})]},`working`);return r||n&&i&&!a?(0,V.jsxs)(V.Fragment,{children:[l,u]}):n?(0,V.jsxs)(V.Fragment,{children:[l,(0,V.jsxs)(`span`,{className:I_,children:[(0,V.jsx)(`span`,{className:`size-2 flex-none rounded-full bg-current`,style:{opacity:.3+Math.min(1,t.level*10)*.7}}),(0,V.jsx)(`span`,{className:`flex-none font-mono text-body normal-nums`,children:t.time}),i?(0,V.jsxs)(`span`,{className:`ml-auto flex flex-none items-center gap-1 text-body motion-safe:animate-fade-in ${t.armed?`font-semibold`:`opacity-80`}`,children:[(0,V.jsx)(`svg`,{viewBox:`0 0 16 16`,className:`size-4 flex-none fill-none stroke-current stroke-[1.5]`,"aria-hidden":`true`,children:(0,V.jsx)(`path`,{d:D_})}),t.armed?e.release:e.slide]},String(t.armed)):t.partial?(0,V.jsx)(`span`,{className:`flex min-w-0 flex-1 justify-end overflow-hidden whitespace-nowrap text-meta`,children:t.partial}):(0,V.jsx)(M_,{level:t.level,seconds:t.seconds})]},`take`)]}):(0,V.jsxs)(V.Fragment,{children:[l,(0,V.jsxs)(`span`,{className:`${I_} justify-center gap-2 text-display`,children:[(0,V.jsx)(`span`,{className:`flex text-muted`,children:(0,V.jsx)(T_,{d:E_})}),e.idle]},`idle`)]})}function R_({state:e}){return e.phase===`recording`?(0,V.jsx)(`span`,{className:`font-mono text-meta normal-nums`,children:e.time}):e.phase===`transcribing`?(0,V.jsx)(`span`,{className:`font-mono text-meta`,children:`…`}):(0,V.jsx)(T_,{d:E_})}function z_(e){return e.hold?(0,V.jsx)(L_,{state:e.state,idle:e.idle,working:e.working}):(0,V.jsx)(R_,{state:e.state})}function B_(e){return(0,V.jsxs)(`form`,{className:d_,"data-composer":e.composerKey,onSubmit:t=>{t.preventDefault(),e.onSend()},children:[e.attached&&(0,V.jsx)(`div`,{className:f_,children:e.attached}),e.suggest&&(0,V.jsx)(`div`,{className:p_,children:e.suggest}),(0,V.jsxs)(`div`,{className:m_,children:[e.attach,e.voice??(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:h_,children:[(0,V.jsx)(`textarea`,{ref:e.fieldRef,className:g_,rows:1,value:e.value,placeholder:e.placeholder,disabled:e.busy,enterKeyHint:`send`,onChange:e.onChange,onSelect:e.onSelect,onKeyDown:e.onKeyDown,onPaste:e.onPaste,onBlur:e.onBlur}),e.dictate]}),(0,V.jsx)(k_,{label:e.sendLabel,disabled:e.busy||!e.ready})]})]})]})}var V_=`/dictation-worklet.js`,H_=60,U_=16e3,W_=.004,G_={phase:`idle`,seconds:0,level:0,error:null,partial:``},K_=1e3,q_=class{step;emitted=0;consumed=0;constructor(e){this.step=e}push(e){let t=e.reduce((e,t)=>e+t.length,0),n=new Float32Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;let i=this.consumed+t,a=[];for(let e=Math.floor(this.emitted*this.step);e<i;e=Math.floor(this.emitted*this.step)){let t=Math.max(-1,Math.min(1,n[e-this.consumed]??0));a.push(Math.round(t*32767)),this.emitted++}return this.consumed=i,Int16Array.from(a)}};function J_(e){let t=new Uint8Array(e.length*2),n=new DataView(t.buffer);for(let t=0;t<e.length;t++)n.setInt16(t*2,e[t],!0);return t}function Y_(e,t){let n=new q_(t/U_).push(e),r=Math.max(1,n.length),i=new Uint8Array(44+r*2),a=new DataView(i.buffer),o=(e,t)=>{for(let n=0;n<t.length;n++)a.setUint8(e+n,t.charCodeAt(n))};return o(0,`RIFF`),a.setUint32(4,36+r*2,!0),o(8,`WAVEfmt `),a.setUint32(16,16,!0),a.setUint16(20,1,!0),a.setUint16(22,1,!0),a.setUint32(24,U_,!0),a.setUint32(28,U_*2,!0),a.setUint16(32,2,!0),a.setUint16(34,16,!0),o(36,`data`),a.setUint32(40,r*2,!0),i.set(J_(n),44),i}function X_(e){for(let t of e.getTracks())t.stop();return null}function Z_(e){let t=Array(e.length);for(let n=0;n<e.length;n++)t[n]=e[n].toString(16).padStart(2,`0`);return t.join(``)}var Q_=class{client;scope;view=v(G_);stream=null;context=null;node=null;chunks=[];timer=null;capTimer=null;peak=0;recent=0;session=0;live=null;liveTimer=null;constructor(e,t){this.client=e,this.scope=t}get recording(){return this.view.get().phase===`recording`}async toggle(){return this.recording?this.stop():this.start()}async start(e=!1){if(this.view.get().phase!==`idle`&&this.view.get().phase!==`error`)return null;let t=++this.session;this.live=null,this.view.set({...G_,phase:`recording`});try{let n=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1,echoCancellation:!0,noiseSuppression:!0}});if(t!==this.session)return X_(n);this.stream=n;let r=new AudioContext;if(this.context=r,await r.audioWorklet.addModule(V_),t!==this.session)return null;let i=r.createMediaStreamSource(n);this.node=new AudioWorkletNode(r,`rove-capture`),this.chunks=[],this.peak=0,this.recent=0,this.node.port.onmessage=e=>{let t=e.data;this.chunks.push(t);let n=0;for(let e=0;e<t.length;e++)n+=t[e]*t[e];let r=Math.sqrt(n/Math.max(1,t.length));this.peak=Math.max(this.peak,r),this.recent=Math.max(this.recent,r)},i.connect(this.node);let a=r.createGain();a.gain.value=0,this.node.connect(a),a.connect(r.destination);let o=Date.now();return this.timer=window.setInterval(()=>{this.view.set({...this.view.get(),seconds:(Date.now()-o)/1e3,level:this.recent}),this.recent=0},100),this.capTimer=window.setTimeout(()=>void this.stop(),H_*1e3),e&&(this.live={id:`${Date.now().toString(36)}${Math.random().toString(36).slice(2,10)}`,resample:new q_(r.sampleRate/U_),sent:0,seq:0,inFlight:null,dead:!1},this.liveTimer=window.setInterval(()=>void this.pump(!1),K_)),null}catch(e){return t===this.session?(this.release(),this.fail(e),null):null}}async pump(e){let t=this.live;if(!t||t.dead||t.inFlight&&!e||(t.inFlight&&await t.inFlight.catch(()=>{}),t.dead))return null;let n=this.chunks.slice(t.sent);t.sent+=n.length;let r=t.seq++,i=r===0?this.scope():null,a=this.client.request(`voice.stream`,{session:t.id,seq:r,pcm:Z_(J_(t.resample.push(n))),final:e,...i?{context:i.draft,taskId:i.taskId,tabId:i.tabId}:{}});t.inFlight=a;try{let n=await a;if(e)return n;let r=this.view.get();this.live===t&&r.phase===`recording`&&typeof n.partial==`string`&&this.view.set({...r,partial:n.partial})}catch{t.dead=!0}finally{t.inFlight===a&&(t.inFlight=null)}return null}async stop(){if(this.view.get().phase!==`recording`)return null;let e=this.context?.sampleRate??U_,t=this.chunks;this.view.set({...this.view.get(),phase:`transcribing`,level:0}),this.release();let n=Y_(t,e),r=(n.length-44)/2/U_;if(r<.3||this.peak<W_)return this.live=null,this.view.set(G_),{text:``,seconds:r,ms:0,reason:`silent`};try{let e=this.live?await this.pump(!0):null;this.live=null;let t=e??await this.transcribeWhole(n);return this.view.set(G_),t}catch(e){return this.live=null,this.fail(e),null}}transcribeWhole(e){let t=this.scope();return this.client.request(`voice.transcribe`,{wav:Z_(e),context:t.draft,taskId:t.taskId,tabId:t.tabId})}fail(e){this.view.set({...G_,phase:`error`,error:e instanceof Error?e.message:String(e)})}cancel(){this.view.get().phase===`recording`&&(this.release(),this.live=null,this.view.set(G_))}release(){this.session++,this.timer!==null&&window.clearInterval(this.timer),this.capTimer!==null&&window.clearTimeout(this.capTimer),this.liveTimer!==null&&window.clearInterval(this.liveTimer),this.timer=null,this.capTimer=null,this.liveTimer=null,this.node?.port.close(),this.node=null;for(let e of this.stream?.getTracks()??[])e.stop();this.stream=null,this.context?.close().catch(()=>{}),this.context=null}},$_=e=>`0:${String(Math.floor(e)).padStart(2,`0`)}`,ev=300,tv=48,nv=()=>navigator.vibrate?.(8),rv=new WeakMap,iv=new WeakSet;function av(e){let t=rv.get(e);return t||(t=v(null),rv.set(e,t)),t}function ov(e,t){av(e).set(t)}var sv=e=>e.available??(e.ready===!0||(e.model??null)!==null);function cv(e){let t=av(e),n=y(t);return(0,h.useEffect)(()=>{iv.has(e)||(iv.add(e),e.onOpen(()=>{e.request(`voice.status`).then(e=>t.set(sv(e)),()=>t.set(!1))}))},[e,t]),n}var lv=e=>cu()&&av(e).get()!==!1;function uv(e){B();let t=(0,h.useRef)(e);t.current=e;let n=(0,h.useRef)(null);n.current===null&&(n.current=new Q_(e.client,()=>t.current.context()));let r=y(n.current.view),i=cv(e.client),a=(0,h.useRef)(null),o=(0,h.useRef)(!1),[s,c]=(0,h.useState)(null);(0,h.useEffect)(()=>()=>{a.current&&window.clearTimeout(a.current.timer),n.current?.cancel()},[]);let l=(e,n)=>{if(!e?.text)return;let{onSend:r,onText:i}=t.current;n&&r?r(e.text):i(e.text)},u=()=>void n.current?.toggle().then(e=>l(e,!1)),d=e=>{if(e.button!==0)return;e.currentTarget.setPointerCapture(e.pointerId);let t={y:e.clientY,timer:0,held:!1,armed:!1,started:null};(r.phase===`idle`||r.phase===`error`)&&(t.timer=window.setTimeout(()=>{t.held=!0,t.started=n.current?.start(!0)??null,c({armed:!1}),nv()},ev)),a.current=t},f=e=>{let n=a.current;if(!n?.held||!t.current.onSend)return;let r=n.y-e.clientY>tv;r!==n.armed&&(n.armed=r,c({armed:r}),nv())},p=async()=>{let e=a.current;if(a.current=null,e){if(window.clearTimeout(e.timer),o.current=e.held,!e.held)return t.current.onTap?void 0:u();c(null),await e.started,l(await n.current?.stop()??null,e.armed)}},m=async()=>{let e=a.current;a.current=null,e&&(window.clearTimeout(e.timer),e.held&&(c(null),await e.started,n.current?.cancel()))},g=r.phase===`recording`?z(s?`voice.release`:`voice.stop`,{time:$_(r.seconds)}):r.phase===`transcribing`?z(`voice.working`):e.idle??z(`voice.say`),_=r.phase===`recording`,v=s?.armed??!1;return i===!0?(0,V.jsx)(`button`,{type:`button`,className:`${(e.look??Yp)(_,v)} ${Xp}`,disabled:e.disabled||r.phase===`transcribing`,title:r.error??z(`voice.hint`),"aria-label":e.face?g:void 0,onPointerDown:d,onPointerMove:f,onPointerUp:()=>void p(),onPointerCancel:()=>void m(),onContextMenu:e=>e.preventDefault(),onClick:t=>{let n=o.current;if(o.current=!1,e.onTap)return n?void 0:e.onTap();t.detail===0&&u()},children:e.face?e.face({phase:r.phase,time:$_(r.seconds),seconds:r.seconds,level:r.level,held:s!==null,armed:v,partial:r.partial}):(0,V.jsxs)(V.Fragment,{children:[g,_&&(0,V.jsx)(`span`,{className:`inline-flex items-center`,"aria-hidden":`true`,children:(0,V.jsx)(`span`,{className:`size-1.5 rounded-full bg-current`,style:{opacity:.25+Math.min(1,r.level*12)*.75}})})]})}):null}function dv(e,t){P(e,void 0,t)}function fv(){P(void 0,void 0,void 0,void 0,!0)}var pv=`rove.web.newSession.worktree`;function mv({model:e,seed:t}){let n=t.repo;B();let r=y(e.selection).taskId,i=e.tasks.get()?.tasks.find(e=>e.id===r)?.repo,a=Ku(e,n??i,t.engine),o=Y(e,`repos.list`)?.repos,s=e=>t.ungrouped?void 0:(t.machine?void 0:n)??i??e?.[0],[c,l]=(0,h.useState)(o??[]),[u,d]=(0,h.useState)(()=>Y(e,`fs.subdirs`,{path:`~/`})?.home??``),[f,p]=(0,h.useState)(()=>qg(s(o),t)),[m,g]=(0,h.useState)(()=>Object.fromEntries(f.flatMap(t=>{let n=Y(e,`repo.probe`,{path:t});return n?[[t,n]]:[]}))),_=(0,h.useRef)(new Set),[v,b]=(0,h.useState)(t.ungrouped===!0),[x,S]=(0,h.useState)(null),C=()=>{b(!0),p([]),S(null)},[w,T]=(0,h.useState)(()=>Jg(s(o),t)),[E,D]=(0,h.useState)(``),[O,k]=(0,h.useState)(``),[A,ee]=(0,h.useState)(()=>(t.prompt!==void 0&&sg(t.prompt),og())),j=e=>{sg(e),ee(e)},[te,M]=(0,h.useState)(``),[P,F]=(0,h.useState)(!1),[ne,re]=(0,h.useState)(``),[ie,ae]=(0,h.useState)(()=>t.worktree??localStorage.getItem(pv)!==`0`),L=e=>{localStorage.setItem(pv,e?`1`:`0`),ae(e)},[oe,R]=(0,h.useState)(null),se=(0,h.useRef)(()=>{}),{attachments:ce,attach:le,remove:ue,ready:de,clear:fe}=au(e,R,ig),pe=(0,h.useRef)(null),me=cv(e.client),he=cu()&&me===!0,_e=e=>{let t=pe.current,n=t?.selectionStart??A.length,r=t?.selectionEnd??A.length,i=n>0&&!/\s$/.test(A.slice(0,n))?` `:``;j(`${A.slice(0,n)}${i}${e}${A.slice(r)}`);let a=n+i.length+e.length;requestAnimationFrame(()=>{he||t?.focus(),t?.setSelectionRange(a,a)})},ve=Gh(e,{machine:t.machine,repo:n},a),{machines:ye,machine:be,remote:xe,machineName:Se,remoteList:Ce,engineThere:we,shown:Te}=ve,{pick:Ee,setPick:De,base:Oe,setBase:ke}=ve,Ae=xe?null:Zl(e=>void le(e)),je=Te.engine;(0,h.useEffect)(()=>e.client.onOpen(()=>{Promise.all([Gu(e,`repos.list`),Gu(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:qg(r,t)),T(e=>({...e,...Jg(r,t)}))}).catch(()=>{})}),[e,n]);let Me=f.some(e=>m[e]?.git===!1),Ne=!xe&&(!ie||Me)&&f.length===1,Pe=f[0]??``;(0,h.useEffect)(()=>{for(let t of f)_.current.has(t)||(_.current.add(t),Gu(e,`repo.probe`,{path:t}).then(e=>g(n=>({...n,[t]:e}))).catch(()=>{}))},[e,f]),(0,h.useEffect)(()=>{lv(e.client)||pe.current?.focus()},[e.client]);let Fe=!xe&&!v&&!Ne,Ie=cg(Te,Fe),Le=a.engines.find(e=>e.id===je),Re=Te.engines.find(e=>e.id===je)?.name??je,ze=Du(Le,z(`newSession.modelDefault`)),Be=ze.some(e=>e.id===te)?te:``,Ve=async t=>{re(z(`newSession.cloning`,{source:t}));let n=yu(vu((localStorage.getItem(`rove.web.cloneParent`)||`~/`).trim(),u)),r=await e.client.request(`repo.clone`,{url:t,parentDir:n},re);return l(e=>e.includes(r.path)?e:[...e,r.path]),p([r.path]),S(null),r.path},He=async()=>{if(!Ee)return R(z(`newSession.needRepo`));if(!A.trim())return R(z(`newSession.needPrompt`));let n=Te.missing?.has(je)&ℜif(n)return R(z(`newSession.engineMissingOn`,{engine:n,machine:Se}));F(!0),re(Ee.clone?z(`newSession.cloningOn`,{source:qm(Ee.ref),machine:Se}):z(`newSession.startingOn`,{machine:Se}));try{let n=await Qh(e,{pick:Ee,machine:be,engine:je,prompt:A.trim(),baseRef:Oe,engineThere:we,model:Be});sg(``),N.set(null),n&&e.selectWhenListed(n),t.retryOf&&n&&Qg(e,t.retryOf)}catch(e){R(eg(e))}finally{F(!1),re(``)}},Ue=async n=>{if(se.current=()=>void Ue(n),R(null),xe)return He();if(!Pe&&!v&&!x)return R(z(`newSession.needRepo`));if(!A.trim())return R(z(`newSession.needPrompt`));F(!0);let r=eu(A.trim(),await de());try{let i=x?[await Ve(x)]:f,a=await Promise.all(i.map(t=>e.client.request(`repo.probe`,{path:t}))),o=a.find(e=>!e.ok);if(o)throw Error(o.reason??o.repo);let s=a.some(e=>e.git===!1);if(s&&a.length>1)throw Error(z(`newSession.plainMulti`));let c,l;if(v)c=await Iu(e.client.request.bind(e.client),je,A);else if(i.length===1&&!ie||s)c=await Lu(e.client.request.bind(e.client),a[0]?.repo??i[0]??``,je,A,r,n);else{let o=Xg(t,je),s=ve.auto&&!n&&i.length===1&&Ie.ids.length<=1&&ce.length===0&&!o,u=await e.client.request(`task.spawn`,{...Fu({repos:i.map((e,t)=>({repo:a[t]?.repo??e,baseRef:w[e]??``})),branch:E.trim(),engine:je,commandFrom:o,engines:n?[]:Ie.ids,prompt:r,...n?{at:n}:{},model:Be}),...s?{machine:Lh}:{}});u.machine&&I(z(`newSession.startedOn`,{machine:u.machine})),c=u.taskIds[0],l=u.groupId}n&&I(z(`newSession.laterSet`,{time:hg(n)})),sg(``),fe(),N.set(null),l?ge(l):c&&e.selectWhenListed(c),t.retryOf&&c&&Qg(e,t.retryOf)}catch(e){let t=ju(e);t?(sg(``),fe(),N.set(null),I(e instanceof Error?e.message:String(e),`error`),ge(t)):R(eg(e))}finally{F(!1),re(``)}},We=u_({value:A,onChange:j,area:pe,onEnter:()=>void Ue()}),Ge=e=>{ve.switchTo(e,Pe),k(``),R(null),b(!1)};return(0,V.jsxs)(`div`,{className:Pp,children:[(0,V.jsxs)(`div`,{className:Fp,children:[(0,V.jsx)(Ug,{}),(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 narrow:hidden`,children:z(`newSession.tagline`)})]}),(0,V.jsxs)(`form`,{className:Ip,onSubmit:e=>{e.preventDefault(),Ue()},children:[(0,V.jsxs)(`div`,{className:Rp,...Ae?.drop,children:[!xe&&(0,V.jsx)(ou,{attachments:ce,onRemove:ue}),(0,V.jsx)(`textarea`,{ref:pe,className:Bp,rows:4,spellCheck:!1,placeholder:z(`newSession.placeholder`),value:A,disabled:P,onPaste:Ae?.onPaste,...We.field}),We.list,(0,V.jsxs)(`div`,{className:zp,children:[Ae&&(0,V.jsxs)(Ql,{className:(he?S_:Wp)(ce.length>0),title:z(`newSession.attachHint`),disabled:P,onFiles:le,children:[(0,V.jsx)(`span`,{className:`sr-only`,children:z(`newSession.attach`)}),(0,V.jsx)(O_,{})]}),(0,V.jsx)(uv,{client:e.client,context:()=>({draft:[A.slice(-300),Pe,E,Ee?.ref??``].filter(Boolean).join(`
|
|
44
|
-
`)}),onText:_e,disabled:P,look:he?w_:Wp,idle:he?z(`voice.hold`):void 0,face:e=>(0,V.jsx)(z_,{state:e,hold:he,idle:z(`voice.hold`),working:z(`voice.working`)})}),!he&&(0,V.jsx)(`span`,{className:`flex-1`}),(0,V.jsx)(`button`,{type:`submit`,className:`${br()} self-stretch`,disabled:P,children:z(`newSession.start`)})]})]}),(0,V.jsxs)(`div`,{className:Vp,children:[(0,V.jsxs)(`div`,{className:Hp,children:[ye.length>0&&(0,V.jsx)(Yh,{machines:ye,value:ve.auto?`auto`:be,onPick:Ge}),(0,V.jsx)(Hm,{field:`repo`,title:!xe&&f.length>1?z(`newSession.repoCount`,{count:f.length}):z(`newSession.repo`),label:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(fm,{}),(0,V.jsx)(`span`,{className:am,children:(xe?Ee?.clone?qm(Ee.ref):Mu(Ee?[Ee.ref]:[]):x?qm(x):Mu(f))||z(v?`newSession.noFolder`:`newSession.repo`)})]}),children:t=>(0,V.jsx)(Gg,{model:e,saved:xe?Ce.repos.map(Jm):c,picked:xe?Ee?[Ee.ref]:[]:f,primary:xe?``:Pe,home:xe?``:u,query:O,onQuery:k,onToggle:(e,n)=>{if(R(null),!xe)return b(!1),S(null),n?p(t=>Nu(t,e)):(p([e]),t());De({ref:e,clone:!1}),t()},onClone:e=>{if(R(null),xe)return De({ref:e,clone:!0});S(e),p([]),b(!1),k(``)},cloning:xe?void 0:x??void 0,close:t,remote:xe?{name:Se,empty:qh(be,Ce),blocked:Ce.problem!==``}:void 0,ungrouped:xe?void 0:{on:v,pick:C}})}),(0,V.jsx)(ng,{remote:xe,remotePick:Ee,remoteBase:Oe,onRemoteBase:ke,ungrouped:v,inPlace:Ne,plain:Me,onToggleWorktree:()=>L(!ie),repos:f,probes:m,bases:w,onBase:(e,t)=>T(n=>({...n,[e]:t})),branchName:E,onBranchName:D})]}),(0,V.jsxs)(`div`,{className:Up,children:[(0,V.jsx)(lg,{choice:Te,picks:Ie,available:Fe,missing:Te.missing}),!Ne&&!(xe&&we)&&!v&&!Ie.comparing&&ze.length>0&&(0,V.jsx)(ug,{models:ze,model:Be,onModel:M}),(0,V.jsx)(_g,{busy:P,onLater:!xe&&!v&&!Ie.comparing?e=>void Ue(e):void 0,onInvalid:R,agentPlace:xe?{machine:Se,there:we,onPick:ve.setEngineThere}:void 0})]})]}),(0,V.jsx)($h,{progress:P?ne:``,error:oe,busy:P,onRetry:()=>se.current()})]})]})}var hv=[`needs`,`working`,`ready`,`idle`],gv=`~state:`;function _v(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 vv=e=>e&&e.kind!==`main`&&!Td(e)?od(e.repo):void 0;function yv(e,t){let n=Ed(e,t.sort),{children:r,nested:i}=jd([{repo:``,label:``,tasks:n}]),a=n.filter(e=>!i.has(e.id)),o=pd(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=fd(e),n=((t===null?void 0:o.get(t))??[e]).map(s),r=n.flat().map(_v).reduce((e,t)=>hv.indexOf(t)<hv.indexOf(e)?t:e);for(let e of n)for(let t of e)c.set(t.id,r)}return hv.flatMap(e=>{let t=n.filter(t=>c.get(t.id)===e);return t.length===0?[]:[{repo:``,label:z(`rail.state.${e}`),key:`${gv}${e}`,tasks:t}]})}function bv(e){let t=new Set(e.machines.map(e=>e.alias));return{rows:xv(Pd(yv([...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:${gv}`.length);return{id:`state:${t}`,kind:`state`,state:t,label:e.label,count:0}})),groups:[]}}function xv(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 Sv=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 Cv(e){return e&&Sv.has(e)?`machines.reason.${e}`:null}function wv(e,t){return e.filter(e=>e.machine?.id===t&&!e.routine&&!e.deleting)}function Tv(e){let t=hv.map(e=>({state:e,tasks:[]}));for(let n of e)t[hv.indexOf(_v(n))]?.tasks.push(n);return t.filter(e=>e.tasks.length>0)}var Ev=`flex flex-col font-mono text-meta`,Dv=`flex flex-col gap-1 border-t-hairline border-line py-2.5 first:border-t-0 first:pt-0`,Ov=`flex flex-wrap items-baseline gap-x-2.5 gap-y-0.5`,kv=`min-w-0 text-ink wrap-anywhere`,Av=`m-0 text-muted wrap-anywhere`,jv=`flex flex-wrap gap-x-3.5 gap-y-1 pt-0.5 whitespace-nowrap`,Mv=`mt-1.5 mb-0.5 text-subtle`,Nv=`flex min-w-0 items-baseline gap-2 pl-2`,Pv=`min-w-0 flex-1 truncate text-left`,Fv=`min-w-0 max-w-[55%] flex-none truncate text-muted`;function Iv(e){C.set((0,V.jsx)(Bv,{model:e}))}function Lv({model:e,tasks:t}){let n=t=>{R(),e.select(t.id),pe()};return Tv(t).map(e=>(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`p`,{className:`${Mv} m-0`,children:z(`rail.state.${e.state}`)}),e.tasks.map(e=>(0,V.jsxs)(H,{variant:`row`,className:`${Nv} w-full rounded-sm py-0.5 hover:bg-hover`,onClick:()=>n(e),children:[(0,V.jsx)(`span`,{className:Pv,children:e.label}),(0,V.jsx)(`span`,{className:Fv,children:e.branch})]},e.id))]},e.state))}function Rv({model:e,alias:t}){let[n,r]=(0,h.useState)(null);return(0,h.useEffect)(()=>{let n=!0;return Gu(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:Av,children:z(`machines.reposFailed`,{message:n.failed})}):n.reason?(0,V.jsx)(`p`,{className:Av,children:z(`machines.reposFailed`,{message:n.message??n.reason})}):n.repos.length===0?(0,V.jsx)(`p`,{className:Av,children:z(`machines.noRepos`)}):n.repos.map(e=>(0,V.jsxs)(`div`,{className:Nv,children:[(0,V.jsx)(`span`,{className:Pv,children:e.id}),(0,V.jsx)(`span`,{className:Fv,title:e.primary??e.checkouts[0],children:e.primary??e.checkouts[0]??``})]},e.id)):(0,V.jsx)(`p`,{className:Av,children:z(`machines.loading`)})}function zv(e){let{model:t,row:n,tasks:r,words:i}=e,[a,o]=(0,h.useState)(null),s=n.state===`online`,c=Cv(n.reason),l=Tv(r).map(e=>`${e.tasks.length} ${z(`rail.state.${e.state}`)}`),u=e=>o(a===e?null:e);return(0,V.jsxs)(`section`,{className:Dv,children:[(0,V.jsxs)(`div`,{className:Ov,children:[(0,V.jsx)(`span`,{className:`${kv} ${s?``:tp.warning}`,children:Im(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:jv,children:[s&&(0,V.jsx)(H,{hit:`tight`,onClick:()=>{R(),dv(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)(Lv,{model:t,tasks:r}),a===`repos`&&(0,V.jsx)(Rv,{model:t,alias:n.alias})]})}function Bv({model:e}){let t=B(),n=Vm(e),r=y(e.remote),i=(t===`zh`?Wi:Ui).machine;return(0,V.jsx)(bi,{title:z(`machines.title`),wide:!0,children:(0,V.jsxs)(`div`,{className:`${Wr} ${Ev}`,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)(zv,{model:e,row:t,tasks:wv(r,t.alias),words:i},t.alias))]})})}function Vv(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 Hv=`mx-1.5 mt-2 mb-0.5 font-mono text-meta font-semibold normal-nums text-subtle first:mt-0`,Uv=`mx-1.5 my-1 text-meta text-muted [overflow-wrap:anywhere]`,Wv=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`:``}`,Gv=`flex min-w-0 items-baseline gap-2`,Kv=`min-w-0 flex-1 truncate text-body`,qv=`whitespace-nowrap text-meta text-muted`,Jv=`text-meta text-muted [overflow-wrap:anywhere]`,Yv=`rounded-xs bg-accent/25 text-ink`;function Xv(e,t){let[n,r]=(0,h.useState)({kind:`idle`});return(0,h.useEffect)(()=>{let n=Vv(t=>e.client.request(`sessions.search`,{query:t}),r);return n.run(t),n.stop},[e,t]),n}function Zv(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:Yv,children:e.hit},e.at))}function Qv({children:e}){return(0,V.jsx)(`h3`,{className:Hv,children:e})}function $v({children:e,error:t}){return(0,V.jsx)(`p`,{className:`${Uv} ${t?`text-error`:``}`,children:e})}function ey(e){return(0,V.jsx)(H,{variant:`row`,className:Wv(e.selected),onMouseEnter:e.onHover,onClick:e.onOpen,children:(0,V.jsxs)(`span`,{className:Gv,children:[(0,V.jsx)(`span`,{className:Kv,children:e.title}),(0,V.jsx)(`span`,{className:qv,children:e.repo})]})})}function ty(e){let{hit:t}=e;return(0,V.jsxs)(H,{variant:`row`,className:Wv(e.selected),onMouseEnter:e.onHover,onClick:e.onOpen,children:[(0,V.jsxs)(`span`,{className:Gv,children:[(0,V.jsx)(`span`,{className:Kv,children:t.title}),(0,V.jsxs)(`span`,{className:qv,children:[z(t.role===`user`?`search.you`:`search.agent`),` · `,Ml(Date.now()-Date.parse(t.at))]})]}),(0,V.jsx)(`span`,{className:Jv,children:Zv(t.snippet,e.query)})]})}async function ny(e,t){let{taskId:n}=await e.client.request(`task.openScratch`);await ed(e,n,{kind:`engine`,prompt:t}),R()}function ry(e){return ny(e,z(`settings.feedback.reportPrompt`))}var iy=v(`issues`);function ay(e,t,n){return{repo:e.repo,baseBranch:t,prompt:n,worktree:!0}}function oy(e){let t=e.todos;return!t||t.length===0?null:{done:t.filter(e=>e.done).length,total:t.length}}function sy(e){return(e.todos??[]).filter(e=>!e.done)}var cy=/LAND_CONFLICT/,ly=/MAIN_CHECKOUT_DIRTY/,uy=/SYNC_CONFLICT(?:: )?(.*)/,dy=/SYNC_WORKTREE_DIRTY(?:: )?(.*)/;function fy(e){let t=W(e);return cy.test(t)?G(`worktrees`,`land.conflict`,{files:t}):ly.test(t)?G(`worktrees`,`land.dirtyBase`):G(`worktrees`,`land.failed`,{error:t})}async function py(e,t,n){if(t.machine){my(e,t,t.machine.label,n);return}let r;try{r=await e.client.request(`task.landPreflight`,{taskId:t.id})}catch(e){I(G(`worktrees`,`land.failed`,{error:W(e)}),`error`);return}if(r.refusal){I(r.refusal===`MAIN_CHECKOUT_DIRTY`?G(`worktrees`,`land.dirtyBase`):G(`worktrees`,`land.failed`,{error:r.message??r.refusal}),`error`);return}let i=t.branch||t.title,a=sy(e.tasks.get()?.tasks.find(e=>e.id===t.id)??{}).length;C.set((0,V.jsx)(Ci,{title:G(`worktrees`,`land.confirmTitle`),body:[G(`worktrees`,r.ahead===1?`land.confirmBodyOne`:`land.confirmBody`,{branch:i,landedOn:r.landedOn,commits:r.ahead??`?`}),...a>0?[z(`files.landTodos`,{count:a})]:[]].join(`
|
|
44
|
+
`)}),onText:_e,disabled:P,look:he?w_:Wp,idle:he?z(`voice.hold`):void 0,face:e=>(0,V.jsx)(z_,{state:e,hold:he,idle:z(`voice.hold`),working:z(`voice.working`)})}),!he&&(0,V.jsx)(`span`,{className:`flex-1`}),he&&(0,V.jsx)(k_,{label:z(`newSession.start`),disabled:P}),!he&&(0,V.jsx)(`button`,{type:`submit`,className:br(),disabled:P,children:z(`newSession.start`)})]})]}),(0,V.jsxs)(`div`,{className:Vp,children:[(0,V.jsxs)(`div`,{className:Hp,children:[ye.length>0&&(0,V.jsx)(Yh,{machines:ye,value:ve.auto?`auto`:be,onPick:Ge}),(0,V.jsx)(Hm,{field:`repo`,title:!xe&&f.length>1?z(`newSession.repoCount`,{count:f.length}):z(`newSession.repo`),label:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(fm,{}),(0,V.jsx)(`span`,{className:am,children:(xe?Ee?.clone?qm(Ee.ref):Mu(Ee?[Ee.ref]:[]):x?qm(x):Mu(f))||z(v?`newSession.noFolder`:`newSession.repo`)})]}),children:t=>(0,V.jsx)(Gg,{model:e,saved:xe?Ce.repos.map(Jm):c,picked:xe?Ee?[Ee.ref]:[]:f,primary:xe?``:Pe,home:xe?``:u,query:O,onQuery:k,onToggle:(e,n)=>{if(R(null),!xe)return b(!1),S(null),n?p(t=>Nu(t,e)):(p([e]),t());De({ref:e,clone:!1}),t()},onClone:e=>{if(R(null),xe)return De({ref:e,clone:!0});S(e),p([]),b(!1),k(``)},cloning:xe?void 0:x??void 0,close:t,remote:xe?{name:Se,empty:qh(be,Ce),blocked:Ce.problem!==``}:void 0,ungrouped:xe?void 0:{on:v,pick:C}})}),(0,V.jsx)(ng,{remote:xe,remotePick:Ee,remoteBase:Oe,onRemoteBase:ke,ungrouped:v,inPlace:Ne,plain:Me,onToggleWorktree:()=>L(!ie),repos:f,probes:m,bases:w,onBase:(e,t)=>T(n=>({...n,[e]:t})),branchName:E,onBranchName:D})]}),(0,V.jsxs)(`div`,{className:Up,children:[(0,V.jsx)(lg,{choice:Te,picks:Ie,available:Fe,missing:Te.missing}),!Ne&&!(xe&&we)&&!v&&!Ie.comparing&&ze.length>0&&(0,V.jsx)(ug,{models:ze,model:Be,onModel:M}),(0,V.jsx)(_g,{busy:P,onLater:!xe&&!v&&!Ie.comparing?e=>void Ue(e):void 0,onInvalid:R,agentPlace:xe?{machine:Se,there:we,onPick:ve.setEngineThere}:void 0})]})]}),(0,V.jsx)($h,{progress:P?ne:``,error:oe,busy:P,onRetry:()=>se.current()})]})]})}var hv=[`needs`,`working`,`ready`,`idle`],gv=`~state:`;function _v(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 vv=e=>e&&e.kind!==`main`&&!Td(e)?od(e.repo):void 0;function yv(e,t){let n=Ed(e,t.sort),{children:r,nested:i}=jd([{repo:``,label:``,tasks:n}]),a=n.filter(e=>!i.has(e.id)),o=pd(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=fd(e),n=((t===null?void 0:o.get(t))??[e]).map(s),r=n.flat().map(_v).reduce((e,t)=>hv.indexOf(t)<hv.indexOf(e)?t:e);for(let e of n)for(let t of e)c.set(t.id,r)}return hv.flatMap(e=>{let t=n.filter(t=>c.get(t.id)===e);return t.length===0?[]:[{repo:``,label:z(`rail.state.${e}`),key:`${gv}${e}`,tasks:t}]})}function bv(e){let t=new Set(e.machines.map(e=>e.alias));return{rows:xv(Pd(yv([...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:${gv}`.length);return{id:`state:${t}`,kind:`state`,state:t,label:e.label,count:0}})),groups:[]}}function xv(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 Sv=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 Cv(e){return e&&Sv.has(e)?`machines.reason.${e}`:null}function wv(e,t){return e.filter(e=>e.machine?.id===t&&!e.routine&&!e.deleting)}function Tv(e){let t=hv.map(e=>({state:e,tasks:[]}));for(let n of e)t[hv.indexOf(_v(n))]?.tasks.push(n);return t.filter(e=>e.tasks.length>0)}var Ev=`flex flex-col font-mono text-meta`,Dv=`flex flex-col gap-1 border-t-hairline border-line py-2.5 first:border-t-0 first:pt-0`,Ov=`flex flex-wrap items-baseline gap-x-2.5 gap-y-0.5`,kv=`min-w-0 text-ink wrap-anywhere`,Av=`m-0 text-muted wrap-anywhere`,jv=`flex flex-wrap gap-x-3.5 gap-y-1 pt-0.5 whitespace-nowrap`,Mv=`mt-1.5 mb-0.5 text-subtle`,Nv=`flex min-w-0 items-baseline gap-2 pl-2`,Pv=`min-w-0 flex-1 truncate text-left`,Fv=`min-w-0 max-w-[55%] flex-none truncate text-muted`;function Iv(e){C.set((0,V.jsx)(Bv,{model:e}))}function Lv({model:e,tasks:t}){let n=t=>{R(),e.select(t.id),pe()};return Tv(t).map(e=>(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`p`,{className:`${Mv} m-0`,children:z(`rail.state.${e.state}`)}),e.tasks.map(e=>(0,V.jsxs)(H,{variant:`row`,className:`${Nv} w-full rounded-sm py-0.5 hover:bg-hover`,onClick:()=>n(e),children:[(0,V.jsx)(`span`,{className:Pv,children:e.label}),(0,V.jsx)(`span`,{className:Fv,children:e.branch})]},e.id))]},e.state))}function Rv({model:e,alias:t}){let[n,r]=(0,h.useState)(null);return(0,h.useEffect)(()=>{let n=!0;return Gu(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:Av,children:z(`machines.reposFailed`,{message:n.failed})}):n.reason?(0,V.jsx)(`p`,{className:Av,children:z(`machines.reposFailed`,{message:n.message??n.reason})}):n.repos.length===0?(0,V.jsx)(`p`,{className:Av,children:z(`machines.noRepos`)}):n.repos.map(e=>(0,V.jsxs)(`div`,{className:Nv,children:[(0,V.jsx)(`span`,{className:Pv,children:e.id}),(0,V.jsx)(`span`,{className:Fv,title:e.primary??e.checkouts[0],children:e.primary??e.checkouts[0]??``})]},e.id)):(0,V.jsx)(`p`,{className:Av,children:z(`machines.loading`)})}function zv(e){let{model:t,row:n,tasks:r,words:i}=e,[a,o]=(0,h.useState)(null),s=n.state===`online`,c=Cv(n.reason),l=Tv(r).map(e=>`${e.tasks.length} ${z(`rail.state.${e.state}`)}`),u=e=>o(a===e?null:e);return(0,V.jsxs)(`section`,{className:Dv,children:[(0,V.jsxs)(`div`,{className:Ov,children:[(0,V.jsx)(`span`,{className:`${kv} ${s?``:tp.warning}`,children:Im(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:jv,children:[s&&(0,V.jsx)(H,{hit:`tight`,onClick:()=>{R(),dv(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)(Lv,{model:t,tasks:r}),a===`repos`&&(0,V.jsx)(Rv,{model:t,alias:n.alias})]})}function Bv({model:e}){let t=B(),n=Vm(e),r=y(e.remote),i=(t===`zh`?Wi:Ui).machine;return(0,V.jsx)(bi,{title:z(`machines.title`),wide:!0,children:(0,V.jsxs)(`div`,{className:`${Wr} ${Ev}`,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)(zv,{model:e,row:t,tasks:wv(r,t.alias),words:i},t.alias))]})})}function Vv(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 Hv=`mx-1.5 mt-2 mb-0.5 font-mono text-meta font-semibold normal-nums text-subtle first:mt-0`,Uv=`mx-1.5 my-1 text-meta text-muted [overflow-wrap:anywhere]`,Wv=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`:``}`,Gv=`flex min-w-0 items-baseline gap-2`,Kv=`min-w-0 flex-1 truncate text-body`,qv=`whitespace-nowrap text-meta text-muted`,Jv=`text-meta text-muted [overflow-wrap:anywhere]`,Yv=`rounded-xs bg-accent/25 text-ink`;function Xv(e,t){let[n,r]=(0,h.useState)({kind:`idle`});return(0,h.useEffect)(()=>{let n=Vv(t=>e.client.request(`sessions.search`,{query:t}),r);return n.run(t),n.stop},[e,t]),n}function Zv(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:Yv,children:e.hit},e.at))}function Qv({children:e}){return(0,V.jsx)(`h3`,{className:Hv,children:e})}function $v({children:e,error:t}){return(0,V.jsx)(`p`,{className:`${Uv} ${t?`text-error`:``}`,children:e})}function ey(e){return(0,V.jsx)(H,{variant:`row`,className:Wv(e.selected),onMouseEnter:e.onHover,onClick:e.onOpen,children:(0,V.jsxs)(`span`,{className:Gv,children:[(0,V.jsx)(`span`,{className:Kv,children:e.title}),(0,V.jsx)(`span`,{className:qv,children:e.repo})]})})}function ty(e){let{hit:t}=e;return(0,V.jsxs)(H,{variant:`row`,className:Wv(e.selected),onMouseEnter:e.onHover,onClick:e.onOpen,children:[(0,V.jsxs)(`span`,{className:Gv,children:[(0,V.jsx)(`span`,{className:Kv,children:t.title}),(0,V.jsxs)(`span`,{className:qv,children:[z(t.role===`user`?`search.you`:`search.agent`),` · `,Ml(Date.now()-Date.parse(t.at))]})]}),(0,V.jsx)(`span`,{className:Jv,children:Zv(t.snippet,e.query)})]})}async function ny(e,t){let{taskId:n}=await e.client.request(`task.openScratch`);await ed(e,n,{kind:`engine`,prompt:t}),R()}function ry(e){return ny(e,z(`settings.feedback.reportPrompt`))}var iy=v(`issues`);function ay(e,t,n){return{repo:e.repo,baseBranch:t,prompt:n,worktree:!0}}function oy(e){let t=e.todos;return!t||t.length===0?null:{done:t.filter(e=>e.done).length,total:t.length}}function sy(e){return(e.todos??[]).filter(e=>!e.done)}var cy=/LAND_CONFLICT/,ly=/MAIN_CHECKOUT_DIRTY/,uy=/SYNC_CONFLICT(?:: )?(.*)/,dy=/SYNC_WORKTREE_DIRTY(?:: )?(.*)/;function fy(e){let t=W(e);return cy.test(t)?G(`worktrees`,`land.conflict`,{files:t}):ly.test(t)?G(`worktrees`,`land.dirtyBase`):G(`worktrees`,`land.failed`,{error:t})}async function py(e,t,n){if(t.machine){my(e,t,t.machine.label,n);return}let r;try{r=await e.client.request(`task.landPreflight`,{taskId:t.id})}catch(e){I(G(`worktrees`,`land.failed`,{error:W(e)}),`error`);return}if(r.refusal){I(r.refusal===`MAIN_CHECKOUT_DIRTY`?G(`worktrees`,`land.dirtyBase`):G(`worktrees`,`land.failed`,{error:r.message??r.refusal}),`error`);return}let i=t.branch||t.title,a=sy(e.tasks.get()?.tasks.find(e=>e.id===t.id)??{}).length;C.set((0,V.jsx)(Ci,{title:G(`worktrees`,`land.confirmTitle`),body:[G(`worktrees`,r.ahead===1?`land.confirmBodyOne`:`land.confirmBody`,{branch:i,landedOn:r.landedOn,commits:r.ahead??`?`}),...a>0?[z(`files.landTodos`,{count:a})]:[]].join(`
|
|
45
45
|
|
|
46
46
|
`),confirmLabel:G(`worktrees`,`land.button`),onConfirm:async()=>{try{let r=await e.client.request(`task.land`,{taskId:t.id});I(G(`worktrees`,`land.done`,{branch:i,landedOn:r.landedOn,commit:r.commit.slice(0,8)})),n?.()}catch(e){throw Error(fy(e))}}}))}function my(e,t,n,r){let i=t.branch||t.title;C.set((0,V.jsx)(Ci,{title:z(`taskops.publishTitle`),body:z(`taskops.publishBody`,{branch:i,host:n}),confirmLabel:z(`taskops.publishButton`),onConfirm:async()=>{let n=await e.client.request(`task.land`,{taskId:t.id}),a=n.published?.prUrl;a?I(z(`taskops.publishedPr`,{branch:i,url:a})):I(z(`taskops.publishedNoPr`,{branch:i,reason:gy(n.published?.prError??``)}),`error`),r?.()}}))}async function hy(e,t){try{let n=await e.client.request(`task.syncBase`,{taskId:t});I(G(`tasks`,n.alreadyCurrent?`sync.alreadyCurrent`:`sync.done`,{base:n.baseRef}))}catch(e){let t=W(e),n=uy.exec(t),r=dy.exec(t);I(n?G(`tasks`,`sync.conflict`,{files:n[1]?.trim()||`?`}):r?G(`tasks`,`sync.dirty`,{files:r[1]?.trim()||`?`}):G(`tasks`,`sync.failed`,{error:t}),`error`)}}function gy(e){return e.split(`
|
|
47
47
|
`).find(e=>e.trim().length>0)?.trim()??e.trim()}async function _y(e,t,n){try{let r=await e.client.request(`task.fixChecks`,e.engineTarget(t));r.outcome===`unavailable`?I(G(`files`,`toast.ciChecksUnavailable`,{detail:gy(r.detail??``)}),`error`):r.outcome===`none`?I(G(`files`,`toast.ciNoFailingChecks`),`error`):I(n)}catch(e){I(W(e),`error`)}}async function vy(e,t){try{let n=await e.client.request(`task.openEditor`,{taskId:t});n.outcome===`noEditor`?I(G(`tasks`,`toast.noEditor`),`error`):n.outcome===`failed`&&I(G(`tasks`,`toast.openWorktreeFailed`,{label:n.label??``}),`error`)}catch(e){I(hm(e)?G(`tasks`,`toast.noDiskSpace`):G(`tasks`,`toast.worktreeErrorGeneric`,{message:W(e)}),`error`)}}function yy(e,t){let n=e.tasks.get();return[...n?.tasks??[],...n?.archived??[]].filter(e=>e.parentTaskId===t)}function by(e,t){let n=yy(e,t.id),r=n.length>0,i=n=>e.act(`task.delete`,{taskId:t.id,...n}).then(()=>{}),a=e=>`${G(`worktrees`,`delete.forceBody`,{branch:t.branch||t.title})}\n\n${G(`worktrees`,`delete.forceReason`,{reason:W(e).replace(`task ${t.id} `,``)})}`,o=async e=>{i(e).catch(n=>{if(e.force||!(n instanceof Ho)||n.code!==`DIRTY_WORKTREE`){I(W(n),`error`);return}C.set((0,V.jsx)(Ci,{title:G(`tasks`,`confirm.forceDeleteTitle`,{title:t.label}),body:a(n),confirmLabel:G(`tasks`,`confirm.forceDeleteConfirm`),onConfirm:()=>o({...e,force:!0})}))})};return(0,V.jsx)(Ci,{title:r?G(`tasks`,`confirm.childrenTitle`,{title:t.label,count:String(n.length)}):G(`tasks`,t.kind===`dir`?`confirm.deleteTitleDir`:`confirm.deleteTitle`,{title:t.label}),body:r?G(`tasks`,`confirm.childrenBody`):G(`tasks`,t.kind===`dir`?`confirm.deleteBodyDir`:`confirm.deleteBodyTask`),confirmLabel:G(`tasks`,r?`confirm.childrenPromote`:`confirm.deleteConfirm`),onConfirm:()=>o({}),...r?{secondary:{label:G(`tasks`,`confirm.childrenCascade`),onConfirm:()=>o({cascade:!0})}}:{}})}function xy(e,t){let n=yy(e,t.id),r=n.length>0,i=t.label,a=async()=>{let{tabs:n}=await e.client.request(`task.tabs`,{taskId:t.id});for(let r of n)await e.closeTab(t.id,r.id)},o,s=async t=>{for(let r of n)try{await e.act(`task.delete`,{taskId:r.id,cascade:!0,...t?{force:!0}:{}})}catch(e){throw o=r.title,e}await a()};return(0,V.jsx)(Ci,{title:r?G(`tasks`,`confirm.childrenTitle`,{title:i,count:String(n.length)}):G(`tasks`,`confirm.deleteTitleDir`,{title:i}),body:G(`tasks`,r?`confirm.childrenBodyMain`:`confirm.deleteBodyMain`),confirmLabel:G(`tasks`,r?`confirm.childrenKeepMain`:`confirm.deleteConfirm`),onConfirm:a,...r?{secondary:{label:G(`tasks`,`confirm.childrenCascadeMain`),onConfirm:()=>s(!1)}}:{},escalate:{when:e=>e instanceof Ho&&e.code===`DIRTY_WORKTREE`,label:G(`tasks`,`confirm.forceDeleteConfirm`),title:G(`tasks`,`confirm.forceDeleteTitle`,{title:i}),body:e=>`${G(`worktrees`,`delete.forceBody`,{branch:o??i})}\n\n${W(e)}`,run:()=>s(!0)}})}async function Sy(e,t){let n=t.archived!==!0,r=t.label,i=async i=>{await e.act(`task.archive`,{taskId:t.id,archived:n,...i?{force:!0}:{}}),I(G(`tasks`,n?`archive.done`:`archive.restored`,{title:r}))};try{await i(!1)}catch(e){if(n&&e instanceof Ho&&e.code===`TASK_BUSY`){C.set((0,V.jsx)(Ci,{title:G(`tasks`,`archive.busyTitle`),body:G(`tasks`,`archive.busyBody`,{title:r}),confirmLabel:G(`tasks`,`archive.busyConfirm`),onConfirm:()=>i(!0)}));return}I(G(`tasks`,n?`archive.failed`:`archive.restoreFailed`,{error:W(e)}),`error`)}}function Cy(e,t,n){return(0,V.jsx)(Ci,{title:G(`tasks`,`confirm.forgetProjectTitle`,{title:n}),body:G(`tasks`,`confirm.forgetProjectBody`),confirmLabel:G(`tasks`,`confirm.forgetProjectConfirm`),onConfirm:async()=>{try{await e.client.request(`project.forget`,{repo:t})}catch(e){throw Error(G(`tasks`,`toast.forgetProjectFailed`,{error:W(e)}))}}})}var wy=v(null),Ty=0;function Ey(e,t){wy.set({taskId:e,hit:t,nonce:++Ty}),Fc(e,`chat`),j.get()&&j.set(!1)}var Dy=10;function Oy(e,t){let n=e=>e.surface===t?0:e.surface?1:2,r=wo().filter(n=>To(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:Sl(e.id),raw:e.prefix?`${ha()} + ${t}`:t}))}return a}function ky(e){let t=document.activeElement instanceof HTMLElement?document.activeElement:null;C.set((0,V.jsx)(jy,{model:e,surface:Do(),origin:t}))}var Ay=8;function jy({model:e,surface:t,origin:n}){B();let[r,i]=(0,h.useState)(``),[a,o]=(0,h.useState)(0),s=(0,h.useRef)(null),c=y(ua),l=y(e.tasks),u=y(e.remote),d=(0,h.useMemo)(()=>Oy(e,t),[e,t,c]).filter(e=>ll(r,e.name,e.raw)),f=(Vm(e).length>0?[{name:z(`machines.title`)}]:[]).filter(e=>ll(r,e.name,``)),p=[{name:z(`settings.feedback.report`)}].filter(e=>ll(r,e.name,``)),m=r.trim(),g=m===``?[]:[...l?.tasks??[],...u,...l?.archived??[]].filter(e=>!e.routine&&!e.deleting&&[e.label,e.title,e.branch,od(e.repo)].some(e=>e!==``&&$c(m,e))).slice(0,Ay),_=y(e.installedMods).has(`issues`),v=[{id:`usage`,name:z(`usage.title`)},..._?[{id:`issues`,name:z(`reviewQueue.palette`),source:`reviews`}]:[]].filter(e=>m===``||$c(m,e.name)),b=Xv(e,r),x=b.kind===`done`?b.reply.matches:[],S=[...d.map(e=>({kind:`command`,row:e})),...v.map(e=>({kind:`page`,...e})),...f.map(e=>({kind:`machines`,...e})),...p.map(e=>({kind:`report`,...e})),...g.map(e=>({kind:`task`,task:e})),...x.map(e=>({kind:`hit`,hit:e}))],C=Math.min(a,Math.max(0,S.length-1));(0,h.useEffect)(()=>()=>n?.focus(),[n]),(0,h.useEffect)(()=>{s.current?.querySelector(`.is-selected`)?.scrollIntoView({block:`nearest`})},[C]);let w=t=>{if(t.kind===`machines`){Iv(e);return}if(R(),n?.focus(),t.kind===`report`){ry(e).catch(()=>I(z(`settings.feedback.reportFailed`),`error`));return}if(t.kind===`command`){t.row.command.live?.(e)===!1?I(yl(`unavailable`),`error`):t.row.command.run(e);return}if(t.kind===`page`){t.source&&iy.set(t.source),he(t.id);return}t.kind===`task`&&t.task.archived&&Sy(e,t.task),t.kind===`task`?e.select(t.task.id):e.select(t.hit.taskId,t.hit.tabId??null),pe(),t.kind===`hit`&&Ey(t.hit.taskId,t.hit)},T=e=>{if(e.key===`ArrowDown`)o(Math.min(S.length-1,C+1));else if(e.key===`ArrowUp`)o(Math.max(0,C-1));else if(e.key===`Enter`){let e=S[C];e&&w(e)}else return;e.preventDefault()},E=m!==``&&(g.length>0||m.length>=2),D=0,O=()=>D++;return(0,V.jsx)(bi,{title:yl(`palette`),wide:!0,children:(0,V.jsxs)(`div`,{className:`${Wr} palette`,onKeyDown:T,children:[(0,V.jsx)(`input`,{className:pn,autoFocus:!0,spellCheck:!1,value:r,placeholder:yl(`search`),onChange:e=>{i(e.target.value),o(0)}}),(0,V.jsxs)(`div`,{className:un,ref:s,style:{maxHeight:`${(E?18:Dy)*1.9}em`},children:[S.length===0&&b.kind!==`searching`&&(0,V.jsx)(`p`,{className:`text-muted`,children:yl(`noResults`)}),E&&d.length>0&&(0,V.jsx)(Qv,{children:z(`search.commands`)}),d.map(e=>{let t=O();return(0,V.jsx)(`button`,{type:`button`,className:dn(t===C),title:e.name,onMouseEnter:()=>o(t),onClick:()=>w({kind:`command`,row:e}),children:(0,V.jsx)(`span`,{className:fn,children:`${t===C?`› `:` `}${e.name}`})},e.command.id)}),v.map(e=>{let t=O();return(0,V.jsx)(H,{variant:`row`,className:dn(t===C),title:e.name,onMouseEnter:()=>o(t),onClick:()=>w({kind:`page`,...e}),children:(0,V.jsx)(`span`,{className:fn,children:`${t===C?`› `:` `}${e.name}`})},e.id)}),f.map(e=>{let t=O();return(0,V.jsx)(H,{variant:`row`,className:dn(t===C),title:e.name,onMouseEnter:()=>o(t),onClick:()=>w({kind:`machines`,...e}),children:(0,V.jsx)(`span`,{className:fn,children:`${t===C?`› `:` `}${e.name}`})},`machines`)}),p.map(e=>{let t=O();return(0,V.jsx)(H,{variant:`row`,className:dn(t===C),title:e.name,onMouseEnter:()=>o(t),onClick:()=>w({kind:`report`,...e}),children:(0,V.jsx)(`span`,{className:fn,children:`${t===C?`› `:` `}${e.name}`})},`report`)}),g.length>0&&(0,V.jsx)(Qv,{children:z(`search.tasks`)}),g.map(e=>{let t=O();return(0,V.jsx)(ey,{title:e.label,repo:e.archived?z(`search.archived`,{repo:od(e.repo)}):od(e.repo),selected:t===C,onHover:()=>o(t),onOpen:()=>w({kind:`task`,task:e})},e.id)}),b.kind!==`idle`&&(0,V.jsx)(Qv,{children:z(`search.inConversations`)}),b.kind===`searching`&&(0,V.jsx)($v,{children:z(`search.searching`)}),b.kind===`failed`&&(0,V.jsx)($v,{error:!0,children:b.message}),b.kind===`done`&&x.length===0&&(0,V.jsx)($v,{children:z(`search.none`,{query:b.query})}),x.map(e=>{let t=O();return(0,V.jsx)(ty,{hit:e,query:b.kind===`done`?b.query:``,selected:t===C,onHover:()=>o(t),onOpen:()=>w({kind:`hit`,hit:e})},`${e.taskId}:${e.tabId??``}:${e.at}:${t}`)}),b.kind===`done`&&b.reply.truncated&&(0,V.jsx)($v,{children:z(`search.truncated`)}),b.kind===`done`&&b.reply.skipped.length>0&&(0,V.jsx)($v,{children:z(`search.skipped`,{count:b.reply.skipped.length})})]}),(0,V.jsx)(`p`,{className:`keys-only text-muted`,children:yl(`run`)})]})})}var My=v(null);function Ny(e){let t=(document.activeElement?.closest(`.rail`)==null?null:My.get())??e.selection.get().taskId;return e.tasks.get()?.tasks.find(e=>e.id===t)??null}var Py=[`latest`,`next`,`nightly`],Fy={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"}},Iy={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}"}},Ly={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`}},Ry={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:`现场笔记调度器`}},zy={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`}},By={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:`● 检测到登录`}},Vy={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.`}},Hy={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 命令,其余命令会在它们声明的事件发生时执行。它们以你的身份、带你的环境变量运行,没有任何沙箱。`}},Uy={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`,keys:`j/k pick · enter record a key · backspace default · x unbind · 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.`},...Fy,...zy,...Vy,keybindings:{title:`Keybindings`,hint:`Press enter on a binding, then the key you want. To put it behind the prefix, press the prefix key first. Changes are saved to the file below and apply at once.`,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`,prefixKey:`Prefix key`,recording:`press the new key… (esc cancels)`,recordingPrefix:`{prefix}, then… (esc cancels)`,recordingSlot:`press the key for {slot}… (esc cancels)`,unbound:`(unbound)`,defaultKeys:`default: {keys}`,warnings:`Warnings`},feedback:{title:`Feedback`,hint:"Files a GitHub issue on the Rove repo through `gh`. Requires `gh auth login`; without it you get a prefilled link to open.",titleLabel:`title`,titlePlaceholder:`Short summary`,descriptionLabel:`description`,descriptionPlaceholder:`What happened? (enter for a new line · tab to Send)`,send:`[enter] File a GitHub issue`,submitting:`submitting...`,sent:`filed #{number}: {url}`,notFiled:`not filed: {hint}
|