@shepai/cli 1.123.0 → 1.124.0-pr396.2dd2ae6

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 (222) hide show
  1. package/dist/packages/core/src/application/ports/output/services/git-pr-service.interface.d.ts +68 -5
  2. package/dist/packages/core/src/application/ports/output/services/git-pr-service.interface.d.ts.map +1 -1
  3. package/dist/packages/core/src/application/ports/output/services/git-pr-service.interface.js +6 -4
  4. package/dist/packages/core/src/application/use-cases/features/rebase-feature-on-main.use-case.d.ts +28 -0
  5. package/dist/packages/core/src/application/use-cases/features/rebase-feature-on-main.use-case.d.ts.map +1 -0
  6. package/dist/packages/core/src/application/use-cases/features/rebase-feature-on-main.use-case.js +81 -0
  7. package/dist/packages/core/src/application/use-cases/repositories/sync-repository-main.use-case.d.ts +16 -0
  8. package/dist/packages/core/src/application/use-cases/repositories/sync-repository-main.use-case.d.ts.map +1 -0
  9. package/dist/packages/core/src/application/use-cases/repositories/sync-repository-main.use-case.js +43 -0
  10. package/dist/packages/core/src/infrastructure/di/container.d.ts.map +1 -1
  11. package/dist/packages/core/src/infrastructure/di/container.js +15 -0
  12. package/dist/packages/core/src/infrastructure/services/agents/conflict-resolution/conflict-resolution.prompt.d.ts +35 -0
  13. package/dist/packages/core/src/infrastructure/services/agents/conflict-resolution/conflict-resolution.prompt.d.ts.map +1 -0
  14. package/dist/packages/core/src/infrastructure/services/agents/conflict-resolution/conflict-resolution.prompt.js +66 -0
  15. package/dist/packages/core/src/infrastructure/services/agents/conflict-resolution/conflict-resolution.service.d.ts +42 -0
  16. package/dist/packages/core/src/infrastructure/services/agents/conflict-resolution/conflict-resolution.service.d.ts.map +1 -0
  17. package/dist/packages/core/src/infrastructure/services/agents/conflict-resolution/conflict-resolution.service.js +169 -0
  18. package/dist/packages/core/src/infrastructure/services/git/git-pr.service.d.ts +6 -0
  19. package/dist/packages/core/src/infrastructure/services/git/git-pr.service.d.ts.map +1 -1
  20. package/dist/packages/core/src/infrastructure/services/git/git-pr.service.js +125 -0
  21. package/dist/src/presentation/web/app/actions/rebase-feature.d.ts +5 -0
  22. package/dist/src/presentation/web/app/actions/rebase-feature.d.ts.map +1 -0
  23. package/dist/src/presentation/web/app/actions/rebase-feature.js +16 -0
  24. package/dist/src/presentation/web/app/actions/sync-repository.d.ts +5 -0
  25. package/dist/src/presentation/web/app/actions/sync-repository.d.ts.map +1 -0
  26. package/dist/src/presentation/web/app/actions/sync-repository.js +16 -0
  27. package/dist/src/presentation/web/components/common/control-center-drawer/feature-drawer-client.d.ts.map +1 -1
  28. package/dist/src/presentation/web/components/common/control-center-drawer/feature-drawer-client.js +2 -1
  29. package/dist/src/presentation/web/components/common/control-center-drawer/repository-drawer-client.d.ts.map +1 -1
  30. package/dist/src/presentation/web/components/common/control-center-drawer/repository-drawer-client.js +4 -4
  31. package/dist/src/presentation/web/components/common/feature-drawer/use-feature-actions.d.ts +4 -0
  32. package/dist/src/presentation/web/components/common/feature-drawer/use-feature-actions.d.ts.map +1 -1
  33. package/dist/src/presentation/web/components/common/feature-drawer/use-feature-actions.js +32 -1
  34. package/dist/src/presentation/web/components/common/feature-drawer-tabs/feature-drawer-tabs.d.ts +4 -1
  35. package/dist/src/presentation/web/components/common/feature-drawer-tabs/feature-drawer-tabs.d.ts.map +1 -1
  36. package/dist/src/presentation/web/components/common/feature-drawer-tabs/feature-drawer-tabs.js +2 -2
  37. package/dist/src/presentation/web/components/common/feature-drawer-tabs/overview-tab.d.ts +4 -1
  38. package/dist/src/presentation/web/components/common/feature-drawer-tabs/overview-tab.d.ts.map +1 -1
  39. package/dist/src/presentation/web/components/common/feature-drawer-tabs/overview-tab.js +8 -3
  40. package/dist/src/presentation/web/components/common/feature-drawer-tabs/overview-tab.stories.d.ts +6 -0
  41. package/dist/src/presentation/web/components/common/feature-drawer-tabs/overview-tab.stories.d.ts.map +1 -1
  42. package/dist/src/presentation/web/components/common/feature-drawer-tabs/overview-tab.stories.js +30 -0
  43. package/dist/src/presentation/web/components/common/feature-node/feature-node.d.ts.map +1 -1
  44. package/dist/src/presentation/web/components/common/feature-node/feature-node.js +14 -6
  45. package/dist/src/presentation/web/components/common/feature-node/feature-node.stories.d.ts +1 -0
  46. package/dist/src/presentation/web/components/common/feature-node/feature-node.stories.d.ts.map +1 -1
  47. package/dist/src/presentation/web/components/common/feature-node/feature-node.stories.js +16 -0
  48. package/dist/src/presentation/web/components/common/open-action-menu/open-action-menu.stories.d.ts.map +1 -1
  49. package/dist/src/presentation/web/components/common/open-action-menu/open-action-menu.stories.js +3 -0
  50. package/dist/src/presentation/web/components/common/repository-node/repository-drawer.d.ts.map +1 -1
  51. package/dist/src/presentation/web/components/common/repository-node/repository-drawer.js +3 -3
  52. package/dist/src/presentation/web/components/common/repository-node/repository-node.js +1 -1
  53. package/dist/src/presentation/web/components/common/repository-node/use-repository-actions.d.ts +4 -0
  54. package/dist/src/presentation/web/components/common/repository-node/use-repository-actions.d.ts.map +1 -1
  55. package/dist/src/presentation/web/components/common/repository-node/use-repository-actions.js +11 -0
  56. package/dist/tsconfig.build.tsbuildinfo +1 -1
  57. package/package.json +1 -1
  58. package/web/.next/BUILD_ID +1 -1
  59. package/web/.next/build-manifest.json +2 -2
  60. package/web/.next/fallback-build-manifest.json +2 -2
  61. package/web/.next/prerender-manifest.json +3 -3
  62. package/web/.next/required-server-files.js +3 -3
  63. package/web/.next/required-server-files.json +3 -3
  64. package/web/.next/server/app/(dashboard)/@drawer/create/page/server-reference-manifest.json +59 -44
  65. package/web/.next/server/app/(dashboard)/@drawer/create/page.js +1 -1
  66. package/web/.next/server/app/(dashboard)/@drawer/create/page.js.nft.json +1 -1
  67. package/web/.next/server/app/(dashboard)/@drawer/create/page_client-reference-manifest.js +1 -1
  68. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/server-reference-manifest.json +86 -56
  69. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js +1 -1
  70. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  71. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  72. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/server-reference-manifest.json +86 -56
  73. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js +1 -1
  74. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js.nft.json +1 -1
  75. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page_client-reference-manifest.js +1 -1
  76. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/server-reference-manifest.json +55 -40
  77. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js +1 -1
  78. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js.nft.json +1 -1
  79. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  80. package/web/.next/server/app/(dashboard)/create/page/server-reference-manifest.json +59 -44
  81. package/web/.next/server/app/(dashboard)/create/page.js +1 -1
  82. package/web/.next/server/app/(dashboard)/create/page.js.nft.json +1 -1
  83. package/web/.next/server/app/(dashboard)/create/page_client-reference-manifest.js +1 -1
  84. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/server-reference-manifest.json +86 -56
  85. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js +1 -1
  86. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  87. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  88. package/web/.next/server/app/(dashboard)/feature/[featureId]/page/server-reference-manifest.json +86 -56
  89. package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js +1 -1
  90. package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js.nft.json +1 -1
  91. package/web/.next/server/app/(dashboard)/feature/[featureId]/page_client-reference-manifest.js +1 -1
  92. package/web/.next/server/app/(dashboard)/page/server-reference-manifest.json +55 -40
  93. package/web/.next/server/app/(dashboard)/page.js +1 -1
  94. package/web/.next/server/app/(dashboard)/page.js.nft.json +1 -1
  95. package/web/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
  96. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/server-reference-manifest.json +55 -40
  97. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js +1 -1
  98. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js.nft.json +1 -1
  99. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  100. package/web/.next/server/app/_global-error.html +2 -2
  101. package/web/.next/server/app/_global-error.rsc +1 -1
  102. package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  103. package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  104. package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  105. package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  106. package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  107. package/web/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
  108. package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  109. package/web/.next/server/app/api/attachments/preview/route.js.nft.json +1 -1
  110. package/web/.next/server/app/api/evidence/route.js.nft.json +1 -1
  111. package/web/.next/server/app/api/graph-data/route.js.nft.json +1 -1
  112. package/web/.next/server/app/settings/page/server-reference-manifest.json +6 -6
  113. package/web/.next/server/app/settings/page.js.nft.json +1 -1
  114. package/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  115. package/web/.next/server/app/skills/page/server-reference-manifest.json +6 -6
  116. package/web/.next/server/app/skills/page.js.nft.json +1 -1
  117. package/web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  118. package/web/.next/server/app/tools/page/server-reference-manifest.json +6 -6
  119. package/web/.next/server/app/tools/page.js.nft.json +1 -1
  120. package/web/.next/server/app/tools/page_client-reference-manifest.js +1 -1
  121. package/web/.next/server/app/version/page/server-reference-manifest.json +1 -1
  122. package/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
  123. package/web/.next/server/chunks/[root-of-the-server]__a402b567._.js +1 -1
  124. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js +1 -1
  125. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js.map +1 -1
  126. package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_@drawer_repository_[repositoryId]_page_actions_9efdd752.js +3 -0
  127. package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_@drawer_repository_[repositoryId]_page_actions_9efdd752.js.map +1 -0
  128. package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_repository_[repositoryId]_page_actions_6ce19942.js +3 -0
  129. package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_repository_[repositoryId]_page_actions_6ce19942.js.map +1 -0
  130. package/web/.next/server/chunks/ssr/[root-of-the-server]__06fef644._.js +1 -1
  131. package/web/.next/server/chunks/ssr/[root-of-the-server]__14664e9b._.js +2 -2
  132. package/web/.next/server/chunks/ssr/[root-of-the-server]__14664e9b._.js.map +1 -1
  133. package/web/.next/server/chunks/ssr/[root-of-the-server]__16a547fc._.js +3 -0
  134. package/web/.next/server/chunks/ssr/[root-of-the-server]__16a547fc._.js.map +1 -0
  135. package/web/.next/server/chunks/ssr/[root-of-the-server]__545792ab._.js +1 -1
  136. package/web/.next/server/chunks/ssr/[root-of-the-server]__545792ab._.js.map +1 -1
  137. package/web/.next/server/chunks/ssr/[root-of-the-server]__6b17a22d._.js +1 -1
  138. package/web/.next/server/chunks/ssr/[root-of-the-server]__6b17a22d._.js.map +1 -1
  139. package/web/.next/server/chunks/ssr/[root-of-the-server]__6bb00d90._.js +2 -2
  140. package/web/.next/server/chunks/ssr/[root-of-the-server]__6bb00d90._.js.map +1 -1
  141. package/web/.next/server/chunks/ssr/[root-of-the-server]__7a715c73._.js +3 -0
  142. package/web/.next/server/chunks/ssr/{[root-of-the-server]__ce6057f6._.js.map → [root-of-the-server]__7a715c73._.js.map} +1 -1
  143. package/web/.next/server/chunks/ssr/[root-of-the-server]__804c006d._.js +1 -1
  144. package/web/.next/server/chunks/ssr/[root-of-the-server]__804c006d._.js.map +1 -1
  145. package/web/.next/server/chunks/ssr/[root-of-the-server]__8c553503._.js +2 -2
  146. package/web/.next/server/chunks/ssr/[root-of-the-server]__a32640a5._.js +3 -0
  147. package/web/.next/server/chunks/ssr/{[root-of-the-server]__7cbda1ea._.js.map → [root-of-the-server]__a32640a5._.js.map} +1 -1
  148. package/web/.next/server/chunks/ssr/[root-of-the-server]__a7de2711._.js +2 -2
  149. package/web/.next/server/chunks/ssr/[root-of-the-server]__c94704d6._.js +3 -0
  150. package/web/.next/server/chunks/ssr/[root-of-the-server]__c94704d6._.js.map +1 -0
  151. package/web/.next/server/chunks/ssr/_135edb9c._.js +1 -1
  152. package/web/.next/server/chunks/ssr/_135edb9c._.js.map +1 -1
  153. package/web/.next/server/chunks/ssr/_2f6f48b8._.js +1 -1
  154. package/web/.next/server/chunks/ssr/_2f6f48b8._.js.map +1 -1
  155. package/web/.next/server/chunks/ssr/_966c4532._.js +3 -0
  156. package/web/.next/server/chunks/ssr/{_fd4c574b._.js.map → _966c4532._.js.map} +1 -1
  157. package/web/.next/server/chunks/ssr/_cc77a143._.js +1 -1
  158. package/web/.next/server/chunks/ssr/_cc77a143._.js.map +1 -1
  159. package/web/.next/server/chunks/ssr/{_960ceb5d._.js → _e2638d5f._.js} +2 -2
  160. package/web/.next/server/chunks/ssr/{_960ceb5d._.js.map → _e2638d5f._.js.map} +1 -1
  161. package/web/.next/server/chunks/ssr/_e9703421._.js +1 -1
  162. package/web/.next/server/chunks/ssr/_e9703421._.js.map +1 -1
  163. package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js +1 -1
  164. package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js.map +1 -1
  165. package/web/.next/server/chunks/ssr/f3a1f_components_common_control-center-drawer_repository-drawer-client_tsx_39a00c03._.js +1 -1
  166. package/web/.next/server/chunks/ssr/f3a1f_components_common_control-center-drawer_repository-drawer-client_tsx_39a00c03._.js.map +1 -1
  167. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_883074bc.js +3 -0
  168. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_883074bc.js.map +1 -0
  169. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1fa8042e.js +1 -1
  170. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1fa8042e.js.map +1 -1
  171. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_24684200.js +1 -1
  172. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_24684200.js.map +1 -1
  173. package/web/.next/server/chunks/ssr/src_presentation_web_components_bf50c527._.js +1 -1
  174. package/web/.next/server/chunks/ssr/src_presentation_web_components_bf50c527._.js.map +1 -1
  175. package/web/.next/server/chunks/ssr/src_presentation_web_components_de814675._.js +1 -1
  176. package/web/.next/server/chunks/ssr/src_presentation_web_components_de814675._.js.map +1 -1
  177. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js +1 -1
  178. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js.map +1 -1
  179. package/web/.next/server/chunks/ssr/src_presentation_web_d1d40a09._.js +5 -0
  180. package/web/.next/server/chunks/ssr/{src_presentation_web_c4337169._.js.map → src_presentation_web_d1d40a09._.js.map} +1 -1
  181. package/web/.next/server/chunks/ssr/src_presentation_web_e4e3c09b._.js +5 -0
  182. package/web/.next/server/chunks/ssr/{src_presentation_web_5f039db1._.js.map → src_presentation_web_e4e3c09b._.js.map} +1 -1
  183. package/web/.next/server/chunks/ssr/src_presentation_web_f6b57368._.js +3 -0
  184. package/web/.next/server/chunks/ssr/src_presentation_web_f6b57368._.js.map +1 -0
  185. package/web/.next/server/pages/500.html +2 -2
  186. package/web/.next/server/server-reference-manifest.js +1 -1
  187. package/web/.next/server/server-reference-manifest.json +357 -250
  188. package/web/.next/static/chunks/{e418898e8e02f50a.js → 0a25d970e4abd189.js} +1 -1
  189. package/web/.next/static/chunks/{9821072252ddb89a.js → 11fbcb908d07e234.js} +1 -1
  190. package/web/.next/static/chunks/4b51f8f4e49665b8.js +1 -0
  191. package/web/.next/static/chunks/{373e10090c6410c4.js → 513b719e49ca003a.js} +1 -1
  192. package/web/.next/static/chunks/{f0dfeedb263eb906.js → 77304c4f9c5bb158.js} +1 -1
  193. package/web/.next/static/chunks/{3f6c44cbad751310.js → 80f9e0cade7d717b.js} +1 -1
  194. package/web/.next/static/chunks/{310be54600c8ce20.js → 8b87caa5e8e72539.js} +2 -2
  195. package/web/.next/static/chunks/9b7dbb75030aac3e.js +1 -0
  196. package/web/.next/static/chunks/{64d063449c3be0ec.js → cd008e10baaeae9a.js} +1 -1
  197. package/web/.next/static/chunks/d71ce7044ed5a85a.js +2 -0
  198. package/web/.next/static/chunks/db8d50abcf46d8b3.js +1 -0
  199. package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_@drawer_repository_[repositoryId]_page_actions_f30d0343.js +0 -3
  200. package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_@drawer_repository_[repositoryId]_page_actions_f30d0343.js.map +0 -1
  201. package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_repository_[repositoryId]_page_actions_9f1775bb.js +0 -3
  202. package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_repository_[repositoryId]_page_actions_9f1775bb.js.map +0 -1
  203. package/web/.next/server/chunks/ssr/[root-of-the-server]__7cbda1ea._.js +0 -3
  204. package/web/.next/server/chunks/ssr/[root-of-the-server]__9e8b25ad._.js +0 -3
  205. package/web/.next/server/chunks/ssr/[root-of-the-server]__9e8b25ad._.js.map +0 -1
  206. package/web/.next/server/chunks/ssr/[root-of-the-server]__aed1d6f8._.js +0 -3
  207. package/web/.next/server/chunks/ssr/[root-of-the-server]__aed1d6f8._.js.map +0 -1
  208. package/web/.next/server/chunks/ssr/[root-of-the-server]__ce6057f6._.js +0 -3
  209. package/web/.next/server/chunks/ssr/_fd4c574b._.js +0 -3
  210. package/web/.next/server/chunks/ssr/src_presentation_web_5f039db1._.js +0 -5
  211. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_2a52b697.js +0 -3
  212. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_2a52b697.js.map +0 -1
  213. package/web/.next/server/chunks/ssr/src_presentation_web_c4337169._.js +0 -5
  214. package/web/.next/server/chunks/ssr/src_presentation_web_db779ef4._.js +0 -3
  215. package/web/.next/server/chunks/ssr/src_presentation_web_db779ef4._.js.map +0 -1
  216. package/web/.next/static/chunks/694718e5449b3150.js +0 -1
  217. package/web/.next/static/chunks/878643f90bc6360f.js +0 -2
  218. package/web/.next/static/chunks/94af5be1ccf8842e.js +0 -1
  219. package/web/.next/static/chunks/eb9841ec4d80af01.js +0 -1
  220. /package/web/.next/static/{gBTe97SiNDA2hbG9dbfpb → MpP2wa-zjPqcZxmpuDBjj}/_buildManifest.js +0 -0
  221. /package/web/.next/static/{gBTe97SiNDA2hbG9dbfpb → MpP2wa-zjPqcZxmpuDBjj}/_clientMiddlewareManifest.json +0 -0
  222. /package/web/.next/static/{gBTe97SiNDA2hbG9dbfpb → MpP2wa-zjPqcZxmpuDBjj}/_ssgManifest.js +0 -0
@@ -9,15 +9,17 @@ import type { PrStatus } from '../../../../domain/generated/output.js';
9
9
  * Error codes for git PR operations.
10
10
  */
11
11
  export declare enum GitPrErrorCode {
12
- MERGE_CONFLICT = "MERGE_CONFLICT",
13
12
  AUTH_FAILURE = "AUTH_FAILURE",
14
- GH_NOT_FOUND = "GH_NOT_FOUND",
15
- NETWORK_ERROR = "NETWORK_ERROR",
16
- CI_TIMEOUT = "CI_TIMEOUT",
17
13
  BRANCH_NOT_FOUND = "BRANCH_NOT_FOUND",
14
+ CI_TIMEOUT = "CI_TIMEOUT",
15
+ GH_NOT_FOUND = "GH_NOT_FOUND",
18
16
  GIT_ERROR = "GIT_ERROR",
17
+ MERGE_CONFLICT = "MERGE_CONFLICT",
19
18
  MERGE_FAILED = "MERGE_FAILED",
20
- PR_NOT_FOUND = "PR_NOT_FOUND"
19
+ NETWORK_ERROR = "NETWORK_ERROR",
20
+ PR_NOT_FOUND = "PR_NOT_FOUND",
21
+ REBASE_CONFLICT = "REBASE_CONFLICT",
22
+ SYNC_FAILED = "SYNC_FAILED"
21
23
  }
22
24
  /**
23
25
  * Typed error for git PR operations.
@@ -318,5 +320,66 @@ export interface IGitPrService {
318
320
  * @throws GitPrError with GH_NOT_FOUND or GIT_ERROR code on failure
319
321
  */
320
322
  getFailureLogs(cwd: string, runId: string, branch: string, logMaxChars?: number): Promise<string>;
323
+ /**
324
+ * Fast-forward the local base branch to match its remote counterpart.
325
+ * If currently on the base branch, uses `git pull --ff-only`.
326
+ * If on a different branch, uses `git fetch origin <baseBranch>:<baseBranch>`.
327
+ *
328
+ * @param cwd - Working directory path
329
+ * @param baseBranch - The base branch to sync (e.g. "main")
330
+ * @throws GitPrError with SYNC_FAILED code if the branch has diverged and cannot fast-forward
331
+ * @throws GitPrError with GIT_ERROR code on other git failures
332
+ */
333
+ syncMain(cwd: string, baseBranch: string): Promise<void>;
334
+ /**
335
+ * Rebase the feature branch onto the latest base branch.
336
+ * Checks for dirty worktree before starting. Detects conflict state
337
+ * from git exit code and stderr — throws REBASE_CONFLICT if conflicts
338
+ * are encountered (caller is responsible for resolution or abort).
339
+ *
340
+ * @param cwd - Working directory path
341
+ * @param featureBranch - The feature branch to rebase
342
+ * @param baseBranch - The base branch to rebase onto
343
+ * @throws GitPrError with GIT_ERROR code if the worktree is dirty
344
+ * @throws GitPrError with REBASE_CONFLICT code if conflicts are detected
345
+ * @throws GitPrError with BRANCH_NOT_FOUND code if a branch does not exist
346
+ */
347
+ rebaseOnMain(cwd: string, featureBranch: string, baseBranch: string): Promise<void>;
348
+ /**
349
+ * Get the list of files with unresolved conflicts (unmerged paths).
350
+ * Uses `git diff --name-only --diff-filter=U` to identify conflicted files.
351
+ *
352
+ * @param cwd - Working directory path
353
+ * @returns Array of file paths with unresolved conflicts
354
+ * @throws GitPrError with GIT_ERROR code on failure
355
+ */
356
+ getConflictedFiles(cwd: string): Promise<string[]>;
357
+ /**
358
+ * Stage specific files in the working directory.
359
+ * Uses `git add` for the specified file paths.
360
+ *
361
+ * @param cwd - Working directory path
362
+ * @param files - Array of file paths to stage
363
+ * @throws GitPrError with GIT_ERROR code on failure
364
+ */
365
+ stageFiles(cwd: string, files: string[]): Promise<void>;
366
+ /**
367
+ * Continue an in-progress rebase after conflicts have been resolved.
368
+ * Runs `git rebase --continue`. May throw REBASE_CONFLICT if the next
369
+ * commit in the rebase also has conflicts.
370
+ *
371
+ * @param cwd - Working directory path
372
+ * @throws GitPrError with REBASE_CONFLICT code if new conflicts are detected
373
+ * @throws GitPrError with GIT_ERROR code on other git failures
374
+ */
375
+ rebaseContinue(cwd: string): Promise<void>;
376
+ /**
377
+ * Abort an in-progress rebase, restoring the branch to its pre-rebase state.
378
+ * Runs `git rebase --abort`.
379
+ *
380
+ * @param cwd - Working directory path
381
+ * @throws GitPrError with GIT_ERROR code on failure
382
+ */
383
+ rebaseAbort(cwd: string): Promise<void>;
321
384
  }
322
385
  //# sourceMappingURL=git-pr-service.interface.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"git-pr-service.interface.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/core/src/application/ports/output/services/git-pr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face.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/core/src/application/ports/output/services/git-pr-service.interface.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC;AAEvE;;GAEG;AACH,oBAAY,cAAc;IACxB,YAAY,iBAAiB;IAC7B,gBAAgB,qBAAqB;IACrC,UAAU,eAAe;IACzB,YAAY,iBAAiB;IAC7B,SAAS,cAAc;IACvB,cAAc,mBAAmB;IACjC,YAAY,iBAAiB;IAC7B,aAAa,kBAAkB;IAC/B,YAAY,iBAAiB;IAC7B,eAAe,oBAAoB;IACnC,WAAW,gBAAgB;CAC5B;AAED;;GAEG;AACH,qBAAa,UAAW,SAAQ,KAAK;aAGjB,IAAI,EAAE,cAAc;aACpB,KAAK,CAAC,EAAE,KAAK;gBAF7B,OAAO,EAAE,MAAM,EACC,IAAI,EAAE,cAAc,EACpB,KAAK,CAAC,EAAE,KAAK,YAAA;CAKhC;AAED;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,CAAC;AAEzD;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,wBAAwB;IACxB,MAAM,EAAE,QAAQ,CAAC;IACjB,uDAAuD;IACvD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kDAAkD;IAClD,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,8BAA8B;IAC9B,YAAY,EAAE,MAAM,CAAC;IACrB,4BAA4B;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,8BAA8B;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,oCAAoC;IACpC,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,2CAA2C;IAC3C,MAAM,EAAE,MAAM,CAAC;IACf,qDAAqD;IACrD,KAAK,EAAE,QAAQ,E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AAE,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAIlG;;;;;;;;;OASG;IACH,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEzD;;;;;;;;;;;;OAYG;IACH,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEpF;;;;;;;OAOG;IACH,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAEnD;;;;;;;OAOG;IACH,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAExD;;;;;;;;OAQG;IACH,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE3C;;;;;;OAMG;IACH,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACzC"}
@@ -9,15 +9,17 @@
9
9
  */
10
10
  export var GitPrErrorCode;
11
11
  (function (GitPrErrorCode) {
12
- GitPrErrorCode["MERGE_CONFLICT"] = "MERGE_CONFLICT";
13
12
  GitPrErrorCode["AUTH_FAILURE"] = "AUTH_FAILURE";
14
- GitPrErrorCode["GH_NOT_FOUND"] = "GH_NOT_FOUND";
15
- GitPrErrorCode["NETWORK_ERROR"] = "NETWORK_ERROR";
16
- GitPrErrorCode["CI_TIMEOUT"] = "CI_TIMEOUT";
17
13
  GitPrErrorCode["BRANCH_NOT_FOUND"] = "BRANCH_NOT_FOUND";
14
+ GitPrErrorCode["CI_TIMEOUT"] = "CI_TIMEOUT";
15
+ GitPrErrorCode["GH_NOT_FOUND"] = "GH_NOT_FOUND";
18
16
  GitPrErrorCode["GIT_ERROR"] = "GIT_ERROR";
17
+ GitPrErrorCode["MERGE_CONFLICT"] = "MERGE_CONFLICT";
19
18
  GitPrErrorCode["MERGE_FAILED"] = "MERGE_FAILED";
19
+ GitPrErrorCode["NETWORK_ERROR"] = "NETWORK_ERROR";
20
20
  GitPrErrorCode["PR_NOT_FOUND"] = "PR_NOT_FOUND";
21
+ GitPrErrorCode["REBASE_CONFLICT"] = "REBASE_CONFLICT";
22
+ GitPrErrorCode["SYNC_FAILED"] = "SYNC_FAILED";
21
23
  })(GitPrErrorCode || (GitPrErrorCode = {}));
22
24
  /**
23
25
  * Typed error for git PR operations.
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Rebase Feature on Main Use Case
3
+ *
4
+ * Rebases a feature branch onto the latest main branch with auto-sync
5
+ * and agent-powered conflict resolution.
6
+ *
7
+ * Flow: resolve feature → determine cwd (worktree or repo root) →
8
+ * sync main → rebase → on conflict, delegate to ConflictResolutionService.
9
+ */
10
+ import type { IFeatureRepository } from '../../ports/output/repositories/feature-repository.interface.js';
11
+ import type { IGitPrService } from '../../ports/output/services/git-pr-service.interface.js';
12
+ import type { IWorktreeService } from '../../ports/output/services/worktree-service.interface.js';
13
+ import type { ConflictResolutionService } from '../../../infrastructure/services/agents/conflict-resolution/conflict-resolution.service.js';
14
+ export declare class RebaseFeatureOnMainUseCase {
15
+ private readonly featureRepo;
16
+ private readonly gitPrService;
17
+ private readonly worktreeService;
18
+ private readonly conflictResolutionService;
19
+ constructor(featureRepo: IFeatureRepository, gitPrService: IGitPrService, worktreeService: IWorktreeService, conflictResolutionService: ConflictResolutionService);
20
+ execute(featureId: string): Promise<void>;
21
+ /**
22
+ * Resolve the correct working directory for the feature.
23
+ * Uses the worktree path if a worktree exists for this branch,
24
+ * otherwise falls back to the repository root.
25
+ */
26
+ private resolveCwd;
27
+ }
28
+ //# sourceMappingURL=rebase-feature-on-main.use-case.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rebase-feature-on-main.use-case.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/application/use-cases/features/rebase-feature-on-main.use-case.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iEAAiE,CAAC;AAC1G,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yDAAyD,CAAC;AAK7F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2DAA2D,CAAC;AAClG,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,4FAA4F,CAAC;AAE5I,qBACa,0BAA0B;IAGnC,OAAO,CAAC,QAAQ,CAAC,WAAW;IAE5B,OAAO,CAAC,QAAQ,CAAC,YAAY;IAE7B,OAAO,CAAC,QAAQ,CAAC,eAAe;IAEhC,OAAO,CAAC,QAAQ,CAAC,yBAAyB;gBANzB,WAAW,EAAE,kBAAkB,EAE/B,YAAY,EAAE,aAAa,EAE3B,eAAe,EAAE,gBAAgB,EAEjC,yBAAyB,EAAE,yBAAyB;IAGjE,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IA6B/C;;;;OAIG;YACW,UAAU;CAOzB"}
@@ -0,0 +1,81 @@
1
+ /**
2
+ * Rebase Feature on Main Use Case
3
+ *
4
+ * Rebases a feature branch onto the latest main branch with auto-sync
5
+ * and agent-powered conflict resolution.
6
+ *
7
+ * Flow: resolve feature → determine cwd (worktree or repo root) →
8
+ * sync main → rebase → on conflict, delegate to ConflictResolutionService.
9
+ */
10
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
11
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
12
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
13
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
14
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
15
+ };
16
+ var __metadata = (this && this.__metadata) || function (k, v) {
17
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
18
+ };
19
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
20
+ return function (target, key) { decorator(target, key, paramIndex); }
21
+ };
22
+ import { injectable, inject } from 'tsyringe';
23
+ import { GitPrError, GitPrErrorCode, } from '../../ports/output/services/git-pr-service.interface.js';
24
+ let RebaseFeatureOnMainUseCase = class RebaseFeatureOnMainUseCase {
25
+ featureRepo;
26
+ gitPrService;
27
+ worktreeService;
28
+ conflictResolutionService;
29
+ constructor(featureRepo, gitPrService, worktreeService, conflictResolutionService) {
30
+ this.featureRepo = featureRepo;
31
+ this.gitPrService = gitPrService;
32
+ this.worktreeService = worktreeService;
33
+ this.conflictResolutionService = conflictResolutionService;
34
+ }
35
+ async execute(featureId) {
36
+ // Resolve feature by exact ID or prefix
37
+ const feature = (await this.featureRepo.findById(featureId)) ??
38
+ (await this.featureRepo.findByIdPrefix(featureId));
39
+ if (!feature) {
40
+ throw new Error(`Feature not found: "${featureId}"`);
41
+ }
42
+ // Determine working directory — worktree path if it exists, else repo root
43
+ const cwd = await this.resolveCwd(feature.repositoryPath, feature.branch);
44
+ const defaultBranch = await this.gitPrService.getDefaultBranch(feature.repositoryPath);
45
+ // Auto-sync main before rebasing (per spec decision)
46
+ await this.gitPrService.syncMain(cwd, defaultBranch);
47
+ // Attempt rebase
48
+ try {
49
+ await this.gitPrService.rebaseOnMain(cwd, feature.branch, defaultBranch);
50
+ }
51
+ catch (error) {
52
+ if (error instanceof GitPrError && error.code === GitPrErrorCode.REBASE_CONFLICT) {
53
+ // Delegate to agent-powered conflict resolution
54
+ await this.conflictResolutionService.resolve(cwd, feature.branch, defaultBranch);
55
+ return;
56
+ }
57
+ throw error;
58
+ }
59
+ }
60
+ /**
61
+ * Resolve the correct working directory for the feature.
62
+ * Uses the worktree path if a worktree exists for this branch,
63
+ * otherwise falls back to the repository root.
64
+ */
65
+ async resolveCwd(repositoryPath, branch) {
66
+ const hasWorktree = await this.worktreeService.exists(repositoryPath, branch);
67
+ if (hasWorktree) {
68
+ return this.worktreeService.getWorktreePath(repositoryPath, branch);
69
+ }
70
+ return repositoryPath;
71
+ }
72
+ };
73
+ RebaseFeatureOnMainUseCase = __decorate([
74
+ injectable(),
75
+ __param(0, inject('IFeatureRepository')),
76
+ __param(1, inject('IGitPrService')),
77
+ __param(2, inject('IWorktreeService')),
78
+ __param(3, inject('ConflictResolutionService')),
79
+ __metadata("design:paramtypes", [Object, Object, Object, Function])
80
+ ], RebaseFeatureOnMainUseCase);
81
+ export { RebaseFeatureOnMainUseCase };
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Sync Repository Main Use Case
3
+ *
4
+ * Syncs a repository's local main branch with the remote.
5
+ * Resolves the repository by ID, determines its path and default branch,
6
+ * then delegates to IGitPrService.syncMain().
7
+ */
8
+ import type { IRepositoryRepository } from '../../ports/output/repositories/repository-repository.interface.js';
9
+ import type { IGitPrService } from '../../ports/output/services/git-pr-service.interface.js';
10
+ export declare class SyncRepositoryMainUseCase {
11
+ private readonly repositoryRepo;
12
+ private readonly gitPrService;
13
+ constructor(repositoryRepo: IRepositoryRepository, gitPrService: IGitPrService);
14
+ execute(repoId: string): Promise<void>;
15
+ }
16
+ //# sourceMappingURL=sync-repository-main.use-case.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sync-repository-main.use-case.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/application/use-cases/repositories/sync-repository-main.use-case.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oEAAoE,CAAC;AAChH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yDAAyD,CAAC;AAE7F,qBACa,yBAAyB;IAGlC,OAAO,CAAC,QAAQ,CAAC,cAAc;IAE/B,OAAO,CAAC,QAAQ,CAAC,YAAY;gBAFZ,cAAc,EAAE,qBAAqB,EAErC,YAAY,EAAE,aAAa;IAGxC,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAS7C"}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Sync Repository Main Use Case
3
+ *
4
+ * Syncs a repository's local main branch with the remote.
5
+ * Resolves the repository by ID, determines its path and default branch,
6
+ * then delegates to IGitPrService.syncMain().
7
+ */
8
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
9
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
10
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
11
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
12
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
13
+ };
14
+ var __metadata = (this && this.__metadata) || function (k, v) {
15
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
16
+ };
17
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
18
+ return function (target, key) { decorator(target, key, paramIndex); }
19
+ };
20
+ import { injectable, inject } from 'tsyringe';
21
+ let SyncRepositoryMainUseCase = class SyncRepositoryMainUseCase {
22
+ repositoryRepo;
23
+ gitPrService;
24
+ constructor(repositoryRepo, gitPrService) {
25
+ this.repositoryRepo = repositoryRepo;
26
+ this.gitPrService = gitPrService;
27
+ }
28
+ async execute(repoId) {
29
+ const repository = await this.repositoryRepo.findById(repoId);
30
+ if (!repository) {
31
+ throw new Error(`Repository not found: "${repoId}"`);
32
+ }
33
+ const defaultBranch = await this.gitPrService.getDefaultBranch(repository.path);
34
+ await this.gitPrService.syncMain(repository.path, defaultBranch);
35
+ }
36
+ };
37
+ SyncRepositoryMainUseCase = __decorate([
38
+ injectable(),
39
+ __param(0, inject('IRepositoryRepository')),
40
+ __param(1, inject('IGitPrService')),
41
+ __metadata("design:paramtypes", [Object, Object])
42
+ ], SyncRepositoryMainUseCase);
43
+ export { SyncRepositoryMainUseCase };
@@ -1 +1 @@
1
- {"version":3,"file":"container.d.ts","sourceRoot":"","sources":["../../../../../../packages/core/src/infrastructure/di/container.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAoHrC;;;;;;GAMG;AACH,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,OAAO,SAAS,CAAC,CAiUrE;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,IAAI,OAAO,CAEhD;AAED;;;GAGG;AACH,OAAO,EAAE,SAAS,EAAE,CAAC"}
1
+ {"version":3,"file":"container.d.ts","sourceRoot":"","sources":["../../../../../../packages/core/src/infrastructure/di/container.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAuHrC;;;;;;GAMG;AACH,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,OAAO,SAAS,CAAC,CA6UrE;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,IAAI,OAAO,CAEhD;AAED;;;GAGG;AACH,OAAO,EAAE,SAAS,EAAE,CAAC"}
@@ -80,6 +80,9 @@ import { CheckAndUnblockFeaturesUseCase } from '../../application/use-cases/feat
80
80
  import { UpdateFeatureLifecycleUseCase } from '../../application/use-cases/features/update/update-feature-lifecycle.use-case.js';
81
81
  import { CleanupFeatureWorktreeUseCase } from '../../application/use-cases/features/cleanup-feature-worktree.use-case.js';
82
82
  import { UpgradeCliUseCase } from '../../application/use-cases/upgrade/upgrade-cli.use-case.js';
83
+ import { SyncRepositoryMainUseCase } from '../../application/use-cases/repositories/sync-repository-main.use-case.js';
84
+ import { RebaseFeatureOnMainUseCase } from '../../application/use-cases/features/rebase-feature-on-main.use-case.js';
85
+ import { ConflictResolutionService } from '../services/agents/conflict-resolution/conflict-resolution.service.js';
83
86
  // Session listing
84
87
  import { ClaudeCodeSessionRepository } from '../services/agents/sessions/claude-code-session.repository.js';
85
88
  import { StubSessionRepository } from '../services/agents/sessions/stub-session.repository.js';
@@ -295,6 +298,12 @@ export async function initializeContainer() {
295
298
  container.registerSingleton(UpdateFeatureLifecycleUseCase);
296
299
  container.registerSingleton(CleanupFeatureWorktreeUseCase);
297
300
  container.registerSingleton(UpgradeCliUseCase);
301
+ container.registerSingleton(ConflictResolutionService);
302
+ container.register('ConflictResolutionService', {
303
+ useFactory: (c) => c.resolve(ConflictResolutionService),
304
+ });
305
+ container.registerSingleton(SyncRepositoryMainUseCase);
306
+ container.registerSingleton(RebaseFeatureOnMainUseCase);
298
307
  // Session repositories (per-AgentType string tokens)
299
308
  container.register(`IAgentSessionRepository:${AgentType.ClaudeCode}`, {
300
309
  useFactory: () => new ClaudeCodeSessionRepository(),
@@ -385,6 +394,12 @@ export async function initializeContainer() {
385
394
  container.register('UpgradeCliUseCase', {
386
395
  useFactory: (c) => c.resolve(UpgradeCliUseCase),
387
396
  });
397
+ container.register('SyncRepositoryMainUseCase', {
398
+ useFactory: (c) => c.resolve(SyncRepositoryMainUseCase),
399
+ });
400
+ container.register('RebaseFeatureOnMainUseCase', {
401
+ useFactory: (c) => c.resolve(RebaseFeatureOnMainUseCase),
402
+ });
388
403
  _initialized = true;
389
404
  return container;
390
405
  }
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Conflict Resolution Prompt Builder
3
+ *
4
+ * Builds prompts for the AI agent to resolve git rebase conflicts.
5
+ * Follows the merge-prompts.ts pattern of pure functions returning
6
+ * markdown strings.
7
+ */
8
+ export interface ConflictedFile {
9
+ /** Relative file path from repo root */
10
+ path: string;
11
+ /** Full file contents including conflict markers */
12
+ content: string;
13
+ }
14
+ export interface ConflictResolutionPromptParams {
15
+ /** Files with conflict markers */
16
+ conflictedFiles: ConflictedFile[];
17
+ /** The feature branch being rebased */
18
+ featureBranch: string;
19
+ /** The base branch being rebased onto */
20
+ baseBranch: string;
21
+ /** 1-based attempt number */
22
+ attemptNumber: number;
23
+ /** Maximum allowed attempts */
24
+ maxAttempts: number;
25
+ /** Feedback from previous failed attempt (remaining markers info) */
26
+ previousFeedback?: string;
27
+ }
28
+ /**
29
+ * Build a prompt for the conflict resolution agent.
30
+ *
31
+ * The agent receives conflicted file contents and instructions to resolve
32
+ * all conflict markers by editing files in the working directory.
33
+ */
34
+ export declare function buildConflictResolutionPrompt(params: ConflictResolutionPromptParams): string;
35
+ //# sourceMappingURL=conflict-resolution.prompt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conflict-resolution.prompt.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/core/src/infrastructure/services/agents/conflict-resolution/conflict-resolution.prompt.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,WAAW,cAAc;IAC7B,wCAAwC;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,oDAAoD;IACpD,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,8BAA8B;IAC7C,kCAAkC;IAClC,eAAe,EAAE,cAAc,EAAE,CAAC;IAClC,uCAAuC;IACvC,aAAa,EAAE,MAAM,CAAC;IACtB,yCAAyC;IACzC,UAAU,EAAE,MAAM,CAAC;IACnB,6BAA6B;IAC7B,aAAa,EAAE,MAAM,CAAC;IACtB,+BAA+B;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,qEAAqE;IACrE,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAAC,MAAM,EAAE,8BAA8B,GAAG,MAAM,CAgE5F"}
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Conflict Resolution Prompt Builder
3
+ *
4
+ * Builds prompts for the AI agent to resolve git rebase conflicts.
5
+ * Follows the merge-prompts.ts pattern of pure functions returning
6
+ * markdown strings.
7
+ */
8
+ /**
9
+ * Build a prompt for the conflict resolution agent.
10
+ *
11
+ * The agent receives conflicted file contents and instructions to resolve
12
+ * all conflict markers by editing files in the working directory.
13
+ */
14
+ export function buildConflictResolutionPrompt(params) {
15
+ const { conflictedFiles, featureBranch, baseBranch, attemptNumber, maxAttempts, previousFeedback, } = params;
16
+ const fileSection = conflictedFiles
17
+ .map((f) => `### \`${f.path}\`
18
+
19
+ \`\`\`
20
+ ${f.content}
21
+ \`\`\``)
22
+ .join('\n\n');
23
+ const feedbackSection = previousFeedback
24
+ ? `
25
+ ## Previous Attempt Feedback
26
+
27
+ Your previous resolution attempt (${attemptNumber - 1}/${maxAttempts}) was incomplete:
28
+
29
+ ${previousFeedback}
30
+
31
+ You MUST resolve all remaining conflict markers in this attempt.
32
+ `
33
+ : '';
34
+ return `You are resolving git rebase conflicts (attempt ${attemptNumber}/${maxAttempts}).
35
+
36
+ ## Branch Context
37
+
38
+ - Feature branch: \`${featureBranch}\`
39
+ - Base branch: \`${baseBranch}\`
40
+ - The feature branch is being rebased onto the latest \`${baseBranch}\`.
41
+ ${feedbackSection}
42
+ ## Conflicted Files
43
+
44
+ The following files contain conflict markers that must be resolved:
45
+
46
+ ${fileSection}
47
+
48
+ ## Instructions
49
+
50
+ 1. Read each conflicted file listed above
51
+ 2. Resolve ALL conflict markers (\`<<<<<<<\`, \`=======\`, \`>>>>>>>\`) by editing the files
52
+ 3. For each conflict, determine the correct resolution by understanding the intent of both sides:
53
+ - The \`<<<<<<< HEAD\` section contains changes from \`${baseBranch}\` (theirs during rebase)
54
+ - The \`>>>>>>> ...\` section contains changes from \`${featureBranch}\` (ours during rebase)
55
+ 4. Produce a merged result that preserves the intent of both sides where possible
56
+ 5. If the changes conflict logically (not just textually), prefer the feature branch changes but ensure compatibility with the base branch
57
+
58
+ ## Constraints
59
+
60
+ - Edit ONLY the conflicted files listed above — do NOT modify any other files
61
+ - Remove ALL conflict markers (\`<<<<<<<\`, \`=======\`, \`>>>>>>>\`) from every conflicted file
62
+ - Do NOT add new files or delete files
63
+ - Do NOT run git commands — only edit files to resolve conflicts
64
+ - Do NOT run tests, builds, or linters — only resolve the conflict markers
65
+ - Every conflicted file must have zero remaining conflict markers when you are done`;
66
+ }
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Conflict Resolution Service
3
+ *
4
+ * Orchestrates agent-powered conflict resolution during git rebase.
5
+ * Follows the CI watch/fix loop pattern: detect conflict → invoke agent →
6
+ * validate resolution → stage files → continue rebase, with retry logic.
7
+ */
8
+ import type { IAgentExecutorProvider } from '../../../../application/ports/output/agents/agent-executor-provider.interface.js';
9
+ import type { IGitPrService } from '../../../../application/ports/output/services/git-pr-service.interface.js';
10
+ export declare class ConflictResolutionService {
11
+ private readonly agentProvider;
12
+ private readonly gitPrService;
13
+ constructor(agentProvider: IAgentExecutorProvider, gitPrService: IGitPrService);
14
+ /**
15
+ * Resolve all conflicts during a rebase operation.
16
+ *
17
+ * Handles multi-commit rebases where each commit may introduce conflicts.
18
+ * For each conflicted commit: reads conflicted files, invokes agent to
19
+ * resolve, validates no remaining markers, stages resolved files, and
20
+ * continues the rebase. Retries up to MAX_RETRIES_PER_COMMIT times.
21
+ *
22
+ * If retries are exhausted, aborts the rebase and throws REBASE_CONFLICT.
23
+ *
24
+ * @param cwd - Working directory (repo root or worktree path)
25
+ * @param featureBranch - Feature branch being rebased
26
+ * @param baseBranch - Base branch being rebased onto
27
+ */
28
+ resolve(cwd: string, featureBranch: string, baseBranch: string): Promise<void>;
29
+ /**
30
+ * Read the contents of conflicted files from the working directory.
31
+ */
32
+ private readConflictedFileContents;
33
+ /**
34
+ * Validate that no conflict markers remain in the previously-conflicted files.
35
+ */
36
+ private validateResolution;
37
+ /**
38
+ * Build feedback about remaining conflict markers for retry attempts.
39
+ */
40
+ private buildFeedbackFromRemainingMarkers;
41
+ }
42
+ //# sourceMappingURL=conflict-resolution.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conflict-resolution.service.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/core/src/infrastructure/services/agents/conflict-resolution/conflict-resolution.service.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wEAAwE,CAAC;AACrH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iEAAiE,CAAC;AAerG,qBACa,yBAAyB;IAGlC,OAAO,CAAC,QAAQ,CAAC,aAAa;IAE9B,OAAO,CAAC,QAAQ,CAAC,YAAY;gBAFZ,aAAa,EAAE,sBAAsB,EAErC,YAAY,EAAE,aAAa;IAG9C;;;;;;;;;;;;;OAaG;IACG,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAkEpF;;OAEG;IACH,OAAO,CAAC,0BAA0B;IAWlC;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAgB1B;;OAEG;IACH,OAAO,CAAC,iCAAiC;CAyB1C"}