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
@@ -1,3 +1,4 @@
1
+ import { type RequestListener } from 'node:http';
1
2
  import type { TransportServerConfig } from '../../core/domain/transport/types.js';
2
3
  import type { ConnectionHandler, ITransportServer, RequestHandler } from '../../core/interfaces/transport/index.js';
3
4
  /**
@@ -12,6 +13,7 @@ export declare class SocketIOTransportServer implements ITransportServer {
12
13
  private readonly config;
13
14
  private connectionHandlers;
14
15
  private disconnectionHandlers;
16
+ private httpRequestHandler?;
15
17
  private httpServer;
16
18
  private io;
17
19
  private port;
@@ -34,6 +36,11 @@ export declare class SocketIOTransportServer implements ITransportServer {
34
36
  onRequest<TRequest = unknown, TResponse = unknown>(event: string, handler: RequestHandler<TRequest, TResponse>): void;
35
37
  removeFromRoom(clientId: string, room: string): void;
36
38
  sendTo<T = unknown>(clientId: string, event: string, data: T): void;
39
+ /**
40
+ * Sets an HTTP request handler (e.g., Express app) to handle non-Socket.IO HTTP requests.
41
+ * Must be called before start().
42
+ */
43
+ setHttpRequestHandler(handler: RequestListener): void;
37
44
  start(port: number): Promise<void>;
38
45
  stop(): Promise<void>;
39
46
  private registerEventHandler;
@@ -22,6 +22,7 @@ export class SocketIOTransportServer {
22
22
  config;
23
23
  connectionHandlers = [];
24
24
  disconnectionHandlers = [];
25
+ httpRequestHandler;
25
26
  httpServer;
26
27
  io;
27
28
  port;
@@ -104,12 +105,22 @@ export class SocketIOTransportServer {
104
105
  socket.emit(event, data);
105
106
  }
106
107
  }
108
+ /**
109
+ * Sets an HTTP request handler (e.g., Express app) to handle non-Socket.IO HTTP requests.
110
+ * Must be called before start().
111
+ */
112
+ setHttpRequestHandler(handler) {
113
+ if (this.running) {
114
+ throw new TransportServerAlreadyRunningError(this.port ?? 0);
115
+ }
116
+ this.httpRequestHandler = handler;
117
+ }
107
118
  async start(port) {
108
119
  if (this.running) {
109
120
  throw new TransportServerAlreadyRunningError(this.port ?? port);
110
121
  }
111
122
  return new Promise((resolve, reject) => {
112
- this.httpServer = createServer();
123
+ this.httpServer = this.httpRequestHandler ? createServer(this.httpRequestHandler) : createServer();
113
124
  // In development mode, allow admin.socket.io for debugging
114
125
  const corsOrigin = isDevelopment() ? [this.config.corsOrigin, 'https://admin.socket.io'] : this.config.corsOrigin;
115
126
  this.io = new Server(this.httpServer, {
@@ -10,4 +10,4 @@ export type TransportConnector = (fromDir?: string) => Promise<ConnectionResult>
10
10
  * projectPath is auto-filled by the transport library from the discovered
11
11
  * project root (walks up from fromDir to find .brv/).
12
12
  */
13
- export declare function createDaemonAwareConnector(): TransportConnector;
13
+ export declare function createDaemonAwareConnector(projectPath?: string): TransportConnector;
@@ -9,10 +9,11 @@ import { resolveLocalServerMainPath } from '../../utils/server-main-resolver.js'
9
9
  * projectPath is auto-filled by the transport library from the discovered
10
10
  * project root (walks up from fromDir to find .brv/).
11
11
  */
12
- export function createDaemonAwareConnector() {
12
+ export function createDaemonAwareConnector(projectPath) {
13
13
  return (fromDir) => connectToDaemon({
14
14
  clientType: 'cli',
15
15
  fromDir,
16
+ projectPath,
16
17
  serverPath: resolveLocalServerMainPath(),
17
18
  });
18
19
  }
@@ -0,0 +1,11 @@
1
+ import type { IVcGitConfig, IVcGitConfigStore } from '../../core/interfaces/vc/i-vc-git-config-store.js';
2
+ export interface IFileVcGitConfigStoreDeps {
3
+ readonly getDataDir: () => string;
4
+ }
5
+ export declare class FileVcGitConfigStore implements IVcGitConfigStore {
6
+ private readonly deps;
7
+ constructor(deps?: IFileVcGitConfigStoreDeps);
8
+ get(projectPath: string): Promise<IVcGitConfig | undefined>;
9
+ set(projectPath: string, config: IVcGitConfig): Promise<void>;
10
+ private configPath;
11
+ }
@@ -0,0 +1,43 @@
1
+ import { createHash } from 'node:crypto';
2
+ import { mkdir, readFile, writeFile } from 'node:fs/promises';
3
+ import { join } from 'node:path';
4
+ import { getGlobalDataDir } from '../../utils/global-data-path.js';
5
+ const defaultDeps = {
6
+ getDataDir: getGlobalDataDir,
7
+ };
8
+ function projectKey(projectPath) {
9
+ return createHash('sha1').update(projectPath).digest('hex').slice(0, 16);
10
+ }
11
+ function isIVcGitConfig(value) {
12
+ if (typeof value !== 'object' || value === null)
13
+ return false;
14
+ const v = value;
15
+ return (v.name === undefined || typeof v.name === 'string') && (v.email === undefined || typeof v.email === 'string');
16
+ }
17
+ export class FileVcGitConfigStore {
18
+ deps;
19
+ constructor(deps = defaultDeps) {
20
+ this.deps = deps;
21
+ }
22
+ async get(projectPath) {
23
+ const configPath = this.configPath(projectPath);
24
+ try {
25
+ const content = await readFile(configPath, 'utf8');
26
+ const parsed = JSON.parse(content);
27
+ if (!isIVcGitConfig(parsed))
28
+ return undefined;
29
+ return parsed;
30
+ }
31
+ catch {
32
+ return undefined;
33
+ }
34
+ }
35
+ async set(projectPath, config) {
36
+ const projectDir = join(this.deps.getDataDir(), 'projects', projectKey(projectPath));
37
+ await mkdir(projectDir, { recursive: true });
38
+ await writeFile(join(projectDir, 'vc-git-config.json'), JSON.stringify(config, null, 2), 'utf8');
39
+ }
40
+ configPath(projectPath) {
41
+ return join(this.deps.getDataDir(), 'projects', projectKey(projectPath), 'vc-git-config.json');
42
+ }
43
+ }
@@ -9,7 +9,7 @@ Use the `brv` CLI to manage your project's long-term memory.
9
9
  Install: `npm install -g byterover-cli`
10
10
  Knowledge is stored in `.brv/context-tree/` as human-readable Markdown files.
11
11
 
12
- **No authentication needed.** `brv query` and `brv curate` work out of the box. Login is only required for cloud sync (`push`/`pull`/`space`) — ignore those if you don't need cloud features.
12
+ **No authentication needed.** `brv query`, `brv curate`, and `brv vc` (local version control) work out of the box. Login is only required for remote sync (`brv vc push`/`brv vc pull`).
13
13
 
14
14
  ## Workflow
15
15
  1. **Before Thinking:** Run `brv query` to understand existing patterns.
@@ -35,7 +35,7 @@ brv query "How is authentication implemented?"
35
35
  ```
36
36
 
37
37
  ### 2. Curate Context
38
- **Overview**: Analyze and save knowledge to the local knowledge base. Uses a configured LLM provider to categorize and structure the context you provide.
38
+ **Overview:** Analyze and save knowledge to the local knowledge base. Uses a configured LLM provider to categorize and structure the context you provide.
39
39
 
40
40
  **Use this skill when:**
41
41
  - The user wants you to remember something
@@ -79,7 +79,70 @@ brv curate view --since 1h --status completed
79
79
  brv curate view --help
80
80
  ```
81
81
 
82
- ### 3. LLM Provider Setup
82
+ ### 3. Review Pending Changes
83
+ **Overview:** After a curate operation, some changes may require human review before being applied. Use `brv review` to list, approve, or reject pending operations.
84
+
85
+ **Use this when:**
86
+ - A curate operation reports pending reviews (shown in curate output)
87
+ - The user wants to check, approve, or reject pending changes
88
+
89
+ **Do NOT use this skill when:**
90
+ - There are no pending reviews (check with `brv review pending` first)
91
+
92
+ **Commands:**
93
+
94
+ List all pending reviews for the current project:
95
+ ```bash
96
+ brv review pending
97
+ ```
98
+
99
+ Sample output:
100
+ ```
101
+ 2 operations pending review
102
+
103
+   Task: ddcb3dc6-d957-4a56-b9c3-d0bdc04317f3
104
+   [UPSERT · HIGH IMPACT] - path: architecture/context/context_compression_pipeline.md
105
+   Why:    Documenting switch to token-budget sliding window
106
+   After:  Context compression pipeline switching from reactive-overflow to token-budget sliding window in src/agent/infra/llm/context/compression/
107
+
108
+   [UPSERT · HIGH IMPACT] - path: architecture/tools/agent_tool_registry.md
109
+   Why:    Documenting tool registry rewrite with capability-based permissions
110
+   After:  Agent tool registry rewrite in src/agent/infra/tools/tool-registry.ts using capability-based permissions
111
+
112
+   To approve all:  brv review approve ddcb3dc6-d957-4a56-b9c3-d0bdc04317f3
113
+   To reject all:   brv review reject ddcb3dc6-d957-4a56-b9c3-d0bdc04317f3
114
+   Per file:        brv review <approve|reject> ddcb3dc6-d957-4a56-b9c3-d0bdc04317f3 --file <path> [--file <path>]
115
+ ```
116
+
117
+ Each pending task shows: operation type (ADD/UPDATE/DELETE/MERGE/UPSERT), file path, reason, and before/after summaries. High-impact operations are flagged.
118
+
119
+ Approve all operations for a task (applies the changes):
120
+ ```bash
121
+ brv review approve <taskId>
122
+ ```
123
+
124
+ Reject all operations for a task (discards pending changes; restores backup for UPDATE/DELETE operations):
125
+ ```bash
126
+ brv review reject <taskId>
127
+ ```
128
+
129
+ Approve or reject specific files within a task:
130
+ ```bash
131
+ brv review approve <taskId> --file <path> --file <path>
132
+ brv review reject <taskId> --file <path>
133
+ ```
134
+ File paths are relative to context tree (as shown in `brv review pending` output).
135
+
136
+ **Note**: Always ask the user before approving or rejecting critical changes.
137
+
138
+ **JSON output** (useful for agent-driven workflows):
139
+ ```bash
140
+ brv review pending --format json
141
+ brv review approve <taskId> --format json
142
+ brv review reject <taskId> --format json
143
+ ```
144
+
145
+ ### 4. LLM Provider Setup
83
146
  `brv query` and `brv curate` require a configured LLM provider. Connect the default ByteRover provider (no API key needed):
84
147
 
85
148
  ```bash
@@ -93,7 +156,7 @@ brv providers list
93
156
  brv providers connect openai --api-key sk-xxx --model gpt-4.1
94
157
  ```
95
158
 
96
- ### 4. Project Locations
159
+ ### 5. Project Locations
97
160
  **Overview:** List registered projects and their context tree paths. Returns project metadata including initialization status and active state. Use `-f json` for machine-readable output.
98
161
 
99
162
  **Use this when:**
@@ -111,50 +174,121 @@ brv locations -f json
111
174
 
112
175
  JSON fields: `projectPath`, `contextTreePath`, `isCurrent`, `isActive`, `isInitialized`.
113
176
 
114
- ### 5. Cloud Sync (Optional)
115
- **Overview:** Sync your local knowledge with a team via ByteRover's cloud service. Requires ByteRover authentication.
177
+ ### 6. Version Control
178
+ **Overview:** `brv vc` provides git-based version control for your context tree. It uses standard git semantics — branching, committing, merging, history, and conflict resolution — all working locally with no authentication required. Remote sync with a team is optional. The legacy `brv push`, `brv pull`, and `brv space` commands are deprecated — use `brv vc push`, `brv vc pull`, and `brv vc clone`/`brv vc remote add` instead.
179
+
180
+ **Use this when:**
181
+ - The user wants to track, commit, or inspect changes to the knowledge base
182
+ - The user wants to branch, merge, or undo knowledge changes
183
+ - The user wants to sync knowledge with a team (push/pull)
184
+ - The user wants to connect to or clone a team space
185
+ - The user asks about knowledge history or diffs
186
+
187
+ **Do NOT use this when:**
188
+ - The user wants to query or curate knowledge — use `brv query`/`brv curate` instead
189
+ - The user wants to review pending curate operations — use `brv review` instead
190
+ - Version control is not initialized and the user didn't ask to set it up
191
+
192
+ **Commands:**
193
+
194
+ Available commands: `init`, `status`, `add`, `commit`, `reset`, `log`, `branch`, `checkout`, `merge`, `config`, `clone`, `remote`, `fetch`, `push`, `pull`.
116
195
 
117
- **Setup steps:**
118
- 1. Log in: Get an API key from your ByteRover account and authenticate:
196
+ #### First-Time Setup
197
+
198
+ **Setup — local (no auth needed):**
199
+ ```bash
200
+ brv vc init
201
+ brv vc config user.name "Your Name"
202
+ brv vc config user.email "you@example.com"
203
+ ```
204
+
205
+ **Setup — clone a team space (requires `brv login`):**
119
206
  ```bash
120
207
  brv login --api-key sample-key-string
208
+ brv vc clone https://byterover.dev/<team>/<space>.git
121
209
  ```
122
- 2. List available spaces:
210
+
211
+ **Setup — connect existing project to a remote (requires `brv login`):**
123
212
  ```bash
124
- brv space list
213
+ brv login --api-key sample-key-string
214
+ brv vc remote add origin https://byterover.dev/<team>/<space>.git
125
215
  ```
126
- Sample output:
216
+
217
+ #### Local Workflow
218
+
219
+ **Check status:**
220
+ ```bash
221
+ brv vc status
127
222
  ```
128
- brv space list
129
- 1. human-resources-team (team)
130
- - a-department (space)
131
- - b-department (space)
132
- 2. marketing-team (team)
133
- - c-department (space)
134
- - d-department (space)
223
+
224
+ **Stage and commit:**
225
+ ```bash
226
+ brv vc add . # stage all
227
+ brv vc add notes.md docs/ # stage specific files
228
+ brv vc commit -m "add authentication patterns"
135
229
  ```
136
- 3. Connect to a space:
230
+
231
+ **View history:**
137
232
  ```bash
138
- brv space switch --team human-resources-team --name a-department
233
+ brv vc log
234
+ brv vc log --limit 20
235
+ brv vc log --all
139
236
  ```
140
237
 
141
- **Cloud sync commands:**
142
- Once connected, `brv push` and `brv pull` sync with that space.
238
+ **Unstage or undo:**
143
239
  ```bash
144
- # Pull team updates
145
- brv pull
240
+ brv vc reset # unstage all files
241
+ brv vc reset <file> # unstage a specific file
242
+ brv vc reset --soft HEAD~1 # undo last commit, keep changes staged
243
+ brv vc reset --hard HEAD~1 # discard last commit and changes
244
+ ```
146
245
 
147
- # Push local changes
148
- brv push
246
+ #### Branch Management
247
+
248
+ ```bash
249
+ brv vc branch # list branches
250
+ brv vc branch feature/auth # create a branch
251
+ brv vc branch -a # list all (including remote-tracking)
252
+ brv vc branch -d feature/auth # delete a branch
253
+ brv vc checkout feature/auth # switch branch
254
+ brv vc checkout -b feature/new # create and switch
255
+ ```
256
+
257
+ **Merge:**
258
+ ```bash
259
+ brv vc merge feature/auth # merge into current branch
260
+ brv vc merge --continue # continue after resolving conflicts
261
+ brv vc merge --abort # abort a conflicted merge
262
+ ```
263
+
264
+ **Set upstream tracking:**
265
+ ```bash
266
+ brv vc branch --set-upstream-to origin/main
267
+ ```
268
+
269
+ #### Cloud Sync (Remote Operations)
270
+
271
+ Requires ByteRover authentication (`brv login`) and a configured remote.
272
+
273
+ **Manage remotes:**
274
+ ```bash
275
+ brv vc remote # show current remote
276
+ brv vc remote add origin <url> # add a remote
277
+ brv vc remote set-url origin <url> # update remote URL
278
+ ```
279
+
280
+ **Fetch, pull, and push:**
281
+ ```bash
282
+ brv vc fetch # fetch remote refs
283
+ brv vc pull # fetch + merge remote commits
284
+ brv vc push # push commits to cloud
285
+ brv vc push -u origin main # push and set upstream tracking
149
286
  ```
150
287
 
151
- **Switching spaces:**
152
- - Push local changes first (`brv push`) — switching is blocked if unsaved changes exist.
153
- - Then switch:
288
+ **Clone a space:**
154
289
  ```bash
155
- brv space switch --team marketing-team --name d-department
290
+ brv vc clone https://byterover.dev/<team>/<space>.git
156
291
  ```
157
- - The switch automatically pulls context from the new space.
158
292
 
159
293
  ## Data Handling
160
294
 
@@ -162,9 +296,9 @@ brv space switch --team marketing-team --name d-department
162
296
 
163
297
  **File access**: The `-f` flag on `brv curate` reads files from the current project directory only. Paths outside the project root are rejected. Maximum 5 files per command, text and document formats only.
164
298
 
165
- **LLM usage**: `brv query` and `brv curate` send context to a configured LLM provider for processing. The LLM sees the query or curate text and any included file contents. No data is sent to ByteRover servers unless you explicitly run `brv push`.
299
+ **LLM usage**: `brv query` and `brv curate` send context to a configured LLM provider for processing. The LLM sees the query or curate text and any included file contents. No data is sent to ByteRover servers unless you explicitly run `brv vc push`.
166
300
 
167
- **Cloud sync**: `brv push` and `brv pull` require authentication (`brv login`) and send knowledge to ByteRover's cloud service. All other commands operate without ByteRover authentication.
301
+ **Cloud sync**: `brv vc push` and `brv vc pull` require authentication (`brv login`) and sync knowledge with ByteRover's cloud service via git. All other commands operate without ByteRover authentication.
168
302
 
169
303
  ## Error Handling
170
304
  **User Action Required:**
@@ -2,43 +2,91 @@ import { z } from 'zod';
2
2
  import type { CurateLogOperation } from '../core/domain/entities/curate-log-entry.js';
3
3
  import type { LlmToolResultEvent } from '../core/domain/transport/schemas.js';
4
4
  export declare const CurateOperationSchema: z.ZodObject<{
5
+ additionalFilePaths: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
6
+ confidence: z.ZodOptional<z.ZodEnum<["high", "low"]>>;
5
7
  filePath: z.ZodOptional<z.ZodString>;
8
+ impact: z.ZodOptional<z.ZodEnum<["high", "low"]>>;
6
9
  message: z.ZodOptional<z.ZodString>;
10
+ needsReview: z.ZodOptional<z.ZodBoolean>;
7
11
  path: z.ZodString;
12
+ previousSummary: z.ZodOptional<z.ZodString>;
13
+ reason: z.ZodOptional<z.ZodString>;
14
+ reviewStatus: z.ZodOptional<z.ZodEnum<["approved", "pending", "rejected"]>>;
8
15
  status: z.ZodEnum<["failed", "success"]>;
16
+ summary: z.ZodOptional<z.ZodString>;
9
17
  type: z.ZodEnum<["ADD", "DELETE", "MERGE", "UPDATE", "UPSERT"]>;
10
18
  }, "strip", z.ZodTypeAny, {
11
19
  path: string;
12
20
  type: "ADD" | "DELETE" | "MERGE" | "UPDATE" | "UPSERT";
13
21
  status: "failed" | "success";
14
22
  message?: string | undefined;
23
+ summary?: string | undefined;
24
+ reason?: string | undefined;
15
25
  filePath?: string | undefined;
26
+ confidence?: "high" | "low" | undefined;
27
+ impact?: "high" | "low" | undefined;
28
+ additionalFilePaths?: string[] | undefined;
29
+ needsReview?: boolean | undefined;
30
+ previousSummary?: string | undefined;
31
+ reviewStatus?: "pending" | "rejected" | "approved" | undefined;
16
32
  }, {
17
33
  path: string;
18
34
  type: "ADD" | "DELETE" | "MERGE" | "UPDATE" | "UPSERT";
19
35
  status: "failed" | "success";
20
36
  message?: string | undefined;
37
+ summary?: string | undefined;
38
+ reason?: string | undefined;
21
39
  filePath?: string | undefined;
40
+ confidence?: "high" | "low" | undefined;
41
+ impact?: "high" | "low" | undefined;
42
+ additionalFilePaths?: string[] | undefined;
43
+ needsReview?: boolean | undefined;
44
+ previousSummary?: string | undefined;
45
+ reviewStatus?: "pending" | "rejected" | "approved" | undefined;
22
46
  }>;
23
47
  export declare const CurateResultSchema: z.ZodObject<{
24
48
  applied: z.ZodOptional<z.ZodArray<z.ZodObject<{
49
+ additionalFilePaths: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
50
+ confidence: z.ZodOptional<z.ZodEnum<["high", "low"]>>;
25
51
  filePath: z.ZodOptional<z.ZodString>;
52
+ impact: z.ZodOptional<z.ZodEnum<["high", "low"]>>;
26
53
  message: z.ZodOptional<z.ZodString>;
54
+ needsReview: z.ZodOptional<z.ZodBoolean>;
27
55
  path: z.ZodString;
56
+ previousSummary: z.ZodOptional<z.ZodString>;
57
+ reason: z.ZodOptional<z.ZodString>;
58
+ reviewStatus: z.ZodOptional<z.ZodEnum<["approved", "pending", "rejected"]>>;
28
59
  status: z.ZodEnum<["failed", "success"]>;
60
+ summary: z.ZodOptional<z.ZodString>;
29
61
  type: z.ZodEnum<["ADD", "DELETE", "MERGE", "UPDATE", "UPSERT"]>;
30
62
  }, "strip", z.ZodTypeAny, {
31
63
  path: string;
32
64
  type: "ADD" | "DELETE" | "MERGE" | "UPDATE" | "UPSERT";
33
65
  status: "failed" | "success";
34
66
  message?: string | undefined;
67
+ summary?: string | undefined;
68
+ reason?: string | undefined;
35
69
  filePath?: string | undefined;
70
+ confidence?: "high" | "low" | undefined;
71
+ impact?: "high" | "low" | undefined;
72
+ additionalFilePaths?: string[] | undefined;
73
+ needsReview?: boolean | undefined;
74
+ previousSummary?: string | undefined;
75
+ reviewStatus?: "pending" | "rejected" | "approved" | undefined;
36
76
  }, {
37
77
  path: string;
38
78
  type: "ADD" | "DELETE" | "MERGE" | "UPDATE" | "UPSERT";
39
79
  status: "failed" | "success";
40
80
  message?: string | undefined;
81
+ summary?: string | undefined;
82
+ reason?: string | undefined;
41
83
  filePath?: string | undefined;
84
+ confidence?: "high" | "low" | undefined;
85
+ impact?: "high" | "low" | undefined;
86
+ additionalFilePaths?: string[] | undefined;
87
+ needsReview?: boolean | undefined;
88
+ previousSummary?: string | undefined;
89
+ reviewStatus?: "pending" | "rejected" | "approved" | undefined;
42
90
  }>, "many">>;
43
91
  summary: z.ZodOptional<z.ZodObject<{
44
92
  added: z.ZodOptional<z.ZodNumber>;
@@ -72,7 +120,15 @@ export declare const CurateResultSchema: z.ZodObject<{
72
120
  type: "ADD" | "DELETE" | "MERGE" | "UPDATE" | "UPSERT";
73
121
  status: "failed" | "success";
74
122
  message?: string | undefined;
123
+ summary?: string | undefined;
124
+ reason?: string | undefined;
75
125
  filePath?: string | undefined;
126
+ confidence?: "high" | "low" | undefined;
127
+ impact?: "high" | "low" | undefined;
128
+ additionalFilePaths?: string[] | undefined;
129
+ needsReview?: boolean | undefined;
130
+ previousSummary?: string | undefined;
131
+ reviewStatus?: "pending" | "rejected" | "approved" | undefined;
76
132
  }[] | undefined;
77
133
  }, {
78
134
  summary?: {
@@ -87,7 +143,15 @@ export declare const CurateResultSchema: z.ZodObject<{
87
143
  type: "ADD" | "DELETE" | "MERGE" | "UPDATE" | "UPSERT";
88
144
  status: "failed" | "success";
89
145
  message?: string | undefined;
146
+ summary?: string | undefined;
147
+ reason?: string | undefined;
90
148
  filePath?: string | undefined;
149
+ confidence?: "high" | "low" | undefined;
150
+ impact?: "high" | "low" | undefined;
151
+ additionalFilePaths?: string[] | undefined;
152
+ needsReview?: boolean | undefined;
153
+ previousSummary?: string | undefined;
154
+ reviewStatus?: "pending" | "rejected" | "approved" | undefined;
91
155
  }[] | undefined;
92
156
  }>;
93
157
  /**
@@ -1,10 +1,18 @@
1
1
  import { z } from 'zod';
2
2
  // ── Zod schemas ──────────────────────────────────────────────────────────────
3
3
  export const CurateOperationSchema = z.object({
4
+ additionalFilePaths: z.array(z.string()).optional(),
5
+ confidence: z.enum(['high', 'low']).optional(),
4
6
  filePath: z.string().optional(),
7
+ impact: z.enum(['high', 'low']).optional(),
5
8
  message: z.string().optional(),
9
+ needsReview: z.boolean().optional(),
6
10
  path: z.string(),
11
+ previousSummary: z.string().optional(),
12
+ reason: z.string().optional(),
13
+ reviewStatus: z.enum(['approved', 'pending', 'rejected']).optional(),
7
14
  status: z.enum(['failed', 'success']),
15
+ summary: z.string().optional(),
8
16
  type: z.enum(['ADD', 'DELETE', 'MERGE', 'UPDATE', 'UPSERT']),
9
17
  });
10
18
  export const CurateResultSchema = z.object({
@@ -26,7 +26,7 @@ export interface FileReadResult {
26
26
  /**
27
27
  * Configuration options for file reading.
28
28
  */
29
- export interface FileContentReaderConfig {
29
+ interface FileContentReaderConfig {
30
30
  /** Maximum content length per file in characters (default: 40000) */
31
31
  maxContentLength?: number;
32
32
  /** Maximum lines to read for text files (default: 2000) */
@@ -79,3 +79,4 @@ export declare class FileContentReader {
79
79
  * Factory function to create a FileContentReader instance.
80
80
  */
81
81
  export declare function createFileContentReader(documentParser?: IDocumentParserService): FileContentReader;
82
+ export {};
@@ -1,18 +1,3 @@
1
- /**
2
- * Finds the most recent file in a directory by modification time.
3
- * @param directory - Absolute path to directory to search
4
- * @returns Absolute path to the most recent file
5
- * @throws Error if directory is empty or doesn't exist
6
- */
7
- export declare function findLatestFile(directory: string): Promise<string>;
8
- /**
9
- * Removes all files from a directory while preserving the directory itself.
10
- * Returns the number of files removed.
11
- * Silently succeeds if directory doesn't exist.
12
- * @param dirPath - Absolute path to directory to clear
13
- * @returns Number of files removed
14
- */
15
- export declare function clearDirectory(dirPath: string): Promise<number>;
16
1
  /**
17
2
  * Sanitizes a folder path by replacing all special characters with a hyphen.
18
3
  * @param folderName - The folder path need to sanitize
@@ -33,12 +18,3 @@ export declare function sanitizeFolderName(folderName: string): string;
33
18
  * ```
34
19
  */
35
20
  export declare function toSnakeCase(name: string): string;
36
- /**
37
- * Lists all immediate children (files and directories) of the given directory,
38
- * and, for each child folder, shows its own immediate children.
39
- * @param dirPath The directory path whose children to list.
40
- * @returns An object where keys are child names, and values are:
41
- * - for files: undefined
42
- * - for directories: an array of their immediate children
43
- */
44
- export declare function listDirectoryChildren(dirPath?: string): Record<string, string[] | undefined>;
@@ -1,49 +1,3 @@
1
- import fs from 'node:fs';
2
- import { readdir, unlink } from 'node:fs/promises';
3
- import { join } from 'node:path';
4
- /**
5
- * Finds the most recent file in a directory by modification time.
6
- * @param directory - Absolute path to directory to search
7
- * @returns Absolute path to the most recent file
8
- * @throws Error if directory is empty or doesn't exist
9
- */
10
- export async function findLatestFile(directory) {
11
- const files = await readdir(directory, { withFileTypes: true });
12
- const fileNames = files.filter((f) => f.isFile()).map((f) => f.name);
13
- if (fileNames.length === 0) {
14
- throw new Error(`No files found in directory: ${directory}`);
15
- }
16
- // Sort files by name (timestamp-based naming ensures latest is last)
17
- // Assuming filenames follow pattern: prefix-{timestamp}.json
18
- fileNames.sort();
19
- const latestFile = fileNames.at(-1);
20
- return join(directory, latestFile);
21
- }
22
- /**
23
- * Removes all files from a directory while preserving the directory itself.
24
- * Returns the number of files removed.
25
- * Silently succeeds if directory doesn't exist.
26
- * @param dirPath - Absolute path to directory to clear
27
- * @returns Number of files removed
28
- */
29
- export async function clearDirectory(dirPath) {
30
- try {
31
- const entries = await readdir(dirPath, { withFileTypes: true });
32
- // Filter to only get files (not subdirectories)
33
- const files = entries.filter((entry) => entry.isFile());
34
- // Remove each file
35
- await Promise.all(files.map((file) => unlink(join(dirPath, file.name))));
36
- return files.length;
37
- }
38
- catch (error) {
39
- // If directory doesn't exist (ENOENT), return 0
40
- if (error.code === 'ENOENT') {
41
- return 0;
42
- }
43
- // Re-throw other errors
44
- throw error;
45
- }
46
- }
47
1
  /**
48
2
  * Sanitizes a folder path by replacing all special characters with a hyphen.
49
3
  * @param folderName - The folder path need to sanitize
@@ -73,38 +27,3 @@ export function toSnakeCase(name) {
73
27
  .replaceAll(/_{2,}/g, '_')
74
28
  .replaceAll(/^_|_$/g, '');
75
29
  }
76
- /**
77
- * Lists all immediate children (files and directories) of the given directory,
78
- * and, for each child folder, shows its own immediate children.
79
- * @param dirPath The directory path whose children to list.
80
- * @returns An object where keys are child names, and values are:
81
- * - for files: undefined
82
- * - for directories: an array of their immediate children
83
- */
84
- export function listDirectoryChildren(dirPath = '.brv/context-tree') {
85
- const result = {};
86
- const children = fs.readdirSync(dirPath);
87
- for (const child of children) {
88
- const childPath = `${dirPath}/${child}`;
89
- let stat;
90
- try {
91
- stat = fs.statSync(childPath);
92
- }
93
- catch {
94
- result[child] = undefined;
95
- continue;
96
- }
97
- if (stat.isDirectory()) {
98
- try {
99
- result[child] = fs.readdirSync(childPath);
100
- }
101
- catch {
102
- result[child] = undefined;
103
- }
104
- }
105
- else {
106
- result[child] = undefined;
107
- }
108
- }
109
- return result;
110
- }