@sma1lboy/rove 0.9.249 → 0.9.251-nightly.20261020

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 (168) hide show
  1. package/dist/cli/{chunk-h86p4zzr.js → chunk-094cgrcc.js} +1 -1
  2. package/dist/cli/chunk-0az45yae.js +2 -0
  3. package/dist/cli/chunk-0jc516f2.js +11 -0
  4. package/dist/cli/{chunk-5bfern2b.js → chunk-11wyec8z.js} +1 -1
  5. package/dist/cli/chunk-13p55zgg.js +2 -0
  6. package/dist/cli/{chunk-kxaqge09.js → chunk-14f459aa.js} +1 -1
  7. package/dist/cli/{chunk-8gmxg77t.js → chunk-1exaxwyv.js} +1 -1
  8. package/dist/cli/chunk-1f42tb22.js +2 -0
  9. package/dist/cli/{chunk-w0qy9ybf.js → chunk-1hhthz4g.js} +2 -2
  10. package/dist/cli/chunk-1s3rtx3r.js +3 -0
  11. package/dist/cli/chunk-1sjpx21n.js +2 -0
  12. package/dist/cli/{chunk-h9cg0j3a.js → chunk-21ek142k.js} +1 -1
  13. package/dist/cli/{chunk-9q1m5qz0.js → chunk-28wjmb9f.js} +1 -1
  14. package/dist/cli/chunk-29kvfqeh.js +23 -0
  15. package/dist/cli/{chunk-7xttx9m1.js → chunk-2pen6b1t.js} +1 -1
  16. package/dist/cli/{chunk-ehs0wh6y.js → chunk-2ts19s9a.js} +1 -1
  17. package/dist/cli/{chunk-a82ec09z.js → chunk-2wd4744g.js} +1 -1
  18. package/dist/cli/chunk-3rbrwfe2.js +2 -0
  19. package/dist/cli/{chunk-wtdj8n93.js → chunk-4rx3nhvq.js} +1 -1
  20. package/dist/cli/{chunk-2vgc5cyj.js → chunk-4z01vg3t.js} +1 -1
  21. package/dist/cli/chunk-52aq1xs5.js +2 -0
  22. package/dist/cli/{chunk-f7zjggfv.js → chunk-568q390y.js} +2 -2
  23. package/dist/cli/chunk-5j1p0602.js +20 -0
  24. package/dist/cli/{chunk-ptb83b12.js → chunk-5k4m5yt5.js} +1 -1
  25. package/dist/cli/{chunk-qrb2eqm5.js → chunk-5r6zg1ha.js} +1 -1
  26. package/dist/cli/{chunk-3c58659p.js → chunk-6f01fsje.js} +1 -1
  27. package/dist/cli/{chunk-rvqse0aa.js → chunk-6h0n4b5t.js} +2 -2
  28. package/dist/cli/{chunk-x2gc4vx0.js → chunk-6xh5nbd3.js} +3 -3
  29. package/dist/cli/{chunk-cm1ykwbs.js → chunk-71bsnsm3.js} +1 -1
  30. package/dist/cli/chunk-71xc2sxv.js +6 -0
  31. package/dist/cli/{chunk-yc4x46ha.js → chunk-76y3cdz7.js} +1 -1
  32. package/dist/cli/{chunk-7fc1ndtk.js → chunk-7kpxmp55.js} +1 -1
  33. package/dist/cli/{chunk-4xns5j33.js → chunk-84bmcqyz.js} +1 -1
  34. package/dist/cli/{chunk-ntrwd6ks.js → chunk-8ja7jrhc.js} +2 -2
  35. package/dist/cli/{chunk-wqfp8d9w.js → chunk-91sykzqq.js} +2 -2
  36. package/dist/cli/{chunk-8gqkrbyr.js → chunk-92zmns0y.js} +1 -1
  37. package/dist/cli/{chunk-y7mg74jx.js → chunk-964z8ccb.js} +1 -1
  38. package/dist/cli/chunk-9h940gnr.js +2 -0
  39. package/dist/cli/chunk-9p4gs9yq.js +4 -0
  40. package/dist/cli/{chunk-tbrkck2f.js → chunk-9xtg2k54.js} +1 -1
  41. package/dist/cli/chunk-9ytmk0zq.js +87 -0
  42. package/dist/cli/{chunk-dzm8f4hx.js → chunk-9z690mvn.js} +1 -1
  43. package/dist/cli/{chunk-ecdhqwsj.js → chunk-a4hsqj1b.js} +1 -1
  44. package/dist/cli/{chunk-pyy41pch.js → chunk-a6mhccf6.js} +1 -1
  45. package/dist/cli/{chunk-xv8fhxxm.js → chunk-a7m7w6d1.js} +1 -1
  46. package/dist/cli/{chunk-3pdg2afa.js → chunk-apfzdw7g.js} +2 -2
  47. package/dist/cli/chunk-ar03ag32.js +82 -0
  48. package/dist/cli/{chunk-wn4agkek.js → chunk-aw6s9ayv.js} +1 -1
  49. package/dist/cli/chunk-bsqs03z8.js +2 -0
  50. package/dist/cli/{chunk-ktzbg4jg.js → chunk-cb1dg7nz.js} +1 -1
  51. package/dist/cli/chunk-cck7f5jc.js +2 -0
  52. package/dist/cli/{chunk-g4jd8vvb.js → chunk-chzvy4x5.js} +1 -1
  53. package/dist/cli/{chunk-nhakrm1f.js → chunk-cmp64q4j.js} +1 -1
  54. package/dist/cli/{chunk-78xjh4gg.js → chunk-crdyt04z.js} +1 -1
  55. package/dist/cli/{chunk-wkt6h5cf.js → chunk-d28kyy8z.js} +1 -1
  56. package/dist/cli/chunk-d3828ttr.js +2 -0
  57. package/dist/cli/{chunk-wtb8cycx.js → chunk-dcjxtwdb.js} +1 -1
  58. package/dist/cli/chunk-dexythnk.js +3 -0
  59. package/dist/cli/{chunk-27sfb204.js → chunk-drhzdxb6.js} +1 -1
  60. package/dist/cli/{chunk-easxds8p.js → chunk-e003wm6d.js} +2 -2
  61. package/dist/cli/{chunk-q8q22wq3.js → chunk-e171nbyx.js} +1 -1
  62. package/dist/cli/{chunk-2mrwdd50.js → chunk-e1xvz3sv.js} +1 -1
  63. package/dist/cli/{chunk-7f1g1kxp.js → chunk-eg2wzscx.js} +7 -7
  64. package/dist/cli/{chunk-tydzne5g.js → chunk-fg1sx7hc.js} +1 -1
  65. package/dist/cli/chunk-fkrwqgcy.js +2 -0
  66. package/dist/cli/{chunk-7mq1ascs.js → chunk-fktvtdkb.js} +1 -1
  67. package/dist/cli/{chunk-t8v9rpdx.js → chunk-g8wrdp7n.js} +1 -1
  68. package/dist/cli/{chunk-53cyns0f.js → chunk-gp991c3v.js} +1 -1
  69. package/dist/cli/chunk-gqnnpkn8.js +2 -0
  70. package/dist/cli/{chunk-twc7bdag.js → chunk-gse10w1v.js} +1 -1
  71. package/dist/cli/chunk-h9kzwj14.js +2 -0
  72. package/dist/cli/{chunk-v1ban2hc.js → chunk-hkr8r1sg.js} +1 -1
  73. package/dist/cli/chunk-jdkr3hpe.js +3 -0
  74. package/dist/cli/{chunk-fd260eye.js → chunk-kgw1kzk4.js} +1 -1
  75. package/dist/cli/{chunk-fs3p13ah.js → chunk-kq8mywzd.js} +1 -1
  76. package/dist/cli/chunk-kyjdsax8.js +3 -0
  77. package/dist/cli/{chunk-whbm14qr.js → chunk-meyfwc50.js} +1 -1
  78. package/dist/cli/chunk-mqdx3p1q.js +52 -0
  79. package/dist/cli/{chunk-21xgqgmv.js → chunk-mt6hv8p4.js} +1 -1
  80. package/dist/cli/{chunk-1xtmkdyn.js → chunk-mv9f3b5g.js} +1 -1
  81. package/dist/cli/{chunk-mptaj95j.js → chunk-n2t1ffne.js} +1 -1
  82. package/dist/cli/chunk-n77bc7zh.js +9 -0
  83. package/dist/cli/chunk-na6xz9r5.js +17 -0
  84. package/dist/cli/{chunk-pe6wnsww.js → chunk-nj53wrzz.js} +1 -1
  85. package/dist/cli/{chunk-p83wf4zw.js → chunk-nxe45n7k.js} +2 -2
  86. package/dist/cli/chunk-p6d966bc.js +2 -0
  87. package/dist/cli/{chunk-1qxr6wsw.js → chunk-p9d26ma8.js} +1 -1
  88. package/dist/cli/{chunk-0vpn32r6.js → chunk-pvm47wsy.js} +1 -1
  89. package/dist/cli/{chunk-9aydqazr.js → chunk-q854fweb.js} +1 -1
  90. package/dist/cli/{chunk-6fr3dfhy.js → chunk-q9p4d9vr.js} +1 -1
  91. package/dist/cli/{chunk-a0kyf848.js → chunk-qd3hraax.js} +3 -3
  92. package/dist/cli/{chunk-p18ehv9y.js → chunk-qstjfseh.js} +1 -1
  93. package/dist/cli/{chunk-gcxcq22q.js → chunk-r0etyq15.js} +1 -1
  94. package/dist/cli/{chunk-hbn1t161.js → chunk-r2c5nbcq.js} +1 -1
  95. package/dist/cli/chunk-r7tbzgt7.js +2 -0
  96. package/dist/cli/{chunk-s57vy3k3.js → chunk-ra40m849.js} +1 -1
  97. package/dist/cli/{chunk-pvm3fc44.js → chunk-rf0jrh3q.js} +1 -1
  98. package/dist/cli/{chunk-sbgtbxhc.js → chunk-rm1b8fgg.js} +1 -1
  99. package/dist/cli/{chunk-8mfpv3fh.js → chunk-rt4tg426.js} +1 -1
  100. package/dist/cli/{chunk-n5dea05t.js → chunk-s2t9acrv.js} +1 -1
  101. package/dist/cli/{chunk-des00203.js → chunk-sgegp9x9.js} +1 -1
  102. package/dist/cli/{chunk-vaydxhdd.js → chunk-sjx6gn4f.js} +1 -1
  103. package/dist/cli/chunk-srq21cyw.js +2 -0
  104. package/dist/cli/{chunk-qb1agm2c.js → chunk-svseq6ge.js} +1 -1
  105. package/dist/cli/{chunk-fvmee0tr.js → chunk-t71nxngb.js} +1 -1
  106. package/dist/cli/chunk-tkft79ag.js +2 -0
  107. package/dist/cli/{chunk-ng12dprz.js → chunk-tntdcyra.js} +1 -1
  108. package/dist/cli/{chunk-dbsmf3ce.js → chunk-tq4swfhw.js} +1 -1
  109. package/dist/cli/{chunk-4nt1gnwq.js → chunk-v312167r.js} +1 -1
  110. package/dist/cli/{chunk-j4cqwqnc.js → chunk-v6d6kvmk.js} +1 -1
  111. package/dist/cli/{chunk-vej49hnt.js → chunk-vgknea9y.js} +2 -2
  112. package/dist/cli/{chunk-x6gpzj4t.js → chunk-w0gf8pe2.js} +1 -1
  113. package/dist/cli/{chunk-mxag13a6.js → chunk-w456ytdd.js} +1 -1
  114. package/dist/cli/{chunk-99n8qsw9.js → chunk-w4cpkhzj.js} +1 -1
  115. package/dist/cli/chunk-wa9jgthq.js +3 -0
  116. package/dist/cli/{chunk-nqsf6j0s.js → chunk-wghh6vj1.js} +1 -1
  117. package/dist/cli/{chunk-5yb2rehg.js → chunk-wmv58pbj.js} +1 -1
  118. package/dist/cli/{chunk-85q2tgmg.js → chunk-ws6yep7z.js} +1 -1
  119. package/dist/cli/{chunk-j9m9zr27.js → chunk-wwfatcxr.js} +1 -1
  120. package/dist/cli/{chunk-9jsm6h5y.js → chunk-x0rvg54z.js} +1 -1
  121. package/dist/cli/{chunk-e8e9f42k.js → chunk-x5c3fap3.js} +1 -1
  122. package/dist/cli/{chunk-enq6vwz5.js → chunk-x7cv6deh.js} +1 -1
  123. package/dist/cli/{chunk-1rhham18.js → chunk-xfyg3p1w.js} +1 -1
  124. package/dist/cli/{chunk-c9m63446.js → chunk-xh1051v2.js} +1 -1
  125. package/dist/cli/chunk-y18jrdkr.js +3 -0
  126. package/dist/cli/{chunk-cbjh43yc.js → chunk-y5dk90tw.js} +1 -1
  127. package/dist/cli/{chunk-rr08hsha.js → chunk-y92xbk2f.js} +3 -3
  128. package/dist/cli/{chunk-zfvg4w3t.js → chunk-yjyjg7sk.js} +1 -1
  129. package/dist/cli/{chunk-0gz3an4p.js → chunk-yknavm97.js} +1 -1
  130. package/dist/cli/{chunk-nh1g9yw6.js → chunk-z0ndesj6.js} +1 -1
  131. package/dist/cli/{chunk-9mvm5zp2.js → chunk-z8w64xa1.js} +1 -1
  132. package/dist/cli/chunk-zk5qkkb1.js +3 -0
  133. package/dist/cli/{chunk-4m18vee4.js → chunk-zsb4p0ce.js} +1 -1
  134. package/dist/cli/index.js +9 -9
  135. package/dist/cli/pty-host-node.mjs +2 -1
  136. package/dist/cli/rove-run.js +1 -1
  137. package/dist/cli/rove.js +1 -1
  138. package/dist/web/assets/{index-DgsWPjvG.js → index-DB1fxViH.js} +28 -28
  139. package/dist/web/index.html +1 -1
  140. package/package.json +3 -3
  141. package/dist/cli/chunk-0hkqt7nn.js +0 -17
  142. package/dist/cli/chunk-4qwkxe0d.js +0 -9
  143. package/dist/cli/chunk-544bbk17.js +0 -87
  144. package/dist/cli/chunk-7q43tysm.js +0 -3
  145. package/dist/cli/chunk-7w9wkv9a.js +0 -2
  146. package/dist/cli/chunk-86tw1190.js +0 -4
  147. package/dist/cli/chunk-8pna13mr.js +0 -2
  148. package/dist/cli/chunk-a97jt3kh.js +0 -2
  149. package/dist/cli/chunk-b13q90ha.js +0 -2
  150. package/dist/cli/chunk-cg072925.js +0 -2
  151. package/dist/cli/chunk-djvfxx5t.js +0 -81
  152. package/dist/cli/chunk-eyxmdn3h.js +0 -3
  153. package/dist/cli/chunk-fts71ez1.js +0 -2
  154. package/dist/cli/chunk-hd5vbg8d.js +0 -2
  155. package/dist/cli/chunk-j0eh1ve1.js +0 -2
  156. package/dist/cli/chunk-myzsv53b.js +0 -2
  157. package/dist/cli/chunk-nz084jp5.js +0 -2
  158. package/dist/cli/chunk-rtcxzve2.js +0 -2
  159. package/dist/cli/chunk-s3md5y0b.js +0 -40
  160. package/dist/cli/chunk-s87vbwxy.js +0 -9
  161. package/dist/cli/chunk-sr9fd2qp.js +0 -52
  162. package/dist/cli/chunk-v59nnam9.js +0 -3
  163. package/dist/cli/chunk-w6y3ksqa.js +0 -3
  164. package/dist/cli/chunk-x8fd9y51.js +0 -3
  165. package/dist/cli/chunk-ydm5scdn.js +0 -2
  166. package/dist/cli/chunk-zh2t2wa9.js +0 -2
  167. package/dist/cli/chunk-zkmsvjtd.js +0 -2
  168. package/dist/cli/chunk-zpxjbrzt.js +0 -7
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{fetchMarketplace,searchMarketplace}from"./chunk-grr2fn38.js";import"./chunk-zt7wfnva.js";import"./chunk-nc46gddg.js";import"./chunk-wqfp8d9w.js";export{searchMarketplace,fetchMarketplace};
2
+ import{fetchMarketplace,searchMarketplace}from"./chunk-grr2fn38.js";import"./chunk-zt7wfnva.js";import"./chunk-nc46gddg.js";import"./chunk-91sykzqq.js";export{searchMarketplace,fetchMarketplace};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{invokeVerb,runApiSubcommand}from"./chunk-71xc2sxv.js";import{executeVerb,toApiError}from"./chunk-1s3rtx3r.js";import{API_SCHEMA_VERSION,API_VERBS,VERBS,VERB_GROUPS,VerbArgs,apiUsage,buildCountPlan,defaultApiRuntime,deliverPrompt,findVerb,fullSchema,parseAgentsSpec,parseFlags,schemaIndex,validateAgainstSpec,verbHelp,verbSchema}from"./chunk-n77bc7zh.js";import"./chunk-76y3cdz7.js";import"./chunk-mt6hv8p4.js";import"./chunk-w456ytdd.js";import"./chunk-92zmns0y.js";import"./chunk-cbc1h345.js";import"./chunk-17e2tgyg.js";import"./chunk-84bmcqyz.js";import"./chunk-wwfatcxr.js";import"./chunk-4hestsjp.js";import"./chunk-5mhvjytn.js";import"./chunk-e171nbyx.js";import"./chunk-2bgmby1d.js";import"./chunk-9p4gs9yq.js";import"./chunk-41x1hrqe.js";import"./chunk-r2c5nbcq.js";import"./chunk-atn06ncf.js";import"./chunk-xh1051v2.js";import"./chunk-qkehg2c1.js";import"./chunk-fg1sx7hc.js";import"./chunk-chzvy4x5.js";import"./chunk-p9d26ma8.js";import"./chunk-y5dk90tw.js";import"./chunk-2apszxn2.js";import"./chunk-sak1tphp.js";import"./chunk-z8w64xa1.js";import"./chunk-rxqdw6s5.js";import"./chunk-4250pw6r.js";import"./chunk-5k4m5yt5.js";import"./chunk-vjvkkrzc.js";import"./chunk-pdvyfz3n.js";import"./chunk-r0etyq15.js";import"./chunk-hpay0ax8.js";import"./chunk-catrr0z3.js";import"./chunk-8ja7jrhc.js";import"./chunk-2pen6b1t.js";import"./chunk-2tfnscxk.js";import"./chunk-w4cpkhzj.js";import"./chunk-w7zv47mp.js";import"./chunk-etfh8f4z.js";import"./chunk-6xppe9bj.js";import{ApiError}from"./chunk-568q390y.js";import"./chunk-zsfyj36g.js";import"./chunk-kq8mywzd.js";import"./chunk-hkr8r1sg.js";import"./chunk-w0gf8pe2.js";import"./chunk-ag3txfg2.js";import"./chunk-2brn8e1y.js";import"./chunk-964z8ccb.js";import"./chunk-x33sm4rp.js";import"./chunk-7kysxgbq.js";import"./chunk-qzsahxd9.js";import"./chunk-xy8be792.js";import"./chunk-h2m7em1e.js";import"./chunk-tdhk4dz8.js";import"./chunk-jdkr3hpe.js";import"./chunk-21ek142k.js";import"./chunk-40dgv828.js";import"./chunk-3342qzve.js";import"./chunk-zk5qkkb1.js";import"./chunk-mw0ysrpd.js";import"./chunk-a7kq09ke.js";import"./chunk-prqeddy7.js";import"./chunk-zt7wfnva.js";import"./chunk-yt15y085.js";import"./chunk-dexythnk.js";import"./chunk-y18jrdkr.js";import"./chunk-cmp64q4j.js";import"./chunk-pxk2c2vj.js";import"./chunk-pvm47wsy.js";import"./chunk-kyjdsax8.js";import"./chunk-hq9tbzqa.js";import"./chunk-pn5ygqn6.js";import"./chunk-npwzmmv9.js";import"./chunk-b39sdtt0.js";import"./chunk-nc46gddg.js";import"./chunk-91sykzqq.js";export{verbSchema,verbHelp,validateAgainstSpec,toApiError,schemaIndex,runApiSubcommand,parseFlags,parseAgentsSpec,invokeVerb,fullSchema,findVerb,executeVerb,deliverPrompt,defaultApiRuntime,buildCountPlan,apiUsage,VerbArgs,VERB_GROUPS,VERBS,ApiError,API_VERBS,API_SCHEMA_VERSION};
@@ -0,0 +1,11 @@
1
+ // @bun
2
+ import{deliverPromptToLiveEngineAdapter,deliverPromptToLiveEngineDetailedAdapter,deliverPromptToLiveEngineTabDetailedAdapter,deriveTitleFromSession,ensureTaskSessionAdapter,startTaskSessionWithPromptAdapter,tearDownTaskSessionAdapter}from"./chunk-q9p4d9vr.js";import{Orchestrator}from"./chunk-apfzdw7g.js";import{GH_PR_VIEW_FIELDS,classifyGhFailure,mapGhPrView,nextPrPoll,samePrStatus}from"./chunk-crdyt04z.js";import"./chunk-s2t9acrv.js";import{resolvePluginBinPath}from"./chunk-b0ssvpht.js";import{GitWorktreeManager,parseDirtyPaths}from"./chunk-e1xvz3sv.js";import{startChatChannels}from"./chunk-gse10w1v.js";import{auditDeletionBranchKept,auditDeletionResidue,auditDeletionSalvaged,auditWorktreeResidue,auditWorktreeSalvaged,parseAheadBehind,startDaemonServer}from"./chunk-eg2wzscx.js";import"./chunk-a4hsqj1b.js";import"./chunk-r3s2t9af.js";import"./chunk-svseq6ge.js";import"./chunk-k67vbszb.js";import{preferredReleaseChannel}from"./chunk-wa9jgthq.js";import{TaskIndexStore}from"./chunk-h7y9v8k1.js";import{PLACEHOLDER_TASK_TITLE}from"./chunk-cbc1h345.js";import{affectsActivityState,isEngineActivityKind}from"./chunk-17e2tgyg.js";import"./chunk-84bmcqyz.js";import"./chunk-4hestsjp.js";import"./chunk-5mhvjytn.js";import"./chunk-e171nbyx.js";import"./chunk-2bgmby1d.js";import"./chunk-9p4gs9yq.js";import"./chunk-41x1hrqe.js";import"./chunk-atn06ncf.js";import"./chunk-qkehg2c1.js";import{autoStatusEnabled}from"./chunk-p9d26ma8.js";import{execHostForWorktreePath}from"./chunk-y5dk90tw.js";import"./chunk-2apszxn2.js";import"./chunk-sak1tphp.js";import{GENERIC_PROTOCOL,engineDisplayName,engineProtocolKey,getEngineProtocol,protocolEntry,resolveCommandProtocol,roveApiInvocation,sessionProtocol}from"./chunk-z8w64xa1.js";import{installDaemonCrashHandlers,logDaemonInfo}from"./chunk-rxqdw6s5.js";import"./chunk-4250pw6r.js";import"./chunk-5k4m5yt5.js";import"./chunk-vjvkkrzc.js";import"./chunk-pdvyfz3n.js";import"./chunk-r0etyq15.js";import"./chunk-hpay0ax8.js";import"./chunk-catrr0z3.js";import{foregroundEngineIn,parsePsSnapshot,psSnapshot}from"./chunk-8ja7jrhc.js";import{createEngineTurnDetector,engineEntry,engineTitleTurnHint,vendorsWithQuotaProbe}from"./chunk-2pen6b1t.js";import{spawnCapture}from"./chunk-2tfnscxk.js";import{availableEngineIds}from"./chunk-w4cpkhzj.js";import"./chunk-w7zv47mp.js";import"./chunk-w2sp489k.js";import"./chunk-etfh8f4z.js";import"./chunk-a7m7w6d1.js";import{parsePorcelain}from"./chunk-55ajzrj6.js";import"./chunk-t7j8g9f6.js";import"./chunk-dmzg9zdc.js";import{DEFAULT_BASE_REF_CANDIDATES,readHeadSha,readRefSha,resolveGitDirs}from"./chunk-kg9kmwt9.js";import{readOnlyGitProcessEnv}from"./chunk-6xppe9bj.js";import{argvHasFlag,switchFlag}from"./chunk-zsfyj36g.js";import{connectOrStartDaemon,daemonSpawnReason}from"./chunk-kq8mywzd.js";import"./chunk-hkr8r1sg.js";import{stopDaemonProcess}from"./chunk-w0gf8pe2.js";import"./chunk-2brn8e1y.js";import"./chunk-964z8ccb.js";import"./chunk-x33sm4rp.js";import"./chunk-7kysxgbq.js";import"./chunk-qzsahxd9.js";import{DEFAULT_TASK_VENDOR,isTaskStatus}from"./chunk-xy8be792.js";import{BUILTIN_VENDORS,isBuiltinVendor}from"./chunk-h2m7em1e.js";import{migrateRoveDaemonStateLayout}from"./chunk-tdhk4dz8.js";import{SUBCOMMAND_VERBS}from"./chunk-e1x88j3k.js";import{CURRENT_VERSION,checkLatestVersion}from"./chunk-jdkr3hpe.js";import{backfillSavedReposFromProjects,getCustomEngineIds,getPersistedString,getRemoteRepoConfig,getSavedRepos,setPersistedString}from"./chunk-21ek142k.js";import"./chunk-40dgv828.js";import"./chunk-3342qzve.js";import"./chunk-zk5qkkb1.js";import{releaseSync}from"./chunk-mw0ysrpd.js";import{isProcessAlive,readPidFile}from"./chunk-a7kq09ke.js";import"./chunk-prqeddy7.js";import{ROVE_PRODUCT_NAME}from"./chunk-zt7wfnva.js";import"./chunk-yt15y085.js";import"./chunk-y18jrdkr.js";import"./chunk-cmp64q4j.js";import"./chunk-pxk2c2vj.js";import{RoveDaemonClient}from"./chunk-pvm47wsy.js";import"./chunk-kyjdsax8.js";import{rotateLogIfNeeded}from"./chunk-hq9tbzqa.js";import"./chunk-pn5ygqn6.js";import{defaultDaemonLogPath,defaultDaemonPidPath,defaultDaemonSocketPath}from"./chunk-npwzmmv9.js";import"./chunk-b39sdtt0.js";import{readRoveHomeDirEnv}from"./chunk-nc46gddg.js";import{__require}from"./chunk-91sykzqq.js";function sniffProtocolFromTitle(title){let trimmed=title?.trim();if(!trimmed)return null;let owners=new Map;for(let vendor of BUILTIN_VENDORS)for(let glyph of engineEntry(vendor).terminalTitle?.statusPrefixes??[])owners.set(glyph,[...owners.get(glyph)??[],vendor]);for(let glyph of[...owners.keys()].sort((a,b)=>b.length-a.length)){if(!trimmed.startsWith(glyph))continue;if(trimmed.slice(glyph.length).trim().length===0)continue;let vendors=owners.get(glyph)??[];if(vendors.length===1)return vendors[0];return null}return null}function protocolUpgradeFromLiveSession(task,evidence){let command=task.command?.trim();if(!command)return null;if(task.vendor&&isBuiltinVendor(task.vendor))return null;if(resolveCommandProtocol(command)!==GENERIC_PROTOCOL)return null;let walk=evidence.walkVendor,vendor=walk!==null&&isBuiltinVendor(walk)?walk:sniffProtocolFromTitle(evidence.title);return vendor?{command,vendor}:null}function protocolWriteBackFromLiveSession(task,evidence,customEngineIds){let id=task.vendor?.trim();if(!id)return null;if(getEngineProtocol(id)!==void 0)return null;if(!customEngineIds.includes(id))return null;let walk=evidence.walkVendor;return walk!==null&&isBuiltinVendor(walk)?{id,protocol:walk}:null}async function latestTranscriptMtime(vendor,worktree){if(!worktree)return 0;return protocolEntry(vendor).history.latestTranscriptMtimeForWorktree(worktree)}async function maybeAutoStart(orch,taskId,enabled=autoStatusEnabled){if(!enabled())return"skipped";let task=orch.getTask(taskId);if(!task)return"skipped";if((task.kind??"task")==="main")return"skipped";if(task.status!=="backlog")return"skipped";return await orch.setStatus(taskId,"in_progress"),"moved"}var SYNC_TIMEOUT_MS=60000,SYNC_CONFLICT="SYNC_CONFLICT",SYNC_DIRTY="SYNC_WORKTREE_DIRTY";async function git(cwd,args,signal,write=!1){return spawnCapture("git",args,{cwd,env:write?process.env:readOnlyGitProcessEnv(),signal})}function parseConflictedPaths(stdout){return stdout.split(`
3
+ `).map((line)=>line.trim()).filter((line)=>line.length>0)}async function syncWorktreeWithBase(worktreePath,baseRef,signal){let status=await git(worktreePath,["status","--porcelain=v1"],signal);if(status.status!==0)throw Error("git status failed");let dirty=parseDirtyPaths(status.stdout);if(dirty.length>0)throw Error(`${SYNC_DIRTY}: ${dirty.join(", ")}`);let before=await git(worktreePath,["rev-parse","HEAD"],signal),merge=await git(worktreePath,["merge","--no-edit",baseRef],signal,!0);if(merge.status!==0){let conflicted=await git(worktreePath,["diff","--name-only","--diff-filter=U"],signal),paths=parseConflictedPaths(conflicted.stdout);if(paths.length>0)throw Error(`${SYNC_CONFLICT}: ${paths.join(", ")}`);let detail=merge.stderr?.trim();throw Error(detail?`git merge ${baseRef} failed \u2014 ${detail}`:`git merge ${baseRef} failed`)}let after=await git(worktreePath,["rev-parse","HEAD"],signal);return{baseRef,alreadyCurrent:before.status===0&&before.stdout.trim()===after.stdout.trim()}}import{readFileSync}from"fs";import{join}from"path";var BASE_REF_TTL_MS=300000,cache=new Map;async function git2(worktreePath,args,signal){return await spawnCapture("git",[...args],{cwd:worktreePath,env:readOnlyGitProcessEnv(),signal})}async function refExists(worktreePath,ref,signal){return(await git2(worktreePath,["rev-parse","--verify","--quiet",ref],signal)).status===0}async function sharesHistory(worktreePath,ref,signal){return(await git2(worktreePath,["merge-base",ref,"HEAD"],signal)).status===0}async function baseCheckoutBranchFromGit(worktreePath,signal){let out=await git2(worktreePath,["worktree","list","--porcelain"],signal);if(out.status!==0)return null;return(out.stdout.split(`
4
+
5
+ `,1)[0]??"").split(`
6
+ `).find((l)=>l.startsWith("branch "))?.slice(7).trim().replace(/^refs\/heads\//,"")||null}function readRefSymbolic(dirs,ref){for(let dir of[dirs.gitDir,dirs.commonDir])try{let target=readFileSync(join(dir,ref),"utf8").trim().match(/^ref:\s*(.+)$/)?.[1]?.trim();if(target)return target}catch{}return null}function ladderFromFiles(worktreePath){let dirs=resolveGitDirs(worktreePath);if(!dirs)return;let originHead=readRefSymbolic(dirs,"refs/remotes/origin/HEAD")?.replace(/^refs\/remotes\//,""),baseCheckout=readRefSymbolic({gitDir:dirs.commonDir,commonDir:dirs.commonDir},"HEAD")?.replace(/^refs\/heads\//,""),names=[],head=readHeadSha(dirs),parts=[`HEAD=${head}`];for(let guess of[...originHead?[originHead]:[],...DEFAULT_BASE_REF_CANDIDATES,...baseCheckout?[baseCheckout]:[]]){if(names.includes(guess))continue;let sha=readRefSha(dirs,guess);if(sha===null)continue;names.push(guess),parts.push(`${guess}=${sha}`)}return{names,fingerprint:head===null?null:parts.join(",")}}async function ladderFromGit(worktreePath,signal){let head=await git2(worktreePath,["symbolic-ref","--short","refs/remotes/origin/HEAD"],signal),originHead=head.status===0?head.stdout.trim():"",baseCheckout=await baseCheckoutBranchFromGit(worktreePath,signal),names=[],candidates=[...originHead?[originHead]:[],...DEFAULT_BASE_REF_CANDIDATES,...baseCheckout?[baseCheckout]:[]];for(let guess of candidates){if(names.includes(guess))continue;if(await refExists(worktreePath,guess,signal))names.push(guess)}return{names,fingerprint:null}}async function resolveBaseRefCached(worktreePath,recordedBaseRef,signal,now=Date.now()){if(recordedBaseRef){let dirs=resolveGitDirs(worktreePath);if(dirs&&readRefSha(dirs,recordedBaseRef)!==null)return recordedBaseRef;if(await refExists(worktreePath,recordedBaseRef,signal))return recordedBaseRef}let hit=cache.get(worktreePath);if(hit&&now-hit.at<BASE_REF_TTL_MS)return hit.ref;let ladder=ladderFromFiles(worktreePath)??await ladderFromGit(worktreePath,signal);if(hit&&ladder.fingerprint!==null&&hit.fingerprint===ladder.fingerprint)return cache.set(worktreePath,{...hit,at:now}),hit.ref;let ref=null;for(let candidate of ladder.names)if(await sharesHistory(worktreePath,candidate,signal)){ref=candidate;break}return cache.set(worktreePath,{ref,at:now,fingerprint:ladder.fingerprint}),ref}var cache2=new Map;function readShas(worktreePath,baseRef){let dirs=resolveGitDirs(worktreePath);if(!dirs)return null;let head=readHeadSha(dirs),base=readRefSha(dirs,baseRef);return head&&base?{head,base}:null}async function driftCached(worktreePath,baseRef,compute){let shas=readShas(worktreePath,baseRef),hit=shas?cache2.get(worktreePath):void 0;if(shas&&hit&&hit.head===shas.head&&hit.base===shas.base)return hit.value;let value=await compute();if(shas&&value!==null)cache2.set(worktreePath,{...shas,value});return value}import{statSync}from"fs";function judgeWorktree(signals,nowMs){if(signals.dirty)return{verdict:"active",reason:"dirty"};if(signals.prState==="open")return{verdict:"active",reason:"prOpen"};if(signals.prState==="merged")return{verdict:"merged",reason:"prMerged"};if(signals.aheadOfDefault===0)return{verdict:"merged",reason:"inMain"};if(signals.prState==="closed")return{verdict:"stale",reason:"prClosed"};if(signals.lastActivityMs>0&&nowMs-signals.lastActivityMs>1209600000)return{verdict:"stale",reason:"idle"};return{verdict:"fresh",reason:"fresh"}}function parseGhPrList(stdout){let entries;try{entries=JSON.parse(stdout)}catch{return null}if(!Array.isArray(entries))return null;let rank={open:3,merged:2,closed:1},map=new Map;for(let entry of entries){let branch=entry?.headRefName,rawState=entry?.state;if(typeof branch!=="string"||typeof rawState!=="string")continue;let state=rawState.toLowerCase();if(state!=="open"&&state!=="merged"&&state!=="closed")continue;let cur=map.get(branch);if(!cur||rank[state]>rank[cur])map.set(branch,state)}return map}var TIMEOUT_MS=4000,manager=new GitWorktreeManager;function createdAt(path){try{let stat=statSync(path);return stat.birthtimeMs||stat.mtimeMs}catch{return 0}}async function run(path,argv){return execHostForWorktreePath(path).run(argv,{cwd:path,signal:AbortSignal.timeout(TIMEOUT_MS)})}async function branchOnRemote(path,branch){try{let out=await run(path,["git","ls-remote","--exit-code","--heads","origin",branch]);return out.exitCode===0?!0:out.exitCode===2?!1:null}catch{return null}}async function defaultRef(repo){try{let out=await run(repo,["git","symbolic-ref","--short","refs/remotes/origin/HEAD"]);if(out.exitCode===0&&out.stdout.trim())return out.stdout.trim()}catch{}for(let guess of["origin/main","origin/master"])try{if((await run(repo,["git","rev-parse","--verify","--quiet",guess])).exitCode===0)return guess}catch{}return null}async function prStates(repo){try{let origin=await run(repo,["git","remote","get-url","origin"]);if(origin.exitCode!==0||!origin.stdout.includes("github.com"))return null;let out=await run(repo,["gh","pr","list","--state","all","--limit","200","--json","headRefName,state"]);return out.exitCode===0?parseGhPrList(out.stdout):null}catch{return null}}async function ahead(path,ref){if(!ref)return null;try{let out=await run(path,["git","rev-list","--count",`${ref}..HEAD`]),value=Number.parseInt(out.stdout.trim(),10);return out.exitCode===0&&!Number.isNaN(value)?value:null}catch{return null}}async function listWorktreeProjectsAdapter(network){let repos=getSavedRepos().filter((repo)=>!getRemoteRepoConfig(repo)),now=Date.now();return Promise.all(repos.map(async(repo)=>{let[worktrees,states,ref]=await Promise.all([manager.listAll(repo),network?prStates(repo):null,defaultRef(repo)]),rows=await Promise.all(worktrees.map(async(worktree)=>{let[remote,aheadBy]=await Promise.all([network?branchOnRemote(worktree.path,worktree.branch):null,ahead(worktree.path,ref)]),judgement=judgeWorktree({dirty:worktree.dirty===!0,prState:states?.get(worktree.branch)??null,aheadOfDefault:aheadBy,lastActivityMs:worktree.lastActivityMs},now);return{...worktree,repo,createdAtMs:createdAt(worktree.path),branchOnRemote:remote,verdict:judgement.verdict,verdictReason:judgement.reason}}));return{repo,worktrees:rows}}))}async function listUnreadableWorktreesAdapter(repo){return manager.listUnreadableWorktrees(repo)}async function removeWorktreeAdapter(path,force){let residue=null;return await manager.remove(path,{force,onSalvage:(record)=>{if(record)auditWorktreeSalvaged(path,record.ref,record.commit,record.uncaptured)},onResidue:(r)=>{residue={path:r.path,reason:r.reason},auditWorktreeResidue(r.path,r.reason)}}),residue}function resolveProtocolUpgradeAndLearnPreset(task,evidence){let preset=protocolWriteBackFromLiveSession(task,evidence,getCustomEngineIds());if(preset)setPersistedString(engineProtocolKey(preset.id),preset.protocol);return protocolUpgradeFromLiveSession(task,evidence)}var daemonRuntime={currentVersion:CURRENT_VERSION,async invokeApi(verb,params,socketPath){let[{executeVerb,errorEnvelope},{REMOTE_CALLER},{RoveDaemonClient:RoveDaemonClient2}]=await Promise.all([import("./chunk-srq21cyw.js"),import("./chunk-9h940gnr.js"),import("./chunk-kgw1kzk4.js")]),client=new RoveDaemonClient2(socketPath);try{return await client.connect(),await executeVerb(verb,{params},{client,caller:REMOTE_CALLER})}catch(err){return errorEnvelope(err)}finally{client.close()}},defaultTaskVendor:DEFAULT_TASK_VENDOR,placeholderTaskTitle:PLACEHOLDER_TASK_TITLE,isTaskStatus,isEngineActivityKind,affectsActivityState,async foregroundEngines(pids){let rows=parsePsSnapshot(await psSnapshot([...pids])),out=new Map;for(let pid of pids){let found=foregroundEngineIn(rows,pid);out.set(pid,found?{vendor:found.vendor,pid:found.pid}:null)}return out},titleTurnHint:(vendor,title)=>engineTitleTurnHint(sessionProtocol(vendor),title),resolveProtocolUpgrade:resolveProtocolUpgradeAndLearnPreset,readEngineTurns:async(vendor,transcriptPath)=>await protocolEntry(vendor).readTurns?.(transcriptPath)??[],checkLatestVersion:()=>checkLatestVersion({channel:preferredReleaseChannel()}),latestTranscriptMtime,deriveTitleFromSession,createEngineTurnDetector:(vendor)=>createEngineTurnDetector(sessionProtocol(vendor)),async runWorktreeStatus(worktreePath,signal,baseRef){let result=await spawnCapture("git",["status","--porcelain=v1"],{cwd:worktreePath,env:readOnlyGitProcessEnv(),signal});if(result.status!==0)throw Error("git status failed");let counts=parsePorcelain(result.stdout),base=await resolveBaseRefCached(worktreePath,baseRef,signal);if(!base)return counts;let drift=await driftCached(worktreePath,base,async()=>{let out=await spawnCapture("git",["rev-list","--left-right","--count",`${base}...HEAD`],{cwd:worktreePath,env:readOnlyGitProcessEnv(),signal});return out.status===0?parseAheadBehind(out.stdout):null});return drift===null?counts:{...counts,...drift}},maybeAutoStart:(orch,taskId)=>maybeAutoStart(orch,taskId),listWorktreeProjects:listWorktreeProjectsAdapter,listUnreadableWorktrees:listUnreadableWorktreesAdapter,removeWorktree:removeWorktreeAdapter,async syncWorktreeWithBase(worktreePath,recordedBaseRef){let controller=new AbortController,timer=setTimeout(()=>controller.abort(),SYNC_TIMEOUT_MS);try{let baseRef=await resolveBaseRefCached(worktreePath,recordedBaseRef,controller.signal);if(!baseRef)throw Error("no base ref resolves for this worktree");return await syncWorktreeWithBase(worktreePath,baseRef,controller.signal)}finally{clearTimeout(timer)}},availableEngineIds,engineDisplayName,roveApiInvocation,engineEntry,ensureTaskSession:ensureTaskSessionAdapter,startTaskSessionWithPrompt:startTaskSessionWithPromptAdapter,tearDownTaskSession:tearDownTaskSessionAdapter,async readEngineContextUsage(vendor,sessionId){let read=protocolEntry(vendor).history.readUsageSnapshot;if(!read)return null;let snapshot=await read(sessionId);if(snapshot?.context_tokens===void 0)return null;return{contextTokens:snapshot.context_tokens,...snapshot.context_window_tokens===void 0?{}:{contextWindowTokens:snapshot.context_window_tokens},...snapshot.context_tokens_approximate?{approximate:!0}:{},...snapshot.input_tokens===void 0?{}:{inputTokens:snapshot.input_tokens},...snapshot.output_tokens===void 0?{}:{outputTokens:snapshot.output_tokens},...snapshot.cache_read_input_tokens===void 0?{}:{cacheReadTokens:snapshot.cache_read_input_tokens},...snapshot.cache_creation_input_tokens===void 0?{}:{cacheCreationTokens:snapshot.cache_creation_input_tokens}}},quotaUsage:(vendor)=>engineEntry(vendor).quotaUsage?.()??Promise.resolve(null),vendorsWithQuotaProbe,deliverPromptToLiveEngine:deliverPromptToLiveEngineAdapter,deliverPromptToLiveEngineDetailed:deliverPromptToLiveEngineDetailedAdapter,deliverPromptToLiveEngineTabDetailed:deliverPromptToLiveEngineTabDetailedAdapter,getPersistedString,setPersistedString,getSavedRepos:()=>[...getSavedRepos()],prStatus:{viewFields:GH_PR_VIEW_FIELDS,mapView:(view,at)=>mapGhPrView(view,at),sameStatus:samePrStatus,nextPoll:(outcome,failures,now,config,random)=>nextPrPoll(outcome,failures,now,config,random),classify:classifyGhFailure}};import{homedir}from"os";async function createRoveCore(options={}){let homeDir=options.homeDir??readRoveHomeDirEnv()??homedir(),store=new TaskIndexStore({homeDir});await store.load();let worktrees=new GitWorktreeManager,orchestrator=new Orchestrator({store,worktrees,onSalvage:(taskId,salvage)=>auditDeletionSalvaged(String(taskId),salvage.ref,salvage.commit,store.get(taskId)?.repo,salvage.uncaptured),onWorktreeResidue:(taskId,residue)=>auditDeletionResidue(String(taskId),residue.path,residue.reason),onBranchKept:(taskId,kept)=>auditDeletionBranchKept(String(taskId),kept.branch,kept.reason),tearDownSession:(taskId)=>tearDownTaskSessionAdapter(String(taskId))}),backfilled=backfillSavedReposFromProjects(store.list().filter((task)=>task.kind==="main").map((task)=>task.repo));if(backfilled.length>0)console.error(`[rove] added ${backfilled.length} existing project(s) to the new-task picker`);return{homeDir,orchestrator,store,worktrees,async close(){orchestrator.dispose()}}}import{existsSync,readFileSync as readFileSync2,readdirSync,statSync as statSync2,unlinkSync}from"fs";import{join as join2}from"path";var TMP_MAX_AGE_MS=300000;function sweepIndexLeftovers(stateDir,now=Date.now()){let tmp=[],tmpBytes=0,entries;try{entries=readdirSync(stateDir)}catch{return{tmp,tmpBytes,lock:!1}}for(let name of entries){if(!name.startsWith("tasks.json.")||!name.endsWith(".tmp"))continue;let path=join2(stateDir,name);try{let stat=statSync2(path);if(now-stat.mtimeMs<TMP_MAX_AGE_MS)continue;unlinkSync(path),tmp.push(path),tmpBytes+=stat.size}catch{}}return{tmp,tmpBytes,lock:clearStaleLock(join2(stateDir,"tasks.json.lock"))}}function clearStaleLock(lockPath){let holder;try{holder=readFileSync2(lockPath,"utf8").trim()}catch{return!1}let pid=Number.parseInt(holder,10);if(Number.isFinite(pid)&&pid>0&&isProcessAlive(pid))return!1;return releaseSync(lockPath,holder),!existsSync(lockPath)}var CLI_NAME=ROVE_PRODUCT_NAME;function printDaemonUsage(out){out.write([`Usage: ${CLI_NAME} daemon <command>`,"","Commands:"," status Print the running daemon's status JSON (default)"," start Run the daemon in the foreground (this process becomes it)"," --resident: never idle-stop when the last TUI leaves (headless host)"," stop Ask the running daemon to shut down"," restart Stop the daemon (graceful \u2192 SIGTERM \u2192 SIGKILL) and respawn it",""].join(`
7
+ `))}async function runDaemonSubcommand(argv){let[command="status",...flags]=argv,socketPath=defaultDaemonSocketPath(),pidPath=defaultDaemonPidPath();if(command==="--help"||command==="-h"||command==="help"){printDaemonUsage(process.stdout);return}if(!SUBCOMMAND_VERBS.daemon.includes(command))process.stderr.write(`${CLI_NAME} daemon: unknown command "${command}"
8
+
9
+ `),printDaemonUsage(process.stderr),process.exit(2);let badFlag=flags.find((flag)=>command!=="start"||!argvHasFlag([flag],"--resident")),resident=switchFlag(flags,"--resident");if(badFlag!==void 0||resident===void 0)process.stderr.write(`${CLI_NAME} daemon ${command}: bad option "${badFlag??flags.join(" ")}"
10
+
11
+ `),printDaemonUsage(process.stderr),process.exit(2);if(command==="status"){let client=new RoveDaemonClient(socketPath);try{let status=await client.request("daemon.status");console.log(JSON.stringify(status,null,2))}catch{let pid=await readPidFile(pidPath);if(pid)console.log(`${CLI_NAME} daemon: no daemon socket at ${socketPath} (stale pidfile pid=${pid})`);else console.log(`${CLI_NAME} daemon: no daemon running at ${socketPath}`);process.exitCode=1}finally{client.close()}return}if(command==="stop"){let client=new RoveDaemonClient(socketPath);try{await client.request("daemon.stop"),console.log(`${CLI_NAME} daemon: stop requested`)}catch{console.log(`${CLI_NAME} daemon: no daemon running at ${socketPath}`)}finally{client.close()}return}if(command==="restart"){await stopDaemonProcess(socketPath,pidPath,{reason:"restart"}),(await connectOrStartDaemon("explicit-restart")).close(),console.log(`${CLI_NAME} daemon: restarted, listening on ${socketPath}`);return}rotateLogIfNeeded(defaultDaemonLogPath()),installDaemonCrashHandlers(),logDaemonInfo("boot",`daemon starting \u2014 ${daemonSpawnReason()} (pid ${process.pid}, v${CURRENT_VERSION})`);let core,channels=[],server=await startDaemonServer(async()=>{let migration=migrateRoveDaemonStateLayout();for(let warning of migration.warnings)console.error(`[rove] daemon state migration will retry: ${warning}`);core=await createRoveCore();let swept=sweepIndexLeftovers(core.store.stateDir);if(swept.lock||swept.tmp.length>0)console.error(`[rove] swept crash leftovers in ${core.store.stateDir}: ${swept.tmp.length} orphaned staging file(s) (${swept.tmpBytes} bytes)${swept.lock?", stale task-index lockfile":""}`);return core.orchestrator},{runtime:daemonRuntime,socketPath,pidPath,plugins:{binPath:resolvePluginBinPath()},keepAlive:()=>channels.some((channel)=>channel.keepAlive()),resident,onStop:async()=>{for(let channel of channels)channel.stop();await core?.close()}});console.log(`${CLI_NAME} daemon: listening on ${server.socketPath}`),channels=await startChatChannels({socketPath:server.socketPath,log:logDaemonInfo,keepAliveChanged:()=>server.reevaluateIdle()});let shutdown=async()=>{await server.close(),process.exit(0)};process.once("SIGINT",()=>void shutdown()),process.once("SIGTERM",()=>void shutdown())}export{runDaemonSubcommand};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{parsePorcelain,pickPushedChanges,readWorktreeChanges,sameWorktreeChanges}from"./chunk-55ajzrj6.js";import"./chunk-t7j8g9f6.js";import"./chunk-dmzg9zdc.js";import"./chunk-6xppe9bj.js";import"./chunk-40dgv828.js";import"./chunk-wqfp8d9w.js";export{sameWorktreeChanges,readWorktreeChanges,pickPushedChanges,parsePorcelain};
2
+ import{parsePorcelain,pickPushedChanges,readWorktreeChanges,sameWorktreeChanges}from"./chunk-55ajzrj6.js";import"./chunk-t7j8g9f6.js";import"./chunk-dmzg9zdc.js";import"./chunk-6xppe9bj.js";import"./chunk-40dgv828.js";import"./chunk-91sykzqq.js";export{sameWorktreeChanges,readWorktreeChanges,pickPushedChanges,parsePorcelain};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{ensureGlobalRoveHooks,readStdinText,readTextWithTimeout,runHookSubcommand}from"./chunk-5r6zg1ha.js";import"./chunk-17e2tgyg.js";import"./chunk-2bgmby1d.js";import"./chunk-9p4gs9yq.js";import"./chunk-2pen6b1t.js";import"./chunk-2tfnscxk.js";import"./chunk-w4cpkhzj.js";import"./chunk-w7zv47mp.js";import"./chunk-zsfyj36g.js";import"./chunk-kq8mywzd.js";import"./chunk-hkr8r1sg.js";import"./chunk-w0gf8pe2.js";import"./chunk-2brn8e1y.js";import"./chunk-964z8ccb.js";import"./chunk-x33sm4rp.js";import"./chunk-7kysxgbq.js";import"./chunk-qzsahxd9.js";import"./chunk-xy8be792.js";import"./chunk-h2m7em1e.js";import"./chunk-tdhk4dz8.js";import"./chunk-21ek142k.js";import"./chunk-40dgv828.js";import"./chunk-3342qzve.js";import"./chunk-zk5qkkb1.js";import"./chunk-mw0ysrpd.js";import"./chunk-a7kq09ke.js";import"./chunk-prqeddy7.js";import"./chunk-zt7wfnva.js";import"./chunk-yt15y085.js";import"./chunk-pvm47wsy.js";import"./chunk-kyjdsax8.js";import"./chunk-hq9tbzqa.js";import"./chunk-pn5ygqn6.js";import"./chunk-npwzmmv9.js";import"./chunk-b39sdtt0.js";import"./chunk-nc46gddg.js";import"./chunk-91sykzqq.js";export{runHookSubcommand,readTextWithTimeout,readStdinText,ensureGlobalRoveHooks};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{PsProbeUnavailableError,serializeProcRows}from"./chunk-pxk2c2vj.js";import"./chunk-wqfp8d9w.js";import{existsSync}from"fs";import{createRequire}from"module";import{dirname,join}from"path";var WIN_PROCESS_LIST_COMMAND=`[Console]::OutputEncoding=[System.Text.Encoding]::UTF8; Get-CimInstance -ClassName Win32_Process -Property ProcessId,ParentProcessId,CommandLine,Name,CreationDate | Sort-Object CreationDate | ForEach-Object { $c = $_.CommandLine; if (-not $c) { $c = $_.Name }; "$($_.ProcessId) $($_.ParentProcessId) $($c -replace '[\\r\\n\\t]+', ' ')" }`;function winBasename(path){let parts=path.split(/[\\/]+/);return parts[parts.length-1]||path}function normalizeWindowsArgs(commandLine){let line=commandLine.trim();if(!line)return"";if(line.startsWith('"')){let end=line.indexOf('"',1);if(end===-1)return winBasename(line.slice(1));return`${winBasename(line.slice(1,end))}${line.slice(end+1)}`}let space=line.search(/\s/);if(space===-1)return winBasename(line);return`${winBasename(line.slice(0,space))}${line.slice(space)}`}function parseWinProcessList(text){let rows=[];for(let line of text.split(`
2
+ import{PsProbeUnavailableError,serializeProcRows}from"./chunk-pxk2c2vj.js";import"./chunk-91sykzqq.js";import{existsSync}from"fs";import{createRequire}from"module";import{dirname,join}from"path";var WIN_PROCESS_LIST_COMMAND=`[Console]::OutputEncoding=[System.Text.Encoding]::UTF8; Get-CimInstance -ClassName Win32_Process -Property ProcessId,ParentProcessId,CommandLine,Name,CreationDate | Sort-Object CreationDate | ForEach-Object { $c = $_.CommandLine; if (-not $c) { $c = $_.Name }; "$($_.ProcessId) $($_.ParentProcessId) $($c -replace '[\\r\\n\\t]+', ' ')" }`;function winBasename(path){let parts=path.split(/[\\/]+/);return parts[parts.length-1]||path}function normalizeWindowsArgs(commandLine){let line=commandLine.trim();if(!line)return"";if(line.startsWith('"')){let end=line.indexOf('"',1);if(end===-1)return winBasename(line.slice(1));return`${winBasename(line.slice(1,end))}${line.slice(end+1)}`}let space=line.search(/\s/);if(space===-1)return winBasename(line);return`${winBasename(line.slice(0,space))}${line.slice(space)}`}function parseWinProcessList(text){let rows=[];for(let line of text.split(`
3
3
  `)){let m=/^\s*(\d+)\s+(\d+)\s+(\S.*?)\s*$/.exec(line);if(m)rows.push({pid:Number(m[1]),ppid:Number(m[2]),args:normalizeWindowsArgs(m[3])})}return rows}function repairConsoleParentage(rows,cohorts){let byPid=new Map(rows.map((r)=>[r.pid,r])),reparent=new Map;for(let[anchor,members]of cohorts){if(!members||!byPid.has(anchor))continue;let cohort=new Set(members.filter((pid)=>byPid.has(pid))),root=cohortRoot(rows,byPid,cohort,anchor);if(root===void 0)continue;for(let pid of cohort){if(pid===root||reparent.has(pid))continue;let row=byPid.get(pid);if(!row||cohort.has(row.ppid))continue;reparent.set(pid,root)}}if(reparent.size===0)return[...rows];return rows.map((row)=>{let ppid=reparent.get(row.pid);return ppid===void 0||ppid===row.ppid?row:{...row,ppid}})}function cohortRoot(rows,byPid,cohort,anchor){let anchorRow=byPid.get(anchor);if(anchorRow&&!cohort.has(anchorRow.ppid))return anchor;let orphanRoot;for(let row of rows){if(!cohort.has(row.pid)||cohort.has(row.ppid))continue;if(byPid.has(row.ppid))return row.pid;orphanRoot??=row.pid}return orphanRoot}function powershellPath(){let root=process.env.SystemRoot||process.env.windir||"C:\\Windows",absolute=join(root,"System32","WindowsPowerShell","v1.0","powershell.exe");return existsSync(absolute)?absolute:"powershell.exe"}var WIN_PROBE_TIMEOUT_MS=1e4;async function capture(cmd,what,deadline){let remaining=deadline-Date.now();if(remaining<=0)throw new PsProbeUnavailableError(`${what} had no time left in the probe budget`);let proc=Bun.spawn(cmd,{stdout:"pipe",stderr:"pipe"}),timedOut=!1,timer=setTimeout(()=>{timedOut=!0;try{proc.kill()}catch{}},remaining);try{let[out,err,code]=await Promise.all([new Response(proc.stdout).text(),new Response(proc.stderr).text(),proc.exited]);if(timedOut)throw new PsProbeUnavailableError(`${what} did not answer within ${remaining}ms`);if(code!==0)throw new PsProbeUnavailableError(`${what} exited ${code}: ${err.trim().slice(0,200)||"no output"}`);return out}catch(err){if(err instanceof PsProbeUnavailableError)throw err;throw new PsProbeUnavailableError(`${what} failed: ${err instanceof Error?err.message:String(err)}`)}finally{clearTimeout(timer)}}function consoleListAddonPath(){let pkg;try{pkg=dirname(createRequire(import.meta.url).resolve("node-pty/package.json"))}catch(err){throw new PsProbeUnavailableError(`node-pty is not resolvable: ${err instanceof Error?err.message:String(err)}`)}let found=[join(pkg,"prebuilds",`${process.platform}-${process.arch}`,"conpty_console_list.node"),join(pkg,"build","Release","conpty_console_list.node"),join(pkg,"build","Debug","conpty_console_list.node")].find((c)=>existsSync(c));if(!found)throw new PsProbeUnavailableError(`node-pty ships no conpty_console_list addon for ${process.arch}`);return found}function agentScript(addon,anchors){return`const native = require(${JSON.stringify(addon)})
4
4
  const lists = {}
5
5
  for (const pid of ${JSON.stringify([...anchors])}) {
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{PS_PROBE_TIMEOUT_MS,engineProcessIn,foregroundEngine,foregroundEngineIn,hasAncestor,parsePsSnapshot,psSnapshot,psSnapshotWith,vendorFromArgv}from"./chunk-ntrwd6ks.js";import"./chunk-7xttx9m1.js";import"./chunk-99n8qsw9.js";import"./chunk-w7zv47mp.js";import"./chunk-2tfnscxk.js";import"./chunk-2brn8e1y.js";import"./chunk-y7mg74jx.js";import"./chunk-x33sm4rp.js";import"./chunk-7kysxgbq.js";import"./chunk-qzsahxd9.js";import"./chunk-xy8be792.js";import"./chunk-h2m7em1e.js";import"./chunk-tdhk4dz8.js";import"./chunk-h9cg0j3a.js";import"./chunk-40dgv828.js";import"./chunk-3342qzve.js";import"./chunk-7q43tysm.js";import"./chunk-mw0ysrpd.js";import"./chunk-a7kq09ke.js";import"./chunk-prqeddy7.js";import"./chunk-zt7wfnva.js";import"./chunk-yt15y085.js";import{PsProbeUnavailableError}from"./chunk-pxk2c2vj.js";import"./chunk-hq9tbzqa.js";import"./chunk-pn5ygqn6.js";import"./chunk-npwzmmv9.js";import"./chunk-b39sdtt0.js";import"./chunk-nc46gddg.js";import"./chunk-wqfp8d9w.js";export{vendorFromArgv,psSnapshotWith,psSnapshot,parsePsSnapshot,hasAncestor,foregroundEngineIn,foregroundEngine,engineProcessIn,PsProbeUnavailableError,PS_PROBE_TIMEOUT_MS};
2
+ import{PS_PROBE_TIMEOUT_MS,engineProcessIn,foregroundEngine,foregroundEngineIn,hasAncestor,parsePsSnapshot,psSnapshot,psSnapshotWith,vendorFromArgv}from"./chunk-8ja7jrhc.js";import"./chunk-2pen6b1t.js";import"./chunk-2tfnscxk.js";import"./chunk-w4cpkhzj.js";import"./chunk-w7zv47mp.js";import"./chunk-2brn8e1y.js";import"./chunk-964z8ccb.js";import"./chunk-x33sm4rp.js";import"./chunk-7kysxgbq.js";import"./chunk-qzsahxd9.js";import"./chunk-xy8be792.js";import"./chunk-h2m7em1e.js";import"./chunk-tdhk4dz8.js";import"./chunk-21ek142k.js";import"./chunk-40dgv828.js";import"./chunk-3342qzve.js";import"./chunk-zk5qkkb1.js";import"./chunk-mw0ysrpd.js";import"./chunk-a7kq09ke.js";import"./chunk-prqeddy7.js";import"./chunk-zt7wfnva.js";import"./chunk-yt15y085.js";import{PsProbeUnavailableError}from"./chunk-pxk2c2vj.js";import"./chunk-hq9tbzqa.js";import"./chunk-pn5ygqn6.js";import"./chunk-npwzmmv9.js";import"./chunk-b39sdtt0.js";import"./chunk-nc46gddg.js";import"./chunk-91sykzqq.js";export{vendorFromArgv,psSnapshotWith,psSnapshot,parsePsSnapshot,hasAncestor,foregroundEngineIn,foregroundEngine,engineProcessIn,PsProbeUnavailableError,PS_PROBE_TIMEOUT_MS};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{ReleaseNotesBody,bootPaneHost,pageCloseBindings,runShellUpdater,useBindings,useT,useTheme}from"./chunk-5j1p0602.js";import"./chunk-yknavm97.js";import{$jsx,$jsxs,useRenderer}from"./chunk-29kvfqeh.js";import{require_react_production}from"./chunk-2wd4744g.js";import"./chunk-aw6s9ayv.js";import"./chunk-764bsyb0.js";import"./chunk-sjx6gn4f.js";import"./chunk-atn06ncf.js";import"./chunk-5k4m5yt5.js";import"./chunk-vjvkkrzc.js";import"./chunk-pdvyfz3n.js";import"./chunk-55ajzrj6.js";import"./chunk-t7j8g9f6.js";import"./chunk-dmzg9zdc.js";import"./chunk-6xppe9bj.js";import"./chunk-kq8mywzd.js";import"./chunk-hkr8r1sg.js";import"./chunk-w0gf8pe2.js";import"./chunk-ag3txfg2.js";import"./chunk-2brn8e1y.js";import"./chunk-xy8be792.js";import{BREAKING_VERSIONS,CURRENT_VERSION,breakingVersionsCrossed,fetchReleaseNotes,fetchReleaseSummaries,updateCommandFor}from"./chunk-jdkr3hpe.js";import"./chunk-40dgv828.js";import"./chunk-zk5qkkb1.js";import"./chunk-mw0ysrpd.js";import"./chunk-a7kq09ke.js";import"./chunk-prqeddy7.js";import"./chunk-zt7wfnva.js";import"./chunk-yt15y085.js";import"./chunk-dexythnk.js";import"./chunk-y18jrdkr.js";import"./chunk-cmp64q4j.js";import"./chunk-pvm47wsy.js";import"./chunk-kyjdsax8.js";import"./chunk-hq9tbzqa.js";import"./chunk-pn5ygqn6.js";import"./chunk-npwzmmv9.js";import"./chunk-b39sdtt0.js";import"./chunk-nc46gddg.js";import{__toESM}from"./chunk-91sykzqq.js";import{TextAttributes}from"@opentui/core";var import_react2=__toESM(require_react_production(),1);var RELEASE_LIMIT=20;function VersionsPage(props){let{theme}=useTheme(),t=useT(),renderer=useRenderer(),[releases,setReleases]=import_react2.useState(null),[cursor,setCursor]=import_react2.useState(0),[notes,setNotes]=import_react2.useState({}),[status,setStatus]=import_react2.useState(null),selected=releases?.[cursor],crossings=selected?breakingVersionsCrossed(CURRENT_VERSION,selected.version):[],loadSummaries=props.fetchSummaries??fetchReleaseSummaries,loadNotes=props.fetchNotes??fetchReleaseNotes;import_react2.useEffect(()=>{loadSummaries(RELEASE_LIMIT).then((fetched)=>setReleases(fetched))},[loadSummaries]);let selectedVersion=selected?.version;import_react2.useEffect(()=>{if(selectedVersion===void 0||notes[selectedVersion]!==void 0)return;setNotes((cache)=>({...cache,[selectedVersion]:"loading"})),loadNotes(selectedVersion).then((fetched)=>{setNotes((cache)=>({...cache,[selectedVersion]:fetched??"missing"}))})},[selectedVersion,notes,loadNotes]);function move(delta){let count=releases?.length??0;if(count===0)return;setCursor((index)=>(index+delta+count)%count)}async function installSelected(){if(!selected)return;setStatus(t("update.statusRunningUpdater")),await new Promise((resolve)=>setTimeout(resolve,30)),await runShellUpdater({renderer,t,targetLabel:selected.version,command:updateCommandFor(selected.version)})}useBindings(()=>({bindings:[{key:"up",cmd:()=>move(-1)},{key:"down",cmd:()=>move(1)},{key:"k",cmd:()=>move(-1)},{key:"j",cmd:()=>move(1)},{key:"return",cmd:()=>void installSelected()},{key:"u",cmd:()=>void installSelected()},...pageCloseBindings(props.onClose)]}));let selectedNotes=selectedVersion===void 0?void 0:notes[selectedVersion];return $jsxs("box",{flexDirection:"column",flexGrow:1,paddingTop:1,paddingLeft:2,paddingRight:2,children:[$jsxs("box",{flexDirection:"row",justifyContent:"space-between",flexShrink:0,children:[$jsx("text",{fg:theme.text,attributes:TextAttributes.BOLD,wrapMode:"none",children:t("update.versions.pageTitle")}),$jsx("text",{fg:theme.textMuted,wrapMode:"none",onMouseUp:props.onClose,children:t("update.versions.closeHint")})]}),$jsxs("box",{flexDirection:"row",flexGrow:1,paddingTop:1,gap:2,children:[$jsxs("box",{flexDirection:"column",width:26,flexShrink:0,children:[releases===null?$jsx("text",{fg:theme.textMuted,children:t("update.versions.loading")}):null,releases!==null&&releases.length===0?$jsx("text",{fg:theme.textMuted,wrapMode:"word",children:t("update.versions.unavailable")}):null,(releases??[]).map((release,index)=>{let active=index===cursor,tags=[release.version===CURRENT_VERSION?t("update.versions.tagCurrent"):"",index===0?t("update.versions.tagLatest"):"",BREAKING_VERSIONS.includes(release.version)?t("update.versions.tagBreaking"):""].filter(Boolean).join(" ");return $jsxs("box",{flexDirection:"row",gap:1,paddingLeft:1,backgroundColor:active?theme.primary:void 0,onMouseUp:()=>setCursor(index),children:[$jsxs("text",{fg:active?theme.selectedListItemText:theme.text,attributes:release.version===CURRENT_VERSION?TextAttributes.BOLD:void 0,wrapMode:"none",children:["v",release.version]}),tags?$jsx("text",{fg:active?theme.selectedListItemText:theme.textMuted,wrapMode:"none",children:tags}):null]},release.version)})]}),$jsxs("box",{flexDirection:"column",flexGrow:1,flexShrink:1,children:[$jsx("scrollbox",{flexGrow:1,flexShrink:1,stickyScroll:!1,verticalScrollbarOptions:{trackOptions:{foregroundColor:"transparent"}},children:$jsxs("box",{flexDirection:"column",paddingRight:1,paddingBottom:1,gap:0,children:[selectedNotes==="loading"?$jsx("text",{fg:theme.textMuted,children:t("update.loadingNotes")}):null,selectedNotes==="missing"?$jsx("text",{fg:theme.textMuted,wrapMode:"word",children:t("update.notesUnavailable")}):null,selectedNotes!==void 0&&selectedNotes!=="loading"&&selectedNotes!=="missing"?$jsx(ReleaseNotesBody,{body:selectedNotes.body}):null]})}),crossings.length>0?$jsx("text",{fg:theme.warning,wrapMode:"word",children:t("update.versions.breakingWarning",{versions:crossings.join(", ")})}):null]})]}),status?$jsx("text",{fg:theme.info,wrapMode:"word",children:status}):null,$jsx("box",{flexShrink:0,paddingTop:1,children:$jsx("text",{fg:theme.textMuted,attributes:TextAttributes.DIM,wrapMode:"none",children:t("update.versions.footerHint")})})]})}var INLINE_ROWS=24;async function startVersionsHost(){await bootPaneHost({inlineRows:INLINE_ROWS,setup:()=>({root:()=>$jsx(VersionsPage,{onClose:()=>process.exit(0)})})})}export{startVersionsHost,VersionsPage};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{applyFixes,daemonRestartFix,defaultFixRuntime,engineTabsManualFix,formatBytes,humanOnlyFix,killOrphansManualFix,noEngineFix,reinstallManualFix,resetManualFix,skillInstallFix,spawnHelperFix}from"./chunk-27sfb204.js";import{hookConfigIssues}from"./chunk-wtdj8n93.js";import{inspectLegacyTmux,legacyTmuxDoctorLines}from"./chunk-gkdfct7t.js";import"./chunk-7f1g1kxp.js";import"./chunk-r3s2t9af.js";import"./chunk-ecdhqwsj.js";import"./chunk-qb1agm2c.js";import"./chunk-k67vbszb.js";import{describeAccount,detectEngineStatuses,probeableEngineIds,summarizeEngines}from"./chunk-j9m9zr27.js";import"./chunk-4hestsjp.js";import"./chunk-q8q22wq3.js";import"./chunk-2bgmby1d.js";import"./chunk-86tw1190.js";import"./chunk-41x1hrqe.js";import"./chunk-5mhvjytn.js";import"./chunk-atn06ncf.js";import{resolveNodeBinary}from"./chunk-9mvm5zp2.js";import{formatDaemonInfo}from"./chunk-rxqdw6s5.js";import"./chunk-vjvkkrzc.js";import"./chunk-ntrwd6ks.js";import"./chunk-7xttx9m1.js";import"./chunk-99n8qsw9.js";import"./chunk-w7zv47mp.js";import"./chunk-2tfnscxk.js";import"./chunk-w2sp489k.js";import"./chunk-etfh8f4z.js";import"./chunk-dmzg9zdc.js";import"./chunk-kg9kmwt9.js";import"./chunk-zsfyj36g.js";import{isStaleInstallError,resolveRoveSpawn}from"./chunk-fs3p13ah.js";import"./chunk-x6gpzj4t.js";import"./chunk-v1ban2hc.js";import"./chunk-2brn8e1y.js";import"./chunk-y7mg74jx.js";import"./chunk-x33sm4rp.js";import"./chunk-7kysxgbq.js";import{readableLegacyIndexPath}from"./chunk-qzsahxd9.js";import"./chunk-xy8be792.js";import"./chunk-h2m7em1e.js";import"./chunk-tdhk4dz8.js";import{CURRENT_VERSION,package_default}from"./chunk-v59nnam9.js";import{roveSkillState,skillInstallCommand}from"./chunk-rvqse0aa.js";import"./chunk-h9cg0j3a.js";import"./chunk-40dgv828.js";import"./chunk-3342qzve.js";import"./chunk-7q43tysm.js";import"./chunk-mw0ysrpd.js";import{readPidFile}from"./chunk-a7kq09ke.js";import{homeDir,kvStatePath,roveStateDir}from"./chunk-prqeddy7.js";import{ROVE_PRODUCT_NAME}from"./chunk-zt7wfnva.js";import"./chunk-yt15y085.js";import{t}from"./chunk-w6y3ksqa.js";import"./chunk-eyxmdn3h.js";import"./chunk-nhakrm1f.js";import"./chunk-pxk2c2vj.js";import{RoveDaemonClient,isForeignDaemonHome}from"./chunk-0vpn32r6.js";import"./chunk-x8fd9y51.js";import"./chunk-hq9tbzqa.js";import"./chunk-pn5ygqn6.js";import{defaultDaemonLogPath,defaultDaemonPidPath,defaultDaemonSocketPath,defaultPtyHostLogPath,defaultPtyHostPidPath,defaultPtyHostSocketPath}from"./chunk-npwzmmv9.js";import{preRenameStateDir}from"./chunk-b39sdtt0.js";import"./chunk-nc46gddg.js";import{__require}from"./chunk-wqfp8d9w.js";import{existsSync,readFileSync as readFileSync2,statSync as statSync2}from"fs";import{join as join2}from"path";var MIN_BUN_VERSION=package_default.engines.bun.match(/\d+\.\d+\.\d+/)?.[0]??"0.0.0";function parseBunVersion(raw){return raw.trim().match(/^v?(\d+\.\d+\.\d+)/)?.[1]??null}function isBunAtLeast(raw,minimum=MIN_BUN_VERSION){let found=parseBunVersion(raw),floor=parseBunVersion(minimum);if(!found||!floor)return!0;let a=found.split(".").map(Number),b=floor.split(".").map(Number);for(let i=0;i<3;i++){let av=a[i]??0,bv=b[i]??0;if(av!==bv)return av>bv}return!0}function classifyHookChannel(input){let total=0,hooked=0;for(let tabs of Object.values(input.tabs))for(let entry of Object.values(tabs))if(total++,entry.source==="hook")hooked++;if(total===0)return{kind:"no-tabs"};if(hooked===0)return{kind:"down",totalTabs:total};return{kind:"live",hookTabs:hooked,totalTabs:total}}function hookChannelDoctorLines(verdict,input,cliName){let configLines=(input.configIssues??[]).flatMap((issue)=>[` \u26A0 hook install skipped: ${issue.file}`,` ${issue.reason} \u2014 fix the file, then relaunch Rove`]);if(verdict.kind==="no-tabs")return["hooks: \u2014 no engine tabs yet (nothing to check)",...configLines];if(verdict.kind==="live")return[`hooks: \u2713 engine hook channel live (${verdict.hookTabs}/${verdict.totalTabs} tab(s) hook-sourced)`,...configLines];let out=[`hooks: \u2717 NO hook events reaching the daemon (0/${verdict.totalTabs} tab(s) hook-sourced)`," badges fall back to a ~10s poll, so activity looks seconds late",` daemon socket: ${input.socketPath}`,...configLines];return out.push(' \u2192 compare with an engine tab\'s own path: `ps eww -p <engine-pid> | tr " " "\\n" | grep DAEMON_SOCKET_PATH`',` \u2192 restart the engine tabs (they may hold a stale socket path), or run \`${cliName} daemon restart\``,` \u2192 debug one hook directly: \`ROVE_HOOK_DEBUG=1 echo '{}' | ${cliName} hook turn-start --engine claude\``),out}import{readdirSync,statSync}from"fs";import{createRequire}from"module";import{dirname,join}from"path";function installedSpawnHelpers(){let pkg;try{pkg=dirname(createRequire(import.meta.url).resolve("node-pty/package.json"))}catch{return[]}let prebuilds=join(pkg,"prebuilds"),arches;try{arches=readdirSync(prebuilds).filter((name)=>name.startsWith("darwin-"))}catch{return[]}let helpers=[];for(let arch of arches){let path=join(prebuilds,arch,"spawn-helper");try{helpers.push({path,executable:(statSync(path).mode&64)!==0})}catch{}}return helpers}function spawnHelperDoctorLines(helpers){let broken=helpers.filter((helper)=>!helper.executable).map((helper)=>helper.path);if(helpers.length===0)return{lines:["node-pty: ? no darwin spawn-helper found next to node-pty"],broken};if(broken.length===0)return{lines:[`node-pty: \u2713 spawn-helper executable (${helpers.length} arch)`],broken};return{lines:["node-pty: \u2717 spawn-helper is not executable \u2014 every node-pty PTY spawn fails",...broken.map((path)=>` ${path}`),` \u2192 chmod 755 ${broken.join(" ")}`],broken}}import{appendFileSync,readFileSync}from"fs";var PTY_MARKER="ROVE_TERMINAL_PTY=1",run=async(argv)=>{try{let proc=Bun.spawn([...argv],{stdin:"ignore",stdout:"pipe",stderr:"ignore"}),[stdout,code]=await Promise.all([new Response(proc.stdout).text().catch(()=>""),proc.exited]);return{code,stdout}}catch{return{code:127,stdout:""}}};function parsePsRows(output){let rows=[];for(let line of output.split(`
2
+ import{applyFixes,daemonRestartFix,defaultFixRuntime,engineTabsManualFix,formatBytes,humanOnlyFix,killOrphansManualFix,noEngineFix,reinstallManualFix,resetManualFix,skillInstallFix,spawnHelperFix}from"./chunk-drhzdxb6.js";import{hookConfigIssues}from"./chunk-4rx3nhvq.js";import"./chunk-eg2wzscx.js";import"./chunk-a4hsqj1b.js";import"./chunk-r3s2t9af.js";import"./chunk-svseq6ge.js";import"./chunk-k67vbszb.js";import{inspectLegacyTmux,legacyTmuxDoctorLines}from"./chunk-gkdfct7t.js";import{describeAccount,detectEngineStatuses,probeableEngineIds,summarizeEngines}from"./chunk-wwfatcxr.js";import"./chunk-4hestsjp.js";import"./chunk-5mhvjytn.js";import"./chunk-e171nbyx.js";import"./chunk-2bgmby1d.js";import"./chunk-9p4gs9yq.js";import"./chunk-41x1hrqe.js";import"./chunk-atn06ncf.js";import{resolveNodeBinary}from"./chunk-z8w64xa1.js";import{formatDaemonInfo}from"./chunk-rxqdw6s5.js";import"./chunk-vjvkkrzc.js";import"./chunk-8ja7jrhc.js";import"./chunk-2pen6b1t.js";import"./chunk-2tfnscxk.js";import"./chunk-w4cpkhzj.js";import"./chunk-w7zv47mp.js";import"./chunk-w2sp489k.js";import"./chunk-etfh8f4z.js";import"./chunk-dmzg9zdc.js";import"./chunk-kg9kmwt9.js";import"./chunk-zsfyj36g.js";import{isStaleInstallError,resolveRoveSpawn}from"./chunk-kq8mywzd.js";import"./chunk-hkr8r1sg.js";import"./chunk-w0gf8pe2.js";import"./chunk-2brn8e1y.js";import"./chunk-964z8ccb.js";import"./chunk-x33sm4rp.js";import"./chunk-7kysxgbq.js";import{readableLegacyIndexPath}from"./chunk-qzsahxd9.js";import"./chunk-xy8be792.js";import"./chunk-h2m7em1e.js";import"./chunk-tdhk4dz8.js";import{CURRENT_VERSION,package_default}from"./chunk-jdkr3hpe.js";import{roveSkillState,skillInstallCommand}from"./chunk-6h0n4b5t.js";import"./chunk-21ek142k.js";import"./chunk-40dgv828.js";import"./chunk-3342qzve.js";import"./chunk-zk5qkkb1.js";import"./chunk-mw0ysrpd.js";import{readPidFile}from"./chunk-a7kq09ke.js";import{homeDir,kvStatePath,roveStateDir}from"./chunk-prqeddy7.js";import{ROVE_PRODUCT_NAME}from"./chunk-zt7wfnva.js";import"./chunk-yt15y085.js";import{t}from"./chunk-dexythnk.js";import"./chunk-y18jrdkr.js";import"./chunk-cmp64q4j.js";import"./chunk-pxk2c2vj.js";import{RoveDaemonClient,isForeignDaemonHome}from"./chunk-pvm47wsy.js";import"./chunk-kyjdsax8.js";import"./chunk-hq9tbzqa.js";import"./chunk-pn5ygqn6.js";import{defaultDaemonLogPath,defaultDaemonPidPath,defaultDaemonSocketPath,defaultPtyHostLogPath,defaultPtyHostPidPath,defaultPtyHostSocketPath}from"./chunk-npwzmmv9.js";import{preRenameStateDir}from"./chunk-b39sdtt0.js";import"./chunk-nc46gddg.js";import{__require}from"./chunk-91sykzqq.js";import{existsSync,readFileSync as readFileSync2,statSync as statSync2}from"fs";import{join as join2}from"path";var MIN_BUN_VERSION=package_default.engines.bun.match(/\d+\.\d+\.\d+/)?.[0]??"0.0.0";function parseBunVersion(raw){return raw.trim().match(/^v?(\d+\.\d+\.\d+)/)?.[1]??null}function isBunAtLeast(raw,minimum=MIN_BUN_VERSION){let found=parseBunVersion(raw),floor=parseBunVersion(minimum);if(!found||!floor)return!0;let a=found.split(".").map(Number),b=floor.split(".").map(Number);for(let i=0;i<3;i++){let av=a[i]??0,bv=b[i]??0;if(av!==bv)return av>bv}return!0}function classifyHookChannel(input){let total=0,hooked=0;for(let tabs of Object.values(input.tabs))for(let entry of Object.values(tabs))if(total++,entry.source==="hook")hooked++;if(total===0)return{kind:"no-tabs"};if(hooked===0)return{kind:"down",totalTabs:total};return{kind:"live",hookTabs:hooked,totalTabs:total}}function hookChannelDoctorLines(verdict,input,cliName){let configLines=(input.configIssues??[]).flatMap((issue)=>[` \u26A0 hook install skipped: ${issue.file}`,` ${issue.reason} \u2014 fix the file, then relaunch Rove`]);if(verdict.kind==="no-tabs")return["hooks: \u2014 no engine tabs yet (nothing to check)",...configLines];if(verdict.kind==="live")return[`hooks: \u2713 engine hook channel live (${verdict.hookTabs}/${verdict.totalTabs} tab(s) hook-sourced)`,...configLines];let out=[`hooks: \u2717 NO hook events reaching the daemon (0/${verdict.totalTabs} tab(s) hook-sourced)`," badges fall back to a ~10s poll, so activity looks seconds late",` daemon socket: ${input.socketPath}`,...configLines];return out.push(' \u2192 compare with an engine tab\'s own path: `ps eww -p <engine-pid> | tr " " "\\n" | grep DAEMON_SOCKET_PATH`',` \u2192 restart the engine tabs (they may hold a stale socket path), or run \`${cliName} daemon restart\``,` \u2192 debug one hook directly: \`ROVE_HOOK_DEBUG=1 echo '{}' | ${cliName} hook turn-start --engine claude\``),out}import{readdirSync,statSync}from"fs";import{createRequire}from"module";import{dirname,join}from"path";function installedSpawnHelpers(){let pkg;try{pkg=dirname(createRequire(import.meta.url).resolve("node-pty/package.json"))}catch{return[]}let prebuilds=join(pkg,"prebuilds"),arches;try{arches=readdirSync(prebuilds).filter((name)=>name.startsWith("darwin-"))}catch{return[]}let helpers=[];for(let arch of arches){let path=join(prebuilds,arch,"spawn-helper");try{helpers.push({path,executable:(statSync(path).mode&64)!==0})}catch{}}return helpers}function spawnHelperDoctorLines(helpers){let broken=helpers.filter((helper)=>!helper.executable).map((helper)=>helper.path);if(helpers.length===0)return{lines:["node-pty: ? no darwin spawn-helper found next to node-pty"],broken};if(broken.length===0)return{lines:[`node-pty: \u2713 spawn-helper executable (${helpers.length} arch)`],broken};return{lines:["node-pty: \u2717 spawn-helper is not executable \u2014 every node-pty PTY spawn fails",...broken.map((path)=>` ${path}`),` \u2192 chmod 755 ${broken.join(" ")}`],broken}}import{appendFileSync,readFileSync}from"fs";var PTY_MARKER="ROVE_TERMINAL_PTY=1",run=async(argv)=>{try{let proc=Bun.spawn([...argv],{stdin:"ignore",stdout:"pipe",stderr:"ignore"}),[stdout,code]=await Promise.all([new Response(proc.stdout).text().catch(()=>""),proc.exited]);return{code,stdout}}catch{return{code:127,stdout:""}}};function parsePsRows(output){let rows=[];for(let line of output.split(`
3
3
  `)){let parts=line.trim().split(/\s+/);if(parts.length<6)continue;let[pid,ppid,pgid]=[parts[0],parts[1],parts[2]].map((value)=>Number.parseInt(value??"",10)),rssKb=Number.parseInt(parts[4]??"",10);if(!Number.isFinite(pid)||!Number.isFinite(ppid)||!Number.isFinite(pgid)||!Number.isFinite(rssKb))continue;rows.push({pid,ppid,pgid,etime:parts[3]??"",rssKb,command:parts.slice(5).join(" ")})}return rows}function pidAlive(pid,rows){return rows.some((row)=>row.pid===pid)}function orphanCandidates(rows,selfPgid,liveSessionPids){return rows.filter((row)=>row.ppid===1&&row.pgid!==selfPgid&&!liveSessionPids.has(row.pgid)&&!pidAlive(row.pgid,rows))}async function markedPids(pids,deps={}){let runProbe=deps.run??run,readEnviron=deps.readEnviron??((pid)=>readFileSync(`/proc/${pid}/environ`,"utf8")),marked=new Set;if(pids.length===0)return{marked,failed:null};if((deps.platform??process.platform)==="linux"){let refused=null;for(let pid of pids)try{if(readEnviron(pid).split("\x00").includes(PTY_MARKER))marked.add(pid)}catch(err){let code=err.code;if(code!=="ENOENT"&&code!=="ESRCH")refused??=`/proc/${pid}/environ: ${code??"unreadable"}`}return{marked,failed:refused}}let result=await runProbe(["ps","eww","-o","pid=,command=","-p",pids.join(",")]);if(result.code!==0)return{marked,failed:`ps eww exited ${result.code}`};let marker=new RegExp(`(^|\\s)${PTY_MARKER}(\\s|$)`);for(let line of result.stdout.split(`
4
4
  `)){let pid=Number.parseInt(line.trim().split(/\s+/)[0]??"",10);if(Number.isFinite(pid)&&marker.test(line))marked.add(pid)}return{marked,failed:null}}async function ownPgid(runProbe){let result=await runProbe(["ps","-o","pgid=","-p",String(process.pid)]),pgid=Number.parseInt(result.stdout.trim(),10);return Number.isFinite(pgid)?pgid:-1}async function collectOrphans(liveSessionPids,deps={}){let runProbe=deps.run??run;if((deps.platform??process.platform)==="win32")return{orphans:[],error:null};let ps=await runProbe(["ps","-A","-o","pid=,ppid=,pgid=,etime=,rss=,command="]);if(ps.code!==0)return{orphans:[],error:`could not read the process table \u2014 ps exited ${ps.code}`};let rows=parsePsRows(ps.stdout),candidates=orphanCandidates(rows,await ownPgid(runProbe),liveSessionPids),{marked,failed}=await markedPids(candidates.map((row)=>row.pid),deps);if(failed)return{orphans:[],error:`could not read process environments \u2014 ${failed}`};return{orphans:candidates.filter((row)=>marked.has(row.pid)),error:null}}function formatMb(rssKb){return`${(rssKb/1024).toFixed(0)} MB`}function orphanDoctorLines(orphans,error,cliName,killing=!1){if(error)return[`orphans: \u2717 ${error}`];if(orphans.length===0)return["orphans: \u2713 none \u2014 no processes left behind by a dead PTY session"];let totalMb=orphans.reduce((sum,row)=>sum+row.rssKb,0)/1024,lines=[`orphans: \u26A0 ${orphans.length} process(es) outlived the PTY session that spawned them (${totalMb.toFixed(0)} MB RSS)`," each is reparented to init, carries Rove's PTY marker, and its process"," group leader is gone \u2014 no live task owns them"];for(let row of[...orphans].sort((a,b)=>b.rssKb-a.rssKb))lines.push(` pid ${row.pid} (group ${row.pgid}) up ${row.etime}, ${formatMb(row.rssKb)}: ${row.command.slice(0,90)}`);if(!killing)lines.push(` \u2192 \`${cliName} doctor --kill-orphans\` ends those process groups (SIGTERM, then SIGKILL)`," read the list first: something you backgrounded from a Rove terminal and then"," closed the tab on looks exactly like a leak, and doctor cannot tell them apart");return lines}var GROUP_EXIT_GRACE_MS=2000,GROUP_POLL_MS=100;function logOrphanKill(pgid,signal,logPath=defaultDaemonLogPath()){try{appendFileSync(logPath,formatDaemonInfo("doctor-kill-orphans",`${signal} process group ${pgid}`))}catch{}}function groupAlive(pgid){try{return process.kill(-pgid,0),!0}catch(err){return err.code!=="ESRCH"}}async function killOrphanGroups(orphans){let groups=[...new Set(orphans.map((row)=>row.pgid))];for(let pgid of groups)try{process.kill(-pgid,"SIGTERM"),logOrphanKill(pgid,"SIGTERM")}catch{}let deadline=Date.now()+GROUP_EXIT_GRACE_MS,survivors=groups.filter(groupAlive);while(survivors.length>0&&Date.now()<deadline)await new Promise((resolve)=>setTimeout(resolve,GROUP_POLL_MS)),survivors=survivors.filter(groupAlive);for(let pgid of survivors)try{process.kill(-pgid,"SIGKILL"),logOrphanKill(pgid,"SIGKILL")}catch{}return await new Promise((resolve)=>setTimeout(resolve,GROUP_POLL_MS)),{groups,survivors:survivors.filter(groupAlive)}}function multiplexerLabel(env){if(env.TMUX)return"tmux";if(env.ZELLIJ)return"zellij";if(env.STY)return"screen";return"no"}function terminalEnvLines(env){let show=(v)=>v&&v.length>0?v:"(unset)",program=env.TERM_PROGRAM?`${env.TERM_PROGRAM}${env.TERM_PROGRAM_VERSION?` v${env.TERM_PROGRAM_VERSION}`:""}`:"(unset)";return[`terminal: TERM=${show(env.TERM)} TERM_PROGRAM=${program} COLORTERM=${show(env.COLORTERM)}`,` running inside a multiplexer: ${multiplexerLabel(env)}`]}function parseKittyProbeReply(data){let kitty=data.match(/\x1b\[\?(\d+)u/);if(kitty?.[1]!==void 0)return{kind:"supported",flags:Number.parseInt(kitty[1],10)};if(/\x1b\[\?[\d;]*c/.test(data))return{kind:"unsupported"};return null}function kittyProbeLine(result){switch(result.kind){case"supported":return` kitty keyboard protocol: \u2713 answered (flags=${result.flags})`;case"unsupported":return[" kitty keyboard protocol: \u2717 not supported \u2014 legacy key path"," (ctrl+h/ctrl+j arrive as C0 backspace/linefeed bytes; the"," split chords ctrl+\\ and ctrl+= cannot be encoded at all)"].join(`
5
5
  `);case"no-response":return" kitty keyboard protocol: ? no reply (terminal ignored both the kitty query and DA1)";case"skipped":return` kitty keyboard protocol: skipped (${result.reason})`}}async function probeKittyKeyboard(timeoutMs=300){let stdin=process.stdin;if(!stdin.isTTY||!process.stdout.isTTY)return{kind:"skipped",reason:"not an interactive terminal"};let wasRaw=stdin.isRaw===!0,buffer="";return await new Promise((resolve)=>{let done=!1,finish=(result)=>{if(done)return;if(done=!0,clearTimeout(timer),stdin.off("data",onData),stdin.pause(),!wasRaw)stdin.setRawMode(!1);resolve(result)},onData=(chunk)=>{buffer+=chunk.toString("latin1");let decided=parseKittyProbeReply(buffer);if(decided)finish(decided)},timer=setTimeout(()=>finish({kind:"no-response"}),timeoutMs);stdin.setRawMode(!0),stdin.resume(),stdin.on("data",onData),process.stdout.write("\x1B[?u\x1B[c")})}async function terminalDoctorLines(){return[...terminalEnvLines(process.env),kittyProbeLine(await probeKittyKeyboard())]}async function probeGit(){try{let proc=Bun.spawn(["git","--version"],{stdin:"ignore",stdout:"pipe",stderr:"ignore"}),text=(await new Response(proc.stdout).text()).trim();if(await proc.exited===0&&text)return{line:`git: \u2713 ${text}`,found:!0}}catch{}return{line:"git: \u2717 not found on PATH",found:!1}}function binaryLabel(binary){return binary.found?`\u2713 ${binary.path}`:`\u2717 ${binary.error}`}async function probeEngines(){let statuses=await detectEngineStatuses(await probeableEngineIds()),lines=["engines:"];for(let status of statuses){let account=describeAccount(status.account),name=`${status.vendor.padEnd(7)} `;if(lines.push(` ${name}${binaryLabel(status.binary)}${status.binary.found?` \u2014 ${account}`:""}`),status.accountError)lines.push(` \u26A0 ${status.accountError}`)}let{usable,signedOut}=summarizeEngines(statuses);return{lines,anyUsable:usable.length>0,signedOut}}var CLI_NAME=ROVE_PRODUCT_NAME;function isProcessAlive(pid){try{return process.kill(pid,0),!0}catch(err){return err.code==="EPERM"}}async function requestIfReachable(socketPath,name){let client=new RoveDaemonClient(socketPath);try{return await client.request(name,{})}catch{return null}finally{client.close()}}function fmtDuration(ms){let seconds=Math.floor(ms/1000);if(seconds<60)return`${seconds}s`;let minutes=Math.floor(seconds/60);if(minutes<60)return`${minutes}m ${seconds%60}s`;return`${Math.floor(minutes/60)}h ${minutes%60}m`}function describeFile(path){try{let stat=statSync2(path);return`present (${formatBytes(stat.size)}, modified ${stat.mtime.toISOString()})`}catch{return"absent"}}function taskCount(path){try{let parsed=JSON.parse(readFileSync2(path,"utf8"));return Array.isArray(parsed.tasks)?parsed.tasks.length:null}catch{return null}}function tailFile(path,count){try{return readFileSync2(path,"utf8").split(`
@@ -14,5 +14,5 @@ Usage: ${CLI_NAME} doctor [--report] [--fix] [--kill-orphans]
14
14
  `),process.exit(2);let{lines,fixes,orphans}=await collectDoctor();if(!fix&&fixes.length>0)lines.push("",t("doctor.fix.hint",{count:fixes.length,command:`${CLI_NAME} doctor --fix`}));if(console.log(lines.join(`
15
15
  `)),kill)console.log(`
16
16
  ${(await sweepOrphans(orphans)).join(`
17
- `)}`);if(fix)await applyFixes(fixes,defaultFixRuntime());if(report){let{writeReportBundle}=await import("./chunk-whbm14qr.js"),path=writeReportBundle(lines);console.log(`
17
+ `)}`);if(fix)await applyFixes(fixes,defaultFixRuntime());if(report){let{writeReportBundle}=await import("./chunk-meyfwc50.js"),path=writeReportBundle(lines);console.log(`
18
18
  report written: ${path}`),console.log("attach this file to a bug report \u2014 it includes recent daemon + pty-host logs and env.")}}export{runDoctorSubcommand};
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ import{VerbArgs,defaultApiRuntime,findVerb,parseFlags,unknownVerbError,validateAgainstSpec}from"./chunk-n77bc7zh.js";import{ensurePluginEnginesLoaded}from"./chunk-mt6hv8p4.js";import{ApiError,cliCaller,splitDaemonCode}from"./chunk-568q390y.js";import{errorMessage}from"./chunk-2brn8e1y.js";import{ROVE_API_VERSION}from"./chunk-kyjdsax8.js";function toApiError(err){if(err instanceof ApiError)return err;let message=errorMessage(err);if(/task not found/i.test(message))return new ApiError(message,"TASK_NOT_FOUND",{hint:"that task id does not exist (deleted or mistyped) \u2014 list live tasks and retry with a real id",nextCommandArgs:["api","list"]});if(/unknown daemon request:/i.test(message))return versionSkewError(message);let coded=splitDaemonCode(message);if(coded)return new ApiError(coded.rest,coded.code);return new ApiError(message,"RPC_ERROR")}function versionSkewError(message){return new ApiError(message,"DAEMON_VERSION_SKEW",{hint:"the running daemon is a different build than this CLI, so it does not serve this verb \u2014 restart the daemon to pick up this build, then retry (if the verb is gone for good, `rove api schema` lists what this daemon actually serves)",nextCommandArgs:["daemon","restart"]})}function errorBody(err){return{message:err.message,code:err.code,...err.data}}function successEnvelope(result){return{apiVersion:ROVE_API_VERSION,ok:!0,result}}function errorEnvelope(err){return{apiVersion:ROVE_API_VERSION,ok:!1,error:errorBody(toApiError(err))}}function flagText(name,type,value){if(typeof value==="string")return value;if(typeof value==="boolean"&&(type==="bool"||type===void 0))return String(value);if(typeof value==="number"&&(type==="int"||type==="uint"||type===void 0))return String(value);if(Array.isArray(value)&&(type==="csv"||type===void 0)){if(!value.every((item)=>typeof item==="string"&&!item.includes(",")))throw new ApiError(`param ${name} must be a list of strings without ","`,"BAD_FLAG");return value.join(",")}throw new ApiError(`param ${name} does not fit its ${type} flag`,"BAD_FLAG")}function paramsToFlags(verb,params){let flags=new Map;for(let[name,value]of Object.entries(params))flags.set(name,flagText(name,verb.flags.find((f)=>f.name===name)?.type,value));return flags}function booleanFlagsOf(verb){return new Set(verb.flags.filter((f)=>f.type==="bool").map((f)=>f.name))}async function callVerb(verb,flags,deps){let caller=deps.caller??cliCaller();try{return await verb.handler({args:new VerbArgs(verb,flags,caller),caller,client:deps.client,runtime:deps.runtime??defaultApiRuntime})}catch(err){throw toApiError(err)}}async function runVerb(verbName,input,deps){ensurePluginEnginesLoaded();let verb=findVerb(verbName);if(!verb)throw unknownVerbError(verbName);if(verb.cliOnly&&!(deps.caller??cliCaller()).cli)throw new ApiError(`"${verbName}" streams over stdout/stdin, so only \`rove api\` can run it`,"CLI_ONLY_VERB",{hint:"run it as a CLI command on the machine whose daemon you are talking to"});let flags="argv"in input?parseFlags(input.argv,booleanFlagsOf(verb)).flags:paramsToFlags(verb,input.params);return validateAgainstSpec(verb,flags),callVerb(verb,flags,deps)}async function executeVerb(verbName,input,deps){try{return successEnvelope(await runVerb(verbName,input,deps))}catch(err){return errorEnvelope(err)}}
3
+ export{toApiError,errorBody,successEnvelope,errorEnvelope,paramsToFlags,booleanFlagsOf,callVerb,runVerb,executeVerb};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{ENGINE_NOT_OBSERVED_REASON,ENGINE_START_POLL_MS,ENGINE_START_PROBE_MS,deliverHostedPrompt,deliverToKey,ensurePtyHost,findEngineKey,isTaskKey,killTaskSessions,listSessions,listSessionsOrNull,openPtyHost,outcomeFields,taskKeys}from"./chunk-fg1sx7hc.js";import"./chunk-chzvy4x5.js";import"./chunk-p9d26ma8.js";import"./chunk-y5dk90tw.js";import"./chunk-2apszxn2.js";import"./chunk-sak1tphp.js";import"./chunk-z8w64xa1.js";import"./chunk-rxqdw6s5.js";import"./chunk-4250pw6r.js";import"./chunk-5k4m5yt5.js";import"./chunk-vjvkkrzc.js";import"./chunk-pdvyfz3n.js";import"./chunk-r0etyq15.js";import"./chunk-hpay0ax8.js";import"./chunk-catrr0z3.js";import"./chunk-8ja7jrhc.js";import"./chunk-2pen6b1t.js";import"./chunk-2tfnscxk.js";import"./chunk-w4cpkhzj.js";import"./chunk-w7zv47mp.js";import"./chunk-etfh8f4z.js";import"./chunk-568q390y.js";import"./chunk-zsfyj36g.js";import"./chunk-kq8mywzd.js";import"./chunk-hkr8r1sg.js";import"./chunk-w0gf8pe2.js";import"./chunk-ag3txfg2.js";import"./chunk-2brn8e1y.js";import"./chunk-964z8ccb.js";import"./chunk-x33sm4rp.js";import"./chunk-7kysxgbq.js";import"./chunk-qzsahxd9.js";import"./chunk-xy8be792.js";import"./chunk-h2m7em1e.js";import"./chunk-tdhk4dz8.js";import"./chunk-21ek142k.js";import"./chunk-40dgv828.js";import"./chunk-3342qzve.js";import"./chunk-zk5qkkb1.js";import"./chunk-mw0ysrpd.js";import"./chunk-a7kq09ke.js";import"./chunk-prqeddy7.js";import"./chunk-zt7wfnva.js";import"./chunk-yt15y085.js";import"./chunk-dexythnk.js";import"./chunk-y18jrdkr.js";import"./chunk-cmp64q4j.js";import"./chunk-pxk2c2vj.js";import"./chunk-pvm47wsy.js";import"./chunk-kyjdsax8.js";import"./chunk-hq9tbzqa.js";import"./chunk-pn5ygqn6.js";import"./chunk-npwzmmv9.js";import"./chunk-b39sdtt0.js";import"./chunk-nc46gddg.js";import"./chunk-91sykzqq.js";export{taskKeys,outcomeFields,openPtyHost,listSessionsOrNull,listSessions,killTaskSessions,isTaskKey,findEngineKey,ensurePtyHost,deliverToKey,deliverHostedPrompt,ENGINE_START_PROBE_MS,ENGINE_START_POLL_MS,ENGINE_NOT_OBSERVED_REASON};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{recordSpawn}from"./chunk-40dgv828.js";import{projectRejection}from"./chunk-3342qzve.js";import{getPersistedBool,loadStateFile,patchStateFile,readSavedRepos,updateStateFile}from"./chunk-7q43tysm.js";import{kvStatePath}from"./chunk-prqeddy7.js";import{pathIdentity,samePath}from"./chunk-pn5ygqn6.js";import{spawnSync}from"child_process";import{realpathSync}from"fs";function isRemoteRepoKey(key){return key.startsWith("ssh://")}function isRemoteProjectsEnabled(){return getPersistedBool("experimental.remoteProjects",!1)}function remoteRepoKey(host,user,port,basePath){let authority=port?`${user}@${host}:${port}`:`${user}@${host}`,base=(basePath??"").trim().replace(/\/+$/,"");if(!base)return`ssh://${authority}`;return`ssh://${authority}${base.startsWith("/")?base:`/${base}`}`}function readRemoteRepos(state){let raw=state.remoteRepos;if(!raw||typeof raw!=="object"||Array.isArray(raw))return{};return raw}function getRemoteRepoConfig(key){return readRemoteRepos(loadStateFile())[key]??null}function getRemoteRepos(){return readRemoteRepos(loadStateFile())}function addRemoteRepo(config){let key=remoteRepoKey(config.host,config.user,config.port,config.basePath),added=!1;return updateStateFile((state)=>{let repos={...readRemoteRepos(state)},legacyKey=remoteRepoKey(config.host,config.user,config.port);if(key!==legacyKey&&repos[legacyKey]?.basePath===config.basePath)key=legacyKey;repos[key]=config,state.remoteRepos=repos;let saved=readSavedRepos(state);if(added=!saved.includes(key),added)state.savedRepos=[...saved,key];return}),{key,added}}function resolveRepoRoot(absPath){if(isRemoteRepoKey(absPath))return absPath;recordSpawn("repos.resolveRepoRoot",["git","rev-parse","--show-toplevel"],absPath);let r=spawnSync("git",["rev-parse","--show-toplevel"],{cwd:absPath,encoding:"utf8",shell:!1});if(r.status!==0)return absPath;let top=(r.stdout??"").trim();if(!top)return absPath;try{if(realpathSync(absPath)===realpathSync(top))return absPath}catch{}return top}function isGitRepo(absPath){if(isRemoteRepoKey(absPath))return!1;recordSpawn("repos.isGitRepo",["git","rev-parse","--is-inside-work-tree"],absPath);let r=spawnSync("git",["rev-parse","--is-inside-work-tree"],{cwd:absPath,encoding:"utf8",shell:!1});return r.status===0&&(r.stdout??"").trim()==="true"}function isValidBranchName(branch){return spawnSync("git",["check-ref-format","--branch",branch],{encoding:"utf8",shell:!1}).status===0}function resolveMainRepoRoot(absPath){if(isRemoteRepoKey(absPath))return absPath;recordSpawn("repos.resolveMainRepoRoot",["git","worktree","list","--porcelain"],absPath);let r=spawnSync("git",["worktree","list","--porcelain"],{cwd:absPath,encoding:"utf8",shell:!1});if(r.status!==0)return resolveRepoRoot(absPath);return(r.stdout??"").split(/\r?\n/).find((line)=>line.startsWith("worktree "))?.slice(9).trim()||resolveRepoRoot(absPath)}function statePath(){return kvStatePath()}function getSavedRepos(){return readSavedRepos(loadStateFile())}function getPersistedString(key){let value=loadStateFile()[key];return typeof value==="string"?value:void 0}function getPersistedValue(key){return loadStateFile()[key]}function setPersistedString(key,value){patchStateFile({[key]:value})}function getCustomEngineIds(){let raw=loadStateFile().customEngineIds;if(!Array.isArray(raw))return[];return raw.filter((s)=>typeof s==="string"&&s.trim().length>0)}function getDisabledEngineIds(){let raw=loadStateFile().disabledEngineIds;if(!Array.isArray(raw))return[];return raw.filter((s)=>typeof s==="string"&&s.trim().length>0)}function addSavedRepo(absPath,opts={}){let normalized=resolveMainRepoRoot(absPath),rejected=opts.skipGate?null:projectRejection(normalized,isGitRepo,opts.intent??"explicit");if(rejected)return{added:!1,path:normalized,total:getSavedRepos().length,rejected};let result={added:!1,path:normalized,total:0};return updateStateFile((state)=>{let cur=readSavedRepos(state);if(cur.some((repo)=>samePath(repo,normalized)))return result={added:!1,path:normalized,total:cur.length},!1;state.savedRepos=[...cur,normalized],result={added:!0,path:normalized,total:cur.length+1};return}),result}function backfillSavedReposFromProjects(mainRepos){let added=[];for(let repo of mainRepos)if(addSavedRepo(repo,{intent:"explicit"}).added)added.push(repo);return added}function normalizeSavedRepos(){let cur=getSavedRepos(),seen=new Set,next=[],changed=!1;for(let p of cur){let top=resolveMainRepoRoot(p);if(top!==p)changed=!0;if(seen.has(pathIdentity(top))){changed=!0;continue}seen.add(pathIdentity(top)),next.push(top)}if(!changed)return;patchStateFile({savedRepos:next})}function readRepoConfigs(state){let raw=state.repoConfigs;if(!raw||typeof raw!=="object"||Array.isArray(raw))return{};return raw}function samePathResolved(left,right){if(samePath(left,right))return!0;try{return realpathSync(left)===realpathSync(right)}catch{return!1}}function coerceOverride(entry){if(!entry||typeof entry!=="object")return{};let e=entry;return{initScript:typeof e.initScript==="string"&&e.initScript.length>0?e.initScript:void 0,initPrompt:typeof e.initPrompt==="string"&&e.initPrompt.length>0?e.initPrompt:void 0}}function getRepoInitOverride(repoRoot){let configs=readRepoConfigs(loadStateFile()),keys=Object.keys(configs);if(keys.length===0)return{};let direct=keys.find((key2)=>samePathResolved(key2,repoRoot));if(direct)return coerceOverride(configs[direct]);let normalized=resolveRepoRoot(repoRoot),key=keys.find((key2)=>samePathResolved(key2,normalized))??normalized;return coerceOverride(configs[key])}function setRepoInitOverride(repoRoot,patch){let resolved=resolveRepoRoot(repoRoot),next={};return updateStateFile((state)=>{let configs={...readRepoConfigs(state)},normalized=Object.keys(configs).find((key)=>samePathResolved(key,resolved))??resolved,cur=coerceOverride(configs[normalized]),nextScript=patch.initScript===void 0?cur.initScript:patch.initScript||void 0,nextPrompt=patch.initPrompt===void 0?cur.initPrompt:patch.initPrompt||void 0;if(next={...nextScript?{initScript:nextScript}:{},...nextPrompt?{initPrompt:nextPrompt}:{}},!next.initScript&&!next.initPrompt){let{[normalized]:_dropped,...rest}=configs;state.repoConfigs=rest}else configs[normalized]=next,state.repoConfigs=configs;return}),next}function removeSavedRepo(absPath){let result={removed:!1,path:absPath,total:0};return updateStateFile((state)=>{let cur=readSavedRepos(state);if(!cur.some((repo)=>samePath(repo,absPath)))return result={removed:!1,path:absPath,total:cur.length},!1;let remaining=cur.filter((p)=>!samePath(p,absPath));if(state.savedRepos=remaining,isRemoteRepoKey(absPath)){let remotes=readRemoteRepos(state);if(absPath in remotes){let next={...remotes};delete next[absPath],state.remoteRepos=next}}result={removed:!0,path:absPath,total:remaining.length};return}),result}
2
+ import{recordSpawn}from"./chunk-40dgv828.js";import{projectRejection}from"./chunk-3342qzve.js";import{getPersistedBool,loadStateFile,patchStateFile,readSavedRepos,updateStateFile}from"./chunk-zk5qkkb1.js";import{kvStatePath}from"./chunk-prqeddy7.js";import{pathIdentity,samePath}from"./chunk-pn5ygqn6.js";import{spawnSync}from"child_process";import{realpathSync}from"fs";function isRemoteRepoKey(key){return key.startsWith("ssh://")}function isRemoteProjectsEnabled(){return getPersistedBool("experimental.remoteProjects",!1)}function remoteRepoKey(host,user,port,basePath){let authority=port?`${user}@${host}:${port}`:`${user}@${host}`,base=(basePath??"").trim().replace(/\/+$/,"");if(!base)return`ssh://${authority}`;return`ssh://${authority}${base.startsWith("/")?base:`/${base}`}`}function readRemoteRepos(state){let raw=state.remoteRepos;if(!raw||typeof raw!=="object"||Array.isArray(raw))return{};return raw}function getRemoteRepoConfig(key){return readRemoteRepos(loadStateFile())[key]??null}function getRemoteRepos(){return readRemoteRepos(loadStateFile())}function addRemoteRepo(config){let key=remoteRepoKey(config.host,config.user,config.port,config.basePath),added=!1;return updateStateFile((state)=>{let repos={...readRemoteRepos(state)},legacyKey=remoteRepoKey(config.host,config.user,config.port);if(key!==legacyKey&&repos[legacyKey]?.basePath===config.basePath)key=legacyKey;repos[key]=config,state.remoteRepos=repos;let saved=readSavedRepos(state);if(added=!saved.includes(key),added)state.savedRepos=[...saved,key];return}),{key,added}}function resolveRepoRoot(absPath){if(isRemoteRepoKey(absPath))return absPath;recordSpawn("repos.resolveRepoRoot",["git","rev-parse","--show-toplevel"],absPath);let r=spawnSync("git",["rev-parse","--show-toplevel"],{cwd:absPath,encoding:"utf8",shell:!1});if(r.status!==0)return absPath;let top=(r.stdout??"").trim();if(!top)return absPath;try{if(realpathSync(absPath)===realpathSync(top))return absPath}catch{}return top}function isGitRepo(absPath){if(isRemoteRepoKey(absPath))return!1;recordSpawn("repos.isGitRepo",["git","rev-parse","--is-inside-work-tree"],absPath);let r=spawnSync("git",["rev-parse","--is-inside-work-tree"],{cwd:absPath,encoding:"utf8",shell:!1});return r.status===0&&(r.stdout??"").trim()==="true"}function isValidBranchName(branch){return spawnSync("git",["check-ref-format","--branch",branch],{encoding:"utf8",shell:!1}).status===0}function resolveMainRepoRoot(absPath){if(isRemoteRepoKey(absPath))return absPath;recordSpawn("repos.resolveMainRepoRoot",["git","worktree","list","--porcelain"],absPath);let r=spawnSync("git",["worktree","list","--porcelain"],{cwd:absPath,encoding:"utf8",shell:!1});if(r.status!==0)return resolveRepoRoot(absPath);return(r.stdout??"").split(/\r?\n/).find((line)=>line.startsWith("worktree "))?.slice(9).trim()||resolveRepoRoot(absPath)}function statePath(){return kvStatePath()}function getSavedRepos(){return readSavedRepos(loadStateFile())}function getPersistedString(key){let value=loadStateFile()[key];return typeof value==="string"?value:void 0}function getPersistedValue(key){return loadStateFile()[key]}function setPersistedString(key,value){patchStateFile({[key]:value})}function getCustomEngineIds(){let raw=loadStateFile().customEngineIds;if(!Array.isArray(raw))return[];return raw.filter((s)=>typeof s==="string"&&s.trim().length>0)}function getDisabledEngineIds(){let raw=loadStateFile().disabledEngineIds;if(!Array.isArray(raw))return[];return raw.filter((s)=>typeof s==="string"&&s.trim().length>0)}function addSavedRepo(absPath,opts={}){let normalized=resolveMainRepoRoot(absPath),rejected=opts.skipGate?null:projectRejection(normalized,isGitRepo,opts.intent??"explicit");if(rejected)return{added:!1,path:normalized,total:getSavedRepos().length,rejected};let result={added:!1,path:normalized,total:0};return updateStateFile((state)=>{let cur=readSavedRepos(state);if(cur.some((repo)=>samePath(repo,normalized)))return result={added:!1,path:normalized,total:cur.length},!1;state.savedRepos=[...cur,normalized],result={added:!0,path:normalized,total:cur.length+1};return}),result}function backfillSavedReposFromProjects(mainRepos){let added=[];for(let repo of mainRepos)if(addSavedRepo(repo,{intent:"explicit"}).added)added.push(repo);return added}function normalizeSavedRepos(){let cur=getSavedRepos(),seen=new Set,next=[],changed=!1;for(let p of cur){let top=resolveMainRepoRoot(p);if(top!==p)changed=!0;if(seen.has(pathIdentity(top))){changed=!0;continue}seen.add(pathIdentity(top)),next.push(top)}if(!changed)return;patchStateFile({savedRepos:next})}function readRepoConfigs(state){let raw=state.repoConfigs;if(!raw||typeof raw!=="object"||Array.isArray(raw))return{};return raw}function samePathResolved(left,right){if(samePath(left,right))return!0;try{return realpathSync(left)===realpathSync(right)}catch{return!1}}function coerceOverride(entry){if(!entry||typeof entry!=="object")return{};let e=entry;return{initScript:typeof e.initScript==="string"&&e.initScript.length>0?e.initScript:void 0,initPrompt:typeof e.initPrompt==="string"&&e.initPrompt.length>0?e.initPrompt:void 0}}function getRepoInitOverride(repoRoot){let configs=readRepoConfigs(loadStateFile()),keys=Object.keys(configs);if(keys.length===0)return{};let direct=keys.find((key2)=>samePathResolved(key2,repoRoot));if(direct)return coerceOverride(configs[direct]);let normalized=resolveRepoRoot(repoRoot),key=keys.find((key2)=>samePathResolved(key2,normalized))??normalized;return coerceOverride(configs[key])}function setRepoInitOverride(repoRoot,patch){let resolved=resolveRepoRoot(repoRoot),next={};return updateStateFile((state)=>{let configs={...readRepoConfigs(state)},normalized=Object.keys(configs).find((key)=>samePathResolved(key,resolved))??resolved,cur=coerceOverride(configs[normalized]),nextScript=patch.initScript===void 0?cur.initScript:patch.initScript||void 0,nextPrompt=patch.initPrompt===void 0?cur.initPrompt:patch.initPrompt||void 0;if(next={...nextScript?{initScript:nextScript}:{},...nextPrompt?{initPrompt:nextPrompt}:{}},!next.initScript&&!next.initPrompt){let{[normalized]:_dropped,...rest}=configs;state.repoConfigs=rest}else configs[normalized]=next,state.repoConfigs=configs;return}),next}function removeSavedRepo(absPath){let result={removed:!1,path:absPath,total:0};return updateStateFile((state)=>{let cur=readSavedRepos(state);if(!cur.some((repo)=>samePath(repo,absPath)))return result={removed:!1,path:absPath,total:cur.length},!1;let remaining=cur.filter((p)=>!samePath(p,absPath));if(state.savedRepos=remaining,isRemoteRepoKey(absPath)){let remotes=readRemoteRepos(state);if(absPath in remotes){let next={...remotes};delete next[absPath],state.remoteRepos=next}}result={removed:!0,path:absPath,total:remaining.length};return}),result}
3
3
  export{isRemoteRepoKey,isRemoteProjectsEnabled,remoteRepoKey,getRemoteRepoConfig,getRemoteRepos,addRemoteRepo,resolveRepoRoot,isGitRepo,isValidBranchName,resolveMainRepoRoot,statePath,getSavedRepos,getPersistedString,getPersistedValue,setPersistedString,getCustomEngineIds,getDisabledEngineIds,addSavedRepo,backfillSavedReposFromProjects,normalizeSavedRepos,getRepoInitOverride,setRepoInitOverride,removeSavedRepo};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{GitWorktreeManager}from"./chunk-2mrwdd50.js";import"./chunk-4xns5j33.js";import"./chunk-41x1hrqe.js";import"./chunk-cbjh43yc.js";import"./chunk-2apszxn2.js";import"./chunk-sak1tphp.js";import"./chunk-catrr0z3.js";import"./chunk-t7j8g9f6.js";import"./chunk-dmzg9zdc.js";import"./chunk-6xppe9bj.js";import"./chunk-2brn8e1y.js";import"./chunk-7kysxgbq.js";import"./chunk-h9cg0j3a.js";import"./chunk-40dgv828.js";import"./chunk-3342qzve.js";import"./chunk-7q43tysm.js";import"./chunk-mw0ysrpd.js";import"./chunk-a7kq09ke.js";import"./chunk-prqeddy7.js";import"./chunk-zt7wfnva.js";import"./chunk-yt15y085.js";import"./chunk-pn5ygqn6.js";import"./chunk-npwzmmv9.js";import"./chunk-b39sdtt0.js";import"./chunk-nc46gddg.js";import"./chunk-wqfp8d9w.js";export{GitWorktreeManager};
2
+ import{GitWorktreeManager}from"./chunk-e1xvz3sv.js";import"./chunk-84bmcqyz.js";import"./chunk-41x1hrqe.js";import"./chunk-y5dk90tw.js";import"./chunk-2apszxn2.js";import"./chunk-sak1tphp.js";import"./chunk-catrr0z3.js";import"./chunk-t7j8g9f6.js";import"./chunk-dmzg9zdc.js";import"./chunk-6xppe9bj.js";import"./chunk-2brn8e1y.js";import"./chunk-7kysxgbq.js";import"./chunk-21ek142k.js";import"./chunk-40dgv828.js";import"./chunk-3342qzve.js";import"./chunk-zk5qkkb1.js";import"./chunk-mw0ysrpd.js";import"./chunk-a7kq09ke.js";import"./chunk-prqeddy7.js";import"./chunk-zt7wfnva.js";import"./chunk-yt15y085.js";import"./chunk-pn5ygqn6.js";import"./chunk-npwzmmv9.js";import"./chunk-b39sdtt0.js";import"./chunk-nc46gddg.js";import"./chunk-91sykzqq.js";export{GitWorktreeManager};