rovecode 0.3.2 → 0.4.0-beta.2

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 (491) hide show
  1. package/CHANGELOG.md +512 -0
  2. package/README.md +33 -45
  3. package/bin/rovecode.js +24 -0
  4. package/dist/cli/app-dybnr56b.js +2 -0
  5. package/dist/cli/ask-user-p8hq4xgj.js +2 -0
  6. package/dist/cli/auth-login-ewpgw5sm.js +2 -0
  7. package/dist/cli/auth-m8p9grty.js +2 -0
  8. package/dist/cli/bench-xv3ypwev.js +9 -0
  9. package/dist/cli/catalog-737wb2s0.js +2 -0
  10. package/dist/cli/cli-arhg40m0.js +2 -0
  11. package/dist/cli/client-cf2pxx8q.js +2 -0
  12. package/dist/cli/commands-3p7e4xxs.js +2 -0
  13. package/dist/cli/connect-3q93d7cb.js +2 -0
  14. package/dist/cli/context-cmd-eqxmxhzq.js +2 -0
  15. package/dist/cli/context-report-hbw9zfes.js +2 -0
  16. package/dist/cli/count-remote-mby98cd0.js +2 -0
  17. package/dist/cli/design-122y0axd.js +2 -0
  18. package/dist/cli/dispatch-b4egzvvh.js +2 -0
  19. package/dist/cli/doctor-x4jkv72e.js +3 -0
  20. package/dist/cli/executor-ftvg6tsy.js +2 -0
  21. package/dist/cli/export-pdgdhkch.js +2 -0
  22. package/dist/cli/files-cez9a96p.js +2 -0
  23. package/dist/cli/gauntlet-r3xxaszc.js +2 -0
  24. package/dist/cli/gauntlet-runner-r515m7kk.js +10 -0
  25. package/dist/cli/gauntlet-wave3-bnkjk2v2.js +5 -0
  26. package/dist/cli/gauntlet-wave4-acs9s60q.js +14 -0
  27. package/dist/cli/hashline-ewg5hbe3.js +2 -0
  28. package/dist/cli/http-n0kehsk8.js +5 -0
  29. package/dist/cli/index-z5qt1s76.js +2 -0
  30. package/dist/cli/install-80mp63kx.js +2 -0
  31. package/dist/cli/loop-12twjcat.js +2 -0
  32. package/dist/cli/main-01pv9206.js +4 -0
  33. package/dist/cli/main-0jys2ccn.js +3 -0
  34. package/dist/cli/main-1ztz6fkj.js +10 -0
  35. package/dist/cli/main-23q7cmww.js +9 -0
  36. package/dist/cli/main-2rzbexn2.js +3 -0
  37. package/dist/cli/main-2wyax8k9.js +9 -0
  38. package/dist/cli/main-2yeveeve.js +6 -0
  39. package/dist/cli/main-2z3dek0b.js +3 -0
  40. package/dist/cli/main-2zgsknth.js +3 -0
  41. package/dist/cli/main-45ejth3a.js +4 -0
  42. package/dist/cli/main-45rn3trk.js +22 -0
  43. package/dist/cli/main-4p4e2w7x.js +4 -0
  44. package/dist/cli/main-4y0tnfpa.js +16 -0
  45. package/dist/cli/main-5py0rkmc.js +4 -0
  46. package/dist/cli/main-6dtqmbt6.js +7 -0
  47. package/dist/cli/main-6h9x282m.js +4 -0
  48. package/dist/cli/main-6vjeds42.js +3 -0
  49. package/dist/cli/main-78gq4bt9.js +6 -0
  50. package/dist/cli/main-7jd5vh3x.js +4 -0
  51. package/dist/cli/main-7kt6r53y.js +4 -0
  52. package/dist/cli/main-8c1tbazx.js +58 -0
  53. package/dist/cli/main-9a9rnh47.js +19 -0
  54. package/dist/cli/main-9ht36z12.js +3 -0
  55. package/dist/cli/main-a2yfvcy9.js +7 -0
  56. package/dist/cli/main-a3f51n0x.js +5 -0
  57. package/dist/cli/main-b8zq261k.js +3 -0
  58. package/dist/cli/main-bxtvnf6d.js +13 -0
  59. package/dist/cli/main-edxc3yzt.js +4 -0
  60. package/dist/cli/main-evgz4mp5.js +21 -0
  61. package/dist/cli/main-f33fc5je.js +9 -0
  62. package/dist/cli/main-fvnpq46y.js +12 -0
  63. package/dist/cli/main-gbbty4d4.js +3 -0
  64. package/dist/cli/main-gth53dnt.js +25 -0
  65. package/dist/cli/main-hqbz10aw.js +9 -0
  66. package/dist/cli/main-hrrvcfan.js +38 -0
  67. package/dist/cli/main-hzwtsb2m.js +5 -0
  68. package/dist/cli/main-j7ttv0sd.js +34 -0
  69. package/dist/cli/main-jak598k9.js +5 -0
  70. package/dist/cli/main-kba6zeyd.js +6 -0
  71. package/dist/cli/main-kwwsz6rq.js +3 -0
  72. package/dist/cli/main-m8vm17zq.js +3 -0
  73. package/dist/cli/main-mg4f96e1.js +3 -0
  74. package/dist/cli/main-mg9b20ac.js +18 -0
  75. package/dist/cli/main-mgb9ccnx.js +3 -0
  76. package/dist/cli/main-mjt2p7aj.js +3 -0
  77. package/dist/cli/main-n6qrdbmy.js +3 -0
  78. package/dist/cli/main-na7wse0x.js +5 -0
  79. package/dist/cli/main-nqveez48.js +4 -0
  80. package/dist/cli/main-ntqef02r.js +10 -0
  81. package/dist/cli/main-nvc3yjay.js +136 -0
  82. package/dist/cli/main-p0cfn6nr.js +16 -0
  83. package/dist/cli/main-qj2djy17.js +19 -0
  84. package/dist/cli/main-qsevpgsv.js +3 -0
  85. package/dist/cli/main-qvarybsp.js +3 -0
  86. package/dist/cli/main-rebtt91r.js +5 -0
  87. package/dist/cli/main-rpg7h8mb.js +3 -0
  88. package/dist/cli/main-rsy72qmw.js +15 -0
  89. package/dist/cli/main-rvetps99.js +18 -0
  90. package/dist/cli/main-s4bb0jav.js +3 -0
  91. package/dist/cli/main-s9v8k74e.js +3 -0
  92. package/dist/cli/main-tjvwmscs.js +3 -0
  93. package/dist/cli/main-tkgarpjj.js +4 -0
  94. package/dist/cli/main-v8y60bb2.js +3 -0
  95. package/dist/cli/main-vhrrq337.js +3 -0
  96. package/dist/cli/main-vp2dfb7s.js +4 -0
  97. package/dist/cli/main-vqbr22sz.js +8 -0
  98. package/dist/cli/main-vxnwe5xx.js +18 -0
  99. package/dist/cli/main-wgph00xf.js +5 -0
  100. package/dist/cli/main-wk2csfnj.js +5 -0
  101. package/dist/cli/main-wm997zjx.js +3 -0
  102. package/dist/cli/main-wpkyraxh.js +3 -0
  103. package/dist/cli/main-wqt32p5x.js +4 -0
  104. package/dist/cli/main-x9ct6y1a.js +3 -0
  105. package/dist/cli/main-xfekqh9m.js +7 -0
  106. package/dist/cli/main-xt9zc3n6.js +7 -0
  107. package/dist/cli/main-xx2z3zh5.js +4 -0
  108. package/dist/cli/main-y5c82rxr.js +3 -0
  109. package/dist/cli/main-yrjt2sqt.js +14 -0
  110. package/dist/cli/main-ys6zj3yr.js +3 -0
  111. package/dist/cli/main-ywbxshqc.js +8 -0
  112. package/dist/cli/main-z13755t8.js +25 -0
  113. package/dist/cli/main-zc7pyrbj.js +4 -0
  114. package/dist/cli/main.js +279 -0
  115. package/dist/cli/market-cmd-bm5xvn9f.js +5 -0
  116. package/dist/cli/mcp-login-bthtfpt7.js +2 -0
  117. package/dist/cli/mcp-market-cmd-mbeshfyd.js +2 -0
  118. package/dist/cli/notify-54v5z9dz.js +2 -0
  119. package/dist/cli/oauth-g5gme95c.js +2 -0
  120. package/dist/cli/output-satndjap.js +16 -0
  121. package/dist/cli/profiles-sfhpbq3m.js +2 -0
  122. package/dist/cli/provider-config-hv3xtdt4.js +2 -0
  123. package/dist/cli/provider-kwzq6g84.js +2 -0
  124. package/dist/cli/registry-fh0hdnyn.js +2 -0
  125. package/dist/cli/registry-y1y8e94r.js +2 -0
  126. package/dist/cli/repl-t4z03mqq.js +11 -0
  127. package/dist/cli/resume-fqt4chg8.js +2 -0
  128. package/dist/cli/run-flags-rysbag9t.js +2 -0
  129. package/dist/cli/runtime-j19fjbsa.js +2 -0
  130. package/dist/cli/sandbox-config-g4qxd7y5.js +2 -0
  131. package/dist/cli/server-r0b6bksk.js +5 -0
  132. package/dist/cli/session-arg-txmn5g4x.js +2 -0
  133. package/dist/cli/session-ed250d9j.js +2 -0
  134. package/dist/cli/sessions-cmd-adw7svfn.js +7 -0
  135. package/dist/cli/settings-y9rzcqx8.js +2 -0
  136. package/dist/cli/setup-jmbr11j0.js +2 -0
  137. package/dist/cli/sextant-smoke-tcth0vea.js +5 -0
  138. package/dist/cli/skills-cmd-zbdy99v6.js +2 -0
  139. package/dist/cli/smoke-1bg937kx.js +8 -0
  140. package/dist/cli/start-chat-p01cdks3.js +12 -0
  141. package/dist/cli/stream-4wmyaypz.js +2 -0
  142. package/dist/cli/task-eg4s093s.js +2 -0
  143. package/dist/cli/tasks-12v9rr9k.js +2 -0
  144. package/dist/cli/thinking-a5ngvqyh.js +2 -0
  145. package/dist/cli/todo-1wxpcecx.js +2 -0
  146. package/dist/cli/tools-2ftsya7w.js +2 -0
  147. package/dist/cli/tools-x1tj4fxm.js +2 -0
  148. package/dist/cli/trust-cmd-hccxehzb.js +2 -0
  149. package/dist/cli/update-check-ygt3vd7m.js +2 -0
  150. package/dist/cli/update-cmd-v23qhr8c.js +2 -0
  151. package/dist/cli/voice-g1gtck92.js +2 -0
  152. package/dist/cli/webfetch-0nnrjgb5.js +2 -0
  153. package/dist/cli/websearch-f0vr2p7d.js +2 -0
  154. package/dist/cli/workspace-9rq1w4ta.js +2 -0
  155. package/dist/lib/index.js +62 -0
  156. package/dist/lib/models-index.json +1 -0
  157. package/dist/lib/plugins.js +6 -0
  158. package/dist/lib/providers.js +17 -0
  159. package/dist/lib/public-api.js +20 -0
  160. package/dist/rovecode.exe +4 -0
  161. package/package.json +38 -11
  162. package/bin/rovecode.ts +0 -21
  163. package/src/acp/server.ts +0 -374
  164. package/src/cli/auth-login.ts +0 -122
  165. package/src/cli/connect.ts +0 -244
  166. package/src/cli/context-cmd.ts +0 -199
  167. package/src/cli/dispatch.ts +0 -82
  168. package/src/cli/doctor.ts +0 -362
  169. package/src/cli/export.ts +0 -276
  170. package/src/cli/help.ts +0 -293
  171. package/src/cli/is-tui-invocation.ts +0 -8
  172. package/src/cli/main.ts +0 -583
  173. package/src/cli/market-cmd.ts +0 -658
  174. package/src/cli/mcp-login.ts +0 -141
  175. package/src/cli/mcp-market-cmd.ts +0 -302
  176. package/src/cli/output.ts +0 -382
  177. package/src/cli/repl.ts +0 -250
  178. package/src/cli/repomap-root.ts +0 -14
  179. package/src/cli/resume.ts +0 -57
  180. package/src/cli/run-flags.ts +0 -43
  181. package/src/cli/run-limits.ts +0 -78
  182. package/src/cli/runtime.ts +0 -931
  183. package/src/cli/session-arg.ts +0 -30
  184. package/src/cli/sessions-cmd.ts +0 -145
  185. package/src/cli/setup.ts +0 -153
  186. package/src/cli/skills-cmd.ts +0 -194
  187. package/src/cli/start-chat.ts +0 -65
  188. package/src/cli/trust-cmd.ts +0 -52
  189. package/src/coding/bash.ts +0 -148
  190. package/src/coding/checkpoints.ts +0 -327
  191. package/src/coding/diff.ts +0 -138
  192. package/src/coding/files.ts +0 -341
  193. package/src/coding/hashline.ts +0 -274
  194. package/src/coding/lsp-gate.ts +0 -254
  195. package/src/coding/lsp-servers.ts +0 -147
  196. package/src/coding/lsp.ts +0 -283
  197. package/src/coding/repomap-cache.ts +0 -99
  198. package/src/coding/repomap-files.ts +0 -192
  199. package/src/coding/repomap.ts +0 -481
  200. package/src/core/agents.ts +0 -255
  201. package/src/core/compaction.ts +0 -259
  202. package/src/core/config.ts +0 -289
  203. package/src/core/context-report.ts +0 -228
  204. package/src/core/context.ts +0 -60
  205. package/src/core/count-remote.ts +0 -107
  206. package/src/core/execpolicy-rules.ts +0 -196
  207. package/src/core/execpolicy.ts +0 -385
  208. package/src/core/executor.ts +0 -454
  209. package/src/core/guardrails.ts +0 -400
  210. package/src/core/hooks.ts +0 -411
  211. package/src/core/images.ts +0 -230
  212. package/src/core/intro.ts +0 -266
  213. package/src/core/loop.ts +0 -567
  214. package/src/core/modes.ts +0 -372
  215. package/src/core/orchestrator.ts +0 -245
  216. package/src/core/proc-group.ts +0 -48
  217. package/src/core/project-trust.ts +0 -98
  218. package/src/core/reflection.ts +0 -165
  219. package/src/core/sandbox-config.ts +0 -186
  220. package/src/core/session-id.ts +0 -24
  221. package/src/core/session-images.ts +0 -73
  222. package/src/core/session-ops.ts +0 -183
  223. package/src/core/session-text.ts +0 -29
  224. package/src/core/session.ts +0 -469
  225. package/src/core/settings.ts +0 -170
  226. package/src/core/tasks.ts +0 -646
  227. package/src/core/token-scale.ts +0 -108
  228. package/src/core/tools.ts +0 -309
  229. package/src/core/trust.ts +0 -104
  230. package/src/core/types.ts +0 -330
  231. package/src/core/update-check.ts +0 -171
  232. package/src/core/usage.ts +0 -204
  233. package/src/core/validate.ts +0 -121
  234. package/src/core/verify-gate.ts +0 -159
  235. package/src/core/verify.ts +0 -236
  236. package/src/core/voice.ts +0 -158
  237. package/src/core/win-job.ts +0 -183
  238. package/src/core/workspace.ts +0 -184
  239. package/src/design/audit.ts +0 -797
  240. package/src/design/direction.ts +0 -190
  241. package/src/design/rules.ts +0 -157
  242. package/src/eval/bench.ts +0 -150
  243. package/src/eval/gauntlet-runner.ts +0 -215
  244. package/src/eval/gauntlet-support.ts +0 -84
  245. package/src/eval/gauntlet-wave3.ts +0 -269
  246. package/src/eval/gauntlet-wave4.ts +0 -217
  247. package/src/eval/gauntlet.ts +0 -253
  248. package/src/index.ts +0 -17
  249. package/src/lanes/agy.ts +0 -95
  250. package/src/lanes/approval.ts +0 -24
  251. package/src/lanes/claude.ts +0 -129
  252. package/src/lanes/codex.ts +0 -127
  253. package/src/lanes/events.ts +0 -130
  254. package/src/lanes/job.ts +0 -142
  255. package/src/lanes/opencode.ts +0 -122
  256. package/src/lanes/process.ts +0 -184
  257. package/src/lanes/progress.ts +0 -183
  258. package/src/lanes/registry.ts +0 -178
  259. package/src/lanes/runner.ts +0 -124
  260. package/src/lanes/types.ts +0 -112
  261. package/src/market/catalogs/mcp-docs.json +0 -111
  262. package/src/market/catalogs/plugins.json +0 -111
  263. package/src/market/catalogs/skills.json +0 -478
  264. package/src/market/clone.ts +0 -72
  265. package/src/market/context-cost.ts +0 -121
  266. package/src/market/digest.ts +0 -106
  267. package/src/market/index.ts +0 -22
  268. package/src/market/install.ts +0 -578
  269. package/src/market/manifest.ts +0 -187
  270. package/src/market/prereq.ts +0 -145
  271. package/src/market/registry.ts +0 -363
  272. package/src/market/resolve.ts +0 -111
  273. package/src/market/types.ts +0 -236
  274. package/src/market/validate.ts +0 -227
  275. package/src/mcp/client.ts +0 -449
  276. package/src/mcp/config.ts +0 -252
  277. package/src/mcp/local-package.ts +0 -211
  278. package/src/mcp/market-catalog.ts +0 -84
  279. package/src/mcp/market-install.ts +0 -289
  280. package/src/mcp/market.ts +0 -362
  281. package/src/mcp/oauth.ts +0 -251
  282. package/src/mcp/prompts-resources.ts +0 -249
  283. package/src/mcp/shared.ts +0 -149
  284. package/src/mcp/status.ts +0 -67
  285. package/src/mcp/tools.ts +0 -275
  286. package/src/mcp/transport.ts +0 -122
  287. package/src/mcp/trust.ts +0 -25
  288. package/src/memory/blocks.ts +0 -278
  289. package/src/memory/recall.ts +0 -355
  290. package/src/memory/scope.ts +0 -182
  291. package/src/memory/store.ts +0 -105
  292. package/src/memory/tools.ts +0 -99
  293. package/src/plugins/cli.ts +0 -119
  294. package/src/plugins/discover.ts +0 -108
  295. package/src/plugins/index.ts +0 -50
  296. package/src/plugins/install.ts +0 -184
  297. package/src/plugins/load.ts +0 -124
  298. package/src/plugins/manifest.ts +0 -92
  299. package/src/plugins/state.ts +0 -83
  300. package/src/providers/auth.ts +0 -408
  301. package/src/providers/cache.ts +0 -223
  302. package/src/providers/catalog-local.ts +0 -160
  303. package/src/providers/catalog.ts +0 -421
  304. package/src/providers/middleware-context.ts +0 -86
  305. package/src/providers/middleware.ts +0 -373
  306. package/src/providers/model-list.ts +0 -23
  307. package/src/providers/oauth/common.ts +0 -105
  308. package/src/providers/oauth/device-code.ts +0 -107
  309. package/src/providers/oauth/github-copilot.ts +0 -146
  310. package/src/providers/oauth/loopback.ts +0 -158
  311. package/src/providers/oauth/openai.ts +0 -163
  312. package/src/providers/oauth/openrouter.ts +0 -89
  313. package/src/providers/oauth/pkce.ts +0 -45
  314. package/src/providers/oauth/registry.ts +0 -39
  315. package/src/providers/oauth/seam.ts +0 -89
  316. package/src/providers/profile-glm53.ts +0 -111
  317. package/src/providers/profile-sonnet5-persona.ts +0 -65
  318. package/src/providers/profile-sonnet5-voice.ts +0 -23
  319. package/src/providers/profiles.ts +0 -156
  320. package/src/providers/provider-config.ts +0 -311
  321. package/src/providers/registry.ts +0 -333
  322. package/src/providers/responses.ts +0 -209
  323. package/src/providers/retry.ts +0 -234
  324. package/src/providers/router.ts +0 -294
  325. package/src/providers/sse.ts +0 -26
  326. package/src/providers/stream-errors.ts +0 -117
  327. package/src/providers/stream.ts +0 -566
  328. package/src/providers/thinking.ts +0 -189
  329. package/src/providers/wire-messages.ts +0 -129
  330. package/src/providers/wire-responses.ts +0 -79
  331. package/src/providers/wire-select.ts +0 -53
  332. package/src/server/http.ts +0 -291
  333. package/src/server/openapi.ts +0 -246
  334. package/src/sextant/card-hits.ts +0 -102
  335. package/src/sextant/card-keys.ts +0 -55
  336. package/src/sextant/context-source.ts +0 -157
  337. package/src/sextant/crew-cards.ts +0 -350
  338. package/src/sextant/draw-agents.ts +0 -273
  339. package/src/sextant/draw-code.ts +0 -388
  340. package/src/sextant/draw-context.ts +0 -222
  341. package/src/sextant/draw-frame.ts +0 -164
  342. package/src/sextant/draw-market.ts +0 -573
  343. package/src/sextant/draw-messages.ts +0 -386
  344. package/src/sextant/draw-pet.ts +0 -230
  345. package/src/sextant/draw-plan.ts +0 -187
  346. package/src/sextant/draw-tabs.ts +0 -85
  347. package/src/sextant/draw-util.ts +0 -65
  348. package/src/sextant/draw-wizard.ts +0 -378
  349. package/src/sextant/engine.ts +0 -230
  350. package/src/sextant/frame-hits.ts +0 -25
  351. package/src/sextant/frame.ts +0 -101
  352. package/src/sextant/git-status.ts +0 -197
  353. package/src/sextant/grid.ts +0 -59
  354. package/src/sextant/input.ts +0 -119
  355. package/src/sextant/keys.ts +0 -521
  356. package/src/sextant/layout.ts +0 -86
  357. package/src/sextant/local-commands.ts +0 -169
  358. package/src/sextant/market-source.ts +0 -287
  359. package/src/sextant/mentions.ts +0 -200
  360. package/src/sextant/message-hits.ts +0 -26
  361. package/src/sextant/model.ts +0 -387
  362. package/src/sextant/overlays.ts +0 -456
  363. package/src/sextant/panel-hits.ts +0 -38
  364. package/src/sextant/pet.ts +0 -399
  365. package/src/sextant/screen.ts +0 -324
  366. package/src/sextant/scroll-hits.ts +0 -66
  367. package/src/sextant/scrollbar.ts +0 -82
  368. package/src/sextant/sextant-bridge.ts +0 -174
  369. package/src/sextant/sextant-cards.ts +0 -142
  370. package/src/sextant/sextant-diff-base.ts +0 -63
  371. package/src/sextant/sextant-files.ts +0 -154
  372. package/src/sextant/sextant-frame-loop.ts +0 -335
  373. package/src/sextant/sextant-renderer.ts +0 -574
  374. package/src/sextant/sextant-repo.ts +0 -140
  375. package/src/sextant/theme.ts +0 -66
  376. package/src/sextant/tool-rows.ts +0 -189
  377. package/src/sextant/types.ts +0 -493
  378. package/src/skills/index.ts +0 -387
  379. package/src/skills/pack.ts +0 -220
  380. package/src/skills/spec.ts +0 -162
  381. package/src/skills/tools.ts +0 -69
  382. package/src/skills/versioned.ts +0 -227
  383. package/src/telemetry/otel-export.ts +0 -122
  384. package/src/telemetry/otel-lanes.ts +0 -89
  385. package/src/telemetry/otel-logs.ts +0 -131
  386. package/src/telemetry/otel-metrics.ts +0 -136
  387. package/src/telemetry/otel.ts +0 -397
  388. package/src/telemetry/otlp.ts +0 -76
  389. package/src/tools/ask-user.ts +0 -156
  390. package/src/tools/bash-bg.ts +0 -94
  391. package/src/tools/bash-jobs.ts +0 -237
  392. package/src/tools/design.ts +0 -151
  393. package/src/tools/evalcell.ts +0 -338
  394. package/src/tools/html-text.ts +0 -139
  395. package/src/tools/provider.ts +0 -149
  396. package/src/tools/task.ts +0 -250
  397. package/src/tools/todo.ts +0 -320
  398. package/src/tools/webfetch.ts +0 -332
  399. package/src/tools/websearch.ts +0 -359
  400. package/src/tui/agents-cmd.ts +0 -41
  401. package/src/tui/app.ts +0 -749
  402. package/src/tui/attach.ts +0 -127
  403. package/src/tui/boot-notes.ts +0 -41
  404. package/src/tui/builtin-prompts.ts +0 -59
  405. package/src/tui/checkpoints-cmd.ts +0 -70
  406. package/src/tui/clipboard-image.ts +0 -81
  407. package/src/tui/clipboard.ts +0 -78
  408. package/src/tui/commands.ts +0 -283
  409. package/src/tui/config-view.ts +0 -53
  410. package/src/tui/context-cmds.ts +0 -282
  411. package/src/tui/cost.ts +0 -108
  412. package/src/tui/crash-guard.ts +0 -173
  413. package/src/tui/focus-terminal.ts +0 -34
  414. package/src/tui/git-cmds.ts +0 -273
  415. package/src/tui/git-plain.ts +0 -58
  416. package/src/tui/info-cmd.ts +0 -150
  417. package/src/tui/input-plain.ts +0 -76
  418. package/src/tui/mcp-cmd.ts +0 -128
  419. package/src/tui/memory-note.ts +0 -77
  420. package/src/tui/modes-cmd.ts +0 -45
  421. package/src/tui/notify-seq.ts +0 -100
  422. package/src/tui/notify.ts +0 -318
  423. package/src/tui/overlays.ts +0 -97
  424. package/src/tui/pi-renderer.ts +0 -428
  425. package/src/tui/providers-cmd.ts +0 -377
  426. package/src/tui/reasoning-view.ts +0 -56
  427. package/src/tui/renderer.ts +0 -128
  428. package/src/tui/replay-marker.ts +0 -29
  429. package/src/tui/session-cmd.ts +0 -148
  430. package/src/tui/session-manage.ts +0 -95
  431. package/src/tui/sextant-attach.ts +0 -102
  432. package/src/tui/sextant-io.ts +0 -202
  433. package/src/tui/sextant-smoke.ts +0 -110
  434. package/src/tui/shell-cmd.ts +0 -158
  435. package/src/tui/smoke.ts +0 -72
  436. package/src/tui/staged-terminal.ts +0 -50
  437. package/src/tui/startup.ts +0 -12
  438. package/src/tui/theme.ts +0 -59
  439. package/src/tui/todo-label.ts +0 -7
  440. package/src/tui/trust-card.ts +0 -107
  441. package/src/tui/tui-commands.ts +0 -87
  442. package/tsconfig.json +0 -30
  443. package/vendor/pi-tui/LICENSE +0 -21
  444. package/vendor/pi-tui/PATCHES.md +0 -12
  445. package/vendor/pi-tui/PROVENANCE.md +0 -12
  446. package/vendor/pi-tui/README.upstream.md +0 -854
  447. package/vendor/pi-tui/native/win32/prebuilds/win32-arm64/win32-console-mode.node +0 -0
  448. package/vendor/pi-tui/native/win32/prebuilds/win32-x64/win32-console-mode.node +0 -0
  449. package/vendor/pi-tui/src/alt-screen-search.ts +0 -158
  450. package/vendor/pi-tui/src/autocomplete.ts +0 -827
  451. package/vendor/pi-tui/src/components/alt-screen-flash.ts +0 -52
  452. package/vendor/pi-tui/src/components/box.ts +0 -138
  453. package/vendor/pi-tui/src/components/cancellable-loader.ts +0 -41
  454. package/vendor/pi-tui/src/components/editor.ts +0 -2364
  455. package/vendor/pi-tui/src/components/h-stack.ts +0 -45
  456. package/vendor/pi-tui/src/components/image.ts +0 -128
  457. package/vendor/pi-tui/src/components/input.ts +0 -448
  458. package/vendor/pi-tui/src/components/loader.ts +0 -93
  459. package/vendor/pi-tui/src/components/markdown.ts +0 -1016
  460. package/vendor/pi-tui/src/components/scroll-view.ts +0 -217
  461. package/vendor/pi-tui/src/components/select-list.ts +0 -230
  462. package/vendor/pi-tui/src/components/settings-list.ts +0 -277
  463. package/vendor/pi-tui/src/components/spacer.ts +0 -29
  464. package/vendor/pi-tui/src/components/stack.ts +0 -155
  465. package/vendor/pi-tui/src/components/text.ts +0 -108
  466. package/vendor/pi-tui/src/components/truncated-text.ts +0 -66
  467. package/vendor/pi-tui/src/components/v-stack.ts +0 -34
  468. package/vendor/pi-tui/src/editor-component.ts +0 -75
  469. package/vendor/pi-tui/src/fuzzy.ts +0 -138
  470. package/vendor/pi-tui/src/index.ts +0 -149
  471. package/vendor/pi-tui/src/keybindings.ts +0 -321
  472. package/vendor/pi-tui/src/keys.ts +0 -1402
  473. package/vendor/pi-tui/src/kill-ring.ts +0 -47
  474. package/vendor/pi-tui/src/latex.ts +0 -1381
  475. package/vendor/pi-tui/src/layout-node.ts +0 -52
  476. package/vendor/pi-tui/src/layout.ts +0 -411
  477. package/vendor/pi-tui/src/native-modifiers.ts +0 -60
  478. package/vendor/pi-tui/src/native-module-path.ts +0 -32
  479. package/vendor/pi-tui/src/stdin-buffer.ts +0 -445
  480. package/vendor/pi-tui/src/terminal-colors.ts +0 -74
  481. package/vendor/pi-tui/src/terminal-image.ts +0 -701
  482. package/vendor/pi-tui/src/terminal.ts +0 -554
  483. package/vendor/pi-tui/src/tui-alt-screen.ts +0 -1379
  484. package/vendor/pi-tui/src/tui-main-screen.ts +0 -655
  485. package/vendor/pi-tui/src/tui.ts +0 -1264
  486. package/vendor/pi-tui/src/undo-stack.ts +0 -29
  487. package/vendor/pi-tui/src/utils.ts +0 -1327
  488. package/vendor/pi-tui/src/word-navigation.ts +0 -118
  489. package/vendor/pi-tui/test/test-themes.ts +0 -39
  490. package/vendor/pi-tui/test/virtual-terminal.ts +0 -219
  491. /package/{src/providers → dist/cli}/models-index.json +0 -0
@@ -0,0 +1,279 @@
1
+ #!/usr/bin/env bun
2
+ // @bun
3
+ import{Gh as e}from"./main-mgb9ccnx.js";import{Jh as t}from"./main-qvarybsp.js";import{Fj as d,Gj as f,Wj as Jq}from"./main-ywbxshqc.js";import{Ul as w,Vl as Qq}from"./main-vhrrq337.js";import{wm as Yq,xm as k}from"./main-ys6zj3yr.js";import{xn as q}from"./main-qsevpgsv.js";Qq();Jq();var u=`rovecode \u2014 a coding agent in your terminal
4
+
5
+ start here
6
+ rovecode open the cockpit (--classic: the plain chat \xB7 --plain: a bare REPL)
7
+ rovecode "fix the failing test" one task, then exit
8
+ rovecode connect connect a model: pick a provider, paste the key (hidden), one test call
9
+ rovecode connect <id> [<url>] the same in one line \u2014 rovecode connect anthropic \xB7 rovecode connect me https://host/v1
10
+
11
+ everyday
12
+ rovecode run "<prompt>" --yolo one task in ${f} mode
13
+ rovecode run "<prompt>" --output json machine-readable result (ndjson: one line per event)
14
+ rovecode model pick the default from a menu \xB7 model use <provider/model> sets it (--project pins it here)
15
+ rovecode market search <q> MCP servers, skills and plugins on one shelf; install any with market install <id>
16
+ --effort auto|off|low|medium|high how hard I think before answering (/effort in the TUI, ROVECODE_EFFORT=\u2026)
17
+ rovecode provider list|add|remove|test endpoints in ~/.rovecode/providers.json \u2014 live, no restart
18
+ rovecode auth set <id> \xB7 auth login <id> store an API key (hidden) \xB7 sign in (github-copilot, openrouter, openai) \xB7 list \xB7 remove
19
+ rovecode doctor \xB7 --resume <id> what is wrong with my setup, in one pass \xB7 reopen a session (export <id> \u2192 markdown)
20
+
21
+ safety
22
+ ${d} (default) I read freely; I ask before every write, shell command and subagent
23
+ accept edits (--accept-edits) I write inside this folder without asking; shell, subagents,
24
+ network and writes OUTSIDE it still ask (/accept-edits, ROVECODE_ACCEPT_EDITS=1)
25
+ auto (--yolo, ROVECODE_YOLO=1) I never ask \u2014 deny rules and plan mode still hold
26
+ /yolo --save \xB7 /accept-edits --save make the level stick (add --project to pin it to this repo);
27
+ without --save a toggle lasts one session. ROVECODE_PERMISSION=ask|accept-edits|auto
28
+ plan mode (/plan in the TUI) read-only: I can look and plan, not change anything
29
+
30
+ more
31
+ rovecode help env every ROVECODE_* setting (incl. the bash sandbox rungs)
32
+ rovecode help advanced market \xB7 context \xB7 mcp \xB7 plugins \xB7 acp \xB7 serve \xB7 gauntlet \xB7 bench \xB7 trace \xB7 tools
33
+ rovecode help all everything on one page`,p=`advanced \u2014 the full command reference
34
+ rovecode interactive TUI chat \u2014 the full cockpit (files \xB7 code \xB7 messages \xB7 plan \xB7 usage \xB7 pet)
35
+ on a colour TTY of at least 100x30 (truecolor, or 256 colours through the
36
+ quantizer), else the classic chat;
37
+ --classic forces the classic chat \xB7 --pet <name> names the pet \xB7 --plain = readline REPL
38
+ --no-intro (or ROVECODE_INTRO=0) skips the ~0.9s opening animation
39
+ rovecode chat \xB7 rovecode repl the same as bare rovecode (repl still needs --plain for the readline REPL)
40
+ rovecode --help | -h this help (only with no command in front of it) \xB7 rovecode --version prints the
41
+ version to stdout and the update check\u2019s answer to stderr
42
+ rovecode --resume <id> open the TUI resuming a session (full id or unique prefix); an unknown, ambiguous or
43
+ malformed id is refused with the reason (exit 2) \u2014 never a new session under that name
44
+ rovecode --continue reopen the newest session that holds something (also: --resume with no id);
45
+ nothing to continue from \u2192 a fresh session, and the startup card says so
46
+ rovecode "prompt" one-shot task (same as run; a lone path-shaped word \u2014 ./x, x.ts, an existing
47
+ name \u2014 is confirmed on a TTY and refused with exit 2 off one: use "rovecode run" to send it)
48
+ rovecode setup connect a model step by step (TTY only; piped stdin prints the recipe and exits 2)
49
+ TUI: /agents list the subagent definitions loaded from .rovecode/agents/*.md (the bare /agents
50
+ is the crew board) \xB7 /config [all] the settings this session loaded
51
+ rovecode connect the same wizard when given no arguments
52
+ rovecode connect <id> [<baseUrl>] [--model <id>] [--key | --key-stdin | --key-env NAME | --no-key]
53
+ [--protocol openai|anthropic] [--project] [--no-test]
54
+ one line: register the endpoint, store the key, pick the model, one tiny real
55
+ call, persist the default. A key is never a flag value (shell history, ps):
56
+ --key prompts hidden, --key-stdin reads one piped line (CI), --key-env names
57
+ an env var, --no-key marks a local server.
58
+ exit 0 connected \xB7 1 the test call failed (config still written) \xB7 2 usage
59
+ rovecode smoke-tui render check: full pipeline into an 80x24 terminal emulator (dev-only)
60
+ rovecode smoke-tui --sextant render check: the full cockpit at 160x44 through the pipeline (no emulator needed)
61
+ rovecode run "<prompt>" run an agent task (--yolo = ${f}; with no provider configured this is a
62
+ startup error, exit 2 \u2014 ROVECODE_MOCK=1 asks for the scripted mock on purpose)
63
+ "/name args" expands a custom command (.rovecode/commands/<name>.md, else ~/.rovecode/commands)
64
+ the way the TUI does; an unknown /name is sent verbatim; model:/mode: frontmatter is
65
+ TUI-only and not applied headlessly
66
+ piped stdin is appended to the prompt as a fenced block \u2014 git diff | rovecode run "review this"
67
+ (never read from a terminal; --no-stdin ignores it; an open pipe that sends nothing
68
+ for 3 s is skipped with a note; capped at 1 MB)
69
+ --max-turns N \xB7 --max-seconds S|off ceilings on one run; a hit ends it cleanly with status
70
+ "budget" (exit 1) and the work so far, instead of an external kill. Headless runs
71
+ default to a 20-minute wall clock; --max-seconds off removes it
72
+ --max-cost D|off a spend ceiling in dollars for one run, priced from each turn's usage as it lands
73
+ (the catalog's rates for the model that served it); the same clean "budget" end.
74
+ A turn the catalog cannot price adds nothing and is counted in the summary
75
+ --output <text|json|ndjson> text (default): progress + the final answer on stdout
76
+ json: exactly ONE result object on stdout {status, summary, sessionId,
77
+ model:{provider,model}, origin (served model|null), usage:{input,output,cacheRead,
78
+ cacheWrite}, costUsd (null when unpriced), toolCalls:[{tool,ok,ms?}], durationMs, exitCode}
79
+ ndjson: one JSON line per RunEvent, then a final {type:"result"} line
80
+ json/ndjson: stdout carries only JSON, progress goes to stderr
81
+ exit codes: 0 done \xB7 1 error/budget \xB7 2 usage/startup error \xB7 130 aborted (Ctrl-C)
82
+ exit 2 = usage/startup error (bad --output value, sandbox misconfig or unavailable rung):
83
+ one stderr line, nothing on stdout; --output=<mode> is accepted as well
84
+ rovecode bench run cross-harness micro-benchmarks (edits, sessions)
85
+ rovecode gauntlet run the adversarial evaluation suite (offline, scripted model)
86
+ rovecode gauntlet --live the gauntlet's tasks minus loop-guard (9) against the configured REAL model through
87
+ the real prompt \u2014 --model <provider/model> and --effort pick; compare pass/calls/tokens
88
+ rovecode tools list registered tools
89
+ rovecode plugin list plugins in ~/.rovecode/plugins and .rovecode/plugins with status (active \xB7 disabled \xB7 untrusted \xB7 broken)
90
+ rovecode plugin add <folder|git-url> [--project] [--force] install a plugin folder (tools, hooks, commands, skills, MCP in one manifest)
91
+ rovecode plugin trust <name> approve a PROJECT plugin's current files on this machine (show <name> lists them first)
92
+ rovecode plugin remove|enable|disable|untrust|show <name> (docs/plugins.md; restart to load \u2014 read once per process, like hooks)
93
+ rovecode mcp search [query] MCP servers to install: the curated shelf, then the official registry (cached a day)
94
+ rovecode mcp info <name> publisher, version, the exact command or URL, the keys it asks for
95
+ rovecode mcp add <name> [--project] [--pick N] [--as <name>] [--yes] [--force] show the plan, ask for keys
96
+ masked, write ~/.rovecode/mcp.json (or .rovecode/mcp.json); --as renames it, --force replaces an entry
97
+ rovecode mcp remove <name> [--project] \xB7 rovecode mcp list (docs/mcp-market.md; /mcp does the same inside the TUI)
98
+ rovecode mcp show this repo's .rovecode/mcp.json + .mcp.json: exact commands/URLs, env names, trusted or not
99
+ rovecode mcp trust [--yes] \xB7 rovecode mcp untrust approve those files as they are now, or withdraw that
100
+ approval \u2014 until trusted nothing in them loads; your own add --project is trusted as you approve it
101
+ rovecode trust show every project file that could make rovecode RUN or IMPORT something, with what it would do:
102
+ .rovecode/settings.json (verify, lsp, notify_command), hooks.ts, sandbox.json, mcp.json, .mcp.json
103
+ rovecode trust [--yes] \xB7 rovecode trust untrust approve them as they are now (one store with mcp trust: path \u2192 sha256,
104
+ an edit asks again) \u2014 until trusted a cloned repo's files contribute NOTHING; the user files never ask
105
+ rovecode skills list [--json] every installed skill, its scope and path \u2014 and every SKILL.md the loader
106
+ refused or warned about, which is the only place those warnings are visible
107
+ rovecode skills validate <dir> the agentskills.io spec check, strictly: findings on stderr, exit 1, nothing written
108
+ rovecode skills pack <dir> [--out <file>] [--force] a <name>.tar.gz of one skill (a symlink inside refuses the pack)
109
+ rovecode skills install <dir|file.tar.gz|http(s)-url> [--user] [--force] staged, validated, then renamed into
110
+ place; a URL goes through the same SSRF guard as web_fetch, on the URL AND every redirect hop
111
+ rovecode market search [query] [--kind mcp|skill|plugin] one shelf over MCP servers, skills and plugins
112
+ rovecode market info <id> publisher, licence, version, exactly what an install would write
113
+ rovecode market docs <id> the item's own documentation, as the catalog carries it \u2014 no network
114
+ rovecode market install <id|kind:id|git-url|npm-pkg> [--project] [--ref <branch|tag|commit>] [--yes]
115
+ plan first, write only after you agree
116
+ rovecode market list|remove|update|sources what is installed, what is behind, where each shelf came from
117
+ rovecode market verify [id] re-hash what is installed and say what has changed since
118
+ rovecode market validate <path|url> [--kind skill|plugin] check a catalog before anyone trusts it
119
+ (docs/market.md; /market does the same inside the TUI; every subcommand takes --json)
120
+ rovecode doctor [--json] [--no-connect] one pass over the setup: home (and a legacy ~/.cumulus), the default
121
+ provider and where its key comes from (names, never values), the permission level and
122
+ which rung set it, git/node/npm/npx/uvx on PATH with what each absence costs HERE,
123
+ every configured MCP server (loads? skipped for a placeholder or an unset variable?
124
+ untrusted file? connects?), the shadow checkpoints' size \u2014 and a list of what it did
125
+ NOT check. exit 0 nothing broken \xB7 1 something to fix \xB7 a missing provider is a note
126
+ rovecode context [session] [--json] what fills the window, item by item, and how far our estimate is from
127
+ the provider's own count of the same prompt (cache reads included \u2014 they are the prompt too)
128
+ (--exact asks Anthropic to count it for real; --no-runtime skips the system prompt and tool schemas)
129
+ rovecode auth set <provider> [--key <name>] store an API key (prompts on stdin; ~/.rovecode/credentials.json)
130
+ rovecode auth login <provider> OAuth sign-in, stored next to the keys: github-copilot (GitHub device code \u2014 open the URL,
131
+ type the code) \xB7 openrouter (PKCE in your browser, back to a loopback port on this machine) \xB7
132
+ openai (ChatGPT device code; the token is sent over the Codex Responses wire only \u2014 see
133
+ ROVECODE_OPENAI_WIRE). anthropic is refused (the Claude subscription login is an owner
134
+ decision, not a port). Ctrl-C cancels (exit 130)
135
+ rovecode auth list stored providers: kind (api | oauth), key name, redacted value, and for oauth the expiry
136
+ rovecode auth remove <provider> delete a stored credential (api or oauth)
137
+ rovecode provider list [--all] providers with a key + every providers.json entry, and the default provider/model
138
+ rovecode provider add <id> <baseUrl> [--protocol openai|anthropic] [--key-env NAME] [--model <id>] [--no-key]
139
+ [--project | --user | --scope user|project] [--key]
140
+ register any OpenAI-compatible or Anthropic endpoint in ~/.rovecode/providers.json
141
+ (--project: ./.rovecode/providers.json); --key prompts for the secret (never echoed);
142
+ running TUIs/servers pick the change up live \u2014 no restart
143
+ rovecode provider remove <id> delete a providers.json entry (built-ins: rovecode auth remove <id> drops the key)
144
+ rovecode provider test <id> [model] one tiny real call \u2014 proves url + key + model together
145
+ rovecode model list [provider] model ids (providers.json "models" or the endpoint's /models); * = current default
146
+ rovecode models [provider] alias for model list
147
+ rovecode model no arguments on a terminal: every configured provider's models in one
148
+ numbered menu, the current one first; a pipe gets the usage line instead
149
+ rovecode model use <provider/model> [--project] persist the default (in the TUI: /model <provider/model> --save)
150
+ rovecode model show [provider/model] the model, its protocol, and the exact thinking field each /effort
151
+ level puts on the wire (docs/thinking.md)
152
+ rovecode sessions [--json] this folder's sessions, newest first: id \xB7 created \xB7 turns \xB7 first prompt (or the title);
153
+ reads only the sessions that hold something, and a footer counts the empty session
154
+ directories (a meta.json, nothing ever written) so they stay visible without being rows
155
+ rovecode sessions rename <id|prefix> <title\u2026> name a session (one line, \u2264 120 chars; shown in place of the first prompt)
156
+ rovecode sessions delete <id|prefix> [--yes] remove the session AND its checkpoints shadow dir; asks y/N on a
157
+ terminal, needs --yes off one; prints every path it removed
158
+ rovecode sessions fork <id|prefix> [--json] copy a session (entries, meta, attachments; up to 256 MB of attachments)
159
+ into a new id titled "\u2026 (fork #N)" \u2014 the source is untouched
160
+ rovecode sessions search <terms\u2026> [--json] title hits first, then the recall index (all terms, exact before partial)
161
+ every id here is exact or a unique prefix: ambiguous or unknown \u2192 exit 2 naming the
162
+ candidates, nothing created or removed
163
+ rovecode trace <id|prefix> the session's messages, one line each (role \xB7 first 120 chars \xB7 tool-call count)
164
+ rovecode export <session> write a session as markdown (--json: raw JSONL copy; --out <path>; --force)
165
+ rovecode eval alias for gauntlet
166
+ rovecode acp Agent Client Protocol v1 endpoint over stdio (Zed/JetBrains)
167
+ rovecode serve headless HTTP server (ROVECODE_PORT, default 4100; loopback-only)`,n=`env \u2014 every ROVECODE_* setting
168
+ ROVECODE_BASE_URL any OpenAI-compatible or Anthropic endpoint
169
+ ROVECODE_API_KEY API key (falls back to OPENAI_API_KEY)
170
+ ROVECODE_MODEL model id (e.g. zai-org/glm-5.3)
171
+ ROVECODE_MODEL_<ROLE> role fallback chain, comma-separated provider/model list; on 429/5xx
172
+ the next candidate serves. Roles: DEFAULT SMOL PLAN COMMIT TASK
173
+ (e.g. ROVECODE_MODEL_DEFAULT=kaesra/zai-org/glm-5.3-flash,openai/gpt-4o-mini)
174
+ ROVECODE_STREAM streaming is on by default (both protocols); off|json|0|false|none use the one-shot JSON
175
+ adapters; sse forces the raw SSE adapter, without the tool-call middleware, for one-shot runs
176
+ ROVECODE_OPENAI_WIRE responses | chat \u2014 which OpenAI wire a request takes. Unset: a stored ChatGPT login
177
+ (auth login openai) always takes /responses; provider openai takes /responses for models the
178
+ catalog does not mark non-reasoning (gpt-5, o3, ids it does not know) and /chat/completions
179
+ for the gpt-4o class; every other provider stays on /chat/completions. Not done yet on
180
+ /responses: the model's own reasoning items are NOT sent back to it on the next turn (each
181
+ turn reasons afresh; reasoning text still streams live) \u2014 that needs a reasoning part in
182
+ the message store, a change across the session store, export and both other wires
183
+ ROVECODE_EFFORT auto|off|low|medium|high thinking before the answer (default auto: the provider's
184
+ own default stands). Anthropic gets output_config.effort or a thinking budget,
185
+ whichever the model takes (learned from its own 400, then remembered); OpenAI gets
186
+ reasoning_effort. Thinking is billed as output and delays the first word.
187
+ ROVECODE_PROFILE model profile: off, or an id (glm-5.3 | glm-5.3-plain) whose PROMPT section is forced onto
188
+ every model (request fields always follow the model id). Unset = by model id: GLM-5.3 / -Flash
189
+ get the Claude Sonnet 5 persona + the working agreement appended to the system prompt
190
+ (glm-5.3-plain = agreement only) plus, on OpenAI-compatible providers, Z.ai's
191
+ request fields (thinking always on, reasoning_effort low|high|max \u2014 off leaves the endpoint's
192
+ max, medium rounds up to high, high means max \u2014 and tool_stream when streaming). The text
193
+ comes from .rovecode/profiles/<id>.md (project) or ~/.rovecode/profiles/<id>.md when present.
194
+ ROVECODE_DESIGN off drops the interface-design section from the system prompt (for runs with no UI in
195
+ them). Otherwise every run carries it: propose three distinct directions before the first
196
+ UI in a project, let the human choose, record it with design_direction, then build to it.
197
+ The section prescribes NO palette, typeface or layout -- there is no default look, on
198
+ purpose -- and names the patterns to climb out of (amber accents, the reflex full-viewport
199
+ hero, Inter/Roboto/Poppins, hairlines round everything, all-square corners, everything
200
+ centred, violet gradients). The choice lives in .rovecode/design.json; design_audit counts
201
+ those patterns in the files you touched and checks them against it.
202
+ ROVECODE_PERMISSION ask|accept-edits|auto \u2014 the level this run starts at. Ladder, widest first:
203
+ a CLI flag, then this, then <cwd>/.rovecode/settings.json, then ~/.rovecode/settings.json,
204
+ then "ask". Write the files with /yolo --save or /accept-edits --save [--project].
205
+ ROVECODE_ACCEPT_EDITS=1 start in accept-edits (writes inside the workspace do not ask)
206
+ ROVECODE_YOLO=1 ${f}: allow all tool actions
207
+ ROVECODE_TUI cockpit | classic \u2014 force the TUI surface (the cockpit still needs a TTY; --classic wins)
208
+ ROVECODE_THEME cockpit palette: night (default) | ember | contrast (/theme switches it live)
209
+ ROVECODE_PET=0 hide the pet panel (rovecode); --pet <name> renames it
210
+ ROVECODE_NOTIFY off | auto | bell | osc9 | osc777 \u2014 how the TUI tells you a run ended or a card needs you, ONLY while
211
+ the terminal is unfocused (auto = an OSC 9 toast on Ghostty/iTerm2/kitty/Warp/WezTerm, else the bell;
212
+ settings.json "bell": false is off; a terminal that never reports focus stays silent)
213
+ ROVECODE_NOTIFY_WHEN unfocused (default; the terminal must report focus \u2014 Windows Terminal \u2265 1.14, Ghostty, kitty, WezTerm,
214
+ iTerm2, xterm, VTE) | always (every run, as before 2026-09-07)
215
+ ROVECODE_NOTIFY_COMMAND a desktop hook under the same gate: argv as a JSON string array (["notify-send","rovecode"]) or
216
+ whitespace-split words, the JSON payload appended as its last argument; never a shell. From a project
217
+ settings.json it applies only once that file is trusted; the user file and this variable always may
218
+ ROVECODE_SANDBOX executor rung for bash: direct (default) | wsl | docker; beats .rovecode/sandbox.json {"rung","dockerImage"}
219
+ ROVECODE_SANDBOX_IMAGE image for the docker rung (default debian:stable-slim; must contain bash)
220
+ ROVECODE_RETRY_MAX same-model retries after a 429/5xx/transport failure (default 3 = 4 attempts; 0 = off)
221
+ The wait is announced live, while it is happening, not in a summary after the run
222
+ ROVECODE_RETRY_BASE_MS cap of the FIRST backoff, ms (default 1000; full jitter; a Retry-After hint is a floor)
223
+ It doubles per attempt up to 20 s, and a server hint can raise the wait, never shorten it
224
+ ROVECODE_FIRST_BYTE_TIMEOUT_MS how long a provider may go without ANY response before the request
225
+ counts as failed and is retried (default 60000). Only the FIRST byte is on this clock:
226
+ once the model is talking, the body may take as long as it takes
227
+ ROVECODE_WEBFETCH_TIMEOUT_MS web_fetch request timeout in ms (default 30000)
228
+ EXA_API_KEY optional Exa key for web_search; without it the search runs keyless against the
229
+ same hosted endpoint. Read only where the tool is registered, never stored, and
230
+ stripped from every URL and error line the tool prints
231
+ ROVECODE_WEBFETCH_ALLOW_PRIVATE=1 let web_fetch reach loopback/private hosts (SSRF guard escape for local dev)
232
+ ROVECODE_COMPACTION history compaction strategy: head-summarize (default) | keep-window | provider-native
233
+ /compact runs the same set on demand (TUI + --plain); on this build it keeps
234
+ the window and notes "no summarizer wired on this surface" \u2014 a manual compaction
235
+ is durable (new session branch, marker persisted) even when it falls back
236
+ ROVECODE_TASKS_MAX concurrent background tasks (default 3; further task starts queue FIFO)
237
+ ROVECODE_OTEL_ENDPOINT OTLP/HTTP collector, e.g. http://host:4318 \u2014 one trace per run (run \u2283 turn \u2283 tool); unset = off
238
+ ROVECODE_OTEL_HEADERS extra OTLP headers as k=v,k2=v2 (e.g. authorization=Bearer \u2026)
239
+ ROVECODE_REFLECTION=0 disable reflection nudges after failed edits; ROVECODE_REFLECTION_MAX caps them per run (default 2)
240
+ ROVECODE_PORT port for rovecode serve (default 4100; loopback-only)
241
+ ROVECODE_IMAGE_MAX_BYTES per-image cap in bytes for pasted and attached images (default 5 MB;
242
+ at most 8 images per message). Over it, the image is refused by name, not silently dropped.
243
+ ROVECODE_REPOMAP_TOKENS repo-map budget in tokens (default 1024); ROVECODE_NO_REPOMAP=1 drops the map entirely
244
+ ROVECODE_HOOK_TIMEOUT_MS per-hook-call budget in ms (default 5000); ROVECODE_NO_HOOKS=1 skips hook files
245
+ ROVECODE_PLUGIN_TIMEOUT_MS per-plugin import + tools() budget in ms (default 5000);
246
+ ROVECODE_NO_PLUGINS=1 skips plugin discovery
247
+ ROVECODE_NO_CHECKPOINTS=1 turn off the shadow-git checkpoints taken after mutating tools
248
+ ROVECODE_TOOL_MIDDLEWARE=1 force the text tool-call protocol (a prompt block + a parser) even for a model
249
+ the catalog says has native tool calling; ROVECODE_NO_TOOL_MIDDLEWARE=1 forces native only
250
+ ROVECODE_EVAL_CELL=1 register the persistent eval cell tool (a REPL that keeps state between calls)
251
+ ROVECODE_MAX_TURNS turn ceiling for one run, every surface (TUI included); a hit ends it with status
252
+ "budget" and exit 1
253
+ ROVECODE_MAX_SECONDS the same as a wall clock, or "off". Every surface honours it, but only
254
+ one-shot runs have a DEFAULT (1200 s) \u2014 the TUI has no clock unless this sets one
255
+ ROVECODE_MAX_COST the same in dollars for one run (--max-cost on a one-shot run), or "off"; no default
256
+ ROVECODE_FINISH_CHECK=0 turn off the once-per-run finish check: when the model stops right after a failed tool
257
+ call or an unanswered question, it is asked ONCE to finish or say what is left; the next
258
+ reply ends the run either way. "done \xB7 \u2026" on run_end still names what was left
259
+ ROVECODE_VERIFY=1 turn ON the verify gate (off by default): a run that wrote files runs the project's configured
260
+ check before "done"; a failure goes back to the model once, then "done \xB7 check failed (\u2026)" says
261
+ so. No check configured \u2192 nothing runs, run_end says "not verified". ROVECODE_VERIFY_TIMEOUT=<s> (120)
262
+ ROVECODE_LSP the language-server table behind the per-edit diagnostics gate: "ext[,ext]=argv;\u2026" merged over
263
+ the built-in ".ts,.tsx,.mts,.cts,.js,.jsx,.mjs,.cjs=typescript-language-server --stdio"; "ext=off"
264
+ drops one, "off" drops all; overrides the settings key lsp. A server not on PATH is named at boot
265
+ ROVECODE_HOME credentials + user-scope providers/commands dir (default ~/.rovecode)
266
+ providers: built in \u2014 kaesra openai anthropic deepseek groq openrouter ollama lmstudio
267
+ together mistral cerebras fireworks perplexity xai moondream vllm
268
+ plus anything in ~/.rovecode/providers.json or ./.rovecode/providers.json (rovecode provider add)
269
+ key: rovecode auth set <id>, or set <ID>_API_KEY \u2014 stored creds beat env;
270
+ default: providers.json "default" ("provider/model"), ROVECODE_MODEL overrides the model,
271
+ ROVECODE_BASE_URL/ROVECODE_API_KEY always wins`;function a(Q=""){switch(Q){case"":return u;case"env":return n;case"advanced":return p;case"all":return`${u}
272
+
273
+ ${p}
274
+
275
+ ${n}`;default:return`${u}
276
+
277
+ no help topic "${Q}" \u2014 topics: env \xB7 advanced \xB7 all`}}Yq();import{join as v}from"path";if(process.env.ROVECODE_TRACE_BOOT==="1")process.env._ROVECODE_BOOT_T0=String(Date.now());var C=t(process.argv),S=C.cmd;if(process.argv.includes("--version")){console.log(k.version);let{checkForUpdate:Q,updateLine:z}=await import("./update-check-ygt3vd7m.js"),Z=z(await Q(k.version,{cacheOnly:!0}),!0);if(Z!==null)console.error(Z);process.exit(0)}async function Zq(){let{resolveProvider:Q,providerStream:z,providerStreaming:Z,wantsStreaming:V}=await import("./stream-4wmyaypz.js"),{mockStream:B,textTurn:F}=await import("./stream-4wmyaypz.js"),{MOCK_PROVIDER_TEXT:W}=await import("./voice-g1gtck92.js"),X=Q();if(X)return{stream:V({ROVECODE_STREAM:process.env.ROVECODE_STREAM})?Z(X):z(X),model:{provider:X.id,model:process.env.ROVECODE_MODEL??X.defaultModel??"gpt-4o-mini"},real:!0,providerId:X.id};return{stream:B({turns:[F(W)]}),model:{provider:"mock",model:"default"},real:!1,providerId:"mock"}}async function $q(){let{providerPreflight:Q}=await import("./gauntlet-r3xxaszc.js"),{stream:z,model:Z}=await Zq();try{await Q(z,Z)}catch(V){let B=V instanceof Error?V.message:String(V);console.error(`error: ${B}`),console.error(`hint: check ROVECODE_BASE_URL (${process.env.ROVECODE_BASE_URL??"not set"}) and ROVECODE_API_KEY; aborting before running tasks.`),process.exit(2)}}async function i(Q){let{agentLoop:z}=await import("./loop-12twjcat.js"),{bootRuntime:Z}=await import("./runtime-j19fjbsa.js"),{SandboxConfigError:V}=await import("./sandbox-config-g4qxd7y5.js"),{WorkspaceRootError:B}=await import("./workspace-9rq1w4ta.js"),{parseAddDirs:F}=await import("./run-flags-rysbag9t.js"),{mockStream:W,textTurn:X,resolveProvider:K,providerStreaming:j}=await import("./stream-4wmyaypz.js"),{MOCK_PROVIDER_TEXT:Y}=await import("./voice-g1gtck92.js"),{summarizePlugins:J}=await import("./index-z5qt1s76.js"),{resolvePermission:G}=await import("./settings-y9rzcqx8.js"),{buildRunDeps:$,createOutputSink:N,guardStdout:I,parseOutputMode:U,runPromptWords:R}=await import("./output-satndjap.js"),{expandSlashPrompt:O}=await import("./commands-3p7e4xxs.js"),{resetTurnFailureCount:b}=await import("./tools-x1tj4fxm.js"),E=U(process.argv),L=e(process.argv,process.env,{defaultSeconds:1200});if("error"in L)console.error(`error: ${L.error}`),process.exit(2);let x=F(process.argv),P={write:process.stdout.write.bind(process.stdout)};if(E!=="text")I(process.stderr);let M=process.argv.includes("--yolo")||process.env.ROVECODE_YOLO==="1",y=K(),T=y&&process.env.ROVECODE_STREAM==="sse"?j(y):void 0,H=await Z({...T?{stream:T}:{},...x.length>0?{addDirs:x}:{}}).catch((_)=>{if(_ instanceof V||_ instanceof B)console.error(`error: ${_.message}`),process.exit(2);throw _}),A=process.env.ROVECODE_MOCK==="1",g=H.provider&&!A?{provider:H.provider.id,model:process.env.ROVECODE_MODEL??H.provider.defaultModel??"gpt-4o-mini"}:{provider:"mock",model:"default"},r=!A&&H.stream!==null&&H.noProviderReason()===null?H.stream:W({turns:[X(Y)]});H.hooks.onWarning((_)=>console.error(`hooks: ${_}`)),H.plugins.onWarning((_)=>console.error(_));let l=J(H.plugins.found);if(l!==null)console.error(l);H.onRouterNote((_)=>console.error(_));let m=async(_)=>{return H.tasks.cancelAll(),await H.tasks.drain(2000),H.bashJobs.dispose(),await H.hooks.close(),await H.mcp?.close().catch(()=>{}),process.exit(_)},h=N(E,{stdout:E==="text"?process.stdout:P,stderr:process.stderr,model:g,messages:()=>H.store.messages()});if(H.noProviderReason()!==null&&!A){let _=H.noProviderReason();if(E==="text")console.error(`error: ${_}`);else P.write(`${JSON.stringify({status:"error",summary:_,error:_,exitCode:2})}
278
+ `);await m(2)}let c=w(process.argv[process.argv.indexOf("--effort")+1]);if(c!==void 0)H.setEffort(c);H.setRunLimits(L);let qq=G(H.cwd,M?"auto":process.argv.includes("--accept-edits")?"accept-edits":void 0,{ROVECODE_PERMISSION:process.env.ROVECODE_PERMISSION,ROVECODE_YOLO:process.env.ROVECODE_YOLO,ROVECODE_ACCEPT_EDITS:process.env.ROVECODE_ACCEPT_EDITS});for await(let _ of z(H.buildDef(g),Q,{},H.buildCfg(qq),$(H,r,h),H.steering)){if(_.type==="turn_start")b();if(h.onEvent(_),_.type==="run_end")await m(h.finish(_))}await m(h.finish())}async function zq(){if(process.argv.includes("--live"))return Bq();await $q();let{runGauntlet:Q,reportResults:z,basicTasks:Z,codingTasks:V,failureTasks:B,adversarialTasks:F}=await import("./gauntlet-r3xxaszc.js"),{wave3Tasks:W}=await import("./gauntlet-wave3-bnkjk2v2.js"),{wave4Tasks:X}=await import("./gauntlet-wave4-acs9s60q.js"),{runTask:K}=await import("./gauntlet-runner-r515m7kk.js"),j=[...Z(),...V(),...B(),...F(),...W(),...X()],Y=await Q({tasks:j,runner:(J,G)=>K(J,G)});console.log(z(Y)),process.exit(Y.some((J)=>!J.pass)?1:0)}async function Bq(){let{bootRuntime:Q}=await import("./runtime-j19fjbsa.js"),{SandboxConfigError:z}=await import("./sandbox-config-g4qxd7y5.js"),{runGauntlet:Z,reportResults:V,providerPreflight:B}=await import("./gauntlet-r3xxaszc.js"),{liveGauntletTasks:F,runTaskLive:W}=await import("./gauntlet-runner-r515m7kk.js"),{profileFor:X,profileHint:K}=await import("./profiles-sfhpbq3m.js"),{ProviderRegistry:j}=await import("./registry-y1y8e94r.js"),{rmSync:Y}=await import("fs"),J=await Q().catch((M)=>{if(M instanceof z)console.error(`error: ${M.message}`),process.exit(2);throw M}),G=async(M)=>{if(J.bashJobs.dispose(),await J.hooks.close(),await J.mcp?.close().catch(()=>{}),J.store.messages().length===0)Y(v(J.cwd,".rovecode","sessions",J.sessionId),{recursive:!0,force:!0});return process.exit(M)},$=J.noProviderReason();if($!==null||J.stream===null||J.provider===null)console.error(`error: ${$??"no provider configured"}`),await G(2);let{provider:N,stream:I}=J,U=process.argv.indexOf("--model"),R=U>=0?process.argv[U+1]:void 0,O=R?J.providers.resolveSelector(R,N.id):{provider:N.id,model:J.defaultModel||N.defaultModel||""};if("error"in O)console.error(`error: ${O.error}`),await G(2);let b=O;if(!b.model)console.error("error: no model \u2014 pass --model <provider/model> or set a default (rovecode model use \u2026)"),await G(2);let E=w(process.argv[process.argv.indexOf("--effort")+1]);if(E!==void 0)J.setEffort(E);let L=K();if(L)console.error(`note: ${L}`);try{await B(I,b)}catch(M){console.error(`error: ${M instanceof Error?M.message:String(M)}`),await G(2)}let x=F();console.log(`Gauntlet (live): ${b.provider}/${b.model} \xB7 effort ${J.effort} \xB7 profile ${X(b)?.id??"none"} \xB7 ${x.length} tasks`);let P=await Z({tasks:x,runner:(M,y,T)=>W(M,y,J,b,T)});console.log(V(P)),await G(P.some((M)=>!M.pass)?1:0)}async function Xq(){let{runBenchmarks:Q}=await import("./bench-xv3ypwev.js"),z=await Q();for(let Z of z)console.log(`${Z.harness.padEnd(8)} ${Z.task.padEnd(28)} ${Z.pass?"PASS":"FAIL"} ${Z.durationMs}ms ${Z.toolCalls} calls`);process.exit(z.some((Z)=>!Z.pass)?1:0)}async function Kq(){let{ToolRegistry:Q}=await import("./tools-2ftsya7w.js"),{readTool:z,editTool:Z,writeTool:V,bashTool:B}=await import("./hashline-ewg5hbe3.js"),{globTool:F,grepTool:W,lsTool:X}=await import("./files-cez9a96p.js"),{webFetchTool:K}=await import("./webfetch-0nnrjgb5.js"),{webSearchTool:j}=await import("./websearch-f0vr2p7d.js"),{todoTools:Y}=await import("./todo-1wxpcecx.js"),{askUserTool:J}=await import("./ask-user-p8hq4xgj.js"),{TaskManager:G}=await import("./tasks-12v9rr9k.js"),{createTaskTool:$,createTaskStatusTool:N}=await import("./task-eg4s093s.js"),{ProviderRegistry:I}=await import("./registry-y1y8e94r.js"),{providerListTool:U,providerEditTool:R}=await import("./provider-kwzq6g84.js"),{designAuditTool:O,designDirectionTool:b}=await import("./design-122y0axd.js"),{loadPlugins:E}=await import("./index-z5qt1s76.js"),L=new Q;L.register(z,Z,V,B,F,W,X),L.register(K,j),L.register(...Y(v(process.cwd(),".rovecode","sessions"))),L.register(J(()=>{return}));let x=new G({deps:()=>null});L.register($(x),N(x));let P=new I(process.cwd());L.register(U(P),R(P)),L.register(O(),b());let{plugins:M,warnings:y}=await E(process.cwd()),T=new Set(L.list().map((H)=>H.schema.name));for(let H of M)for(let A of H.tools){if(T.has(A.schema.name)){y.push(`plugin ${H.name}: tool "${A.schema.name}" is already registered \u2014 refused`);continue}T.add(A.schema.name),L.register(A)}for(let H of y)console.error(`plugins: ${H}`);for(let H of L.list())console.log(`${H.schema.name.padEnd(8)} ${H.kind.padEnd(8)} sequential=${H.sequential!==!1}`),console.log(` ${H.schema.description}`)}function o(Q=""){console.log(a(Q))}async function Wq(Q){let{saveCredential:z,removeCredential:Z,listProviders:V,credentialsPath:B,readSecret:F}=await import("./auth-m8p9grty.js"),{ProviderRegistry:W}=await import("./registry-y1y8e94r.js"),{isConfigured:X}=await import("./provider-config-hv3xtdt4.js"),K=Q[0]??"",j=process.argv.indexOf("--key"),Y=j!==-1?process.argv[j+1]:void 0,J=Y!==void 0&&!Y.startsWith("-")?Y:void 0,G=Q.slice(1).filter((I)=>I!==J),$=G[0];if(K==="list"){let I=V();if(process.argv.includes("--json")){console.log(JSON.stringify({path:B(),credentials:I.map((U)=>({provider:U.provider,kind:U.kind,keyName:U.keyName,redacted:U.redacted,...U.expires!==void 0?{expires:U.expires}:{}}))},null,2));return}(await import("./auth-login-ewpgw5sm.js")).printAuthList();return}if(K==="login"){process.exitCode=await(await import("./auth-login-ewpgw5sm.js")).cmdAuthLogin(G);return}if(K==="set"&&$!==void 0){let I=new W(process.cwd()),U=I.get($);if(U===void 0)console.error(`error: unknown provider "${$}" \u2014 known: ${I.ids().join(" ")}`),console.error(`hint: register a custom endpoint first: rovecode provider add ${$} <baseUrl>`),process.exit(1);let R=J??U.keyEnv,O=await F(`${R} for ${$}: `);if(O.length===0)console.error("error: empty secret \u2014 nothing stored"),process.exit(1);z($,O,J),console.log(`stored ${R} for ${$} in ${B()}`);return}if(K==="remove"&&$!==void 0){if(!Z($))console.error(`error: no stored credential for ${$}`),process.exit(1);console.log(`removed credential for ${$}`);return}let{AUTH_LOGIN_USAGE:N}=await import("./auth-login-ewpgw5sm.js");console.error(`usage: rovecode auth set <provider> [--key <name>] | rovecode auth list | rovecode auth remove <provider> | ${N.replace(/^usage: /,"")}`),process.exit(1)}function D(Q){let z=process.argv.indexOf(Q);return z===-1?[]:process.argv.slice(z+1).filter((Z)=>Z!=="--yolo"&&Z!=="--plain"&&Z!=="--classic")}async function jq(Q){let{ProviderRegistry:z,formatProviderList:Z,parseAddArgs:V,ADD_USAGE:B}=await import("./registry-y1y8e94r.js"),{isConfigured:F,providersPathFor:W}=await import("./provider-config-hv3xtdt4.js"),{saveCredential:X,credentialsPath:K,readSecret:j}=await import("./auth-m8p9grty.js"),Y=new z(process.cwd()),[J,...G]=Q;if(J===void 0||J==="list"){if(G.includes("--json")){let $=Y.defaultRef(),N=G.includes("--all"),I=Y.list().filter((U)=>N||F(U)||U.scope!=="builtin").map((U)=>({id:U.id,protocol:U.protocol,baseUrl:U.baseUrl,keyEnv:U.keyEnv,defaultModel:U.defaultModel??null,configured:F(U),scope:U.scope??null}));console.log(JSON.stringify({default:$??null,providers:I,warnings:Y.warnings()},null,2));return}console.log(Z(Y,{all:G.includes("--all")}));return}if(J==="add"){let $=V(G);if("error"in $)console.error(`error: ${$.error}`),process.exit(2);let N=Y.add($.spec,$.scope);if("error"in N)console.error(`error: ${N.error}`),process.exit(1);if(console.log(`added ${N.id} (${N.protocol}, ${N.baseUrl}) to ${W($.scope,process.cwd())}`),$.promptKey){let I=await j(`${N.keyEnv} for ${N.id}: `);if(I.length===0)console.error("error: empty secret \u2014 provider kept, no key stored"),process.exit(1);X(N.id,I,N.keyEnv),console.log(`stored ${N.keyEnv} for ${N.id} in ${K()}`)}else if(!F(N))console.log(`no key yet: rovecode auth set ${N.id} (or set ${N.keyEnv}; picked up live, no restart)`);if(Y.refresh()&&Y.defaultRef()?.provider!==N.id)console.log(`make it the default: rovecode model use ${N.id}/${N.defaultModel??"<model>"}`);return}if(J==="remove"&&G[0]!==void 0){let $=Y.remove(G[0]);if("error"in $)console.error(`error: ${$.error}`),process.exit(1);console.log($.removed.length>0?`removed ${G[0]} from the ${$.removed.join(" and ")} providers.json`:`${G[0]} was not in any providers.json`);return}if(J==="test"&&G[0]!==void 0){let $=await Y.probe(G[0],G[1]);console.log(`${G[0]}/${$.model}: ${$.detail}`),process.exit($.ok?0:1)}console.error(`usage: rovecode provider list [--all] | rovecode provider ${B} [--key] | rovecode provider remove <id> | rovecode provider test <id> [model]`),process.exit(2)}async function s(Q){let{ProviderRegistry:z}=await import("./registry-y1y8e94r.js"),{isConfigured:Z,providersPathFor:V}=await import("./provider-config-hv3xtdt4.js"),B=new z(process.cwd()),F=Q.filter((K)=>!K.startsWith("-")),[W,X]=F;if(W==="list"){let K=X??B.defaultRef()?.provider;if(K===void 0)console.error("error: no provider configured \u2014 rovecode provider add <id> <baseUrl>"),process.exit(1);let j=await B.models(K);if(!j.ok)console.error(`error: ${j.error}`),process.exit(1);let Y=B.defaultRef();if(Q.includes("--json")){console.log(JSON.stringify({provider:K,models:j.models.map((J)=>({id:J,ref:`${K}/${J}`,default:Y?.provider===K&&Y.model===J}))},null,2));return}if(j.models.length===0)console.log(`${K}: the endpoint listed no models (no /models route?) \u2014 pass one directly: rovecode model use ${K}/<model>`);for(let J of j.models)console.log(`${Y?.provider===K&&Y.model===J?"*":" "} ${K}/${J}`);return}if((W===void 0||W==="use"&&X===void 0)&&process.stdin.isTTY===!0){let K=await Hq(B);if(K===null)return;let j=B.setDefault(K,Q.includes("--project")?"project":"user");if("error"in j)console.error(`error: ${j.error}`),process.exit(1);console.log(`default \u2192 ${j.provider}/${j.model} (${V(Q.includes("--project")?"project":"user",process.cwd())}; running TUIs switch live)`);return}if(W==="use"&&X!==void 0){let K=Q.includes("--project")?"project":"user",j=B.setDefault(X,K);if("error"in j)console.error(`error: ${j.error}`),process.exit(1);console.log(`default \u2192 ${j.provider}/${j.model} (${V(K,process.cwd())}; running TUIs switch live)`);let Y=B.get(j.provider);if(Y!==void 0&&!Z(Y))console.log(B.keyHint(Y));return}if(W==="show"){let{ModelCatalog:K,describePricing:j}=await import("./catalog-737wb2s0.js"),{thinkingReport:Y}=await import("./thinking-a5ngvqyh.js"),J=X!==void 0?B.resolveSelector(X,B.defaultRef()?.provider??""):B.defaultRef();if(J===null)console.error("error: no default model \u2014 rovecode model use <provider/model>"),process.exit(1);if("error"in J)console.error(`error: ${J.error}`),process.exit(1);let G=B.get(J.provider),$=new K().lookup(J.provider,J.model),N={...J,effort:w(process.env.ROVECODE_EFFORT)??"auto",...$?.supportsReasoning!==void 0?{reasoning:$.supportsReasoning}:{}},I=$===void 0?"unpriced \u2014 not in models.dev, not in rovecode's own table (/cost shows tokens only)":$.source==="local"?`priced from rovecode's own table, not models.dev (${$.sourceNote})`:"models.dev";for(let U of Y(N,G?.protocol??"openai",{source:X!==void 0?"as named":"the default",catalog:I}))console.log(U);if($!==void 0)for(let U of j($))console.log(` ${U}`);return}console.error("usage: rovecode model list [provider] | rovecode model use <provider/model> [--project] | rovecode model show [provider/model]"),process.exit(2)}async function Vq(Q){let{ProviderRegistry:z}=await import("./registry-y1y8e94r.js"),{askLine:Z,runSetup:V}=await import("./setup-jmbr11j0.js"),B=new z(process.cwd());if(Q.length===0)return V({registry:B});let{parseConnectArgs:F,runConnect:W}=await import("./connect-3q93d7cb.js"),X=F(Q);if("error"in X)return console.error(`error: ${X.error}`),2;return W(X,{registry:B})}async function Hq(Q){let{isConfigured:z}=await import("./provider-config-hv3xtdt4.js"),{askLine:Z}=await import("./setup-jmbr11j0.js"),V=Q.list().filter(z).map((Y)=>Y.id);if(V.length===0)console.error("error: no provider is configured yet \u2014 run: rovecode connect"),process.exit(1);console.log(`fetching models from ${V.length} provider${V.length===1?"":"s"}\u2026`);let B=await Promise.all(V.map(async(Y)=>({id:Y,r:await Q.models(Y)}))),F=Q.defaultRef(),W=[];for(let{id:Y,r:J}of B){if(!J.ok){console.log(` (${Y}: ${J.error})`);continue}for(let G of J.models)W.push(`${Y}/${G}`)}if(W.length===0)console.error("error: no models to choose from"),process.exit(1);let X=F?`${F.provider}/${F.model}`:null;W.sort((Y,J)=>Number(J===X)-Number(Y===X)),W.forEach((Y,J)=>console.log(` ${String(J+1).padStart(2)} ${Y===X?"* ":" "}${Y}`));let K=(await Z(`Which one? [1-${W.length}, empty = cancel]: `)).trim();if(K.length===0)return console.log("cancelled \u2014 nothing changed"),null;let j=Number(K);if(!Number.isInteger(j)||j<1||j>W.length)console.error(`error: "${K}" is not one of 1-${W.length}`),process.exit(2);return W[j-1]}async function Gq(Q){let{SessionStore:z}=await import("./session-ed250d9j.js"),Z=new z(v(process.cwd(),".rovecode","sessions"),Q),V=Z.reload();if(V.length>0)console.error(`warning: ${V.length} corruption(s):`,V);for(let B of Z.messages()){let F=B.parts.filter((X)=>X.kind==="text").map((X)=>X.text).join(""),W=B.parts.filter((X)=>X.kind==="tool_call").length;console.log(`${B.role.padEnd(10)} ${F.slice(0,120)}${W?` [+${W} tool call(s)]`:""}`)}}var Nq=new Set(["run","gauntlet","eval","bench","tools","plugin","skills","mcp","market","context","doctor","auth","provider","model","models","setup","connect","trace","help","chat","repl","smoke-tui","acp","serve","export","sessions","trust","update"]);if(S===""||S==="chat"||S==="repl")await(await import("./start-chat-p01cdks3.js")).startChat(C);else if(Nq.has(S))switch(S){case"run":{let{expandSlashPrompt:Q}=await import("./commands-3p7e4xxs.js"),{runPromptWords:z,readPipedStdin:Z,withPipedInput:V}=await import("./output-satndjap.js"),B=z(C,process.argv).join(" "),F=process.argv.includes("--no-stdin")?"":await Z(process.stdin,{note:(W)=>console.error(W)});await i(Q(V(B,F)||"hello",process.cwd()));break}case"gauntlet":case"eval":await zq();break;case"bench":await Xq();break;case"tools":await Kq();break;case"plugin":process.exitCode=await(await import("./cli-arhg40m0.js")).cmdPlugin(D("plugin"));break;case"mcp":process.exitCode=await(await import("./mcp-market-cmd-mbeshfyd.js")).cmdMcp(D("mcp"));break;case"trust":process.exitCode=await(await import("./trust-cmd-hccxehzb.js")).cmdTrust(D("trust"),process.cwd());break;case"market":process.exitCode=await(await import("./market-cmd-bm5xvn9f.js")).cmdMarket(D("market"));break;case"skills":process.exitCode=await(await import("./skills-cmd-zbdy99v6.js")).cmdSkills(D("skills"),process.cwd());break;case"context":process.exitCode=await(await import("./context-cmd-eqxmxhzq.js")).cmdContext(D("context"));break;case"doctor":process.exitCode=await(await import("./doctor-x4jkv72e.js")).cmdDoctor(D("doctor"));break;case"setup":{let{runSetup:Q}=await import("./setup-jmbr11j0.js"),{ProviderRegistry:z}=await import("./registry-y1y8e94r.js");process.exitCode=await Q({registry:new z(process.cwd())});break}case"connect":process.exitCode=await Vq(D("connect"));break;case"help":o(C.rest[0]??"");break;case"auth":await Wq(C.rest);break;case"provider":await jq(D("provider"));break;case"model":await s(D("model"));break;case"update":process.exitCode=await(await import("./update-cmd-v23qhr8c.js")).cmdUpdate(D("update"),k.version,import.meta.path);break;case"models":await s(["list",...D("models")]);break;case"trace":{let{resolveSessionArg:Q}=await import("./session-arg-txmn5g4x.js");await Gq(Q("rovecode trace",v(process.cwd(),".rovecode","sessions"),C.rest[0]));break}case"export":(await import("./export-pdgdhkch.js")).cmdExport(process.argv);break;case"sessions":process.exitCode=(await import("./sessions-cmd-adw7svfn.js")).cmdSessions(process.argv,process.cwd());break;case"smoke-tui":{if(process.argv.includes("--sextant")){await(await import("./sextant-smoke-tcth0vea.js")).runSextantSmoke();break}let Q=await import("./smoke-1bg937kx.js").catch((z)=>{if(z?.code==="ERR_MODULE_NOT_FOUND")return null;throw z});if(Q===null)console.error("smoke-tui is dev-only \u2014 run from a source checkout with devDependencies installed"),process.exit(1);await Q.runTuiSmoke();break}case"acp":await(await import("./server-r0b6bksk.js")).runAcpStdio({yolo:C.yolo});break;case"serve":{let{startServer:Q}=await import("./http-n0kehsk8.js"),z=Number(process.env.ROVECODE_PORT??"")||void 0,Z=Q({...z!==void 0?{port:z}:{},yolo:C.yolo});for(let V of["SIGTERM","SIGINT"])process.once(V,()=>{Promise.resolve(Z.stop()).then(()=>process.exit(0),()=>process.exit(1))});console.log(`rovecode server listening on ${Z.url} \u2014 POST /session \xB7 POST /session/:id/prompt (SSE) \xB7 DELETE /session/:id/prompt \xB7 GET /session/:id/tasks \xB7 GET /sessions \xB7 GET /doc`);break}default:o();break}else{let{pathShaped:Q}=await import("./dispatch-b4egzvvh.js");if(Q(S)){let W=process.argv.slice(process.argv.indexOf(S)).map((Y)=>/\s/.test(Y)?JSON.stringify(Y):Y).join(" "),X=`"${S}" looks like a path, not a prompt. A bare prompt is sent to your provider and billed; for a command see \`rovecode help\`, to send it as a prompt anyway: rovecode run ${W}`;if(!process.stdin.isTTY||!process.stderr.isTTY)console.error(`error: ${X}`),process.exit(2);let{askLine:K}=await import("./setup-jmbr11j0.js"),j=(await K(`${X}
279
+ Send it as a prompt? [y/N] `)).trim().toLowerCase();if(j!=="y"&&j!=="yes")console.error("nothing sent"),process.exit(2)}let{expandSlashPrompt:z}=await import("./commands-3p7e4xxs.js"),{runPromptWords:Z,readPipedStdin:V,withPipedInput:B}=await import("./output-satndjap.js"),F=process.argv.includes("--no-stdin")?"":await V(process.stdin,{note:(W)=>console.error(W)});await i(z(B(Z(C,process.argv).join(" "),F),process.cwd()))}
@@ -0,0 +1,5 @@
1
+ // @bun
2
+ import{Db as XJ,Fb as h,Gb as w,Hb as f,Ib as c,ub as q,vb as JJ,wb as _,xb as d,yb as p}from"./main-tjvwmscs.js";import{Jb as DJ,Kb as KJ,Lb as gJ,Ob as EJ,Pb as UJ,Qb as PJ,Rb as u,Sb as g,Tb as CJ,Ub as uJ}from"./main-hzwtsb2m.js";import"./main-m8vm17zq.js";import{Zb as WJ,ac as k,cc as HJ,dc as fJ}from"./main-zc7pyrbj.js";import{ec as e,oc as AJ}from"./main-45ejth3a.js";import{pc as BJ,xc as kJ}from"./main-jak598k9.js";import"./main-7kt6r53y.js";import"./main-f33fc5je.js";import"./main-2zgsknth.js";import"./main-kwwsz6rq.js";import{Ng as YJ,Vg as xJ}from"./main-7jd5vh3x.js";import"./main-xt9zc3n6.js";import"./main-2rzbexn2.js";import"./main-y5c82rxr.js";import{$m as hJ,Lm as VJ,_m as o}from"./main-2yeveeve.js";import"./main-0jys2ccn.js";import"./main-nqveez48.js";import{xn as yJ}from"./main-qsevpgsv.js";hJ();p();c();p();c();AJ();var FJ=/^(?:https?:\/\/|git@|ssh:\/\/|git:\/\/)|\.git$/i,qJ=/^(?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*$/i,TJ=/^(?:\.{1,2}[\\/]|[A-Za-z]:[\\/]|[\\/])/,MJ=(J)=>FJ.test(J),SJ=(J)=>TJ.test(J),LJ=(J)=>qJ.test(J)&&(J.startsWith("@")||J.includes("-"));function x(J,Z,X,$){return{id:Z,kind:J,title:Z,publisher:"unknown (you named this source)",description:$,source:"catalog",tags:[],env:[],install:X}}function t(J,Z){let X=J.trim();if(MJ(X)){if(Z==="mcp")return null;return Z==="skill"?x("skill",s(X),{kind:"skill",source:{git:X}},`a skill cloned from ${X}`):x("plugin",s(X),{kind:"plugin",source:X,git:!0},`a plugin cloned from ${X}`)}if(SJ(X)){if(Z!==void 0&&Z!=="plugin")return null;return x("plugin",X.split(/[\\/]/).filter(Boolean).pop()??"plugin",{kind:"plugin",source:X,git:!1},`a plugin copied from ${X}`)}if((Z===void 0||Z==="mcp")&&LJ(X)){let $={key:X,title:X,description:`an MCP server run with npx ${X}`,source:"registry",publisher:X.startsWith("@")?X.slice(1).split("/")[0]:"unknown",installs:[{kind:"stdio",runtime:"npx",command:"npx",args:["-y",X],env:[],pending:[]}]};return x("mcp",e(X),{kind:"mcp",entry:$},`an MCP server run with npx ${X}`)}return null}function s(J){return(J.replace(/\.git$/i,"").split(/[\\/]/).filter(Boolean).pop()??"item").toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/^[^a-z0-9]+/,"").slice(0,64)||"item"}async function j(J,Z={}){let X=JJ(J);if(X===null)return{ok:!1,error:`"${J.slice(0,60)}" is not something rovecode can install`};let{kind:$,id:V}=X;if($!==void 0){let E=await w($,V,Z);if(E.item)return{ok:!0,item:E.item};let D=t(V,$);if(D)return{ok:!0,item:D};return{ok:!1,error:`no ${$} called "${V}"${E.notes.length?` \u2014 ${E.notes[0]}`:""}`}}let B=[];for(let E of["mcp","skill","plugin"]){let D=await w(E,V,Z);if(D.item&&D.item.id===V)B.push(D.item)}if(B.length===1)return{ok:!0,item:B[0]};if(B.length>1)return{ok:!1,ambiguous:B,error:`"${V}" exists in ${B.length} kinds \u2014 say which: ${B.map(_).join(" \xB7 ")}`};let Q=t(V);if(Q)return{ok:!0,item:Q};let C=(await h(V,Z)).items.slice(0,5);if(C.length===0)return{ok:!1,error:`nothing in the market matches "${V}"`};return{ok:!1,ambiguous:C,error:`no item is called "${V}" \u2014 did you mean: ${C.map(_).join(" \xB7 ")}`}}uJ();kJ();fJ();gJ();xJ();c();p();var b=(J)=>typeof J==="object"&&J!==null&&!Array.isArray(J),OJ=/^[a-z0-9][a-z0-9._-]{0,63}$/,vJ={skill:new Set(["id","name","title","publisher","description","version","license","tags","repository","homepage","source","files","bytes","docs","env","status","planNote"]),plugin:new Set(["id","name","title","publisher","description","version","apiVersion","license","tags","repository","homepage","install","contributes","docs","env","status","planNote"])};function l(J){if(typeof J!=="string"||J==="")return!1;let Z=J.split("\\").join("/");return Z.startsWith("/")||/^[A-Za-z]:/.test(Z)||Z.split("/").includes("..")}function bJ(J,Z={}){if(Z.kind!==void 0)return Z.kind;if(b(J)&&(J.kind==="skill"||J.kind==="plugin"))return J.kind;let X=(Z.filename??"").toLowerCase();if(X.includes("skill"))return"skill";if(X.includes("plugin"))return"plugin";return}function ZJ(J,Z={}){let X=[],$=(D,S,G="error")=>X.push({path:D,message:S,severity:G});if(J.length>q.body)return{ok:!1,kind:Z.kind??"skill",accepted:0,dropped:0,findings:[{path:"",message:`the file is ${Math.round(J.length/1024)} KB; rovecode reads at most ${q.body/1024} KB`,severity:"error"}]};let V;try{V=JSON.parse(J)}catch(D){return{ok:!1,kind:Z.kind??"skill",accepted:0,dropped:0,findings:[{path:"",message:`not valid JSON: ${D instanceof Error?D.message:String(D)}`,severity:"error"}]}}let B=bJ(V,Z);if(B===void 0)return{ok:!1,kind:"skill",accepted:0,dropped:0,findings:[{path:"",message:'cannot tell whether this is a skill or a plugin catalog \u2014 pass --kind skill|plugin, or give the document a "kind" field',severity:"error"}]};if(!b(V))return{ok:!1,kind:B,accepted:0,dropped:0,findings:[{path:"",message:"the top level must be an object",severity:"error"}]};if(V.version===void 0)$("version","missing; rovecode assumes 1","warning");else if(V.version!==1)$("version",`is ${JSON.stringify(V.version)}; this rovecode reads version 1`);if(!Array.isArray(V.items))return $("items","missing or not an array \u2014 a catalog is { version, items: [...] }"),{ok:!1,kind:B,accepted:0,dropped:0,findings:X};let Q=V.items;if(Q.length===0)$("items","no rows: this catalog would show nothing","warning");if(Q.length>q.items)$("items",`${Q.length} rows; rovecode reads the first ${q.items} and ignores the rest`,"warning");let F=new Map,C=0,E=0;return Q.forEach((D,S)=>{let G=`items[${S}]`,A=X.length;if(!b(D)){$(G,"not an object"),E++;return}let O=typeof D.id==="string"?D.id:typeof D.name==="string"?D.name:void 0;if(O===void 0)$(`${G}.id`,"missing (a row needs an id, or a name to use as one)");else if(!OJ.test(O))$(`${G}.id`,`"${O}" is not a bare slug \u2014 lowercase letters, digits, dot, dash, underscore, at most 64`);else{let Y=F.get(O);if(Y!==void 0)$(`${G}.id`,`"${O}" is already used by items[${Y}]; ids are unique within a kind`);else F.set(O,S)}if(typeof D.description!=="string"||D.description.trim()==="")$(`${G}.description`,"missing (a row needs one line describing it)");else if(D.description.length>q.desc)$(`${G}.description`,`${D.description.length} characters; will be cut to ${q.desc}`,"warning");for(let Y of["title","publisher","version","license","repository","homepage"]){let H=D[Y];if(H!==void 0&&typeof H!=="string")$(`${G}.${Y}`,`must be a string, not ${Array.isArray(H)?"an array":typeof H}`,"warning");else if(typeof H==="string"&&H.length>q.str)$(`${G}.${Y}`,`${H.length} characters; will be cut to ${q.str}`,"warning")}if(D.publisher===void 0)$(`${G}.publisher`,'missing; the row will say "unknown"',"warning");if(D.tags!==void 0){if(!Array.isArray(D.tags))$(`${G}.tags`,"must be an array of strings","warning");else if(D.tags.length>q.list)$(`${G}.tags`,`${D.tags.length} tags; only the first ${q.list} are read`,"warning")}IJ(B,D,G,$),jJ(D.docs,`${G}.docs`,$);for(let Y of Object.keys(D))if(!vJ[B].has(Y))$(`${G}.${Y}`,"not a field rovecode reads \u2014 a typo, or something it will ignore","warning");let I=[],R=XJ(B,D,I),z=X.slice(A).some((Y)=>Y.severity==="error");if(R===null){if(E++,!z)$(G,`rovecode drops this row${I.length?`: ${I[I.length-1]}`:""} \u2014 the checks above did not explain why, which is a gap in this validator`)}else{if(z)$(G,"the row loads despite the errors above; treat them as the more careful reading","warning");C++}}),{ok:X.every((D)=>D.severity!=="error"),kind:B,accepted:C,dropped:E,findings:X}}function IJ(J,Z,X,$){if(J==="skill"){let B=b(Z.source)?Z.source:void 0,Q=Array.isArray(Z.files)?Z.files:void 0;if(B===void 0&&Q===void 0){$(`${X}.source`,"missing: a skill needs either source.git (a repository) or files (the text itself)");return}if(B!==void 0){if(typeof B.git!=="string"||!/^https?:\/\//.test(B.git))$(`${X}.source.git`,"must be an http(s) repository URL");if(l(B.subfolder))$(`${X}.source.subfolder`,`"${String(B.subfolder)}" climbs out of the clone`)}if(Q?.forEach((F,C)=>{let E=b(F)?F.path:void 0;if(typeof E!=="string"||E==="")$(`${X}.files[${C}].path`,"missing");else if(l(E))$(`${X}.files[${C}].path`,`"${E}" writes outside the skill's folder`);if(b(F)&&typeof F.text!=="string")$(`${X}.files[${C}].text`,"missing (the file's contents)")}),Q!==void 0&&Q.length>q.list)$(`${X}.files`,`${Q.length} files; only the first ${q.list} are read`,"warning");return}let V=b(Z.install)?Z.install:void 0;if(V===void 0){$(`${X}.install`,"missing: a plugin needs install.source (a repository URL or a folder)");return}if(typeof V.source!=="string"||V.source===""){$(`${X}.install.source`,"missing");return}if(V.git===!0&&!/^https?:\/\//.test(V.source))$(`${X}.install.source`,`"${V.source}" is marked git: true but is not an http(s) URL`);if(l(V.subfolder))$(`${X}.install.subfolder`,`"${String(V.subfolder)}" climbs out of the clone`);if(V.subfolder===void 0)$(`${X}.install.subfolder`,"absent: the plugin.json must then be at the repository root","warning")}function jJ(J,Z,X){if(J===void 0)return;if(!b(J)){X(Z,"must be an object","warning");return}if(typeof J.source!=="string"||!/^https?:\/\//.test(J.source))X(`${Z}.source`,"must be the http(s) URL the document was read from \u2014 the docs are dropped without it","warning");if(J.format!=="markdown")X(`${Z}.format`,'must be "markdown"; the docs are dropped otherwise',"warning");if(typeof J.body!=="string"||J.body.trim()==="")X(`${Z}.body`,"empty: the docs are dropped and the row keeps no documentation","warning");else if(Buffer.byteLength(J.body,"utf8")>q.docs)X(`${Z}.body`,`${Math.round(Buffer.byteLength(J.body,"utf8")/1024)} KB; will be cut to ${q.docs/1024} KB`,"warning");if(J.truncated===!0&&typeof J.bytes==="number"&&typeof J.body==="string"&&J.bytes<=Buffer.byteLength(J.body,"utf8"))X(`${Z}.bytes`,"marked truncated, but bytes is not larger than the body \u2014 bytes should be the size BEFORE truncation","warning")}function $J(J,Z){let X=J.findings.filter((B)=>B.severity==="error"),$=J.findings.filter((B)=>B.severity==="warning"),V=[`${Z}: ${J.kind} catalog \u2014 ${J.ok?"valid":"INVALID"}`];V.push(` ${J.accepted} row${J.accepted===1?"":"s"} would load, ${J.dropped} dropped, ${X.length} error${X.length===1?"":"s"}, ${$.length} warning${$.length===1?"":"s"}`);for(let B of[...X,...$])V.push(` ${B.severity==="error"?"error ":"warning"} ${B.path===""?"(file)":B.path}: ${B.message}`);if(J.ok&&$.length>0)V.push(" warnings do not stop a catalog loading; they are fields that will not survive as written");return V}import{readFileSync as mJ}from"fs";import{createInterface as wJ}from"readline";var n=["usage: rovecode market <command>"," search [query] [--kind mcp|skill|plugin] every source at once: the curated MCP shelf, the MCP registry,"," rovecode's skill and plugin catalogs (skills/plugins work offline)"," info <id> one item in full: publisher, version, what it installs, what it asks"," docs <id> the item's own documentation, as the catalog carries it"," install <id|kind:id|git-url|npm-package> [--project] [--as <name>] [--pick N] [--ref <branch|tag|commit>] [--yes] [--force]"," shows the plan, asks (masked) for keys by name, then writes"," --local / --no-local: an npx server installed ONCE (npm, ~25 MB, starts in 0.4 s not 2 s)"," or the npx line as it is; without either, a terminal asks and --yes keeps npx"," --dry-run shows the plan and stops; nothing is fetched or written"," remove <id|kind:id> [--project] undo an install of any kind"," list [--all] [--kind mcp|skill|plugin] what is installed here (--all: the whole market, with badges)"," update [id] [--all] [--yes] what is out of date; with an id or --all: plan, approve, reinstall"," --all --yes skips plugins (new code): name one, or pass --yes-plugins"," sources [probe] where rows come from right now; really asks the registry (--offline to skip)"," verify [id] re-hash what is installed and say what has changed since"," validate <path|url> [--kind skill|plugin] check a catalog you wrote before anyone trusts it: what would"," load, what would be dropped, and which fields will not survive","every command takes --json \xB7 --offline skips the network entirely","an id is a bare slug inside its kind (filesystem); say mcp:filesystem when two kinds share a name"],GJ=new Set(["--json","--offline"]),pJ=new Set(["--as","--pick","--kind","--ref"]),_J={search:new Set(["--kind"]),info:new Set,docs:new Set,install:new Set(["--project","--as","--pick","--ref","--yes","--force","--dry-run","--local","--no-local"]),remove:new Set(["--project","--yes"]),list:new Set(["--all","--kind"]),update:new Set(["--all","--yes","--yes-plugins","--dry-run"]),sources:new Set,verify:new Set,validate:new Set(["--kind"]),help:new Set},cJ=new Set([...GJ,...Object.values(_J).flatMap((J)=>[...J])]),lJ=/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f-\u009f]/g,nJ=(J)=>J.replace(/\r\n?/g,`
3
+ `).replace(lJ,""),NJ=(J)=>J<1024?`${J} B`:`${(J/1024).toFixed(1)} KB`,N=(J,Z)=>(J.out??console.log)(JSON.stringify(Z,null,2));function zJ(J){let Z=J.status?` [${J.status}]`:"";if(!J.installed)return Z;if(J.installed.updateAvailable)return`${Z} [installed ${J.installed.version??"?"} \xB7 update ${"available"}]`;if(J.installed.trusted===!1)return`${Z} [installed \xB7 NOT approved on this machine]`;return`${Z} [installed]`}function iJ(J,Z,X){let $=[`${J.title}${J.version?` ${J.version}`:""}${J.status?` [${J.status}]`:""}`,` id ${_(J)}`,` kind ${J.kind==="mcp"?"MCP server \u2014 rovecode launches it and the model gets its tools":J.kind==="skill"?"skill \u2014 instructions the model reads; files only, nothing runs":"plugin \u2014 a folder of code rovecode loads and runs"}`,` publisher ${J.publisher}`,` source ${J.source==="curated"?"curated list (built into rovecode)":J.source==="registry"?"MCP registry (registry.modelcontextprotocol.io)":"rovecode catalog (in the repository)"}`,` ${J.description}`];if(J.license)$.push(` licence ${J.license}`);if($.push(J.docs?` docs ${NJ(J.docs.bytes)} from ${J.docs.source}${J.docs.truncated?" (truncated)":""} \u2014 rovecode market docs ${_(J)}`:` docs none${J.repository?` \u2014 try ${J.repository}`:""}`),J.repository)$.push(` repo ${J.repository}`);if(J.homepage)$.push(` home ${J.homepage}`);if(J.tags.length)$.push(` tags ${J.tags.join(", ")}`);let{install:V}=J;if(V.kind==="mcp")for(let Q of V.entry.installs)$.push(Q.kind==="stdio"?` runs ${Q.command} ${Q.args.join(" ")}`:` connects ${Q.url}`);else if(V.kind==="plugin")$.push(` installs ${V.git?`git clone ${V.source}`:`copy of ${V.source}`}${V.subfolder?` (subfolder ${V.subfolder})`:""}`);else $.push(V.source?` installs git clone ${V.source.git}${V.source.subfolder?` (${V.source.subfolder})`:""}`:` installs ${(V.files??[]).length} file(s) from the catalog`);for(let Q of J.env)$.push(` needs ${Q.name}${Q.secret?" (secret, asked masked)":""}${Q.required?"":" (optional)"}${Q.description?` \u2014 ${Q.description}`:""}`);let B=u(J,Z,X);return $.push(B?` installed ${B.path} (${B.scope}${B.version?`, ${B.version}`:""}${B.trusted===!1?", NOT approved here":""})`:" installed no"),$}async function oJ(J,Z){let X={};for(let $ of J.asks){if(!Z.tty){Z.err(`${$.name} is not set \u2014 it will be written as \${${$.name}} and read from your environment`);continue}let V=`${$.name}${$.description?` (${$.description})`:""}: `,B=(await($.secret?Z.secret(V):Z.plain(V))).trim();if(B.length>0)X[$.name]=B}for(let $ of J.pending??[]){if(!Z.tty)continue;let V=(await Z.plain(`${$}: `)).trim();if(V.length>0)X[$]=V}return X}function dJ(J,Z){if(J.install.kind!=="mcp")return;if(Z.scope==="project")return;let X=J.install.entry.installs[Z.pick??0];return X===void 0?void 0:BJ(X)}function aJ(J){return[`${J.spec} would start through npx: ~2 s at every start, re-resolving the package (and asking the npm registry) each time.`,"Install it once instead? npm puts the package's code under ~/.rovecode/mcp \u2014 typically 20\u201330 MB and a few seconds, one time;","it then starts in ~0.4 s and needs no network to start. No keeps the npx line exactly as it is today."]}async function QJ(J,Z,X){let $=(E)=>{if(X.collect)X.collect(E);else N({out:X.out},E)},V=Z.local,B=dJ(J,Z);if(B!==void 0&&V===void 0&&!X.yes&&!X.json&&!X.dryRun&&X.tty){for(let D of aJ(B))X.out(D);let E=(await X.plain(`install ${B.spec} once? [y/N] `)).trim().toLowerCase();V=E==="y"||E==="yes"}let Q=EJ(J,V===void 0?Z:{...Z,local:V});if("error"in Q){if(X.err(Q.error),X.json)$({ok:!1,error:Q.error,id:_(J)});return 1}if(!X.json){for(let E of Q.preview)X.out(E);if(Q.replaces)X.out(` replaces ${Q.replaces}`);for(let E of Q.pending)X.out(` fill in ${E} \u2014 after the install, in ${Q.target}`)}if(X.dryRun){if(X.json)return $({dryRun:!0,item:J,target:Q.target,scope:Q.scope,preview:Q.preview,asks:Q.asks,pending:Q.pending,...Q.replaces?{replaces:Q.replaces}:{}}),0;return X.out(`nothing written \u2014 --dry-run. ${PJ(J.install)?"The source was not fetched, so this is the plan, not its contents.":"This is the whole plan."}`),0}if(!X.yes){if(X.json)return $({ok:!1,needsApproval:!0,item:J,target:Q.target,scope:Q.scope,preview:Q.preview,asks:Q.asks,pending:Q.pending,...Q.replaces?{replaces:Q.replaces}:{}}),X.err("nothing written: pass --yes to accept this plan, or --dry-run to read it"),1;if(!X.tty)return X.err("nothing written: rerun on a terminal, or pass --yes to accept this plan in a script"),1;let E=(await X.plain(`${X.verb} this? [y/N] `)).trim().toLowerCase();if(E!=="y"&&E!=="yes")return X.out("nothing written"),1}let F=await oJ(Q,{secret:X.secret,plain:X.plain,tty:X.tty&&!(Z.scope==="project"&&Q.asks.some((E)=>E.secret)),err:X.err}),C=await UJ(Q,F,V===void 0?Z:{...Z,local:V},X.run);if(!C.ok){if(X.err(C.error),X.json)$(C);return 1}if(X.json)return $(C),0;if(X.out(`${X.verb==="update"?"updated":"installed"} ${_(J)} \u2192 ${C.target}${C.trusted===!0?" (trusted as written)":""}`),C.package){if(X.out(` package ${C.package.name} ${C.package.version} \u2192 ${C.package.prefix}${C.package.integrity!==void 0?" (integrity recorded in installed.json)":""}`),C.package.missing)X.err(` record incomplete: ${C.package.missing.join("; ")}`)}if(C.trusted===!1)X.err("that file already held entries you have not approved, so it is NOT trusted yet \u2014 rovecode mcp trust");if(C.envNames.length)X.err(`set ${C.envNames.join(", ")} in your environment before the restart`);if(C.next)X.out(C.next);return 0}async function GX(J,Z={}){let X=new Map;try{return await rJ(J,{...Z,run:{...Z.run,cloneCache:X}})}catch($){return(Z.err??((V)=>console.error(V)))(`market: ${$ instanceof Error?$.message:String($)}`),1}finally{YJ(X)}}async function rJ(J,Z){let X=Z.out??console.log,$=Z.err??((z)=>console.error(z)),V=Z.cwd??process.cwd(),B=Z.home??VJ(),Q=J.includes("--json"),F=J.includes("--offline"),C=J.includes("--project")?"project":"user",E={...Z.registry,...F?{offline:!0}:{}},D=(z)=>{let Y=J.indexOf(z);return Y>=0?J[Y+1]:void 0},S=J.filter((z,Y)=>!z.startsWith("--")&&!(Y>0&&pJ.has(J[Y-1]))),G=(z)=>{if($(z),$(n.join(`
4
+ `)),Q)N(Z,{ok:!1,error:z,usage:n});return 2},A=S[0];if(A===void 0)return G("market needs a command");let O=_J[A];if(O===void 0)return G(`unknown command "${A}"`);for(let z of J){if(!z.startsWith("--"))continue;if(GJ.has(z)||O.has(z))continue;return G(cJ.has(z)?`market ${A} does not take ${z}`:`unknown flag ${z}`)}if(A==="help")return X(n.join(`
5
+ `)),0;let I=()=>{let z=D("--kind");if(z===void 0)return;return["mcp","skill","plugin"].includes(z)?z:G("--kind takes mcp, skill or plugin")};if(A==="search"){let z=I();if(z===2)return 2;let Y=S.slice(1).join(" "),H=await h(Y,E),K=z?H.items.filter((W)=>W.kind===z):H.items,P=g(K,V,B);if(Q)return N(Z,{items:P,sources:H.sources,notes:H.notes}),P.length===0?1:0;for(let W of H.notes)$(`market: ${W}`);if(P.length===0){let W=Object.entries(H.sources).filter(([,T])=>!T.ok);$(Y?`nothing matches "${Y}"`:"the market is empty");for(let[T,M]of W)if(!M.ok)$(` ${T}: ${M.reason}`);return 1}for(let W of P)X(`${d(W)}${zJ(W)}`);return 0}if(A==="sources"){let z=S.slice(1).join(" ")||"mcp",Y=F?await f(E):await h(z,E);if(Q)return N(Z,{sources:Y.sources,notes:Y.notes,count:Y.items.length,probe:F?null:z,offline:F}),Object.values(Y.sources).every((H)=>H.ok)?0:1;if(F)X("--offline: the registry was not asked");else X(`probed with "${z}"`);for(let[H,K]of Object.entries(Y.sources)){let P=!K.ok?`FAILED \u2014 ${K.reason}`:K.from==="live"?"answered just now":K.from==="cache"?`from the cache${K.ageMs?` (${Math.round(K.ageMs/1000)}s old)`:""}`:K.from==="skipped"?`not consulted \u2014 ${K.why}`:"built in / on disk";X(`${H.padEnd(14)} ${P}`)}return X(`${String(Y.items.length).padStart(14)} items visible right now`),Object.values(Y.sources).every((H)=>H.ok)?0:1}if(A==="verify"){let z=S[1],Y=[];for(let K of["user","project"])for(let P of WJ(K,V,B)){let W=`${P.kind}:${P.id}`;if(z!==void 0&&z!==W&&z!==P.id)continue;Y.push({id:W,result:P.kind==="mcp"?{state:"not-applicable",why:"an MCP entry is a line inside a shared mcp.json, not a folder of its own"}:DJ(P.digest,P.target)})}if(Q){if(N(Z,Y),Y.length===0)return z!==void 0?1:0;return Y.some((K)=>K.result.state==="changed"||K.result.state==="missing")?1:0}if(Y.length===0)return X(z!==void 0?`nothing recorded for "${z}"`:"nothing installed through the market yet"),z!==void 0?1:0;for(let K of Y)X(KJ(K.id,K.result));let H=Y.filter((K)=>K.result.state==="changed"||K.result.state==="missing").length;if(H>0)$(`${H} item${H===1?" is":"s are"} not what was installed \u2014 reinstall with \`market install <id> --force\`, or keep the edit`);return H>0?1:0}if(A==="list"){let z=J.includes("--all"),Y=I();if(Y===2)return 2;let H=await f(E),K=g(H.items,V,B).filter((W)=>(z||W.installed)&&(Y===void 0||W.kind===Y)),P=K.map((W)=>W.installed?{...W,origin:k(W,W.installed.scope,V,B)??null}:W);if(Q)return N(Z,P),0;if(K.length===0){let W=Y===void 0?"":`${Y==="mcp"?"MCP server":Y} `;return X(z?Y===void 0?"the market is empty":`the market has no ${W}items`:`${Y===void 0?"nothing ":`no ${W}`}installed here yet \u2014 \`rovecode market search${Y?` --kind ${Y}`:""}\` to look around`),0}for(let W of K)if(X(`${d(W)}${zJ(W)}`),W.installed)X(` from ${HJ(k(W,W.installed.scope,V,B))}`);return 0}if(A==="update"){let z=await f(E),Y=g(z.items,V,B).filter((U)=>U.installed),H=Y.filter((U)=>U.installed.updateAvailable===!0||U.version===void 0||U.installed.version===void 0),K=S[1],P=J.includes("--all");if(K===void 0&&!P){if(Q)return N(Z,H),0;if(H.length===0)return X("everything installed is at the catalog's version"),0;for(let U of H){let v=U.installed.version,L=U.version;X(v!==void 0&&L!==void 0?`${_(U)} ${v} \u2192 ${L}`:`${_(U)} version unknown (${v===void 0?"nothing on disk says one":"the catalog states none"}) \u2014 updating reinstalls it`)}return X("rovecode market update <id> \xB7 rovecode market update --all"),0}let W=P&&J.includes("--yes")&&!J.includes("--yes-plugins"),T=H;if(K!==void 0){let U=await j(K,E);if(!U.ok){if($(U.error),Q)N(Z,{ok:!1,error:U.error,candidates:U.ambiguous??[]});return U.ambiguous?2:1}let v=Y.find((L)=>L.id===U.item.id&&L.kind===U.item.kind);if(v===void 0){let L=`${_(U.item)} is not installed here \u2014 rovecode market install ${_(U.item)}`;if($(L),Q)N(Z,{ok:!1,error:L,id:_(U.item),installed:!1});return 1}T=[v]}let M=W?T.filter((U)=>U.kind==="plugin"):[];if(M.length)T=T.filter((U)=>U.kind!=="plugin");let y=[],a=(U)=>{if(Q)N(Z,{ok:U,results:y,skipped:M.map(_)})};if(T.length===0&&M.length===0){if(Q)a(!0);else X("everything installed is at the catalog's version");return 0}let RJ={out:X,err:$,json:Q,yes:J.includes("--yes"),tty:Z.tty??process.stdin.isTTY===!0,secret:Z.secret??o,plain:Z.plain??i,verb:"update",dryRun:J.includes("--dry-run"),run:{...Z.run,force:!0,...F?{offline:!0}:{}},...Q?{collect:(U)=>{y.push(U)}}:{}},m=0;if(M.length&&!Q)X(`${M.length} plugin${M.length>1?"s":""} skipped \u2014 a plugin update runs new code: ${M.map(_).join(", ")}`),X(" rovecode market update <id> --yes \xB7 or --yes-plugins to take them all");for(let U of T){let v=U.kind==="mcp"?k(U,U.installed.scope,V,B)?.package!==void 0:void 0,L={scope:U.installed.scope,cwd:V,home:B,...Z.prereqEnv!==void 0?{prereqEnv:Z.prereqEnv}:{},...v!==void 0?{local:v}:{}},r=await QJ(U,L,RJ);if(r!==0)m=r}return a(m===0),m}let R=S[1];if(["info","install","remove","docs"].includes(A)&&R===void 0)return G(`market ${A} needs a name`);if(A==="info"){let z=await j(R,E);if(z.ok&&z.item.source==="catalog"&&z.item.publisher.startsWith("unknown (")&&z.item.kind==="mcp"){if($(`"${R}" is not in the catalog or the registry \u2014 \`market install\` would treat it as an npm package, but there is nothing here to describe`),Q)N(Z,{error:"not found",id:R});return 1}if(!z.ok){if($(z.error),Q)N(Z,{error:z.error,candidates:z.ambiguous??[]});return z.ambiguous?2:1}if(Q)return N(Z,{...z.item,installed:u(z.item,V,B)}),0;for(let Y of iJ(z.item,V,B))X(Y);return 0}if(A==="docs"){let z=await j(R,E);if(z.ok&&z.item.source==="catalog"&&z.item.publisher.startsWith("unknown (")&&z.item.kind==="mcp"){if($(`"${R}" is not in the catalog or the registry \u2014 nothing here has documentation`),Q)N(Z,{error:"not found",id:R});return 1}if(!z.ok){if($(z.error),Q)N(Z,{error:z.error,candidates:z.ambiguous??[]});return z.ambiguous?2:1}let Y=z.item.docs;if(!Y||Y.body===void 0){let H=z.item.repository??z.item.homepage;if($(`${_(z.item)} carries no documentation in the catalog${H?` \u2014 the publisher's own is at ${H}`:""}`),Q)N(Z,{id:_(z.item),docs:null,...H?{repository:H}:{}});return 1}if(Q)return N(Z,{id:_(z.item),docs:Y}),0;if(X(nJ(Y.body)),Y.truncated)$(`\u2014 truncated: ${NJ(Y.bytes)} upstream, read the rest at ${Y.source}`);return 0}if(A==="validate"){if(R===void 0)return G("usage: rovecode market validate <path|url> [--kind skill|plugin]");let z=D("--kind");if(z!==void 0&&z!=="skill"&&z!=="plugin")return G("validate takes --kind skill or --kind plugin");let Y,H=/^https?:\/\//i.test(R),K=(W)=>{if($(W),Q)N(Z,{ok:!1,error:W,source:R});return 1};if(H){if(F)return G("--offline and a URL cannot both be meant \u2014 give a local path, or drop --offline");try{let W=await fetch(R,{headers:{"user-agent":"rovecode-market-validate"}});if(!W.ok)return K(`${R}: HTTP ${W.status}`);Y=await W.text()}catch(W){return K(`${R}: ${W instanceof Error?W.message:String(W)}`)}}else try{Y=mJ(R,"utf8")}catch(W){return K(`${R}: ${W instanceof Error?W.message:String(W)}`)}let P=ZJ(Y,{...z?{kind:z}:{},filename:R});if(Q)return N(Z,P),P.ok?0:1;for(let W of $J(P,R))X(W);return P.ok?0:1}if(A==="remove"){let z=await j(R,E);if(!z.ok){if($(z.error),Q)N(Z,{ok:!1,error:z.error,candidates:z.ambiguous??[]});return z.ambiguous?2:1}let Y=u(z.item,V,B,J.includes("--project")?"project":void 0);if(Y===void 0){let P=`${_(z.item)} is not installed here`;if($(P),Q)N(Z,{ok:!1,error:P,id:_(z.item),installed:!1});return 1}let H=Z.tty??process.stdin.isTTY===!0;if(!J.includes("--yes")){if(Q)return N(Z,{ok:!1,needsApproval:!0,id:_(z.item),path:Y.path,scope:Y.scope}),$("nothing removed: pass --yes to confirm"),1;if(!H)return $(`nothing removed: ${_(z.item)} lives at ${Y.path} \u2014 rerun on a terminal, or pass --yes`),1;X(`${_(z.item)} ${Y.path}${Y.scope==="project"?" (this repo)":""}`);let P=(await(Z.plain??i)("remove this? [y/N] ")).trim().toLowerCase();if(P!=="y"&&P!=="yes")return X("nothing removed"),1}let K=CJ(z.item,V,B,J.includes("--project")?"project":void 0);if(!K.ok){if($(K.error),Q)N(Z,{ok:!1,error:K.error,id:_(z.item)});return 1}if(Q)return N(Z,{ok:!0,removed:_(z.item),path:K.path}),0;return X(`removed ${_(z.item)} from ${K.path}`),0}if(A==="install"){let z=await j(R,E);if(!z.ok){if($(z.error),Q)N(Z,{error:z.error,candidates:z.ambiguous??[]});else for(let y of z.ambiguous??[])$(` ${_(y)} ${y.description}`);return z.ambiguous?2:1}let Y=D("--pick"),H=Y===void 0?void 0:Number(Y);if(H!==void 0&&!Number.isInteger(H))return G("--pick takes a number");let K=D("--as"),P=Z.model??await tJ(),W=D("--ref");if(W!==void 0&&W.trim()==="")return G("--ref needs a branch, tag or commit");let T=J.includes("--local")?!0:J.includes("--no-local")?!1:void 0,M={scope:C,cwd:V,home:B,...H!==void 0?{pick:H}:{},...K!==void 0?{as:K}:{},...W!==void 0?{ref:W}:{},...Z.prereqEnv!==void 0?{prereqEnv:Z.prereqEnv}:{},...P!==void 0?{model:P}:{},...T!==void 0?{local:T}:{}};return QJ(z.item,M,{out:X,err:$,json:Q,yes:J.includes("--yes"),tty:Z.tty??process.stdin.isTTY===!0,secret:Z.secret??o,plain:Z.plain??i,verb:"install",dryRun:J.includes("--dry-run"),run:{...Z.run,...J.includes("--force")?{force:!0}:{},...F?{offline:!0}:{}}})}return G(`unknown command "${A}"`)}async function tJ(){try{let{resolveProvider:J}=await import("./stream-4wmyaypz.js"),Z=J();if(!Z)return;let X=process.env.ROVECODE_MODEL??Z.defaultModel;return X?{provider:Z.id,model:X}:void 0}catch{return}}async function i(J){let Z=wJ({input:process.stdin,output:process.stderr});try{return await new Promise((X)=>Z.question(J,X))}finally{Z.close()}}export{nJ as safeForTerminal,iJ as infoLines,GX as cmdMarket,_J as SUBCOMMAND_FLAGS,n as MARKET_USAGE};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Dc as F,Gc as G}from"./main-wpkyraxh.js";import{jd as x,ld as P}from"./main-n6qrdbmy.js";import{Ed as C}from"./main-kwwsz6rq.js";import{Ji as k}from"./main-s9v8k74e.js";import{$l as _,bm as v}from"./main-b8zq261k.js";import"./main-wk2csfnj.js";import{nm as A,pm as O,qm as X,um as T,vm as j}from"./main-y5c82rxr.js";import"./main-ys6zj3yr.js";import"./main-mjt2p7aj.js";import{$m as L,Lm as H,Nm as R}from"./main-2yeveeve.js";import"./main-0jys2ccn.js";import{dn as U,kn as N,mn as b}from"./main-nqveez48.js";import"./main-qsevpgsv.js";P();j();v();C();N();L();import{existsSync as y,readFileSync as S}from"fs";import{join as M}from"path";var w="usage: rovecode mcp login <name> \u2014 a url server from ~/.rovecode/mcp.json or a TRUSTED .rovecode/mcp.json / .mcp.json";function u(z){if(!y(z))return;let J;try{J=JSON.parse(S(z,"utf8"))}catch(q){throw Error(`${z}: invalid JSON (${X(q)}) \u2014 fix or remove it by hand; refusing to overwrite`)}if(!O(J))throw Error(`${z}: root is not an object \u2014 fix or remove it by hand; refusing to overwrite`)}async function f(z,J,q){if(z.length===0)return q.err(w),1;let K=A(J);try{u(K)}catch(B){return q.err(`error: ${X(B)}`),2}let V=q.home??H(),W=[],Q=T(J,W,{home:V,trusted:b(U(V))}).find((B)=>B.name===z);for(let B of W)q.err(`warning: ${B}`);if(!Q)return q.err(`error: no MCP server "${z}" in ${K}, .mcp.json (trusted files only \u2014 rovecode mcp trust) or ${M(V,"mcp.json")}`),1;if(Q.transport==="stdio"||Q.url===void 0)return q.err(`error: MCP server "${z}" is a stdio server \u2014 OAuth login applies to url servers only`),1;if(Q.enabled===!1)return q.err(`error: MCP server "${z}" is disabled (enabled: false) \u2014 enable it first`),1;let Y=q.signal??new AbortController().signal,Z={...k(),...q.oauth};q.out(`rovecode mcp login ${z} \u2014 ${Q.transport} ${Q.url}`);let $;try{$=await _(Q,{notify:(B)=>{for(let I of G(B))q.out(` ${I}`)},signal:Y},{...Z,...q.timeoutMs!==void 0?{timeoutMs:q.timeoutMs}:{}})}catch(B){if(Y.aborted)return q.err("login cancelled"),130;return q.err(`error: ${B instanceof Error?B.message:String(B)}`),1}let D=`stored OAuth token for MCP server "${z}" in ${R()} (${F($.expires,Z.now())})`,E=await l(Q,q.connectTimeoutMs);if(E===void 0)return q.out(`${D} \u2014 connected`),0;return q.out(D),q.err(`error: verification connect failed: ${E}`),1}async function l(z,J=1e4){let q=new x([z],{connectTimeoutMs:J});try{let K=await q.connect();return K.failed[0]?.error??(K.connected.includes(z.name)?void 0:"not connected")}finally{await q.close()}}async function p(z,J,q){let K=new AbortController,V=()=>K.abort();process.once("SIGINT",V);try{return await f(z[0]??"",J,{out:(W)=>q.out(W),err:(W)=>q.err(W),signal:K.signal,...q.home!==void 0?{home:q.home}:{}})}finally{process.removeListener("SIGINT",V)}}export{f as runMcpLogin,p as cmdMcpLogin,w as MCP_LOGIN_USAGE};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{_b as $q,bc as Dq,dc as Kq}from"./main-zc7pyrbj.js";import{fc as L,gc as zq,hc as Bq,ic as Jq,jc as Qq,kc as Xq,lc as v,mc as Yq,nc as Zq,oc as Uq}from"./main-45ejth3a.js";import{pc as a,rc as s,sc as r,vc as e,wc as qq,xc as Tq}from"./main-jak598k9.js";import{Ac as l,Bc as Eq,yc as p,zc as b}from"./main-7kt6r53y.js";import{Ad as R,Bd as t,Cd as n,Dd as S,Ed as jq}from"./main-kwwsz6rq.js";import{om as y,tm as o,vm as Vq}from"./main-y5c82rxr.js";import{$m as i,Lm as c,_m as d}from"./main-2yeveeve.js";import"./main-0jys2ccn.js";import"./main-nqveez48.js";import{xn as Hq}from"./main-qsevpgsv.js";i();i();Eq();Uq();Vq();jq();Tq();Kq();import{createInterface as Wq}from"readline";var f=["usage: rovecode mcp <command>"," search [query] the curated list, then the MCP registry's name matches (cached a day)"," info <name> everything about one server: publisher, version, what it runs or connects to, what it asks"," add <name> [--project] [--pick N] [--as <name>] [--yes] [--force] [--local | --no-local]"," install: shows the exact command/URL + source, asks (masked) for keys by name, then writes"," ~/.rovecode/mcp.json \u2014 or .rovecode/mcp.json with --project (keys stay out of it: ${NAME})"," --local: an npx server is installed ONCE (npm, ~25 MB under ~/.rovecode/mcp) and started with"," node in ~0.4 s instead of ~2 s; --no-local keeps npx; neither \u2192 a terminal asks, --yes keeps npx"," remove <name> [--project] delete the entry from that file"," list every configured server, by file (user \xB7 .mcp.json \xB7 project), with the project files' trust"," show --project each project file's servers \u2014 exact command/URL, env NAMES \u2014 and whether it is trusted here"," trust \xB7 untrust approve this repo's .rovecode/mcp.json and .mcp.json as they are now (any edit asks again);"," files you write through `add --project` are trusted as you approve them"," login <name> OAuth sign-in to a url server through the browser (port #76, mcp-login.ts): the token"," lands in credentials.json under mcp:<name>; only servers the runtime itself would load","restart rovecode after add/remove/trust \u2014 servers are read once per process (docs/mcp-market.md)"];function u(z,J){let Q=S(z);if(Q.length===0)return["no project MCP files here (.rovecode/mcp.json, .mcp.json)"];let B=new Proxy({},{get:()=>"set"}),q=[];for(let Z of Q){let G=R(J,Z);q.push(`${Z} \u2014 ${G==="trusted"?"trusted on this machine":"NOT trusted: nothing in it loads until `rovecode mcp trust`"}`);let U=[];for(let _ of o(Z,U,B))q.push(` ${v(_)}`);for(let _ of U)q.push(` ! ${_}`)}return q}async function Aq(z){process.stderr.write(z);let J=Wq({input:process.stdin});return new Promise((Q)=>{J.once("line",(B)=>{J.close(),Q(B.trim())}),J.once("close",()=>Q(""))})}function A(z,J){return z.includes(J)}function m(z,J){let Q=z.indexOf(J);return Q===-1?void 0:z[Q+1]}function Gq(z){let J=[];for(let Q=0;Q<z.length;Q++){let B=z[Q];if(B==="--pick"||B==="--as"){Q++;continue}if(!B.startsWith("--"))J.push(B)}return J}function _q(z){let J=z.source==="curated"?"curated ":"registry",Q=[z.title,z.version,z.status?`[${z.status}]`:void 0].filter((B)=>B!==void 0).join(" ");return`${z.key.padEnd(40)} ${J} ${Q}${z.description?`${Q?" \u2014 ":""}${z.description}`:""}`.trimEnd()}function xq(z){let J=[`${z.key}${z.title?` (${z.title})`:""}${z.version?` v${z.version}`:""}${z.status?` [${z.status}]`:""}`,` ${z.description}`,` source ${z.source==="curated"?"curated list":"MCP registry"}`,` publisher ${z.publisher??"unknown"}`];if(z.repository)J.push(` repo ${z.repository}`);if(z.homepage)J.push(` home ${z.homepage}`);if(z.installs.length===0)J.push(" install nothing rovecode can launch (no stdio package, no streamable-http remote)");if(z.installs.forEach((Q,B)=>{if(J.push(` install ${B} ${Q.kind==="stdio"?`runs ${l(Q)}`:`connects ${Q.url}`}`),Q.kind==="stdio"){for(let q of Q.env)J.push(` env ${q.name}${q.secret?" (secret)":""}${q.required?"":" optional"}${q.description?` \u2014 ${q.description}`:""}`);for(let q of Q.pending)J.push(` needs ${q}`)}else for(let q of Q.headers)J.push(` header ${q.name}${q.template?`: ${q.template}`:""}${q.secret?" (secret)":""}${q.required?"":" optional"}`)}),z.installs.length>1)J.push(` pick one with: rovecode mcp add ${z.key} --pick N`);return J}async function Nq(z,J){let Q={};for(let B of z.asks){let q=B.secret&&z.scope==="project";if(!J.tty||q){if(B.required)J.err(`${B.name} is not set \u2014 it will be written as \${${B.name}} and read from your environment at launch`);continue}let Z=`${B.name}${B.description?` (${B.description})`:""}${B.required?"":" [optional, enter to skip]"}: `;if(Q[B.name]=B.secret?await J.secret(Z):await J.plain(Z),B.required&&Q[B.name].length===0)J.err(`${B.name} is not set \u2014 it will be written as \${${B.name}} and read from your environment at launch`)}for(let B of z.pending){if(!J.tty)continue;let q=(await J.plain(`${B}: `)).trim();if(q.length>0)Q[B]=q}return Q}async function Rq(z,J={}){let Q=J.cwd??process.cwd(),B=J.home??c(),q=J.out??console.log,Z=J.err??console.error,G={home:B,...J.market},U=J.tty??process.stdin.isTTY===!0,_=J.secret??((X)=>d(X)),x=J.plain??Aq,[K,...j]=z,k={search:[],info:[],add:["--project","--pick","--as","--yes","--force","--local","--no-local"],remove:["--project"],list:[],show:["--project"],trust:["--yes","--project"],untrust:[],login:[],help:[]};if(K!==void 0&&K in k){let X=new Set(["--pick","--as"]),Y=!1;for(let D of j){if(Y){Y=!1;continue}if(D.startsWith("--")){if(!k[K].includes(D))return Z(`unknown flag ${D} for "rovecode mcp ${K}" \u2014 see: rovecode mcp help`),2;if(X.has(D))Y=!0}}}let E=Gq(j),W=A(j,"--project")?"project":"user";switch(K){case void 0:case"help":case"--help":case"-h":for(let X of f)q(X);return K===void 0?2:0;case"search":{let X=await p(E.join(" "),G);for(let Y of X.notes)Z(`note: ${Y}`);if(X.entries.length===0)return q(`nothing matches "${E.join(" ")}"`),0;for(let Y of X.entries)q(_q(Y));return q(`\u2192 rovecode mcp info <name> \xB7 rovecode mcp add <name>${X.fromCache?" (registry results from cache)":""}`),0}case"info":{if(!E[0])return Z("usage: rovecode mcp info <name>"),2;let X=await b(E[0],G);for(let Y of X.notes)Z(`note: ${Y}`);if(!X.entry)return 1;for(let Y of xq(X.entry))q(Y);return 0}case"add":{if(!E[0])return Z("usage: rovecode mcp add <name> [--project] [--pick N] [--as <name>] [--yes] [--force]"),2;let X=await b(E[0],G);for(let $ of X.notes)Z(`note: ${$}`);if(!X.entry)return 1;let Y=m(j,"--pick"),D=Y===void 0?void 0:Number(Y);if(D!==void 0&&(!Number.isInteger(D)||D<0))return Z(`--pick wants a whole number, not "${Y}"`),2;let V=m(j,"--as"),N={scope:W,cwd:Q,home:B,...D!==void 0?{pick:D}:{},...V!==void 0?{name:V}:{}},O=L(X.entry,N);if("error"in O)return Z(O.error),1;let I=A(j,"--local")?!0:A(j,"--no-local")?!1:void 0,C=a(O.install);if(C!==void 0&&I===void 0&&W==="user"&&!A(j,"--yes")&&U){q(`${C.spec} would start through npx: ~2 s at every start, re-resolving the package (and asking the npm registry) each time.`),q("Install it once instead? npm puts the package's code under ~/.rovecode/mcp \u2014 typically 20\u201330 MB and a few seconds, one time;"),q("it then starts in ~0.4 s and needs no network to start. No keeps the npx line exactly as it is today.");let $=(await x(`install ${C.spec} once? [y/N] `)).trim().toLowerCase();I=$==="y"||$==="yes"}let H=I===!0?L(X.entry,{...N,local:!0}):O;if("error"in H)return Z(H.error),1;for(let $ of Jq(H))q($);if(!A(j,"--yes")){if(!U)return Z("nothing written: no terminal to confirm on \u2014 re-run with --yes after reading the lines above"),1;let $=(await x("install this? [y/N] ")).toLowerCase();if($!=="y"&&$!=="yes")return q("nothing written"),1}let h=await Nq(H,{secret:_,plain:x,tty:U,err:Z});if(h===null)return q("nothing written"),1;let w,T;if(H.local){let $=await s(H.local.pkg,H.local.prefix,J.spawn?{spawn:J.spawn}:{});if(!$.ok)return Z($.error),q("nothing written"),1;w=r($.pkg,H.local.pkg.rest),T={name:$.pkg.name,version:$.pkg.version,prefix:H.local.prefix,bin:$.pkg.bin,missing:$.pkg.missing,...$.pkg.integrity!==void 0?{integrity:$.pkg.integrity}:{},...$.pkg.resolved!==void 0?{resolved:$.pkg.resolved}:{}}}let M,P=zq(H,h,w);try{M=Qq(H.file,H.name,P,{replace:A(j,"--force"),...W==="project"?{trustHome:B}:{}}).trusted}catch($){return Z($ instanceof Error?$.message:String($)),1}if(q(`added "${H.name}" \u2192 ${H.file}${M===!0?" (trusted on this machine as written)":""}`),T){if($q(Dq({kind:"mcp",id:X.entry.key,source:X.entry.source,...X.entry.version!==void 0?{version:X.entry.version}:{}},{scope:W,target:H.file,package:T,installedBy:"mcp add"}),{cwd:Q,home:B}),q(`installed ${T.name} ${T.version} once \u2192 ${H.local.prefix}${T.integrity!==void 0?" (integrity recorded in installed.json)":""}`),T.missing?.length)Z(`record incomplete: ${T.missing.join("; ")}`)}if(M===!1)q("NOT trusted yet: that file already held servers you have not approved \u2014 rovecode mcp show, then rovecode mcp trust");let F=Zq(H,P);if(F.length)q(`fill in before use: ${F.join(", ")} \u2014 edit the args in that file; until then this server is skipped`);let g=Bq(H,P);if(g.length)q(`set ${g.join(", ")} in your environment \u2014 the file only names them`);if(F.length===0)q("restart rovecode to connect (servers are read once per process)");return 0}case"remove":{if(!E[0])return Z("usage: rovecode mcp remove <name> [--project]"),2;let X=y(Q,B),Y=W==="project"?X.project:X.user;try{if(!Xq(Y,E[0],W==="project"?{trustHome:B}:{}))return Z(`${Y} has no server named "${E[0]}"${W==="user"?" (project entries: add --project)":""}`),1}catch(D){return Z(D instanceof Error?D.message:String(D)),1}return q(`removed "${E[0]}" from ${Y}`),0}case"list":{let X=[],Y=Yq(Q,B,X);for(let V of X)Z(V);if(Y.length===0)return q("no MCP servers configured \u2014 rovecode mcp search <query>"),0;for(let V of Y){let N=V.scope==="user"?"":R(B,V.file)==="trusted"?"":" (file not trusted \u2014 off; rovecode mcp trust)";q(`${V.scope.padEnd(8)} ${v(V.server)}${N}`)}let D=qq(Y.filter((V)=>e(V.server)).map((V)=>V.server.name));if(D!==void 0)q(D);return 0}case"show":{for(let X of u(Q,B))q(X);return 0}case"login":return(await import("./mcp-login-bthtfpt7.js")).cmdMcpLogin(E,Q,{out:q,err:Z,home:B});case"trust":{let X=S(Q);if(X.length===0)return q("no project MCP files here (.rovecode/mcp.json, .mcp.json) \u2014 nothing to trust"),1;for(let Y of u(Q,B))q(Y);if(!A(j,"--yes")){if(!U)return Z("nothing trusted: no terminal to confirm on \u2014 re-run with --yes after reading the lines above"),1;let Y=(await x("trust these files as they are now? [y/N] ")).toLowerCase();if(Y!=="y"&&Y!=="yes")return q("nothing trusted"),1}for(let Y of X){let D=t(B,Y);q(D.ok?`trusted ${Y} (${D.digest.slice(0,12)}\u2026)`:D.reason)}return q("restart rovecode to connect \u2014 an edit to either file asks again"),0}case"untrust":{let Y=[y(Q).harvest,y(Q).project].filter((D)=>n(B,D));return q(Y.length?`untrusted ${Y.join(", ")}`:"nothing was trusted here"),0}default:Z(`unknown mcp command "${K}"`);for(let X of f)Z(X);return 2}}export{u as showLines,xq as infoLines,Rq as cmdMcp,Nq as askPlan,f as MCP_USAGE};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{d as w}from"./main-z13755t8.js";import{A as c,B as v,x as l,y as p}from"./main-8c1tbazx.js";import"./main-rsy72qmw.js";import"./main-jak598k9.js";import{dd as x,ed as k}from"./main-hqbz10aw.js";import"./main-2z3dek0b.js";import"./main-xfekqh9m.js";import"./main-rvetps99.js";import"./main-kba6zeyd.js";import"./main-2rzbexn2.js";import"./main-ywbxshqc.js";import"./main-qj2djy17.js";import"./main-6dtqmbt6.js";import"./main-rebtt91r.js";import"./main-a3f51n0x.js";import"./main-5py0rkmc.js";import{Ll as b,Sl as h}from"./main-6h9x282m.js";import"./main-vhrrq337.js";import"./main-ys6zj3yr.js";import"./main-2yeveeve.js";import"./main-0jys2ccn.js";import"./main-nqveez48.js";import{un as M}from"./main-qsevpgsv.js";h();class _{inner;tracker;constructor(j,B){this.inner=j;this.tracker=B}start(j,B){this.inner.start((G)=>{let J=this.tracker.feed(G);if(J.length>0)j(J)},B)}stop(){this.inner.stop()}drainInput(j,B){return this.inner.drainInput(j,B)}write(j){this.inner.write(j)}get columns(){return this.inner.columns}get rows(){return this.inner.rows}get kittyProtocolActive(){return this.inner.kittyProtocolActive}moveBy(j){this.inner.moveBy(j)}hideCursor(){this.inner.hideCursor()}showCursor(){this.inner.showCursor()}clearLine(){this.inner.clearLine()}clearFromCursor(){this.inner.clearFromCursor()}clearScreen(){this.inner.clearScreen()}setTitle(j){this.inner.setTitle(j)}setProgress(j){this.inner.setProgress(j)}}var E="\x1B[?1004h",N="\x1B[?1004l";function z(j,B){let G=j.replace(/[\x00-\x1f\x7f-\x9f]/g,(J)=>/\s/.test(J)?" ":"").replace(/\s+/g," ").trim();if(B<=0)return"";return G.length>B?`${G.slice(0,B-1)}\u2026`:G}var Y=(j,B)=>(j[B]??"")!=="",g=(j)=>(j.TERM_PROGRAM??"").replace(/[\s_.-]/g,"").toLowerCase();function O(j){let B=g(j),G=j.TERM??"",J=B==="ghostty"||G==="xterm-ghostty"||Y(j,"GHOSTTY_RESOURCES_DIR"),$=B==="itermapp"||B==="iterm"||B==="iterm2"||Y(j,"ITERM_SESSION_ID"),L=B==="kitty"||G==="xterm-kitty"||Y(j,"KITTY_WINDOW_ID"),D=B==="warpterminal"||B==="warp",H=B==="wezterm"||Y(j,"WEZTERM_VERSION");return J||$||L||D||H?"osc9":"bell"}var C=(j)=>Y(j,"TMUX");function I(j,B,G){if(j==="bell")return"\x07";let J=j==="osc9"?`\x1B]9;${B}\x07`:`\x1B]777;notify;rovecode;${B}\x07`;return G?`\x1BPtmux;${J.replace(/\x1b/g,"\x1B\x1B")}\x1B\\`:J}function P(j,B){if(j==="approval")return`approval needed: ${z(B.tool??"",40)} ${z(B.argsPreview??"",40)}`.trimEnd();if(j==="question")return`question: ${z(B.question??"",60)}`;let G=z(B.lastText??"",120);return G?`run finished: ${G}`:"run finished"}var S=(j)=>!Array.isArray(j);function F(j){let B=j.trim();if(B.startsWith("[")){let J;try{J=JSON.parse(B)}catch($){return{error:`not a JSON array (${$ instanceof Error?$.message:String($)})`}}if(!Array.isArray(J)||J.length===0||!J.every(($)=>typeof $==="string"&&$.length>0))return{error:"a JSON array must hold one or more non-empty strings"};return J}let G=B.split(/\s+/).filter((J)=>J.length>0);return G.length===0?{error:"empty command"}:G}class q{focused=!0;feed(j){if(!j.includes("\x1B["))return j;return j.replace(/\x1b\[([IO])/g,(B,G)=>{return this.focused=G==="I",""})}}var i=["auto","bell","osc9","osc777"],s=["unfocused","always"],T=(j)=>(j??"").trim().toLowerCase();function a(j,B={}){let G=B.env??process.env,J=B.settings??b(j),$={...J.user,...J.project},L=[],D,H=T(G.ROVECODE_NOTIFY);if(H==="off")D=void 0;else if(i.includes(H))D=H;else{if(H!=="")L.push(`notify: unknown value "${H}" in ROVECODE_NOTIFY \u2014 off | auto | bell | osc9 | osc777; using the settings files`);D=$.bell===!1?void 0:$.notify??"auto"}let Q=D==="auto"?O(G):D,K=$.notify_when??"unfocused",Z=T(G.ROVECODE_NOTIFY_WHEN);if(s.includes(Z))K=Z;else if(Z!=="")L.push(`notify_when: unknown value "${Z}" in ROVECODE_NOTIFY_WHEN \u2014 unfocused | always; using ${K}`);let V,U,A=G.ROVECODE_NOTIFY_COMMAND;if(A!==void 0&&A.trim()!=="")V=A,U="ROVECODE_NOTIFY_COMMAND";else{if(J.project.notify_command!==void 0)V=J.project.notify_command,U=J.projectPath;else if(J.dropped.includes("notify_command"))L.push(`notify_command: set by ${J.projectPath}, a repository file this machine has not approved \u2014 ignored (rovecode trust show \xB7 rovecode trust; in the TUI: /trust); set it in ~/.rovecode/settings.json or ROVECODE_NOTIFY_COMMAND to use your own`);if(V===void 0&&J.user.notify_command!==void 0)V=J.user.notify_command,U="~/.rovecode/settings.json"}let R;if(V!==void 0){let X=F(V);if(S(X))L.push(`notify_command (${U}): ${X.error} \u2014 the hook is off`);else{let W=x(X),u=k().check(X).decision;if(W!==null)L.push(`notify_command (${U}): "${X.join(" ")}" is a dangerous command (${W}) \u2014 the hook is off`);else if(u==="forbidden")L.push(`notify_command (${U}): execpolicy forbids "${X.join(" ")}" \u2014 the hook is off`);else R=X}}return{...Q!==void 0?{method:Q}:{},when:K,...R!==void 0?{hook:R,hookSource:U}:{},tmux:C(G),notes:L}}var y=400;function o(j,B,G){if(j==="approval")return{type:"approval-requested",cwd:G,tool:B.tool??"","args-preview":B.argsPreview??""};if(j==="question")return{type:"question-requested",cwd:G,question:B.question??""};return{type:"agent-turn-complete",cwd:G,"last-assistant-message":B.lastText??null}}var d=(j,B)=>Bun.spawn(j,B);function r(j=d){return(B)=>{j(B,{stdio:["ignore","ignore","ignore"]}).unref()}}var f=(j)=>j instanceof Error?j.message:String(j);class m{config;cwd;write;focused;spawn;note;seqOff=!1;hookOff=!1;notesShown=!1;decset=!1;constructor(j){this.config=j.config,this.cwd=j.cwd??process.cwd(),this.write=j.write??(()=>{}),this.focused=j.focused??(()=>!0),this.spawn=j.spawn??r(),this.note=j.note??(()=>{})}active(){return this.config.method!==void 0||this.config.hook!==void 0}showNotes(){if(this.notesShown)return;this.notesShown=!0;for(let j of this.config.notes)this.note(j,"warn")}focusOn(){if(this.showNotes(),!this.active())return!1;return this.decset=!0,this.emit(E),!0}focusOff(){if(!this.decset)return;this.decset=!1,this.emit(N)}fire(j,B){if(this.showNotes(),!(this.config.when==="always"||!this.focused()))return;let{method:G,hook:J}=this.config;if(G!==void 0)this.emit(I(G,P(j,B),this.config.tmux));if(J!==void 0&&!this.hookOff)this.runHook(J,o(j,B,this.cwd))}emit(j){if(this.seqOff)return;try{this.write(j)}catch(B){this.seqOff=!0,this.note(`notify: the terminal write failed (${f(B)}) \u2014 terminal notifications are off for this session`,"warn")}}runHook(j,B){try{this.spawn([...j,JSON.stringify(B)])}catch(G){this.hookOff=!0,this.note(`notify_command: could not start ${j[0]} (${f(G)}) \u2014 the hook is off for this session`,"warn")}}}function n(j,B){let G=!1,J=!1,$=!1,L=0,D,H={start(Q,K){let Z=L,V=j.start(Q,K),U=()=>{if(Z===L&&!J)J=!0,$=B.focusOn()};if(V)return V.then(U);U()},stop(){if(L++,$)$=!1,B.focusOff();J=!1,j.stop()},askApproval(Q,K,Z){if(J)B.fire("approval",{tool:Q,argsPreview:K});return j.askApproval(Q,K,Z)},askQuestion(Q,K){if(J)B.fire("question",{question:Q.question});return j.askQuestion(Q,K)},setBusy(Q,K){if(j.setBusy(Q,K),Q){G=!0,D=void 0;return}let Z=G&&K===void 0;if(G=!1,Z&&J)B.fire("run_end",{...D!==void 0?{lastText:D}:{}})},beginAssistant(){let Q=j.beginAssistant(),K="";return{append(Z){if(Q.append(Z),K.length<y)K=(K+Z).slice(0,y)},done(){Q.done(),D=K}}}};return new Proxy(j,{get(Q,K){if(typeof K==="string"&&Object.hasOwn(H,K))return H[K];let Z=Reflect.get(Q,K,Q);return typeof Z==="function"?Z.bind(Q):Z}})}function Qj(j,B=process.env,G=process.stdout,J=process.stdin,$=process.cwd()){let L=G.isTTY===!0,D=L?new q:void 0,H=w(j,B,G,{stdin:J,...D?{focus:D}:{}});if(!H){let{PiTuiRenderer:K}=(v(),M(c)),{ProcessTerminal:Z}=(p(),M(l));H=new K({cwd:$,terminal:D?new _(new Z,D):new Z})}if(J.isTTY!==!0)J.on?.("end",()=>{try{process.exit(0)}catch{}});let Q=new m({config:a($,{env:B}),cwd:$,write:L?(K)=>{G.write(K)}:()=>{},focused:()=>D?.focused??!0,note:(K,Z)=>H.addSystemNote(K,Z)});return n(H,Q)}export{n as withNotifications,a as resolveNotifyConfig,o as payloadFor,Qj as interactiveRenderer,r as defaultSpawner,m as Notifier,s as NOTIFY_WHENS,i as NOTIFY_METHODS};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{$l as i,Wl as d,Xl as e,Yl as f,Zl as g,_l as h,am as j,bm as k}from"./main-b8zq261k.js";import{hm as a,im as b,jm as c}from"./main-wk2csfnj.js";import"./main-y5c82rxr.js";import"./main-ys6zj3yr.js";import"./main-mjt2p7aj.js";import"./main-2yeveeve.js";import"./main-0jys2ccn.js";import"./main-nqveez48.js";import"./main-qsevpgsv.js";k();export{f as saveMcpOAuth,j as runtimeAuthProvider,i as runMcpLoginFlow,a as needsLoginText,d as mcpOAuthId,e as loadMcpOAuth,c as hasStaticAuthorization,g as McpRuntimeAuthProvider,b as McpNeedsLoginError,h as McpLoginAuthProvider};
@@ -0,0 +1,16 @@
1
+ // @bun
2
+ import{Hh as T}from"./main-qvarybsp.js";import{wj as y,yj as A}from"./main-2rzbexn2.js";import{Bj as L,Ej as w}from"./main-v8y60bb2.js";import{Mk as O,Qk as _}from"./main-qj2djy17.js";import"./main-6dtqmbt6.js";import"./main-rebtt91r.js";import"./main-a3f51n0x.js";import"./main-5py0rkmc.js";import"./main-6h9x282m.js";import"./main-vhrrq337.js";import"./main-2yeveeve.js";import"./main-0jys2ccn.js";import"./main-nqveez48.js";import"./main-qsevpgsv.js";_();A();w();import{format as F}from"util";var S=["text","json","ndjson"],U="--output <mode>: text (default) | json | ndjson",M=(j)=>{return process.stderr.write(`error: ${j} \u2014 ${U}
3
+ `),process.exit(2)};function E(j){return S.includes(j)}function m(j,J=M){let K=j.slice(2),H;for(let R=0;R<K.length;R++){let Y=K[R];if(Y==="--output"){let $=K[++R];if($===void 0||$.startsWith("-"))return J("--output needs a value");H=$}else if(Y.startsWith("--output="))H=Y.slice(9)}if(H===void 0)return"text";return E(H)?H:J(`unknown --output mode "${H}"`)}function v(j,J){let K=j.cmd==="run"?[...j.rest]:[j.cmd,...j.rest],H=J.slice(2),R=(N)=>N.startsWith("-"),Y=H.findIndex((N,X)=>!R(N)&&!(X>0&&T.has(H[X-1])));if(Y===-1)return K;let $=j.cmd==="run"?Y+1:Y,z=[];H.forEach((N,X)=>{let W=H[X+1];if(!T.has(N)||X<Y||W===void 0||R(W))return;z.push(H.slice($,X+1).filter((D)=>!R(D)).length)});for(let N of z.reverse())K.splice(N,1);return K}async function l(j,J={}){if(j.isTTY===!0)return"";let K=J.firstByteMs??3000,H=J.maxChars??1e6;return new Promise((R)=>{let Y=[],$=!1,z=!1,N=()=>{if(z)return;z=!0,clearTimeout(X);let W=Buffer.concat(Y).toString("utf8");if(W.length>H)J.note?.(`stdin: ${W.length.toLocaleString("en-US")} characters piped in \u2014 kept the first ${H.toLocaleString("en-US")}`);R(W.slice(0,H))},X=setTimeout(()=>{if($||z)return;J.note?.(`stdin: not a terminal, but nothing arrived in ${K/1000} s \u2014 ignored (pipe your input, or pass --no-stdin)`);try{j.pause?.()}catch{}N()},K);j.on("data",(W)=>{$=!0,Y.push(Buffer.isBuffer(W)?W:Buffer.from(W))}),j.on("end",N),j.on("close",N),j.on("error",N);try{j.resume?.()}catch{N()}})}function c(j,J){let K=J.replace(/\r\n?/g,`
4
+ `).replace(/\n+$/,"");if(K.length===0)return j;let H="```";while(K.includes(H))H+="`";return`${j.trim().length>0?j.trim():"Here is the input:"}
5
+
6
+ ${H}
7
+ ${K}
8
+ ${H}`}function I(j){let J={log:console.log,info:console.info,debug:console.debug,write:process.stdout.write},K=(...H)=>{j.write(`${F(...H)}
9
+ `)};return console.log=K,console.info=K,console.debug=K,process.stdout.write=(H)=>{return j.write(typeof H==="string"?H:new TextDecoder().decode(H)),!0},{restore(){console.log=J.log,console.info=J.info,console.debug=J.debug,process.stdout.write=J.write}}}function C(j){if(j==="done")return 0;if(j==="stopped")return 130;return 1}var k=(j)=>{try{process.once("SIGINT",j)}catch{return()=>{}}return()=>{try{process.off("SIGINT",j)}catch{}}};function r(j,J){let K=Date.now(),H=J.stdout===process.stdout,R=H?{write:process.stdout.write.bind(process.stdout)}:J.stdout,Y=j!=="text"&&H?I(J.stderr):null,$=new AbortController,z=(J.onInterrupt??k)(()=>$.abort()),N=null,X=0,W=0,D=new Map,b=(q)=>{let Q=`${W}:${q}`,Z=D.get(Q)??{id:q,ok:!1};return D.set(Q,Z),Z},P=(q)=>{if(j==="text")R.write(`${q}
10
+ `);else if(j==="json")J.stderr.write(`${q}
11
+ `)};return{mode:j,signal:$.signal,onEvent(q){if(j==="ndjson")R.write(`${JSON.stringify(q)}
12
+ `);if(q.type==="run_start")N=q.sessionId,X=J.messages().length;else if(q.type==="turn_start")W=q.turn;else if(q.type==="tool_execution_start")b(q.callId).tool=q.tool,P(`\u2192 ${q.tool} ${String(JSON.stringify(q.args)).slice(0,100)}`);else if(q.type==="tool_execution_end")Object.assign(b(q.callId),{ok:q.ok,ms:q.durationMs}),P(`\u2190 ${q.ok?"ok":"FAIL"} ${q.output.slice(0,200).replace(/\n/g," \u23CE ")}`);else if(q.type==="tool_call_failed")b(q.callId).ok=!1;else if(q.type==="verify")P(q.state==="running"?`\u2192 verify ${q.command.slice(0,100)}`:`\u2190 ${q.state==="passed"?"ok":"FAIL"} verify ${q.detail??q.state}`)},finish(q){z();let Q=C(q?.status);if(j==="text"){if(q)R.write(`
13
+ ${q.summary}
14
+ `);if(q?.status==="done"&&q.outstanding){let B=O(q.outstanding);if(B!==null)R.write(`done \xB7 ${B}
15
+ `)}return Q}let Z=f(q??{status:"error",summary:"stream ended without run_end"},Q,N,J.model,J.messages().slice(X),[...D.values()],J.catalog??new L,Date.now()-K);return R.write(`${JSON.stringify(j==="json"?Z:{type:"result",...Z})}
16
+ `),Q},close(){Y?.restore()}}}function i(j,J,K){return{stream:J,registry:j.registry,store:j.store,tools:j.registry.list().map((H)=>H.schema),guard:j.guard,planReminder:j.planReminder,cwd:j.cwd,signal:K.signal,hooks:j.hooks}}function f(j,J,K,H,R,Y,$,z){let N=R.filter((q)=>q.role==="assistant"),X={input:0,output:0,cacheRead:0,cacheWrite:0},W=0;for(let q of N){let Q=q.usage;if(!Q)continue;let Z={input:Q.input,output:Q.output,cacheRead:Q.cacheRead??0,cacheWrite:Q.cacheWrite??0};if(X.input+=Z.input,X.output+=Z.output,X.cacheRead+=Z.cacheRead,X.cacheWrite+=Z.cacheWrite,W===null||Z.input===0&&Z.output===0&&Z.cacheRead===0&&Z.cacheWrite===0)continue;let B=q.origin??H,V=$.lookup(B.provider,B.model)?.pricing,G=V?y(Z,V):void 0;W=G===void 0?null:W+G}let D=new Map;for(let q of N)for(let Q of q.parts)if(Q.kind==="tool_call")D.set(Q.id,[...D.get(Q.id)??[],Q.tool]);let b=new Map,P=N.at(-1)?.origin;return{status:j.status,summary:j.summary,sessionId:K,...j.outstanding?{outstanding:j.outstanding}:{},model:{provider:H.provider,model:H.model},origin:P?{provider:P.provider,model:P.model}:null,usage:X,costUsd:W,toolCalls:Y.map((q)=>{let Q=b.get(q.id)??0;return b.set(q.id,Q+1),{tool:q.tool??D.get(q.id)?.[Q]??"unknown",ok:q.ok,...q.ms!==void 0?{ms:q.ms}:{}}}),durationMs:z,exitCode:J}}export{c as withPipedInput,v as runPromptWords,l as readPipedStdin,m as parseOutputMode,I as guardStdout,C as exitCodeFor,r as createOutputSink,i as buildRunDeps,S as OUTPUT_MODES};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{fj as a,gj as b,hj as c,ij as d,jj as e,kj as f,lj as g,mj as h,nj as i,oj as j,pj as k,qj as l,rj as m}from"./main-1ztz6fkj.js";import"./main-2yeveeve.js";import"./main-0jys2ccn.js";import"./main-qsevpgsv.js";export{i as wireProfileFor,m as profileWire,l as profilePromptSection,k as profileOverridePaths,j as profileHint,h as profileFor,c as SONNET_5_VOICE,b as SONNET_5_PERSONA,g as PROFILES,e as GLM_53_PROFILE,f as GLM_53_PLAIN_PROFILE,d as GLM_53_MODEL_RE,a as GLM_53_AGENT_CONTRACT};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{$i as k,Ri as a,Si as b,Ti as c,Ui as d,Vi as e,Wi as f,Xi as g,Yi as h,Zi as i,_i as j,aj as l,bj as m,cj as n,dj as o,ej as p}from"./main-xx2z3zh5.js";import"./main-2yeveeve.js";import"./main-0jys2ccn.js";import"./main-qsevpgsv.js";export{i as writeProvidersFile,g as validateSpec,b as userProvidersPath,j as resolveKey,h as readProvidersFile,d as providersPathFor,c as projectProvidersPath,o as pickDefault,n as parseSelector,l as isConfigured,f as inferProtocol,k as envCustomProvider,m as buildSnapshot,p as ProviderConfig,e as PROVIDER_ID_RE,a as BUILTIN_PROVIDERS};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Fd as a,Gd as b,Hd as c}from"./main-23q7cmww.js";import"./main-wqt32p5x.js";import"./main-2wyax8k9.js";import"./main-01pv9206.js";import"./main-s9v8k74e.js";import"./main-6vjeds42.js";import"./main-xx2z3zh5.js";import"./main-1ztz6fkj.js";import"./main-2rzbexn2.js";import"./main-v8y60bb2.js";import"./main-ywbxshqc.js";import"./main-qj2djy17.js";import"./main-6dtqmbt6.js";import"./main-rebtt91r.js";import"./main-a3f51n0x.js";import"./main-5py0rkmc.js";import"./main-6h9x282m.js";import"./main-vhrrq337.js";import"./main-mjt2p7aj.js";import"./main-2yeveeve.js";import"./main-0jys2ccn.js";import"./main-nqveez48.js";import"./main-qsevpgsv.js";export{b as providerListTool,c as providerEditTool,a as looksLikeSecret};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Ab as b,Bb as c,Cb as d,Db as e,Eb as f,Fb as g,Gb as h,Hb as i,Ib as j,zb as a}from"./main-tjvwmscs.js";import"./main-7kt6r53y.js";import"./main-y5c82rxr.js";import"./main-2yeveeve.js";import"./main-0jys2ccn.js";import"./main-nqveez48.js";import"./main-qsevpgsv.js";j();export{g as searchMarket,f as itemFromMcp,e as itemFromCatalog,h as findItem,d as capBytes,i as allItems,c as MCP_DOCS_FILE,b as CATALOG_FILES,a as CATALOG_DIR};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Lf as a,Mf as b,Nf as c,Of as d,Pf as e,Qf as f,Rf as g,Sf as h,Tf as i,Uf as j}from"./main-wqt32p5x.js";import"./main-2wyax8k9.js";import"./main-01pv9206.js";import"./main-s9v8k74e.js";import"./main-6vjeds42.js";import"./main-xx2z3zh5.js";import"./main-1ztz6fkj.js";import"./main-2rzbexn2.js";import"./main-v8y60bb2.js";import"./main-ywbxshqc.js";import"./main-qj2djy17.js";import"./main-6dtqmbt6.js";import"./main-rebtt91r.js";import"./main-a3f51n0x.js";import"./main-5py0rkmc.js";import"./main-6h9x282m.js";import"./main-vhrrq337.js";import"./main-mjt2p7aj.js";import"./main-2yeveeve.js";import"./main-0jys2ccn.js";import"./main-nqveez48.js";import"./main-qsevpgsv.js";export{a as toWireConfig,e as scrubSecret,h as parseAddArgs,j as formatProviderList,i as formatProviderLine,b as defaultAdapterFactory,d as configErrorTurn,f as ProviderRegistry,c as CONFIG_ERROR_PREFIX,g as ADD_USAGE};