@sma1lboy/rove 0.9.154 → 0.9.156

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 (145) hide show
  1. package/dist/cli/chunk-0fhab4tq.js +2 -0
  2. package/dist/cli/{chunk-79gqh5p2.js → chunk-0wnfq5sx.js} +1 -1
  3. package/dist/cli/{chunk-pxtx1gcf.js → chunk-1aqmmea7.js} +1 -1
  4. package/dist/cli/{chunk-9zb2wkfr.js → chunk-25hxhtdr.js} +1 -1
  5. package/dist/cli/{chunk-aedrswty.js → chunk-2ernbaey.js} +3 -3
  6. package/dist/cli/{chunk-73qrq7bg.js → chunk-32h9htyh.js} +1 -1
  7. package/dist/cli/{chunk-d393z1mj.js → chunk-38272eqv.js} +1 -1
  8. package/dist/cli/chunk-39x1ztey.js +4 -0
  9. package/dist/cli/{chunk-s8eh3cf1.js → chunk-3wj69b0a.js} +1 -1
  10. package/dist/cli/{chunk-94z64m9x.js → chunk-3xcz7mz7.js} +2 -2
  11. package/dist/cli/{chunk-5wzap7r2.js → chunk-41ahvk51.js} +1 -1
  12. package/dist/cli/{chunk-5bn91n19.js → chunk-4502n1bk.js} +1 -1
  13. package/dist/cli/{chunk-8kvyjb4p.js → chunk-45p9xh44.js} +1 -1
  14. package/dist/cli/{chunk-183ptzzh.js → chunk-4a37bmpm.js} +1 -1
  15. package/dist/cli/{chunk-7z9cqycv.js → chunk-4gjr08g0.js} +1 -1
  16. package/dist/cli/chunk-4pmd0mxp.js +4 -0
  17. package/dist/cli/{chunk-ke95ebrz.js → chunk-5f80ggc3.js} +1 -1
  18. package/dist/cli/{chunk-rsqx358z.js → chunk-5v893waj.js} +1 -1
  19. package/dist/cli/{chunk-8gsqypg8.js → chunk-6123622n.js} +2 -2
  20. package/dist/cli/{chunk-4exg1101.js → chunk-667hcm3g.js} +2 -2
  21. package/dist/cli/{chunk-43n38xv5.js → chunk-6bbj9axg.js} +2 -2
  22. package/dist/cli/{chunk-5snrwe65.js → chunk-6pt23vas.js} +1 -1
  23. package/dist/cli/{chunk-3ztek08w.js → chunk-7j5372wb.js} +1 -1
  24. package/dist/cli/chunk-7ntf5hdf.js +15 -0
  25. package/dist/cli/chunk-7x88845e.js +2 -0
  26. package/dist/cli/{chunk-h3hw5vpc.js → chunk-88vvd6qz.js} +1 -1
  27. package/dist/cli/chunk-8kaqpb7t.js +2 -0
  28. package/dist/cli/chunk-8kj2s16b.js +7 -0
  29. package/dist/cli/{chunk-mb5m7ex7.js → chunk-91f68r6e.js} +1 -1
  30. package/dist/cli/{chunk-55xkvzvw.js → chunk-98zhyhpz.js} +1 -1
  31. package/dist/cli/{chunk-j5bmtpkc.js → chunk-9g7hamhv.js} +1 -1
  32. package/dist/cli/{chunk-y9ksfpbp.js → chunk-9xt05etk.js} +1 -1
  33. package/dist/cli/{chunk-8qb8kksk.js → chunk-9ypg30c1.js} +1 -1
  34. package/dist/cli/{chunk-gc25wht3.js → chunk-aak5ttgt.js} +1 -1
  35. package/dist/cli/{chunk-nywh3yb9.js → chunk-axfn4f28.js} +1 -1
  36. package/dist/cli/{chunk-8r1pnch1.js → chunk-bwyskwer.js} +1 -1
  37. package/dist/cli/{chunk-51y7sjhe.js → chunk-c43g3qcb.js} +1 -1
  38. package/dist/cli/chunk-caqpt09m.js +3 -0
  39. package/dist/cli/{chunk-07k2njwk.js → chunk-ch9b1d5y.js} +1 -1
  40. package/dist/cli/{chunk-mf7xghwj.js → chunk-cqaxnve9.js} +1 -1
  41. package/dist/cli/chunk-d2p1za6y.js +2 -0
  42. package/dist/cli/{chunk-rrzepm47.js → chunk-d57awd05.js} +2 -2
  43. package/dist/cli/{chunk-2z90jxcn.js → chunk-de751t37.js} +1 -1
  44. package/dist/cli/chunk-dmdpsw2y.js +2 -0
  45. package/dist/cli/{chunk-37gnmm2m.js → chunk-ds9qf1w1.js} +1 -1
  46. package/dist/cli/{chunk-703edkrq.js → chunk-dwbtszh0.js} +1 -1
  47. package/dist/cli/chunk-dzd1wy5a.js +2 -0
  48. package/dist/cli/{chunk-svpn3av1.js → chunk-e17gszac.js} +1 -1
  49. package/dist/cli/{chunk-es2agvre.js → chunk-e9cpb5jt.js} +15 -14
  50. package/dist/cli/{chunk-8ad0ba2n.js → chunk-esk240e5.js} +2 -2
  51. package/dist/cli/{chunk-yshnare4.js → chunk-exggdhpt.js} +1 -1
  52. package/dist/cli/chunk-fd2zhddn.js +3 -0
  53. package/dist/cli/{chunk-tt0fde40.js → chunk-fm5s7njg.js} +1 -1
  54. package/dist/cli/{chunk-cb2fpajx.js → chunk-g56kvet6.js} +1 -1
  55. package/dist/cli/{chunk-z83wxkg6.js → chunk-g90z5s39.js} +2 -2
  56. package/dist/cli/{chunk-9gz7jmgq.js → chunk-gkfd073t.js} +1 -1
  57. package/dist/cli/chunk-hj08heah.js +10 -0
  58. package/dist/cli/{chunk-rgnnq8wk.js → chunk-j20cerws.js} +1 -1
  59. package/dist/cli/{chunk-grh6dvfv.js → chunk-k2ckx8zw.js} +1 -1
  60. package/dist/cli/{chunk-c6mthex1.js → chunk-ksbvcxc3.js} +1 -1
  61. package/dist/cli/{chunk-deejtpcr.js → chunk-kt1ppyje.js} +1 -1
  62. package/dist/cli/{chunk-fg38d91k.js → chunk-m45w6v9d.js} +4 -4
  63. package/dist/cli/{chunk-vpzvcxc1.js → chunk-max057d8.js} +1 -1
  64. package/dist/cli/{chunk-1a7ctg07.js → chunk-mbvk5758.js} +1 -1
  65. package/dist/cli/chunk-mcdv19rs.js +3 -0
  66. package/dist/cli/{chunk-xhn25xaa.js → chunk-me2752c0.js} +1 -1
  67. package/dist/cli/chunk-mhs6yywx.js +2 -0
  68. package/dist/cli/{chunk-ffgb1a1n.js → chunk-mhzv94cg.js} +1 -1
  69. package/dist/cli/{chunk-z4c6bmw0.js → chunk-mkkp4c5t.js} +2 -2
  70. package/dist/cli/{chunk-kwe61yx7.js → chunk-mnqxgvyb.js} +1 -1
  71. package/dist/cli/{chunk-d809qqsk.js → chunk-mp8v5gn8.js} +1 -1
  72. package/dist/cli/chunk-mqnr4p48.js +2 -0
  73. package/dist/cli/{chunk-4wwx51m5.js → chunk-mqqnk8w7.js} +1 -1
  74. package/dist/cli/{chunk-4tzgma89.js → chunk-msr1xtay.js} +1 -1
  75. package/dist/cli/{chunk-86bjqmg1.js → chunk-n4nntq73.js} +1 -1
  76. package/dist/cli/{chunk-g5nz190n.js → chunk-n7n12868.js} +1 -1
  77. package/dist/cli/{chunk-btadstee.js → chunk-n80h9k0r.js} +1 -1
  78. package/dist/cli/chunk-ngnrz33z.js +3 -0
  79. package/dist/cli/{chunk-pdh5w4ht.js → chunk-nm0pq5r6.js} +1 -1
  80. package/dist/cli/{chunk-p1d3ag8b.js → chunk-nss70xwr.js} +1 -1
  81. package/dist/cli/{chunk-v9p6gxm0.js → chunk-ntt7gy5a.js} +1 -1
  82. package/dist/cli/chunk-nx7ahbsg.js +2 -0
  83. package/dist/cli/{chunk-yk2ha5yj.js → chunk-nyv7a76k.js} +1 -1
  84. package/dist/cli/{chunk-ef11h2am.js → chunk-p7s4xwgx.js} +1 -1
  85. package/dist/cli/{chunk-rkt1qjec.js → chunk-ptjc5mtc.js} +1 -1
  86. package/dist/cli/{chunk-4y2vsnhs.js → chunk-qch6g9za.js} +2 -2
  87. package/dist/cli/chunk-r05r01nv.js +3 -0
  88. package/dist/cli/{chunk-dp3rdb1p.js → chunk-r0z1bhjg.js} +1 -1
  89. package/dist/cli/{chunk-3bfm4hrs.js → chunk-r3k9rbwm.js} +1 -1
  90. package/dist/cli/chunk-r639wna1.js +2 -0
  91. package/dist/cli/chunk-rc668r26.js +2 -0
  92. package/dist/cli/{chunk-ea1r26pa.js → chunk-sfv15era.js} +1 -1
  93. package/dist/cli/chunk-sram9jmt.js +2 -0
  94. package/dist/cli/{chunk-92vsj4mv.js → chunk-svg7ee0z.js} +1 -1
  95. package/dist/cli/{chunk-z1e1bsv5.js → chunk-t27t2x9b.js} +1 -1
  96. package/dist/cli/{chunk-c1xp9qx6.js → chunk-t3z4etp5.js} +1 -1
  97. package/dist/cli/{chunk-mmd7zehs.js → chunk-t7xhb2jx.js} +1 -1
  98. package/dist/cli/chunk-t90vnrpk.js +2 -0
  99. package/dist/cli/{chunk-a4h476hv.js → chunk-vj2vdx3w.js} +1 -1
  100. package/dist/cli/chunk-wbt845s6.js +4 -0
  101. package/dist/cli/{chunk-e8493db0.js → chunk-wdhcrcre.js} +1 -1
  102. package/dist/cli/{chunk-k1tm3bys.js → chunk-we0gedwp.js} +1 -1
  103. package/dist/cli/{chunk-g6ww85sh.js → chunk-ybcacmqv.js} +1 -1
  104. package/dist/cli/{chunk-h5jhdjv7.js → chunk-yfy6031g.js} +1 -1
  105. package/dist/cli/{chunk-ewdhz3dv.js → chunk-yhwb91e4.js} +1 -1
  106. package/dist/cli/chunk-yqvrr5kt.js +2 -0
  107. package/dist/cli/{chunk-r8mk1aw4.js → chunk-ywtsabyg.js} +1 -1
  108. package/dist/cli/{chunk-5c3d1y0r.js → chunk-zd3wmj4d.js} +1 -1
  109. package/dist/cli/{chunk-xtr7ks02.js → chunk-zftxrnwh.js} +1 -1
  110. package/dist/cli/{chunk-b9h2ywc7.js → chunk-zqfbyq0a.js} +1 -1
  111. package/dist/cli/chunk-zwaf2mzz.js +2 -0
  112. package/dist/cli/index.js +7 -7
  113. package/dist/cli/kobe-run.js +1 -1
  114. package/dist/cli/kobe.js +6 -6
  115. package/dist/cli/pty-host-node.mjs +7 -6
  116. package/dist/cli/rove-run.js +1 -1
  117. package/dist/cli/rove.js +6 -6
  118. package/dist/skills/rove/references/api-flags.md +9 -5
  119. package/package.json +1 -1
  120. package/dist/cli/chunk-4c220qpj.js +0 -16
  121. package/dist/cli/chunk-4gaqhq8t.js +0 -2
  122. package/dist/cli/chunk-6t2zhxmq.js +0 -2
  123. package/dist/cli/chunk-7h7tqran.js +0 -2
  124. package/dist/cli/chunk-8ddjfc2v.js +0 -4
  125. package/dist/cli/chunk-9j7507ap.js +0 -2
  126. package/dist/cli/chunk-9k5p5852.js +0 -7
  127. package/dist/cli/chunk-9tw3vt9p.js +0 -2
  128. package/dist/cli/chunk-aeq5xmtq.js +0 -3
  129. package/dist/cli/chunk-aq912vvw.js +0 -3
  130. package/dist/cli/chunk-arf294te.js +0 -2
  131. package/dist/cli/chunk-ea0fm583.js +0 -2
  132. package/dist/cli/chunk-evmfa4v5.js +0 -2
  133. package/dist/cli/chunk-fm6e40pe.js +0 -2
  134. package/dist/cli/chunk-fna6sxe4.js +0 -5
  135. package/dist/cli/chunk-j2j1kq3m.js +0 -2
  136. package/dist/cli/chunk-kpf3yaj9.js +0 -3
  137. package/dist/cli/chunk-m6n0mkye.js +0 -2
  138. package/dist/cli/chunk-makzf3q1.js +0 -9
  139. package/dist/cli/chunk-nzy3yafz.js +0 -2
  140. package/dist/cli/chunk-p8hzr9m6.js +0 -2
  141. package/dist/cli/chunk-q3fc7t7p.js +0 -3
  142. package/dist/cli/chunk-r94jdy8g.js +0 -2
  143. package/dist/cli/chunk-snzh4n0v.js +0 -3
  144. package/dist/cli/chunk-st4xag8b.js +0 -2
  145. package/dist/cli/chunk-x760j10f.js +0 -3
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{getPersistedBool,loadStateFile,patchStateFile,readSavedRepos,updateStateFile}from"./chunk-rsqx358z.js";import{projectRejection}from"./chunk-s8eh3cf1.js";import{kvStatePath}from"./chunk-07k2njwk.js";import{spawnSync}from"child_process";import{realpathSync}from"fs";function isRemoteRepoKey(key){return key.startsWith("ssh://")}function isRemoteProjectsEnabled(){return getPersistedBool("experimental.remoteProjects",!1)}function remoteRepoKey(host,user,port,basePath){let authority=port?`${user}@${host}:${port}`:`${user}@${host}`,base=(basePath??"").trim().replace(/\/+$/,"");if(!base)return`ssh://${authority}`;return`ssh://${authority}${base.startsWith("/")?base:`/${base}`}`}function readRemoteRepos(state){let raw=state.remoteRepos;if(!raw||typeof raw!=="object"||Array.isArray(raw))return{};return raw}function getRemoteRepoConfig(key){return readRemoteRepos(loadStateFile())[key]??null}function getRemoteRepos(){return readRemoteRepos(loadStateFile())}function addRemoteRepo(config){let key=remoteRepoKey(config.host,config.user,config.port,config.basePath),added=!1;return updateStateFile((state)=>{let repos={...readRemoteRepos(state)},legacyKey=remoteRepoKey(config.host,config.user,config.port);if(key!==legacyKey&&repos[legacyKey]?.basePath===config.basePath)key=legacyKey;repos[key]=config,state.remoteRepos=repos;let saved=readSavedRepos(state);if(added=!saved.includes(key),added)state.savedRepos=[...saved,key];return}),{key,added}}function resolveRepoRoot(absPath){if(isRemoteRepoKey(absPath))return absPath;let r=spawnSync("git",["rev-parse","--show-toplevel"],{cwd:absPath,encoding:"utf8",shell:!1});if(r.status!==0)return absPath;let top=(r.stdout??"").trim();if(!top)return absPath;try{if(realpathSync(absPath)===realpathSync(top))return absPath}catch{}return top}function isGitRepo(absPath){if(isRemoteRepoKey(absPath))return!1;let r=spawnSync("git",["rev-parse","--is-inside-work-tree"],{cwd:absPath,encoding:"utf8",shell:!1});return r.status===0&&(r.stdout??"").trim()==="true"}function resolveMainRepoRoot(absPath){if(isRemoteRepoKey(absPath))return absPath;let r=spawnSync("git",["worktree","list","--porcelain"],{cwd:absPath,encoding:"utf8",shell:!1});if(r.status!==0)return resolveRepoRoot(absPath);return(r.stdout??"").split(/\r?\n/).find((line)=>line.startsWith("worktree "))?.slice(9).trim()||resolveRepoRoot(absPath)}function statePath(){return kvStatePath()}function getSavedRepos(){return readSavedRepos(loadStateFile())}function getPersistedString(key){let value=loadStateFile()[key];return typeof value==="string"?value:void 0}function setPersistedString(key,value){patchStateFile({[key]:value})}function getCustomEngineIds(){let raw=loadStateFile().customEngineIds;if(!Array.isArray(raw))return[];return raw.filter((s)=>typeof s==="string"&&s.trim().length>0)}function getDisabledEngineIds(){let raw=loadStateFile().disabledEngineIds;if(!Array.isArray(raw))return[];return raw.filter((s)=>typeof s==="string"&&s.trim().length>0)}function addSavedRepo(absPath,opts={}){let normalized=resolveMainRepoRoot(absPath),rejected=opts.skipGate?null:projectRejection(normalized,isGitRepo,opts.intent??"explicit");if(rejected)return{added:!1,path:normalized,total:getSavedRepos().length,rejected};let result={added:!1,path:normalized,total:0};return updateStateFile((state)=>{let cur=readSavedRepos(state);if(cur.includes(normalized))return result={added:!1,path:normalized,total:cur.length},!1;state.savedRepos=[...cur,normalized],result={added:!0,path:normalized,total:cur.length+1};return}),result}function backfillSavedReposFromProjects(mainRepos){let added=[];for(let repo of mainRepos)if(addSavedRepo(repo,{intent:"explicit"}).added)added.push(repo);return added}function normalizeSavedRepos(){let cur=getSavedRepos(),seen=new Set,next=[],changed=!1;for(let p of cur){let top=resolveMainRepoRoot(p);if(top!==p)changed=!0;if(seen.has(top)){changed=!0;continue}seen.add(top),next.push(top)}if(!changed)return;patchStateFile({savedRepos:next})}function readRepoConfigs(state){let raw=state.repoConfigs;if(!raw||typeof raw!=="object"||Array.isArray(raw))return{};return raw}function coerceOverride(entry){if(!entry||typeof entry!=="object")return{};let e=entry;return{initScript:typeof e.initScript==="string"&&e.initScript.length>0?e.initScript:void 0,initPrompt:typeof e.initPrompt==="string"&&e.initPrompt.length>0?e.initPrompt:void 0}}function getRepoInitOverride(repoRoot){return coerceOverride(readRepoConfigs(loadStateFile())[resolveRepoRoot(repoRoot)])}function setRepoInitOverride(repoRoot,patch){let normalized=resolveRepoRoot(repoRoot),next={};return updateStateFile((state)=>{let configs={...readRepoConfigs(state)},cur=coerceOverride(configs[normalized]),nextScript=patch.initScript===void 0?cur.initScript:patch.initScript||void 0,nextPrompt=patch.initPrompt===void 0?cur.initPrompt:patch.initPrompt||void 0;if(next={...nextScript?{initScript:nextScript}:{},...nextPrompt?{initPrompt:nextPrompt}:{}},!next.initScript&&!next.initPrompt){let{[normalized]:_dropped,...rest}=configs;state.repoConfigs=rest}else configs[normalized]=next,state.repoConfigs=configs;return}),next}function removeSavedRepo(absPath){let result={removed:!1,path:absPath,total:0};return updateStateFile((state)=>{let cur=readSavedRepos(state);if(!cur.includes(absPath))return result={removed:!1,path:absPath,total:cur.length},!1;if(state.savedRepos=cur.filter((p)=>p!==absPath),isRemoteRepoKey(absPath)){let remotes=readRemoteRepos(state);if(absPath in remotes){let next={...remotes};delete next[absPath],state.remoteRepos=next}}result={removed:!0,path:absPath,total:cur.length-1};return}),result}
2
+ import{getPersistedBool,loadStateFile,patchStateFile,readSavedRepos,updateStateFile}from"./chunk-5v893waj.js";import{projectRejection}from"./chunk-3wj69b0a.js";import{kvStatePath}from"./chunk-ch9b1d5y.js";import{spawnSync}from"child_process";import{realpathSync}from"fs";function isRemoteRepoKey(key){return key.startsWith("ssh://")}function isRemoteProjectsEnabled(){return getPersistedBool("experimental.remoteProjects",!1)}function remoteRepoKey(host,user,port,basePath){let authority=port?`${user}@${host}:${port}`:`${user}@${host}`,base=(basePath??"").trim().replace(/\/+$/,"");if(!base)return`ssh://${authority}`;return`ssh://${authority}${base.startsWith("/")?base:`/${base}`}`}function readRemoteRepos(state){let raw=state.remoteRepos;if(!raw||typeof raw!=="object"||Array.isArray(raw))return{};return raw}function getRemoteRepoConfig(key){return readRemoteRepos(loadStateFile())[key]??null}function getRemoteRepos(){return readRemoteRepos(loadStateFile())}function addRemoteRepo(config){let key=remoteRepoKey(config.host,config.user,config.port,config.basePath),added=!1;return updateStateFile((state)=>{let repos={...readRemoteRepos(state)},legacyKey=remoteRepoKey(config.host,config.user,config.port);if(key!==legacyKey&&repos[legacyKey]?.basePath===config.basePath)key=legacyKey;repos[key]=config,state.remoteRepos=repos;let saved=readSavedRepos(state);if(added=!saved.includes(key),added)state.savedRepos=[...saved,key];return}),{key,added}}function resolveRepoRoot(absPath){if(isRemoteRepoKey(absPath))return absPath;let r=spawnSync("git",["rev-parse","--show-toplevel"],{cwd:absPath,encoding:"utf8",shell:!1});if(r.status!==0)return absPath;let top=(r.stdout??"").trim();if(!top)return absPath;try{if(realpathSync(absPath)===realpathSync(top))return absPath}catch{}return top}function isGitRepo(absPath){if(isRemoteRepoKey(absPath))return!1;let r=spawnSync("git",["rev-parse","--is-inside-work-tree"],{cwd:absPath,encoding:"utf8",shell:!1});return r.status===0&&(r.stdout??"").trim()==="true"}function resolveMainRepoRoot(absPath){if(isRemoteRepoKey(absPath))return absPath;let r=spawnSync("git",["worktree","list","--porcelain"],{cwd:absPath,encoding:"utf8",shell:!1});if(r.status!==0)return resolveRepoRoot(absPath);return(r.stdout??"").split(/\r?\n/).find((line)=>line.startsWith("worktree "))?.slice(9).trim()||resolveRepoRoot(absPath)}function statePath(){return kvStatePath()}function getSavedRepos(){return readSavedRepos(loadStateFile())}function getPersistedString(key){let value=loadStateFile()[key];return typeof value==="string"?value:void 0}function setPersistedString(key,value){patchStateFile({[key]:value})}function getCustomEngineIds(){let raw=loadStateFile().customEngineIds;if(!Array.isArray(raw))return[];return raw.filter((s)=>typeof s==="string"&&s.trim().length>0)}function getDisabledEngineIds(){let raw=loadStateFile().disabledEngineIds;if(!Array.isArray(raw))return[];return raw.filter((s)=>typeof s==="string"&&s.trim().length>0)}function addSavedRepo(absPath,opts={}){let normalized=resolveMainRepoRoot(absPath),rejected=opts.skipGate?null:projectRejection(normalized,isGitRepo,opts.intent??"explicit");if(rejected)return{added:!1,path:normalized,total:getSavedRepos().length,rejected};let result={added:!1,path:normalized,total:0};return updateStateFile((state)=>{let cur=readSavedRepos(state);if(cur.includes(normalized))return result={added:!1,path:normalized,total:cur.length},!1;state.savedRepos=[...cur,normalized],result={added:!0,path:normalized,total:cur.length+1};return}),result}function backfillSavedReposFromProjects(mainRepos){let added=[];for(let repo of mainRepos)if(addSavedRepo(repo,{intent:"explicit"}).added)added.push(repo);return added}function normalizeSavedRepos(){let cur=getSavedRepos(),seen=new Set,next=[],changed=!1;for(let p of cur){let top=resolveMainRepoRoot(p);if(top!==p)changed=!0;if(seen.has(top)){changed=!0;continue}seen.add(top),next.push(top)}if(!changed)return;patchStateFile({savedRepos:next})}function readRepoConfigs(state){let raw=state.repoConfigs;if(!raw||typeof raw!=="object"||Array.isArray(raw))return{};return raw}function coerceOverride(entry){if(!entry||typeof entry!=="object")return{};let e=entry;return{initScript:typeof e.initScript==="string"&&e.initScript.length>0?e.initScript:void 0,initPrompt:typeof e.initPrompt==="string"&&e.initPrompt.length>0?e.initPrompt:void 0}}function getRepoInitOverride(repoRoot){return coerceOverride(readRepoConfigs(loadStateFile())[resolveRepoRoot(repoRoot)])}function setRepoInitOverride(repoRoot,patch){let normalized=resolveRepoRoot(repoRoot),next={};return updateStateFile((state)=>{let configs={...readRepoConfigs(state)},cur=coerceOverride(configs[normalized]),nextScript=patch.initScript===void 0?cur.initScript:patch.initScript||void 0,nextPrompt=patch.initPrompt===void 0?cur.initPrompt:patch.initPrompt||void 0;if(next={...nextScript?{initScript:nextScript}:{},...nextPrompt?{initPrompt:nextPrompt}:{}},!next.initScript&&!next.initPrompt){let{[normalized]:_dropped,...rest}=configs;state.repoConfigs=rest}else configs[normalized]=next,state.repoConfigs=configs;return}),next}function removeSavedRepo(absPath){let result={removed:!1,path:absPath,total:0};return updateStateFile((state)=>{let cur=readSavedRepos(state);if(!cur.includes(absPath))return result={removed:!1,path:absPath,total:cur.length},!1;if(state.savedRepos=cur.filter((p)=>p!==absPath),isRemoteRepoKey(absPath)){let remotes=readRemoteRepos(state);if(absPath in remotes){let next={...remotes};delete next[absPath],state.remoteRepos=next}}result={removed:!0,path:absPath,total:cur.length-1};return}),result}
3
3
  export{isRemoteRepoKey,isRemoteProjectsEnabled,remoteRepoKey,getRemoteRepoConfig,getRemoteRepos,addRemoteRepo,resolveRepoRoot,isGitRepo,resolveMainRepoRoot,statePath,getSavedRepos,getPersistedString,setPersistedString,getCustomEngineIds,getDisabledEngineIds,addSavedRepo,backfillSavedReposFromProjects,normalizeSavedRepos,getRepoInitOverride,setRepoInitOverride,removeSavedRepo};
@@ -1,7 +1,7 @@
1
1
  // @bun
2
- import{applyFixes,daemonRestartFix,defaultFixRuntime,engineTabsManualFix,humanOnlyFix,killOrphansManualFix,noEngineFix,probeEngines,probeGit,reinstallManualFix,resetManualFix,skillInstallFix,spawnHelperFix}from"./chunk-g6ww85sh.js";import{formatBytes}from"./chunk-my20q579.js";import"./chunk-yshnare4.js";import"./chunk-4c220qpj.js";import"./chunk-aeq5xmtq.js";import"./chunk-5wzap7r2.js";import"./chunk-r2pztgm6.js";import"./chunk-ke95ebrz.js";import{kobeSkillState,skillInstallCommand}from"./chunk-z83wxkg6.js";import{inspectLegacyTmux,legacyTmuxDoctorLines}from"./chunk-dqndd97s.js";import"./chunk-rz8zs7j8.js";import"./chunk-h4n8ffqy.js";import"./chunk-vyb5a2rh.js";import"./chunk-d393z1mj.js";import{CURRENT_VERSION,package_default}from"./chunk-55xkvzvw.js";import{resolveNodeBinary}from"./chunk-e8493db0.js";import"./chunk-rkt1qjec.js";import"./chunk-1cjd7h8p.js";import"./chunk-b99tf0jr.js";import"./chunk-2z90jxcn.js";import{t}from"./chunk-p1d3ag8b.js";import"./chunk-q3fc7t7p.js";import"./chunk-sdyzxayr.js";import"./chunk-jvxh93nz.js";import{isStaleInstallError,resolveKobeSpawn}from"./chunk-5bn91n19.js";import"./chunk-pdh5w4ht.js";import{readPidFile}from"./chunk-4wwx51m5.js";import{KobeDaemonClient}from"./chunk-79gqh5p2.js";import{isForeignDaemonHome}from"./chunk-3ztek08w.js";import"./chunk-kwe61yx7.js";import"./chunk-g5nz190n.js";import"./chunk-7z9cqycv.js";import"./chunk-ea1r26pa.js";import"./chunk-w7zv47mp.js";import"./chunk-gwcneg6c.js";import"./chunk-9zb2wkfr.js";import"./chunk-7jkf3tvr.js";import"./chunk-2fypr41w.js";import"./chunk-deejtpcr.js";import"./chunk-rsqx358z.js";import{readableLegacyIndexPath}from"./chunk-nywh3yb9.js";import"./chunk-xy8be792.js";import"./chunk-a3a9gdc4.js";import"./chunk-2brn8e1y.js";import"./chunk-s8eh3cf1.js";import{homeDir,kvStatePath,roveStateDir}from"./chunk-07k2njwk.js";import"./chunk-bq3fyc0p.js";import{activeCliName}from"./chunk-ef11h2am.js";import"./chunk-8ddjfc2v.js";import{LEGACY_KOBE_STATE_DIR_BASENAME}from"./chunk-cb2fpajx.js";import"./chunk-grh6dvfv.js";import"./chunk-pw6yfj10.js";import"./chunk-yk2ha5yj.js";import"./chunk-rxvbm4vt.js";import{defaultDaemonLogPath,defaultDaemonPidPath,defaultDaemonSocketPath,defaultPtyHostLogPath,defaultPtyHostPidPath,defaultPtyHostSocketPath}from"./chunk-x760j10f.js";import"./chunk-3bfm4hrs.js";import{__require}from"./chunk-wqfp8d9w.js";import{existsSync,readFileSync as readFileSync2,statSync as statSync2}from"fs";import{join as join2}from"path";var MIN_BUN_VERSION=package_default.engines.bun.match(/\d+\.\d+\.\d+/)?.[0]??"0.0.0";function parseBunVersion(raw){return raw.trim().match(/^v?(\d+\.\d+\.\d+)/)?.[1]??null}function isBunAtLeast(raw,minimum=MIN_BUN_VERSION){let found=parseBunVersion(raw),floor=parseBunVersion(minimum);if(!found||!floor)return!0;let a=found.split(".").map(Number),b=floor.split(".").map(Number);for(let i=0;i<3;i++){let av=a[i]??0,bv=b[i]??0;if(av!==bv)return av>bv}return!0}function classifyHookChannel(input){let total=0,hooked=0;for(let tabs of Object.values(input.tabs))for(let entry of Object.values(tabs))if(total++,entry.source==="hook")hooked++;if(total===0)return{kind:"no-tabs"};if(hooked===0)return{kind:"down",totalTabs:total};return{kind:"live",hookTabs:hooked,totalTabs:total}}function hookChannelDoctorLines(verdict,input,cliName){if(verdict.kind==="no-tabs")return["hooks: \u2014 no engine tabs yet (nothing to check)"];if(verdict.kind==="live")return[`hooks: \u2713 engine hook channel live (${verdict.hookTabs}/${verdict.totalTabs} tab(s) hook-sourced)`];let out=[`hooks: \u2717 NO hook events reaching the daemon (0/${verdict.totalTabs} tab(s) hook-sourced)`," badges fall back to a ~10s poll, so activity looks seconds late",` daemon socket: ${input.socketPath}`];return out.push(' \u2192 compare with an engine tab\'s own path: `ps eww -p <engine-pid> | tr " " "\\n" | grep DAEMON_SOCKET_PATH`',` \u2192 restart the engine tabs (they may hold a stale socket path), or run \`${cliName} daemon restart\``,` \u2192 debug one hook directly: \`KOBE_HOOK_DEBUG=1 echo '{}' | ${cliName} hook turn-start --engine claude\``),out}import{readdirSync,statSync}from"fs";import{createRequire}from"module";import{dirname,join}from"path";function installedSpawnHelpers(){let pkg;try{pkg=dirname(createRequire(import.meta.url).resolve("node-pty/package.json"))}catch{return[]}let prebuilds=join(pkg,"prebuilds"),arches;try{arches=readdirSync(prebuilds).filter((name)=>name.startsWith("darwin-"))}catch{return[]}let helpers=[];for(let arch of arches){let path=join(prebuilds,arch,"spawn-helper");try{helpers.push({path,executable:(statSync(path).mode&64)!==0})}catch{}}return helpers}function spawnHelperDoctorLines(helpers){let broken=helpers.filter((helper)=>!helper.executable).map((helper)=>helper.path);if(helpers.length===0)return{lines:["node-pty: ? no darwin spawn-helper found next to node-pty"],broken};if(broken.length===0)return{lines:[`node-pty: \u2713 spawn-helper executable (${helpers.length} arch)`],broken};return{lines:["node-pty: \u2717 spawn-helper is not executable \u2014 every node-pty PTY spawn fails",...broken.map((path)=>` ${path}`),` \u2192 chmod 755 ${broken.join(" ")}`],broken}}import{readFileSync}from"fs";var PTY_MARKER="KOBE_TERMINAL_PTY=1";async function run(argv){try{let proc=Bun.spawn([...argv],{stdin:"ignore",stdout:"pipe",stderr:"ignore"}),[stdout,code]=await Promise.all([new Response(proc.stdout).text().catch(()=>""),proc.exited]);return{code,stdout}}catch{return{code:127,stdout:""}}}function parsePsRows(output){let rows=[];for(let line of output.split(`
3
- `)){let parts=line.trim().split(/\s+/);if(parts.length<6)continue;let[pid,ppid,pgid]=[parts[0],parts[1],parts[2]].map((value)=>Number.parseInt(value??"",10)),rssKb=Number.parseInt(parts[4]??"",10);if(!Number.isFinite(pid)||!Number.isFinite(ppid)||!Number.isFinite(pgid)||!Number.isFinite(rssKb))continue;rows.push({pid,ppid,pgid,etime:parts[3]??"",rssKb,command:parts.slice(5).join(" ")})}return rows}function pidAlive(pid,rows){return rows.some((row)=>row.pid===pid)}function orphanCandidates(rows,selfPgid,liveSessionPids){return rows.filter((row)=>row.ppid===1&&row.pgid!==selfPgid&&!liveSessionPids.has(row.pgid)&&!pidAlive(row.pgid,rows))}async function markedPids(pids){let marked=new Set;if(pids.length===0)return marked;if(process.platform==="linux"){for(let pid of pids)try{if(readFileSync(`/proc/${pid}/environ`,"utf8").split("\x00").includes(PTY_MARKER))marked.add(pid)}catch{}return marked}let result=await run(["ps","eww","-o","pid=,command=","-p",pids.join(",")]),marker=new RegExp(`(^|\\s)${PTY_MARKER}(\\s|$)`);for(let line of result.stdout.split(`
4
- `)){let pid=Number.parseInt(line.trim().split(/\s+/)[0]??"",10);if(Number.isFinite(pid)&&marker.test(line))marked.add(pid)}return marked}async function ownPgid(){let result=await run(["ps","-o","pgid=","-p",String(process.pid)]),pgid=Number.parseInt(result.stdout.trim(),10);return Number.isFinite(pgid)?pgid:-1}async function collectOrphans(liveSessionPids){if(process.platform==="win32")return{orphans:[],error:null};let ps=await run(["ps","-A","-o","pid=,ppid=,pgid=,etime=,rss=,command="]);if(ps.code!==0)return{orphans:[],error:`ps exited ${ps.code}`};let rows=parsePsRows(ps.stdout),candidates=orphanCandidates(rows,await ownPgid(),liveSessionPids),marked=await markedPids(candidates.map((row)=>row.pid));return{orphans:candidates.filter((row)=>marked.has(row.pid)),error:null}}function formatMb(rssKb){return`${(rssKb/1024).toFixed(0)} MB`}function orphanDoctorLines(orphans,error,cliName,killing=!1){if(error)return[`orphans: \u2717 could not inspect the process table \u2014 ${error}`];if(orphans.length===0)return["orphans: \u2713 none \u2014 no processes left behind by a dead PTY session"];let totalMb=orphans.reduce((sum,row)=>sum+row.rssKb,0)/1024,lines=[`orphans: \u26A0 ${orphans.length} process(es) outlived the PTY session that spawned them (${totalMb.toFixed(0)} MB RSS)`," each is reparented to init, carries Rove's PTY marker, and its process"," group leader is gone \u2014 no live task owns them"];for(let row of[...orphans].sort((a,b)=>b.rssKb-a.rssKb))lines.push(` pid ${row.pid} (group ${row.pgid}) up ${row.etime}, ${formatMb(row.rssKb)}: ${row.command.slice(0,90)}`);if(!killing)lines.push(` \u2192 \`${cliName} doctor --kill-orphans\` ends those process groups (SIGTERM, then SIGKILL)`," read the list first: something you backgrounded from a Rove terminal and then"," closed the tab on looks exactly like a leak, and doctor cannot tell them apart");return lines}var GROUP_EXIT_GRACE_MS=2000,GROUP_POLL_MS=100;function groupAlive(pgid){try{return process.kill(-pgid,0),!0}catch(err){return err.code!=="ESRCH"}}async function killOrphanGroups(orphans){let groups=[...new Set(orphans.map((row)=>row.pgid))];for(let pgid of groups)try{process.kill(-pgid,"SIGTERM")}catch{}let deadline=Date.now()+GROUP_EXIT_GRACE_MS,survivors=groups.filter(groupAlive);while(survivors.length>0&&Date.now()<deadline)await new Promise((resolve)=>setTimeout(resolve,GROUP_POLL_MS)),survivors=survivors.filter(groupAlive);for(let pgid of survivors)try{process.kill(-pgid,"SIGKILL")}catch{}return await new Promise((resolve)=>setTimeout(resolve,GROUP_POLL_MS)),{groups,survivors:survivors.filter(groupAlive)}}function multiplexerLabel(env){if(env.TMUX)return"tmux";if(env.ZELLIJ)return"zellij";if(env.STY)return"screen";return"no"}function terminalEnvLines(env){let show=(v)=>v&&v.length>0?v:"(unset)",program=env.TERM_PROGRAM?`${env.TERM_PROGRAM}${env.TERM_PROGRAM_VERSION?` v${env.TERM_PROGRAM_VERSION}`:""}`:"(unset)";return[`terminal: TERM=${show(env.TERM)} TERM_PROGRAM=${program} COLORTERM=${show(env.COLORTERM)}`,` running inside a multiplexer: ${multiplexerLabel(env)}`]}function parseKittyProbeReply(data){let kitty=data.match(/\x1b\[\?(\d+)u/);if(kitty?.[1]!==void 0)return{kind:"supported",flags:Number.parseInt(kitty[1],10)};if(/\x1b\[\?[\d;]*c/.test(data))return{kind:"unsupported"};return null}function kittyProbeLine(result){switch(result.kind){case"supported":return` kitty keyboard protocol: \u2713 answered (flags=${result.flags})`;case"unsupported":return[" kitty keyboard protocol: \u2717 not supported \u2014 legacy key path"," (ctrl+h/ctrl+j arrive as C0 backspace/linefeed bytes; the"," split chords ctrl+\\ and ctrl+= cannot be encoded at all)"].join(`
2
+ import{applyFixes,daemonRestartFix,defaultFixRuntime,engineTabsManualFix,humanOnlyFix,killOrphansManualFix,noEngineFix,probeEngines,probeGit,reinstallManualFix,resetManualFix,skillInstallFix,spawnHelperFix}from"./chunk-ybcacmqv.js";import{formatBytes}from"./chunk-my20q579.js";import"./chunk-exggdhpt.js";import"./chunk-7ntf5hdf.js";import"./chunk-39x1ztey.js";import"./chunk-41ahvk51.js";import"./chunk-r2pztgm6.js";import{kobeSkillState,skillInstallCommand}from"./chunk-g90z5s39.js";import{inspectLegacyTmux,legacyTmuxDoctorLines}from"./chunk-dqndd97s.js";import"./chunk-rz8zs7j8.js";import"./chunk-h4n8ffqy.js";import"./chunk-vyb5a2rh.js";import"./chunk-38272eqv.js";import"./chunk-5f80ggc3.js";import{CURRENT_VERSION,package_default}from"./chunk-98zhyhpz.js";import{resolveNodeBinary}from"./chunk-wdhcrcre.js";import"./chunk-ptjc5mtc.js";import"./chunk-1cjd7h8p.js";import"./chunk-b99tf0jr.js";import"./chunk-de751t37.js";import{t}from"./chunk-nss70xwr.js";import"./chunk-fd2zhddn.js";import"./chunk-sdyzxayr.js";import"./chunk-jvxh93nz.js";import{isStaleInstallError,resolveKobeSpawn}from"./chunk-4502n1bk.js";import"./chunk-nm0pq5r6.js";import{readPidFile}from"./chunk-mqqnk8w7.js";import{KobeDaemonClient}from"./chunk-0wnfq5sx.js";import{isForeignDaemonHome}from"./chunk-7j5372wb.js";import"./chunk-mnqxgvyb.js";import"./chunk-n7n12868.js";import"./chunk-4gjr08g0.js";import"./chunk-sfv15era.js";import"./chunk-w7zv47mp.js";import"./chunk-gwcneg6c.js";import"./chunk-25hxhtdr.js";import"./chunk-7jkf3tvr.js";import"./chunk-2fypr41w.js";import"./chunk-kt1ppyje.js";import"./chunk-5v893waj.js";import{readableLegacyIndexPath}from"./chunk-axfn4f28.js";import"./chunk-xy8be792.js";import"./chunk-a3a9gdc4.js";import"./chunk-2brn8e1y.js";import"./chunk-3wj69b0a.js";import{homeDir,kvStatePath,roveStateDir}from"./chunk-ch9b1d5y.js";import"./chunk-bq3fyc0p.js";import{activeCliName}from"./chunk-p7s4xwgx.js";import"./chunk-4pmd0mxp.js";import{LEGACY_KOBE_STATE_DIR_BASENAME}from"./chunk-g56kvet6.js";import"./chunk-k2ckx8zw.js";import"./chunk-pw6yfj10.js";import"./chunk-nyv7a76k.js";import"./chunk-rxvbm4vt.js";import{defaultDaemonLogPath,defaultDaemonPidPath,defaultDaemonSocketPath,defaultPtyHostLogPath,defaultPtyHostPidPath,defaultPtyHostSocketPath}from"./chunk-mcdv19rs.js";import"./chunk-r3k9rbwm.js";import{__require}from"./chunk-wqfp8d9w.js";import{existsSync,readFileSync as readFileSync2,statSync as statSync2}from"fs";import{join as join2}from"path";var MIN_BUN_VERSION=package_default.engines.bun.match(/\d+\.\d+\.\d+/)?.[0]??"0.0.0";function parseBunVersion(raw){return raw.trim().match(/^v?(\d+\.\d+\.\d+)/)?.[1]??null}function isBunAtLeast(raw,minimum=MIN_BUN_VERSION){let found=parseBunVersion(raw),floor=parseBunVersion(minimum);if(!found||!floor)return!0;let a=found.split(".").map(Number),b=floor.split(".").map(Number);for(let i=0;i<3;i++){let av=a[i]??0,bv=b[i]??0;if(av!==bv)return av>bv}return!0}function classifyHookChannel(input){let total=0,hooked=0;for(let tabs of Object.values(input.tabs))for(let entry of Object.values(tabs))if(total++,entry.source==="hook")hooked++;if(total===0)return{kind:"no-tabs"};if(hooked===0)return{kind:"down",totalTabs:total};return{kind:"live",hookTabs:hooked,totalTabs:total}}function hookChannelDoctorLines(verdict,input,cliName){if(verdict.kind==="no-tabs")return["hooks: \u2014 no engine tabs yet (nothing to check)"];if(verdict.kind==="live")return[`hooks: \u2713 engine hook channel live (${verdict.hookTabs}/${verdict.totalTabs} tab(s) hook-sourced)`];let out=[`hooks: \u2717 NO hook events reaching the daemon (0/${verdict.totalTabs} tab(s) hook-sourced)`," badges fall back to a ~10s poll, so activity looks seconds late",` daemon socket: ${input.socketPath}`];return out.push(' \u2192 compare with an engine tab\'s own path: `ps eww -p <engine-pid> | tr " " "\\n" | grep DAEMON_SOCKET_PATH`',` \u2192 restart the engine tabs (they may hold a stale socket path), or run \`${cliName} daemon restart\``,` \u2192 debug one hook directly: \`KOBE_HOOK_DEBUG=1 echo '{}' | ${cliName} hook turn-start --engine claude\``),out}import{readdirSync,statSync}from"fs";import{createRequire}from"module";import{dirname,join}from"path";function installedSpawnHelpers(){let pkg;try{pkg=dirname(createRequire(import.meta.url).resolve("node-pty/package.json"))}catch{return[]}let prebuilds=join(pkg,"prebuilds"),arches;try{arches=readdirSync(prebuilds).filter((name)=>name.startsWith("darwin-"))}catch{return[]}let helpers=[];for(let arch of arches){let path=join(prebuilds,arch,"spawn-helper");try{helpers.push({path,executable:(statSync(path).mode&64)!==0})}catch{}}return helpers}function spawnHelperDoctorLines(helpers){let broken=helpers.filter((helper)=>!helper.executable).map((helper)=>helper.path);if(helpers.length===0)return{lines:["node-pty: ? no darwin spawn-helper found next to node-pty"],broken};if(broken.length===0)return{lines:[`node-pty: \u2713 spawn-helper executable (${helpers.length} arch)`],broken};return{lines:["node-pty: \u2717 spawn-helper is not executable \u2014 every node-pty PTY spawn fails",...broken.map((path)=>` ${path}`),` \u2192 chmod 755 ${broken.join(" ")}`],broken}}import{readFileSync}from"fs";var PTY_MARKER="KOBE_TERMINAL_PTY=1",run=async(argv)=>{try{let proc=Bun.spawn([...argv],{stdin:"ignore",stdout:"pipe",stderr:"ignore"}),[stdout,code]=await Promise.all([new Response(proc.stdout).text().catch(()=>""),proc.exited]);return{code,stdout}}catch{return{code:127,stdout:""}}};function parsePsRows(output){let rows=[];for(let line of output.split(`
3
+ `)){let parts=line.trim().split(/\s+/);if(parts.length<6)continue;let[pid,ppid,pgid]=[parts[0],parts[1],parts[2]].map((value)=>Number.parseInt(value??"",10)),rssKb=Number.parseInt(parts[4]??"",10);if(!Number.isFinite(pid)||!Number.isFinite(ppid)||!Number.isFinite(pgid)||!Number.isFinite(rssKb))continue;rows.push({pid,ppid,pgid,etime:parts[3]??"",rssKb,command:parts.slice(5).join(" ")})}return rows}function pidAlive(pid,rows){return rows.some((row)=>row.pid===pid)}function orphanCandidates(rows,selfPgid,liveSessionPids){return rows.filter((row)=>row.ppid===1&&row.pgid!==selfPgid&&!liveSessionPids.has(row.pgid)&&!pidAlive(row.pgid,rows))}async function markedPids(pids,deps={}){let runProbe=deps.run??run,readEnviron=deps.readEnviron??((pid)=>readFileSync(`/proc/${pid}/environ`,"utf8")),marked=new Set;if(pids.length===0)return{marked,failed:null};if((deps.platform??process.platform)==="linux"){let refused=null;for(let pid of pids)try{if(readEnviron(pid).split("\x00").includes(PTY_MARKER))marked.add(pid)}catch(err){let code=err.code;if(code!=="ENOENT"&&code!=="ESRCH")refused??=`/proc/${pid}/environ: ${code??"unreadable"}`}return{marked,failed:refused}}let result=await runProbe(["ps","eww","-o","pid=,command=","-p",pids.join(",")]);if(result.code!==0)return{marked,failed:`ps eww exited ${result.code}`};let marker=new RegExp(`(^|\\s)${PTY_MARKER}(\\s|$)`);for(let line of result.stdout.split(`
4
+ `)){let pid=Number.parseInt(line.trim().split(/\s+/)[0]??"",10);if(Number.isFinite(pid)&&marker.test(line))marked.add(pid)}return{marked,failed:null}}async function ownPgid(runProbe){let result=await runProbe(["ps","-o","pgid=","-p",String(process.pid)]),pgid=Number.parseInt(result.stdout.trim(),10);return Number.isFinite(pgid)?pgid:-1}async function collectOrphans(liveSessionPids,deps={}){let runProbe=deps.run??run;if((deps.platform??process.platform)==="win32")return{orphans:[],error:null};let ps=await runProbe(["ps","-A","-o","pid=,ppid=,pgid=,etime=,rss=,command="]);if(ps.code!==0)return{orphans:[],error:`could not read the process table \u2014 ps exited ${ps.code}`};let rows=parsePsRows(ps.stdout),candidates=orphanCandidates(rows,await ownPgid(runProbe),liveSessionPids),{marked,failed}=await markedPids(candidates.map((row)=>row.pid),deps);if(failed)return{orphans:[],error:`could not read process environments \u2014 ${failed}`};return{orphans:candidates.filter((row)=>marked.has(row.pid)),error:null}}function formatMb(rssKb){return`${(rssKb/1024).toFixed(0)} MB`}function orphanDoctorLines(orphans,error,cliName,killing=!1){if(error)return[`orphans: \u2717 ${error}`];if(orphans.length===0)return["orphans: \u2713 none \u2014 no processes left behind by a dead PTY session"];let totalMb=orphans.reduce((sum,row)=>sum+row.rssKb,0)/1024,lines=[`orphans: \u26A0 ${orphans.length} process(es) outlived the PTY session that spawned them (${totalMb.toFixed(0)} MB RSS)`," each is reparented to init, carries Rove's PTY marker, and its process"," group leader is gone \u2014 no live task owns them"];for(let row of[...orphans].sort((a,b)=>b.rssKb-a.rssKb))lines.push(` pid ${row.pid} (group ${row.pgid}) up ${row.etime}, ${formatMb(row.rssKb)}: ${row.command.slice(0,90)}`);if(!killing)lines.push(` \u2192 \`${cliName} doctor --kill-orphans\` ends those process groups (SIGTERM, then SIGKILL)`," read the list first: something you backgrounded from a Rove terminal and then"," closed the tab on looks exactly like a leak, and doctor cannot tell them apart");return lines}var GROUP_EXIT_GRACE_MS=2000,GROUP_POLL_MS=100;function groupAlive(pgid){try{return process.kill(-pgid,0),!0}catch(err){return err.code!=="ESRCH"}}async function killOrphanGroups(orphans){let groups=[...new Set(orphans.map((row)=>row.pgid))];for(let pgid of groups)try{process.kill(-pgid,"SIGTERM")}catch{}let deadline=Date.now()+GROUP_EXIT_GRACE_MS,survivors=groups.filter(groupAlive);while(survivors.length>0&&Date.now()<deadline)await new Promise((resolve)=>setTimeout(resolve,GROUP_POLL_MS)),survivors=survivors.filter(groupAlive);for(let pgid of survivors)try{process.kill(-pgid,"SIGKILL")}catch{}return await new Promise((resolve)=>setTimeout(resolve,GROUP_POLL_MS)),{groups,survivors:survivors.filter(groupAlive)}}function multiplexerLabel(env){if(env.TMUX)return"tmux";if(env.ZELLIJ)return"zellij";if(env.STY)return"screen";return"no"}function terminalEnvLines(env){let show=(v)=>v&&v.length>0?v:"(unset)",program=env.TERM_PROGRAM?`${env.TERM_PROGRAM}${env.TERM_PROGRAM_VERSION?` v${env.TERM_PROGRAM_VERSION}`:""}`:"(unset)";return[`terminal: TERM=${show(env.TERM)} TERM_PROGRAM=${program} COLORTERM=${show(env.COLORTERM)}`,` running inside a multiplexer: ${multiplexerLabel(env)}`]}function parseKittyProbeReply(data){let kitty=data.match(/\x1b\[\?(\d+)u/);if(kitty?.[1]!==void 0)return{kind:"supported",flags:Number.parseInt(kitty[1],10)};if(/\x1b\[\?[\d;]*c/.test(data))return{kind:"unsupported"};return null}function kittyProbeLine(result){switch(result.kind){case"supported":return` kitty keyboard protocol: \u2713 answered (flags=${result.flags})`;case"unsupported":return[" kitty keyboard protocol: \u2717 not supported \u2014 legacy key path"," (ctrl+h/ctrl+j arrive as C0 backspace/linefeed bytes; the"," split chords ctrl+\\ and ctrl+= cannot be encoded at all)"].join(`
5
5
  `);case"no-response":return" kitty keyboard protocol: ? no reply (terminal ignored both the kitty query and DA1)";case"skipped":return` kitty keyboard protocol: skipped (${result.reason})`}}async function probeKittyKeyboard(timeoutMs=300){let stdin=process.stdin;if(!stdin.isTTY||!process.stdout.isTTY)return{kind:"skipped",reason:"not an interactive terminal"};let wasRaw=stdin.isRaw===!0,buffer="";return await new Promise((resolve)=>{let done=!1,finish=(result)=>{if(done)return;if(done=!0,clearTimeout(timer),stdin.off("data",onData),stdin.pause(),!wasRaw)stdin.setRawMode(!1);resolve(result)},onData=(chunk)=>{buffer+=chunk.toString("latin1");let decided=parseKittyProbeReply(buffer);if(decided)finish(decided)},timer=setTimeout(()=>finish({kind:"no-response"}),timeoutMs);stdin.setRawMode(!0),stdin.resume(),stdin.on("data",onData),process.stdout.write("\x1B[?u\x1B[c")})}async function terminalDoctorLines(){return[...terminalEnvLines(process.env),kittyProbeLine(await probeKittyKeyboard())]}var CLI_NAME=activeCliName();function isProcessAlive(pid){try{return process.kill(pid,0),!0}catch(err){return err.code==="EPERM"}}async function requestIfReachable(socketPath,name){let client=new KobeDaemonClient(socketPath);try{return await client.request(name,{})}catch{return null}finally{client.close()}}function fmtDuration(ms){let seconds=Math.floor(ms/1000);if(seconds<60)return`${seconds}s`;let minutes=Math.floor(seconds/60);if(minutes<60)return`${minutes}m ${seconds%60}s`;return`${Math.floor(minutes/60)}h ${minutes%60}m`}function describeFile(path){try{let stat=statSync2(path);return`present (${formatBytes(stat.size)}, modified ${stat.mtime.toISOString()})`}catch{return"absent"}}function taskCount(path){try{let parsed=JSON.parse(readFileSync2(path,"utf8"));return Array.isArray(parsed.tasks)?parsed.tasks.length:null}catch{return null}}function tailFile(path,count){try{return readFileSync2(path,"utf8").split(`
6
6
  `).filter((line)=>line.trim().length>0).slice(-count).join(`
7
7
  `)}catch{return""}}function describeInstall(){try{let[,entry]=resolveKobeSpawn([]);return{line:`install: \u2713 ${entry??process.execPath}`,ok:!0}}catch(err){if(!isStaleInstallError(err))return{line:`install: ? could not check (${String(err)})`,ok:!0};return{line:["install: \u2717 GONE \u2014 this process is running from an install that no longer exists on disk"," it cannot start a daemon; every reconnect fails the same way until you reinstall"," \u2192 npm install -g @sma1lboy/rove (then relaunch Rove)"].join(`
@@ -14,5 +14,5 @@ Usage: ${CLI_NAME} doctor [--report] [--fix] [--kill-orphans]
14
14
  `),process.exit(2);let{lines,fixes,orphans}=await collectDoctor();if(!fix&&fixes.length>0)lines.push("",t("doctor.fix.hint",{count:fixes.length,command:`${CLI_NAME} doctor --fix`}));if(console.log(lines.join(`
15
15
  `)),kill)console.log(`
16
16
  ${(await sweepOrphans(orphans)).join(`
17
- `)}`);if(fix)await applyFixes(fixes,defaultFixRuntime());if(report){let{writeReportBundle}=await import("./chunk-c6mthex1.js"),path=writeReportBundle(lines);console.log(`
17
+ `)}`);if(fix)await applyFixes(fixes,defaultFixRuntime());if(report){let{writeReportBundle}=await import("./chunk-ksbvcxc3.js"),path=writeReportBundle(lines);console.log(`
18
18
  report written: ${path}`),console.log("attach this file to a bug report \u2014 it includes recent daemon + pty-host logs and env.")}}export{runDoctorSubcommand};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{activeCliName}from"./chunk-ef11h2am.js";import"./chunk-8ddjfc2v.js";import"./chunk-cb2fpajx.js";import"./chunk-3bfm4hrs.js";import"./chunk-wqfp8d9w.js";var SEARCH_TIMEOUT_MS=5000,CLI_NAME=activeCliName(),FIRST_PARTY=[{ref:"Sma1lboy/kobe-plugins/notify",desc:"Desktop/ntfy notifications when an agent finishes or needs input"},{ref:"Sma1lboy/kobe-plugins/github-start",desc:"Start a Rove task from a GitHub issue or PR"},{ref:"Sma1lboy/kobe-plugins/worktree-include",desc:"Copy .worktreeinclude-matched files into new worktrees"},{ref:"Sma1lboy/kobe-plugins/linear-start",desc:"Pick a Linear issue (fzf) and start a task on its branch"},{ref:"Sma1lboy/kobe-plugins/lazygit",desc:"lazygit on the task worktree, as a pane tab"},{ref:"Sma1lboy/kobe-plugins/browser",desc:"Chromium rendered as terminal cells (carbonyl) in a pane tab"}];async function fetchTopic(topic,query){let q=encodeURIComponent(`topic:${topic}${query?` ${query}`:""}`),ctrl=new AbortController,timer=setTimeout(()=>ctrl.abort(),SEARCH_TIMEOUT_MS);try{let res=await fetch(`https://api.github.com/search/repositories?q=${q}&sort=stars&order=desc&per_page=50`,{signal:ctrl.signal,headers:{accept:"application/vnd.github+json"}});if(!res.ok)return null;let body=await res.json();if(!Array.isArray(body.items))return null;return body.items.filter((r)=>typeof r.full_name==="string").map((r)=>({ref:r.full_name,desc:r.description??"",stars:r.stargazers_count}))}catch{return null}finally{clearTimeout(timer)}}async function searchMarketplace(query){let topicResults=await Promise.all([fetchTopic("rove-plugin",query),fetchTopic("kobe-plugin",query)]),lower=query?.toLowerCase(),seeds=FIRST_PARTY.filter((s)=>!lower||`${s.ref} ${s.desc}`.toLowerCase().includes(lower)).map((s)=>({...s,firstParty:!0})),entries=dedupeEntries([...seeds,...topicResults.flatMap((result)=>result??[])]);if(topicResults.every((result)=>result===null))console.error("(GitHub search unreachable \u2014 showing first-party plugins only)");if(entries.length===0){console.log(query?`no plugins match \`${query}\``:"no plugins found");return}let width=Math.min(48,Math.max(...entries.map((e)=>e.ref.length))+2);for(let e of entries){let stars=e.stars!==void 0?`\u2605${e.stars}`:e.firstParty?"first-party":"";console.log(`${e.ref.padEnd(width)}${stars.padEnd(12)}${e.desc}`)}console.log(`
2
+ import{activeCliName}from"./chunk-p7s4xwgx.js";import"./chunk-4pmd0mxp.js";import"./chunk-g56kvet6.js";import"./chunk-r3k9rbwm.js";import"./chunk-wqfp8d9w.js";var SEARCH_TIMEOUT_MS=5000,CLI_NAME=activeCliName(),FIRST_PARTY=[{ref:"Sma1lboy/kobe-plugins/notify",desc:"Desktop/ntfy notifications when an agent finishes or needs input"},{ref:"Sma1lboy/kobe-plugins/github-start",desc:"Start a Rove task from a GitHub issue or PR"},{ref:"Sma1lboy/kobe-plugins/worktree-include",desc:"Copy .worktreeinclude-matched files into new worktrees"},{ref:"Sma1lboy/kobe-plugins/linear-start",desc:"Pick a Linear issue (fzf) and start a task on its branch"},{ref:"Sma1lboy/kobe-plugins/lazygit",desc:"lazygit on the task worktree, as a pane tab"},{ref:"Sma1lboy/kobe-plugins/browser",desc:"Chromium rendered as terminal cells (carbonyl) in a pane tab"}];async function fetchTopic(topic,query){let q=encodeURIComponent(`topic:${topic}${query?` ${query}`:""}`),ctrl=new AbortController,timer=setTimeout(()=>ctrl.abort(),SEARCH_TIMEOUT_MS);try{let res=await fetch(`https://api.github.com/search/repositories?q=${q}&sort=stars&order=desc&per_page=50`,{signal:ctrl.signal,headers:{accept:"application/vnd.github+json"}});if(!res.ok)return null;let body=await res.json();if(!Array.isArray(body.items))return null;return body.items.filter((r)=>typeof r.full_name==="string").map((r)=>({ref:r.full_name,desc:r.description??"",stars:r.stargazers_count}))}catch{return null}finally{clearTimeout(timer)}}async function searchMarketplace(query){let topicResults=await Promise.all([fetchTopic("rove-plugin",query),fetchTopic("kobe-plugin",query)]),lower=query?.toLowerCase(),seeds=FIRST_PARTY.filter((s)=>!lower||`${s.ref} ${s.desc}`.toLowerCase().includes(lower)).map((s)=>({...s,firstParty:!0})),entries=dedupeEntries([...seeds,...topicResults.flatMap((result)=>result??[])]);if(topicResults.every((result)=>result===null))console.error("(GitHub search unreachable \u2014 showing first-party plugins only)");if(entries.length===0){console.log(query?`no plugins match \`${query}\``:"no plugins found");return}let width=Math.min(48,Math.max(...entries.map((e)=>e.ref.length))+2);for(let e of entries){let stars=e.stars!==void 0?`\u2605${e.stars}`:e.firstParty?"first-party":"";console.log(`${e.ref.padEnd(width)}${stars.padEnd(12)}${e.desc}`)}console.log(`
3
3
  install: ${CLI_NAME} plugin install <owner/repo[/subdir]> \u2014 browse: https://rove.run/plugins`)}function dedupeEntries(entries){let seen=new Set;return entries.filter((entry)=>{let key=entry.ref.toLowerCase();if(seen.has(key))return!1;return seen.add(key),!0})}export{searchMarketplace};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{isEngineActivityKind}from"./chunk-3ry6prwn.js";import{loadPluginRegistry,readPluginManifest}from"./chunk-d393z1mj.js";import{flagValue}from"./chunk-jvxh93nz.js";import{connectIfRunning}from"./chunk-5bn91n19.js";import{createEngineHookAdapter}from"./chunk-7z9cqycv.js";import{getPersistedString,setPersistedString}from"./chunk-deejtpcr.js";import{ALL_VENDORS}from"./chunk-bq3fyc0p.js";import{activeCliName}from"./chunk-ef11h2am.js";import{readRoveEnv}from"./chunk-3bfm4hrs.js";import{__require}from"./chunk-wqfp8d9w.js";import{join,resolve}from"path";var STDIN_READ_TIMEOUT_MS=500;async function readTextWithTimeout(read,timeoutMs=STDIN_READ_TIMEOUT_MS){let raceTimer;try{return await Promise.race([read(),new Promise((resolve2)=>{raceTimer=setTimeout(()=>resolve2(""),timeoutMs)})])}finally{if(raceTimer!==void 0)clearTimeout(raceTimer)}}async function readStdinPayload(){try{let text=await readTextWithTimeout(()=>Bun.stdin.text());if(!text.trim())return{};let parsed=JSON.parse(text);return parsed&&typeof parsed==="object"&&!Array.isArray(parsed)?parsed:{}}catch{return{}}}async function runHookSubcommand(argv){let[verb,...rest]=argv;if(verb==="setup"){await runHookSetup(rest);return}if(verb==="cleanup"){await runHookCleanup();return}try{if(!verb||!isEngineActivityKind(verb))return;let payload=await readStdinPayload(),taskId=flagValue(rest,"--task-id"),cwd=typeof payload.cwd==="string"&&payload.cwd?payload.cwd:process.cwd(),envTaskId=process.env.KOBE_TASK_ID,envTabId=process.env.KOBE_TAB_ID,engine=flagValue(rest,"--engine"),adapters=activityHookAdapters().filter((a)=>!engine||a.vendor===engine),detail;for(let adapter of adapters)if(detail=adapter.activityDetailFromPayload(verb,payload),detail)break;let session;for(let adapter of adapters)if(session=adapter.sessionFromPayload(payload),session)break;let client=await connectIfRunning();if(!client)return;try{let effectiveTaskId=taskId??envTaskId;await client.request("engine.reportEvent",{...effectiveTaskId?{taskId:effectiveTaskId}:{cwd},kind:verb,...engine?{engine}:{},...envTabId?{tabId:envTabId}:{},...detail?{detail}:{},...session?{sessionId:session.sessionId}:{},...session?.transcriptPath?{transcriptPath:session.transcriptPath}:{}})}finally{client.close()}}catch(err){if(readRoveEnv("HOOK_DEBUG"))console.error(`[rove hook] ${verb} failed:`,err instanceof Error?err.message:String(err))}}var SYNC_SETTING_KEY="externalWorktreeSync";function worktreeSyncAdapters(){return ALL_VENDORS.map((v)=>createEngineHookAdapter(v)).filter((a)=>a.supportsWorktreeSync())}function activityHookAdapters(){return ALL_VENDORS.map((v)=>createEngineHookAdapter(v)).filter((a)=>a.supportsHooks())}function globalSettingsPath(){return worktreeSyncAdapters()[0]?.globalSettingsPath()}function persistedSyncPath(stored){if(!stored||stored==="off")return;if(stored==="global")return globalSettingsPath();if(stored.startsWith("repo:"))return join(resolve(stored.slice(5)),".claude","settings.json");return stored}async function ensureGlobalKobeHooks(){try{let{isRovePluginEnabled,detectLegacyInstalls,migrationHint}=await import("./chunk-8r1pnch1.js"),pluginMode=isRovePluginEnabled();if(pluginMode){let hint=migrationHint(detectLegacyInstalls(),activeCliName());if(hint)process.stderr.write(`
2
+ import{isEngineActivityKind}from"./chunk-3ry6prwn.js";import{loadPluginRegistry,readPluginManifest}from"./chunk-38272eqv.js";import{flagValue}from"./chunk-jvxh93nz.js";import{connectIfRunning}from"./chunk-4502n1bk.js";import{createEngineHookAdapter}from"./chunk-4gjr08g0.js";import{getPersistedString,setPersistedString}from"./chunk-kt1ppyje.js";import{ALL_VENDORS}from"./chunk-bq3fyc0p.js";import{activeCliName}from"./chunk-p7s4xwgx.js";import{readRoveEnv}from"./chunk-r3k9rbwm.js";import{__require}from"./chunk-wqfp8d9w.js";import{join,resolve}from"path";var STDIN_READ_TIMEOUT_MS=500;async function readTextWithTimeout(read,timeoutMs=STDIN_READ_TIMEOUT_MS){let raceTimer;try{return await Promise.race([read(),new Promise((resolve2)=>{raceTimer=setTimeout(()=>resolve2(""),timeoutMs)})])}finally{if(raceTimer!==void 0)clearTimeout(raceTimer)}}async function readStdinPayload(){try{let text=await readTextWithTimeout(()=>Bun.stdin.text());if(!text.trim())return{};let parsed=JSON.parse(text);return parsed&&typeof parsed==="object"&&!Array.isArray(parsed)?parsed:{}}catch{return{}}}async function runHookSubcommand(argv){let[verb,...rest]=argv;if(verb==="setup"){await runHookSetup(rest);return}if(verb==="cleanup"){await runHookCleanup();return}try{if(!verb||!isEngineActivityKind(verb))return;let payload=await readStdinPayload(),taskId=flagValue(rest,"--task-id"),cwd=typeof payload.cwd==="string"&&payload.cwd?payload.cwd:process.cwd(),envTaskId=process.env.KOBE_TASK_ID,envTabId=process.env.KOBE_TAB_ID,engine=flagValue(rest,"--engine"),adapters=activityHookAdapters().filter((a)=>!engine||a.vendor===engine),detail;for(let adapter of adapters)if(detail=adapter.activityDetailFromPayload(verb,payload),detail)break;let session;for(let adapter of adapters)if(session=adapter.sessionFromPayload(payload),session)break;let client=await connectIfRunning();if(!client)return;try{let effectiveTaskId=taskId??envTaskId;await client.request("engine.reportEvent",{...effectiveTaskId?{taskId:effectiveTaskId}:{cwd},kind:verb,...engine?{engine}:{},...envTabId?{tabId:envTabId}:{},...detail?{detail}:{},...session?{sessionId:session.sessionId}:{},...session?.transcriptPath?{transcriptPath:session.transcriptPath}:{}})}finally{client.close()}}catch(err){if(readRoveEnv("HOOK_DEBUG"))console.error(`[rove hook] ${verb} failed:`,err instanceof Error?err.message:String(err))}}var SYNC_SETTING_KEY="externalWorktreeSync";function worktreeSyncAdapters(){return ALL_VENDORS.map((v)=>createEngineHookAdapter(v)).filter((a)=>a.supportsWorktreeSync())}function activityHookAdapters(){return ALL_VENDORS.map((v)=>createEngineHookAdapter(v)).filter((a)=>a.supportsHooks())}function globalSettingsPath(){return worktreeSyncAdapters()[0]?.globalSettingsPath()}function persistedSyncPath(stored){if(!stored||stored==="off")return;if(stored==="global")return globalSettingsPath();if(stored.startsWith("repo:"))return join(resolve(stored.slice(5)),".claude","settings.json");return stored}async function ensureGlobalKobeHooks(){try{let{isRovePluginEnabled,detectLegacyInstalls,migrationHint}=await import("./chunk-bwyskwer.js"),pluginMode=isRovePluginEnabled();if(pluginMode){let hint=migrationHint(detectLegacyInstalls(),activeCliName());if(hint)process.stderr.write(`
3
3
  ${hint}
4
4
  `)}let toolEvents=pluginsWantToolEvents();for(let a of activityHookAdapters()){if(pluginMode&&a.vendor==="claude")continue;let enginePath=a.globalSettingsPath();if(!enginePath)continue;await a.installActivityHooks(enginePath,{toolEvents}),await a.removeWorktreeWatchHook(enginePath)}await cleanupWorktreeSyncHook()}catch{}}function pluginsWantToolEvents(){try{for(let entry of loadPluginRegistry().plugins){if(!entry.enabled)continue;try{if(readPluginManifest(entry.root).manifest.events.some((e)=>e.on.startsWith("tool.")))return!0}catch{}}}catch{}return!1}async function cleanupWorktreeSyncHook(){let adapters=worktreeSyncAdapters();if(adapters.length===0)return;let stored=getPersistedString(SYNC_SETTING_KEY),paths=new Set;for(let adapter of adapters){let file=adapter.globalSettingsPath();if(file)paths.add(file)}let prev=persistedSyncPath(stored);if(prev)paths.add(prev);for(let a of adapters)for(let p of paths)await a.removeWorktreeSyncHook(p);if(stored!=="off")setPersistedString(SYNC_SETTING_KEY,"off")}async function runHookCleanup(){let claude=activityHookAdapters().find((a)=>a.vendor==="claude"),path=claude?.globalSettingsPath();if(!claude||!path){process.stdout.write(`rove hook cleanup: no Claude hook adapter \u2014 nothing to do.
5
5
  `);return}await claude.removeActivityHooks(path),await claude.removeWorktreeWatchHook(path),process.stdout.write([`rove hook cleanup: removed Rove's settings-managed hooks from ${path}.`,"Only Rove's own entries were touched; your other hooks are intact.","The Claude Code plugin's hooks.json now carries these events (if the plugin","is not installed, the next Rove launch reinstalls the settings-managed set).",""].join(`
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ import{COMPAT_STATE_DIR_BASENAME,ROVE_STATE_DIR_BASENAME,readRoveEnv,readRoveHomeDirEnv}from"./chunk-r3k9rbwm.js";import{createHash}from"crypto";import{existsSync,readFileSync}from"fs";import{homedir,tmpdir}from"os";import{join}from"path";function stateDirs(homeDir){return{canonical:join(homeDir,ROVE_STATE_DIR_BASENAME),legacy:join(homeDir,COMPAT_STATE_DIR_BASENAME)}}function pidIsLive(pidPath){try{let pid=Number.parseInt(readFileSync(pidPath,"utf8").trim(),10);if(!Number.isInteger(pid)||pid<=1)return!1;return process.kill(pid,0),!0}catch{return!1}}function runtimePath(homeDir,name,pidName){let{canonical,legacy}=stateDirs(homeDir),canonicalPath=join(canonical,name);if(existsSync(canonicalPath))return canonicalPath;let legacyPath=join(legacy,name);if(existsSync(legacyPath)&&pidIsLive(join(legacy,pidName)))return legacyPath;return canonicalPath}function legacyRuntimePath(homeDir,name){return join(homeDir,COMPAT_STATE_DIR_BASENAME,name)}function legacyDaemonSocketPath(homeDir){return legacyRuntimePath(homeDir,"daemon.sock")}function legacyDaemonPidPath(homeDir){return legacyRuntimePath(homeDir,"daemon.pid")}function legacyPtyHostSocketPath(homeDir){return legacyRuntimePath(homeDir,"pty.sock")}function legacyPtyHostPidPath(homeDir){return legacyRuntimePath(homeDir,"pty.pid")}function runtimeDataPath(homeDir,name){return join(stateDirs(homeDir).canonical,name)}var SOCKET_PATH_SAFETY_LIMIT=100;function shortHomeTag(homeDir){return createHash("sha1").update(homeDir).digest("hex").slice(0,8)}function fitSocketPath(naturalPath,homeDir,role,pidTag){if(Buffer.byteLength(naturalPath,"utf8")<=SOCKET_PATH_SAFETY_LIMIT)return naturalPath;let tag=shortHomeTag(homeDir),suffix=pidTag===void 0?"":`-${pidTag}`,fallback=join(tmpdir(),`kobe-${tag}-${role}${suffix}.sock`);if(Buffer.byteLength(fallback,"utf8")<=SOCKET_PATH_SAFETY_LIMIT)return fallback;throw Error(`daemon socket path exceeds ${SOCKET_PATH_SAFETY_LIMIT} bytes even after fallback: ${fallback}`)}function defaultDaemonSocketPath(homeDir){let override=readRoveEnv("DAEMON_SOCKET_PATH");if(override)return override;let explicit=homeDir??readRoveHomeDirEnv();if(explicit&&explicit.length>0)return fitSocketPath(runtimePath(explicit,"daemon.sock","daemon.pid"),explicit,"daemon");let runtimeDir=process.env.XDG_RUNTIME_DIR;if(runtimeDir&&runtimeDir.length>0)return fitSocketPath(join(runtimeDir,"kobe.sock"),runtimeDir,"daemon");let home=homedir();return fitSocketPath(runtimePath(home,"daemon.sock","daemon.pid"),home,"daemon")}function resolveDaemonHomeDir(homeDir){let explicit=homeDir??readRoveHomeDirEnv();return explicit&&explicit.length>0?explicit:homedir()}function defaultDaemonPidPath(homeDir=readRoveHomeDirEnv()??homedir()){let override=readRoveEnv("DAEMON_PID_PATH");if(override)return override;return runtimePath(homeDir,"daemon.pid","daemon.pid")}function defaultDaemonLogPath(homeDir=readRoveHomeDirEnv()??homedir()){return join(homeDir,ROVE_STATE_DIR_BASENAME,"daemon.log")}function defaultClientLogPath(homeDir=readRoveHomeDirEnv()??homedir()){return join(homeDir,ROVE_STATE_DIR_BASENAME,"client.log")}function isWindowsPipePath(path){return path.startsWith("\\\\.\\pipe\\")||path.startsWith("//./pipe/")}function windowsPipePath(homeDir,role){return`\\\\.\\pipe\\kobe-${shortHomeTag(homeDir)}-${role}`}function defaultPtyHostSocketPath(homeDir,platform=process.platform){let override=readRoveEnv("PTY_SOCKET_PATH");if(override)return override;let explicit=homeDir??readRoveHomeDirEnv();if(platform==="win32")return windowsPipePath(explicit||homedir(),"pty");if(explicit&&explicit.length>0)return fitSocketPath(runtimePath(explicit,"pty.sock","pty.pid"),explicit,"pty");let runtimeDir=process.env.XDG_RUNTIME_DIR;if(runtimeDir&&runtimeDir.length>0)return fitSocketPath(join(runtimeDir,"kobe-pty.sock"),runtimeDir,"pty");let home=homedir();return fitSocketPath(runtimePath(home,"pty.sock","pty.pid"),home,"pty")}function defaultPtyHostPidPath(homeDir=readRoveHomeDirEnv()??homedir()){let override=readRoveEnv("PTY_PID_PATH");if(override)return override;return runtimePath(homeDir,"pty.pid","pty.pid")}function defaultPtyHostLogPath(homeDir=readRoveHomeDirEnv()??homedir()){return join(homeDir,ROVE_STATE_DIR_BASENAME,"pty.log")}function defaultPtyExitsPath(homeDir=readRoveHomeDirEnv()??homedir()){return runtimeDataPath(homeDir,"pty-exits.json")}function defaultWebTokenPath(homeDir=readRoveHomeDirEnv()??homedir()){return runtimeDataPath(homeDir,"web-token")}function defaultPtyFreezeDir(homeDir=readRoveHomeDirEnv()??homedir()){return runtimeDataPath(homeDir,"pty-sessions")}
3
+ export{legacyRuntimePath,legacyDaemonSocketPath,legacyDaemonPidPath,legacyPtyHostSocketPath,legacyPtyHostPidPath,shortHomeTag,fitSocketPath,defaultDaemonSocketPath,resolveDaemonHomeDir,defaultDaemonPidPath,defaultDaemonLogPath,defaultClientLogPath,isWindowsPipePath,windowsPipePath,defaultPtyHostSocketPath,defaultPtyHostPidPath,defaultPtyHostLogPath,defaultPtyExitsPath,defaultWebTokenPath,defaultPtyFreezeDir};
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{BREAKING_VERSIONS,CURRENT_VERSION,compareSemver}from"./chunk-55xkvzvw.js";import{loadStateFile,patchStateFile}from"./chunk-rsqx358z.js";import{activeCliName}from"./chunk-ef11h2am.js";var LAST_RUN_VERSION_KEY="app.lastRunVersion";function resetGateBlockers(lastRun,current=CURRENT_VERSION,breaking=BREAKING_VERSIONS){if(typeof lastRun!=="string"||lastRun.length===0)return[];let[lo,hi]=compareSemver(lastRun,current)<=0?[lastRun,current]:[current,lastRun];return breaking.filter((b)=>compareSemver(b,lo)>0&&compareSemver(b,hi)<=0)}function enforceResetGate(){let cliName=activeCliName(),lastRun=loadStateFile()[LAST_RUN_VERSION_KEY],blockers=resetGateBlockers(lastRun);if(blockers.length>0){let from=typeof lastRun==="string"?lastRun:"unknown";console.error([`${cliName} ${CURRENT_VERSION}: cannot start \u2014 version ${blockers.join(", ")} introduced breaking changes`,`(last run: ${from}). Your daemon/session state may be incompatible.`,"","Run:",` ${cliName} reset # stop daemon + PTY host + sessions (tasks kept)`,` ${cliName} reset --hard # additionally wipe the task index + UI state`,"","Then relaunch Rove. Worktrees are never touched."].join(`
2
+ import{BREAKING_VERSIONS,CURRENT_VERSION,compareSemver}from"./chunk-98zhyhpz.js";import{loadStateFile,patchStateFile}from"./chunk-5v893waj.js";import{activeCliName}from"./chunk-p7s4xwgx.js";var LAST_RUN_VERSION_KEY="app.lastRunVersion";function resetGateBlockers(lastRun,current=CURRENT_VERSION,breaking=BREAKING_VERSIONS){if(typeof lastRun!=="string"||lastRun.length===0)return[];let[lo,hi]=compareSemver(lastRun,current)<=0?[lastRun,current]:[current,lastRun];return breaking.filter((b)=>compareSemver(b,lo)>0&&compareSemver(b,hi)<=0)}function enforceResetGate(){let cliName=activeCliName(),lastRun=loadStateFile()[LAST_RUN_VERSION_KEY],blockers=resetGateBlockers(lastRun);if(blockers.length>0){let from=typeof lastRun==="string"?lastRun:"unknown";console.error([`${cliName} ${CURRENT_VERSION}: cannot start \u2014 version ${blockers.join(", ")} introduced breaking changes`,`(last run: ${from}). Your daemon/session state may be incompatible.`,"","Run:",` ${cliName} reset # stop daemon + PTY host + sessions (tasks kept)`,` ${cliName} reset --hard # additionally wipe the task index + UI state`,"","Then relaunch Rove. Worktrees are never touched."].join(`
3
3
  `)),process.exit(1)}if(lastRun!==CURRENT_VERSION)stampResetGate()}function stampResetGate(){try{patchStateFile({[LAST_RUN_VERSION_KEY]:CURRENT_VERSION})}catch{}}
4
4
  export{LAST_RUN_VERSION_KEY,enforceResetGate,stampResetGate};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{getGlobalDefaultVendor,getRepoLastActiveVendor,resolvePreferredVendor,setGlobalDefaultVendor,setRepoLastActiveVendor}from"./chunk-caqpt09m.js";import"./chunk-kt1ppyje.js";import"./chunk-5v893waj.js";import"./chunk-xy8be792.js";import"./chunk-a3a9gdc4.js";import"./chunk-3wj69b0a.js";import"./chunk-ch9b1d5y.js";import"./chunk-bq3fyc0p.js";import"./chunk-g56kvet6.js";import"./chunk-r3k9rbwm.js";import"./chunk-wqfp8d9w.js";export{setRepoLastActiveVendor,setGlobalDefaultVendor,resolvePreferredVendor,getRepoLastActiveVendor,getGlobalDefaultVendor};