@sma1lboy/rove 0.9.238 → 0.9.239

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 (237) hide show
  1. package/README.md +2 -2
  2. package/dist/cli/{chunk-77w83wgh.js → chunk-0k91029d.js} +1 -1
  3. package/dist/cli/chunk-0mj358p5.js +3 -0
  4. package/dist/cli/chunk-0n7w8t48.js +2 -0
  5. package/dist/cli/{chunk-grt1e2s8.js → chunk-0wrh5s5y.js} +2 -2
  6. package/dist/cli/{chunk-nntg9d85.js → chunk-0y4qgnby.js} +1 -1
  7. package/dist/cli/chunk-1brfxbvg.js +4 -0
  8. package/dist/cli/{chunk-bhqracn8.js → chunk-20qm75rb.js} +1 -1
  9. package/dist/cli/chunk-21fm5tks.js +2 -0
  10. package/dist/cli/{chunk-bkbmqec2.js → chunk-28zg6p31.js} +1 -1
  11. package/dist/cli/chunk-2andp9gs.js +2 -0
  12. package/dist/cli/{chunk-r2pztgm6.js → chunk-2bgmby1d.js} +1 -1
  13. package/dist/cli/{chunk-hk8mc43r.js → chunk-2s2xy444.js} +5 -5
  14. package/dist/cli/chunk-2vgc5cyj.js +2 -0
  15. package/dist/cli/chunk-2x9yc5nx.js +2 -0
  16. package/dist/cli/chunk-30kjq5m7.js +2 -0
  17. package/dist/cli/{chunk-mkksdcsw.js → chunk-3342qzve.js} +1 -1
  18. package/dist/cli/chunk-3aqhytyy.js +3 -0
  19. package/dist/cli/chunk-3c58659p.js +2 -0
  20. package/dist/cli/chunk-3d1hjrq0.js +2 -0
  21. package/dist/cli/chunk-41x1hrqe.js +3 -0
  22. package/dist/cli/{chunk-mhg40es1.js → chunk-4hestsjp.js} +1 -1
  23. package/dist/cli/{chunk-s1p650mm.js → chunk-53cyns0f.js} +1 -1
  24. package/dist/cli/chunk-576r5nht.js +5 -0
  25. package/dist/cli/{chunk-acw32w13.js → chunk-5akk3wap.js} +6 -5
  26. package/dist/cli/chunk-7cce0st1.js +3 -0
  27. package/dist/cli/{chunk-zyd6k6ak.js → chunk-7q43tysm.js} +1 -1
  28. package/dist/cli/chunk-8bn6eg67.js +8 -0
  29. package/dist/cli/chunk-8rf7nzan.js +4 -0
  30. package/dist/cli/chunk-96cjpssp.js +3 -0
  31. package/dist/cli/{chunk-bs7v83x0.js → chunk-9aydqazr.js} +1 -1
  32. package/dist/cli/{chunk-7txq91d9.js → chunk-9jsm6h5y.js} +1 -1
  33. package/dist/cli/{chunk-pz907kve.js → chunk-9w5g7frx.js} +1 -1
  34. package/dist/cli/{chunk-vnpqemb0.js → chunk-a7kq09ke.js} +1 -1
  35. package/dist/cli/chunk-acxznk3y.js +2 -0
  36. package/dist/cli/chunk-adkva3ep.js +6 -0
  37. package/dist/cli/{chunk-nvqdmx7q.js → chunk-ag3txfg2.js} +1 -1
  38. package/dist/cli/{chunk-2rg6aw59.js → chunk-atmaakwp.js} +1 -1
  39. package/dist/cli/chunk-axsm0gn5.js +3 -0
  40. package/dist/cli/chunk-b0ssvpht.js +3 -0
  41. package/dist/cli/chunk-b39sdtt0.js +3 -0
  42. package/dist/cli/{chunk-2yd128k1.js → chunk-b9q8c2qg.js} +6 -6
  43. package/dist/cli/{chunk-g56km26e.js → chunk-bn73kd6z.js} +1 -1
  44. package/dist/cli/chunk-c2m55b72.js +4 -0
  45. package/dist/cli/{chunk-b503z32q.js → chunk-c60qsnfw.js} +3 -3
  46. package/dist/cli/{chunk-ch0ehc06.js → chunk-cbc1h345.js} +1 -1
  47. package/dist/cli/{chunk-dnbh8hsm.js → chunk-cbjh43yc.js} +1 -1
  48. package/dist/cli/{chunk-pzbrj3gd.js → chunk-cmcn8e8x.js} +1 -1
  49. package/dist/cli/{chunk-cv1kaq8a.js → chunk-cp89n425.js} +5 -5
  50. package/dist/cli/chunk-cst86kt3.js +2 -0
  51. package/dist/cli/chunk-des00203.js +2 -0
  52. package/dist/cli/chunk-dgs0m8r4.js +3 -0
  53. package/dist/cli/chunk-dkgxz9hf.js +5 -0
  54. package/dist/cli/{chunk-gqphk56d.js → chunk-ekg3h5z3.js} +7 -7
  55. package/dist/cli/chunk-fert44x2.js +2 -0
  56. package/dist/cli/chunk-ff1h2qxd.js +2 -0
  57. package/dist/cli/{chunk-cv6r89jp.js → chunk-ffs26p85.js} +1 -1
  58. package/dist/cli/chunk-fft50thp.js +3 -0
  59. package/dist/cli/{chunk-hp32tbes.js → chunk-fg62y5fm.js} +1 -1
  60. package/dist/cli/{chunk-s9a974w9.js → chunk-fvmee0tr.js} +1 -1
  61. package/dist/cli/chunk-g4c4ffqp.js +20 -0
  62. package/dist/cli/{chunk-k7g060qr.js → chunk-g4j41mky.js} +2 -2
  63. package/dist/cli/{chunk-j6kataan.js → chunk-g5c5jytr.js} +1 -1
  64. package/dist/cli/{chunk-1bm6sryf.js → chunk-ga1pb0mr.js} +1 -1
  65. package/dist/cli/{chunk-dqndd97s.js → chunk-gkdfct7t.js} +2 -2
  66. package/dist/cli/chunk-gqydm0q8.js +2 -0
  67. package/dist/cli/chunk-gvrtrvnz.js +96 -0
  68. package/dist/cli/chunk-h2m7em1e.js +3 -0
  69. package/dist/cli/chunk-h33m6cc6.js +8 -0
  70. package/dist/cli/{chunk-ynbfqbn9.js → chunk-h3fckxn3.js} +1 -1
  71. package/dist/cli/chunk-h7y9v8k1.js +4 -0
  72. package/dist/cli/{chunk-32mv1yy6.js → chunk-h9cg0j3a.js} +1 -1
  73. package/dist/cli/{chunk-h4qv19v8.js → chunk-hbn1t161.js} +1 -1
  74. package/dist/cli/{chunk-mb1e73jm.js → chunk-hen7jj2h.js} +2 -2
  75. package/dist/cli/{chunk-3es6spp4.js → chunk-hq9tbzqa.js} +2 -2
  76. package/dist/cli/{chunk-snjte1rd.js → chunk-hr2xky15.js} +1 -1
  77. package/dist/cli/{chunk-s0snbj93.js → chunk-kb6xw0fw.js} +1 -1
  78. package/dist/cli/{chunk-8h0khkap.js → chunk-ker4971f.js} +2 -2
  79. package/dist/cli/{chunk-vyb5a2rh.js → chunk-kg9kmwt9.js} +1 -1
  80. package/dist/cli/chunk-ktzbg4jg.js +2 -0
  81. package/dist/cli/chunk-m4f5h05c.js +10 -0
  82. package/dist/cli/chunk-m6q44xc0.js +2 -0
  83. package/dist/cli/{chunk-hq2n27y1.js → chunk-mw0ysrpd.js} +1 -1
  84. package/dist/cli/{chunk-2cwb64fj.js → chunk-n5dea05t.js} +1 -1
  85. package/dist/cli/chunk-nc46gddg.js +3 -0
  86. package/dist/cli/{chunk-jhbc9nx2.js → chunk-nckmga7j.js} +1 -1
  87. package/dist/cli/chunk-nem2x959.js +2 -0
  88. package/dist/cli/chunk-ng12dprz.js +2 -0
  89. package/dist/cli/chunk-npwzmmv9.js +3 -0
  90. package/dist/cli/chunk-nzh30nty.js +4 -0
  91. package/dist/cli/{chunk-gqrh2gp1.js → chunk-p024scd4.js} +1 -1
  92. package/dist/cli/chunk-p18ehv9y.js +7 -0
  93. package/dist/cli/chunk-p6qr8sen.js +2 -0
  94. package/dist/cli/{chunk-3sg5v7cg.js → chunk-p83wf4zw.js} +2 -2
  95. package/dist/cli/{chunk-s278gjet.js → chunk-pdvyfz3n.js} +1 -1
  96. package/dist/cli/chunk-pe6wnsww.js +2 -0
  97. package/dist/cli/{chunk-z5fnv7nk.js → chunk-pqzbk1cz.js} +25 -23
  98. package/dist/cli/chunk-prqeddy7.js +3 -0
  99. package/dist/cli/chunk-pvm3fc44.js +2 -0
  100. package/dist/cli/chunk-qd5zgq91.js +10 -0
  101. package/dist/cli/chunk-qvfdqrbf.js +3 -0
  102. package/dist/cli/{chunk-2xsem13q.js → chunk-qzsahxd9.js} +1 -1
  103. package/dist/cli/{chunk-0wgheepg.js → chunk-rahv4nrm.js} +3 -3
  104. package/dist/cli/chunk-rqyaf0dw.js +4 -0
  105. package/dist/cli/chunk-s57vy3k3.js +2 -0
  106. package/dist/cli/{chunk-g2advs8t.js → chunk-sak1tphp.js} +1 -1
  107. package/dist/cli/{chunk-vdcn6h48.js → chunk-snhcvjdb.js} +1 -1
  108. package/dist/cli/chunk-ss8c3b25.js +3 -0
  109. package/dist/cli/{chunk-bav389wj.js → chunk-svm809bx.js} +1 -1
  110. package/dist/cli/chunk-t8v9rpdx.js +2 -0
  111. package/dist/cli/{chunk-j4xfsn9g.js → chunk-tbrkck2f.js} +1 -1
  112. package/dist/cli/chunk-tdhk4dz8.js +4 -0
  113. package/dist/cli/chunk-try1f2h3.js +3 -0
  114. package/dist/cli/{chunk-aj7fkrha.js → chunk-tsj1054w.js} +1 -1
  115. package/dist/cli/{chunk-t3wwsz29.js → chunk-tvk46rfs.js} +1 -1
  116. package/dist/cli/{chunk-4d54zgc7.js → chunk-twyda1p8.js} +2 -2
  117. package/dist/cli/{chunk-s1e0e9hc.js → chunk-vej49hnt.js} +2 -2
  118. package/dist/cli/chunk-w2sp489k.js +3 -0
  119. package/dist/cli/chunk-wfhnbnbw.js +2 -0
  120. package/dist/cli/{chunk-0wh2ff77.js → chunk-whbm14qr.js} +2 -2
  121. package/dist/cli/{chunk-ww4fbx8h.js → chunk-wtb8cycx.js} +2 -2
  122. package/dist/cli/chunk-wvmjdnhk.js +2 -0
  123. package/dist/cli/chunk-x9s14ppv.js +4 -0
  124. package/dist/cli/{chunk-dq2mh3b3.js → chunk-xv8fhxxm.js} +1 -1
  125. package/dist/cli/{chunk-85pk7c74.js → chunk-xx166cdv.js} +1 -1
  126. package/dist/cli/{chunk-ssfj9td0.js → chunk-y8tysjc2.js} +15 -13
  127. package/dist/cli/{chunk-y3k1accw.js → chunk-yexx8nec.js} +1 -1
  128. package/dist/cli/{chunk-9prawccj.js → chunk-yt15y085.js} +1 -1
  129. package/dist/cli/{chunk-n0mg67wn.js → chunk-ytxk6zqc.js} +1 -1
  130. package/dist/cli/chunk-yvjgwnb9.js +2 -0
  131. package/dist/cli/{chunk-n24dmy2r.js → chunk-yxt1y0n3.js} +9 -9
  132. package/dist/cli/chunk-ze0htjr5.js +2 -0
  133. package/dist/cli/chunk-zeb0sttx.js +2 -0
  134. package/dist/cli/chunk-znjcesdr.js +5 -0
  135. package/dist/cli/chunk-zsfyj36g.js +3 -0
  136. package/dist/cli/chunk-zt49bbg9.js +3 -0
  137. package/dist/cli/chunk-zt7wfnva.js +3 -0
  138. package/dist/cli/{chunk-6rvzzrd7.js → chunk-zx2n95qe.js} +1 -1
  139. package/dist/cli/{chunk-zwgns5ce.js → chunk-zxsbz3kk.js} +1 -1
  140. package/dist/cli/index.js +12 -10
  141. package/dist/cli/pty-host-node.mjs +880 -169
  142. package/dist/cli/rove-run.js +1 -1
  143. package/dist/cli/rove.js +6 -6
  144. package/dist/skills/rove/SKILL.md +1 -1
  145. package/dist/skills/rove/references/api-flags.md +5 -5
  146. package/dist/web-ui/assets/{harness-CQ-1WI4q.js → harness-BHiciz5A.js} +2 -2
  147. package/dist/web-ui/assets/{index-_ttAn6pY.js → index-BkxJISAI.js} +2 -2
  148. package/dist/web-ui/assets/{index-C4dLQEqf.css → index-nMJ42IGm.css} +1 -1
  149. package/dist/web-ui/index.html +2 -2
  150. package/dist/web-ui/origin-policy.mjs +1 -1
  151. package/dist/web-ui/pty-server.mjs +24 -10
  152. package/dist/web-ui/pty-session-lifecycle.mjs +9 -13
  153. package/package.json +6 -8
  154. package/dist/cli/chunk-05jej26n.js +0 -3
  155. package/dist/cli/chunk-079cyb2e.js +0 -4
  156. package/dist/cli/chunk-1265fmzk.js +0 -3
  157. package/dist/cli/chunk-1da3bqjc.js +0 -4
  158. package/dist/cli/chunk-1tx1s5v6.js +0 -2
  159. package/dist/cli/chunk-507zn8rs.js +0 -3
  160. package/dist/cli/chunk-53afdybj.js +0 -3
  161. package/dist/cli/chunk-544bwsss.js +0 -4
  162. package/dist/cli/chunk-67ev8k22.js +0 -2
  163. package/dist/cli/chunk-6s5mev2n.js +0 -4
  164. package/dist/cli/chunk-6x5vzzpx.js +0 -3
  165. package/dist/cli/chunk-7s1kx9ez.js +0 -2
  166. package/dist/cli/chunk-85mk6j0s.js +0 -3
  167. package/dist/cli/chunk-8hbtca1g.js +0 -3
  168. package/dist/cli/chunk-8pa1ph1s.js +0 -7
  169. package/dist/cli/chunk-9ek7xm94.js +0 -8
  170. package/dist/cli/chunk-9k47xr7m.js +0 -2
  171. package/dist/cli/chunk-9mtxxsb3.js +0 -2
  172. package/dist/cli/chunk-a1k2z44b.js +0 -2
  173. package/dist/cli/chunk-a3yyrabb.js +0 -2
  174. package/dist/cli/chunk-ahnk6zx3.js +0 -2
  175. package/dist/cli/chunk-bc18gat5.js +0 -4
  176. package/dist/cli/chunk-be757xzj.js +0 -3
  177. package/dist/cli/chunk-bw73t1zw.js +0 -5
  178. package/dist/cli/chunk-c2tevj9f.js +0 -2
  179. package/dist/cli/chunk-d1agt94n.js +0 -8
  180. package/dist/cli/chunk-dc31fzrm.js +0 -2
  181. package/dist/cli/chunk-dw853n4w.js +0 -3
  182. package/dist/cli/chunk-eawt4n4g.js +0 -2
  183. package/dist/cli/chunk-egx76ah2.js +0 -5
  184. package/dist/cli/chunk-ex1a2djb.js +0 -2
  185. package/dist/cli/chunk-f5e3dcxe.js +0 -2
  186. package/dist/cli/chunk-fwb72vzc.js +0 -2
  187. package/dist/cli/chunk-fxs82dsx.js +0 -4
  188. package/dist/cli/chunk-g3r1dwy9.js +0 -3
  189. package/dist/cli/chunk-ge30p4s5.js +0 -3
  190. package/dist/cli/chunk-gmgsxdrf.js +0 -10
  191. package/dist/cli/chunk-he76emdm.js +0 -2
  192. package/dist/cli/chunk-hgx20x94.js +0 -2
  193. package/dist/cli/chunk-hnfp317x.js +0 -2
  194. package/dist/cli/chunk-hq4b3fca.js +0 -3
  195. package/dist/cli/chunk-janvvpv5.js +0 -8
  196. package/dist/cli/chunk-jvxh93nz.js +0 -3
  197. package/dist/cli/chunk-k6nxyxyh.js +0 -3
  198. package/dist/cli/chunk-k8tspshr.js +0 -2
  199. package/dist/cli/chunk-md8k7c5w.js +0 -2
  200. package/dist/cli/chunk-mppda1wq.js +0 -3
  201. package/dist/cli/chunk-ppwpjm39.js +0 -3
  202. package/dist/cli/chunk-pvw2y93q.js +0 -25
  203. package/dist/cli/chunk-pw6yfj10.js +0 -3
  204. package/dist/cli/chunk-q4nehkj9.js +0 -2
  205. package/dist/cli/chunk-qagek3wg.js +0 -5
  206. package/dist/cli/chunk-r8xqvg26.js +0 -2
  207. package/dist/cli/chunk-rz8zs7j8.js +0 -3
  208. package/dist/cli/chunk-sb0ns0c7.js +0 -3
  209. package/dist/cli/chunk-tcj36cqg.js +0 -2
  210. package/dist/cli/chunk-vejgnmcp.js +0 -2
  211. package/dist/cli/chunk-vzqrj32e.js +0 -2
  212. package/dist/cli/chunk-wpsbyq4s.js +0 -2
  213. package/dist/cli/chunk-wtqxv2rv.js +0 -39
  214. package/dist/cli/chunk-y05d79az.js +0 -2
  215. package/dist/cli/chunk-y4048296.js +0 -4
  216. package/dist/cli/chunk-y8fqdnh3.js +0 -3
  217. package/dist/cli/chunk-ygd572ee.js +0 -4
  218. package/dist/cli/chunk-yj5pjxx2.js +0 -2
  219. package/dist/cli/chunk-zja9chrd.js +0 -4
  220. package/dist/cli/chunk-zwej00t0.js +0 -5
  221. package/dist/cli/kobe-run.js +0 -3
  222. package/dist/cli/kobe.js +0 -7
  223. package/dist/completions/kobe.bash +0 -25
  224. package/dist/completions/kobe.fish +0 -27
  225. package/dist/completions/kobe.zsh +0 -35
  226. /package/dist/cli/{chunk-hqbmzz4t.js → chunk-0422g8ac.js} +0 -0
  227. /package/dist/cli/{chunk-khj0apc7.js → chunk-2tfnscxk.js} +0 -0
  228. /package/dist/cli/{chunk-7q67dz4c.js → chunk-4250pw6r.js} +0 -0
  229. /package/dist/cli/{chunk-xsrcwcjc.js → chunk-5mhvjytn.js} +0 -0
  230. /package/dist/cli/{chunk-ef39ym8f.js → chunk-7bgbansg.js} +0 -0
  231. /package/dist/cli/{chunk-nh4wvyz3.js → chunk-atn06ncf.js} +0 -0
  232. /package/dist/cli/{chunk-h4n8ffqy.js → chunk-dmzg9zdc.js} +0 -0
  233. /package/dist/cli/{chunk-w25b7xxz.js → chunk-etfh8f4z.js} +0 -0
  234. /package/dist/cli/{chunk-hape5vwj.js → chunk-hpay0ax8.js} +0 -0
  235. /package/dist/cli/{chunk-f10n6063.js → chunk-pn5ygqn6.js} +0 -0
  236. /package/dist/cli/{chunk-rcyasw34.js → chunk-rxqdw6s5.js} +0 -0
  237. /package/dist/cli/{chunk-exfyqsdd.js → chunk-vjvkkrzc.js} +0 -0
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ import{ROVE_CONFIG_DIR_BASENAME,ROVE_PRODUCT_NAME,ROVE_STATE_DIR_BASENAME}from"./chunk-nc46gddg.js";var ROVE_CONFIG_DIR_BASENAME2=ROVE_CONFIG_DIR_BASENAME,ROVE_PRODUCT_NAME2=ROVE_PRODUCT_NAME,ROVE_STATE_DIR_BASENAME2=ROVE_STATE_DIR_BASENAME;
3
+ export{ROVE_CONFIG_DIR_BASENAME2 as ROVE_CONFIG_DIR_BASENAME,ROVE_PRODUCT_NAME2 as ROVE_PRODUCT_NAME,ROVE_STATE_DIR_BASENAME2 as ROVE_STATE_DIR_BASENAME};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{closeTab,engineTabArgv,initialTabs,setTabTitle,terminalTabsKey}from"./chunk-g56km26e.js";import{awaitEngineProcess,buildEngineSessionLaunch,deliverToHostedKey,enginePresence,ensureHostedSessionHost,findHostedEngineKey,hostedSessionFailureLine,hostedTaskKeys,initMarkerSaysFinished,isHostedTaskKey,killHostedSessions,listHostedSessions,listHostedSessionsOrNull,openHostedSessionHost,pastePromptWhenEngineUp,readPersistedTerminalDefaultColors}from"./chunk-n24dmy2r.js";import{engineLaunchArgv}from"./chunk-ygd572ee.js";import{ApiError}from"./chunk-f7zjggfv.js";import{loadStateFile,patchStateFile,updateStateFile}from"./chunk-zyd6k6ak.js";function taskEngineArgv(task){return engineLaunchArgv({command:task.command,vendor:task.vendor})}function readTabsSnapshot(taskId){try{let snap=loadStateFile()[terminalTabsKey(taskId)];return snap&&Array.isArray(snap.tabs)?snap:void 0}catch{return}}function closeTabsSnapshot(taskId,tabId){let closing,key=terminalTabsKey(taskId);return updateStateFile((store)=>{let state=store[key];if(!state||!Array.isArray(state.tabs))return!1;if(closing=state.tabs.find((tab)=>tab.id===tabId),!closing)return!1;let{state:next,closedId}=closeTab(state,tabId,{allowEmpty:!0});if(!closedId)return closing=void 0,!1;store[key]=next;return}),closing}function renameTabsSnapshot(taskId,tabId,title){let found=!1,key=terminalTabsKey(taskId);return updateStateFile((store)=>{let state=store[key];if(!state||!Array.isArray(state.tabs))return!1;if(!state.tabs.some((tab)=>tab.id===tabId))return!1;found=!0;let next=setTabTitle(state,tabId,title);if(next===state)return!1;store[key]=next;return}),found}var aliveKeysOf=(sessions)=>new Set(sessions.filter((s)=>s.alive).map((s)=>s.key));function unregisteredTabIds(snapshot,taskId,sessions){let known=new Set((snapshot?.tabs??[]).map((t)=>t.id)),prefix=`${taskId}::`,out=[];for(let s of sessions){if(!s.alive||!s.key.startsWith(prefix))continue;let tabId=s.key.slice(prefix.length);if(tabId.includes("::"))continue;if(!known.has(tabId)&&!out.includes(tabId))out.push(tabId)}return out}var abnormalExit=(exit)=>exit&&(exit.code!==0||exit.signal!==null)?exit:null;function joinTaskTabs(snapshot,taskId,sessions,persistedExits={},liveVendors,engineAlive){let unknown=sessions===null,rows0=sessions??[],alive=aliveKeysOf(rows0),sessionExits=new Map(rows0.map((s)=>[s.key,s.exit])),deadExit=(key)=>{let ex=abnormalExit(sessionExits.get(key)??persistedExits[key]);if(!ex)return null;let record=persistedExits[key],sameDeath=record?.at===ex.at,tail=sameDeath?record?.tail:void 0,code=ex.code??(sameDeath?record?.code??null:null),layer=record?.layer??"pty";return{code,signal:ex.signal,at:ex.at,layer,...tail&&tail.length>0?{tail}:{}}},engineExit=(key)=>{let record=persistedExits[`${key}#engine`];if(!record)return null;let{code,signal,at,tail,atApproximate}=record;return{code,signal,at,layer:"engine",...atApproximate?{atApproximate}:{},...tail&&tail.length>0?{tail}:{}}},rows=(snapshot?.tabs??[]).map((t)=>{let key=`${taskId}::${t.id}`,isAlive=unknown?null:alive.has(key),walked=isAlive===!0&&liveVendors?.has(key)===!0?liveVendors.get(key)??null:void 0,engineIsAlive=engineAliveOf(key,isAlive,engineAlive);return{id:t.id,kind:t.kind,title:t.title??null,vendor:t.vendor??null,liveVendor:walked!==void 0?walked:t.liveVendor??null,lastTitle:t.lastTitle??null,autoTitle:t.autoTitle??null,alive:isAlive,engineAlive:engineIsAlive,exit:isAlive===!1?deadExit(key):engineIsAlive===!1?engineExit(key):null}});for(let tabId of unregisteredTabIds(snapshot,taskId,rows0))rows.push({id:tabId,kind:"engine",title:null,vendor:null,liveVendor:null,lastTitle:null,autoTitle:null,alive:!0,engineAlive:engineAliveOf(`${taskId}::${tabId}`,!0,engineAlive),exit:null,unregistered:!0});return rows}function engineAliveOf(key,isAlive,engineAlive){if(isAlive===null)return null;if(!isAlive)return!1;return engineAlive?.has(key)===!0?engineAlive.get(key)??null:null}function publishCliTabSnapshot(taskId,sessionId){if(!taskId)return;try{let key=terminalTabsKey(taskId);if(loadStateFile()[key]!==void 0)return;let seeded=initialTabs();patchStateFile({[key]:sessionId?{...seeded,tabs:seeded.tabs.map((t)=>t.kind==="engine"?{...t,sessionId,spawned:!0}:t)}:seeded})}catch{}}function markCliTabSession(taskId,tabId,sessionId){try{let key=terminalTabsKey(taskId),existing=loadStateFile()[key];if(!existing||!Array.isArray(existing.tabs))return;patchStateFile({[key]:{...existing,tabs:existing.tabs.map((t)=>t.id===tabId&&t.kind==="engine"?{...t,sessionId,spawned:!0}:t)}})}catch{}}function mintCliTab(taskId,vendor,command){let tabId="tab-1";try{let key=terminalTabsKey(taskId),existing=loadStateFile()[key],state=existing&&Array.isArray(existing.tabs)&&existing.tabs.length>0?existing:initialTabs(),ordinal=typeof state.nextOrdinal==="number"&&state.nextOrdinal>1?state.nextOrdinal:2;tabId=`tab-${ordinal}`,patchStateFile({[key]:{...state,tabs:[...state.tabs,{kind:"engine",id:tabId,title:null,ordinal,...vendor?{vendor}:{},...command?{engineCommand:command}:{}}],activeId:tabId,nextOrdinal:ordinal+1}})}catch{tabId=`tab-cli-${Date.now().toString(36)}`}return tabId}function restoredTabsOf(sessions,taskId,exceptKey){let prefix=`${taskId}::`,ids=[];for(let s of sessions){if(s.alive||s.restored!==!0||s.key===exceptKey||!s.key.startsWith(prefix))continue;let tab=s.key.slice(prefix.length);if(tab.includes("::"))continue;if(!ids.includes(tab))ids.push(tab)}let tabs=readTabsSnapshot(taskId)?.tabs??[];return ids.map((tab)=>{let sessionId=tabs.find((t)=>t.id===tab)?.sessionId;return sessionId?{tab,sessionId}:{tab}})}function restoredTabLaunch(task,tabId,worktreePath,shell){let tab=readTabsSnapshot(task.id)?.tabs.find((t)=>t.id===tabId&&t.kind==="engine");if(!tab)return null;let base=engineLaunchArgv({command:tab.engineCommand??(tab.vendor?void 0:task.command),vendor:tab.vendor??task.vendor,effort:task.modelEffort,model:tab.engineCommand||tab.vendor?void 0:task.model});return buildEngineSessionLaunch({task:{id:task.id,kind:task.kind??"task",vendor:tab.vendor??task.vendor,repo:task.repo},worktreePath,shell,argv:engineTabArgv(tab,base,!1,task.vendor),promptIntent:{kind:"none"},tabId})}var isTaskKey=isHostedTaskKey,findEngineKey=findHostedEngineKey,taskKeys=hostedTaskKeys,openPtyHost=openHostedSessionHost,ensurePtyHost=ensureHostedSessionHost,listSessions=listHostedSessions,listSessionsOrNull=listHostedSessionsOrNull,deliverToKey=deliverToHostedKey,ENGINE_START_PROBE_MS=3000,ENGINE_START_POLL_MS=150,ENGINE_NOT_OBSERVED_REASON=`no engine process appeared in the session within ${ENGINE_START_PROBE_MS}ms`;function outcomeFields(outcome){if(!outcome)return{engineReady:!1,delivered:!1};return{engineReady:outcome.ready,delivered:!0,bytes:outcome.bytes,promptEcho:outcome.confirmed?"confirmed":"unconfirmed"}}async function deliverHostedPrompt(rpc,target,cwd,prompt,launch,opts){let{sessions=[]}=await rpc.request("pty.list",{}),existingKey=opts?.forceNew?null:findEngineKey(sessions,target.id,target.engineBin);if(existingKey){let pid=sessions.find((s)=>s.key===existingKey)?.pid,presence=await enginePresence(pid,target.engineBin,opts?.snapshot);if(presence.kind==="unknown")throw new ApiError(`could not read the process table, so task ${target.id}'s engine tab (${existingKey}) could not be checked for a live engine`,"ENGINE_PROBE_FAILED",{hint:"the `ps` probe failed or timed out; retry, or check the machine's process table",nextCommandArgs:["api","pty-list"]});if(presence.kind!=="engine")throw new ApiError(`task ${target.id}'s engine tab (${existingKey}) has no live engine process \u2014 its engine exited into a plain shell`,"ENGINE_NOT_RUNNING",{hint:"spawn a fresh engine tab for this prompt with --tab new",nextCommandArgs:["api","send","--task-id",target.id,"--tab","new","--prompt",prompt]});let outcome=await deliverToKey(rpc,existingKey,prompt,{vendor:presence.vendor});return{session:existingKey,pane:existingKey,started:!1,...outcomeFields(outcome)}}if(!opts?.forceNew){let aliveTabs=sessions.filter((s)=>s.alive&&isTaskKey(s.key,target.id)).map((s)=>s.key);if(aliveTabs.length>0)throw new ApiError(`task ${target.id} has live tabs (${aliveTabs.join(", ")}) but none resolves as its engine tab \u2014 refusing to spawn a new engine`,"NO_ENGINE_TAB",{hint:"address a live engine tab explicitly with --tab <tab-N> (see pty-list), or spawn a fresh engine tab with --tab new",nextCommandArgs:["api","pty-list"]})}let frozen=restoredTabsOf(sessions,target.id,launch.key),disclose=frozen.length>0?{frozenTabs:frozen}:{},staleCanonical=sessions.find((session)=>session.key===launch.key&&!session.alive);if(staleCanonical&&staleCanonical.restored!==!0)await rpc.request("pty.kill",{key:launch.key});let open=await rpc.request("pty.open",{key:launch.key,cwd,command:launch.command,defaultColors:readPersistedTerminalDefaultColors()});try{if(!open.alive)return{session:launch.key,pane:launch.key,started:open.created!==!1||open.respawned===!0,engineReady:!1,delivered:!1,...disclose};if(launch.firstMessage){let outcome=await pastePromptWhenEngineUp(rpc,launch.key,target.engineBin,launch.firstMessage,{initMarkerPath:launch.initMarkerPath,initTimeoutMs:launch.initTimeoutMs});return{session:launch.key,pane:launch.key,started:open.created!==!1||open.respawned===!0,...outcomeFields(outcome),...disclose}}let started=open.created!==!1||open.respawned===!0;if(open.created===!1&&open.respawned!==!0){let outcome=await pastePromptWhenEngineUp(rpc,launch.key,target.engineBin,prompt,{snapshot:opts?.snapshot});return{session:launch.key,pane:launch.key,started,...outcomeFields(outcome),...disclose}}let pendingInit={session:launch.key,pane:launch.key,started,engineReady:!1,delivered:!0,reason:"repo init script is still running; the engine has not started yet",...disclose};if(launch.initMarkerPath&&!initMarkerSaysFinished(launch.initMarkerPath))return pendingInit;if(await awaitEngineProcess(rpc,launch.key,target.engineBin,{timeoutMs:ENGINE_START_PROBE_MS,intervalMs:ENGINE_START_POLL_MS,snapshot:opts?.snapshot})===null){if(launch.initMarkerPath&&!initMarkerSaysFinished(launch.initMarkerPath)&&(await listSessions(rpc)).some((session)=>session.key===launch.key&&session.alive)&&!initMarkerSaysFinished(launch.initMarkerPath))return pendingInit;return{session:launch.key,pane:launch.key,started,engineReady:!1,delivered:!1,reason:await hostedSessionFailureLine(rpc,launch.key)??ENGINE_NOT_OBSERVED_REASON,...disclose}}return{session:launch.key,pane:launch.key,started,engineReady:!0,delivered:!0,...disclose}}finally{await rpc.request("pty.detach",{key:launch.key}).catch(()=>{})}}var killTaskSessions=killHostedSessions;
2
+ import{closeTab,engineTabArgv,initialTabs,setTabTitle,terminalTabsKey}from"./chunk-bn73kd6z.js";import{awaitEngineProcess,buildEngineSessionLaunch,deliverToHostedKey,enginePresence,ensureHostedSessionHost,findHostedEngineKey,hostedSessionFailureLine,hostedTaskKeys,initMarkerSaysFinished,isHostedTaskKey,killHostedSessions,listHostedSessions,listHostedSessionsOrNull,openHostedSessionHost,pastePromptWhenEngineUp,readPersistedTerminalDefaultColors}from"./chunk-yxt1y0n3.js";import{engineLaunchArgv}from"./chunk-x9s14ppv.js";import{ApiError}from"./chunk-f7zjggfv.js";import{loadStateFile,patchStateFile,updateStateFile}from"./chunk-7q43tysm.js";function taskEngineArgv(task){return engineLaunchArgv({command:task.command,vendor:task.vendor})}function readTabsSnapshot(taskId){try{let snap=loadStateFile()[terminalTabsKey(taskId)];return snap&&Array.isArray(snap.tabs)?snap:void 0}catch{return}}function closeTabsSnapshot(taskId,tabId){let closing,key=terminalTabsKey(taskId);return updateStateFile((store)=>{let state=store[key];if(!state||!Array.isArray(state.tabs))return!1;if(closing=state.tabs.find((tab)=>tab.id===tabId),!closing)return!1;let{state:next,closedId}=closeTab(state,tabId,{allowEmpty:!0});if(!closedId)return closing=void 0,!1;store[key]=next;return}),closing}function renameTabsSnapshot(taskId,tabId,title){let found=!1,key=terminalTabsKey(taskId);return updateStateFile((store)=>{let state=store[key];if(!state||!Array.isArray(state.tabs))return!1;if(!state.tabs.some((tab)=>tab.id===tabId))return!1;found=!0;let next=setTabTitle(state,tabId,title);if(next===state)return!1;store[key]=next;return}),found}var aliveKeysOf=(sessions)=>new Set(sessions.filter((s)=>s.alive).map((s)=>s.key));function unregisteredTabIds(snapshot,taskId,sessions){let known=new Set((snapshot?.tabs??[]).map((t)=>t.id)),prefix=`${taskId}::`,out=[];for(let s of sessions){if(!s.alive||!s.key.startsWith(prefix))continue;let tabId=s.key.slice(prefix.length);if(tabId.includes("::"))continue;if(!known.has(tabId)&&!out.includes(tabId))out.push(tabId)}return out}var abnormalExit=(exit)=>exit&&(exit.code!==0||exit.signal!==null)?exit:null;function joinTaskTabs(snapshot,taskId,sessions,persistedExits={},liveVendors,engineAlive){let unknown=sessions===null,rows0=sessions??[],alive=aliveKeysOf(rows0),sessionExits=new Map(rows0.map((s)=>[s.key,s.exit])),deadExit=(key)=>{let ex=abnormalExit(sessionExits.get(key)??persistedExits[key]);if(!ex)return null;let record=persistedExits[key],sameDeath=record?.at===ex.at,tail=sameDeath?record?.tail:void 0,code=ex.code??(sameDeath?record?.code??null:null),layer=record?.layer??"pty";return{code,signal:ex.signal,at:ex.at,layer,...tail&&tail.length>0?{tail}:{}}},engineExit=(key)=>{let record=persistedExits[`${key}#engine`];if(!record)return null;let{code,signal,at,tail,atApproximate}=record;return{code,signal,at,layer:"engine",...atApproximate?{atApproximate}:{},...tail&&tail.length>0?{tail}:{}}},rows=(snapshot?.tabs??[]).map((t)=>{let key=`${taskId}::${t.id}`,isAlive=unknown?null:alive.has(key),walked=isAlive===!0&&liveVendors?.has(key)===!0?liveVendors.get(key)??null:void 0,engineIsAlive=engineAliveOf(key,isAlive,engineAlive);return{id:t.id,kind:t.kind,title:t.title??null,vendor:t.vendor??null,liveVendor:walked!==void 0?walked:t.liveVendor??null,lastTitle:t.lastTitle??null,autoTitle:t.autoTitle??null,alive:isAlive,engineAlive:engineIsAlive,exit:isAlive===!1?deadExit(key):engineIsAlive===!1?engineExit(key):null}});for(let tabId of unregisteredTabIds(snapshot,taskId,rows0))rows.push({id:tabId,kind:"engine",title:null,vendor:null,liveVendor:null,lastTitle:null,autoTitle:null,alive:!0,engineAlive:engineAliveOf(`${taskId}::${tabId}`,!0,engineAlive),exit:null,unregistered:!0});return rows}function engineAliveOf(key,isAlive,engineAlive){if(isAlive===null)return null;if(!isAlive)return!1;return engineAlive?.has(key)===!0?engineAlive.get(key)??null:null}function publishCliTabSnapshot(taskId,sessionId){if(!taskId)return;try{let key=terminalTabsKey(taskId);if(loadStateFile()[key]!==void 0)return;let seeded=initialTabs();patchStateFile({[key]:sessionId?{...seeded,tabs:seeded.tabs.map((t)=>t.kind==="engine"?{...t,sessionId,spawned:!0}:t)}:seeded})}catch{}}function markCliTabSession(taskId,tabId,sessionId){try{let key=terminalTabsKey(taskId),existing=loadStateFile()[key];if(!existing||!Array.isArray(existing.tabs))return;patchStateFile({[key]:{...existing,tabs:existing.tabs.map((t)=>t.id===tabId&&t.kind==="engine"?{...t,sessionId,spawned:!0}:t)}})}catch{}}function mintCliTab(taskId,vendor,command){let tabId="tab-1";try{let key=terminalTabsKey(taskId),existing=loadStateFile()[key],state=existing&&Array.isArray(existing.tabs)&&existing.tabs.length>0?existing:initialTabs(),ordinal=typeof state.nextOrdinal==="number"&&state.nextOrdinal>1?state.nextOrdinal:2;tabId=`tab-${ordinal}`,patchStateFile({[key]:{...state,tabs:[...state.tabs,{kind:"engine",id:tabId,title:null,ordinal,...vendor?{vendor}:{},...command?{engineCommand:command}:{}}],activeId:tabId,nextOrdinal:ordinal+1}})}catch{tabId=`tab-cli-${Date.now().toString(36)}`}return tabId}function restoredTabsOf(sessions,taskId,exceptKey){let prefix=`${taskId}::`,ids=[];for(let s of sessions){if(s.alive||s.restored!==!0||s.key===exceptKey||!s.key.startsWith(prefix))continue;let tab=s.key.slice(prefix.length);if(tab.includes("::"))continue;if(!ids.includes(tab))ids.push(tab)}let tabs=readTabsSnapshot(taskId)?.tabs??[];return ids.map((tab)=>{let sessionId=tabs.find((t)=>t.id===tab)?.sessionId;return sessionId?{tab,sessionId}:{tab}})}function restoredTabLaunch(task,tabId,worktreePath,shell){let tab=readTabsSnapshot(task.id)?.tabs.find((t)=>t.id===tabId&&t.kind==="engine");if(!tab)return null;let base=engineLaunchArgv({command:tab.engineCommand??(tab.vendor?void 0:task.command),vendor:tab.vendor??task.vendor,effort:task.modelEffort,model:tab.engineCommand||tab.vendor?void 0:task.model});return buildEngineSessionLaunch({task:{id:task.id,kind:task.kind??"task",vendor:tab.vendor??task.vendor,repo:task.repo},worktreePath,shell,argv:engineTabArgv(tab,base,!1,task.vendor),promptIntent:{kind:"none"},tabId})}var isTaskKey=isHostedTaskKey,findEngineKey=findHostedEngineKey,taskKeys=hostedTaskKeys,openPtyHost=openHostedSessionHost,ensurePtyHost=ensureHostedSessionHost,listSessions=listHostedSessions,listSessionsOrNull=listHostedSessionsOrNull,deliverToKey=deliverToHostedKey,ENGINE_START_PROBE_MS=3000,ENGINE_START_POLL_MS=150,ENGINE_NOT_OBSERVED_REASON=`no engine process appeared in the session within ${ENGINE_START_PROBE_MS}ms`;function outcomeFields(outcome){if(!outcome)return{engineReady:!1,delivered:!1};return{engineReady:outcome.ready,delivered:!0,bytes:outcome.bytes,promptEcho:outcome.confirmed?"confirmed":"unconfirmed"}}async function deliverHostedPrompt(rpc,target,cwd,prompt,launch,opts){let{sessions=[]}=await rpc.request("pty.list",{}),existingKey=opts?.forceNew?null:findEngineKey(sessions,target.id,target.engineBin);if(existingKey){let pid=sessions.find((s)=>s.key===existingKey)?.pid,presence=await enginePresence(pid,target.engineBin,opts?.snapshot);if(presence.kind==="unknown")throw new ApiError(`could not read the process table, so task ${target.id}'s engine tab (${existingKey}) could not be checked for a live engine`,"ENGINE_PROBE_FAILED",{hint:"the `ps` probe failed or timed out; retry, or check the machine's process table",nextCommandArgs:["api","pty-list"]});if(presence.kind!=="engine")throw new ApiError(`task ${target.id}'s engine tab (${existingKey}) has no live engine process \u2014 its engine exited into a plain shell`,"ENGINE_NOT_RUNNING",{hint:"spawn a fresh engine tab for this prompt with --tab new",nextCommandArgs:["api","send","--task-id",target.id,"--tab","new","--prompt",prompt]});let outcome=await deliverToKey(rpc,existingKey,prompt,{vendor:presence.vendor});return{session:existingKey,pane:existingKey,started:!1,...outcomeFields(outcome)}}if(!opts?.forceNew){let aliveTabs=sessions.filter((s)=>s.alive&&isTaskKey(s.key,target.id)).map((s)=>s.key);if(aliveTabs.length>0)throw new ApiError(`task ${target.id} has live tabs (${aliveTabs.join(", ")}) but none resolves as its engine tab \u2014 refusing to spawn a new engine`,"NO_ENGINE_TAB",{hint:"address a live engine tab explicitly with --tab <tab-N> (see pty-list), or spawn a fresh engine tab with --tab new",nextCommandArgs:["api","pty-list"]})}let frozen=restoredTabsOf(sessions,target.id,launch.key),disclose=frozen.length>0?{frozenTabs:frozen}:{},staleCanonical=sessions.find((session)=>session.key===launch.key&&!session.alive);if(staleCanonical&&staleCanonical.restored!==!0)await rpc.request("pty.kill",{key:launch.key});let open=await rpc.request("pty.open",{key:launch.key,cwd,command:launch.command,defaultColors:readPersistedTerminalDefaultColors()});try{if(!open.alive)return{session:launch.key,pane:launch.key,started:open.created!==!1||open.respawned===!0,engineReady:!1,delivered:!1,...disclose};if(launch.firstMessage){let outcome=await pastePromptWhenEngineUp(rpc,launch.key,target.engineBin,launch.firstMessage,{initMarkerPath:launch.initMarkerPath,initTimeoutMs:launch.initTimeoutMs});return{session:launch.key,pane:launch.key,started:open.created!==!1||open.respawned===!0,...outcomeFields(outcome),...disclose}}let started=open.created!==!1||open.respawned===!0;if(open.created===!1&&open.respawned!==!0){let outcome=await pastePromptWhenEngineUp(rpc,launch.key,target.engineBin,prompt,{snapshot:opts?.snapshot});return{session:launch.key,pane:launch.key,started,...outcomeFields(outcome),...disclose}}let pendingInit={session:launch.key,pane:launch.key,started,engineReady:!1,delivered:!0,reason:"repo init script is still running; the engine has not started yet",...disclose};if(launch.initMarkerPath&&!initMarkerSaysFinished(launch.initMarkerPath))return pendingInit;if(await awaitEngineProcess(rpc,launch.key,target.engineBin,{timeoutMs:ENGINE_START_PROBE_MS,intervalMs:ENGINE_START_POLL_MS,snapshot:opts?.snapshot})===null){if(launch.initMarkerPath&&!initMarkerSaysFinished(launch.initMarkerPath)&&(await listSessions(rpc)).some((session)=>session.key===launch.key&&session.alive)&&!initMarkerSaysFinished(launch.initMarkerPath))return pendingInit;return{session:launch.key,pane:launch.key,started,engineReady:!1,delivered:!1,reason:await hostedSessionFailureLine(rpc,launch.key)??ENGINE_NOT_OBSERVED_REASON,...disclose}}return{session:launch.key,pane:launch.key,started,engineReady:!0,delivered:!0,...disclose}}finally{await rpc.request("pty.detach",{key:launch.key}).catch(()=>{})}}var killTaskSessions=killHostedSessions;
3
3
  export{taskEngineArgv,readTabsSnapshot,closeTabsSnapshot,renameTabsSnapshot,unregisteredTabIds,joinTaskTabs,publishCliTabSnapshot,markCliTabSession,mintCliTab,restoredTabLaunch,isTaskKey,findEngineKey,taskKeys,openPtyHost,ensurePtyHost,listSessions,listSessionsOrNull,deliverToKey,ENGINE_START_PROBE_MS,ENGINE_START_POLL_MS,ENGINE_NOT_OBSERVED_REASON,outcomeFields,deliverHostedPrompt,killTaskSessions};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{submitFeedback}from"./chunk-77w83wgh.js";import"./chunk-be757xzj.js";import{activeCliName}from"./chunk-ppwpjm39.js";import"./chunk-fxs82dsx.js";import"./chunk-zyd6k6ak.js";import"./chunk-8hbtca1g.js";import"./chunk-hq2n27y1.js";import"./chunk-sb0ns0c7.js";import"./chunk-vnpqemb0.js";import"./chunk-9prawccj.js";import"./chunk-y8fqdnh3.js";import"./chunk-hq4b3fca.js";import"./chunk-wqfp8d9w.js";import{readFileSync}from"fs";var CLI_NAME=activeCliName(),FEEDBACK_USAGE=[`Usage: ${CLI_NAME} feedback --title <text> (--body <text> | --body-file <path>) [--category <slug>]`,"","Create a GitHub Discussion in the Rove repository using the GitHub CLI.","","Requires:"," gh auth login","","Options:"," --title <text> Discussion title"," --body <text> Discussion body"," --body-file <path> Read the Discussion body from a file; use - for stdin"," --category <slug> Discussion category slug (default: feedback)"," -h, --help Print this help",""].join(`
2
+ import{submitFeedback}from"./chunk-0k91029d.js";import"./chunk-7cce0st1.js";import"./chunk-prqeddy7.js";import{ROVE_PRODUCT_NAME}from"./chunk-zt7wfnva.js";import"./chunk-b39sdtt0.js";import"./chunk-nc46gddg.js";import"./chunk-wqfp8d9w.js";import{readFileSync}from"fs";var CLI_NAME=ROVE_PRODUCT_NAME,FEEDBACK_USAGE=[`Usage: ${CLI_NAME} feedback --title <text> (--body <text> | --body-file <path>) [--category <slug>]`,"","Create a GitHub Discussion in the Rove repository using the GitHub CLI.","","Requires:"," gh auth login","","Options:"," --title <text> Discussion title"," --body <text> Discussion body"," --body-file <path> Read the Discussion body from a file; use - for stdin"," --category <slug> Discussion category slug (default: feedback)"," -h, --help Print this help",""].join(`
3
3
  `);function usageError(message){process.stderr.write(`${CLI_NAME} feedback: ${message}
4
4
 
5
5
  ${FEEDBACK_USAGE}
package/dist/cli/index.js CHANGED
@@ -1,25 +1,27 @@
1
1
  #!/usr/bin/env bun
2
2
  // @bun
3
- import{matchPathGlob}from"./chunk-kg11c1py.js";import{argvHasFlag}from"./chunk-jvxh93nz.js";import{connectIfRunning}from"./chunk-wtqxv2rv.js";import"./chunk-pz907kve.js";import{expandTilde}from"./chunk-nvqdmx7q.js";import{errorMessage}from"./chunk-2brn8e1y.js";import{BUILTIN_VENDORS,coerceVendorId,isBuiltinVendor}from"./chunk-05jej26n.js";import{CURRENT_VERSION}from"./chunk-be757xzj.js";import{rejectionReason}from"./chunk-mkksdcsw.js";import{activeCliName,prepareCliEnvironment}from"./chunk-ppwpjm39.js";import"./chunk-fxs82dsx.js";import"./chunk-zyd6k6ak.js";import"./chunk-8hbtca1g.js";import"./chunk-hq2n27y1.js";import"./chunk-sb0ns0c7.js";import"./chunk-vnpqemb0.js";import"./chunk-9prawccj.js";import"./chunk-qagek3wg.js";import"./chunk-544bwsss.js";import"./chunk-hqbmzz4t.js";import"./chunk-3es6spp4.js";import"./chunk-pw6yfj10.js";import{pathSyntax}from"./chunk-f10n6063.js";import"./chunk-y8fqdnh3.js";import"./chunk-hq4b3fca.js";import{__require}from"./chunk-wqfp8d9w.js";import{resolve as resolve2}from"path";function debugEnabled(env){return env.KOBE_DEBUG==="1"||env.ROVE_DEBUG==="1"}function failureSubject(cliName,argv){let verb=argv[2];return verb&&!verb.startsWith("-")&&!verb.includes("/")?`${cliName} ${verb}`:cliName}function summarizeCliGitError(message,cwd){if(!/not a git repository/i.test(message))return null;return`${cwd} is not a git repository \u2014 run this inside one, or pass a repo path.`}function formatCliFailure(err,opts){let subject=failureSubject(opts.cliName,opts.argv);if(debugEnabled(opts.env))return`${subject}: ${String(err instanceof Error?err.stack??err:err)}`;let raw=errorMessage(err);return`${subject}: ${summarizeCliGitError(raw,opts.cwd)??raw}`}var DYNAMIC_COMMANDS=new Map([["completions",async(args)=>{let{runCompletionsSubcommand}=await import("./chunk-9ek7xm94.js");await runCompletionsSubcommand(args)}],["export",async(args)=>{let{runExportSubcommand}=await import("./chunk-s1e0e9hc.js");await runExportSubcommand(args)}],["repo",async(args)=>{let{runRepoSubcommand}=await import("./chunk-4d54zgc7.js");await runRepoSubcommand(args)}],["api",async(args)=>{let{runApiSubcommand}=await import("./chunk-8h0khkap.js");await runApiSubcommand(args)}],["update",async(args)=>{let{runUpdateSubcommand}=await import("./chunk-mb1e73jm.js");await runUpdateSubcommand(args)}],["theme",async(args)=>{let{runThemeSubcommand}=await import("./chunk-k7g060qr.js");await runThemeSubcommand(args)}],["feedback",async(args)=>{let{runFeedbackSubcommand}=await import("./chunk-zwgns5ce.js");await runFeedbackSubcommand(args)}],["daemon",async(args)=>{let{runDaemonSubcommand}=await import("./chunk-b503z32q.js");await runDaemonSubcommand(args)}],["machine",async(args)=>{let{runMachineSubcommand}=await import("./chunk-3sg5v7cg.js");await runMachineSubcommand(args)}],["doctor",async(args)=>{let{runDoctorSubcommand}=await import("./chunk-2yd128k1.js");await runDoctorSubcommand(args)}],["config",async(args)=>{let{runConfigSubcommand}=await import("./chunk-8pa1ph1s.js");await runConfigSubcommand(args)}],["reset",async(args)=>{let{runResetSubcommand}=await import("./chunk-grt1e2s8.js");await runResetSubcommand(args)}],["pty-host",async(args)=>{let{runPtyHostSubcommand}=await import("./chunk-507zn8rs.js");await runPtyHostSubcommand(args)}],["skill",async(args)=>{let{runSkillSubcommand}=await import("./chunk-cv1kaq8a.js");await runSkillSubcommand(args)}],["plugin",async(args)=>{let{runPluginSubcommand}=await import("./chunk-0wgheepg.js");await runPluginSubcommand(args)}],["hook",async(args)=>{let{runHookSubcommand}=await import("./chunk-wpsbyq4s.js");await runHookSubcommand(args)}]]);import{statSync}from"fs";import{resolve}from"path";async function openLocalOrchestrator(){let{TaskIndexStore}=await import("./chunk-vzqrj32e.js"),{GitWorktreeManager}=await import("./chunk-9k47xr7m.js"),{Orchestrator}=await import("./chunk-md8k7c5w.js"),store=new TaskIndexStore;return await store.load(),new Orchestrator({store,worktrees:new GitWorktreeManager})}async function withDaemonOrLocal(bridge){let client=await connectIfRunning();if(client)try{return await bridge.daemon(client)}finally{client.close()}let orch=await openLocalOrchestrator();return bridge.local(orch)}function isPathLikeArg(arg){return arg==="."||arg===".."||arg.startsWith("./")||arg.startsWith("../")||arg.startsWith(".\\")||arg.startsWith("..\\")||pathSyntax(arg).isAbsolute(arg)||arg.startsWith("/")||arg==="~"||arg.startsWith("~/")||arg.startsWith("~\\")}async function projectRootFor(dir){let{isGitRepo,resolveRepoRoot}=await import("./chunk-7s1kx9ez.js"),{projectRejection}=await import("./chunk-9mtxxsb3.js"),top=resolveRepoRoot(dir);if(top!==dir)return null;return projectRejection(top,isGitRepo,"explicit")?null:top}async function runOpenDirectory(arg){let dir=resolve(process.cwd(),expandTilde(arg)),isDir=!1;try{isDir=statSync(dir).isDirectory()}catch{isDir=!1}if(!isDir)process.stderr.write(`${activeCliName()}: "${arg}" is not a directory (resolved to ${dir}).
4
- `),process.exit(1);let projectRoot=await projectRootFor(dir);await withDaemonOrLocal({daemon:async(client)=>{let taskId;if(projectRoot)taskId=(await client.request("task.ensureMain",{repo:projectRoot})).task.id;else taskId=(await client.request("task.openDir",{dir})).taskId;await client.request("task.setActive",{taskId})},local:async(orch)=>{let task=projectRoot?await orch.ensureMainTask(projectRoot):await orch.openDirectoryTask({dir}),{writeLastActiveTaskId}=await import("./chunk-hgx20x94.js");writeLastActiveTaskId(String(task.id))}});let{publishKobeTerminalTitle}=await import("./chunk-1tx1s5v6.js");publishKobeTerminalTitle();let{startTui}=await import("./chunk-tcj36cqg.js");await startTui()}function topLevelUsage(cliName=activeCliName()){return[`${cliName} ${CURRENT_VERSION}`,"",`Usage: ${cliName} [command] [options]`,"","Run with no command to launch PureTUI.",`Run \`${cliName} .\` (or \`${cliName} <path>\`) to open a directory as a standalone task.`,"","Commands:"," completions <shell> Generate shell completion script (bash/zsh/fish)"," add [path] Save a repo path for the new-task picker"," remove [path] Forget a saved project (inverse of add; non-destructive)"," adopt [glob] Import existing git worktrees as tasks"," export [--csv|--json] Print the task list (json/csv/table; daemon-free)"," repo <verb> Per-repo init script + first prompt (show|set|unset)",` api <verb> Scriptable RPC surface for agents (see \`${cliName} api --help\`)`," daemon <verb> Manage the daemon (start|stop|status|restart)"," machine <verb> Other computers running Rove (add|remove|list)"," doctor [--report|--fix] Diagnose daemon/PTY/engines/git; --fix walks the remedies",` config [--path] Open ${cliName}'s config file (state.json) in your editor`," reset [--hard] Stop runtimes; optionally wipe task/UI state"," theme <verb> Manage user themes (list|add|remove)",` skill <verb> Install the ${cliName} agent skill (install|status|command|print)`," plugin <verb> Install and run plugins (install|link|list|action|\u2026)"," feedback Send feedback to GitHub Discussions",` update [version|channel|list] Self-update ${cliName}, switch channel, or list versions`,"","Options:"," -v, --version Print version"," -h, --help Print this help"," --skill Print the agent skill file and exit"].join(`
5
- `)}prepareCliEnvironment();var CLI_NAME=activeCliName(),ADD_USAGE=[`Usage: ${CLI_NAME} add [path]`,` ${CLI_NAME} add --remote --host <host> --user <user> --path <basePath> [--port N] [--key [path] | --password]`,"","Save a repo for the new-task picker. With --remote, register an SSH-backed","project whose worktrees live on <host>; engine launch over SSH is pending.",""].join(`
6
- `);async function runAddSubcommand(rest){let arg=rest[0];if(arg==="--help"||arg==="-h"||arg==="help"){process.stdout.write(ADD_USAGE);return}if(arg==="--remote"){let{runAddRemote}=await import("./chunk-s1p650mm.js");await runAddRemote(rest.slice(1));return}if(arg?.startsWith("-"))process.stderr.write(`${CLI_NAME} add: unknown flag "${arg}"
3
+ import{matchPathGlob}from"./chunk-kg11c1py.js";import{switchFlag}from"./chunk-zsfyj36g.js";import{connectIfRunning}from"./chunk-96cjpssp.js";import"./chunk-9w5g7frx.js";import"./chunk-gvrtrvnz.js";import{expandTilde}from"./chunk-ag3txfg2.js";import{errorMessage}from"./chunk-2brn8e1y.js";import{BUILTIN_VENDORS,coerceVendorId,isBuiltinVendor}from"./chunk-h2m7em1e.js";import{CURRENT_VERSION}from"./chunk-7cce0st1.js";import{rejectionReason}from"./chunk-3342qzve.js";import"./chunk-a7kq09ke.js";import"./chunk-prqeddy7.js";import{ROVE_PRODUCT_NAME}from"./chunk-zt7wfnva.js";import"./chunk-yt15y085.js";import"./chunk-adkva3ep.js";import"./chunk-0422g8ac.js";import"./chunk-hq9tbzqa.js";import{pathSyntax}from"./chunk-pn5ygqn6.js";import"./chunk-npwzmmv9.js";import"./chunk-b39sdtt0.js";import"./chunk-nc46gddg.js";import{__require}from"./chunk-wqfp8d9w.js";import{resolve as resolve2}from"path";function debugEnabled(env){return env.ROVE_DEBUG==="1"||env.ROVE_DEBUG==="1"}function failureSubject(cliName,argv){let verb=argv[2];return verb&&!verb.startsWith("-")&&!verb.includes("/")?`${cliName} ${verb}`:cliName}function summarizeCliGitError(message,cwd){if(!/not a git repository/i.test(message))return null;return`${cwd} is not a git repository \u2014 run this inside one, or pass a repo path.`}function formatCliFailure(err,opts){let subject=failureSubject(opts.cliName,opts.argv);if(debugEnabled(opts.env))return`${subject}: ${String(err instanceof Error?err.stack??err:err)}`;let raw=errorMessage(err);return`${subject}: ${summarizeCliGitError(raw,opts.cwd)??raw}`}var DYNAMIC_COMMANDS=new Map([["completions",async(args)=>{let{runCompletionsSubcommand}=await import("./chunk-8bn6eg67.js");await runCompletionsSubcommand(args)}],["export",async(args)=>{let{runExportSubcommand}=await import("./chunk-vej49hnt.js");await runExportSubcommand(args)}],["repo",async(args)=>{let{runRepoSubcommand}=await import("./chunk-twyda1p8.js");await runRepoSubcommand(args)}],["api",async(args)=>{let{runApiSubcommand}=await import("./chunk-ker4971f.js");await runApiSubcommand(args)}],["update",async(args)=>{let{runUpdateSubcommand}=await import("./chunk-hen7jj2h.js");await runUpdateSubcommand(args)}],["theme",async(args)=>{let{runThemeSubcommand}=await import("./chunk-g4j41mky.js");await runThemeSubcommand(args)}],["feedback",async(args)=>{let{runFeedbackSubcommand}=await import("./chunk-zxsbz3kk.js");await runFeedbackSubcommand(args)}],["daemon",async(args)=>{let{runDaemonSubcommand}=await import("./chunk-c60qsnfw.js");await runDaemonSubcommand(args)}],["machine",async(args)=>{let{runMachineSubcommand}=await import("./chunk-p83wf4zw.js");await runMachineSubcommand(args)}],["doctor",async(args)=>{let{runDoctorSubcommand}=await import("./chunk-b9q8c2qg.js");await runDoctorSubcommand(args)}],["config",async(args)=>{let{runConfigSubcommand}=await import("./chunk-p18ehv9y.js");await runConfigSubcommand(args)}],["reset",async(args)=>{let{runResetSubcommand}=await import("./chunk-0wrh5s5y.js");await runResetSubcommand(args)}],["pty-host",async(args)=>{let{runPtyHostSubcommand}=await import("./chunk-fft50thp.js");await runPtyHostSubcommand(args)}],["skill",async(args)=>{let{runSkillSubcommand}=await import("./chunk-cp89n425.js");await runSkillSubcommand(args)}],["plugin",async(args)=>{let{runPluginSubcommand}=await import("./chunk-rahv4nrm.js");await runPluginSubcommand(args)}],["hook",async(args)=>{let{runHookSubcommand}=await import("./chunk-2x9yc5nx.js");await runHookSubcommand(args)}]]);import{statSync}from"fs";import{resolve}from"path";async function openLocalOrchestrator(){let{TaskIndexStore}=await import("./chunk-pe6wnsww.js"),{GitWorktreeManager}=await import("./chunk-m6q44xc0.js"),{Orchestrator}=await import("./chunk-ze0htjr5.js"),store=new TaskIndexStore;return await store.load(),new Orchestrator({store,worktrees:new GitWorktreeManager})}async function withDaemonOrLocal(bridge){let client=await connectIfRunning();if(client)try{return await bridge.daemon(client)}finally{client.close()}let orch=await openLocalOrchestrator();return bridge.local(orch)}function isPathLikeArg(arg){return arg==="."||arg===".."||arg.startsWith("./")||arg.startsWith("../")||arg.startsWith(".\\")||arg.startsWith("..\\")||pathSyntax(arg).isAbsolute(arg)||arg.startsWith("/")||arg==="~"||arg.startsWith("~/")||arg.startsWith("~\\")}async function projectRootFor(dir){let{isGitRepo,resolveRepoRoot}=await import("./chunk-ng12dprz.js"),{projectRejection}=await import("./chunk-2vgc5cyj.js"),top=resolveRepoRoot(dir);if(top!==dir)return null;return projectRejection(top,isGitRepo,"explicit")?null:top}async function runOpenDirectory(arg){let dir=resolve(process.cwd(),expandTilde(arg)),isDir=!1;try{isDir=statSync(dir).isDirectory()}catch{isDir=!1}if(!isDir)process.stderr.write(`${ROVE_PRODUCT_NAME}: "${arg}" is not a directory (resolved to ${dir}).
4
+ `),process.exit(1);let projectRoot=await projectRootFor(dir);await withDaemonOrLocal({daemon:async(client)=>{let taskId;if(projectRoot)taskId=(await client.request("task.ensureMain",{repo:projectRoot})).task.id;else taskId=(await client.request("task.openDir",{dir})).taskId;await client.request("task.setActive",{taskId})},local:async(orch)=>{let task=projectRoot?await orch.ensureMainTask(projectRoot):await orch.openDirectoryTask({dir}),{writeLastActiveTaskId}=await import("./chunk-ktzbg4jg.js");writeLastActiveTaskId(String(task.id))}});let{publishRoveTerminalTitle}=await import("./chunk-t8v9rpdx.js");publishRoveTerminalTitle();let{launchTui}=await import("./chunk-wvmjdnhk.js");await launchTui()}function topLevelUsage(cliName=ROVE_PRODUCT_NAME){return[`${cliName} ${CURRENT_VERSION}`,"",`Usage: ${cliName} [command] [options]`,"","Run with no command to launch PureTUI.",`Run \`${cliName} .\` (or \`${cliName} <path>\`) to open a directory as a standalone task.`,"","Commands:"," completions <shell> Generate shell completion script (bash/zsh/fish)"," add [path] Save a repo path for the new-task picker"," remove [path] Forget a saved project (inverse of add; non-destructive)"," adopt [glob] Import existing git worktrees as tasks"," export [--csv|--json] Print the task list (json/csv/table; daemon-free)"," repo <verb> Per-repo init script + first prompt (show|set|unset)",` api <verb> Scriptable RPC surface for agents (see \`${cliName} api --help\`)`," daemon <verb> Manage the daemon (start|stop|status|restart)"," machine <verb> Other computers running Rove (add|remove|list)"," doctor [--report|--fix] Diagnose daemon/PTY/engines/git; --fix walks the remedies",` config [--path] Open ${cliName}'s config file (state.json) in your editor`," reset [--hard] Stop runtimes; optionally wipe task/UI state"," theme <verb> Manage user themes (list|add|remove)",` skill <verb> Install the ${cliName} agent skill (install|status|command|print)`," plugin <verb> Install and run plugins (install|link|list|action|\u2026)"," feedback Send feedback to GitHub Discussions",` update [version|channel|list] Self-update ${cliName}, switch channel, or list versions`,"","Options:"," -v, --version Print version"," -h, --help Print this help"," --skill Print the agent skill file and exit"].join(`
5
+ `)}var CLI_NAME=ROVE_PRODUCT_NAME,ADD_USAGE=[`Usage: ${CLI_NAME} add [path]`,` ${CLI_NAME} add --remote --host <host> --user <user> --path <basePath> [--port N] [--key [path] | --password]`,"","Save a repo for the new-task picker. With --remote, register an SSH-backed","project whose worktrees live on <host>; engine launch over SSH is pending.",""].join(`
6
+ `);async function runAddSubcommand(rest){let arg=rest[0];if(arg==="--help"||arg==="-h"||arg==="help"){process.stdout.write(ADD_USAGE);return}if(arg==="--remote"){let{runAddRemote}=await import("./chunk-53cyns0f.js");await runAddRemote(rest.slice(1));return}if(arg?.startsWith("-"))process.stderr.write(`${CLI_NAME} add: unknown flag "${arg}"
7
7
 
8
- ${ADD_USAGE}`),process.exit(2);let target=resolve2(process.cwd(),expandTilde(arg&&arg.length>0?arg:".")),{addSavedRepo}=await import("./chunk-7s1kx9ez.js"),result=addSavedRepo(target);if(result.rejected)process.stderr.write(`${CLI_NAME} add: "${arg&&arg.length>0?arg:"."}" cannot be a project \u2014 ${rejectionReason(result.rejected)} (resolved to ${result.path}).
8
+ ${ADD_USAGE}`),process.exit(2);let target=resolve2(process.cwd(),expandTilde(arg&&arg.length>0?arg:".")),{addSavedRepo}=await import("./chunk-ng12dprz.js"),result=addSavedRepo(target);if(result.rejected)process.stderr.write(`${CLI_NAME} add: "${arg&&arg.length>0?arg:"."}" cannot be a project \u2014 ${rejectionReason(result.rejected)} (resolved to ${result.path}).
9
9
  `),process.exit(1);if(result.added)console.log(`added ${result.path} (${result.total} saved repo${result.total===1?"":"s"} total)`);else console.log(`already saved: ${result.path}`);await ensureProjectMainTask(result.path),await adoptAllWorktrees(result.path)}async function ensureProjectMainTask(repo){try{await withDaemonOrLocal({daemon:(client)=>client.request("task.ensureMain",{repo}),local:(orch)=>orch.ensureMainTask(repo)})}catch(err){console.error(`(skipped project main-task setup: ${errorMessage(err)})`)}}var PURGE_FLAG="--purge-credentials",REMOVE_USAGE=[`Usage: ${CLI_NAME} remove [path] [--purge-credentials]`,"","Forget a saved project (drop it from the new-task picker). Non-destructive:","the repo's files, worktrees, branches and tasks all stay on disk. A remote","(ssh://) project also has its stored connection config dropped.",""," path defaults to the current directory. Pass an exact saved entry (e.g. a"," remote `ssh://user@host` key) to remove it verbatim. Run with no match to"," print the current saved projects.",""," --purge-credentials also delete the remote project's SSH password from"," the OS keychain. Off by default: forgetting a project"," should not silently destroy a stored secret.",""].join(`
10
- `);async function runRemoveSubcommand(rest){let purgeCredentials=argvHasFlag(rest,PURGE_FLAG),arg=rest.filter((a)=>a!==PURGE_FLAG&&!a.startsWith(`${PURGE_FLAG}=`))[0];if(arg==="--help"||arg==="-h"||arg==="help"){process.stdout.write(REMOVE_USAGE);return}if(arg?.startsWith("-"))process.stderr.write(`${CLI_NAME} remove: unknown flag "${arg}"
10
+ `);async function runRemoveSubcommand(rest){let purgeCredentials=switchFlag(rest,PURGE_FLAG),arg=rest.filter((a)=>a!==PURGE_FLAG&&!a.startsWith(`${PURGE_FLAG}=`))[0];if(arg==="--help"||arg==="-h"||arg==="help"){process.stdout.write(REMOVE_USAGE);return}if(purgeCredentials===void 0)process.stderr.write(`${CLI_NAME} remove: ${PURGE_FLAG} takes true or false
11
11
 
12
- ${REMOVE_USAGE}`),process.exit(2);let{getRemoteRepoConfig,getSavedRepos,resolveRepoRoot}=await import("./chunk-7s1kx9ez.js"),saved=getSavedRepos();if(saved.length===0){console.log("no saved projects to remove.");return}let raw=arg&&arg.length>0?arg:".",target=saved.includes(raw)?raw:(()=>{let abs=resolve2(process.cwd(),expandTilde(raw)),top=resolveRepoRoot(abs);if(saved.includes(top))return top;if(saved.includes(abs))return abs;return null})();if(target===null){process.stderr.write(`${CLI_NAME} remove: "${raw}" is not a saved project.
12
+ ${REMOVE_USAGE}`),process.exit(2);if(arg?.startsWith("-"))process.stderr.write(`${CLI_NAME} remove: unknown flag "${arg}"
13
+
14
+ ${REMOVE_USAGE}`),process.exit(2);let{getRemoteRepoConfig,getSavedRepos,resolveRepoRoot}=await import("./chunk-ng12dprz.js"),saved=getSavedRepos();if(saved.length===0){console.log("no saved projects to remove.");return}let raw=arg&&arg.length>0?arg:".",target=saved.includes(raw)?raw:(()=>{let abs=resolve2(process.cwd(),expandTilde(raw)),top=resolveRepoRoot(abs);if(saved.includes(top))return top;if(saved.includes(abs))return abs;return null})();if(target===null){process.stderr.write(`${CLI_NAME} remove: "${raw}" is not a saved project.
13
15
 
14
16
  Saved projects:
15
17
  `);for(let p of saved)process.stderr.write(` ${p}
16
- `);process.exit(1)}let auth=getRemoteRepoConfig(target)?.auth,keychainRef=auth?.kind==="password"?auth.keychainRef:null;await withDaemonOrLocal({daemon:(client)=>client.request("project.forget",{repo:target}),local:(orch)=>orch.forgetProject(target)});let remaining=getSavedRepos().length;if(console.log(`removed ${target} (${remaining} saved repo${remaining===1?"":"s"} left)`),keychainRef)await reportCredentialExit(keychainRef,purgeCredentials)}async function reportCredentialExit(ref,purge){let{deleteKeychainPassword,isKeychainSupported}=await import("./chunk-s9a974w9.js");if(!purge){console.log(`note: its SSH password is still in the OS keychain (${ref.service}/${ref.account}).`),console.log(` re-run with ${PURGE_FLAG} to delete it.`);return}if(!isKeychainSupported()){console.error("--purge-credentials: the OS keychain is only wired for macOS; nothing deleted.");return}if(deleteKeychainPassword(ref))console.log(`purged the keychain password (${ref.service}/${ref.account})`);else console.error(`--purge-credentials: no keychain item found for ${ref.service}/${ref.account}`)}async function adoptAllWorktrees(repo){let orch=await openLocalOrchestrator(),candidates;try{candidates=await orch.discoverAdoptableWorktrees(repo)}catch(err){console.error(`(skipped worktree scan: ${errorMessage(err)})`);return}if(candidates.length===0)return;console.log(`scanning ${repo}: ${candidates.length} unlinked worktree(s) \u2192 importing`),await adoptWorktreesInto(orch,repo,candidates,coerceVendorId(void 0))}async function adoptWorktreesInto(orch,repo,list,vendor){for(let w of list){let adopted=await withDaemonOrLocal({daemon:async(client)=>(await client.request("worktree.adopt",{repo,worktreePath:w.path,branch:w.branch,vendor})).task,local:async()=>orch.adoptWorktree({repo,worktreePath:w.path,branch:w.branch,vendor})});console.log(` adopted ${w.branch} \u2192 task ${adopted.id} (${adopted.title})`)}}var ADOPT_USAGE=[`Usage: ${CLI_NAME} adopt [glob] [--repo <path>] [--vendor <v>] [--yes]`,"",`Import existing git worktrees in a repo as ${CLI_NAME} tasks.`,"No glob \u2192 dry-run listing. With a glob \u2192 list matches; --yes adopts them.","","Options:"," --repo <path> Repo to scan (default: current directory)"," --vendor <v> Engine vendor for adopted tasks"," -y, --yes Actually adopt the matched worktrees"," -h, --help Print this help",""].join(`
18
+ `);process.exit(1)}let auth=getRemoteRepoConfig(target)?.auth,keychainRef=auth?.kind==="password"?auth.keychainRef:null;await withDaemonOrLocal({daemon:(client)=>client.request("project.forget",{repo:target}),local:(orch)=>orch.forgetProject(target)});let remaining=getSavedRepos().length;if(console.log(`removed ${target} (${remaining} saved repo${remaining===1?"":"s"} left)`),keychainRef)await reportCredentialExit(keychainRef,purgeCredentials)}async function reportCredentialExit(ref,purge){let{deleteKeychainPassword,isKeychainSupported}=await import("./chunk-fvmee0tr.js");if(!purge){console.log(`note: its SSH password is still in the OS keychain (${ref.service}/${ref.account}).`),console.log(` re-run with ${PURGE_FLAG} to delete it.`);return}if(!isKeychainSupported()){console.error("--purge-credentials: the OS keychain is only wired for macOS; nothing deleted.");return}if(deleteKeychainPassword(ref))console.log(`purged the keychain password (${ref.service}/${ref.account})`);else console.error(`--purge-credentials: no keychain item found for ${ref.service}/${ref.account}`)}async function adoptAllWorktrees(repo){let orch=await openLocalOrchestrator(),candidates;try{candidates=await orch.discoverAdoptableWorktrees(repo)}catch(err){console.error(`(skipped worktree scan: ${errorMessage(err)})`);return}if(candidates.length===0)return;console.log(`scanning ${repo}: ${candidates.length} unlinked worktree(s) \u2192 importing`),await adoptWorktreesInto(orch,repo,candidates,coerceVendorId(void 0))}async function adoptWorktreesInto(orch,repo,list,vendor){for(let w of list){let adopted=await withDaemonOrLocal({daemon:async(client)=>(await client.request("worktree.adopt",{repo,worktreePath:w.path,branch:w.branch,vendor})).task,local:async()=>orch.adoptWorktree({repo,worktreePath:w.path,branch:w.branch,vendor})});console.log(` adopted ${w.branch} \u2192 task ${adopted.id} (${adopted.title})`)}}var ADOPT_USAGE=[`Usage: ${CLI_NAME} adopt [glob] [--repo <path>] [--vendor <v>] [--yes]`,"",`Import existing git worktrees in a repo as ${CLI_NAME} tasks.`,"No glob \u2192 dry-run listing. With a glob \u2192 list matches; --yes adopts them.","","Options:"," --repo <path> Repo to scan (default: current directory)"," --vendor <v> Engine vendor for adopted tasks"," -y, --yes Actually adopt the matched worktrees"," -h, --help Print this help",""].join(`
17
19
  `);function adoptUsageError(message){process.stderr.write(`${CLI_NAME} adopt: ${message}
18
20
 
19
21
  ${ADOPT_USAGE}
20
22
  `),process.exit(2)}async function runAdoptSubcommand(args){let glob,repoArg,vendorArg,yes=!1;for(let i=0;i<args.length;i++){let a=args[i];if(a==="--help"||a==="-h"||a==="help"){process.stdout.write(`${ADOPT_USAGE}
21
- `);return}if(a==="--repo"){if(repoArg=args[++i],repoArg===void 0)adoptUsageError("--repo requires a value")}else if(a==="--vendor"){if(vendorArg=args[++i],vendorArg===void 0)adoptUsageError("--vendor requires a value")}else if(a==="--yes"||a==="-y")yes=!0;else if(a&&!a.startsWith("-")&&glob===void 0)glob=a;else adoptUsageError(`unexpected argument "${a}"`)}let{getCustomEngineIds,resolveRepoRoot}=await import("./chunk-7s1kx9ez.js"),repo=resolveRepoRoot(resolve2(process.cwd(),expandTilde(repoArg&&repoArg.length>0?repoArg:"."))),typed=vendorArg?.trim();if(typed&&!isBuiltinVendor(typed)&&!getCustomEngineIds().includes(typed)){let known=[...BUILTIN_VENDORS,...getCustomEngineIds()].join(", ");adoptUsageError(`unknown engine "${typed}" \u2014 no task was created. Known engines: ${known}`)}let vendor=coerceVendorId(vendorArg),orch=await openLocalOrchestrator(),worktrees=await orch.discoverAdoptableWorktrees(repo);if(worktrees.length===0){console.log(`no adoptable worktrees for ${repo} \u2014 every git worktree here is already a task`);return}let isMatch=(w)=>!glob||matchPathGlob(glob,w.path);console.log(`adoptable worktrees in ${repo}:`);for(let w of worktrees){let hit=glob?isMatch(w)?"*":" ":"-",tags=[w.dirty===!0?"dirty":w.dirty===null?"dirty?":"",w.kobeManaged?"":"external"].filter(Boolean).join(",");console.log(` ${hit} ${w.branch} ${w.path}${tags?` (${tags})`:""}`)}if(!glob){console.log(`
23
+ `);return}if(a==="--repo"){if(repoArg=args[++i],repoArg===void 0)adoptUsageError("--repo requires a value")}else if(a==="--vendor"){if(vendorArg=args[++i],vendorArg===void 0)adoptUsageError("--vendor requires a value")}else if(a==="--yes"||a==="-y")yes=!0;else if(a&&!a.startsWith("-")&&glob===void 0)glob=a;else adoptUsageError(`unexpected argument "${a}"`)}let{getCustomEngineIds,resolveRepoRoot}=await import("./chunk-ng12dprz.js"),repo=resolveRepoRoot(resolve2(process.cwd(),expandTilde(repoArg&&repoArg.length>0?repoArg:"."))),typed=vendorArg?.trim();if(typed&&!isBuiltinVendor(typed)&&!getCustomEngineIds().includes(typed)){let known=[...BUILTIN_VENDORS,...getCustomEngineIds()].join(", ");adoptUsageError(`unknown engine "${typed}" \u2014 no task was created. Known engines: ${known}`)}let vendor=coerceVendorId(vendorArg),orch=await openLocalOrchestrator(),worktrees=await orch.discoverAdoptableWorktrees(repo);if(worktrees.length===0){console.log(`no adoptable worktrees for ${repo} \u2014 every git worktree here is already a task`);return}let isMatch=(w)=>!glob||matchPathGlob(glob,w.path);console.log(`adoptable worktrees in ${repo}:`);for(let w of worktrees){let hit=glob?isMatch(w)?"*":" ":"-",tags=[w.dirty===!0?"dirty":w.dirty===null?"dirty?":"",w.roveManaged?"":"external"].filter(Boolean).join(",");console.log(` ${hit} ${w.branch} ${w.path}${tags?` (${tags})`:""}`)}if(!glob){console.log(`
22
24
  pass a path glob to adopt, e.g. ${CLI_NAME} adopt '${repo}/*' --yes`);return}let matched=worktrees.filter(isMatch);if(matched.length===0){console.log(`
23
25
  no worktrees match glob ${JSON.stringify(glob)}`);return}if(!yes){console.log(`
24
26
  ${matched.length} worktree(s) match \u2014 re-run with --yes to adopt them`);return}await adoptWorktreesInto(orch,repo,matched,vendor),console.log(`done \u2014 adopted ${matched.length} worktree(s)`)}function printTopLevelUsage(out){out.write(`${topLevelUsage()}
25
- `)}var COMMANDS=new Map([["add",runAddSubcommand],["remove",runRemoveSubcommand],["adopt",runAdoptSubcommand],...DYNAMIC_COMMANDS]);async function main(){let[,,...rawArgs]=process.argv,[subcommand,...rest]=rawArgs;if(subcommand==="--version"||subcommand==="-v"||subcommand==="version"){let{CURRENT_VERSION:CURRENT_VERSION2}=await import("./chunk-a1k2z44b.js");console.log(`${CLI_NAME} ${CURRENT_VERSION2}`);return}if(subcommand==="--help"||subcommand==="-h"||subcommand==="help"){printTopLevelUsage(process.stdout);return}if(subcommand==="--skill"){let{runSkillSubcommand}=await import("./chunk-cv1kaq8a.js");await runSkillSubcommand(["print"]);return}let handler=subcommand!==void 0?COMMANDS.get(subcommand):void 0;if(handler){await handler(rest);return}if(subcommand!==void 0&&isPathLikeArg(subcommand)){await runOpenDirectory(subcommand);return}if(subcommand!==void 0)console.error(`${CLI_NAME}: unknown command '${subcommand}'`),printTopLevelUsage(process.stderr),process.exit(2);let{publishKobeTerminalTitle}=await import("./chunk-1tx1s5v6.js");publishKobeTerminalTitle();let{startTui}=await import("./chunk-tcj36cqg.js");await startTui();let{runPendingWelcomeInstalls}=await import("./chunk-67ev8k22.js");runPendingWelcomeInstalls()}main().catch((err)=>{console.error(formatCliFailure(err,{cliName:CLI_NAME,argv:process.argv,cwd:process.cwd(),env:process.env})),process.exit(1)});
27
+ `)}var COMMANDS=new Map([["add",runAddSubcommand],["remove",runRemoveSubcommand],["adopt",runAdoptSubcommand],...DYNAMIC_COMMANDS]);async function main(){let[,,...rawArgs]=process.argv,[subcommand,...rest]=rawArgs;if(subcommand==="--version"||subcommand==="-v"||subcommand==="version"){let{CURRENT_VERSION:CURRENT_VERSION2}=await import("./chunk-gqydm0q8.js");console.log(`${CLI_NAME} ${CURRENT_VERSION2}`);return}if(subcommand==="--help"||subcommand==="-h"||subcommand==="help"){printTopLevelUsage(process.stdout);return}if(subcommand==="--skill"){let{runSkillSubcommand}=await import("./chunk-cp89n425.js");await runSkillSubcommand(["print"]);return}let handler=subcommand!==void 0?COMMANDS.get(subcommand):void 0;if(handler){await handler(rest);return}if(subcommand!==void 0&&isPathLikeArg(subcommand)){await runOpenDirectory(subcommand);return}if(subcommand!==void 0)console.error(`${CLI_NAME}: unknown command '${subcommand}'`),printTopLevelUsage(process.stderr),process.exit(2);let{publishRoveTerminalTitle}=await import("./chunk-t8v9rpdx.js");publishRoveTerminalTitle();let{launchTui}=await import("./chunk-wvmjdnhk.js");await launchTui()}main().catch((err)=>{console.error(formatCliFailure(err,{cliName:CLI_NAME,argv:process.argv,cwd:process.cwd(),env:process.env})),process.exit(1)});