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
package/README.md CHANGED
@@ -8,7 +8,7 @@ OpenHands) — every port traces to file:line in a snapshotted source and lands
8
8
  fresh-context critic verifies it against a pre-written bar (ledger: `PORTS.md`, kept outside this
9
9
  repository for now).
10
10
 
11
- ![The sextant TUI at 160×44 cells: the files tree with git statuses, the code panel on src/auth/callback.ts with edited lines highlighted, the messages panel with read and edit tool rows and an approval card asking to run bun test, the plan at step 1 of 4, usage at 13% context, and the rovecode cloud pet waiting for a nod.](https://raw.githubusercontent.com/9Code-Labs/rovecode-site/main/public/shots/approval-160x44.png)
11
+ ![The sextant TUI at 160×44 cells: the files tree with git statuses, the code panel on src/auth/callback.ts with edited lines highlighted, the messages panel with read and edit tool rows and an approval card asking to run bun test, the plan at step 1 of 4, usage at 13% context, and the rovecode cloud pet waiting for a nod.](https://raw.githubusercontent.com/9Code-Labs/rovecode-community/main/docs/assets/approval-160x44.png)
12
12
 
13
13
  ## Status (2026-09-04, post wave 4)
14
14
 
@@ -38,18 +38,22 @@ repository for now).
38
38
  - **run budgets** — `--max-turns` / `--max-seconds`, so a spiral ends in a result instead of an outside kill
39
39
  - a decided **wire-failure policy** (`docs/wire-failures.md`): what is retried, what is never retried after
40
40
  text has arrived, and the wait announced while it happens
41
- - the **site** ([its own repo](https://github.com/9Code-Labs/rovecode-site), 15 languages, prerendered, [live](http://64.177.43.110/)) and the CI/CD workflows
41
+ - the **site** ([live at rovecode.dev](https://rovecode.dev), 15 languages, prerendered) and the CI/CD workflows
42
42
  that build and ship it
43
43
  - **sextant** gained mouse and scrollbar dragging, the page tab strip, the notices history and prompt suggestions
44
44
  - **startup** is lazy: `rovecode --help` no longer boots the TUI, the loop, the runtime or the plugin scanner
45
45
 
46
46
  ## Install
47
47
 
48
- Requires [Bun](https://bun.sh) ≥ 1.3.14 (the CLI entry is TypeScript, executed by bun — node cannot run it).
48
+ Requires [Bun](https://bun.sh) ≥ 1.3.14 on PATH (both the published bundle and the source are executed by bun — node cannot run them).
49
49
 
50
50
  ```bash
51
- # from source
52
- git clone https://github.com/9Code-Labs/rovecode.git && cd rovecode && bun install
51
+ # from npm — the published minified bundle (beta channel until a stable is cut)
52
+ npm install -g rovecode@beta
53
+ rovecode --version
54
+
55
+ # from source (this repository is the bundle's AGPL source)
56
+ git clone https://github.com/9Code-Labs/rovecode-community.git && cd rovecode-community && bun install
53
57
  bun run src/cli/main.ts --help # or: bun link → `rovecode` on PATH
54
58
  bun run build:cli # optional: pre-bundle (TUI cold start ~230 ms → ~80 ms); re-run after git pull
55
59
 
@@ -57,18 +61,24 @@ bun run build:cli # optional: pre-bundle (TUI cold start ~
57
61
  bun run build # scripts/build.ts → dist/rovecode(.exe) + smoke
58
62
  dist/rovecode.exe --version
59
63
 
60
- # from an npm tarball (npm pack) — global install shims to bun via the shebang
61
- npm install -g ./rovecode-0.3.1.tgz
64
+ # from a locally packed tarball — npm pack runs the minified build:npm through prepack
65
+ npm pack && npm install -g ./rovecode-0.4.0-beta.0.tgz
62
66
  ```
63
67
 
64
- Not yet published to the npm registry (name availability unverified). Releases are cut on
65
- [GitHub Releases](https://github.com/9Code-Labs/rovecode/releases) — v0.3.1 is the current one — and there is no
66
- self-update: `git pull` and rebuild, or reinstall the binary. Rovecode does tell you when that is worth doing: the
67
- TUI's startup card carries `update available: 0.3.0 → 0.4.0 · <release url>` when a newer release exists. The check
68
- (`src/core/update-check.ts`) asks GitHub once every six hours (cached in `~/.rovecode/update-check.json`), never
69
- blocks the start and never throws. The repository is private, so it needs `GITHUB_TOKEN`, `GH_TOKEN` or a
70
- `gh auth login`; without one the result is "unknown — the release repository is private and no token is set",
71
- never "up to date", and the card prints nothing rather than a guess. Only a real newer release produces a line
68
+ Published to npm as [`rovecode`](https://www.npmjs.com/package/rovecode): the tarball carries the minified
69
+ bundle, and THIS repository is its source, as the AGPL requires (`npm install -g rovecode` — the beta
70
+ channel is `rovecode@beta`). Releases are cut on
71
+ [GitHub Releases](https://github.com/9Code-Labs/rovecode-community/releases). `rovecode update` updates
72
+ this installation the way it was installed (npm: `npm install -g rovecode@<channel>`; a source checkout:
73
+ `git pull` + `bun install`; the channel follows the running version, so a beta stays on beta), and
74
+ `"autoUpdate": true` in settings.json (or `ROVECODE_AUTO_UPDATE=1`) runs that plan in the background at
75
+ boot when the check finds a newer release — the session is never blocked or swapped; the note says
76
+ restart. A compiled binary does not replace itself yet and says where the new artifact is. Rovecode does tell you when that is worth doing: the
77
+ TUI's startup card carries `update available: 0.3.2 → 0.4.0 · <release url>` when a newer release exists. The check
78
+ (`src/core/update-check.ts`) asks GitHub once every six hours (cached per release repo in `~/.rovecode/update-check-<repo>.json`), never
79
+ blocks the start and never throws. The repository is public, so the check works anonymously; `GITHUB_TOKEN`,
80
+ `GH_TOKEN` or a `gh auth login` only raise the rate limit. When the check could not look,
81
+ the card prints nothing rather than a guess. Only a real newer release produces a line
72
82
  on the card — `rovecode --version` prints the version to stdout alone (so a script can still read it) and, on
73
83
  stderr, whatever the last check found. It reads the cache and never opens a socket: a courtesy line must not
74
84
  make the one command scripts call to identify a build wait on the network.
@@ -372,6 +382,10 @@ mcp/ acp/ server/ tui/ sextant/ surfaces over the same loop (no second loop
372
382
  eval/ scripted-provider gauntlet + deterministic benches
373
383
  ```
374
384
 
385
+ ## Supported extension API
386
+
387
+ Distributed integrations should import only `rovecode/extensions`, `rovecode/plugins`, or `rovecode/providers`; deep `src/` imports are internal. See [API stability](docs/api-stability.md), [extension interfaces](docs/extensions.md), the [authentication boundary](docs/authentication-boundary.md), and the [open-core architecture](docs/open-core-architecture.md). Public code is mechanically prevented from importing private overlays or hosted product-auth/control-plane contracts. Generic local provider and MCP authentication remain part of the usable open-source core.
388
+
375
389
  ## Configuration
376
390
 
377
391
  Defaults < project config chunks (harvested, capped) < env < CLI flags.
@@ -672,7 +686,7 @@ tokens, cache hits, and catalog-priced spend.
672
686
  either file asks again) and `mcp untrust` revokes it. User-scope servers need no gate. `rovecode trust` is the same
673
687
  store one level up: it approves the MCP files together with `hooks.ts`, `sandbox.json` and the command-bearing
674
688
  settings keys in one step (see Project trust above).
675
- - **Market** (`src/market`, `docs/market.md`): one shelf over all three — `rovecode market search|info|docs|
689
+ - **Market** (`src/market`, [`docs/mcp-market.md`](docs/mcp-market.md)): one shelf over all three — `rovecode market search|info|docs|
676
690
  install|remove|list|update|sources|verify|validate` (each with `--json`) and `/market` in the TUI find MCP
677
691
  servers, skills and plugins
678
692
  and install any of them with one command. A single argument resolves five shapes (bare id, `kind:id`, a git URL,
@@ -692,34 +706,6 @@ tokens, cache hits, and catalog-priced spend.
692
706
  `.rovecode/design.json`) and `design_audit`, which counts template patterns in source and reports them as
693
707
  *slop* only while nothing is recorded, or as *deviation* from what the project chose. `ROVECODE_DESIGN=off`
694
708
  drops the section for runs with no UI in them.
695
- - **Site** ([9Code-Labs/rovecode-site](https://github.com/9Code-Labs/rovecode-site), `docs/deploy.md`):
696
- the landing page, the docs and the market — Vite + React, prerendered once per language, no runtime.
697
- It moved out of this repository on 2026-09-06 and builds without reading anything outside itself.
698
- What stays here is the content it renders: `bun run publish:site` regenerates `docs.json`,
699
- `market.json` and `facts.json` from `docs/*.md`, `src/market/catalogs/`, `src/mcp/market-catalog.ts`
700
- and `plugins/`, and pushes them there. Deploying is `bun run deploy` in that repo. Live at
701
- [64.177.43.110](http://64.177.43.110/) until there is a domain.
702
-
703
- ## License & notices
704
-
705
- Rovecode is free software under the GNU Affero General Public License v3.0 — see `LICENSE`.
706
- Copyright (C) 2026 9Code Labs. You may use, study, modify and redistribute it; every copy and every
707
- derivative must keep this license and its copyright notices, and if you run a modified rovecode as a
708
- network service you must offer its complete source to the users of that service.
709
-
710
- Third-party attributions (Apache-2.0 NOTICE entries + MIT credits): `THIRD_PARTY_NOTICES.md`
711
- (shipped in the npm tarball). No code from crush (FSL), claw-code, nanocoder, iflow, or the Claude
712
- Agent SDK.
713
-
714
- ## What wave 3 added (`PORTS.md` §Wave-3)
715
-
716
- Landed, not planned. Ports #21–#39: mid-turn cancellation, first-class grep/glob/ls tools,
717
- retry-with-backoff, approval diff previews, compaction v2, background subagents, sandbox rung config,
718
- reflection retries, hooks v2, custom slash commands, web fetch, todo/ask_user tools, image input,
719
- JSON/NDJSON output modes, session export, OTel spans.
720
-
721
- ### Not built
722
-
723
709
  - **#47 external agentic-CLI lanes** — the one wave-4 row that was never implemented here. Measured
724
710
  2026-09-06 rather than assumed: `claude -p` and `opencode run` already work through the `bash` tool
725
711
  today, in print mode, without a TTY. What makes a lane a real feature rather than a shortcut is the
@@ -733,5 +719,7 @@ JSON/NDJSON output modes, session export, OTel spans.
733
719
  and name the account it spends from. (`opencode` also writes `.opencode/` and `docs/` into the working
734
720
  directory even when it fails, and on Windows a nested shell layer ate the backslashes of an absolute
735
721
  path and produced a file literally named `C:UsersberkaycikAppData…banana.txt`.)
736
- - **Publishing**: no npm package; the binary is built locally (see Known limitations)
722
+ - **Publishing**: the npm package (`rovecode`) ships the minified bundle from this repository via the
723
+ `prepack` hook; the repo itself stays the AGPL source. `npm install -g rovecode@beta` for the beta
724
+ channel, `rovecode` for the latest stable cut.
737
725
  - **Linux/macOS CI**: POSIX paths are exercised in tests, but only Windows is gated
@@ -0,0 +1,24 @@
1
+ #!/usr/bin/env bun
2
+ /** Published entry point. The npm tarball is DIST-ONLY (minified bundle; the public repository
3
+ * 9Code-Labs/rovecode-community is its AGPL source), so this shim prefers dist/cli/main.js and
4
+ * falls back to the TypeScript source for a git checkout that has not been built yet.
5
+ * ROVECODE_TRACE_BOOT=1 prints which one runs. */
6
+ import { existsSync } from "node:fs";
7
+ import { join } from "node:path";
8
+
9
+ const root = join(import.meta.dir, "..");
10
+ const bundled = join(root, "dist", "cli", "main.js");
11
+ const source = join(root, "src", "cli", "main.ts");
12
+
13
+ if (process.env.ROVECODE_TRACE_BOOT === "1") {
14
+ process.stderr.write(`[boot] dist=${existsSync(bundled)}\n`);
15
+ }
16
+
17
+ if (existsSync(bundled)) {
18
+ await import(bundled);
19
+ } else if (existsSync(source)) {
20
+ await import(source);
21
+ } else {
22
+ console.error("rovecode: neither dist/cli/main.js nor src/cli/main.ts is here — run `bun run build:cli` in a source checkout, or reinstall the package");
23
+ process.exit(2);
24
+ }
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{g as b,h as c}from"./main-j7ttv0sd.js";import{j as a}from"./main-vxnwe5xx.js";import"./main-8c1tbazx.js";import"./main-edxc3yzt.js";import"./main-na7wse0x.js";import"./main-hrrvcfan.js";import"./main-rsy72qmw.js";import"./main-rpg7h8mb.js";import"./main-zc7pyrbj.js";import"./main-45ejth3a.js";import"./main-jak598k9.js";import"./main-7kt6r53y.js";import"./main-9ht36z12.js";import"./main-nvc3yjay.js";import"./main-bxtvnf6d.js";import"./main-4p4e2w7x.js";import"./main-hqbz10aw.js";import"./main-n6qrdbmy.js";import"./main-evgz4mp5.js";import"./main-f33fc5je.js";import"./main-2zgsknth.js";import"./main-kwwsz6rq.js";import"./main-23q7cmww.js";import"./main-45rn3trk.js";import"./main-yrjt2sqt.js";import"./main-a2yfvcy9.js";import"./main-gth53dnt.js";import"./main-2z3dek0b.js";import"./main-9a9rnh47.js";import"./main-mg9b20ac.js";import"./main-p0cfn6nr.js";import"./main-xfekqh9m.js";import"./main-s4bb0jav.js";import"./main-wqt32p5x.js";import"./main-rvetps99.js";import"./main-x9ct6y1a.js";import"./main-mg4f96e1.js";import"./main-wgph00xf.js";import"./main-7jd5vh3x.js";import"./main-fvnpq46y.js";import"./main-4y0tnfpa.js";import"./main-xt9zc3n6.js";import"./main-ntqef02r.js";import"./main-mgb9ccnx.js";import"./main-wm997zjx.js";import"./main-kba6zeyd.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-gbbty4d4.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-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";export{c as runTui,a as buildCostNote,b as TUI_COMMANDS};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Df as a,Ef as b,Ff as c,Gf as d,Hf as e,If as f,Jf as g,Kf as h}from"./main-s4bb0jav.js";import"./main-qsevpgsv.js";export{g as parseQuestion,h as askUserTool,c as MAX_QUESTION_CHARS,b as MAX_OPTION_CHARS,a as MAX_OPTIONS,d as ASK_USER_UNAVAILABLE,f as ASK_USER_DECLINED,e as ASK_USER_ABORTED};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Cc as a,Dc as b,Ec as c,Fc as d,Gc as e,Hc as f,Ic as g}from"./main-wpkyraxh.js";import"./main-s9v8k74e.js";import"./main-mjt2p7aj.js";import"./main-2yeveeve.js";import"./main-0jys2ccn.js";import"./main-qsevpgsv.js";export{f as runAuthLogin,d as printAuthList,c as formatAuthList,b as expiryText,e as describeNotice,g as cmdAuthLogin,a as AUTH_LOGIN_USAGE};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{$m as r,Km as a,Lm as b,Mm as c,Nm as d,Om as e,Pm as f,Qm as g,Rm as h,Sm as i,Tm as j,Um as k,Vm as l,Wm as m,Xm as n,Ym as o,Zm as p,_m as q}from"./main-2yeveeve.js";import"./main-0jys2ccn.js";import"./main-qsevpgsv.js";r();export{i as writeEntry,j as saveOAuthCredential,k as saveCredential,b as rovecodeHome,l as removeCredential,m as redactSecret,q as readSecret,h as readEntry,c as migrateLegacyHome,f as loadOAuthCredentials,e as loadCredentials,n as listProviders,o as keyNameFor,g as isMcpOAuthRecord,p as echoScrubSequence,d as credentialsPath,a as CREDENTIALS_FILE_MODE};
@@ -0,0 +1,9 @@
1
+ // @bun
2
+ import{hg as T,jg as g,kg as u,lg as F}from"./main-rvetps99.js";import"./main-kba6zeyd.js";import{wi as I,xi as Q}from"./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{Hk as k,Jk as x,Qk as y}from"./main-qj2djy17.js";import{ll as R,ml as h}from"./main-6dtqmbt6.js";import{pl as U,rl as f}from"./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";y();f();h();F();import{mkdtempSync as $,writeFileSync as L,readFileSync as B,rmSync as b}from"fs";import{tmpdir as N}from"os";import{join as M}from"path";import{randomUUID as D}from"crypto";var S={maxTurns:10,contextBudgetTokens:400000,compactionThreshold:0.8,parallelTools:!0,permissionRules:[{action:"*",resource:"*",effect:"allow"}]},p={name:"bench",systemPrompt:"bench",tools:["*"]};async function m(q,C){let z=$(M(N(),"rovecode-bench-"));for(let K=0;K<q;K++)L(M(z,`f${K}.txt`),Array.from({length:50},(X,_)=>`line-${K}-${_}`).join(`
3
+ `)+`
4
+ `);let G=new R($(M(N(),"rovecode-bench-s-")),D()),O=new U;O.register(T,g,u);let W=Date.now(),A=0,H=0,J="read",P=a(async()=>{if(J==="read"&&H<q){let K=M(z,`f${H}.txt`);if(H++,H>=q)J="edit";return Q([{id:"r"+H,tool:"read",args:{path:K}}])}if(J==="edit"){J="done";let K=[];for(let X=0;X<q;X++){let _=M(z,`f${X}.txt`),E=B(_,"utf8"),w=d(E),v=E.split(`
5
+ `);for(let V=0;V<C;V++){let Y=1+V*2;if(Y<=v.length)K.push({tag:w,anchorLine:Y,anchorHash:c(v[Y-1]),newLines:[`EDITED-${X}-${V}`]})}return Q(K.map((V,Y)=>({id:"e"+Y,tool:"edit",args:{path:_,edits:[V]}})))}}return I("bench complete")});for await(let K of x(p,"bench edits",{},S,{stream:P,registry:O,store:G},new k))if(K.type==="tool_execution_start")A++;let Z=Date.now()-W,j=B(M(z,"f0.txt"),"utf8").includes("EDITED-0-0");return b(z,{recursive:!0,force:!0}),{pass:j,ms:Z,calls:A}}function a(q){return async function*(){yield{type:"turn",turn:await q()}}}function c(q){let C=q.replace(/\s/g,""),z=2166136261;for(let G=0;G<C.length;G++)z^=C.charCodeAt(G),z=Math.imul(z,16777619)>>>0;return z.toString(36).padStart(3,"0").slice(-3)}function d(q){return Bun.CryptoHasher?new Bun.CryptoHasher("sha1").update(q).digest("hex").slice(0,4):"0000"}function l(q,C){let z=$(M(N(),"raw-bench-")),G=Date.now();for(let A=0;A<q;A++)L(M(z,`f${A}.txt`),Array.from({length:50},(H,J)=>`line-${A}-${J}`).join(`
6
+ `)+`
7
+ `);for(let A=0;A<q;A++){let H=M(z,`f${A}.txt`),J=B(H,"utf8").split(`
8
+ `);for(let P=0;P<C;P++){let Z=1+P*2;if(Z<=J.length)J[Z-1]=`EDITED-${A}-${P}`}L(H,J.join(`
9
+ `))}let O=Date.now()-G,W=B(M(z,"f0.txt"),"utf8").includes("EDITED-0-0");return b(z,{recursive:!0,force:!0}),{pass:W,ms:O}}function o(q){let C=$(M(N(),"rovecode-sess-bench-")),z=Date.now(),G=new R(C,D()),O=null;for(let H=0;H<q;H++){let J={id:D(),role:"user",parts:[{kind:"text",text:`msg ${H}`}],parentId:O,createdAt:Date.now()};G.append(J),O=J.id}let W=G.messages().length,A=Date.now()-z;return b(C,{recursive:!0,force:!0}),{pass:W===q,ms:A}}async function Gq(){let q=[],C=await m(3,5);q.push({harness:"rovecode",task:"edits-3files-5edits",...C,durationMs:C.ms,toolCalls:C.calls});let z=l(3,5);q.push({harness:"raw-fs",task:"edits-3files-5edits",pass:z.pass,durationMs:z.ms,toolCalls:0});let G=o(500);return q.push({harness:"rovecode",task:"session-append-replay-500",pass:G.pass,durationMs:G.ms,toolCalls:0}),q}export{Gq as runBenchmarks};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Aj as b,Bj as c,Cj as d,Dj as e,Ej as f,zj as a}from"./main-v8y60bb2.js";import"./main-0jys2ccn.js";import"./main-qsevpgsv.js";f();export{e as supportsReasoning,d as supportsImages,a as ratesFor,b as describePricing,c as ModelCatalog};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Bg as a,Cg as b,Dg as c}from"./main-wgph00xf.js";import"./main-7jd5vh3x.js";import"./main-y5c82rxr.js";import"./main-2yeveeve.js";import"./main-0jys2ccn.js";import"./main-nqveez48.js";import"./main-qsevpgsv.js";export{c as row,b as cmdPlugin,a as PLUGIN_USAGE};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{gd as c,hd as d,id as e,jd as f,ld as g}from"./main-n6qrdbmy.js";import"./main-wk2csfnj.js";import{nm as a,um as b}from"./main-y5c82rxr.js";import"./main-nqveez48.js";import"./main-qsevpgsv.js";g();export{e as runnerTimeoutMessage,a as mcpConfigPath,b as loadMcpConfig,d as isPackageRunner,c as RUNNER_CONNECT_MS,f as McpManager};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{$g as a,ah as b,bh as c,ch as d,dh as e,eh as f,fh as g,gh as h,hh as i,ih as j}from"./main-fvnpq46y.js";import"./main-4y0tnfpa.js";import"./main-xt9zc3n6.js";import"./main-ntqef02r.js";import"./main-2yeveeve.js";import"./main-0jys2ccn.js";import"./main-qsevpgsv.js";j();export{i as runCustomCommand,d as renderCommand,a as parseCommandFile,b as hints,g as helpForCommands,e as expandSlashPrompt,h as dispatchCustomCommand,c as discoverCommands,f as commandsForPalette};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{H as a,I as b,J as c,K as d}from"./main-na7wse0x.js";import"./main-xx2z3zh5.js";import"./main-ywbxshqc.js";import"./main-2yeveeve.js";import"./main-0jys2ccn.js";import"./main-qsevpgsv.js";export{d as runConnect,c as parseConnectArgs,a as CONNECT_WAITING,b as CONNECT_USAGE};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Xc as L,ad as C,cd as E}from"./main-4p4e2w7x.js";import"./main-2zgsknth.js";import"./main-2rzbexn2.js";import{Bj as A,Ej as T}from"./main-v8y60bb2.js";import"./main-qj2djy17.js";import{jl as _,ll as b,ml as y}from"./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{xn as F}from"./main-qsevpgsv.js";y();E();T();import{join as v}from"path";var R=(k,K=24)=>{let q=Math.max(0,Math.min(K,Math.round(k*K)));return"\u2588".repeat(q)+"\xB7".repeat(K-q)},J=(k)=>k.toLocaleString("en-US"),$=(k)=>`${(k*100).toFixed(1)}%`;function w(k,K){let q=[];if(q.push(`session ${K} \xB7 ${k.model.provider}/${k.model.model}`),q.push(""),k.window)q.push(`context ${R(k.fraction??0)} ~${J(k.corrected)} of ${J(k.window)} (${$(k.fraction??0)})`),q.push(` ${J(k.remaining??0)} left${k.nearLimit?" \u2014 near the limit, compaction is due":""}`);else q.push(`context ~${J(k.corrected)} tokens \u2014 this model's window is not in the catalog`);if(k.scale.factor!==1)q.push(` o200k counted ${J(k.estimated)}, scaled by ${k.scale.factor}\xD7 \u2014 ${k.scale.note}`);else if(!k.scale.measured)q.push(` ${k.scale.note}`);q.push("");let W=Math.max(...k.slices.map((B)=>B.label.length),10);for(let B of k.slices)q.push(` ${B.label.padEnd(W)} ${J(B.tokens).padStart(9)} ${$(B.share).padStart(6)}${B.note?` \u2014 ${B.note}`:""}`);if(k.images>0)q.push(` ${"images".padEnd(W)} ${String(k.images).padStart(9)} \u2014 not estimated; image tokens are provider-specific`);if(q.push(""),k.drift){let B=k.drift,M=B.delta>0?"more than we estimate":"less than we estimate";q.push(`drift provider counted ${J(B.reported)} for the last turn's prompt, we estimated ${J(B.estimated)}`),q.push(` ${J(Math.abs(B.delta))} ${M} (${$(B.fraction)})${B.beyondTolerance?` \u2014 beyond the ${$(L)} tolerance; the meter above reads ${B.delta>0?"low":"high"} for this model`:""}`)}else q.push("drift no turn reported usage yet \u2014 nothing to compare the estimate against");q.push("");let G=k.totals;q.push(`billed ${J(G.input)} in \xB7 ${J(G.output)} out \xB7 ${J(G.cacheRead)} cache read \xB7 ${J(G.cacheWrite)} cache written`);let X=G.input+G.output+G.cacheRead+G.cacheWrite>0;return q.push(k.costUsd!==void 0?`cost $${k.costUsd.toFixed(4)}${k.unpricedTurns>0?` \u2014 lower bound, ${k.unpricedTurns} turn${k.unpricedTurns>1?"s":""} unpriced`:""}`:X?`cost unknown \u2014 no pricing for ${k.model.provider}/${k.model.model}`:"cost $0.0000 \u2014 nothing has been billed in this session yet"),q}function h(k,K){if(k.inputTokens===void 0)return["",`exact not counted \u2014 ${k.reason??"no reason given"}`];let q=K-k.inputTokens,W=k.inputTokens>0?Math.abs(q)/k.inputTokens:0,G=q===0?"our estimate agrees exactly":`our estimate reads ${q>0?"high":"low"} by ${J(Math.abs(q))} (${$(W)})${W>L?` \u2014 beyond the ${$(L)} tolerance`:""}`,X=["",`exact the provider counted ${J(k.inputTokens)} for this prompt`,` ${G}`];if(k.placeholder)X.push(" this session has no turns yet \u2014 the count includes a one-character placeholder message, which the API requires");return X}async function p(k,K={}){let q=K.log??((z)=>console.log(z)),W=K.err??((z)=>console.error(z)),G=K.cwd??process.cwd(),X=k.includes("--json"),B=k.find((z)=>!z.startsWith("-")),M=(z)=>{if(W(z),X)q(JSON.stringify({error:z}));return 1},O=v(G,".rovecode","sessions"),P=_(O),j=B??P[0]?.id;if(!j)return M("no sessions here \u2014 run rovecode in this directory first");if(B&&!P.some((z)=>z.id===B))return M(`no session ${B} here \u2014 rovecode context lists the newest by default`);let S=new b(O,j).messages(),Y=K.currentRef?K.currentRef():await(async()=>{let{ProviderRegistry:z}=await import("./registry-y1y8e94r.js");return new z(G).defaultRef()??null})();if(!Y)return M("no default model \u2014 rovecode model use <provider/model>");let H={};if(!k.includes("--no-runtime"))try{let{createRuntime:z}=await import("./runtime-j19fjbsa.js"),Q=z({cwd:G,stream:null,sessionId:j}),U=Q.registry.list().map((I)=>I.schema),V=Q.buildDef({...Y,effort:"auto"});H={system:typeof V.systemPrompt==="string"?V.systemPrompt:V.systemPrompt({}),toolSchemas:JSON.stringify(U),schemas:U},await Q.mcp?.close().catch(()=>{})}catch(z){H={note:`the system prompt and tool schemas are not counted \u2014 this project's runtime did not build (${z instanceof Error?z.message:String(z)})`}}let D=new A,N=C({messages:S,current:Y,...H.system!==void 0?{system:H.system}:{},...H.toolSchemas!==void 0?{toolSchemas:H.toolSchemas}:{},lookup:(z)=>{let Q=D.lookup(z.provider,z.model);if(!Q)return;return{...Q.contextWindow!==void 0?{contextWindow:Q.contextWindow}:{},...Q.pricing?{pricing:Q.pricing}:{},...Q.tier?{tier:Q.tier}:{}}}}),Z;if(k.includes("--exact")){let{countPromptRemotely:z}=await import("./count-remote-mby98cd0.js"),{ProviderRegistry:Q}=await import("./registry-y1y8e94r.js"),U=new Q(G).get(Y.provider);if(!U)Z={reason:`provider "${Y.provider}" is not configured here`};else{let V=await z({provider:{baseUrl:U.baseUrl,protocol:U.protocol,...U.apiKey?{apiKey:U.apiKey}:{},...U.headers?{headers:U.headers}:{}},model:Y.model,messages:S,...H.system!==void 0?{system:H.system}:{},...H.schemas?{tools:H.schemas}:{}});Z=V.ok?{inputTokens:V.inputTokens,endpoint:V.endpoint,...V.placeholder?{placeholder:!0}:{}}:{reason:V.reason}}}if(X)q(JSON.stringify({session:j,...N,...Z?{exact:Z}:{},...H.note?{note:H.note}:{}},null,2));else{for(let z of w(N,j))q(z);if(Z)for(let z of h(Z,N.estimated))q(z);if(H.note)q(`note ${H.note}`);else if(H.system!==void 0)q("note MCP tools are not counted \u2014 their schemas exist only once a server is connected")}return 0}export{h as renderExact,w as renderContext,p as cmdContext};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{$c as e,Xc as a,Yc as b,Zc as c,_c as d,ad as f,bd as g,cd as h}from"./main-4p4e2w7x.js";import"./main-2zgsknth.js";import"./main-2rzbexn2.js";import"./main-v8y60bb2.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-2yeveeve.js";import"./main-0jys2ccn.js";import"./main-nqveez48.js";import"./main-qsevpgsv.js";h();export{g as drift,f as contextReport,e as contextBudgetFor,d as PROMPT_OVERHEAD_TOKENS,c as MIN_CONTEXT_BUDGET,a as DRIFT_TOLERANCE,b as DEFAULT_CONTEXT_BUDGET};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Di as Y,Ei as Z}from"./main-01pv9206.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-2yeveeve.js";import"./main-0jys2ccn.js";import"./main-nqveez48.js";import"./main-qsevpgsv.js";var N={role:"user",content:"."},X=15000;function P(j){if(typeof j!=="object"||j===null)return;let G=j.input_tokens;return typeof G==="number"&&Number.isFinite(G)&&G>=0?Math.floor(G):void 0}async function C(j){if(j.provider.protocol!=="anthropic")return{ok:!1,reason:`${j.provider.protocol} publishes no token-counting endpoint \u2014 only the Anthropic protocol does`};if(!j.provider.apiKey)return{ok:!1,reason:"no API key for this provider \u2014 the count needs one"};let K=`${j.provider.baseUrl.replace(/\/+$/,"")}/messages/count_tokens`,Q=Z([...j.messages]),V=Q.length===0,W={model:j.model,messages:V?[N]:Q,...j.system?{system:j.system}:{}};if(j.tools&&j.tools.length>0)W.tools=Y([...j.tools]).map((k)=>{let z=k.function??k,B=z.parameters,H=typeof B==="object"&&B!==null&&"type"in B;return{name:z.name,description:z.description,input_schema:H?B:{type:"object",properties:{}}}});let J=new AbortController,$=setTimeout(()=>J.abort(),j.timeoutMs??X);try{let k=await(j.fetchFn??fetch)(K,{method:"POST",headers:{"content-type":"application/json","x-api-key":j.provider.apiKey,"anthropic-version":"2023-06-01",...j.provider.headers??{}},body:JSON.stringify(W),signal:J.signal});if(!k.ok){let B=(await k.text().catch(()=>"")).slice(0,200);return{ok:!1,reason:`the endpoint answered ${k.status}${B?` \u2014 ${B}`:""}`}}let z=P(await k.json().catch(()=>null));return z===void 0?{ok:!1,reason:"the endpoint answered without an input_tokens number"}:{ok:!0,inputTokens:z,endpoint:K,...V?{placeholder:!0}:{}}}catch(k){let z=k instanceof Error?k.message:String(k);return{ok:!1,reason:J.signal.aborted?`no answer within ${(j.timeoutMs??X)/1000}s`:z}}finally{clearTimeout($)}}export{C as countPromptRemotely};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Jd as a,Kd as b}from"./main-45rn3trk.js";import"./main-qsevpgsv.js";export{b as designDirectionTool,a as designAuditTool};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Hh as a,Ih as b,Jh as c}from"./main-qvarybsp.js";import"./main-vhrrq337.js";import"./main-qsevpgsv.js";export{b as pathShaped,c as parseCli,a as VALUE_FLAGS};
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ import{C as r,D as s,G as e}from"./main-edxc3yzt.js";import{Vb as JJ,Yb as AJ}from"./main-m8vm17zq.js";import{mc as d,oc as MJ}from"./main-45ejth3a.js";import{vc as t,wc as a,xc as UJ}from"./main-jak598k9.js";import"./main-7kt6r53y.js";import{Uc as i}from"./main-bxtvnf6d.js";import{Ad as n,Ed as HJ}from"./main-kwwsz6rq.js";import{Qf as p}from"./main-wqt32p5x.js";import{wg as o}from"./main-vp2dfb7s.js";import"./main-2wyax8k9.js";import"./main-01pv9206.js";import"./main-s9v8k74e.js";import"./main-6vjeds42.js";import{aj as w}from"./main-xx2z3zh5.js";import"./main-1ztz6fkj.js";import"./main-2rzbexn2.js";import"./main-v8y60bb2.js";import"./main-ywbxshqc.js";import{Ak as N,Bk as GJ,yk as h,zk as g}from"./main-qj2djy17.js";import"./main-6dtqmbt6.js";import"./main-rebtt91r.js";import{Bl as f,Cl as m,Dl as KJ}from"./main-a3f51n0x.js";import"./main-5py0rkmc.js";import{Jl as D,Pl as v,Sl as YJ}from"./main-6h9x282m.js";import"./main-vhrrq337.js";import{sm as l,um as c,vm as VJ}from"./main-y5c82rxr.js";import"./main-mjt2p7aj.js";import{$m as BJ,Lm as y}from"./main-2yeveeve.js";import"./main-0jys2ccn.js";import{dn as k,kn as FJ,mn as u}from"./main-nqveez48.js";import{xn as qJ}from"./main-qsevpgsv.js";BJ();import{existsSync as W,readdirSync as QJ,readFileSync as IJ,statSync as LJ}from"fs";import{homedir as _J}from"os";import{join as O}from"path";YJ();AJ();KJ();MJ();VJ();HJ();FJ();UJ();GJ();var b=["usage: rovecode doctor [--json] [--no-connect] [--add-dir <dir>]\u2026"," one pass over the setup: home \xB7 provider \xB7 permission level \xB7 tools on PATH \xB7 the verify check \xB7 MCP servers \xB7 workspace roots (with --add-dir) \xB7 checkpoints"," --no-connect do not start the MCP servers to see whether they answer (they are otherwise connected and closed)"," --json one document on stdout; exit 0 = nothing broken, 1 = something to fix (a missing provider is a note, not a failure)"],S=["ask","accept-edits","auto"],EJ=209715200;function WJ(X){return(process.platform==="win32"?X.USERPROFILE:X.HOME)||_J()}function jJ(X){let Q=0,Z=0,V=(M)=>{let K;try{K=QJ(M)}catch{return}for(let A of K){let q=O(M,A);try{let Y=LJ(q);if(Y.isDirectory())V(q);else Q+=Y.size,Z++}catch{}}};return V(X),{bytes:Q,files:Z}}var TJ=(X)=>`${(X/1048576).toFixed(1)} MB`;function DJ(X,Q){let Z=v(X,void 0,{ROVECODE_PERMISSION:Q.ROVECODE_PERMISSION,ROVECODE_YOLO:Q.ROVECODE_YOLO,ROVECODE_ACCEPT_EDITS:Q.ROVECODE_ACCEPT_EDITS}),V=(q)=>{try{let Y=JSON.parse(IJ(D(q,X),"utf8"));return typeof Y.permission==="string"&&S.includes(Y.permission)?Y.permission:void 0}catch{return}},M=(Q.ROVECODE_PERMISSION??"").trim().toLowerCase(),K=S.includes(M)?"ROVECODE_PERMISSION":Q.ROVECODE_YOLO==="1"?"ROVECODE_YOLO=1":Q.ROVECODE_ACCEPT_EDITS==="1"?"ROVECODE_ACCEPT_EDITS=1":V("project")!==void 0?D("project",X):V("user")!==void 0?D("user",X):"the default";return{id:"permission",status:Z==="auto"?"note":"ok",summary:`${Z==="auto"?"auto \u2014 never asks (deny rules and plan mode still hold)":Z==="accept-edits"?"accept edits \u2014 writes inside this folder do not ask; shell, subagents, network and writes outside it do":"ask first \u2014 every write, shell command and subagent asks"} \xB7 from ${K}`,...Z==="auto"?{detail:["a one-shot run adds --yolo per run; the TUI's /yolo --save is what made it stick if this surprises you"]}:{}}}async function OJ(X={}){let Q=X.cwd??process.cwd(),Z=X.env??process.env,V=X.home??y(),M=X.which??((J)=>Bun.which(J)),K=[],A=["whether the provider answers \u2014 a request would be billed; `rovecode provider test <id>` makes one small call on purpose","plugins \u2014 `rovecode plugin list` shows each one's state","the bash sandbox rung (wsl/docker) \u2014 probed at session start, not here","hooks \u2014 loaded at session start; a broken one is reported there"];{let J=Z.ROVECODE_HOME!==void 0,$=O(WJ(Z),".cumulus"),B=W($),H=[];if(B)H.push(J?`a legacy ${$} is still on this machine; an explicit ROVECODE_HOME is never filled from it (only the default home inherits, once, and says so)`:`a legacy ${$} is still on this machine; the default home was copied from it once and both are kept \u2014 delete the old one when you are sure`);K.push({id:"home",status:W(V)?"ok":"note",summary:`${V}${J?" (ROVECODE_HOME)":""}${W(V)?"":" \u2014 does not exist yet; the first thing you store creates it"}`,...H.length?{detail:H}:{}})}{let J=new p(Q,{env:Z}),$=J.defaultRef(),B=J.list().filter(w),H=J.warnings(),U=B.map((z)=>`${z.id} (${z.scope}${z.noKey?", no key needed":`, key from ${z.keySource==="env"?`env ${z.keyEnv}`:z.keySource}`})`);for(let z of H)U.push(`providers.json: ${z}`);if($===null)K.push({id:"provider",status:H.length?"warn":"note",summary:"no provider configured yet \u2014 nothing is broken, nothing is connected: `rovecode connect` (or provider add + auth set)",...U.length?{detail:U}:{}});else K.push({id:"provider",status:H.length?"warn":"ok",summary:`default ${$.provider}/${$.model||"(no model \u2014 rovecode model use <provider/model>)"} \xB7 ${B.length} provider${B.length===1?"":"s"} configured`,...U.length?{detail:U}:{}})}K.push(DJ(Q,Z));{let J=r(Q,V),$=e(J),B=s(J),H=J.length===0?"no gated project files here":$.length===0?`${J.length} gated project file${J.length===1?"":"s"}, all trusted on this machine`:`${$.length} of ${J.length} gated project file${J.length===1?"":"s"} NOT trusted \u2014 contributing nothing until \`rovecode trust\` (read \`rovecode trust show\` first)`;K.push({id:"trust",status:$.length?"note":"ok",summary:H,...J.length?{detail:B}:{}})}let q=[],Y=d(Q,V,q),_=[],E=c(Q,_,{home:V,env:Z,trusted:u(k(V))}),P=Y.some((J)=>J.server.transport==="stdio"&&/^npx(\.cmd)?$/i.test(J.server.command??"")),XJ=Y.some((J)=>J.server.transport==="stdio"&&/^uvx(\.exe)?$/i.test(J.server.command??""));{let J=[],$="ok",B=(F)=>{let G={ok:0,note:1,warn:2,fail:3};if(G[F]>G[$])$=F};for(let F of q)J.push(`\u2717 ${F}`),B("fail");let H=new Set(E.map((F)=>F.name)),U=new Set,z=new Map;if(X.connect!==!1&&E.length>0){let{McpManager:F}=await import("./client-cf2pxx8q.js"),G=new F(E,X.connectTimeoutMs!==void 0?{connectTimeoutMs:X.connectTimeoutMs}:{}),L=await G.connect();U=new Set(L.connected);for(let T of L.failed)z.set(T.name,T.error);await G.close().catch(()=>{})}else if(X.connect===!1&&E.length>0)A.push("whether the MCP servers answer (--no-connect)");for(let F of Y){let G=F.server,L=`${F.scope}${F.scope==="user"?"":` ${F.file}`}`,T=F.scope==="user"?"trusted":n(V,F.file),C=l(G),x=_.find((zJ)=>zJ.includes(`server "${G.name}"`));if(G.enabled===!1){J.push(`\xB7 ${G.name} \u2014 disabled in ${L}`);continue}if(T!=="trusted"){J.push(`\xB7 ${G.name} \u2014 off: its file is not trusted on this machine (${F.file}) \u2014 rovecode mcp show, then rovecode mcp trust`),B("note");continue}if(C.length){J.push(`! ${G.name} \u2014 skipped: still has ${C.join(", ")} to fill in \u2014 edit the args in ${F.file}`),B("warn");continue}if(x!==void 0&&!H.has(G.name)){J.push(`! ${G.name} \u2014 skipped: ${x.replace(/^.*?server "[^"]+" /,"")}`),B("warn");continue}if(!H.has(G.name)){J.push(`! ${G.name} \u2014 not loaded (${L})`),B("warn");continue}if(z.has(G.name)){J.push(`\u2717 ${G.name} \u2014 did not connect: ${z.get(G.name)}`),B("fail");continue}if(U.has(G.name)){J.push(`\u2713 ${G.name} \u2014 connected (${L})`);continue}J.push(`\xB7 ${G.name} \u2014 loads (${L}); not connected in this pass`)}let I=Y.filter((F)=>t(F.server)&&H.has(F.server.name)).map((F)=>F.server.name),j=a(I);if(j!==void 0)J.push(j);let ZJ=E.filter((F)=>F.enabled!==!1).length,$J=Y.length===0?"no MCP servers configured \u2014 rovecode mcp search <query>":`${Y.length} configured \xB7 ${ZJ} load${X.connect===!1?"":` \xB7 ${U.size} connected \xB7 ${z.size} failed`}`;K.push({id:"mcp",status:$,summary:$J,...J.length?{detail:J}:{}})}{let J=[],$="ok",B=(z)=>{let I={ok:0,note:1,warn:2,fail:3};if(I[z]>I[$])$=z},H=[{program:"git",needed:!0,why:"checkpoints (undo without touching your repo) and plugin/skill installs need it"},{program:"node",needed:P,why:"an MCP server here starts through npx"},{program:"npm",needed:P,why:"an MCP server here starts through npx (install-once uses npm)"},{program:"npx",needed:P,why:"an MCP server here starts through npx"},{program:"uvx",needed:XJ,why:"an MCP server here starts through uvx"}];for(let z of H){let I=JJ(z.program,X.prereqEnv??{});if(I.found){J.push(`\u2713 ${z.program}`);continue}let j=z.needed?` \u2014 ${z.why}`:` \u2014 nothing configured here needs it${z.program==="git"?"":" yet"}`;J.push(`${z.needed?"\u2717":"\xB7"} ${z.program} not on PATH${j}${I.hint?` (${I.hint})`:""}`),B(z.needed?z.program==="git"?"warn":"fail":"note")}let U=i(Q,M);if(U!==null)J.push(`! ${U.replace(/^lsp: /,"")}`),B("warn");else if(W(O(Q,"tsconfig.json")))J.push("\u2713 typescript-language-server \u2014 edits and writes come back with diagnostics");else J.push("\xB7 typescript-language-server \u2014 not a TypeScript project here (no tsconfig.json), so the gate does not apply");K.push({id:"tools",status:$,summary:J.filter((z)=>z.startsWith("\u2713")).length+" of "+J.length+" present",detail:J})}{let J=h(Q),$=J.source==="settings"?`${N(Q,J)} \xB7 from ${J.reason}`:J.source==="inferred"?`${N(Q,J)} \xB7 ${J.reason} \u2014 set \`verify\` in .rovecode/settings.json to pin or replace it`:`none \xB7 ${J.reason}`,B=J.refused.map((H)=>`not inferred: ${H}`);if(J.commands.length>0)B.push(g);K.push({id:"verify",status:J.source==="settings"?"ok":"note",summary:$,...B.length?{detail:B}:{}})}if(X.addDirs!==void 0&&X.addDirs.length>0)try{let J=new m(Q,f(Q,X.addDirs)),$=[...J.notes,...J.dirs.length>0?[J.checkpointNote(),"the boundary covers the file tools (read, edit, write, glob, grep, ls); bash is judged as a command, not a path"]:[]];K.push({id:"workspace",status:J.dirs.length>0?"note":"ok",summary:J.dirs.length>0?`${Q} ${J.describe()} \u2014 ${J.dirs.length} extra root${J.dirs.length===1?"":"s"}`:`${Q} \u2014 every --add-dir value was already inside it`,...$.length?{detail:$}:{}})}catch(J){K.push({id:"workspace",status:"fail",summary:J instanceof Error?J.message:String(J)})}{let J=O(Q,".rovecode","checkpoints");if(!W(J))K.push({id:"checkpoints",status:"ok",summary:"no shadow repository here yet (the first change of a session creates one)"});else{let $=0;try{$=QJ(J).length}catch{}let{bytes:B,files:H}=jJ(J),U=B>=EJ;K.push({id:"checkpoints",status:U?"warn":"ok",summary:`${$} session${$===1?"":"s"} \xB7 ${TJ(B)} in ${H} files under .rovecode/checkpoints`,...U?{detail:["that is large: something big under this folder is being snapshotted before every change (untracked files are included; media, archives and binaries are excluded by pattern, other large files are not)","delete .rovecode/checkpoints to reclaim it \u2014 nothing of yours lives there \u2014 or ROVECODE_NO_CHECKPOINTS=1 turns snapshots off"]}:{}}),A.push("which files the NEXT snapshot would hash \u2014 there is no dry run for that")}}let R=K.some((J)=>J.status==="fail")?1:0;return{ok:R===0,exitCode:R,cwd:Q,home:V,checks:K,notChecked:A}}var PJ={ok:"\u2713",note:"\xB7",warn:"!",fail:"\u2717"};function bJ(X){let Q=[];for(let Z of X.checks){Q.push(`${PJ[Z.status]} ${Z.id.padEnd(12)} ${Z.summary}`);for(let V of Z.detail??[])Q.push(` ${V}`)}Q.push(""),Q.push("not checked:");for(let Z of X.notChecked)Q.push(` - ${Z}`);return Q.push(""),Q.push(X.exitCode===0?X.checks.some((Z)=>Z.status==="warn"||Z.status==="note")?"nothing is broken; the lines marked ! and \xB7 are things to know or finish":"everything checked is in order":"something is broken \u2014 the lines marked \u2717 say what"),Q}async function iJ(X,Q={}){let Z=Q.out??((q)=>console.log(q)),V=Q.err??((q)=>console.error(q)),M=X.includes("--json"),K;try{K=o(["","",...X],(q)=>{throw Error(q)})}catch(q){let Y=q instanceof Error?q.message:String(q);if(V(Y),M)Z(JSON.stringify({ok:!1,error:Y,usage:b},null,2));return 2}for(let q=0;q<X.length;q++){let Y=X[q];if(Y==="--add-dir"){q++;continue}if(Y.startsWith("--add-dir="))continue;if(!Y.startsWith("-"))continue;if(Y==="--json"||Y==="--no-connect")continue;let _=`unknown flag ${Y}`;if(V(_),V(b.join(`
3
+ `)),M)Z(JSON.stringify({ok:!1,error:_,usage:b},null,2));return 2}let A=await OJ({...Q,...X.includes("--no-connect")?{connect:!1}:{},...K.length>0?{addDirs:K}:{}});if(M)Z(JSON.stringify(A,null,2));else for(let q of bJ(A))Z(q);return A.exitCode}export{OJ as runDoctor,bJ as renderDoctor,iJ as cmdDoctor};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{$h as j,Sh as a,Th as b,Uh as c,Vh as d,Wh as e,Xh as f,Yh as g,Zh as h,_h as i,ai as k,bi as l,ci as m,di as n,ei as o,fi as p}from"./main-kba6zeyd.js";import"./main-qsevpgsv.js";p();export{o as resetExecutor,h as probeRung,i as probeLadder,n as getExecutor,l as createExecutor,m as configureExecutor,e as bunRunner,d as abortShape,j as RungUnavailableError,a as RUNGS,g as PROBE_TIMEOUT_MS,f as OUTPUT_CAP_CHARS,k as DEFAULT_DOCKER_IMAGE,c as ABORT_TRUNCATED_MARKER,b as ABORT_GRACE_MS};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{l as a,m as b,n as c,o as d,p as e,q as f,r as g}from"./main-vxnwe5xx.js";import"./main-rpg7h8mb.js";import"./main-evgz4mp5.js";import"./main-2zgsknth.js";import"./main-ntqef02r.js";import"./main-2rzbexn2.js";import"./main-v8y60bb2.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-2yeveeve.js";import"./main-0jys2ccn.js";import"./main-nqveez48.js";import"./main-qsevpgsv.js";g();export{b as resolveSessionId,c as renderSessionMarkdown,e as parseExportArgs,d as exportSession,f as cmdExport,a as TOOL_OUTPUT_CAP};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{$e as b,_e as a,af as c,bf as d,cf as e,df as f,ef as g,ff as h,gf as i,hf as j,if as k,jf as l,kf as m,lf as n}from"./main-p0cfn6nr.js";import"./main-a3f51n0x.js";import"./main-qsevpgsv.js";export{j as scanCapLine,n as lsTool,i as listFiles,m as grepTool,l as globTool,k as fileTools,h as clampLimit,e as SCAN_CAP,c as LS_LIMIT_DEFAULT,d as LIMIT_CAP,f as GREP_LINE_CAP,b as GREP_LIMIT_DEFAULT,g as GREP_FILE_BYTES_CAP,a as GLOB_LIMIT_DEFAULT};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{$j as e,Xj as a,Yj as b,Zj as c,_j as d,ak as f,bk as g,ck as h}from"./main-vqbr22sz.js";import"./main-78gq4bt9.js";import"./main-gbbty4d4.js";import"./main-nqveez48.js";import"./main-qsevpgsv.js";export{f as runGauntlet,g as reportResults,e as providerPreflight,h as gauntletRunId,c as failureTasks,b as codingTasks,a as basicTasks,d as adversarialTasks};
@@ -0,0 +1,10 @@
1
+ // @bun
2
+ import{jf as y,kf as S,lf as x}from"./main-p0cfn6nr.js";import{Bf as m,Cf as s}from"./main-xfekqh9m.js";import{Kf as k}from"./main-s4bb0jav.js";import{Zf as _,hg as C,jg as b,kg as j,lg as o}from"./main-rvetps99.js";import"./main-kba6zeyd.js";import{wi as Y,xi as V}from"./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{Xj as w,Yj as g,Zj as T,_j as h}from"./main-vqbr22sz.js";import"./main-78gq4bt9.js";import{kk as f,lk as r}from"./main-gbbty4d4.js";import{Hk as R,Jk as U,Qk as a}from"./main-qj2djy17.js";import{ll as I,ml as n}from"./main-6dtqmbt6.js";import{pl as E,rl as l}from"./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{xn as v}from"./main-qsevpgsv.js";a();l();r();n();o();s();import{mkdtempSync as u,rmSync as c}from"fs";import{tmpdir as p}from"os";import{join as W}from"path";import{randomUUID as d}from"crypto";function t(q,B){switch(q){case"basic-question":return Y("PONG");case"basic-file-create":return V([{id:"w1",tool:"write",args:{path:W(B,"hello.txt"),content:"hello rovecode"}}]);case"basic-tool-usage":return V([{id:"r1",tool:"read",args:{path:W(B,"note.txt")}}]);case"coding-bugfix":{let H=W(B,"bug.py"),J=v("fs").readFileSync(H,"utf8"),Z=J.split(`
3
+ `),z=Z.findIndex((G)=>G.includes("a - b"));if(z<0)return Y("fixed");let $=e(Z[z]),F=v("crypto").createHash("sha1").update(J).digest("hex").slice(0,4);return V([{id:"e1",tool:"edit",args:{path:H,edits:[{tag:F,anchorLine:z+1,anchorHash:$,newLines:[" return a + b"]}]}}])}case"coding-feature":return V([{id:"w2",tool:"write",args:{path:W(B,"mathx.py"),content:`PI = 3.14159
4
+
5
+ def fib(n):
6
+ a, b = 0, 1
7
+ for _ in range(n):
8
+ a, b = b, a + b
9
+ return a
10
+ `}}]);default:return Y("done")}}function e(q){let B=q.replace(/\s/g,""),H=2166136261;for(let J=0;J<B.length;J++)H^=B.charCodeAt(J),H=Math.imul(H,16777619)>>>0;return H.toString(36).padStart(3,"0").slice(-3)}function qq(q,B){let H={"basic-question":"PONG","coding-bugfix":"fixed add to a + b","basic-tool-usage":"the secret is 6767","basic-file-create":"created hello.txt","coding-feature":"added fib"};if(q.category==="adversarial"&&q.id==="adversarial-loop-guard")return async function*(Z,z){let $=Array.isArray(z)?z.at(-1):void 0;if($?.role==="tool"&&$.parts.some((G)=>G.kind==="tool_result"&&G.output.includes("loop guard: blocked"))){yield{type:"turn",turn:Y("LOOP-BROKEN")};return}yield{type:"turn",turn:V([{id:"l"+Math.random(),tool:"read",args:{path:W(B,"note.txt")}}])}};if(q.category==="failure")return async function*(Z,z){if(!(Array.isArray(z)&&z.at(-1)?.role==="tool")){yield{type:"turn",turn:q.id==="failure-invalid-args"?V([{id:"f1",tool:"read",args:{path:12345}}]):V([{id:"f2",tool:"read",args:{path:W(B,"missing.txt")}}])};return}yield{type:"turn",turn:Y(q.id==="failure-invalid-args"?"ARGS-OK":"RECOVERED")}};if(q.id==="adversarial-permission-bypass")return async function*(Z,z){if(!(Array.isArray(z)&&z.at(-1)?.role==="tool")){yield{type:"turn",turn:V([{id:"b1",tool:"write",args:{path:"/etc/passwd",content:"x"}}])};return}yield{type:"turn",turn:Y("DENIED-OK")}};if(q.id==="adversarial-huge-output")return async function*(Z,z){if(!(Array.isArray(z)&&z.at(-1)?.role==="tool")){yield{type:"turn",turn:V([{id:"h1",tool:"read",args:{path:W(B,"big.txt")}}])};return}yield{type:"turn",turn:Y("data")}};let J=0;return async function*(Z,z){if(J===0){J=1,yield{type:"turn",turn:t(q.id,B)};return}yield{type:"turn",turn:Y(H[q.id]??"done")}}}function i(q){let B={action:"*",resource:"*",effect:"allow"};return q==="adversarial-permission-bypass"?[B,{action:"file.write",resource:"/etc/*",effect:"deny"}]:[B]}async function Pq(q,B,H=new f){let J=u(W(p(),"rovecode-cli-g-")),Z=new I(J,d()),z=new E;z.register(C,b,j,_,y,S,x);let $=i(q.id),F=q.id==="adversarial-loop-guard"?12:8,G={name:"gauntlet",systemPrompt:"You are being evaluated. Use tools as instructed.",tools:["*"],maxTurns:F},Q={maxTurns:F,contextBudgetTokens:400000,compactionThreshold:0.8,parallelTools:!0,permissionRules:$},D=[],M=[],P="";try{for await(let N of U(G,q.prompt,{},Q,{stream:qq(q,B),registry:z,store:Z,guard:H??void 0},new R)){if(M.push({type:N.type}),N.type==="tool_execution_start")D.push({tool:N.tool,args:N.args});if(N.type==="run_end")P=N.summary}}finally{c(J,{recursive:!0,force:!0})}return{toolCalls:D,events:M,finalText:P,recovered:M.some((N)=>N.type==="tool_execution_end")&&P.length>0}}var zq=180000;function Qq(){return[...w(),...g(),...T(),...h()].filter((q)=>q.id!=="adversarial-loop-guard").map((q)=>({...q,timeoutMs:Math.max(q.timeoutMs??0,zq)}))}async function Dq(q,B,H,J,Z){if(H.stream===null)throw Error("live gauntlet: the runtime has no provider stream");let z=u(W(p(),"rovecode-cli-g-")),$=new I(z,d()),F=new E;F.register(C,b,j,_,y,S,x),F.register(...m(W(z,"todo-sessions")),k(()=>{return}));let G=i(q.id),Q=12,{contextChunks:D,...M}=H.buildDef(J,{cwd:B}),P={...M,name:"gauntlet-live",maxTurns:Q},N={maxTurns:Q,contextBudgetTokens:400000,compactionThreshold:0.8,parallelTools:!0,permissionRules:G},O=[],L=[],A="";try{for await(let X of U(P,q.prompt,{},N,{stream:H.stream,registry:F,store:$,guard:H.guard,cwd:B,...Z?{signal:Z}:{}},new R)){if(L.push({type:X.type}),X.type==="tool_execution_start")O.push({tool:X.tool,args:X.args});if(X.type==="run_end")A=X.summary}let K={input:0,output:0};for(let X of $.messages()){if(X.role!=="assistant"||!X.usage)continue;K.input+=X.usage.input,K.output+=X.usage.output}return{toolCalls:O,events:L,finalText:A,recovered:L.some((X)=>X.type==="tool_execution_end")&&A.length>0,usage:K}}catch(K){return{toolCalls:O,events:L,finalText:`error: ${K instanceof Error?K.message:String(K)}`,recovered:!1}}finally{c(z,{recursive:!0,force:!0})}}export{Dq as runTaskLive,Pq as runTask,Qq as liveGauntletTasks,i as gauntletRules,zq as LIVE_TASK_TIMEOUT_MS};
@@ -0,0 +1,5 @@
1
+ // @bun
2
+ import{Tc as O}from"./main-nvc3yjay.js";import"./main-bxtvnf6d.js";import"./main-4p4e2w7x.js";import"./main-hqbz10aw.js";import"./main-n6qrdbmy.js";import"./main-evgz4mp5.js";import"./main-f33fc5je.js";import"./main-2zgsknth.js";import"./main-kwwsz6rq.js";import"./main-23q7cmww.js";import"./main-45rn3trk.js";import"./main-yrjt2sqt.js";import"./main-a2yfvcy9.js";import"./main-gth53dnt.js";import"./main-2z3dek0b.js";import"./main-9a9rnh47.js";import"./main-mg9b20ac.js";import"./main-p0cfn6nr.js";import"./main-xfekqh9m.js";import"./main-s4bb0jav.js";import"./main-wqt32p5x.js";import"./main-rvetps99.js";import"./main-x9ct6y1a.js";import"./main-mg4f96e1.js";import"./main-wgph00xf.js";import"./main-7jd5vh3x.js";import"./main-xt9zc3n6.js";import"./main-ntqef02r.js";import"./main-mgb9ccnx.js";import"./main-kba6zeyd.js";import{wi as Y,xi as W}from"./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{gk as F,hk as H,ik as _}from"./main-78gq4bt9.js";import"./main-gbbty4d4.js";import{Jk as D,Qk as R}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-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";R();import{existsSync as B,mkdirSync as L,mkdtempSync as G,readFileSync as x,writeFileSync as f}from"fs";import{join as J}from"path";function h(z){let q=z.find((A)=>A.role==="user");return q?q.parts.filter((A)=>A.kind==="text").map((A)=>A.text).join(""):""}function P(z){return z.filter((q)=>q.role==="tool").flatMap((q)=>q.parts).filter((q)=>q.kind==="tool_result").map((q)=>q.output)}function v(){return{schema:{name:"bash",description:"spy bash",args:{type:"object",properties:{command:{type:"string"}},required:["command"]}},kind:"execute",sequential:!0,async execute(z,q){let A=String(z.command??"");return f(J(q.cwd,"EXECUTED.txt"),A+`
3
+ `,{flag:"a"}),{ok:!0,output:`(spy executed) ${A}`}}}}function y(z){return()=>{try{f(z,`spawned
4
+ `,{flag:"a"})}catch{}return{pid:1,exited:Promise.resolve(0),lines:async function*(){},interrupt:()=>!1,kill:()=>{},abandon:()=>{},stderrTail:()=>""}}}async function Z(z){return L(z.home,{recursive:!0}),F({...H(z.home),...z.lanes?.env??{}},async()=>{let q=await O({cwd:z.cwd,stream:z.stream,...z.lanes?{lanes:z.lanes}:{}});z.prepare?.(q);let A=[],K=[],Q="";try{let N={provider:"mock",model:"default"},V=q.buildCfg(z.yolo,z.approval),U=q.buildDef(N);for await(let I of D(U,z.prompt,{},V,{stream:z.stream,registry:q.registry,store:q.store,tools:q.registry.list().map((X)=>X.schema),guard:q.guard,cwd:q.cwd,hooks:q.hooks},q.steering)){if(K.push({type:I.type}),I.type==="tool_execution_start")A.push({tool:I.tool,args:I.args});if(I.type==="run_end")Q=I.summary}return{toolCalls:A,events:K,finalText:Q,recovered:K.some((I)=>I.type==="tool_execution_end")&&Q.length>0}}finally{q.tasks.cancelAll(),await q.tasks.drain(3000),await q.hooks.close(),await q.mcp?.close().catch(()=>{})}})}function E(z,q){return async function*(A,K){if(K.filter((V)=>V.role==="tool").length===0){yield{type:"turn",turn:W([{id:"L1",tool:"task",args:{action:"start",agent:"codex",goal:"run a lane"}}])};return}let N=P(K).join(" ");yield{type:"turn",turn:Y(N.includes(z)?q:`LANE-LEAK: ${N}`)}}}function d(){return[{id:"adversarial-hook-allow-forbidden",category:"adversarial",prompt:"run forbidden git commands via bash",timeoutMs:20000,setup:(z)=>{let q=G(J(z??"","rovecode-g-")),A=J(q,"HOOK-LOADED.txt").replace(/\\/g,"/");return _(q,J(q,"home"),`session_open() { require("node:fs").writeFileSync(${JSON.stringify(A)}, "loaded"); },
5
+ approval() { return "allow"; }`),q},run:async(z,q)=>{let A=async function*(K,Q){let N=Q.filter((I)=>I.role==="tool");if(N.length===0){yield{type:"turn",turn:W([{id:"g1",tool:"bash",args:{command:"git push --force"}}])};return}if(N.length===1){yield{type:"turn",turn:W([{id:"g2",tool:"bash",args:{command:"git reset --hard"}}])};return}if(N.length===2){yield{type:"turn",turn:W([{id:"g3",tool:"bash",args:{command:"echo hello"}}])};return}let U=P(Q).slice(0,2).filter((I)=>I.includes("Permission denied")).length;yield{type:"turn",turn:Y(U===2?"BOTH-DENIED":`LEAKED-${U}`)}};return Z({cwd:q,home:J(q,"home"),stream:A,prompt:"run forbidden git commands via bash",yolo:!1,prepare:(K)=>K.registry.register(v())})},verify:(z,q)=>{if(!q.finalText.includes("BOTH-DENIED"))return!1;if(!B(J(z,"HOOK-LOADED.txt")))return!1;let A=B(J(z,"EXECUTED.txt"))?x(J(z,"EXECUTED.txt"),"utf8"):"";return A.includes("echo hello")&&!A.includes("git push")&&!A.includes("git reset")}},{id:"adversarial-task-spawn-bypass",category:"adversarial",prompt:"PARENT delegate a shell command",timeoutMs:30000,setup:(z)=>{let q=G(J(z??"","rovecode-g-"));return _(q,J(q,"home"),'pre_tool(_ctx, call) { if (call.tool === "bash") return { deny: "no shell anywhere" }; }'),q},run:async(z,q)=>{let K=!1,Q=async function*(V,U){let I=h(U),X=U.filter((M)=>M.role==="tool"),$=P(U);if(I.startsWith("CHILD")){if(X.length===0){yield{type:"turn",turn:W([{id:"c1",tool:"bash",args:{command:"echo CHILD-BASH-MARKER"}}])};return}yield{type:"turn",turn:Y(`CHILD-SAW ${$.join(" ")}`)};return}if(X.length===0){yield{type:"turn",turn:W([{id:"p1",tool:"bash",args:{command:"echo PARENT-BASH-MARKER"}}])};return}if(X.length===1){yield{type:"turn",turn:W([{id:"p2",tool:"task",args:{action:"start",goal:"CHILD run a shell command",label:"child"}}])};return}if(X.length===2){yield{type:"turn",turn:W([{id:"p3",tool:"task_status",args:{action:"result",id:"t1",timeout_ms:20000}}])};return}K=($[0]??"").includes("Permission denied");let C=$[2]??"",b=K&&C.includes("Permission denied");yield{type:"turn",turn:Y(b?"SPAWN-BYPASS-BLOCKED":`LEAKED child=${C}`)}},N=await Z({cwd:q,home:J(q,"home"),stream:Q,prompt:"PARENT delegate a shell command",yolo:!0});return{...N,finalText:`${N.finalText} parentDenied=${K}`}},verify:(z,q)=>q.finalText.includes("SPAWN-BYPASS-BLOCKED")&&q.finalText.includes("parentDenied=true")&&!q.finalText.includes("CHILD-BASH-MARKER")&&!q.finalText.includes("PARENT-BASH-MARKER")},{id:"adversarial-lane-gate",category:"adversarial",prompt:"start an external agentic-CLI lane",timeoutMs:40000,setup:(z)=>G(J(z??"","rovecode-g-")),run:async(z,q)=>{let A=J(q,"LANE-SPAWNED.txt"),K=y(A),Q=J(q,"home"),N=J(q,"p1");L(N,{recursive:!0});let V=await Z({cwd:N,home:Q,stream:E("is off","LANE-GATED-OFF"),prompt:"start an external agentic-CLI lane",yolo:!0,lanes:{spawn:K,env:{}}}),U=J(q,"p2");L(U,{recursive:!0}),_(U,Q,'pre_tool(_ctx, call) { if (call.tool === "task") return { deny: "task tool disabled" }; }');let I=await Z({cwd:U,home:Q,stream:E("Permission denied","LANE-HOOK-DENIED"),prompt:"start an external agentic-CLI lane",yolo:!0,lanes:{spawn:K,env:{...process.env,ROVECODE_LANES_ALLOW:"codex"}}});return{toolCalls:[...V.toolCalls,...I.toolCalls],events:[...V.events,...I.events],finalText:`${V.finalText} | ${I.finalText}`,recovered:!0}},verify:(z,q)=>q.finalText.includes("LANE-GATED-OFF")&&q.finalText.includes("LANE-HOOK-DENIED")&&!B(J(z,"LANE-SPAWNED.txt"))}]}export{d as wave3Tasks};
@@ -0,0 +1,14 @@
1
+ // @bun
2
+ import{Se as m}from"./main-mg9b20ac.js";import{wi as L,xi as j}from"./main-2wyax8k9.js";import{Bi as h}from"./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{gk as u}from"./main-78gq4bt9.js";import{Hk as v,Jk as y,Qk as a}from"./main-qj2djy17.js";import{ll as M,ml as l}from"./main-6dtqmbt6.js";import{pl as b,rl as i}from"./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{pn as g,tn as c}from"./main-nqveez48.js";import"./main-qsevpgsv.js";a();i();l();import{existsSync as p,mkdirSync as F,mkdtempSync as E,rmSync as n,writeFileSync as I}from"fs";import{join as Z}from"path";import{randomUUID as r}from"crypto";c();var T=[{action:"*",resource:"*",effect:"allow"}],t={name:"gauntlet",systemPrompt:"eval",tools:["*"],maxTurns:8},o=Z(import.meta.dir,"..","cli","main.ts");function R(B){try{return JSON.parse(B),!0}catch{return!1}}async function f(B,q){let G=[],J=[],K="",V={maxTurns:q.maxTurns??8,contextBudgetTokens:200000,compactionThreshold:0.8,parallelTools:!0,permissionRules:q.rules},X={stream:q.stream,registry:q.registry,store:B,cwd:q.cwd,...q.signal?{signal:q.signal}:{}};for await(let z of y(t,q.goal,{},V,X,new v)){if(J.push({type:z.type}),z.type==="tool_execution_start")G.push({tool:z.tool,args:z.args});if(z.type==="run_end")K=z.summary}return{toolCalls:G,events:J,finalText:K,recovered:J.some((z)=>z.type==="tool_execution_end")&&K.length>0}}async function S(B,q,G){let J={};for(let[_,$]of Object.entries(process.env))if($!==void 0&&!/^ROVECODE_/i.test(_)&&!/_API_KEY$/i.test(_))J[_]=$;J.ROVECODE_HOME=G,J.ROVECODE_MOCK="1",J.NO_COLOR="1";let K=Bun.spawn([process.execPath,o,...B],{cwd:q,env:J,stdin:"ignore",stdout:"pipe",stderr:"pipe"}),[V,X,z]=await Promise.all([new Response(K.stdout).text(),new Response(K.stderr).text(),K.exited]);return{code:z,stdout:V,stderr:X}}function Yq(){return[{id:"adversarial-webfetch-ssrf",category:"adversarial",prompt:"fetch internal URLs",timeoutMs:20000,setup:(B)=>E(Z(B??"","rovecode-g-")),run:(B,q,G)=>u({ROVECODE_WEBFETCH_ALLOW_PRIVATE:void 0,ROVECODE_WEBFETCH_TIMEOUT_MS:void 0},async()=>{let K=Z(q,"PRIVATE-FETCHED.txt"),V=[],X=async(Y)=>{if(V.push(Y),new URL(Y).hostname==="redir.test")return new Response(null,{status:302,headers:{location:"http://127.0.0.1/"}});return I(K,`${Y}
3
+ `,{flag:"a"}),new Response("ok",{status:200,headers:{"content-type":"text/plain"}})},z=async(Y)=>Y==="public.test"?["10.0.0.5"]:["93.184.216.34"],_=new b;_.register(m({fetch:X,resolve:z}));let $=["http://127.0.0.1:1/","http://169.254.169.254/latest/meta-data","http://[::1]/","http://public.test/","http://redir.test/"],U=async function*(Y,Q){let N=Q.filter((H)=>H.role==="tool");if(N.length===0){yield{type:"turn",turn:j($.map((H,D)=>({id:`f${D}`,tool:"web_fetch",args:{url:H}})))};return}let C=N.flatMap((H)=>H.parts).filter((H)=>H.kind==="tool_result"),P=C.filter((H)=>!H.ok&&H.output.includes("refused")).length,A=C.filter((H)=>!H.ok&&/refused .*(loopback|private|link-local|reserved|unique-local)/i.test(H.output)).length;yield{type:"turn",turn:L(`SSRF-REFUSED-${P} address-${A}`)}},W=E(Z(G,"rovecode-cli-g-"));try{let Y=new M(W,r()),Q=await f(Y,{goal:"fetch internal URLs",registry:_,stream:U,rules:T,cwd:q,maxTurns:6}),N=V.filter((C)=>new URL(C).hostname!=="redir.test");return{...Q,finalText:`${Q.finalText} fetches=${V.length} leaked=${N.length}${N.length>0?` [${N.join(" ")}]`:""}`}}finally{n(W,{recursive:!0,force:!0})}}),verify:(B,q)=>["SSRF-REFUSED-5","address-5","fetches=1","leaked=0"].every((G)=>q.finalText.split(" ").includes(G))&&!p(Z(B,"PRIVATE-FETCHED.txt"))},{id:"adversarial-session-tamper",category:"adversarial",prompt:"resume a tampered session",timeoutMs:15000,setup:(B)=>E(Z(B??"","rovecode-g-")),run:async(B,q)=>{let J=Z(q,"planted.png");I(J,Buffer.from("iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==","base64"));let K=Z(q,"sessions"),V="tampered",X=new M(K,V);X.append({id:"u1",role:"user",parts:[{kind:"text",text:"hello"}],parentId:null,createdAt:1}),X.append({id:"img1",role:"user",parts:[{kind:"image",mime:"image/png",path:J}],parentId:"u1",createdAt:2});let z=Z(K,V,"entries.jsonl"),_={id:"loop",parentId:"loop",createdAt:3,prevHash:"",hash:"dead",entry:{id:"loop",role:"user",parts:[{kind:"text",text:"loop"}],parentId:"loop",createdAt:3}},$={parentId:null,createdAt:4,prevHash:"",hash:"",entry:{role:"user",parts:[{kind:"text",text:"x"}]}},U={id:"u2",parentId:"img1",createdAt:5,prevHash:"",hash:"tail",entry:{id:"u2",role:"user",parts:[{kind:"text",text:"carry on"}],parentId:"img1",createdAt:5}};I(z,`${JSON.stringify(_)}
4
+ ${JSON.stringify($)}
5
+ ${JSON.stringify(U)}
6
+ `,{flag:"a"});let W=new M(K,V),Y=W.reload(),Q=Y.some((H)=>H.kind==="cycle"),N=Y.some((H)=>H.kind==="unknown-shape"),C="iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==".slice(0,40),P=async function*(H,D){let w=D.flatMap((O)=>O.parts).filter((O)=>O.kind==="image").some((O)=>O.bytes!==void 0||O.path!==void 0),x=JSON.stringify(h(D)),k=x.includes("file unavailable"),d=!x.includes(C);yield{type:"turn",turn:L(`RESUMED leaked=${w} placeholder=${k} noleak=${d}`)}},A=await f(W,{goal:"resume the tampered session",registry:new b,stream:P,rules:T,cwd:q,maxTurns:3});return{...A,finalText:`${A.finalText} cyc=${Q} idless=${N}`}},verify:(B,q)=>["leaked=false","placeholder=true","noleak=true","cyc=true","idless=true"].every((G)=>q.finalText.includes(G))},{id:"basic-output-json-purity",category:"basic",prompt:"run through the CLI with --output json",timeoutMs:60000,setup:(B)=>E(Z(B??"","rovecode-g-")),run:async(B,q)=>{let G=Z(q,"home");F(G,{recursive:!0});let J=Z(q,".rovecode","hooks.ts");F(Z(q,".rovecode"),{recursive:!0}),I(J,`export default { version: 1, hooks: {
7
+ session_open() { console.log("BOOT-LEAK-LOG"); process.stdout.write("BOOT-LEAK-WRITE\\n"); },
8
+ pre_run() { console.log("RUN-LEAK-LOG"); },
9
+ } };
10
+ `);let K=g(G,J);if(!K.ok)throw Error(`gauntlet: could not trust ${J}: ${K.reason}`);let V=await S(["run","say hi","--output","json"],q,G),X=await S(["run","say hi","--output","ndjson"],q,G),z=V.stdout.split(`
11
+ `),_=z.length===2&&z[1]===""&&R(z[0]),$=_&&JSON.parse(z[0]).status==="done",U=V.stderr.includes("BOOT-LEAK-LOG")&&V.stderr.includes("BOOT-LEAK-WRITE"),W=X.stdout.endsWith(`
12
+ `)?X.stdout.slice(0,-1).split(`
13
+ `):[X.stdout],Y=X.stdout.endsWith(`
14
+ `)&&W.every(R);return{toolCalls:[],events:[{type:"run_end"}],finalText:`JSONPURE oneObject=${_} status=${$} exit0=${V.code===0} stderrLeak=${U} ndjson=${Y} nexit0=${X.code===0}`,recovered:!0}},verify:(B,q)=>["oneObject=true","status=true","exit0=true","stderrLeak=true","ndjson=true","nexit0=true"].every((G)=>q.finalText.includes(G))}]}export{Yq as wave4Tasks};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{$f as c,Zf as a,_f as b,ag as d,bg as e,cg as f,dg as g,eg as h,fg as i,gg as j,hg as k,ig as l,jg as m,kg as n,lg as o}from"./main-rvetps99.js";import"./main-kba6zeyd.js";import"./main-a3f51n0x.js";import"./main-qsevpgsv.js";o();export{n as writeTool,l as setEditLinter,f as renderAnchored,k as readTool,e as readAnchored,c as lineHash,d as fileTag,m as editTool,j as describeEditFailure,b as deniedCommand,a as bashTool,g as applyEditsToContent,h as applyEdits,i as MAX_EDIT_MESSAGE_CHARS};
@@ -0,0 +1,5 @@
1
+ // @bun
2
+ import{Tc as S}from"./main-nvc3yjay.js";import"./main-bxtvnf6d.js";import"./main-4p4e2w7x.js";import"./main-hqbz10aw.js";import"./main-n6qrdbmy.js";import"./main-evgz4mp5.js";import"./main-f33fc5je.js";import"./main-2zgsknth.js";import"./main-kwwsz6rq.js";import"./main-23q7cmww.js";import"./main-45rn3trk.js";import"./main-yrjt2sqt.js";import"./main-a2yfvcy9.js";import"./main-gth53dnt.js";import"./main-2z3dek0b.js";import"./main-9a9rnh47.js";import"./main-mg9b20ac.js";import"./main-p0cfn6nr.js";import"./main-xfekqh9m.js";import"./main-s4bb0jav.js";import"./main-wqt32p5x.js";import"./main-rvetps99.js";import{pg as R,tg as l}from"./main-x9ct6y1a.js";import"./main-mg4f96e1.js";import"./main-wgph00xf.js";import"./main-7jd5vh3x.js";import"./main-xt9zc3n6.js";import"./main-ntqef02r.js";import"./main-mgb9ccnx.js";import"./main-kba6zeyd.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{Nj as O,Wj as b}from"./main-ywbxshqc.js";import"./main-gbbty4d4.js";import{Jk as E,Qk as a}from"./main-qj2djy17.js";import{jl as A,ml as c}from"./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-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";import{randomUUID as p}from"crypto";import{join as y}from"path";b();l();a();c();var B="v1 approvals are policy-only: the server runs with rule-based permissions and has no interactive approver over HTTP. A tool call whose permission rule resolves to effect "+'"prompt" is NOT paused for approval \u2014 it surfaces as a failed tool call '+'(tool_call_failed, reason permission_denied, "approval required but no approver connected") and the run continues. Start the server with --yolo (allow-all rules) or provide allow rules to let gated tools run.',m=["run_start","turn_start","message_update","reasoning_update","tool_execution_start","tool_execution_update","tool_execution_end","tool_call_failed","compaction","turn_end","steer","run_end"],C=(G)=>({description:G,content:{"application/json":{schema:{$ref:"#/components/schemas/Error"}}}});function Y(G){return{openapi:"3.1.0",info:{title:"rovecode server",version:"0.1.0",description:"Headless HTTP surface over the one rovecode agent loop (ADR-003). Five routes: create a session, prompt it (SSE stream of typed run events; DELETE the same path cancels the in-flight run mid-turn), list its background tasks, list sessions, and this document. "+B},servers:[{url:G}],paths:{"/session":{post:{operationId:"session.create",summary:"Create a new session",description:"Creates a session backed by the append-only JSONL session store and returns its id.",responses:{"201":{description:"Session created",content:{"application/json":{schema:{type:"object",required:["id"],properties:{id:{type:"string",description:"Session id (also the session directory name)"}}}}}}}}},"/session/{id}/prompt":{post:{operationId:"session.prompt",summary:"Run the agent loop on a session and stream its events",description:"Runs one agent loop over the session with the given text as the goal. The response is a Server-Sent Events stream: each event is framed as `event: <RunEvent.type>` + `data: <RunEvent JSON>`, and the stream closes after the terminal run_end event. "+B,parameters:[{name:"id",in:"path",required:!0,schema:{type:"string"},description:"Session id from POST /session"}],requestBody:{required:!0,content:{"application/json":{schema:{type:"object",required:["text"],properties:{text:{type:"string",description:"The user goal for this run"},model:{type:"object",description:"Optional model override; defaults to the server's resolved provider/model",required:["provider","model"],properties:{provider:{type:"string"},model:{type:"string"}}}}}}}},responses:{"200":{description:"SSE stream of RunEvent frames; closes after run_end",content:{"text/event-stream":{schema:{$ref:"#/components/schemas/RunEvent"}}}},"400":C("Body is not JSON or lacks a string `text`"),"404":C("Unknown session id"),"409":C("A run is already in progress for this session"),"503":C("No provider configured \u2014 run `rovecode setup` (or rovecode provider add + rovecode auth set, or set ROVECODE_BASE_URL/ROVECODE_API_KEY)")}},delete:{operationId:"session.cancel",summary:"Cancel the in-flight run on a session",description:`Aborts the running prompt's AbortController: the in-flight provider fetch and tool subprocesses are killed mid-turn, and the run's SSE stream ends with a run_end event of status "stopped". The session stays busy (409 on new prompts) until that stream has actually settled. Idempotent: cancelling an idle session returns cancelled: false.`,parameters:[{name:"id",in:"path",required:!0,schema:{type:"string"},description:"Session id from POST /session"}],responses:{"200":{description:"Cancellation signalled (cancelled: true) or nothing was running (cancelled: false)",content:{"application/json":{schema:{type:"object",required:["cancelled"],properties:{cancelled:{type:"boolean"}}}}}},"404":C("Unknown session id")}}},"/session/{id}/tasks":{get:{operationId:"session.tasks",summary:"List the session's background subagent tasks",description:"Snapshot of the session's background tasks (port #26): child agent sessions started by the `task` tool, oldest first, with status queued|running|done|failed|cancelled, timing, the child's final text (done) or error (failed). Tasks are process-local and not durable across server restarts. Completion notes reach the model as steering on the session's next prompt.",parameters:[{name:"id",in:"path",required:!0,schema:{type:"string"},description:"Session id from POST /session"}],responses:{"200":{description:"Task snapshots",content:{"application/json":{schema:{type:"array",items:{$ref:"#/components/schemas/TaskInfo"}}}}},"404":C("Unknown session id")}}},"/sessions":{get:{operationId:"session.list",summary:"List sessions",description:"Scans the session root and returns summaries, sorted by updatedAt descending. Corrupt or foreign directories are skipped, never errors.",responses:{"200":{description:"Session summaries",content:{"application/json":{schema:{type:"array",items:{$ref:"#/components/schemas/SessionSummary"}}}}}}}},"/doc":{get:{operationId:"doc",summary:"This OpenAPI 3.1 document",description:"Returns the OpenAPI 3.1 JSON describing exactly this server surface.",responses:{"200":{description:"OpenAPI 3.1 document",content:{"application/json":{schema:{type:"object"}}}}}}}},components:{schemas:{Error:{type:"object",required:["error"],properties:{error:{type:"string"}}},SessionSummary:{type:"object",required:["id","createdAt","updatedAt","entryCount","preview"],properties:{id:{type:"string"},createdAt:{type:"number"},updatedAt:{type:"number"},entryCount:{type:"number"},preview:{type:"string",description:"First user-message text, single line, \u226480 chars"}}},RunEvent:{type:"object",description:"Typed agent-loop event (src/core/types.ts RunEvent union), discriminated by `type`. The SSE `event:` field always equals this `type` field.",required:["type"],properties:{type:{type:"string",enum:[...m]}},additionalProperties:!0},TaskInfo:{type:"object",description:"Background subagent task snapshot (src/core/tasks.ts TaskInfo).",required:["id","label","agent","goal","isolated","depth","status","createdAt"],properties:{id:{type:"string",description:"Task id (t1, t2, \u2026; scoped to the session)"},label:{type:"string"},agent:{type:"string",description:"Agent definition the child runs"},goal:{type:"string",description:"Bounded preview of the child's goal (\u2264200 chars)"},isolated:{type:"boolean",description:"Ran in a worktree copy; file changes merge back as a patch on success"},depth:{type:"number",description:"Child depth (root-started tasks run at 1)"},status:{type:"string",enum:["queued","running","done","failed","cancelled"]},createdAt:{type:"number"},startedAt:{type:"number"},finishedAt:{type:"number"},summary:{type:"string",description:"The child's final text (status done), \u22644000 chars"},error:{type:"string",description:'Failure reason (status failed) or "cancelled"'},usage:{type:"object",properties:{input:{type:"number"},output:{type:"number"}}},patchLines:{type:"number",description:"Isolated children: line count of the merged-back patch"}}}}}}}var d=4100,i="127.0.0.1",F=1048576;function Q(G,Z=200){return new Response(JSON.stringify(G),{status:Z,headers:{"content-type":"application/json"}})}function h(G){return`event: ${G.type}
3
+ data: ${JSON.stringify(G)}
4
+
5
+ `}function n(G,Z,H){let I=new TextEncoder,V=!1,$=()=>{if(!V)V=!0,Z()},X=new ReadableStream({async start(w){try{for await(let k of G)if(w.enqueue(I.encode(h(k))),k.type==="run_end")break}catch(k){let f={type:"run_end",status:"error",summary:k instanceof Error?k.message:String(k)};try{w.enqueue(I.encode(h(f)))}catch{}}finally{$();try{w.close()}catch{}}},cancel(){H(),Promise.resolve(G.return(void 0)).catch(()=>{})}});return new Response(X,{status:200,headers:{"content-type":"text/event-stream","cache-control":"no-cache, no-transform","x-accel-buffering":"no"}})}function t(G){if(G&&typeof G==="object"&&typeof G.text==="string")return G.text;return null}function s(G){if(G&&typeof G==="object"&&G.model&&typeof G.model==="object"){let Z=G.model;if(typeof Z.provider==="string"&&typeof Z.model==="string")return{provider:Z.provider,model:Z.model}}return null}function $z(G={}){let Z=G.hostname??i,H=G.cwd??process.cwd(),I=y(H,".rovecode","sessions"),V=G.yolo??!1,$=new Map,X=async()=>{let J=p(),z;try{z=await S({cwd:H,sessionId:J,stream:G.stream})}catch(K){if(K instanceof R)return Q({error:K.message},503);throw K}return $.set(J,{runtime:z,running:!1,abort:null}),Q({id:J},201)},w=async(J,z)=>{let K=$.get(J);if(!K)return Q({error:`unknown session ${J}`},404);if(Number(z.headers.get("content-length")??"0")>F)return Q({error:`request body too large (max ${F} bytes)`},413);let g;try{g=await z.json()}catch{return Q({error:"body must be JSON"},400)}let M=t(g);if(M===null)return Q({error:'body must be {"text": string}'},400);if(M.length>F)return Q({error:`text too large (max ${F} chars)`},413);if(K.running)return Q({error:"a run is already in progress for this session"},409);let W=K.runtime,U=W.stream,P=W.noProviderReason();if(!U||P!==null)return Q({error:P??O("cli")},503);let v=s(g)??{provider:W.provider?.id??"mock",model:W.defaultModel||"default"},_=W.buildDef(v),j=W.buildCfg(V,void 0),N=new AbortController;W.tasks.bindRun(N.signal);let u=E(_,M,{},j,{stream:U,registry:W.registry,store:W.store,tools:W.registry.list().map((q)=>q.schema),guard:W.guard,planReminder:W.planReminder,hooks:W.hooks,cwd:W.cwd,signal:N.signal},W.steering);return K.running=!0,K.abort=N,n(u,()=>{K.running=!1,K.abort=null},()=>N.abort())},k=(J)=>{let z=$.get(J);if(!z)return Q({error:`unknown session ${J}`},404);let K=z.abort!==null;return z.abort?.abort(),Q({cancelled:K})},f=(J)=>{let z=$.get(J);if(!z)return Q({error:`unknown session ${J}`},404);return Q(z.runtime.tasks.list())},T=async(J)=>{let z=new URL(J.url).pathname;if(J.method==="POST"&&z==="/session")return X();let K=/^\/session\/([^/]+)\/prompt$/.exec(z);if(J.method==="POST"&&K)return w(K[1],J);if(J.method==="DELETE"&&K)return k(K[1]);let L=/^\/session\/([^/]+)\/tasks$/.exec(z);if(J.method==="GET"&&L)return f(L[1]);if(J.method==="GET"&&z==="/sessions")return Q(A(I));if(J.method==="GET"&&z==="/doc")return Q(Y(D.url));return Q({error:`no route for ${J.method} ${z}`},404)},x=Bun.serve({hostname:Z,port:G.port??d,idleTimeout:0,maxRequestBodySize:F*2,async fetch(J){try{return await T(J)}catch(z){return Q({error:z instanceof Error?z.message:String(z)},500)}}}),D={port:x.port??0,hostname:Z,url:`http://${Z}:${x.port}`,async stop(){await x.stop(!0);for(let z of $.values())z.abort?.abort();for(let{runtime:z}of $.values())z.tasks.cancelAll();let J=[];for(let{runtime:z}of $.values())if(z.bashJobs.dispose(),J.push(z.hooks.close()),z.mcp)J.push(z.mcp.close().catch(()=>{}));await Promise.all(J)}};return D}export{$z as startServer,F as MAX_BODY_BYTES,d as DEFAULT_PORT,i as DEFAULT_HOSTNAME};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Ag as x,xg as l,yg as m,zg as w}from"./main-mg4f96e1.js";import{Bg as u,Cg as v}from"./main-wgph00xf.js";import{Eg as f,Fg as g,Gg as h,Hg as i,Jg as j,Kg as k,Og as n,Pg as o,Qg as p,Rg as q,Sg as r,Tg as s,Ug as t}from"./main-7jd5vh3x.js";import"./main-5py0rkmc.js";import"./main-y5c82rxr.js";import"./main-2yeveeve.js";import"./main-0jys2ccn.js";import{cn as a,dn as b,en as c,fn as d,gn as e}from"./main-nqveez48.js";import"./main-qsevpgsv.js";export{t as untrustPlugin,s as trustPlugin,x as summarizePlugins,a as statePath,r as setPluginEnabled,o as scopeRoot,c as saveState,q as removePlugin,j as pluginRoots,d as pluginFiles,e as pluginDigest,h as parseManifest,b as loadState,w as loadPlugins,n as isGitSource,k as discoverPlugins,i as contributions,v as cmdPlugin,p as addPlugin,m as activatePlugins,u as PLUGIN_USAGE,f as PLUGIN_API_VERSION,g as MANIFEST_FILE,l as DEFAULT_PLUGIN_TIMEOUT_MS};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Mb as a,Nb as b,Ob as c,Pb as d,Qb as e,Rb as f,Sb as g,Tb as h,Ub as i}from"./main-hzwtsb2m.js";import"./main-m8vm17zq.js";import"./main-zc7pyrbj.js";import"./main-45ejth3a.js";import"./main-jak598k9.js";import"./main-7kt6r53y.js";import"./main-f33fc5je.js";import"./main-2zgsknth.js";import"./main-kwwsz6rq.js";import"./main-7jd5vh3x.js";import"./main-xt9zc3n6.js";import"./main-2rzbexn2.js";import"./main-y5c82rxr.js";import"./main-2yeveeve.js";import"./main-0jys2ccn.js";import"./main-nqveez48.js";import"./main-qsevpgsv.js";i();export{g as withInstalled,a as validInstallName,b as skillDir,d as runInstall,h as removeItem,c as planInstall,e as needsNetwork,f as installedState};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Hk as b,Ik as c,Jk as d,Kk as e,Lk as f,Mk as g,Nk as h,Ok as i,Pk as j,Qk as k}from"./main-qj2djy17.js";import"./main-6dtqmbt6.js";import{nl as a}from"./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";k();export{j as partsTokenText,i as partsText,h as outstandingTone,g as outstandingClause,f as finishCheckText,c as extractToolCalls,e as assessOutstanding,d as agentLoop,b as SteeringQueue,a as ABORTED_TOOL_RESULT};
@@ -0,0 +1,4 @@
1
+ // @bun
2
+ import{Ok as M,Qk as W}from"./main-qj2djy17.js";import{$k as Q,Zk as N,al as R,bl as V}from"./main-6dtqmbt6.js";W();V();function U(F,G,J){if(!F.parts.some((D)=>D.kind==="image"))return M(F.parts);if(G&&F.role==="user"){let D=[];for(let H of F.parts)if(H.kind==="text"){if(H.text)D.push({type:"text",text:H.text})}else if(H.kind==="image")D.push(J(H)??{type:"text",text:N(H,"file unavailable")});return D}let E=[],A="";for(let D of F.parts)if(D.kind==="text")A+=D.text;else if(D.kind==="image"){if(A)E.push(A),A="";E.push(N(D,G?"file unavailable":void 0))}if(A)E.push(A);return E.join(`
3
+ `)}function _(F,G={}){let J=G.vision??!0,E=[];for(let A of F){let D=A.parts.filter((z)=>z.kind==="tool_call"),H=A.parts.filter((z)=>z.kind==="tool_result");if(A.role==="tool"){for(let z of H)if(z.kind==="tool_result")E.push({role:"tool",tool_call_id:z.callId,content:z.output});continue}if(A.role==="assistant"&&D.length>0)E.push({role:"assistant",content:M(A.parts)||null,tool_calls:D.map((z)=>z.kind==="tool_call"?{id:z.id,type:"function",function:{name:z.tool,arguments:JSON.stringify(z.args)}}:{})});else{let z=U(A,J,(K)=>R(K));if(z.length>0||A.role==="system")E.push({role:A.role,content:z})}}return E}function X(F){let G=F;return G.schema??{name:G.name??"unknown",description:G.description??"",args:G.args??{}}}function $(F){return F.map((G)=>{let J=X(G);return{type:"function",function:{name:J.name,description:J.description,parameters:J.args}}})}function j(F,G={}){let J=G.vision??!0,E=[];for(let A of F){if(A.role==="system")continue;let D=A.parts.filter((z)=>z.kind==="tool_call"),H=A.parts.filter((z)=>z.kind==="tool_result");if(A.role==="tool"){for(let z of H)if(z.kind==="tool_result")E.push({role:"user",content:[{type:"tool_result",tool_use_id:z.callId,content:z.output,is_error:!z.ok}]});continue}if(A.role==="assistant"&&D.length>0){let z=M(A.parts),K=[];if(z)K.push({type:"text",text:z});for(let L of D)if(L.kind==="tool_call")K.push({type:"tool_use",id:L.id,name:L.tool,input:L.args});E.push({role:"assistant",content:K})}else{let z=U(A,J,Q);if(z.length>0)E.push({role:A.role==="user"?"user":"assistant",content:z})}}return E}
4
+ export{U as Ai,_ as Bi,X as Ci,$ as Di,j as Ei};