@sma1lboy/rove 0.9.310-nightly.20261128 → 0.9.310

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 (250) hide show
  1. package/dist/cli/{chunk-rrtbrnsm.js → chunk-06cpc990.js} +1 -1
  2. package/dist/cli/chunk-0ccgkp9z.js +2 -0
  3. package/dist/cli/{chunk-qjq62kcb.js → chunk-0mdzphdz.js} +1 -1
  4. package/dist/cli/chunk-0rfd9c8r.js +9 -0
  5. package/dist/cli/{chunk-n7wa2g9g.js → chunk-0rfkgmns.js} +1 -1
  6. package/dist/cli/{chunk-0gdrrkeb.js → chunk-0x3vfkz9.js} +1 -1
  7. package/dist/cli/chunk-0xn13zhr.js +2 -0
  8. package/dist/cli/{chunk-aw9y2ecv.js → chunk-11vgtrm4.js} +1 -1
  9. package/dist/cli/{chunk-7akh6mpq.js → chunk-12qq8r81.js} +1 -1
  10. package/dist/cli/chunk-140pf8yx.js +77 -0
  11. package/dist/cli/chunk-152tg65q.js +2 -0
  12. package/dist/cli/chunk-17b3wpdk.js +2 -0
  13. package/dist/cli/chunk-1thazzyj.js +2 -0
  14. package/dist/cli/chunk-1wpwxcg9.js +3 -0
  15. package/dist/cli/chunk-22knrp3g.js +2 -0
  16. package/dist/cli/{chunk-xpf5znba.js → chunk-29ftjs96.js} +1 -1
  17. package/dist/cli/{chunk-v73jr6d3.js → chunk-2vk65d66.js} +1 -1
  18. package/dist/cli/{chunk-0pd79pqm.js → chunk-361acgxq.js} +1 -1
  19. package/dist/cli/{chunk-7qqg543d.js → chunk-36qsn2v8.js} +1 -1
  20. package/dist/cli/{chunk-8vhda57t.js → chunk-39txvrcs.js} +1 -1
  21. package/dist/cli/{chunk-ndjs6pfx.js → chunk-3d6caevx.js} +1 -1
  22. package/dist/cli/chunk-3fzrgjxr.js +13 -0
  23. package/dist/cli/{chunk-vr3hz387.js → chunk-3kraw5fh.js} +1 -1
  24. package/dist/cli/chunk-3vhhs2ye.js +2 -0
  25. package/dist/cli/chunk-3wkjeqt5.js +19 -0
  26. package/dist/cli/{chunk-th94kgx8.js → chunk-3yd8nyv6.js} +2 -2
  27. package/dist/cli/chunk-451z1265.js +19 -0
  28. package/dist/cli/chunk-4csg29es.js +3 -0
  29. package/dist/cli/chunk-4g1466qe.js +2 -0
  30. package/dist/cli/{chunk-d527kp0a.js → chunk-4y536nwm.js} +1 -1
  31. package/dist/cli/chunk-599msv9a.js +2 -0
  32. package/dist/cli/{chunk-94v7fkbx.js → chunk-5jevazzh.js} +2 -2
  33. package/dist/cli/chunk-5p2hhjje.js +3 -0
  34. package/dist/cli/{chunk-e5rhtk39.js → chunk-5sb5cgsx.js} +1 -1
  35. package/dist/cli/{chunk-7za2saew.js → chunk-65nm1v5h.js} +1 -1
  36. package/dist/cli/{chunk-bccq9wmd.js → chunk-69cqwz53.js} +1 -1
  37. package/dist/cli/{chunk-t0m58ycm.js → chunk-6f6b9zxx.js} +1 -1
  38. package/dist/cli/{chunk-f3bfy4jj.js → chunk-6qp32yje.js} +1 -1
  39. package/dist/cli/{chunk-zren8xsj.js → chunk-6t1yxx9x.js} +1 -1
  40. package/dist/cli/{chunk-nsscv6nb.js → chunk-76snhsy7.js} +1 -1
  41. package/dist/cli/{chunk-9avew3w0.js → chunk-7709m234.js} +1 -1
  42. package/dist/cli/{chunk-br2ehnve.js → chunk-7fw390kp.js} +1 -1
  43. package/dist/cli/{chunk-9h9kbx1m.js → chunk-7vassnhs.js} +3 -3
  44. package/dist/cli/chunk-887ysmy5.js +2 -0
  45. package/dist/cli/{chunk-bp4wst6z.js → chunk-89xz7kc8.js} +1 -1
  46. package/dist/cli/chunk-8akyzrjc.js +2 -0
  47. package/dist/cli/chunk-8byrmc70.js +3 -0
  48. package/dist/cli/{chunk-ys6md651.js → chunk-8ca4esh6.js} +1 -1
  49. package/dist/cli/{chunk-vf138rbf.js → chunk-8y9de8mg.js} +2 -2
  50. package/dist/cli/chunk-96wm6gt4.js +7 -0
  51. package/dist/cli/{chunk-2d0yz3mg.js → chunk-97fhq6zk.js} +1 -1
  52. package/dist/cli/chunk-9qye1syf.js +3 -0
  53. package/dist/cli/{chunk-e6wjt3e2.js → chunk-a2m6sk0n.js} +1 -1
  54. package/dist/cli/chunk-a2rxzyy4.js +2 -0
  55. package/dist/cli/chunk-asnjgz5a.js +4 -0
  56. package/dist/cli/chunk-aterhn60.js +3 -0
  57. package/dist/cli/chunk-ay3c35g5.js +2 -0
  58. package/dist/cli/{chunk-1kf56h0r.js → chunk-b3nrywgm.js} +1 -1
  59. package/dist/cli/{chunk-fg8d4z6c.js → chunk-bche07fb.js} +1 -1
  60. package/dist/cli/{chunk-5nwcwk6x.js → chunk-bsprr76b.js} +1 -1
  61. package/dist/cli/{chunk-jpc5yh8e.js → chunk-bwgtbaex.js} +1 -1
  62. package/dist/cli/chunk-bxabhkaq.js +21 -0
  63. package/dist/cli/{chunk-se483mcw.js → chunk-bz3p5vp1.js} +3 -3
  64. package/dist/cli/chunk-bzqjk9fb.js +3 -0
  65. package/dist/cli/chunk-c4c03wnz.js +3 -0
  66. package/dist/cli/{chunk-kqb8dd6n.js → chunk-cjzyc7cn.js} +12 -10
  67. package/dist/cli/{chunk-b550dwkd.js → chunk-cq4fym60.js} +1 -1
  68. package/dist/cli/{chunk-6d49rhme.js → chunk-cqazrkzw.js} +1 -1
  69. package/dist/cli/{chunk-vnp1k7ek.js → chunk-d3sgpjj6.js} +1 -1
  70. package/dist/cli/{chunk-rzem07e4.js → chunk-d5gtdecq.js} +1 -1
  71. package/dist/cli/chunk-de89aagk.js +6 -0
  72. package/dist/cli/chunk-ecdnw5xe.js +70 -0
  73. package/dist/cli/{chunk-sgnm8v1a.js → chunk-ehssspvr.js} +1 -1
  74. package/dist/cli/{chunk-ytrktnmv.js → chunk-emzt8crt.js} +1 -1
  75. package/dist/cli/{chunk-pnv7anct.js → chunk-ene2k7kb.js} +1 -1
  76. package/dist/cli/{chunk-a5p8fvpv.js → chunk-ep7abg35.js} +1 -1
  77. package/dist/cli/{chunk-7h5xfs5r.js → chunk-etj5h8hg.js} +2 -2
  78. package/dist/cli/chunk-ex2qtjt3.js +3 -0
  79. package/dist/cli/chunk-expgczbc.js +2 -0
  80. package/dist/cli/{chunk-9bq5e4fm.js → chunk-ez623zqp.js} +1 -1
  81. package/dist/cli/chunk-fads90r0.js +2 -0
  82. package/dist/cli/chunk-fdajxdht.js +2 -0
  83. package/dist/cli/{chunk-rbfah7j1.js → chunk-fwrpg1q9.js} +1 -1
  84. package/dist/cli/{chunk-mq9ng0qf.js → chunk-fyxfgkrw.js} +1 -1
  85. package/dist/cli/{chunk-b8xsf17w.js → chunk-fzc40zx7.js} +1 -1
  86. package/dist/cli/{chunk-s2wr6rc2.js → chunk-fzkq16qb.js} +1 -1
  87. package/dist/cli/chunk-g9qssqb7.js +2 -0
  88. package/dist/cli/{chunk-ekp98v7y.js → chunk-gf37e6ty.js} +1 -1
  89. package/dist/cli/chunk-gfsgk1n8.js +2 -0
  90. package/dist/cli/{chunk-8gy5m5s9.js → chunk-gvxchzch.js} +2 -2
  91. package/dist/cli/chunk-gxwy1r9a.js +382 -0
  92. package/dist/cli/{chunk-0ceg9qrt.js → chunk-hedp76tw.js} +1 -1
  93. package/dist/cli/{chunk-xttwk07t.js → chunk-hvz45y6d.js} +1 -1
  94. package/dist/cli/chunk-hwckecfa.js +2 -0
  95. package/dist/cli/{chunk-r987rn4r.js → chunk-j0s13v56.js} +1 -1
  96. package/dist/cli/chunk-j25b1ggg.js +2 -0
  97. package/dist/cli/{chunk-mapwzp5d.js → chunk-j6g8jmke.js} +2 -2
  98. package/dist/cli/chunk-j8r8q5z8.js +8 -0
  99. package/dist/cli/chunk-jgkjfqm9.js +4 -0
  100. package/dist/cli/{chunk-fexbzt63.js → chunk-jpa26n83.js} +1 -1
  101. package/dist/cli/chunk-jx3zndsh.js +2 -0
  102. package/dist/cli/chunk-jykxdtad.js +3 -0
  103. package/dist/cli/{chunk-73a9kk03.js → chunk-jyrmdx8f.js} +1 -1
  104. package/dist/cli/{chunk-fkz86c53.js → chunk-k1pk159f.js} +1 -1
  105. package/dist/cli/{chunk-4q5gbyhd.js → chunk-kmfas00z.js} +1 -1
  106. package/dist/cli/{chunk-szdzakrk.js → chunk-kpq28cbh.js} +1 -1
  107. package/dist/cli/chunk-kzcd7vdj.js +189 -0
  108. package/dist/cli/chunk-m0kprsxc.js +2 -0
  109. package/dist/cli/chunk-m932h3dx.js +30 -0
  110. package/dist/cli/{chunk-r5c51qqp.js → chunk-mp535p99.js} +1 -1
  111. package/dist/cli/chunk-mpmsc9s5.js +2 -0
  112. package/dist/cli/{chunk-dmb3y33d.js → chunk-n9d40jze.js} +1 -1
  113. package/dist/cli/{chunk-0b9dhq9b.js → chunk-navavqt2.js} +1 -1
  114. package/dist/cli/chunk-nf7pks44.js +2 -0
  115. package/dist/cli/chunk-pgaf0wqj.js +2 -0
  116. package/dist/cli/chunk-pp771snb.js +3 -0
  117. package/dist/cli/{chunk-3k56eqyb.js → chunk-pw0fvd64.js} +2 -2
  118. package/dist/cli/{chunk-55h581rc.js → chunk-qbmdpbdg.js} +1 -1
  119. package/dist/cli/chunk-qe7m3bwf.js +2 -0
  120. package/dist/cli/{chunk-6x4h80aw.js → chunk-qsfc7q9h.js} +1 -1
  121. package/dist/cli/chunk-r9n3asjx.js +2 -0
  122. package/dist/cli/{chunk-7v2m50tf.js → chunk-rr97z89e.js} +1 -1
  123. package/dist/cli/{chunk-sae6zcnq.js → chunk-rt4bsvd5.js} +1 -1
  124. package/dist/cli/chunk-sd3e5htq.js +2 -0
  125. package/dist/cli/{chunk-rzskspr8.js → chunk-spr6z826.js} +1 -1
  126. package/dist/cli/{chunk-jmx0vbra.js → chunk-t2f0xqyk.js} +2 -2
  127. package/dist/cli/chunk-t9vpmnbc.js +7 -0
  128. package/dist/cli/{chunk-mwnx6dk0.js → chunk-teq8p5rp.js} +4 -4
  129. package/dist/cli/{chunk-ebd4hnwk.js → chunk-tswzvtsy.js} +1 -1
  130. package/dist/cli/chunk-tzhfek18.js +34 -0
  131. package/dist/cli/{chunk-b4fqpvf8.js → chunk-v29v0cgd.js} +1 -1
  132. package/dist/cli/chunk-v2vs5nzx.js +2 -0
  133. package/dist/cli/{chunk-brk45qrp.js → chunk-v72qzktg.js} +1 -1
  134. package/dist/cli/chunk-vg3tyctk.js +2 -0
  135. package/dist/cli/chunk-vpy8tvfy.js +6 -0
  136. package/dist/cli/{chunk-eh7gh2nd.js → chunk-w3dpq6aj.js} +3 -3
  137. package/dist/cli/chunk-w70anvs6.js +3 -0
  138. package/dist/cli/chunk-wcjpanrw.js +51 -0
  139. package/dist/cli/{chunk-ay4k354s.js → chunk-wjmte4f0.js} +1 -1
  140. package/dist/cli/chunk-wth84cjn.js +3 -0
  141. package/dist/cli/chunk-wx3pr38x.js +2 -0
  142. package/dist/cli/{chunk-zw0k97mj.js → chunk-xc2zndmb.js} +1 -1
  143. package/dist/cli/chunk-xff3eqbv.js +2 -0
  144. package/dist/cli/chunk-xq2tazj5.js +2 -0
  145. package/dist/cli/{chunk-wdsbprdp.js → chunk-y4bhq88n.js} +1 -1
  146. package/dist/cli/{chunk-a833bpk3.js → chunk-y6eqz5pa.js} +1 -1
  147. package/dist/cli/{chunk-mm9rcced.js → chunk-ydxq51g3.js} +1 -1
  148. package/dist/cli/{chunk-nkgfr338.js → chunk-yg74j7kp.js} +1 -1
  149. package/dist/cli/{chunk-gpsj28xq.js → chunk-ygdxgp8r.js} +1 -1
  150. package/dist/cli/{chunk-h9hve3q0.js → chunk-ymmzwv5w.js} +2 -2
  151. package/dist/cli/{chunk-g883a7np.js → chunk-yn7y3epg.js} +1 -1
  152. package/dist/cli/chunk-ynwk3ep3.js +2 -0
  153. package/dist/cli/chunk-ypbh8ra4.js +8 -0
  154. package/dist/cli/{chunk-243dk7qd.js → chunk-z343ngx6.js} +1 -1
  155. package/dist/cli/{chunk-tdxr7vsr.js → chunk-z3cje8hk.js} +1 -1
  156. package/dist/cli/{chunk-q11wjx9d.js → chunk-z4nk2g47.js} +1 -1
  157. package/dist/cli/{chunk-18jk12bw.js → chunk-z6k53zqj.js} +1 -1
  158. package/dist/cli/chunk-z7dzpnyt.js +2 -0
  159. package/dist/cli/{chunk-h3fhg0k6.js → chunk-z98zs1h3.js} +2 -2
  160. package/dist/cli/chunk-z9c475xb.js +1 -0
  161. package/dist/cli/chunk-zg76y0bt.js +2 -0
  162. package/dist/cli/{chunk-sxpb2rv2.js → chunk-zgmnse5q.js} +1 -1
  163. package/dist/cli/chunk-zknvzer3.js +3 -0
  164. package/dist/cli/{chunk-1tqdxper.js → chunk-zpwg3eh0.js} +1 -1
  165. package/dist/cli/{chunk-e62x3fgv.js → chunk-zswn8skz.js} +1 -1
  166. package/dist/cli/index.js +7 -7
  167. package/dist/cli/pty-host-node.mjs +1 -1
  168. package/dist/cli/rove-run.js +1 -1
  169. package/dist/cli/rove.js +5 -5
  170. package/dist/completions/rove.bash +5 -3
  171. package/dist/completions/rove.fish +6 -2
  172. package/dist/completions/rove.zsh +5 -3
  173. package/dist/skills/rove/SKILL.md +21 -1
  174. package/dist/skills/rove/references/api-flags.md +21 -7
  175. package/dist/web/assets/index-BWayUsdy.css +1 -0
  176. package/dist/web/assets/index-D7OcIn1Q.js +113 -0
  177. package/dist/web/assets/term-mount-CSGanVNa.js +94 -0
  178. package/dist/web/index.html +2 -2
  179. package/dist/web/relay/index.html +12 -12
  180. package/dist/web/relay-client/assets/index-B307rVpU.js +264 -0
  181. package/dist/web/relay-client/assets/index-T6nIyGrP.css +1 -0
  182. package/dist/web/relay-client/index.html +2 -2
  183. package/package.json +7 -7
  184. package/dist/cli/chunk-0ft14bvv.js +0 -2
  185. package/dist/cli/chunk-0fymskqv.js +0 -2
  186. package/dist/cli/chunk-0x5c0fps.js +0 -2
  187. package/dist/cli/chunk-1z684jqw.js +0 -7
  188. package/dist/cli/chunk-22zaracj.js +0 -2
  189. package/dist/cli/chunk-35bm2hhp.js +0 -3
  190. package/dist/cli/chunk-43z1kjw1.js +0 -34
  191. package/dist/cli/chunk-452h1mje.js +0 -4
  192. package/dist/cli/chunk-4bje4rs5.js +0 -2
  193. package/dist/cli/chunk-4nwydt5r.js +0 -70
  194. package/dist/cli/chunk-5fn27ykb.js +0 -3
  195. package/dist/cli/chunk-686h761b.js +0 -2
  196. package/dist/cli/chunk-6ev3tb6p.js +0 -2
  197. package/dist/cli/chunk-6rpzvsp9.js +0 -2
  198. package/dist/cli/chunk-6rtxkaq4.js +0 -62
  199. package/dist/cli/chunk-7q0tgnka.js +0 -2
  200. package/dist/cli/chunk-7xzsssdb.js +0 -2
  201. package/dist/cli/chunk-7yx30m9p.js +0 -2
  202. package/dist/cli/chunk-88c4frwd.js +0 -2
  203. package/dist/cli/chunk-8jp0h0cb.js +0 -3
  204. package/dist/cli/chunk-9hkf3fxt.js +0 -2
  205. package/dist/cli/chunk-9tfh7fm8.js +0 -2
  206. package/dist/cli/chunk-a1cdvvjj.js +0 -3
  207. package/dist/cli/chunk-b926z6ts.js +0 -3
  208. package/dist/cli/chunk-c9c6yczz.js +0 -3
  209. package/dist/cli/chunk-cq5bvzpw.js +0 -2
  210. package/dist/cli/chunk-dsqcwtw5.js +0 -5
  211. package/dist/cli/chunk-e3d8k6yn.js +0 -173
  212. package/dist/cli/chunk-ea6nmvhb.js +0 -6
  213. package/dist/cli/chunk-en31v4c6.js +0 -2
  214. package/dist/cli/chunk-ex4q79hw.js +0 -4
  215. package/dist/cli/chunk-f7h3mzk0.js +0 -3
  216. package/dist/cli/chunk-feq3nytk.js +0 -3
  217. package/dist/cli/chunk-g2brwxbt.js +0 -2
  218. package/dist/cli/chunk-g6wzch69.js +0 -162
  219. package/dist/cli/chunk-gpdrhahv.js +0 -2
  220. package/dist/cli/chunk-h0yvntcq.js +0 -3
  221. package/dist/cli/chunk-hy1pkmfa.js +0 -2
  222. package/dist/cli/chunk-jrrq9k1b.js +0 -212
  223. package/dist/cli/chunk-khfwvz0g.js +0 -2
  224. package/dist/cli/chunk-kknejavp.js +0 -2
  225. package/dist/cli/chunk-m00ftggk.js +0 -11
  226. package/dist/cli/chunk-mktg22yf.js +0 -13
  227. package/dist/cli/chunk-mxr7n23g.js +0 -2
  228. package/dist/cli/chunk-nr7gk1r6.js +0 -2
  229. package/dist/cli/chunk-p90ne1pc.js +0 -4
  230. package/dist/cli/chunk-pmfkzjj4.js +0 -2
  231. package/dist/cli/chunk-qwkgksrt.js +0 -2
  232. package/dist/cli/chunk-r1zy756y.js +0 -2
  233. package/dist/cli/chunk-rf82fyrx.js +0 -2
  234. package/dist/cli/chunk-rv0c3aje.js +0 -2
  235. package/dist/cli/chunk-s0y3qw79.js +0 -2
  236. package/dist/cli/chunk-tm6vvy5t.js +0 -3
  237. package/dist/cli/chunk-tsyz1xr8.js +0 -2
  238. package/dist/cli/chunk-vfc9k4b9.js +0 -5
  239. package/dist/cli/chunk-wgyhtgeq.js +0 -2
  240. package/dist/cli/chunk-yecvqy0c.js +0 -2
  241. package/dist/cli/chunk-yz9erpjc.js +0 -2
  242. package/dist/cli/chunk-zhjd9pvc.js +0 -2
  243. package/dist/cli/chunk-zmk4q05h.js +0 -2
  244. package/dist/cli/chunk-zwbnsf1p.js +0 -8
  245. package/dist/cli/chunk-zy7m8fm9.js +0 -2
  246. package/dist/web/assets/index-BJEFhpXi.css +0 -1
  247. package/dist/web/assets/index-D7VnKpGY.js +0 -100
  248. package/dist/web/assets/term-mount-DBU4rcMr.js +0 -94
  249. package/dist/web/relay-client/assets/index-D9PRsWzW.js +0 -251
  250. package/dist/web/relay-client/assets/index-Dk042dEU.css +0 -1
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{openDaemonSession,resolveActiveTaskId}from"./chunk-e62x3fgv.js";import"./chunk-rrtbrnsm.js";import"./chunk-zw0k97mj.js";import"./chunk-1tqdxper.js";import"./chunk-ea6nmvhb.js";import"./chunk-96kvwzj8.js";import"./chunk-d527kp0a.js";import"./chunk-pn5ygqn6.js";import"./chunk-mm9rcced.js";import"./chunk-yt15y085.js";import"./chunk-8gy5m5s9.js";import"./chunk-g6wb8p4p.js";import"./chunk-nc46gddg.js";import"./chunk-91sykzqq.js";export{resolveActiveTaskId,openDaemonSession};
@@ -1,3 +0,0 @@
1
- // @bun
2
- import{markCliTabSession,publishCliTabSnapshot,readDaemonTabs}from"./chunk-bp4wst6z.js";import{deriveTitleFromPrompt}from"./chunk-4kepb278.js";import{TaskDeletingError}from"./chunk-ys6md651.js";import{awaitEngineProcess,buildEngineSessionLaunch,deliverToHostedKey,enginePresence,ensureHostedEngine,ensureHostedSessionHost,findHostedEngineKey,hostedSessionFailureLine,hostedTaskKeys,killHostedSessions,launchReposOf,listHostedSessions,openHostedSessionHost,pastePromptWhenEngineUp,trustEngineWorktree,trustExtraRepos}from"./chunk-3k56eqyb.js";import{engineLaunchArgv,engineResumeArgv,protocolEntry,withPinnedSessionId}from"./chunk-feq3nytk.js";import{hostedKeyFor}from"./chunk-ebd4hnwk.js";import{resolveSessionShell}from"./chunk-tn9gtf18.js";import{taskCwd}from"./chunk-sckqk79z.js";import{DEFAULT_TASK_VENDOR}from"./chunk-w2czjjxy.js";var MAX_SESSIONS_SCANNED=8;function titleFromMessages(messages){let firstUser=messages.find((m)=>m.role==="user");if(!firstUser)return"";let text=firstUser.blocks.filter((b)=>b.type==="text").map((b)=>b.text).join(" "),title=deriveTitleFromPrompt(text);return title.length>0?Buffer.from(title,"utf8").toString("utf8"):title}async function deriveTitleFromSession(worktree,vendor=DEFAULT_TASK_VENDOR){if(!worktree)return"";let{history}=protocolEntry(vendor),ids=await history.listSessionIdsForWorktree(worktree);for(let sessionId of ids.slice(0,MAX_SESSIONS_SCANNED)){let title=titleFromMessages(await history.readHistory(sessionId));if(title)return title}return""}async function deriveTitleFromSessionId(vendor,sessionId){if(!sessionId)return"";try{return titleFromMessages(await protocolEntry(vendor).history.readHistory(sessionId))}catch{return""}}async function getTask(link,taskId){let{task}=await link.request("task.get",{taskId});return task}async function ensureTaskWorktree(link,taskId){let task=await getTask(link,taskId);if(task.deletion)throw new TaskDeletingError(taskId);let hasExtras=Boolean(task.extraRepos?.length);if(task.worktreePath&&!hasExtras){let repos=task.sharesWorkspaceOf?await launchReposOf(link,taskId):void 0;return{task,worktreePath:taskCwd(task),repos}}let{worktreePath}=await link.request("task.ensureWorktree",{taskId});if(!worktreePath)throw Error(`task ${taskId} has no worktree`);return{task,worktreePath:taskCwd({worktreePath,cwdSubpath:task.cwdSubpath}),repos:hasExtras||task.sharesWorkspaceOf?await launchReposOf(link,taskId):void 0}}async function ensureTaskSessionAdapter(link,taskId){let{task,worktreePath,repos}=await ensureTaskWorktree(link,taskId),launch=taskEngineLaunch(task,worktreePath,{kind:"repo-init"},repos),host=await ensureHostedSessionHost();try{if(!(await ensureHostedEngine(host.rpc,worktreePath,launch)).alive)throw Error(`failed to start hosted engine session for ${taskId}`);if(launch.firstMessage){let engineBin=engineLaunchArgv({command:task.command,vendor:task.vendor,effort:task.modelEffort,model:task.model})[0];await pastePromptWhenEngineUp(host.rpc,launch.key,engineBin,launch.firstMessage,{initMarkerPath:launch.initMarkerPath,initTimeoutMs:launch.initTimeoutMs}).catch(()=>!1)}}finally{host.close()}return{session:launch.key,worktreePath}}async function startTaskSessionWithPromptAdapter(link,taskId,prompt,options={}){let{task,worktreePath,repos}=await ensureTaskWorktree(link,taskId);await link.request("task.observeLanguage",{taskId,text:prompt}).catch(()=>{});let base=engineLaunchArgv({command:task.command,vendor:task.vendor,effort:task.modelEffort,model:task.model}),row=(await readDaemonTabs(link,taskId).catch(()=>{return}))?.tabs.find((tab)=>tab.id==="tab-1"),held=row?.kind==="engine"&&row.spawned&&row.sessionId?row.sessionId:null,resumeArgv=held&&!options.newConversation?engineResumeArgv(base,task.vendor,held):null,host=await ensureHostedSessionHost();try{let start=async(argv,text)=>{let launch=taskEngineLaunch(task,worktreePath,{kind:"new-task",prompt:text},repos,argv),opened=await ensureHostedEngine(host.rpc,worktreePath,launch);if(!opened.alive)return{started:!1,error:"hosted session did not open",key:launch.key};let wait={initMarkerPath:launch.initMarkerPath,initTimeoutMs:launch.initTimeoutMs},reattached=opened.created===!1&&opened.respawned!==!0,paste=launch.firstMessage??(reattached?text:void 0);if((paste?await pastePromptWhenEngineUp(host.rpc,launch.key,base[0],paste,wait):await awaitEngineProcess(host.rpc,launch.key,base[0],wait))!==null)return{started:!0,key:launch.key};if(reattached)return{started:!1,error:"NOT_DELIVERED: tab-1 was already open and the prompt could not be pasted into its engine",key:launch.key};return{started:!1,error:await startFailureReason(host.rpc,launch.key),key:launch.key}};if(resumeArgv){let resumed=await start(resumeArgv,options.resumedPrompt??prompt);if(resumed.started)return{started:!0,resumed:!0};await killHostedSessions(host.rpc,[resumed.key],{wait:!0})}let pinned=withPinnedSessionId(base,task.vendor),{key:_key,...fresh}=await start(pinned.argv,prompt);if(fresh.started)await publishCliTabSnapshot(link,taskId,pinned.sessionId),await markCliTabSession(link,taskId,"tab-1",pinned.sessionId);return fresh}finally{host.close()}}async function startFailureReason(rpc,key){let tail=await hostedSessionFailureLine(rpc,key),base="engine process never started";return tail?`engine process never started; last session output: ${tail}`:"engine process never started"}function taskEngineLaunch(task,worktreePath,promptIntent,repos,argv=engineLaunchArgv({command:task.command,vendor:task.vendor,effort:task.modelEffort,model:task.model})){return trustEngineWorktree(task.vendor,worktreePath),trustExtraRepos(task.vendor,repos),buildEngineSessionLaunch({task:{id:task.id,kind:task.kind,vendor:task.vendor,repo:task.repo,repos},worktreePath,shell:resolveSessionShell(),argv,promptIntent})}async function deliverPromptToLiveEngineAdapter(task,prompt){let host=await openHostedSessionHost();if(!host)return!1;try{let sessions=await listHostedSessions(host.rpc),engineArgv=engineLaunchArgv({command:task.command,vendor:task.vendor}),key=findHostedEngineKey(sessions,task.id,engineArgv[0],task.scope);if(!key)return!1;let presence=await enginePresence(sessions.find((s)=>s.key===key)?.pid,engineArgv);if(presence.kind!=="engine")return!1;return await deliverToHostedKey(host.rpc,key,prompt,{vendor:presence.vendor})!==null}catch{return!1}finally{host.close()}}function tabIdFromHostedKey(key){return key.split("::")[1]??"tab-1"}async function deliverPromptToLiveEngineDetailedAdapter(task,prompt){let host=await openHostedSessionHost();if(!host)return{outcome:"no-session"};try{let sessions=await listHostedSessions(host.rpc),engineArgv=engineLaunchArgv({command:task.command,vendor:task.vendor}),key=findHostedEngineKey(sessions,task.id,engineArgv[0],task.scope);if(!key)return{outcome:"no-session"};let presence=await enginePresence(sessions.find((s)=>s.key===key)?.pid,engineArgv);if(presence.kind!=="engine")return{outcome:"no-engine",tabId:tabIdFromHostedKey(key)};return await deliverToHostedKey(host.rpc,key,prompt,{vendor:presence.vendor})===null?{outcome:"no-session"}:{outcome:"delivered",tabId:tabIdFromHostedKey(key)}}catch{return{outcome:"no-session"}}finally{host.close()}}async function deliverPromptToLiveEngineTabDetailedAdapter(target,prompt){let host=await openHostedSessionHost();if(!host)return{outcome:"no-session"};try{let key=hostedKeyFor(target.id,target.tabId,target.scope);if(!key)return{outcome:"no-session"};let sessions;try{sessions=await listHostedSessions(host.rpc)}catch{return{outcome:"no-session"}}let session=sessions.find((candidate)=>candidate.alive&&candidate.key===key);if(!session)return{outcome:"no-session"};let engineArgv=engineLaunchArgv({command:target.command,vendor:target.vendor}),presence=await enginePresence(session.pid,engineArgv);if(presence.kind!=="engine")return{outcome:"no-engine",tabId:target.tabId};return await deliverToHostedKey(host.rpc,key,prompt,{vendor:presence.vendor})===null?{outcome:"no-session"}:{outcome:"delivered",tabId:target.tabId}}finally{host.close()}}async function tearDownTaskSessionAdapter(taskId,scope){let host=await openHostedSessionHost();if(!host)return;try{let keys=hostedTaskKeys(await listHostedSessions(host.rpc),taskId,scope);await killHostedSessions(host.rpc,keys,{wait:!0})}catch{}finally{host.close()}}async function stopTaskEngineTabAdapter(taskId,tabId,scope){let host=await openHostedSessionHost();if(!host)return;try{let key=hostedKeyFor(taskId,tabId,scope);if(key)await killHostedSessions(host.rpc,[key],{wait:!0})}finally{host.close()}}
3
- export{deriveTitleFromSession,deriveTitleFromSessionId,ensureTaskSessionAdapter,startTaskSessionWithPromptAdapter,deliverPromptToLiveEngineAdapter,deliverPromptToLiveEngineDetailedAdapter,deliverPromptToLiveEngineTabDetailedAdapter,tearDownTaskSessionAdapter,stopTaskEngineTabAdapter};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{addRemoteRepo,addSavedRepo,backfillSavedReposFromProjects,getCustomEngineIds,getDisabledEngineIds,getPersistedString,getPersistedValue,getRemoteRepoConfig,getRemoteRepos,getRepoInitOverride,getSavedRepos,inspectRepo,isGitRepo,isRemoteProjectsEnabled,isRemoteRepoKey,isValidBranchName,normalizeSavedRepos,remoteRepoKey,removeSavedRepo,resolveMainRepoRoot,resolveRepoRoot,setPersistedString,setRepoInitOverride,statePath,storedRepos}from"./chunk-f7h3mzk0.js";import"./chunk-h8qg9v95.js";import"./chunk-tm6vvy5t.js";import"./chunk-7akh6mpq.js";import"./chunk-pn5ygqn6.js";import"./chunk-rzskspr8.js";import"./chunk-mm9rcced.js";import"./chunk-yt15y085.js";import"./chunk-8gy5m5s9.js";import"./chunk-pzbcbmm4.js";import"./chunk-4ctx6hst.js";import"./chunk-g6wb8p4p.js";import"./chunk-nc46gddg.js";import"./chunk-91sykzqq.js";export{storedRepos,statePath,setRepoInitOverride,setPersistedString,resolveRepoRoot,resolveMainRepoRoot,removeSavedRepo,remoteRepoKey,normalizeSavedRepos,isValidBranchName,isRemoteRepoKey,isRemoteProjectsEnabled,isGitRepo,inspectRepo,getSavedRepos,getRepoInitOverride,getRemoteRepos,getRemoteRepoConfig,getPersistedValue,getPersistedString,getDisabledEngineIds,getCustomEngineIds,backfillSavedReposFromProjects,addSavedRepo,addRemoteRepo};
@@ -1,212 +0,0 @@
1
- // @bun
2
- import{getCustomEngineIds,getDisabledEngineIds}from"./chunk-f7h3mzk0.js";import{bypassFlag}from"./chunk-78y80xe8.js";import{errorMessage}from"./chunk-0zs13rdq.js";import{JsonHookAdapter,ROVE_HOOK_VERSION,editJsonSettings,hookCommandQuoting,isRoveHook,roveHookArgs}from"./chunk-vfc9k4b9.js";import{roveHookInvocation}from"./chunk-6hjt5an9.js";import{quoteShellArgv}from"./chunk-ptyqj15s.js";import{bobAuthSecretsPath,claudeGlobalConfigPath,codexAuthPath,copilotConfigPath,kimiCredentialsPath,readTextFileSyncBounded,skillsDirUnder,updateSharedJson,updateSharedJsonSync,xdgConfigHome}from"./chunk-5fn27ykb.js";import{isObject}from"./chunk-a6z2ggxd.js";import{roveStateDir}from"./chunk-pzbcbmm4.js";import{__require}from"./chunk-91sykzqq.js";import{execFile}from"child_process";import{mkdirSync,readFileSync,renameSync,statSync,writeFileSync}from"fs";import{delimiter,dirname,isAbsolute,join}from"path";import{promisify}from"util";var run=promisify(execFile),LIST_TIMEOUT_MS=15000;async function stdoutOf(bin,args){let{stdout}=await run(bin,[...args],{encoding:"utf8",timeout:LIST_TIMEOUT_MS,maxBuffer:4194304});return stdout}var CACHE_TTL_MS=900000;function binaryKey(bin){let dirs=isAbsolute(bin)?[""]:(process.env.PATH??"").split(delimiter);for(let dir of dirs){let candidate=dir?join(dir,bin):bin;try{let s=statSync(candidate);if(s.isFile())return`${candidate}:${s.mtimeMs}:${s.size}`}catch{}}return`${bin}:unknown`}function readCache(key){try{let hit=JSON.parse(readFileSync(join(roveStateDir(),"model-lists.json"),"utf8"))[key];if(!hit||typeof hit.at!=="number"||Date.now()-hit.at>CACHE_TTL_MS)return null;return Array.isArray(hit.models)?hit.models:null}catch{return null}}function writeCache(key,models){let path=join(roveStateDir(),"model-lists.json");try{mkdirSync(dirname(path),{recursive:!0});let all={};try{let parsed=JSON.parse(readFileSync(path,"utf8"));if(parsed&&typeof parsed==="object")all=parsed}catch{}all[key]={at:Date.now(),models};let tmp=`${path}.tmp-${process.pid}`;writeFileSync(tmp,JSON.stringify(all)),renameSync(tmp,path)}catch{}}async function cachedModelList(bin,args,parse){let key=`${bin} ${args.join(" ")} ${binaryKey(bin)}`,hit=readCache(key);if(hit)return hit;let models=parse(await stdoutOf(bin,args));return writeCache(key,models),models}var CLAUDE_MODELS=[{id:"fable"},{id:"opus"},{id:"sonnet"}],CODEX_MODELS=[{id:"gpt-6-astra"},{id:"gpt-5.6-luna"},{id:"gpt-5.6-sol"},{id:"gpt-5.5"}];function isClaudeFamilyModel(model){return/^(claude-|anthropic\/)|^(fable|opus|sonnet|haiku)(\[|$)/i.test(model.trim())}function isOpenAiFamilyModel(model){return/^(gpt-|o\d|codex-|openai\/)/i.test(model.trim())}function parsePiModelTable(stdout){let out=[];for(let line of stdout.split(`
3
- `)){let cols=line.trim().split(/\s+/);if(cols.length<2)continue;let[provider,model]=cols;if(provider==="provider"&&model==="model")continue;out.push({id:`${provider}/${model}`,label:model})}return out}async function listPiModels(){return cachedModelList("pi",["--list-models"],parsePiModelTable)}function parseOmpModelJson(stdout){let models=JSON.parse(stdout).models;if(!Array.isArray(models))throw Error("omp models --json: no `models` array");let out=[];for(let m of models){if(typeof m.selector!=="string"||!m.selector)continue;out.push({id:m.selector,...typeof m.name==="string"&&m.name?{label:m.name}:{}})}return out}async function listOmpModels(){return cachedModelList("omp",["models","--json"],parseOmpModelJson)}function parseModelLines(stdout){let out=[];for(let line of stdout.split(`
4
- `)){let[id="",label=""]=line.split("\t").map((c)=>c.trim());if(!id||/\s/.test(id))continue;out.push({id,...label?{label}:{}})}return out}function listModelLines(bin,args){return()=>cachedModelList(bin,args,parseModelLines)}import{homedir as homedir10}from"os";import{join as join10}from"path";import{homedir}from"os";import{join as join2}from"path";function trustAntigravityWorktree(worktreePath,home=homedir()){updateSharedJsonSync(join2(home,".gemini","antigravity-cli","settings.json"),(raw)=>{if(raw===void 0)return{};try{return JSON.parse(raw)}catch{return}},(doc)=>{let existing=Array.isArray(doc.trustedWorkspaces)?doc.trustedWorkspaces:[];if(existing.includes(worktreePath))return;return`${JSON.stringify({...doc,trustedWorkspaces:[...existing,worktreePath]},null,2)}
5
- `})}var GEMINI={rules:[{state:"blocked",any:["\u2502 apply this change","\u2502 allow execution","waiting for user confirmation"]},{state:"blocked",all:["do you want to proceed"],any:["yes"]},{state:"working",any:["esc to cancel"]}]},OPENCODE={rules:[{state:"blocked",all:["update available","would you like to update now?","skip","confirm"]},{state:"blocked",any:["\u25B3 permission required"]},{state:"blocked",all:["esc dismiss"],any:["enter confirm","enter submit","enter toggle"]},{state:"working",any:["esc interrupt","esc to interrupt","ctrl+c to interrupt","esc again to interrupt"]},{state:"idle",any:["enter send"]}]},CURSOR={rules:[{state:"blocked",any:["press any key to log in"]},{state:"blocked",all:["proceed (y)"]},{state:"blocked",any:["run this command?","waiting for approval","skip (esc or n)","(y) (enter)"]},{state:"working",any:["esc to cancel","ctrl+c to stop"]}]},GROK={rules:[{state:"blocked",any:["\u26A0 action required","ctrl+o:yolo"]},{state:"blocked",all:["\u2503"],lineRegex:["^\\s*\u2503\\s+\\S+\\s+\\(\u25CB\\)"]},{state:"working",any:["[stop]"],lineRegex:["^\\s*[\\u2800-\\u28FF]"]}]},DROID={rules:[{state:"blocked",all:["enter to select","esc to cancel"],any:["> yes, allow","> no, cancel"]},{state:"blocked",all:["enter select","esc cancel"]},{state:"working",any:["esc to stop"]}]},AMP={rules:[{state:"blocked",any:["waiting for approval","run this command?","allow editing file:","allow creating file:","confirm tool call"]},{state:"working",lineRegex:["^\\s*\u2570\\s+\\S+\\s+(thinking|streaming|running tools|waiting)\\s+\u2500"]}]},CLINE={rules:[{state:"blocked",any:["let cline use this tool"]},{state:"blocked",all:["execute command?","yes"],any:["[act mode]","[plan mode]"]},{state:"blocked",all:["use this tool?","yes"],any:["[act mode]","[plan mode]"]}]},KIRO={rules:[{state:"blocked",all:["requires approval"],any:["yes, single permission","trust, always allow","no (tab to edit)","esc to close"]},{state:"blocked",all:["pending from subagents","tool approval"],any:["approve all pending","configure individually","exit (cancel subagents)"]},{state:"working",any:["kiro is working"]},{state:"working",all:["esc to cancel"],lineRegex:["^\\s*[\u25D4\u25D1\u25D5\u25CF]\\s+[A-Za-z]"]}]},MAKI={rules:[{state:"blocked",all:["permission required","y allow","n deny"]},{state:"blocked",all:["permission required"],any:["confirm allow","confirm deny"]},{state:"blocked",all:["permission required","enter deny","esc cancel"]},{state:"blocked",all:["plan complete","enter confirm"],any:["space toggle parallel","edit plan"]},{state:"working",bottomLines:1,lineRegex:["^( [\\u2800-\\u28FF]){1,2} \\[(BUILD|PLAN|BASH)\\]"]},{state:"idle",bottomLines:1,lineRegex:["^ \\[(BUILD|PLAN|BASH)\\]"]}]},ANTIGRAVITY={rules:[{state:"blocked",all:["do you trust the contents of this project?","yes, i trust this folder"]},{state:"blocked",all:["requesting permission for:","do you want to proceed?"]},{state:"blocked",all:["requesting permission for:","tab amend","edit command"]},{state:"working",lineRegex:["^\\s*[\\u2800-\\u28FF]+\\s+[A-Za-z]+\\w*ing\\b"]},{state:"working",bottomLines:5,lineRegex:["\xB7\\s*[1-9][0-9]*\\s+task"]}]},DEVIN={rules:[{state:"blocked",bottomLines:8,all:["do you trust the authors of this directory?","yes, trust "]},{state:"blocked",bottomLines:8,all:["approve once","select","confirm","esc cancel"]},{state:"working",bottomLines:8,all:["running tools","esc to interrupt"]},{state:"working",bottomLines:6,all:["guide devin while it works"]},{state:"working",bottomLines:8,all:["reading shell ","timeout:"]},{state:"idle",bottomLines:8,all:["ask devin to build","features, fix bugs","your code"],lineRegex:["^\\s*\u276D Ask Devin to build"]},{state:"idle",bottomLines:6,all:["context:"],lineRegex:["^\\s*\u276D"]}]},QODERCLI={rules:[{state:"blocked",all:["waiting for user confirmation"],any:["yes","no","allow","reject"]},{state:"blocked",all:["awaiting approval"],any:["allow","reject"]},{state:"blocked",any:["permission required","allow once or always?","asking user","enter your response","review your answers:","shell awaiting input"]},{state:"working",any:["(esc to cancel,"]},{state:"working",lineRegex:["^\\s*[\\u2800-\\u28FF]\\s+.*[A-Za-z]"]}]},HERMES={rules:[{state:"blocked",bottomLines:14,any:["dangerous","approval","allow once","hermes needs your","type your answer","approve once","start a new session","keep going"],lineRegex:["enter\\s+(?:to\\s+)?(?:confirm|send)","press enter","\u2191/\u2193\\s+(?:to\\s+)?select","show full command","type 1/2/3","y/n quick","other \\(type"]},{state:"blocked",bottomLines:14,any:["sudo password","skill setup"]},{state:"blocked",bottomLines:14,all:["\uD83D\uDD11","for "]},{state:"working",bottomLines:5,any:["msg=interrupt","ctrl+c to interrupt","ctrl+c cancel"]}]},KILO={rules:[{state:"blocked",any:["\u25B3 permission required"]},{state:"blocked",all:["esc dismiss"],any:["enter confirm","enter submit","enter toggle"],lineRegex:["\u2191\u2193\\s*select","\u21C6\\s*tab"]},{state:"working",any:["esc interrupt"]}]},MASTRACODE={rules:[]};import{existsSync}from"fs";import{homedir as homedir2}from"os";import{dirname as dirname2,join as join3}from"path";function parseFlatHooks(raw){if(raw===void 0)return{ok:!0,doc:{}};let parsed;try{parsed=JSON.parse(raw)}catch(err){return{ok:!1,reason:`not valid JSON (${err instanceof Error?err.message:String(err)})`}}if(!isObject(parsed))return{ok:!1,reason:"top level is not a JSON object"};if(parsed.hooks===void 0)return{ok:!0,doc:parsed};if(!isObject(parsed.hooks))return{ok:!1,reason:'"hooks" is not an object'};for(let[event,entries]of Object.entries(parsed.hooks))if(!Array.isArray(entries))return{ok:!1,reason:`"hooks.${event}" is not an array`};return{ok:!0,doc:parsed}}function mergeFlatHooks(format,current,install,inv=roveHookInvocation()){let verbs=format.eventMap.map((spec)=>spec.verb),{hooks:rawHooks,...rest}=current,hooks=isObject(rawHooks)?{...rawHooks}:{},quoting=hookCommandQuoting();for(let{event,verb}of format.eventMap){let kept=(Array.isArray(hooks[event])?hooks[event]:[]).filter((entry)=>!isRoveHook(entry,verbs));if(install){let command=quoteShellArgv([...inv,"hook",verb,...roveHookArgs(format.vendor)],quoting);kept.push(format.withType?{type:"command",command}:{command})}if(kept.length>0)hooks[event]=kept;else delete hooks[event]}return{version:1,...rest,hooks}}var CURSOR_HOOK_EVENT_MAP=[{event:"sessionStart",verb:"session-start"}],CURSOR_FORMAT={vendor:"cursor",eventMap:CURSOR_HOOK_EVENT_MAP};function cursorHooksPath(home=homedir2()){let override=process.env.CURSOR_CONFIG_DIR?.trim();return join3(override||join3(home,".cursor"),"hooks.json")}function parseCursorHooks(raw){return parseFlatHooks(raw)}function mergeCursorHooks(current,install,inv=roveHookInvocation()){return mergeFlatHooks(CURSOR_FORMAT,current,install,inv)}class CursorHookAdapter{vendor="cursor";supportsHooks(){return!0}globalSettingsPath(){return cursorHooksPath()}activityDetailFromPayload(){return}cwdFromPayload(payload){let roots=payload.workspace_roots;return Array.isArray(roots)?firstString(...roots):void 0}sessionFromPayload(payload){let sessionId=firstString(payload.session_id,payload.conversation_id);if(!sessionId)return;let transcriptPath=firstString(payload.transcript_path);return{sessionId,...transcriptPath?{transcriptPath}:{}}}async installActivityHooks(settingsFilePath,opts={}){if(!existsSync(dirname2(settingsFilePath)))return{ok:!0};let outcome=await editJsonSettings(settingsFilePath,(cur)=>mergeCursorHooks(cur,!0),parseCursorHooks);if(!outcome.ok&&!opts.quiet)process.stderr.write(`[rove hooks] cursor: skipped ${outcome.file}: ${outcome.reason}
6
- `);return outcome}async removeActivityHooks(settingsFilePath){if(!existsSync(settingsFilePath))return;await editJsonSettings(settingsFilePath,(cur)=>mergeCursorHooks(cur,!1),parseCursorHooks)}hookConfigRefusal(raw){let parsed=parseCursorHooks(raw);return parsed.ok?void 0:parsed.reason}supportsWorktreeSync(){return!1}async removeWorktreeSyncHook(){}async removeWorktreeWatchHook(){}}function firstString(...values){for(let value of values)if(typeof value==="string"&&value)return value;return}import{homedir as homedir3}from"os";import{join as join4}from"path";import{existsSync as existsSync2}from"fs";import{dirname as dirname3}from"path";function sessionStartOnly(matcher){return[{event:"SessionStart",verb:"session-start",...matcher?{matcher}:{}}]}class SessionStartHookAdapter extends JsonHookAdapter{installGuardDir(settingsFilePath){return dirname3(settingsFilePath)}async installActivityHooks(settingsFilePath,opts={}){if(!existsSync2(this.installGuardDir(settingsFilePath)))return{ok:!0};return super.installActivityHooks(settingsFilePath,opts)}async removeActivityHooks(settingsFilePath){if(!existsSync2(settingsFilePath))return;await super.removeActivityHooks(settingsFilePath)}sessionFromPayload(payload){if(typeof payload.session_id!=="string"||!payload.session_id)return;return{sessionId:payload.session_id,...typeof payload.transcript_path==="string"&&payload.transcript_path?{transcriptPath:payload.transcript_path}:{}}}}var DEVIN_HOOK_EVENT_MAP=sessionStartOnly();function devinSettingsPath(home=homedir3()){let xdg=process.env.XDG_CONFIG_HOME?.trim();return join4(xdg||join4(home,".config"),"devin","config.json")}class DevinHookAdapter extends SessionStartHookAdapter{vendor="devin";eventMap=DEVIN_HOOK_EVENT_MAP;globalSettingsPath(){return devinSettingsPath()}}import{homedir as homedir4}from"os";import{join as join5}from"path";var DROID_HOOK_EVENT_MAP=sessionStartOnly();function droidSettingsPath(home=homedir4()){return join5(home,".factory","settings.json")}class DroidHookAdapter extends SessionStartHookAdapter{vendor="droid";eventMap=DROID_HOOK_EVENT_MAP;globalSettingsPath(){return droidSettingsPath()}}var CLAUDE_ICON={viewBox:"0 0 94 94",paths:[{d:"M18.7657 62.4437L37.1822 52.1167L37.4857 51.2122L37.1822 50.7085H36.2715L33.1852 50.5208L22.6615 50.2391L13.5545 49.8636L4.70044 49.3942L2.47428 48.9248L0.399902 46.1553L0.602281 44.794L2.47428 43.5266L5.15579 43.7613L11.0754 44.1837L19.98 44.794L26.4055 45.1695L35.9679 46.1553H37.4857L37.6881 45.545L37.1822 45.1695L36.7774 44.794L27.5692 38.5508L17.6021 31.9791L12.3908 28.1769L9.60812 26.2524L8.19147 24.4686L7.58433 20.5256L10.1141 17.7091L13.5545 17.9438L14.4146 18.1785L17.9056 20.8542L25.343 26.6279L35.0572 33.7629L36.4739 34.9364L37.0443 34.5514L37.1316 34.2792L36.4739 33.1996L31.212 23.6706L25.596 13.9539L23.0663 9.91695L22.4086 7.52296C22.1538 6.51831 22.0038 5.68714 22.0038 4.65957L24.8877 0.716544L26.5067 0.200195L30.4025 0.716544L32.0215 2.12477L34.4501 7.66379L38.3458 16.3478L44.4172 28.1769L46.188 31.6975L47.1493 34.9364L47.5035 35.9222H48.1106V35.3589L48.6166 28.6933L49.5273 20.5256L50.438 10.0108L50.7415 7.05356L52.2088 3.48605L55.1433 1.56148L57.42 2.64112L59.292 5.31674L59.039 7.05356L57.926 14.2824L55.7504 25.5952L54.3337 33.1996H55.1433L56.1046 32.2138L59.9497 27.1442L66.3752 19.0704L69.2085 15.8784L72.5478 12.3579L74.6728 10.668H78.7203L81.6548 15.0804L80.3394 19.6337L76.1906 24.8911L72.7502 29.3504L67.8172 35.9595L64.7562 41.2734L65.0307 41.7118L65.7681 41.6489L76.8989 39.255L82.9197 38.1753L90.1041 36.9549L93.3422 38.457L93.6963 40.006L92.4315 43.151L84.7411 45.0287L75.7353 46.8594L62.3244 50.0164L62.1759 50.1358L62.3512 50.3958L68.399 50.9432L70.9794 51.084H77.3037L89.0922 51.9759L92.1785 53.9944L93.9999 56.4822L93.6963 58.4068L88.9404 60.8008L82.5655 59.2987L67.6401 55.7312L62.5301 54.4638H61.8217V54.8862L66.0717 59.064L73.9139 66.1051L83.6786 75.2116L84.1845 77.4648L82.9197 79.2485L81.6042 79.0608L73.0032 72.5829L69.6639 69.6726L62.1759 63.3356H61.67V63.9928L63.3902 66.5276L72.5478 80.2812L73.0032 84.5059L72.3454 85.8672L69.9675 86.7121L67.3871 86.2427L61.9735 78.6852L56.4587 70.2359L52.0064 62.6315L51.4687 62.971L48.8189 91.2654L47.6047 92.7206L44.7714 93.8002L42.3934 92.0164L41.1286 89.1061L42.3934 83.3324L43.9113 75.8219L45.1255 69.8604L46.2386 62.4437L46.9184 59.9661L46.8583 59.8003L46.3153 59.8916L40.7238 67.5603L32.2239 79.0608L25.4948 86.2427L23.8758 86.8999L21.0931 85.4447L21.3461 82.863L22.9145 80.5629L32.2239 68.7338L37.8399 61.3641L41.4594 57.1337L41.4242 56.5218L41.2244 56.5048L16.489 72.6299L12.0873 73.1932L10.1647 71.4094L10.4176 68.4991L11.3283 67.5603L18.7657 62.4437Z",fill:"#D97757"}]},CODEX_ICON={viewBox:"0 0 41 41",paths:[{d:"M37.5324 16.8707C37.9808 15.5241 38.1363 14.0974 37.9886 12.6859C37.8409 11.2744 37.3934 9.91076 36.676 8.68622C35.6126 6.83404 33.9882 5.3676 32.0373 4.4985C30.0864 3.62941 27.9098 3.40259 25.8215 3.85078C24.8796 2.7893 23.7219 1.94125 22.4257 1.36341C21.1295 0.785575 19.7249 0.491269 18.3058 0.500197C16.1708 0.495044 14.0893 1.16803 12.3614 2.42214C10.6335 3.67624 9.34853 5.44666 8.6917 7.47815C7.30085 7.76286 5.98686 8.3414 4.8377 9.17505C3.68854 10.0087 2.73073 11.0782 2.02839 12.312C0.956464 14.1591 0.498905 16.2988 0.721698 18.4228C0.944492 20.5467 1.83612 22.5449 3.268 24.1293C2.81966 25.4759 2.66413 26.9026 2.81182 28.3141C2.95951 29.7256 3.40701 31.0892 4.12437 32.3138C5.18791 34.1659 6.8123 35.6322 8.76321 36.5013C10.7141 37.3704 12.8907 37.5973 14.9789 37.1492C15.9208 38.2107 17.0786 39.0587 18.3747 39.6366C19.6709 40.2144 21.0755 40.5087 22.4946 40.4998C24.6307 40.5054 26.7133 39.8321 28.4418 38.5772C30.1704 37.3223 31.4556 35.5506 32.1119 33.5179C33.5027 33.2332 34.8167 32.6547 35.9659 31.821C37.115 30.9874 38.0728 29.9178 38.7752 28.684C39.8458 26.8371 40.3023 24.6979 40.0789 22.5748C39.8556 20.4517 38.9639 18.4544 37.5324 16.8707ZM22.4978 37.8849C20.7443 37.8874 19.0459 37.2733 17.6994 36.1501C17.7601 36.117 17.8666 36.0586 17.936 36.0161L25.9004 31.4156C26.1003 31.3019 26.2663 31.137 26.3813 30.9378C26.4964 30.7386 26.5563 30.5124 26.5549 30.2825V19.0542L29.9213 20.998C29.9389 21.0068 29.9541 21.0198 29.9656 21.0359C29.977 21.052 29.9842 21.0707 29.9867 21.0902V30.3889C29.9842 32.375 29.1946 34.2791 27.7909 35.6841C26.3872 37.0892 24.4838 37.8806 22.4978 37.8849ZM6.39227 31.0064C5.51397 29.4888 5.19742 27.7107 5.49804 25.9832C5.55718 26.0187 5.66048 26.0818 5.73461 26.1244L13.699 30.7248C13.8975 30.8408 14.1233 30.902 14.3532 30.902C14.583 30.902 14.8088 30.8408 15.0073 30.7248L24.731 25.1103V28.9979C24.7321 29.0177 24.7283 29.0376 24.7199 29.0556C24.7115 29.0736 24.6988 29.0893 24.6829 29.1012L16.6317 33.7497C14.9096 34.7416 12.8643 35.0097 10.9447 34.4954C9.02506 33.9811 7.38785 32.7263 6.39227 31.0064ZM4.29707 13.6194C5.17156 12.0998 6.55279 10.9364 8.19885 10.3327C8.19885 10.4013 8.19491 10.5228 8.19491 10.6071V19.808C8.19351 20.0378 8.25334 20.2638 8.36823 20.4629C8.48312 20.6619 8.64893 20.8267 8.84863 20.9404L18.5723 26.5542L15.206 28.4979C15.1894 28.5089 15.1703 28.5155 15.1505 28.5173C15.1307 28.5191 15.1107 28.516 15.0924 28.5082L7.04046 23.8557C5.32135 22.8601 4.06716 21.2235 3.55289 19.3046C3.03862 17.3858 3.30624 15.3413 4.29707 13.6194ZM31.955 20.0556L22.2312 14.4411L25.5976 12.4981C25.6142 12.4872 25.6333 12.4805 25.6531 12.4787C25.6729 12.4769 25.6928 12.4801 25.7111 12.4879L33.7631 17.1364C34.9967 17.849 36.0017 18.8982 36.6606 20.1613C37.3194 21.4244 37.6047 22.849 37.4832 24.2684C37.3617 25.6878 36.8382 27.0432 35.9743 28.1759C35.1103 29.3086 33.9415 30.1717 32.6047 30.6641C32.6047 30.5947 32.6047 30.4733 32.6047 30.3889V21.188C32.6066 20.9586 32.5474 20.7328 32.4332 20.5338C32.319 20.3348 32.154 20.1698 31.955 20.0556ZM35.3055 15.0128C35.2464 14.9765 35.1431 14.9142 35.069 14.8717L27.1045 10.2712C26.906 10.1554 26.6803 10.0943 26.4504 10.0943C26.2206 10.0943 25.9948 10.1554 25.7963 10.2712L16.0726 15.8858V11.9982C16.0715 11.9783 16.0753 11.9585 16.0837 11.9405C16.0921 11.9225 16.1048 11.9068 16.1207 11.8949L24.1719 7.25025C25.4053 6.53903 26.8158 6.19376 28.2383 6.25482C29.6608 6.31589 31.0364 6.78077 32.2044 7.59508C33.3723 8.40939 34.2842 9.53945 34.8334 10.8531C35.3826 12.1667 35.5464 13.6095 35.3055 15.0128ZM14.2424 21.9419L10.8752 19.9981C10.8576 19.9893 10.8423 19.9763 10.8309 19.9602C10.8195 19.9441 10.8122 19.9254 10.8098 19.9058V10.6071C10.8107 9.18295 11.2173 7.78848 11.9819 6.58696C12.7466 5.38544 13.8377 4.42659 15.1275 3.82264C16.4173 3.21869 17.8524 2.99464 19.2649 3.1767C20.6775 3.35876 22.0089 3.93941 23.1034 4.85067C23.0427 4.88379 22.937 4.94215 22.8668 4.98473L14.9024 9.58517C14.7025 9.69878 14.5366 9.86356 14.4215 10.0626C14.3065 10.2616 14.2466 10.4877 14.2479 10.7175L14.2424 21.9419ZM16.071 17.9991L20.4018 15.4978L24.7325 17.9975V22.9985L20.4018 25.4983L16.071 22.9985V17.9991Z"}]},COPILOT_ICON={viewBox:"0 0 96 96",paths:[{d:"M95.6877 67.9677C92.2446 73.9488 72.2522 88.0617 48 88.0617C23.7478 88.0617 3.75535 73.9488 0.312312 67.9677C0.0605215 67.5303 -0.0207525 67.031 -0.0207525 66.5263L-0.0207524 55.8787C-0.0207524 55.4373 0.0473833 54.9986 0.210699 54.5885C1.69959 50.8499 5.59895 45.4192 10.6313 43.9621C11.2985 42.2494 12.2867 39.7456 13.2087 37.8974C13.0543 36.4833 13 35.0248 13 33.5512C13 28.2274 14.1285 23.5576 17.5288 20.0801C19.117 18.4559 21.0876 17.21 23.4246 16.2735C29.0217 11.7264 36.992 7.90112 47.9136 7.90112C58.8352 7.90112 66.9783 11.7264 72.5754 16.2735C74.9124 17.21 76.883 18.4559 78.4712 20.0801C81.8715 23.5576 83 28.2274 83 33.5512C83 35.0248 82.9457 36.4833 82.7913 37.8974C83.7133 39.7456 84.7015 42.2494 85.3687 43.9621C90.401 45.4192 94.3004 50.8499 95.7893 54.5885C95.9526 54.9986 96.0208 55.4373 96.0208 55.8787L96.0208 66.5263C96.0208 67.031 95.9395 67.5303 95.6877 67.9677ZM51.253 32.2606C51.0828 30.9345 51.0018 29.747 50.9995 28.686L50.9995 28.6021C51.0048 25.5242 51.6776 23.5215 52.7524 22.2914C54.1172 20.7295 56.9379 19.5328 62.8829 20.1762C68.9059 20.828 72.2725 22.3229 74.1812 24.2749C76.0291 26.1648 76.9999 28.9922 76.9999 33.5512C76.9999 38.3951 76.3018 41.2568 74.767 42.9977C73.3075 44.6531 70.4335 46 64.1386 46C59.2994 46 56.5326 44.4261 54.7637 42.2493C52.8644 39.912 51.7955 36.4878 51.253 32.2606ZM44.747 32.2606C44.9172 30.9344 44.9982 29.747 45.0005 28.686L45.0005 28.6021C44.9952 25.5242 44.3224 23.5214 43.2476 22.2914C41.8828 20.7295 39.0621 19.5328 33.1171 20.1762C27.0941 20.828 23.7275 22.3229 21.8188 24.2749C19.9709 26.1647 19.0001 28.9922 19.0001 33.5512C19.0001 38.3951 19.6982 41.2568 21.233 42.9977C22.6925 44.6531 25.5665 46 31.8614 46C36.7006 46 39.4674 44.4261 41.2363 42.2493C43.1356 39.9119 44.2045 36.4878 44.747 32.2606ZM48.6889 43.9983C48.4592 43.9995 48.9185 43.9983 48.6889 43.9983C48.4594 43.9983 47.5408 43.9995 47.3111 43.9983C46.8877 44.7075 46.4168 45.3882 45.8926 46.0332C42.8139 49.8219 38.2182 52 31.8613 52C24.9615 52 19.9049 50.564 16.7324 46.9657C16.552 46.7611 16.3906 46.5469 16.3906 46.5469L16 46.9657L16 73.3023C21.7392 76.4213 34.0576 82.0184 48 82.0184C61.9424 82.0184 74.2608 76.4213 80 73.3023L80 46.9657L79.6094 46.5469C79.6094 46.5469 79.4772 46.728 79.2676 46.9657C76.0951 50.564 71.0385 52 64.1387 52C57.7818 52 53.1861 49.8219 50.1074 46.0332C49.5832 45.3882 49.1123 44.7075 48.6889 43.9983Z",evenodd:!0},{d:"M58 57C60.2091 57 62 58.7909 62 61L62 69C62 71.2092 60.2091 73 58 73C55.7909 73 54 71.2092 54 69L54 61C54 58.7909 55.7909 57 58 57Z",evenodd:!0},{d:"M38 57C40.2091 57 42 58.7909 42 61L42 69C42 71.2092 40.2091 73 38 73C35.7909 73 34 71.2092 34 69L34 61C34 58.7909 35.7909 57 38 57Z",evenodd:!0}]},KIMI_ICON={viewBox:"0 0 24 25",paths:[{d:"M21.7202 0.939941C22.9502 0.939941 23.9502 1.93994 23.9502 3.16994C23.9502 4.39994 22.9502 5.39994 21.7202 5.39994H19.7502C19.6002 5.39994 19.4902 5.27994 19.4902 5.13994V3.16994C19.4902 1.93994 20.4902 0.939941 21.7202 0.939941Z",fill:"#1783FF"},{d:"M9.39 13.9501L17.82 5.59012C17.98 5.43012 17.89 5.12012 17.68 5.12012H13.14C13.14 5.12012 13.04 5.14012 13 5.18012L3.92 14.1901C3.78 14.3301 3.57 14.2101 3.57 13.9801V5.39012C3.57 5.24012 3.47 5.12012 3.35 5.12012H0.219999C0.0999993 5.12012 0 5.24012 0 5.39012V23.9201C0 24.0701 0.0999993 24.1901 0.219999 24.1901H3.35C3.47 24.1901 3.57 24.0701 3.57 23.9201V20.1401C3.57 20.0601 3.6 19.9801 3.65 19.9301L6.47 17.1401C6.54 17.0701 6.63 17.0601 6.71 17.1101L14.24 22.6501C15.47 23.4801 16.85 23.9901 18.25 24.1401C18.37 24.1501 18.48 24.0301 18.48 23.8701V20.3101C18.48 20.1701 18.4 20.0601 18.29 20.0501C17.47 19.9201 16.66 19.6001 15.94 19.1101L9.42 14.3901C9.28 14.3001 9.27 14.0701 9.39 13.9501Z"}]},OMP_ICON={viewBox:"10 8 100 74",paths:[{d:"M10 8h100v12H10zM25 20h12v62H25zM75 20h12v45H75z"},{d:"M71 55h20v16H71zM76 59h3v8h-3zM82 59h3v8h-3z",evenodd:!0,fill:"#f97316"}]};var ANTIGRAVITY_ICON={viewBox:"0 0 24 24",paths:[{d:"M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z",fill:"#3186FF"},{d:"M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z",fill:"#08B962",fade:[7,15.5,11,12]},{d:"M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z",fill:"#F94543",fade:[8,5.5,11.5,11]},{d:"M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z",fill:"#FABC12",fade:[3.5,13.5,9.94,12.81]}]};import{homedir as homedir5}from"os";import{dirname as dirname4,join as join6}from"path";var GROK_HOOK_EVENT_MAP=sessionStartOnly();function grokConfigDir(home=homedir5()){return process.env.GROK_HOME?.trim()||join6(home,".grok")}function grokHooksPath(home=homedir5()){return join6(grokConfigDir(home),"hooks","rove.json")}class GrokHookAdapter extends SessionStartHookAdapter{vendor="grok";eventMap=GROK_HOOK_EVENT_MAP;globalSettingsPath(){return grokHooksPath()}installGuardDir(settingsFilePath){return dirname4(dirname4(settingsFilePath))}sessionFromPayload(payload){let sessionId=firstString2(payload.session_id,payload.sessionId);if(!sessionId)return;let transcriptPath=firstString2(payload.transcript_path,payload.transcriptPath);return{sessionId,...transcriptPath?{transcriptPath}:{}}}}function firstString2(...values){for(let value of values)if(typeof value==="string"&&value)return value;return}import{existsSync as existsSync3}from"fs";import{rm}from"fs/promises";import{homedir as homedir6}from"os";import path2 from"path";import{mkdir,readFile,writeFile}from"fs/promises";import path from"path";async function writeIfChanged(file,content){try{if(await readFile(file,"utf8").catch(()=>{return})===content)return;await mkdir(path.dirname(file),{recursive:!0}),await writeFile(file,content)}catch{}}var HERMES_PLUGIN_NAME="rove-agent-state";function indentOf(line){if(!line.trim()||line.trim().startsWith("#"))return;let match=/^ */.exec(line),indent=match?match[0].length:0;return line[indent]==="\t"?void 0:indent}function keyAt(line,indent){if(indentOf(line)!==indent)return;return/^ *(["']?)([A-Za-z0-9_.-]+)\1:(?:\s|$)/.exec(line)?.[2]}function inlineValue(line){return(/^ *(["']?)[A-Za-z0-9_.-]+\1:(.*)$/.exec(line)?.[2]??"").trim()}function listItemAt(line,indent){if(indentOf(line)!==indent)return;let match=/^ *- *(.*)$/.exec(line);if(!match)return;return match[1].trim().replace(/^["']|["']$/g,"")}function join7(lines,trailingNewline){return lines.join(`
7
- `)+(trailingNewline?`
8
- `:"")}function setHermesPluginEnabled(content,enabled){let trailingNewline=content.endsWith(`
9
- `)||content==="",lines=content.length>0?content.replace(/\n$/,"").split(`
10
- `):[],pluginsIndex=lines.findIndex((line)=>keyAt(line,0)==="plugins");if(pluginsIndex<0){if(!enabled)return{ok:!0,content};let head=content.replace(/\n+$/,""),block=`plugins:
11
- enabled:
12
- - rove-agent-state
13
- `;return{ok:!0,content:head?`${head}
14
- ${block}`:block}}if(inlineValue(lines[pluginsIndex]??"")!=="")return{ok:!1,reason:'"plugins" is written inline; Rove only edits a block mapping'};let pluginsEnd=lines.length;for(let i=pluginsIndex+1;i<lines.length;i++)if(indentOf(lines[i]??"")===0){pluginsEnd=i;break}let enabledIndex=lines.slice(pluginsIndex+1,pluginsEnd).findIndex((line)=>keyAt(line,2)==="enabled");if(enabledIndex<0)return{ok:!1,reason:'"plugins" has no "enabled" key that Rove can add to'};let enabledAt=pluginsIndex+1+enabledIndex,enabledValue=inlineValue(lines[enabledAt]??"");if(enabledValue==="[]"){if(!enabled)return{ok:!0,content};let next2=[...lines];return next2.splice(enabledAt,1," enabled:"," - rove-agent-state"),{ok:!0,content:join7(next2,trailingNewline)}}if(enabledValue!=="")return{ok:!1,reason:'"plugins.enabled" is written inline; Rove only edits a block list'};let listEnd=pluginsEnd;for(let i=enabledAt+1;i<pluginsEnd;i++){let line=lines[i]??"",indent=indentOf(line);if(indent!==void 0&&indent<=2&&listItemAt(line,indent)===void 0){listEnd=i;break}}let itemIndent=(()=>{for(let i=enabledAt+1;i<listEnd;i++){let indent=indentOf(lines[i]??"");if(indent!==void 0&&listItemAt(lines[i]??"",indent)!==void 0)return indent}return 4})(),existing=-1;for(let i=enabledAt+1;i<listEnd;i++)if(listItemAt(lines[i]??"",itemIndent)==="rove-agent-state"){existing=i;break}if(enabled){if(existing>=0)return{ok:!0,content};let next2=[...lines];return next2.splice(enabledAt+1,0,`${" ".repeat(itemIndent)}- rove-agent-state`),{ok:!0,content:join7(next2,trailingNewline)}}if(existing<0)return{ok:!0,content};let next=[...lines];return next.splice(existing,1),{ok:!0,content:join7(next,trailingNewline)}}var HERMES_PLUGIN_MANIFEST=`name: rove-agent-state
15
- version: "1.0"
16
- description: Report Hermes Agent session identity to Rove
17
- `;function renderHermesPluginSource(opts){let{vendor,invocation}=opts;return`"""Rove activity hook \u2014 GENERATED, installed and rewritten by Rove on every
18
- launch (${vendor}). Local edits are overwritten; to stop reporting, delete this
19
- directory or turn Rove's global hooks off.
20
-
21
- ROVE_HOOK_VERSION=${ROVE_HOOK_VERSION}
22
-
23
- It subscribes to ${vendor}'s session hooks and shells out to
24
- \`${invocation.join(" ")} hook session-start --engine ${vendor}\`. Best-effort by
25
- construction: the report is fire-and-forget and every failure is swallowed \u2014 a
26
- badge must never break a turn.
27
- """
28
-
29
- from __future__ import annotations
30
-
31
- import json
32
- import os
33
- import subprocess
34
-
35
- _ENGINE = ${JSON.stringify(vendor)}
36
- _INVOCATION = ${JSON.stringify(invocation)}
37
- _HOOK_VERSION = ${JSON.stringify(String(ROVE_HOOK_VERSION))}
38
-
39
- # Hermes fires these hooks for batch and API entry points too; only a session
40
- # with a terminal behind it is the one Rove's pane is about.
41
- _INTERACTIVE_PLATFORMS = {"cli", "tui", "desktop", "acp"}
42
-
43
-
44
- def _emit(session_id: str) -> None:
45
- payload = {"session_id": session_id, "cwd": os.getcwd()}
46
- argv = list(_INVOCATION) + [
47
- "hook",
48
- "session-start",
49
- "--engine",
50
- _ENGINE,
51
- "--hook-version",
52
- _HOOK_VERSION,
53
- "--payload",
54
- json.dumps(payload),
55
- ]
56
- try:
57
- subprocess.Popen(
58
- argv,
59
- stdin=subprocess.DEVNULL,
60
- stdout=subprocess.DEVNULL,
61
- stderr=subprocess.DEVNULL,
62
- )
63
- except Exception:
64
- pass
65
-
66
-
67
- def _report(**kwargs) -> None:
68
- if kwargs.get("platform") not in _INTERACTIVE_PLATFORMS:
69
- return
70
- session_id = kwargs.get("session_id")
71
- if not isinstance(session_id, str) or not session_id:
72
- return
73
- _emit(session_id)
74
-
75
-
76
- def register(ctx):
77
- # Only the two session edges. Hermes also exposes \`pre_llm_call\`, which
78
- # would re-report the same identity once per model request \u2014 a process
79
- # spawn per call to say what session start already said.
80
- ctx.register_hook("on_session_start", _report)
81
- ctx.register_hook("on_session_reset", _report)
82
- `}function hermesConfigDir(home=homedir6()){return path2.join(home,".hermes")}function hermesConfigPath(home=homedir6()){return path2.join(hermesConfigDir(home),"config.yaml")}class HermesHookAdapter{vendor="hermes";supportsHooks(){return!0}globalSettingsPath(){return hermesConfigPath()}activityDetailFromPayload(){return}sessionFromPayload(payload){let sessionId=typeof payload.session_id==="string"?payload.session_id:void 0;return sessionId?{sessionId}:void 0}async installActivityHooks(settingsFilePath,opts={}){let configDir=path2.dirname(settingsFilePath);if(!existsSync3(configDir))return{ok:!0};let pluginDir=path2.join(configDir,"plugins",HERMES_PLUGIN_NAME);await writeIfChanged(path2.join(pluginDir,"plugin.yaml"),HERMES_PLUGIN_MANIFEST),await writeIfChanged(path2.join(pluginDir,"__init__.py"),renderHermesPluginSource({vendor:this.vendor,invocation:roveHookInvocation()}));let outcome=await this.editConfig(settingsFilePath,!0);if(!outcome.ok&&!opts.quiet)process.stderr.write(`[rove hooks] hermes: skipped ${outcome.file}: ${outcome.reason}
83
- `);return outcome}async removeActivityHooks(settingsFilePath){if(existsSync3(settingsFilePath))await this.editConfig(settingsFilePath,!1);try{await rm(path2.join(path2.dirname(settingsFilePath),"plugins",HERMES_PLUGIN_NAME),{recursive:!0,force:!0})}catch{}}hookConfigRefusal(raw){let edit=setHermesPluginEnabled(raw,!0);return edit.ok?void 0:edit.reason}supportsWorktreeSync(){return!1}async removeWorktreeSyncHook(){}async removeWorktreeWatchHook(){}async editConfig(file,enabled){let rejected;try{await updateSharedJson(file,(raw)=>({raw:raw??""}),(doc)=>{let raw=String(doc.raw??""),edit=setHermesPluginEnabled(raw,enabled);if(!edit.ok){rejected=edit.reason;return}return edit.content===raw?void 0:edit.content})}catch(err){return{ok:!1,file,reason:err instanceof Error?err.message:String(err)}}if(rejected!==void 0)return{ok:!1,file,reason:rejected};return{ok:!0}}}import{existsSync as existsSync4}from"fs";import{homedir as homedir7}from"os";import{dirname as dirname5,join as join8}from"path";var MASTRACODE_HOOK_EVENT_MAP=[{event:"SessionStart",verb:"session-start"},{event:"UserPromptSubmit",verb:"turn-start"},{event:"AgentStart",verb:"turn-start"},{event:"PermissionRequest",verb:"awaiting-input"},{event:"PermissionResult",verb:"turn-start"},{event:"Interrupt",verb:"turn-interrupted"},{event:"AgentEnd",verb:"turn-complete"},{event:"Stop",verb:"turn-complete"}],MASTRACODE_FORMAT={vendor:"mastracode",eventMap:MASTRACODE_HOOK_EVENT_MAP,withType:!0};function mastracodeHooksPath(home=homedir7()){return join8(home,".mastracode","hooks.json")}function mergeMastracodeHooks(current,install,inv=roveHookInvocation()){return mergeFlatHooks(MASTRACODE_FORMAT,current,install,inv)}class MastracodeHookAdapter{vendor="mastracode";supportsHooks(){return!0}globalSettingsPath(){return mastracodeHooksPath()}activityDetailFromPayload(kind){return kind==="awaiting-input"?{waiting:"permission"}:void 0}sessionFromPayload(payload){if(typeof payload.session_id!=="string"||!payload.session_id)return;return{sessionId:payload.session_id,...typeof payload.transcript_path==="string"&&payload.transcript_path?{transcriptPath:payload.transcript_path}:{}}}async installActivityHooks(settingsFilePath,opts={}){if(!existsSync4(dirname5(settingsFilePath)))return{ok:!0};let outcome=await editJsonSettings(settingsFilePath,(cur)=>mergeMastracodeHooks(cur,!0),parseMastracodeHooks);if(!outcome.ok&&!opts.quiet)process.stderr.write(`[rove hooks] mastracode: skipped ${outcome.file}: ${outcome.reason}
84
- `);return outcome}async removeActivityHooks(settingsFilePath){if(!existsSync4(settingsFilePath))return;await editJsonSettings(settingsFilePath,(cur)=>mergeMastracodeHooks(cur,!1),parseMastracodeHooks)}hookConfigRefusal(raw){let parsed=parseMastracodeHooks(raw);return parsed.ok?void 0:parsed.reason}supportsWorktreeSync(){return!1}async removeWorktreeSyncHook(){}async removeWorktreeWatchHook(){}}function parseMastracodeHooks(raw){return parseFlatHooks(raw)}import{existsSync as existsSync5}from"fs";import{rm as rm2}from"fs/promises";import{homedir as homedir8}from"os";import path3 from"path";function isTransientFailureText(message){return/unable to connect|fetch failed|network error|connection (error|refused|reset|closed)|socket hang up|econn(refused|reset)|etimedout|enotfound|eai_again|\b50[0234]\b|internal server error|bad gateway|service unavailable|gateway timeout/i.test(message)}function renderOpencodePluginSource(opts){let{vendor,invocation}=opts;return`/**
85
- * Rove activity hook \u2014 GENERATED, installed and rewritten by Rove on every
86
- * launch (${vendor}). Local edits are overwritten; to stop reporting, delete
87
- * this file or turn Rove's global hooks off. Add your own plugins beside it.
88
- *
89
- * ROVE_HOOK_VERSION=${ROVE_HOOK_VERSION}
90
- *
91
- * It subscribes to ${vendor}'s session lifecycle and shells out to
92
- * \`${invocation.join(" ")} hook <verb> --engine ${vendor}\`. Best-effort by
93
- * construction: every report is fire-and-forget and every failure is
94
- * swallowed \u2014 a badge must never break a turn.
95
- */
96
-
97
- import { spawn } from "node:child_process"
98
-
99
- const ENGINE = ${JSON.stringify(vendor)}
100
- const INVOCATION = ${JSON.stringify(invocation)}
101
- const HOOK_VERSION = ${JSON.stringify(String(ROVE_HOOK_VERSION))}
102
-
103
- /** A running turn, by whichever name this build of the CLI reports. */
104
- const WORKING_STATUS = new Set(["active", "busy", "pending", "retry", "running", "streaming", "working"])
105
-
106
- function text(value) {
107
- return typeof value === "string" && value.length > 0 ? value : undefined
108
- }
109
-
110
- /**
111
- * Sub-agent sessions. Their lifecycle edges must not replace the pane's root
112
- * session id, and their completions must not light the "turn done" lamp while
113
- * the user's own turn is still running.
114
- */
115
- const childSessions = new Set()
116
-
117
- /** A child session's events that still say something about the ROOT turn:
118
- * a nested agent blocked on a human blocks the whole task. */
119
- const CHILD_VERBS = new Map([
120
- ["permission.asked", "awaiting-input"],
121
- ["question.asked", "awaiting-input"],
122
- ["permission.replied", "turn-start"],
123
- ["question.replied", "turn-start"],
124
- ["question.rejected", "turn-start"],
125
- ])
126
-
127
- function emit(cwd, verb, sessionID, extra) {
128
- try {
129
- const payload = Object.assign({}, extra)
130
- if (cwd) payload.cwd = cwd
131
- if (sessionID) payload.session_id = sessionID
132
- const args = INVOCATION.slice(1).concat([
133
- "hook",
134
- verb,
135
- "--engine",
136
- ENGINE,
137
- "--hook-version",
138
- HOOK_VERSION,
139
- "--payload",
140
- JSON.stringify(payload),
141
- ])
142
- const child = spawn(INVOCATION[0], args, { stdio: "ignore", detached: false })
143
- child.on("error", () => {})
144
- } catch {
145
- /* never let observability break the engine */
146
- }
147
- }
148
-
149
- export const RoveAgentState = async (input) => {
150
- const cwd = text(input && input.directory) || text(input && input.worktree)
151
-
152
- return {
153
- "chat.message": async ({ sessionID }) => {
154
- if (sessionID && childSessions.has(sessionID)) return
155
- emit(cwd, "turn-start", sessionID)
156
- },
157
- event: async ({ event }) => {
158
- const type = event && event.type
159
- const properties = (event && event.properties) || {}
160
- const info = properties.info
161
- // session.created carries the new Session as \`info\`, not a \`sessionID\`.
162
- const sessionID = text(properties.sessionID) || (type === "session.created" ? text(info && info.id) : undefined)
163
-
164
- if (info && info.id && info.parentID) childSessions.add(info.id)
165
- if (sessionID && childSessions.has(sessionID)) {
166
- const verb = CHILD_VERBS.get(type)
167
- // No session id: a sub-agent's identity must never become the pane's.
168
- if (verb) emit(cwd, verb, undefined)
169
- return
170
- }
171
-
172
- switch (type) {
173
- case "session.created":
174
- if (sessionID) emit(cwd, "session-start", sessionID)
175
- break
176
- case "session.status": {
177
- const status = properties.status
178
- const kind = typeof status === "string" ? status : status && status.type
179
- const lowered = typeof kind === "string" ? kind.toLowerCase() : undefined
180
- if (lowered === "idle") emit(cwd, "turn-complete", sessionID)
181
- else if (lowered && WORKING_STATUS.has(lowered)) emit(cwd, "turn-start", sessionID)
182
- break
183
- }
184
- case "permission.replied":
185
- case "question.replied":
186
- case "question.rejected":
187
- emit(cwd, "turn-start", sessionID)
188
- break
189
- case "permission.asked":
190
- emit(cwd, "awaiting-input", sessionID, { waiting: "permission" })
191
- break
192
- case "question.asked":
193
- emit(cwd, "awaiting-input", sessionID, { waiting: "input" })
194
- break
195
- case "session.error":
196
- emit(cwd, "turn-failed", sessionID, { error_message: text(properties.error?.data?.message) || text(properties.error?.name) })
197
- break
198
- case "session.idle":
199
- emit(cwd, "turn-complete", sessionID)
200
- break
201
- case "session.compacted":
202
- emit(cwd, "post-compact", sessionID)
203
- break
204
- default:
205
- break
206
- }
207
- },
208
- }
209
- }
210
- `}var ACTIVITY_PLUGIN_FILE="rove-agent-state.js",FAMILY_DIRS={opencode:{configDir:"opencode",pluginDir:"plugins"},kilo:{configDir:"kilo",pluginDir:"plugin"}};function opencodeFamilyConfigDir(vendor,home=homedir8()){return path3.join(home,".config",FAMILY_DIRS[vendor].configDir)}function opencodeFamilyPluginPath(vendor,home=homedir8()){return path3.join(opencodeFamilyConfigDir(vendor,home),FAMILY_DIRS[vendor].pluginDir,ACTIVITY_PLUGIN_FILE)}function opencodeFailureDetail(payload){let raw=typeof payload.error_message==="string"?payload.error_message:"",message=raw.toLowerCase(),note=raw?raw.slice(0,200):void 0;return{failure:(()=>{if(/insufficient|credit|billing|payment required|\b402\b|quota exceeded|out of credits/.test(message))return"billing";if(/rate.?limit|too many requests|\b429\b|overloaded|capacity/.test(message))return"rate_limit";if(isTransientFailureText(message))return"transient";return"other"})(),...note?{note}:{}}}class OpencodeFamilyHookAdapter{family;vendor;constructor(family){this.family=family;this.vendor=family}supportsHooks(){return!0}globalSettingsPath(){return opencodeFamilyPluginPath(this.family)}activityDetailFromPayload(kind,payload){if(kind==="turn-failed")return opencodeFailureDetail(payload);if(kind==="awaiting-input")return{waiting:payload.waiting==="input"?"input":"permission"};return}sessionFromPayload(payload){let sessionId=typeof payload.session_id==="string"?payload.session_id:void 0;return sessionId?{sessionId}:void 0}async installActivityHooks(settingsFilePath){let configDir=path3.dirname(path3.dirname(settingsFilePath));if(!existsSync5(configDir))return{ok:!0};let source=renderOpencodePluginSource({vendor:this.family,invocation:roveHookInvocation()});return await writeIfChanged(settingsFilePath,source),{ok:!0}}async removeActivityHooks(settingsFilePath){try{await rm2(settingsFilePath,{force:!0})}catch{}}supportsWorktreeSync(){return!1}async removeWorktreeSyncHook(){}async removeWorktreeWatchHook(){}}import{homedir as homedir9}from"os";import{join as join9}from"path";var QODERCLI_HOOK_EVENT_MAP=sessionStartOnly("*");function qodercliSettingsPath(home=homedir9()){let override=process.env.QODERCLI_CONFIG_DIR?.trim();return join9(override||join9(home,".qoder"),"settings.json")}class QodercliHookAdapter extends SessionStartHookAdapter{vendor="qodercli";eventMap=QODERCLI_HOOK_EVENT_MAP;globalSettingsPath(){return qodercliSettingsPath()}}var pluginEngines=new Map;function registerPluginEngine(id,spec){if(Object.hasOwn(CONTRIB_ENGINES,id))return!1;return pluginEngines.set(id,spec),!0}function clearPluginEngines(){pluginEngines.clear()}function pluginEngineIds(){return[...pluginEngines.keys()]}var CONTRIB_ENGINES={gemini:{displayName:"Gemini CLI",defaultCommand:["gemini"],screenManifest:GEMINI,modelArgv:(base,model)=>[...base,"--model",model],skillsDir:()=>skillsDirUnder(join10(homedir10(),".gemini"))},opencode:{displayName:"OpenCode",defaultCommand:["opencode"],screenManifest:OPENCODE,firstMessageDelivery:"paste",listModels:listModelLines("opencode",["models"]),modelArgv:(base,model)=>[...base,"--model",model],createHookAdapter:()=>new OpencodeFamilyHookAdapter("opencode"),skillsDir:()=>skillsDirUnder(join10(xdgConfigHome(),"opencode"))},cursor:{displayName:"Cursor Agent",defaultCommand:["cursor-agent"],screenManifest:CURSOR,modelArgv:(base,model)=>[...base,"--model",model],permissionBypass:bypassFlag("--force","-f","--yolo"),createHookAdapter:()=>new CursorHookAdapter,skillsDir:()=>skillsDirUnder(join10(homedir10(),".cursor"))},grok:{displayName:"Grok CLI",defaultCommand:["grok"],screenManifest:GROK,createHookAdapter:()=>new GrokHookAdapter,skillsDir:()=>skillsDirUnder(grokConfigDir())},droid:{displayName:"Droid",defaultCommand:["droid"],screenManifest:DROID,createHookAdapter:()=>new DroidHookAdapter,skillsDir:()=>skillsDirUnder(join10(homedir10(),".factory"))},amp:{displayName:"Amp",defaultCommand:["amp"],screenManifest:AMP},devin:{displayName:"Devin",defaultCommand:["devin"],processNames:["devin-cli"],screenManifest:DEVIN,createHookAdapter:()=>new DevinHookAdapter,skillsDir:()=>skillsDirUnder(join10(xdgConfigHome(),"devin"))},qodercli:{displayName:"Qoder CLI",defaultCommand:["qodercli"],processNames:["qoder","qoderclicn","qodercn"],screenManifest:QODERCLI,createHookAdapter:()=>new QodercliHookAdapter,skillsDir:()=>skillsDirUnder(join10(homedir10(),".qoder"))},cline:{displayName:"Cline",defaultCommand:["cline"],screenManifest:CLINE},kiro:{displayName:"Kiro CLI",defaultCommand:["kiro-cli"],processNames:["kiro"],screenManifest:KIRO,skillsDir:()=>skillsDirUnder(join10(homedir10(),".kiro"))},maki:{displayName:"Maki",defaultCommand:["maki"],screenManifest:MAKI},antigravity:{displayName:"Antigravity",icon:ANTIGRAVITY_ICON,defaultCommand:["agy"],processNames:["antigravity","antigravity-cli"],screenManifest:ANTIGRAVITY,firstMessageArgv:(argv,text)=>[...argv,"-i",text],trustWorktree:trustAntigravityWorktree,listModels:listModelLines("agy",["models"]),modelArgv:(base,model)=>[...base,"--model",model],effortLevels:["low","medium","high","xhigh","max"],effortArgv:(base,level)=>[...base,"--effort",level],permissionBypass:bypassFlag("--dangerously-skip-permissions"),skillsDir:()=>skillsDirUnder(join10(homedir10(),".gemini","antigravity"))},hermes:{displayName:"Hermes Agent",defaultCommand:["hermes"],processNames:["hermes-agent"],screenManifest:HERMES,createHookAdapter:()=>new HermesHookAdapter,skillsDir:()=>skillsDirUnder(hermesConfigDir())},kilo:{displayName:"Kilo",defaultCommand:["kilo"],processNames:["kilo-code"],screenManifest:KILO,firstMessageDelivery:"paste",createHookAdapter:()=>new OpencodeFamilyHookAdapter("kilo"),skillsDir:()=>skillsDirUnder(join10(homedir10(),".kilo"))},mastracode:{displayName:"MastraCode",defaultCommand:["mastracode"],processNames:["mastra-code"],screenManifest:MASTRACODE,createHookAdapter:()=>new MastracodeHookAdapter}};function isContribEngine(id){return Object.hasOwn(CONTRIB_ENGINES,id)||pluginEngines.has(id)}var CONTRIB_ENGINE_IDS=Object.keys(CONTRIB_ENGINES);function contribEngineEntry(id,base){let spec=CONTRIB_ENGINES[id]??pluginEngines.get(id);if(!spec)return base;let declared=Object.fromEntries(Object.entries(spec).filter(([,v])=>v!==void 0));return{...base,...declared}}import{homedir as homedir12}from"os";import{spawnSync}from"child_process";import{existsSync as existsSync6,statSync as statSync2}from"fs";import{homedir as homedir11}from"os";import path4 from"path";var defaultBinaryDeps={fileExists(p){try{return statSync2(p).isFile()}catch{return!1}},env(name){return process.env[name]},home(){return homedir11()},which(name){let cmd=process.platform==="win32"?"where":"which",out=spawnSync(cmd,[name],{encoding:"utf8"});if(out.status!==0)return;let first=out.stdout.split(`
211
- `).map((l)=>l.trim()).filter(Boolean)[0];if(!first)return;if(first.startsWith(`${name}:`)&&first.includes("aliased to")){let aliasTarget=first.split("aliased to")[1]?.trim();return aliasTarget&&existsSync6(aliasTarget)?aliasTarget:void 0}return first},readdir(p){try{return __require("fs").readdirSync(p)}catch{return[]}}};class BinaryNotFoundError extends Error{checkedPaths;constructor(label,hint,checkedPaths){super(`${label} not found. Checked: ${checkedPaths.join(", ")}. ${hint}`);this.name="BinaryNotFoundError",this.checkedPaths=checkedPaths}}function npmStyleDirs({deps,home},locations=["system","nvm","windowsNpm","npmGlobal","local","bun","bin"]){return locations.flatMap((location)=>{switch(location){case"system":return["/opt/homebrew/bin","/usr/local/bin","/usr/bin","/bin"];case"homebrew":return["/opt/homebrew/bin","/usr/local/bin"];case"nvm":{let bin=deps.env("NVM_BIN");return bin?[bin]:[]}case"windowsNpm":{if((deps.platform?.()??process.platform)!=="win32")return[];let appData=deps.env("APPDATA"),localAppData=deps.env("LOCALAPPDATA");return[...localAppData?[path4.join(localAppData,"npm")]:[],...appData?[path4.join(appData,"npm")]:[],path4.join(home,"AppData/Roaming/npm")]}case"npmGlobal":return[path4.join(home,".npm-global/bin")];case"local":return[path4.join(home,".local/bin")];case"yarn":return[path4.join(home,".yarn/bin")];case"bun":return[path4.join(home,".bun/bin")];case"bin":return[path4.join(home,"bin")]}})}function npmStyleBinaryCandidates(ctx,name){let names=(ctx.deps.platform?.()??process.platform)==="win32"?[`${name}.exe`,`${name}.cmd`,name]:[name];return npmStyleDirs(ctx).flatMap((dir)=>names.map((n)=>path4.join(dir,n)))}function createBinaryFinder(spec){return async function(deps=defaultBinaryDeps){let checked=[],whichResult=deps.which(spec.name);if(whichResult){if(checked.push(`which:${whichResult}`),deps.fileExists(whichResult))return whichResult}for(let candidate of spec.candidates({deps,home:deps.home()}))if(checked.push(candidate),deps.fileExists(candidate))return candidate;throw spec.notFound(checked)}}class BobBinaryNotFoundError extends BinaryNotFoundError{constructor(checkedPaths){super("IBM Bob Shell binary","Ensure 'bob' is on PATH (for example `curl -fsSL https://bob.ibm.com/download/bobshell.sh | bash`).",checkedPaths);this.name="BobBinaryNotFoundError"}}var findBobBinary=createBinaryFinder({name:"bob",candidates:(ctx)=>npmStyleBinaryCandidates(ctx,"bob"),notFound:(checked)=>new BobBinaryNotFoundError(checked)});import path5 from"path";class ClaudeBinaryNotFoundError extends BinaryNotFoundError{constructor(checkedPaths){super("Claude Code binary","Ensure 'claude' is on PATH, or install at ~/.claude/local/claude.",checkedPaths);this.name="ClaudeBinaryNotFoundError"}}var findClaudeBinary=createBinaryFinder({name:"claude",candidates({deps,home}){let out=[path5.join(home,".claude","local","claude")];out.push(...npmStyleDirs({deps,home},["nvm"]).map((dir)=>path5.join(dir,"claude")));let nvmRoot=path5.join(home,".nvm","versions","node"),versions=(deps.readdir?.(nvmRoot)??[]).sort((a,b)=>b.localeCompare(a,void 0,{numeric:!0}));for(let v of versions)out.push(path5.join(nvmRoot,v,"bin","claude"));return out.push(...npmStyleDirs({deps,home},["system","local","npmGlobal","yarn","bun","bin"]).map((dir)=>path5.join(dir,"claude"))),out},notFound:(checked)=>new ClaudeBinaryNotFoundError(checked)});import path6 from"path";class CodexBinaryNotFoundError extends BinaryNotFoundError{constructor(checkedPaths){super("Codex CLI binary","Ensure 'codex' is on PATH (e.g. `brew install codex` or the official installer).",checkedPaths);this.name="CodexBinaryNotFoundError"}}var findCodexBinary=createBinaryFinder({name:"codex",candidates({deps,home}){return npmStyleDirs({deps,home},["system","nvm","local","bun","bin"]).map((dir)=>path6.join(dir,"codex"))},notFound:(checked)=>new CodexBinaryNotFoundError(checked)});class CopilotBinaryNotFoundError extends BinaryNotFoundError{constructor(checkedPaths){super("GitHub Copilot CLI binary","Ensure 'copilot' is on PATH (for example `npm install -g @github/copilot` or `brew install copilot-cli`).",checkedPaths);this.name="CopilotBinaryNotFoundError"}}var findCopilotBinary=createBinaryFinder({name:"copilot",candidates:(ctx)=>npmStyleBinaryCandidates(ctx,"copilot"),notFound:(checked)=>new CopilotBinaryNotFoundError(checked)});import path7 from"path";class KimiBinaryNotFoundError extends BinaryNotFoundError{constructor(checkedPaths){super("Kimi Code CLI binary","Ensure 'kimi' is on PATH or installed at ~/.kimi-code/bin/kimi.",checkedPaths);this.name="KimiBinaryNotFoundError"}}var findKimiBinary=createBinaryFinder({name:"kimi",candidates:(ctx)=>[path7.join(ctx.home,".kimi-code/bin"),...npmStyleDirs(ctx,["local","bin","homebrew"])].map((dir)=>path7.join(dir,"kimi")),notFound:(checked)=>new KimiBinaryNotFoundError(checked)});import path8 from"path";class PiFamilyBinaryNotFoundError extends BinaryNotFoundError{constructor(name,checkedPaths){super(`${name} CLI binary`,`Ensure '${name}' is on PATH (e.g. \`brew install ${name}\`, or \`npm i -g ${name==="omp"?"@oh-my-pi/pi-coding-agent":"@earendil-works/pi-coding-agent"}\`).`,checkedPaths);this.name="PiFamilyBinaryNotFoundError"}}function candidatesFor(name,ctx){let{home}=ctx,out=npmStyleDirs(ctx,["system","local","bun","bin"]).map((dir)=>path8.join(dir,name)),packageName=name==="omp"?"@oh-my-pi/pi-coding-agent":"@earendil-works/pi-coding-agent";for(let prefix of[path8.join(home,".npm-global"),"/usr/local","/opt/homebrew"])out.push(path8.join(prefix,"bin",name)),out.push(path8.join(prefix,"lib/node_modules",packageName,"dist","cli.js"));return out}var findPiBinary=createBinaryFinder({name:"pi",candidates:(ctx)=>candidatesFor("pi",ctx),notFound:(checked)=>new PiFamilyBinaryNotFoundError("pi",checked)}),findOmpBinary=createBinaryFinder({name:"omp",candidates:(ctx)=>candidatesFor("omp",ctx),notFound:(checked)=>new PiFamilyBinaryNotFoundError("omp",checked)});var defaultDeps={readFile(p){return readTextFileSyncBounded(p)},env(name){return process.env[name]},home(){return homedir12()},findClaudeBinary(){return findClaudeBinary()},findCodexBinary(){return findCodexBinary()},findBobBinary(){return findBobBinary()},findCopilotBinary(){return findCopilotBinary()},findKimiBinary(){return findKimiBinary()},findPiBinary(){return findPiBinary()},findOmpBinary(){return findOmpBinary()}};function decodeJwtPayload(jwt){let parts=jwt.split(".");if(parts.length!==3)return null;let payload=parts[1];if(!payload)return null;let b64=payload.replace(/-/g,"+").replace(/_/g,"/"),padded=b64+"=".repeat((4-b64.length%4)%4);try{let json=Buffer.from(padded,"base64").toString("utf8"),obj=JSON.parse(json);return typeof obj==="object"&&obj!==null?obj:null}catch{return null}}async function probeBinary(probe){try{return{found:!0,path:await probe()}}catch(err){if(err instanceof BinaryNotFoundError)return{found:!1,error:"not found on PATH"};return{found:!1,error:errorMessage(err)}}}var cachedDefaultVendors=null;async function probeAvailableVendors(deps){return(await Promise.all([["claude",()=>deps.findClaudeBinary()],["codex",()=>deps.findCodexBinary()],["copilot",()=>deps.findCopilotBinary()],["kimi",()=>deps.findKimiBinary()],["pi",()=>deps.findPiBinary()],["omp",()=>deps.findOmpBinary()]].map(async([vendor,probe])=>(await probeBinary(probe)).found?vendor:null))).filter((v)=>v!==null)}function detectAvailableVendors(deps=defaultDeps){if(deps!==defaultDeps)return probeAvailableVendors(deps);if(cachedDefaultVendors)return cachedDefaultVendors;let pending=probeAvailableVendors(deps).catch((err)=>{throw cachedDefaultVendors=null,err});return cachedDefaultVendors=pending,pending}function resetAvailableVendorsCache(){cachedDefaultVendors=null,cachedContribEngines=null}async function installedEngineIds(deps=defaultDeps){let builtins=await detectAvailableVendors(deps),contrib=await detectContribEngines();return[...new Set([...builtins,...getCustomEngineIds(),...contrib])]}async function availableEngineIds(deps=defaultDeps){let disabled=new Set(getDisabledEngineIds());return(await installedEngineIds(deps)).filter((id)=>!disabled.has(id))}var cachedContribEngines=null;function detectContribEngines(){if(cachedContribEngines)return cachedContribEngines;let which=globalThis.Bun?.which;return cachedContribEngines=Promise.resolve([...which?CONTRIB_ENGINE_IDS.filter((id)=>{let bin=CONTRIB_ENGINES[id]?.defaultCommand[0];return bin?which(bin)!==null:!1}):[],...pluginEngineIds()]),cachedContribEngines}async function detectClaudeAccount(deps=defaultDeps){let binary=await probeBinary(()=>deps.findClaudeBinary()),configPath=claudeGlobalConfigPath(deps.env,deps.home()),raw;try{raw=deps.readFile(configPath)}catch(err){return{binary,account:{kind:"none"},accountError:`read ${configPath}: ${errorMessage(err)}`}}if(raw===null)return{binary,account:{kind:"none"}};let parsed;try{parsed=JSON.parse(raw)}catch(err){return{binary,account:{kind:"none"},accountError:`parse ${configPath}: ${errorMessage(err)}`}}let oauth=parsed?.oauthAccount;if(!oauth||typeof oauth!=="object")return{binary,account:{kind:"none"}};let o=oauth,email=typeof o.emailAddress==="string"?o.emailAddress:void 0;if(!email)return{binary,account:{kind:"none"}};return{binary,account:{kind:"oauth",email,organization:typeof o.organizationName==="string"?o.organizationName:void 0,displayName:typeof o.displayName==="string"?o.displayName:void 0,billingType:typeof o.billingType==="string"?o.billingType:void 0}}}async function detectCodexAccount(deps=defaultDeps){let binary=await probeBinary(()=>deps.findCodexBinary()),authPath=codexAuthPath(deps.env,deps.home()),raw;try{raw=deps.readFile(authPath)}catch(err){return{binary,account:{kind:"none"},accountError:`read ${authPath}: ${errorMessage(err)}`}}if(raw===null)return{binary,account:{kind:"none"}};let parsed;try{parsed=JSON.parse(raw)}catch(err){return{binary,account:{kind:"none"},accountError:`parse ${authPath}: ${errorMessage(err)}`}}let obj=parsed??{},tokens=obj.tokens,idToken=typeof tokens?.id_token==="string"?tokens.id_token:void 0;if(idToken){let payload=decodeJwtPayload(idToken);if(!payload)return{binary,account:{kind:"none"},accountError:"codex id_token: malformed JWT"};let email=typeof payload.email==="string"?payload.email:void 0,authClaimRaw=payload["https://api.openai.com/auth"],authClaim=isObject(authClaimRaw)?authClaimRaw:void 0,plan=typeof authClaim?.chatgpt_plan_type==="string"?authClaim.chatgpt_plan_type:void 0;if(email)return{binary,account:{kind:"chatgpt",email,plan}};return{binary,account:{kind:"none"},accountError:"codex id_token: no email claim"}}let apiKey=obj.OPENAI_API_KEY;if(typeof apiKey==="string"&&apiKey.length>0)return{binary,account:{kind:"apikey"}};return{binary,account:{kind:"none"}}}async function detectCopilotAccount(deps=defaultDeps){let binary=await probeBinary(()=>deps.findCopilotBinary());for(let source of["COPILOT_GITHUB_TOKEN","GH_TOKEN","GITHUB_TOKEN"])if(deps.env(source)?.trim())return{binary,account:{kind:"token",source}};let configPath=copilotConfigPath(deps.env,deps.home()),raw;try{raw=deps.readFile(configPath)}catch(err){return{binary,account:{kind:"none"},accountError:`read ${configPath}: ${errorMessage(err)}`}}if(raw===null)return{binary,account:{kind:"none"}};let parsed;try{parsed=JSON.parse(raw)}catch(err){return{binary,account:{kind:"none"},accountError:`parse ${configPath}: ${errorMessage(err)}`}}if(!isObject(parsed))return{binary,account:{kind:"none"}};if(hasStringDeep(parsed,["github_token","oauth_token","access_token","token","selectedUser","currentUser","user"]))return{binary,account:{kind:"oauth"}};return{binary,account:{kind:"none"}}}async function detectBobAccount(deps=defaultDeps){let binary=await probeBinary(()=>deps.findBobBinary()),secretsPath=bobAuthSecretsPath(deps.home()),raw;try{raw=deps.readFile(secretsPath)}catch(err){return{binary,account:{kind:"none"},accountError:`read ${secretsPath}: ${errorMessage(err)}`}}if(raw===null)return{binary,account:{kind:"none"}};let parsed;try{parsed=JSON.parse(raw)}catch(err){return{binary,account:{kind:"none"},accountError:`parse ${secretsPath}: ${errorMessage(err)}`}}if(!isObject(parsed))return{binary,account:{kind:"none"}};let signedIn=Object.entries(parsed).some(([key,value])=>key.startsWith("bob.auth.tokens-")&&typeof value==="string"&&value.length>0);return{binary,account:signedIn?{kind:"oauth"}:{kind:"none"}}}async function detectKimiAccount(deps=defaultDeps){let binary=await probeBinary(()=>deps.findKimiBinary()),credPath=kimiCredentialsPath(deps.env,deps.home()),raw;try{raw=deps.readFile(credPath)}catch(err){return{binary,account:{kind:"none"},accountError:`read ${credPath}: ${errorMessage(err)}`}}if(raw===null)return{binary,account:{kind:"none"}};let parsed;try{parsed=JSON.parse(raw)}catch(err){return{binary,account:{kind:"none"},accountError:`parse ${credPath}: ${errorMessage(err)}`}}if(!isObject(parsed))return{binary,account:{kind:"none"}};let token=parsed.access_token;if(typeof token==="string"&&token.length>0)return{binary,account:{kind:"oauth"}};return{binary,account:{kind:"none"}}}function hasStringDeep(value,interestingKeys,depth=0){if(depth>4||!isObject(value))return!1;for(let[key,entry]of Object.entries(value)){if(interestingKeys.includes(key)&&typeof entry==="string"&&entry.length>0)return!0;if(isObject(entry)&&hasStringDeep(entry,interestingKeys,depth+1))return!0}return!1}
212
- export{findClaudeBinary,parseFlatHooks,mergeFlatHooks,CLAUDE_ICON,CODEX_ICON,COPILOT_ICON,KIMI_ICON,OMP_ICON,writeIfChanged,CLAUDE_MODELS,CODEX_MODELS,isClaudeFamilyModel,isOpenAiFamilyModel,listPiModels,listOmpModels,listModelLines,isTransientFailureText,registerPluginEngine,clearPluginEngines,pluginEngineIds,isContribEngine,CONTRIB_ENGINE_IDS,contribEngineEntry,resetAvailableVendorsCache,installedEngineIds,availableEngineIds,detectClaudeAccount,detectCodexAccount,detectCopilotAccount,detectBobAccount,detectKimiAccount};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{DAEMON_UNREACHABLE_MESSAGE,argvToParams,booleanFlagsOf,callVerb,errorBody,errorEnvelope,executeVerb,isDaemonUnreachable,paramsToFlags,repeatableFlagsOf,runVerb,successEnvelope,toApiError}from"./chunk-35bm2hhp.js";import"./chunk-kqb8dd6n.js";import"./chunk-nkgfr338.js";import"./chunk-b926z6ts.js";import"./chunk-73a9kk03.js";import"./chunk-v73jr6d3.js";import"./chunk-br2ehnve.js";import"./chunk-e62x3fgv.js";import"./chunk-h58qkv3b.js";import"./chunk-bp4wst6z.js";import"./chunk-zcywdm3y.js";import"./chunk-4kepb278.js";import"./chunk-7qqg543d.js";import"./chunk-ys6md651.js";import"./chunk-q8ffd1pc.js";import"./chunk-rh5024pb.js";import"./chunk-d1vv8xk6.js";import"./chunk-2bgmby1d.js";import"./chunk-hdea2ss8.js";import"./chunk-5mhvjytn.js";import"./chunk-jpc5yh8e.js";import"./chunk-n7wa2g9g.js";import"./chunk-fexbzt63.js";import"./chunk-z0wnws9w.js";import"./chunk-v8nbqjwc.js";import"./chunk-ws2q07kb.js";import"./chunk-zren8xsj.js";import"./chunk-mdx18vtz.js";import"./chunk-1kf56h0r.js";import"./chunk-jmx0vbra.js";import"./chunk-y0e28qha.js";import"./chunk-nsscv6nb.js";import"./chunk-ay4k354s.js";import"./chunk-3vm6e0cf.js";import"./chunk-f1csqde7.js";import"./chunk-9bq5e4fm.js";import"./chunk-fxpbaff2.js";import"./chunk-dmzg9zdc.js";import"./chunk-kg9kmwt9.js";import"./chunk-9k0r47z3.js";import"./chunk-a1cdvvjj.js";import"./chunk-grbrh92f.js";import"./chunk-243dk7qd.js";import"./chunk-7b2x6nkj.js";import"./chunk-3k56eqyb.js";import"./chunk-feq3nytk.js";import"./chunk-ebd4hnwk.js";import"./chunk-bccq9wmd.js";import"./chunk-mqfvzdpr.js";import"./chunk-szdzakrk.js";import"./chunk-hpay0ax8.js";import"./chunk-tteswdyf.js";import"./chunk-55h581rc.js";import"./chunk-rxqdw6s5.js";import"./chunk-tn9gtf18.js";import"./chunk-vnp1k7ek.js";import"./chunk-c9c6yczz.js";import"./chunk-gpsj28xq.js";import"./chunk-drhwacg1.js";import"./chunk-wrqv141p.js";import"./chunk-p90ne1pc.js";import"./chunk-e3d8k6yn.js";import"./chunk-jrrq9k1b.js";import"./chunk-7v2m50tf.js";import"./chunk-f60hmm20.js";import"./chunk-03ab55aq.js";import"./chunk-w7zv47mp.js";import"./chunk-ve196r2v.js";import"./chunk-nr7c9q0j.js";import"./chunk-r478tzjz.js";import"./chunk-0b9dhq9b.js";import"./chunk-rrtbrnsm.js";import"./chunk-zw0k97mj.js";import"./chunk-1tqdxper.js";import"./chunk-ea6nmvhb.js";import"./chunk-96kvwzj8.js";import"./chunk-etfh8f4z.js";import"./chunk-f7h3mzk0.js";import"./chunk-h8qg9v95.js";import"./chunk-78y80xe8.js";import"./chunk-0zs13rdq.js";import"./chunk-tm6vvy5t.js";import"./chunk-wx77yjhc.js";import"./chunk-7akh6mpq.js";import"./chunk-mktg22yf.js";import"./chunk-dsqcwtw5.js";import"./chunk-vfc9k4b9.js";import"./chunk-6hjt5an9.js";import"./chunk-ptyqj15s.js";import"./chunk-5fn27ykb.js";import"./chunk-7za2saew.js";import"./chunk-sckqk79z.js";import"./chunk-d527kp0a.js";import"./chunk-w2czjjxy.js";import"./chunk-8q0nmdh3.js";import"./chunk-pn5ygqn6.js";import"./chunk-a6z2ggxd.js";import"./chunk-8rxg12aj.js";import"./chunk-rzskspr8.js";import"./chunk-mm9rcced.js";import"./chunk-yt15y085.js";import"./chunk-8gy5m5s9.js";import"./chunk-pzbcbmm4.js";import"./chunk-4ctx6hst.js";import"./chunk-g6wb8p4p.js";import"./chunk-nc46gddg.js";import"./chunk-ksx55wt3.js";import"./chunk-91sykzqq.js";export{toApiError,successEnvelope,runVerb,repeatableFlagsOf,paramsToFlags,isDaemonUnreachable,executeVerb,errorEnvelope,errorBody,callVerb,booleanFlagsOf,argvToParams,DAEMON_UNREACHABLE_MESSAGE};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{ensureGlobalRoveHooks,readStdinText,readTextWithTimeout,runHookSubcommand}from"./chunk-b550dwkd.js";import"./chunk-zcywdm3y.js";import"./chunk-2bgmby1d.js";import"./chunk-jpc5yh8e.js";import"./chunk-ws2q07kb.js";import"./chunk-e3d8k6yn.js";import"./chunk-jrrq9k1b.js";import"./chunk-7v2m50tf.js";import"./chunk-f60hmm20.js";import"./chunk-03ab55aq.js";import"./chunk-w7zv47mp.js";import"./chunk-ve196r2v.js";import"./chunk-nr7c9q0j.js";import"./chunk-r478tzjz.js";import"./chunk-0b9dhq9b.js";import"./chunk-rrtbrnsm.js";import"./chunk-zw0k97mj.js";import"./chunk-1tqdxper.js";import"./chunk-ea6nmvhb.js";import"./chunk-96kvwzj8.js";import"./chunk-f7h3mzk0.js";import"./chunk-h8qg9v95.js";import"./chunk-78y80xe8.js";import"./chunk-0zs13rdq.js";import"./chunk-tm6vvy5t.js";import"./chunk-wx77yjhc.js";import"./chunk-7akh6mpq.js";import"./chunk-dsqcwtw5.js";import"./chunk-vfc9k4b9.js";import"./chunk-6hjt5an9.js";import"./chunk-ptyqj15s.js";import"./chunk-5fn27ykb.js";import"./chunk-7za2saew.js";import"./chunk-sckqk79z.js";import"./chunk-d527kp0a.js";import"./chunk-w2czjjxy.js";import"./chunk-8q0nmdh3.js";import"./chunk-pn5ygqn6.js";import"./chunk-a6z2ggxd.js";import"./chunk-8rxg12aj.js";import"./chunk-rzskspr8.js";import"./chunk-mm9rcced.js";import"./chunk-yt15y085.js";import"./chunk-8gy5m5s9.js";import"./chunk-pzbcbmm4.js";import"./chunk-4ctx6hst.js";import"./chunk-g6wb8p4p.js";import"./chunk-nc46gddg.js";import"./chunk-91sykzqq.js";export{runHookSubcommand,readTextWithTimeout,readStdinText,ensureGlobalRoveHooks};
@@ -1,11 +0,0 @@
1
- // @bun
2
- import{ThemeInstallError,isThemeName,parseThemeSource,writeUserTheme}from"./chunk-ex4q79hw.js";import{expandTilde}from"./chunk-grbrh92f.js";import{SUBCOMMAND_VERBS}from"./chunk-8jp0h0cb.js";import"./chunk-vnp1k7ek.js";import{BUNDLED_THEME_JSONS,userThemesDir}from"./chunk-c9c6yczz.js";import{errorMessage}from"./chunk-0zs13rdq.js";import"./chunk-pn5ygqn6.js";import"./chunk-a6z2ggxd.js";import"./chunk-pzbcbmm4.js";import{ROVE_PRODUCT_NAME}from"./chunk-4ctx6hst.js";import"./chunk-g6wb8p4p.js";import"./chunk-nc46gddg.js";import"./chunk-91sykzqq.js";import{existsSync,readFileSync,readdirSync,unlinkSync}from"fs";import{basename,join,resolve}from"path";var CLI_NAME=ROVE_PRODUCT_NAME,THEME_VERB_ALIASES={ls:"list",rm:"remove"},BUNDLED_NAMES=Object.keys(BUNDLED_THEME_JSONS);function fail(message){process.stderr.write(`${CLI_NAME} theme: ${message}
3
- Run ${CLI_NAME} theme --help for valid names and options.
4
- `),process.exit(1)}function failUsage(message){process.stderr.write(`${CLI_NAME} theme: ${message}
5
-
6
- `),printUsage(),process.exit(2)}function listThemes(){let lines=[];lines.push("bundled:");for(let name of[...BUNDLED_NAMES].sort())lines.push(` ${name} [built-in]`);let dir=userThemesDir(),userFiles=[];try{userFiles=readdirSync(dir).filter((f)=>f.endsWith(".json")).sort()}catch{}if(lines.push(""),lines.push(`user (${dir}):`),userFiles.length===0)lines.push(" (none)");else for(let f of userFiles){let name=f.slice(0,-5),path=join(dir,f),overridesBundled=BUNDLED_NAMES.includes(name)?" (overrides built-in)":"";lines.push(` ${name}${overridesBundled} ${path}`)}process.stdout.write(`${lines.join(`
7
- `)}
8
- `)}async function readSource(source){if(/^https?:\/\//i.test(source)){let res;try{res=await fetch(source)}catch(err){fail(`failed to fetch ${source}: ${errorMessage(err)}`)}if(!res.ok)fail(`failed to fetch ${source}: HTTP ${res.status} ${res.statusText}`);let text2=await res.text(),cleanPath=source.split(/[?#]/)[0]??source,file2=basename(cleanPath)||"theme.json",defaultName2=file2.endsWith(".json")?file2.slice(0,-5):file2;return{text:text2,defaultName:defaultName2}}let abs=resolve(process.cwd(),expandTilde(source)),text;try{text=readFileSync(abs,"utf8")}catch(err){fail(`failed to read ${abs}: ${errorMessage(err)}`)}let file=basename(abs),defaultName=file.endsWith(".json")?file.slice(0,-5):file;return{text,defaultName}}function parseAddArgs(args){let source=null,name,force=!1;for(let i=0;i<args.length;i+=1){let a=args[i];if(a==="--force"||a==="-f"){force=!0;continue}if(a==="--name"||a==="-n"){let next=args[i+1];if(next===void 0)failUsage("--name requires a value");name=next,i+=1;continue}if(a.startsWith("--name=")){name=a.slice(7);continue}if(a.startsWith("--"))failUsage(`unknown flag: ${a}`);if(source===null){source=a;continue}failUsage(`unexpected positional argument: ${a}`)}if(source===null)failUsage("missing <source> (URL or path to theme JSON)");return{source,opts:{name,force}}}async function addTheme(args){let{source,opts}=parseAddArgs(args),{text,defaultName}=await readSource(source);try{let{theme,fromScheme}=parseThemeSource(text),name=opts.name??(fromScheme?defaultName.replace(/(.)\.[^.]+$/,"$1"):defaultName),dest=writeUserTheme(name,theme,opts.force);process.stdout.write(`installed theme "${name}"${fromScheme?" from a terminal color scheme":""} -> ${dest}
9
- `)}catch(err){if(err instanceof ThemeInstallError)fail(err.message);throw err}}function requireThemeName(name){if(!isThemeName(name))fail(`invalid theme name "${name}" (use letters, digits, '.', '_', '-')`);return name}function removeTheme(args){if(!args[0])failUsage("missing <name>");if(args.length>1)failUsage(`unexpected extra arguments after "${args[0]}"`);let name=requireThemeName(args[0]);if(BUNDLED_NAMES.includes(name))fail(`"${name}" is a built-in theme and cannot be removed`);let dest=join(userThemesDir(),`${name}.json`);if(!existsSync(dest))fail(`no user theme named "${name}" (looked for ${dest})`);unlinkSync(dest),process.stdout.write(`removed theme "${name}" (${dest})
10
- `)}function printUsage(out=process.stderr){out.write([`Usage: ${CLI_NAME} theme <command> [args]`,"","Commands:"," list List bundled and user-installed themes"," add <source> [--name <name>] Install a theme from a URL or local path: a theme JSON,"," or a terminal color scheme file (background, foreground, ANSI palette)"," Pass --force to overwrite an existing user theme"," remove <name> Remove a user-installed theme","",`User themes live under: ${userThemesDir()}`,"Schema: https://raw.githubusercontent.com/sma1lboy/rove/main/packages/rove/src/tui/context/theme/theme.schema.json",""].join(`
11
- `))}async function runThemeSubcommand(args){let[action,...rest]=args;if(!action||action==="--help"||action==="-h"||action==="help"){if(printUsage(action?process.stdout:process.stderr),!action)process.exit(2);return}let verb=THEME_VERB_ALIASES[action]??action;if(!SUBCOMMAND_VERBS.theme.includes(verb))failUsage(`unknown action "${action}" (try ${SUBCOMMAND_VERBS.theme.map((v)=>`"${v}"`).join(", ")})`);if(verb==="list"){if(rest.length>0)failUsage(`"${action}" takes no arguments`);listThemes();return}if(verb==="add"){await addTheme(rest);return}if(verb==="remove"){removeTheme(rest);return}failUsage(`unknown action "${action}"`)}export{runThemeSubcommand};