@sma1lboy/rove 0.9.156 → 0.9.157

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/dist/cli/{chunk-9ypg30c1.js → chunk-158gfptx.js} +1 -1
  2. package/dist/cli/{chunk-r0z1bhjg.js → chunk-2egeskms.js} +1 -1
  3. package/dist/cli/{chunk-ywtsabyg.js → chunk-2f6p2wrk.js} +1 -1
  4. package/dist/cli/{chunk-88vvd6qz.js → chunk-2ge9th94.js} +1 -1
  5. package/dist/cli/{chunk-me2752c0.js → chunk-3evh2jfe.js} +1 -1
  6. package/dist/cli/{chunk-mqnr4p48.js → chunk-3sah6nks.js} +1 -1
  7. package/dist/cli/{chunk-667hcm3g.js → chunk-7rf1b05j.js} +1 -1
  8. package/dist/cli/{chunk-svg7ee0z.js → chunk-940nrpw3.js} +1 -1
  9. package/dist/cli/{chunk-cqaxnve9.js → chunk-bhv2b63j.js} +1 -1
  10. package/dist/cli/{chunk-8kj2s16b.js → chunk-d2qjxtfh.js} +1 -1
  11. package/dist/cli/{chunk-98zhyhpz.js → chunk-dyxz1ch3.js} +1 -1
  12. package/dist/cli/{chunk-m45w6v9d.js → chunk-eyjbq4ee.js} +1 -1
  13. package/dist/cli/{chunk-9g7hamhv.js → chunk-h165zftp.js} +1 -1
  14. package/dist/cli/{chunk-sram9jmt.js → chunk-kkvgtey3.js} +1 -1
  15. package/dist/cli/{chunk-3xcz7mz7.js → chunk-kth4fmzh.js} +2 -2
  16. package/dist/cli/{chunk-45p9xh44.js → chunk-mw7az4dy.js} +1 -1
  17. package/dist/cli/{chunk-7ntf5hdf.js → chunk-njgxgh1f.js} +2 -1
  18. package/dist/cli/{chunk-d2p1za6y.js → chunk-tpcrsppv.js} +1 -1
  19. package/dist/cli/{chunk-d57awd05.js → chunk-tvzy1h3c.js} +2 -2
  20. package/dist/cli/{chunk-6bbj9axg.js → chunk-vb4xz8pz.js} +1 -1
  21. package/dist/cli/{chunk-j20cerws.js → chunk-vffbdrqa.js} +1 -1
  22. package/dist/cli/{chunk-dwbtszh0.js → chunk-vjykdnst.js} +1 -1
  23. package/dist/cli/{chunk-n80h9k0r.js → chunk-w93ahgrj.js} +1 -1
  24. package/dist/cli/{chunk-e9cpb5jt.js → chunk-xcmftf87.js} +1 -1
  25. package/dist/cli/{chunk-2ernbaey.js → chunk-xhte0jhf.js} +2 -2
  26. package/dist/cli/{chunk-4a37bmpm.js → chunk-ztb025x6.js} +1 -1
  27. package/dist/cli/index.js +3 -3
  28. package/dist/cli/kobe.js +1 -1
  29. package/dist/cli/rove.js +1 -1
  30. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{sameWorktreeChanges}from"./chunk-xqw5d5rv.js";import{CURRENT_VERSION}from"./chunk-98zhyhpz.js";import{BUNDLED_THEMES,DEFAULT_THEME,applyDisplayOverlay,readPersistedUiPrefs,resolveTheme}from"./chunk-fm5s7njg.js";import{localeState,setLocaleLang,t}from"./chunk-nss70xwr.js";import{isLocaleId}from"./chunk-fd2zhddn.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&&currentTransition.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-dyxz1ch3.js";import{BUNDLED_THEMES,DEFAULT_THEME,applyDisplayOverlay,readPersistedUiPrefs,resolveTheme}from"./chunk-fm5s7njg.js";import{localeState,setLocaleLang,t}from"./chunk-nss70xwr.js";import{isLocaleId}from"./chunk-fd2zhddn.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&&currentTransition.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,4 +1,4 @@
1
1
  // @bun
2
- import{PLUGIN_MANIFEST_FILENAMES,currentPluginPlatform,loadPluginRegistry,parsePluginManifest,pluginCheckoutDir,pluginConfigDir,pluginManifestPath,pluginStateDir,pluginsRootDir,savePluginRegistry,supportsPlatform,upsertPluginEntry}from"./chunk-38272eqv.js";import{CURRENT_VERSION,compareSemver}from"./chunk-98zhyhpz.js";import{spawnSync}from"child_process";import{cpSync,existsSync,mkdirSync,readFileSync,renameSync,rmSync}from"fs";import{mkdtempSync}from"fs";import{basename,join,resolve}from"path";import{createInterface}from"readline/promises";var GITHUB_SPEC_RE=/^([A-Za-z0-9-]+)\/([A-Za-z0-9._-]+)(\/.+)?$/;class PluginCliError extends Error{}function fail(message){throw new PluginCliError(message)}function readManifestAt(root){let path=pluginManifestPath(root);if(!path)fail(`no ${PLUGIN_MANIFEST_FILENAMES.join(" or ")} found at ${root}`);let source=readFileSync(path,"utf8");return{...parsePluginManifest(source,basename(path)),manifestPath:path,manifestSource:source}}function checkVersionGate(parsed){let min=parsed.manifest.minKobeVersion;if(compareSemver(CURRENT_VERSION,min)<0)fail(`plugin requires Rove >= ${min} (this is ${CURRENT_VERSION}); update Rove first`)}function printPreview(parsed,source){let m=parsed.manifest;console.log(`
2
+ import{PLUGIN_MANIFEST_FILENAMES,currentPluginPlatform,loadPluginRegistry,parsePluginManifest,pluginCheckoutDir,pluginConfigDir,pluginManifestPath,pluginStateDir,pluginsRootDir,savePluginRegistry,supportsPlatform,upsertPluginEntry}from"./chunk-38272eqv.js";import{CURRENT_VERSION,compareSemver}from"./chunk-dyxz1ch3.js";import{spawnSync}from"child_process";import{cpSync,existsSync,mkdirSync,readFileSync,renameSync,rmSync}from"fs";import{mkdtempSync}from"fs";import{basename,join,resolve}from"path";import{createInterface}from"readline/promises";var GITHUB_SPEC_RE=/^([A-Za-z0-9-]+)\/([A-Za-z0-9._-]+)(\/.+)?$/;class PluginCliError extends Error{}function fail(message){throw new PluginCliError(message)}function readManifestAt(root){let path=pluginManifestPath(root);if(!path)fail(`no ${PLUGIN_MANIFEST_FILENAMES.join(" or ")} found at ${root}`);let source=readFileSync(path,"utf8");return{...parsePluginManifest(source,basename(path)),manifestPath:path,manifestSource:source}}function checkVersionGate(parsed){let min=parsed.manifest.minKobeVersion;if(compareSemver(CURRENT_VERSION,min)<0)fail(`plugin requires Rove >= ${min} (this is ${CURRENT_VERSION}); update Rove first`)}function printPreview(parsed,source){let m=parsed.manifest;console.log(`
3
3
  ${m.name} (${m.id}) v${m.version} \u2014 ${m.description??"no description"}`),console.log(`source: ${source}`);let show=(label,commands)=>{for(let c of commands)console.log(` ${label}: ${c.command.join(" ")}`)};show("build",m.build),show("startup",m.startup);for(let a of m.actions)console.log(` action ${a.id}: ${a.command.join(" ")}`);for(let e of m.events)console.log(` on ${e.on}: ${e.command.join(" ")}`);for(let w of parsed.warnings)console.log(` warning: ${w}`);console.log("")}async function confirmOrBail(yes){if(yes)return;if(!process.stdin.isTTY)fail("refusing to install without confirmation in a non-interactive terminal; pass --yes");let rl=createInterface({input:process.stdin,output:process.stdout}),answer=(await rl.question("Install this plugin and run its build commands? [y/N] ")).trim().toLowerCase();if(rl.close(),answer!=="y"&&answer!=="yes")fail("aborted")}function git(args,cwd){if(spawnSync("git",args,{cwd,stdio:["ignore","inherit","inherit"]}).status!==0)fail(`git ${args[0]} failed`)}function runBuildCommands(parsed,root){let platform=currentPluginPlatform();for(let[i,step]of parsed.manifest.build.entries()){if(!supportsPlatform(step,parsed.manifest,platform))continue;let[cmd,...args]=step.command;console.log(`build[${i}]: ${step.command.join(" ")}`);let res=spawnSync(cmd,args,{cwd:root,stdio:["ignore","inherit","inherit"]});if(res.status!==0)fail(`build[${i}] failed (exit ${res.status??"spawn error"}); plugin not registered`)}}function makeStagingDir(){let root=pluginsRootDir();return mkdirSync(root,{recursive:!0}),mkdtempSync(join(root,".staging-"))}function movePluginTree(from,to){try{renameSync(from,to)}catch(err){if(err.code!=="EXDEV")throw err;cpSync(from,to,{recursive:!0,verbatimSymlinks:!0}),rmSync(from,{recursive:!0,force:!0})}}function register(entry){savePluginRegistry(upsertPluginEntry(loadPluginRegistry(),entry)),mkdirSync(pluginConfigDir(entry.id),{recursive:!0,mode:448}),mkdirSync(pluginStateDir(entry.id),{recursive:!0,mode:448})}async function installPlugin(spec,opts){let match=spec.match(GITHUB_SPEC_RE);if(!match)fail(`install takes GitHub shorthand (owner/repo[/subdir]), got \`${spec}\``);let[,owner,repo,subdirRaw]=match,subdir=subdirRaw?.replace(/^\//,""),tmp=makeStagingDir();try{let url=`https://github.com/${owner}/${repo}.git`;if(console.log(`cloning ${url}${opts.ref?` @ ${opts.ref}`:""}`),opts.ref)git(["clone","--quiet",url,tmp]),git(["checkout","--quiet",opts.ref],tmp);else git(["clone","--quiet","--depth","1",url,tmp]);let rootInClone=subdir?join(tmp,subdir):tmp,parsed=readManifestAt(rootInClone);checkVersionGate(parsed);let id=parsed.manifest.id,existing=loadPluginRegistry().plugins.find((p)=>p.id===id);if(existing?.source.kind==="link")fail(`\`${id}\` is locally linked at ${existing.root}; unlink it first`);if(!supportsPlatform({},parsed.manifest,currentPluginPlatform()))fail(`plugin declares platforms [${parsed.manifest.platforms?.join(", ")}]; this machine is unsupported`);printPreview(parsed,`github.com/${owner}/${repo}${subdir?`/${subdir}`:""}`),await confirmOrBail(opts.yes),runBuildCommands(parsed,rootInClone);let manifestPath=pluginManifestPath(rootInClone);if(!manifestPath)fail("manifest disappeared during build; aborting");if(manifestPath!==parsed.manifestPath)fail("manifest changed during build; aborting");if(readFileSync(manifestPath,"utf8")!==parsed.manifestSource)fail("manifest changed during build; aborting");let checkout=pluginCheckoutDir(id);return rmSync(checkout,{recursive:!0,force:!0}),mkdirSync(join(checkout,".."),{recursive:!0}),movePluginTree(tmp,checkout),register({id,source:{kind:"github",spec},root:subdir?join(checkout,subdir):checkout,enabled:!0,version:parsed.manifest.version,installedAt:Date.now()}),console.log(`installed ${id} v${parsed.manifest.version}`),id}finally{rmSync(tmp,{recursive:!0,force:!0})}}function linkPlugin(dir){let root=resolve(dir);if(!existsSync(root))fail(`no such directory: ${root}`);let parsed=readManifestAt(root);checkVersionGate(parsed);let id=parsed.manifest.id;if(loadPluginRegistry().plugins.find((p)=>p.id===id)?.source.kind==="github")fail(`\`${id}\` is installed from GitHub; uninstall it before linking a local copy`);for(let w of parsed.warnings)console.log(`warning: ${w}`);if(!supportsPlatform({},parsed.manifest,currentPluginPlatform()))console.log(`warning: declares platforms [${parsed.manifest.platforms?.join(", ")}]; nothing will run on this machine`);register({id,source:{kind:"link"},root,enabled:!0,version:parsed.manifest.version,installedAt:Date.now()}),console.log(`linked ${id} v${parsed.manifest.version} \u2192 ${root}`)}
4
4
  export{PluginCliError,installPlugin,linkPlugin};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{envReadyForTasks}from"./chunk-3xcz7mz7.js";import{wizardKeyLines}from"./chunk-svg7ee0z.js";import"./chunk-ybcacmqv.js";import"./chunk-exggdhpt.js";import"./chunk-g90z5s39.js";import"./chunk-me2752c0.js";import{$Fragment,$jsx,$jsxs,bootPaneHost,currentPrefixConfiguration,pageCloseBindings,require_react_production,useBindings,useRenderer,useT,useTheme}from"./chunk-6bbj9axg.js";import"./chunk-764bsyb0.js";import"./chunk-xqw5d5rv.js";import"./chunk-h4n8ffqy.js";import"./chunk-6xppe9bj.js";import"./chunk-98zhyhpz.js";import"./chunk-ptjc5mtc.js";import"./chunk-de751t37.js";import"./chunk-fm5s7njg.js";import"./chunk-nss70xwr.js";import"./chunk-fd2zhddn.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-n7n12868.js";import"./chunk-4gjr08g0.js";import"./chunk-sfv15era.js";import"./chunk-w7zv47mp.js";import"./chunk-gwcneg6c.js";import"./chunk-25hxhtdr.js";import"./chunk-7jkf3tvr.js";import"./chunk-2fypr41w.js";import"./chunk-kt1ppyje.js";import"./chunk-5v893waj.js";import"./chunk-axfn4f28.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-p7s4xwgx.js";import"./chunk-4pmd0mxp.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};
2
+ import{envReadyForTasks}from"./chunk-kth4fmzh.js";import{wizardKeyLines}from"./chunk-940nrpw3.js";import"./chunk-ybcacmqv.js";import"./chunk-exggdhpt.js";import"./chunk-g90z5s39.js";import"./chunk-3evh2jfe.js";import{$Fragment,$jsx,$jsxs,bootPaneHost,currentPrefixConfiguration,pageCloseBindings,require_react_production,useBindings,useRenderer,useT,useTheme}from"./chunk-vb4xz8pz.js";import"./chunk-764bsyb0.js";import"./chunk-xqw5d5rv.js";import"./chunk-h4n8ffqy.js";import"./chunk-6xppe9bj.js";import"./chunk-dyxz1ch3.js";import"./chunk-ptjc5mtc.js";import"./chunk-de751t37.js";import"./chunk-fm5s7njg.js";import"./chunk-nss70xwr.js";import"./chunk-fd2zhddn.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-n7n12868.js";import"./chunk-4gjr08g0.js";import"./chunk-sfv15era.js";import"./chunk-w7zv47mp.js";import"./chunk-gwcneg6c.js";import"./chunk-25hxhtdr.js";import"./chunk-7jkf3tvr.js";import"./chunk-2fypr41w.js";import"./chunk-kt1ppyje.js";import"./chunk-5v893waj.js";import"./chunk-axfn4f28.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-p7s4xwgx.js";import"./chunk-4pmd0mxp.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,2 +1,2 @@
1
1
  // @bun
2
- import{writeOutdatedCache}from"./chunk-n4nntq73.js";import{PluginCliError,installPlugin}from"./chunk-j20cerws.js";import{loadPluginRegistry,pluginCheckoutDir,pluginConfigDir,pluginDataDir,pluginStateDir,removePluginEntry,savePluginRegistry}from"./chunk-38272eqv.js";import"./chunk-98zhyhpz.js";import"./chunk-mnqxgvyb.js";import"./chunk-w7zv47mp.js";import"./chunk-ch9b1d5y.js";import{activeCliName}from"./chunk-p7s4xwgx.js";import"./chunk-4pmd0mxp.js";import"./chunk-g56kvet6.js";import"./chunk-r3k9rbwm.js";import"./chunk-wqfp8d9w.js";import{execFileSync}from"child_process";import{existsSync,mkdirSync,readdirSync,renameSync}from"fs";import{join}from"path";function gitOut(args,cwd){try{return execFileSync("git",args,{cwd,encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim()}catch{return null}}function checkEntry(entry){let repoSpec=entry.source.spec.split("/").slice(0,2).join("/"),localSha=gitOut(["rev-parse","HEAD"],pluginCheckoutDir(entry.id)),remote=gitOut(["ls-remote",`https://github.com/${repoSpec}.git`,"HEAD"]),remoteSha=remote?remote.split(/\s+/)[0]??null:null;return{id:entry.id,spec:entry.source.spec,version:entry.version,localSha,remoteSha,behind:Boolean(localSha&&remoteSha&&localSha!==remoteSha)}}function listOutdated(){let rows=loadPluginRegistry().plugins.filter((p)=>p.source.kind==="github").map(checkEntry);return writeOutdatedCache(rows.filter((r)=>r.behind).map((r)=>r.id)),rows}function printOutdated(){let rows=listOutdated();if(rows.length===0){console.log("no GitHub-installed plugins.");return}for(let r of rows){let status=r.behind?"update available":r.remoteSha===null?"remote unreachable":r.localSha===null?"local sha unreadable":"up to date";console.log(`${r.id} v${r.version} ${status}`)}}function migrateRenamedPlugin(oldId,newId){for(let dirOf of[pluginConfigDir,pluginStateDir]){let from=dirOf(oldId),to=dirOf(newId);if(!existsSync(from))continue;mkdirSync(to,{recursive:!0});for(let entry of readdirSync(from)){if(existsSync(join(to,entry)))continue;renameSync(join(from,entry),join(to,entry))}}savePluginRegistry(removePluginEntry(loadPluginRegistry(),oldId)),console.log(`renamed ${oldId} \u2192 ${newId}: settings and state carried over, old entry unregistered`),console.log(` leftover checkout (safe to remove): ${pluginDataDir(oldId)}`)}async function updatePlugins(ids,opts){let rows=listOutdated(),targets;if(opts.all){if(targets=rows.filter((r)=>r.behind),targets.length===0){console.log("all plugins up to date.");return}}else{if(ids.length===0)throw new PluginCliError("update takes plugin ids or --all");targets=ids.map((id)=>{let row=rows.find((r)=>r.id===id);if(!row)throw new PluginCliError(`\`${id}\` is not a GitHub-installed plugin; see \`${activeCliName()} plugin list\``);return row})}for(let target of targets){if(!target.behind&&!ids.includes(target.id))continue;console.log(`updating ${target.id} (${target.spec})\u2026`);let installedId=await installPlugin(target.spec,{yes:opts.yes});if(installedId!==target.id)migrateRenamedPlugin(target.id,installedId)}listOutdated()}export{updatePlugins,printOutdated};
2
+ import{writeOutdatedCache}from"./chunk-n4nntq73.js";import{PluginCliError,installPlugin}from"./chunk-vffbdrqa.js";import{loadPluginRegistry,pluginCheckoutDir,pluginConfigDir,pluginDataDir,pluginStateDir,removePluginEntry,savePluginRegistry}from"./chunk-38272eqv.js";import"./chunk-dyxz1ch3.js";import"./chunk-mnqxgvyb.js";import"./chunk-w7zv47mp.js";import"./chunk-ch9b1d5y.js";import{activeCliName}from"./chunk-p7s4xwgx.js";import"./chunk-4pmd0mxp.js";import"./chunk-g56kvet6.js";import"./chunk-r3k9rbwm.js";import"./chunk-wqfp8d9w.js";import{execFileSync}from"child_process";import{existsSync,mkdirSync,readdirSync,renameSync}from"fs";import{join}from"path";function gitOut(args,cwd){try{return execFileSync("git",args,{cwd,encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim()}catch{return null}}function checkEntry(entry){let repoSpec=entry.source.spec.split("/").slice(0,2).join("/"),localSha=gitOut(["rev-parse","HEAD"],pluginCheckoutDir(entry.id)),remote=gitOut(["ls-remote",`https://github.com/${repoSpec}.git`,"HEAD"]),remoteSha=remote?remote.split(/\s+/)[0]??null:null;return{id:entry.id,spec:entry.source.spec,version:entry.version,localSha,remoteSha,behind:Boolean(localSha&&remoteSha&&localSha!==remoteSha)}}function listOutdated(){let rows=loadPluginRegistry().plugins.filter((p)=>p.source.kind==="github").map(checkEntry);return writeOutdatedCache(rows.filter((r)=>r.behind).map((r)=>r.id)),rows}function printOutdated(){let rows=listOutdated();if(rows.length===0){console.log("no GitHub-installed plugins.");return}for(let r of rows){let status=r.behind?"update available":r.remoteSha===null?"remote unreachable":r.localSha===null?"local sha unreadable":"up to date";console.log(`${r.id} v${r.version} ${status}`)}}function migrateRenamedPlugin(oldId,newId){for(let dirOf of[pluginConfigDir,pluginStateDir]){let from=dirOf(oldId),to=dirOf(newId);if(!existsSync(from))continue;mkdirSync(to,{recursive:!0});for(let entry of readdirSync(from)){if(existsSync(join(to,entry)))continue;renameSync(join(from,entry),join(to,entry))}}savePluginRegistry(removePluginEntry(loadPluginRegistry(),oldId)),console.log(`renamed ${oldId} \u2192 ${newId}: settings and state carried over, old entry unregistered`),console.log(` leftover checkout (safe to remove): ${pluginDataDir(oldId)}`)}async function updatePlugins(ids,opts){let rows=listOutdated(),targets;if(opts.all){if(targets=rows.filter((r)=>r.behind),targets.length===0){console.log("all plugins up to date.");return}}else{if(ids.length===0)throw new PluginCliError("update takes plugin ids or --all");targets=ids.map((id)=>{let row=rows.find((r)=>r.id===id);if(!row)throw new PluginCliError(`\`${id}\` is not a GitHub-installed plugin; see \`${activeCliName()} plugin list\``);return row})}for(let target of targets){if(!target.behind&&!ids.includes(target.id))continue;console.log(`updating ${target.id} (${target.spec})\u2026`);let installedId=await installPlugin(target.spec,{yes:opts.yes});if(installedId!==target.id)migrateRenamedPlugin(target.id,installedId)}listOutdated()}export{updatePlugins,printOutdated};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{KEY_HINTS_ENABLED_KEY,PANE_HINT_USED_KEYS,grammarHelpSections,guideCategory,keyHintsEnabled,keyHintsToggleOn,legendCap,paneHintTokens,paneHintVisible,scopeCategory,statusHintTokens,toggleKeyHints}from"./chunk-svg7ee0z.js";import{readOutdatedCache}from"./chunk-n4nntq73.js";import{listPaneLaunches}from"./chunk-9xt05etk.js";import{deriveTitleFromSessionId,startTaskSessionWithPromptAdapter}from"./chunk-we0gedwp.js";import{canonPath,checkResolutionNotify}from"./chunk-vj2vdx3w.js";import{readLastActiveTaskId}from"./chunk-t7xhb2jx.js";import{formatBytes}from"./chunk-my20q579.js";import{detectEngineStatuses,probeableEngineIds,summarizeEngines}from"./chunk-exggdhpt.js";import{ISSUE_STATUSES,isValidCron,nextCronAfter,tightenPluginPermissions}from"./chunk-39x1ztey.js";import"./chunk-41ahvk51.js";import{DEFAULT_EDITOR_KIND,EDITOR_CUSTOM_KEY,EDITOR_KINDS,EDITOR_KIND_KEY,normalizeEditorKind,resolveEditorLaunch}from"./chunk-aak5ttgt.js";import{embeddedTerminalEnv}from"./chunk-ef39ym8f.js";import{approxCellWidth,approxCharCells,charWidth,displayWidth,padEndCells}from"./chunk-dvcb6mk4.js";import{UpdatePage,openWithSystemViewer,resolveRowSelectionChrome,spawnDetached}from"./chunk-88vvd6qz.js";import{$Fragment,$jsx,$jsxs,DEFAULT_PREFIX_CONFIGURATION,DIRECT_GUIDE_PREFIX_ACTION_ID,FIXED_BINDING_IDS,KobeKeymap,PREFIX_GUIDE_DELAY_MS,PREFIX_HUD_TTL_MS,RemoteOrchestrator,armPrefixFromCurrentStack,attentionEdges,attentionKindFor,bindByIds,bootPaneHost,chipAttentionKind,currentBindingReachability,currentPrefixConfiguration,defaultChordsOf,findBinding,formatChord,imeAnchorController,invokeArmedPrefixActionFromCurrentStack,isKittyModifierKeyEvent,isNarrowWidth,keymapVersion,modalActive,narrowSurface,pageCloseBindings,pluginKeybindings,prefixAction,prefixHudClock,prefixHudState,reloadUserKeybindings,require_react_production,shortcutCaption,showDialog,subscribeKeymapVersion,useAccessor,useBindingStackVersion,useBindings,useDialog,useDialogPaddingX,useFocus,useKV,useLatest,useNotifications,useOptionalDialog,useOptionalFocus,useOptionalKV,useOptionalNotifications,usePaste,useRenderer,useT,useTerminalDimensions,useTheme,userKeybindingsReport}from"./chunk-6bbj9axg.js";import"./chunk-764bsyb0.js";import{getGlobalDefaultVendor,resolvePreferredVendor,setGlobalDefaultVendor,setRepoLastActiveVendor}from"./chunk-caqpt09m.js";import{parseNumstatRows,parsePorcelain,pickPushedChanges,sameWorktreeChanges}from"./chunk-xqw5d5rv.js";import{parsePorcelainRows,unquoteGitPath}from"./chunk-h4n8ffqy.js";import{READ_ONLY_GIT_ENV,readOnlyGitProcessEnv}from"./chunk-6xppe9bj.js";import{reloadPluginEngines}from"./chunk-ntt7gy5a.js";import{submitFeedback}from"./chunk-9ypg30c1.js";import{DIRTY_WORKTREE_CODE,TASK_DELETING_CODE,TaskDeletingError}from"./chunk-r05r01nv.js";import{PROJECT_SIBLING_BASE,WORKTREE_BASE_CUSTOM_KEY,worktreeBaseKindOf}from"./chunk-6pt23vas.js";import{currentPluginPlatform,loadPluginRegistry,parsePluginManifest,pluginConfigDir,pluginLogPath,pluginManifestPath,qualifiedActionId,readPluginManifest,savePluginRegistry,supportsPlatform}from"./chunk-38272eqv.js";import{PROJECT_DIR_TOKEN,WORKTREE_BASE_KEY,hasProjectDirToken,normalizeWorktreeBase}from"./chunk-5f80ggc3.js";import{ulid}from"./chunk-qkehg2c1.js";import{matchPathGlob}from"./chunk-kg11c1py.js";import{CURRENT_VERSION}from"./chunk-98zhyhpz.js";import{tildify}from"./chunk-msr1xtay.js";import{addTab,closeActiveTab,closeTab,collapseSplit,cycleLeaf,cycleTab,engineTabSpawnFor,expandHome,filterSubdirs,findEditorTab,forgetTaskTabsSnapshot,hasEngineLeaf,initialShellTabs,initialSplit,initialTabs,isTabSplit,joinDrill,joinPicked,leaves,listSubdirs,moveTab,openCommandTab,openContentTab,openEditorTab,pathLeaf,recycleTabs,rehydrateTabs,removeLeaf,renameActiveTab,renameLeaf,reopenTabs,selectTab,setTabAutoTitle,setTabEngineCommand,setTabForkFrom,setTabInitialPrompt,setTabLastTitle,setTabLiveVendor,setTabSessionId,setTabSpawned,setTabSplit,setTabTitle,shellIdentityInput,splitActive,splitLeafNames,splitLeafPtyKey,splitPathForDirSuggest,stripTrailingSlash,sweepOrphanTabsSnapshots,tabCwdFor,tabExitAction,tabPtyKey,tabPtyKeyFor,tabTitle,tabTitleStable,terminalTabsKey,visibleNativeStatus}from"./chunk-qch6g9za.js";import{AUTO_STATUS_KEY,DISPATCHER_KEY,Ke,composerGatePreferenceOn,hostedTaskKeys,killHostedSessions,listHostedSessions,openHostedSessionHost,pastePromptWhenEngineUp,require_xterm_headless,toggleComposerGatePreference}from"./chunk-mhzv94cg.js";import{execHostForWorktreePath,remoteKeyForRepo}from"./chunk-ds9qf1w1.js";import"./chunk-bkba9c4n.js";import"./chunk-g2advs8t.js";import{ensurePtyHostReachable}from"./chunk-wdhcrcre.js";import{ENGINE_PROTOCOLS,engineCanFork,engineLaunchArgv,engineProtocolKey,getEngineProtocol,pickUnclaimedSessionId,protocolEntry,withPinnedSessionId}from"./chunk-ptjc5mtc.js";import{DEFAULT_TERMINAL_COLORS,formatDefaultColorReply,parseTerminalDefaultColors}from"./chunk-7q67dz4c.js";import"./chunk-1cjd7h8p.js";import{resolveLoginShell}from"./chunk-b99tf0jr.js";import{readFirstNonEmptyRepoFile}from"./chunk-t27t2x9b.js";import"./chunk-hape5vwj.js";import{defaultEngineCommand,engineCommandKey,engineDisplayName,engineNameKey,humanizeSlug,interactiveEngineCommand,kobeApiInvocation}from"./chunk-de751t37.js";import{FOCUS_ACCENT_SLOTS,LOCALE_KEY}from"./chunk-fm5s7njg.js";import{currentLang,intlLocale,setLocaleLang,t,tKeys}from"./chunk-nss70xwr.js";import{LOCALES}from"./chunk-fd2zhddn.js";import{createStateCell}from"./chunk-sdyzxayr.js";import"./chunk-zqfbyq0a.js";import"./chunk-jvxh93nz.js";import{connectOrStartDaemon}from"./chunk-4502n1bk.js";import"./chunk-nm0pq5r6.js";import"./chunk-mqqnk8w7.js";import{KobeDaemonClient}from"./chunk-0wnfq5sx.js";import{attentionInboxItemKey,automationRunNeedsAttention}from"./chunk-7j5372wb.js";import"./chunk-mnqxgvyb.js";import{foregroundEngineIn,parsePsSnapshot,psSnapshot}from"./chunk-n7n12868.js";import{engineEntry,engineSessionIdFromTitle,engineTitleTurnHint,getCapabilities,stripEngineStatusPrefix}from"./chunk-4gjr08g0.js";import{availableEngineIds,installedEngineIds}from"./chunk-sfv15era.js";import"./chunk-w7zv47mp.js";import{maybeStartScheduledRun,spawnCapture}from"./chunk-gwcneg6c.js";import{roveCliInvocation}from"./chunk-25hxhtdr.js";import"./chunk-7jkf3tvr.js";import"./chunk-2fypr41w.js";import{addSavedRepo,getSavedRepos,isGitRepo,isRemoteRepoKey,resolveMainRepoRoot}from"./chunk-kt1ppyje.js";import{loadStateFile}from"./chunk-5v893waj.js";import"./chunk-axfn4f28.js";import{DEFAULT_TASK_VENDOR,TASK_STATUSES}from"./chunk-xy8be792.js";import"./chunk-a3a9gdc4.js";import{errorMessage,userFacingErrorMessage}from"./chunk-2brn8e1y.js";import"./chunk-3wj69b0a.js";import{isDev,promptAttachmentsDir,roveStateDir}from"./chunk-ch9b1d5y.js";import{ALL_VENDORS,isBuiltinVendor,nextVendorWithin,prevVendorWithin}from"./chunk-bq3fyc0p.js";import{activeCliName}from"./chunk-p7s4xwgx.js";import"./chunk-4pmd0mxp.js";import{ROVE_PRODUCT_NAME}from"./chunk-g56kvet6.js";import{logClientError}from"./chunk-k2ckx8zw.js";import"./chunk-pw6yfj10.js";import{defaultDaemonSocketPath}from"./chunk-mcdv19rs.js";import{readRoveEnv}from"./chunk-r3k9rbwm.js";import{__require,__toESM}from"./chunk-wqfp8d9w.js";var import_react115=__toESM(require_react_production(),1);function truncateEnd(s,max){if(max<=0)return"";let points=[...s];if(points.length<=max)return s;return`${points.slice(0,Math.max(0,max-1)).join("")}\u2026`}function truncateEndCells(s,maxCells,cellsOf){if(maxCells<=0)return"";let total=0;for(let ch of s)total+=cellsOf(ch.codePointAt(0)??0);if(total<=maxCells)return s;let used=0,out="";for(let ch of s){let w=cellsOf(ch.codePointAt(0)??0);if(used+w>maxCells-1)break;used+=w,out+=ch}return`${out}\u2026`}function truncateStart(s,max){if(max<=0)return"";let points=[...s];if(points.length<=max)return s;return`\u2026${points.slice(points.length-Math.max(0,max-1)).join("")}`}function truncateStartCells(s,maxCells,cellsOf){if(maxCells<=0)return"";let points=[...s],total=0;for(let ch of points)total+=cellsOf(ch.codePointAt(0)??0);if(total<=maxCells)return s;let used=0,out="";for(let i=points.length-1;i>=0;i--){let ch=points[i],w=cellsOf(ch.codePointAt(0)??0);if(used+w>maxCells-1)break;used+=w,out=ch+out}return`\u2026${out}`}var SIDEBAR_WIDTH=24;function sidebarWidthFor(terminalWidth){return Math.max(SIDEBAR_WIDTH,Math.min(40,Math.floor(terminalWidth/6)))}var MAIN_BRANCH_POLL_MS=2000;function sidebarEmptyStateKey(opts){if(opts.searching)return"tasks.empty.noMatchSearch";if(opts.projectFilter)return"tasks.empty.noActiveProject";return"tasks.empty.noActive"}var BRANCH_LABEL_MAX=16;function truncateBranchLabel(branch,max=BRANCH_LABEL_MAX){return truncateEnd(branch,max)}function toneColor(theme,tone){switch(tone){case"success":return theme.success;case"warning":return theme.warning;case"primary":return theme.primary;case"error":return theme.error;default:return theme.textMuted}}function searchQueryKeystroke(query,evt){if(evt.defaultPrevented)return null;if(evt.ctrl||evt.meta||evt.option)return null;if(evt.name==="backspace")return query.slice(0,-1);let seq=evt.sequence;if(!seq||seq.length!==1)return null;let code=seq.charCodeAt(0);if(code<32||code===127)return null;return query+seq}var m=0,p=0,g=0,b=0,I;((r)=>{function u(t2,a,s,i){return i!==void 0?`#${B(t2)}${B(a)}${B(s)}${B(i)}`:`#${B(t2)}${B(a)}${B(s)}`}r.toCss=u;function o(t2,a,s,i=255){return(t2<<24|a<<16|s<<8|i)>>>0}r.toRgba=o;function e(t2,a,s,i){return{css:r.toCss(t2,a,s,i),rgba:r.toRgba(t2,a,s,i)}}r.toColor=e})(I||={});var $;((i)=>{function u(n,l){if(b=(l.rgba&255)/255,b===1)return{css:l.css,rgba:l.rgba};let f=l.rgba>>24&255,d=l.rgba>>16&255,c=l.rgba>>8&255,C=n.rgba>>24&255,h=n.rgba>>16&255,x=n.rgba>>8&255;m=C+Math.round((f-C)*b),p=h+Math.round((d-h)*b),g=x+Math.round((c-x)*b);let R=I.toCss(m,p,g),L=I.toRgba(m,p,g);return{css:R,rgba:L}}i.blend=u;function o(n){return(n.rgba&255)===255}i.isOpaque=o;function e(n,l,f){let d=y.ensureContrastRatio(n.rgba,l.rgba,f);if(d)return I.toColor(d>>24&255,d>>16&255,d>>8&255)}i.ensureContrastRatio=e;function r(n){let l=(n.rgba|255)>>>0;return[m,p,g]=y.toChannels(l),{css:I.toCss(m,p,g),rgba:l}}i.opaque=r;function t2(n,l){return b=Math.round(l*255),[m,p,g]=y.toChannels(n.rgba),{css:I.toCss(m,p,g,b),rgba:I.toRgba(m,p,g,b)}}i.opacity=t2;function a(n,l){return b=n.rgba&255,t2(n,b*l/255)}i.multiplyOpacity=a;function s(n){return[n.rgba>>24&255,n.rgba>>16&255,n.rgba>>8&255]}i.toColorRGB=s})($||={});var _;((r)=>{let u,o;try{let t2=document.createElement("canvas");t2.width=1,t2.height=1;let a=t2.getContext("2d",{willReadFrequently:!0});a&&(u=a,u.globalCompositeOperation="copy",o=u.createLinearGradient(0,0,1,1))}catch{}function e(t2){if(t2.match(/#[\da-f]{3,8}/i))switch(t2.length){case 4:return m=parseInt(t2.slice(1,2).repeat(2),16),p=parseInt(t2.slice(2,3).repeat(2),16),g=parseInt(t2.slice(3,4).repeat(2),16),I.toColor(m,p,g);case 5:return m=parseInt(t2.slice(1,2).repeat(2),16),p=parseInt(t2.slice(2,3).repeat(2),16),g=parseInt(t2.slice(3,4).repeat(2),16),b=parseInt(t2.slice(4,5).repeat(2),16),I.toColor(m,p,g,b);case 7:return{css:t2,rgba:(parseInt(t2.slice(1),16)<<8|255)>>>0};case 9:return{css:t2,rgba:parseInt(t2.slice(1),16)>>>0}}let a=t2.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(a)return m=parseInt(a[1]),p=parseInt(a[2]),g=parseInt(a[3]),b=Math.round((a[5]===void 0?1:parseFloat(a[5]))*255),I.toColor(m,p,g,b);if(!u||!o)throw Error("css.toColor: Unsupported css format");if(u.fillStyle=o,u.fillStyle=t2,typeof u.fillStyle!="string")throw Error("css.toColor: Unsupported css format");if(u.fillRect(0,0,1,1),[m,p,g,b]=u.getImageData(0,0,1,1).data,b!==255)throw Error("css.toColor: Unsupported css format");return{rgba:I.toRgba(m,p,g,b),css:t2}}r.toColor=e})(_||={});var v;((e)=>{function u(r){return o(r>>16&255,r>>8&255,r&255)}e.relativeLuminance=u;function o(r,t2,a){let s=r/255,i=t2/255,n=a/255,l=s<=0.03928?s/12.92:Math.pow((s+0.055)/1.055,2.4),f=i<=0.03928?i/12.92:Math.pow((i+0.055)/1.055,2.4),d=n<=0.03928?n/12.92:Math.pow((n+0.055)/1.055,2.4);return l*0.2126+f*0.7152+d*0.0722}e.relativeLuminance2=o})(v||={});var y;((a)=>{function u(s,i){if(b=(i&255)/255,b===1)return i;let n=i>>24&255,l=i>>16&255,f=i>>8&255,d=s>>24&255,c=s>>16&255,C=s>>8&255;return m=d+Math.round((n-d)*b),p=c+Math.round((l-c)*b),g=C+Math.round((f-C)*b),I.toRgba(m,p,g)}a.blend=u;function o(s,i,n){let l=v.relativeLuminance(s>>8),f=v.relativeLuminance(i>>8);if(F(l,f)<n){if(f<l){let h=e(s,i,n),x=F(l,v.relativeLuminance(h>>8));if(x<n){let R=r(s,i,n),L=F(l,v.relativeLuminance(R>>8));return x>L?h:R}return h}let c=r(s,i,n),C=F(l,v.relativeLuminance(c>>8));if(C<n){let h=e(s,i,n),x=F(l,v.relativeLuminance(h>>8));return C>x?c:h}return c}}a.ensureContrastRatio=o;function e(s,i,n){let l=s>>24&255,f=s>>16&255,d=s>>8&255,c=i>>24&255,C=i>>16&255,h=i>>8&255,x=F(v.relativeLuminance2(c,C,h),v.relativeLuminance2(l,f,d));for(;x<n&&(c>0||C>0||h>0);)c-=Math.max(0,Math.ceil(c*0.1)),C-=Math.max(0,Math.ceil(C*0.1)),h-=Math.max(0,Math.ceil(h*0.1)),x=F(v.relativeLuminance2(c,C,h),v.relativeLuminance2(l,f,d));return(c<<24|C<<16|h<<8|255)>>>0}a.reduceLuminance=e;function r(s,i,n){let l=s>>24&255,f=s>>16&255,d=s>>8&255,c=i>>24&255,C=i>>16&255,h=i>>8&255,x=F(v.relativeLuminance2(c,C,h),v.relativeLuminance2(l,f,d));for(;x<n&&(c<255||C<255||h<255);)c=Math.min(255,c+Math.ceil((255-c)*0.1)),C=Math.min(255,C+Math.ceil((255-C)*0.1)),h=Math.min(255,h+Math.ceil((255-h)*0.1)),x=F(v.relativeLuminance2(c,C,h),v.relativeLuminance2(l,f,d));return(c<<24|C<<16|h<<8|255)>>>0}a.increaseLuminance=r;function t2(s){return[s>>24&255,s>>16&255,s>>8&255,s&255]}a.toChannels=t2})(y||={});function B(u){let o=u.toString(16);return o.length<2?"0"+o:o}function F(u,o){return u<o?(o+0.05)/(u+0.05):(u+0.05)/(o+0.05)}var E=Object.freeze((()=>{let u=[_.toColor("#2e3436"),_.toColor("#cc0000"),_.toColor("#4e9a06"),_.toColor("#c4a000"),_.toColor("#3465a4"),_.toColor("#75507b"),_.toColor("#06989a"),_.toColor("#d3d7cf"),_.toColor("#555753"),_.toColor("#ef2929"),_.toColor("#8ae234"),_.toColor("#fce94f"),_.toColor("#729fcf"),_.toColor("#ad7fa8"),_.toColor("#34e2e2"),_.toColor("#eeeeec")],o=[0,95,135,175,215,255];for(let e=0;e<216;e++){let r=o[e/36%6|0],t2=o[e/6%6|0],a=o[e%6];u.push({css:I.toCss(r,t2,a),rgba:I.toRgba(r,t2,a)})}for(let e=0;e<24;e++){let r=8+e*10;u.push({css:I.toCss(r,r,r),rgba:I.toRgba(r,r,r)})}return u})());function A(u,o,e){return Math.max(o,Math.min(u,e))}function O(u){switch(u){case"&":return"&amp;";case"<":return"&lt;"}return u}var S=class{constructor(o){this._buffer=o}serialize(o,e){let r=this._buffer.getNullCell(),t2=this._buffer.getNullCell(),a=r,s=o.start.y,i=o.end.y,n=o.start.x,l=o.end.x;this._beforeSerialize(i-s,s,i);for(let f=s;f<=i;f++){let d=this._buffer.getLine(f);if(d){let c=f===o.start.y?n:0,C=f===o.end.y?l:d.length;for(let h=c;h<C;h++){let x=d.getCell(h,a===r?t2:r);if(!x){console.warn(`Can't get cell at row=${f}, col=${h}`);continue}this._nextCell(x,a,f,h),a=x}}this._rowEnd(f,f===i)}return this._afterSerialize(),this._serializeString(e)}_nextCell(o,e,r,t2){}_rowEnd(o,e){}_beforeSerialize(o,e,r){}_afterSerialize(){}_serializeString(o){return""}};function T(u,o){return u.getFgColorMode()===o.getFgColorMode()&&u.getFgColor()===o.getFgColor()}function w(u,o){return u.getBgColorMode()===o.getBgColorMode()&&u.getBgColor()===o.getBgColor()}function z(u,o){return u.isInverse()===o.isInverse()&&u.isBold()===o.isBold()&&u.isUnderline()===o.isUnderline()&&u.isOverline()===o.isOverline()&&u.isBlink()===o.isBlink()&&u.isInvisible()===o.isInvisible()&&u.isItalic()===o.isItalic()&&u.isDim()===o.isDim()&&u.isStrikethrough()===o.isStrikethrough()}var k=class extends S{constructor(e,r){super(e);this._terminal=r,this._rowIndex=0,this._allRows=[],this._allRowSeparators=[],this._currentRow="",this._nullCellCount=0,this._cursorStyle=this._buffer.getNullCell(),this._cursorStyleRow=0,this._cursorStyleCol=0,this._backgroundCell=this._buffer.getNullCell(),this._firstRow=0,this._lastCursorRow=0,this._lastCursorCol=0,this._lastContentCursorRow=0,this._lastContentCursorCol=0,this._thisRowLastChar=this._buffer.getNullCell(),this._thisRowLastSecondChar=this._buffer.getNullCell(),this._nextRowFirstChar=this._buffer.getNullCell()}_beforeSerialize(e,r,t2){this._allRows=Array(e),this._lastContentCursorRow=r,this._lastCursorRow=r,this._firstRow=r}_rowEnd(e,r){this._nullCellCount>0&&!w(this._cursorStyle,this._backgroundCell)&&(this._currentRow+=`\x1B[${this._nullCellCount}X`);let t2="";if(!r){e-this._firstRow>=this._terminal.rows&&this._buffer.getLine(this._cursorStyleRow)?.getCell(this._cursorStyleCol,this._backgroundCell);let a=this._buffer.getLine(e),s=this._buffer.getLine(e+1);if(!s.isWrapped)t2=`\r
2
+ import{KEY_HINTS_ENABLED_KEY,PANE_HINT_USED_KEYS,grammarHelpSections,guideCategory,keyHintsEnabled,keyHintsToggleOn,legendCap,paneHintTokens,paneHintVisible,scopeCategory,statusHintTokens,toggleKeyHints}from"./chunk-940nrpw3.js";import{readOutdatedCache}from"./chunk-n4nntq73.js";import{listPaneLaunches}from"./chunk-9xt05etk.js";import{deriveTitleFromSessionId,startTaskSessionWithPromptAdapter}from"./chunk-we0gedwp.js";import{canonPath,checkResolutionNotify}from"./chunk-vj2vdx3w.js";import{readLastActiveTaskId}from"./chunk-t7xhb2jx.js";import{formatBytes}from"./chunk-my20q579.js";import{detectEngineStatuses,probeableEngineIds,summarizeEngines}from"./chunk-exggdhpt.js";import{ISSUE_STATUSES,isValidCron,nextCronAfter,tightenPluginPermissions}from"./chunk-39x1ztey.js";import"./chunk-41ahvk51.js";import{DEFAULT_EDITOR_KIND,EDITOR_CUSTOM_KEY,EDITOR_KINDS,EDITOR_KIND_KEY,normalizeEditorKind,resolveEditorLaunch}from"./chunk-aak5ttgt.js";import{embeddedTerminalEnv}from"./chunk-ef39ym8f.js";import{approxCellWidth,approxCharCells,charWidth,displayWidth,padEndCells}from"./chunk-dvcb6mk4.js";import{UpdatePage,openWithSystemViewer,resolveRowSelectionChrome,spawnDetached}from"./chunk-2ge9th94.js";import{$Fragment,$jsx,$jsxs,DEFAULT_PREFIX_CONFIGURATION,DIRECT_GUIDE_PREFIX_ACTION_ID,FIXED_BINDING_IDS,KobeKeymap,PREFIX_GUIDE_DELAY_MS,PREFIX_HUD_TTL_MS,RemoteOrchestrator,armPrefixFromCurrentStack,attentionEdges,attentionKindFor,bindByIds,bootPaneHost,chipAttentionKind,currentBindingReachability,currentPrefixConfiguration,defaultChordsOf,findBinding,formatChord,imeAnchorController,invokeArmedPrefixActionFromCurrentStack,isKittyModifierKeyEvent,isNarrowWidth,keymapVersion,modalActive,narrowSurface,pageCloseBindings,pluginKeybindings,prefixAction,prefixHudClock,prefixHudState,reloadUserKeybindings,require_react_production,shortcutCaption,showDialog,subscribeKeymapVersion,useAccessor,useBindingStackVersion,useBindings,useDialog,useDialogPaddingX,useFocus,useKV,useLatest,useNotifications,useOptionalDialog,useOptionalFocus,useOptionalKV,useOptionalNotifications,usePaste,useRenderer,useT,useTerminalDimensions,useTheme,userKeybindingsReport}from"./chunk-vb4xz8pz.js";import"./chunk-764bsyb0.js";import{getGlobalDefaultVendor,resolvePreferredVendor,setGlobalDefaultVendor,setRepoLastActiveVendor}from"./chunk-caqpt09m.js";import{parseNumstatRows,parsePorcelain,pickPushedChanges,sameWorktreeChanges}from"./chunk-xqw5d5rv.js";import{parsePorcelainRows,unquoteGitPath}from"./chunk-h4n8ffqy.js";import{READ_ONLY_GIT_ENV,readOnlyGitProcessEnv}from"./chunk-6xppe9bj.js";import{reloadPluginEngines}from"./chunk-ntt7gy5a.js";import{submitFeedback}from"./chunk-158gfptx.js";import{DIRTY_WORKTREE_CODE,TASK_DELETING_CODE,TaskDeletingError}from"./chunk-r05r01nv.js";import{PROJECT_SIBLING_BASE,WORKTREE_BASE_CUSTOM_KEY,worktreeBaseKindOf}from"./chunk-6pt23vas.js";import{currentPluginPlatform,loadPluginRegistry,parsePluginManifest,pluginConfigDir,pluginLogPath,pluginManifestPath,qualifiedActionId,readPluginManifest,savePluginRegistry,supportsPlatform}from"./chunk-38272eqv.js";import{PROJECT_DIR_TOKEN,WORKTREE_BASE_KEY,hasProjectDirToken,normalizeWorktreeBase}from"./chunk-5f80ggc3.js";import{ulid}from"./chunk-qkehg2c1.js";import{matchPathGlob}from"./chunk-kg11c1py.js";import{CURRENT_VERSION}from"./chunk-dyxz1ch3.js";import{tildify}from"./chunk-msr1xtay.js";import{addTab,closeActiveTab,closeTab,collapseSplit,cycleLeaf,cycleTab,engineTabSpawnFor,expandHome,filterSubdirs,findEditorTab,forgetTaskTabsSnapshot,hasEngineLeaf,initialShellTabs,initialSplit,initialTabs,isTabSplit,joinDrill,joinPicked,leaves,listSubdirs,moveTab,openCommandTab,openContentTab,openEditorTab,pathLeaf,recycleTabs,rehydrateTabs,removeLeaf,renameActiveTab,renameLeaf,reopenTabs,selectTab,setTabAutoTitle,setTabEngineCommand,setTabForkFrom,setTabInitialPrompt,setTabLastTitle,setTabLiveVendor,setTabSessionId,setTabSpawned,setTabSplit,setTabTitle,shellIdentityInput,splitActive,splitLeafNames,splitLeafPtyKey,splitPathForDirSuggest,stripTrailingSlash,sweepOrphanTabsSnapshots,tabCwdFor,tabExitAction,tabPtyKey,tabPtyKeyFor,tabTitle,tabTitleStable,terminalTabsKey,visibleNativeStatus}from"./chunk-qch6g9za.js";import{AUTO_STATUS_KEY,DISPATCHER_KEY,Ke,composerGatePreferenceOn,hostedTaskKeys,killHostedSessions,listHostedSessions,openHostedSessionHost,pastePromptWhenEngineUp,require_xterm_headless,toggleComposerGatePreference}from"./chunk-mhzv94cg.js";import{execHostForWorktreePath,remoteKeyForRepo}from"./chunk-ds9qf1w1.js";import"./chunk-bkba9c4n.js";import"./chunk-g2advs8t.js";import{ensurePtyHostReachable}from"./chunk-wdhcrcre.js";import{ENGINE_PROTOCOLS,engineCanFork,engineLaunchArgv,engineProtocolKey,getEngineProtocol,pickUnclaimedSessionId,protocolEntry,withPinnedSessionId}from"./chunk-ptjc5mtc.js";import{DEFAULT_TERMINAL_COLORS,formatDefaultColorReply,parseTerminalDefaultColors}from"./chunk-7q67dz4c.js";import"./chunk-1cjd7h8p.js";import{resolveLoginShell}from"./chunk-b99tf0jr.js";import{readFirstNonEmptyRepoFile}from"./chunk-t27t2x9b.js";import"./chunk-hape5vwj.js";import{defaultEngineCommand,engineCommandKey,engineDisplayName,engineNameKey,humanizeSlug,interactiveEngineCommand,kobeApiInvocation}from"./chunk-de751t37.js";import{FOCUS_ACCENT_SLOTS,LOCALE_KEY}from"./chunk-fm5s7njg.js";import{currentLang,intlLocale,setLocaleLang,t,tKeys}from"./chunk-nss70xwr.js";import{LOCALES}from"./chunk-fd2zhddn.js";import{createStateCell}from"./chunk-sdyzxayr.js";import"./chunk-zqfbyq0a.js";import"./chunk-jvxh93nz.js";import{connectOrStartDaemon}from"./chunk-4502n1bk.js";import"./chunk-nm0pq5r6.js";import"./chunk-mqqnk8w7.js";import{KobeDaemonClient}from"./chunk-0wnfq5sx.js";import{attentionInboxItemKey,automationRunNeedsAttention}from"./chunk-7j5372wb.js";import"./chunk-mnqxgvyb.js";import{foregroundEngineIn,parsePsSnapshot,psSnapshot}from"./chunk-n7n12868.js";import{engineEntry,engineSessionIdFromTitle,engineTitleTurnHint,getCapabilities,stripEngineStatusPrefix}from"./chunk-4gjr08g0.js";import{availableEngineIds,installedEngineIds}from"./chunk-sfv15era.js";import"./chunk-w7zv47mp.js";import{maybeStartScheduledRun,spawnCapture}from"./chunk-gwcneg6c.js";import{roveCliInvocation}from"./chunk-25hxhtdr.js";import"./chunk-7jkf3tvr.js";import"./chunk-2fypr41w.js";import{addSavedRepo,getSavedRepos,isGitRepo,isRemoteRepoKey,resolveMainRepoRoot}from"./chunk-kt1ppyje.js";import{loadStateFile}from"./chunk-5v893waj.js";import"./chunk-axfn4f28.js";import{DEFAULT_TASK_VENDOR,TASK_STATUSES}from"./chunk-xy8be792.js";import"./chunk-a3a9gdc4.js";import{errorMessage,userFacingErrorMessage}from"./chunk-2brn8e1y.js";import"./chunk-3wj69b0a.js";import{isDev,promptAttachmentsDir,roveStateDir}from"./chunk-ch9b1d5y.js";import{ALL_VENDORS,isBuiltinVendor,nextVendorWithin,prevVendorWithin}from"./chunk-bq3fyc0p.js";import{activeCliName}from"./chunk-p7s4xwgx.js";import"./chunk-4pmd0mxp.js";import{ROVE_PRODUCT_NAME}from"./chunk-g56kvet6.js";import{logClientError}from"./chunk-k2ckx8zw.js";import"./chunk-pw6yfj10.js";import{defaultDaemonSocketPath}from"./chunk-mcdv19rs.js";import{readRoveEnv}from"./chunk-r3k9rbwm.js";import{__require,__toESM}from"./chunk-wqfp8d9w.js";var import_react115=__toESM(require_react_production(),1);function truncateEnd(s,max){if(max<=0)return"";let points=[...s];if(points.length<=max)return s;return`${points.slice(0,Math.max(0,max-1)).join("")}\u2026`}function truncateEndCells(s,maxCells,cellsOf){if(maxCells<=0)return"";let total=0;for(let ch of s)total+=cellsOf(ch.codePointAt(0)??0);if(total<=maxCells)return s;let used=0,out="";for(let ch of s){let w=cellsOf(ch.codePointAt(0)??0);if(used+w>maxCells-1)break;used+=w,out+=ch}return`${out}\u2026`}function truncateStart(s,max){if(max<=0)return"";let points=[...s];if(points.length<=max)return s;return`\u2026${points.slice(points.length-Math.max(0,max-1)).join("")}`}function truncateStartCells(s,maxCells,cellsOf){if(maxCells<=0)return"";let points=[...s],total=0;for(let ch of points)total+=cellsOf(ch.codePointAt(0)??0);if(total<=maxCells)return s;let used=0,out="";for(let i=points.length-1;i>=0;i--){let ch=points[i],w=cellsOf(ch.codePointAt(0)??0);if(used+w>maxCells-1)break;used+=w,out=ch+out}return`\u2026${out}`}var SIDEBAR_WIDTH=24;function sidebarWidthFor(terminalWidth){return Math.max(SIDEBAR_WIDTH,Math.min(40,Math.floor(terminalWidth/6)))}var MAIN_BRANCH_POLL_MS=2000;function sidebarEmptyStateKey(opts){if(opts.searching)return"tasks.empty.noMatchSearch";if(opts.projectFilter)return"tasks.empty.noActiveProject";return"tasks.empty.noActive"}var BRANCH_LABEL_MAX=16;function truncateBranchLabel(branch,max=BRANCH_LABEL_MAX){return truncateEnd(branch,max)}function toneColor(theme,tone){switch(tone){case"success":return theme.success;case"warning":return theme.warning;case"primary":return theme.primary;case"error":return theme.error;default:return theme.textMuted}}function searchQueryKeystroke(query,evt){if(evt.defaultPrevented)return null;if(evt.ctrl||evt.meta||evt.option)return null;if(evt.name==="backspace")return query.slice(0,-1);let seq=evt.sequence;if(!seq||seq.length!==1)return null;let code=seq.charCodeAt(0);if(code<32||code===127)return null;return query+seq}var m=0,p=0,g=0,b=0,I;((r)=>{function u(t2,a,s,i){return i!==void 0?`#${B(t2)}${B(a)}${B(s)}${B(i)}`:`#${B(t2)}${B(a)}${B(s)}`}r.toCss=u;function o(t2,a,s,i=255){return(t2<<24|a<<16|s<<8|i)>>>0}r.toRgba=o;function e(t2,a,s,i){return{css:r.toCss(t2,a,s,i),rgba:r.toRgba(t2,a,s,i)}}r.toColor=e})(I||={});var $;((i)=>{function u(n,l){if(b=(l.rgba&255)/255,b===1)return{css:l.css,rgba:l.rgba};let f=l.rgba>>24&255,d=l.rgba>>16&255,c=l.rgba>>8&255,C=n.rgba>>24&255,h=n.rgba>>16&255,x=n.rgba>>8&255;m=C+Math.round((f-C)*b),p=h+Math.round((d-h)*b),g=x+Math.round((c-x)*b);let R=I.toCss(m,p,g),L=I.toRgba(m,p,g);return{css:R,rgba:L}}i.blend=u;function o(n){return(n.rgba&255)===255}i.isOpaque=o;function e(n,l,f){let d=y.ensureContrastRatio(n.rgba,l.rgba,f);if(d)return I.toColor(d>>24&255,d>>16&255,d>>8&255)}i.ensureContrastRatio=e;function r(n){let l=(n.rgba|255)>>>0;return[m,p,g]=y.toChannels(l),{css:I.toCss(m,p,g),rgba:l}}i.opaque=r;function t2(n,l){return b=Math.round(l*255),[m,p,g]=y.toChannels(n.rgba),{css:I.toCss(m,p,g,b),rgba:I.toRgba(m,p,g,b)}}i.opacity=t2;function a(n,l){return b=n.rgba&255,t2(n,b*l/255)}i.multiplyOpacity=a;function s(n){return[n.rgba>>24&255,n.rgba>>16&255,n.rgba>>8&255]}i.toColorRGB=s})($||={});var _;((r)=>{let u,o;try{let t2=document.createElement("canvas");t2.width=1,t2.height=1;let a=t2.getContext("2d",{willReadFrequently:!0});a&&(u=a,u.globalCompositeOperation="copy",o=u.createLinearGradient(0,0,1,1))}catch{}function e(t2){if(t2.match(/#[\da-f]{3,8}/i))switch(t2.length){case 4:return m=parseInt(t2.slice(1,2).repeat(2),16),p=parseInt(t2.slice(2,3).repeat(2),16),g=parseInt(t2.slice(3,4).repeat(2),16),I.toColor(m,p,g);case 5:return m=parseInt(t2.slice(1,2).repeat(2),16),p=parseInt(t2.slice(2,3).repeat(2),16),g=parseInt(t2.slice(3,4).repeat(2),16),b=parseInt(t2.slice(4,5).repeat(2),16),I.toColor(m,p,g,b);case 7:return{css:t2,rgba:(parseInt(t2.slice(1),16)<<8|255)>>>0};case 9:return{css:t2,rgba:parseInt(t2.slice(1),16)>>>0}}let a=t2.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(a)return m=parseInt(a[1]),p=parseInt(a[2]),g=parseInt(a[3]),b=Math.round((a[5]===void 0?1:parseFloat(a[5]))*255),I.toColor(m,p,g,b);if(!u||!o)throw Error("css.toColor: Unsupported css format");if(u.fillStyle=o,u.fillStyle=t2,typeof u.fillStyle!="string")throw Error("css.toColor: Unsupported css format");if(u.fillRect(0,0,1,1),[m,p,g,b]=u.getImageData(0,0,1,1).data,b!==255)throw Error("css.toColor: Unsupported css format");return{rgba:I.toRgba(m,p,g,b),css:t2}}r.toColor=e})(_||={});var v;((e)=>{function u(r){return o(r>>16&255,r>>8&255,r&255)}e.relativeLuminance=u;function o(r,t2,a){let s=r/255,i=t2/255,n=a/255,l=s<=0.03928?s/12.92:Math.pow((s+0.055)/1.055,2.4),f=i<=0.03928?i/12.92:Math.pow((i+0.055)/1.055,2.4),d=n<=0.03928?n/12.92:Math.pow((n+0.055)/1.055,2.4);return l*0.2126+f*0.7152+d*0.0722}e.relativeLuminance2=o})(v||={});var y;((a)=>{function u(s,i){if(b=(i&255)/255,b===1)return i;let n=i>>24&255,l=i>>16&255,f=i>>8&255,d=s>>24&255,c=s>>16&255,C=s>>8&255;return m=d+Math.round((n-d)*b),p=c+Math.round((l-c)*b),g=C+Math.round((f-C)*b),I.toRgba(m,p,g)}a.blend=u;function o(s,i,n){let l=v.relativeLuminance(s>>8),f=v.relativeLuminance(i>>8);if(F(l,f)<n){if(f<l){let h=e(s,i,n),x=F(l,v.relativeLuminance(h>>8));if(x<n){let R=r(s,i,n),L=F(l,v.relativeLuminance(R>>8));return x>L?h:R}return h}let c=r(s,i,n),C=F(l,v.relativeLuminance(c>>8));if(C<n){let h=e(s,i,n),x=F(l,v.relativeLuminance(h>>8));return C>x?c:h}return c}}a.ensureContrastRatio=o;function e(s,i,n){let l=s>>24&255,f=s>>16&255,d=s>>8&255,c=i>>24&255,C=i>>16&255,h=i>>8&255,x=F(v.relativeLuminance2(c,C,h),v.relativeLuminance2(l,f,d));for(;x<n&&(c>0||C>0||h>0);)c-=Math.max(0,Math.ceil(c*0.1)),C-=Math.max(0,Math.ceil(C*0.1)),h-=Math.max(0,Math.ceil(h*0.1)),x=F(v.relativeLuminance2(c,C,h),v.relativeLuminance2(l,f,d));return(c<<24|C<<16|h<<8|255)>>>0}a.reduceLuminance=e;function r(s,i,n){let l=s>>24&255,f=s>>16&255,d=s>>8&255,c=i>>24&255,C=i>>16&255,h=i>>8&255,x=F(v.relativeLuminance2(c,C,h),v.relativeLuminance2(l,f,d));for(;x<n&&(c<255||C<255||h<255);)c=Math.min(255,c+Math.ceil((255-c)*0.1)),C=Math.min(255,C+Math.ceil((255-C)*0.1)),h=Math.min(255,h+Math.ceil((255-h)*0.1)),x=F(v.relativeLuminance2(c,C,h),v.relativeLuminance2(l,f,d));return(c<<24|C<<16|h<<8|255)>>>0}a.increaseLuminance=r;function t2(s){return[s>>24&255,s>>16&255,s>>8&255,s&255]}a.toChannels=t2})(y||={});function B(u){let o=u.toString(16);return o.length<2?"0"+o:o}function F(u,o){return u<o?(o+0.05)/(u+0.05):(u+0.05)/(o+0.05)}var E=Object.freeze((()=>{let u=[_.toColor("#2e3436"),_.toColor("#cc0000"),_.toColor("#4e9a06"),_.toColor("#c4a000"),_.toColor("#3465a4"),_.toColor("#75507b"),_.toColor("#06989a"),_.toColor("#d3d7cf"),_.toColor("#555753"),_.toColor("#ef2929"),_.toColor("#8ae234"),_.toColor("#fce94f"),_.toColor("#729fcf"),_.toColor("#ad7fa8"),_.toColor("#34e2e2"),_.toColor("#eeeeec")],o=[0,95,135,175,215,255];for(let e=0;e<216;e++){let r=o[e/36%6|0],t2=o[e/6%6|0],a=o[e%6];u.push({css:I.toCss(r,t2,a),rgba:I.toRgba(r,t2,a)})}for(let e=0;e<24;e++){let r=8+e*10;u.push({css:I.toCss(r,r,r),rgba:I.toRgba(r,r,r)})}return u})());function A(u,o,e){return Math.max(o,Math.min(u,e))}function O(u){switch(u){case"&":return"&amp;";case"<":return"&lt;"}return u}var S=class{constructor(o){this._buffer=o}serialize(o,e){let r=this._buffer.getNullCell(),t2=this._buffer.getNullCell(),a=r,s=o.start.y,i=o.end.y,n=o.start.x,l=o.end.x;this._beforeSerialize(i-s,s,i);for(let f=s;f<=i;f++){let d=this._buffer.getLine(f);if(d){let c=f===o.start.y?n:0,C=f===o.end.y?l:d.length;for(let h=c;h<C;h++){let x=d.getCell(h,a===r?t2:r);if(!x){console.warn(`Can't get cell at row=${f}, col=${h}`);continue}this._nextCell(x,a,f,h),a=x}}this._rowEnd(f,f===i)}return this._afterSerialize(),this._serializeString(e)}_nextCell(o,e,r,t2){}_rowEnd(o,e){}_beforeSerialize(o,e,r){}_afterSerialize(){}_serializeString(o){return""}};function T(u,o){return u.getFgColorMode()===o.getFgColorMode()&&u.getFgColor()===o.getFgColor()}function w(u,o){return u.getBgColorMode()===o.getBgColorMode()&&u.getBgColor()===o.getBgColor()}function z(u,o){return u.isInverse()===o.isInverse()&&u.isBold()===o.isBold()&&u.isUnderline()===o.isUnderline()&&u.isOverline()===o.isOverline()&&u.isBlink()===o.isBlink()&&u.isInvisible()===o.isInvisible()&&u.isItalic()===o.isItalic()&&u.isDim()===o.isDim()&&u.isStrikethrough()===o.isStrikethrough()}var k=class extends S{constructor(e,r){super(e);this._terminal=r,this._rowIndex=0,this._allRows=[],this._allRowSeparators=[],this._currentRow="",this._nullCellCount=0,this._cursorStyle=this._buffer.getNullCell(),this._cursorStyleRow=0,this._cursorStyleCol=0,this._backgroundCell=this._buffer.getNullCell(),this._firstRow=0,this._lastCursorRow=0,this._lastCursorCol=0,this._lastContentCursorRow=0,this._lastContentCursorCol=0,this._thisRowLastChar=this._buffer.getNullCell(),this._thisRowLastSecondChar=this._buffer.getNullCell(),this._nextRowFirstChar=this._buffer.getNullCell()}_beforeSerialize(e,r,t2){this._allRows=Array(e),this._lastContentCursorRow=r,this._lastCursorRow=r,this._firstRow=r}_rowEnd(e,r){this._nullCellCount>0&&!w(this._cursorStyle,this._backgroundCell)&&(this._currentRow+=`\x1B[${this._nullCellCount}X`);let t2="";if(!r){e-this._firstRow>=this._terminal.rows&&this._buffer.getLine(this._cursorStyleRow)?.getCell(this._cursorStyleCol,this._backgroundCell);let a=this._buffer.getLine(e),s=this._buffer.getLine(e+1);if(!s.isWrapped)t2=`\r
3
3
  `,this._lastCursorRow=e+1,this._lastCursorCol=0;else{t2="";let i=a.getCell(a.length-1,this._thisRowLastChar),n=a.getCell(a.length-2,this._thisRowLastSecondChar),l=s.getCell(0,this._nextRowFirstChar),f=l.getWidth()>1,d=!1;(l.getChars()&&f?this._nullCellCount<=1:this._nullCellCount<=0)&&((i.getChars()||i.getWidth()===0)&&w(i,l)&&(d=!0),f&&(n.getChars()||n.getWidth()===0)&&w(i,l)&&w(n,l)&&(d=!0)),d||(t2="-".repeat(this._nullCellCount+1),t2+="\x1B[1D\x1B[1X",this._nullCellCount>0&&(t2+="\x1B[A",t2+=`\x1B[${a.length-this._nullCellCount}C`,t2+=`\x1B[${this._nullCellCount}X`,t2+=`\x1B[${a.length-this._nullCellCount}D`,t2+="\x1B[B"),this._lastContentCursorRow=e+1,this._lastContentCursorCol=0,this._lastCursorRow=e+1,this._lastCursorCol=0)}}this._allRows[this._rowIndex]=this._currentRow,this._allRowSeparators[this._rowIndex++]=t2,this._currentRow="",this._nullCellCount=0}_diffStyle(e,r){let t2=[],a=!T(e,r),s=!w(e,r),i=!z(e,r);if(a||s||i)if(e.isAttributeDefault())r.isAttributeDefault()||t2.push(0);else{if(a){let n=e.getFgColor();e.isFgRGB()?t2.push(38,2,n>>>16&255,n>>>8&255,n&255):e.isFgPalette()?n>=16?t2.push(38,5,n):t2.push(n&8?90+(n&7):30+(n&7)):t2.push(39)}if(s){let n=e.getBgColor();e.isBgRGB()?t2.push(48,2,n>>>16&255,n>>>8&255,n&255):e.isBgPalette()?n>=16?t2.push(48,5,n):t2.push(n&8?100+(n&7):40+(n&7)):t2.push(49)}i&&(e.isInverse()!==r.isInverse()&&t2.push(e.isInverse()?7:27),e.isBold()!==r.isBold()&&t2.push(e.isBold()?1:22),e.isUnderline()!==r.isUnderline()&&t2.push(e.isUnderline()?4:24),e.isOverline()!==r.isOverline()&&t2.push(e.isOverline()?53:55),e.isBlink()!==r.isBlink()&&t2.push(e.isBlink()?5:25),e.isInvisible()!==r.isInvisible()&&t2.push(e.isInvisible()?8:28),e.isItalic()!==r.isItalic()&&t2.push(e.isItalic()?3:23),e.isDim()!==r.isDim()&&t2.push(e.isDim()?2:22),e.isStrikethrough()!==r.isStrikethrough()&&t2.push(e.isStrikethrough()?9:29))}return t2}_nextCell(e,r,t2,a){if(e.getWidth()===0)return;let i=e.getChars()==="",n=this._diffStyle(e,this._cursorStyle);if(i?!w(this._cursorStyle,e):n.length>0){this._nullCellCount>0&&(w(this._cursorStyle,this._backgroundCell)||(this._currentRow+=`\x1B[${this._nullCellCount}X`),this._currentRow+=`\x1B[${this._nullCellCount}C`,this._nullCellCount=0),this._lastContentCursorRow=this._lastCursorRow=t2,this._lastContentCursorCol=this._lastCursorCol=a,this._currentRow+=`\x1B[${n.join(";")}m`;let f=this._buffer.getLine(t2);f!==void 0&&(f.getCell(a,this._cursorStyle),this._cursorStyleRow=t2,this._cursorStyleCol=a)}i?this._nullCellCount+=e.getWidth():(this._nullCellCount>0&&(w(this._cursorStyle,this._backgroundCell)?this._currentRow+=`\x1B[${this._nullCellCount}C`:(this._currentRow+=`\x1B[${this._nullCellCount}X`,this._currentRow+=`\x1B[${this._nullCellCount}C`),this._nullCellCount=0),this._currentRow+=e.getChars(),this._lastContentCursorRow=this._lastCursorRow=t2,this._lastContentCursorCol=this._lastCursorCol=a+e.getWidth())}_serializeString(e){let r=this._allRows.length;this._buffer.length-this._firstRow<=this._terminal.rows&&(r=this._lastContentCursorRow+1-this._firstRow,this._lastCursorCol=this._lastContentCursorCol,this._lastCursorRow=this._lastContentCursorRow);let t2="";for(let i=0;i<r;i++)t2+=this._allRows[i],i+1<r&&(t2+=this._allRowSeparators[i]);if(!e){let i=this._buffer.baseY+this._buffer.cursorY,n=this._buffer.cursorX,l=i!==this._lastCursorRow||n!==this._lastCursorCol,f=(c)=>{c>0?t2+=`\x1B[${c}C`:c<0&&(t2+=`\x1B[${-c}D`)};l&&(((c)=>{c>0?t2+=`\x1B[${c}B`:c<0&&(t2+=`\x1B[${-c}A`)})(i-this._lastCursorRow),f(n-this._lastCursorCol))}let a=this._terminal._core._inputHandler._curAttrData,s=this._diffStyle(a,this._cursorStyle);return s.length>0&&(t2+=`\x1B[${s.join(";")}m`),t2}},D=class{activate(o){this._terminal=o}_serializeBufferByScrollback(o,e,r){let t2=e.length,a=r===void 0?t2:A(r+o.rows,0,t2);return this._serializeBufferByRange(o,e,{start:t2-a,end:t2-1},!1)}_serializeBufferByRange(o,e,r,t2){return new k(e,o).serialize({start:{x:0,y:typeof r.start=="number"?r.start:r.start.line},end:{x:o.cols,y:typeof r.end=="number"?r.end:r.end.line}},t2)}_serializeBufferAsHTML(o,e){let r=o.buffer.active,t2=new M(r,o,e),a=e.onlySelection??!1,s=e.range;if(s)return t2.serialize({start:{x:s.startCol,y:(s.startLine,s.startLine)},end:{x:o.cols,y:(s.endLine,s.endLine)}});if(!a){let n=r.length,l=e.scrollback,f=l===void 0?n:A(l+o.rows,0,n);return t2.serialize({start:{x:0,y:n-f},end:{x:o.cols,y:n-1}})}let i=this._terminal?.getSelectionPosition();return i!==void 0?t2.serialize({start:{x:i.start.x,y:i.start.y},end:{x:i.end.x,y:i.end.y}}):""}_serializeModes(o){let e="",r=o.modes;if(r.applicationCursorKeysMode&&(e+="\x1B[?1h"),r.applicationKeypadMode&&(e+="\x1B[?66h"),r.bracketedPasteMode&&(e+="\x1B[?2004h"),r.insertMode&&(e+="\x1B[4h"),r.originMode&&(e+="\x1B[?6h"),r.reverseWraparoundMode&&(e+="\x1B[?45h"),r.sendFocusMode&&(e+="\x1B[?1004h"),r.wraparoundMode===!1&&(e+="\x1B[?7l"),r.mouseTrackingMode!=="none")switch(r.mouseTrackingMode){case"x10":e+="\x1B[?9h";break;case"vt200":e+="\x1B[?1000h";break;case"drag":e+="\x1B[?1002h";break;case"any":e+="\x1B[?1003h";break}return e}serialize(o){if(!this._terminal)throw Error("Cannot use addon until it has been loaded");let e=o?.range?this._serializeBufferByRange(this._terminal,this._terminal.buffer.normal,o.range,!0):this._serializeBufferByScrollback(this._terminal,this._terminal.buffer.normal,o?.scrollback);if(!o?.excludeAltBuffer&&this._terminal.buffer.active.type==="alternate"){let r=this._serializeBufferByScrollback(this._terminal,this._terminal.buffer.alternate,void 0);e+=`\x1B[?1049h\x1B[H${r}`}return o?.excludeModes||(e+=this._serializeModes(this._terminal)),e}serializeAsHTML(o){if(!this._terminal)throw Error("Cannot use addon until it has been loaded");return this._serializeBufferAsHTML(this._terminal,o||{})}dispose(){}},M=class extends S{constructor(e,r,t2){super(e);this._terminal=r,this._options=t2,this._currentRow="",this._htmlContent="",r._core._themeService?this._ansiColors=r._core._themeService.colors.ansi:this._ansiColors=E}_padStart(e,r,t2){return r=r>>0,t2=t2??" ",e.length>r?e:(r-=e.length,r>t2.length&&(t2+=t2.repeat(r/t2.length)),t2.slice(0,r)+e)}_beforeSerialize(e,r,t2){this._htmlContent+="<html><body><!--StartFragment--><pre>";let a="#000000",s="#ffffff";(this._options.includeGlobalBackground??!1)&&(a=this._terminal.options.theme?.foreground??"#ffffff",s=this._terminal.options.theme?.background??"#000000");let i=[];i.push("color: "+a+";"),i.push("background-color: "+s+";"),i.push("font-family: "+this._terminal.options.fontFamily+";"),i.push("font-size: "+this._terminal.options.fontSize+"px;"),this._htmlContent+="<div style='"+i.join(" ")+"'>"}_afterSerialize(){this._htmlContent+="</div>",this._htmlContent+="</pre><!--EndFragment--></body></html>"}_rowEnd(e,r){this._htmlContent+="<div><span>"+this._currentRow+"</span></div>",this._currentRow=""}_getHexColor(e,r){let t2=r?e.getFgColor():e.getBgColor();if(r?e.isFgRGB():e.isBgRGB())return"#"+[t2>>16&255,t2>>8&255,t2&255].map((s)=>this._padStart(s.toString(16),2,"0")).join("");if(r?e.isFgPalette():e.isBgPalette())return this._ansiColors[t2].css}_diffStyle(e,r){let t2=[],a=!T(e,r),s=!w(e,r),i=!z(e,r);if(a||s||i){let n=this._getHexColor(e,!0);n&&t2.push("color: "+n+";");let l=this._getHexColor(e,!1);return l&&t2.push("background-color: "+l+";"),e.isInverse()&&t2.push("color: #000000; background-color: #BFBFBF;"),e.isBold()&&t2.push("font-weight: bold;"),e.isUnderline()&&e.isOverline()?t2.push("text-decoration: overline underline;"):e.isUnderline()?t2.push("text-decoration: underline;"):e.isOverline()&&t2.push("text-decoration: overline;"),e.isBlink()&&t2.push("text-decoration: blink;"),e.isInvisible()&&t2.push("visibility: hidden;"),e.isItalic()&&t2.push("font-style: italic;"),e.isDim()&&t2.push("opacity: 0.5;"),e.isStrikethrough()&&t2.push("text-decoration: line-through;"),t2}}_nextCell(e,r,t2,a){if(e.getWidth()===0)return;let i=e.getChars()==="",n=this._diffStyle(e,r);n&&(this._currentRow+=n.length===0?"</span><span>":"</span><span style='"+n.join(" ")+"'>"),i?this._currentRow+=" ":this._currentRow+=O(e.getChars())}_serializeString(){return this._htmlContent}};var D2=new Set(["<","=",">"]);var M2=new Set(["P","_","^","X"]);var F2=/[;:]/,I2={TEXT:"TEXT",INTRODUCER:"INTRODUCER",DATA:"DATA",FINAL:"FINAL"},L={CSI:"CSI",DCS:"DCS",DEC:"DEC",ESC:"ESC",OSC:"OSC",PRIVATE:"PRIVATE",SGR:"SGR",STRING:"STRING",TEXT:"TEXT"};function R(e){if(e.length===1)return e[0].raw;if(e.length===0)return"";let t2="";for(let n of e)t2+=n.raw;return t2}function z2(e,t2,n){let r=R(t2),i=e.raw+r+(n?.raw||"");return{type:L.STRING,pos:e.pos,raw:i,command:"APC",params:r?[r]:[]}}function B2(e,t2,n){let r=R(t2),i=n?.raw??"",a=e.raw+r+i,o=[],s=L.CSI,c=0;if(r)for(;c<r.length;){let e2=r.charCodeAt(c);if(e2<48||e2>63)break;c++}let l=c>0?r.substring(0,c):"",u=c<r.length?r.substring(c):"";if(l){let e2=0;for(let t3=0;t3<=l.length;t3++)(t3===l.length||l.charCodeAt(t3)===59||l.charCodeAt(t3)===58)&&(o.push(t3>e2?l.substring(e2,t3):"0"),e2=t3+1)}let d=u+i,f=o[0];if(f!==void 0&&f.charCodeAt(0)===63)return s=L.DEC,f.length>1?o[0]=f.substring(1):o.shift(),{type:s,pos:e.pos,raw:a,command:d,params:o};for(let t3 of o)if(t3.length>0&&D2.has(t3[0])){s=L.PRIVATE;let n2=t3[0]+d;for(let e2=0;e2<o.length;e2++)if(o[e2].length>0&&D2.has(o[e2][0])){o[e2].length>1?o[e2]=o[e2].substring(1):o.splice(e2,1);break}return{type:s,pos:e.pos,raw:a,command:n2,params:o}}return d==="m"&&o.length===5&&o[1]==="2"&&(f==="38"||f==="48")&&o.splice(2,0,"0"),d==="r"&&o.length===2&&o[1]==="0"&&(o[1]="-1"),{type:s,pos:e.pos,raw:a,command:d,params:o}}var V=new Map([["$q",2],["+q",2],["+p",2],["|",1],["{",1]]);function H(e,t2,n){let r=R(t2),i=e.raw+r+(n?.raw??"");if(!r)return{type:L.DCS,pos:e.pos,raw:i,command:"",params:[]};for(let[t3,n2]of V)if(r.startsWith(t3)){let a=r.slice(n2),o=[];if(a)for(let e2 of a.split(F2))o.push(e2||"-1");return{type:L.DCS,pos:e.pos,raw:i,command:t3,params:o}}return{type:L.DCS,pos:e.pos,raw:i,command:"",params:[r]}}function U(e,t2,n){let r=R(t2),i=e.intermediate||(t2[0]?.raw??n?.raw??""),a=e.intermediate&&n?.raw?[n.raw]:[],o=e.raw+r+(n?.raw??"");return{type:L.ESC,pos:e.pos,raw:o,command:i,params:a}}function W(e,t2,n){let r=R(t2),i=e.raw+r+(n?.raw||""),a=r.indexOf(";");if(a===-1)return{type:L.OSC,pos:e.pos,raw:i,command:r,params:[]};let o=r.slice(0,a),s=r.slice(a+1);if(o==="1337")return{type:L.OSC,pos:e.pos,raw:i,command:o,params:[s]};let c=s?s.split(";"):[];return{type:L.OSC,pos:e.pos,raw:i,command:o,params:c}}function G(e,t2,n){let r=R(t2),i=e.raw+r+(n?.raw||"");return{type:L.STRING,pos:e.pos,raw:i,command:"PM",params:r?[r]:[]}}function K(e,t2,n){let r=R(t2),i=e.raw+r+(n?.raw||"");return{type:L.STRING,pos:e.pos,raw:i,command:"SOS",params:r?[r]:[]}}function q(e){return e===24||e===26||e===27||e===155||e===157||e===144||e===159||e===158||e===152}function J(e){return e===24||e===26}function Y(e){return e===27||e===155||e===157||e===144||e===159||e===158||e===152}function X(e){return e===155||e===157||e===144||e===159||e===158||e===152}function Z(e){let t2=[],n=0,r=0,i=0,a=e.length;for(;n<a;)if(r===0){let o=n,s=e.charCodeAt(n);for(;n<a&&!Y(s);)s=e.charCodeAt(++n);if(n>o&&t2.push({type:I2.TEXT,pos:o,raw:e.substring(o,n)}),n>=a)break;if(X(s))t2.push({type:I2.INTRODUCER,pos:n,raw:e[n],code:e[n]}),n++,r=1,i=s;else{let o2=e.charCodeAt(n+1);if(o2===91)t2.push({type:I2.INTRODUCER,pos:n,raw:e.substring(n,n+2),code:"\x9B"}),n+=2,r=1,i=155;else if(o2===93)t2.push({type:I2.INTRODUCER,pos:n,raw:e.substring(n,n+2),code:"\x9D"}),n+=2,r=1,i=157;else if(n+1<a&&M2.has(e[n+1]))t2.push({type:I2.INTRODUCER,pos:n,raw:e.substring(n,n+2),code:e[n+1]}),n+=2,r=1,i=o2;else if(n+1<a){let o3=n+1;for(;o3<a&&e.charCodeAt(o3)>=32&&e.charCodeAt(o3)<=47;)o3++;if(o3>n+1){let r2=e.substring(n+1,o3);t2.push({type:I2.INTRODUCER,pos:n,raw:e.substring(n,o3),code:"\x1B",intermediate:r2})}else t2.push({type:I2.INTRODUCER,pos:n,raw:e[n],code:"\x1B"});n=o3,o3<a&&(r=1,i=27)}else t2.push({type:I2.INTRODUCER,pos:n,raw:e[n],code:"\x1B"}),n++}}else{let o=n;if(i===155){let i2=n;for(;n<a;){let a2=e.charCodeAt(n);if(q(a2)){n>i2&&t2.push({type:I2.DATA,pos:o,raw:e.substring(i2,n)}),r=0,J(a2)&&(t2.push({type:I2.TEXT,pos:n,raw:e[n]}),n++);break}if(a2>=64&&a2<=126){n>i2&&t2.push({type:I2.DATA,pos:o,raw:e.substring(i2,n)}),t2.push({type:I2.FINAL,pos:n,raw:e[n]}),n++,r=0;break}n++}r===1&&n>i2&&t2.push({type:I2.DATA,pos:o,raw:e.substring(i2,n)})}else if(i===27){if(n<a){let i2=e.charCodeAt(n);q(i2)?(r=0,J(i2)&&(t2.push({type:I2.TEXT,pos:n,raw:e[n]}),n++)):(t2.push({type:I2.FINAL,pos:n,raw:e[n]}),n++,r=0)}}else{let s=n;for(;n<a;){let a2=e.charCodeAt(n),c;if(a2===27&&e.charCodeAt(n+1)===92?c="\x1B\\":a2===156?c="\x9C":a2===7&&i===157&&(c="\x07"),c){n>s&&t2.push({type:I2.DATA,pos:o,raw:e.substring(s,n)}),t2.push({type:I2.FINAL,pos:n,raw:c}),n+=c.length,r=0;break}if(q(a2)){n>s&&t2.push({type:I2.DATA,pos:o,raw:e.substring(s,n)}),r=0,J(a2)&&(t2.push({type:I2.TEXT,pos:n,raw:e[n]}),n++);break}n++}r===1&&n>s&&t2.push({type:I2.DATA,pos:o,raw:e.substring(s,n)})}r===1&&(r=0)}return t2}function Q(e,t2,n){switch(e.code){case"\x9B":return B2(e,t2,n);case"\x9D":return W(e,t2,n);case"\x90":case"P":return H(e,t2,n);case"\x9F":case"_":return z2(e,t2,n);case"\x9E":case"X":return G(e,t2,n);case"\x98":case"^":return K(e,t2,n);case"\x1B":return U(e,t2,n);default:return{type:L.TEXT,pos:e.pos,raw:e.raw}}}function $2(e){let t2=[],n=0,r=e.length;for(;n<r;){let i=e[n];if(i.type===I2.TEXT){t2.push({type:L.TEXT,pos:i.pos,raw:i.raw}),n++;continue}if(i.type===I2.INTRODUCER){let a=i,o=[],s;for(n++;n<r;){let t3=e[n];if(t3.type===I2.DATA)o.push(t3);else if(t3.type===I2.FINAL){s=t3,n++;break}else break;n++}t2.push(Q(a,o,s))}else n++}return t2}function ie(e){return $2(Z(e))}var DEFAULT_COLS=80,DEFAULT_ROWS=24,PIPE_SCROLLBACK_LIMIT=200000;function defaultShell(){return resolveLoginShell()}function extractOscTitle(chunk){let title=null;for(let code of ie(chunk))if(code.type==="OSC"&&(code.command==="0"||code.command==="2")&&code.params[0])title=code.params[0];return title}function resolveArgv(opts){if(opts.command&&opts.command.length>0)return[...opts.command];return[opts.shell??defaultShell()]}var shared=null,hostedByKey=new Map;function routeAdd(handle){let set=hostedByKey.get(handle.taskId);if(!set)set=new Set,hostedByKey.set(handle.taskId,set);set.add(handle)}function routeRemove(handle){let set=hostedByKey.get(handle.taskId);if(!set)return 0;if(set.delete(handle),set.size===0)hostedByKey.delete(handle.taskId);return set.size}function routeCount(key){return hostedByKey.get(key)?.size??0}var dispatchInstalled=new WeakSet;function installDispatch(client){if(dispatchInstalled.has(client))return;dispatchInstalled.add(client),client.on("pty.data",(frame)=>{let payload=frame.payload,handles=hostedByKey.get(payload.key);if(handles)for(let handle of handles)handle.feedFrame(payload.data)}),client.on("pty.exit",(frame)=>{let payload=frame.payload,handles=hostedByKey.get(payload.key);if(handles)for(let handle of[...handles])handle.remoteExited(payload.pid)})}function getSharedPtyClient(){if(shared)return shared;let p3=(async()=>{let socketPath=await ensurePtyHostReachable(),client=new KobeDaemonClient(socketPath);return await client.connect(),installDispatch(client),client.onLifecycle("close",()=>{if(shared===p3)shared=null}),client})();return p3.catch(()=>{if(shared===p3)shared=null}),shared=p3,p3}function peekSharedPtyClient(){return shared}function warmHostedShell(cwd,shell=defaultShell()){if((process.env.KOBE_TERMINAL_BACKEND??"hosted")!=="hosted")return;getSharedPtyClient().then((client)=>client.request("pty.warm",{cwd,shell})).catch(()=>{})}var import_headless=__toESM(require_xterm_headless(),1);var SCROLLBACK_ROWS_KEY="terminal.scrollbackRows",DEFAULT_SCROLLBACK_ROWS=1000,SCROLLBACK_ROWS_MIN=100,SCROLLBACK_ROWS_MAX=1e5;function normalizeScrollbackRows(value){let n2=typeof value==="number"?Math.floor(value):typeof value==="string"?Number.parseInt(value.trim(),10):Number.NaN;if(!Number.isFinite(n2))return DEFAULT_SCROLLBACK_ROWS;return Math.min(SCROLLBACK_ROWS_MAX,Math.max(SCROLLBACK_ROWS_MIN,n2))}function persistedScrollbackRows(){return normalizeScrollbackRows(loadStateFile()[SCROLLBACK_ROWS_KEY])}var target=process.env.ROVE_RENDER_PROFILE,renderProfileOn=Boolean(target),counts=new Map,totals=new Map,started=0;function flush(){if(counts.size===0)return;let row={sec:Math.round((Date.now()-started)/1000)};for(let[k3,n2]of counts){row[`${k3}_n`]=n2;let ms=totals.get(k3);if(ms!==void 0)row[`${k3}_ms`]=+ms.toFixed(3)}counts.clear(),totals.clear();try{__require("fs").appendFileSync(target,`${JSON.stringify(row)}
4
4
  `)}catch{}}if(renderProfileOn)started=Date.now(),setInterval(flush,1000).unref?.();function profileTick(stage){if(!renderProfileOn)return;counts.set(stage,(counts.get(stage)??0)+1)}function profileSpan(stage,fn){if(!renderProfileOn)return fn();let t0=performance.now();try{return fn()}finally{counts.set(stage,(counts.get(stage)??0)+1),totals.set(stage,(totals.get(stage)??0)+(performance.now()-t0))}}var KITTY_CSI_U_RE=/^\x1b\[[\d:;]*u$/;function containsControlCharacter(value){for(let character of value){let codePoint=character.codePointAt(0);if(codePoint===void 0||codePoint<=31||codePoint>=127&&codePoint<=159)return!0}return!1}var CTRL_PUNCT_C0={"@":"\x00","[":"\x1B","\\":"\x1C","]":"\x1D","^":"\x1E",_:"\x1F","?":"\x7F"},LEGACY_FUNCTION_KEYS={f1:{kind:"ss3",final:"P"},f2:{kind:"ss3",final:"Q"},f3:{kind:"ss3",final:"R"},f4:{kind:"ss3",final:"S"},f5:{kind:"tilde",number:15},f6:{kind:"tilde",number:17},f7:{kind:"tilde",number:18},f8:{kind:"tilde",number:19},f9:{kind:"tilde",number:20},f10:{kind:"tilde",number:21},f11:{kind:"tilde",number:23},f12:{kind:"tilde",number:24}},XTERM_MODIFIER_NAMED_KEYS=new Set(["delete","kpdelete","insert","kpinsert","up","kpup","down","kpdown","right","kpright","left","kpleft","home","kphome","end","kpend","pageup","kppageup","pagedown","kppagedown"]);function legacyModifier(evt){return 1+(evt.shift?1:0)+(evt.option||evt.meta?2:0)+(evt.ctrl?4:0)+(evt.super?8:0)+(evt.hyper?16:0)}function legacyCursorSequence(evt,final,applicationCursorKeys){let modifier=legacyModifier(evt);if(modifier!==1)return`\x1B[1;${modifier}${final}`;return applicationCursorKeys?`\x1BO${final}`:`\x1B[${final}`}function legacyTildeSequence(evt,number){let modifier=legacyModifier(evt);return modifier===1?`\x1B[${number}~`:`\x1B[${number};${modifier}~`}function legacyFunctionSequence(evt,key){if(key.kind==="tilde")return legacyTildeSequence(evt,key.number);let modifier=legacyModifier(evt);return modifier===1?`\x1BO${key.final}`:`\x1B[1;${modifier}${key.final}`}var NORMAL_TERMINAL_INPUT_MODES={applicationCursorKeys:!1,applicationKeypad:!1};function keyEventToShellBytes(evt,modes=NORMAL_TERMINAL_INPUT_MODES){if(isKittyModifierKeyEvent(evt))return null;let e2=evt,seq=typeof e2.sequence==="string"&&e2.sequence.length>0?e2.sequence:null,kittyInput=e2.source==="kitty"||typeof e2.raw==="string"&&KITTY_CSI_U_RE.test(e2.raw)||seq!=null&&KITTY_CSI_U_RE.test(seq);if(seq!=null&&!kittyInput)return seq;if(seq!=null&&!containsControlCharacter(seq)&&!evt.ctrl&&!e2.option&&!e2.meta)return seq;return synthesizeShellBytes(evt,modes)}function synthesizeShellBytes(evt,modes){let name=evt.name;if(!name)return null;if(evt.shift&&name==="tab")return"\x1B[Z";let functionKey=LEGACY_FUNCTION_KEYS[name],xtermModifiedNamedKey=functionKey!==void 0||XTERM_MODIFIER_NAMED_KEYS.has(name);if((evt.option||evt.meta)&&!xtermModifiedNamedKey){let inner=synthesizeShellBytes({...evt,option:!1,meta:!1},modes);return inner==null?null:`\x1B${inner}`}if(functionKey)return legacyFunctionSequence(evt,functionKey);switch(name){case"return":case"enter":return"\r";case"kpenter":return modes.applicationKeypad&&legacyModifier(evt)===1?"\x1BOM":"\r";case"tab":return"\t";case"backspace":return"\x7F";case"delete":case"kpdelete":return legacyTildeSequence(evt,3);case"insert":case"kpinsert":return legacyTildeSequence(evt,2);case"up":case"kpup":return legacyCursorSequence(evt,"A",modes.applicationCursorKeys);case"down":case"kpdown":return legacyCursorSequence(evt,"B",modes.applicationCursorKeys);case"right":case"kpright":return legacyCursorSequence(evt,"C",modes.applicationCursorKeys);case"left":case"kpleft":return legacyCursorSequence(evt,"D",modes.applicationCursorKeys);case"home":case"kphome":return legacyCursorSequence(evt,"H",modes.applicationCursorKeys);case"end":case"kpend":return legacyCursorSequence(evt,"F",modes.applicationCursorKeys);case"pageup":case"kppageup":return legacyTildeSequence(evt,5);case"pagedown":case"kppagedown":return legacyTildeSequence(evt,6);case"clear":return"\x1B[E";case"escape":return"\x1B";case"space":return evt.ctrl?"\x00":" ";default:if(name.length===1){if(evt.ctrl){let code=name.toLowerCase().charCodeAt(0);if(code>=97&&code<=122)return String.fromCharCode(code-96);let c0=CTRL_PUNCT_C0[name];if(c0!=null)return c0;return null}if(evt.shift&&name>="a"&&name<="z")return name.toUpperCase();return name}return null}}var DEFAULT_PAGE_SIZE=10;var RESERVED_SPEC=[{id:"help.open"},{id:"focus.sidebar"},{id:"chat.tab.new"},{id:"chat.tab.close"},{id:"chat.tab.cycle-next"},{id:"chat.tab.cycle-prev"},{id:"chat.tab.rename"},"ctrl+e","ctrl+f",{id:"workspace.split.right"},{id:"workspace.split.down"},{id:"workspace.split.focus-next"},{id:"focus.next"},{id:"terminal.reset"},{id:"attention.next"},{id:"tasks.jump"}],RESERVED_GLOBAL_CHORDS=[...new Set(RESERVED_SPEC.flatMap((entry)=>typeof entry==="string"?[entry]:defaultChordsOf(entry.id)))],PASSTHROUGH_NAMES=[..."abcdefghijklmnopqrstuvwxyz".split(""),..."ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),..."0123456789".split(""),..." `~!@#$%^&*()-_=+[]{}\\|;:'\",.<>/?".split(""),"return","enter","space","tab","backspace","delete","up","down","left","right","home","end","pageup","pagedown","escape","insert","f1","f2","f3","f4","f5","f6","f7","f8","f9","f10","f11","f12"],PASSTHROUGH_MODIFIER_PREFIXES=["","ctrl+","alt+","shift+","ctrl+shift+","alt+shift+","ctrl+alt+"],PASSTHROUGH_CHORDS=PASSTHROUGH_NAMES.flatMap((name)=>PASSTHROUGH_MODIFIER_PREFIXES.map((prefix)=>`${prefix}${name}`)).filter((chord)=>!RESERVED_GLOBAL_CHORDS.includes(chord));function encodeWheel(modes,direction,col,row){if(modes.mouseTracking)return`\x1B[<${direction==="up"?64:65};${Math.max(1,col)};${Math.max(1,row)}M`;if(modes.alternateScreen)return(modes.applicationCursorKeys?direction==="up"?"\x1BOA":"\x1BOB":direction==="up"?"\x1B[A":"\x1B[B").repeat(3);return null}function encodeMouseButton(modes,kind,button,col,row,modifiers){if(modes.mouseTracking==="none")return null;if(kind==="drag"&&modes.mouseTracking!=="drag"&&modes.mouseTracking!=="any")return null;let code=button;if(kind==="drag")code+=32;if(modifiers?.shift)code+=4;if(modifiers?.alt)code+=8;if(modifiers?.ctrl)code+=16;return`\x1B[<${code};${Math.max(1,col)};${Math.max(1,row)}${kind==="up"?"m":"M"}`}class PtyListeners{data=new Set;exits=new Set;titles=new Set;get dataCount(){return this.data.size}addData(listener){return this.data.add(listener),()=>this.data.delete(listener)}addExit(listener){return this.exits.add(listener),()=>this.exits.delete(listener)}addTitle(listener){return this.titles.add(listener),()=>this.titles.delete(listener)}publishData(snapshot,cursor,window,wrapped){for(let listener of this.data)try{listener(snapshot,cursor,window,wrapped)}catch{}}publishTitle(title){for(let listener of this.titles)try{listener(title)}catch{}}drainExits(){let listeners=[...this.exits];return this.exits.clear(),listeners}clearData(){this.data.clear()}clearAll(){this.data.clear(),this.exits.clear(),this.titles.clear()}}function sameRgb(a2,b3){if(a2===b3)return!0;return a2!==void 0&&b3!==void 0&&a2[0]===b3[0]&&a2[1]===b3[1]&&a2[2]===b3[2]}function sameChunk(a2,b3){return a2.text===b3.text&&(a2.attributes??0)===(b3.attributes??0)&&sameRgb(a2.fg,b3.fg)&&sameRgb(a2.bg,b3.bg)}function sameRow(a2,b3){if(a2===b3)return!0;if(a2.length!==b3.length)return!1;for(let i2=0;i2<a2.length;i2++)if(!sameChunk(a2[i2],b3[i2]))return!1;return!0}function reconcileTerminalRow(previous,next){return previous&&sameRow(previous,next)?previous:next}function reconcileTerminalRows(previous,next){if(previous.length!==next.length)return next;let changed=!1;for(let i2=0;i2<next.length;i2++){let stable=reconcileTerminalRow(previous[i2],next[i2]);if(next[i2]=stable,stable!==previous[i2])changed=!0}return changed?next:previous}function reconcileTerminalCursor(previous,next){if(previous===next)return previous;if(previous&&next&&previous.x===next.x&&previous.y===next.y)return previous;return next}var ATTR=Object.freeze({BOLD:1,DIM:2,ITALIC:4,UNDERLINE:8,BLINK:16,INVERSE:32,HIDDEN:64,STRIKETHROUGH:128}),EMPTY_STYLE=Object.freeze({fg:void 0,bg:void 0,attributes:0});function ansi256ToRgb(index){if(index<0)return[0,0,0];if(index<16)return SYSTEM_PALETTE[index]??[0,0,0];if(index<232){let i2=index-16,r2=Math.floor(i2/36),g3=Math.floor(i2/6%6),b3=i2%6,step=(n2)=>n2===0?0:55+40*n2;return[step(r2),step(g3),step(b3)]}if(index<256){let gray=8+10*(index-232);return[gray,gray,gray]}return[0,0,0]}var SYSTEM_PALETTE=[[21,22,30],[247,118,142],[158,206,106],[224,175,104],[122,162,247],[187,154,247],[125,207,255],[169,177,214],[65,72,104],[255,137,157],[158,224,68],[250,186,74],[141,176,255],[199,169,255],[164,218,255],[192,202,245]];function applySgr(prev,rawParams){let params=rawParams.length===0?[0]:rawParams.map((p3)=>p3===""?0:Number.parseInt(p3,10)||0),fg=prev.fg,bg=prev.bg,attr=prev.attributes,i2=0;while(i2<params.length){let p3=params[i2];if(p3===void 0)break;if(p3===0){fg=void 0,bg=void 0,attr=0,i2+=1;continue}if(p3===1){attr|=ATTR.BOLD,i2+=1;continue}if(p3===2){attr|=ATTR.DIM,i2+=1;continue}if(p3===3){attr|=ATTR.ITALIC,i2+=1;continue}if(p3===4){attr|=ATTR.UNDERLINE,i2+=1;continue}if(p3===5||p3===6){attr|=ATTR.BLINK,i2+=1;continue}if(p3===7){attr|=ATTR.INVERSE,i2+=1;continue}if(p3===8){attr|=ATTR.HIDDEN,i2+=1;continue}if(p3===9){attr|=ATTR.STRIKETHROUGH,i2+=1;continue}if(p3===22){attr&=~(ATTR.BOLD|ATTR.DIM),i2+=1;continue}if(p3===23){attr&=~ATTR.ITALIC,i2+=1;continue}if(p3===24){attr&=~ATTR.UNDERLINE,i2+=1;continue}if(p3===25){attr&=~ATTR.BLINK,i2+=1;continue}if(p3===27){attr&=~ATTR.INVERSE,i2+=1;continue}if(p3===28){attr&=~ATTR.HIDDEN,i2+=1;continue}if(p3===29){attr&=~ATTR.STRIKETHROUGH,i2+=1;continue}if(p3>=30&&p3<=37){fg=ansi256ToRgb(p3-30),i2+=1;continue}if(p3>=90&&p3<=97){fg=ansi256ToRgb(p3-90+8),i2+=1;continue}if(p3===39){fg=void 0,i2+=1;continue}if(p3>=40&&p3<=47){bg=ansi256ToRgb(p3-40),i2+=1;continue}if(p3>=100&&p3<=107){bg=ansi256ToRgb(p3-100+8),i2+=1;continue}if(p3===49){bg=void 0,i2+=1;continue}if(p3===38){let sub=params[i2+1];if(sub===5){let idx=params[i2+2]??0;fg=ansi256ToRgb(idx),i2+=3;continue}if(sub===2){let r2=params[i2+2]??0,g3=params[i2+3]??0,b3=params[i2+4]??0;fg=[r2,g3,b3],i2+=5;continue}i2+=1;continue}if(p3===48){let sub=params[i2+1];if(sub===5){let idx=params[i2+2]??0;bg=ansi256ToRgb(idx),i2+=3;continue}if(sub===2){let r2=params[i2+2]??0,g3=params[i2+3]??0,b3=params[i2+4]??0;bg=[r2,g3,b3],i2+=5;continue}i2+=1;continue}i2+=1}return{fg,bg,attributes:attr}}function sgrParamsFromRaw(raw){let body=raw;if(body.charCodeAt(0)===27)body=body.slice(2);else if(body.charCodeAt(0)===155)body=body.slice(1);if(body.endsWith("m"))body=body.slice(0,-1);return body.split(";")}function parseAnsiLine(input,initial=EMPTY_STYLE){if(input.length===0)return{chunks:[],endStyle:initial};let out=[],style={...initial},buf="",flush2=()=>{if(buf.length===0)return;let c2={text:buf,...style.fg?{fg:style.fg}:{},...style.bg?{bg:style.bg}:{},...style.attributes!==0?{attributes:style.attributes}:{}};out.push(c2),buf=""},codes=ie(input);for(let code of codes){if(code.type==="TEXT"){buf+=code.raw;continue}if(code.type==="CSI"&&code.command==="m"){flush2(),style=applySgr(style,sgrParamsFromRaw(code.raw));continue}if(code.type==="OSC"&&code.command==="8"){flush2();let url=code.params[code.params.length-1]??"";style={...style,attributes:url?style.attributes|ATTR.UNDERLINE:style.attributes&~ATTR.UNDERLINE}}}return flush2(),{chunks:out,endStyle:style}}function parseAnsiSnapshot(input){let lines=input.split(`
5
5
  `),rows=[],carry=EMPTY_STYLE;for(let line of lines){let{chunks,endStyle}=parseAnsiLine(line,carry);rows.push(chunks),carry=endStyle}return rows}var XTERM_COLOR_MODE_DEFAULT=0,XTERM_COLOR_MODE_PALETTE=16777216,XTERM_COLOR_MODE_RGB=50331648,DEFAULT_RENDER_STYLE=Object.freeze({fg:"",bg:"",attrs:0});function colorKeyToRGB(key){if(key==="")return;let sep=key.indexOf(":"),value=Number(key.slice(sep+1));if(key.startsWith("rgb:"))return[value>>16&255,value>>8&255,value&255];if(key.startsWith("pal:"))return ansi256ToRgb(value);return}function colorKey(cell,kind){if(kind==="fg"?cell.isFgDefault():cell.isBgDefault())return"";let mode=kind==="fg"?cell.getFgColorMode():cell.getBgColorMode(),color=kind==="fg"?cell.getFgColor():cell.getBgColor();if(mode===XTERM_COLOR_MODE_RGB||(kind==="fg"?cell.isFgRGB():cell.isBgRGB()))return`rgb:${color}`;if(mode===XTERM_COLOR_MODE_PALETTE||(kind==="fg"?cell.isFgPalette():cell.isBgPalette()))return`pal:${color}`;if(mode===XTERM_COLOR_MODE_DEFAULT)return"";return""}function cellAttributes(cell){let attrs=0;if(cell.isBold())attrs|=ATTR.BOLD;if(cell.isDim())attrs|=ATTR.DIM;if(cell.isItalic())attrs|=ATTR.ITALIC;if(cell.isUnderline())attrs|=ATTR.UNDERLINE;if(cell.isBlink())attrs|=ATTR.BLINK;if(cell.isInverse())attrs|=ATTR.INVERSE;if(cell.isInvisible())attrs|=ATTR.HIDDEN;if(cell.isStrikethrough())attrs|=ATTR.STRIKETHROUGH;return attrs}function matchingStyleRewrite(cell,styleRewrites){if(!styleRewrites||styleRewrites.length===0||!cell.isFgDefault()||cell.isBgDefault())return;let background=colorKeyToRGB(colorKey(cell,"bg"));return styleRewrites.find((rewrite)=>sameRgb2(background,rewrite.matchBackground))}function rgbKey([red,green,blue]){return`rgb:${red<<16|green<<8|blue}`}function cellStyle(cell,styleRewrites){let style={fg:colorKey(cell,"fg"),bg:colorKey(cell,"bg"),attrs:cellAttributes(cell)},rewrite=matchingStyleRewrite(cell,styleRewrites);return rewrite?{...style,fg:rgbKey(rewrite.foreground),bg:rgbKey(rewrite.background)}:style}function styleEquals(a2,b3){return a2.fg===b3.fg&&a2.bg===b3.bg&&a2.attrs===b3.attrs}function renderStyleToChunkFields(style){let fg=colorKeyToRGB(style.fg),bg=colorKeyToRGB(style.bg);return{...fg?{fg}:{},...bg?{bg}:{},...style.attrs!==0?{attributes:style.attrs}:{}}}function isSolidBlock(chars){return chars==="\u2580"||chars==="\u2584"||chars==="\u2588"}function paintsSamePixel(fg,bg){if(fg===void 0||bg===void 0)return!1;return fg[0]===bg[0]&&fg[1]===bg[1]&&fg[2]===bg[2]}function isVisibleCell(cell){let chars=cell.getChars();if(chars!==""&&chars!==" ")return!0;return!cell.isAttributeDefault()||!cell.isFgDefault()||!cell.isBgDefault()}var scratchCell;function getCellReusing(line,x2){if(scratchCell===void 0){let seeded=line.getCell(x2);if(seeded)scratchCell=seeded;return seeded}return line.getCell(x2,scratchCell)}function xtermLineToChunks(line,minLast=-1,styleRewrites){let last=Math.min(line.length-1,minLast);for(let x2=0;x2<line.length;x2++){let cell=getCellReusing(line,x2);if(!cell||cell.getWidth()===0)continue;if(isVisibleCell(cell))last=Math.max(last,x2)}if(last===-1)return[];let out=[],active=DEFAULT_RENDER_STYLE,activeIsFill=!1,buf="",flush2=()=>{if(buf==="")return;out.push({text:buf,...renderStyleToChunkFields(active)}),buf=""};for(let x2=0;x2<=last;x2++){let cell=getCellReusing(line,x2);if(!cell||cell.getWidth()===0)continue;let next=cellStyle(cell,styleRewrites);if(!styleEquals(active,next))flush2(),active=next,activeIsFill=paintsSamePixel(colorKeyToRGB(next.fg),colorKeyToRGB(next.bg));let chars=cell.getChars()||" ";buf+=isSolidBlock(chars)&&activeIsFill?" ":chars}return flush2(),out}function chunkColorMatchesCell(rgb,cell,kind){if(kind==="fg"?cell.isFgDefault():cell.isBgDefault())return rgb===void 0;if(!rgb)return!1;let mode=kind==="fg"?cell.getFgColorMode():cell.getBgColorMode(),color=kind==="fg"?cell.getFgColor():cell.getBgColor();if(mode===XTERM_COLOR_MODE_RGB||(kind==="fg"?cell.isFgRGB():cell.isBgRGB()))return rgb[0]===(color>>16&255)&&rgb[1]===(color>>8&255)&&rgb[2]===(color&255);if(mode===XTERM_COLOR_MODE_PALETTE||(kind==="fg"?cell.isFgPalette():cell.isBgPalette())){let palette=ansi256ToRgb(color);return rgb[0]===palette[0]&&rgb[1]===palette[1]&&rgb[2]===palette[2]}return!1}function sameRgb2(a2,b3){return Boolean(a2&&b3&&a2[0]===b3[0]&&a2[1]===b3[1]&&a2[2]===b3[2])}function chunkStyleMatchesCell(chunk,cell,styleRewrites){let rewrite=matchingStyleRewrite(cell,styleRewrites);if(rewrite)return(chunk.attributes??0)===cellAttributes(cell)&&sameRgb2(chunk.fg,rewrite.foreground)&&sameRgb2(chunk.bg,rewrite.background);return(chunk.attributes??0)===cellAttributes(cell)&&chunkColorMatchesCell(chunk.fg,cell,"fg")&&chunkColorMatchesCell(chunk.bg,cell,"bg")}function xtermLineMatchesChunks(line,row,minLast=-1,styleRewrites){if(!line)return row.length===0;let last=Math.min(line.length-1,minLast);for(let x2=0;x2<line.length;x2++){let cell=getCellReusing(line,x2);if(!cell||cell.getWidth()===0)continue;if(isVisibleCell(cell))last=Math.max(last,x2)}if(last===-1)return row.length===0;let chunkIndex=0,textOffset=0;for(let x2=0;x2<=last;x2++){let cell=getCellReusing(line,x2);if(!cell||cell.getWidth()===0)continue;let chunk=row[chunkIndex];if(!chunk||!chunkStyleMatchesCell(chunk,cell,styleRewrites))return!1;let raw=cell.getChars()||" ",text=isSolidBlock(raw)&&paintsSamePixel(chunk.fg,chunk.bg)?" ":raw;if(!chunk.text.startsWith(text,textOffset))return!1;if(textOffset+=text.length,textOffset===chunk.text.length)chunkIndex++,textOffset=0;else if(textOffset>chunk.text.length)return!1}return chunkIndex===row.length&&textOffset===0}function wireXtermChannels(term,hooks){term.onData(hooks.onReply),term.onTitleChange(hooks.onTitle)}function wireXtermDefaultColorQueries(term,colors,reply){let resolved=parseTerminalDefaultColors(colors)??DEFAULT_TERMINAL_COLORS;for(let slot of[10,11])term.parser.registerOscHandler(slot,(payload)=>{if(payload!=="?")return!1;return reply(formatDefaultColorReply(slot,resolved)),!0})}class XtermRefreshTracker{dirty=null;subscription;supported;constructor(term){let event=term._core?._inputHandler?.onRequestRefreshRows;if(!event){this.supported=!1,this.subscription=null;return}this.supported=!0,this.subscription=event((range)=>{if(!range){this.dirty={kind:"all"};return}if(!this.dirty)this.dirty={kind:"range",start:range.start,end:range.end};else if(this.dirty.kind==="range")this.dirty.start=Math.min(this.dirty.start,range.start),this.dirty.end=Math.max(this.dirty.end,range.end)})}markAll(){this.dirty={kind:"all"}}peek(){return this.dirty}clear(){this.dirty=null}dispose(){this.subscription?.dispose()}}function snapshotMeta(active,viewportRows,scrollbackRows){return{type:active.type,baseY:active.baseY,length:active.length,start:Math.max(0,active.length-(viewportRows+scrollbackRows))}}function sameMeta(a2,b3){return a2.type===b3.type&&a2.baseY===b3.baseY&&a2.length===b3.length&&a2.start===b3.start}function dirtyRowsMatchSnapshot(active,snapshot,previousMeta,currentMeta,dirty,cursorHidden,frozen=null,styleRewrites){if(!previousMeta||!sameMeta(previousMeta,currentMeta)||!dirty)return!1;let first=currentMeta.start,last=currentMeta.length-1;if(dirty.kind==="range")first=Math.max(first,active.baseY+dirty.start),last=Math.min(last,active.baseY+dirty.end);let cursorY=active.baseY+active.cursorY;for(let y3=first;y3<=last;y3++){let row=snapshot[y3-currentMeta.start];if(!row)return!1;if(frozen&&y3<frozen.baseY&&frozen.cache.get(frozen.absBase+y3)===row)continue;let minLast=!cursorHidden&&y3===cursorY?active.cursorX-1:-1;if(!xtermLineMatchesChunks(active.getLine(y3),row,minLast,styleRewrites))return!1}return!0}function xtermSynchronizedOutput(term){try{return term.modes.synchronizedOutputMode===!0}catch{return!1}}function xtermCursorHidden(term){try{return term._core?.coreService?.isCursorHidden===!0}catch{return!1}}function sameFlags(previous,next){if(previous.length!==next.length)return!1;for(let i2=0;i2<next.length;i2++)if(previous[i2]!==next[i2])return!1;return!0}class XtermSnapshotEngine{alternateScreenStyleRewrites;scrollbackCache=new Map;wrappedCache=new Map;wrapped=[];anchor;anchorId=0;snapshotEpoch=0;publishedMeta=null;constructor(alternateScreenStyleRewrites){this.alternateScreenStyleRewrites=alternateScreenStyleRewrites}invalidate(){this.scrollbackCache.clear(),this.wrappedCache.clear(),this.wrapped=[],this.anchor?.dispose(),this.anchor=void 0,this.anchorId=0,this.publishedMeta=null}refresh(term,rows,scrollbackRows,refreshTracker,previousSnapshot,previousCursor,previousWindow){let active=term.buffer.active,styleRewrites=active.type==="alternate"?this.alternateScreenStyleRewrites:void 0,cursorHidden=xtermCursorHidden(term),currentMeta=snapshotMeta(active,rows,scrollbackRows),nextCursor=reconcileTerminalCursor(previousCursor,cursorHidden?null:{x:active.cursorX,y:active.baseY+active.cursorY-currentMeta.start}),verifyAnchor=this.anchor,verifyFrozen=active.type!=="alternate"&&verifyAnchor!==void 0&&!verifyAnchor.isDisposed?{baseY:active.baseY,absBase:this.anchorId-verifyAnchor.line,cache:this.scrollbackCache}:null;if(dirtyRowsMatchSnapshot(active,previousSnapshot,this.publishedMeta,currentMeta,refreshTracker.peek(),cursorHidden,verifyFrozen,styleRewrites))return refreshTracker.clear(),this.publishedMeta=currentMeta,{snapshot:previousSnapshot,cursor:nextCursor,snapshotWindow:previousWindow,wrapped:this.wrapped,changed:nextCursor!==previousCursor};if(xtermSynchronizedOutput(term))return null;let canAnchor=active.type!=="alternate"&&active.baseY>0;if(canAnchor&&(this.anchor===void 0||this.anchor.isDisposed)){this.scrollbackCache.clear(),this.wrappedCache.clear();let fresh=term.registerMarker(-active.cursorY-1);if(fresh)this.snapshotEpoch+=1,this.anchor=fresh,this.anchorId=fresh.line}let anchorAlive=canAnchor&&this.anchor!==void 0&&!this.anchor.isDisposed,absBase=anchorAlive?this.anchorId-this.anchor.line:0,cache=this.scrollbackCache,wrappedCache=this.wrappedCache,rowsOut=[],wrappedOut=[],cursorY=active.baseY+active.cursorY,start=currentMeta.start;for(let y3=start;y3<active.length;y3++){let frozen=anchorAlive&&y3<active.baseY;if(frozen){let cached=cache.get(absBase+y3);if(cached){rowsOut.push(cached),wrappedOut.push(wrappedCache.get(absBase+y3)??!1);continue}}let line=active.getLine(y3),minLast=!cursorHidden&&y3===cursorY?active.cursorX-1:-1,row=line?xtermLineToChunks(line,minLast,styleRewrites):[],wraps=y3>start&&line?.isWrapped===!0,stableRow=frozen?reconcileTerminalRow(previousSnapshot[rowsOut.length],row):row;if(rowsOut.push(stableRow),wrappedOut.push(wraps),frozen)cache.set(absBase+y3,stableRow),wrappedCache.set(absBase+y3,wraps)}if(anchorAlive){let min=absBase+start;for(let id of cache.keys())if(id<min)cache.delete(id);for(let id of wrappedCache.keys())if(id<min)wrappedCache.delete(id)}if(canAnchor){let next=term.registerMarker(-active.cursorY-1);if(next)this.anchorId=anchorAlive?absBase+next.line:0,this.anchor?.dispose(),this.anchor=next}let snapshot=reconcileTerminalRows(previousSnapshot,rowsOut),nextStartLine=absBase+start,snapshotWindow=anchorAlive?previousWindow?.epoch===this.snapshotEpoch&&previousWindow.startLine===nextStartLine?previousWindow:{epoch:this.snapshotEpoch,startLine:nextStartLine}:null;refreshTracker.clear(),this.publishedMeta=currentMeta;let wrapLayoutMoved=!sameFlags(this.wrapped,wrappedOut);if(wrapLayoutMoved)this.wrapped=wrappedOut;let changed=snapshot!==previousSnapshot||nextCursor!==previousCursor||snapshotWindow!==previousWindow||wrapLayoutMoved;return{snapshot,cursor:nextCursor,snapshotWindow,wrapped:this.wrapped,changed}}}var SNAPSHOT_COALESCE_MS=33;class XtermTaskPty{taskId;cwd;term;listeners=new PtyListeners;snapshot=[];cursor=null;snapshotWindow=null;snapshotWrapped=[];snapshotDirty=!1;snapshotEngine;_title=null;_unwatchedSince=Date.now();_killed=!1;muteReplies=!1;cols;rows;refreshQueued=!1;refreshTracker;scrollbackRows;constructor(opts,options={}){if(this.taskId=opts.taskId,this.cwd=opts.cwd,this.cols=opts.cols??DEFAULT_COLS,this.rows=opts.rows??DEFAULT_ROWS,opts.restore?.title)this._title=opts.restore.title;this.scrollbackRows=opts.scrollback??persistedScrollbackRows(),this.term=new import_headless.Terminal({allowProposedApi:!0,cols:this.cols,rows:this.rows,scrollback:this.scrollbackRows}),this.snapshotEngine=new XtermSnapshotEngine(opts.alternateScreenStyleRewrites),this.term.loadAddon(new Ke),this.term.unicode.activeVersion="11",this.refreshTracker=new XtermRefreshTracker(this.term);let reply=(data)=>{if(this._killed||this.muteReplies)return;try{this.transportWrite(data)}catch{}};if(wireXtermChannels(this.term,{onReply:reply,onTitle:(title)=>{if(!title||title===this._title)return;this._title=title,this.listeners.publishTitle(title)}}),options.respondToDefaultColorQueries!==!1)wireXtermDefaultColorQueries(this.term,opts.defaultColors,reply)}get killed(){return this._killed}write(data){if(this._killed||data.length===0)return;try{this.transportWrite(data)}catch{this.markDead(!1)}}inputModes(){try{return{applicationCursorKeys:this.term.modes.applicationCursorKeysMode===!0,applicationKeypad:this.term.modes.applicationKeypadMode===!0}}catch{return{applicationCursorKeys:!1,applicationKeypad:!1}}}onExit(cb){if(this._killed)return cb(),()=>{};return this.listeners.addExit(cb)}onTitleChange(cb){let off=this.listeners.addTitle(cb);if(this._title)try{cb(this._title)}catch{}return off}paste(text){if(this._killed||text.length===0)return;let bracketed=!1;try{bracketed=this.term.modes.bracketedPasteMode===!0}catch{}this.write(bracketed?`\x1B[200~${text}\x1B[201~`:text)}wheel(direction,col,row){if(this._killed)return!1;try{let modes=this.term.modes,seq=encodeWheel({mouseTracking:modes.mouseTrackingMode!=="none",applicationCursorKeys:modes.applicationCursorKeysMode===!0,alternateScreen:this.term.buffer.active.type==="alternate"},direction,col,row);if(seq!==null)return this.write(seq),!0}catch{}return!1}click(kind,button,col,row,modifiers){if(this._killed)return!1;try{let seq=encodeMouseButton({mouseTracking:this.term.modes.mouseTrackingMode},kind,button,col,row,modifiers);if(seq!==null)return this.write(seq),!0}catch{}return!1}get appOwnsMouse(){if(this._killed)return!1;try{return this.term.modes.mouseTrackingMode!=="none"}catch{return!1}}get onAlternateScreen(){if(this._killed)return!1;try{return this.term.buffer.active.type==="alternate"}catch{return!1}}onData(cb){this.ensureFreshSnapshot();let off=this.listeners.addData(cb);if(this._unwatchedSince=null,this.snapshot.length>0)try{cb(this.snapshot,this.cursor,this.snapshotWindow,this.snapshotWrapped)}catch{}return()=>{if(off(),this.listeners.dataCount===0&&this._unwatchedSince===null)this._unwatchedSince=Date.now()}}unwatchedSinceMs(){return this._unwatchedSince}get windowTitle(){return this._title}get scrollback(){return this.scrollbackRows}resizeEmulator(cols,rows){this.cols=cols,this.rows=rows,this.term.resize(cols,rows),this.invalidateScrollbackCache(),this.refreshTracker.markAll()}get size(){return{cols:this.cols,rows:this.rows}}resize(cols,rows){if(this._killed)return;this.cols=cols,this.rows=rows;try{this.term.resize(cols,rows),this.invalidateScrollbackCache(),this.transportResize(cols,rows),this.refreshTracker.markAll(),this.refreshSnapshot()}catch{this.markDead(!1)}}invalidateScrollbackCache(){this.snapshotEngine.invalidate(),this.snapshotWindow=null}capture(){return this.ensureFreshSnapshot(),this.snapshot}captureCursor(){return this.ensureFreshSnapshot(),this.cursor}captureWindow(){return this.ensureFreshSnapshot(),this.snapshotWindow}captureWrapped(){return this.ensureFreshSnapshot(),this.snapshotWrapped}ensureFreshSnapshot(){if(!this.snapshotDirty||this._killed)return;this.refreshSnapshot()}kill(){if(this._killed)return;this.markDead(!0)}feed(data){this.feedInternal(data,!1)}feedReplay(data){this.feedInternal(data,!0)}feedInternal(data,muteReplies){if(this._killed)return;if(muteReplies)this.muteReplies=!0;profileTick("feed"),this.term.write(data,()=>{if(muteReplies)this.muteReplies=!1;if(!this.refreshTracker.supported)this.refreshTracker.markAll();this.queueRefresh()})}queueRefresh(){if(this.listeners.dataCount===0){this.snapshotDirty=!0;return}if(this.refreshQueued)return;this.refreshQueued=!0,setTimeout(()=>{this.refreshQueued=!1,this.refreshSnapshot()},SNAPSHOT_COALESCE_MS)}refreshSnapshot(){if(this._killed)return;let result=profileSpan("refresh",()=>this.snapshotEngine.refresh(this.term,this.rows,this.scrollbackRows,this.refreshTracker,this.snapshot,this.cursor,this.snapshotWindow));if(result===null){this.queueRefresh();return}if(this.snapshot=result.snapshot,this.cursor=result.cursor,this.snapshotWindow=result.snapshotWindow,this.snapshotWrapped=result.wrapped,this.snapshotDirty=!1,result.changed)this.publishSnapshot()}publishSnapshot(){profileTick("publish"),this.listeners.publishData(this.snapshot,this.cursor,this.snapshotWindow,this.snapshotWrapped)}disposeEmulator(){try{this.term.dispose()}catch{}}markDead(killProcess){if(this._killed)return;if(this._killed=!0,this.refreshTracker.dispose(),this.disposeEmulator(),killProcess)try{this.transportKill()}catch{}let exitCbs=this.listeners.drainExits();this.listeners.clearData();for(let cb of exitCbs)try{cb()}catch{}}silentDispose(){this._killed=!0,this.refreshTracker.dispose(),this.disposeEmulator(),this.listeners.clearAll()}}var WIGGLE_MIN_GAP_MS=150;class HostedTaskPty extends XtermTaskPty{client=null;opened=!1;pendingInput=[];pendingResize=null;unsubs=[];deadOnAttach=!1;sessionPid=void 0;pendingExitPid=null;get shellPid(){return this.sessionPid??null}serializer=new D;hostOffset=null;constructor(opts){super(opts,{respondToDefaultColorQueries:!1});this.term.loadAddon(this.serializer),this.openRemote(opts)}static createdFresh(res){return res.alive&&(res.created??res.replay.length===0)}async openRemote(opts){try{let client=await getSharedPtyClient();if(this.killed)return;this.client=client,routeAdd(this),this.unsubs.push(client.onLifecycle("close",()=>this.remoteGone()));let res=await client.request("pty.open",{key:this.taskId,cwd:this.cwd,command:opts.command,shell:opts.shell,cols:this.cols,rows:this.rows,defaultColors:opts.defaultColors,sinceOffset:opts.restore?.byteOffset,sincePid:opts.restore?.pid??void 0});if(this.killed)return;this.sessionPid=res.pid??null,this.hostOffset=res.offset??null;let restored=opts.restore!==void 0&&res.sinceValid===!0&&res.created!==!0&&(res.pid??null)===opts.restore.pid;if(restored&&opts.restore){if(await this.restoreParked(opts.restore,Buffer.from(res.replay,"base64")),this.killed)return}else if(res.replay.length>0)this.feedReplay(Buffer.from(res.replay,"base64"));if(this.opened=!0,this.pendingResize){let{cols,rows}=this.pendingResize;this.pendingResize=null,this.sendResize(cols,rows)}let fresh=HostedTaskPty.createdFresh(res);if(opts.initialInput&&fresh)this.sendInput(opts.initialInput);if(opts.firstMessage&&fresh)pastePromptWhenEngineUp(client,this.taskId,opts.engineBin,opts.firstMessage).catch((err)=>logClientError("pty-hosted",err));for(let data of this.pendingInput.splice(0))this.sendInput(data);let parkedExitPid=this.pendingExitPid;if(this.pendingExitPid=null,!res.alive)this.deadOnAttach=res.replay.length>0||restored,this.remoteGone();else if(parkedExitPid!==null&&parkedExitPid===this.sessionPid)this.remoteGone();else if(res.replay.length>0&&!restored){if(this.sendResize(this.cols,Math.max(1,this.rows-1)),await Promise.all([this.nextDataOrTimeout(500),new Promise((r2)=>setTimeout(r2,WIGGLE_MIN_GAP_MS))]),!this.killed)this.sendResize(this.cols,this.rows)}}catch(err){logClientError("pty-hosted",err),this.remoteGone()}}transportWrite(data){if(!this.opened){this.pendingInput.push(data);return}this.sendInput(data)}transportResize(cols,rows){if(!this.opened){this.pendingResize={cols,rows};return}this.sendResize(cols,rows)}transportKill(){let client=this.client;if(client)client.request("pty.kill",{key:this.taskId}).catch(()=>{});this.cleanup()}kill(){if(this.killed){this.client?.request("pty.kill",{key:this.taskId}).catch(()=>{});return}super.kill()}capturePark(){if(this.killed||!this.opened||this.hostOffset===null||this.sessionPid===void 0)return null;try{return{serialized:Buffer.from(this.serializer.serialize({scrollback:this.scrollback}),"utf8").toString(),title:this.windowTitle,cursorHidden:xtermCursorHidden(this.term),cols:this.cols,rows:this.rows,byteOffset:this.hostOffset,pid:this.sessionPid}}catch{return null}}async restoreParked(state,delta){let targetCols=this.cols,targetRows=this.rows;if(state.cols!==targetCols||state.rows!==targetRows)this.resizeEmulator(state.cols,state.rows);if(this.feedReplay(state.serialized+(state.cursorHidden?"\x1B[?25l":"")),delta.byteLength>0)this.feedReplay(delta);if(await new Promise((resolve)=>{let off=this.onExit(resolve);this.term.write("",()=>{off(),resolve()})}),!this.killed&&(this.cols!==targetCols||this.rows!==targetRows))this.resizeEmulator(targetCols,targetRows)}detach(opts={}){let client=this.client;this.cleanup();let siblings=routeCount(this.taskId);if(client&&siblings===0)client.request("pty.detach",{key:this.taskId,parked:opts.parked===!0,parkedScreenBytes:opts.parkedScreenBytes}).catch(()=>{});this.silentDispose()}sendInput(data){this.client?.request("pty.write",{key:this.taskId,data}).catch(()=>this.remoteGone())}sendResize(cols,rows){this.client?.request("pty.resize",{key:this.taskId,cols,rows}).catch(()=>{})}dataWaiter=null;_lastOutputAt=null;lastOutputAtMs(){return this._lastOutputAt}nextDataOrTimeout(ms){return new Promise((resolve)=>{let timer=setTimeout(()=>{this.dataWaiter=null,resolve()},ms);this.dataWaiter=()=>{this.dataWaiter=null,clearTimeout(timer),resolve()}})}feedFrame(dataB64){this.dataWaiter?.(),this._lastOutputAt=Date.now();let buf=Buffer.from(dataB64,"base64");if(this.hostOffset!==null)this.hostOffset+=buf.byteLength;this.feed(buf)}remoteExited(pid){if(this.killed)return;if(pid===void 0){this.remoteGone();return}if(this.sessionPid===void 0){this.pendingExitPid=pid;return}if(pid!==null&&pid===this.sessionPid)this.remoteGone()}remoteGone(){this.cleanup(),this.markDead(!1)}cleanup(){routeRemove(this);for(let unsub of this.unsubs.splice(0))try{unsub()}catch{}}}class MockTaskPty{taskId;cwd;listeners=new Set;buffer="";writes=[];_killed=!1;_title=null;exitListeners=new Set;titleListeners=new Set;pastes=[];deadOnAttach=!1;wheels=[];clicks=[];appOwnsMouse=!1;onAlternateScreen=!1;_cols;_rows;_cursor=null;modes={applicationCursorKeys:!1,applicationKeypad:!1};constructor(opts){if(this.taskId=opts.taskId,this.cwd=opts.cwd,this._cols=opts.cols??DEFAULT_COLS,this._rows=opts.rows??DEFAULT_ROWS,opts.initialInput)this.writes.push(opts.initialInput)}get killed(){return this._killed}get writeLog(){return this.writes}get geometry(){return{cols:this._cols,rows:this._rows}}feed(data){if(this._killed)return;this.buffer+=data;let title=extractOscTitle(data);if(title&&title!==this._title){this._title=title;for(let cb of this.titleListeners)try{cb(title)}catch{}}let rows=this.capture();for(let cb of this.listeners)try{cb(rows,this._cursor,null)}catch{}}write(data){if(this._killed)return;this.writes.push(data)}inputModes(){return this.modes}replaceScreen(data){if(this._killed)return;this.buffer="",this.feed(data)}onData(cb){if(this.listeners.add(cb),this.buffer!=="")try{cb(this.capture(),this._cursor,null)}catch{}return()=>{this.listeners.delete(cb)}}resize(cols,rows){if(this._killed)return;this._cols=cols,this._rows=rows}capture(){return parseAnsiSnapshot(this.buffer)}setCursor(pos){this._cursor=pos}captureCursor(){if(this._killed)return null;return this._cursor}captureWindow(){return null}kill(){if(this._killed)return;this._killed=!0,this.listeners.clear();let exitCbs=[...this.exitListeners];this.exitListeners.clear();for(let cb of exitCbs)cb()}paste(text){if(this._killed)return;this.pastes.push(text)}wheel(direction,col,row){if(this._killed)return!1;return this.wheels.push({direction,col,row}),!1}click(kind,button,col,row){if(this._killed)return!1;return this.clicks.push({kind,button,col,row}),this.appOwnsMouse}onExit(cb){if(this._killed)return cb(),()=>{};return this.exitListeners.add(cb),()=>{this.exitListeners.delete(cb)}}onTitleChange(cb){if(this.titleListeners.add(cb),this._title)try{cb(this._title)}catch{}return()=>{this.titleListeners.delete(cb)}}}import{spawn}from"child_process";class PipeTaskPty{taskId;cwd;proc;listeners=new Set;buffer="";_killed=!1;_title=null;exitListeners=new Set;titleListeners=new Set;cols;rows;constructor(opts){this.taskId=opts.taskId,this.cwd=opts.cwd,this.cols=opts.cols??DEFAULT_COLS,this.rows=opts.rows??DEFAULT_ROWS;let argv=resolveArgv(opts),exe=argv[0]??defaultShell(),args=argv.slice(1);if(this.proc=spawn(exe,args,{cwd:opts.cwd,env:embeddedTerminalEnv(process.env,{TERM:process.env.TERM??"xterm-256color",COLUMNS:String(this.cols),LINES:String(this.rows),KOBE_TERMINAL_PIPE:"1"}),stdio:["pipe","pipe","pipe"]}),this.proc.stdout?.setEncoding("utf8"),this.proc.stderr?.setEncoding("utf8"),this.proc.stdout?.on("data",(chunk)=>this.append(chunk)),this.proc.stderr?.on("data",(chunk)=>this.append(chunk)),this.proc.stdin?.on("error",()=>this.markDead(!1)),this.proc.on("error",(err)=>{this.append(`
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{buildPaneArgv}from"./chunk-9xt05etk.js";import{PluginCliError,installPlugin,linkPlugin}from"./chunk-j20cerws.js";import{resolvePluginBinPath}from"./chunk-e17gszac.js";import{buildPluginEnv}from"./chunk-41ahvk51.js";import{currentPluginPlatform,loadPluginRegistry,pluginCheckoutDir,pluginConfigDir,pluginLogPath,qualifiedActionId,readPluginManifest,removePluginEntry,savePluginRegistry,supportsPlatform}from"./chunk-38272eqv.js";import{SUBCOMMAND_VERBS}from"./chunk-s76r56rj.js";import"./chunk-98zhyhpz.js";import"./chunk-b99tf0jr.js";import{flagValue}from"./chunk-jvxh93nz.js";import"./chunk-mnqxgvyb.js";import"./chunk-w7zv47mp.js";import{errorMessage}from"./chunk-2brn8e1y.js";import"./chunk-ch9b1d5y.js";import{activeCliName}from"./chunk-p7s4xwgx.js";import"./chunk-4pmd0mxp.js";import"./chunk-g56kvet6.js";import{defaultDaemonSocketPath}from"./chunk-mcdv19rs.js";import"./chunk-r3k9rbwm.js";import{__require}from"./chunk-wqfp8d9w.js";import{spawnSync}from"child_process";import{readFileSync,rmSync}from"fs";var CLI_NAME=activeCliName();function printUsage(out){out.write([`usage: ${CLI_NAME} plugin <command>`,""," install <owner/repo[/subdir]> [--yes] [--ref <rev>] clone from GitHub, preview, build, register"," link <dir> register a local plugin directory (dev)"," list installed + linked plugins"," search [query] browse the marketplace (GitHub topic rove-plugin)"," outdated check GitHub-installed plugins against upstream"," update <id\u2026> | --all [--yes] reinstall stale plugins from GitHub"," enable <id> | disable <id> toggle a plugin without unregistering it"," unlink <id> unregister a linked plugin (files untouched)"," uninstall <id-or-spec> unregister + remove the managed checkout"," config-dir <id> print the plugin's config directory"," log <id> [-n <count>] tail the plugin's command-run log"," action list [--plugin <id>] declared actions"," action invoke <plugin-id.action-id> run an action now"," pane open <plugin-id.pane-id> [--task <task-id>] open a plugin pane as a terminal tab (JSON:"," clients \u2014 0 = no attached UI performed the split)","","Marketplace: https://github.com/topics/rove-plugin (legacy kobe-plugin is included)",""].join(`
2
+ import{buildPaneArgv}from"./chunk-9xt05etk.js";import{PluginCliError,installPlugin,linkPlugin}from"./chunk-vffbdrqa.js";import{resolvePluginBinPath}from"./chunk-e17gszac.js";import{buildPluginEnv}from"./chunk-41ahvk51.js";import{currentPluginPlatform,loadPluginRegistry,pluginCheckoutDir,pluginConfigDir,pluginLogPath,qualifiedActionId,readPluginManifest,removePluginEntry,savePluginRegistry,supportsPlatform}from"./chunk-38272eqv.js";import{SUBCOMMAND_VERBS}from"./chunk-s76r56rj.js";import"./chunk-dyxz1ch3.js";import"./chunk-b99tf0jr.js";import{flagValue}from"./chunk-jvxh93nz.js";import"./chunk-mnqxgvyb.js";import"./chunk-w7zv47mp.js";import{errorMessage}from"./chunk-2brn8e1y.js";import"./chunk-ch9b1d5y.js";import{activeCliName}from"./chunk-p7s4xwgx.js";import"./chunk-4pmd0mxp.js";import"./chunk-g56kvet6.js";import{defaultDaemonSocketPath}from"./chunk-mcdv19rs.js";import"./chunk-r3k9rbwm.js";import{__require}from"./chunk-wqfp8d9w.js";import{spawnSync}from"child_process";import{readFileSync,rmSync}from"fs";var CLI_NAME=activeCliName();function printUsage(out){out.write([`usage: ${CLI_NAME} plugin <command>`,""," install <owner/repo[/subdir]> [--yes] [--ref <rev>] clone from GitHub, preview, build, register"," link <dir> register a local plugin directory (dev)"," list installed + linked plugins"," search [query] browse the marketplace (GitHub topic rove-plugin)"," outdated check GitHub-installed plugins against upstream"," update <id\u2026> | --all [--yes] reinstall stale plugins from GitHub"," enable <id> | disable <id> toggle a plugin without unregistering it"," unlink <id> unregister a linked plugin (files untouched)"," uninstall <id-or-spec> unregister + remove the managed checkout"," config-dir <id> print the plugin's config directory"," log <id> [-n <count>] tail the plugin's command-run log"," action list [--plugin <id>] declared actions"," action invoke <plugin-id.action-id> run an action now"," pane open <plugin-id.pane-id> [--task <task-id>] open a plugin pane as a terminal tab (JSON:"," clients \u2014 0 = no attached UI performed the split)","","Marketplace: https://github.com/topics/rove-plugin (legacy kobe-plugin is included)",""].join(`
3
3
  `))}function loadAll(){return loadPluginRegistry().plugins.map((entry)=>{try{return{entry,manifest:readPluginManifest(entry.root).manifest}}catch{return{entry,manifest:void 0}}})}function requireEntry(id){let entry=loadPluginRegistry().plugins.find((p)=>p.id===id);if(!entry)throw new PluginCliError(`no plugin registered as \`${id}\`; see \`${CLI_NAME} plugin list\``);return entry}function listPlugins(){let all=loadAll();if(all.length===0){console.log(`no plugins installed. Try: ${CLI_NAME} plugin install <owner/repo> \u2014 browse the \`rove-plugin\` GitHub topic.`);return}for(let{entry,manifest}of all){let state=entry.enabled?"enabled":"disabled",kind=entry.source.kind==="link"?`linked ${entry.root}`:entry.source.spec,broken=manifest?"":" [manifest unreadable]";console.log(`${entry.id} v${entry.version} ${state} (${kind})${broken}`)}}function setEnabled(id,enabled){let entry=requireEntry(id),registry=loadPluginRegistry();savePluginRegistry({plugins:registry.plugins.map((p)=>p.id===id?{...entry,enabled}:p)}),console.log(`${enabled?"enabled":"disabled"} ${id}`)}function unlink(id){let entry=requireEntry(id);if(entry.source.kind!=="link")throw new PluginCliError(`\`${id}\` is a GitHub install; use uninstall`);savePluginRegistry(removePluginEntry(loadPluginRegistry(),id)),console.log(`unlinked ${id} (files untouched at ${entry.root})`)}function uninstall(idOrSpec){let registry=loadPluginRegistry(),entry=registry.plugins.find((p)=>p.id===idOrSpec||p.source.kind==="github"&&p.source.spec===idOrSpec);if(!entry)throw new PluginCliError(`no plugin registered as \`${idOrSpec}\``);if(entry.source.kind==="link")throw new PluginCliError(`\`${entry.id}\` is linked; use unlink`);savePluginRegistry(removePluginEntry(registry,entry.id)),rmSync(pluginCheckoutDir(entry.id),{recursive:!0,force:!0}),console.log(`uninstalled ${entry.id} (config/state kept under ~/.rove/plugins/${entry.id}/)`)}function listActions(pluginFilter){for(let{entry,manifest}of loadAll()){if(!manifest||pluginFilter&&entry.id!==pluginFilter)continue;for(let action of manifest.actions)console.log(`${qualifiedActionId(entry.id,action.id)} ${action.title}`)}}function findByLongestPluginPrefix(qualified,options,findItem){for(let{entry,manifest}of loadAll().filter(({entry:entry2,manifest:manifest2})=>Boolean(manifest2&&(!options.enabledOnly||entry2.enabled)&&qualified.startsWith(`${entry2.id}.`))).sort((a,b)=>b.entry.id.length-a.entry.id.length)){let item=findItem(manifest,qualified.slice(entry.id.length+1));if(item!==void 0)return{entry,manifest,item}}return}function assertPlatformSupported(label,item,manifest){if(supportsPlatform(item,manifest,currentPluginPlatform()))return;let declared=(item.platforms??manifest.platforms??[]).join(", ");throw new PluginCliError(`\`${label}\` is not supported on this platform (declares ${declared})`)}function invokeAction(qualified,extraArgs){let hit=findByLongestPluginPrefix(qualified,{enabledOnly:!0},(manifest,actionId)=>manifest.actions.find((a)=>a.id===actionId));if(!hit)throw new PluginCliError(`no action \`${qualified}\`; see \`${CLI_NAME} plugin action list\``);assertPlatformSupported(qualified,hit.item,hit.manifest);let action=hit.item,[cmd,...args]=[...action.command,...extraArgs],res=spawnSync(cmd,args,{cwd:hit.entry.root,stdio:"inherit",env:buildPluginEnv({socketPath:defaultDaemonSocketPath(),binPath:resolvePluginBinPath(),pluginId:hit.entry.id,pluginRoot:hit.entry.root,extra:{ROVE_PLUGIN_ACTION_ID:action.id,ROVE_PLUGIN_INVOKE_CWD:process.cwd()}})});process.exit(res.status??1)}function resolvePaneQualified(qualified){let hit=findByLongestPluginPrefix(qualified,{enabledOnly:!1},(manifest,entrypoint)=>manifest.panes.find((p)=>p.id===entrypoint));if(!hit)throw new PluginCliError(`no pane \`${qualified}\`; see \`${CLI_NAME} plugin list\``);return{pluginId:hit.entry.id,entrypoint:hit.item.id}}async function openPane(pluginId,entrypoint,taskFlag){let loaded=loadAll().find(({entry})=>entry.id===pluginId);if(!loaded?.manifest)throw new PluginCliError(`no plugin \`${pluginId}\` (or its manifest is unreadable)`);if(!loaded.entry.enabled)throw new PluginCliError(`\`${pluginId}\` is disabled`);let pane=loaded.manifest.panes.find((p)=>p.id===entrypoint);if(!pane)throw new PluginCliError(`no pane \`${entrypoint}\` in \`${pluginId}\`; declare it under [[panes]]`);assertPlatformSupported(`${pluginId}.${pane.id}`,pane,loaded.manifest);let{openDaemonSession,resolveActiveTaskId}=await import("./chunk-0fhab4tq.js"),session=await openDaemonSession({mode:"start"});try{let taskId=taskFlag??await resolveActiveTaskId(session.client);if(!taskId)throw new PluginCliError("no active task; pass --task <id>");let argv=buildPaneArgv(loaded.entry.id,loaded.entry.root,pane,{socketPath:defaultDaemonSocketPath(),binPath:resolvePluginBinPath(),taskId}),reply=await session.client.request("tab.open",{taskId,argv,title:pane.title,placement:pane.placement});console.log(JSON.stringify({...reply,ok:!0,pane:`${pluginId}.${pane.id}`,taskId,title:pane.title}))}finally{session.close()}}function tailLog(id,count){requireEntry(id);let text;try{text=readFileSync(pluginLogPath(id),"utf8")}catch{console.log("(no runs logged yet)");return}let lines=text.trimEnd().split(`
4
- `);for(let line of lines.slice(-count))console.log(line)}async function runPluginSubcommand(rest){let[command,...args]=rest;if(command!==void 0&&!SUBCOMMAND_VERBS.plugin.includes(command)){let isHelp=command==="help"||command==="--help"||command==="-h";if(printUsage(isHelp?process.stdout:process.stderr),!isHelp)process.exit(2);return}try{switch(command){case"install":{let spec=args.find((a)=>!a.startsWith("-"));if(!spec)throw new PluginCliError("install needs <owner/repo[/subdir]>");await installPlugin(spec,{yes:args.includes("--yes"),ref:flagValue(args,"--ref")});return}case"link":{if(!args[0])throw new PluginCliError("link needs a directory");linkPlugin(args[0]);return}case"list":listPlugins();return;case"search":{let{searchMarketplace}=await import("./chunk-max057d8.js");await searchMarketplace(args.find((a)=>!a.startsWith("-")));return}case"outdated":{let{printOutdated}=await import("./chunk-n80h9k0r.js");printOutdated();return}case"update":{let{updatePlugins}=await import("./chunk-n80h9k0r.js");await updatePlugins(args.filter((a)=>!a.startsWith("-")),{all:args.includes("--all"),yes:args.includes("--yes")});return}case"enable":case"disable":{if(!args[0])throw new PluginCliError(`${command} needs a plugin id`);setEnabled(args[0],command==="enable");return}case"unlink":{if(!args[0])throw new PluginCliError("unlink needs a plugin id");unlink(args[0]);return}case"uninstall":{if(!args[0])throw new PluginCliError("uninstall needs a plugin id or owner/repo spec");uninstall(args[0]);return}case"config-dir":{if(!args[0])throw new PluginCliError("config-dir needs a plugin id");requireEntry(args[0]),console.log(pluginConfigDir(args[0]));return}case"log":{if(!args[0])throw new PluginCliError("log needs a plugin id");tailLog(args[0],Number.parseInt(flagValue(args,"-n")??"20",10)||20);return}case"pane":{let[sub,...paneArgs]=args;if(sub==="open"){let positional=paneArgs.find((a)=>!a.startsWith("-")&&a!==flagValue(paneArgs,"--task")),pluginId=flagValue(paneArgs,"--plugin"),entrypoint=flagValue(paneArgs,"--entrypoint");if(!pluginId||!entrypoint){if(!positional)throw new PluginCliError("pane open needs <plugin-id.pane-id> (or --plugin <id> --entrypoint <pane-id>) [--task <task-id>]");({pluginId,entrypoint}=resolvePaneQualified(positional))}await openPane(pluginId,entrypoint,flagValue(paneArgs,"--task"));return}printUsage(process.stderr),process.exit(2);return}case"action":{let[sub,...actionArgs]=args;if(sub==="list"){listActions(flagValue(actionArgs,"--plugin"));return}if(sub==="invoke"){if(!actionArgs[0])throw new PluginCliError("action invoke needs <plugin-id.action-id>");invokeAction(actionArgs[0],actionArgs.slice(1));return}printUsage(process.stderr),process.exit(2);return}default:{let isHelp=command===void 0||command==="help"||command==="--help"||command==="-h";if(printUsage(isHelp?process.stdout:process.stderr),!isHelp)process.exit(2);return}}}catch(err){if(err instanceof PluginCliError)console.error(`${CLI_NAME} plugin: ${err.message}`),process.exit(1);console.error(`${CLI_NAME} plugin: ${errorMessage(err)}`),process.exit(1)}}export{runPluginSubcommand};
4
+ `);for(let line of lines.slice(-count))console.log(line)}async function runPluginSubcommand(rest){let[command,...args]=rest;if(command!==void 0&&!SUBCOMMAND_VERBS.plugin.includes(command)){let isHelp=command==="help"||command==="--help"||command==="-h";if(printUsage(isHelp?process.stdout:process.stderr),!isHelp)process.exit(2);return}try{switch(command){case"install":{let spec=args.find((a)=>!a.startsWith("-"));if(!spec)throw new PluginCliError("install needs <owner/repo[/subdir]>");await installPlugin(spec,{yes:args.includes("--yes"),ref:flagValue(args,"--ref")});return}case"link":{if(!args[0])throw new PluginCliError("link needs a directory");linkPlugin(args[0]);return}case"list":listPlugins();return;case"search":{let{searchMarketplace}=await import("./chunk-max057d8.js");await searchMarketplace(args.find((a)=>!a.startsWith("-")));return}case"outdated":{let{printOutdated}=await import("./chunk-w93ahgrj.js");printOutdated();return}case"update":{let{updatePlugins}=await import("./chunk-w93ahgrj.js");await updatePlugins(args.filter((a)=>!a.startsWith("-")),{all:args.includes("--all"),yes:args.includes("--yes")});return}case"enable":case"disable":{if(!args[0])throw new PluginCliError(`${command} needs a plugin id`);setEnabled(args[0],command==="enable");return}case"unlink":{if(!args[0])throw new PluginCliError("unlink needs a plugin id");unlink(args[0]);return}case"uninstall":{if(!args[0])throw new PluginCliError("uninstall needs a plugin id or owner/repo spec");uninstall(args[0]);return}case"config-dir":{if(!args[0])throw new PluginCliError("config-dir needs a plugin id");requireEntry(args[0]),console.log(pluginConfigDir(args[0]));return}case"log":{if(!args[0])throw new PluginCliError("log needs a plugin id");tailLog(args[0],Number.parseInt(flagValue(args,"-n")??"20",10)||20);return}case"pane":{let[sub,...paneArgs]=args;if(sub==="open"){let positional=paneArgs.find((a)=>!a.startsWith("-")&&a!==flagValue(paneArgs,"--task")),pluginId=flagValue(paneArgs,"--plugin"),entrypoint=flagValue(paneArgs,"--entrypoint");if(!pluginId||!entrypoint){if(!positional)throw new PluginCliError("pane open needs <plugin-id.pane-id> (or --plugin <id> --entrypoint <pane-id>) [--task <task-id>]");({pluginId,entrypoint}=resolvePaneQualified(positional))}await openPane(pluginId,entrypoint,flagValue(paneArgs,"--task"));return}printUsage(process.stderr),process.exit(2);return}case"action":{let[sub,...actionArgs]=args;if(sub==="list"){listActions(flagValue(actionArgs,"--plugin"));return}if(sub==="invoke"){if(!actionArgs[0])throw new PluginCliError("action invoke needs <plugin-id.action-id>");invokeAction(actionArgs[0],actionArgs.slice(1));return}printUsage(process.stderr),process.exit(2);return}default:{let isHelp=command===void 0||command==="help"||command==="--help"||command==="-h";if(printUsage(isHelp?process.stdout:process.stderr),!isHelp)process.exit(2);return}}}catch(err){if(err instanceof PluginCliError)console.error(`${CLI_NAME} plugin: ${err.message}`),process.exit(1);console.error(`${CLI_NAME} plugin: ${errorMessage(err)}`),process.exit(1)}}export{runPluginSubcommand};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{SUBCOMMAND_VERBS,TOP_LEVEL_SUBCOMMANDS}from"./chunk-s76r56rj.js";import{activeCliName}from"./chunk-p7s4xwgx.js";import"./chunk-4pmd0mxp.js";import"./chunk-g56kvet6.js";import"./chunk-r3k9rbwm.js";import{__require}from"./chunk-wqfp8d9w.js";async function collectSubVerbs(){let{API_VERBS}=await import("./chunk-d2p1za6y.js"),merged={...SUBCOMMAND_VERBS,api:API_VERBS};return Object.keys(merged).sort().map((command)=>[command,merged[command]??[]])}function completionUsage(cliName){return[`Usage: ${cliName} completions <bash|zsh|fish>`,"",`Generate a shell completion script for ${cliName} and print it to stdout.`,"","Install:",` zsh source <(${cliName} completions zsh) # one-off, or in ~/.zshrc after compinit`," # or the fpath way:",` # ${cliName} completions zsh > ~/.zsh/completions/_${cliName}`," # fpath=(~/.zsh/completions $fpath) # in ~/.zshrc, BEFORE compinit"," # rm -f ~/.zcompdump && exec zsh # rebuild the completion cache",` bash ${cliName} completions bash > ~/.bash_completion.d/${cliName} # source it from ~/.bashrc`,` fish ${cliName} completions fish > ~/.config/fish/completions/${cliName}.fish`,""].join(`
2
+ import{SUBCOMMAND_VERBS,TOP_LEVEL_SUBCOMMANDS}from"./chunk-s76r56rj.js";import{activeCliName}from"./chunk-p7s4xwgx.js";import"./chunk-4pmd0mxp.js";import"./chunk-g56kvet6.js";import"./chunk-r3k9rbwm.js";import{__require}from"./chunk-wqfp8d9w.js";async function collectSubVerbs(){let{API_VERBS}=await import("./chunk-tpcrsppv.js"),merged={...SUBCOMMAND_VERBS,api:API_VERBS};return Object.keys(merged).sort().map((command)=>[command,merged[command]??[]])}function completionUsage(cliName){return[`Usage: ${cliName} completions <bash|zsh|fish>`,"",`Generate a shell completion script for ${cliName} and print it to stdout.`,"","Install:",` zsh source <(${cliName} completions zsh) # one-off, or in ~/.zshrc after compinit`," # or the fpath way:",` # ${cliName} completions zsh > ~/.zsh/completions/_${cliName}`," # fpath=(~/.zsh/completions $fpath) # in ~/.zshrc, BEFORE compinit"," # rm -f ~/.zcompdump && exec zsh # rebuild the completion cache",` bash ${cliName} completions bash > ~/.bash_completion.d/${cliName} # source it from ~/.bashrc`,` fish ${cliName} completions fish > ~/.config/fish/completions/${cliName}.fish`,""].join(`
3
3
  `)}function generateBashCompletions(cliName,subVerbs){let subcommands=TOP_LEVEL_SUBCOMMANDS.join(" "),fn=`_${cliName}`;return[`# ${cliName} bash completions`,`# Source: ${cliName} completions bash`,"",`${fn}() {`," local cur prev"," COMPREPLY=()",' cur="${COMP_WORDS[COMP_CWORD]}"',' prev="${COMP_WORDS[COMP_CWORD-1]}"'," if [[ ${COMP_CWORD} -eq 1 ]]; then",` COMPREPLY=( $(compgen -W "${subcommands}" -- "\${cur}") )`," return"," fi"," if [[ ${COMP_CWORD} -eq 2 ]]; then",' case "${prev}" in',...subVerbs.map(([command,verbs])=>` ${command}) COMPREPLY=( $(compgen -W "${verbs.join(" ")}" -- "\${cur}") ) ;;`)," esac"," fi","}",`complete -F ${fn} ${cliName}`,""].join(`
4
4
  `)}function generateZshCompletions(cliName,subVerbs){let subcommandsList=TOP_LEVEL_SUBCOMMANDS.map((s)=>`"${s}"`).join(" "),fn=`_${cliName}`;return[`#compdef ${cliName}`,`# ${cliName} zsh completions`,`# Source: ${cliName} completions zsh`,"",`${fn}() {`," local -a subcommands verbs",` subcommands=(${subcommandsList})`,""," if (( CURRENT == 2 )); then"," _describe -t commands 'subcommand' subcommands"," return"," fi",""," verbs=()",' case "${words[2]}" in',...subVerbs.map(([command,verbs])=>` ${command}) verbs=(${verbs.map((v)=>`"${v}"`).join(" ")}) ;;`)," esac"," if (( CURRENT == 3 && ${#verbs} > 0 )); then"," _describe -t verbs 'verb' verbs"," fi","}","","# Autoloaded from $fpath -> run as the completion function;","# sourced directly -> register with compdef instead.",`if [ "\${funcstack[1]}" = "${fn}" ]; then`,` ${fn} "$@"`,"elif (( $+functions[compdef] )); then",` compdef ${fn} ${cliName}`,"fi",""].join(`
5
5
  `)}function generateFishCompletions(cliName,subVerbs){let lines=[...TOP_LEVEL_SUBCOMMANDS.map((s)=>`complete -c ${cliName} -f -n __fish_use_subcommand -a ${s}`),...subVerbs.map(([command,verbs])=>`complete -c ${cliName} -f -n "__fish_seen_subcommand_from ${command}" -a "${verbs.join(" ")}"`)];return`# ${cliName} fish completions