byterover-cli 2.6.0 → 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 (316) hide show
  1. package/.env.production +1 -0
  2. package/README.md +240 -14
  3. package/dist/agent/core/domain/knowledge/conflict-detector.d.ts +38 -0
  4. package/dist/agent/core/domain/knowledge/conflict-detector.js +71 -0
  5. package/dist/agent/core/domain/knowledge/conflict-resolver.d.ts +17 -0
  6. package/dist/agent/core/domain/knowledge/conflict-resolver.js +118 -0
  7. package/dist/agent/core/domain/knowledge/utils.d.ts +4 -0
  8. package/dist/agent/core/domain/knowledge/utils.js +6 -0
  9. package/dist/agent/core/interfaces/i-curate-service.d.ts +6 -0
  10. package/dist/agent/infra/tools/implementations/curate-tool.d.ts +67 -34
  11. package/dist/agent/infra/tools/implementations/curate-tool.js +294 -47
  12. package/dist/agent/resources/prompts/system-prompt.yml +15 -8
  13. package/dist/agent/resources/tools/code_exec.txt +3 -0
  14. package/dist/agent/resources/tools/curate.txt +12 -3
  15. package/dist/oclif/commands/connectors/install.d.ts +2 -1
  16. package/dist/oclif/commands/connectors/install.js +38 -3
  17. package/dist/oclif/commands/curate/index.d.ts +18 -0
  18. package/dist/oclif/commands/curate/index.js +78 -1
  19. package/dist/oclif/commands/init.d.ts +12 -0
  20. package/dist/oclif/commands/init.js +75 -0
  21. package/dist/oclif/commands/locations.js +1 -1
  22. package/dist/oclif/commands/providers/connect.d.ts +31 -1
  23. package/dist/oclif/commands/providers/connect.js +307 -27
  24. package/dist/oclif/commands/pull.d.ts +1 -0
  25. package/dist/oclif/commands/pull.js +7 -0
  26. package/dist/oclif/commands/push.d.ts +1 -0
  27. package/dist/oclif/commands/push.js +8 -0
  28. package/dist/oclif/commands/review/approve.d.ts +17 -0
  29. package/dist/oclif/commands/review/approve.js +37 -0
  30. package/dist/oclif/commands/review/base-review-decision.d.ts +18 -0
  31. package/dist/oclif/commands/review/base-review-decision.js +71 -0
  32. package/dist/oclif/commands/review/pending.d.ts +13 -0
  33. package/dist/oclif/commands/review/pending.js +94 -0
  34. package/dist/oclif/commands/review/reject.d.ts +17 -0
  35. package/dist/oclif/commands/review/reject.js +38 -0
  36. package/dist/oclif/commands/space/list.d.ts +2 -2
  37. package/dist/oclif/commands/space/list.js +13 -35
  38. package/dist/oclif/commands/space/switch.d.ts +2 -7
  39. package/dist/oclif/commands/space/switch.js +13 -56
  40. package/dist/oclif/commands/status.d.ts +1 -0
  41. package/dist/oclif/commands/status.js +11 -1
  42. package/dist/oclif/commands/vc/add.d.ts +7 -0
  43. package/dist/oclif/commands/vc/add.js +29 -0
  44. package/dist/oclif/commands/vc/branch.d.ts +15 -0
  45. package/dist/oclif/commands/vc/branch.js +70 -0
  46. package/dist/oclif/commands/vc/checkout.d.ts +14 -0
  47. package/dist/oclif/commands/vc/checkout.js +47 -0
  48. package/dist/oclif/commands/vc/clone.d.ts +9 -0
  49. package/dist/oclif/commands/vc/clone.js +61 -0
  50. package/dist/oclif/commands/vc/commit.d.ts +10 -0
  51. package/dist/oclif/commands/vc/commit.js +32 -0
  52. package/dist/oclif/commands/vc/config.d.ts +10 -0
  53. package/dist/oclif/commands/vc/config.js +30 -0
  54. package/dist/oclif/commands/vc/fetch.d.ts +10 -0
  55. package/dist/oclif/commands/vc/fetch.js +42 -0
  56. package/dist/oclif/commands/vc/index.d.ts +6 -0
  57. package/dist/oclif/commands/vc/index.js +8 -0
  58. package/dist/oclif/commands/vc/init.d.ts +6 -0
  59. package/dist/oclif/commands/vc/init.js +25 -0
  60. package/dist/oclif/commands/vc/log.d.ts +13 -0
  61. package/dist/oclif/commands/vc/log.js +48 -0
  62. package/dist/oclif/commands/vc/merge.d.ts +19 -0
  63. package/dist/oclif/commands/vc/merge.js +130 -0
  64. package/dist/oclif/commands/vc/pull.d.ts +13 -0
  65. package/dist/oclif/commands/vc/pull.js +60 -0
  66. package/dist/oclif/commands/vc/push.d.ts +13 -0
  67. package/dist/oclif/commands/vc/push.js +60 -0
  68. package/dist/oclif/commands/vc/remote/add.d.ts +10 -0
  69. package/dist/oclif/commands/vc/remote/add.js +30 -0
  70. package/dist/oclif/commands/vc/remote/index.d.ts +6 -0
  71. package/dist/oclif/commands/vc/remote/index.js +16 -0
  72. package/dist/oclif/commands/vc/remote/set-url.d.ts +10 -0
  73. package/dist/oclif/commands/vc/remote/set-url.js +30 -0
  74. package/dist/oclif/commands/vc/reset.d.ts +13 -0
  75. package/dist/oclif/commands/vc/reset.js +62 -0
  76. package/dist/oclif/commands/vc/status.d.ts +8 -0
  77. package/dist/oclif/commands/vc/status.js +106 -0
  78. package/dist/oclif/hooks/init/validate-brv-config.d.ts +26 -0
  79. package/dist/oclif/hooks/init/validate-brv-config.js +62 -0
  80. package/dist/oclif/lib/daemon-client.d.ts +2 -0
  81. package/dist/oclif/lib/daemon-client.js +36 -10
  82. package/dist/oclif/lib/prompt-utils.d.ts +43 -0
  83. package/dist/oclif/lib/prompt-utils.js +84 -0
  84. package/dist/oclif/lib/spinner.d.ts +8 -0
  85. package/dist/oclif/lib/spinner.js +23 -0
  86. package/dist/oclif/lib/task-client.d.ts +5 -0
  87. package/dist/oclif/lib/task-client.js +15 -2
  88. package/dist/server/config/environment.d.ts +2 -0
  89. package/dist/server/config/environment.js +2 -0
  90. package/dist/server/constants.d.ts +3 -0
  91. package/dist/server/constants.js +9 -0
  92. package/dist/server/core/domain/entities/auth-token.d.ts +2 -0
  93. package/dist/server/core/domain/entities/auth-token.js +7 -1
  94. package/dist/server/core/domain/entities/curate-log-entry.d.ts +11 -0
  95. package/dist/server/core/domain/entities/space.d.ts +4 -0
  96. package/dist/server/core/domain/entities/space.js +8 -0
  97. package/dist/server/core/domain/entities/team.d.ts +2 -0
  98. package/dist/server/core/domain/entities/team.js +4 -0
  99. package/dist/server/core/domain/errors/git-error.d.ts +6 -0
  100. package/dist/server/core/domain/errors/git-error.js +12 -0
  101. package/dist/server/core/domain/errors/task-error.d.ts +4 -0
  102. package/dist/server/core/domain/errors/task-error.js +8 -0
  103. package/dist/server/core/domain/errors/vc-error.d.ts +5 -0
  104. package/dist/server/core/domain/errors/vc-error.js +8 -0
  105. package/dist/server/core/domain/knowledge/markdown-writer.d.ts +4 -1
  106. package/dist/server/core/domain/knowledge/markdown-writer.js +37 -7
  107. package/dist/server/core/domain/transport/schemas.d.ts +6 -6
  108. package/dist/server/core/interfaces/context-tree/i-context-tree-service.d.ts +11 -0
  109. package/dist/server/core/interfaces/process/i-task-lifecycle-hook.d.ts +6 -0
  110. package/dist/server/core/interfaces/services/i-git-service.d.ts +234 -0
  111. package/dist/server/core/interfaces/services/i-git-service.js +1 -0
  112. package/dist/server/core/interfaces/storage/i-curate-log-store.d.ts +5 -0
  113. package/dist/server/core/interfaces/storage/i-review-backup-store.d.ts +19 -0
  114. package/dist/server/core/interfaces/storage/i-review-backup-store.js +1 -0
  115. package/dist/server/core/interfaces/vc/i-vc-git-config-store.d.ts +8 -0
  116. package/dist/server/core/interfaces/vc/i-vc-git-config-store.js +1 -0
  117. package/dist/server/infra/config/auto-init.d.ts +0 -2
  118. package/dist/server/infra/config/auto-init.js +0 -1
  119. package/dist/server/infra/context-tree/file-context-tree-service.d.ts +2 -0
  120. package/dist/server/infra/context-tree/file-context-tree-service.js +13 -0
  121. package/dist/server/infra/daemon/brv-server.js +23 -3
  122. package/dist/server/infra/git/cogit-url.d.ts +17 -0
  123. package/dist/server/infra/git/cogit-url.js +39 -0
  124. package/dist/server/infra/git/git-http-wrapper.d.ts +20 -0
  125. package/dist/server/infra/git/git-http-wrapper.js +334 -0
  126. package/dist/server/infra/git/isomorphic-git-service.d.ts +78 -0
  127. package/dist/server/infra/git/isomorphic-git-service.js +983 -0
  128. package/dist/server/infra/http/review-api-handler.d.ts +13 -0
  129. package/dist/server/infra/http/review-api-handler.js +286 -0
  130. package/dist/server/infra/http/review-ui.d.ts +7 -0
  131. package/dist/server/infra/http/review-ui.js +606 -0
  132. package/dist/server/infra/mcp/tools/brv-curate-tool.d.ts +2 -2
  133. package/dist/server/infra/process/curate-log-handler.d.ts +18 -2
  134. package/dist/server/infra/process/curate-log-handler.js +50 -13
  135. package/dist/server/infra/process/feature-handlers.js +41 -1
  136. package/dist/server/infra/process/task-router.js +16 -0
  137. package/dist/server/infra/space/http-space-service.js +2 -0
  138. package/dist/server/infra/storage/file-curate-log-store.d.ts +10 -0
  139. package/dist/server/infra/storage/file-curate-log-store.js +35 -0
  140. package/dist/server/infra/storage/file-review-backup-store.d.ts +29 -0
  141. package/dist/server/infra/storage/file-review-backup-store.js +121 -0
  142. package/dist/server/infra/transport/handlers/auth-handler.js +9 -5
  143. package/dist/server/infra/transport/handlers/handler-types.d.ts +9 -0
  144. package/dist/server/infra/transport/handlers/handler-types.js +11 -0
  145. package/dist/server/infra/transport/handlers/index.d.ts +4 -0
  146. package/dist/server/infra/transport/handlers/index.js +2 -0
  147. package/dist/server/infra/transport/handlers/init-handler.d.ts +1 -0
  148. package/dist/server/infra/transport/handlers/init-handler.js +13 -1
  149. package/dist/server/infra/transport/handlers/pull-handler.d.ts +3 -0
  150. package/dist/server/infra/transport/handlers/pull-handler.js +5 -1
  151. package/dist/server/infra/transport/handlers/push-handler.d.ts +20 -0
  152. package/dist/server/infra/transport/handlers/push-handler.js +116 -14
  153. package/dist/server/infra/transport/handlers/reset-handler.d.ts +11 -0
  154. package/dist/server/infra/transport/handlers/reset-handler.js +37 -1
  155. package/dist/server/infra/transport/handlers/review-handler.d.ts +35 -0
  156. package/dist/server/infra/transport/handlers/review-handler.js +162 -0
  157. package/dist/server/infra/transport/handlers/space-handler.d.ts +3 -0
  158. package/dist/server/infra/transport/handlers/space-handler.js +4 -1
  159. package/dist/server/infra/transport/handlers/status-handler.d.ts +5 -0
  160. package/dist/server/infra/transport/handlers/status-handler.js +51 -16
  161. package/dist/server/infra/transport/handlers/vc-handler.d.ts +100 -0
  162. package/dist/server/infra/transport/handlers/vc-handler.js +1050 -0
  163. package/dist/server/infra/transport/socket-io-transport-server.d.ts +7 -0
  164. package/dist/server/infra/transport/socket-io-transport-server.js +12 -1
  165. package/dist/server/infra/transport/transport-connector.d.ts +1 -1
  166. package/dist/server/infra/transport/transport-connector.js +2 -1
  167. package/dist/server/infra/vc/file-vc-git-config-store.d.ts +11 -0
  168. package/dist/server/infra/vc/file-vc-git-config-store.js +43 -0
  169. package/dist/server/templates/skill/SKILL.md +167 -33
  170. package/dist/server/utils/curate-result-parser.d.ts +64 -0
  171. package/dist/server/utils/curate-result-parser.js +8 -0
  172. package/dist/server/utils/gitignore.d.ts +9 -0
  173. package/dist/server/utils/gitignore.js +47 -0
  174. package/dist/shared/transport/events/index.d.ts +6 -0
  175. package/dist/shared/transport/events/index.js +3 -0
  176. package/dist/shared/transport/events/init-events.d.ts +8 -0
  177. package/dist/shared/transport/events/init-events.js +1 -0
  178. package/dist/shared/transport/events/push-events.d.ts +6 -0
  179. package/dist/shared/transport/events/review-events.d.ts +41 -0
  180. package/dist/shared/transport/events/review-events.js +5 -0
  181. package/dist/shared/transport/events/vc-events.d.ts +257 -0
  182. package/dist/shared/transport/events/vc-events.js +67 -0
  183. package/dist/shared/transport/types/dto.d.ts +6 -1
  184. package/dist/tui/app/pages/init-project-page.d.ts +9 -0
  185. package/dist/tui/app/pages/init-project-page.js +54 -0
  186. package/dist/tui/app/pages/protected-routes.js +14 -6
  187. package/dist/tui/components/index.d.ts +0 -2
  188. package/dist/tui/components/index.js +0 -1
  189. package/dist/tui/features/activity/hooks/use-activity-logs.js +7 -1
  190. package/dist/tui/features/commands/definitions/index.js +3 -0
  191. package/dist/tui/features/commands/definitions/space-list.js +9 -18
  192. package/dist/tui/features/commands/definitions/space-switch.js +10 -6
  193. package/dist/tui/features/commands/definitions/vc-add.d.ts +2 -0
  194. package/dist/tui/features/commands/definitions/vc-add.js +15 -0
  195. package/dist/tui/features/commands/definitions/vc-branch.d.ts +2 -0
  196. package/dist/tui/features/commands/definitions/vc-branch.js +33 -0
  197. package/dist/tui/features/commands/definitions/vc-checkout.d.ts +2 -0
  198. package/dist/tui/features/commands/definitions/vc-checkout.js +32 -0
  199. package/dist/tui/features/commands/definitions/vc-clone.d.ts +2 -0
  200. package/dist/tui/features/commands/definitions/vc-clone.js +18 -0
  201. package/dist/tui/features/commands/definitions/vc-commit.d.ts +2 -0
  202. package/dist/tui/features/commands/definitions/vc-commit.js +32 -0
  203. package/dist/tui/features/commands/definitions/vc-config.d.ts +2 -0
  204. package/dist/tui/features/commands/definitions/vc-config.js +40 -0
  205. package/dist/tui/features/commands/definitions/vc-fetch.d.ts +2 -0
  206. package/dist/tui/features/commands/definitions/vc-fetch.js +37 -0
  207. package/dist/tui/features/commands/definitions/vc-init.d.ts +2 -0
  208. package/dist/tui/features/commands/definitions/vc-init.js +11 -0
  209. package/dist/tui/features/commands/definitions/vc-log.d.ts +2 -0
  210. package/dist/tui/features/commands/definitions/vc-log.js +25 -0
  211. package/dist/tui/features/commands/definitions/vc-merge.d.ts +2 -0
  212. package/dist/tui/features/commands/definitions/vc-merge.js +48 -0
  213. package/dist/tui/features/commands/definitions/vc-pull.d.ts +2 -0
  214. package/dist/tui/features/commands/definitions/vc-pull.js +42 -0
  215. package/dist/tui/features/commands/definitions/vc-push.d.ts +2 -0
  216. package/dist/tui/features/commands/definitions/vc-push.js +38 -0
  217. package/dist/tui/features/commands/definitions/vc-remote.d.ts +2 -0
  218. package/dist/tui/features/commands/definitions/vc-remote.js +57 -0
  219. package/dist/tui/features/commands/definitions/vc-reset.d.ts +2 -0
  220. package/dist/tui/features/commands/definitions/vc-reset.js +35 -0
  221. package/dist/tui/features/commands/definitions/vc-status.d.ts +2 -0
  222. package/dist/tui/features/commands/definitions/vc-status.js +11 -0
  223. package/dist/tui/features/commands/definitions/vc.d.ts +2 -0
  224. package/dist/tui/features/commands/definitions/vc.js +36 -0
  225. package/dist/tui/features/commands/hooks/use-slash-command-processor.js +5 -5
  226. package/dist/tui/features/log/api/execute-log.d.ts +8 -0
  227. package/dist/tui/features/log/api/execute-log.js +13 -0
  228. package/dist/tui/features/log/components/log-flow.d.ts +14 -0
  229. package/dist/tui/features/log/components/log-flow.js +29 -0
  230. package/dist/tui/features/log/utils/format-log.d.ts +3 -0
  231. package/dist/tui/features/log/utils/format-log.js +42 -0
  232. package/dist/tui/features/onboarding/hooks/use-app-view-mode.d.ts +9 -5
  233. package/dist/tui/features/onboarding/hooks/use-app-view-mode.js +12 -5
  234. package/dist/tui/features/push/components/push-flow.js +9 -2
  235. package/dist/tui/features/reset/components/reset-flow.js +2 -1
  236. package/dist/tui/features/status/components/status-view.js +2 -1
  237. package/dist/tui/features/status/utils/format-status.js +9 -0
  238. package/dist/tui/features/tasks/hooks/use-task-subscriptions.js +11 -0
  239. package/dist/tui/features/tasks/stores/tasks-store.d.ts +10 -0
  240. package/dist/tui/features/tasks/stores/tasks-store.js +16 -0
  241. package/dist/tui/features/vc/add/api/execute-vc-add.d.ts +8 -0
  242. package/dist/tui/features/vc/add/api/execute-vc-add.js +13 -0
  243. package/dist/tui/features/vc/add/components/vc-add-flow.d.ts +7 -0
  244. package/dist/tui/features/vc/add/components/vc-add-flow.js +35 -0
  245. package/dist/tui/features/vc/branch/api/execute-vc-branch.d.ts +8 -0
  246. package/dist/tui/features/vc/branch/api/execute-vc-branch.js +13 -0
  247. package/dist/tui/features/vc/branch/components/vc-branch-flow.d.ts +8 -0
  248. package/dist/tui/features/vc/branch/components/vc-branch-flow.js +53 -0
  249. package/dist/tui/features/vc/branch/utils/format-branch.d.ts +4 -0
  250. package/dist/tui/features/vc/branch/utils/format-branch.js +12 -0
  251. package/dist/tui/features/vc/checkout/api/execute-vc-checkout.d.ts +8 -0
  252. package/dist/tui/features/vc/checkout/api/execute-vc-checkout.js +13 -0
  253. package/dist/tui/features/vc/checkout/components/vc-checkout-flow.d.ts +8 -0
  254. package/dist/tui/features/vc/checkout/components/vc-checkout-flow.js +33 -0
  255. package/dist/tui/features/vc/clone/api/execute-vc-clone.d.ts +8 -0
  256. package/dist/tui/features/vc/clone/api/execute-vc-clone.js +13 -0
  257. package/dist/tui/features/vc/clone/components/vc-clone-flow.d.ts +7 -0
  258. package/dist/tui/features/vc/clone/components/vc-clone-flow.js +79 -0
  259. package/dist/tui/features/vc/commit/api/execute-vc-commit.d.ts +8 -0
  260. package/dist/tui/features/vc/commit/api/execute-vc-commit.js +13 -0
  261. package/dist/tui/features/vc/commit/components/vc-commit-flow.d.ts +7 -0
  262. package/dist/tui/features/vc/commit/components/vc-commit-flow.js +29 -0
  263. package/dist/tui/features/vc/config/api/execute-vc-config.d.ts +8 -0
  264. package/dist/tui/features/vc/config/api/execute-vc-config.js +13 -0
  265. package/dist/tui/features/vc/config/components/vc-config-flow.d.ts +9 -0
  266. package/dist/tui/features/vc/config/components/vc-config-flow.js +30 -0
  267. package/dist/tui/features/vc/fetch/api/execute-vc-fetch.d.ts +8 -0
  268. package/dist/tui/features/vc/fetch/api/execute-vc-fetch.js +13 -0
  269. package/dist/tui/features/vc/fetch/components/vc-fetch-flow.d.ts +8 -0
  270. package/dist/tui/features/vc/fetch/components/vc-fetch-flow.js +75 -0
  271. package/dist/tui/features/vc/init/api/execute-vc-init.d.ts +8 -0
  272. package/dist/tui/features/vc/init/api/execute-vc-init.js +13 -0
  273. package/dist/tui/features/vc/init/components/vc-init-flow.d.ts +10 -0
  274. package/dist/tui/features/vc/init/components/vc-init-flow.js +37 -0
  275. package/dist/tui/features/vc/merge/api/execute-vc-merge.d.ts +8 -0
  276. package/dist/tui/features/vc/merge/api/execute-vc-merge.js +13 -0
  277. package/dist/tui/features/vc/merge/components/vc-merge-flow.d.ts +11 -0
  278. package/dist/tui/features/vc/merge/components/vc-merge-flow.js +72 -0
  279. package/dist/tui/features/vc/pull/api/execute-vc-pull.d.ts +8 -0
  280. package/dist/tui/features/vc/pull/api/execute-vc-pull.js +13 -0
  281. package/dist/tui/features/vc/pull/components/vc-pull-flow.d.ts +9 -0
  282. package/dist/tui/features/vc/pull/components/vc-pull-flow.js +83 -0
  283. package/dist/tui/features/vc/push/api/execute-vc-push.d.ts +8 -0
  284. package/dist/tui/features/vc/push/api/execute-vc-push.js +13 -0
  285. package/dist/tui/features/vc/push/components/vc-push-flow.d.ts +8 -0
  286. package/dist/tui/features/vc/push/components/vc-push-flow.js +83 -0
  287. package/dist/tui/features/vc/remote/api/execute-vc-remote.d.ts +8 -0
  288. package/dist/tui/features/vc/remote/api/execute-vc-remote.js +13 -0
  289. package/dist/tui/features/vc/remote/components/vc-remote-flow.d.ts +9 -0
  290. package/dist/tui/features/vc/remote/components/vc-remote-flow.js +42 -0
  291. package/dist/tui/features/vc/reset/api/execute-vc-reset.d.ts +8 -0
  292. package/dist/tui/features/vc/reset/api/execute-vc-reset.js +13 -0
  293. package/dist/tui/features/vc/reset/components/vc-reset-flow.d.ts +10 -0
  294. package/dist/tui/features/vc/reset/components/vc-reset-flow.js +63 -0
  295. package/dist/tui/features/vc/status/api/execute-vc-status.d.ts +8 -0
  296. package/dist/tui/features/vc/status/api/execute-vc-status.js +13 -0
  297. package/dist/tui/features/vc/status/components/vc-status-flow.d.ts +10 -0
  298. package/dist/tui/features/vc/status/components/vc-status-flow.js +133 -0
  299. package/dist/tui/lib/environment.d.ts +8 -0
  300. package/dist/tui/lib/environment.js +8 -0
  301. package/dist/tui/utils/error-messages.d.ts +5 -1
  302. package/dist/tui/utils/error-messages.js +32 -3
  303. package/oclif.manifest.json +1124 -204
  304. package/package.json +9 -3
  305. package/dist/oclif/hooks/prerun/validate-brv-config-version.d.ts +0 -33
  306. package/dist/oclif/hooks/prerun/validate-brv-config-version.js +0 -86
  307. package/dist/tui/components/init.d.ts +0 -33
  308. package/dist/tui/components/init.js +0 -234
  309. package/dist/tui/features/space/api/get-spaces.d.ts +0 -16
  310. package/dist/tui/features/space/api/get-spaces.js +0 -17
  311. package/dist/tui/features/space/api/switch-space.d.ts +0 -11
  312. package/dist/tui/features/space/api/switch-space.js +0 -24
  313. package/dist/tui/features/space/components/space-list-view.d.ts +0 -12
  314. package/dist/tui/features/space/components/space-list-view.js +0 -56
  315. package/dist/tui/features/space/components/space-switch-flow.d.ts +0 -13
  316. package/dist/tui/features/space/components/space-switch-flow.js +0 -97
@@ -0,0 +1,94 @@
1
+ import { Command, Flags } from '@oclif/core';
2
+ import { ReviewEvents, } from '../../../shared/transport/events/review-events.js';
3
+ import { formatConnectionError, withDaemonRetry } from '../../lib/daemon-client.js';
4
+ import { writeJsonResponse } from '../../lib/json-response.js';
5
+ export default class ReviewPending extends Command {
6
+ static description = 'List all pending review operations for the current project';
7
+ static examples = [
8
+ '# Show all pending reviews',
9
+ '<%= config.bin %> review pending',
10
+ '',
11
+ '# Get structured output for agent-driven workflows',
12
+ '<%= config.bin %> review pending --format json',
13
+ ];
14
+ static flags = {
15
+ format: Flags.string({
16
+ default: 'text',
17
+ description: 'Output format (text or json)',
18
+ options: ['text', 'json'],
19
+ }),
20
+ };
21
+ getDaemonClientOptions() {
22
+ return {};
23
+ }
24
+ async run() {
25
+ const { flags } = await this.parse(ReviewPending);
26
+ const format = flags.format === 'json' ? 'json' : 'text';
27
+ try {
28
+ const response = await withDaemonRetry((client) => client.requestWithAck(ReviewEvents.PENDING, {}), this.getDaemonClientOptions());
29
+ if (format === 'json') {
30
+ writeJsonResponse({
31
+ command: 'review',
32
+ data: {
33
+ pendingCount: response.pendingCount,
34
+ status: 'success',
35
+ tasks: response.tasks,
36
+ },
37
+ success: true,
38
+ });
39
+ }
40
+ else {
41
+ this.printText(response);
42
+ }
43
+ }
44
+ catch (error) {
45
+ if (format === 'json') {
46
+ writeJsonResponse({
47
+ command: 'review',
48
+ data: { error: error instanceof Error ? error.message : 'Review failed', status: 'error' },
49
+ success: false,
50
+ });
51
+ }
52
+ else {
53
+ this.log(formatConnectionError(error));
54
+ }
55
+ }
56
+ }
57
+ printTask(task) {
58
+ this.log(` Task: ${task.taskId}`);
59
+ for (const [i, op] of task.operations.entries()) {
60
+ const impact = op.impact === 'high' ? ' · HIGH IMPACT' : '';
61
+ const displayPath = op.filePath ?? op.path;
62
+ if (i > 0)
63
+ this.log('');
64
+ this.log(` [${op.type}${impact}] - path: ${displayPath}`);
65
+ if (op.reason)
66
+ this.log(` Why: ${op.reason}`);
67
+ if (op.previousSummary)
68
+ this.log(` Before: ${op.previousSummary.replaceAll('\n', '\n ')}`);
69
+ if (op.summary)
70
+ this.log(` After: ${op.summary.replaceAll('\n', '\n ')}`);
71
+ }
72
+ this.log('');
73
+ this.log(` To approve all: ${this.config.bin} review approve ${task.taskId}`);
74
+ this.log(` To reject all: ${this.config.bin} review reject ${task.taskId}`);
75
+ this.log(` Per file: ${this.config.bin} review approve/reject ${task.taskId} --file <path> [--file <path>]`);
76
+ }
77
+ printText(response) {
78
+ if (response.pendingCount === 0) {
79
+ this.log('No pending reviews.');
80
+ return;
81
+ }
82
+ const { pendingCount } = response;
83
+ this.log(`${pendingCount} operation${pendingCount === 1 ? '' : 's'} pending review`);
84
+ this.log('');
85
+ for (const [i, task] of response.tasks.entries()) {
86
+ if (i > 0) {
87
+ this.log('');
88
+ this.log('---');
89
+ this.log('');
90
+ }
91
+ this.printTask(task);
92
+ }
93
+ }
94
+ }
@@ -0,0 +1,17 @@
1
+ import type { ReviewDecideTaskResponse } from '../../../shared/transport/events/review-events.js';
2
+ import { ReviewDecisionCommand } from './base-review-decision.js';
3
+ type ReviewFile = ReviewDecideTaskResponse['files'][number];
4
+ export default class ReviewReject extends ReviewDecisionCommand {
5
+ static args: {
6
+ taskId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
7
+ };
8
+ static description: string;
9
+ static examples: string[];
10
+ static flags: {
11
+ file: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
+ format: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
13
+ };
14
+ protected readonly decision: "rejected";
15
+ protected formatFileLine(file: ReviewFile): string;
16
+ }
17
+ export {};
@@ -0,0 +1,38 @@
1
+ import { Args, Flags } from '@oclif/core';
2
+ import { ReviewDecisionCommand } from './base-review-decision.js';
3
+ export default class ReviewReject extends ReviewDecisionCommand {
4
+ static args = {
5
+ taskId: Args.string({
6
+ description: 'Task ID shown in the curate output (e.g. "brv review reject abc-123")',
7
+ required: true,
8
+ }),
9
+ };
10
+ static description = 'Reject pending review operations for a curate task (restores files from backup)';
11
+ static examples = [
12
+ '# Reject all pending changes from a curate task',
13
+ '<%= config.bin %> review reject abc-123',
14
+ '',
15
+ '# Reject specific files',
16
+ '<%= config.bin %> review reject abc-123 --file architecture/security/audit.md',
17
+ '<%= config.bin %> review reject abc-123 --file auth/jwt.md --file auth/oauth.md',
18
+ '',
19
+ '# Reject and get structured output (useful for coding agents)',
20
+ '<%= config.bin %> review reject abc-123 --format json',
21
+ ];
22
+ static flags = {
23
+ file: Flags.string({
24
+ description: 'Reject only the specified file path(s) (relative to context tree)',
25
+ multiple: true,
26
+ }),
27
+ format: Flags.string({
28
+ default: 'text',
29
+ description: 'Output format (text or json)',
30
+ options: ['text', 'json'],
31
+ }),
32
+ };
33
+ decision = 'rejected';
34
+ formatFileLine(file) {
35
+ const suffix = file.reverted ? ' (restored from backup)' : '';
36
+ return `✓ Rejected ${file.path}${suffix}`;
37
+ }
38
+ }
@@ -1,5 +1,5 @@
1
1
  import { Command } from '@oclif/core';
2
- import { type SpaceListResponse } from '../../../shared/transport/events/space-events.js';
2
+ import type { StatusGetResponse } from '../../../shared/transport/events/status-events.js';
3
3
  import { type DaemonClientOptions } from '../../lib/daemon-client.js';
4
4
  export default class SpaceList extends Command {
5
5
  static description: string;
@@ -7,6 +7,6 @@ export default class SpaceList extends Command {
7
7
  static flags: {
8
8
  format: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
9
9
  };
10
- protected fetchSpaces(options?: DaemonClientOptions): Promise<SpaceListResponse>;
10
+ protected checkDeprecation(options?: DaemonClientOptions): Promise<StatusGetResponse>;
11
11
  run(): Promise<void>;
12
12
  }
@@ -1,10 +1,10 @@
1
1
  import { Command, Flags } from '@oclif/core';
2
- import { SpaceEvents } from '../../../shared/transport/events/space-events.js';
2
+ import { StatusEvents } from '../../../shared/transport/events/status-events.js';
3
3
  import { formatConnectionError, withDaemonRetry } from '../../lib/daemon-client.js';
4
4
  import { writeJsonResponse } from '../../lib/json-response.js';
5
5
  export default class SpaceList extends Command {
6
- static description = 'List all teams and spaces';
7
- static examples = ['<%= config.bin %> space list', '<%= config.bin %> space list --format json'];
6
+ static description = 'List all teams and spaces (deprecated)';
7
+ static examples = ['<%= config.bin %> space list'];
8
8
  static flags = {
9
9
  format: Flags.string({
10
10
  char: 'f',
@@ -13,45 +13,23 @@ export default class SpaceList extends Command {
13
13
  options: ['text', 'json'],
14
14
  }),
15
15
  };
16
- async fetchSpaces(options) {
17
- return withDaemonRetry(async (client) => client.requestWithAck(SpaceEvents.LIST), options);
16
+ async checkDeprecation(options) {
17
+ return withDaemonRetry(async (client) => client.requestWithAck(StatusEvents.GET), options);
18
18
  }
19
19
  async run() {
20
20
  const { flags } = await this.parse(SpaceList);
21
21
  const format = flags.format;
22
22
  try {
23
- const { teams } = await this.fetchSpaces();
23
+ const { status } = await this.checkDeprecation();
24
+ const isVc = status.contextTreeStatus === 'git_vc';
25
+ const message = isVc
26
+ ? 'The space list command has been deprecated. Visit the ByteRover web dashboard to view your spaces.'
27
+ : 'The space list command has been deprecated. Visit the ByteRover web dashboard to view your spaces and follow the migration guide to version control.';
24
28
  if (format === 'json') {
25
- const data = {
26
- teams: teams.map((t) => ({
27
- teamId: t.teamId,
28
- teamName: t.teamName,
29
- // eslint-disable-next-line perfectionist/sort-objects
30
- spaces: t.spaces.map((s) => ({
31
- isDefault: s.isDefault,
32
- spaceId: s.id,
33
- spaceName: s.name,
34
- })),
35
- })),
36
- };
37
- writeJsonResponse({ command: 'space list', data, success: true });
38
- return;
29
+ writeJsonResponse({ command: 'space list', data: { message }, success: true });
39
30
  }
40
- if (teams.length === 0) {
41
- this.log('No teams found.');
42
- return;
43
- }
44
- for (const [index, team] of teams.entries()) {
45
- this.log(`${index + 1}. ${team.teamName} (team)`);
46
- if (team.spaces.length === 0) {
47
- this.log(' No spaces');
48
- }
49
- else {
50
- for (const space of team.spaces) {
51
- const defaultMarker = space.isDefault ? ' (default)' : '';
52
- this.log(` - ${space.name}${defaultMarker} (space)`);
53
- }
54
- }
31
+ else {
32
+ this.log(message);
55
33
  }
56
34
  }
57
35
  catch (error) {
@@ -1,17 +1,12 @@
1
1
  import { Command } from '@oclif/core';
2
- import { type SpaceSwitchResponse } from '../../../shared/transport/events/space-events.js';
2
+ import type { StatusGetResponse } from '../../../shared/transport/events/status-events.js';
3
3
  import { type DaemonClientOptions } from '../../lib/daemon-client.js';
4
4
  export default class SpaceSwitch extends Command {
5
5
  static description: string;
6
6
  static examples: string[];
7
7
  static flags: {
8
8
  format: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
9
- name: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
10
- team: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
11
9
  };
12
- protected executeSwitch(params: {
13
- spaceName: string;
14
- teamName: string;
15
- }, options?: DaemonClientOptions): Promise<SpaceSwitchResponse>;
10
+ protected checkDeprecation(options?: DaemonClientOptions): Promise<StatusGetResponse>;
16
11
  run(): Promise<void>;
17
12
  }
@@ -1,14 +1,10 @@
1
1
  import { Command, Flags } from '@oclif/core';
2
- import { TRANSPORT_SPACE_SWITCH_TIMEOUT_MS } from '../../../server/constants.js';
3
- import { SpaceEvents, } from '../../../shared/transport/events/space-events.js';
2
+ import { StatusEvents } from '../../../shared/transport/events/status-events.js';
4
3
  import { formatConnectionError, withDaemonRetry } from '../../lib/daemon-client.js';
5
4
  import { writeJsonResponse } from '../../lib/json-response.js';
6
5
  export default class SpaceSwitch extends Command {
7
- static description = 'Switch to a different space';
8
- static examples = [
9
- '<%= config.bin %> space switch --team acme --name my-space',
10
- '<%= config.bin %> space switch --team acme --name my-space --format json',
11
- ];
6
+ static description = 'Switch to a different space (deprecated)';
7
+ static examples = ['<%= config.bin %> space switch'];
12
8
  static flags = {
13
9
  format: Flags.string({
14
10
  char: 'f',
@@ -16,68 +12,29 @@ export default class SpaceSwitch extends Command {
16
12
  description: 'Output format',
17
13
  options: ['text', 'json'],
18
14
  }),
19
- name: Flags.string({
20
- char: 'n',
21
- description: 'Name of the space to switch to',
22
- required: true,
23
- }),
24
- team: Flags.string({
25
- char: 't',
26
- description: 'Team name',
27
- required: true,
28
- }),
29
15
  };
30
- async executeSwitch(params, options) {
31
- return withDaemonRetry(async (client) => {
32
- const { teams } = await client.requestWithAck(SpaceEvents.LIST);
33
- const team = teams.find((t) => t.teamName === params.teamName);
34
- if (!team) {
35
- const available = teams.map((t) => t.teamName).join(', ');
36
- throw new Error(teams.length > 0
37
- ? `Team "${params.teamName}" not found. Available teams: ${available}`
38
- : `Team "${params.teamName}" not found. No teams available.`);
39
- }
40
- const targetSpace = team.spaces.find((s) => s.name === params.spaceName);
41
- if (!targetSpace) {
42
- const available = team.spaces.map((s) => s.name).join(', ');
43
- throw new Error(team.spaces.length > 0
44
- ? `Space "${params.spaceName}" not found in team "${params.teamName}". Available spaces: ${available}`
45
- : `Space "${params.spaceName}" not found in team "${params.teamName}". No spaces available.`);
46
- }
47
- return client.requestWithAck(SpaceEvents.SWITCH, { spaceId: targetSpace.id }, { timeout: TRANSPORT_SPACE_SWITCH_TIMEOUT_MS });
48
- }, options);
16
+ async checkDeprecation(options) {
17
+ return withDaemonRetry(async (client) => client.requestWithAck(StatusEvents.GET), options);
49
18
  }
50
19
  async run() {
51
20
  const { flags } = await this.parse(SpaceSwitch);
52
21
  const format = flags.format;
53
- const spaceName = flags.name;
54
- const teamName = flags.team;
55
22
  try {
56
- const result = await this.executeSwitch({ spaceName, teamName });
23
+ const { status } = await this.checkDeprecation();
24
+ const isVc = status.contextTreeStatus === 'git_vc';
25
+ const message = isVc
26
+ ? 'The space switch command has been deprecated. To work with a different space, use: brv vc clone <url>'
27
+ : 'The space switch command has been deprecated. Visit the ByteRover web dashboard to follow the migration guide from snapshot to version control.';
57
28
  if (format === 'json') {
58
- writeJsonResponse({ command: 'space switch', data: result, success: result.success });
59
- }
60
- else if (result.success) {
61
- this.log(`Successfully switched to space: ${result.config.spaceName}`);
62
- if (result.pullResult) {
63
- const { added, conflicted, deleted, edited, restoredFromRemote } = result.pullResult;
64
- const parts = [`+${added}`, `~${edited}`, `-${deleted}`];
65
- if (conflicted)
66
- parts.push(`!${conflicted} conflicted`);
67
- if (restoredFromRemote)
68
- parts.push(`^${restoredFromRemote} restored`);
69
- this.log(`Pulled: ${parts.join(' ')}`);
70
- }
71
- this.log('Configuration updated in: .brv/config.json');
29
+ writeJsonResponse({ command: 'space switch', data: { message }, success: true });
72
30
  }
73
31
  else {
74
- this.log(`Failed to switch space: ${result.pullError}`);
32
+ this.log(message);
75
33
  }
76
34
  }
77
35
  catch (error) {
78
36
  if (format === 'json') {
79
- const errorMessage = error instanceof Error ? error.message : 'Switch failed';
80
- writeJsonResponse({ command: 'space switch', data: { error: errorMessage }, success: false });
37
+ writeJsonResponse({ command: 'space switch', data: { error: formatConnectionError(error) }, success: false });
81
38
  }
82
39
  else {
83
40
  this.log(formatConnectionError(error));
@@ -10,4 +10,5 @@ export default class Status extends Command {
10
10
  protected fetchStatus(options?: DaemonClientOptions): Promise<StatusDTO>;
11
11
  run(): Promise<void>;
12
12
  private formatTextOutput;
13
+ private logVcHint;
13
14
  }
@@ -24,7 +24,7 @@ export default class Status extends Command {
24
24
  const { flags } = await this.parse(Status);
25
25
  const isJson = flags.format === 'json';
26
26
  try {
27
- const status = await this.fetchStatus();
27
+ const status = await this.fetchStatus({ projectPath: process.cwd() });
28
28
  if (isJson) {
29
29
  writeJsonResponse({
30
30
  command: 'status',
@@ -34,6 +34,7 @@ export default class Status extends Command {
34
34
  }
35
35
  else {
36
36
  this.formatTextOutput(status);
37
+ this.logVcHint();
37
38
  }
38
39
  }
39
40
  catch (error) {
@@ -46,6 +47,7 @@ export default class Status extends Command {
46
47
  }
47
48
  else {
48
49
  this.log(formatConnectionError(error));
50
+ this.logVcHint();
49
51
  }
50
52
  }
51
53
  }
@@ -79,6 +81,10 @@ export default class Status extends Command {
79
81
  }
80
82
  // Context tree status
81
83
  switch (status.contextTreeStatus) {
84
+ case 'git_vc': {
85
+ this.log('Context Tree: Managed by Byterover version control (use brv vc commands)');
86
+ break;
87
+ }
82
88
  case 'has_changes': {
83
89
  if (status.contextTreeChanges && status.contextTreeRelativeDir) {
84
90
  const formatPath = (file) => `${status.contextTreeRelativeDir}/${file}`;
@@ -107,4 +113,8 @@ export default class Status extends Command {
107
113
  }
108
114
  }
109
115
  }
116
+ logVcHint() {
117
+ this.log('\nTip: Version control is now available for your context tree.');
118
+ this.log('Learn more: https://docs.byterover.dev/git-semantic/overview');
119
+ }
110
120
  }
@@ -0,0 +1,7 @@
1
+ import { Command } from '@oclif/core';
2
+ export default class VcAdd extends Command {
3
+ static description: string;
4
+ static examples: string[];
5
+ static strict: boolean;
6
+ run(): Promise<void>;
7
+ }
@@ -0,0 +1,29 @@
1
+ import { Command } from '@oclif/core';
2
+ import { VcEvents } from '../../../shared/transport/events/vc-events.js';
3
+ import { formatConnectionError, withDaemonRetry } from '../../lib/daemon-client.js';
4
+ export default class VcAdd extends Command {
5
+ static description = 'Stage files for the next commit';
6
+ static examples = [
7
+ '<%= config.bin %> <%= command.id %> .',
8
+ '<%= config.bin %> <%= command.id %> notes.md',
9
+ '<%= config.bin %> <%= command.id %> design/architecture.md',
10
+ '<%= config.bin %> <%= command.id %> docs/',
11
+ ];
12
+ static strict = false;
13
+ async run() {
14
+ const { argv } = await this.parse(VcAdd);
15
+ const filePaths = argv.length > 0 ? argv.filter((a) => typeof a === 'string') : ['.'];
16
+ try {
17
+ const result = await withDaemonRetry(async (client) => client.requestWithAck(VcEvents.ADD, { filePaths }));
18
+ if (result.count === 0) {
19
+ this.log('Nothing to stage.');
20
+ }
21
+ else {
22
+ this.log(`Staged ${result.count} file(s).`);
23
+ }
24
+ }
25
+ catch (error) {
26
+ this.error(formatConnectionError(error));
27
+ }
28
+ }
29
+ }
@@ -0,0 +1,15 @@
1
+ import { Command } from '@oclif/core';
2
+ export default class VcBranch extends Command {
3
+ static args: {
4
+ name: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
5
+ };
6
+ static description: string;
7
+ static examples: string[];
8
+ static flags: {
9
+ all: import("@oclif/core/interfaces").BooleanFlag<boolean>;
10
+ delete: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
+ 'set-upstream-to': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
+ };
13
+ run(): Promise<void>;
14
+ private requestBranch;
15
+ }
@@ -0,0 +1,70 @@
1
+ import { Args, Command, Flags } from '@oclif/core';
2
+ import { VcEvents } from '../../../shared/transport/events/vc-events.js';
3
+ import { formatConnectionError, withDaemonRetry } from '../../lib/daemon-client.js';
4
+ export default class VcBranch extends Command {
5
+ static args = {
6
+ name: Args.string({ description: 'Branch name to create' }),
7
+ };
8
+ static description = 'List, create, or delete local branches';
9
+ static examples = [
10
+ '<%= config.bin %> <%= command.id %>',
11
+ '<%= config.bin %> <%= command.id %> feature/new-context',
12
+ '<%= config.bin %> <%= command.id %> -d feature/new-context',
13
+ '<%= config.bin %> <%= command.id %> -a',
14
+ '<%= config.bin %> <%= command.id %> --set-upstream-to origin/main',
15
+ ];
16
+ static flags = {
17
+ all: Flags.boolean({
18
+ char: 'a',
19
+ default: false,
20
+ description: 'List all branches including remote-tracking',
21
+ }),
22
+ delete: Flags.string({
23
+ char: 'd',
24
+ description: 'Delete a branch by name',
25
+ }),
26
+ 'set-upstream-to': Flags.string({
27
+ description: 'Set upstream tracking (e.g. origin/main)',
28
+ }),
29
+ };
30
+ async run() {
31
+ const { args, flags } = await this.parse(VcBranch);
32
+ try {
33
+ if (flags['set-upstream-to']) {
34
+ const result = await this.requestBranch({ action: 'set-upstream', upstream: flags['set-upstream-to'] });
35
+ if (result.action === 'set-upstream') {
36
+ this.log(`Branch '${result.branch}' set up to track '${result.upstream}'.`);
37
+ }
38
+ return;
39
+ }
40
+ if (flags.delete) {
41
+ const result = await this.requestBranch({ action: 'delete', name: flags.delete });
42
+ if (result.action === 'delete')
43
+ this.log(`Deleted branch '${result.deleted}'.`);
44
+ return;
45
+ }
46
+ if (args.name) {
47
+ const result = await this.requestBranch({ action: 'create', name: args.name });
48
+ if (result.action === 'create')
49
+ this.log(`Created branch '${result.created}'.`);
50
+ return;
51
+ }
52
+ const result = await this.requestBranch({ action: 'list', all: flags.all });
53
+ if (result.action !== 'list' || result.branches.length === 0) {
54
+ this.log('No branches found.');
55
+ return;
56
+ }
57
+ for (const b of result.branches) {
58
+ const prefix = b.isCurrent ? '* ' : ' ';
59
+ const name = b.isRemote ? `remotes/${b.name}` : b.name;
60
+ this.log(`${prefix}${name}`);
61
+ }
62
+ }
63
+ catch (error) {
64
+ this.error(formatConnectionError(error));
65
+ }
66
+ }
67
+ requestBranch(req) {
68
+ return withDaemonRetry((client) => client.requestWithAck(VcEvents.BRANCH, req));
69
+ }
70
+ }
@@ -0,0 +1,14 @@
1
+ import { Command } from '@oclif/core';
2
+ export default class VcCheckout extends Command {
3
+ static args: {
4
+ branch: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
5
+ };
6
+ static description: string;
7
+ static examples: string[];
8
+ static flags: {
9
+ create: import("@oclif/core/interfaces").BooleanFlag<boolean>;
10
+ force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
11
+ };
12
+ run(): Promise<void>;
13
+ private requestCheckout;
14
+ }
@@ -0,0 +1,47 @@
1
+ import { Args, Command, Flags } from '@oclif/core';
2
+ import { VcEvents, } from '../../../shared/transport/events/vc-events.js';
3
+ import { formatConnectionError, withDaemonRetry } from '../../lib/daemon-client.js';
4
+ export default class VcCheckout extends Command {
5
+ static args = {
6
+ branch: Args.string({ description: 'Branch to switch to', required: true }),
7
+ };
8
+ static description = 'Switch to an existing branch, or create and switch with -b';
9
+ static examples = [
10
+ '<%= config.bin %> <%= command.id %> feature/my-branch',
11
+ '<%= config.bin %> <%= command.id %> -b feature/new-branch',
12
+ '<%= config.bin %> <%= command.id %> --force feature/my-branch',
13
+ ];
14
+ static flags = {
15
+ create: Flags.boolean({
16
+ char: 'b',
17
+ default: false,
18
+ description: 'Create a new branch and switch to it',
19
+ }),
20
+ force: Flags.boolean({
21
+ default: false,
22
+ description: 'Discard local changes and switch',
23
+ }),
24
+ };
25
+ async run() {
26
+ const { args, flags } = await this.parse(VcCheckout);
27
+ try {
28
+ const result = await this.requestCheckout({
29
+ branch: args.branch,
30
+ create: flags.create,
31
+ force: flags.force,
32
+ });
33
+ if (result.created) {
34
+ this.log(`Switched to a new branch '${result.branch}'`);
35
+ }
36
+ else {
37
+ this.log(`Switched to branch '${result.branch}'`);
38
+ }
39
+ }
40
+ catch (error) {
41
+ this.error(formatConnectionError(error));
42
+ }
43
+ }
44
+ requestCheckout(req) {
45
+ return withDaemonRetry((client) => client.requestWithAck(VcEvents.CHECKOUT, req));
46
+ }
47
+ }
@@ -0,0 +1,9 @@
1
+ import { Command } from '@oclif/core';
2
+ export default class VcClone extends Command {
3
+ static args: {
4
+ url: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
5
+ };
6
+ static description: string;
7
+ static examples: string[];
8
+ run(): Promise<void>;
9
+ }