byterover-cli 2.5.2 → 3.0.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 (389) hide show
  1. package/.env.production +8 -0
  2. package/LICENSE +44 -0
  3. package/README.md +240 -14
  4. package/bin/dev.js +8 -1
  5. package/bin/run.js +8 -1
  6. package/dist/agent/core/domain/knowledge/conflict-detector.d.ts +38 -0
  7. package/dist/agent/core/domain/knowledge/conflict-detector.js +71 -0
  8. package/dist/agent/core/domain/knowledge/conflict-resolver.d.ts +17 -0
  9. package/dist/agent/core/domain/knowledge/conflict-resolver.js +118 -0
  10. package/dist/agent/core/domain/knowledge/utils.d.ts +4 -0
  11. package/dist/agent/core/domain/knowledge/utils.js +6 -0
  12. package/dist/agent/core/interfaces/i-curate-service.d.ts +6 -0
  13. package/dist/agent/infra/tools/implementations/curate-tool.d.ts +67 -34
  14. package/dist/agent/infra/tools/implementations/curate-tool.js +294 -47
  15. package/dist/agent/resources/prompts/system-prompt.yml +15 -8
  16. package/dist/agent/resources/tools/code_exec.txt +3 -0
  17. package/dist/agent/resources/tools/curate.txt +12 -3
  18. package/dist/oclif/commands/connectors/install.d.ts +2 -1
  19. package/dist/oclif/commands/connectors/install.js +38 -3
  20. package/dist/oclif/commands/curate/index.d.ts +18 -0
  21. package/dist/oclif/commands/curate/index.js +78 -1
  22. package/dist/oclif/commands/init.d.ts +12 -0
  23. package/dist/oclif/commands/init.js +75 -0
  24. package/dist/oclif/commands/locations.js +1 -1
  25. package/dist/oclif/commands/providers/connect.d.ts +31 -1
  26. package/dist/oclif/commands/providers/connect.js +307 -27
  27. package/dist/oclif/commands/pull.d.ts +1 -0
  28. package/dist/oclif/commands/pull.js +7 -0
  29. package/dist/oclif/commands/push.d.ts +1 -0
  30. package/dist/oclif/commands/push.js +8 -0
  31. package/dist/oclif/commands/review/approve.d.ts +17 -0
  32. package/dist/oclif/commands/review/approve.js +37 -0
  33. package/dist/oclif/commands/review/base-review-decision.d.ts +18 -0
  34. package/dist/oclif/commands/review/base-review-decision.js +71 -0
  35. package/dist/oclif/commands/review/pending.d.ts +13 -0
  36. package/dist/oclif/commands/review/pending.js +94 -0
  37. package/dist/oclif/commands/review/reject.d.ts +17 -0
  38. package/dist/oclif/commands/review/reject.js +38 -0
  39. package/dist/oclif/commands/space/list.d.ts +2 -2
  40. package/dist/oclif/commands/space/list.js +13 -35
  41. package/dist/oclif/commands/space/switch.d.ts +2 -7
  42. package/dist/oclif/commands/space/switch.js +13 -56
  43. package/dist/oclif/commands/status.d.ts +1 -0
  44. package/dist/oclif/commands/status.js +11 -1
  45. package/dist/oclif/commands/vc/add.d.ts +7 -0
  46. package/dist/oclif/commands/vc/add.js +29 -0
  47. package/dist/oclif/commands/vc/branch.d.ts +15 -0
  48. package/dist/oclif/commands/vc/branch.js +70 -0
  49. package/dist/oclif/commands/vc/checkout.d.ts +14 -0
  50. package/dist/oclif/commands/vc/checkout.js +47 -0
  51. package/dist/oclif/commands/vc/clone.d.ts +9 -0
  52. package/dist/oclif/commands/vc/clone.js +61 -0
  53. package/dist/oclif/commands/vc/commit.d.ts +10 -0
  54. package/dist/oclif/commands/vc/commit.js +32 -0
  55. package/dist/oclif/commands/vc/config.d.ts +10 -0
  56. package/dist/oclif/commands/vc/config.js +30 -0
  57. package/dist/oclif/commands/vc/fetch.d.ts +10 -0
  58. package/dist/oclif/commands/vc/fetch.js +42 -0
  59. package/dist/oclif/commands/vc/index.d.ts +6 -0
  60. package/dist/oclif/commands/vc/index.js +8 -0
  61. package/dist/oclif/commands/vc/init.d.ts +6 -0
  62. package/dist/oclif/commands/vc/init.js +25 -0
  63. package/dist/oclif/commands/vc/log.d.ts +13 -0
  64. package/dist/oclif/commands/vc/log.js +48 -0
  65. package/dist/oclif/commands/vc/merge.d.ts +19 -0
  66. package/dist/oclif/commands/vc/merge.js +130 -0
  67. package/dist/oclif/commands/vc/pull.d.ts +13 -0
  68. package/dist/oclif/commands/vc/pull.js +60 -0
  69. package/dist/oclif/commands/vc/push.d.ts +13 -0
  70. package/dist/oclif/commands/vc/push.js +60 -0
  71. package/dist/oclif/commands/vc/remote/add.d.ts +10 -0
  72. package/dist/oclif/commands/vc/remote/add.js +30 -0
  73. package/dist/oclif/commands/vc/remote/index.d.ts +6 -0
  74. package/dist/oclif/commands/vc/remote/index.js +16 -0
  75. package/dist/oclif/commands/vc/remote/set-url.d.ts +10 -0
  76. package/dist/oclif/commands/vc/remote/set-url.js +30 -0
  77. package/dist/oclif/commands/vc/reset.d.ts +13 -0
  78. package/dist/oclif/commands/vc/reset.js +62 -0
  79. package/dist/oclif/commands/vc/status.d.ts +8 -0
  80. package/dist/oclif/commands/vc/status.js +106 -0
  81. package/dist/oclif/hooks/init/validate-brv-config.d.ts +26 -0
  82. package/dist/oclif/hooks/init/validate-brv-config.js +62 -0
  83. package/dist/oclif/lib/daemon-client.d.ts +2 -0
  84. package/dist/oclif/lib/daemon-client.js +36 -10
  85. package/dist/oclif/lib/prompt-utils.d.ts +43 -0
  86. package/dist/oclif/lib/prompt-utils.js +84 -0
  87. package/dist/oclif/lib/spinner.d.ts +8 -0
  88. package/dist/oclif/lib/spinner.js +23 -0
  89. package/dist/oclif/lib/task-client.d.ts +5 -0
  90. package/dist/oclif/lib/task-client.js +15 -2
  91. package/dist/server/config/environment.d.ts +2 -19
  92. package/dist/server/config/environment.js +31 -38
  93. package/dist/server/constants.d.ts +3 -9
  94. package/dist/server/constants.js +9 -12
  95. package/dist/server/core/domain/entities/auth-token.d.ts +2 -0
  96. package/dist/server/core/domain/entities/auth-token.js +7 -1
  97. package/dist/server/core/domain/entities/curate-log-entry.d.ts +11 -0
  98. package/dist/server/core/domain/entities/space.d.ts +4 -0
  99. package/dist/server/core/domain/entities/space.js +8 -0
  100. package/dist/server/core/domain/entities/team.d.ts +2 -0
  101. package/dist/server/core/domain/entities/team.js +4 -0
  102. package/dist/server/core/domain/errors/auth-error.d.ts +0 -6
  103. package/dist/server/core/domain/errors/auth-error.js +0 -12
  104. package/dist/server/core/domain/errors/git-error.d.ts +6 -0
  105. package/dist/server/core/domain/errors/git-error.js +12 -0
  106. package/dist/server/core/domain/errors/task-error.d.ts +4 -3
  107. package/dist/server/core/domain/errors/task-error.js +8 -8
  108. package/dist/server/core/domain/errors/transport-error.d.ts +0 -31
  109. package/dist/server/core/domain/errors/transport-error.js +0 -50
  110. package/dist/server/core/domain/errors/vc-error.d.ts +5 -0
  111. package/dist/server/core/domain/errors/vc-error.js +8 -0
  112. package/dist/server/core/domain/knowledge/markdown-writer.d.ts +4 -1
  113. package/dist/server/core/domain/knowledge/markdown-writer.js +37 -7
  114. package/dist/server/core/domain/transport/schemas.d.ts +6 -6
  115. package/dist/server/core/interfaces/context-tree/i-context-tree-service.d.ts +11 -0
  116. package/dist/server/core/interfaces/process/i-task-lifecycle-hook.d.ts +6 -0
  117. package/dist/server/core/interfaces/services/i-git-service.d.ts +234 -0
  118. package/dist/server/core/interfaces/storage/i-curate-log-store.d.ts +5 -0
  119. package/dist/server/core/interfaces/storage/i-review-backup-store.d.ts +19 -0
  120. package/dist/server/core/interfaces/vc/i-vc-git-config-store.d.ts +8 -0
  121. package/dist/server/infra/config/auto-init.d.ts +0 -2
  122. package/dist/server/infra/config/auto-init.js +0 -1
  123. package/dist/server/infra/connectors/rules/rules-connector-config.d.ts +0 -4
  124. package/dist/server/infra/context-tree/file-context-tree-service.d.ts +2 -0
  125. package/dist/server/infra/context-tree/file-context-tree-service.js +13 -0
  126. package/dist/server/infra/daemon/brv-server.js +23 -3
  127. package/dist/server/infra/git/cogit-url.d.ts +17 -0
  128. package/dist/server/infra/git/cogit-url.js +39 -0
  129. package/dist/server/infra/git/git-http-wrapper.d.ts +20 -0
  130. package/dist/server/infra/git/git-http-wrapper.js +334 -0
  131. package/dist/server/infra/git/isomorphic-git-service.d.ts +78 -0
  132. package/dist/server/infra/git/isomorphic-git-service.js +983 -0
  133. package/dist/server/infra/http/models-dev-client.d.ts +0 -4
  134. package/dist/server/infra/http/models-dev-client.js +0 -6
  135. package/dist/server/infra/http/openrouter-api-client.d.ts +0 -8
  136. package/dist/server/infra/http/openrouter-api-client.js +0 -13
  137. package/dist/server/infra/http/provider-model-fetcher-registry.d.ts +0 -5
  138. package/dist/server/infra/http/provider-model-fetcher-registry.js +0 -7
  139. package/dist/server/infra/http/review-api-handler.d.ts +13 -0
  140. package/dist/server/infra/http/review-api-handler.js +286 -0
  141. package/dist/server/infra/http/review-ui.d.ts +7 -0
  142. package/dist/server/infra/http/review-ui.js +606 -0
  143. package/dist/server/infra/mcp/tools/brv-curate-tool.d.ts +2 -2
  144. package/dist/server/infra/process/curate-log-handler.d.ts +18 -2
  145. package/dist/server/infra/process/curate-log-handler.js +50 -13
  146. package/dist/server/infra/process/feature-handlers.js +41 -1
  147. package/dist/server/infra/process/task-router.js +16 -0
  148. package/dist/server/infra/provider/env-provider-detector.d.ts +0 -20
  149. package/dist/server/infra/provider/env-provider-detector.js +0 -27
  150. package/dist/server/infra/space/http-space-service.js +2 -0
  151. package/dist/server/infra/storage/file-curate-log-store.d.ts +10 -0
  152. package/dist/server/infra/storage/file-curate-log-store.js +35 -0
  153. package/dist/server/infra/storage/file-provider-config-store.d.ts +0 -4
  154. package/dist/server/infra/storage/file-provider-config-store.js +0 -6
  155. package/dist/server/infra/storage/file-review-backup-store.d.ts +29 -0
  156. package/dist/server/infra/storage/file-review-backup-store.js +121 -0
  157. package/dist/server/infra/transport/handlers/auth-handler.js +9 -5
  158. package/dist/server/infra/transport/handlers/handler-types.d.ts +9 -0
  159. package/dist/server/infra/transport/handlers/handler-types.js +11 -0
  160. package/dist/server/infra/transport/handlers/index.d.ts +4 -0
  161. package/dist/server/infra/transport/handlers/index.js +2 -0
  162. package/dist/server/infra/transport/handlers/init-handler.d.ts +1 -0
  163. package/dist/server/infra/transport/handlers/init-handler.js +13 -1
  164. package/dist/server/infra/transport/handlers/pull-handler.d.ts +3 -0
  165. package/dist/server/infra/transport/handlers/pull-handler.js +5 -1
  166. package/dist/server/infra/transport/handlers/push-handler.d.ts +20 -0
  167. package/dist/server/infra/transport/handlers/push-handler.js +116 -14
  168. package/dist/server/infra/transport/handlers/reset-handler.d.ts +11 -0
  169. package/dist/server/infra/transport/handlers/reset-handler.js +37 -1
  170. package/dist/server/infra/transport/handlers/review-handler.d.ts +35 -0
  171. package/dist/server/infra/transport/handlers/review-handler.js +162 -0
  172. package/dist/server/infra/transport/handlers/space-handler.d.ts +3 -0
  173. package/dist/server/infra/transport/handlers/space-handler.js +4 -1
  174. package/dist/server/infra/transport/handlers/status-handler.d.ts +5 -0
  175. package/dist/server/infra/transport/handlers/status-handler.js +51 -16
  176. package/dist/server/infra/transport/handlers/vc-handler.d.ts +100 -0
  177. package/dist/server/infra/transport/handlers/vc-handler.js +1050 -0
  178. package/dist/server/infra/transport/socket-io-transport-server.d.ts +7 -0
  179. package/dist/server/infra/transport/socket-io-transport-server.js +12 -1
  180. package/dist/server/infra/transport/transport-connector.d.ts +1 -1
  181. package/dist/server/infra/transport/transport-connector.js +2 -1
  182. package/dist/server/infra/vc/file-vc-git-config-store.d.ts +11 -0
  183. package/dist/server/infra/vc/file-vc-git-config-store.js +43 -0
  184. package/dist/server/templates/skill/SKILL.md +167 -33
  185. package/dist/server/utils/curate-result-parser.d.ts +64 -0
  186. package/dist/server/utils/curate-result-parser.js +8 -0
  187. package/dist/server/utils/file-content-reader.d.ts +2 -1
  188. package/dist/server/utils/file-helpers.d.ts +0 -24
  189. package/dist/server/utils/file-helpers.js +0 -81
  190. package/dist/server/utils/gitignore.d.ts +9 -0
  191. package/dist/server/utils/gitignore.js +47 -0
  192. package/dist/server/utils/process-logger.d.ts +0 -13
  193. package/dist/server/utils/process-logger.js +1 -78
  194. package/dist/shared/transport/events/index.d.ts +6 -0
  195. package/dist/shared/transport/events/index.js +3 -0
  196. package/dist/shared/transport/events/init-events.d.ts +8 -0
  197. package/dist/shared/transport/events/init-events.js +1 -0
  198. package/dist/shared/transport/events/push-events.d.ts +6 -0
  199. package/dist/shared/transport/events/review-events.d.ts +41 -0
  200. package/dist/shared/transport/events/review-events.js +5 -0
  201. package/dist/shared/transport/events/vc-events.d.ts +257 -0
  202. package/dist/shared/transport/events/vc-events.js +67 -0
  203. package/dist/shared/transport/types/dto.d.ts +6 -1
  204. package/dist/tui/app/pages/init-project-page.d.ts +9 -0
  205. package/dist/tui/app/pages/init-project-page.js +54 -0
  206. package/dist/tui/app/pages/protected-routes.js +14 -6
  207. package/dist/tui/components/index.d.ts +0 -2
  208. package/dist/tui/components/index.js +0 -1
  209. package/dist/tui/features/activity/hooks/use-activity-logs.js +7 -1
  210. package/dist/tui/features/commands/definitions/index.js +3 -0
  211. package/dist/tui/features/commands/definitions/space-list.js +9 -18
  212. package/dist/tui/features/commands/definitions/space-switch.js +10 -6
  213. package/dist/tui/features/commands/definitions/vc-add.d.ts +2 -0
  214. package/dist/tui/features/commands/definitions/vc-add.js +15 -0
  215. package/dist/tui/features/commands/definitions/vc-branch.d.ts +2 -0
  216. package/dist/tui/features/commands/definitions/vc-branch.js +33 -0
  217. package/dist/tui/features/commands/definitions/vc-checkout.d.ts +2 -0
  218. package/dist/tui/features/commands/definitions/vc-checkout.js +32 -0
  219. package/dist/tui/features/commands/definitions/vc-clone.d.ts +2 -0
  220. package/dist/tui/features/commands/definitions/vc-clone.js +18 -0
  221. package/dist/tui/features/commands/definitions/vc-commit.d.ts +2 -0
  222. package/dist/tui/features/commands/definitions/vc-commit.js +32 -0
  223. package/dist/tui/features/commands/definitions/vc-config.d.ts +2 -0
  224. package/dist/tui/features/commands/definitions/vc-config.js +40 -0
  225. package/dist/tui/features/commands/definitions/vc-fetch.d.ts +2 -0
  226. package/dist/tui/features/commands/definitions/vc-fetch.js +37 -0
  227. package/dist/tui/features/commands/definitions/vc-init.d.ts +2 -0
  228. package/dist/tui/features/commands/definitions/vc-init.js +11 -0
  229. package/dist/tui/features/commands/definitions/vc-log.d.ts +2 -0
  230. package/dist/tui/features/commands/definitions/vc-log.js +25 -0
  231. package/dist/tui/features/commands/definitions/vc-merge.d.ts +2 -0
  232. package/dist/tui/features/commands/definitions/vc-merge.js +48 -0
  233. package/dist/tui/features/commands/definitions/vc-pull.d.ts +2 -0
  234. package/dist/tui/features/commands/definitions/vc-pull.js +42 -0
  235. package/dist/tui/features/commands/definitions/vc-push.d.ts +2 -0
  236. package/dist/tui/features/commands/definitions/vc-push.js +38 -0
  237. package/dist/tui/features/commands/definitions/vc-remote.d.ts +2 -0
  238. package/dist/tui/features/commands/definitions/vc-remote.js +57 -0
  239. package/dist/tui/features/commands/definitions/vc-reset.d.ts +2 -0
  240. package/dist/tui/features/commands/definitions/vc-reset.js +35 -0
  241. package/dist/tui/features/commands/definitions/vc-status.d.ts +2 -0
  242. package/dist/tui/features/commands/definitions/vc-status.js +11 -0
  243. package/dist/tui/features/commands/definitions/vc.d.ts +2 -0
  244. package/dist/tui/features/commands/definitions/vc.js +36 -0
  245. package/dist/tui/features/commands/hooks/use-slash-command-processor.js +5 -5
  246. package/dist/tui/features/log/api/execute-log.d.ts +8 -0
  247. package/dist/tui/features/log/api/execute-log.js +13 -0
  248. package/dist/tui/features/log/components/log-flow.d.ts +14 -0
  249. package/dist/tui/features/log/components/log-flow.js +29 -0
  250. package/dist/tui/features/log/utils/format-log.d.ts +3 -0
  251. package/dist/tui/features/log/utils/format-log.js +42 -0
  252. package/dist/tui/features/onboarding/hooks/use-app-view-mode.d.ts +9 -5
  253. package/dist/tui/features/onboarding/hooks/use-app-view-mode.js +12 -5
  254. package/dist/tui/features/push/components/push-flow.js +9 -2
  255. package/dist/tui/features/reset/components/reset-flow.js +2 -1
  256. package/dist/tui/features/status/components/status-view.js +2 -1
  257. package/dist/tui/features/status/utils/format-status.js +9 -0
  258. package/dist/tui/features/tasks/hooks/use-task-subscriptions.js +11 -0
  259. package/dist/tui/features/tasks/stores/tasks-store.d.ts +10 -0
  260. package/dist/tui/features/tasks/stores/tasks-store.js +16 -0
  261. package/dist/tui/features/vc/add/api/execute-vc-add.d.ts +8 -0
  262. package/dist/tui/features/vc/add/api/execute-vc-add.js +13 -0
  263. package/dist/tui/features/vc/add/components/vc-add-flow.d.ts +7 -0
  264. package/dist/tui/features/vc/add/components/vc-add-flow.js +35 -0
  265. package/dist/tui/features/vc/branch/api/execute-vc-branch.d.ts +8 -0
  266. package/dist/tui/features/vc/branch/api/execute-vc-branch.js +13 -0
  267. package/dist/tui/features/vc/branch/components/vc-branch-flow.d.ts +8 -0
  268. package/dist/tui/features/vc/branch/components/vc-branch-flow.js +53 -0
  269. package/dist/tui/features/vc/branch/utils/format-branch.d.ts +4 -0
  270. package/dist/tui/features/vc/branch/utils/format-branch.js +12 -0
  271. package/dist/tui/features/vc/checkout/api/execute-vc-checkout.d.ts +8 -0
  272. package/dist/tui/features/vc/checkout/api/execute-vc-checkout.js +13 -0
  273. package/dist/tui/features/vc/checkout/components/vc-checkout-flow.d.ts +8 -0
  274. package/dist/tui/features/vc/checkout/components/vc-checkout-flow.js +33 -0
  275. package/dist/tui/features/vc/clone/api/execute-vc-clone.d.ts +8 -0
  276. package/dist/tui/features/vc/clone/api/execute-vc-clone.js +13 -0
  277. package/dist/tui/features/vc/clone/components/vc-clone-flow.d.ts +7 -0
  278. package/dist/tui/features/vc/clone/components/vc-clone-flow.js +79 -0
  279. package/dist/tui/features/vc/commit/api/execute-vc-commit.d.ts +8 -0
  280. package/dist/tui/features/vc/commit/api/execute-vc-commit.js +13 -0
  281. package/dist/tui/features/vc/commit/components/vc-commit-flow.d.ts +7 -0
  282. package/dist/tui/features/vc/commit/components/vc-commit-flow.js +29 -0
  283. package/dist/tui/features/vc/config/api/execute-vc-config.d.ts +8 -0
  284. package/dist/tui/features/vc/config/api/execute-vc-config.js +13 -0
  285. package/dist/tui/features/vc/config/components/vc-config-flow.d.ts +9 -0
  286. package/dist/tui/features/vc/config/components/vc-config-flow.js +30 -0
  287. package/dist/tui/features/vc/fetch/api/execute-vc-fetch.d.ts +8 -0
  288. package/dist/tui/features/vc/fetch/api/execute-vc-fetch.js +13 -0
  289. package/dist/tui/features/vc/fetch/components/vc-fetch-flow.d.ts +8 -0
  290. package/dist/tui/features/vc/fetch/components/vc-fetch-flow.js +75 -0
  291. package/dist/tui/features/vc/init/api/execute-vc-init.d.ts +8 -0
  292. package/dist/tui/features/vc/init/api/execute-vc-init.js +13 -0
  293. package/dist/tui/features/vc/init/components/vc-init-flow.d.ts +10 -0
  294. package/dist/tui/features/vc/init/components/vc-init-flow.js +37 -0
  295. package/dist/tui/features/vc/merge/api/execute-vc-merge.d.ts +8 -0
  296. package/dist/tui/features/vc/merge/api/execute-vc-merge.js +13 -0
  297. package/dist/tui/features/vc/merge/components/vc-merge-flow.d.ts +11 -0
  298. package/dist/tui/features/vc/merge/components/vc-merge-flow.js +72 -0
  299. package/dist/tui/features/vc/pull/api/execute-vc-pull.d.ts +8 -0
  300. package/dist/tui/features/vc/pull/api/execute-vc-pull.js +13 -0
  301. package/dist/tui/features/vc/pull/components/vc-pull-flow.d.ts +9 -0
  302. package/dist/tui/features/vc/pull/components/vc-pull-flow.js +83 -0
  303. package/dist/tui/features/vc/push/api/execute-vc-push.d.ts +8 -0
  304. package/dist/tui/features/vc/push/api/execute-vc-push.js +13 -0
  305. package/dist/tui/features/vc/push/components/vc-push-flow.d.ts +8 -0
  306. package/dist/tui/features/vc/push/components/vc-push-flow.js +83 -0
  307. package/dist/tui/features/vc/remote/api/execute-vc-remote.d.ts +8 -0
  308. package/dist/tui/features/vc/remote/api/execute-vc-remote.js +13 -0
  309. package/dist/tui/features/vc/remote/components/vc-remote-flow.d.ts +9 -0
  310. package/dist/tui/features/vc/remote/components/vc-remote-flow.js +42 -0
  311. package/dist/tui/features/vc/reset/api/execute-vc-reset.d.ts +8 -0
  312. package/dist/tui/features/vc/reset/api/execute-vc-reset.js +13 -0
  313. package/dist/tui/features/vc/reset/components/vc-reset-flow.d.ts +10 -0
  314. package/dist/tui/features/vc/reset/components/vc-reset-flow.js +63 -0
  315. package/dist/tui/features/vc/status/api/execute-vc-status.d.ts +8 -0
  316. package/dist/tui/features/vc/status/api/execute-vc-status.js +13 -0
  317. package/dist/tui/features/vc/status/components/vc-status-flow.d.ts +10 -0
  318. package/dist/tui/features/vc/status/components/vc-status-flow.js +133 -0
  319. package/dist/tui/lib/environment.d.ts +8 -0
  320. package/dist/tui/lib/environment.js +8 -0
  321. package/dist/tui/utils/error-messages.d.ts +5 -1
  322. package/dist/tui/utils/error-messages.js +32 -3
  323. package/node_modules/@campfirein/brv-transport-client/LICENSE +95 -0
  324. package/node_modules/@campfirein/brv-transport-client/README.md +3 -4
  325. package/node_modules/@campfirein/brv-transport-client/package.json +2 -2
  326. package/oclif.manifest.json +985 -65
  327. package/package.json +13 -5
  328. package/dist/oclif/hooks/prerun/validate-brv-config-version.d.ts +0 -33
  329. package/dist/oclif/hooks/prerun/validate-brv-config-version.js +0 -86
  330. package/dist/server/core/domain/entities/bullet.d.ts +0 -51
  331. package/dist/server/core/domain/entities/bullet.js +0 -94
  332. package/dist/server/core/domain/entities/memory.d.ts +0 -55
  333. package/dist/server/core/domain/entities/memory.js +0 -90
  334. package/dist/server/core/domain/entities/playbook.d.ts +0 -80
  335. package/dist/server/core/domain/entities/playbook.js +0 -214
  336. package/dist/server/core/domain/entities/presigned-url.d.ts +0 -9
  337. package/dist/server/core/domain/entities/presigned-url.js +0 -18
  338. package/dist/server/core/domain/entities/presigned-urls-response.d.ts +0 -10
  339. package/dist/server/core/domain/entities/presigned-urls-response.js +0 -18
  340. package/dist/server/core/domain/entities/retrieve-result.d.ts +0 -35
  341. package/dist/server/core/domain/entities/retrieve-result.js +0 -35
  342. package/dist/server/core/domain/errors/headless-prompt-error.d.ts +0 -11
  343. package/dist/server/core/domain/errors/headless-prompt-error.js +0 -18
  344. package/dist/server/core/interfaces/services/i-legacy-rule-detector.d.ts +0 -56
  345. package/dist/server/core/interfaces/services/i-memory-retrieval-service.d.ts +0 -39
  346. package/dist/server/core/interfaces/services/i-memory-storage-service.d.ts +0 -53
  347. package/dist/server/core/interfaces/services/i-terminal.d.ts +0 -146
  348. package/dist/server/core/interfaces/services/i-terminal.js +0 -1
  349. package/dist/server/core/interfaces/services/i-workspace-detector-service.d.ts +0 -8
  350. package/dist/server/core/interfaces/services/i-workspace-detector-service.js +0 -1
  351. package/dist/server/core/interfaces/storage/i-onboarding-preference-store.d.ts +0 -20
  352. package/dist/server/core/interfaces/storage/i-onboarding-preference-store.js +0 -1
  353. package/dist/server/infra/connectors/rules/legacy-rule-detector.d.ts +0 -21
  354. package/dist/server/infra/connectors/rules/legacy-rule-detector.js +0 -106
  355. package/dist/server/infra/memory/http-memory-retrieval-service.d.ts +0 -18
  356. package/dist/server/infra/memory/http-memory-retrieval-service.js +0 -64
  357. package/dist/server/infra/memory/http-memory-storage-service.d.ts +0 -18
  358. package/dist/server/infra/memory/http-memory-storage-service.js +0 -72
  359. package/dist/server/infra/memory/memory-to-playbook-mapper.d.ts +0 -33
  360. package/dist/server/infra/memory/memory-to-playbook-mapper.js +0 -51
  361. package/dist/server/infra/storage/file-onboarding-preference-store.d.ts +0 -10
  362. package/dist/server/infra/storage/file-onboarding-preference-store.js +0 -45
  363. package/dist/server/infra/terminal/headless-terminal.d.ts +0 -91
  364. package/dist/server/infra/terminal/headless-terminal.js +0 -211
  365. package/dist/server/infra/workspace/workspace-detector-service.d.ts +0 -57
  366. package/dist/server/infra/workspace/workspace-detector-service.js +0 -165
  367. package/dist/server/utils/crash-log.d.ts +0 -14
  368. package/dist/server/utils/crash-log.js +0 -19
  369. package/dist/server/utils/emoji-helpers.d.ts +0 -38
  370. package/dist/server/utils/emoji-helpers.js +0 -42
  371. package/dist/server/utils/error-handler.d.ts +0 -51
  372. package/dist/server/utils/error-handler.js +0 -169
  373. package/dist/server/utils/oclif-error-helpers.d.ts +0 -40
  374. package/dist/server/utils/oclif-error-helpers.js +0 -46
  375. package/dist/server/utils/tool-display-formatter.d.ts +0 -53
  376. package/dist/server/utils/tool-display-formatter.js +0 -257
  377. package/dist/tui/components/init.d.ts +0 -33
  378. package/dist/tui/components/init.js +0 -234
  379. package/dist/tui/features/space/api/get-spaces.d.ts +0 -16
  380. package/dist/tui/features/space/api/get-spaces.js +0 -17
  381. package/dist/tui/features/space/api/switch-space.d.ts +0 -11
  382. package/dist/tui/features/space/api/switch-space.js +0 -24
  383. package/dist/tui/features/space/components/space-list-view.d.ts +0 -12
  384. package/dist/tui/features/space/components/space-list-view.js +0 -56
  385. package/dist/tui/features/space/components/space-switch-flow.d.ts +0 -13
  386. package/dist/tui/features/space/components/space-switch-flow.js +0 -97
  387. /package/dist/server/core/interfaces/services/{i-legacy-rule-detector.js → i-git-service.js} +0 -0
  388. /package/dist/server/core/interfaces/{services/i-memory-retrieval-service.js → storage/i-review-backup-store.js} +0 -0
  389. /package/dist/server/core/interfaces/{services/i-memory-storage-service.js → vc/i-vc-git-config-store.js} +0 -0
@@ -0,0 +1,9 @@
1
+ /**
2
+ * InitProjectPage
3
+ *
4
+ * Shown when .brv/ doesn't exist at cwd.
5
+ * Confirms with the user, then runs local init + vc init via daemon.
6
+ * On success, invalidates status cache → useAppViewMode transitions forward.
7
+ */
8
+ import React from 'react';
9
+ export declare function InitProjectPage(): React.ReactNode;
@@ -0,0 +1,54 @@
1
+ import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
+ /**
3
+ * InitProjectPage
4
+ *
5
+ * Shown when .brv/ doesn't exist at cwd.
6
+ * Confirms with the user, then runs local init + vc init via daemon.
7
+ * On success, invalidates status cache → useAppViewMode transitions forward.
8
+ */
9
+ import { useQueryClient } from '@tanstack/react-query';
10
+ import { Box, Text, useApp } from 'ink';
11
+ import Spinner from 'ink-spinner';
12
+ import { useCallback, useState } from 'react';
13
+ import { InitEvents } from '../../../shared/transport/events/init-events.js';
14
+ import { VcEvents } from '../../../shared/transport/events/vc-events.js';
15
+ import { EnterPrompt } from '../../components/enter-prompt.js';
16
+ import { getStatusQueryOptions } from '../../features/status/api/get-status.js';
17
+ import { useTheme } from '../../hooks/index.js';
18
+ import { useTransportStore } from '../../stores/transport-store.js';
19
+ import { MainLayout } from '../layouts/main-layout.js';
20
+ export function InitProjectPage() {
21
+ const queryClient = useQueryClient();
22
+ const { theme: { colors }, } = useTheme();
23
+ const [state, setState] = useState('confirm');
24
+ const { exit } = useApp();
25
+ const [error, setError] = useState();
26
+ const runInit = useCallback(async () => {
27
+ setState('running');
28
+ try {
29
+ const { apiClient } = useTransportStore.getState();
30
+ if (!apiClient)
31
+ throw new Error('Not connected to daemon');
32
+ // Step 1: Local init
33
+ await apiClient.request(InitEvents.LOCAL, { force: false });
34
+ // Step 2: VC init
35
+ await apiClient.request(VcEvents.INIT, {});
36
+ setState('done');
37
+ // Invalidate status so useAppViewMode re-evaluates and transitions
38
+ queryClient.invalidateQueries(getStatusQueryOptions());
39
+ }
40
+ catch (error_) {
41
+ setError(error_ instanceof Error ? error_.message : 'Initialization failed');
42
+ setState('error');
43
+ }
44
+ }, [queryClient]);
45
+ const handleConfirm = useCallback((confirmed) => {
46
+ if (confirmed) {
47
+ runInit();
48
+ }
49
+ else {
50
+ exit();
51
+ }
52
+ }, [exit, runInit]);
53
+ return (_jsx(MainLayout, { showInput: false, children: _jsxs(Box, { flexDirection: "column", paddingTop: 1, children: [state === 'confirm' && (_jsxs(Box, { flexDirection: "column", gap: 1, children: [_jsxs(Text, { color: colors.secondary, children: ["Project not initialized in ", process.cwd()] }), _jsx(EnterPrompt, { action: "initialize ByteRover here", onEnter: () => handleConfirm(true) })] })), state === 'running' && (_jsxs(Text, { color: colors.text, children: [_jsx(Spinner, { type: "dots" }), " Initializing project..."] })), state === 'error' && _jsx(Text, { color: colors.errorText, children: error })] }) }));
54
+ }
@@ -2,13 +2,21 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useAppViewMode } from '../../features/onboarding/hooks/use-app-view-mode.js';
3
3
  import { ConfigProviderPage } from './config-provider-page.js';
4
4
  import { HomePage } from './home-page.js';
5
+ // import {InitProjectPage} from './init-project-page.js'
5
6
  export function ProtectedRoutes() {
6
7
  const viewMode = useAppViewMode();
7
- if (viewMode.type === 'loading') {
8
- return null;
8
+ switch (viewMode.type) {
9
+ case 'config-provider': {
10
+ return _jsx(ConfigProviderPage, {});
11
+ }
12
+ // case 'init-project': {
13
+ // return <InitProjectPage />
14
+ // }
15
+ case 'loading': {
16
+ return null;
17
+ }
18
+ case 'ready': {
19
+ return _jsx(HomePage, {});
20
+ }
9
21
  }
10
- if (viewMode.type === 'config-provider') {
11
- return _jsx(ConfigProviderPage, {});
12
- }
13
- return _jsx(HomePage, {});
14
22
  }
@@ -11,8 +11,6 @@ export { EnterPrompt } from './enter-prompt.js';
11
11
  export { ExecutionChanges, ExecutionContent, ExecutionInput, ExecutionProgress, ExecutionStatus, ExpandedLogView, LogItem, truncateContent, } from './execution/index.js';
12
12
  export { Footer } from './footer.js';
13
13
  export { Header } from './header.js';
14
- export { Init } from './init.js';
15
- export type { InitProps } from './init.js';
16
14
  export { List } from './list.js';
17
15
  export { Logo } from './logo.js';
18
16
  export type { LogoVariant } from './logo.js';
@@ -9,7 +9,6 @@ export { EnterPrompt } from './enter-prompt.js';
9
9
  export { ExecutionChanges, ExecutionContent, ExecutionInput, ExecutionProgress, ExecutionStatus, ExpandedLogView, LogItem, truncateContent, } from './execution/index.js';
10
10
  export { Footer } from './footer.js';
11
11
  export { Header } from './header.js';
12
- export { Init } from './init.js';
13
12
  export { List } from './list.js';
14
13
  export { Logo } from './logo.js';
15
14
  export { Markdown } from './markdown.js';
@@ -185,9 +185,15 @@ export function useActivityLogs() {
185
185
  toolCallName: tc.toolName,
186
186
  }));
187
187
  const changes = composeChangesFromToolCalls(task.toolCalls);
188
+ let content = task.status === 'error' ? formatTaskError(task.error) : (task.result ?? '');
189
+ if (task.reviewNotification) {
190
+ const { pendingCount, reviewUrl } = task.reviewNotification;
191
+ const fileLabel = pendingCount === 1 ? 'file needs' : 'files need';
192
+ content += `\n\n⚠ ${pendingCount} ${fileLabel} review: ${reviewUrl}`;
193
+ }
188
194
  const activityLog = {
189
195
  changes,
190
- content: task.status === 'error' ? formatTaskError(task.error) : (task.result ?? ''),
196
+ content,
191
197
  files: task.files,
192
198
  folders: task.folders,
193
199
  id: task.taskId,
@@ -14,6 +14,7 @@ import { queryCommand } from './query.js';
14
14
  import { resetCommand } from './reset.js';
15
15
  import { spaceCommand } from './space.js';
16
16
  import { statusCommand } from './status.js';
17
+ import { vcCommand } from './vc.js';
17
18
  /**
18
19
  * Load all REPL slash commands.
19
20
  *
@@ -38,6 +39,8 @@ export const load = () => [
38
39
  modelCommand,
39
40
  // Space management
40
41
  spaceCommand,
42
+ // Git semantic (vc commands)
43
+ vcCommand,
41
44
  // Context tree management
42
45
  resetCommand,
43
46
  // Session management
@@ -1,22 +1,13 @@
1
- import React from 'react';
2
- import { SpaceListView } from '../../space/components/space-list-view.js';
3
- import { Flags, parseReplArgs, toCommandFlags } from '../utils/arg-parser.js';
4
- const listFlags = {
5
- json: Flags.boolean({
6
- char: 'j',
7
- default: false,
8
- description: 'Output in JSON format',
9
- }),
10
- };
1
+ import { getStatus } from '../../status/api/get-status.js';
11
2
  export const spaceListCommand = {
12
- async action(_context, args) {
13
- const parsed = await parseReplArgs(args, { flags: listFlags, strict: false });
14
- const json = parsed.flags.json ?? false;
15
- return {
16
- render: ({ onCancel, onComplete }) => React.createElement(SpaceListView, { json, onCancel, onComplete }),
17
- };
3
+ async action() {
4
+ const { status } = await getStatus();
5
+ const isVc = status.contextTreeStatus === 'git_vc';
6
+ const content = isVc
7
+ ? 'The space list command has been deprecated. Visit the ByteRover web dashboard to view your spaces.'
8
+ : 'The space list command has been deprecated. Visit the ByteRover web dashboard to view your spaces and follow the migration guide to version control.';
9
+ return { content, messageType: 'error', type: 'message' };
18
10
  },
19
- description: 'List all spaces for the current team',
20
- flags: toCommandFlags(listFlags),
11
+ description: 'List all spaces (deprecated)',
21
12
  name: 'list',
22
13
  };
@@ -1,9 +1,13 @@
1
- import React from 'react';
2
- import { SpaceSwitchFlow } from '../../space/components/space-switch-flow.js';
1
+ import { getStatus } from '../../status/api/get-status.js';
3
2
  export const spaceSwitchCommand = {
4
- action: () => ({
5
- render: ({ onCancel, onComplete }) => React.createElement(SpaceSwitchFlow, { onCancel, onComplete }),
6
- }),
7
- description: 'Switch to a different space',
3
+ async action() {
4
+ const { status } = await getStatus();
5
+ const isVc = status.contextTreeStatus === 'git_vc';
6
+ const content = isVc
7
+ ? 'The space switch command has been deprecated. To work with a different space, use: brv vc clone <url>'
8
+ : 'The space switch command has been deprecated. Visit the ByteRover web dashboard to follow the migration guide from snapshot to version control.';
9
+ return { content, messageType: 'error', type: 'message' };
10
+ },
11
+ description: 'Switch to a different space (deprecated)',
8
12
  name: 'switch',
9
13
  };
@@ -0,0 +1,2 @@
1
+ import type { SlashCommand } from '../../../types/commands.js';
2
+ export declare const vcAddSubCommand: SlashCommand;
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import { VcAddFlow } from '../../vc/add/components/vc-add-flow.js';
3
+ import { parseReplArgs } from '../utils/arg-parser.js';
4
+ export const vcAddSubCommand = {
5
+ async action(_context, rawArgs) {
6
+ const parsed = await parseReplArgs(rawArgs, { strict: false });
7
+ // argv contains all non-flag tokens; default to '.' like git add .
8
+ const filePaths = parsed.argv.length > 0 ? parsed.argv : ['.'];
9
+ return {
10
+ render: ({ onCancel, onComplete }) => React.createElement(VcAddFlow, { filePaths, onCancel, onComplete }),
11
+ };
12
+ },
13
+ description: 'Stage files for the next commit',
14
+ name: 'add',
15
+ };
@@ -0,0 +1,2 @@
1
+ import type { SlashCommand } from '../../../types/commands.js';
2
+ export declare const vcBranchSubCommand: SlashCommand;
@@ -0,0 +1,33 @@
1
+ import React from 'react';
2
+ import { VcBranchFlow } from '../../vc/branch/components/vc-branch-flow.js';
3
+ import { Args, Flags, parseReplArgs, toCommandFlags } from '../utils/arg-parser.js';
4
+ const vcBranchArgs = {
5
+ name: Args.string({ description: 'Branch name to create' }),
6
+ };
7
+ const vcBranchFlags = {
8
+ all: Flags.boolean({ char: 'a', default: false, description: 'List all branches including remote-tracking' }),
9
+ delete: Flags.string({ char: 'd', description: 'Delete a branch by name' }),
10
+ 'set-upstream-to': Flags.string({ description: 'Set upstream tracking (e.g. origin/main)' }),
11
+ };
12
+ function resolveRequest(parsed) {
13
+ if (parsed.flags['set-upstream-to'])
14
+ return { action: 'set-upstream', upstream: parsed.flags['set-upstream-to'] };
15
+ if (parsed.flags.delete)
16
+ return { action: 'delete', name: parsed.flags.delete };
17
+ if (parsed.args.name)
18
+ return { action: 'create', name: parsed.args.name };
19
+ return { action: 'list', all: parsed.flags.all };
20
+ }
21
+ export const vcBranchSubCommand = {
22
+ async action(_context, rawArgs) {
23
+ const parsed = await parseReplArgs(rawArgs, { args: vcBranchArgs, flags: vcBranchFlags, strict: false });
24
+ const request = resolveRequest(parsed);
25
+ return {
26
+ render: ({ onCancel, onComplete }) => React.createElement(VcBranchFlow, { onCancel, onComplete, request }),
27
+ };
28
+ },
29
+ args: [{ description: 'Branch name to create', name: 'name' }],
30
+ description: 'List, create, or delete local branches',
31
+ flags: toCommandFlags(vcBranchFlags),
32
+ name: 'branch',
33
+ };
@@ -0,0 +1,2 @@
1
+ import type { SlashCommand } from '../../../types/commands.js';
2
+ export declare const vcCheckoutSubCommand: SlashCommand;
@@ -0,0 +1,32 @@
1
+ import React from 'react';
2
+ import { VcCheckoutFlow } from '../../vc/checkout/components/vc-checkout-flow.js';
3
+ import { Args, Flags, parseReplArgs, toCommandFlags } from '../utils/arg-parser.js';
4
+ const vcCheckoutArgs = {
5
+ branch: Args.string({ description: 'Branch to switch to', required: true }),
6
+ };
7
+ const vcCheckoutFlags = {
8
+ create: Flags.boolean({ char: 'b', default: false, description: 'Create a new branch and switch to it' }),
9
+ force: Flags.boolean({ default: false, description: 'Discard local changes and switch' }),
10
+ };
11
+ function resolveRequest(parsed) {
12
+ if (!parsed.args.branch)
13
+ throw new Error('Branch name is required.');
14
+ return {
15
+ branch: parsed.args.branch,
16
+ create: parsed.flags.create,
17
+ force: parsed.flags.force,
18
+ };
19
+ }
20
+ export const vcCheckoutSubCommand = {
21
+ async action(_context, rawArgs) {
22
+ const parsed = await parseReplArgs(rawArgs, { args: vcCheckoutArgs, flags: vcCheckoutFlags, strict: false });
23
+ const request = resolveRequest(parsed);
24
+ return {
25
+ render: ({ onCancel, onComplete }) => React.createElement(VcCheckoutFlow, { onCancel, onComplete, request }),
26
+ };
27
+ },
28
+ args: [{ description: 'Branch to switch to', name: 'branch', required: true }],
29
+ description: 'Switch to an existing branch, or create and switch with -b',
30
+ flags: toCommandFlags(vcCheckoutFlags),
31
+ name: 'checkout',
32
+ };
@@ -0,0 +1,2 @@
1
+ import type { SlashCommand } from '../../../types/commands.js';
2
+ export declare const vcCloneSubCommand: SlashCommand;
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ import { VcCloneFlow } from '../../vc/clone/components/vc-clone-flow.js';
3
+ import { Args, parseReplArgs } from '../utils/arg-parser.js';
4
+ const vcCloneArgs = {
5
+ url: Args.string({ description: 'Clone URL (optional — prompts for URL if omitted)' }),
6
+ };
7
+ export const vcCloneSubCommand = {
8
+ async action(_context, rawArgs) {
9
+ const parsed = await parseReplArgs(rawArgs, { args: vcCloneArgs, strict: false });
10
+ const { url } = parsed.args;
11
+ return {
12
+ render: ({ onCancel, onComplete }) => React.createElement(VcCloneFlow, { onCancel, onComplete, url }),
13
+ };
14
+ },
15
+ args: [{ description: 'Clone URL (optional)', name: 'url' }],
16
+ description: 'Clone a ByteRover space repository',
17
+ name: 'clone',
18
+ };
@@ -0,0 +1,2 @@
1
+ import type { SlashCommand } from '../../../types/commands.js';
2
+ export declare const vcCommitSubCommand: SlashCommand;
@@ -0,0 +1,32 @@
1
+ import React from 'react';
2
+ import { VcCommitFlow } from '../../vc/commit/components/vc-commit-flow.js';
3
+ import { Flags, parseReplArgs, toCommandFlags } from '../utils/arg-parser.js';
4
+ const vcCommitFlags = {
5
+ message: Flags.string({ char: 'm', description: 'Commit message' }),
6
+ };
7
+ export const vcCommitSubCommand = {
8
+ async action(_context, rawArgs) {
9
+ const parsed = await parseReplArgs(rawArgs, { flags: vcCommitFlags, strict: false });
10
+ // Join remaining argv with the flag value to support unquoted multi-word messages
11
+ // e.g. /vc commit -m hello world → message = "hello world"
12
+ // e.g. /vc commit hello world → message = "hello world"
13
+ const extra = parsed.argv.join(' ');
14
+ const message = parsed.flags.message
15
+ ? (extra ? `${parsed.flags.message} ${extra}` : parsed.flags.message)
16
+ : (extra || undefined);
17
+ if (!message) {
18
+ const errorMsg = {
19
+ content: 'Usage: /vc commit -m "<message>"',
20
+ messageType: 'error',
21
+ type: 'message',
22
+ };
23
+ return errorMsg;
24
+ }
25
+ return {
26
+ render: ({ onCancel, onComplete }) => React.createElement(VcCommitFlow, { message, onCancel, onComplete }),
27
+ };
28
+ },
29
+ description: 'Save staged changes as a commit',
30
+ flags: toCommandFlags(vcCommitFlags),
31
+ name: 'commit',
32
+ };
@@ -0,0 +1,2 @@
1
+ import type { SlashCommand } from '../../../types/commands.js';
2
+ export declare const vcConfigSubCommand: SlashCommand;
@@ -0,0 +1,40 @@
1
+ import React from 'react';
2
+ import { isVcConfigKey } from '../../../../shared/transport/events/vc-events.js';
3
+ import { VcConfigFlow } from '../../vc/config/components/vc-config-flow.js';
4
+ import { Args, parseReplArgs } from '../utils/arg-parser.js';
5
+ const vcConfigArgs = {
6
+ key: Args.string({ description: 'Config key (user.name or user.email)' }),
7
+ value: Args.string({ description: 'Config value to set (omit to get current value)' }),
8
+ };
9
+ export const vcConfigSubCommand = {
10
+ async action(_context, rawArgs) {
11
+ const parsed = await parseReplArgs(rawArgs, { args: vcConfigArgs, strict: false });
12
+ const { key } = parsed.args;
13
+ const { value } = parsed.args;
14
+ if (!key) {
15
+ const errorMsg = {
16
+ content: 'Usage: /vc config user.name "<value>" | /vc config user.email "<value>"',
17
+ messageType: 'error',
18
+ type: 'message',
19
+ };
20
+ return errorMsg;
21
+ }
22
+ if (!isVcConfigKey(key)) {
23
+ const errorMsg = {
24
+ content: `Unknown key '${key}'. Allowed: user.name, user.email.`,
25
+ messageType: 'error',
26
+ type: 'message',
27
+ };
28
+ return errorMsg;
29
+ }
30
+ return {
31
+ render: ({ onCancel, onComplete }) => React.createElement(VcConfigFlow, { configKey: key, onCancel, onComplete, value }),
32
+ };
33
+ },
34
+ args: [
35
+ { description: 'Config key (user.name or user.email)', name: 'key' },
36
+ { description: 'Value to set (omit to read current value)', name: 'value' },
37
+ ],
38
+ description: 'Get or set commit author for ByteRover version control',
39
+ name: 'config',
40
+ };
@@ -0,0 +1,2 @@
1
+ import type { SlashCommand } from '../../../types/commands.js';
2
+ export declare const vcFetchSubCommand: SlashCommand;
@@ -0,0 +1,37 @@
1
+ import React from 'react';
2
+ import { VcFetchFlow } from '../../vc/fetch/components/vc-fetch-flow.js';
3
+ import { Args, parseReplArgs } from '../utils/arg-parser.js';
4
+ /* eslint-disable perfectionist/sort-objects -- positional order matters: remote before branch */
5
+ const vcFetchArgs = {
6
+ remote: Args.string({ description: 'Remote name (only origin supported)' }),
7
+ branch: Args.string({ description: 'Branch to fetch' }),
8
+ };
9
+ /* eslint-enable perfectionist/sort-objects */
10
+ export const vcFetchSubCommand = {
11
+ async action(_context, rawArgs) {
12
+ const parsed = await parseReplArgs(rawArgs, { args: vcFetchArgs, strict: false });
13
+ const { branch, remote } = parsed.args;
14
+ if (remote && remote !== 'origin') {
15
+ const errorMsg = {
16
+ content: `Only 'origin' remote is currently supported.`,
17
+ messageType: 'error',
18
+ type: 'message',
19
+ };
20
+ return errorMsg;
21
+ }
22
+ return {
23
+ render: ({ onCancel, onComplete }) => React.createElement(VcFetchFlow, {
24
+ onCancel,
25
+ onComplete,
26
+ ref: branch,
27
+ remote,
28
+ }),
29
+ };
30
+ },
31
+ args: [
32
+ { description: 'Remote name (only origin supported)', name: 'remote', required: false },
33
+ { description: 'Branch to fetch', name: 'branch', required: false },
34
+ ],
35
+ description: 'Fetch refs from ByteRover cloud',
36
+ name: 'fetch',
37
+ };
@@ -0,0 +1,2 @@
1
+ import type { SlashCommand } from '../../../types/commands.js';
2
+ export declare const vcInitSubCommand: SlashCommand;
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import { VcInitFlow } from '../../vc/init/components/vc-init-flow.js';
3
+ export const vcInitSubCommand = {
4
+ action() {
5
+ return {
6
+ render: ({ onCancel, onComplete }) => React.createElement(VcInitFlow, { onCancel, onComplete }),
7
+ };
8
+ },
9
+ description: 'Initialize ByteRover version control for context tree',
10
+ name: 'init',
11
+ };
@@ -0,0 +1,2 @@
1
+ import type { SlashCommand } from '../../../types/commands.js';
2
+ export declare const vcLogSubCommand: SlashCommand;
@@ -0,0 +1,25 @@
1
+ import React from 'react';
2
+ import { LogFlow } from '../../log/components/log-flow.js';
3
+ import { Args, Flags, parseReplArgs, toCommandFlags } from '../utils/arg-parser.js';
4
+ const vcLogArgs = {
5
+ branch: Args.string({ description: 'Branch name to show history for' }),
6
+ };
7
+ const vcLogFlags = {
8
+ all: Flags.boolean({ char: 'a', default: false, description: 'Show commits from all branches' }),
9
+ limit: Flags.string({ default: '10', description: 'Number of commits to show (default: 10)' }),
10
+ };
11
+ export const vcLogSubCommand = {
12
+ async action(_context, args) {
13
+ const parsed = await parseReplArgs(args, { args: vcLogArgs, flags: vcLogFlags, strict: false });
14
+ const limit = Number(parsed.flags.limit ?? '10');
15
+ const all = parsed.flags.all ?? false;
16
+ const { branch } = parsed.args;
17
+ return {
18
+ render: ({ onCancel, onComplete }) => React.createElement(LogFlow, { all, branch, limit, onCancel, onComplete }),
19
+ };
20
+ },
21
+ args: [{ description: 'Branch name to show history for', name: 'branch' }],
22
+ description: 'Show commit history for the context-tree',
23
+ flags: toCommandFlags(vcLogFlags),
24
+ name: 'log',
25
+ };
@@ -0,0 +1,2 @@
1
+ import type { SlashCommand } from '../../../types/commands.js';
2
+ export declare const vcMergeSubCommand: SlashCommand;
@@ -0,0 +1,48 @@
1
+ import React from 'react';
2
+ import { VcMergeFlow } from '../../vc/merge/components/vc-merge-flow.js';
3
+ import { Flags, parseReplArgs, toCommandFlags } from '../utils/arg-parser.js';
4
+ const vcMergeFlags = {
5
+ abort: Flags.boolean({ description: 'Abort the current merge', exclusive: ['continue'] }),
6
+ 'allow-unrelated-histories': Flags.boolean({ default: false, description: 'Allow merging unrelated histories' }),
7
+ continue: Flags.boolean({ description: 'Continue after resolving conflicts', exclusive: ['abort'] }),
8
+ message: Flags.string({ char: 'm', description: 'Merge commit message' }),
9
+ };
10
+ export const vcMergeSubCommand = {
11
+ async action(_context, rawArgs) {
12
+ const parsed = await parseReplArgs(rawArgs, { flags: vcMergeFlags, strict: false });
13
+ const { abort, continue: cont, message } = parsed.flags;
14
+ const branch = parsed.argv[0];
15
+ if (abort) {
16
+ return {
17
+ render: ({ onCancel, onComplete }) => React.createElement(VcMergeFlow, { action: 'abort', onCancel, onComplete }),
18
+ };
19
+ }
20
+ if (cont) {
21
+ return {
22
+ render: ({ onCancel, onComplete }) => React.createElement(VcMergeFlow, { action: 'continue', message, onCancel, onComplete }),
23
+ };
24
+ }
25
+ if (!branch) {
26
+ const errorMsg = {
27
+ content: 'Usage: /vc merge <branch> | --abort | --continue',
28
+ messageType: 'error',
29
+ type: 'message',
30
+ };
31
+ return errorMsg;
32
+ }
33
+ return {
34
+ render: ({ onCancel, onComplete }) => React.createElement(VcMergeFlow, {
35
+ action: 'merge',
36
+ allowUnrelatedHistories: parsed.flags['allow-unrelated-histories'],
37
+ branch,
38
+ message,
39
+ onCancel,
40
+ onComplete,
41
+ }),
42
+ };
43
+ },
44
+ args: [{ description: 'Branch to merge', name: 'branch', required: false }],
45
+ description: 'Merge a branch into the current branch',
46
+ flags: toCommandFlags(vcMergeFlags),
47
+ name: 'merge',
48
+ };
@@ -0,0 +1,2 @@
1
+ import type { SlashCommand } from '../../../types/commands.js';
2
+ export declare const vcPullSubCommand: SlashCommand;
@@ -0,0 +1,42 @@
1
+ import React from 'react';
2
+ import { VcPullFlow } from '../../vc/pull/components/vc-pull-flow.js';
3
+ import { Args, Flags, parseReplArgs, toCommandFlags } from '../utils/arg-parser.js';
4
+ /* eslint-disable perfectionist/sort-objects -- positional order matters: remote before branch */
5
+ const vcPullArgs = {
6
+ remote: Args.string({ description: 'Remote name (only origin supported)' }),
7
+ branch: Args.string({ description: 'Branch to pull' }),
8
+ };
9
+ /* eslint-enable perfectionist/sort-objects */
10
+ const vcPullFlags = {
11
+ 'allow-unrelated-histories': Flags.boolean({ default: false, description: 'Allow merging unrelated histories' }),
12
+ };
13
+ export const vcPullSubCommand = {
14
+ async action(_context, rawArgs) {
15
+ const parsed = await parseReplArgs(rawArgs, { args: vcPullArgs, flags: vcPullFlags, strict: false });
16
+ const { branch, remote } = parsed.args;
17
+ if (remote && remote !== 'origin') {
18
+ const errorMsg = {
19
+ content: `Only 'origin' remote is currently supported.`,
20
+ messageType: 'error',
21
+ type: 'message',
22
+ };
23
+ return errorMsg;
24
+ }
25
+ return {
26
+ render: ({ onCancel, onComplete }) => React.createElement(VcPullFlow, {
27
+ allowUnrelatedHistories: parsed.flags['allow-unrelated-histories'],
28
+ branch,
29
+ onCancel,
30
+ onComplete,
31
+ remote,
32
+ }),
33
+ };
34
+ },
35
+ args: [
36
+ { description: 'Remote name (only origin supported)', name: 'remote', required: false },
37
+ { description: 'Branch to pull', name: 'branch', required: false },
38
+ ],
39
+ description: 'Pull commits from ByteRover cloud',
40
+ flags: toCommandFlags(vcPullFlags),
41
+ name: 'pull',
42
+ };
@@ -0,0 +1,2 @@
1
+ import type { SlashCommand } from '../../../types/commands.js';
2
+ export declare const vcPushSubCommand: SlashCommand;
@@ -0,0 +1,38 @@
1
+ import React from 'react';
2
+ import { VcPushFlow } from '../../vc/push/components/vc-push-flow.js';
3
+ import { Flags, parseReplArgs, toCommandFlags } from '../utils/arg-parser.js';
4
+ const vcPushFlags = {
5
+ 'set-upstream': Flags.boolean({ char: 'u', description: 'Set upstream tracking branch' }),
6
+ };
7
+ export const vcPushSubCommand = {
8
+ async action(_context, rawArgs) {
9
+ const parsed = await parseReplArgs(rawArgs, { flags: vcPushFlags, strict: false });
10
+ const { 'set-upstream': setUpstream } = parsed.flags;
11
+ const positional = parsed.argv ?? [];
12
+ // Git push semantics: push [<remote> [<branch>]]
13
+ // /vc push → current branch
14
+ // /vc push origin → current branch (explicit remote)
15
+ // /vc push origin feat/x → feat/x
16
+ // /vc push feat/x → error (unknown remote)
17
+ let branch;
18
+ if (positional.length >= 2) {
19
+ if (positional[0] !== 'origin') {
20
+ throw new Error(`Unknown remote '${positional[0]}'.`);
21
+ }
22
+ branch = positional[1];
23
+ }
24
+ else if (positional.length === 1 && positional[0] !== 'origin') {
25
+ throw new Error(`Unknown remote '${positional[0]}'. Use '/vc push origin ${positional[0]}' to push a specific branch.`);
26
+ }
27
+ return {
28
+ render: ({ onCancel, onComplete }) => React.createElement(VcPushFlow, { branch, onCancel, onComplete, setUpstream }),
29
+ };
30
+ },
31
+ args: [
32
+ { description: 'Remote name (e.g. origin)', name: 'remote', required: false },
33
+ { description: 'Branch to push to', name: 'branch', required: false },
34
+ ],
35
+ description: 'Push commits to ByteRover cloud',
36
+ flags: toCommandFlags(vcPushFlags),
37
+ name: 'push',
38
+ };