@sma1lboy/rove 0.9.159 → 0.9.160
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-7fy242v4.js → chunk-0am6gj8j.js} +1 -1
- package/dist/cli/{chunk-w6s06z4a.js → chunk-0bayctej.js} +2 -2
- package/dist/cli/{chunk-6tgc7mhc.js → chunk-0hn7ctj6.js} +1 -1
- package/dist/cli/{chunk-m4zadw45.js → chunk-144wtkqt.js} +1 -1
- package/dist/cli/{chunk-w3gzwzfk.js → chunk-1ckc04zj.js} +1 -1
- package/dist/cli/{chunk-bwyskwer.js → chunk-1y37w7zq.js} +1 -1
- package/dist/cli/{chunk-yfy6031g.js → chunk-22yhtgcy.js} +1 -1
- package/dist/cli/{chunk-max057d8.js → chunk-2hbhmvjw.js} +1 -1
- package/dist/cli/{chunk-nsayx0vv.js → chunk-39fjx5fq.js} +2 -2
- package/dist/cli/{chunk-mmfwyc7j.js → chunk-47nevjck.js} +2 -2
- package/dist/cli/{chunk-atzd04e0.js → chunk-4jf0yq4v.js} +1 -1
- package/dist/cli/{chunk-gkfd073t.js → chunk-51sbegpb.js} +1 -1
- package/dist/cli/{chunk-pny0ne6r.js → chunk-56wver0a.js} +1 -1
- package/dist/cli/{chunk-mxz4jmb8.js → chunk-5w26jqne.js} +1 -1
- package/dist/cli/{chunk-e5f9rdj2.js → chunk-6b474j5g.js} +1 -1
- package/dist/cli/{chunk-ckqjhfss.js → chunk-84s62bex.js} +1 -1
- package/dist/cli/{chunk-bc93p4fx.js → chunk-8vec42df.js} +1 -1
- package/dist/cli/{chunk-yxnqzamz.js → chunk-959a71qj.js} +1 -1
- package/dist/cli/{chunk-9m0tb44t.js → chunk-9h4kbsk5.js} +1 -1
- package/dist/cli/{chunk-25hxhtdr.js → chunk-a2xndedd.js} +1 -1
- package/dist/cli/{chunk-1w8nmx4v.js → chunk-azsmk821.js} +1 -1
- package/dist/cli/chunk-ccjmtajy.js +3 -0
- package/dist/cli/{chunk-r639wna1.js → chunk-cdxme5y4.js} +1 -1
- package/dist/cli/{chunk-6123622n.js → chunk-cfg0s90c.js} +2 -2
- package/dist/cli/{chunk-yzwv7g1r.js → chunk-cfghdnev.js} +1 -1
- package/dist/cli/{chunk-c43g3qcb.js → chunk-cs50jnwn.js} +1 -1
- package/dist/cli/{chunk-es4985my.js → chunk-cz7qj1p8.js} +1 -1
- package/dist/cli/{chunk-e17gszac.js → chunk-d4vadrmy.js} +1 -1
- package/dist/cli/{chunk-4pmd0mxp.js → chunk-e29hx18x.js} +1 -1
- package/dist/cli/{chunk-kkc2vejt.js → chunk-e85ttr8r.js} +1 -1
- package/dist/cli/{chunk-g8r9zv1x.js → chunk-g48s150x.js} +1 -1
- package/dist/cli/{chunk-g90z5s39.js → chunk-gkmpfpmn.js} +2 -2
- package/dist/cli/{chunk-wk7f8ns5.js → chunk-j91yq51m.js} +3 -3
- package/dist/cli/{chunk-0f377y88.js → chunk-ksqdd9zh.js} +1 -1
- package/dist/cli/{chunk-8kaqpb7t.js → chunk-kw0nnzdp.js} +1 -1
- package/dist/cli/{chunk-dxcwhdsx.js → chunk-myewzjst.js} +1 -1
- package/dist/cli/{chunk-s53jjqyf.js → chunk-ny31s73y.js} +1 -1
- package/dist/cli/{chunk-wt8dc57p.js → chunk-pas1rh6m.js} +14 -14
- package/dist/cli/{chunk-dqxzpetd.js → chunk-qpd817w4.js} +1 -1
- package/dist/cli/{chunk-4wrby8xt.js → chunk-qr3e1m00.js} +1 -1
- package/dist/cli/{chunk-cpmbj0zg.js → chunk-qy855bd5.js} +1 -1
- package/dist/cli/{chunk-esk240e5.js → chunk-s59cymtd.js} +2 -2
- package/dist/cli/{chunk-32h9htyh.js → chunk-t0y9ty67.js} +1 -1
- package/dist/cli/{chunk-s6fcwzyg.js → chunk-ttnpek4s.js} +1 -1
- package/dist/cli/{chunk-p7s4xwgx.js → chunk-v0zxyqrq.js} +1 -1
- package/dist/cli/{chunk-axfn4f28.js → chunk-w68k2kdb.js} +1 -1
- package/dist/cli/{chunk-pz92vzcv.js → chunk-wdq5p44p.js} +1 -1
- package/dist/cli/{chunk-de751t37.js → chunk-x6hevxs5.js} +1 -1
- package/dist/cli/{chunk-zvhrhn88.js → chunk-y7szq7xb.js} +2 -2
- package/dist/cli/{chunk-xxmyqw1v.js → chunk-y8yyk9hq.js} +1 -1
- package/dist/cli/{chunk-gf5y2jft.js → chunk-yrawhw9y.js} +1 -1
- package/dist/cli/{chunk-wy1rbq5h.js → chunk-yzmvmt89.js} +1 -1
- package/dist/cli/{chunk-qq5z2ev8.js → chunk-z49thwax.js} +1 -1
- package/dist/cli/{chunk-4gjr08g0.js → chunk-zmvsqfad.js} +1 -1
- package/dist/cli/{chunk-hfdxy3qe.js → chunk-ztx1pfqv.js} +1 -1
- package/dist/cli/{chunk-svndhd3d.js → chunk-zvfgzpw6.js} +1 -1
- package/dist/cli/{chunk-mkkp4c5t.js → chunk-zz788rt4.js} +2 -2
- package/dist/cli/index.js +4 -4
- package/dist/cli/kobe-run.js +1 -1
- package/dist/cli/kobe.js +5 -5
- package/dist/cli/rove-run.js +1 -1
- package/dist/cli/rove.js +5 -5
- package/package.json +1 -1
- package/dist/cli/chunk-tb6b5zx4.js +0 -3
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{envReadyForTasks}from"./chunk-
|
|
2
|
+
import{envReadyForTasks}from"./chunk-47nevjck.js";import{wizardKeyLines}from"./chunk-84s62bex.js";import"./chunk-g48s150x.js";import"./chunk-ny31s73y.js";import"./chunk-gkmpfpmn.js";import"./chunk-cz7qj1p8.js";import{$Fragment,$jsx,$jsxs,bootPaneHost,currentPrefixConfiguration,pageCloseBindings,require_react_production,useBindings,useRenderer,useT,useTheme}from"./chunk-qr3e1m00.js";import"./chunk-764bsyb0.js";import"./chunk-xqw5d5rv.js";import"./chunk-h4n8ffqy.js";import"./chunk-6xppe9bj.js";import"./chunk-e85ttr8r.js";import"./chunk-y8yyk9hq.js";import"./chunk-x6hevxs5.js";import"./chunk-ynknvkrw.js";import"./chunk-9wn8m2rt.js";import"./chunk-w06vgba4.js";import"./chunk-sdyzxayr.js";import"./chunk-zqfbyq0a.js";import"./chunk-jvxh93nz.js";import"./chunk-4502n1bk.js";import"./chunk-nm0pq5r6.js";import"./chunk-mqqnk8w7.js";import"./chunk-0wnfq5sx.js";import"./chunk-7j5372wb.js";import"./chunk-mnqxgvyb.js";import"./chunk-ztx1pfqv.js";import"./chunk-zmvsqfad.js";import"./chunk-sfv15era.js";import"./chunk-w7zv47mp.js";import"./chunk-gwcneg6c.js";import"./chunk-a2xndedd.js";import"./chunk-7jkf3tvr.js";import"./chunk-2fypr41w.js";import"./chunk-kt1ppyje.js";import"./chunk-5v893waj.js";import"./chunk-w68k2kdb.js";import"./chunk-xy8be792.js";import"./chunk-a3a9gdc4.js";import"./chunk-2brn8e1y.js";import"./chunk-3wj69b0a.js";import"./chunk-ch9b1d5y.js";import"./chunk-bq3fyc0p.js";import"./chunk-v0zxyqrq.js";import"./chunk-e29hx18x.js";import"./chunk-g56kvet6.js";import"./chunk-k2ckx8zw.js";import"./chunk-pw6yfj10.js";import"./chunk-mcdv19rs.js";import"./chunk-r3k9rbwm.js";import{__toESM}from"./chunk-wqfp8d9w.js";import{TextAttributes}from"@opentui/core";var import_react2=__toESM(require_react_production(),1);function inlineRowsFor(env){return 15+env.engines.lines.length+envActionKeys(env).length}function envActionKeys(env){let keys=[];if(!env.engines.anyUsable)keys.push("doctor.fix.noEngineAction");if(!env.git.found)keys.push("doctor.fix.gitAction");return keys}function WizardPage(props){let{theme}=useTheme(),t=useT(),renderer=useRenderer(),steps=(props.mode??"full")==="primer"?[]:props.shell===null?["skill"]:["completions","skill"],[stepIndex,setStepIndex]=import_react2.useState(0),[yes,setYes]=import_react2.useState(!0),[answers,setAnswers]=import_react2.useState({}),[page,setPage]=import_react2.useState(steps.length===0?"env":"questions"),step=steps[stepIndex];function finish(finalAnswers){renderer?.destroy(),props.onDone({completions:finalAnswers.completions??!1,skill:finalAnswers.skill??!1})}function confirm(choice=yes){if(page==="env"){setPage("keys");return}if(page==="keys"){finish(answers);return}let next={...answers,[step]:choice};if(setAnswers(next),stepIndex+1>=steps.length){setPage("env");return}setStepIndex(stepIndex+1),setYes(!0)}useBindings(()=>({bindings:[{key:"up",cmd:()=>setYes(!0)},{key:"k",cmd:()=>setYes(!0)},{key:"down",cmd:()=>setYes(!1)},{key:"j",cmd:()=>setYes(!1)},{key:"return",cmd:()=>confirm()},...pageCloseBindings(()=>finish(answers))]}));function questionFor(s){return s==="completions"?t("onboarding.completionsQuestion",{shell:props.shell??""}):t("onboarding.skillQuestion")}let explain=step==="completions"?t("onboarding.completionsExplain"):t("onboarding.skillExplain"),ready=envReadyForTasks(props.env);return $jsxs("box",{flexDirection:"column",flexGrow:1,paddingTop:1,paddingLeft:2,paddingRight:2,children:[$jsx("text",{fg:theme.primary,attributes:TextAttributes.BOLD,wrapMode:"none",children:t("onboarding.title")}),$jsx("text",{fg:theme.textMuted,wrapMode:"word",children:t("onboarding.subtitle")}),$jsxs("box",{flexDirection:"column",paddingTop:1,children:[steps.slice(0,page==="questions"?stepIndex:steps.length).map((answered)=>$jsxs("box",{flexDirection:"row",gap:1,children:[$jsx("text",{fg:theme.success,wrapMode:"none",children:"\u2713"}),$jsx("text",{fg:theme.textMuted,wrapMode:"none",children:questionFor(answered)}),$jsx("text",{fg:theme.text,wrapMode:"none",children:answers[answered]?t("onboarding.optionYes"):t("onboarding.optionNo")})]},answered)),page==="env"?$jsxs("box",{flexDirection:"column",onMouseUp:()=>confirm(),children:[$jsx("text",{fg:theme.text,attributes:TextAttributes.BOLD,wrapMode:"word",children:t("onboarding.envTitle")}),$jsx("text",{fg:theme.textMuted,wrapMode:"word",children:t("onboarding.envExplain")}),$jsxs("box",{flexDirection:"column",paddingTop:1,children:[$jsx("text",{fg:theme.textMuted,wrapMode:"word",children:props.env.git.line}),props.env.engines.lines.map((line)=>$jsx("text",{fg:theme.textMuted,wrapMode:"word",children:line},line))]}),$jsxs("box",{paddingTop:1,flexDirection:"column",children:[$jsx("text",{fg:ready?theme.success:theme.error,wrapMode:"word",children:ready?t("onboarding.envReady"):t("onboarding.envNotReady")}),envActionKeys(props.env).map((key)=>$jsx("text",{fg:theme.textMuted,wrapMode:"word",children:`\u2192 ${t(key)}`},key))]})]}):null,page==="keys"?$jsxs("box",{flexDirection:"column",onMouseUp:()=>confirm(),children:[$jsx("text",{fg:theme.text,attributes:TextAttributes.BOLD,wrapMode:"word",children:t("onboarding.keysTitle")}),wizardKeyLines(currentPrefixConfiguration().key).map((line)=>$jsx("text",{fg:theme.textMuted,wrapMode:"word",children:t(`onboarding.${line.msg}`,line.params)},line.msg))]}):null,page==="questions"?$jsxs($Fragment,{children:[$jsx("text",{fg:theme.text,attributes:TextAttributes.BOLD,wrapMode:"word",children:questionFor(step)}),$jsx("text",{fg:theme.textMuted,wrapMode:"word",children:explain}),[!0,!1].map((option)=>{let active=yes===option;return $jsxs("box",{flexDirection:"row",gap:1,paddingLeft:1,onMouseUp:()=>confirm(option),children:[$jsx("text",{fg:active?theme.primary:theme.textMuted,wrapMode:"none",children:active?"\u276F":" "}),$jsx("text",{fg:active?theme.primary:theme.textMuted,attributes:active?TextAttributes.BOLD:void 0,wrapMode:"none",children:option?t("onboarding.optionYes"):t("onboarding.optionNo")})]},String(option))})]}):null]}),$jsx("box",{paddingTop:1,children:$jsx("text",{fg:theme.textMuted,attributes:TextAttributes.DIM,wrapMode:"none",children:t(page==="keys"?"onboarding.keysLegend":page==="env"?"onboarding.envLegend":"onboarding.legend")})})]})}async function runOnboardingWizard(shell,env,mode){return await new Promise((resolve)=>{bootPaneHost({inlineRows:inlineRowsFor(env),setup:()=>({root:()=>$jsx(WizardPage,{shell,env,mode,onDone:resolve})})})})}export{runOnboardingWizard,WizardPage};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{sameWorktreeChanges}from"./chunk-xqw5d5rv.js";import{CURRENT_VERSION}from"./chunk-kkc2vejt.js";import{BUNDLED_THEMES,DEFAULT_THEME,applyDisplayOverlay,readPersistedUiPrefs,resolveTheme}from"./chunk-ynknvkrw.js";import{localeState,setLocaleLang,t}from"./chunk-9wn8m2rt.js";import{isLocaleId}from"./chunk-w06vgba4.js";import{createStateCell,mapReadableState,recentStateChangesForDiagnostics}from"./chunk-sdyzxayr.js";import{loadUserThemes}from"./chunk-zqfbyq0a.js";import{connectIfRunning,ensureDaemonReachable,isStaleInstallError}from"./chunk-4502n1bk.js";import{DAEMON_PROTOCOL_VERSION,MIN_COMPATIBLE_PROTOCOL_VERSION,isAttentionInboxState,isDaemonVersionStale,isForeignDaemonHome,isProtocolCompatible}from"./chunk-7j5372wb.js";import{loadStateFile,patchStateFile,replaceStateFile}from"./chunk-5v893waj.js";import{toTaskId}from"./chunk-xy8be792.js";import{errorMessage}from"./chunk-2brn8e1y.js";import{homeDir,isDev,keybindingsConfigPath}from"./chunk-ch9b1d5y.js";import{installClientCrashHandlers,logClient,logClientError,setClientLogContext}from"./chunk-k2ckx8zw.js";import{__commonJS,__esm,__require,__toESM}from"./chunk-wqfp8d9w.js";var require_react_production=__commonJS((exports)=>{var REACT_ELEMENT_TYPE=Symbol.for("react.transitional.element"),REACT_PORTAL_TYPE=Symbol.for("react.portal"),REACT_FRAGMENT_TYPE=Symbol.for("react.fragment"),REACT_STRICT_MODE_TYPE=Symbol.for("react.strict_mode"),REACT_PROFILER_TYPE=Symbol.for("react.profiler"),REACT_CONSUMER_TYPE=Symbol.for("react.consumer"),REACT_CONTEXT_TYPE=Symbol.for("react.context"),REACT_FORWARD_REF_TYPE=Symbol.for("react.forward_ref"),REACT_SUSPENSE_TYPE=Symbol.for("react.suspense"),REACT_MEMO_TYPE=Symbol.for("react.memo"),REACT_LAZY_TYPE=Symbol.for("react.lazy"),REACT_ACTIVITY_TYPE=Symbol.for("react.activity"),MAYBE_ITERATOR_SYMBOL=Symbol.iterator;function getIteratorFn(maybeIterable){if(maybeIterable===null||typeof maybeIterable!=="object")return null;return maybeIterable=MAYBE_ITERATOR_SYMBOL&&maybeIterable[MAYBE_ITERATOR_SYMBOL]||maybeIterable["@@iterator"],typeof maybeIterable==="function"?maybeIterable:null}var ReactNoopUpdateQueue={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},assign=Object.assign,emptyObject={};function Component(props,context,updater){this.props=props,this.context=context,this.refs=emptyObject,this.updater=updater||ReactNoopUpdateQueue}Component.prototype.isReactComponent={};Component.prototype.setState=function(partialState,callback){if(typeof partialState!=="object"&&typeof partialState!=="function"&&partialState!=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,partialState,callback,"setState")};Component.prototype.forceUpdate=function(callback){this.updater.enqueueForceUpdate(this,callback,"forceUpdate")};function ComponentDummy(){}ComponentDummy.prototype=Component.prototype;function PureComponent(props,context,updater){this.props=props,this.context=context,this.refs=emptyObject,this.updater=updater||ReactNoopUpdateQueue}var pureComponentPrototype=PureComponent.prototype=new ComponentDummy;pureComponentPrototype.constructor=PureComponent;assign(pureComponentPrototype,Component.prototype);pureComponentPrototype.isPureReactComponent=!0;var isArrayImpl=Array.isArray;function noop(){}var ReactSharedInternals={H:null,A:null,T:null,S:null},hasOwnProperty=Object.prototype.hasOwnProperty;function ReactElement(type,key,props){var refProp=props.ref;return{$$typeof:REACT_ELEMENT_TYPE,type,key,ref:refProp!==void 0?refProp:null,props}}function cloneAndReplaceKey(oldElement,newKey){return ReactElement(oldElement.type,newKey,oldElement.props)}function isValidElement(object){return typeof object==="object"&&object!==null&&object.$$typeof===REACT_ELEMENT_TYPE}function escape(key){var escaperLookup={"=":"=0",":":"=2"};return"$"+key.replace(/[=:]/g,function(match){return escaperLookup[match]})}var userProvidedKeyEscapeRegex=/\/+/g;function getElementKey(element,index){return typeof element==="object"&&element!==null&&element.key!=null?escape(""+element.key):index.toString(36)}function resolveThenable(thenable){switch(thenable.status){case"fulfilled":return thenable.value;case"rejected":throw thenable.reason;default:switch(typeof thenable.status==="string"?thenable.then(noop,noop):(thenable.status="pending",thenable.then(function(fulfilledValue){thenable.status==="pending"&&(thenable.status="fulfilled",thenable.value=fulfilledValue)},function(error){thenable.status==="pending"&&(thenable.status="rejected",thenable.reason=error)})),thenable.status){case"fulfilled":return thenable.value;case"rejected":throw thenable.reason}}throw thenable}function mapIntoArray(children,array,escapedPrefix,nameSoFar,callback){var type=typeof children;if(type==="undefined"||type==="boolean")children=null;var invokeCallback=!1;if(children===null)invokeCallback=!0;else switch(type){case"bigint":case"string":case"number":invokeCallback=!0;break;case"object":switch(children.$$typeof){case REACT_ELEMENT_TYPE:case REACT_PORTAL_TYPE:invokeCallback=!0;break;case REACT_LAZY_TYPE:return invokeCallback=children._init,mapIntoArray(invokeCallback(children._payload),array,escapedPrefix,nameSoFar,callback)}}if(invokeCallback)return callback=callback(children),invokeCallback=nameSoFar===""?"."+getElementKey(children,0):nameSoFar,isArrayImpl(callback)?(escapedPrefix="",invokeCallback!=null&&(escapedPrefix=invokeCallback.replace(userProvidedKeyEscapeRegex,"$&/")+"/"),mapIntoArray(callback,array,escapedPrefix,"",function(c){return c})):callback!=null&&(isValidElement(callback)&&(callback=cloneAndReplaceKey(callback,escapedPrefix+(callback.key==null||children&&children.key===callback.key?"":(""+callback.key).replace(userProvidedKeyEscapeRegex,"$&/")+"/")+invokeCallback)),array.push(callback)),1;invokeCallback=0;var nextNamePrefix=nameSoFar===""?".":nameSoFar+":";if(isArrayImpl(children))for(var i=0;i<children.length;i++)nameSoFar=children[i],type=nextNamePrefix+getElementKey(nameSoFar,i),invokeCallback+=mapIntoArray(nameSoFar,array,escapedPrefix,type,callback);else if(i=getIteratorFn(children),typeof i==="function")for(children=i.call(children),i=0;!(nameSoFar=children.next()).done;)nameSoFar=nameSoFar.value,type=nextNamePrefix+getElementKey(nameSoFar,i++),invokeCallback+=mapIntoArray(nameSoFar,array,escapedPrefix,type,callback);else if(type==="object"){if(typeof children.then==="function")return mapIntoArray(resolveThenable(children),array,escapedPrefix,nameSoFar,callback);throw array=String(children),Error("Objects are not valid as a React child (found: "+(array==="[object Object]"?"object with keys {"+Object.keys(children).join(", ")+"}":array)+"). If you meant to render a collection of children, use an array instead.")}return invokeCallback}function mapChildren(children,func,context){if(children==null)return children;var result=[],count=0;return mapIntoArray(children,result,"","",function(child){return func.call(context,child,count++)}),result}function lazyInitializer(payload){if(payload._status===-1){var ctor=payload._result;ctor=ctor(),ctor.then(function(moduleObject){if(payload._status===0||payload._status===-1)payload._status=1,payload._result=moduleObject},function(error){if(payload._status===0||payload._status===-1)payload._status=2,payload._result=error}),payload._status===-1&&(payload._status=0,payload._result=ctor)}if(payload._status===1)return payload._result.default;throw payload._result}var reportGlobalError=typeof reportError==="function"?reportError:function(error){if(typeof window==="object"&&typeof window.ErrorEvent==="function"){var event=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof error==="object"&&error!==null&&typeof error.message==="string"?String(error.message):String(error),error});if(!window.dispatchEvent(event))return}else if(typeof process==="object"&&typeof process.emit==="function"){process.emit("uncaughtException",error);return}console.error(error)},Children={map:mapChildren,forEach:function(children,forEachFunc,forEachContext){mapChildren(children,function(){forEachFunc.apply(this,arguments)},forEachContext)},count:function(children){var n=0;return mapChildren(children,function(){n++}),n},toArray:function(children){return mapChildren(children,function(child){return child})||[]},only:function(children){if(!isValidElement(children))throw Error("React.Children.only expected to receive a single React element child.");return children}};exports.Activity=REACT_ACTIVITY_TYPE;exports.Children=Children;exports.Component=Component;exports.Fragment=REACT_FRAGMENT_TYPE;exports.Profiler=REACT_PROFILER_TYPE;exports.PureComponent=PureComponent;exports.StrictMode=REACT_STRICT_MODE_TYPE;exports.Suspense=REACT_SUSPENSE_TYPE;exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=ReactSharedInternals;exports.__COMPILER_RUNTIME={__proto__:null,c:function(size){return ReactSharedInternals.H.useMemoCache(size)}};exports.cache=function(fn){return function(){return fn.apply(null,arguments)}};exports.cacheSignal=function(){return null};exports.cloneElement=function(element,config,children){if(element===null||element===void 0)throw Error("The argument must be a React element, but you passed "+element+".");var props=assign({},element.props),key=element.key;if(config!=null)for(propName in config.key!==void 0&&(key=""+config.key),config)!hasOwnProperty.call(config,propName)||propName==="key"||propName==="__self"||propName==="__source"||propName==="ref"&&config.ref===void 0||(props[propName]=config[propName]);var propName=arguments.length-2;if(propName===1)props.children=children;else if(1<propName){for(var childArray=Array(propName),i=0;i<propName;i++)childArray[i]=arguments[i+2];props.children=childArray}return ReactElement(element.type,key,props)};exports.createContext=function(defaultValue){return defaultValue={$$typeof:REACT_CONTEXT_TYPE,_currentValue:defaultValue,_currentValue2:defaultValue,_threadCount:0,Provider:null,Consumer:null},defaultValue.Provider=defaultValue,defaultValue.Consumer={$$typeof:REACT_CONSUMER_TYPE,_context:defaultValue},defaultValue};exports.createElement=function(type,config,children){var propName,props={},key=null;if(config!=null)for(propName in config.key!==void 0&&(key=""+config.key),config)hasOwnProperty.call(config,propName)&&propName!=="key"&&propName!=="__self"&&propName!=="__source"&&(props[propName]=config[propName]);var childrenLength=arguments.length-2;if(childrenLength===1)props.children=children;else if(1<childrenLength){for(var childArray=Array(childrenLength),i=0;i<childrenLength;i++)childArray[i]=arguments[i+2];props.children=childArray}if(type&&type.defaultProps)for(propName in childrenLength=type.defaultProps,childrenLength)props[propName]===void 0&&(props[propName]=childrenLength[propName]);return ReactElement(type,key,props)};exports.createRef=function(){return{current:null}};exports.forwardRef=function(render){return{$$typeof:REACT_FORWARD_REF_TYPE,render}};exports.isValidElement=isValidElement;exports.lazy=function(ctor){return{$$typeof:REACT_LAZY_TYPE,_payload:{_status:-1,_result:ctor},_init:lazyInitializer}};exports.memo=function(type,compare){return{$$typeof:REACT_MEMO_TYPE,type,compare:compare===void 0?null:compare}};exports.startTransition=function(scope){var prevTransition=ReactSharedInternals.T,currentTransition={};ReactSharedInternals.T=currentTransition;try{var returnValue=scope(),onStartTransitionFinish=ReactSharedInternals.S;onStartTransitionFinish!==null&&onStartTransitionFinish(currentTransition,returnValue),typeof returnValue==="object"&&returnValue!==null&&typeof returnValue.then==="function"&&returnValue.then(noop,reportGlobalError)}catch(error){reportGlobalError(error)}finally{prevTransition!==null&¤tTransition.types!==null&&(prevTransition.types=currentTransition.types),ReactSharedInternals.T=prevTransition}};exports.unstable_useCacheRefresh=function(){return ReactSharedInternals.H.useCacheRefresh()};exports.use=function(usable){return ReactSharedInternals.H.use(usable)};exports.useActionState=function(action,initialState,permalink){return ReactSharedInternals.H.useActionState(action,initialState,permalink)};exports.useCallback=function(callback,deps){return ReactSharedInternals.H.useCallback(callback,deps)};exports.useContext=function(Context){return ReactSharedInternals.H.useContext(Context)};exports.useDebugValue=function(){};exports.useDeferredValue=function(value,initialValue){return ReactSharedInternals.H.useDeferredValue(value,initialValue)};exports.useEffect=function(create,deps){return ReactSharedInternals.H.useEffect(create,deps)};exports.useEffectEvent=function(callback){return ReactSharedInternals.H.useEffectEvent(callback)};exports.useId=function(){return ReactSharedInternals.H.useId()};exports.useImperativeHandle=function(ref,create,deps){return ReactSharedInternals.H.useImperativeHandle(ref,create,deps)};exports.useInsertionEffect=function(create,deps){return ReactSharedInternals.H.useInsertionEffect(create,deps)};exports.useLayoutEffect=function(create,deps){return ReactSharedInternals.H.useLayoutEffect(create,deps)};exports.useMemo=function(create,deps){return ReactSharedInternals.H.useMemo(create,deps)};exports.useOptimistic=function(passthrough,reducer){return ReactSharedInternals.H.useOptimistic(passthrough,reducer)};exports.useReducer=function(reducer,initialArg,init){return ReactSharedInternals.H.useReducer(reducer,initialArg,init)};exports.useRef=function(initialValue){return ReactSharedInternals.H.useRef(initialValue)};exports.useState=function(initialState){return ReactSharedInternals.H.useState(initialState)};exports.useSyncExternalStore=function(subscribe,getSnapshot,getServerSnapshot){return ReactSharedInternals.H.useSyncExternalStore(subscribe,getSnapshot,getServerSnapshot)};exports.useTransition=function(){return ReactSharedInternals.H.useTransition()};exports.version="19.2.8"});function push(heap,node){var index=heap.length;heap.push(node);a:for(;0<index;){var parentIndex=index-1>>>1,parent=heap[parentIndex];if(0<compare(parent,node))heap[parentIndex]=node,heap[index]=parent,index=parentIndex;else break a}}function peek(heap){return heap.length===0?null:heap[0]}function pop(heap){if(heap.length===0)return null;var first=heap[0],last=heap.pop();if(last!==first){heap[0]=last;a:for(var index=0,length=heap.length,halfLength=length>>>1;index<halfLength;){var leftIndex=2*(index+1)-1,left=heap[leftIndex],rightIndex=leftIndex+1,right=heap[rightIndex];if(0>compare(left,last))rightIndex<length&&0>compare(right,left)?(heap[index]=right,heap[rightIndex]=last,index=rightIndex):(heap[index]=left,heap[leftIndex]=last,index=leftIndex);else if(rightIndex<length&&0>compare(right,last))heap[index]=right,heap[rightIndex]=last,index=rightIndex;else break a}}return first}function compare(a,b){var diff=a.sortIndex-b.sortIndex;return diff!==0?diff:a.id-b.id}function advanceTimers(currentTime){for(var timer=peek(timerQueue);timer!==null;){if(timer.callback===null)pop(timerQueue);else if(timer.startTime<=currentTime)pop(timerQueue),timer.sortIndex=timer.expirationTime,push(taskQueue,timer);else break;timer=peek(timerQueue)}}function handleTimeout(currentTime){if(isHostTimeoutScheduled=!1,advanceTimers(currentTime),!isHostCallbackScheduled)if(peek(taskQueue)!==null)isHostCallbackScheduled=!0,isMessageLoopRunning||(isMessageLoopRunning=!0,schedulePerformWorkUntilDeadline());else{var firstTimer=peek(timerQueue);firstTimer!==null&&requestHostTimeout(handleTimeout,firstTimer.startTime-currentTime)}}function shouldYieldToHost(){return needsPaint?!0:$unstable_now()-startTime<frameInterval?!1:!0}function performWorkUntilDeadline(){if(needsPaint=!1,isMessageLoopRunning){var currentTime=$unstable_now();startTime=currentTime;var hasMoreWork=!0;try{a:{isHostCallbackScheduled=!1,isHostTimeoutScheduled&&(isHostTimeoutScheduled=!1,localClearTimeout(taskTimeoutID),taskTimeoutID=-1),isPerformingWork=!0;var previousPriorityLevel=currentPriorityLevel;try{b:{advanceTimers(currentTime);for(currentTask=peek(taskQueue);currentTask!==null&&!(currentTask.expirationTime>currentTime&&shouldYieldToHost());){var callback=currentTask.callback;if(typeof callback==="function"){currentTask.callback=null,currentPriorityLevel=currentTask.priorityLevel;var continuationCallback=callback(currentTask.expirationTime<=currentTime);if(currentTime=$unstable_now(),typeof continuationCallback==="function"){currentTask.callback=continuationCallback,advanceTimers(currentTime),hasMoreWork=!0;break b}currentTask===peek(taskQueue)&&pop(taskQueue),advanceTimers(currentTime)}else pop(taskQueue);currentTask=peek(taskQueue)}if(currentTask!==null)hasMoreWork=!0;else{var firstTimer=peek(timerQueue);firstTimer!==null&&requestHostTimeout(handleTimeout,firstTimer.startTime-currentTime),hasMoreWork=!1}}break a}finally{currentTask=null,currentPriorityLevel=previousPriorityLevel,isPerformingWork=!1}hasMoreWork=void 0}}finally{hasMoreWork?schedulePerformWorkUntilDeadline():isMessageLoopRunning=!1}}}function requestHostTimeout(callback,ms){taskTimeoutID=localSetTimeout(function(){callback($unstable_now())},ms)}var $unstable_now=void 0,localPerformance,localDate,initialTime,taskQueue,timerQueue,taskIdCounter=1,currentTask=null,currentPriorityLevel=3,isPerformingWork=!1,isHostCallbackScheduled=!1,isHostTimeoutScheduled=!1,needsPaint=!1,localSetTimeout,localClearTimeout,localSetImmediate,isMessageLoopRunning=!1,taskTimeoutID=-1,frameInterval=5,startTime=-1,schedulePerformWorkUntilDeadline,channel,port,$unstable_IdlePriority=5,$unstable_ImmediatePriority=1,$unstable_NormalPriority=3,$unstable_UserBlockingPriority=2,$unstable_cancelCallback=function(task){task.callback=null},$unstable_requestPaint=function(){needsPaint=!0},$unstable_scheduleCallback=function(priorityLevel,callback,options){var currentTime=$unstable_now();switch(typeof options==="object"&&options!==null?(options=options.delay,options=typeof options==="number"&&0<options?currentTime+options:currentTime):options=currentTime,priorityLevel){case 1:var timeout=-1;break;case 2:timeout=250;break;case 5:timeout=1073741823;break;case 4:timeout=1e4;break;default:timeout=5000}return timeout=options+timeout,priorityLevel={id:taskIdCounter++,callback,priorityLevel,startTime:options,expirationTime:timeout,sortIndex:-1},options>currentTime?(priorityLevel.sortIndex=options,push(timerQueue,priorityLevel),peek(taskQueue)===null&&priorityLevel===peek(timerQueue)&&(isHostTimeoutScheduled?(localClearTimeout(taskTimeoutID),taskTimeoutID=-1):isHostTimeoutScheduled=!0,requestHostTimeout(handleTimeout,options-currentTime))):(priorityLevel.sortIndex=timeout,push(taskQueue,priorityLevel),isHostCallbackScheduled||isPerformingWork||(isHostCallbackScheduled=!0,isMessageLoopRunning||(isMessageLoopRunning=!0,schedulePerformWorkUntilDeadline()))),priorityLevel},$unstable_shouldYield;var init_scheduler_production=__esm(()=>{if(typeof performance==="object"&&typeof performance.now==="function")localPerformance=performance,$unstable_now=function(){return localPerformance.now()};else localDate=Date,initialTime=localDate.now(),$unstable_now=function(){return localDate.now()-initialTime};taskQueue=[],timerQueue=[],localSetTimeout=typeof setTimeout==="function"?setTimeout:null,localClearTimeout=typeof clearTimeout==="function"?clearTimeout:null,localSetImmediate=typeof setImmediate<"u"?setImmediate:null;if(typeof localSetImmediate==="function")schedulePerformWorkUntilDeadline=function(){localSetImmediate(performWorkUntilDeadline)};else if(typeof MessageChannel<"u")channel=new MessageChannel,port=channel.port2,channel.port1.onmessage=performWorkUntilDeadline,schedulePerformWorkUntilDeadline=function(){port.postMessage(null)};else schedulePerformWorkUntilDeadline=function(){localSetTimeout(performWorkUntilDeadline,0)};$unstable_shouldYield=shouldYieldToHost});var require_react_reconciler_production=__commonJS((exports,module)=>{init_scheduler_production();var React=__toESM(require_react_production());module.exports=function($$$config){function createFiber(tag,pendingProps,key,mode){return new FiberNode(tag,pendingProps,key,mode)}function noop(){}function formatProdErrorMessage(code){var url="https://react.dev/errors/"+code;if(1<arguments.length){url+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)url+="&args[]="+encodeURIComponent(arguments[i])}return"Minified React error #"+code+"; visit "+url+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function getNearestMountedFiber(fiber){var node=fiber,nearestMounted=fiber;if(fiber.alternate)for(;node.return;)node=node.return;else{fiber=node;do node=fiber,(node.flags&4098)!==0&&(nearestMounted=node.return),fiber=node.return;while(fiber)}return node.tag===3?nearestMounted:null}function assertIsMounted(fiber){if(getNearestMountedFiber(fiber)!==fiber)throw Error(formatProdErrorMessage(188))}function findCurrentFiberUsingSlowPath(fiber){var alternate=fiber.alternate;if(!alternate){if(alternate=getNearestMountedFiber(fiber),alternate===null)throw Error(formatProdErrorMessage(188));return alternate!==fiber?null:fiber}for(var a=fiber,b=alternate;;){var parentA=a.return;if(parentA===null)break;var parentB=parentA.alternate;if(parentB===null){if(b=parentA.return,b!==null){a=b;continue}break}if(parentA.child===parentB.child){for(parentB=parentA.child;parentB;){if(parentB===a)return assertIsMounted(parentA),fiber;if(parentB===b)return assertIsMounted(parentA),alternate;parentB=parentB.sibling}throw Error(formatProdErrorMessage(188))}if(a.return!==b.return)a=parentA,b=parentB;else{for(var didFindChild=!1,child$0=parentA.child;child$0;){if(child$0===a){didFindChild=!0,a=parentA,b=parentB;break}if(child$0===b){didFindChild=!0,b=parentA,a=parentB;break}child$0=child$0.sibling}if(!didFindChild){for(child$0=parentB.child;child$0;){if(child$0===a){didFindChild=!0,a=parentB,b=parentA;break}if(child$0===b){didFindChild=!0,b=parentB,a=parentA;break}child$0=child$0.sibling}if(!didFindChild)throw Error(formatProdErrorMessage(189))}}if(a.alternate!==b)throw Error(formatProdErrorMessage(190))}if(a.tag!==3)throw Error(formatProdErrorMessage(188));return a.stateNode.current===a?fiber:alternate}function findCurrentHostFiberImpl(node){var tag=node.tag;if(tag===5||tag===26||tag===27||tag===6)return node;for(node=node.child;node!==null;){if(tag=findCurrentHostFiberImpl(node),tag!==null)return tag;node=node.sibling}return null}function findCurrentHostFiberWithNoPortalsImpl(node){var tag=node.tag;if(tag===5||tag===26||tag===27||tag===6)return node;for(node=node.child;node!==null;){if(node.tag!==4&&(tag=findCurrentHostFiberWithNoPortalsImpl(node),tag!==null))return tag;node=node.sibling}return null}function getIteratorFn(maybeIterable){if(maybeIterable===null||typeof maybeIterable!=="object")return null;return maybeIterable=MAYBE_ITERATOR_SYMBOL&&maybeIterable[MAYBE_ITERATOR_SYMBOL]||maybeIterable["@@iterator"],typeof maybeIterable==="function"?maybeIterable:null}function getComponentNameFromType(type){if(type==null)return null;if(typeof type==="function")return type.$$typeof===REACT_CLIENT_REFERENCE?null:type.displayName||type.name||null;if(typeof type==="string")return type;switch(type){case REACT_FRAGMENT_TYPE:return"Fragment";case REACT_PROFILER_TYPE:return"Profiler";case REACT_STRICT_MODE_TYPE:return"StrictMode";case REACT_SUSPENSE_TYPE:return"Suspense";case REACT_SUSPENSE_LIST_TYPE:return"SuspenseList";case REACT_ACTIVITY_TYPE:return"Activity"}if(typeof type==="object")switch(type.$$typeof){case REACT_PORTAL_TYPE:return"Portal";case REACT_CONTEXT_TYPE:return type.displayName||"Context";case REACT_CONSUMER_TYPE:return(type._context.displayName||"Context")+".Consumer";case REACT_FORWARD_REF_TYPE:var innerType=type.render;return type=type.displayName,type||(type=innerType.displayName||innerType.name||"",type=type!==""?"ForwardRef("+type+")":"ForwardRef"),type;case REACT_MEMO_TYPE:return innerType=type.displayName||null,innerType!==null?innerType:getComponentNameFromType(type.type)||"Memo";case REACT_LAZY_TYPE:innerType=type._payload,type=type._init;try{return getComponentNameFromType(type(innerType))}catch(x){}}return null}function createCursor(defaultValue){return{current:defaultValue}}function pop2(cursor){0>index$jscomp$0||(cursor.current=valueStack[index$jscomp$0],valueStack[index$jscomp$0]=null,index$jscomp$0--)}function push2(cursor,value){index$jscomp$0++,valueStack[index$jscomp$0]=cursor.current,cursor.current=value}function clz32Fallback(x){return x>>>=0,x===0?32:31-(log$1(x)/LN2|0)|0}function getHighestPriorityLanes(lanes){var pendingSyncLanes=lanes&42;if(pendingSyncLanes!==0)return pendingSyncLanes;switch(lanes&-lanes){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return lanes&261888;case 262144:case 524288:case 1048576:case 2097152:return lanes&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return lanes&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return lanes}}function getNextLanes(root,wipLanes,rootHasPendingCommit){var pendingLanes=root.pendingLanes;if(pendingLanes===0)return 0;var nextLanes=0,suspendedLanes=root.suspendedLanes,pingedLanes=root.pingedLanes;root=root.warmLanes;var nonIdlePendingLanes=pendingLanes&134217727;return nonIdlePendingLanes!==0?(pendingLanes=nonIdlePendingLanes&~suspendedLanes,pendingLanes!==0?nextLanes=getHighestPriorityLanes(pendingLanes):(pingedLanes&=nonIdlePendingLanes,pingedLanes!==0?nextLanes=getHighestPriorityLanes(pingedLanes):rootHasPendingCommit||(rootHasPendingCommit=nonIdlePendingLanes&~root,rootHasPendingCommit!==0&&(nextLanes=getHighestPriorityLanes(rootHasPendingCommit))))):(nonIdlePendingLanes=pendingLanes&~suspendedLanes,nonIdlePendingLanes!==0?nextLanes=getHighestPriorityLanes(nonIdlePendingLanes):pingedLanes!==0?nextLanes=getHighestPriorityLanes(pingedLanes):rootHasPendingCommit||(rootHasPendingCommit=pendingLanes&~root,rootHasPendingCommit!==0&&(nextLanes=getHighestPriorityLanes(rootHasPendingCommit)))),nextLanes===0?0:wipLanes!==0&&wipLanes!==nextLanes&&(wipLanes&suspendedLanes)===0&&(suspendedLanes=nextLanes&-nextLanes,rootHasPendingCommit=wipLanes&-wipLanes,suspendedLanes>=rootHasPendingCommit||suspendedLanes===32&&(rootHasPendingCommit&4194048)!==0)?wipLanes:nextLanes}function checkIfRootIsPrerendering(root,renderLanes2){return(root.pendingLanes&~(root.suspendedLanes&~root.pingedLanes)&renderLanes2)===0}function computeExpirationTime(lane,currentTime){switch(lane){case 1:case 2:case 4:case 8:case 64:return currentTime+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return currentTime+5000;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function claimNextRetryLane(){var lane=nextRetryLane;return nextRetryLane<<=1,(nextRetryLane&62914560)===0&&(nextRetryLane=4194304),lane}function createLaneMap(initial){for(var laneMap=[],i=0;31>i;i++)laneMap.push(initial);return laneMap}function markRootUpdated$1(root,updateLane){root.pendingLanes|=updateLane,updateLane!==268435456&&(root.suspendedLanes=0,root.pingedLanes=0,root.warmLanes=0)}function markRootFinished(root,finishedLanes,remainingLanes,spawnedLane,updatedLanes,suspendedRetryLanes){var previouslyPendingLanes=root.pendingLanes;root.pendingLanes=remainingLanes,root.suspendedLanes=0,root.pingedLanes=0,root.warmLanes=0,root.expiredLanes&=remainingLanes,root.entangledLanes&=remainingLanes,root.errorRecoveryDisabledLanes&=remainingLanes,root.shellSuspendCounter=0;var{entanglements,expirationTimes,hiddenUpdates}=root;for(remainingLanes=previouslyPendingLanes&~remainingLanes;0<remainingLanes;){var index$5=31-clz32(remainingLanes),lane=1<<index$5;entanglements[index$5]=0,expirationTimes[index$5]=-1;var hiddenUpdatesForLane=hiddenUpdates[index$5];if(hiddenUpdatesForLane!==null)for(hiddenUpdates[index$5]=null,index$5=0;index$5<hiddenUpdatesForLane.length;index$5++){var update=hiddenUpdatesForLane[index$5];update!==null&&(update.lane&=-536870913)}remainingLanes&=~lane}spawnedLane!==0&&markSpawnedDeferredLane(root,spawnedLane,0),suspendedRetryLanes!==0&&updatedLanes===0&&root.tag!==0&&(root.suspendedLanes|=suspendedRetryLanes&~(previouslyPendingLanes&~finishedLanes))}function markSpawnedDeferredLane(root,spawnedLane,entangledLanes){root.pendingLanes|=spawnedLane,root.suspendedLanes&=~spawnedLane;var spawnedLaneIndex=31-clz32(spawnedLane);root.entangledLanes|=spawnedLane,root.entanglements[spawnedLaneIndex]=root.entanglements[spawnedLaneIndex]|1073741824|entangledLanes&261930}function markRootEntangled(root,entangledLanes){var rootEntangledLanes=root.entangledLanes|=entangledLanes;for(root=root.entanglements;rootEntangledLanes;){var index$6=31-clz32(rootEntangledLanes),lane=1<<index$6;lane&entangledLanes|root[index$6]&entangledLanes&&(root[index$6]|=entangledLanes),rootEntangledLanes&=~lane}}function getBumpedLaneForHydration(root,renderLanes2){var renderLane=renderLanes2&-renderLanes2;return renderLane=(renderLane&42)!==0?1:getBumpedLaneForHydrationByLane(renderLane),(renderLane&(root.suspendedLanes|renderLanes2))!==0?0:renderLane}function getBumpedLaneForHydrationByLane(lane){switch(lane){case 2:lane=1;break;case 8:lane=4;break;case 32:lane=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:lane=128;break;case 268435456:lane=134217728;break;default:lane=0}return lane}function lanesToEventPriority(lanes){return lanes&=-lanes,2<lanes?8<lanes?(lanes&134217727)!==0?32:268435456:8:2}function setIsStrictModeForDevtools(newIsStrictMode){if(typeof log2==="function"&&unstable_setDisableYieldValue2(newIsStrictMode),injectedHook&&typeof injectedHook.setStrictMode==="function")try{injectedHook.setStrictMode(rendererID,newIsStrictMode)}catch(err){}}function is(x,y){return x===y&&(x!==0||1/x===1/y)||x!==x&&y!==y}function describeBuiltInComponentFrame(name){if(prefix===void 0)try{throw Error()}catch(x){var match=x.stack.trim().match(/\n( *(at )?)/);prefix=match&&match[1]||"",suffix=-1<x.stack.indexOf(`
|
|
2
|
+
import{sameWorktreeChanges}from"./chunk-xqw5d5rv.js";import{CURRENT_VERSION}from"./chunk-e85ttr8r.js";import{BUNDLED_THEMES,DEFAULT_THEME,applyDisplayOverlay,readPersistedUiPrefs,resolveTheme}from"./chunk-ynknvkrw.js";import{localeState,setLocaleLang,t}from"./chunk-9wn8m2rt.js";import{isLocaleId}from"./chunk-w06vgba4.js";import{createStateCell,mapReadableState,recentStateChangesForDiagnostics}from"./chunk-sdyzxayr.js";import{loadUserThemes}from"./chunk-zqfbyq0a.js";import{connectIfRunning,ensureDaemonReachable,isStaleInstallError}from"./chunk-4502n1bk.js";import{DAEMON_PROTOCOL_VERSION,MIN_COMPATIBLE_PROTOCOL_VERSION,isAttentionInboxState,isDaemonVersionStale,isForeignDaemonHome,isProtocolCompatible}from"./chunk-7j5372wb.js";import{loadStateFile,patchStateFile,replaceStateFile}from"./chunk-5v893waj.js";import{toTaskId}from"./chunk-xy8be792.js";import{errorMessage}from"./chunk-2brn8e1y.js";import{homeDir,isDev,keybindingsConfigPath}from"./chunk-ch9b1d5y.js";import{installClientCrashHandlers,logClient,logClientError,setClientLogContext}from"./chunk-k2ckx8zw.js";import{__commonJS,__esm,__require,__toESM}from"./chunk-wqfp8d9w.js";var require_react_production=__commonJS((exports)=>{var REACT_ELEMENT_TYPE=Symbol.for("react.transitional.element"),REACT_PORTAL_TYPE=Symbol.for("react.portal"),REACT_FRAGMENT_TYPE=Symbol.for("react.fragment"),REACT_STRICT_MODE_TYPE=Symbol.for("react.strict_mode"),REACT_PROFILER_TYPE=Symbol.for("react.profiler"),REACT_CONSUMER_TYPE=Symbol.for("react.consumer"),REACT_CONTEXT_TYPE=Symbol.for("react.context"),REACT_FORWARD_REF_TYPE=Symbol.for("react.forward_ref"),REACT_SUSPENSE_TYPE=Symbol.for("react.suspense"),REACT_MEMO_TYPE=Symbol.for("react.memo"),REACT_LAZY_TYPE=Symbol.for("react.lazy"),REACT_ACTIVITY_TYPE=Symbol.for("react.activity"),MAYBE_ITERATOR_SYMBOL=Symbol.iterator;function getIteratorFn(maybeIterable){if(maybeIterable===null||typeof maybeIterable!=="object")return null;return maybeIterable=MAYBE_ITERATOR_SYMBOL&&maybeIterable[MAYBE_ITERATOR_SYMBOL]||maybeIterable["@@iterator"],typeof maybeIterable==="function"?maybeIterable:null}var ReactNoopUpdateQueue={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},assign=Object.assign,emptyObject={};function Component(props,context,updater){this.props=props,this.context=context,this.refs=emptyObject,this.updater=updater||ReactNoopUpdateQueue}Component.prototype.isReactComponent={};Component.prototype.setState=function(partialState,callback){if(typeof partialState!=="object"&&typeof partialState!=="function"&&partialState!=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,partialState,callback,"setState")};Component.prototype.forceUpdate=function(callback){this.updater.enqueueForceUpdate(this,callback,"forceUpdate")};function ComponentDummy(){}ComponentDummy.prototype=Component.prototype;function PureComponent(props,context,updater){this.props=props,this.context=context,this.refs=emptyObject,this.updater=updater||ReactNoopUpdateQueue}var pureComponentPrototype=PureComponent.prototype=new ComponentDummy;pureComponentPrototype.constructor=PureComponent;assign(pureComponentPrototype,Component.prototype);pureComponentPrototype.isPureReactComponent=!0;var isArrayImpl=Array.isArray;function noop(){}var ReactSharedInternals={H:null,A:null,T:null,S:null},hasOwnProperty=Object.prototype.hasOwnProperty;function ReactElement(type,key,props){var refProp=props.ref;return{$$typeof:REACT_ELEMENT_TYPE,type,key,ref:refProp!==void 0?refProp:null,props}}function cloneAndReplaceKey(oldElement,newKey){return ReactElement(oldElement.type,newKey,oldElement.props)}function isValidElement(object){return typeof object==="object"&&object!==null&&object.$$typeof===REACT_ELEMENT_TYPE}function escape(key){var escaperLookup={"=":"=0",":":"=2"};return"$"+key.replace(/[=:]/g,function(match){return escaperLookup[match]})}var userProvidedKeyEscapeRegex=/\/+/g;function getElementKey(element,index){return typeof element==="object"&&element!==null&&element.key!=null?escape(""+element.key):index.toString(36)}function resolveThenable(thenable){switch(thenable.status){case"fulfilled":return thenable.value;case"rejected":throw thenable.reason;default:switch(typeof thenable.status==="string"?thenable.then(noop,noop):(thenable.status="pending",thenable.then(function(fulfilledValue){thenable.status==="pending"&&(thenable.status="fulfilled",thenable.value=fulfilledValue)},function(error){thenable.status==="pending"&&(thenable.status="rejected",thenable.reason=error)})),thenable.status){case"fulfilled":return thenable.value;case"rejected":throw thenable.reason}}throw thenable}function mapIntoArray(children,array,escapedPrefix,nameSoFar,callback){var type=typeof children;if(type==="undefined"||type==="boolean")children=null;var invokeCallback=!1;if(children===null)invokeCallback=!0;else switch(type){case"bigint":case"string":case"number":invokeCallback=!0;break;case"object":switch(children.$$typeof){case REACT_ELEMENT_TYPE:case REACT_PORTAL_TYPE:invokeCallback=!0;break;case REACT_LAZY_TYPE:return invokeCallback=children._init,mapIntoArray(invokeCallback(children._payload),array,escapedPrefix,nameSoFar,callback)}}if(invokeCallback)return callback=callback(children),invokeCallback=nameSoFar===""?"."+getElementKey(children,0):nameSoFar,isArrayImpl(callback)?(escapedPrefix="",invokeCallback!=null&&(escapedPrefix=invokeCallback.replace(userProvidedKeyEscapeRegex,"$&/")+"/"),mapIntoArray(callback,array,escapedPrefix,"",function(c){return c})):callback!=null&&(isValidElement(callback)&&(callback=cloneAndReplaceKey(callback,escapedPrefix+(callback.key==null||children&&children.key===callback.key?"":(""+callback.key).replace(userProvidedKeyEscapeRegex,"$&/")+"/")+invokeCallback)),array.push(callback)),1;invokeCallback=0;var nextNamePrefix=nameSoFar===""?".":nameSoFar+":";if(isArrayImpl(children))for(var i=0;i<children.length;i++)nameSoFar=children[i],type=nextNamePrefix+getElementKey(nameSoFar,i),invokeCallback+=mapIntoArray(nameSoFar,array,escapedPrefix,type,callback);else if(i=getIteratorFn(children),typeof i==="function")for(children=i.call(children),i=0;!(nameSoFar=children.next()).done;)nameSoFar=nameSoFar.value,type=nextNamePrefix+getElementKey(nameSoFar,i++),invokeCallback+=mapIntoArray(nameSoFar,array,escapedPrefix,type,callback);else if(type==="object"){if(typeof children.then==="function")return mapIntoArray(resolveThenable(children),array,escapedPrefix,nameSoFar,callback);throw array=String(children),Error("Objects are not valid as a React child (found: "+(array==="[object Object]"?"object with keys {"+Object.keys(children).join(", ")+"}":array)+"). If you meant to render a collection of children, use an array instead.")}return invokeCallback}function mapChildren(children,func,context){if(children==null)return children;var result=[],count=0;return mapIntoArray(children,result,"","",function(child){return func.call(context,child,count++)}),result}function lazyInitializer(payload){if(payload._status===-1){var ctor=payload._result;ctor=ctor(),ctor.then(function(moduleObject){if(payload._status===0||payload._status===-1)payload._status=1,payload._result=moduleObject},function(error){if(payload._status===0||payload._status===-1)payload._status=2,payload._result=error}),payload._status===-1&&(payload._status=0,payload._result=ctor)}if(payload._status===1)return payload._result.default;throw payload._result}var reportGlobalError=typeof reportError==="function"?reportError:function(error){if(typeof window==="object"&&typeof window.ErrorEvent==="function"){var event=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof error==="object"&&error!==null&&typeof error.message==="string"?String(error.message):String(error),error});if(!window.dispatchEvent(event))return}else if(typeof process==="object"&&typeof process.emit==="function"){process.emit("uncaughtException",error);return}console.error(error)},Children={map:mapChildren,forEach:function(children,forEachFunc,forEachContext){mapChildren(children,function(){forEachFunc.apply(this,arguments)},forEachContext)},count:function(children){var n=0;return mapChildren(children,function(){n++}),n},toArray:function(children){return mapChildren(children,function(child){return child})||[]},only:function(children){if(!isValidElement(children))throw Error("React.Children.only expected to receive a single React element child.");return children}};exports.Activity=REACT_ACTIVITY_TYPE;exports.Children=Children;exports.Component=Component;exports.Fragment=REACT_FRAGMENT_TYPE;exports.Profiler=REACT_PROFILER_TYPE;exports.PureComponent=PureComponent;exports.StrictMode=REACT_STRICT_MODE_TYPE;exports.Suspense=REACT_SUSPENSE_TYPE;exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=ReactSharedInternals;exports.__COMPILER_RUNTIME={__proto__:null,c:function(size){return ReactSharedInternals.H.useMemoCache(size)}};exports.cache=function(fn){return function(){return fn.apply(null,arguments)}};exports.cacheSignal=function(){return null};exports.cloneElement=function(element,config,children){if(element===null||element===void 0)throw Error("The argument must be a React element, but you passed "+element+".");var props=assign({},element.props),key=element.key;if(config!=null)for(propName in config.key!==void 0&&(key=""+config.key),config)!hasOwnProperty.call(config,propName)||propName==="key"||propName==="__self"||propName==="__source"||propName==="ref"&&config.ref===void 0||(props[propName]=config[propName]);var propName=arguments.length-2;if(propName===1)props.children=children;else if(1<propName){for(var childArray=Array(propName),i=0;i<propName;i++)childArray[i]=arguments[i+2];props.children=childArray}return ReactElement(element.type,key,props)};exports.createContext=function(defaultValue){return defaultValue={$$typeof:REACT_CONTEXT_TYPE,_currentValue:defaultValue,_currentValue2:defaultValue,_threadCount:0,Provider:null,Consumer:null},defaultValue.Provider=defaultValue,defaultValue.Consumer={$$typeof:REACT_CONSUMER_TYPE,_context:defaultValue},defaultValue};exports.createElement=function(type,config,children){var propName,props={},key=null;if(config!=null)for(propName in config.key!==void 0&&(key=""+config.key),config)hasOwnProperty.call(config,propName)&&propName!=="key"&&propName!=="__self"&&propName!=="__source"&&(props[propName]=config[propName]);var childrenLength=arguments.length-2;if(childrenLength===1)props.children=children;else if(1<childrenLength){for(var childArray=Array(childrenLength),i=0;i<childrenLength;i++)childArray[i]=arguments[i+2];props.children=childArray}if(type&&type.defaultProps)for(propName in childrenLength=type.defaultProps,childrenLength)props[propName]===void 0&&(props[propName]=childrenLength[propName]);return ReactElement(type,key,props)};exports.createRef=function(){return{current:null}};exports.forwardRef=function(render){return{$$typeof:REACT_FORWARD_REF_TYPE,render}};exports.isValidElement=isValidElement;exports.lazy=function(ctor){return{$$typeof:REACT_LAZY_TYPE,_payload:{_status:-1,_result:ctor},_init:lazyInitializer}};exports.memo=function(type,compare){return{$$typeof:REACT_MEMO_TYPE,type,compare:compare===void 0?null:compare}};exports.startTransition=function(scope){var prevTransition=ReactSharedInternals.T,currentTransition={};ReactSharedInternals.T=currentTransition;try{var returnValue=scope(),onStartTransitionFinish=ReactSharedInternals.S;onStartTransitionFinish!==null&&onStartTransitionFinish(currentTransition,returnValue),typeof returnValue==="object"&&returnValue!==null&&typeof returnValue.then==="function"&&returnValue.then(noop,reportGlobalError)}catch(error){reportGlobalError(error)}finally{prevTransition!==null&¤tTransition.types!==null&&(prevTransition.types=currentTransition.types),ReactSharedInternals.T=prevTransition}};exports.unstable_useCacheRefresh=function(){return ReactSharedInternals.H.useCacheRefresh()};exports.use=function(usable){return ReactSharedInternals.H.use(usable)};exports.useActionState=function(action,initialState,permalink){return ReactSharedInternals.H.useActionState(action,initialState,permalink)};exports.useCallback=function(callback,deps){return ReactSharedInternals.H.useCallback(callback,deps)};exports.useContext=function(Context){return ReactSharedInternals.H.useContext(Context)};exports.useDebugValue=function(){};exports.useDeferredValue=function(value,initialValue){return ReactSharedInternals.H.useDeferredValue(value,initialValue)};exports.useEffect=function(create,deps){return ReactSharedInternals.H.useEffect(create,deps)};exports.useEffectEvent=function(callback){return ReactSharedInternals.H.useEffectEvent(callback)};exports.useId=function(){return ReactSharedInternals.H.useId()};exports.useImperativeHandle=function(ref,create,deps){return ReactSharedInternals.H.useImperativeHandle(ref,create,deps)};exports.useInsertionEffect=function(create,deps){return ReactSharedInternals.H.useInsertionEffect(create,deps)};exports.useLayoutEffect=function(create,deps){return ReactSharedInternals.H.useLayoutEffect(create,deps)};exports.useMemo=function(create,deps){return ReactSharedInternals.H.useMemo(create,deps)};exports.useOptimistic=function(passthrough,reducer){return ReactSharedInternals.H.useOptimistic(passthrough,reducer)};exports.useReducer=function(reducer,initialArg,init){return ReactSharedInternals.H.useReducer(reducer,initialArg,init)};exports.useRef=function(initialValue){return ReactSharedInternals.H.useRef(initialValue)};exports.useState=function(initialState){return ReactSharedInternals.H.useState(initialState)};exports.useSyncExternalStore=function(subscribe,getSnapshot,getServerSnapshot){return ReactSharedInternals.H.useSyncExternalStore(subscribe,getSnapshot,getServerSnapshot)};exports.useTransition=function(){return ReactSharedInternals.H.useTransition()};exports.version="19.2.8"});function push(heap,node){var index=heap.length;heap.push(node);a:for(;0<index;){var parentIndex=index-1>>>1,parent=heap[parentIndex];if(0<compare(parent,node))heap[parentIndex]=node,heap[index]=parent,index=parentIndex;else break a}}function peek(heap){return heap.length===0?null:heap[0]}function pop(heap){if(heap.length===0)return null;var first=heap[0],last=heap.pop();if(last!==first){heap[0]=last;a:for(var index=0,length=heap.length,halfLength=length>>>1;index<halfLength;){var leftIndex=2*(index+1)-1,left=heap[leftIndex],rightIndex=leftIndex+1,right=heap[rightIndex];if(0>compare(left,last))rightIndex<length&&0>compare(right,left)?(heap[index]=right,heap[rightIndex]=last,index=rightIndex):(heap[index]=left,heap[leftIndex]=last,index=leftIndex);else if(rightIndex<length&&0>compare(right,last))heap[index]=right,heap[rightIndex]=last,index=rightIndex;else break a}}return first}function compare(a,b){var diff=a.sortIndex-b.sortIndex;return diff!==0?diff:a.id-b.id}function advanceTimers(currentTime){for(var timer=peek(timerQueue);timer!==null;){if(timer.callback===null)pop(timerQueue);else if(timer.startTime<=currentTime)pop(timerQueue),timer.sortIndex=timer.expirationTime,push(taskQueue,timer);else break;timer=peek(timerQueue)}}function handleTimeout(currentTime){if(isHostTimeoutScheduled=!1,advanceTimers(currentTime),!isHostCallbackScheduled)if(peek(taskQueue)!==null)isHostCallbackScheduled=!0,isMessageLoopRunning||(isMessageLoopRunning=!0,schedulePerformWorkUntilDeadline());else{var firstTimer=peek(timerQueue);firstTimer!==null&&requestHostTimeout(handleTimeout,firstTimer.startTime-currentTime)}}function shouldYieldToHost(){return needsPaint?!0:$unstable_now()-startTime<frameInterval?!1:!0}function performWorkUntilDeadline(){if(needsPaint=!1,isMessageLoopRunning){var currentTime=$unstable_now();startTime=currentTime;var hasMoreWork=!0;try{a:{isHostCallbackScheduled=!1,isHostTimeoutScheduled&&(isHostTimeoutScheduled=!1,localClearTimeout(taskTimeoutID),taskTimeoutID=-1),isPerformingWork=!0;var previousPriorityLevel=currentPriorityLevel;try{b:{advanceTimers(currentTime);for(currentTask=peek(taskQueue);currentTask!==null&&!(currentTask.expirationTime>currentTime&&shouldYieldToHost());){var callback=currentTask.callback;if(typeof callback==="function"){currentTask.callback=null,currentPriorityLevel=currentTask.priorityLevel;var continuationCallback=callback(currentTask.expirationTime<=currentTime);if(currentTime=$unstable_now(),typeof continuationCallback==="function"){currentTask.callback=continuationCallback,advanceTimers(currentTime),hasMoreWork=!0;break b}currentTask===peek(taskQueue)&&pop(taskQueue),advanceTimers(currentTime)}else pop(taskQueue);currentTask=peek(taskQueue)}if(currentTask!==null)hasMoreWork=!0;else{var firstTimer=peek(timerQueue);firstTimer!==null&&requestHostTimeout(handleTimeout,firstTimer.startTime-currentTime),hasMoreWork=!1}}break a}finally{currentTask=null,currentPriorityLevel=previousPriorityLevel,isPerformingWork=!1}hasMoreWork=void 0}}finally{hasMoreWork?schedulePerformWorkUntilDeadline():isMessageLoopRunning=!1}}}function requestHostTimeout(callback,ms){taskTimeoutID=localSetTimeout(function(){callback($unstable_now())},ms)}var $unstable_now=void 0,localPerformance,localDate,initialTime,taskQueue,timerQueue,taskIdCounter=1,currentTask=null,currentPriorityLevel=3,isPerformingWork=!1,isHostCallbackScheduled=!1,isHostTimeoutScheduled=!1,needsPaint=!1,localSetTimeout,localClearTimeout,localSetImmediate,isMessageLoopRunning=!1,taskTimeoutID=-1,frameInterval=5,startTime=-1,schedulePerformWorkUntilDeadline,channel,port,$unstable_IdlePriority=5,$unstable_ImmediatePriority=1,$unstable_NormalPriority=3,$unstable_UserBlockingPriority=2,$unstable_cancelCallback=function(task){task.callback=null},$unstable_requestPaint=function(){needsPaint=!0},$unstable_scheduleCallback=function(priorityLevel,callback,options){var currentTime=$unstable_now();switch(typeof options==="object"&&options!==null?(options=options.delay,options=typeof options==="number"&&0<options?currentTime+options:currentTime):options=currentTime,priorityLevel){case 1:var timeout=-1;break;case 2:timeout=250;break;case 5:timeout=1073741823;break;case 4:timeout=1e4;break;default:timeout=5000}return timeout=options+timeout,priorityLevel={id:taskIdCounter++,callback,priorityLevel,startTime:options,expirationTime:timeout,sortIndex:-1},options>currentTime?(priorityLevel.sortIndex=options,push(timerQueue,priorityLevel),peek(taskQueue)===null&&priorityLevel===peek(timerQueue)&&(isHostTimeoutScheduled?(localClearTimeout(taskTimeoutID),taskTimeoutID=-1):isHostTimeoutScheduled=!0,requestHostTimeout(handleTimeout,options-currentTime))):(priorityLevel.sortIndex=timeout,push(taskQueue,priorityLevel),isHostCallbackScheduled||isPerformingWork||(isHostCallbackScheduled=!0,isMessageLoopRunning||(isMessageLoopRunning=!0,schedulePerformWorkUntilDeadline()))),priorityLevel},$unstable_shouldYield;var init_scheduler_production=__esm(()=>{if(typeof performance==="object"&&typeof performance.now==="function")localPerformance=performance,$unstable_now=function(){return localPerformance.now()};else localDate=Date,initialTime=localDate.now(),$unstable_now=function(){return localDate.now()-initialTime};taskQueue=[],timerQueue=[],localSetTimeout=typeof setTimeout==="function"?setTimeout:null,localClearTimeout=typeof clearTimeout==="function"?clearTimeout:null,localSetImmediate=typeof setImmediate<"u"?setImmediate:null;if(typeof localSetImmediate==="function")schedulePerformWorkUntilDeadline=function(){localSetImmediate(performWorkUntilDeadline)};else if(typeof MessageChannel<"u")channel=new MessageChannel,port=channel.port2,channel.port1.onmessage=performWorkUntilDeadline,schedulePerformWorkUntilDeadline=function(){port.postMessage(null)};else schedulePerformWorkUntilDeadline=function(){localSetTimeout(performWorkUntilDeadline,0)};$unstable_shouldYield=shouldYieldToHost});var require_react_reconciler_production=__commonJS((exports,module)=>{init_scheduler_production();var React=__toESM(require_react_production());module.exports=function($$$config){function createFiber(tag,pendingProps,key,mode){return new FiberNode(tag,pendingProps,key,mode)}function noop(){}function formatProdErrorMessage(code){var url="https://react.dev/errors/"+code;if(1<arguments.length){url+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)url+="&args[]="+encodeURIComponent(arguments[i])}return"Minified React error #"+code+"; visit "+url+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function getNearestMountedFiber(fiber){var node=fiber,nearestMounted=fiber;if(fiber.alternate)for(;node.return;)node=node.return;else{fiber=node;do node=fiber,(node.flags&4098)!==0&&(nearestMounted=node.return),fiber=node.return;while(fiber)}return node.tag===3?nearestMounted:null}function assertIsMounted(fiber){if(getNearestMountedFiber(fiber)!==fiber)throw Error(formatProdErrorMessage(188))}function findCurrentFiberUsingSlowPath(fiber){var alternate=fiber.alternate;if(!alternate){if(alternate=getNearestMountedFiber(fiber),alternate===null)throw Error(formatProdErrorMessage(188));return alternate!==fiber?null:fiber}for(var a=fiber,b=alternate;;){var parentA=a.return;if(parentA===null)break;var parentB=parentA.alternate;if(parentB===null){if(b=parentA.return,b!==null){a=b;continue}break}if(parentA.child===parentB.child){for(parentB=parentA.child;parentB;){if(parentB===a)return assertIsMounted(parentA),fiber;if(parentB===b)return assertIsMounted(parentA),alternate;parentB=parentB.sibling}throw Error(formatProdErrorMessage(188))}if(a.return!==b.return)a=parentA,b=parentB;else{for(var didFindChild=!1,child$0=parentA.child;child$0;){if(child$0===a){didFindChild=!0,a=parentA,b=parentB;break}if(child$0===b){didFindChild=!0,b=parentA,a=parentB;break}child$0=child$0.sibling}if(!didFindChild){for(child$0=parentB.child;child$0;){if(child$0===a){didFindChild=!0,a=parentB,b=parentA;break}if(child$0===b){didFindChild=!0,b=parentB,a=parentA;break}child$0=child$0.sibling}if(!didFindChild)throw Error(formatProdErrorMessage(189))}}if(a.alternate!==b)throw Error(formatProdErrorMessage(190))}if(a.tag!==3)throw Error(formatProdErrorMessage(188));return a.stateNode.current===a?fiber:alternate}function findCurrentHostFiberImpl(node){var tag=node.tag;if(tag===5||tag===26||tag===27||tag===6)return node;for(node=node.child;node!==null;){if(tag=findCurrentHostFiberImpl(node),tag!==null)return tag;node=node.sibling}return null}function findCurrentHostFiberWithNoPortalsImpl(node){var tag=node.tag;if(tag===5||tag===26||tag===27||tag===6)return node;for(node=node.child;node!==null;){if(node.tag!==4&&(tag=findCurrentHostFiberWithNoPortalsImpl(node),tag!==null))return tag;node=node.sibling}return null}function getIteratorFn(maybeIterable){if(maybeIterable===null||typeof maybeIterable!=="object")return null;return maybeIterable=MAYBE_ITERATOR_SYMBOL&&maybeIterable[MAYBE_ITERATOR_SYMBOL]||maybeIterable["@@iterator"],typeof maybeIterable==="function"?maybeIterable:null}function getComponentNameFromType(type){if(type==null)return null;if(typeof type==="function")return type.$$typeof===REACT_CLIENT_REFERENCE?null:type.displayName||type.name||null;if(typeof type==="string")return type;switch(type){case REACT_FRAGMENT_TYPE:return"Fragment";case REACT_PROFILER_TYPE:return"Profiler";case REACT_STRICT_MODE_TYPE:return"StrictMode";case REACT_SUSPENSE_TYPE:return"Suspense";case REACT_SUSPENSE_LIST_TYPE:return"SuspenseList";case REACT_ACTIVITY_TYPE:return"Activity"}if(typeof type==="object")switch(type.$$typeof){case REACT_PORTAL_TYPE:return"Portal";case REACT_CONTEXT_TYPE:return type.displayName||"Context";case REACT_CONSUMER_TYPE:return(type._context.displayName||"Context")+".Consumer";case REACT_FORWARD_REF_TYPE:var innerType=type.render;return type=type.displayName,type||(type=innerType.displayName||innerType.name||"",type=type!==""?"ForwardRef("+type+")":"ForwardRef"),type;case REACT_MEMO_TYPE:return innerType=type.displayName||null,innerType!==null?innerType:getComponentNameFromType(type.type)||"Memo";case REACT_LAZY_TYPE:innerType=type._payload,type=type._init;try{return getComponentNameFromType(type(innerType))}catch(x){}}return null}function createCursor(defaultValue){return{current:defaultValue}}function pop2(cursor){0>index$jscomp$0||(cursor.current=valueStack[index$jscomp$0],valueStack[index$jscomp$0]=null,index$jscomp$0--)}function push2(cursor,value){index$jscomp$0++,valueStack[index$jscomp$0]=cursor.current,cursor.current=value}function clz32Fallback(x){return x>>>=0,x===0?32:31-(log$1(x)/LN2|0)|0}function getHighestPriorityLanes(lanes){var pendingSyncLanes=lanes&42;if(pendingSyncLanes!==0)return pendingSyncLanes;switch(lanes&-lanes){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return lanes&261888;case 262144:case 524288:case 1048576:case 2097152:return lanes&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return lanes&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return lanes}}function getNextLanes(root,wipLanes,rootHasPendingCommit){var pendingLanes=root.pendingLanes;if(pendingLanes===0)return 0;var nextLanes=0,suspendedLanes=root.suspendedLanes,pingedLanes=root.pingedLanes;root=root.warmLanes;var nonIdlePendingLanes=pendingLanes&134217727;return nonIdlePendingLanes!==0?(pendingLanes=nonIdlePendingLanes&~suspendedLanes,pendingLanes!==0?nextLanes=getHighestPriorityLanes(pendingLanes):(pingedLanes&=nonIdlePendingLanes,pingedLanes!==0?nextLanes=getHighestPriorityLanes(pingedLanes):rootHasPendingCommit||(rootHasPendingCommit=nonIdlePendingLanes&~root,rootHasPendingCommit!==0&&(nextLanes=getHighestPriorityLanes(rootHasPendingCommit))))):(nonIdlePendingLanes=pendingLanes&~suspendedLanes,nonIdlePendingLanes!==0?nextLanes=getHighestPriorityLanes(nonIdlePendingLanes):pingedLanes!==0?nextLanes=getHighestPriorityLanes(pingedLanes):rootHasPendingCommit||(rootHasPendingCommit=pendingLanes&~root,rootHasPendingCommit!==0&&(nextLanes=getHighestPriorityLanes(rootHasPendingCommit)))),nextLanes===0?0:wipLanes!==0&&wipLanes!==nextLanes&&(wipLanes&suspendedLanes)===0&&(suspendedLanes=nextLanes&-nextLanes,rootHasPendingCommit=wipLanes&-wipLanes,suspendedLanes>=rootHasPendingCommit||suspendedLanes===32&&(rootHasPendingCommit&4194048)!==0)?wipLanes:nextLanes}function checkIfRootIsPrerendering(root,renderLanes2){return(root.pendingLanes&~(root.suspendedLanes&~root.pingedLanes)&renderLanes2)===0}function computeExpirationTime(lane,currentTime){switch(lane){case 1:case 2:case 4:case 8:case 64:return currentTime+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return currentTime+5000;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function claimNextRetryLane(){var lane=nextRetryLane;return nextRetryLane<<=1,(nextRetryLane&62914560)===0&&(nextRetryLane=4194304),lane}function createLaneMap(initial){for(var laneMap=[],i=0;31>i;i++)laneMap.push(initial);return laneMap}function markRootUpdated$1(root,updateLane){root.pendingLanes|=updateLane,updateLane!==268435456&&(root.suspendedLanes=0,root.pingedLanes=0,root.warmLanes=0)}function markRootFinished(root,finishedLanes,remainingLanes,spawnedLane,updatedLanes,suspendedRetryLanes){var previouslyPendingLanes=root.pendingLanes;root.pendingLanes=remainingLanes,root.suspendedLanes=0,root.pingedLanes=0,root.warmLanes=0,root.expiredLanes&=remainingLanes,root.entangledLanes&=remainingLanes,root.errorRecoveryDisabledLanes&=remainingLanes,root.shellSuspendCounter=0;var{entanglements,expirationTimes,hiddenUpdates}=root;for(remainingLanes=previouslyPendingLanes&~remainingLanes;0<remainingLanes;){var index$5=31-clz32(remainingLanes),lane=1<<index$5;entanglements[index$5]=0,expirationTimes[index$5]=-1;var hiddenUpdatesForLane=hiddenUpdates[index$5];if(hiddenUpdatesForLane!==null)for(hiddenUpdates[index$5]=null,index$5=0;index$5<hiddenUpdatesForLane.length;index$5++){var update=hiddenUpdatesForLane[index$5];update!==null&&(update.lane&=-536870913)}remainingLanes&=~lane}spawnedLane!==0&&markSpawnedDeferredLane(root,spawnedLane,0),suspendedRetryLanes!==0&&updatedLanes===0&&root.tag!==0&&(root.suspendedLanes|=suspendedRetryLanes&~(previouslyPendingLanes&~finishedLanes))}function markSpawnedDeferredLane(root,spawnedLane,entangledLanes){root.pendingLanes|=spawnedLane,root.suspendedLanes&=~spawnedLane;var spawnedLaneIndex=31-clz32(spawnedLane);root.entangledLanes|=spawnedLane,root.entanglements[spawnedLaneIndex]=root.entanglements[spawnedLaneIndex]|1073741824|entangledLanes&261930}function markRootEntangled(root,entangledLanes){var rootEntangledLanes=root.entangledLanes|=entangledLanes;for(root=root.entanglements;rootEntangledLanes;){var index$6=31-clz32(rootEntangledLanes),lane=1<<index$6;lane&entangledLanes|root[index$6]&entangledLanes&&(root[index$6]|=entangledLanes),rootEntangledLanes&=~lane}}function getBumpedLaneForHydration(root,renderLanes2){var renderLane=renderLanes2&-renderLanes2;return renderLane=(renderLane&42)!==0?1:getBumpedLaneForHydrationByLane(renderLane),(renderLane&(root.suspendedLanes|renderLanes2))!==0?0:renderLane}function getBumpedLaneForHydrationByLane(lane){switch(lane){case 2:lane=1;break;case 8:lane=4;break;case 32:lane=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:lane=128;break;case 268435456:lane=134217728;break;default:lane=0}return lane}function lanesToEventPriority(lanes){return lanes&=-lanes,2<lanes?8<lanes?(lanes&134217727)!==0?32:268435456:8:2}function setIsStrictModeForDevtools(newIsStrictMode){if(typeof log2==="function"&&unstable_setDisableYieldValue2(newIsStrictMode),injectedHook&&typeof injectedHook.setStrictMode==="function")try{injectedHook.setStrictMode(rendererID,newIsStrictMode)}catch(err){}}function is(x,y){return x===y&&(x!==0||1/x===1/y)||x!==x&&y!==y}function describeBuiltInComponentFrame(name){if(prefix===void 0)try{throw Error()}catch(x){var match=x.stack.trim().match(/\n( *(at )?)/);prefix=match&&match[1]||"",suffix=-1<x.stack.indexOf(`
|
|
3
3
|
at`)?" (<anonymous>)":-1<x.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
4
4
|
`+prefix+name+suffix}function describeNativeComponentFrame(fn,construct){if(!fn||reentry)return"";reentry=!0;var previousPrepareStackTrace=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var RunInRootFrame={DetermineComponentFrameRoot:function(){try{if(construct){var Fake=function(){throw Error()};if(Object.defineProperty(Fake.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==="object"&&Reflect.construct){try{Reflect.construct(Fake,[])}catch(x){var control=x}Reflect.construct(fn,[],Fake)}else{try{Fake.call()}catch(x$8){control=x$8}fn.call(Fake.prototype)}}else{try{throw Error()}catch(x$9){control=x$9}(Fake=fn())&&typeof Fake.catch==="function"&&Fake.catch(function(){})}}catch(sample){if(sample&&control&&typeof sample.stack==="string")return[sample.stack,control.stack]}return[null,null]}};RunInRootFrame.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var namePropDescriptor=Object.getOwnPropertyDescriptor(RunInRootFrame.DetermineComponentFrameRoot,"name");namePropDescriptor&&namePropDescriptor.configurable&&Object.defineProperty(RunInRootFrame.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var _RunInRootFrame$Deter=RunInRootFrame.DetermineComponentFrameRoot(),sampleStack=_RunInRootFrame$Deter[0],controlStack=_RunInRootFrame$Deter[1];if(sampleStack&&controlStack){var sampleLines=sampleStack.split(`
|
|
5
5
|
`),controlLines=controlStack.split(`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{BREAKING_VERSIONS,CURRENT_VERSION,DEFAULT_RELEASE_CHANNEL,PACKAGE_NAME,RELEASE_CHANNELS,UPDATE_COMMAND,UPDATE_SCRIPT_URL,breakingVersionsCrossed,channelOf,checkLatestVersion,compareSemver,fetchReleaseNotes,fetchReleaseNotesRange,fetchReleaseSummaries,isNewerSemver,owningNpmPrefix,recommendedGlobalInstallCommand,releasePageUrl,repoSlug}from"./chunk-
|
|
2
|
+
import{BREAKING_VERSIONS,CURRENT_VERSION,DEFAULT_RELEASE_CHANNEL,PACKAGE_NAME,RELEASE_CHANNELS,UPDATE_COMMAND,UPDATE_SCRIPT_URL,breakingVersionsCrossed,channelOf,checkLatestVersion,compareSemver,fetchReleaseNotes,fetchReleaseNotesRange,fetchReleaseSummaries,isNewerSemver,owningNpmPrefix,recommendedGlobalInstallCommand,releasePageUrl,repoSlug}from"./chunk-e85ttr8r.js";import"./chunk-ch9b1d5y.js";import"./chunk-g56kvet6.js";import"./chunk-r3k9rbwm.js";import"./chunk-wqfp8d9w.js";export{repoSlug,releasePageUrl,recommendedGlobalInstallCommand,owningNpmPrefix,isNewerSemver,fetchReleaseSummaries,fetchReleaseNotesRange,fetchReleaseNotes,compareSemver,checkLatestVersion,channelOf,breakingVersionsCrossed,UPDATE_SCRIPT_URL,UPDATE_COMMAND,RELEASE_CHANNELS,PACKAGE_NAME,DEFAULT_RELEASE_CHANNEL,CURRENT_VERSION,BREAKING_VERSIONS};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{SUBCOMMAND_VERBS}from"./chunk-s76r56rj.js";import{expandTilde}from"./chunk-msr1xtay.js";import{errorMessage}from"./chunk-2brn8e1y.js";import"./chunk-ch9b1d5y.js";import{activeCliName}from"./chunk-
|
|
2
|
+
import{SUBCOMMAND_VERBS}from"./chunk-s76r56rj.js";import{expandTilde}from"./chunk-msr1xtay.js";import{errorMessage}from"./chunk-2brn8e1y.js";import"./chunk-ch9b1d5y.js";import{activeCliName}from"./chunk-v0zxyqrq.js";import"./chunk-e29hx18x.js";import"./chunk-g56kvet6.js";import"./chunk-r3k9rbwm.js";import{__require}from"./chunk-wqfp8d9w.js";import{readFileSync}from"fs";import{resolve}from"path";var CLI_NAME=activeCliName(),REPO_USAGE=[`Usage: ${CLI_NAME} repo <show|set|unset> [path] [options]`,"","Manage a repo's per-user init override (state.json fallback for repos","that don't ship .rove/init.sh / .rove/init-prompt.md).","","Commands:"," show [path] Print the override + repo convention files"," set [path] <options> Set the init script and/or first prompt"," unset [path] [--init-script] [--init-prompt] Clear one or both (default: both)","","Set options (later wins; *-file reads from disk):"," --init-script <text> Inline shell to run before the engine"," --init-script-file <path> Read the init script from a file"," --init-prompt <text> Inline first prompt for the engine"," --init-prompt-file <path> Read the first prompt from a file",""," path defaults to the current directory (resolved to its git toplevel).",""].join(`
|
|
3
3
|
`);function usageError(message){process.stderr.write(`${CLI_NAME} repo: ${message}
|
|
4
4
|
|
|
5
5
|
${REPO_USAGE}
|
|
6
6
|
`),process.exit(2)}function readArgFile(path){try{return readFileSync(resolve(process.cwd(),expandTilde(path)),"utf8")}catch(err){usageError(`cannot read ${path}: ${errorMessage(err)}`)}}function parseRepoArgs(args){let out={};for(let i=0;i<args.length;i++){let a=args[i],need=()=>{let v=args[++i];if(v===void 0)usageError(`${a} requires a value`);return v};if(a==="--init-script")out.initScript=need();else if(a==="--init-script-file")out.initScript=readArgFile(need());else if(a==="--init-prompt")out.initPrompt=need();else if(a==="--init-prompt-file")out.initPrompt=readArgFile(need());else if(a.startsWith("-"))usageError(`unknown flag "${a}"`);else if(out.path===void 0)out.path=a;else usageError(`unexpected argument "${a}"`)}return out}function parseUnsetArgs(args){let path,clearScript=!1,clearPrompt=!1;for(let a of args)if(a==="--init-script")clearScript=!0;else if(a==="--init-prompt")clearPrompt=!0;else if(a.startsWith("-"))usageError(`unknown flag "${a}"`);else if(path===void 0)path=a;else usageError(`unexpected argument "${a}"`);if(!clearScript&&!clearPrompt)clearScript=!0,clearPrompt=!0;return{path,clearScript,clearPrompt}}async function runRepoSubcommand(args){let[verb,...rest]=args;if(verb===void 0||verb==="--help"||verb==="-h"||verb==="help"){process.stdout.write(`${REPO_USAGE}
|
|
7
|
-
`);return}if(!SUBCOMMAND_VERBS.repo.includes(verb))usageError(`unknown verb "${verb}"`);let{getRepoInitOverride,setRepoInitOverride,resolveRepoRoot}=await import("./chunk-mp8v5gn8.js");if(verb==="show"){let[pathArg]=rest.filter((a)=>!a.startsWith("-")),repo=resolveRepoRoot(resolve(process.cwd(),expandTilde(pathArg??"."))),override=getRepoInitOverride(repo),{describeRepoInitSources}=await import("./chunk-
|
|
7
|
+
`);return}if(!SUBCOMMAND_VERBS.repo.includes(verb))usageError(`unknown verb "${verb}"`);let{getRepoInitOverride,setRepoInitOverride,resolveRepoRoot}=await import("./chunk-mp8v5gn8.js");if(verb==="show"){let[pathArg]=rest.filter((a)=>!a.startsWith("-")),repo=resolveRepoRoot(resolve(process.cwd(),expandTilde(pathArg??"."))),override=getRepoInitOverride(repo),{describeRepoInitSources}=await import("./chunk-cdxme5y4.js"),sources=describeRepoInitSources(repo);console.log(`repo: ${repo}`);for(let group of[sources.script,sources.prompt])group.forEach((source,index)=>{console.log(` ${`${source.rel}:`.padEnd(22)}${describeSource(group,index)}`)});console.log(` override initScript: ${override.initScript?quotePreview(override.initScript):"(unset)"}`),console.log(` override initPrompt: ${override.initPrompt?quotePreview(override.initPrompt):"(unset)"}`);return}if(verb==="set"){let flags=parseRepoArgs(rest);if(flags.initScript===void 0&&flags.initPrompt===void 0)usageError("set needs at least one of --init-script(-file) / --init-prompt(-file)");let repo=resolveRepoRoot(resolve(process.cwd(),expandTilde(flags.path??"."))),next=setRepoInitOverride(repo,{...flags.initScript!==void 0?{initScript:flags.initScript}:{},...flags.initPrompt!==void 0?{initPrompt:flags.initPrompt}:{}});console.log(`updated override for ${repo}`),console.log(` initScript: ${next.initScript?quotePreview(next.initScript):"(unset)"}`),console.log(` initPrompt: ${next.initPrompt?quotePreview(next.initPrompt):"(unset)"}`);return}if(verb==="unset"){let{path,clearScript,clearPrompt}=parseUnsetArgs(rest),repo=resolveRepoRoot(resolve(process.cwd(),expandTilde(path??"."))),next=setRepoInitOverride(repo,{...clearScript?{initScript:""}:{},...clearPrompt?{initPrompt:""}:{}});console.log(`cleared override for ${repo}`),console.log(` initScript: ${next.initScript?quotePreview(next.initScript):"(unset)"}`),console.log(` initPrompt: ${next.initPrompt?quotePreview(next.initPrompt):"(unset)"}`);return}usageError(`unknown verb "${verb}"`)}function describeSource(group,index){let source=group[index];if(!source)return"absent";if(source.effective)return"present (wins)";if(!source.present)return"absent";return group.slice(0,index).some((earlier)=>earlier.effective)?"present (shadowed)":"present but empty (ignored)"}function quotePreview(value){let oneLine=value.replace(/\s+/g," ").trim();return oneLine.length>60?`"${oneLine.slice(0,57)}\u2026"`:`"${oneLine}"`}export{runRepoSubcommand};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{RemoteExecHost}from"./chunk-bkba9c4n.js";import{getKeychainPassword,isKeychainSupported,remoteKeychainRef,setKeychainPassword}from"./chunk-g2advs8t.js";import"./chunk-2fypr41w.js";import{addRemoteRepo,isRemoteProjectsEnabled}from"./chunk-kt1ppyje.js";import"./chunk-5v893waj.js";import"./chunk-a3a9gdc4.js";import{errorMessage}from"./chunk-2brn8e1y.js";import"./chunk-3wj69b0a.js";import{remoteControlSocketPath}from"./chunk-ch9b1d5y.js";import{activeCliName}from"./chunk-
|
|
2
|
+
import{RemoteExecHost}from"./chunk-bkba9c4n.js";import{getKeychainPassword,isKeychainSupported,remoteKeychainRef,setKeychainPassword}from"./chunk-g2advs8t.js";import"./chunk-2fypr41w.js";import{addRemoteRepo,isRemoteProjectsEnabled}from"./chunk-kt1ppyje.js";import"./chunk-5v893waj.js";import"./chunk-a3a9gdc4.js";import{errorMessage}from"./chunk-2brn8e1y.js";import"./chunk-3wj69b0a.js";import{remoteControlSocketPath}from"./chunk-ch9b1d5y.js";import{activeCliName}from"./chunk-v0zxyqrq.js";import"./chunk-e29hx18x.js";import"./chunk-g56kvet6.js";import"./chunk-r3k9rbwm.js";import"./chunk-wqfp8d9w.js";import{createInterface}from"readline";var CLI_NAME=activeCliName(),USAGE=`Usage: ${CLI_NAME} add --remote --host <host> --user <user> --path <basePath>
|
|
3
3
|
[--port N] [--key [path] | --password]
|
|
4
4
|
|
|
5
5
|
Register an experimental SSH-backed project. Worktrees are created on <host>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{applyFixes,daemonRestartFix,defaultFixRuntime,engineTabsManualFix,humanOnlyFix,killOrphansManualFix,noEngineFix,probeEngines,probeGit,reinstallManualFix,resetManualFix,skillInstallFix,spawnHelperFix}from"./chunk-
|
|
2
|
+
import{applyFixes,daemonRestartFix,defaultFixRuntime,engineTabsManualFix,humanOnlyFix,killOrphansManualFix,noEngineFix,probeEngines,probeGit,reinstallManualFix,resetManualFix,skillInstallFix,spawnHelperFix}from"./chunk-g48s150x.js";import{formatBytes}from"./chunk-my20q579.js";import"./chunk-ny31s73y.js";import"./chunk-y7szq7xb.js";import"./chunk-39x1ztey.js";import"./chunk-41ahvk51.js";import{kobeSkillState,skillInstallCommand}from"./chunk-gkmpfpmn.js";import{inspectLegacyTmux,legacyTmuxDoctorLines}from"./chunk-dqndd97s.js";import"./chunk-rz8zs7j8.js";import"./chunk-h4n8ffqy.js";import"./chunk-vyb5a2rh.js";import"./chunk-r2pztgm6.js";import"./chunk-38272eqv.js";import"./chunk-5f80ggc3.js";import{CURRENT_VERSION,package_default}from"./chunk-e85ttr8r.js";import{resolveNodeBinary}from"./chunk-wdhcrcre.js";import"./chunk-y8yyk9hq.js";import"./chunk-1cjd7h8p.js";import"./chunk-b99tf0jr.js";import"./chunk-x6hevxs5.js";import{t}from"./chunk-9wn8m2rt.js";import"./chunk-w06vgba4.js";import"./chunk-sdyzxayr.js";import"./chunk-jvxh93nz.js";import{isStaleInstallError,resolveKobeSpawn}from"./chunk-4502n1bk.js";import"./chunk-nm0pq5r6.js";import{readPidFile}from"./chunk-mqqnk8w7.js";import{KobeDaemonClient}from"./chunk-0wnfq5sx.js";import{isForeignDaemonHome}from"./chunk-7j5372wb.js";import"./chunk-mnqxgvyb.js";import"./chunk-ztx1pfqv.js";import"./chunk-zmvsqfad.js";import"./chunk-sfv15era.js";import"./chunk-w7zv47mp.js";import"./chunk-gwcneg6c.js";import"./chunk-a2xndedd.js";import"./chunk-7jkf3tvr.js";import"./chunk-2fypr41w.js";import"./chunk-kt1ppyje.js";import"./chunk-5v893waj.js";import{readableLegacyIndexPath}from"./chunk-w68k2kdb.js";import"./chunk-xy8be792.js";import"./chunk-a3a9gdc4.js";import"./chunk-2brn8e1y.js";import"./chunk-3wj69b0a.js";import{homeDir,kvStatePath,roveStateDir}from"./chunk-ch9b1d5y.js";import"./chunk-bq3fyc0p.js";import{activeCliName}from"./chunk-v0zxyqrq.js";import"./chunk-e29hx18x.js";import{LEGACY_KOBE_STATE_DIR_BASENAME}from"./chunk-g56kvet6.js";import"./chunk-k2ckx8zw.js";import"./chunk-pw6yfj10.js";import"./chunk-nyv7a76k.js";import"./chunk-rxvbm4vt.js";import{defaultDaemonLogPath,defaultDaemonPidPath,defaultDaemonSocketPath,defaultPtyHostLogPath,defaultPtyHostPidPath,defaultPtyHostSocketPath}from"./chunk-mcdv19rs.js";import"./chunk-r3k9rbwm.js";import{__require}from"./chunk-wqfp8d9w.js";import{existsSync,readFileSync as readFileSync2,statSync as statSync2}from"fs";import{join as join2}from"path";var MIN_BUN_VERSION=package_default.engines.bun.match(/\d+\.\d+\.\d+/)?.[0]??"0.0.0";function parseBunVersion(raw){return raw.trim().match(/^v?(\d+\.\d+\.\d+)/)?.[1]??null}function isBunAtLeast(raw,minimum=MIN_BUN_VERSION){let found=parseBunVersion(raw),floor=parseBunVersion(minimum);if(!found||!floor)return!0;let a=found.split(".").map(Number),b=floor.split(".").map(Number);for(let i=0;i<3;i++){let av=a[i]??0,bv=b[i]??0;if(av!==bv)return av>bv}return!0}function classifyHookChannel(input){let total=0,hooked=0;for(let tabs of Object.values(input.tabs))for(let entry of Object.values(tabs))if(total++,entry.source==="hook")hooked++;if(total===0)return{kind:"no-tabs"};if(hooked===0)return{kind:"down",totalTabs:total};return{kind:"live",hookTabs:hooked,totalTabs:total}}function hookChannelDoctorLines(verdict,input,cliName){if(verdict.kind==="no-tabs")return["hooks: \u2014 no engine tabs yet (nothing to check)"];if(verdict.kind==="live")return[`hooks: \u2713 engine hook channel live (${verdict.hookTabs}/${verdict.totalTabs} tab(s) hook-sourced)`];let out=[`hooks: \u2717 NO hook events reaching the daemon (0/${verdict.totalTabs} tab(s) hook-sourced)`," badges fall back to a ~10s poll, so activity looks seconds late",` daemon socket: ${input.socketPath}`];return out.push(' \u2192 compare with an engine tab\'s own path: `ps eww -p <engine-pid> | tr " " "\\n" | grep DAEMON_SOCKET_PATH`',` \u2192 restart the engine tabs (they may hold a stale socket path), or run \`${cliName} daemon restart\``,` \u2192 debug one hook directly: \`KOBE_HOOK_DEBUG=1 echo '{}' | ${cliName} hook turn-start --engine claude\``),out}import{readdirSync,statSync}from"fs";import{createRequire}from"module";import{dirname,join}from"path";function installedSpawnHelpers(){let pkg;try{pkg=dirname(createRequire(import.meta.url).resolve("node-pty/package.json"))}catch{return[]}let prebuilds=join(pkg,"prebuilds"),arches;try{arches=readdirSync(prebuilds).filter((name)=>name.startsWith("darwin-"))}catch{return[]}let helpers=[];for(let arch of arches){let path=join(prebuilds,arch,"spawn-helper");try{helpers.push({path,executable:(statSync(path).mode&64)!==0})}catch{}}return helpers}function spawnHelperDoctorLines(helpers){let broken=helpers.filter((helper)=>!helper.executable).map((helper)=>helper.path);if(helpers.length===0)return{lines:["node-pty: ? no darwin spawn-helper found next to node-pty"],broken};if(broken.length===0)return{lines:[`node-pty: \u2713 spawn-helper executable (${helpers.length} arch)`],broken};return{lines:["node-pty: \u2717 spawn-helper is not executable \u2014 every node-pty PTY spawn fails",...broken.map((path)=>` ${path}`),` \u2192 chmod 755 ${broken.join(" ")}`],broken}}import{readFileSync}from"fs";var PTY_MARKER="KOBE_TERMINAL_PTY=1",run=async(argv)=>{try{let proc=Bun.spawn([...argv],{stdin:"ignore",stdout:"pipe",stderr:"ignore"}),[stdout,code]=await Promise.all([new Response(proc.stdout).text().catch(()=>""),proc.exited]);return{code,stdout}}catch{return{code:127,stdout:""}}};function parsePsRows(output){let rows=[];for(let line of output.split(`
|
|
3
3
|
`)){let parts=line.trim().split(/\s+/);if(parts.length<6)continue;let[pid,ppid,pgid]=[parts[0],parts[1],parts[2]].map((value)=>Number.parseInt(value??"",10)),rssKb=Number.parseInt(parts[4]??"",10);if(!Number.isFinite(pid)||!Number.isFinite(ppid)||!Number.isFinite(pgid)||!Number.isFinite(rssKb))continue;rows.push({pid,ppid,pgid,etime:parts[3]??"",rssKb,command:parts.slice(5).join(" ")})}return rows}function pidAlive(pid,rows){return rows.some((row)=>row.pid===pid)}function orphanCandidates(rows,selfPgid,liveSessionPids){return rows.filter((row)=>row.ppid===1&&row.pgid!==selfPgid&&!liveSessionPids.has(row.pgid)&&!pidAlive(row.pgid,rows))}async function markedPids(pids,deps={}){let runProbe=deps.run??run,readEnviron=deps.readEnviron??((pid)=>readFileSync(`/proc/${pid}/environ`,"utf8")),marked=new Set;if(pids.length===0)return{marked,failed:null};if((deps.platform??process.platform)==="linux"){let refused=null;for(let pid of pids)try{if(readEnviron(pid).split("\x00").includes(PTY_MARKER))marked.add(pid)}catch(err){let code=err.code;if(code!=="ENOENT"&&code!=="ESRCH")refused??=`/proc/${pid}/environ: ${code??"unreadable"}`}return{marked,failed:refused}}let result=await runProbe(["ps","eww","-o","pid=,command=","-p",pids.join(",")]);if(result.code!==0)return{marked,failed:`ps eww exited ${result.code}`};let marker=new RegExp(`(^|\\s)${PTY_MARKER}(\\s|$)`);for(let line of result.stdout.split(`
|
|
4
4
|
`)){let pid=Number.parseInt(line.trim().split(/\s+/)[0]??"",10);if(Number.isFinite(pid)&&marker.test(line))marked.add(pid)}return{marked,failed:null}}async function ownPgid(runProbe){let result=await runProbe(["ps","-o","pgid=","-p",String(process.pid)]),pgid=Number.parseInt(result.stdout.trim(),10);return Number.isFinite(pgid)?pgid:-1}async function collectOrphans(liveSessionPids,deps={}){let runProbe=deps.run??run;if((deps.platform??process.platform)==="win32")return{orphans:[],error:null};let ps=await runProbe(["ps","-A","-o","pid=,ppid=,pgid=,etime=,rss=,command="]);if(ps.code!==0)return{orphans:[],error:`could not read the process table \u2014 ps exited ${ps.code}`};let rows=parsePsRows(ps.stdout),candidates=orphanCandidates(rows,await ownPgid(runProbe),liveSessionPids),{marked,failed}=await markedPids(candidates.map((row)=>row.pid),deps);if(failed)return{orphans:[],error:`could not read process environments \u2014 ${failed}`};return{orphans:candidates.filter((row)=>marked.has(row.pid)),error:null}}function formatMb(rssKb){return`${(rssKb/1024).toFixed(0)} MB`}function orphanDoctorLines(orphans,error,cliName,killing=!1){if(error)return[`orphans: \u2717 ${error}`];if(orphans.length===0)return["orphans: \u2713 none \u2014 no processes left behind by a dead PTY session"];let totalMb=orphans.reduce((sum,row)=>sum+row.rssKb,0)/1024,lines=[`orphans: \u26A0 ${orphans.length} process(es) outlived the PTY session that spawned them (${totalMb.toFixed(0)} MB RSS)`," each is reparented to init, carries Rove's PTY marker, and its process"," group leader is gone \u2014 no live task owns them"];for(let row of[...orphans].sort((a,b)=>b.rssKb-a.rssKb))lines.push(` pid ${row.pid} (group ${row.pgid}) up ${row.etime}, ${formatMb(row.rssKb)}: ${row.command.slice(0,90)}`);if(!killing)lines.push(` \u2192 \`${cliName} doctor --kill-orphans\` ends those process groups (SIGTERM, then SIGKILL)`," read the list first: something you backgrounded from a Rove terminal and then"," closed the tab on looks exactly like a leak, and doctor cannot tell them apart");return lines}var GROUP_EXIT_GRACE_MS=2000,GROUP_POLL_MS=100;function groupAlive(pgid){try{return process.kill(-pgid,0),!0}catch(err){return err.code!=="ESRCH"}}async function killOrphanGroups(orphans){let groups=[...new Set(orphans.map((row)=>row.pgid))];for(let pgid of groups)try{process.kill(-pgid,"SIGTERM")}catch{}let deadline=Date.now()+GROUP_EXIT_GRACE_MS,survivors=groups.filter(groupAlive);while(survivors.length>0&&Date.now()<deadline)await new Promise((resolve)=>setTimeout(resolve,GROUP_POLL_MS)),survivors=survivors.filter(groupAlive);for(let pgid of survivors)try{process.kill(-pgid,"SIGKILL")}catch{}return await new Promise((resolve)=>setTimeout(resolve,GROUP_POLL_MS)),{groups,survivors:survivors.filter(groupAlive)}}function multiplexerLabel(env){if(env.TMUX)return"tmux";if(env.ZELLIJ)return"zellij";if(env.STY)return"screen";return"no"}function terminalEnvLines(env){let show=(v)=>v&&v.length>0?v:"(unset)",program=env.TERM_PROGRAM?`${env.TERM_PROGRAM}${env.TERM_PROGRAM_VERSION?` v${env.TERM_PROGRAM_VERSION}`:""}`:"(unset)";return[`terminal: TERM=${show(env.TERM)} TERM_PROGRAM=${program} COLORTERM=${show(env.COLORTERM)}`,` running inside a multiplexer: ${multiplexerLabel(env)}`]}function parseKittyProbeReply(data){let kitty=data.match(/\x1b\[\?(\d+)u/);if(kitty?.[1]!==void 0)return{kind:"supported",flags:Number.parseInt(kitty[1],10)};if(/\x1b\[\?[\d;]*c/.test(data))return{kind:"unsupported"};return null}function kittyProbeLine(result){switch(result.kind){case"supported":return` kitty keyboard protocol: \u2713 answered (flags=${result.flags})`;case"unsupported":return[" kitty keyboard protocol: \u2717 not supported \u2014 legacy key path"," (ctrl+h/ctrl+j arrive as C0 backspace/linefeed bytes; the"," split chords ctrl+\\ and ctrl+= cannot be encoded at all)"].join(`
|
|
5
5
|
`);case"no-response":return" kitty keyboard protocol: ? no reply (terminal ignored both the kitty query and DA1)";case"skipped":return` kitty keyboard protocol: skipped (${result.reason})`}}async function probeKittyKeyboard(timeoutMs=300){let stdin=process.stdin;if(!stdin.isTTY||!process.stdout.isTTY)return{kind:"skipped",reason:"not an interactive terminal"};let wasRaw=stdin.isRaw===!0,buffer="";return await new Promise((resolve)=>{let done=!1,finish=(result)=>{if(done)return;if(done=!0,clearTimeout(timer),stdin.off("data",onData),stdin.pause(),!wasRaw)stdin.setRawMode(!1);resolve(result)},onData=(chunk)=>{buffer+=chunk.toString("latin1");let decided=parseKittyProbeReply(buffer);if(decided)finish(decided)},timer=setTimeout(()=>finish({kind:"no-response"}),timeoutMs);stdin.setRawMode(!0),stdin.resume(),stdin.on("data",onData),process.stdout.write("\x1B[?u\x1B[c")})}async function terminalDoctorLines(){return[...terminalEnvLines(process.env),kittyProbeLine(await probeKittyKeyboard())]}var CLI_NAME=activeCliName();function isProcessAlive(pid){try{return process.kill(pid,0),!0}catch(err){return err.code==="EPERM"}}async function requestIfReachable(socketPath,name){let client=new KobeDaemonClient(socketPath);try{return await client.request(name,{})}catch{return null}finally{client.close()}}function fmtDuration(ms){let seconds=Math.floor(ms/1000);if(seconds<60)return`${seconds}s`;let minutes=Math.floor(seconds/60);if(minutes<60)return`${minutes}m ${seconds%60}s`;return`${Math.floor(minutes/60)}h ${minutes%60}m`}function describeFile(path){try{let stat=statSync2(path);return`present (${formatBytes(stat.size)}, modified ${stat.mtime.toISOString()})`}catch{return"absent"}}function taskCount(path){try{let parsed=JSON.parse(readFileSync2(path,"utf8"));return Array.isArray(parsed.tasks)?parsed.tasks.length:null}catch{return null}}function tailFile(path,count){try{return readFileSync2(path,"utf8").split(`
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{migrateRoveClientStateLayout}from"./chunk-
|
|
2
|
+
import{migrateRoveClientStateLayout}from"./chunk-e29hx18x.js";import{LEGACY_KOBE_PRODUCT_NAME,ROVE_PRODUCT_NAME}from"./chunk-g56kvet6.js";import{installRoveEnvCompatibility}from"./chunk-r3k9rbwm.js";var INVOKED_AS_ENV="ROVE_INVOKED_AS";function markRoveInvocation(env=process.env){env[INVOKED_AS_ENV]=ROVE_PRODUCT_NAME}function markKobeInvocation(env=process.env){env[INVOKED_AS_ENV]=LEGACY_KOBE_PRODUCT_NAME}function prepareCliEnvironment(env=process.env){installRoveEnvCompatibility(env)}function prepareCliStateLayout(env=process.env){let result=migrateRoveClientStateLayout(env);for(let warning of result.warnings)console.error(`[rove] state migration will retry: ${warning}`)}function activeCliName(env=process.env){return env[INVOKED_AS_ENV]===ROVE_PRODUCT_NAME?ROVE_PRODUCT_NAME:LEGACY_KOBE_PRODUCT_NAME}
|
|
3
3
|
export{markRoveInvocation,markKobeInvocation,prepareCliEnvironment,prepareCliStateLayout,activeCliName};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{toTaskId}from"./chunk-xy8be792.js";import{LockfileError,acquire}from"./chunk-a3a9gdc4.js";import{coerceVendorId}from"./chunk-bq3fyc0p.js";import{DAEMON_MIGRATION_MARKER}from"./chunk-4pmd0mxp.js";import{logClient}from"./chunk-k2ckx8zw.js";import{defaultClientLogPath}from"./chunk-mcdv19rs.js";import{existsSync}from"fs";import{copyFile,readFile}from"fs/promises";import{dirname,join}from"path";function coerceTask(value){if(!value||typeof value!=="object")return null;let v=value;if(typeof v.id!=="string"||typeof v.title!=="string"||typeof v.repo!=="string"||typeof v.branch!=="string"||typeof v.worktreePath!=="string"||typeof v.status!=="string"||typeof v.createdAt!=="string"||typeof v.updatedAt!=="string")return null;if(!isTaskStatus(v.status))return null;let kind=v.kind==="main"?"main":v.kind==="dir"?"dir":"task",scratch=kind==="dir"&&v.scratch===!0,healedStatus=kind==="main"&&(v.status==="in_progress"||v.status==="done")?"backlog":v.status,deletion=coerceDeletion(v.deletion),quotaResume=coerceQuotaResume(v.quotaResume),linkedWorkItem=coerceLinkedWorkItem(v.linkedWorkItem),dispatcher=coerceDispatcher(v.dispatcher),routine=coerceRoutine(v.routine);return{id:toTaskId(v.id),title:v.title,repo:v.repo,branch:v.branch,worktreePath:v.worktreePath,status:healedStatus,pinned:typeof v.pinned==="boolean"?v.pinned:!1,kind,...scratch?{scratch:!0}:{},...routine?{routine}:{},vendor:coerceVendorId(typeof v.vendor==="string"?v.vendor:void 0),...typeof v.command==="string"&&v.command.trim().length>0?{command:v.command}:{},prStatus:coercePRStatus(v.prStatus),...typeof v.modelEffort==="string"&&v.modelEffort.length>0?{modelEffort:v.modelEffort}:{},...typeof v.groupId==="string"&&v.groupId.length>0?{groupId:v.groupId}:{},...v.observedLanguage==="zh"||v.observedLanguage==="en"?{observedLanguage:v.observedLanguage}:{},...deletion?{deletion}:{},...quotaResume?{quotaResume}:{},...linkedWorkItem?{linkedWorkItem}:{},...dispatcher?{dispatcher}:{},...typeof v.prompt==="string"&&v.prompt.length>0?{prompt:v.prompt}:{},...typeof v.baseRef==="string"&&v.baseRef.trim().length>0?{baseRef:v.baseRef}:{},createdAt:v.createdAt,updatedAt:v.updatedAt}}function coerceDispatcher(value){if(!value||typeof value!=="object"||Array.isArray(value))return;let v=value;if(typeof v.taskId!=="string"||v.taskId.length===0)return;if(typeof v.tabId!=="string"||v.tabId.length===0)return;return{taskId:v.taskId,tabId:v.tabId}}function coerceRoutine(value){if(!value||typeof value!=="object"||Array.isArray(value))return;let v=value;if(typeof v.automationId!=="string"||v.automationId.length===0)return;return{automationId:v.automationId}}function coerceQuotaResume(value){if(!value||typeof value!=="object"||Array.isArray(value))return;let v=value;if(typeof v.resumeAt!=="string"||v.resumeAt.length===0)return;if(typeof v.requestedAt!=="string"||v.requestedAt.length===0)return;return{resumeAt:v.resumeAt,requestedAt:v.requestedAt}}function coerceLinkedWorkItem(value){if(!value||typeof value!=="object"||Array.isArray(value))return;let v=value;if(v.provider!=="github")return;if(v.type!=="issue"&&v.type!=="pr")return;if(typeof v.number!=="number"||!Number.isFinite(v.number))return;if(typeof v.title!=="string"||typeof v.url!=="string"||v.url.length===0)return;return{provider:v.provider,type:v.type,number:v.number,title:v.title,url:v.url}}function coerceDeletion(value){if(!value||typeof value!=="object"||Array.isArray(value))return;let v=value;if(v.phase!=="queued"&&v.phase!=="running"&&v.phase!=="error"||typeof v.force!=="boolean"||typeof v.requestedAt!=="string"||v.requestedAt.length===0||v.error!==void 0&&typeof v.error!=="string")return;return{phase:v.phase,force:v.force,...typeof v.deleteBranch==="boolean"?{deleteBranch:v.deleteBranch}:{},requestedAt:v.requestedAt,...typeof v.error==="string"?{error:v.error}:{}}}function coercePRStatus(value){if(!value||typeof value!=="object"||Array.isArray(value))return;let v=value;if(!isPRProviderId(v.provider)||!isPRLifecycleState(v.lifecycle)||!isPRCheckState(v.checkState))return;return{provider:v.provider,lifecycle:v.lifecycle,checkState:v.checkState,...typeof v.number==="number"&&Number.isFinite(v.number)?{number:v.number}:{},...typeof v.url==="string"?{url:v.url}:{},...typeof v.title==="string"?{title:v.title}:{},...typeof v.baseRef==="string"?{baseRef:v.baseRef}:{},...typeof v.reviewDecision==="string"?{reviewDecision:v.reviewDecision}:{},...typeof v.mergeable==="string"?{mergeable:v.mergeable}:{},...typeof v.lastCheckedAt==="string"?{lastCheckedAt:v.lastCheckedAt}:{},...typeof v.lastError==="string"?{lastError:v.lastError}:{}}}function isPRProviderId(v){return v==="github"||v==="gitlab"||v==="bitbucket"||v==="unknown"}function isPRLifecycleState(v){return v==="creating"||v==="open"||v==="ready_to_merge"||v==="merged"||v==="closed"||v==="unknown"}function isPRCheckState(v){return v==="none"||v==="pending"||v==="passing"||v==="failing"||v==="unknown"}function isTaskStatus(s){return s==="backlog"||s==="in_progress"||s==="in_review"||s==="done"||s==="canceled"||s==="error"}var sleep=(ms)=>new Promise((resolve)=>setTimeout(resolve,ms)),LOCK_RETRY_DELAY_MS=25,LOCK_MAX_WAIT_MS=5000;async function acquireWithRetry(lockPath){let deadline=Date.now()+LOCK_MAX_WAIT_MS;for(;;)try{return await acquire(lockPath)}catch(err){if(!(err instanceof LockfileError)||Date.now()>=deadline)throw err;await sleep(LOCK_RETRY_DELAY_MS)}}var CURRENT_VERSION=3;async function backupCorruptManifest(path,now=()=>new Date){let backupPath=`${path}.corrupt-${now().toISOString().replaceAll(":","-")}`;try{return await copyFile(path,backupPath),backupPath}catch{return null}}var SUPPORTED_VERSIONS=new Set([1,2,3]);function warnManifestRecovery(message,manifestPath){console.warn(message),logClient("tasks-index",message,manifestPath?defaultClientLogPath(dirname(dirname(manifestPath))):void 0)}async function recoverUnsupportedVersion(parsed,sourcePath){if(!parsed||typeof parsed!=="object"||Array.isArray(parsed))return!1;let version=parsed.version;if(version===void 0||SUPPORTED_VERSIONS.has(version))return!1;let backup=await backupCorruptManifest(sourcePath);return warnManifestRecovery(`[rove] tasks.json at ${sourcePath} has unsupported version=${String(version)}; recovering with empty index.${backup?` Original bytes backed up to ${backup}.`:" Backup copy failed; the stale file is left in place."}`,sourcePath),!0}function normalizeIndex(parsed,source){if(!parsed||typeof parsed!=="object"||Array.isArray(parsed))return warnManifestRecovery(`[rove] tasks.json at ${source} is not an object; recovering with empty index.`,source),{version:CURRENT_VERSION,tasks:[]};let obj=parsed,version=obj.version;if(version!==void 0&&!SUPPORTED_VERSIONS.has(version))return warnManifestRecovery(`[rove] tasks.json at ${source} has unsupported version=${String(version)}; recovering with empty index.`,source),{version:CURRENT_VERSION,tasks:[]};let rawTasks=Array.isArray(obj.tasks)?obj.tasks:[],tasks=[];for(let entry of rawTasks){let task=coerceTask(entry);if(task)tasks.push(task);else console.warn(`[rove] dropping malformed task entry from ${source}: ${JSON.stringify(entry)}`)}return{version:CURRENT_VERSION,tasks}}var TOMBSTONE_TTL_MS=2592000000;function readableLegacyIndexPath(canonicalPath,legacyPath){return existsSync(join(dirname(canonicalPath),DAEMON_MIGRATION_MARKER))?void 0:legacyPath}async function readDiskIndex(path,legacyPath){let raw,sourcePath=path;try{raw=await readFile(sourcePath,"utf8")}catch(err){if(err.code!=="ENOENT")throw err;let legacy=readableLegacyIndexPath(path,legacyPath);if(!legacy)return{tasks:[],removed:[]};sourcePath=legacy;try{raw=await readFile(sourcePath,"utf8")}catch(legacyErr){if(legacyErr.code==="ENOENT")return{tasks:[],removed:[]};throw legacyErr}}let parsed;try{parsed=JSON.parse(raw)}catch{return await backupCorruptManifest(sourcePath),{tasks:[],removed:[]}}if(await recoverUnsupportedVersion(parsed,sourcePath))return{tasks:[],removed:[]};return{tasks:normalizeIndex(parsed,sourcePath).tasks,removed:coerceTombstones(parsed)}}function coerceTombstones(parsed){if(!parsed||typeof parsed!=="object"||Array.isArray(parsed))return[];let raw=parsed.removed;if(!Array.isArray(raw))return[];let out=[];for(let entry of raw){if(!entry||typeof entry!=="object")continue;let v=entry;if(typeof v.id==="string"&&v.id.length>0&&typeof v.at==="string")out.push({id:v.id,at:v.at})}return out}function mergeTasksWithDisk(cacheTasks,diskTasks,dirty,removed,diskRemoved=[],now=Date.now()){let tombstones=new Map;for(let t of diskRemoved){let at=Date.parse(t.at);if(!Number.isFinite(at)||now-at>TOMBSTONE_TTL_MS)continue;tombstones.set(t.id,t.at)}for(let[id,at]of removed)tombstones.set(id,at);let diskById=new Map(diskTasks.map((t)=>[t.id,t])),result=[],included=new Set;for(let task of cacheTasks){if(tombstones.has(task.id))continue;if(dirty.has(task.id))result.push(task);else{let onDisk=diskById.get(task.id);if(onDisk===void 0)continue;result.push(onDisk)}included.add(task.id)}for(let task of diskTasks){if(included.has(task.id)||tombstones.has(task.id))continue;result.push(task),included.add(task.id)}return{tasks:result,removed:[...tombstones].map(([id,at])=>({id,at}))}}async function recoverIndexFromDisk(path,legacyPath){let raw,sourcePath=path;try{raw=await readFile(path,"utf8")}catch(err){if(err.code!=="ENOENT")throw err;let legacy=readableLegacyIndexPath(path,legacyPath),legacyRaw;if(legacy)try{legacyRaw=await readFile(legacy,"utf8"),sourcePath=legacy}catch(legacyErr){if(legacyErr.code!=="ENOENT")throw legacyErr}if(legacyRaw===void 0)return{version:CURRENT_VERSION,tasks:[]};raw=legacyRaw}let parsed;try{parsed=JSON.parse(raw)}catch(err){let backup=await backupCorruptManifest(sourcePath);return warnManifestRecovery(`[rove] tasks.json at ${sourcePath} is corrupted (${err.message}); recovering with empty index.${backup?` Original bytes backed up to ${backup}.`:" Backup copy failed; the stale file is left in place."}`,sourcePath),{version:CURRENT_VERSION,tasks:[]}}if(await recoverUnsupportedVersion(parsed,sourcePath))return{version:CURRENT_VERSION,tasks:[]};return normalizeIndex(parsed,sourcePath)}
|
|
2
|
+
import{toTaskId}from"./chunk-xy8be792.js";import{LockfileError,acquire}from"./chunk-a3a9gdc4.js";import{coerceVendorId}from"./chunk-bq3fyc0p.js";import{DAEMON_MIGRATION_MARKER}from"./chunk-e29hx18x.js";import{logClient}from"./chunk-k2ckx8zw.js";import{defaultClientLogPath}from"./chunk-mcdv19rs.js";import{existsSync}from"fs";import{copyFile,readFile}from"fs/promises";import{dirname,join}from"path";function coerceTask(value){if(!value||typeof value!=="object")return null;let v=value;if(typeof v.id!=="string"||typeof v.title!=="string"||typeof v.repo!=="string"||typeof v.branch!=="string"||typeof v.worktreePath!=="string"||typeof v.status!=="string"||typeof v.createdAt!=="string"||typeof v.updatedAt!=="string")return null;if(!isTaskStatus(v.status))return null;let kind=v.kind==="main"?"main":v.kind==="dir"?"dir":"task",scratch=kind==="dir"&&v.scratch===!0,healedStatus=kind==="main"&&(v.status==="in_progress"||v.status==="done")?"backlog":v.status,deletion=coerceDeletion(v.deletion),quotaResume=coerceQuotaResume(v.quotaResume),linkedWorkItem=coerceLinkedWorkItem(v.linkedWorkItem),dispatcher=coerceDispatcher(v.dispatcher),routine=coerceRoutine(v.routine);return{id:toTaskId(v.id),title:v.title,repo:v.repo,branch:v.branch,worktreePath:v.worktreePath,status:healedStatus,pinned:typeof v.pinned==="boolean"?v.pinned:!1,kind,...scratch?{scratch:!0}:{},...routine?{routine}:{},vendor:coerceVendorId(typeof v.vendor==="string"?v.vendor:void 0),...typeof v.command==="string"&&v.command.trim().length>0?{command:v.command}:{},prStatus:coercePRStatus(v.prStatus),...typeof v.modelEffort==="string"&&v.modelEffort.length>0?{modelEffort:v.modelEffort}:{},...typeof v.groupId==="string"&&v.groupId.length>0?{groupId:v.groupId}:{},...v.observedLanguage==="zh"||v.observedLanguage==="en"?{observedLanguage:v.observedLanguage}:{},...deletion?{deletion}:{},...quotaResume?{quotaResume}:{},...linkedWorkItem?{linkedWorkItem}:{},...dispatcher?{dispatcher}:{},...typeof v.prompt==="string"&&v.prompt.length>0?{prompt:v.prompt}:{},...typeof v.baseRef==="string"&&v.baseRef.trim().length>0?{baseRef:v.baseRef}:{},createdAt:v.createdAt,updatedAt:v.updatedAt}}function coerceDispatcher(value){if(!value||typeof value!=="object"||Array.isArray(value))return;let v=value;if(typeof v.taskId!=="string"||v.taskId.length===0)return;if(typeof v.tabId!=="string"||v.tabId.length===0)return;return{taskId:v.taskId,tabId:v.tabId}}function coerceRoutine(value){if(!value||typeof value!=="object"||Array.isArray(value))return;let v=value;if(typeof v.automationId!=="string"||v.automationId.length===0)return;return{automationId:v.automationId}}function coerceQuotaResume(value){if(!value||typeof value!=="object"||Array.isArray(value))return;let v=value;if(typeof v.resumeAt!=="string"||v.resumeAt.length===0)return;if(typeof v.requestedAt!=="string"||v.requestedAt.length===0)return;return{resumeAt:v.resumeAt,requestedAt:v.requestedAt}}function coerceLinkedWorkItem(value){if(!value||typeof value!=="object"||Array.isArray(value))return;let v=value;if(v.provider!=="github")return;if(v.type!=="issue"&&v.type!=="pr")return;if(typeof v.number!=="number"||!Number.isFinite(v.number))return;if(typeof v.title!=="string"||typeof v.url!=="string"||v.url.length===0)return;return{provider:v.provider,type:v.type,number:v.number,title:v.title,url:v.url}}function coerceDeletion(value){if(!value||typeof value!=="object"||Array.isArray(value))return;let v=value;if(v.phase!=="queued"&&v.phase!=="running"&&v.phase!=="error"||typeof v.force!=="boolean"||typeof v.requestedAt!=="string"||v.requestedAt.length===0||v.error!==void 0&&typeof v.error!=="string")return;return{phase:v.phase,force:v.force,...typeof v.deleteBranch==="boolean"?{deleteBranch:v.deleteBranch}:{},requestedAt:v.requestedAt,...typeof v.error==="string"?{error:v.error}:{}}}function coercePRStatus(value){if(!value||typeof value!=="object"||Array.isArray(value))return;let v=value;if(!isPRProviderId(v.provider)||!isPRLifecycleState(v.lifecycle)||!isPRCheckState(v.checkState))return;return{provider:v.provider,lifecycle:v.lifecycle,checkState:v.checkState,...typeof v.number==="number"&&Number.isFinite(v.number)?{number:v.number}:{},...typeof v.url==="string"?{url:v.url}:{},...typeof v.title==="string"?{title:v.title}:{},...typeof v.baseRef==="string"?{baseRef:v.baseRef}:{},...typeof v.reviewDecision==="string"?{reviewDecision:v.reviewDecision}:{},...typeof v.mergeable==="string"?{mergeable:v.mergeable}:{},...typeof v.lastCheckedAt==="string"?{lastCheckedAt:v.lastCheckedAt}:{},...typeof v.lastError==="string"?{lastError:v.lastError}:{}}}function isPRProviderId(v){return v==="github"||v==="gitlab"||v==="bitbucket"||v==="unknown"}function isPRLifecycleState(v){return v==="creating"||v==="open"||v==="ready_to_merge"||v==="merged"||v==="closed"||v==="unknown"}function isPRCheckState(v){return v==="none"||v==="pending"||v==="passing"||v==="failing"||v==="unknown"}function isTaskStatus(s){return s==="backlog"||s==="in_progress"||s==="in_review"||s==="done"||s==="canceled"||s==="error"}var sleep=(ms)=>new Promise((resolve)=>setTimeout(resolve,ms)),LOCK_RETRY_DELAY_MS=25,LOCK_MAX_WAIT_MS=5000;async function acquireWithRetry(lockPath){let deadline=Date.now()+LOCK_MAX_WAIT_MS;for(;;)try{return await acquire(lockPath)}catch(err){if(!(err instanceof LockfileError)||Date.now()>=deadline)throw err;await sleep(LOCK_RETRY_DELAY_MS)}}var CURRENT_VERSION=3;async function backupCorruptManifest(path,now=()=>new Date){let backupPath=`${path}.corrupt-${now().toISOString().replaceAll(":","-")}`;try{return await copyFile(path,backupPath),backupPath}catch{return null}}var SUPPORTED_VERSIONS=new Set([1,2,3]);function warnManifestRecovery(message,manifestPath){console.warn(message),logClient("tasks-index",message,manifestPath?defaultClientLogPath(dirname(dirname(manifestPath))):void 0)}async function recoverUnsupportedVersion(parsed,sourcePath){if(!parsed||typeof parsed!=="object"||Array.isArray(parsed))return!1;let version=parsed.version;if(version===void 0||SUPPORTED_VERSIONS.has(version))return!1;let backup=await backupCorruptManifest(sourcePath);return warnManifestRecovery(`[rove] tasks.json at ${sourcePath} has unsupported version=${String(version)}; recovering with empty index.${backup?` Original bytes backed up to ${backup}.`:" Backup copy failed; the stale file is left in place."}`,sourcePath),!0}function normalizeIndex(parsed,source){if(!parsed||typeof parsed!=="object"||Array.isArray(parsed))return warnManifestRecovery(`[rove] tasks.json at ${source} is not an object; recovering with empty index.`,source),{version:CURRENT_VERSION,tasks:[]};let obj=parsed,version=obj.version;if(version!==void 0&&!SUPPORTED_VERSIONS.has(version))return warnManifestRecovery(`[rove] tasks.json at ${source} has unsupported version=${String(version)}; recovering with empty index.`,source),{version:CURRENT_VERSION,tasks:[]};let rawTasks=Array.isArray(obj.tasks)?obj.tasks:[],tasks=[];for(let entry of rawTasks){let task=coerceTask(entry);if(task)tasks.push(task);else console.warn(`[rove] dropping malformed task entry from ${source}: ${JSON.stringify(entry)}`)}return{version:CURRENT_VERSION,tasks}}var TOMBSTONE_TTL_MS=2592000000;function readableLegacyIndexPath(canonicalPath,legacyPath){return existsSync(join(dirname(canonicalPath),DAEMON_MIGRATION_MARKER))?void 0:legacyPath}async function readDiskIndex(path,legacyPath){let raw,sourcePath=path;try{raw=await readFile(sourcePath,"utf8")}catch(err){if(err.code!=="ENOENT")throw err;let legacy=readableLegacyIndexPath(path,legacyPath);if(!legacy)return{tasks:[],removed:[]};sourcePath=legacy;try{raw=await readFile(sourcePath,"utf8")}catch(legacyErr){if(legacyErr.code==="ENOENT")return{tasks:[],removed:[]};throw legacyErr}}let parsed;try{parsed=JSON.parse(raw)}catch{return await backupCorruptManifest(sourcePath),{tasks:[],removed:[]}}if(await recoverUnsupportedVersion(parsed,sourcePath))return{tasks:[],removed:[]};return{tasks:normalizeIndex(parsed,sourcePath).tasks,removed:coerceTombstones(parsed)}}function coerceTombstones(parsed){if(!parsed||typeof parsed!=="object"||Array.isArray(parsed))return[];let raw=parsed.removed;if(!Array.isArray(raw))return[];let out=[];for(let entry of raw){if(!entry||typeof entry!=="object")continue;let v=entry;if(typeof v.id==="string"&&v.id.length>0&&typeof v.at==="string")out.push({id:v.id,at:v.at})}return out}function mergeTasksWithDisk(cacheTasks,diskTasks,dirty,removed,diskRemoved=[],now=Date.now()){let tombstones=new Map;for(let t of diskRemoved){let at=Date.parse(t.at);if(!Number.isFinite(at)||now-at>TOMBSTONE_TTL_MS)continue;tombstones.set(t.id,t.at)}for(let[id,at]of removed)tombstones.set(id,at);let diskById=new Map(diskTasks.map((t)=>[t.id,t])),result=[],included=new Set;for(let task of cacheTasks){if(tombstones.has(task.id))continue;if(dirty.has(task.id))result.push(task);else{let onDisk=diskById.get(task.id);if(onDisk===void 0)continue;result.push(onDisk)}included.add(task.id)}for(let task of diskTasks){if(included.has(task.id)||tombstones.has(task.id))continue;result.push(task),included.add(task.id)}return{tasks:result,removed:[...tombstones].map(([id,at])=>({id,at}))}}async function recoverIndexFromDisk(path,legacyPath){let raw,sourcePath=path;try{raw=await readFile(path,"utf8")}catch(err){if(err.code!=="ENOENT")throw err;let legacy=readableLegacyIndexPath(path,legacyPath),legacyRaw;if(legacy)try{legacyRaw=await readFile(legacy,"utf8"),sourcePath=legacy}catch(legacyErr){if(legacyErr.code!=="ENOENT")throw legacyErr}if(legacyRaw===void 0)return{version:CURRENT_VERSION,tasks:[]};raw=legacyRaw}let parsed;try{parsed=JSON.parse(raw)}catch(err){let backup=await backupCorruptManifest(sourcePath);return warnManifestRecovery(`[rove] tasks.json at ${sourcePath} is corrupted (${err.message}); recovering with empty index.${backup?` Original bytes backed up to ${backup}.`:" Backup copy failed; the stale file is left in place."}`,sourcePath),{version:CURRENT_VERSION,tasks:[]}}if(await recoverUnsupportedVersion(parsed,sourcePath))return{version:CURRENT_VERSION,tasks:[]};return normalizeIndex(parsed,sourcePath)}
|
|
3
3
|
export{acquireWithRetry,readableLegacyIndexPath,readDiskIndex,mergeTasksWithDisk,recoverIndexFromDisk};
|