@sma1lboy/rove 0.9.285-next.181 → 0.9.285-next.186

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 (54) hide show
  1. package/dist/cli/{chunk-xry1y3yy.js → chunk-0z3s4cwg.js} +1 -1
  2. package/dist/cli/{chunk-qjxazzpa.js → chunk-18cs2dpx.js} +1 -1
  3. package/dist/cli/{chunk-q6wkxa7y.js → chunk-192tj88v.js} +1 -1
  4. package/dist/cli/{chunk-9q1sazmb.js → chunk-1qcadxtn.js} +1 -1
  5. package/dist/cli/{chunk-k0zv202b.js → chunk-214pxfh3.js} +1 -1
  6. package/dist/cli/{chunk-a727qmzy.js → chunk-37m62238.js} +1 -1
  7. package/dist/cli/{chunk-gj0rs3d1.js → chunk-45taq0ct.js} +1 -1
  8. package/dist/cli/{chunk-0rvxwbty.js → chunk-4ztah6c4.js} +1 -1
  9. package/dist/cli/{chunk-s5wdem0p.js → chunk-5j8vjzm3.js} +1 -1
  10. package/dist/cli/{chunk-fvt4cksq.js → chunk-5pnjemmh.js} +1 -1
  11. package/dist/cli/{chunk-v7pgavgx.js → chunk-6bacas6q.js} +1 -1
  12. package/dist/cli/{chunk-h08s007q.js → chunk-7tsacq6p.js} +1 -1
  13. package/dist/cli/{chunk-52rcg0te.js → chunk-7yg5fzwk.js} +1 -1
  14. package/dist/cli/{chunk-ttmazxw8.js → chunk-8m1g3tsx.js} +1 -1
  15. package/dist/cli/{chunk-4t5n0d8g.js → chunk-b49e4517.js} +3 -3
  16. package/dist/cli/{chunk-bv8apjfp.js → chunk-bkj71nep.js} +1 -1
  17. package/dist/cli/{chunk-6fxcq178.js → chunk-bzcb33ab.js} +1 -1
  18. package/dist/cli/{chunk-c2dga8k3.js → chunk-c93pq89y.js} +1 -1
  19. package/dist/cli/{chunk-qkj0x5m8.js → chunk-ce40bv44.js} +1 -1
  20. package/dist/cli/{chunk-d6fpb7bq.js → chunk-dc5p8em3.js} +1 -1
  21. package/dist/cli/{chunk-7qfhfpfm.js → chunk-e8bsb3gx.js} +1 -1
  22. package/dist/cli/{chunk-0yfzh327.js → chunk-ehgj2pes.js} +3 -3
  23. package/dist/cli/{chunk-9vsgjtsw.js → chunk-ek8zf6dk.js} +1 -1
  24. package/dist/cli/{chunk-df67azma.js → chunk-gkcy0317.js} +2 -2
  25. package/dist/cli/{chunk-nyzp03fv.js → chunk-hq0m42wf.js} +1 -1
  26. package/dist/cli/{chunk-t2f00gx2.js → chunk-hyvaqjag.js} +1 -1
  27. package/dist/cli/{chunk-c43nvea7.js → chunk-k6pefzkp.js} +3 -3
  28. package/dist/cli/{chunk-f47sjntg.js → chunk-mhjpxy92.js} +1 -1
  29. package/dist/cli/{chunk-j78dm0wd.js → chunk-mwzw13br.js} +1 -1
  30. package/dist/cli/{chunk-8jj67a6b.js → chunk-n5qpp45q.js} +1 -1
  31. package/dist/cli/{chunk-z5f7dmfw.js → chunk-ndf0kpyg.js} +1 -1
  32. package/dist/cli/{chunk-rafkgz3g.js → chunk-phr3j5va.js} +1 -1
  33. package/dist/cli/{chunk-02hahr1j.js → chunk-q7v4fv1y.js} +1 -1
  34. package/dist/cli/{chunk-e6en1zb7.js → chunk-qk5xb8zg.js} +1 -1
  35. package/dist/cli/{chunk-vbqac1pe.js → chunk-r3x1qrt3.js} +1 -1
  36. package/dist/cli/{chunk-rd48zk95.js → chunk-rj99dvsm.js} +1 -1
  37. package/dist/cli/{chunk-vhvbvf6j.js → chunk-rjetdad7.js} +1 -1
  38. package/dist/cli/{chunk-j18a0976.js → chunk-rpmvfqks.js} +2 -2
  39. package/dist/cli/{chunk-7580c98v.js → chunk-rq2cpa7r.js} +1 -1
  40. package/dist/cli/{chunk-wc934cjj.js → chunk-rr7m867n.js} +1 -1
  41. package/dist/cli/{chunk-qt67sbz0.js → chunk-s48m151m.js} +1 -1
  42. package/dist/cli/{chunk-kmzgdk37.js → chunk-sqsacy1b.js} +1 -1
  43. package/dist/cli/{chunk-nvsyxefp.js → chunk-xgp6f6h0.js} +1 -1
  44. package/dist/cli/{chunk-mtwcbbf5.js → chunk-xp69nvw0.js} +1 -1
  45. package/dist/cli/{chunk-t28twyf8.js → chunk-y0vhe345.js} +1 -1
  46. package/dist/cli/{chunk-emsyqhph.js → chunk-yajg0tpr.js} +1 -1
  47. package/dist/cli/{chunk-mfb320rk.js → chunk-ym1pqp8p.js} +3 -3
  48. package/dist/cli/index.js +2 -2
  49. package/dist/web/assets/{index-CwKXMuCR.js → index-Bcc8NdxZ.js} +33 -33
  50. package/dist/web/assets/{index-DHyfHJiF.css → index-DbOXVdii.css} +1 -1
  51. package/dist/web/assets/{term-mount-D3dFdM5W.js → term-mount-DYJ8TMoo.js} +1 -1
  52. package/dist/web/index.html +2 -2
  53. package/dist/web/relay/index.html +5 -5
  54. package/package.json +1 -1
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{vendorFromArgv}from"./chunk-fvt4cksq.js";import{engineEntry}from"./chunk-52rcg0te.js";import{isContribEngine}from"./chunk-f050r8jy.js";import{getCustomEngineIds,getPersistedString}from"./chunk-rja9tf6j.js";import{roveCliInvocation}from"./chunk-x02jmqj1.js";import{BUILTIN_VENDORS,coerceVendorId,isBuiltinVendor}from"./chunk-h2m7em1e.js";function engineCommandKey(vendor){return`engineCommand.${vendor}`}function engineNameKey(vendor){return`engineName.${vendor}`}function engineDisplayName(vendor){return getPersistedString(engineNameKey(vendor))?.trim()||engineEntry(vendor).displayName}function humanizeSlug(id){return id.split(/[-_]+/).filter((word)=>word.length>0).map((word)=>word.charAt(0).toUpperCase()+word.slice(1)).join(" ")}function engineRenamedFrom(vendor,override){let name=override.trim(),base=engineEntry(vendor).displayName;if(!name||name===base||name===humanizeSlug(vendor))return;return base}function defaultEngineCommand(vendor){return engineEntry(coerceVendorId(vendor)).defaultCommand}function parseEngineCommand(command){let out=[],token="",hasToken=!1,quote=null;for(let ch of command){if(quote){if(ch===quote)quote=null;else token+=ch;continue}if(ch==='"'||ch==="'"){quote=ch,hasToken=!0;continue}if(/\s/.test(ch)){if(hasToken)out.push(token),token="",hasToken=!1;continue}token+=ch,hasToken=!0}if(hasToken)out.push(token);return out}function interactiveEngineCommand(vendor,effort,model){let v=coerceVendorId(vendor),override=getPersistedString(engineCommandKey(v))?.trim(),base=(()=>{if(override){let argv=parseEngineCommand(override);if(argv.length>0)return argv}return defaultEngineCommand(v)})();return withEngineHostedArgs(withEngineModel(withEngineEffort(base,v,effort),v,model),v)}function withEngineHostedArgs(argv,vendor){let entry=engineEntry(coerceVendorId(vendor)),args=entry.terminalTitle?.launchArgs,titled=args&&args.length>0?[...argv,...args]:argv;return entry.hostedStartArgv?.(titled)??titled}function withEngineEffort(argv,vendor,effort){let trimmed=effort?.trim();if(!trimmed)return argv;let entry=engineEntry(coerceVendorId(vendor));if(!entry.effortLevels?.includes(trimmed))return argv;return entry.effortArgv?.(argv,trimmed)??argv}function withEngineModel(argv,vendor,model){let trimmed=model?.trim();if(!trimmed)return argv;return engineEntry(coerceVendorId(vendor)).modelArgv?.(argv,trimmed)??argv}function roveApiInvocation(){let quote=(a)=>/^[A-Za-z0-9_/.:=-]+$/.test(a)?a:`'${a.replace(/'/g,"'\\''")}'`;try{return[...roveCliInvocation(),"api"].map(quote).join(" ")}catch{return"rove api"}}import{randomUUID}from"crypto";function hasFlag(argv,flag){return argv.some((a)=>a===flag||a.startsWith(`${flag}=`))}function controlsOwnSession(identity,argv){return(identity?.sessionControlFlags??[]).some((flag)=>hasFlag(argv,flag))}function pinSessionArgv(identity,argv,sessionId){if(!identity?.pinFlag)return argv;if(controlsOwnSession(identity,argv))return argv;return[...argv,identity.pinFlag,sessionId]}function acceptsPinnedSession(identity,argv){return!!identity?.pinFlag&&!controlsOwnSession(identity,argv)}function resumeSessionArgv(identity,base,sessionId){if(!sessionId||!identity?.resumeArgv)return null;if(controlsOwnSession(identity,base))return null;return identity.resumeArgv(base,sessionId)}function pickUnclaimedSessionId(ids,claimed){for(let i=ids.length-1;i>=0;i--){let id=ids[i];if(id&&!claimed.has(id))return id}return null}function forkSessionArgvFor(identity,base,sourceId,newId){if(!sourceId||!identity?.forkArgv)return null;if(controlsOwnSession(identity,base))return null;return identity.forkArgv(base,sourceId,newId)}function acceptsSessionFork(identity){return!!identity?.forkArgv}var GENERIC_PROTOCOL="generic",ENGINE_PROTOCOLS=BUILTIN_VENDORS;function engineProtocolKey(id){return`engineProtocol.${id}`}function getEngineProtocol(id){if(isBuiltinVendor(id)||isContribEngine(id))return id;let raw=getPersistedString(engineProtocolKey(id))?.trim();return raw&&ENGINE_PROTOCOLS.includes(raw)?raw:void 0}function isPresetId(id){return isBuiltinVendor(id)||isContribEngine(id)||getCustomEngineIds().includes(id)}function listPresetIds(){return[...new Set([...BUILTIN_VENDORS,...getCustomEngineIds()])]}function describePreset(id){let command=getPersistedString(engineCommandKey(id))?.trim()||defaultEngineCommand(id).join(" ");return{id,name:engineDisplayName(id),command,protocol:getEngineProtocol(id)??GENERIC_PROTOCOL,builtin:isBuiltinVendor(id)}}function listEnginePresets(){return listPresetIds().map(describePreset)}function resolveCommandProtocol(command){let trimmed=command?.trim();if(!trimmed)return GENERIC_PROTOCOL;if(isPresetId(trimmed))return getEngineProtocol(trimmed)??GENERIC_PROTOCOL;let fromArgv=vendorFromArgv(trimmed);if(fromArgv)return fromArgv;let argv0=parseEngineCommand(trimmed)[0];if(argv0)for(let id of getCustomEngineIds()){let preset=getPersistedString(engineCommandKey(id))?.trim();if(preset&&parseEngineCommand(preset)[0]===argv0)return getEngineProtocol(id)??GENERIC_PROTOCOL}return GENERIC_PROTOCOL}function engineLaunchArgv(spec){let command=spec.command?.trim();if(!command)return interactiveEngineCommand(spec.vendor,spec.effort,spec.model);let vendor=(isPresetId(command)?getEngineProtocol(command):void 0)??resolveCommandProtocol(command),base=isPresetId(command)?presetBaseArgv(command):(()=>{let argv=parseEngineCommand(command);return argv.length>0?argv:null})();if(!base)return interactiveEngineCommand(spec.vendor,spec.effort,spec.model);return withEngineHostedArgs(withEngineModel(withEngineEffort(base,vendor,spec.effort),vendor,spec.model),vendor)}function presetBaseArgv(id){let override=getPersistedString(engineCommandKey(id))?.trim();if(override){let argv=parseEngineCommand(override);if(argv.length>0)return argv}return defaultEngineCommand(id)}function sessionProtocol(vendor){let id=vendor?.trim();if(!id)return"claude";return getEngineProtocol(id)??id}function protocolEntry(vendor){return engineEntry(sessionProtocol(vendor))}function withPinnedSessionId(argv,vendor,newId=randomUUID){let identity=engineEntry(sessionProtocol(vendor)).sessionIdentity;if(!acceptsPinnedSession(identity,argv))return{argv,sessionId:null};let sessionId=newId();return{argv:pinSessionArgv(identity,argv,sessionId),sessionId}}function engineResumeArgv(base,vendor,sessionId){return resumeSessionArgv(engineEntry(sessionProtocol(vendor)).sessionIdentity,base,sessionId)}function engineCanFork(vendor){return acceptsSessionFork(engineEntry(sessionProtocol(vendor)).sessionIdentity)}function engineForkArgv(base,vendor,sourceId,newId){return forkSessionArgvFor(engineEntry(sessionProtocol(vendor)).sessionIdentity,base,sourceId,newId)}var ID_RE=/^tab-(\d+)$/;function tabOrdinalOf(id){let match=ID_RE.exec(id);return match?Number(match[1]):null}var sameValue=(a,b)=>a===b||JSON.stringify(a)===JSON.stringify(b);function insertAfter(tabs,row,after){if(after===null)return[row,...tabs];let i=after===void 0?-1:tabs.findIndex((t)=>t.id===after);return i<0?[...tabs,row]:[...tabs.slice(0,i+1),row,...tabs.slice(i+1)]}function applyTabOps(current,ops,tombstones=new Set){let state=current,changed=!1,opened=[],set=(next)=>{state=next,changed=!0};for(let op of ops)switch(op.op){case"seed":{if(state===null||state.tabs.length===0){let floor=Math.max(op.state.nextOrdinal,maxOrdinal(op.state)+1,state?.nextOrdinal??0);set({...op.state,nextOrdinal:floor})}break}case"forget":{if(state!==null)set(null);break}case"open":{let base=state??{tabs:[],nextOrdinal:1},wanted=op.row.id;if(wanted!==void 0&&(base.tabs.some((t)=>t.id===wanted)||tombstones.has(wanted))){opened.push(null);break}let ordinal=wanted!==void 0?tabOrdinalOf(wanted)??op.row.ordinal??base.nextOrdinal:base.nextOrdinal,id=wanted??`tab-${ordinal}`,row={...op.row,id,ordinal};set({...base,tabs:insertAfter(base.tabs,row,op.after),nextOrdinal:Math.max(base.nextOrdinal,ordinal+1)}),opened.push(id);break}case"patch":{if(!state)break;let i=state.tabs.findIndex((t)=>t.id===op.id),row=state.tabs[i];if(!row)break;let next={...row},rowChanged=!1;for(let[key,value]of Object.entries(op.set??{})){if(key==="id"||key==="ordinal"||sameValue(next[key],value))continue;next[key]=value,rowChanged=!0}for(let key of op.unset??[]){if(key==="id"||key==="ordinal"||key==="kind"||!(key in next))continue;delete next[key],rowChanged=!0}if(!rowChanged)break;let tabs=[...state.tabs];tabs[i]=next,set({...state,tabs});break}case"close":{if(!state||!state.tabs.some((t)=>t.id===op.id))break;tombstones.add(op.id);let tabs=state.tabs.filter((t)=>t.id!==op.id),reopen=tabs.length===0&&op.reopenAs!==void 0?{reopenAs:op.reopenAs}:{},{activeId,...rest}=state;set({...rest,tabs,...activeId!==void 0&&activeId!==op.id?{activeId}:{},...reopen});break}case"order":{if(!state)break;let byId=new Map(state.tabs.map((t)=>[t.id,t])),tabs=[...op.ids.flatMap((id)=>{let row=byId.get(id);if(!row)return[];return byId.delete(id),[row]}),...state.tabs.filter((t)=>byId.has(t.id))];if(tabs.every((t,i)=>t===state?.tabs[i]))break;set({...state,tabs});break}case"focus":{if(!state||state.activeId===op.id||!state.tabs.some((t)=>t.id===op.id))break;set({...state,activeId:op.id});break}case"meta":{if(!state||sameValue(state.reopenAs,op.reopenAs))break;let{reopenAs:_drop,...rest}=state;set(op.reopenAs===void 0?rest:{...rest,reopenAs:op.reopenAs});break}}return{state,changed,opened}}function maxOrdinal(state){return state.tabs.reduce((max,tab)=>Math.max(max,tab.ordinal),0)}function reserveOrdinals(state,count){let base=state??{tabs:[],nextOrdinal:1},from=Math.max(base.nextOrdinal,maxOrdinal(base)+1);return{state:{...base,nextOrdinal:from+count},from}}function releaseOrdinals(state,from,to){if(!state||state.nextOrdinal!==to||from>=to)return state;let floor=Math.max(from,maxOrdinal(state)+1);return floor<state.nextOrdinal?{...state,nextOrdinal:floor}:state}function diffTabs(prev,next){if(prev===null)return[{op:"seed",state:next}];let ops=[],prevById=new Map(prev.tabs.map((t)=>[t.id,t])),nextIds=new Set(next.tabs.map((t)=>t.id));for(let row of prev.tabs){let reopen=next.tabs.length===0&&next.reopenAs!==void 0?{reopenAs:next.reopenAs}:{};if(!nextIds.has(row.id))ops.push({op:"close",id:row.id,...reopen})}next.tabs.forEach((row,i)=>{let before=prevById.get(row.id);if(!before){ops.push({op:"open",row,after:i===0?null:next.tabs[i-1]?.id??null});return}if(before===row)return;let set={},unset=[];for(let[key,value]of Object.entries(row))if(key!=="id"&&key!=="ordinal"&&!sameValue(before[key],value))set[key]=value;for(let key of Object.keys(before))if(!(key in row))unset.push(key);if(Object.keys(set).length>0||unset.length>0)ops.push({op:"patch",id:row.id,...Object.keys(set).length>0?{set}:{},...unset.length>0?{unset}:{}})});let kept=next.tabs.filter((t)=>prevById.has(t.id)).map((t)=>t.id),prevKept=prev.tabs.filter((t)=>nextIds.has(t.id)).map((t)=>t.id);if(kept.some((id,i)=>id!==prevKept[i]))ops.push({op:"order",ids:next.tabs.map((t)=>t.id)});if(!sameValue(prev.reopenAs,next.reopenAs)&&next.tabs.length>0)ops.push({op:"meta",reopenAs:next.reopenAs});return ops}
2
+ import{vendorFromArgv}from"./chunk-5pnjemmh.js";import{engineEntry}from"./chunk-7yg5fzwk.js";import{isContribEngine}from"./chunk-f050r8jy.js";import{getCustomEngineIds,getPersistedString}from"./chunk-rja9tf6j.js";import{roveCliInvocation}from"./chunk-x02jmqj1.js";import{BUILTIN_VENDORS,coerceVendorId,isBuiltinVendor}from"./chunk-h2m7em1e.js";function engineCommandKey(vendor){return`engineCommand.${vendor}`}function engineNameKey(vendor){return`engineName.${vendor}`}function engineDisplayName(vendor){return getPersistedString(engineNameKey(vendor))?.trim()||engineEntry(vendor).displayName}function humanizeSlug(id){return id.split(/[-_]+/).filter((word)=>word.length>0).map((word)=>word.charAt(0).toUpperCase()+word.slice(1)).join(" ")}function engineRenamedFrom(vendor,override){let name=override.trim(),base=engineEntry(vendor).displayName;if(!name||name===base||name===humanizeSlug(vendor))return;return base}function defaultEngineCommand(vendor){return engineEntry(coerceVendorId(vendor)).defaultCommand}function parseEngineCommand(command){let out=[],token="",hasToken=!1,quote=null;for(let ch of command){if(quote){if(ch===quote)quote=null;else token+=ch;continue}if(ch==='"'||ch==="'"){quote=ch,hasToken=!0;continue}if(/\s/.test(ch)){if(hasToken)out.push(token),token="",hasToken=!1;continue}token+=ch,hasToken=!0}if(hasToken)out.push(token);return out}function interactiveEngineCommand(vendor,effort,model){let v=coerceVendorId(vendor),override=getPersistedString(engineCommandKey(v))?.trim(),base=(()=>{if(override){let argv=parseEngineCommand(override);if(argv.length>0)return argv}return defaultEngineCommand(v)})();return withEngineHostedArgs(withEngineModel(withEngineEffort(base,v,effort),v,model),v)}function withEngineHostedArgs(argv,vendor){let entry=engineEntry(coerceVendorId(vendor)),args=entry.terminalTitle?.launchArgs,titled=args&&args.length>0?[...argv,...args]:argv;return entry.hostedStartArgv?.(titled)??titled}function withEngineEffort(argv,vendor,effort){let trimmed=effort?.trim();if(!trimmed)return argv;let entry=engineEntry(coerceVendorId(vendor));if(!entry.effortLevels?.includes(trimmed))return argv;return entry.effortArgv?.(argv,trimmed)??argv}function withEngineModel(argv,vendor,model){let trimmed=model?.trim();if(!trimmed)return argv;return engineEntry(coerceVendorId(vendor)).modelArgv?.(argv,trimmed)??argv}function roveApiInvocation(){let quote=(a)=>/^[A-Za-z0-9_/.:=-]+$/.test(a)?a:`'${a.replace(/'/g,"'\\''")}'`;try{return[...roveCliInvocation(),"api"].map(quote).join(" ")}catch{return"rove api"}}import{randomUUID}from"crypto";function hasFlag(argv,flag){return argv.some((a)=>a===flag||a.startsWith(`${flag}=`))}function controlsOwnSession(identity,argv){return(identity?.sessionControlFlags??[]).some((flag)=>hasFlag(argv,flag))}function pinSessionArgv(identity,argv,sessionId){if(!identity?.pinFlag)return argv;if(controlsOwnSession(identity,argv))return argv;return[...argv,identity.pinFlag,sessionId]}function acceptsPinnedSession(identity,argv){return!!identity?.pinFlag&&!controlsOwnSession(identity,argv)}function resumeSessionArgv(identity,base,sessionId){if(!sessionId||!identity?.resumeArgv)return null;if(controlsOwnSession(identity,base))return null;return identity.resumeArgv(base,sessionId)}function pickUnclaimedSessionId(ids,claimed){for(let i=ids.length-1;i>=0;i--){let id=ids[i];if(id&&!claimed.has(id))return id}return null}function forkSessionArgvFor(identity,base,sourceId,newId){if(!sourceId||!identity?.forkArgv)return null;if(controlsOwnSession(identity,base))return null;return identity.forkArgv(base,sourceId,newId)}function acceptsSessionFork(identity){return!!identity?.forkArgv}var GENERIC_PROTOCOL="generic",ENGINE_PROTOCOLS=BUILTIN_VENDORS;function engineProtocolKey(id){return`engineProtocol.${id}`}function getEngineProtocol(id){if(isBuiltinVendor(id)||isContribEngine(id))return id;let raw=getPersistedString(engineProtocolKey(id))?.trim();return raw&&ENGINE_PROTOCOLS.includes(raw)?raw:void 0}function isPresetId(id){return isBuiltinVendor(id)||isContribEngine(id)||getCustomEngineIds().includes(id)}function listPresetIds(){return[...new Set([...BUILTIN_VENDORS,...getCustomEngineIds()])]}function describePreset(id){let command=getPersistedString(engineCommandKey(id))?.trim()||defaultEngineCommand(id).join(" ");return{id,name:engineDisplayName(id),command,protocol:getEngineProtocol(id)??GENERIC_PROTOCOL,builtin:isBuiltinVendor(id)}}function listEnginePresets(){return listPresetIds().map(describePreset)}function resolveCommandProtocol(command){let trimmed=command?.trim();if(!trimmed)return GENERIC_PROTOCOL;if(isPresetId(trimmed))return getEngineProtocol(trimmed)??GENERIC_PROTOCOL;let fromArgv=vendorFromArgv(trimmed);if(fromArgv)return fromArgv;let argv0=parseEngineCommand(trimmed)[0];if(argv0)for(let id of getCustomEngineIds()){let preset=getPersistedString(engineCommandKey(id))?.trim();if(preset&&parseEngineCommand(preset)[0]===argv0)return getEngineProtocol(id)??GENERIC_PROTOCOL}return GENERIC_PROTOCOL}function engineLaunchArgv(spec){let command=spec.command?.trim();if(!command)return interactiveEngineCommand(spec.vendor,spec.effort,spec.model);let vendor=(isPresetId(command)?getEngineProtocol(command):void 0)??resolveCommandProtocol(command),base=isPresetId(command)?presetBaseArgv(command):(()=>{let argv=parseEngineCommand(command);return argv.length>0?argv:null})();if(!base)return interactiveEngineCommand(spec.vendor,spec.effort,spec.model);return withEngineHostedArgs(withEngineModel(withEngineEffort(base,vendor,spec.effort),vendor,spec.model),vendor)}function presetBaseArgv(id){let override=getPersistedString(engineCommandKey(id))?.trim();if(override){let argv=parseEngineCommand(override);if(argv.length>0)return argv}return defaultEngineCommand(id)}function sessionProtocol(vendor){let id=vendor?.trim();if(!id)return"claude";return getEngineProtocol(id)??id}function protocolEntry(vendor){return engineEntry(sessionProtocol(vendor))}function withPinnedSessionId(argv,vendor,newId=randomUUID){let identity=engineEntry(sessionProtocol(vendor)).sessionIdentity;if(!acceptsPinnedSession(identity,argv))return{argv,sessionId:null};let sessionId=newId();return{argv:pinSessionArgv(identity,argv,sessionId),sessionId}}function engineResumeArgv(base,vendor,sessionId){return resumeSessionArgv(engineEntry(sessionProtocol(vendor)).sessionIdentity,base,sessionId)}function engineCanFork(vendor){return acceptsSessionFork(engineEntry(sessionProtocol(vendor)).sessionIdentity)}function engineForkArgv(base,vendor,sourceId,newId){return forkSessionArgvFor(engineEntry(sessionProtocol(vendor)).sessionIdentity,base,sourceId,newId)}var ID_RE=/^tab-(\d+)$/;function tabOrdinalOf(id){let match=ID_RE.exec(id);return match?Number(match[1]):null}var sameValue=(a,b)=>a===b||JSON.stringify(a)===JSON.stringify(b);function insertAfter(tabs,row,after){if(after===null)return[row,...tabs];let i=after===void 0?-1:tabs.findIndex((t)=>t.id===after);return i<0?[...tabs,row]:[...tabs.slice(0,i+1),row,...tabs.slice(i+1)]}function applyTabOps(current,ops,tombstones=new Set){let state=current,changed=!1,opened=[],set=(next)=>{state=next,changed=!0};for(let op of ops)switch(op.op){case"seed":{if(state===null||state.tabs.length===0){let floor=Math.max(op.state.nextOrdinal,maxOrdinal(op.state)+1,state?.nextOrdinal??0);set({...op.state,nextOrdinal:floor})}break}case"forget":{if(state!==null)set(null);break}case"open":{let base=state??{tabs:[],nextOrdinal:1},wanted=op.row.id;if(wanted!==void 0&&(base.tabs.some((t)=>t.id===wanted)||tombstones.has(wanted))){opened.push(null);break}let ordinal=wanted!==void 0?tabOrdinalOf(wanted)??op.row.ordinal??base.nextOrdinal:base.nextOrdinal,id=wanted??`tab-${ordinal}`,row={...op.row,id,ordinal};set({...base,tabs:insertAfter(base.tabs,row,op.after),nextOrdinal:Math.max(base.nextOrdinal,ordinal+1)}),opened.push(id);break}case"patch":{if(!state)break;let i=state.tabs.findIndex((t)=>t.id===op.id),row=state.tabs[i];if(!row)break;let next={...row},rowChanged=!1;for(let[key,value]of Object.entries(op.set??{})){if(key==="id"||key==="ordinal"||sameValue(next[key],value))continue;next[key]=value,rowChanged=!0}for(let key of op.unset??[]){if(key==="id"||key==="ordinal"||key==="kind"||!(key in next))continue;delete next[key],rowChanged=!0}if(!rowChanged)break;let tabs=[...state.tabs];tabs[i]=next,set({...state,tabs});break}case"close":{if(!state||!state.tabs.some((t)=>t.id===op.id))break;tombstones.add(op.id);let tabs=state.tabs.filter((t)=>t.id!==op.id),reopen=tabs.length===0&&op.reopenAs!==void 0?{reopenAs:op.reopenAs}:{},{activeId,...rest}=state;set({...rest,tabs,...activeId!==void 0&&activeId!==op.id?{activeId}:{},...reopen});break}case"order":{if(!state)break;let byId=new Map(state.tabs.map((t)=>[t.id,t])),tabs=[...op.ids.flatMap((id)=>{let row=byId.get(id);if(!row)return[];return byId.delete(id),[row]}),...state.tabs.filter((t)=>byId.has(t.id))];if(tabs.every((t,i)=>t===state?.tabs[i]))break;set({...state,tabs});break}case"focus":{if(!state||state.activeId===op.id||!state.tabs.some((t)=>t.id===op.id))break;set({...state,activeId:op.id});break}case"meta":{if(!state||sameValue(state.reopenAs,op.reopenAs))break;let{reopenAs:_drop,...rest}=state;set(op.reopenAs===void 0?rest:{...rest,reopenAs:op.reopenAs});break}}return{state,changed,opened}}function maxOrdinal(state){return state.tabs.reduce((max,tab)=>Math.max(max,tab.ordinal),0)}function reserveOrdinals(state,count){let base=state??{tabs:[],nextOrdinal:1},from=Math.max(base.nextOrdinal,maxOrdinal(base)+1);return{state:{...base,nextOrdinal:from+count},from}}function releaseOrdinals(state,from,to){if(!state||state.nextOrdinal!==to||from>=to)return state;let floor=Math.max(from,maxOrdinal(state)+1);return floor<state.nextOrdinal?{...state,nextOrdinal:floor}:state}function diffTabs(prev,next){if(prev===null)return[{op:"seed",state:next}];let ops=[],prevById=new Map(prev.tabs.map((t)=>[t.id,t])),nextIds=new Set(next.tabs.map((t)=>t.id));for(let row of prev.tabs){let reopen=next.tabs.length===0&&next.reopenAs!==void 0?{reopenAs:next.reopenAs}:{};if(!nextIds.has(row.id))ops.push({op:"close",id:row.id,...reopen})}next.tabs.forEach((row,i)=>{let before=prevById.get(row.id);if(!before){ops.push({op:"open",row,after:i===0?null:next.tabs[i-1]?.id??null});return}if(before===row)return;let set={},unset=[];for(let[key,value]of Object.entries(row))if(key!=="id"&&key!=="ordinal"&&!sameValue(before[key],value))set[key]=value;for(let key of Object.keys(before))if(!(key in row))unset.push(key);if(Object.keys(set).length>0||unset.length>0)ops.push({op:"patch",id:row.id,...Object.keys(set).length>0?{set}:{},...unset.length>0?{unset}:{}})});let kept=next.tabs.filter((t)=>prevById.has(t.id)).map((t)=>t.id),prevKept=prev.tabs.filter((t)=>nextIds.has(t.id)).map((t)=>t.id);if(kept.some((id,i)=>id!==prevKept[i]))ops.push({op:"order",ids:next.tabs.map((t)=>t.id)});if(!sameValue(prev.reopenAs,next.reopenAs)&&next.tabs.length>0)ops.push({op:"meta",reopenAs:next.reopenAs});return ops}
3
3
  export{engineCommandKey,engineNameKey,engineDisplayName,humanizeSlug,engineRenamedFrom,defaultEngineCommand,interactiveEngineCommand,roveApiInvocation,applyTabOps,reserveOrdinals,releaseOrdinals,diffTabs,pickUnclaimedSessionId,GENERIC_PROTOCOL,ENGINE_PROTOCOLS,engineProtocolKey,getEngineProtocol,listPresetIds,describePreset,listEnginePresets,resolveCommandProtocol,engineLaunchArgv,sessionProtocol,protocolEntry,withPinnedSessionId,engineResumeArgv,engineCanFork,engineForkArgv};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{installSkillErrors,missingSkillNames}from"./chunk-e6en1zb7.js";import{createStateCell}from"./chunk-cmp64q4j.js";import{installedEngineIds}from"./chunk-f050r8jy.js";var skillMissing=createStateCell([]),POLL_MS=30000,started=!1;function refreshSkillStatus(){if(!started)return;installedEngineIds().then((installed)=>{let next=missingSkillNames(installed);if(next.join(`
2
+ import{installSkillErrors,missingSkillNames}from"./chunk-qk5xb8zg.js";import{createStateCell}from"./chunk-cmp64q4j.js";import{installedEngineIds}from"./chunk-f050r8jy.js";var skillMissing=createStateCell([]),POLL_MS=30000,started=!1;function refreshSkillStatus(){if(!started)return;installedEngineIds().then((installed)=>{let next=missingSkillNames(installed);if(next.join(`
3
3
  `)!==skillMissing.get().join(`
4
4
  `))skillMissing.set(next)}).catch(()=>{})}function startSkillStatus(){if(started)return;started=!0,refreshSkillStatus(),setInterval(refreshSkillStatus,POLL_MS).unref?.()}function installSkillNow(){let error=installSkillErrors();return refreshSkillStatus(),error}
5
5
  export{skillMissing,refreshSkillStatus,startSkillStatus,installSkillNow};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{AUTO_MACHINE,LOCAL_MACHINE,forwardVerb,invokeRouted,machineDaemonSocket,machinePtySocket,machineTasks,pickMachine,repoHosts,repoWanted,requireMachine,routeTarget}from"./chunk-ttmazxw8.js";import"./chunk-mdfm45fx.js";import"./chunk-vp29jgbt.js";import"./chunk-gq36nzg8.js";import"./chunk-sq6zj3fb.js";import"./chunk-0yfzh327.js";import"./chunk-xry1y3yy.js";import"./chunk-r5j8fycq.js";import"./chunk-xfgqae9t.js";import"./chunk-j1z9kgyd.js";import"./chunk-g9ba25q5.js";import"./chunk-ntqg38ke.js";import"./chunk-hpay0ax8.js";import"./chunk-catrr0z3.js";import"./chunk-mdc7b01e.js";import"./chunk-tn9gtf18.js";import"./chunk-z46zwmyq.js";import"./chunk-sak1tphp.js";import"./chunk-y1xnjx8x.js";import"./chunk-72kf2e5c.js";import"./chunk-gca19v0w.js";import"./chunk-9y803nx4.js";import"./chunk-qq2mjph2.js";import"./chunk-96kvwzj8.js";import"./chunk-zsfyj36g.js";import"./chunk-jrzh4yv6.js";import"./chunk-dpgaag6b.js";import"./chunk-cmp64q4j.js";import"./chunk-fvt4cksq.js";import"./chunk-52rcg0te.js";import"./chunk-dzhk9yd0.js";import"./chunk-f050r8jy.js";import"./chunk-w7zv47mp.js";import"./chunk-rja9tf6j.js";import"./chunk-40dgv828.js";import"./chunk-2brn8e1y.js";import"./chunk-rz8319pe.js";import"./chunk-32j6y5d1.js";import"./chunk-ss6dyn4h.js";import"./chunk-x02jmqj1.js";import"./chunk-7kysxgbq.js";import"./chunk-f6qne8f1.js";import"./chunk-jzsngv31.js";import"./chunk-0g4wc808.js";import"./chunk-xy8be792.js";import"./chunk-h2m7em1e.js";import"./chunk-pn5ygqn6.js";import"./chunk-7ghwdjdc.js";import"./chunk-8t7qbr1e.js";import"./chunk-bejhca6z.js";import"./chunk-br8r72bf.js";import"./chunk-yt15y085.js";import"./chunk-eqdbfgq5.js";import"./chunk-z1nj22va.js";import"./chunk-zt7wfnva.js";import"./chunk-f8gg8cqh.js";import"./chunk-nc46gddg.js";import"./chunk-1mp632fj.js";import"./chunk-91sykzqq.js";export{routeTarget,requireMachine,repoWanted,repoHosts,pickMachine,machineTasks,machinePtySocket,machineDaemonSocket,invokeRouted,forwardVerb,LOCAL_MACHINE,AUTO_MACHINE};
2
+ import{AUTO_MACHINE,LOCAL_MACHINE,forwardVerb,invokeRouted,machineDaemonSocket,machinePtySocket,machineTasks,pickMachine,repoHosts,repoWanted,requireMachine,routeTarget}from"./chunk-8m1g3tsx.js";import"./chunk-mdfm45fx.js";import"./chunk-vp29jgbt.js";import"./chunk-gq36nzg8.js";import"./chunk-sq6zj3fb.js";import"./chunk-ehgj2pes.js";import"./chunk-0z3s4cwg.js";import"./chunk-r5j8fycq.js";import"./chunk-xfgqae9t.js";import"./chunk-j1z9kgyd.js";import"./chunk-g9ba25q5.js";import"./chunk-ntqg38ke.js";import"./chunk-hpay0ax8.js";import"./chunk-catrr0z3.js";import"./chunk-mdc7b01e.js";import"./chunk-tn9gtf18.js";import"./chunk-z46zwmyq.js";import"./chunk-sak1tphp.js";import"./chunk-y1xnjx8x.js";import"./chunk-72kf2e5c.js";import"./chunk-gca19v0w.js";import"./chunk-9y803nx4.js";import"./chunk-qq2mjph2.js";import"./chunk-96kvwzj8.js";import"./chunk-zsfyj36g.js";import"./chunk-jrzh4yv6.js";import"./chunk-dpgaag6b.js";import"./chunk-cmp64q4j.js";import"./chunk-5pnjemmh.js";import"./chunk-7yg5fzwk.js";import"./chunk-dzhk9yd0.js";import"./chunk-f050r8jy.js";import"./chunk-w7zv47mp.js";import"./chunk-rja9tf6j.js";import"./chunk-40dgv828.js";import"./chunk-2brn8e1y.js";import"./chunk-rz8319pe.js";import"./chunk-32j6y5d1.js";import"./chunk-ss6dyn4h.js";import"./chunk-x02jmqj1.js";import"./chunk-7kysxgbq.js";import"./chunk-f6qne8f1.js";import"./chunk-jzsngv31.js";import"./chunk-0g4wc808.js";import"./chunk-xy8be792.js";import"./chunk-h2m7em1e.js";import"./chunk-pn5ygqn6.js";import"./chunk-7ghwdjdc.js";import"./chunk-8t7qbr1e.js";import"./chunk-bejhca6z.js";import"./chunk-br8r72bf.js";import"./chunk-yt15y085.js";import"./chunk-eqdbfgq5.js";import"./chunk-z1nj22va.js";import"./chunk-zt7wfnva.js";import"./chunk-f8gg8cqh.js";import"./chunk-nc46gddg.js";import"./chunk-1mp632fj.js";import"./chunk-91sykzqq.js";export{routeTarget,requireMachine,repoWanted,repoHosts,pickMachine,machineTasks,machinePtySocket,machineDaemonSocket,invokeRouted,forwardVerb,LOCAL_MACHINE,AUTO_MACHINE};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{launchTui,trackWelcomeWrite}from"./chunk-f47sjntg.js";import"./chunk-91sykzqq.js";export{trackWelcomeWrite,launchTui};
2
+ import{launchTui,trackWelcomeWrite}from"./chunk-mhjpxy92.js";import"./chunk-91sykzqq.js";export{trackWelcomeWrite,launchTui};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{PS_PROBE_TIMEOUT_MS,engineProcessIn,foregroundEngine,foregroundEngineIn,hasAncestor,parsePsSnapshot,psSnapshot,psSnapshotWith,shareInflight,vendorFromArgv}from"./chunk-fvt4cksq.js";import"./chunk-52rcg0te.js";import"./chunk-dzhk9yd0.js";import"./chunk-f050r8jy.js";import"./chunk-w7zv47mp.js";import"./chunk-rja9tf6j.js";import"./chunk-40dgv828.js";import"./chunk-2brn8e1y.js";import"./chunk-rz8319pe.js";import"./chunk-32j6y5d1.js";import"./chunk-ss6dyn4h.js";import"./chunk-x02jmqj1.js";import"./chunk-7kysxgbq.js";import"./chunk-f6qne8f1.js";import"./chunk-jzsngv31.js";import"./chunk-0g4wc808.js";import"./chunk-xy8be792.js";import"./chunk-h2m7em1e.js";import"./chunk-pn5ygqn6.js";import"./chunk-7ghwdjdc.js";import"./chunk-8t7qbr1e.js";import"./chunk-bejhca6z.js";import"./chunk-br8r72bf.js";import"./chunk-yt15y085.js";import"./chunk-eqdbfgq5.js";import"./chunk-z1nj22va.js";import"./chunk-zt7wfnva.js";import"./chunk-f8gg8cqh.js";import"./chunk-nc46gddg.js";import{PsProbeUnavailableError}from"./chunk-1mp632fj.js";import"./chunk-91sykzqq.js";export{vendorFromArgv,shareInflight,psSnapshotWith,psSnapshot,parsePsSnapshot,hasAncestor,foregroundEngineIn,foregroundEngine,engineProcessIn,PsProbeUnavailableError,PS_PROBE_TIMEOUT_MS};
2
+ import{PS_PROBE_TIMEOUT_MS,engineProcessIn,foregroundEngine,foregroundEngineIn,hasAncestor,parsePsSnapshot,psSnapshot,psSnapshotWith,shareInflight,vendorFromArgv}from"./chunk-5pnjemmh.js";import"./chunk-7yg5fzwk.js";import"./chunk-dzhk9yd0.js";import"./chunk-f050r8jy.js";import"./chunk-w7zv47mp.js";import"./chunk-rja9tf6j.js";import"./chunk-40dgv828.js";import"./chunk-2brn8e1y.js";import"./chunk-rz8319pe.js";import"./chunk-32j6y5d1.js";import"./chunk-ss6dyn4h.js";import"./chunk-x02jmqj1.js";import"./chunk-7kysxgbq.js";import"./chunk-f6qne8f1.js";import"./chunk-jzsngv31.js";import"./chunk-0g4wc808.js";import"./chunk-xy8be792.js";import"./chunk-h2m7em1e.js";import"./chunk-pn5ygqn6.js";import"./chunk-7ghwdjdc.js";import"./chunk-8t7qbr1e.js";import"./chunk-bejhca6z.js";import"./chunk-br8r72bf.js";import"./chunk-yt15y085.js";import"./chunk-eqdbfgq5.js";import"./chunk-z1nj22va.js";import"./chunk-zt7wfnva.js";import"./chunk-f8gg8cqh.js";import"./chunk-nc46gddg.js";import{PsProbeUnavailableError}from"./chunk-1mp632fj.js";import"./chunk-91sykzqq.js";export{vendorFromArgv,shareInflight,psSnapshotWith,psSnapshot,parsePsSnapshot,hasAncestor,foregroundEngineIn,foregroundEngine,engineProcessIn,PsProbeUnavailableError,PS_PROBE_TIMEOUT_MS};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{defaultFixRuntime}from"./chunk-3rpx0hx2.js";import{INBOUND_CLASSES,deniedClasses,setInbound}from"./chunk-mtwcbbf5.js";import"./chunk-mfb320rk.js";import"./chunk-02hahr1j.js";import"./chunk-j1rsp5pc.js";import"./chunk-4batd98n.js";import"./chunk-wgyfwry1.js";import"./chunk-emsyqhph.js";import"./chunk-9wd57t3j.js";import"./chunk-pm91e38v.js";import"./chunk-2xsxcdp6.js";import"./chunk-17e2tgyg.js";import"./chunk-qq1q07tz.js";import"./chunk-q8ffd1pc.js";import"./chunk-4hestsjp.js";import"./chunk-qgrg9a5n.js";import"./chunk-2bgmby1d.js";import"./chunk-1k7f137x.js";import"./chunk-5mhvjytn.js";import"./chunk-atn06ncf.js";import"./chunk-z39kezz0.js";import{primaryCheckouts,repoIdOf,repoIdentity,setPrimaryCheckout}from"./chunk-ttmazxw8.js";import{addMachine,defaultMachineAlias,discoverMachine,duplicateAliasOf,getMachine,isValidMachineAlias,isWindowsMachine,learnedFrom,listMachines,machineSocketDir,machineSshArgs,parseSshTarget,readMachines,remoteRove,removeMachine,sanitizeAlias,setMachineIdentity,sshServerIsWindows,sshTargetOf,updateMachine,windowsAuthorizeKeySteps}from"./chunk-mdfm45fx.js";import"./chunk-vp29jgbt.js";import"./chunk-gq36nzg8.js";import"./chunk-sq6zj3fb.js";import"./chunk-qkehg2c1.js";import"./chunk-hk0zbk3t.js";import"./chunk-t7j8g9f6.js";import"./chunk-dmzg9zdc.js";import"./chunk-kg9kmwt9.js";import"./chunk-6xppe9bj.js";import{CURRENT_VERSION}from"./chunk-fjyb8w5c.js";import{SUBCOMMAND_VERBS}from"./chunk-nbcm8d58.js";import"./chunk-nvsyxefp.js";import"./chunk-bv8apjfp.js";import"./chunk-3t91qn02.js";import"./chunk-w77s2df8.js";import"./chunk-mqfvzdpr.js";import"./chunk-7t35pfeq.js";import"./chunk-rxqdw6s5.js";import"./chunk-8ng1756g.js";import"./chunk-kxp04jnp.js";import"./chunk-0yfzh327.js";import"./chunk-xry1y3yy.js";import"./chunk-r5j8fycq.js";import"./chunk-xfgqae9t.js";import"./chunk-j1z9kgyd.js";import"./chunk-g9ba25q5.js";import"./chunk-ntqg38ke.js";import"./chunk-hpay0ax8.js";import"./chunk-catrr0z3.js";import"./chunk-mdc7b01e.js";import"./chunk-tn9gtf18.js";import"./chunk-z46zwmyq.js";import"./chunk-sak1tphp.js";import{shQuote}from"./chunk-y1xnjx8x.js";import"./chunk-72kf2e5c.js";import"./chunk-gca19v0w.js";import"./chunk-9y803nx4.js";import"./chunk-qq2mjph2.js";import"./chunk-96kvwzj8.js";import"./chunk-etfh8f4z.js";import{argvHasFlag}from"./chunk-zsfyj36g.js";import"./chunk-jrzh4yv6.js";import"./chunk-dpgaag6b.js";import"./chunk-cmp64q4j.js";import"./chunk-fvt4cksq.js";import"./chunk-52rcg0te.js";import"./chunk-dzhk9yd0.js";import"./chunk-f050r8jy.js";import"./chunk-w7zv47mp.js";import"./chunk-rja9tf6j.js";import"./chunk-40dgv828.js";import"./chunk-2brn8e1y.js";import"./chunk-rz8319pe.js";import{loadStateFile}from"./chunk-32j6y5d1.js";import"./chunk-ss6dyn4h.js";import"./chunk-x02jmqj1.js";import"./chunk-7kysxgbq.js";import"./chunk-f6qne8f1.js";import"./chunk-jzsngv31.js";import"./chunk-0g4wc808.js";import"./chunk-xy8be792.js";import"./chunk-h2m7em1e.js";import"./chunk-pn5ygqn6.js";import"./chunk-7ghwdjdc.js";import"./chunk-8t7qbr1e.js";import"./chunk-bejhca6z.js";import"./chunk-br8r72bf.js";import"./chunk-yt15y085.js";import"./chunk-eqdbfgq5.js";import{homeDir}from"./chunk-z1nj22va.js";import{ROVE_PRODUCT_NAME}from"./chunk-zt7wfnva.js";import"./chunk-f8gg8cqh.js";import"./chunk-nc46gddg.js";import"./chunk-1mp632fj.js";import{__require}from"./chunk-91sykzqq.js";import{spawn}from"child_process";import{appendFileSync,chmodSync,existsSync,mkdirSync}from"fs";import{homedir}from"os";import{dirname}from"path";function parseSshG(stdout,home=homedir()){let values=new Map;for(let line of stdout.split(`
2
+ import{defaultFixRuntime}from"./chunk-3rpx0hx2.js";import{INBOUND_CLASSES,deniedClasses,setInbound}from"./chunk-xp69nvw0.js";import"./chunk-ym1pqp8p.js";import"./chunk-q7v4fv1y.js";import"./chunk-j1rsp5pc.js";import"./chunk-4batd98n.js";import"./chunk-wgyfwry1.js";import"./chunk-yajg0tpr.js";import"./chunk-9wd57t3j.js";import"./chunk-pm91e38v.js";import"./chunk-2xsxcdp6.js";import"./chunk-17e2tgyg.js";import"./chunk-qq1q07tz.js";import"./chunk-q8ffd1pc.js";import"./chunk-4hestsjp.js";import"./chunk-qgrg9a5n.js";import"./chunk-2bgmby1d.js";import"./chunk-1k7f137x.js";import"./chunk-5mhvjytn.js";import"./chunk-atn06ncf.js";import"./chunk-z39kezz0.js";import{primaryCheckouts,repoIdOf,repoIdentity,setPrimaryCheckout}from"./chunk-8m1g3tsx.js";import{addMachine,defaultMachineAlias,discoverMachine,duplicateAliasOf,getMachine,isValidMachineAlias,isWindowsMachine,learnedFrom,listMachines,machineSocketDir,machineSshArgs,parseSshTarget,readMachines,remoteRove,removeMachine,sanitizeAlias,setMachineIdentity,sshServerIsWindows,sshTargetOf,updateMachine,windowsAuthorizeKeySteps}from"./chunk-mdfm45fx.js";import"./chunk-vp29jgbt.js";import"./chunk-gq36nzg8.js";import"./chunk-sq6zj3fb.js";import"./chunk-qkehg2c1.js";import"./chunk-hk0zbk3t.js";import"./chunk-t7j8g9f6.js";import"./chunk-dmzg9zdc.js";import"./chunk-kg9kmwt9.js";import"./chunk-6xppe9bj.js";import{CURRENT_VERSION}from"./chunk-fjyb8w5c.js";import{SUBCOMMAND_VERBS}from"./chunk-nbcm8d58.js";import"./chunk-xgp6f6h0.js";import"./chunk-bkj71nep.js";import"./chunk-3t91qn02.js";import"./chunk-w77s2df8.js";import"./chunk-mqfvzdpr.js";import"./chunk-7t35pfeq.js";import"./chunk-rxqdw6s5.js";import"./chunk-8ng1756g.js";import"./chunk-kxp04jnp.js";import"./chunk-ehgj2pes.js";import"./chunk-0z3s4cwg.js";import"./chunk-r5j8fycq.js";import"./chunk-xfgqae9t.js";import"./chunk-j1z9kgyd.js";import"./chunk-g9ba25q5.js";import"./chunk-ntqg38ke.js";import"./chunk-hpay0ax8.js";import"./chunk-catrr0z3.js";import"./chunk-mdc7b01e.js";import"./chunk-tn9gtf18.js";import"./chunk-z46zwmyq.js";import"./chunk-sak1tphp.js";import{shQuote}from"./chunk-y1xnjx8x.js";import"./chunk-72kf2e5c.js";import"./chunk-gca19v0w.js";import"./chunk-9y803nx4.js";import"./chunk-qq2mjph2.js";import"./chunk-96kvwzj8.js";import"./chunk-etfh8f4z.js";import{argvHasFlag}from"./chunk-zsfyj36g.js";import"./chunk-jrzh4yv6.js";import"./chunk-dpgaag6b.js";import"./chunk-cmp64q4j.js";import"./chunk-5pnjemmh.js";import"./chunk-7yg5fzwk.js";import"./chunk-dzhk9yd0.js";import"./chunk-f050r8jy.js";import"./chunk-w7zv47mp.js";import"./chunk-rja9tf6j.js";import"./chunk-40dgv828.js";import"./chunk-2brn8e1y.js";import"./chunk-rz8319pe.js";import{loadStateFile}from"./chunk-32j6y5d1.js";import"./chunk-ss6dyn4h.js";import"./chunk-x02jmqj1.js";import"./chunk-7kysxgbq.js";import"./chunk-f6qne8f1.js";import"./chunk-jzsngv31.js";import"./chunk-0g4wc808.js";import"./chunk-xy8be792.js";import"./chunk-h2m7em1e.js";import"./chunk-pn5ygqn6.js";import"./chunk-7ghwdjdc.js";import"./chunk-8t7qbr1e.js";import"./chunk-bejhca6z.js";import"./chunk-br8r72bf.js";import"./chunk-yt15y085.js";import"./chunk-eqdbfgq5.js";import{homeDir}from"./chunk-z1nj22va.js";import{ROVE_PRODUCT_NAME}from"./chunk-zt7wfnva.js";import"./chunk-f8gg8cqh.js";import"./chunk-nc46gddg.js";import"./chunk-1mp632fj.js";import{__require}from"./chunk-91sykzqq.js";import{spawn}from"child_process";import{appendFileSync,chmodSync,existsSync,mkdirSync}from"fs";import{homedir}from"os";import{dirname}from"path";function parseSshG(stdout,home=homedir()){let values=new Map;for(let line of stdout.split(`
3
3
  `)){let space=line.indexOf(" ");if(space>0)values.set(line.slice(0,space).toLowerCase(),line.slice(space+1).trim())}let hostname=values.get("hostname")??"",port=Number(values.get("port")??"22")||22,files=(key)=>(values.get(key)??"").split(/\s+/).filter((f)=>f&&f!=="none").map((f)=>f.startsWith("~/")?`${home}${f.slice(1)}`:f),alias=values.get("hostkeyalias"),proxy=(key)=>{let v=values.get(key);return v!==void 0&&v!=="none"};return{knownHostsName:alias&&alias!=="none"?alias:port===22?hostname:`[${hostname}]:${port}`,hostname,port,userKnownHosts:files("userknownhostsfile"),globalKnownHosts:files("globalknownhostsfile"),proxied:proxy("proxyjump")||proxy("proxycommand")}}async function checkHostKey(config){let target=sshTargetOf(config),resolved=await run(["ssh","-G",...config.port?["-p",String(config.port)]:[],target]);if(resolved.code!==0)return{state:"skipped",reason:"ssh -G failed"};let destination=parseSshG(resolved.stdout);if(!destination.hostname)return{state:"skipped",reason:"ssh -G named no host"};if(destination.proxied)return{state:"skipped",reason:"reached through a proxy"};for(let file of[...destination.userKnownHosts,...destination.globalKnownHosts]){if(!existsSync(file))continue;if((await run(["ssh-keygen","-F",destination.knownHostsName,"-f",file])).code===0)return{state:"known"}}let keys=(await run(["ssh-keyscan","-T","5","-p",String(destination.port),destination.hostname])).stdout.split(`
4
4
  `).filter((line)=>line.trim()&&!line.startsWith("#"));if(keys.length===0)return{state:"skipped",reason:"the host offered no key"};let named=keys.map((line)=>line.replace(/^\S+/,destination.knownHostsName)),fingerprints=(await run(["ssh-keygen","-l","-f","-"],`${named.join(`
5
5
  `)}
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{runChannelCli,startChatChannels}from"./chunk-vbqac1pe.js";import"./chunk-91sykzqq.js";export{startChatChannels,runChannelCli};
2
+ import{runChannelCli,startChatChannels}from"./chunk-r3x1qrt3.js";import"./chunk-91sykzqq.js";export{startChatChannels,runChannelCli};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{publishRoveTerminalTitle}from"./chunk-3aqhytyy.js";import{ensureGlobalRoveHooks}from"./chunk-qkj0x5m8.js";import{LAST_RUN_VERSION_KEY,enforceResetGate}from"./chunk-zbwsjdad.js";import"./chunk-17e2tgyg.js";import"./chunk-2bgmby1d.js";import"./chunk-1k7f137x.js";import{CURRENT_VERSION,compareSemver}from"./chunk-fjyb8w5c.js";import{detectShell}from"./chunk-jtrqjhs0.js";import"./chunk-e4fp3w22.js";import"./chunk-nbcm8d58.js";import"./chunk-j1z9kgyd.js";import"./chunk-72kf2e5c.js";import"./chunk-gca19v0w.js";import"./chunk-9y803nx4.js";import"./chunk-qq2mjph2.js";import"./chunk-96kvwzj8.js";import"./chunk-zsfyj36g.js";import"./chunk-dpgaag6b.js";import"./chunk-cmp64q4j.js";import"./chunk-52rcg0te.js";import"./chunk-dzhk9yd0.js";import"./chunk-f050r8jy.js";import"./chunk-w7zv47mp.js";import"./chunk-rja9tf6j.js";import"./chunk-40dgv828.js";import"./chunk-2brn8e1y.js";import"./chunk-rz8319pe.js";import{loadStateFile,patchStateFile}from"./chunk-32j6y5d1.js";import"./chunk-ss6dyn4h.js";import"./chunk-x02jmqj1.js";import"./chunk-7kysxgbq.js";import"./chunk-f6qne8f1.js";import"./chunk-jzsngv31.js";import"./chunk-0g4wc808.js";import"./chunk-xy8be792.js";import"./chunk-h2m7em1e.js";import"./chunk-pn5ygqn6.js";import"./chunk-7ghwdjdc.js";import"./chunk-8t7qbr1e.js";import"./chunk-bejhca6z.js";import"./chunk-br8r72bf.js";import"./chunk-yt15y085.js";import"./chunk-eqdbfgq5.js";import"./chunk-z1nj22va.js";import"./chunk-zt7wfnva.js";import"./chunk-f8gg8cqh.js";import"./chunk-nc46gddg.js";import{__require}from"./chunk-91sykzqq.js";var WELCOMED_KEY="welcomed";function shouldWelcome(state){if(state[WELCOMED_KEY]===!0)return!1;return typeof state[LAST_RUN_VERSION_KEY]!=="string"}function takeWelcome(){if(!shouldWelcome(loadStateFile()))return null;try{patchStateFile({[WELCOMED_KEY]:!0})}catch{}return{shell:detectShell()}}var WHATS_NEW_SEEN_KEY="app.whatsNewSeenVersion";function whatsNewFromVersion(state,current=CURRENT_VERSION){let stamped=state[WHATS_NEW_SEEN_KEY]??state[LAST_RUN_VERSION_KEY];if(typeof stamped!=="string"||stamped.length===0)return null;return compareSemver(current,stamped)>0?stamped:null}function takeWhatsNew(){let from=whatsNewFromVersion(loadStateFile());try{patchStateFile({[WHATS_NEW_SEEN_KEY]:CURRENT_VERSION})}catch{}return from}async function startTui(){let whatsNewFrom=takeWhatsNew(),welcome=takeWelcome();enforceResetGate(),publishRoveTerminalTitle(),await ensureGlobalRoveHooks();let{loadPluginEngines}=await import("./chunk-9xax0901.js");loadPluginEngines();let{startSkillStatus}=await import("./chunk-v7pgavgx.js");startSkillStatus();let{startWorkspaceHost}=await import("./chunk-c43nvea7.js");await startWorkspaceHost({whatsNewFrom,welcome})}export{startTui};
2
+ import{publishRoveTerminalTitle}from"./chunk-3aqhytyy.js";import{ensureGlobalRoveHooks}from"./chunk-ce40bv44.js";import{LAST_RUN_VERSION_KEY,enforceResetGate}from"./chunk-zbwsjdad.js";import"./chunk-17e2tgyg.js";import"./chunk-2bgmby1d.js";import"./chunk-1k7f137x.js";import{CURRENT_VERSION,compareSemver}from"./chunk-fjyb8w5c.js";import{detectShell}from"./chunk-jtrqjhs0.js";import"./chunk-e4fp3w22.js";import"./chunk-nbcm8d58.js";import"./chunk-j1z9kgyd.js";import"./chunk-72kf2e5c.js";import"./chunk-gca19v0w.js";import"./chunk-9y803nx4.js";import"./chunk-qq2mjph2.js";import"./chunk-96kvwzj8.js";import"./chunk-zsfyj36g.js";import"./chunk-dpgaag6b.js";import"./chunk-cmp64q4j.js";import"./chunk-7yg5fzwk.js";import"./chunk-dzhk9yd0.js";import"./chunk-f050r8jy.js";import"./chunk-w7zv47mp.js";import"./chunk-rja9tf6j.js";import"./chunk-40dgv828.js";import"./chunk-2brn8e1y.js";import"./chunk-rz8319pe.js";import{loadStateFile,patchStateFile}from"./chunk-32j6y5d1.js";import"./chunk-ss6dyn4h.js";import"./chunk-x02jmqj1.js";import"./chunk-7kysxgbq.js";import"./chunk-f6qne8f1.js";import"./chunk-jzsngv31.js";import"./chunk-0g4wc808.js";import"./chunk-xy8be792.js";import"./chunk-h2m7em1e.js";import"./chunk-pn5ygqn6.js";import"./chunk-7ghwdjdc.js";import"./chunk-8t7qbr1e.js";import"./chunk-bejhca6z.js";import"./chunk-br8r72bf.js";import"./chunk-yt15y085.js";import"./chunk-eqdbfgq5.js";import"./chunk-z1nj22va.js";import"./chunk-zt7wfnva.js";import"./chunk-f8gg8cqh.js";import"./chunk-nc46gddg.js";import{__require}from"./chunk-91sykzqq.js";var WELCOMED_KEY="welcomed";function shouldWelcome(state){if(state[WELCOMED_KEY]===!0)return!1;return typeof state[LAST_RUN_VERSION_KEY]!=="string"}function takeWelcome(){if(!shouldWelcome(loadStateFile()))return null;try{patchStateFile({[WELCOMED_KEY]:!0})}catch{}return{shell:detectShell()}}var WHATS_NEW_SEEN_KEY="app.whatsNewSeenVersion";function whatsNewFromVersion(state,current=CURRENT_VERSION){let stamped=state[WHATS_NEW_SEEN_KEY]??state[LAST_RUN_VERSION_KEY];if(typeof stamped!=="string"||stamped.length===0)return null;return compareSemver(current,stamped)>0?stamped:null}function takeWhatsNew(){let from=whatsNewFromVersion(loadStateFile());try{patchStateFile({[WHATS_NEW_SEEN_KEY]:CURRENT_VERSION})}catch{}return from}async function startTui(){let whatsNewFrom=takeWhatsNew(),welcome=takeWelcome();enforceResetGate(),publishRoveTerminalTitle(),await ensureGlobalRoveHooks();let{loadPluginEngines}=await import("./chunk-9xax0901.js");loadPluginEngines();let{startSkillStatus}=await import("./chunk-6bacas6q.js");startSkillStatus();let{startWorkspaceHost}=await import("./chunk-k6pefzkp.js");await startWorkspaceHost({whatsNewFrom,welcome})}export{startTui};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{API_VERBS,VERBS,VERB_ALIASES,VERB_GROUPS,findVerb,unknownVerbError}from"./chunk-mfb320rk.js";import"./chunk-02hahr1j.js";import"./chunk-j1rsp5pc.js";import"./chunk-4batd98n.js";import"./chunk-wgyfwry1.js";import"./chunk-emsyqhph.js";import"./chunk-9wd57t3j.js";import"./chunk-pm91e38v.js";import"./chunk-2xsxcdp6.js";import"./chunk-17e2tgyg.js";import"./chunk-qq1q07tz.js";import"./chunk-q8ffd1pc.js";import"./chunk-4hestsjp.js";import"./chunk-qgrg9a5n.js";import"./chunk-2bgmby1d.js";import"./chunk-1k7f137x.js";import"./chunk-5mhvjytn.js";import"./chunk-atn06ncf.js";import"./chunk-z39kezz0.js";import"./chunk-ttmazxw8.js";import"./chunk-mdfm45fx.js";import"./chunk-vp29jgbt.js";import"./chunk-gq36nzg8.js";import"./chunk-sq6zj3fb.js";import"./chunk-qkehg2c1.js";import"./chunk-hk0zbk3t.js";import"./chunk-t7j8g9f6.js";import"./chunk-dmzg9zdc.js";import"./chunk-kg9kmwt9.js";import"./chunk-6xppe9bj.js";import"./chunk-fjyb8w5c.js";import"./chunk-nvsyxefp.js";import"./chunk-bv8apjfp.js";import"./chunk-3t91qn02.js";import"./chunk-w77s2df8.js";import"./chunk-mqfvzdpr.js";import"./chunk-7t35pfeq.js";import"./chunk-rxqdw6s5.js";import"./chunk-8ng1756g.js";import"./chunk-kxp04jnp.js";import"./chunk-0yfzh327.js";import"./chunk-xry1y3yy.js";import"./chunk-r5j8fycq.js";import"./chunk-xfgqae9t.js";import"./chunk-j1z9kgyd.js";import"./chunk-g9ba25q5.js";import"./chunk-ntqg38ke.js";import"./chunk-hpay0ax8.js";import"./chunk-catrr0z3.js";import"./chunk-mdc7b01e.js";import"./chunk-tn9gtf18.js";import"./chunk-z46zwmyq.js";import"./chunk-sak1tphp.js";import"./chunk-y1xnjx8x.js";import"./chunk-72kf2e5c.js";import"./chunk-gca19v0w.js";import"./chunk-9y803nx4.js";import"./chunk-qq2mjph2.js";import"./chunk-96kvwzj8.js";import"./chunk-etfh8f4z.js";import"./chunk-zsfyj36g.js";import"./chunk-jrzh4yv6.js";import"./chunk-dpgaag6b.js";import"./chunk-cmp64q4j.js";import"./chunk-fvt4cksq.js";import"./chunk-52rcg0te.js";import"./chunk-dzhk9yd0.js";import"./chunk-f050r8jy.js";import"./chunk-w7zv47mp.js";import"./chunk-rja9tf6j.js";import"./chunk-40dgv828.js";import"./chunk-2brn8e1y.js";import"./chunk-rz8319pe.js";import"./chunk-32j6y5d1.js";import"./chunk-ss6dyn4h.js";import"./chunk-x02jmqj1.js";import"./chunk-7kysxgbq.js";import"./chunk-f6qne8f1.js";import"./chunk-jzsngv31.js";import"./chunk-0g4wc808.js";import"./chunk-xy8be792.js";import"./chunk-h2m7em1e.js";import"./chunk-pn5ygqn6.js";import"./chunk-7ghwdjdc.js";import"./chunk-8t7qbr1e.js";import"./chunk-bejhca6z.js";import"./chunk-br8r72bf.js";import"./chunk-yt15y085.js";import"./chunk-eqdbfgq5.js";import"./chunk-z1nj22va.js";import"./chunk-zt7wfnva.js";import"./chunk-f8gg8cqh.js";import"./chunk-nc46gddg.js";import"./chunk-1mp632fj.js";import"./chunk-91sykzqq.js";export{unknownVerbError,findVerb,VERB_GROUPS,VERB_ALIASES,VERBS,API_VERBS};
2
+ import{API_VERBS,VERBS,VERB_ALIASES,VERB_GROUPS,findVerb,unknownVerbError}from"./chunk-ym1pqp8p.js";import"./chunk-q7v4fv1y.js";import"./chunk-j1rsp5pc.js";import"./chunk-4batd98n.js";import"./chunk-wgyfwry1.js";import"./chunk-yajg0tpr.js";import"./chunk-9wd57t3j.js";import"./chunk-pm91e38v.js";import"./chunk-2xsxcdp6.js";import"./chunk-17e2tgyg.js";import"./chunk-qq1q07tz.js";import"./chunk-q8ffd1pc.js";import"./chunk-4hestsjp.js";import"./chunk-qgrg9a5n.js";import"./chunk-2bgmby1d.js";import"./chunk-1k7f137x.js";import"./chunk-5mhvjytn.js";import"./chunk-atn06ncf.js";import"./chunk-z39kezz0.js";import"./chunk-8m1g3tsx.js";import"./chunk-mdfm45fx.js";import"./chunk-vp29jgbt.js";import"./chunk-gq36nzg8.js";import"./chunk-sq6zj3fb.js";import"./chunk-qkehg2c1.js";import"./chunk-hk0zbk3t.js";import"./chunk-t7j8g9f6.js";import"./chunk-dmzg9zdc.js";import"./chunk-kg9kmwt9.js";import"./chunk-6xppe9bj.js";import"./chunk-fjyb8w5c.js";import"./chunk-xgp6f6h0.js";import"./chunk-bkj71nep.js";import"./chunk-3t91qn02.js";import"./chunk-w77s2df8.js";import"./chunk-mqfvzdpr.js";import"./chunk-7t35pfeq.js";import"./chunk-rxqdw6s5.js";import"./chunk-8ng1756g.js";import"./chunk-kxp04jnp.js";import"./chunk-ehgj2pes.js";import"./chunk-0z3s4cwg.js";import"./chunk-r5j8fycq.js";import"./chunk-xfgqae9t.js";import"./chunk-j1z9kgyd.js";import"./chunk-g9ba25q5.js";import"./chunk-ntqg38ke.js";import"./chunk-hpay0ax8.js";import"./chunk-catrr0z3.js";import"./chunk-mdc7b01e.js";import"./chunk-tn9gtf18.js";import"./chunk-z46zwmyq.js";import"./chunk-sak1tphp.js";import"./chunk-y1xnjx8x.js";import"./chunk-72kf2e5c.js";import"./chunk-gca19v0w.js";import"./chunk-9y803nx4.js";import"./chunk-qq2mjph2.js";import"./chunk-96kvwzj8.js";import"./chunk-etfh8f4z.js";import"./chunk-zsfyj36g.js";import"./chunk-jrzh4yv6.js";import"./chunk-dpgaag6b.js";import"./chunk-cmp64q4j.js";import"./chunk-5pnjemmh.js";import"./chunk-7yg5fzwk.js";import"./chunk-dzhk9yd0.js";import"./chunk-f050r8jy.js";import"./chunk-w7zv47mp.js";import"./chunk-rja9tf6j.js";import"./chunk-40dgv828.js";import"./chunk-2brn8e1y.js";import"./chunk-rz8319pe.js";import"./chunk-32j6y5d1.js";import"./chunk-ss6dyn4h.js";import"./chunk-x02jmqj1.js";import"./chunk-7kysxgbq.js";import"./chunk-f6qne8f1.js";import"./chunk-jzsngv31.js";import"./chunk-0g4wc808.js";import"./chunk-xy8be792.js";import"./chunk-h2m7em1e.js";import"./chunk-pn5ygqn6.js";import"./chunk-7ghwdjdc.js";import"./chunk-8t7qbr1e.js";import"./chunk-bejhca6z.js";import"./chunk-br8r72bf.js";import"./chunk-yt15y085.js";import"./chunk-eqdbfgq5.js";import"./chunk-z1nj22va.js";import"./chunk-zt7wfnva.js";import"./chunk-f8gg8cqh.js";import"./chunk-nc46gddg.js";import"./chunk-1mp632fj.js";import"./chunk-91sykzqq.js";export{unknownVerbError,findVerb,VERB_GROUPS,VERB_ALIASES,VERBS,API_VERBS};
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{engineEntry,identifiableEngineIds}from"./chunk-52rcg0te.js";import{recordSpawn}from"./chunk-40dgv828.js";import{loadStateFile}from"./chunk-32j6y5d1.js";import{PsProbeUnavailableError}from"./chunk-1mp632fj.js";import{__require}from"./chunk-91sykzqq.js";import{basename}from"path";var WRAPPERS=new Set(["node","bun","npx","deno","sh","zsh","bash","env","script"]);function binaryName(token){return basename(token).replace(/\.(exe|js|mjs|cjs)$/,"")}function executableNameFromArgv(argv){for(let token of argv.slice(0,8)){if(/^[A-Za-z_][A-Za-z0-9_]*=/.test(token))continue;let name=binaryName(token);if(WRAPPERS.has(name))continue;return name||null}return null}function vendorFromArgv(commandLine){let name=executableNameFromArgv(commandLine.trim().split(/\s+/));if(!name)return null;return identifiableEngineIds().find((v)=>{let entry=engineEntry(v);return entry.defaultCommand[0]===name||entry.processNames?.includes(name)===!0})??null}function parsePsSnapshot(text){let rows=[];for(let line of text.split(`
2
+ import{engineEntry,identifiableEngineIds}from"./chunk-7yg5fzwk.js";import{recordSpawn}from"./chunk-40dgv828.js";import{loadStateFile}from"./chunk-32j6y5d1.js";import{PsProbeUnavailableError}from"./chunk-1mp632fj.js";import{__require}from"./chunk-91sykzqq.js";import{basename}from"path";var WRAPPERS=new Set(["node","bun","npx","deno","sh","zsh","bash","env","script"]);function binaryName(token){return basename(token).replace(/\.(exe|js|mjs|cjs)$/,"")}function executableNameFromArgv(argv){for(let token of argv.slice(0,8)){if(/^[A-Za-z_][A-Za-z0-9_]*=/.test(token))continue;let name=binaryName(token);if(WRAPPERS.has(name))continue;return name||null}return null}function vendorFromArgv(commandLine){let name=executableNameFromArgv(commandLine.trim().split(/\s+/));if(!name)return null;return identifiableEngineIds().find((v)=>{let entry=engineEntry(v);return entry.defaultCommand[0]===name||entry.processNames?.includes(name)===!0})??null}function parsePsSnapshot(text){let rows=[];for(let line of text.split(`
3
3
  `)){let m=/^\s*(\d+)\s+(\d+)\s+(\S.*)$/.exec(line);if(m)rows.push({pid:Number(m[1]),ppid:Number(m[2]),args:m[3]})}return rows}function childrenIndex(rows){let kids=new Map;for(let row of rows){let list=kids.get(row.ppid);if(list)list.push(row);else kids.set(row.ppid,[row])}return kids}function hasAncestor(rows,pid,ancestorPid){let parents=new Map(rows.map((r)=>[r.pid,r.ppid])),cur=pid;for(let hops=0;hops<=rows.length;hops++){if(cur===ancestorPid)return!0;let next=parents.get(cur);if(next===void 0||next<=1)return!1;cur=next}return!1}function customEngineBinaries(){let state=loadStateFile(),ids=state.customEngineIds,out=new Map;if(!Array.isArray(ids))return out;for(let id of ids){if(typeof id!=="string"||id.trim().length===0)continue;let command=state[`engineCommand.${id}`],argv=typeof command==="string"&&command.trim().length>0?command.trim().split(/\s+/):[id],name=executableNameFromArgv(argv);if(name)out.set(name,id)}return out}function findDescendant(rows,rootPid,pick){let kids=childrenIndex(rows),queue=[...kids.get(rootPid)??[]],visited=new Set;while(queue.length>0){let row=queue.shift();if(!row)break;if(visited.has(row.pid))continue;visited.add(row.pid);let hit=pick(row);if(hit!==null)return hit;queue.push(...kids.get(row.pid)??[])}return null}function walkDescendants(rows,rootPid,identify){return findDescendant(rows,rootPid,(row)=>{let vendor=identify(row.args);return vendor?{vendor,argv:row.args,pid:row.pid}:null})}function foregroundEngineIn(rows,rootPid){let builtin=walkDescendants(rows,rootPid,vendorFromArgv);if(builtin)return builtin;let custom=customEngineBinaries();if(custom.size===0)return null;return walkDescendants(rows,rootPid,(args)=>custom.get(executableNameFromArgv(args.trim().split(/\s+/))??"")??null)}function engineProcessIn(rows,rootPid,extraLaunch){if(foregroundEngineIn(rows,rootPid))return!0;let expected=extraLaunch?executableNameFromArgv(typeof extraLaunch==="string"?[extraLaunch]:extraLaunch):null;if(!expected)return!1;return findDescendant(rows,rootPid,(row)=>executableNameFromArgv(row.args.trim().split(/\s+/))===expected?!0:null)===!0}var PS_PROBE_TIMEOUT_MS=5000,bunPsSpawn=()=>{recordSpawn("engine.foregroundWalk",["ps","-A","-o","pid=,ppid=,args="]);let proc=Bun.spawn(["ps","-A","-o","pid=,ppid=,args="],{stdout:"pipe",stderr:"ignore"});return{text:new Response(proc.stdout).text(),kill:()=>proc.kill()}};async function psSnapshotWith(spawn,timeoutMs=PS_PROBE_TIMEOUT_MS){let proc=spawn(),timer;try{let text=await Promise.race([proc.text,new Promise((_resolve,reject)=>{timer=setTimeout(()=>{try{proc.kill()}catch{}reject(new PsProbeUnavailableError(`ps did not answer within ${timeoutMs}ms`))},timeoutMs)})]);if(parsePsSnapshot(text).length===0)throw new PsProbeUnavailableError("ps returned no usable rows");return text}finally{if(timer)clearTimeout(timer)}}function shareInflight(run){let inflight=null;return()=>{return inflight??=run().finally(()=>{inflight=null}),inflight}}var sharedPs=shareInflight(()=>psSnapshotWith(bunPsSpawn)),psSnapshot=async(anchors)=>{if(process.platform!=="win32")return sharedPs();let{defaultWinProcessProbe,winProcessSnapshot}=await import("./chunk-tv4frx8n.js");return winProcessSnapshot(anchors??[],defaultWinProcessProbe())};async function foregroundEngine(rootPid,snapshot=psSnapshot){try{return foregroundEngineIn(parsePsSnapshot(await snapshot([rootPid])),rootPid)}catch{return null}}
4
4
  export{vendorFromArgv,parsePsSnapshot,hasAncestor,foregroundEngineIn,engineProcessIn,PS_PROBE_TIMEOUT_MS,psSnapshotWith,shareInflight,psSnapshot,foregroundEngine};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{installSkillNow,refreshSkillStatus,skillMissing,startSkillStatus}from"./chunk-qjxazzpa.js";import"./chunk-e6en1zb7.js";import"./chunk-cmp64q4j.js";import"./chunk-52rcg0te.js";import"./chunk-dzhk9yd0.js";import"./chunk-f050r8jy.js";import"./chunk-w7zv47mp.js";import"./chunk-rja9tf6j.js";import"./chunk-40dgv828.js";import"./chunk-2brn8e1y.js";import"./chunk-rz8319pe.js";import"./chunk-32j6y5d1.js";import"./chunk-ss6dyn4h.js";import"./chunk-x02jmqj1.js";import"./chunk-7kysxgbq.js";import"./chunk-f6qne8f1.js";import"./chunk-jzsngv31.js";import"./chunk-0g4wc808.js";import"./chunk-xy8be792.js";import"./chunk-h2m7em1e.js";import"./chunk-pn5ygqn6.js";import"./chunk-7ghwdjdc.js";import"./chunk-8t7qbr1e.js";import"./chunk-bejhca6z.js";import"./chunk-br8r72bf.js";import"./chunk-yt15y085.js";import"./chunk-eqdbfgq5.js";import"./chunk-z1nj22va.js";import"./chunk-zt7wfnva.js";import"./chunk-f8gg8cqh.js";import"./chunk-nc46gddg.js";import"./chunk-91sykzqq.js";export{startSkillStatus,skillMissing,refreshSkillStatus,installSkillNow};
2
+ import{installSkillNow,refreshSkillStatus,skillMissing,startSkillStatus}from"./chunk-18cs2dpx.js";import"./chunk-qk5xb8zg.js";import"./chunk-cmp64q4j.js";import"./chunk-7yg5fzwk.js";import"./chunk-dzhk9yd0.js";import"./chunk-f050r8jy.js";import"./chunk-w7zv47mp.js";import"./chunk-rja9tf6j.js";import"./chunk-40dgv828.js";import"./chunk-2brn8e1y.js";import"./chunk-rz8319pe.js";import"./chunk-32j6y5d1.js";import"./chunk-ss6dyn4h.js";import"./chunk-x02jmqj1.js";import"./chunk-7kysxgbq.js";import"./chunk-f6qne8f1.js";import"./chunk-jzsngv31.js";import"./chunk-0g4wc808.js";import"./chunk-xy8be792.js";import"./chunk-h2m7em1e.js";import"./chunk-pn5ygqn6.js";import"./chunk-7ghwdjdc.js";import"./chunk-8t7qbr1e.js";import"./chunk-bejhca6z.js";import"./chunk-br8r72bf.js";import"./chunk-yt15y085.js";import"./chunk-eqdbfgq5.js";import"./chunk-z1nj22va.js";import"./chunk-zt7wfnva.js";import"./chunk-f8gg8cqh.js";import"./chunk-nc46gddg.js";import"./chunk-91sykzqq.js";export{startSkillStatus,skillMissing,refreshSkillStatus,installSkillNow};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{booleanFlagsOf,callVerb,errorBody,errorEnvelope,repeatableFlagsOf,runVerb,successEnvelope,toApiError}from"./chunk-qt67sbz0.js";import{VerbArgs,apiUsage,findVerb,parseFlags,unknownVerbError,validateAgainstSpec,verbHelp}from"./chunk-mfb320rk.js";import{ensurePluginEnginesLoaded}from"./chunk-j1rsp5pc.js";import{openDaemonSession}from"./chunk-4batd98n.js";import{AUTO_MACHINE,LOCAL_MACHINE,forwardVerb,pickMachine,repoHosts,requireMachine,routeTarget,takeIdentityWarning}from"./chunk-ttmazxw8.js";import{ApiError,requireVerbInstalled,verbInstalled}from"./chunk-r5j8fycq.js";import{ROVE_API_VERSION}from"./chunk-96kvwzj8.js";import{argvHasFlag}from"./chunk-zsfyj36g.js";import{errorMessage}from"./chunk-2brn8e1y.js";import{__require}from"./chunk-91sykzqq.js";function takeMachineFlag(argv){let rest=[],machine;for(let i=0;i<argv.length;i++){let arg=argv[i];if(arg==="--machine")machine=argv[i+1],i+=1;else if(arg.startsWith("--machine="))machine=arg.slice(10);else rest.push(arg)}return{machine:machine||void 0,rest}}function forwardParams(verb,flags){if(!flags.has("prompt-file")||!verb.flags.some((f)=>f.name==="prompt"))return Object.fromEntries(flags);let text=new VerbArgs(verb,flags).promptText(),params=Object.fromEntries([...flags].filter(([name])=>name!=="prompt-file"));return text===void 0?params:{...params,prompt:text}}var envelopeMode=!1;function writeJson(value,pretty,stream=process.stdout){stream.write(`${pretty?JSON.stringify(value,null,2):JSON.stringify(value)}
2
+ import{booleanFlagsOf,callVerb,errorBody,errorEnvelope,repeatableFlagsOf,runVerb,successEnvelope,toApiError}from"./chunk-s48m151m.js";import{VerbArgs,apiUsage,findVerb,parseFlags,unknownVerbError,validateAgainstSpec,verbHelp}from"./chunk-ym1pqp8p.js";import{ensurePluginEnginesLoaded}from"./chunk-j1rsp5pc.js";import{openDaemonSession}from"./chunk-4batd98n.js";import{AUTO_MACHINE,LOCAL_MACHINE,forwardVerb,pickMachine,repoHosts,requireMachine,routeTarget,takeIdentityWarning}from"./chunk-8m1g3tsx.js";import{ApiError,requireVerbInstalled,verbInstalled}from"./chunk-r5j8fycq.js";import{ROVE_API_VERSION}from"./chunk-96kvwzj8.js";import{argvHasFlag}from"./chunk-zsfyj36g.js";import{errorMessage}from"./chunk-2brn8e1y.js";import{__require}from"./chunk-91sykzqq.js";function takeMachineFlag(argv){let rest=[],machine;for(let i=0;i<argv.length;i++){let arg=argv[i];if(arg==="--machine")machine=argv[i+1],i+=1;else if(arg.startsWith("--machine="))machine=arg.slice(10);else rest.push(arg)}return{machine:machine||void 0,rest}}function forwardParams(verb,flags){if(!flags.has("prompt-file")||!verb.flags.some((f)=>f.name==="prompt"))return Object.fromEntries(flags);let text=new VerbArgs(verb,flags).promptText(),params=Object.fromEntries([...flags].filter(([name])=>name!=="prompt-file"));return text===void 0?params:{...params,prompt:text}}var envelopeMode=!1;function writeJson(value,pretty,stream=process.stdout){stream.write(`${pretty?JSON.stringify(value,null,2):JSON.stringify(value)}
3
3
  `)}function emit(value,pretty){let warning=takeIdentityWarning(),payload=warning&&value&&typeof value==="object"&&!Array.isArray(value)?{...value,identityWarning:warning}:value;writeJson(envelopeMode?successEnvelope(payload):payload,pretty)}function fail(message,code,exitCode=1,data){let error=errorBody(new ApiError(message,code,data));if(envelopeMode)writeJson({apiVersion:ROVE_API_VERSION,ok:!1,error},!1);else writeJson({error},!1,process.stderr);process.exit(exitCode)}var USAGE_ERROR_CODES=new Set(["BAD_VERB","UNKNOWN_VERB","BAD_FLAG","MISSING_FLAG","MISSING_VERB","BAD_DAEMON","UNKNOWN_MACHINE"]);async function invokeVerb(verbName,argv,deps){return runVerb(verbName,{argv},deps)}async function runApiSubcommand(argv){let[verbName,...withMachine]=argv,{machine,rest}=takeMachineFlag(withMachine);if(envelopeMode=argvHasFlag(rest,"--envelope"),!verbName||verbName==="--help"||verbName==="-h"||verbName==="help"){if(!verbName)fail(apiUsage(),"MISSING_VERB",2);process.stdout.write(`${apiUsage()}
4
4
  `);return}ensurePluginEnginesLoaded();let verb=findVerb(verbName);if(!verb){let err=unknownVerbError(verbName);fail(`${err.message}
5
5
  ${apiUsage()}`,err.code,2,err.data)}let parsed;try{parsed=parseFlags(rest,booleanFlagsOf(verb),repeatableFlagsOf(verb))}catch(err){if(err instanceof ApiError)fail(err.message,err.code,2,err.data);fail(errorMessage(err),"BAD_FLAG",2)}if(parsed.help){if(!verbInstalled(verb))try{requireVerbInstalled(verb)}catch(err){if(err instanceof ApiError)fail(err.message,err.code,2,err.data)}process.stdout.write(`${verbHelp(verb)}
@@ -169,5 +169,5 @@ ${tool}}
169
169
  `;var ACTIVITY_EXTENSION_FILE="rove-activity.ts";function piExtensionsDir(vendor,deps){return path10.join(vendorAgentDir(vendor,deps),"extensions")}function piActivityExtensionPath(vendor,deps){return path10.join(piExtensionsDir(vendor,deps),ACTIVITY_EXTENSION_FILE)}function piFailureDetail(payload){let raw=typeof payload.error_message==="string"?payload.error_message:"",message=raw.toLowerCase(),note=raw?raw.slice(0,200):void 0;return{failure:(()=>{if(/insufficient|credit|billing|payment required|\b402\b|quota exceeded|out of credits/.test(message))return"billing";if(/rate.?limit|too many requests|\b429\b|overloaded|capacity/.test(message))return"rate_limit";if(isTransientFailureText(message))return"transient";return"other"})(),...note?{note}:{}}}class PiFamilyHookAdapter{family;vendor;constructor(family){this.family=family;this.vendor=family}supportsHooks(){return!0}globalSettingsPath(){return piActivityExtensionPath(this.family)}activityDetailFromPayload(kind,payload){if(kind==="turn-failed")return piFailureDetail(payload);if(kind==="awaiting-input")return{waiting:payload.waiting==="input"?"input":"permission"};if(kind==="tool-pre"||kind==="tool-post"||kind==="tool-failed"){let name=typeof payload.tool_name==="string"?payload.tool_name:void 0;return{tool:{...name?{name}:{}}}}return}sessionFromPayload(payload){let sessionId=typeof payload.session_id==="string"?payload.session_id:void 0;if(!sessionId)return;let transcriptPath3=typeof payload.transcript_path==="string"?payload.transcript_path:void 0;return{sessionId,...transcriptPath3?{transcriptPath:transcriptPath3}:{}}}async installActivityHooks(settingsFilePath,opts={}){let agentDir=path10.dirname(path10.dirname(settingsFilePath));if(!existsSync3(agentDir))return{ok:!0};let source=renderPiExtensionSource({vendor:this.family,invocation:roveHookInvocation(),toolEvents:opts.toolEvents??!1});return await writeIfChanged(settingsFilePath,source),{ok:!0}}async removeActivityHooks(settingsFilePath){try{await rm2(settingsFilePath,{force:!0})}catch{}}supportsWorktreeSync(){return!1}async removeWorktreeSyncHook(){}async removeWorktreeWatchHook(){}}var OMP_SCREEN_MANIFEST={rules:[{state:"blocked",all:["allow tool"],any:["approve","deny"]},{state:"working",lineRegex:["^\\s*[\\u2800-\\u28FF]{1,2}\\s+\\d+s\\s+\xB7"]},{state:"idle",lineRegex:["^\\s*\xB7\\s+\\S+.*\xB7"]}]},PI_SCREEN_MANIFEST={rules:[{state:"blocked",all:["trust project folder?"]},{state:"blocked",all:["\u2191\u2193 navigate","escape/ctrl+c cancel"]},{state:"working",any:["working..."]},{state:"idle",lineRegex:["^\\s*[\u2191\u2193]\\s*\\d"]}]};var OMP_SPINNER_FRAMES=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"];var OMP_WORKING_PREFIXES=OMP_SPINNER_FRAMES.map((frame)=>`${"\u03C0"} ${frame}`),OMP_ATTENTION_PREFIXES=[`${"\u03C0"} !`],OMP_STATUS_PREFIXES=[...OMP_WORKING_PREFIXES,...OMP_ATTENTION_PREFIXES,`${"\u03C0"} >`,`${"\u03C0"}:`],PI_STATUS_PREFIXES=[`${"\u03C0"} -`];import{existsSync as existsSync4,mkdirSync as mkdirSync4,readFileSync as readFileSync2,writeFileSync as writeFileSync4}from"fs";import path11 from"path";function piTrustPath(deps){return path11.join(vendorAgentDir("pi",deps),"trust.json")}function trustPiWorktree(worktreePath,deps){let file=piTrustPath(deps);try{let existing={};if(existsSync4(file)){let parsed=JSON.parse(readFileSync2(file,"utf8"));if(!parsed||typeof parsed!=="object"||Array.isArray(parsed))return;for(let[key,value]of Object.entries(parsed))existing[key]=value===!0}existing[realPathOrSelf(worktreePath)]=!0,mkdirSync4(path11.dirname(file),{recursive:!0}),writeFileSync4(file,`${JSON.stringify(existing,null,2)}
170
170
  `)}catch{}}import{stat as stat6}from"fs/promises";class EngineTurnDetector{supportsCompletionMarkers(){return!0}async latestCompletion(worktree){return(await this.latestActivity(worktree)).marker}async latestActivityInFile(_transcriptPath){return null}}function createEngineTurnDetector(vendor){return engineEntry(vendor).createTurnDetector()}var statFile=(path12)=>stat6(path12).catch(()=>null);function completionReader(deps,parse2){let cache4=new Map;return async(path12,knownMtime)=>{let info=deps.statFile?await deps.statFile(path12):null;if(deps.statFile&&!info)return null;let mtimeMs=info?.mtimeMs??knownMtime??await(deps.statMtimeMs??(async(p)=>(await statFile(p))?.mtimeMs??0))(path12);if(!info&&knownMtime===void 0&&mtimeMs===0)return null;let key=info?`${info.dev}:${info.ino}:${info.size}:${info.mtimeMs}:${info.ctimeMs}`:String(mtimeMs),hit=cache4.get(path12);if(mtimeMs>0&&hit?.key===key)return hit.scan;let raw;try{raw=await deps.readFile(path12)}catch{return cache4.delete(path12),null}if(raw===null)return cache4.delete(path12),null;let scan={marker:parse2(raw,path12,mtimeMs),mtimeMs};if(cache4.delete(path12),cache4.set(path12,{key,scan}),cache4.size>8){let oldest=cache4.keys().next().value;if(oldest!==void 0)cache4.delete(oldest)}return scan}}var defaultClaudeDeps={listSessionFiles:(worktree)=>listSessionFilesForWorktree(worktree),readFile:readTextFileIfRegular,statFile};class ClaudeTurnDetector extends EngineTurnDetector{deps;vendor="claude";readCompletion;constructor(deps=defaultClaudeDeps){super();this.deps=deps;this.readCompletion=completionReader(deps,latestClaudeCompletionMarkerFromJsonl)}async latestActivity(worktree){let files=await this.deps.listSessionFiles(worktree),mtimeMs=files[0]?.mtimeMs??0,latest=null;for(let file of files.slice(0,4)){let marker=(await this.readCompletion(file.path,file.mtimeMs))?.marker;if(marker&&(!latest||marker.timestampMs>latest.timestampMs))latest=marker}return{marker:latest,mtimeMs}}latestActivityInFile(transcriptPath3){return this.readCompletion(transcriptPath3)}}var defaultCodexDeps={findLatestRollout:(worktree)=>findLatestRolloutForWorktree(worktree),readFile:readTextFileIfRegular,statFile};class CodexTurnDetector extends EngineTurnDetector{deps;vendor="codex";readCompletion;constructor(deps=defaultCodexDeps){super();this.deps=deps;this.readCompletion=completionReader(deps,latestCodexCompletionMarkerFromJsonl)}latestActivityInFile(transcriptPath3){return this.readCompletion(transcriptPath3)}async latestActivity(worktree){if(!worktree)return{marker:null,mtimeMs:0};let found=await this.deps.findLatestRollout(worktree);return found?await this.readCompletion(found.path,found.mtimeMs)??{marker:null,mtimeMs:0}:{marker:null,mtimeMs:0}}}class UnknownTurnDetector extends EngineTurnDetector{vendor;constructor(vendor){super();this.vendor=vendor}supportsCompletionMarkers(){return!1}async latestActivity(){return{marker:null,mtimeMs:0}}}var CLAUDE_TURN_END_STOP_REASONS=new Set(["end_turn","stop_sequence","max_tokens","refusal"]);function latestClaudeCompletionMarkerFromJsonl(raw,sourceId="claude",fallbackMtimeMs=0){let latest=null,lineNo=0;for(let line of raw.split(`
171
171
  `)){lineNo++;let record=parseJsonLine(line);if(!record)continue;let inner=isObject(record.message)?record.message:record;if(inner.role!=="assistant")continue;if(typeof inner.stop_reason!=="string")continue;if(!CLAUDE_TURN_END_STOP_REASONS.has(inner.stop_reason))continue;let timestampMs=timestampFromRecord(record,fallbackMtimeMs),marker={id:`claude:${sourceId}:${timestampMs}:${lineNo}`,timestampMs,source:"claude"};if(!latest||marker.timestampMs>=latest.timestampMs)latest=marker}return latest}var CODEX_ROLLOUT_DONE_EVENTS=new Set(["task_complete","turn_complete","turn_aborted"]);function isCodexCompletionRecord(record){if(record.type==="turn.completed")return!0;if(record.type!=="event_msg")return!1;let payload=isObject(record.payload)?record.payload:void 0;return typeof payload?.type==="string"&&CODEX_ROLLOUT_DONE_EVENTS.has(payload.type)}function latestCodexCompletionMarkerFromJsonl(raw,sourceId="codex"){let latest=null,lineNo=0;for(let line of raw.split(`
172
- `)){lineNo++;let record=parseJsonLine(line);if(!record||!isCodexCompletionRecord(record))continue;let timestampMs=timestampFromRecord(record,0),marker={id:`codex:${sourceId}:${timestampMs}:${lineNo}`,timestampMs,source:"codex"};if(!latest||marker.timestampMs>=latest.timestampMs)latest=marker}return latest}function parseJsonLine(line){if(!isJsonlLineWithinBound(line))return null;let trimmed=line.trim();if(!trimmed)return null;try{let parsed=JSON.parse(trimmed);return isObject(parsed)?parsed:null}catch{return null}}function timestampFromRecord(record,fallback){let ts=typeof record.timestamp==="string"?Date.parse(record.timestamp):Number.NaN;return Number.isFinite(ts)?ts:fallback}var BUILTIN_ENGINES={claude:{vendor:"claude",builtin:!0,displayName:claudeIdentity.shortName,icon:CLAUDE_ICON,defaultCommand:["claude"],listModels:async()=>CLAUDE_MODELS,modelArgv:(base,model)=>[...base,"--model",model],addDirArgv:(base,dirs)=>[...base,...dirs.map((dir)=>`--add-dir=${dir}`)],effortLevels:["low","medium","high","xhigh","max"],effortArgv:(base,level)=>[...base,"--effort",level],foreignModel:isOpenAiFamilyModel,history:claudeHistoryReader,detectAccount:(deps)=>detectClaudeAccount(deps),createHookAdapter:()=>new ClaudeHookAdapter,skillsDir:()=>isRovePluginEnabled()?null:skillsDirUnder(vendorConfigHome("claude")),createTurnDetector:()=>new ClaudeTurnDetector,capabilities:claudeCapabilities,identity:claudeIdentity,trustWorktree:trustClaudeWorktree,terminalTitle:{ownsStatus:!0,statusPrefixes:["\u2733","\u2802","\u2810","\u25D0","\u25D1"],workingPrefixes:["\u2802","\u2810","\u25D0","\u25D1"]},sessionIdentity:{pinFlag:"--session-id",sessionControlFlags:["--session-id","--resume","-r","--continue","-c","--from-pr"],resumeArgv:(base,id)=>[...base,"--resume",id],forkArgv:(base,sourceId,newId)=>{let forked=[...base,"--resume",sourceId,"--fork-session"];return newId?[...forked,"--session-id",newId]:forked}},quotaUsage:()=>fetchClaudeQuotaUsage(),readTurns:readClaudeTurns},codex:{vendor:"codex",builtin:!0,displayName:codexIdentity.shortName,icon:CODEX_ICON,defaultCommand:["codex"],effortLevels:["none","low","medium","high","xhigh","max"],effortArgv:(base,level)=>[...base,"-c",`model_reasoning_effort=${level}`],listModels:async()=>CODEX_MODELS,modelArgv:(base,model)=>[...base,"--model",model],addDirArgv:(base,dirs)=>[...base,...dirs.map((dir)=>`--add-dir=${dir}`)],hostedStartArgv:(argv)=>{for(let i=1;i<argv.length;i++){let arg=argv[i];if(arg==="--")break;let config=arg==="-c"||arg==="--config"?argv[++i]:arg.startsWith("--config=")?arg.slice(9):arg.startsWith("-c")?arg.slice(2).replace(/^=/,""):void 0;if(config&&/^\s*check_for_update_on_startup\s*=/.test(config))return argv}return[...argv,"-c","check_for_update_on_startup=false"]},foreignModel:isClaudeFamilyModel,errorLine:/^\s*\u25A0\s+\S/,history:codexHistoryReader,detectAccount:(deps)=>detectCodexAccount(deps),createHookAdapter:()=>new CodexHookAdapter,skillsDir:()=>skillsDirUnder(vendorConfigHome("codex")),createTurnDetector:()=>new CodexTurnDetector,capabilities:codexCapabilities,identity:codexIdentity,trustWorktree:trustCodexWorktree,readTurns:readCodexTurns,terminalTitle:{ownsStatus:!0,launchArgs:["-c",'tui.terminal_title=["activity","thread-title"]'],statusPrefixes:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],workingPrefixes:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],sessionIdFromTitle:codexSessionIdFromTitle},sessionIdentity:{resumeArgv:(base,id)=>{let[bin,...rest]=base;return bin?[bin,"resume",...rest,id]:base},forkArgv:(base,sourceId)=>{let[bin,...rest]=base;return bin?[bin,"fork",...rest,sourceId]:null}},quotaUsage:()=>fetchCodexQuotaUsage()},bob:{vendor:"bob",builtin:!0,displayName:"IBM Bob",defaultCommand:["bob","chat","--trust"],firstMessageDelivery:"paste",history:bobHistoryReader,detectAccount:(deps)=>detectBobAccount(deps),trustWorktree:trustBobWorktree,createHookAdapter:()=>new NoopHookAdapter("bob"),skillsDir:()=>skillsDirUnder(bobHome()),createTurnDetector:()=>new UnknownTurnDetector("bob"),screenManifest:BOB_SCREEN_MANIFEST},copilot:{vendor:"copilot",builtin:!0,displayName:"Copilot",icon:COPILOT_ICON,defaultCommand:["copilot"],history:copilotHistoryReader,detectAccount:(deps)=>detectCopilotAccount(deps),createHookAdapter:()=>new CopilotHookAdapter,skillsDir:()=>skillsDirUnder(vendorConfigHome("copilot")),createTurnDetector:()=>new UnknownTurnDetector("copilot"),trustWorktree:trustCopilotWorktree,screenManifest:COPILOT_SCREEN_MANIFEST},kimi:{vendor:"kimi",builtin:!0,displayName:"Kimi",icon:KIMI_ICON,defaultCommand:["kimi"],firstMessageDelivery:"paste",processNames:["kimi-co"],modelArgv:(base,model)=>[...base,"--model",model],trustWorktree:trustKimiWorktree,history:kimiHistoryReader,detectAccount:(deps)=>detectKimiAccount(deps),createHookAdapter:()=>new KimiHookAdapter,skillsDir:()=>existsSync5(vendorConfigHome("kimi"))?join5(homedir7(),".agents","skills"):null,createTurnDetector:()=>new UnknownTurnDetector("kimi"),sessionIdentity:{sessionControlFlags:["-S","--session","-c","--continue"],resumeArgv:(base,id)=>[...base,"-S",id]},screenManifest:KIMI_SCREEN_MANIFEST},pi:{vendor:"pi",builtin:!0,displayName:piIdentity.shortName,defaultCommand:["pi"],effortLevels:["off","minimal","low","medium","high","xhigh","max"],effortArgv:(base,level)=>[...base,"--thinking",level],listModels:listPiModels,modelArgv:(base,model)=>[...base,"--model",model],history:piHistoryReader,createHookAdapter:()=>new PiFamilyHookAdapter("pi"),skillsDir:()=>skillsDirUnder(vendorAgentDir("pi")),createTurnDetector:()=>new UnknownTurnDetector("pi"),capabilities:piCapabilities,identity:piIdentity,trustWorktree:trustPiWorktree,terminalTitle:{ownsStatus:!1,statusPrefixes:PI_STATUS_PREFIXES},sessionIdentity:{pinFlag:"--session-id",sessionControlFlags:["--session-id","--session","-c","--continue","-r","--resume","--fork"],resumeArgv:(base,id)=>[...base,"--session",id],forkArgv:(base,sourceId)=>[...base,"--fork",sourceId]},screenManifest:PI_SCREEN_MANIFEST},omp:{vendor:"omp",builtin:!0,displayName:ompIdentity.shortName,icon:OMP_ICON,defaultCommand:["omp"],effortLevels:["off","minimal","low","medium","high","xhigh","max"],effortArgv:(base,level)=>[...base,"--thinking",level],listModels:listOmpModels,modelArgv:(base,model)=>[...base,`--model=${model}`],history:ompHistoryReader,createHookAdapter:()=>new PiFamilyHookAdapter("omp"),createTurnDetector:()=>new UnknownTurnDetector("omp"),capabilities:ompCapabilities,identity:ompIdentity,terminalTitle:{ownsStatus:!0,statusPrefixes:OMP_STATUS_PREFIXES,workingPrefixes:OMP_WORKING_PREFIXES,attentionPrefixes:OMP_ATTENTION_PREFIXES},sessionIdentity:{sessionControlFlags:["-c","--continue","-r","--resume"],resumeArgv:(base,id)=>[...base,"-r",id]},screenManifest:OMP_SCREEN_MANIFEST}};function stripStatusPrefix(title,prefixes){for(let prefix of[...prefixes].sort((a,b)=>b.length-a.length)){if(!title.startsWith(prefix))continue;let rest=title.slice(prefix.length).trimStart();if(rest.length===0)return title;return rest}return title}function titleTurnHint(config,title){let working=config?.workingPrefixes;if(config?.ownsStatus!==!0||!working||working.length===0)return null;let trimmed=title.trim();if(trimmed.length===0)return null;if(config.attentionPrefixes?.some((prefix)=>trimmed.startsWith(prefix)))return null;return working.some((prefix)=>trimmed.startsWith(prefix))?"working":"rest"}function titleSessionId(config,title){let trimmed=title.trim();if(!trimmed)return null;return config?.sessionIdFromTitle?.(trimmed)??null}function titleIsPlaceholder(config,title){return titleSessionId(config,title)!==null}function customEngineEntry(vendor){return{vendor,builtin:!1,displayName:vendor,defaultCommand:[vendor],history:EMPTY_HISTORY,createHookAdapter:()=>new NoopHookAdapter(vendor),createTurnDetector:()=>new UnknownTurnDetector(vendor)}}function engineEntry(vendor){if(isBuiltinVendor(vendor))return BUILTIN_ENGINES[vendor];let custom=customEngineEntry(vendor);return isContribEngine(vendor)?contribEngineEntry(vendor,custom):custom}function identifiableEngineIds(){return[...BUILTIN_VENDORS,...CONTRIB_ENGINE_IDS,...pluginEngineIds()]}function supportsStructuredHistory(vendor){return engineEntry(vendor).history.readHistory!==EMPTY_HISTORY.readHistory}var ALL_STATUS_PREFIXES=[...new Set(Object.values(BUILTIN_ENGINES).flatMap((entry)=>entry.terminalTitle?.statusPrefixes??[]))];function engineStatusPrefixes(vendor){let declared=engineEntry(vendor).terminalTitle?.statusPrefixes;return declared&&declared.length>0?declared:ALL_STATUS_PREFIXES}function stripEngineStatusPrefix(title,vendor){return stripStatusPrefix(title,vendor?engineStatusPrefixes(vendor):ALL_STATUS_PREFIXES)}function engineTitleTurnHint(vendor,title){return titleTurnHint(engineEntry(vendor).terminalTitle,title)}function engineSessionIdFromTitle(vendor,title){return titleSessionId(engineEntry(vendor).terminalTitle,title)}function isEnginePlaceholderTitle(title,vendor){return titleIsPlaceholder(engineEntry(vendor).terminalTitle,title)}function getCapabilities(vendor){return engineEntry(vendor).capabilities}function vendorsWithQuotaProbe(){return Object.values(BUILTIN_ENGINES).filter((entry)=>entry.quotaUsage).map((entry)=>entry.vendor)}function vendorsWithTurnReader(){return Object.values(BUILTIN_ENGINES).filter((entry)=>entry.readTurns).map((entry)=>entry.vendor)}function vendorsWithEffortLevels(){return Object.values(BUILTIN_ENGINES).filter((entry)=>(entry.effortLevels?.length??0)>0).map((entry)=>entry.vendor)}function createEngineHookAdapter(vendor){return engineEntry(vendor).createHookAdapter()}function activityHookAdapters(){return identifiableEngineIds().map((vendor)=>createEngineHookAdapter(vendor)).filter((adapter)=>adapter.supportsHooks())}class NoopHookAdapter{vendor;constructor(vendor){this.vendor=vendor}supportsHooks(){return!1}globalSettingsPath(){return""}activityDetailFromPayload(){return}sessionFromPayload(){return}async installActivityHooks(){return{ok:!0}}async removeActivityHooks(){}supportsWorktreeSync(){return!1}async removeWorktreeSyncHook(){}async removeWorktreeWatchHook(){}}
172
+ `)){lineNo++;let record=parseJsonLine(line);if(!record||!isCodexCompletionRecord(record))continue;let timestampMs=timestampFromRecord(record,0),marker={id:`codex:${sourceId}:${timestampMs}:${lineNo}`,timestampMs,source:"codex"};if(!latest||marker.timestampMs>=latest.timestampMs)latest=marker}return latest}function parseJsonLine(line){if(!isJsonlLineWithinBound(line))return null;let trimmed=line.trim();if(!trimmed)return null;try{let parsed=JSON.parse(trimmed);return isObject(parsed)?parsed:null}catch{return null}}function timestampFromRecord(record,fallback){let ts=typeof record.timestamp==="string"?Date.parse(record.timestamp):Number.NaN;return Number.isFinite(ts)?ts:fallback}var BUILTIN_ENGINES={claude:{vendor:"claude",builtin:!0,displayName:claudeIdentity.shortName,icon:CLAUDE_ICON,defaultCommand:["claude"],listModels:async()=>CLAUDE_MODELS,modelArgv:(base,model)=>[...base,"--model",model],addDirArgv:(base,dirs)=>[...base,...dirs.map((dir)=>`--add-dir=${dir}`)],effortLevels:["low","medium","high","xhigh","max"],effortArgv:(base,level)=>[...base,"--effort",level],foreignModel:isOpenAiFamilyModel,history:claudeHistoryReader,detectAccount:(deps)=>detectClaudeAccount(deps),createHookAdapter:()=>new ClaudeHookAdapter,skillsDir:()=>isRovePluginEnabled()?null:skillsDirUnder(vendorConfigHome("claude")),createTurnDetector:()=>new ClaudeTurnDetector,capabilities:claudeCapabilities,identity:claudeIdentity,trustWorktree:trustClaudeWorktree,terminalTitle:{ownsStatus:!0,statusPrefixes:["\u2733","\u2802","\u2810","\u25D0","\u25D1"],workingPrefixes:["\u2802","\u2810","\u25D0","\u25D1"]},sessionIdentity:{pinFlag:"--session-id",sessionControlFlags:["--session-id","--resume","-r","--continue","-c","--from-pr"],resumeArgv:(base,id)=>[...base,"--resume",id],forkArgv:(base,sourceId,newId)=>{let forked=[...base,"--resume",sourceId,"--fork-session"];return newId?[...forked,"--session-id",newId]:forked}},quotaUsage:()=>fetchClaudeQuotaUsage(),readTurns:readClaudeTurns},codex:{vendor:"codex",builtin:!0,displayName:codexIdentity.shortName,icon:CODEX_ICON,defaultCommand:["codex"],effortLevels:["none","low","medium","high","xhigh","max"],effortArgv:(base,level)=>[...base,"-c",`model_reasoning_effort=${level}`],listModels:async()=>CODEX_MODELS,modelArgv:(base,model)=>[...base,"--model",model],addDirArgv:(base,dirs)=>[...base,...dirs.map((dir)=>`--add-dir=${dir}`)],hostedStartArgv:(argv)=>{for(let i=1;i<argv.length;i++){let arg=argv[i];if(arg==="--")break;let config=arg==="-c"||arg==="--config"?argv[++i]:arg.startsWith("--config=")?arg.slice(9):arg.startsWith("-c")?arg.slice(2).replace(/^=/,""):void 0;if(config&&/^\s*check_for_update_on_startup\s*=/.test(config))return argv}return[...argv,"-c","check_for_update_on_startup=false"]},foreignModel:isClaudeFamilyModel,errorLine:/^\s*\u25A0\s+\S/,history:codexHistoryReader,detectAccount:(deps)=>detectCodexAccount(deps),createHookAdapter:()=>new CodexHookAdapter,skillsDir:()=>skillsDirUnder(vendorConfigHome("codex")),createTurnDetector:()=>new CodexTurnDetector,capabilities:codexCapabilities,identity:codexIdentity,trustWorktree:trustCodexWorktree,readTurns:readCodexTurns,terminalTitle:{ownsStatus:!0,launchArgs:["-c",'tui.terminal_title=["activity","thread-title"]'],statusPrefixes:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],workingPrefixes:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],sessionIdFromTitle:codexSessionIdFromTitle},sessionIdentity:{resumeArgv:(base,id)=>{let[bin,...rest]=base;return bin?[bin,"resume",...rest,id]:base},forkArgv:(base,sourceId)=>{let[bin,...rest]=base;return bin?[bin,"fork",...rest,sourceId]:null}},quotaUsage:()=>fetchCodexQuotaUsage()},bob:{vendor:"bob",builtin:!0,displayName:"IBM Bob",defaultCommand:["bob","chat","--trust"],firstMessageDelivery:"paste",history:bobHistoryReader,detectAccount:(deps)=>detectBobAccount(deps),trustWorktree:trustBobWorktree,createHookAdapter:()=>new NoopHookAdapter("bob"),skillsDir:()=>skillsDirUnder(bobHome()),createTurnDetector:()=>new UnknownTurnDetector("bob"),screenManifest:BOB_SCREEN_MANIFEST},copilot:{vendor:"copilot",builtin:!0,displayName:"Copilot",icon:COPILOT_ICON,defaultCommand:["copilot"],firstMessageArgv:(argv,text)=>[...argv,"-i",text],history:copilotHistoryReader,detectAccount:(deps)=>detectCopilotAccount(deps),createHookAdapter:()=>new CopilotHookAdapter,skillsDir:()=>skillsDirUnder(vendorConfigHome("copilot")),createTurnDetector:()=>new UnknownTurnDetector("copilot"),trustWorktree:trustCopilotWorktree,screenManifest:COPILOT_SCREEN_MANIFEST},kimi:{vendor:"kimi",builtin:!0,displayName:"Kimi",icon:KIMI_ICON,defaultCommand:["kimi"],firstMessageDelivery:"paste",processNames:["kimi-co"],modelArgv:(base,model)=>[...base,"--model",model],trustWorktree:trustKimiWorktree,history:kimiHistoryReader,detectAccount:(deps)=>detectKimiAccount(deps),createHookAdapter:()=>new KimiHookAdapter,skillsDir:()=>existsSync5(vendorConfigHome("kimi"))?join5(homedir7(),".agents","skills"):null,createTurnDetector:()=>new UnknownTurnDetector("kimi"),sessionIdentity:{sessionControlFlags:["-S","--session","-c","--continue"],resumeArgv:(base,id)=>[...base,"-S",id]},screenManifest:KIMI_SCREEN_MANIFEST},pi:{vendor:"pi",builtin:!0,displayName:piIdentity.shortName,defaultCommand:["pi"],effortLevels:["off","minimal","low","medium","high","xhigh","max"],effortArgv:(base,level)=>[...base,"--thinking",level],listModels:listPiModels,modelArgv:(base,model)=>[...base,"--model",model],history:piHistoryReader,createHookAdapter:()=>new PiFamilyHookAdapter("pi"),skillsDir:()=>skillsDirUnder(vendorAgentDir("pi")),createTurnDetector:()=>new UnknownTurnDetector("pi"),capabilities:piCapabilities,identity:piIdentity,trustWorktree:trustPiWorktree,terminalTitle:{ownsStatus:!1,statusPrefixes:PI_STATUS_PREFIXES},sessionIdentity:{pinFlag:"--session-id",sessionControlFlags:["--session-id","--session","-c","--continue","-r","--resume","--fork"],resumeArgv:(base,id)=>[...base,"--session",id],forkArgv:(base,sourceId)=>[...base,"--fork",sourceId]},screenManifest:PI_SCREEN_MANIFEST},omp:{vendor:"omp",builtin:!0,displayName:ompIdentity.shortName,icon:OMP_ICON,defaultCommand:["omp"],effortLevels:["off","minimal","low","medium","high","xhigh","max"],effortArgv:(base,level)=>[...base,"--thinking",level],listModels:listOmpModels,modelArgv:(base,model)=>[...base,`--model=${model}`],history:ompHistoryReader,createHookAdapter:()=>new PiFamilyHookAdapter("omp"),createTurnDetector:()=>new UnknownTurnDetector("omp"),capabilities:ompCapabilities,identity:ompIdentity,terminalTitle:{ownsStatus:!0,statusPrefixes:OMP_STATUS_PREFIXES,workingPrefixes:OMP_WORKING_PREFIXES,attentionPrefixes:OMP_ATTENTION_PREFIXES},sessionIdentity:{sessionControlFlags:["-c","--continue","-r","--resume"],resumeArgv:(base,id)=>[...base,"-r",id]},screenManifest:OMP_SCREEN_MANIFEST}};function stripStatusPrefix(title,prefixes){for(let prefix of[...prefixes].sort((a,b)=>b.length-a.length)){if(!title.startsWith(prefix))continue;let rest=title.slice(prefix.length).trimStart();if(rest.length===0)return title;return rest}return title}function titleTurnHint(config,title){let working=config?.workingPrefixes;if(config?.ownsStatus!==!0||!working||working.length===0)return null;let trimmed=title.trim();if(trimmed.length===0)return null;if(config.attentionPrefixes?.some((prefix)=>trimmed.startsWith(prefix)))return null;return working.some((prefix)=>trimmed.startsWith(prefix))?"working":"rest"}function titleSessionId(config,title){let trimmed=title.trim();if(!trimmed)return null;return config?.sessionIdFromTitle?.(trimmed)??null}function titleIsPlaceholder(config,title){return titleSessionId(config,title)!==null}function customEngineEntry(vendor){return{vendor,builtin:!1,displayName:vendor,defaultCommand:[vendor],history:EMPTY_HISTORY,createHookAdapter:()=>new NoopHookAdapter(vendor),createTurnDetector:()=>new UnknownTurnDetector(vendor)}}function engineEntry(vendor){if(isBuiltinVendor(vendor))return BUILTIN_ENGINES[vendor];let custom=customEngineEntry(vendor);return isContribEngine(vendor)?contribEngineEntry(vendor,custom):custom}function identifiableEngineIds(){return[...BUILTIN_VENDORS,...CONTRIB_ENGINE_IDS,...pluginEngineIds()]}function supportsStructuredHistory(vendor){return engineEntry(vendor).history.readHistory!==EMPTY_HISTORY.readHistory}var ALL_STATUS_PREFIXES=[...new Set(Object.values(BUILTIN_ENGINES).flatMap((entry)=>entry.terminalTitle?.statusPrefixes??[]))];function engineStatusPrefixes(vendor){let declared=engineEntry(vendor).terminalTitle?.statusPrefixes;return declared&&declared.length>0?declared:ALL_STATUS_PREFIXES}function stripEngineStatusPrefix(title,vendor){return stripStatusPrefix(title,vendor?engineStatusPrefixes(vendor):ALL_STATUS_PREFIXES)}function engineTitleTurnHint(vendor,title){return titleTurnHint(engineEntry(vendor).terminalTitle,title)}function engineSessionIdFromTitle(vendor,title){return titleSessionId(engineEntry(vendor).terminalTitle,title)}function isEnginePlaceholderTitle(title,vendor){return titleIsPlaceholder(engineEntry(vendor).terminalTitle,title)}function getCapabilities(vendor){return engineEntry(vendor).capabilities}function vendorsWithQuotaProbe(){return Object.values(BUILTIN_ENGINES).filter((entry)=>entry.quotaUsage).map((entry)=>entry.vendor)}function vendorsWithTurnReader(){return Object.values(BUILTIN_ENGINES).filter((entry)=>entry.readTurns).map((entry)=>entry.vendor)}function vendorsWithEffortLevels(){return Object.values(BUILTIN_ENGINES).filter((entry)=>(entry.effortLevels?.length??0)>0).map((entry)=>entry.vendor)}function createEngineHookAdapter(vendor){return engineEntry(vendor).createHookAdapter()}function activityHookAdapters(){return identifiableEngineIds().map((vendor)=>createEngineHookAdapter(vendor)).filter((adapter)=>adapter.supportsHooks())}class NoopHookAdapter{vendor;constructor(vendor){this.vendor=vendor}supportsHooks(){return!1}globalSettingsPath(){return""}activityDetailFromPayload(){return}sessionFromPayload(){return}async installActivityHooks(){return{ok:!0}}async removeActivityHooks(){}supportsWorktreeSync(){return!1}async removeWorktreeSyncHook(){}async removeWorktreeWatchHook(){}}
173
173
  export{realPathOrSelf,createEngineHookAdapter,activityHookAdapters,NoopHookAdapter,createEngineTurnDetector,engineEntry,identifiableEngineIds,supportsStructuredHistory,engineStatusPrefixes,stripEngineStatusPrefix,engineTitleTurnHint,engineSessionIdFromTitle,isEnginePlaceholderTitle,getCapabilities,vendorsWithQuotaProbe,vendorsWithTurnReader,vendorsWithEffortLevels};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{dedupeMachines,discoverMachine,ensureForwards,learnedFrom,listMachines,localDaemonSocketPath,localPtySocketPath,updateMachine}from"./chunk-mdfm45fx.js";import{DISPATCH_PROMPT_HEAD_CHARS,normalizeRemoteUrl,resolvePtyOwner}from"./chunk-vp29jgbt.js";import{taskEngineArgv}from"./chunk-0yfzh327.js";import{roveApiInvocation}from"./chunk-xry1y3yy.js";import{ApiError}from"./chunk-r5j8fycq.js";import{ptyScopeFor}from"./chunk-g9ba25q5.js";import{connectIfRunning}from"./chunk-72kf2e5c.js";import{RoveDaemonClient}from"./chunk-qq2mjph2.js";import{ROVE_API_VERSION}from"./chunk-96kvwzj8.js";import{getSavedRepos,isRemoteRepoKey}from"./chunk-rja9tf6j.js";import{errorMessage}from"./chunk-2brn8e1y.js";import{loadStateFile,updateStateFile}from"./chunk-32j6y5d1.js";import{ROVE_PRODUCT_NAME}from"./chunk-zt7wfnva.js";import{__require}from"./chunk-91sykzqq.js";import{hostname}from"os";async function ptyScopeOf(daemon,task){let listed=await daemon.request("task.list",{}).catch(()=>({tasks:[]})),scope=ptyScopeFor(listed.tasks,task.id);return task.ptyAlias?{...scope,alias:task.ptyAlias}:scope}async function recordSend(daemon,sent){let self=await ownSession(daemon).catch(()=>null);await daemon.request("dispatch.record",{taskId:sent.taskId,...sent.tabId?{tabId:sent.tabId}:{},promptHead:sent.prompt.slice(0,DISPATCH_PROMPT_HEAD_CHARS),delivered:sent.delivered,...sent.deliveryId?{deliveryId:sent.deliveryId}:{},...self?{fromTaskId:self.taskId,fromTabId:self.tabId}:{}}).catch(()=>{})}var selfSessionOnce,identityWarning=null;async function realProbe(){let[{openPtyHost,listSessions},{psSnapshot}]=await Promise.all([import("./chunk-wc934cjj.js"),import("./chunk-k0zv202b.js")]);return{sessions:async()=>{let host=await openPtyHost();if(!host)return[];try{return await listSessions(host.rpc)}finally{host.close()}},ps:psSnapshot,pid:process.pid}}async function verifiedSelfSession(env=process.env,probe){if(!probe&&selfSessionOnce)return selfSessionOnce;let run=resolveSelfSession(env,probe);return selfSessionOnce=run,run}async function resolveSelfSession(env,probe){let taskId=env.ROVE_TASK_ID;if(!taskId)return null;let tabId=env.ROVE_TAB_ID||"tab-1";try{let p=probe??await realProbe(),key=`${taskId}::${tabId}`,session=(await p.sessions()).find((s)=>s.key===key&&s.alive);if(session?.pid){let{hasAncestor,parsePsSnapshot}=await import("./chunk-k0zv202b.js");if(hasAncestor(parsePsSnapshot(await p.ps([session.pid,p.pid])),p.pid,session.pid))return identityWarning=null,{taskId,tabId}}}catch{}return identityWarning=`$ROVE_TASK_ID/$ROVE_TASK_ID names task ${taskId} ${tabId}, but this process is not running inside that tab (an inherited env, not an identity) \u2014 dispatcher/peer provenance omitted`,null}function takeIdentityWarning(){let warning=identityWarning;return identityWarning=null,warning}async function ownSession(daemon,env=process.env,probe){let self=await verifiedSelfSession(env,probe);if(!self)return null;let listed=await daemon.request("task.list",{}).catch(()=>({tasks:[]}));return{...self,taskId:resolvePtyOwner(listed.tasks,self.taskId,self.tabId)}}async function dispatcherEnvPayload(daemon,env=process.env,probe){let self=await ownSession(daemon,env,probe);if(!self)return{};return{dispatcherTaskId:self.taskId,dispatcherTabId:self.tabId}}async function readOwnDispatcher(daemon){let self=await ownSession(daemon);if(!self)return null;try{return(await daemon.request("task.get",{taskId:self.taskId})).task.dispatcher??null}catch{return null}}async function resolveDispatcherTab(runtime,daemon,dispatcher){let task=await daemon.request("task.get",{taskId:dispatcher.taskId}).then((res)=>res.task).catch(()=>null),{tabs,running}=await runtime.taskTabs(dispatcher.taskId,void 0,task?await ptyScopeOf(daemon,task):void 0);if(tabs.some((t)=>t.id===dispatcher.tabId&&t.alive))return dispatcher.tabId;if(running)return;throw new ApiError(`dispatcher tab ${dispatcher.tabId} on task ${dispatcher.taskId} is dead and the task has no live engine tab \u2014 the reply has nowhere to land`,"DISPATCHER_UNREACHABLE",{dispatcher,hint:`address an alive target explicitly with --task-id/--tab (see \`${ROVE_PRODUCT_NAME} api pty-list\`), or notify the user with \`${ROVE_PRODUCT_NAME} api notify\``,nextCommandArgs:["api","pty-list"]})}async function replyTabOf(runtime,daemon,taskId){let self=await ownSession(daemon);if(self?.taskId===taskId)return self.tabId;let task=await daemon.request("task.get",{taskId}).then((res)=>res.task).catch(()=>null);if(!task)return;let{tabs}=await runtime.taskTabs(taskId,taskEngineArgv(task),await ptyScopeOf(daemon,task));return tabs.find((t)=>t.kind==="engine"&&t.alive===!0&&t.engineAlive!==!1)?.id}async function withPeerProvenance(daemon,targetTaskId,prompt){let self=await ownSession(daemon),senderId=self?.taskId;if(!self||!senderId||senderId===targetTaskId)return prompt;let label=senderId;try{let res=await daemon.request("task.get",{taskId:senderId});label=res.task.title||res.task.branch||senderId}catch{}let api=roveApiInvocation(),replyTarget=`--task-id ${senderId} --tab ${self.tabId}`;return`[ROVE PEER] from "${label}" (task ${senderId} \u2014 Rove agent skill /rove, read it once per session; reply only if it changes what I do next: \`${api} send ${replyTarget} --prompt "<text>"\`)
2
+ import{dedupeMachines,discoverMachine,ensureForwards,learnedFrom,listMachines,localDaemonSocketPath,localPtySocketPath,updateMachine}from"./chunk-mdfm45fx.js";import{DISPATCH_PROMPT_HEAD_CHARS,normalizeRemoteUrl,resolvePtyOwner}from"./chunk-vp29jgbt.js";import{taskEngineArgv}from"./chunk-ehgj2pes.js";import{roveApiInvocation}from"./chunk-0z3s4cwg.js";import{ApiError}from"./chunk-r5j8fycq.js";import{ptyScopeFor}from"./chunk-g9ba25q5.js";import{connectIfRunning}from"./chunk-72kf2e5c.js";import{RoveDaemonClient}from"./chunk-qq2mjph2.js";import{ROVE_API_VERSION}from"./chunk-96kvwzj8.js";import{getSavedRepos,isRemoteRepoKey}from"./chunk-rja9tf6j.js";import{errorMessage}from"./chunk-2brn8e1y.js";import{loadStateFile,updateStateFile}from"./chunk-32j6y5d1.js";import{ROVE_PRODUCT_NAME}from"./chunk-zt7wfnva.js";import{__require}from"./chunk-91sykzqq.js";import{hostname}from"os";async function ptyScopeOf(daemon,task){let listed=await daemon.request("task.list",{}).catch(()=>({tasks:[]})),scope=ptyScopeFor(listed.tasks,task.id);return task.ptyAlias?{...scope,alias:task.ptyAlias}:scope}async function recordSend(daemon,sent){let self=await ownSession(daemon).catch(()=>null);await daemon.request("dispatch.record",{taskId:sent.taskId,...sent.tabId?{tabId:sent.tabId}:{},promptHead:sent.prompt.slice(0,DISPATCH_PROMPT_HEAD_CHARS),delivered:sent.delivered,...sent.deliveryId?{deliveryId:sent.deliveryId}:{},...self?{fromTaskId:self.taskId,fromTabId:self.tabId}:{}}).catch(()=>{})}var selfSessionOnce,identityWarning=null;async function realProbe(){let[{openPtyHost,listSessions},{psSnapshot}]=await Promise.all([import("./chunk-rr7m867n.js"),import("./chunk-214pxfh3.js")]);return{sessions:async()=>{let host=await openPtyHost();if(!host)return[];try{return await listSessions(host.rpc)}finally{host.close()}},ps:psSnapshot,pid:process.pid}}async function verifiedSelfSession(env=process.env,probe){if(!probe&&selfSessionOnce)return selfSessionOnce;let run=resolveSelfSession(env,probe);return selfSessionOnce=run,run}async function resolveSelfSession(env,probe){let taskId=env.ROVE_TASK_ID;if(!taskId)return null;let tabId=env.ROVE_TAB_ID||"tab-1";try{let p=probe??await realProbe(),key=`${taskId}::${tabId}`,session=(await p.sessions()).find((s)=>s.key===key&&s.alive);if(session?.pid){let{hasAncestor,parsePsSnapshot}=await import("./chunk-214pxfh3.js");if(hasAncestor(parsePsSnapshot(await p.ps([session.pid,p.pid])),p.pid,session.pid))return identityWarning=null,{taskId,tabId}}}catch{}return identityWarning=`$ROVE_TASK_ID/$ROVE_TASK_ID names task ${taskId} ${tabId}, but this process is not running inside that tab (an inherited env, not an identity) \u2014 dispatcher/peer provenance omitted`,null}function takeIdentityWarning(){let warning=identityWarning;return identityWarning=null,warning}async function ownSession(daemon,env=process.env,probe){let self=await verifiedSelfSession(env,probe);if(!self)return null;let listed=await daemon.request("task.list",{}).catch(()=>({tasks:[]}));return{...self,taskId:resolvePtyOwner(listed.tasks,self.taskId,self.tabId)}}async function dispatcherEnvPayload(daemon,env=process.env,probe){let self=await ownSession(daemon,env,probe);if(!self)return{};return{dispatcherTaskId:self.taskId,dispatcherTabId:self.tabId}}async function readOwnDispatcher(daemon){let self=await ownSession(daemon);if(!self)return null;try{return(await daemon.request("task.get",{taskId:self.taskId})).task.dispatcher??null}catch{return null}}async function resolveDispatcherTab(runtime,daemon,dispatcher){let task=await daemon.request("task.get",{taskId:dispatcher.taskId}).then((res)=>res.task).catch(()=>null),{tabs,running}=await runtime.taskTabs(dispatcher.taskId,void 0,task?await ptyScopeOf(daemon,task):void 0);if(tabs.some((t)=>t.id===dispatcher.tabId&&t.alive))return dispatcher.tabId;if(running)return;throw new ApiError(`dispatcher tab ${dispatcher.tabId} on task ${dispatcher.taskId} is dead and the task has no live engine tab \u2014 the reply has nowhere to land`,"DISPATCHER_UNREACHABLE",{dispatcher,hint:`address an alive target explicitly with --task-id/--tab (see \`${ROVE_PRODUCT_NAME} api pty-list\`), or notify the user with \`${ROVE_PRODUCT_NAME} api notify\``,nextCommandArgs:["api","pty-list"]})}async function replyTabOf(runtime,daemon,taskId){let self=await ownSession(daemon);if(self?.taskId===taskId)return self.tabId;let task=await daemon.request("task.get",{taskId}).then((res)=>res.task).catch(()=>null);if(!task)return;let{tabs}=await runtime.taskTabs(taskId,taskEngineArgv(task),await ptyScopeOf(daemon,task));return tabs.find((t)=>t.kind==="engine"&&t.alive===!0&&t.engineAlive!==!1)?.id}async function withPeerProvenance(daemon,targetTaskId,prompt){let self=await ownSession(daemon),senderId=self?.taskId;if(!self||!senderId||senderId===targetTaskId)return prompt;let label=senderId;try{let res=await daemon.request("task.get",{taskId:senderId});label=res.task.title||res.task.branch||senderId}catch{}let api=roveApiInvocation(),replyTarget=`--task-id ${senderId} --tab ${self.tabId}`;return`[ROVE PEER] from "${label}" (task ${senderId} \u2014 Rove agent skill /rove, read it once per session; reply only if it changes what I do next: \`${api} send ${replyTarget} --prompt "<text>"\`)
3
3
 
4
4
  ${prompt}`}import{spawnSync}from"child_process";import{existsSync}from"fs";import{join}from"path";function git(cwd,args){let res=spawnSync("git",["-C",cwd,...args],{encoding:"utf8",timeout:5000});return res.status===0?res.stdout.trim():null}function repoIdentity(path){if(!existsSync(path)||git(path,["rev-parse","--git-dir"])===null)return null;let origin=git(path,["remote","get-url","origin"]),root=git(path,["rev-list","--max-parents=0","HEAD"])?.split(`
5
5
  `).filter(Boolean).sort()[0];return{...origin?{origin:normalizeRemoteUrl(origin)}:{},...root?{root}:{}}}function isLocalCheckout(path){return existsSync(join(path,".git"))||existsSync(path)&&git(path,["rev-parse","--git-dir"])!==null}function unpushedCommits(path,ref){if(git(path,["rev-parse","--verify","--quiet",`${ref}^{commit}`])===null)return null;let ahead=git(path,["rev-list","--count",`${ref}@{upstream}..${ref}`]);if(ahead!==null)return Number.parseInt(ahead,10)||0;let lone=git(path,["rev-list","--count",ref,"--not","--remotes"]);return lone===null?null:Number.parseInt(lone,10)||0}import{spawnSync as spawnSync2}from"child_process";import{existsSync as existsSync2,mkdirSync}from"fs";import{homedir}from"os";import{dirname,isAbsolute,join as join2,resolve}from"path";var URL_LIKE=/^[a-z][a-z0-9+.-]*:\/\//i,SCP_LIKE=/^[^@/\s]+@[^:/\s]+:[^\s]+$/,SEGMENT=/^[A-Za-z0-9_.-]+$/;function parseRepoRef(raw,cwd=process.cwd(),exists=existsSync2){let value=raw.trim(),asPath={kind:"path",path:value};if(value===""||isRemoteRepoKey(value))return asPath;if(URL_LIKE.test(value)||SCP_LIKE.test(value))return{kind:"id",id:normalizeRemoteUrl(value),cloneUrl:value};if(isAbsolute(value)||/^[A-Za-z]:[\\/]/.test(value)||/^[~.\\]/.test(value))return asPath;if(exists(resolve(cwd,value)))return asPath;let parts=value.replace(/\.git$/i,"").split("/");if(!parts.every((p)=>SEGMENT.test(p)))return asPath;if(parts.length===2){let id=`github.com/${parts.join("/")}`.toLowerCase();return{kind:"id",id,cloneUrl:`https://${id}.git`}}if(parts.length>=3&&parts[0]?.includes(".")){let id=parts.join("/").toLowerCase();return{kind:"id",id,cloneUrl:`https://${id}.git`}}return asPath}function repoIdOf(identity){if(!identity)return null;if(identity.origin)return identity.origin;return identity.root?`root:${identity.root}`:null}function findCheckouts(want,candidates){let out=[];for(let c of candidates){let sameRoot=Boolean(want.root&&c.identity.root===want.root),sameOrigin=Boolean(want.origin&&c.identity.origin===want.origin);if(!sameRoot&&!sameOrigin)continue;let fork=sameRoot&&!sameOrigin&&Boolean(want.origin&&c.identity.origin);out.push({path:c.path,via:sameRoot?"root":"origin",fork})}return out}function pickCheckout(matches,opts){let usable=matches.filter((m)=>opts.allowFork||!m.fork);if(usable.length===0){let fork=matches.find((m)=>m.fork)?.path;return fork?{path:null,fork}:{path:null}}let primary=usable.find((m)=>m.path===opts.primary);if(primary)return{path:primary.path};if(usable.length>1&&opts.isClean){let clean=usable.find((m)=>opts.isClean?.(m.path));if(clean)return{path:clean.path}}return{path:usable[0]?.path??null}}function isCleanCheckout(path){let res=spawnSync2("git",["-C",path,"status","--porcelain","--untracked-files=no"],{encoding:"utf8",timeout:5000});return res.status===0&&res.stdout.trim()===""}var REPO_PRIMARY_KEY="repoPrimary";function primaryCheckouts(state=loadStateFile()){let raw=state[REPO_PRIMARY_KEY],out={};if(raw&&typeof raw==="object"){for(let[id,path]of Object.entries(raw))if(typeof path==="string")out[id]=path}return out}function setPrimaryCheckout(id,path){updateStateFile((state)=>{let next=primaryCheckouts(state);if(path===null)Reflect.deleteProperty(next,id);else next[id]=path;return state[REPO_PRIMARY_KEY]=next,!0})}function cloneDirFor(id,home=homedir()){return join2(home,".rove","repos",...id.split("/"))}function cloneRepo(ref,home){let dir=cloneDirFor(ref.id,home);if(repoIdentity(dir))return dir;mkdirSync(dirname(dir),{recursive:!0});let res=spawnSync2("git",["clone",ref.cloneUrl,dir],{encoding:"utf8",timeout:600000,env:{...process.env,GIT_TERMINAL_PROMPT:"0"}});if(res.status!==0)throw Error((res.stderr||res.stdout||"git clone failed").trim());return dir}var LOCAL_MACHINE="local";async function machineDaemonSocket(entry){let socketPath=localDaemonSocketPath(entry.alias);if(await answers(socketPath))return socketPath;if(!entry.sockets||!await forward(entry,entry.sockets))return null;if(await answers(socketPath))return socketPath;let found=await discoverMachine(entry.alias,entry);if(!found.ok)return null;let learned=learnedFrom(found);return updateMachine(entry.alias,learned),await forward({...entry,...learned},learned.sockets)&&await answers(socketPath)?socketPath:null}function forward(entry,sockets){return ensureForwards({alias:entry.alias,config:{...entry,sockets},remoteDaemonSocket:sockets.daemon,remotePtySocket:sockets.pty})}async function answers(socketPath){let client=new RoveDaemonClient(socketPath);try{return await client.request("hello",{}),!0}catch{return!1}finally{client.close()}}async function machineTasks(entry){let socketPath=await machineDaemonSocket(entry);if(!socketPath)return null;let client=new RoveDaemonClient(socketPath);try{return(await client.request("task.list")).tasks??[]}catch{return null}finally{client.close()}}function requireMachine(alias){let entry=listMachines().find((m)=>m.alias===alias);if(entry)return entry;throw new ApiError(`no machine named "${alias}"`,"UNKNOWN_MACHINE",{hint:"list the registered machines and retry with one of their aliases, or register it first",nextCommandArgs:["machine","list"]})}var AUTO_MACHINE="auto",busy=(tasks)=>tasks.filter((task)=>task.status==="in_progress").length;async function pickMachine(localTasks,readTasks=machineTasks,machines=dedupeMachines(listMachines()),hosts){let[local,...remote]=await Promise.all([localTasks().catch(()=>[]),...machines.map((entry)=>readTasks(entry))]),loads={[LOCAL_MACHINE]:busy(local)};machines.forEach((entry,i)=>{let tasks=remote[i];if(tasks)loads[entry.alias]=busy(tasks)});let pool=[null,...machines.filter((entry)=>loads[entry.alias]!==void 0)],skipped;if(hosts){let ok=await Promise.all(pool.map((entry)=>hosts(entry).catch(()=>!1)));if(ok.some(Boolean))skipped=pool.filter((_,i)=>!ok[i]).map((entry)=>entry?.alias??LOCAL_MACHINE),pool=pool.filter((_,i)=>ok[i])}let best=null,bestLoad=Number.POSITIVE_INFINITY;for(let entry of pool){let load=loads[entry?.alias??LOCAL_MACHINE]??0;if(load<bestLoad)best=entry,bestLoad=load}return{entry:best,loads,...skipped?{skipped}:{}}}function repoWanted(repo){if(typeof repo!=="string")return null;let ref=parseRepoRef(repo);if(ref.kind==="id")return{origin:ref.id};return isLocalCheckout(ref.path)?repoIdentity(ref.path):null}function repoHosts(params){if(flagOn(params.clone))return;let want=repoWanted(params.repo);if(!want||!want.origin&&!want.root)return;return async(entry)=>{if(entry===null){if(typeof params.repo==="string"&&parseRepoRef(params.repo).kind==="path")return!0;return getSavedRepos().some((path)=>findCheckouts(want,[{path,identity:repoIdentity(path)??{}}]).length)}let socket=await machineDaemonSocket(entry);if(!socket)return!1;let client=new RoveDaemonClient(socket);try{let res=await client.request("api.invoke",{verb:"repo-match",params:{...want.origin?{origin:want.origin}:{},...want.root?{root:want.root}:{}},forwarded:!0,from:hostname()});return res.ok&&Boolean(res.result.repo)}finally{client.close()}}}async function routeTarget(args){if(args.machine===AUTO_MACHINE){let hosts=args.params?repoHosts(args.params):void 0;return(await pickMachine(args.localTasks??(async()=>[]),machineTasks,void 0,hosts)).entry}if(args.machine!==void 0&&args.machine!==LOCAL_MACHINE)return requireMachine(args.machine);if(args.machine===LOCAL_MACHINE||!args.taskId)return null;let machines=dedupeMachines(listMachines());if(machines.length===0||await args.isLocalTask(args.taskId))return null;for(let entry of machines)if((await machineTasks(entry))?.some((task)=>task.id===args.taskId))return entry;return null}async function forwardVerb(entry,verb,params,socketPath){let target=socketPath??await machineDaemonSocket(entry);if(!target)return offline(entry.alias);let client=new RoveDaemonClient(target);try{let repo=await translateRepo(client,entry.alias,params);if(repo.failure)return repo.failure;if(verb==="land"&&params["dry-run"]===void 0){let published=await client.request("api.invoke",{verb:"publish",params:{"task-id":params["task-id"]},forwarded:!0,from:hostname()});if(published.ok||published.error.code!=="UNKNOWN_VERB")return published}let envelope=await client.request("api.invoke",{verb,params:repo.params,forwarded:!0,from:hostname()});return await recordHere(verb,params,envelope),envelope}catch(err){let message=errorMessage(err);if(/unknown daemon request:/i.test(message))return tooOld(entry.alias);return failure("MACHINE_UNREACHABLE",`machine "${entry.alias}": ${message}`,{hint:"check the machine is up and reachable over ssh, then retry",nextCommandArgs:["machine","list"]})}finally{client.close()}}async function recordHere(verb,params,envelope){if(verb!=="send"&&verb!=="dispatch"||!envelope.ok||typeof params.prompt!=="string")return;let sent=envelope.result,taskId=typeof sent.childTaskId==="string"?sent.childTaskId:sent.taskId;if(typeof taskId!=="string")return;let tabId=typeof sent.tabId==="string"?sent.tabId:typeof sent.session==="string"?sent.session.split("::")[1]:void 0,local=await connectIfRunning().catch(()=>null);if(!local)return;try{await recordSend(local,{taskId,...tabId?{tabId}:{},prompt:params.prompt,delivered:sent.delivered===!0})}finally{local.close()}}async function translateRepo(client,alias,params){let repo=params.repo;if(typeof repo!=="string")return{params};let ref=parseRepoRef(repo),local=ref.kind==="path"&&isLocalCheckout(ref.path);if(ref.kind==="path"&&!local)return{params};let identity=ref.kind==="id"?{origin:ref.id}:repoIdentity(repo);if(!identity?.origin&&!identity?.root)return{params};let allowFork=flagOn(params["allow-fork"]),ask=await client.request("api.invoke",{verb:"repo-match",params:{...identity.origin?{origin:identity.origin}:{},...identity.root?{root:identity.root}:{},...allowFork?{"allow-fork":!0}:{}},forwarded:!0,from:hostname()});if(!ask.ok)return ask.error.code==="UNKNOWN_VERB"?{params}:{failure:ask};let answer=ask.result,found=answer.repo;if(found){let base=params["base-branch"],unpushed=local&&typeof base==="string"?unpushedCommits(repo,base):null;if(typeof base==="string"&&unpushed)return{failure:failure("UNPUSHED_BASE",`${base} has ${unpushed} commit${unpushed===1?"":"s"} no remote has; ${alias} cannot base a task on it`,{hint:`push it first (\`git -C ${repo} push -u origin ${base}\`), then dispatch again`})};return{params:{...params,repo:found}}}if(answer.fork)return{failure:failure("FORK_MATCH",`machine "${alias}" only has ${answer.fork}, a fork of ${identity.origin??repo} (same history, other origin)`,{hint:"pass --allow-fork to use it, or --clone with the repo id to fetch the repo itself there"})};if(flagOn(params.clone)&&identity.origin)return{params:{...params,repo:ref.kind==="id"?repo:identity.origin}};return{failure:failure("NO_REMOTE_CHECKOUT",`machine "${alias}" has no checkout of ${identity.origin??repo}`,{hint:identity.origin?`pass --clone to clone it on ${alias}, or --repo with ${alias}'s own path`:`clone it on ${alias} (and open it there once so Rove knows it), or pass --repo with ${alias}'s own path`})}}var flagOn=(value)=>value===!0||value==="true";function offline(alias){return failure("MACHINE_UNREACHABLE",`machine "${alias}" did not answer`,{hint:`check \`ssh ${alias} true\` works without a prompt, then retry`,nextCommandArgs:["machine","list"]})}function tooOld(alias){return failure("MACHINE_VERSION_SKEW",`machine "${alias}" runs a Rove too old to accept forwarded verbs`,{hint:`upgrade Rove on ${alias} (\`rove update\` there), then retry`})}function failure(code,message,data){return{apiVersion:ROVE_API_VERSION,ok:!1,error:{message,code,...data}}}async function invokeRouted(args){if(args.forwarded)return args.runHere();let taskId=args.params["task-id"],target;try{target=await routeTarget({machine:args.machine,taskId:typeof taskId==="string"?taskId:void 0,isLocalTask:args.isLocalTask,...args.localTasks?{localTasks:args.localTasks}:{},params:args.params})}catch(err){if(!(err instanceof ApiError))throw err;return failure(err.code,err.message,err.data??{})}return target?forwardVerb(target,args.verb,args.params):args.runHere()}async function machinePtySocket(alias){let entry=requireMachine(alias);if(!await machineDaemonSocket(entry))throw new ApiError(`machine "${alias}" did not answer`,"MACHINE_UNREACHABLE");return localPtySocketPath(alias)}