rovecode 0.3.3 → 0.4.0-beta.3

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 (495) hide show
  1. package/CHANGELOG.md +527 -0
  2. package/README.md +46 -48
  3. package/bin/rovecode.js +24 -0
  4. package/dist/cli/app-j6gn14w3.js +2 -0
  5. package/dist/cli/ask-user-cwstt8fz.js +2 -0
  6. package/dist/cli/auth-login-9bbp9915.js +2 -0
  7. package/dist/cli/auth-m8p9grty.js +2 -0
  8. package/dist/cli/bench-16zqdms5.js +9 -0
  9. package/dist/cli/catalog-1xchffa4.js +2 -0
  10. package/dist/cli/cli-1n1zb64f.js +2 -0
  11. package/dist/cli/client-2t9gjkck.js +2 -0
  12. package/dist/cli/commands-exafvm2b.js +2 -0
  13. package/dist/cli/connect-6zde0kn3.js +2 -0
  14. package/dist/cli/context-cmd-5t43wgqt.js +2 -0
  15. package/dist/cli/context-report-kt01pw8y.js +2 -0
  16. package/dist/cli/count-remote-ap7x3vh6.js +2 -0
  17. package/dist/cli/design-ne5zszyh.js +2 -0
  18. package/dist/cli/dispatch-2r5myxye.js +2 -0
  19. package/dist/cli/doctor-ws4fh4tn.js +3 -0
  20. package/dist/cli/executor-bdrjn634.js +2 -0
  21. package/dist/cli/export-1mxb9g5p.js +2 -0
  22. package/dist/cli/files-g104xghh.js +2 -0
  23. package/dist/cli/gauntlet-07xrjpj7.js +2 -0
  24. package/dist/cli/gauntlet-runner-xvy64436.js +10 -0
  25. package/dist/cli/gauntlet-wave3-jm91yt5w.js +5 -0
  26. package/dist/cli/gauntlet-wave4-r13py7p1.js +14 -0
  27. package/dist/cli/hashline-znvrat11.js +2 -0
  28. package/dist/cli/http-xafw6fsh.js +143 -0
  29. package/dist/cli/index-1sgjm25y.js +2 -0
  30. package/dist/cli/init-g2m0tn4m.js +51 -0
  31. package/dist/cli/install-avaqjjqq.js +2 -0
  32. package/dist/cli/loop-mmpfft01.js +2 -0
  33. package/dist/cli/main-0904f6ps.js +5 -0
  34. package/dist/cli/main-0ab9fc26.js +9 -0
  35. package/dist/cli/main-0jys2ccn.js +3 -0
  36. package/dist/cli/main-0mtcdbs7.js +3 -0
  37. package/dist/cli/main-0z1w2zsg.js +3 -0
  38. package/dist/cli/main-1dchs7xv.js +18 -0
  39. package/dist/cli/main-1ereejm1.js +3 -0
  40. package/dist/cli/main-1k1kw6b5.js +3 -0
  41. package/dist/cli/main-27y4sm2k.js +38 -0
  42. package/dist/cli/main-2wwjex5j.js +58 -0
  43. package/dist/cli/main-2yeveeve.js +6 -0
  44. package/dist/cli/main-2yfck9b5.js +3 -0
  45. package/dist/cli/main-2zmzgkwh.js +3 -0
  46. package/dist/cli/main-351pz3z7.js +7 -0
  47. package/dist/cli/main-3gjqfh7a.js +6 -0
  48. package/dist/cli/main-3nf3kgve.js +3 -0
  49. package/dist/cli/main-3pjrb2hd.js +3 -0
  50. package/dist/cli/main-3rxcvgna.js +19 -0
  51. package/dist/cli/main-4b3jgy66.js +19 -0
  52. package/dist/cli/main-4wndhjdc.js +7 -0
  53. package/dist/cli/main-4xcmvxnk.js +3 -0
  54. package/dist/cli/main-5tbz0wbz.js +4 -0
  55. package/dist/cli/main-5ywnwthm.js +3 -0
  56. package/dist/cli/main-6b62vkz0.js +14 -0
  57. package/dist/cli/main-6dnk69vp.js +3 -0
  58. package/dist/cli/main-6genrmhs.js +136 -0
  59. package/dist/cli/main-73g7eff4.js +15 -0
  60. package/dist/cli/main-7c5thhjd.js +5 -0
  61. package/dist/cli/main-7rn6bqje.js +3 -0
  62. package/dist/cli/main-80haw7qk.js +4 -0
  63. package/dist/cli/main-875s60s2.js +4 -0
  64. package/dist/cli/main-8kjxbpw4.js +8 -0
  65. package/dist/cli/main-90ds1z4e.js +10 -0
  66. package/dist/cli/main-9etavkew.js +3 -0
  67. package/dist/cli/main-a9njrkk1.js +3 -0
  68. package/dist/cli/main-aecrjq2d.js +12 -0
  69. package/dist/cli/main-ck9asesq.js +9 -0
  70. package/dist/cli/main-cta9racd.js +4 -0
  71. package/dist/cli/main-ddv7j2ag.js +3 -0
  72. package/dist/cli/main-dfreez27.js +10 -0
  73. package/dist/cli/main-f7rw7des.js +3 -0
  74. package/dist/cli/main-ggcn7rd7.js +5 -0
  75. package/dist/cli/main-gzkmycnv.js +3 -0
  76. package/dist/cli/main-hq51jg8v.js +18 -0
  77. package/dist/cli/main-jft389w9.js +8 -0
  78. package/dist/cli/main-k1eqkg83.js +3 -0
  79. package/dist/cli/main-k2y8a2aw.js +9 -0
  80. package/dist/cli/main-kcpbykxz.js +4 -0
  81. package/dist/cli/main-kd488vje.js +22 -0
  82. package/dist/cli/main-kh32yvgk.js +5 -0
  83. package/dist/cli/main-kqxnqjnv.js +25 -0
  84. package/dist/cli/main-kyn0xnsg.js +3 -0
  85. package/dist/cli/main-m1kk6fp5.js +21 -0
  86. package/dist/cli/main-mv40pcr2.js +4 -0
  87. package/dist/cli/main-n0t3973w.js +3 -0
  88. package/dist/cli/main-nqveez48.js +4 -0
  89. package/dist/cli/main-pknhvrmj.js +3 -0
  90. package/dist/cli/main-pn1w7a7j.js +3 -0
  91. package/dist/cli/main-prxxs70n.js +4 -0
  92. package/dist/cli/main-q3vsesf9.js +3 -0
  93. package/dist/cli/main-qsevpgsv.js +3 -0
  94. package/dist/cli/main-rdgdw24b.js +25 -0
  95. package/dist/cli/main-rfth4tbm.js +16 -0
  96. package/dist/cli/main-rg0wn0xf.js +5 -0
  97. package/dist/cli/main-sdmxhtv8.js +4 -0
  98. package/dist/cli/main-skbp13js.js +18 -0
  99. package/dist/cli/main-t4xnd213.js +7 -0
  100. package/dist/cli/main-vqak588n.js +4 -0
  101. package/dist/cli/main-w2n1303f.js +9 -0
  102. package/dist/cli/main-wbrdspr2.js +5 -0
  103. package/dist/cli/main-wsrg79c1.js +7 -0
  104. package/dist/cli/main-x4r0fne4.js +5 -0
  105. package/dist/cli/main-xea2f3tn.js +6 -0
  106. package/dist/cli/main-xg704a3c.js +3 -0
  107. package/dist/cli/main-xvnrabfp.js +16 -0
  108. package/dist/cli/main-xy53xf0r.js +4 -0
  109. package/dist/cli/main-y1fqy60y.js +3 -0
  110. package/dist/cli/main-yn8cd281.js +34 -0
  111. package/dist/cli/main-yr0ksc0h.js +4 -0
  112. package/dist/cli/main-z2ex2vyf.js +4 -0
  113. package/dist/cli/main-z3aayzvq.js +3 -0
  114. package/dist/cli/main-zaqh35jg.js +3 -0
  115. package/dist/cli/main-zc2e8e46.js +4 -0
  116. package/dist/cli/main-zzrfw6cf.js +13 -0
  117. package/dist/cli/main.js +280 -0
  118. package/dist/cli/market-cmd-e14kmx9n.js +5 -0
  119. package/dist/cli/mcp-login-wq7ktdek.js +2 -0
  120. package/dist/cli/mcp-market-cmd-9mg3jecy.js +2 -0
  121. package/dist/cli/notify-b7qc0cjb.js +2 -0
  122. package/dist/cli/oauth-z8whcgfx.js +2 -0
  123. package/dist/cli/output-b3ewj3ps.js +16 -0
  124. package/dist/cli/profiles-6mr5he5e.js +2 -0
  125. package/dist/cli/provider-config-g7j42q8x.js +2 -0
  126. package/dist/cli/provider-jr1y8vvm.js +2 -0
  127. package/dist/cli/registry-s8yk86g0.js +2 -0
  128. package/dist/cli/registry-t6p8d4mn.js +2 -0
  129. package/dist/cli/repl-bajwe1mh.js +11 -0
  130. package/dist/cli/resume-rwn9nz7y.js +2 -0
  131. package/dist/cli/run-flags-nah7ndpt.js +2 -0
  132. package/dist/cli/runtime-n7gafzhb.js +2 -0
  133. package/dist/cli/sandbox-config-emdy18x4.js +2 -0
  134. package/dist/cli/server-b0nvs2bn.js +5 -0
  135. package/dist/cli/session-arg-y75wd4kj.js +2 -0
  136. package/dist/cli/session-j62evmjq.js +2 -0
  137. package/dist/cli/sessions-cmd-tsnwz0ns.js +7 -0
  138. package/dist/cli/settings-df10wfez.js +2 -0
  139. package/dist/cli/setup-jzvv72fg.js +2 -0
  140. package/dist/cli/sextant-smoke-37m81ke6.js +5 -0
  141. package/dist/cli/skills-cmd-gjxnxnhx.js +2 -0
  142. package/dist/cli/smoke-p7748apt.js +8 -0
  143. package/dist/cli/start-chat-s4st3mm0.js +12 -0
  144. package/dist/cli/stream-gmeyewds.js +2 -0
  145. package/dist/cli/task-gh0kkp3n.js +2 -0
  146. package/dist/cli/tasks-z1kfpe8e.js +2 -0
  147. package/dist/cli/thinking-0eqkrz6t.js +2 -0
  148. package/dist/cli/todo-5brcrt9m.js +2 -0
  149. package/dist/cli/tools-7pzm0vj9.js +2 -0
  150. package/dist/cli/tools-s635p6s8.js +2 -0
  151. package/dist/cli/trust-cmd-cjav8zgm.js +2 -0
  152. package/dist/cli/update-check-pt31bm2f.js +2 -0
  153. package/dist/cli/update-cmd-tk131s9t.js +2 -0
  154. package/dist/cli/voice-56nabd8d.js +2 -0
  155. package/dist/cli/webfetch-xd8q596m.js +2 -0
  156. package/dist/cli/websearch-5hkf98k1.js +2 -0
  157. package/dist/cli/workflow-cmd-cy3cvzjp.js +4 -0
  158. package/dist/cli/workspace-q10g5z3e.js +2 -0
  159. package/dist/lib/index.js +62 -0
  160. package/dist/lib/models-index.json +1 -0
  161. package/dist/lib/plugins.js +55 -0
  162. package/dist/lib/providers.js +17 -0
  163. package/dist/lib/public-api.js +20 -0
  164. package/dist/lib/sdk.js +360 -0
  165. package/package.json +84 -72
  166. package/bin/rovecode.ts +0 -21
  167. package/src/acp/server.ts +0 -374
  168. package/src/cli/auth-login.ts +0 -122
  169. package/src/cli/connect.ts +0 -244
  170. package/src/cli/context-cmd.ts +0 -199
  171. package/src/cli/dispatch.ts +0 -82
  172. package/src/cli/doctor.ts +0 -362
  173. package/src/cli/export.ts +0 -276
  174. package/src/cli/help.ts +0 -293
  175. package/src/cli/is-tui-invocation.ts +0 -8
  176. package/src/cli/main.ts +0 -583
  177. package/src/cli/market-cmd.ts +0 -658
  178. package/src/cli/mcp-login.ts +0 -141
  179. package/src/cli/mcp-market-cmd.ts +0 -302
  180. package/src/cli/output.ts +0 -382
  181. package/src/cli/repl.ts +0 -250
  182. package/src/cli/repomap-root.ts +0 -14
  183. package/src/cli/resume.ts +0 -57
  184. package/src/cli/run-flags.ts +0 -43
  185. package/src/cli/run-limits.ts +0 -78
  186. package/src/cli/runtime.ts +0 -931
  187. package/src/cli/session-arg.ts +0 -30
  188. package/src/cli/sessions-cmd.ts +0 -145
  189. package/src/cli/setup.ts +0 -153
  190. package/src/cli/skills-cmd.ts +0 -194
  191. package/src/cli/start-chat.ts +0 -65
  192. package/src/cli/trust-cmd.ts +0 -52
  193. package/src/coding/bash.ts +0 -148
  194. package/src/coding/checkpoints.ts +0 -327
  195. package/src/coding/diff.ts +0 -138
  196. package/src/coding/files.ts +0 -341
  197. package/src/coding/hashline.ts +0 -274
  198. package/src/coding/lsp-gate.ts +0 -254
  199. package/src/coding/lsp-servers.ts +0 -147
  200. package/src/coding/lsp.ts +0 -283
  201. package/src/coding/repomap-cache.ts +0 -99
  202. package/src/coding/repomap-files.ts +0 -192
  203. package/src/coding/repomap.ts +0 -481
  204. package/src/core/agents.ts +0 -255
  205. package/src/core/compaction.ts +0 -259
  206. package/src/core/config.ts +0 -289
  207. package/src/core/context-report.ts +0 -228
  208. package/src/core/context.ts +0 -60
  209. package/src/core/count-remote.ts +0 -107
  210. package/src/core/execpolicy-rules.ts +0 -196
  211. package/src/core/execpolicy.ts +0 -385
  212. package/src/core/executor.ts +0 -454
  213. package/src/core/guardrails.ts +0 -400
  214. package/src/core/hooks.ts +0 -411
  215. package/src/core/images.ts +0 -230
  216. package/src/core/intro.ts +0 -266
  217. package/src/core/loop.ts +0 -567
  218. package/src/core/modes.ts +0 -372
  219. package/src/core/orchestrator.ts +0 -245
  220. package/src/core/proc-group.ts +0 -48
  221. package/src/core/project-trust.ts +0 -98
  222. package/src/core/reflection.ts +0 -165
  223. package/src/core/sandbox-config.ts +0 -186
  224. package/src/core/session-id.ts +0 -24
  225. package/src/core/session-images.ts +0 -73
  226. package/src/core/session-ops.ts +0 -183
  227. package/src/core/session-text.ts +0 -29
  228. package/src/core/session.ts +0 -469
  229. package/src/core/settings.ts +0 -170
  230. package/src/core/tasks.ts +0 -646
  231. package/src/core/token-scale.ts +0 -108
  232. package/src/core/tools.ts +0 -309
  233. package/src/core/trust.ts +0 -104
  234. package/src/core/types.ts +0 -330
  235. package/src/core/update-check.ts +0 -171
  236. package/src/core/usage.ts +0 -204
  237. package/src/core/validate.ts +0 -121
  238. package/src/core/verify-gate.ts +0 -159
  239. package/src/core/verify.ts +0 -236
  240. package/src/core/voice.ts +0 -158
  241. package/src/core/win-job.ts +0 -183
  242. package/src/core/workspace.ts +0 -184
  243. package/src/design/audit.ts +0 -797
  244. package/src/design/direction.ts +0 -190
  245. package/src/design/rules.ts +0 -157
  246. package/src/eval/bench.ts +0 -150
  247. package/src/eval/gauntlet-runner.ts +0 -215
  248. package/src/eval/gauntlet-support.ts +0 -84
  249. package/src/eval/gauntlet-wave3.ts +0 -269
  250. package/src/eval/gauntlet-wave4.ts +0 -217
  251. package/src/eval/gauntlet.ts +0 -253
  252. package/src/index.ts +0 -17
  253. package/src/lanes/agy.ts +0 -95
  254. package/src/lanes/approval.ts +0 -24
  255. package/src/lanes/claude.ts +0 -129
  256. package/src/lanes/codex.ts +0 -127
  257. package/src/lanes/events.ts +0 -130
  258. package/src/lanes/job.ts +0 -142
  259. package/src/lanes/opencode.ts +0 -122
  260. package/src/lanes/process.ts +0 -184
  261. package/src/lanes/progress.ts +0 -183
  262. package/src/lanes/registry.ts +0 -178
  263. package/src/lanes/runner.ts +0 -124
  264. package/src/lanes/types.ts +0 -112
  265. package/src/market/catalogs/mcp-docs.json +0 -111
  266. package/src/market/catalogs/plugins.json +0 -111
  267. package/src/market/catalogs/skills.json +0 -478
  268. package/src/market/clone.ts +0 -72
  269. package/src/market/context-cost.ts +0 -121
  270. package/src/market/digest.ts +0 -106
  271. package/src/market/index.ts +0 -22
  272. package/src/market/install.ts +0 -578
  273. package/src/market/manifest.ts +0 -187
  274. package/src/market/prereq.ts +0 -145
  275. package/src/market/registry.ts +0 -363
  276. package/src/market/resolve.ts +0 -111
  277. package/src/market/types.ts +0 -236
  278. package/src/market/validate.ts +0 -227
  279. package/src/mcp/client.ts +0 -449
  280. package/src/mcp/config.ts +0 -252
  281. package/src/mcp/local-package.ts +0 -211
  282. package/src/mcp/market-catalog.ts +0 -84
  283. package/src/mcp/market-install.ts +0 -289
  284. package/src/mcp/market.ts +0 -362
  285. package/src/mcp/oauth.ts +0 -251
  286. package/src/mcp/prompts-resources.ts +0 -249
  287. package/src/mcp/shared.ts +0 -149
  288. package/src/mcp/status.ts +0 -67
  289. package/src/mcp/tools.ts +0 -275
  290. package/src/mcp/transport.ts +0 -122
  291. package/src/mcp/trust.ts +0 -25
  292. package/src/memory/blocks.ts +0 -278
  293. package/src/memory/recall.ts +0 -355
  294. package/src/memory/scope.ts +0 -182
  295. package/src/memory/store.ts +0 -105
  296. package/src/memory/tools.ts +0 -99
  297. package/src/plugins/cli.ts +0 -119
  298. package/src/plugins/discover.ts +0 -108
  299. package/src/plugins/index.ts +0 -50
  300. package/src/plugins/install.ts +0 -184
  301. package/src/plugins/load.ts +0 -124
  302. package/src/plugins/manifest.ts +0 -92
  303. package/src/plugins/state.ts +0 -83
  304. package/src/providers/auth.ts +0 -408
  305. package/src/providers/cache.ts +0 -223
  306. package/src/providers/catalog-local.ts +0 -160
  307. package/src/providers/catalog.ts +0 -421
  308. package/src/providers/middleware-context.ts +0 -86
  309. package/src/providers/middleware.ts +0 -373
  310. package/src/providers/model-list.ts +0 -23
  311. package/src/providers/oauth/common.ts +0 -105
  312. package/src/providers/oauth/device-code.ts +0 -107
  313. package/src/providers/oauth/github-copilot.ts +0 -146
  314. package/src/providers/oauth/loopback.ts +0 -158
  315. package/src/providers/oauth/openai.ts +0 -163
  316. package/src/providers/oauth/openrouter.ts +0 -89
  317. package/src/providers/oauth/pkce.ts +0 -45
  318. package/src/providers/oauth/registry.ts +0 -39
  319. package/src/providers/oauth/seam.ts +0 -89
  320. package/src/providers/profile-glm53.ts +0 -111
  321. package/src/providers/profile-sonnet5-persona.ts +0 -65
  322. package/src/providers/profile-sonnet5-voice.ts +0 -23
  323. package/src/providers/profiles.ts +0 -156
  324. package/src/providers/provider-config.ts +0 -311
  325. package/src/providers/registry.ts +0 -333
  326. package/src/providers/responses.ts +0 -209
  327. package/src/providers/retry.ts +0 -234
  328. package/src/providers/router.ts +0 -294
  329. package/src/providers/sse.ts +0 -26
  330. package/src/providers/stream-errors.ts +0 -117
  331. package/src/providers/stream.ts +0 -566
  332. package/src/providers/thinking.ts +0 -189
  333. package/src/providers/wire-messages.ts +0 -129
  334. package/src/providers/wire-responses.ts +0 -79
  335. package/src/providers/wire-select.ts +0 -53
  336. package/src/server/http.ts +0 -291
  337. package/src/server/openapi.ts +0 -246
  338. package/src/sextant/card-hits.ts +0 -102
  339. package/src/sextant/card-keys.ts +0 -55
  340. package/src/sextant/context-source.ts +0 -157
  341. package/src/sextant/crew-cards.ts +0 -350
  342. package/src/sextant/draw-agents.ts +0 -273
  343. package/src/sextant/draw-code.ts +0 -388
  344. package/src/sextant/draw-context.ts +0 -222
  345. package/src/sextant/draw-frame.ts +0 -164
  346. package/src/sextant/draw-market.ts +0 -573
  347. package/src/sextant/draw-messages.ts +0 -386
  348. package/src/sextant/draw-pet.ts +0 -230
  349. package/src/sextant/draw-plan.ts +0 -187
  350. package/src/sextant/draw-tabs.ts +0 -85
  351. package/src/sextant/draw-util.ts +0 -65
  352. package/src/sextant/draw-wizard.ts +0 -378
  353. package/src/sextant/engine.ts +0 -230
  354. package/src/sextant/frame-hits.ts +0 -25
  355. package/src/sextant/frame.ts +0 -101
  356. package/src/sextant/git-status.ts +0 -197
  357. package/src/sextant/grid.ts +0 -59
  358. package/src/sextant/input.ts +0 -119
  359. package/src/sextant/keys.ts +0 -521
  360. package/src/sextant/layout.ts +0 -86
  361. package/src/sextant/local-commands.ts +0 -169
  362. package/src/sextant/market-source.ts +0 -287
  363. package/src/sextant/mentions.ts +0 -200
  364. package/src/sextant/message-hits.ts +0 -26
  365. package/src/sextant/model.ts +0 -387
  366. package/src/sextant/overlays.ts +0 -456
  367. package/src/sextant/panel-hits.ts +0 -38
  368. package/src/sextant/pet.ts +0 -399
  369. package/src/sextant/screen.ts +0 -324
  370. package/src/sextant/scroll-hits.ts +0 -66
  371. package/src/sextant/scrollbar.ts +0 -82
  372. package/src/sextant/sextant-bridge.ts +0 -174
  373. package/src/sextant/sextant-cards.ts +0 -142
  374. package/src/sextant/sextant-diff-base.ts +0 -63
  375. package/src/sextant/sextant-files.ts +0 -154
  376. package/src/sextant/sextant-frame-loop.ts +0 -335
  377. package/src/sextant/sextant-renderer.ts +0 -574
  378. package/src/sextant/sextant-repo.ts +0 -140
  379. package/src/sextant/theme.ts +0 -66
  380. package/src/sextant/tool-rows.ts +0 -189
  381. package/src/sextant/types.ts +0 -493
  382. package/src/skills/index.ts +0 -387
  383. package/src/skills/pack.ts +0 -220
  384. package/src/skills/spec.ts +0 -162
  385. package/src/skills/tools.ts +0 -69
  386. package/src/skills/versioned.ts +0 -227
  387. package/src/telemetry/otel-export.ts +0 -122
  388. package/src/telemetry/otel-lanes.ts +0 -89
  389. package/src/telemetry/otel-logs.ts +0 -131
  390. package/src/telemetry/otel-metrics.ts +0 -136
  391. package/src/telemetry/otel.ts +0 -397
  392. package/src/telemetry/otlp.ts +0 -76
  393. package/src/tools/ask-user.ts +0 -156
  394. package/src/tools/bash-bg.ts +0 -94
  395. package/src/tools/bash-jobs.ts +0 -237
  396. package/src/tools/design.ts +0 -151
  397. package/src/tools/evalcell.ts +0 -338
  398. package/src/tools/html-text.ts +0 -139
  399. package/src/tools/provider.ts +0 -149
  400. package/src/tools/task.ts +0 -250
  401. package/src/tools/todo.ts +0 -320
  402. package/src/tools/webfetch.ts +0 -332
  403. package/src/tools/websearch.ts +0 -359
  404. package/src/tui/agents-cmd.ts +0 -41
  405. package/src/tui/app.ts +0 -749
  406. package/src/tui/attach.ts +0 -127
  407. package/src/tui/boot-notes.ts +0 -41
  408. package/src/tui/builtin-prompts.ts +0 -59
  409. package/src/tui/checkpoints-cmd.ts +0 -70
  410. package/src/tui/clipboard-image.ts +0 -81
  411. package/src/tui/clipboard.ts +0 -78
  412. package/src/tui/commands.ts +0 -283
  413. package/src/tui/config-view.ts +0 -53
  414. package/src/tui/context-cmds.ts +0 -282
  415. package/src/tui/cost.ts +0 -108
  416. package/src/tui/crash-guard.ts +0 -173
  417. package/src/tui/focus-terminal.ts +0 -34
  418. package/src/tui/git-cmds.ts +0 -273
  419. package/src/tui/git-plain.ts +0 -58
  420. package/src/tui/info-cmd.ts +0 -150
  421. package/src/tui/input-plain.ts +0 -76
  422. package/src/tui/mcp-cmd.ts +0 -128
  423. package/src/tui/memory-note.ts +0 -77
  424. package/src/tui/modes-cmd.ts +0 -45
  425. package/src/tui/notify-seq.ts +0 -100
  426. package/src/tui/notify.ts +0 -318
  427. package/src/tui/overlays.ts +0 -97
  428. package/src/tui/pi-renderer.ts +0 -428
  429. package/src/tui/providers-cmd.ts +0 -377
  430. package/src/tui/reasoning-view.ts +0 -56
  431. package/src/tui/renderer.ts +0 -128
  432. package/src/tui/replay-marker.ts +0 -29
  433. package/src/tui/session-cmd.ts +0 -148
  434. package/src/tui/session-manage.ts +0 -95
  435. package/src/tui/sextant-attach.ts +0 -102
  436. package/src/tui/sextant-io.ts +0 -202
  437. package/src/tui/sextant-smoke.ts +0 -110
  438. package/src/tui/shell-cmd.ts +0 -158
  439. package/src/tui/smoke.ts +0 -72
  440. package/src/tui/staged-terminal.ts +0 -50
  441. package/src/tui/startup.ts +0 -12
  442. package/src/tui/theme.ts +0 -59
  443. package/src/tui/todo-label.ts +0 -7
  444. package/src/tui/trust-card.ts +0 -107
  445. package/src/tui/tui-commands.ts +0 -87
  446. package/tsconfig.json +0 -30
  447. package/vendor/pi-tui/LICENSE +0 -21
  448. package/vendor/pi-tui/PATCHES.md +0 -12
  449. package/vendor/pi-tui/PROVENANCE.md +0 -12
  450. package/vendor/pi-tui/README.upstream.md +0 -854
  451. package/vendor/pi-tui/native/win32/prebuilds/win32-arm64/win32-console-mode.node +0 -0
  452. package/vendor/pi-tui/native/win32/prebuilds/win32-x64/win32-console-mode.node +0 -0
  453. package/vendor/pi-tui/src/alt-screen-search.ts +0 -158
  454. package/vendor/pi-tui/src/autocomplete.ts +0 -827
  455. package/vendor/pi-tui/src/components/alt-screen-flash.ts +0 -52
  456. package/vendor/pi-tui/src/components/box.ts +0 -138
  457. package/vendor/pi-tui/src/components/cancellable-loader.ts +0 -41
  458. package/vendor/pi-tui/src/components/editor.ts +0 -2364
  459. package/vendor/pi-tui/src/components/h-stack.ts +0 -45
  460. package/vendor/pi-tui/src/components/image.ts +0 -128
  461. package/vendor/pi-tui/src/components/input.ts +0 -448
  462. package/vendor/pi-tui/src/components/loader.ts +0 -93
  463. package/vendor/pi-tui/src/components/markdown.ts +0 -1016
  464. package/vendor/pi-tui/src/components/scroll-view.ts +0 -217
  465. package/vendor/pi-tui/src/components/select-list.ts +0 -230
  466. package/vendor/pi-tui/src/components/settings-list.ts +0 -277
  467. package/vendor/pi-tui/src/components/spacer.ts +0 -29
  468. package/vendor/pi-tui/src/components/stack.ts +0 -155
  469. package/vendor/pi-tui/src/components/text.ts +0 -108
  470. package/vendor/pi-tui/src/components/truncated-text.ts +0 -66
  471. package/vendor/pi-tui/src/components/v-stack.ts +0 -34
  472. package/vendor/pi-tui/src/editor-component.ts +0 -75
  473. package/vendor/pi-tui/src/fuzzy.ts +0 -138
  474. package/vendor/pi-tui/src/index.ts +0 -149
  475. package/vendor/pi-tui/src/keybindings.ts +0 -321
  476. package/vendor/pi-tui/src/keys.ts +0 -1402
  477. package/vendor/pi-tui/src/kill-ring.ts +0 -47
  478. package/vendor/pi-tui/src/latex.ts +0 -1381
  479. package/vendor/pi-tui/src/layout-node.ts +0 -52
  480. package/vendor/pi-tui/src/layout.ts +0 -411
  481. package/vendor/pi-tui/src/native-modifiers.ts +0 -60
  482. package/vendor/pi-tui/src/native-module-path.ts +0 -32
  483. package/vendor/pi-tui/src/stdin-buffer.ts +0 -445
  484. package/vendor/pi-tui/src/terminal-colors.ts +0 -74
  485. package/vendor/pi-tui/src/terminal-image.ts +0 -701
  486. package/vendor/pi-tui/src/terminal.ts +0 -554
  487. package/vendor/pi-tui/src/tui-alt-screen.ts +0 -1379
  488. package/vendor/pi-tui/src/tui-main-screen.ts +0 -655
  489. package/vendor/pi-tui/src/tui.ts +0 -1264
  490. package/vendor/pi-tui/src/undo-stack.ts +0 -29
  491. package/vendor/pi-tui/src/utils.ts +0 -1327
  492. package/vendor/pi-tui/src/word-navigation.ts +0 -118
  493. package/vendor/pi-tui/test/test-themes.ts +0 -39
  494. package/vendor/pi-tui/test/virtual-terminal.ts +0 -219
  495. /package/{src/providers → dist/cli}/models-index.json +0 -0
@@ -0,0 +1,11 @@
1
+ // @bun
2
+ import{Ea as a,Fa as r,Ha as o,Ia as Vj,Ja as n,Ka as f,Ma as R,Na as L,Oa as b,Ta as s,Ua as e,Va as t,Ya as P,cb as Yj}from"./main-27y4sm2k.js";import{Lb as q,Nb as Xj}from"./main-73g7eff4.js";import{bd as l,cd as Wj}from"./main-rfth4tbm.js";import{qd as p,rd as i}from"./main-6genrmhs.js";import"./main-zzrfw6cf.js";import"./main-0ab9fc26.js";import"./main-80haw7qk.js";import"./main-6dnk69vp.js";import"./main-w2n1303f.js";import"./main-0mtcdbs7.js";import"./main-pn1w7a7j.js";import"./main-m1kk6fp5.js";import"./main-wsrg79c1.js";import"./main-ck9asesq.js";import"./main-kd488vje.js";import"./main-6b62vkz0.js";import"./main-rdgdw24b.js";import"./main-3pjrb2hd.js";import"./main-351pz3z7.js";import"./main-dfreez27.js";import{tf as g}from"./main-4b3jgy66.js";import"./main-skbp13js.js";import"./main-xvnrabfp.js";import"./main-t4xnd213.js";import"./main-3nf3kgve.js";import"./main-cta9racd.js";import"./main-1dchs7xv.js";import"./main-rg0wn0xf.js";import{qh as u,th as d,uh as Qj}from"./main-y1fqy60y.js";import"./main-2yfck9b5.js";import"./main-kh32yvgk.js";import"./main-kcpbykxz.js";import"./main-z3aayzvq.js";import"./main-0z1w2zsg.js";import"./main-3gjqfh7a.js";import"./main-k2y8a2aw.js";import"./main-875s60s2.js";import"./main-sdmxhtv8.js";import"./main-pknhvrmj.js";import"./main-1k1kw6b5.js";import"./main-90ds1z4e.js";import"./main-9etavkew.js";import"./main-q3vsesf9.js";import"./main-xg704a3c.js";import{rk as S,uk as Fj}from"./main-8kjxbpw4.js";import"./main-gzkmycnv.js";import{hl as c,ol as Hj}from"./main-3rxcvgna.js";import"./main-4wndhjdc.js";import"./main-ggcn7rd7.js";import{_l as x,bm as Gj}from"./main-0904f6ps.js";import"./main-prxxs70n.js";import"./main-n0t3973w.js";import"./main-2zmzgkwh.js";import"./main-a9njrkk1.js";import"./main-7rn6bqje.js";import"./main-mv40pcr2.js";import"./main-2yeveeve.js";import"./main-0jys2ccn.js";import"./main-nqveez48.js";import"./main-qsevpgsv.js";Hj();import Dj from"readline";Fj();Qj();Gj();Vj();function Kj(X,j){let z=(Y)=>Y.replace(/\n/g," \u23CE ");return{start(Y){},stop(){},setCommands(){},addUser(Y){j(Y)},addSystemNote(Y,K="info"){j(` ${K==="info"?"":`${K}: `}${Y}`)},beginAssistant(){return{append(){},done(){}}},toolStart(Y,K,J){j(`
3
+ \u2192 ${K} ${J}`)},toolUpdate(){},toolEnd(Y,K,J){j(` \u2190 ${K?"ok":"FAIL"} ${z(J)}`)},async askApproval(Y,K,J){if(j(`
4
+ approval needed: ${Y} ${K}`),J)for(let G of J.split(`
5
+ `))j(` ${G}`);let V=await X(" allow? [y]es / [n]o: ");return V==="y"||V==="yes"?"once":"deny"},async askQuestion(){return null},async pickOne(){return null},clearTranscript(){},prefillEditor(Y){j(` resubmit with: ${z(Y)}`)},setBusy(Y,K){},setStatus(Y){}}}async function k(X,j){let Y={renderer:Kj(X.ask,X.out??console.log),rt:X.rt,store:()=>X.rt.store,approve:()=>X.approve,yolo:()=>X.yolo,busy:X.busy??(()=>!1),setBusy(){},bindAbort:X.bindAbort??(()=>{})},K=j.trim();if(K==="/undo")await b(Y);else if(K==="/commit"||K.startsWith("/commit "))await L(Y,K.slice(7))}Wj();R();Xj();Yj();R();import{existsSync as Zj}from"fs";import{resolve as $j}from"path";var Bj=" allow? [y]es / [a]lways / [n]o: ",_=String.fromCharCode(10);async function E(X,j,z,Y,K=console.log){if(K(`${_} approval needed: ${j} ${z}`),Y)for(let V of Y.split(_))K(` ${V}`);let J=await X(Bj);return J==="a"?"always":J==="n"||J===""?"deny":"once"}function v(X,j){return{start(){},stop(){},setCommands(){},addUser(){},addSystemNote(z,Y="info"){j(` ${Y==="info"?"":`${Y}: `}${z}`)},beginAssistant(){return{append(){},done(){}}},toolStart(z,Y,K){j(`${_} \u2192 ${Y} ${K}`)},toolUpdate(){},toolEnd(z,Y,K){j(` \u2190 ${Y?"ok":"FAIL"} ${K.split(_).join(" \u23CE ")}`)},askApproval:(z,Y,K)=>E(X,z,Y,K,j),async askQuestion(){return null},async pickOne(){return null},clearTranscript(){},prefillEditor(){},setBusy(){},setStatus(){}}}async function h(X,j){let z=X.out??console.log,Y={renderer:v(X.ask,z),rt:X.rt,store:()=>X.rt.store,level:()=>X.yolo()?"auto":"ask",approve:()=>X.yolo()?void 0:(K)=>E(X.ask,K.tool,JSON.stringify(K.revisedArgs).slice(0,140),void 0,z),busy:()=>X.busy(),setBusy(){},bindAbort:(K)=>X.bindAbort(K)};await f(Y,j)}function m(X,j){let z=v(X.ask,X.out??console.log),Y={renderer:z,cwd:X.rt.cwd,store:()=>X.rt.store,modelRef:()=>X.modelRef()},K=q(j,{cwd:X.rt.cwd,roots:X.rt.roots.dirs,resolve:(J)=>Zj($j(X.rt.cwd,J))?J:null,attachImage:(J)=>P(Y,J)});for(let J of K.notes)z.addSystemNote(J,J.includes(": attached as an image (")?"info":"warn");if(K.attached.length>0)z.addSystemNote(`attached: ${K.attached.map((J)=>`${J.path} (${J.shown} lines${J.capped?", capped":""})`).join(" \xB7 ")}`);return K.text}function I(X,j,z){if(z?.aborted)return Promise.resolve("");return new Promise((Y)=>{let K=()=>{Y("")};z?.addEventListener("abort",K,{once:!0}),X.question(j,{signal:z},(J)=>{z?.removeEventListener("abort",K),Y(J.trim().toLowerCase())})})}function Uj(X,j=console.log){return(z,Y)=>new Promise((K)=>{let J=z.options??[],V=z.allowFreeText!==!1;j(`
6
+ question: ${z.question}`),J.forEach((D,H)=>j(` ${H+1}) ${D}`));let G=[J.length>0?`1-${J.length}`:"",V?"text":""].filter(Boolean).join(" or "),Q=()=>{K(null)};Y.addEventListener("abort",Q,{once:!0}),X.question(` answer [${G}; empty = decline]: `,{signal:Y},(D)=>{Y.removeEventListener("abort",Q);let H=D.trim(),W=Number(H);if(H==="")K(null);else if(Number.isInteger(W)&&W>=1&&W<=J.length)K({choice:W-1,label:J[W-1]});else if(V)K({text:H});else j(" (not one of the options \u2014 declined)"),K(null)})})}async function mj(X={}){let j=await i(X.addDirs!==void 0&&X.addDirs.length>0?{addDirs:X.addDirs}:{}).catch((F)=>{if(F instanceof u||F instanceof x)console.error(`error: ${F.message}`),process.exit(2);throw F}),z={yolo:X.yolo??process.env.ROVECODE_YOLO==="1",provider:"mock",model:X.model??process.env.ROVECODE_MODEL??"",turns:0,tokensIn:0,tokensOut:0},Y=j.stream??void 0,K=()=>{let F=j.providers.defaultRef();if(F!==null)z.provider=F.provider,z.model=z.model||F.model||"gpt-4o-mini"};if(K(),z.provider==="mock")console.log(p);j.hooks.onWarning((F)=>console.error(`hooks: ${F}`)),console.log(`\u25C6 rovecode here \u2014 plain chat with ${z.provider}/${z.model}`),console.log(`session ${j.sessionId.slice(0,8)} in ${j.cwd}`),console.log(S(z.yolo)),console.log("commands: /exit /new /yolo /model <provider/model> /status /skills /memory [--user] [text] /compact [focus] /copy [n] /init \xB7 #<text> remembers a line"),console.log("input: !cmd runs through the bash tool (same policy + approval, no model turn) \xB7 @path attaches files with read/edit anchors; images ride on the next message");let J=Dj.createInterface({input:process.stdin,output:process.stdout,prompt:"rovecode> "});j.setAskUser(Uj(J));let V=(F)=>E(($)=>I(J,$,G?.ac.signal),F.tool,JSON.stringify(F.revisedArgs).slice(0,140));J.prompt();let G=null,Q=null,D=!1,H=null,W=null,U=null,M=null,O=null,w=()=>Boolean(G||Q||H||W||U||M),T=()=>{if(w())return console.log("finish or interrupt the run first (Ctrl+C)"),!0;return!1},y={rt:j,yolo:()=>z.yolo,busy:w,bindAbort:(F)=>{H=F},ask:(F)=>I(J,F,H?.signal),modelRef:()=>({provider:z.provider,model:z.model})};J.on("SIGINT",()=>{if(Q){Q.abort(),console.log(`
7
+ [interrupted]`);return}if(G)G.ac.abort(),G.gen.return(void 0),console.log(`
8
+ [interrupted]`);else if(H||U)(H??U).abort(),console.log(`${String.fromCharCode(10)} [interrupted]`);else J.close()}),J.on("line",async(F)=>{let $=F.trim();if(!$){J.prompt();return}if(n($)!==null){if(!T()){W=h(y,$);try{await W}catch(Z){console.log(`error: ${Z instanceof Error?Z.message:String(Z)}`)}finally{W=null}}if(!D)J.prompt();return}if($==="/exit"||$==="/quit"){J.close();return}if(($==="/new"||$==="/compact"||$.startsWith("/compact ")||$==="/commit"||$.startsWith("/commit ")||$==="/undo")&&T()){J.prompt();return}if($==="/yolo"){z.yolo=!z.yolo,console.log(S(z.yolo)),J.prompt();return}if($==="/status"){console.log(`provider=${z.provider} model=${z.model} turns=${z.turns} tokens=${z.tokensIn}in/${z.tokensOut}out
9
+ sandbox: ${d(j.sandbox)}`),J.prompt();return}if($==="/skills"){for(let Z of j.skillStore.list())console.log(` ${Z.name.padEnd(20)} ${Z.description}`);J.prompt();return}if($==="/memory"||$.startsWith("/memory ")){console.log(o(j.blockStore,$.slice(7)).text),J.prompt();return}{let Z=a($);if(Z!==null){console.log(r(j.blockStore,"memory",Z).text),J.prompt();return}}if($.startsWith("/model ")){let Z=j.providers.resolveSelector($.slice(7),z.provider);if("error"in Z)console.log(Z.error);else z.provider=Z.provider,z.model=Z.model,console.log(`model \u2192 ${Z.provider}/${Z.model}`);J.prompt();return}if($==="/new"){j.store.branch(j.store.messages()[0]?.id??""),console.log("branched to session start"),J.prompt();return}if($==="/undo"||$==="/commit"||$.startsWith("/commit ")){U=new AbortController,M=k({rt:j,yolo:z.yolo,approve:z.yolo?void 0:V,ask:(Z)=>I(J,Z,U?.signal),busy:()=>Boolean(G||Q||H||W),bindAbort:(Z)=>{U=Z},out:(Z)=>console.log(Z)},$);try{await M}catch(Z){console.log(`error: ${Z instanceof Error?Z.message:String(Z)}`)}finally{M=null,U=null}if(!D)J.prompt();return}if($==="/compact"||$.startsWith("/compact ")){if(G||Q){console.log("finish or interrupt the run first (Ctrl+C)"),J.prompt();return}let Z=$.slice(8).trim();Q=new AbortController,O=s(j.store,j.buildCfg(z.yolo,V),{model:{provider:z.provider,model:z.model},signal:Q.signal}).then((B)=>{for(let Jj of e(B,Z))console.log(Jj)});try{await O}catch(B){console.log(`compaction failed: ${B instanceof Error?B.message:String(B)} \u2014 the session is unchanged`)}finally{Q=null,O=null}if(!D)J.prompt();return}if($==="/copy"||$.startsWith("/copy ")){let Z=$.slice(5).trim(),B=Z===""?1:/^[1-9]\d*$/.test(Z)?Number(Z):NaN;console.log(Number.isNaN(B)?"usage: /copy [n] \u2014 copies the last assistant message; n counts back from the latest":(await t(j.store.messages(),B)).text),J.prompt();return}if(T()){J.prompt();return}let A=j.noProviderReason();if(!Y||A!==null){console.log(A??"no provider stream"),J.prompt();return}if(z.provider==="mock")K();let jj=m(y,l($,j.cwd)??$),zj=j.buildDef({provider:z.provider,model:z.model}),C=new AbortController;j.tasks.bindRun(C.signal);let N=c(zj,jj,{},j.buildCfg(z.yolo,V),{stream:Y,registry:j.registry,store:j.store,tools:j.registry.list().map((Z)=>Z.schema),guard:j.guard,planReminder:j.planReminder,cwd:j.cwd,signal:C.signal,hooks:j.hooks},j.steering);G={ac:C,gen:N};try{let Z="";for await(let B of N){if(B.type==="turn_start")g(),z.turns++;if(B.type==="message_update")process.stdout.write(B.delta),Z+=B.delta;if(B.type==="tool_execution_start")console.log(`
10
+ \u2192 ${B.tool} ${JSON.stringify(B.args).slice(0,120)}`);if(B.type==="tool_execution_end")console.log(` \u2190 ${B.ok?"ok":"FAIL"} ${B.output.slice(0,160).replace(/\n/g," \u23CE ")}`);if(B.type==="run_end"){if(!Z.trim())console.log(B.summary);else console.log();if(B.status!=="done")console.log(` [${B.status}]`)}}for(let B of j.drainRouterNotes())console.log(` [${B}]`);for(let B of j.store.messages())if(B.usage)z.tokensIn+=B.usage.input,z.tokensOut+=B.usage.output}catch(Z){console.log(`error: ${Z instanceof Error?Z.message:String(Z)}`)}finally{G=null}J.prompt()}),J.on("close",async()=>{if(D=!0,G)G.ac.abort(),await G.gen.return(void 0).catch(()=>{});H?.abort(),U?.abort(),Q?.abort(),await Promise.all([W,M,O].map((F)=>F?.catch(()=>{}))),j.tasks.cancelAll(),await j.tasks.drain(2000),j.bashJobs.dispose(),await j.hooks.close().catch(()=>{}),j.mcp?.close().catch(()=>{}),console.log(`
11
+ bye \u2014 session ${j.sessionId.slice(0,8)} saved (${z.turns} turns, ${z.tokensIn}in/${z.tokensOut}out tokens)`),process.exit(0)})}export{mj as runRepl,Uj as readlineAsker};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{v as J}from"./main-z2ex2vyf.js";import"./main-1ereejm1.js";import"./main-m1kk6fp5.js";import{Kl as F,Ml as K}from"./main-4wndhjdc.js";import"./main-qsevpgsv.js";K();function L(k){let j=k.indexOf("--resume"),q=j!==-1?k[j+1]:void 0,y=q!==void 0&&!q.startsWith("-")?q:void 0;return{...y!==void 0?{id:y}:{},newest:y===void 0&&(j!==-1||k.includes("--continue"))}}var M="nothing to continue from \u2014 this is a new session";function P(k,j,q){let y=L(k);if(y.id!==void 0)return{id:J("--resume",j,y.id,q)};if(!y.newest)return{};let z=F(j);return z?{id:z.id}:{note:M}}function W(k,j,q){return P(k,j,q).id}export{W as resolveResume,P as resolveBoot,L as parseResume,M as NOTHING_TO_CONTINUE};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{vh as a,wh as b,xh as c}from"./main-5tbz0wbz.js";import"./main-0904f6ps.js";import"./main-qsevpgsv.js";export{c as parseAddDirs,b as ADD_DIR_USAGE,a as ADD_DIR_FLAG};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{od as a,pd as b,qd as c,rd as d}from"./main-6genrmhs.js";import"./main-zzrfw6cf.js";import"./main-0ab9fc26.js";import"./main-80haw7qk.js";import"./main-6dnk69vp.js";import"./main-w2n1303f.js";import"./main-0mtcdbs7.js";import"./main-pn1w7a7j.js";import"./main-m1kk6fp5.js";import"./main-wsrg79c1.js";import"./main-ck9asesq.js";import"./main-kd488vje.js";import"./main-6b62vkz0.js";import"./main-rdgdw24b.js";import"./main-3pjrb2hd.js";import"./main-351pz3z7.js";import"./main-dfreez27.js";import"./main-4b3jgy66.js";import"./main-skbp13js.js";import"./main-xvnrabfp.js";import"./main-t4xnd213.js";import"./main-3nf3kgve.js";import"./main-cta9racd.js";import"./main-1dchs7xv.js";import"./main-rg0wn0xf.js";import"./main-y1fqy60y.js";import"./main-2yfck9b5.js";import"./main-kh32yvgk.js";import"./main-kcpbykxz.js";import"./main-z3aayzvq.js";import"./main-0z1w2zsg.js";import"./main-3gjqfh7a.js";import"./main-k2y8a2aw.js";import"./main-875s60s2.js";import"./main-sdmxhtv8.js";import"./main-pknhvrmj.js";import"./main-1k1kw6b5.js";import"./main-90ds1z4e.js";import"./main-9etavkew.js";import"./main-q3vsesf9.js";import"./main-xg704a3c.js";import"./main-8kjxbpw4.js";import"./main-gzkmycnv.js";import"./main-3rxcvgna.js";import"./main-4wndhjdc.js";import"./main-ggcn7rd7.js";import"./main-0904f6ps.js";import"./main-prxxs70n.js";import"./main-n0t3973w.js";import"./main-2zmzgkwh.js";import"./main-a9njrkk1.js";import"./main-7rn6bqje.js";import"./main-mv40pcr2.js";import"./main-2yeveeve.js";import"./main-0jys2ccn.js";import"./main-nqveez48.js";import"./main-qsevpgsv.js";export{b as createRuntime,d as bootRuntime,c as NO_PROVIDER_HINT,a as MAX_OUTPUT_CAP};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{nh as a,oh as b,ph as c,qh as d,rh as e,sh as f,th as g,uh as h}from"./main-y1fqy60y.js";import"./main-3gjqfh7a.js";import"./main-2yeveeve.js";import"./main-0jys2ccn.js";import"./main-nqveez48.js";import"./main-qsevpgsv.js";h();export{f as unavailableRungError,e as loadSandboxConfig,g as describeSandbox,d as SandboxConfigError,c as SANDBOX_IMAGE_ENV,a as SANDBOX_FILE,b as SANDBOX_ENV};
@@ -0,0 +1,5 @@
1
+ // @bun
2
+ import{rd as _}from"./main-6genrmhs.js";import"./main-zzrfw6cf.js";import"./main-0ab9fc26.js";import"./main-80haw7qk.js";import"./main-6dnk69vp.js";import"./main-w2n1303f.js";import"./main-0mtcdbs7.js";import"./main-pn1w7a7j.js";import"./main-m1kk6fp5.js";import"./main-wsrg79c1.js";import"./main-ck9asesq.js";import"./main-kd488vje.js";import"./main-6b62vkz0.js";import"./main-rdgdw24b.js";import"./main-3pjrb2hd.js";import"./main-351pz3z7.js";import"./main-dfreez27.js";import"./main-4b3jgy66.js";import"./main-skbp13js.js";import"./main-xvnrabfp.js";import"./main-t4xnd213.js";import"./main-3nf3kgve.js";import"./main-cta9racd.js";import"./main-1dchs7xv.js";import"./main-rg0wn0xf.js";import{qh as T,uh as q}from"./main-y1fqy60y.js";import"./main-2yfck9b5.js";import"./main-kh32yvgk.js";import"./main-kcpbykxz.js";import"./main-z3aayzvq.js";import"./main-0z1w2zsg.js";import"./main-3gjqfh7a.js";import"./main-k2y8a2aw.js";import"./main-875s60s2.js";import"./main-sdmxhtv8.js";import"./main-pknhvrmj.js";import"./main-1k1kw6b5.js";import"./main-90ds1z4e.js";import"./main-9etavkew.js";import"./main-q3vsesf9.js";import"./main-xg704a3c.js";import{lk as W,uk as k}from"./main-8kjxbpw4.js";import"./main-gzkmycnv.js";import{hl as N,ol as C}from"./main-3rxcvgna.js";import{Bl as E,tl as h,ul as w}from"./main-4wndhjdc.js";import"./main-ggcn7rd7.js";import"./main-0904f6ps.js";import"./main-prxxs70n.js";import"./main-n0t3973w.js";import"./main-2zmzgkwh.js";import"./main-a9njrkk1.js";import"./main-7rn6bqje.js";import"./main-mv40pcr2.js";import"./main-2yeveeve.js";import"./main-0jys2ccn.js";import"./main-nqveez48.js";import"./main-qsevpgsv.js";k();C();import{AgentSideConnection as R,RequestError as $,PROTOCOL_VERSION as u,ndJsonStream as b}from"@zed-industries/agent-client-protocol";import{basename as d}from"path";import{Readable as l,Writable as c}from"stream";E();q();function L(y){let j=[],G=[],U;for(let Q of y)if(Q.type==="text")j.push(Q.text);else if(Q.type==="resource_link")j.push(`[resource: ${Q.uri}]`);else if(Q.type==="resource"&&"text"in Q.resource)j.push(`<context uri="${Q.resource.uri}">
3
+ ${Q.resource.text}
4
+ </context>`);else if(Q.type==="image"){let Y=Q.uri&&!Q.uri.startsWith("data:")?d(Q.uri):void 0,z=h(Q.data,Q.mimeType,Y!==void 0?{name:Y}:{});if("error"in z)U??=z.error;else G.push(z)}else j.push(`[unsupported ${Q.type} content omitted]`);U??=w(G.length);let X=j.join(`
5
+ `);return U===void 0?{goal:X,images:G}:{goal:X,images:G,error:U}}function jj(y){return L(y).goal}var m={read:"read",edit:"edit",write:"edit",bash:"execute",skill_view:"read",skills_list:"search",mcp_list:"search",mcp_call:"other",memory_edit:"other",web_fetch:"fetch"};function S(y){return m[y]??"other"}function f(y,j){if(j&&typeof j==="object"){let G=j,U=G.path??G.command??G.name??G.url;if(U!==void 0)return`${y}: ${String(U).slice(0,120)}`}return y}function A(y){if(y&&typeof y==="object"&&!Array.isArray(y))return y;return y===void 0?{}:{value:y}}function J(y){return[{type:"content",content:{type:"text",text:y}}]}function p(y){switch(y.type){case"message_update":return{sessionUpdate:"agent_message_chunk",content:{type:"text",text:y.delta}};case"tool_execution_start":return{sessionUpdate:"tool_call",toolCallId:y.callId,title:f(y.tool,y.args),kind:S(y.tool),status:"in_progress",rawInput:A(y.args)};case"tool_execution_update":return{sessionUpdate:"tool_call_update",toolCallId:y.callId,content:J(y.note)};case"tool_execution_end":return{sessionUpdate:"tool_call_update",toolCallId:y.callId,status:y.ok?"completed":"failed",content:J(y.output),rawOutput:{output:y.output}};case"tool_call_failed":return{sessionUpdate:"tool_call",toolCallId:y.callId,title:`tool call failed (${y.reason})`,kind:"other",status:"failed",content:J(y.detail)};default:return null}}class F{conn;opts;sessions=new Map;constructor(y,j={}){this.conn=y;this.opts=j}async initialize(y){return{protocolVersion:u,agentCapabilities:{loadSession:!1,promptCapabilities:{image:!0,audio:!1,embeddedContext:!0}},authMethods:[]}}async authenticate(y){return{}}async newSession(y){let j;try{j=await _({cwd:y.cwd,stream:this.opts.stream})}catch(U){if(U instanceof T)throw $.invalidParams({cwd:y.cwd,error:U.message});throw U}let G=j.noProviderReason();if(!j.stream||G!==null)throw $.authRequired({details:G??W("cli")});return this.sessions.set(j.sessionId,{rt:j,steering:j.steering,active:null,permSeq:0}),{sessionId:j.sessionId}}async prompt(y){let j=this.sessions.get(y.sessionId);if(!j)throw $.invalidParams({sessionId:y.sessionId,error:"unknown session"});if(j.active)throw $.invalidRequest({error:"a prompt is already running for this session"});let G=j.rt.stream,U=j.rt.noProviderReason();if(!G||U!==null)throw $.authRequired(U!==null?{details:U}:void 0);let{goal:X,images:Q,error:Y}=L(y.prompt);if(Y!==void 0)throw $.invalidParams({error:Y});let z={provider:j.rt.provider?.id??"mock",model:j.rt.defaultModel||"default"},O=j.rt.buildDef(z),x=j.rt.buildCfg(this.opts.yolo??!1,this.approvalFor(y.sessionId,j)),D=new AbortController;j.rt.tasks.bindRun(D.signal);let I={stream:G,registry:j.rt.registry,store:j.rt.store,tools:j.rt.registry.list().map((Z)=>Z.schema),guard:j.rt.guard,hooks:j.rt.hooks,cwd:j.rt.cwd,signal:D.signal};if(Q.length>0)j.rt.store.stageAttachments(Q);let K=N(O,X,{},x,I,j.steering),M=()=>{},P=new Promise((Z)=>{M=()=>Z(null)}),H={gen:K,cancelled:!1,abort:D,onCancel:P,fireCancel:M};j.active=H;let B=null;try{for await(let Z of K){if(H.cancelled)break;if(Z.type==="run_end"){B={status:Z.status,summary:Z.summary};break}let V=p(Z);if(V)await this.conn.sessionUpdate({sessionId:y.sessionId,update:V})}}finally{j.active=null}if(H.cancelled||B===null)return{stopReason:"cancelled"};switch(B.status){case"done":return{stopReason:"end_turn"};case"budget":return{stopReason:"max_turn_requests"};case"stopped":return{stopReason:"cancelled"};case"error":throw $.internalError({details:B.summary})}}async cancel(y){let j=this.sessions.get(y.sessionId)?.active;if(!j)return;j.cancelled=!0,j.abort.abort(),j.fireCancel(),await j.gen.return(void 0).then(()=>{return},()=>{return})}async shutdown(){let y=[];for(let j of this.sessions.values())if(j.rt.tasks.cancelAll(),j.rt.bashJobs.dispose(),y.push(j.rt.hooks.close()),j.rt.mcp)y.push(j.rt.mcp.close().catch(()=>{}));await Promise.all(y)}approvalFor(y,j){return async(G)=>{let U=`perm-${++j.permSeq}`,X;try{let Q=this.conn.requestPermission({sessionId:y,toolCall:{toolCallId:U,title:f(G.tool,G.revisedArgs),kind:S(G.tool),status:"pending",rawInput:A(G.revisedArgs)},options:[{optionId:"allow-once",name:"Allow once",kind:"allow_once"},{optionId:"allow-always",name:"Allow always",kind:"allow_always"},{optionId:"reject-once",name:"Deny",kind:"reject_once"}]});Q.then(()=>{return},()=>{return});let Y=j.active?await Promise.race([Q,j.active.onCancel]):await Q;if(Y===null)return"deny";X=Y.outcome}catch{return"deny"}if(X.outcome!=="selected")return"deny";if(X.optionId==="allow-once")return"once";if(X.optionId==="allow-always")return"always";return"deny"}}}function g(y,j={}){let G;return{conn:new R((X)=>G=new F(X,j),y),agent:G}}function yj(y={}){let j=b(c.toWeb(process.stdout),l.toWeb(process.stdin)),{agent:G}=g(j,y);return new Promise((U)=>{let X=()=>{G.shutdown().then(()=>U(),()=>U())};process.stdin.once("end",X),process.stdin.once("close",X)})}export{p as updateForEvent,f as titleFor,g as serveAcp,yj as runAcpStdio,jj as promptText,L as promptParts,S as kindFor,F as RovecodeAcpAgent};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{u as a,v as b}from"./main-z2ex2vyf.js";import"./main-1ereejm1.js";import"./main-m1kk6fp5.js";import"./main-4wndhjdc.js";import"./main-qsevpgsv.js";export{a as sessionIdArg,b as resolveSessionArg};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Gl as a,Hl as b,Il as c,Jl as d,Kl as e,Ll as f,Ml as g}from"./main-4wndhjdc.js";import"./main-qsevpgsv.js";g();export{c as scanSessions,e as newestSession,d as listSessions,b as entryShape,a as chainHash,f as SessionStore};
@@ -0,0 +1,7 @@
1
+ // @bun
2
+ import{ec as F,hc as U,ic as V,jc as W,kc as Y,lc as _,mc as k}from"./main-1ereejm1.js";import"./main-m1kk6fp5.js";import{El as I,Il as O,Ml as P}from"./main-4wndhjdc.js";import"./main-qsevpgsv.js";P();k();function y(z){let K=F(z),Q=O(K);return{rows:Q.sessions.map((M)=>({id:M.id,created:new Date(M.createdAt).toISOString(),updated:new Date(M.updatedAt).toISOString(),cwd:z,firstPrompt:M.preview,turns:M.turns,entries:M.entryCount,...M.title!==void 0?{title:M.title}:{}})),hollow:Q.hollow.length,root:K}}function S(z){return y(z).rows}function R(z,K){if(z===0)return;return`${z} empty session director${z===1?"y":"ies"} in ${K} \u2014 nothing was ever written to them`}function T(z,K){let{rows:Q,hollow:$,root:M}=z;if(K)return JSON.stringify(Q);let X=R($,M);if(Q.length===0)return[`no sessions in ${M} \u2014 a \`rovecode run\` or a TUI turn starts one`,...X?[X]:[]].join(`
3
+ `);let B=[`sessions in ${M} (newest first; --json for the full rows):`,`${"id".padEnd(36)} ${"created".padEnd(24)} turns first prompt`];for(let x of Q)B.push(`${x.id.padEnd(36)} ${x.created.padEnd(24)} ${String(x.turns).padStart(5)} ${x.title??(x.firstPrompt||"(empty session)")}`);if(X)B.push(X);return B.join(`
4
+ `)}function L(z){let K=z.entryId===""?"title":z.entryId.slice(0,8);return`${z.sessionId.slice(0,8)} ${new Date(z.timestamp).toISOString()} ${K.padEnd(8)} ${z.title!==void 0?`[${z.title}] `:""}${z.preview}`}var j="usage: rovecode sessions [--json] | rename <id|prefix> <title\u2026> | delete <id|prefix> [--yes] | fork <id|prefix> [--json] | search <terms\u2026> [--json]",q=new Set(["rename","delete","fork","search"]),h=(z)=>z.length>1&&z.startsWith("-");function p(z){let K=z.indexOf("sessions");return K===-1?[]:z.slice(K+1).filter((Q)=>!h(Q))}function v(z,K,Q={}){let $=Q.out??((J)=>console.log(J)),M=Q.err??((J)=>process.stderr.write(`${J}
5
+ `)),X=(J)=>{return M(`error: ${J} \u2014 ${j}`),2},B=z.includes("--json"),x=p(z),C=x[0];if(C===void 0)return $(T(y(K),B)),0;if(!q.has(C))return X(`unknown sessions verb "${C}"`);let D=F(K);if(C==="search"){let J=x.slice(1).join(" ").trim();if(J==="")return X("search needs at least one term");let A=_(D,J,10);if(B)$(JSON.stringify(A));else $(A.length===0?`no matches for "${J}" in ${D}`:A.map(L).join(`
6
+ `));return 0}let G=x[1];if(G===void 0)return X(`${C} needs a session id or prefix`);let Z=U(D,G);if(!Z.ok)return X(Z.error);if(C==="rename"){let J=I(x.slice(2).join(" "));if(J===void 0)return X("rename needs a non-empty title");return V(D,Z.id,J),$(`renamed ${Z.id} \u2192 "${J}"`),0}if(C==="fork"){let J;try{J=W(D,Z.summary)}catch(A){return X(A instanceof Error?A.message:String(A))}return $(B?JSON.stringify(J):`${J.id} fork of ${J.from.slice(0,8)} \xB7 "${J.title}"`),0}if(!z.includes("--yes")){if(!(Q.tty??process.stdin.isTTY===!0))return X(`delete ${Z.id.slice(0,8)} needs --yes when stdin is not a terminal`);let A=Z.summary.title??(Z.summary.preview||"(empty session)");if(!(Q.confirm??((N)=>confirm(N)))(`delete session ${Z.id} (${A}, ${Z.summary.entryCount} entries) and its checkpoints?`))return $("delete cancelled \u2014 nothing removed"),0}let{removed:H}=Y(K,D,Z.id);return $(H.length===0?`nothing to remove for ${Z.id}`:H.map((J)=>`removed ${J}`).join(`
7
+ `)),0}export{p as sessionWords,S as sessionRows,y as sessionListing,R as hollowLine,T as formatSessions,L as formatSearchHit,v as cmdSessions,j as SESSIONS_USAGE};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{cm as a,dm as b,em as c,fm as d,gm as e,hm as f,im as g,jm as h,km as i,lm as j,mm as k}from"./main-prxxs70n.js";import"./main-n0t3973w.js";import"./main-2yeveeve.js";import"./main-0jys2ccn.js";import"./main-nqveez48.js";import"./main-qsevpgsv.js";k();export{f as settingsTrustNotes,b as settingsPath,g as saveSetting,h as resolvePermission,i as resolveEffort,c as readSettingsFile,d as loadSettingsScoped,e as loadSettings,j as autoUpdateEnabled,a as COMMAND_KEYS};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{wa as a,xa as b,ya as c,za as d}from"./main-4xcmvxnk.js";import"./main-sdmxhtv8.js";import"./main-8kjxbpw4.js";import"./main-2yeveeve.js";import"./main-0jys2ccn.js";import"./main-qsevpgsv.js";export{d as runSetup,c as askLine,a as SETUP_PICKS,b as SETUP_DONE};
@@ -0,0 +1,5 @@
1
+ // @bun
2
+ import{q as v,r as y,s as C}from"./main-kqxnqjnv.js";import{x as k}from"./main-yn8cd281.js";import"./main-hq51jg8v.js";import"./main-2wwjex5j.js";import"./main-yr0ksc0h.js";import"./main-xy53xf0r.js";import"./main-7c5thhjd.js";import"./main-zc2e8e46.js";import"./main-4xcmvxnk.js";import"./main-wbrdspr2.js";import"./main-27y4sm2k.js";import"./main-73g7eff4.js";import"./main-1ereejm1.js";import"./main-vqak588n.js";import"./main-aecrjq2d.js";import"./main-rfth4tbm.js";import"./main-6genrmhs.js";import"./main-zzrfw6cf.js";import"./main-0ab9fc26.js";import"./main-80haw7qk.js";import"./main-6dnk69vp.js";import"./main-w2n1303f.js";import"./main-0mtcdbs7.js";import"./main-pn1w7a7j.js";import"./main-m1kk6fp5.js";import"./main-wsrg79c1.js";import"./main-ck9asesq.js";import"./main-kd488vje.js";import"./main-6b62vkz0.js";import"./main-rdgdw24b.js";import"./main-3pjrb2hd.js";import"./main-351pz3z7.js";import"./main-dfreez27.js";import"./main-4b3jgy66.js";import"./main-skbp13js.js";import"./main-xvnrabfp.js";import"./main-t4xnd213.js";import"./main-3nf3kgve.js";import"./main-cta9racd.js";import{Rg as P,Sg as g,bh as u}from"./main-1dchs7xv.js";import"./main-rg0wn0xf.js";import"./main-y1fqy60y.js";import"./main-2yfck9b5.js";import"./main-kh32yvgk.js";import"./main-kcpbykxz.js";import"./main-z3aayzvq.js";import"./main-0z1w2zsg.js";import"./main-ddv7j2ag.js";import"./main-3gjqfh7a.js";import{Ji as q,Ki as N,Li as H}from"./main-k2y8a2aw.js";import"./main-875s60s2.js";import"./main-sdmxhtv8.js";import"./main-pknhvrmj.js";import"./main-1k1kw6b5.js";import"./main-90ds1z4e.js";import"./main-9etavkew.js";import"./main-q3vsesf9.js";import"./main-xg704a3c.js";import"./main-8kjxbpw4.js";import"./main-gzkmycnv.js";import"./main-3rxcvgna.js";import"./main-4wndhjdc.js";import"./main-ggcn7rd7.js";import"./main-0904f6ps.js";import"./main-prxxs70n.js";import"./main-n0t3973w.js";import"./main-2zmzgkwh.js";import"./main-a9njrkk1.js";import"./main-7rn6bqje.js";import"./main-mv40pcr2.js";import"./main-2yeveeve.js";import"./main-0jys2ccn.js";import"./main-nqveez48.js";import"./main-qsevpgsv.js";u();import{mkdtempSync as F,rmSync as T}from"fs";import{tmpdir as x}from"os";import{join as j}from"path";y();var $=(J)=>new Promise((X)=>setTimeout(X,J)),B=[/needs your permission\s+write\b/,/needs your permission\s+edit\b/],A=["\x1B[?1049l","\x1B[?25h","\x1B[?1006l","\x1B[?2004l"];async function w(J={}){let X=F(j(x(),"rovecode-sextant-smoke-")),U=new C(J.cols??160,J.rows??44,{COLORTERM:"truecolor"}),Q=new v({io:U,cwd:X,pet:"rovecode"}),I=j(X,"smoke.txt"),S=`smoke-ok
3
+ `,D=q({turns:[H([{id:"t1",tool:"write",args:{path:I,content:`smoke-ok
4
+ `}}]),H([{id:"t2",tool:"edit",args:{path:I,edits:[{tag:g(`smoke-ok
5
+ `),anchorLine:1,anchorHash:P("smoke-ok"),newLines:["smoke-edited"]}]}}]),N("Smoke OK \u2014 the sextant surface rendered a write, an anchored edit and this summary.")]}),K=[],L=k({renderer:Q,stream:D,cwd:X,permission:"ask",exitOnClose:!1,model:"scripted"});U.feed("hello rovecode\r");let b=Date.now()+(J.deadlineMs??15000),Y=[],G="",Z=!1;while(Date.now()<b){if(Q.tick(),G=Q.frameText(),Y.length===B.length&&G.includes("Smoke OK")&&!G.includes("needs your permission")){Z=!0;break}let z=B[Y.length];if(z!==void 0&&z.test(G)&&G.includes("allow"))Y.push(G),U.feed("\r");await $(25)}let M=["\u2500 files \u2500","\u2500 code \u2500","\u2500 messages \u2500","\u2500 plan \u2500","\u2500 usage \u2500","\u2500 rovecode \u2500"],O=(z)=>G.includes(z)||z==="\u2500 code \u2500"&&G.includes("\u2500 diff \u2500"),E=Date.now()+2000;while(Z&&Date.now()<E&&!M.every(O))await $(25),Q.tick(),G=Q.frameText();if(!Z)K.push(`final frame not reached (approval cards seen ${Y.length}/${B.length})`);if(!/~ edit\s+smoke\.txt/.test(G))K.push("no `~ edit smoke.txt` tool row in the messages panel");if(!/\+ write\s+smoke\.txt/.test(G))K.push("no `+ write smoke.txt` tool row in the messages panel");for(let z of M)if(!O(z))K.push(`panel ${z.trim()} missing at ${U.cols}\xD7${U.rows}`);let R=Q.active;U.feed("\x03"),await L;let V=U.output().slice(-400);for(let z of A)if(!V.includes(z))K.push(`the output tail lacks ${JSON.stringify(z)} \u2014 terminal not restored`);if(!R)K.push("the frame interval was not running before quit");if(Q.active)K.push("the frame interval survived quit");await Q.drain().catch(()=>{});for(let z=0;;z++)try{T(X,{recursive:!0,force:!0});break}catch(W){let _=W.code;if(_!=="EBUSY"&&_!=="EPERM"&&_!=="ENOTEMPTY"||z>=20)throw W;await $(25)}return{ok:K.length===0,reasons:K,cardFrame:Y[1]??Y[0]??"(no approval card rendered)",frame:G,tail:V}}async function n(){let J=await w();console.log("\u2500\u2500 sextant: approval card for the anchored edit (160x44) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"),console.log(J.cardFrame),console.log("\u2500\u2500 sextant: final frame (160x44) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"),console.log(J.frame),console.log("\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"),console.log(J.ok?"smoke-tui --sextant: PASS (files \xB7 code \xB7 messages \xB7 plan \xB7 usage \xB7 rovecode + two approval cards through the full pipeline; terminal restored on quit)":`smoke-tui --sextant: FAIL \u2014 ${J.reasons.join("; ")}`),process.exit(J.ok?0:1)}export{w as sextantSmoke,n as runSextantSmoke};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{$e as H,Ye as S,Ze as k,_e as Uq,af as D,bf as T,ef as M,ff as _}from"./main-351pz3z7.js";import{Df as c,Ff as n,Gf as v,Hf as d}from"./main-skbp13js.js";import"./main-2yeveeve.js";import"./main-0jys2ccn.js";import"./main-qsevpgsv.js";_();Uq();import{existsSync as Pq,readFileSync as a,statSync as Nq,writeFileSync as Yq}from"fs";import{basename as Bq,join as F,resolve as R}from"path";_();import{copyFileSync as s,existsSync as u,lstatSync as e,mkdirSync as x,readdirSync as i,readFileSync as r,renameSync as X,rmSync as I,writeFileSync as qq}from"fs";import{basename as Jq,dirname as h,join as B,resolve as Qq}from"path";import{gunzipSync as Wq}from"zlib";var L=2000,K=67108864,b=2*K,Zq=new Set([".git","node_modules"]);class U extends Error{code;constructor(J,Q){super(J);this.code=Q}}function C(J){let Q=[],G=(q,Z)=>{for(let O of i(q,{withFileTypes:!0})){let $=Z===""?O.name:`${Z}/${O.name}`,W=e(B(q,O.name));if(W.isSymbolicLink())throw new U(`symlink refused: ${$}`,1);if(W.isDirectory()){if(!Zq.has(O.name))G(B(q,O.name),$)}else if(W.isFile()&&!D(O.name))Q.push($)}};return G(J,""),Q.sort()}async function g(J,Q){let G={};for(let q of C(J))G[`${Q}/${q}`]=r(B(J,q));return new Bun.Archive(G,{compress:"gzip"}).bytes()}function $q(J){if(J.length===0)return"archive is empty";if(J.length>L)return`archive has ${J.length} entries (max ${L})`;let Q=new Set;for(let q of J){let Z=JSON.stringify(q);if(q.includes("\\"))return`unsafe entry ${Z}: backslash`;if(q.startsWith("/"))return`unsafe entry ${Z}: absolute path`;if(/^[A-Za-z]:/.test(q))return`unsafe entry ${Z}: drive letter`;let O=q.split("/");if(O.some(($)=>$===""))return`unsafe entry ${Z}: empty path segment`;if(O.some(($)=>$===".."||$==="."))return`unsafe entry ${Z}: relative segment`;if(O.length<2)return`entry ${Z} is not inside a top-level directory`;Q.add(O[0])}if(Q.size!==1)return`archive must hold exactly one top-level directory (found ${[...Q].sort().join(", ")})`;let G=[...Q][0];if(!J.includes(`${G}/${H}`))return`top-level directory ${JSON.stringify(G)} has no ${H}`;return null}var Gq={"1":"hard link","2":"symlink","3":"character device","4":"block device","6":"fifo"};function Oq(J){let Q=J;if(J[0]===31&&J[1]===139)try{Q=Wq(J,{maxOutputLength:b})}catch(q){return q.code==="ERR_BUFFER_TOO_LARGE"?`archive inflates past ${b} bytes`:null}let G=(q,Z)=>new TextDecoder().decode(Q.subarray(q,q+Z)).replace(/\0[\s\S]*$/,"");if(G(257,5)!=="ustar")return null;for(let q=0;q+512<=Q.length&&Q[q]!==0;){let Z=parseInt(G(q+124,12).trim()||"0",8);if(!Number.isFinite(Z))return null;let O=Gq[String.fromCharCode(Q[q+156])];if(O!==void 0){let $=G(q+345,155);return`unsafe entry ${JSON.stringify($===""?G(q,100):`${$}/${G(q,100)}`)}: ${O} member`}q+=512+Math.ceil(Z/512)*512}return null}async function zq(J,Q){for(let[G,q]of J){let Z=B(Q,G);x(h(Z),{recursive:!0}),qq(Z,new Uint8Array(await q.arrayBuffer()))}}var w=()=>Math.random().toString(36).slice(2,10);function p(J){x(J,{recursive:!0});let Q=B(J,`.install-${w()}`);return x(Q),Q}function j(J){for(let Q=1;;Q++)try{I(J,{recursive:!0,force:!0});return}catch(G){if(Q>=5)throw G;Bun.sleepSync(40*Q)}}function y(J,Q,G={}){let q=Qq(J);if(!u(B(q,H)))throw new U(`${q} has no ${H}`,2);let Z=C(q),O=p(Q);try{let $=B(O,Jq(q)),W=G.copyFile??s;for(let P of Z){let z=B($,P);x(h(z),{recursive:!0}),W(B(q,P),z)}return f(O,Q,G)}catch($){throw j(O),$}}async function A(J,Q,G={}){if(J.length>K)throw new U(`archive is ${J.length} bytes (max ${K})`,2);let q;try{q=await new Bun.Archive(J).files()}catch(W){throw new U(`not a tar.gz archive: ${W instanceof Error?W.message:String(W)}`,2)}let Z=$q([...q.keys()])??Oq(J);if(Z!==null)throw new U(Z,2);let O=0;for(let W of q.values())O+=W.size;if(O>K)throw new U(`archive unpacks to ${O} bytes (max ${K})`,2);let $=p(Q);try{return await zq(q,$),f($,Q,G)}catch(W){throw j($),W}}function f(J,Q,G){let q=new M(Q,{projectDir:J,globalDir:null}).scan();if(q.invalid.length>0)throw new U(`staged skill is invalid: ${q.invalid.map((W)=>W.reason).join("; ")}`,2);if(q.skills.length!==1)throw new U(`expected exactly one skill, found ${q.skills.length}`,2);let Z=q.skills[0];if(!/^[^/\\]+$/.test(Z.name)||Z.name==="."||Z.name===".."||Z.name.startsWith("."))throw new U(`refusing skill name ${JSON.stringify(Z.name)}`,2);let O=B(Q,Z.name),$=q.warnings.map((W)=>W.reason);if(u(O)){if(!G.force)throw new U(`${O} already exists (use --force to replace it)`,1);let W=B(Q,`.old-${w()}`);X(O,W);try{G.onSwap?.(),X(Z.dir,O)}catch(P){throw I(O,{recursive:!0,force:!0}),X(W,O),P}j(W)}else X(Z.dir,O);return j(J),{name:Z.name,version:Z.version,path:O,warnings:$}}var Hq={out:(J)=>console.log(J),err:(J)=>console.error(J)},Kq="usage: rovecode skills list [--json] | rovecode skills validate <dir> | rovecode skills pack <dir> [--out <file>] [--force] | rovecode skills install <dir|file.tar.gz|http(s)-url> [--user] [--force]",E=60000,m=5,Vq=new Set([301,302,303,307,308]),Xq=/^([a-z][a-z0-9+.-]*):\/\//i;async function gq(J,Q,G={}){let q=G.io??Hq,Z=J[0]??"",O=J.slice(1),$=new Set(O.filter((N)=>N.startsWith("--"))),W=O.indexOf("--out"),P=W!==-1?O[W+1]:void 0,z=O.filter((N,Y)=>!N.startsWith("--")&&O[Y-1]!=="--out"),V=G.globalDir??T(Q,"global");try{if(Z==="list")return xq(Q,V,$.has("--json"),q);if(Z==="validate"&&z[0]!==void 0)return jq(R(Q,z[0]),q);if(Z==="pack"&&z[0]!==void 0)return await Mq(R(Q,z[0]),P!==void 0?R(Q,P):void 0,$.has("--force"),Q,q);if(Z==="install"&&z[0]!==void 0){let N=$.has("--user")?V:T(Q,"project");return await Rq(z[0],Q,N,$.has("--force"),G.fetch??((Y,l)=>fetch(Y,l)),G.resolve??c,q)}}catch(N){return q.err(`error: ${N instanceof Error?N.message:String(N)}`),N instanceof U?N.code:2}return q.err(Kq),1}function xq(J,Q,G,q){let Z=new M(J,{globalDir:Q}).scan(),O=new Map;for(let W of Z.warnings)O.set(W.path,[...O.get(W.path)??[],W.reason]);let $=Z.skills.map((W)=>({name:W.name,version:W.version,scope:W.scope,path:W.path,dir:W.dir,description:W.fullDescription,license:W.license,compatibility:W.compatibility,metadata:W.metadata,allowedTools:W.allowedTools,warnings:O.get(W.path)??[]}));if(G)return q.out(JSON.stringify({skills:$,invalid:Z.invalid},null,2)),0;if($.length===0&&Z.invalid.length===0)return q.out(`no skills installed (${T(J,"project")} or ${Q}) \u2014 rovecode skills install <dir|file.tar.gz|url>`),0;for(let W of $)q.out(`${W.name.padEnd(24)} ${(W.version||"-").padEnd(10)} ${W.scope.padEnd(8)} ${W.path}`);for(let W of $)for(let P of W.warnings)q.err(`warning: ${W.path}: ${P}`);for(let W of Z.invalid)q.err(`warning: ${W.path}: not loaded \u2014 ${W.reason}`);return 0}function t(J){let Q=F(J,H),G;try{G=a(Q,"utf8")}catch(Z){throw new U(`cannot read ${Q}: ${Z instanceof Error?Z.message:String(Z)}`,2)}let q=S(G);if(q===null)throw new U(`${Q}: missing or unterminated frontmatter block`,1);return k(q,Bq(J),"strict")}function o(J,Q,G){for(let q of J.errors)G.err(`${F(Q,H)}: ${q}`);for(let q of J.notes)G.out(`note: ${q}`);return J.errors.length===0}function jq(J,Q){let G=t(J);if(!o(G,J,Q))return 1;return Q.out(`ok: ${G.meta.name}${G.meta.version?` (v${G.meta.version})`:""} \u2014 ${F(J,H)}`),0}async function Mq(J,Q,G,q,Z){let O=t(J);if(!o(O,J,Z))return 1;let $=Q??F(q,`${O.meta.name}.tar.gz`);if(Pq($)&&!G)return Z.err(`error: ${$} already exists (use --force to overwrite)`),1;let W=await g(J,O.meta.name);return Yq($,W),Z.out(`packed ${O.meta.name} \u2192 ${$} (${W.length} bytes)`),0}async function Rq(J,Q,G,q,Z,O,$){let W=Xq.exec(J)?.[1]?.toLowerCase(),P;if(W!==void 0){if(W!=="http"&&W!=="https")throw new U(`only http(s) URLs can be installed (got ${W}:)`,1);P=await A(await Tq(J,Z,O),G,{force:q})}else{let z=R(Q,J),V;try{V=Nq(z).isDirectory()}catch{throw new U(`${z}: no such file or directory`,2)}P=V?y(z,G,{force:q}):await A(a(z),G,{force:q})}$.out(`installed ${P.name}${P.version?` (v${P.version})`:""} \u2192 ${P.path}`);for(let z of P.warnings)$.err(`warning: ${z}`);return 0}async function Tq(J,Q,G){let q=new AbortController,Z=setTimeout(()=>q.abort(),E);Z.ref?.();let O=($)=>new U(`download failed: ${q.signal.aborted?`timed out after ${E}ms`:$ instanceof Error?$.message:String($)}`,2);try{let $=new URL(J),W=0;for(;;){if($.protocol!=="http:"&&$.protocol!=="https:")throw new U(`only http(s) URLs can be installed (got ${$.protocol})`,1);let P;try{P=await v(n($.hostname,G),q.signal)}catch(Y){throw O(Y)}if(P!==null)throw new U(`refused ${$.href}: ${P}`,1);let z;try{z=await v(Q($.href,{signal:q.signal,redirect:"manual"}),q.signal)}catch(Y){throw O(Y)}if(Vq.has(z.status)){let Y=z.headers.get("location");if(await z.body?.cancel().catch(()=>{}),!Y)throw new U(`download failed: HTTP ${z.status} from ${$.href} without a Location header`,2);if(++W>m)throw new U(`download failed: too many redirects (more than ${m}) starting from ${J}`,2);try{$=new URL(Y,$)}catch{throw new U(`download failed: invalid redirect target ${Y}`,2)}continue}if(!z.ok)throw new U(`download failed: HTTP ${z.status} for ${$.href}`,2);let{bytes:V,truncated:N}=await d(z,K);if(N)throw new U(`download exceeds ${K} bytes`,2);return V}}finally{clearTimeout(Z)}}export{gq as cmdSkills,Kq as SKILLS_USAGE,m as MAX_REDIRECTS,E as INSTALL_TIMEOUT_MS};
@@ -0,0 +1,8 @@
1
+ // @bun
2
+ import{x as $}from"./main-yn8cd281.js";import"./main-hq51jg8v.js";import{P as _,R as j}from"./main-2wwjex5j.js";import"./main-yr0ksc0h.js";import"./main-xy53xf0r.js";import"./main-7c5thhjd.js";import"./main-zc2e8e46.js";import"./main-4xcmvxnk.js";import"./main-wbrdspr2.js";import"./main-27y4sm2k.js";import"./main-73g7eff4.js";import"./main-1ereejm1.js";import"./main-vqak588n.js";import"./main-aecrjq2d.js";import"./main-rfth4tbm.js";import"./main-6genrmhs.js";import"./main-zzrfw6cf.js";import"./main-0ab9fc26.js";import"./main-80haw7qk.js";import"./main-6dnk69vp.js";import"./main-w2n1303f.js";import"./main-0mtcdbs7.js";import"./main-pn1w7a7j.js";import"./main-m1kk6fp5.js";import"./main-wsrg79c1.js";import"./main-ck9asesq.js";import"./main-kd488vje.js";import"./main-6b62vkz0.js";import"./main-rdgdw24b.js";import"./main-3pjrb2hd.js";import"./main-351pz3z7.js";import"./main-dfreez27.js";import"./main-4b3jgy66.js";import"./main-skbp13js.js";import"./main-xvnrabfp.js";import"./main-t4xnd213.js";import"./main-3nf3kgve.js";import"./main-cta9racd.js";import{Rg as Y,Sg as Z,bh as g}from"./main-1dchs7xv.js";import"./main-rg0wn0xf.js";import"./main-y1fqy60y.js";import"./main-2yfck9b5.js";import"./main-kh32yvgk.js";import"./main-kcpbykxz.js";import"./main-z3aayzvq.js";import"./main-0z1w2zsg.js";import"./main-ddv7j2ag.js";import"./main-3gjqfh7a.js";import{Ji as O,Ki as Q,Li as L}from"./main-k2y8a2aw.js";import"./main-875s60s2.js";import"./main-sdmxhtv8.js";import"./main-pknhvrmj.js";import"./main-1k1kw6b5.js";import"./main-90ds1z4e.js";import"./main-9etavkew.js";import"./main-q3vsesf9.js";import"./main-xg704a3c.js";import"./main-8kjxbpw4.js";import"./main-gzkmycnv.js";import"./main-3rxcvgna.js";import"./main-4wndhjdc.js";import"./main-ggcn7rd7.js";import"./main-0904f6ps.js";import"./main-prxxs70n.js";import"./main-n0t3973w.js";import"./main-2zmzgkwh.js";import"./main-a9njrkk1.js";import"./main-7rn6bqje.js";import"./main-mv40pcr2.js";import"./main-2yeveeve.js";import"./main-0jys2ccn.js";import"./main-nqveez48.js";import"./main-qsevpgsv.js";import W from"@xterm/headless";var X=W.Terminal;class K{xterm;inputHandler;resizeHandler;_columns;_rows;constructor(q=80,A=24){this._columns=q,this._rows=A,this.xterm=new X({cols:q,rows:A,disableStdin:!0,allowProposedApi:!0})}start(q,A){this.inputHandler=q,this.resizeHandler=A,this.xterm.write("\x1B[?2004h")}async drainInput(q,A){}stop(){this.xterm.write("\x1B[?2004l"),this.inputHandler=void 0,this.resizeHandler=void 0}write(q){this.xterm.write(q)}get columns(){return this._columns}get rows(){return this._rows}get kittyProtocolActive(){return!0}moveBy(q){if(q>0)this.xterm.write(`\x1B[${q}B`);else if(q<0)this.xterm.write(`\x1B[${-q}A`)}hideCursor(){this.xterm.write("\x1B[?25l")}showCursor(){this.xterm.write("\x1B[?25h")}clearLine(){this.xterm.write("\x1B[K")}clearFromCursor(){this.xterm.write("\x1B[J")}clearScreen(){this.xterm.write("\x1B[2J\x1B[H")}setTitle(q){this.xterm.write(`\x1B]0;${q}\x07`)}setProgress(q){}sendInput(q){if(this.inputHandler)this.inputHandler(q)}resize(q,A){if(this._columns=q,this._rows=A,this.xterm.resize(q,A),this.resizeHandler)this.resizeHandler()}async flush(){return new Promise((q)=>{this.xterm.write("",()=>q())})}async flushAndGetViewport(){return await this.flush(),this.getViewport()}getViewport(){let q=[],A=this.xterm.buffer.active;for(let B=0;B<this.xterm.rows;B++){let C=A.getLine(A.viewportY+B);if(C)q.push(C.translateToString(!0));else q.push("")}return q}getScrollBuffer(){let q=[],A=this.xterm.buffer.active;for(let B=0;B<A.length;B++){let C=A.getLine(B);if(C)q.push(C.translateToString(!0));else q.push("")}return q}clear(){this.xterm.clear()}reset(){this.xterm.reset()}getCursorPosition(){let q=this.xterm.buffer.active;return{x:q.cursorX,y:q.cursorY}}async waitForRender(){await new Promise((q)=>process.nextTick(q)),await new Promise((q)=>setTimeout(q,20)),await this.flush()}}j();g();import{mkdtempSync as y,rmSync as z}from"fs";import{tmpdir as I}from"os";import{join as N}from"path";async function u(){let q=y(N(I(),"rovecode-tui-smoke-")),A=new K(80,24),B=new _({terminal:A,cwd:q}),C=N(q,"smoke.txt"),R=`smoke-ok
3
+ `,H=O({turns:[L([{id:"t1",tool:"write",args:{path:C,content:`smoke-ok
4
+ `}}]),L([{id:"t2",tool:"edit",args:{path:C,edits:[{tag:Z(`smoke-ok
5
+ `),anchorLine:1,anchorHash:Y("smoke-ok"),newLines:["smoke-edited"]}]}}]),Q(`# Smoke OK
6
+
7
+ rendered **markdown**, a tool card, and the status line.`)]}),P=$({renderer:B,stream:H,cwd:q,permission:"ask",exitOnClose:!1,model:"scripted"});A.sendInput("hello rovecode"),A.sendInput("\r");let G=["+smoke-ok","-smoke-ok"],E=[],U=Date.now()+1e4,F=[],J=!1;while(Date.now()<U){F=await A.flushAndGetViewport();let D=F.join(`
8
+ `);if(D.includes("Smoke OK")&&D.includes("write")&&E.length===G.length){J=!0;break}let M=G[E.length];if(M!==void 0&&D.includes("allow once")&&D.includes(M))E.push(F),A.sendInput("\r");await new Promise((V)=>setTimeout(V,50))}A.sendInput("\x03"),await P,z(q,{recursive:!0,force:!0}),console.log("\u2500\u2500 approval overlay with diff card (edit) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500");for(let D of E[1]??["(diff card never rendered)"])console.log(D.trimEnd());console.log("\u2500\u2500 emulated 80x24 screen \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500");for(let D of F)console.log(D.trimEnd());console.log("\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"),console.log(J?"smoke-tui: PASS (markdown + tool card + diff card rendered through full pipeline)":`smoke-tui: FAIL (diff cards seen: ${E.length}/${G.length})`),process.exit(J?0:1)}export{u as runTuiSmoke};
@@ -0,0 +1,12 @@
1
+ // @bun
2
+ import{Th as Yq,Uh as o}from"./main-0z1w2zsg.js";import{xn as W}from"./main-qsevpgsv.js";import{join as n}from"path";var A=["\u2591","\u2592","\u2593","\u2588"],O=[["\u2588\u2580\u2588","\u2588\u2580\u2584"],["\u2588\u2580\u2588","\u2588\u2584\u2588"],["\u2588 \u2588","\u2580\u2584\u2580"],["\u2588\u2580\u2580","\u2588\u2584\u2584"],["\u2588\u2580\u2580","\u2588\u2584\u2584"],["\u2588\u2580\u2588","\u2588\u2584\u2588"],["\u2588\u2580\u2584","\u2588\u2584\u2580"],["\u2588\u2580\u2580","\u2588\u2584\u2584"]],C=O.length*4-1;var b=C+8+(C+8)%2;var Gq=[" \u256D\u2500\u256E\u256D\u2500\u2500\u256E\u256D\u2500\u256E "," \u256D\u256F \u2570\u256F \u2570\u256F \u2570\u2500\u256E "," \u256D\u256F \u2570\u256E "," \u2502 \u2502 "," \u2570\u256E \u256D\u256F "," \u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256F "],M={EYE_L:6,EYE_R:12,MOUTH:9,EYE_ROW:3,MOUTH_ROW:4},U=Gq.map((q,J)=>{let G=[...q];if(J===M.EYE_ROW)G[M.EYE_L]="\u2022",G[M.EYE_R]="\u2022";if(J===M.MOUTH_ROW)G[M.MOUTH]="\u25E1";return G.join("")});var Jq=U.length-1,g=O.length+A.length-1,T=Math.ceil(b/2/3),p=U.length,h=[3,2,3],D=g+T+p+h.length;function Qq(q){let J=q-g-T-p,G=J>=0?h[Math.min(J,h.length-1)]:void 0,X=["",""];return O.forEach((j,V)=>{let $=G??Math.max(0,Math.min(A.length-1,q-V)),Y=A[$];for(let y of[0,1])X[y]+=(X[y].length>0?" ":"")+j[y].replaceAll("\u2588",Y)}),X}function a(q){return Math.max(0,Math.min(U.length,q-g-T))}function Vq(q){let J=a(q),G=U.slice(1,Math.max(0,J));return[...G,...Array.from({length:Jq-G.length},()=>"")]}function Xq(q,J){if(a(J)===0||q.length===0)return q;let G=Math.max(0,Math.floor((q.length-18)/2)),X=U[0],j=[...q];return[...X].forEach((V,$)=>{if(V!==" "&&G+$<j.length)j[G+$]=V}),j.join("")}function Zq(q){let J=q-g;if(J<0)return["",""];let G=Math.min(b/2,Math.max(0,J)*3);if(G===0)return["",""];let X="\u2500".repeat(Math.max(0,G-1)),j=Math.max(0,b-G*2),V=($,Y)=>`${$}${X}${" ".repeat(j)}${X}${Y}`;return[V("\u256D","\u256E"),V("\u2570","\u256F")]}var w=7+(U.length-1);function L(q,J){return q>=b+2&&J>=w+2}var u="\x1B[2J\x1B[H",c="\x1B[?25l",$q="\x1B[?25h";function l(q){let J=q.size??(()=>({columns:q.columns??80,rows:q.rows??24})),G=J();if(!q.tty||!L(G.columns,G.rows))return{status:()=>{},animationDone:Promise.resolve(),done:Promise.resolve(),finish:()=>{}};let X=q.setInterval??setInterval,j=q.clearInterval??((Q)=>clearInterval(Q)),V=0,$="",Y=!1,y=!1,x=0,Z=null,z=G,N,f=()=>{},F=new Promise((Q)=>{f=Q}),H=()=>{},I=new Promise((Q)=>{H=Q}),_=()=>$&&y&&!Y?`${$} ${"\xB7".repeat(x+1)}`:$,P=(Q,k)=>{let K=[...Q.replace(/\s+/g," ")].slice(0,Math.max(0,k-2)).join("");return" ".repeat(Math.max(0,Math.floor((k-K.length)/2)))+K},v=()=>{let{columns:Q,rows:k}=z=J();if(!L(Q,k)){q.write(u+c);return}let K=(B)=>" ".repeat(Math.max(0,Math.floor((Q-B)/2))),E=K(C),S=K(b),r=S+" ".repeat(Math.max(0,Math.floor((b-18)/2))),i=`
3
+ `.repeat(Math.max(0,Math.floor((k-w)/2))),[s,e]=Qq(V),[t,qq]=Zq(V),d=(B)=>B.length>0?`${S}${B}`:"";q.write([u,c,i,`${d(Xq(t,V))}
4
+ `,Vq(V).map((B)=>`${B.length>0?r+B:""}
5
+ `).join(""),`
6
+ `,`${E}${s}
7
+ ${E}${e}
8
+ `,`${P(q.version??"",Q)}
9
+ `,`${P(_(),Q)}
10
+ `,`${d(qq)}
11
+ `].join(""))},m=()=>{if(Y)return;let Q=J();if(Q.columns!==z.columns||Q.rows!==z.rows){v();return}if(!L(Q.columns,Q.rows))return;let k=Math.max(0,Math.floor((Q.rows-w)/2))+w-1,K=String.fromCharCode(27);q.write(`${K}[${k};1H${K}[2K${P(_(),Q.columns)}`)},R=()=>{if(Y)return;Y=!0,j(Z),N?.(),V=D,$="",v(),q.write(`${$q}${u}`),H(),f()};return v(),N=q.onResize?.(()=>{if(!Y)v()}),Z=X(()=>{if(Y)return;if(V<D){if(V+=1,v(),V===D)H()}else if(!q.holdUntilReady)R();else j(Z),y=!0,m(),Z=X(()=>{x=(x+1)%3,m()},500)},q.frameMs??Math.round(1100/D)),{status:(Q)=>{if(!Y&&Q!==$)$=Q,m()},animationDone:I,done:F,finish:R}}Yq();async function Hq(q,J=process.argv){if(q.plain){let[{runRepl:Z},{parseAddDirs:z},{resolveBoot:N}]=await Promise.all([import("./repl-bajwe1mh.js"),import("./run-flags-nah7ndpt.js"),import("./resume-rwn9nz7y.js")]);N(J,n(process.cwd(),".rovecode","sessions")),await Z({yolo:q.yolo,addDirs:z(J)});return}let G=l({write:(Z)=>{process.stdout.write(Z)},tty:process.stdout.isTTY===!0&&!J.includes("--no-intro")&&process.env.ROVECODE_INTRO!=="0",version:o.version,holdUntilReady:!0,size:()=>({columns:process.stdout.columns||80,rows:process.stdout.rows||24}),onResize:(Z)=>{return process.stdout.on("resize",Z),()=>{process.stdout.off("resize",Z)}}}),X=new AbortController,j=130,V=()=>{j=130,X.abort(Error("startup interrupted"))},$=()=>{j=143,X.abort(Error("startup terminated"))},Y=()=>{G.finish(),process.off("SIGINT",V),process.off("SIGTERM",$)};process.once("exit",Y),process.once("SIGINT",V),process.once("SIGTERM",$);let y=Number(process.env._ROVECODE_BOOT_T0??-1),x=(Z)=>{if(y>=0)process.stderr.write(`[boot] +${Date.now()-y}ms ${Z}
12
+ `)};try{x("intro started"),G.status("loading modules");let[{runTui:Z},{interactiveRenderer:z},{parseAddDirs:N},{resolveBoot:f}]=await Promise.all([import("./app-j6gn14w3.js"),import("./notify-b7qc0cjb.js"),import("./run-flags-nah7ndpt.js"),import("./resume-rwn9nz7y.js")]);X.signal.throwIfAborted(),x("surface modules loaded"),G.status("opening session");let F=process.cwd(),H=f(J,n(F,".rovecode","sessions")),I=N(J);await Z({yolo:q.yolo,acceptEdits:q.acceptEdits,...q.effort!==void 0?{effort:q.effort}:{},sessionId:H.id,...H.note!==void 0?{bootNote:H.note}:{},renderer:z(q,process.env,process.stdout,process.stdin,F),...q.pet!==void 0?{pet:q.pet}:{},...I.length>0?{addDirs:I}:{},startup:{status:G.status,finish:Y,animationDone:G.animationDone,signal:X.signal}})}catch(Z){if(X.signal.aborted){process.exitCode=j;return}throw Z}finally{Y(),process.off("exit",Y)}}export{Hq as startChat};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Ai as j,Bi as k,Ci as l,Di as m,Ei as n,Fi as o,Gi as p,Hi as q,Ii as r,Ji as s,Ki as t,Li as u,Mi as v,Ni as w,wi as f,xi as g,yi as h,zi as i}from"./main-k2y8a2aw.js";import{Pi as c,Ri as d,Si as e}from"./main-875s60s2.js";import"./main-sdmxhtv8.js";import"./main-pknhvrmj.js";import{mj as a,nj as b}from"./main-1k1kw6b5.js";import"./main-90ds1z4e.js";import"./main-9etavkew.js";import"./main-q3vsesf9.js";import"./main-xg704a3c.js";import"./main-3rxcvgna.js";import"./main-4wndhjdc.js";import"./main-ggcn7rd7.js";import"./main-0904f6ps.js";import"./main-prxxs70n.js";import"./main-n0t3973w.js";import"./main-mv40pcr2.js";import"./main-2yeveeve.js";import"./main-0jys2ccn.js";import"./main-nqveez48.js";import"./main-qsevpgsv.js";export{j as wantsStreaming,u as toolTurn,d as toOpenAiToolSchemas,c as toOpenAiMessages,e as toAnthropicMessages,a as thinkingBudget,t as textTurn,l as shapeKey,k as shapeByModel,v as resolveProvider,i as providerStreaming,h as providerStream,p as openaiCompatStreaming,o as openaiCompatStream,s as mockStream,w as listBuiltinProviders,f as fetchModels,g as clearModelsCache,b as anthropicThinking,q as anthropicStreaming,r as anthropicStream,n as anthropicShapeFor,m as anthropicMaxTokens};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{de as a,ee as b,fe as c,ge as d}from"./main-wsrg79c1.js";import"./main-rdgdw24b.js";import"./main-3pjrb2hd.js";import"./main-dfreez27.js";import"./main-3gjqfh7a.js";import"./main-gzkmycnv.js";import"./main-3rxcvgna.js";import"./main-4wndhjdc.js";import"./main-ggcn7rd7.js";import"./main-0904f6ps.js";import"./main-prxxs70n.js";import"./main-n0t3973w.js";import"./main-mv40pcr2.js";import"./main-2yeveeve.js";import"./main-0jys2ccn.js";import"./main-nqveez48.js";import"./main-qsevpgsv.js";export{c as createTaskTool,d as createTaskStatusTool,b as MAX_WAIT_MS,a as DEFAULT_WAIT_MS};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Ke as a,Le as b,Me as c,Ne as d,Oe as e,Pe as f,Qe as g,Re as h,Se as i,Te as j}from"./main-rdgdw24b.js";import"./main-3pjrb2hd.js";import"./main-dfreez27.js";import"./main-3gjqfh7a.js";import"./main-gzkmycnv.js";import"./main-3rxcvgna.js";import"./main-4wndhjdc.js";import"./main-ggcn7rd7.js";import"./main-0904f6ps.js";import"./main-prxxs70n.js";import"./main-n0t3973w.js";import"./main-mv40pcr2.js";import"./main-2yeveeve.js";import"./main-0jys2ccn.js";import"./main-nqveez48.js";import"./main-qsevpgsv.js";j();export{b as tasksMaxFromEnv,d as taskNote,g as summariseBatch,c as isTerminal,e as formatTaskList,h as batchNote,i as TaskManager,a as DEFAULT_TASKS_MAX,f as BATCH_LABEL_MAX};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{mj as a,nj as b,oj as c,pj as d,qj as e,rj as f,sj as g}from"./main-1k1kw6b5.js";import"./main-90ds1z4e.js";import"./main-2yeveeve.js";import"./main-0jys2ccn.js";import"./main-qsevpgsv.js";export{e as thinkingTable,g as thinkingReport,d as thinkingPlan,f as thinkingLine,a as thinkingBudget,c as dialectFor,b as anthropicThinking};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{cg as a,dg as b,eg as c,fg as d,gg as e,hg as f,ig as g,jg as h,kg as i,lg as j,mg as k,ng as l,og as m,pg as n,qg as o,rg as p,sg as q}from"./main-t4xnd213.js";import"./main-qsevpgsv.js";q();export{g as validateTodos,n as todoWriteTool,p as todoTools,m as todoStatusLabel,o as todoReadTool,j as todoCounts,i as saveTodos,k as renderTodos,l as planReminder,h as loadTodos,a as TODO_STATUSES,b as TODO_PRIORITIES,f as TODOS_FILE,c as MAX_TODOS,d as MAX_ID_CHARS,e as MAX_CONTENT_CHARS};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{tf as a,uf as b,vf as c}from"./main-4b3jgy66.js";import"./main-nqveez48.js";import"./main-qsevpgsv.js";export{b as turnFailures,a as resetTurnFailureCount,c as memoryEditTool};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Nl as a,Ol as b,Pl as c,Ql as d,Rl as e}from"./main-ggcn7rd7.js";import"./main-0904f6ps.js";import"./main-mv40pcr2.js";import"./main-2yeveeve.js";import"./main-0jys2ccn.js";import"./main-nqveez48.js";import"./main-qsevpgsv.js";e();export{b as evaluatePermissions,d as describeResource,c as ToolRegistry,a as ABORTED_TOOL_RESULT};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{ra as O,sa as F,ta as P,ua as Q}from"./main-zc2e8e46.js";import"./main-prxxs70n.js";import"./main-n0t3973w.js";import"./main-7rn6bqje.js";import{$m as Z,Lm as N}from"./main-2yeveeve.js";import"./main-0jys2ccn.js";import"./main-nqveez48.js";import"./main-qsevpgsv.js";Z();var M=["usage: rovecode trust list this repo's gated files with what they would do, then approve them (asks on a TTY)"," rovecode trust --yes approve without asking (after reading `trust show`)"," rovecode trust show list only \u2014 nothing changes"," rovecode trust untrust withdraw the approval; the files contribute nothing again until trusted"," gated: .rovecode/settings.json (verify, lsp, notify_command) \xB7 .rovecode/hooks.ts|js \xB7 .rovecode/sandbox.json \xB7 .rovecode/mcp.json \xB7 .mcp.json"," the store is ~/.rovecode/plugins.json (path \u2192 sha256): any edit to a file asks again"];async function H(I,V=process.cwd(),D={}){let x=D.out??((k)=>console.log(k)),J=D.err??((k)=>console.error(k)),K=D.home??N(),W=I.filter((k)=>!k.startsWith("--")),X=I.includes("--yes"),z=W[0]??"";if(z==="-h"||z==="help"||I.includes("--help")){for(let k of M)x(k);return 0}if(z!==""&&z!=="show"&&z!=="untrust"){J(`unknown trust command "${z}"`);for(let k of M)J(k);return 2}let C=O(V,K);if(z==="show"){for(let k of F(C))x(k);return 0}if(z==="untrust"){for(let k of Q(K,C))x(k);return 0}if(C.length===0){for(let k of F(C))x(k);return 1}for(let k of F(C))x(k);if(!X){if(!(D.tty??process.stdin.isTTY===!0))return J("nothing trusted: no terminal to confirm on \u2014 re-run with --yes after reading the lines above"),1;if(!await(D.confirm??((Y)=>confirm(Y)))("trust these files as they are now? [y/N]"))return x("nothing trusted"),1}for(let k of P(K,C))x(k);return x("restart rovecode to apply \u2014 an edit to any of these files asks again"),0}export{H as cmdTrust,M as TRUST_USAGE};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Yh as a,Zh as b,_h as c}from"./main-ddv7j2ag.js";import"./main-2yeveeve.js";import"./main-0jys2ccn.js";import"./main-qsevpgsv.js";export{c as updateLine,a as isNewer,b as checkForUpdate};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Zh as P,_h as Z}from"./main-ddv7j2ag.js";import"./main-2yeveeve.js";import"./main-0jys2ccn.js";import"./main-qsevpgsv.js";import{existsSync as B}from"fs";import{join as G}from"path";import{existsSync as I}from"fs";import{join as N,sep as X}from"path";var _="/$bunfs/";function $(A){let z=A.entry.replace(/\\/g,"/");if(z.includes(_)||A.exec!==void 0&&A.exec.replace(/\\/g,"/").includes(_))return{mode:"binary"};let D=z.lastIndexOf("/node_modules/");if(D>=0){let E=z.slice(D+14),J=E.split("/"),H=E.startsWith("@")?J.slice(0,2):J.slice(0,1),K=z.slice(0,D)+"/node_modules/"+H.join("/"),Q=A.npmGlobalPrefix?.replace(/\\/g,"/").replace(/\/$/,""),T=Q!==void 0?K.toLowerCase().startsWith((Q+"/node_modules/").toLowerCase()):void 0;return{mode:"npm",root:K,...T!==void 0?{npmGlobal:T}:{}}}for(let E of O(A.entry))if(I(N(E,".git")))return{mode:"source",root:E};return{mode:"unknown"}}function O(A){let z=[],D=A.includes(X)||A.includes("/")?A.replace(/\\/g,"/").split("/").slice(0,-1).join("/"):".";for(let E=0;E<6&&D.length>0;E++){z.push(D.replace(/\//g,X));let J=D.split("/").slice(0,-1).join("/");if(J===D)break;D=J}return z}function Y(A,z){if(z==="beta"||z==="latest")return z;return A.includes("-")?"beta":"latest"}function q(A,z){let D=Y(z.currentVersion,z.channel);switch(A.mode){case"npm":{let E=`rovecode@${D}`;if(A.npmGlobal===!1&&A.root){let J=A.root.replace(/\\/g,"/"),H=J.lastIndexOf("/node_modules/"),K=H>0?J.slice(0,H).replace(/\//g,X):void 0;return{mode:"npm",channel:D,commands:[["npm","install",E]],...K?{cwd:K}:{}}}return{mode:"npm",channel:D,commands:[["npm","install","-g",E]]}}case"source":{let E=[["git","pull","--ff-only"],["bun","install"]];if(z.distBuilt===!0)E.push(["bun","run","build:cli"]);return{mode:"source",channel:D,commands:E,...A.root?{cwd:A.root}:{}}}case"binary":return{mode:"binary",channel:D,commands:[],manual:"a compiled binary does not replace itself yet \u2014 download the new artifact from the releases page (https://github.com/9Code-Labs/rovecode-community/releases) and swap the file"};default:return{mode:"unknown",channel:D,commands:[],manual:"cannot tell how this copy was installed \u2014 update it the way you installed it (npm: `npm install -g rovecode@"+D+"`; source: `git pull && bun install`)"}}}async function M(A,z,D){let E=[];if(A.commands.length===0)return{ok:!1,detail:A.manual??"nothing to run",ran:E};let J=A.commands;if(A.mode==="npm"&&z.npmGlobal===void 0&&z.root&&D.npmGlobalPrefix){let H=(await D.npmGlobalPrefix())?.replace(/\\/g,"/").replace(/\/$/,"");if(H){let K=z.root.replace(/\\/g,"/").toLowerCase().startsWith((H+"/node_modules/").toLowerCase()),Q=A.commands[0][A.commands[0].length-1];J=K?[["npm","install","-g",Q]]:[["npm","install",Q]]}}for(let H of J){D.log?.(`$ ${H.join(" ")}`);let K;try{K=await D.spawn(H,A.cwd)}catch(Q){return{ok:!1,detail:`${H[0]} failed to start: ${Q instanceof Error?Q.message:String(Q)}`,ran:E}}if(E.push(H.join(" ")),K.code!==0)return{ok:!1,detail:`${H.join(" ")} exited ${K.code}: ${V(K.out)}`,ran:E}}return{ok:!0,detail:"updated \u2014 restart rovecode to run the new version",ran:E}}function V(A,z=400){let D=A.trim();return D.length>z?"\u2026"+D.slice(-z):D}var R=process.platform==="win32"?"npm.cmd":"npm";async function L(A,z){let D=A[0]==="npm"?[R,...A.slice(1)]:A,E=Bun.spawn(D,{cwd:z,stdout:"pipe",stderr:"pipe"}),[J,H]=await Promise.all([new Response(E.stdout).text(),new Response(E.stderr).text()]);return{code:await E.exited,out:J+H}}async function b(){try{let A=Bun.spawn([R,"prefix","-g"],{stdout:"pipe",stderr:"ignore"}),z=(await new Response(A.stdout).text()).trim();return await A.exited,z.length>0?z:void 0}catch{return}}async function j(A,z){let D=A.includes("--check"),E=A.includes("--channel")?A[A.indexOf("--channel")+1]:"auto";if(E!=="auto"&&E!=="beta"&&E!=="latest")return z.log("error: --channel must be beta, latest or auto"),2;let J=await P(z.version,D?{cacheOnly:!0}:{});if(D)return z.log(Z(J,!0)??`up to date (${z.version})`),0;if(!J.newer)return z.log(J.latest===void 0?`no newer release is known (${Z(J,!0)??`current: ${z.version}`})`:`up to date (${z.version})`),0;let H=z.deps?.install??$({entry:z.entry}),K=H.mode==="source"&&H.root!==void 0&&B(G(H.root,"dist","cli","main.js")),Q=q(H,{currentVersion:z.version,channel:E,distBuilt:K});if(z.log(`update available: ${z.version} \u2192 ${J.latest} \xB7 this copy is a ${H.mode} install \xB7 channel ${Q.channel} (${Y(z.version,E)} follows the running version)`),Q.commands.length===0)return z.log(Q.manual??"nothing to run"),1;let T=await M(Q,H,{spawn:z.deps?.spawn??L,npmGlobalPrefix:z.deps?.prefix??b,log:z.log});return z.log(T.ok?T.detail:`update failed: ${T.detail}`),T.ok?0:1}async function g(A,z,D){return j(A,{version:z,entry:D,log:(E)=>console.log(E)})}export{j as updateFlow,g as cmdUpdate};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{dk as a,ek as b,fk as c,gk as d,hk as e,ik as f,jk as g,kk as h,lk as i,mk as j,nk as k,ok as l,pk as m,qk as n,rk as o,sk as p,tk as q,uk as r}from"./main-8kjxbpw4.js";import"./main-qsevpgsv.js";r();export{l as welcomeCard,m as resumedLine,i as noModelHint,h as next,o as modeSwitchNote,f as modeMeaning,e as modeLabelShort,d as modeLabel,k as loadedLine,n as effortNote,p as acceptEditsNote,g as NEXT,b as MODE_AUTO,a as MODE_ASK,c as MODE_ACCEPT,j as MOCK_PROVIDER_TEXT,q as EMPTY};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Af as e,Bf as f,Cf as g,Df as h,Ef as i,Ff as j,Gf as k,Hf as l,If as m,Jf as n,wf as a,xf as b,yf as c,zf as d}from"./main-skbp13js.js";import"./main-qsevpgsv.js";export{n as webFetchTool,j as ssrfDenyReason,l as readBounded,g as isPrivateAddress,h as dnsResolver,m as createWebFetchTool,f as clampChars,i as canonicalHost,k as abortable,e as TIMEOUT_DEFAULT_MS,d as MAX_REDIRECTS,a as MAX_BYTES,b as CHARS_DEFAULT,c as CHARS_CAP};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Ae as n,Be as o,Ce as p,De as q,Ee as r,ne as a,oe as b,pe as c,qe as d,re as e,se as f,te as g,ue as h,ve as i,we as j,xe as k,ye as l,ze as m}from"./main-6b62vkz0.js";import"./main-skbp13js.js";import"./main-0z1w2zsg.js";import"./main-qsevpgsv.js";export{r as webSearchTool,o as parseResultsText,m as parseMcpBody,n as parseExaContext,p as formatResults,q as createWebSearchTool,l as clampResults,g as URL_CHARS,f as TITLE_CHARS,k as TIMEOUT_DEFAULT_MS,e as SNIPPET_CHARS,b as RESULTS_DEFAULT,c as RESULTS_CAP,d as QUERY_CHARS,h as OUTPUT_CHARS_CAP,j as MAX_REDIRECTS,i as MAX_BYTES,a as ENDPOINT};
@@ -0,0 +1,4 @@
1
+ // @bun
2
+ import{ya as I}from"./main-4xcmvxnk.js";import"./main-sdmxhtv8.js";import"./main-8kjxbpw4.js";import"./main-2yeveeve.js";import"./main-0jys2ccn.js";import{xn as u}from"./main-qsevpgsv.js";import{join as c,resolve as d}from"path";import{appendFileSync as x,existsSync as F,mkdirSync as k,readFileSync as h,readdirSync as f}from"fs";import{join as v}from"path";function W(B){if(!B.name||typeof B.name!=="string")throw Error("workflow needs a name");let Q=Object.keys(B.steps??{});if(Q.length===0)throw Error("workflow needs at least one step");for(let[N,Y]of Object.entries(B.steps)){if(Y.kind!=="agent"&&Y.kind!=="gate")throw Error(`step '${N}': kind must be "agent" | "gate"`);if(Y.kind==="agent"&&(typeof Y.goal!=="string"||Y.goal.trim()===""))throw Error(`step '${N}': agent step needs a goal`);for(let Z of Y.after??[]){if(!(Z in B.steps))throw Error(`step '${N}': unknown dependency '${Z}'`);if(Z===N)throw Error(`step '${N}': cannot depend on itself`)}}let H=new Map,M=(N,Y)=>{let Z=H.get(N)??0;if(Z===2)return;if(Z===1)throw Error(`workflow has a cycle: ${[...Y,N].join(" \u2192 ")}`);H.set(N,1);for(let _ of B.steps[N].after??[])M(_,[...Y,N]);H.set(N,2)};for(let N of Q)M(N,[]);return B}function l(B,Q){return v(B,`${Q}.jsonl`)}function S(B){let Q=new Map;if(!F(B))return Q;for(let H of h(B,"utf8").split(`
3
+ `)){if(H.trim()==="")continue;try{let M=JSON.parse(H);if(M.type==="step"&&M.status==="done")Q.set(M.step,M.summary??"")}catch{}}return Q}async function y(B,Q,H={}){W(B);let M=H.runId??`wf-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,6)}`,N=H.dir??v(process.cwd(),".rovecode","workflows");k(N,{recursive:!0});let Y=l(N,M),Z=S(Y),_=(z)=>{H.emit?.(z)},b=Math.max(1,H.maxConcurrency??3),E=Math.max(1,B.retry?.maxAttempts??1),P=B.budget?.maxTokens,$=new Map(Object.entries(B.steps)),X={},J=new Set,O=new Set,T=new Set,j={input:0,output:0},R=0;for(let[z,G]of Z)J.add(z),X[z]={status:"done",summary:G,attempts:0};_({type:"workflow_started",runId:M,name:B.name,steps:$.size});let q=(z)=>(z.after??[]).every((G)=>J.has(G)),K=(z)=>(z.after??[]).some((G)=>O.has(G)),L=(z)=>{try{x(Y,JSON.stringify(z)+`
4
+ `)}catch{}},w=async(z,G)=>{T.add(z);try{if(G.kind==="gate"){if(_({type:"gate_waiting",runId:M,step:z,prompt:G.prompt}),H.signal?.aborted?!1:await Q.askGate(G.prompt))J.add(z),X[z]={status:"done",summary:"approved",attempts:1},L({v:1,type:"step",step:z,status:"done",summary:"approved"}),_({type:"step_done",runId:M,step:z,summary:"approved"});else O.add(z),X[z]={status:"failed",error:"gate rejected",attempts:1},_({type:"step_failed",runId:M,step:z,error:"gate rejected",attempt:1});return}let U=0,A="unknown";while(U<E){if(U++,H.signal?.aborted){Q.cancelAgent?.(z),O.add(z),X[z]={status:"failed",error:"cancelled",attempts:U};return}_({type:"step_started",runId:M,step:z,attempt:U});let V=await Q.runAgent({...G,name:z});if(V.usage)j.input+=V.usage.input,j.output+=V.usage.output,R+=V.usage.input+V.usage.output;if(V.ok){J.add(z),X[z]={status:"done",summary:V.summary,attempts:U},L({v:1,type:"step",step:z,status:"done",summary:V.summary}),_({type:"step_done",runId:M,step:z,summary:V.summary});return}A=V.summary,_({type:"step_failed",runId:M,step:z,error:V.summary,attempt:U})}O.add(z),X[z]={status:"failed",error:A,attempts:U},L({v:1,type:"step",step:z,status:"failed",error:A})}finally{T.delete(z)}},C=new Set,D="done";for(;;){if(H.signal?.aborted)D="cancelled";if(P!==void 0&&R>=P)D="budget";let z=D!=="done",G=!1;if(!z&&O.size===0)for(let[U,A]of $){if(J.has(U)||O.has(U)||T.has(U)||X[U]!==void 0)continue;if(!q(A))continue;if(T.size>=b)break;let V=w(U,A);C.add(V),V.finally(()=>C.delete(V)),G=!0}if(O.size>0){for(let[U,A]of $)if(X[U]===void 0&&!T.has(U)&&(K(A)||!q(A))){if((A.after??[]).length>0)X[U]={status:"skipped",error:"upstream failed",attempts:0}}}if(C.size===0){if(!G)break}else await Promise.race(C)}for(let[z]of $)if(X[z]===void 0)X[z]={status:"skipped",error:D==="done"?"dependency failed":D,attempts:0};if(O.size>0&&D==="done")D="failed";return _({type:"workflow_done",runId:M,status:D}),{runId:M,status:D,steps:X,usage:j}}function g(B){if(!F(B))return[];let Q=[];try{Q=f(B)}catch{return[]}return Q.filter((H)=>H.endsWith(".jsonl")).map((H)=>({runId:H.slice(0,-6),done:[...S(v(B,H)).keys()]})).sort((H,M)=>H.runId.localeCompare(M.runId))}async function n(B){let[Q,...H]=B,M=process.cwd(),N=c(M,".rovecode","workflows");if(Q==="list"){let q=g(N);if(process.argv.includes("--json"))return console.log(JSON.stringify({runs:q},null,2)),0;if(q.length===0)return console.log(`no workflow runs in ${N}`),0;for(let K of q)console.log(`${K.runId} done: ${K.done.length>0?K.done.join(", "):"(none)"}`);return 0}if(Q!=="run"||H[0]===void 0)return console.error("usage: rovecode workflow run <file.ts> [--resume <runId>] [--json] | rovecode workflow list"),2;let Y=d(M,H[0]),Z;try{let q=await import(Y);if(!q.default)throw Error("the file must `export default defineWorkflow({\u2026})`");Z=W(q.default)}catch(q){return console.error(`error: ${q instanceof Error?q.message:String(q)}`),2}let _=process.argv.indexOf("--resume"),b=_!==-1?process.argv[_+1]:void 0,E=process.argv.includes("--json"),{bootRuntime:P}=await import("./runtime-n7gafzhb.js"),$=await P(),X=async(q)=>{return $.tasks.cancelAll(),await $.tasks.drain(2000),await $.hooks.close(),await $.mcp?.close().catch(()=>{}),process.exit(q)},J=$.noProviderReason();if(J!==null&&process.env.ROVECODE_MOCK!=="1")return console.error(`error: ${J}`),X(2);let O=process.stdin.isTTY===!0,R=await y(Z,{runAgent:async(q)=>{let K=$.tasks.start({agent:q.agent??"main",goal:q.goal},{label:`${Z.name}/${q.name}`});if(!K.ok)return{ok:!1,summary:K.reason};let L=await $.tasks.result(K.id);if(!L)return{ok:!1,summary:"task vanished"};return{ok:L.status==="done",summary:L.summary??L.error??L.status,...L.usage!==void 0?{usage:L.usage}:{}}},askGate:async(q)=>{if(!O)return console.error(`gate '${q}': no TTY \u2014 rejected (run workflows with gates interactively)`),!1;let K=(await I(`gate [${Z.name}]: ${q} [y/N] `)).trim().toLowerCase();return K==="y"||K==="yes"},cancelAgent:()=>{$.tasks.cancelAll()}},{dir:N,emit:(q)=>{if(E){console.log(JSON.stringify(q));return}if(q.type==="workflow_started")console.log(`workflow ${q.name} (${q.runId}) \u2014 ${q.steps} steps`);else if(q.type==="step_started")console.log(` \u25B8 ${q.step} (attempt ${q.attempt})`);else if(q.type==="step_done")console.log(` \u2713 ${q.step} \u2014 ${String(q.summary??"").slice(0,120)}`);else if(q.type==="step_failed")console.error(` \u2717 ${q.step} \u2014 ${String(q.error??"").slice(0,120)}`);else if(q.type==="gate_waiting");else if(q.type==="workflow_done")console.log(`workflow ${q.status} (${q.runId})`)},...b!==void 0?{runId:b}:{}});if(E)console.log(JSON.stringify({runId:R.runId,status:R.status,steps:R.steps,usage:R.usage},null,2));return X(R.status==="done"?0:1)}export{n as cmdWorkflow};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{$l as j,Sl as a,Tl as b,Ul as c,Vl as d,Wl as e,Xl as f,Yl as g,Zl as h,_l as i,am as k,bm as l}from"./main-0904f6ps.js";import"./main-qsevpgsv.js";l();export{c as toolPath,h as rootProblem,j as resolveRoots,e as outsideWorkspace,g as outsidePrompt,d as isInside,f as externalResource,b as canonical,k as WorkspaceRoots,i as WorkspaceRootError,a as EXTERNAL_ACTION};