rovecode 0.4.0-beta.3 → 0.4.0

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