@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
@@ -0,0 +1,169 @@
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
+ 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
+ import { readFileSync } from 'node:fs';
22
+ import { join } from 'node:path';
23
+ import { GitPrError, GitPrErrorCode, } from '../../../../application/ports/output/services/git-pr-service.interface.js';
24
+ import { buildConflictResolutionPrompt, } from './conflict-resolution.prompt.js';
25
+ const MAX_RETRIES_PER_COMMIT = 3;
26
+ /** Conflict markers that indicate unresolved conflicts */
27
+ const CONFLICT_MARKERS = ['<<<<<<<', '=======', '>>>>>>>'];
28
+ let ConflictResolutionService = class ConflictResolutionService {
29
+ agentProvider;
30
+ gitPrService;
31
+ constructor(agentProvider, gitPrService) {
32
+ this.agentProvider = agentProvider;
33
+ this.gitPrService = gitPrService;
34
+ }
35
+ /**
36
+ * Resolve all conflicts during a rebase operation.
37
+ *
38
+ * Handles multi-commit rebases where each commit may introduce conflicts.
39
+ * For each conflicted commit: reads conflicted files, invokes agent to
40
+ * resolve, validates no remaining markers, stages resolved files, and
41
+ * continues the rebase. Retries up to MAX_RETRIES_PER_COMMIT times.
42
+ *
43
+ * If retries are exhausted, aborts the rebase and throws REBASE_CONFLICT.
44
+ *
45
+ * @param cwd - Working directory (repo root or worktree path)
46
+ * @param featureBranch - Feature branch being rebased
47
+ * @param baseBranch - Base branch being rebased onto
48
+ */
49
+ async resolve(cwd, featureBranch, baseBranch) {
50
+ const executor = await this.agentProvider.getExecutor();
51
+ // Outer loop: handle multi-commit rebases where rebaseContinue
52
+ // may reveal conflicts on the next commit
53
+ while (true) {
54
+ const conflictedFiles = await this.gitPrService.getConflictedFiles(cwd);
55
+ if (conflictedFiles.length === 0) {
56
+ return; // No conflicts — rebase is complete
57
+ }
58
+ // Inner loop: retry agent resolution for the current commit's conflicts
59
+ let resolved = false;
60
+ for (let attempt = 1; attempt <= MAX_RETRIES_PER_COMMIT; attempt++) {
61
+ const fileContents = this.readConflictedFileContents(cwd, conflictedFiles);
62
+ const previousFeedback = attempt > 1 ? this.buildFeedbackFromRemainingMarkers(cwd, conflictedFiles) : undefined;
63
+ const prompt = buildConflictResolutionPrompt({
64
+ conflictedFiles: fileContents,
65
+ featureBranch,
66
+ baseBranch,
67
+ attemptNumber: attempt,
68
+ maxAttempts: MAX_RETRIES_PER_COMMIT,
69
+ previousFeedback,
70
+ });
71
+ await executor.execute(prompt, { cwd });
72
+ // Validate: check no conflict markers remain
73
+ if (this.validateResolution(cwd, conflictedFiles)) {
74
+ resolved = true;
75
+ break;
76
+ }
77
+ }
78
+ if (!resolved) {
79
+ // Exhausted retries — abort and report
80
+ await this.gitPrService.rebaseAbort(cwd);
81
+ const remaining = conflictedFiles.join(', ');
82
+ throw new GitPrError(`Failed to resolve conflicts after ${MAX_RETRIES_PER_COMMIT} attempts. ` +
83
+ `Unresolved files: ${remaining}. The rebase has been aborted.`, GitPrErrorCode.REBASE_CONFLICT);
84
+ }
85
+ // Resolution succeeded — stage files and continue rebase
86
+ await this.gitPrService.stageFiles(cwd, conflictedFiles);
87
+ try {
88
+ await this.gitPrService.rebaseContinue(cwd);
89
+ // rebaseContinue succeeded — check if there are more conflicts
90
+ // from subsequent commits (loop continues)
91
+ return; // No more conflicts
92
+ }
93
+ catch (error) {
94
+ if (error instanceof GitPrError && error.code === GitPrErrorCode.REBASE_CONFLICT) {
95
+ // Next commit has conflicts — loop back to resolve them
96
+ continue;
97
+ }
98
+ throw error; // Unexpected error
99
+ }
100
+ }
101
+ }
102
+ /**
103
+ * Read the contents of conflicted files from the working directory.
104
+ */
105
+ readConflictedFileContents(cwd, filePaths) {
106
+ return filePaths.map((filePath) => {
107
+ try {
108
+ const content = readFileSync(join(cwd, filePath), 'utf-8');
109
+ return { path: filePath, content };
110
+ }
111
+ catch {
112
+ return { path: filePath, content: '(unable to read file)' };
113
+ }
114
+ });
115
+ }
116
+ /**
117
+ * Validate that no conflict markers remain in the previously-conflicted files.
118
+ */
119
+ validateResolution(cwd, filePaths) {
120
+ for (const filePath of filePaths) {
121
+ try {
122
+ const content = readFileSync(join(cwd, filePath), 'utf-8');
123
+ for (const marker of CONFLICT_MARKERS) {
124
+ if (content.includes(marker)) {
125
+ return false;
126
+ }
127
+ }
128
+ }
129
+ catch {
130
+ return false;
131
+ }
132
+ }
133
+ return true;
134
+ }
135
+ /**
136
+ * Build feedback about remaining conflict markers for retry attempts.
137
+ */
138
+ buildFeedbackFromRemainingMarkers(cwd, filePaths) {
139
+ const remaining = [];
140
+ for (const filePath of filePaths) {
141
+ try {
142
+ const content = readFileSync(join(cwd, filePath), 'utf-8');
143
+ const lines = content.split('\n');
144
+ const markerLines = [];
145
+ lines.forEach((line, index) => {
146
+ if (CONFLICT_MARKERS.some((marker) => line.includes(marker))) {
147
+ markerLines.push(index + 1);
148
+ }
149
+ });
150
+ if (markerLines.length > 0) {
151
+ remaining.push(`- \`${filePath}\`: conflict markers remain on lines ${markerLines.join(', ')}`);
152
+ }
153
+ }
154
+ catch {
155
+ remaining.push(`- \`${filePath}\`: unable to read file`);
156
+ }
157
+ }
158
+ return remaining.length > 0
159
+ ? remaining.join('\n')
160
+ : 'No specific markers found, but validation failed.';
161
+ }
162
+ };
163
+ ConflictResolutionService = __decorate([
164
+ injectable(),
165
+ __param(0, inject('IAgentExecutorProvider')),
166
+ __param(1, inject('IGitPrService')),
167
+ __metadata("design:paramtypes", [Object, Object])
168
+ ], ConflictResolutionService);
169
+ export { ConflictResolutionService };
@@ -45,5 +45,11 @@ export declare class GitPrService implements IGitPrService {
45
45
  private parseGhError;
46
46
  private parsePrNumberFromUrl;
47
47
  private parseDiffStat;
48
+ syncMain(cwd: string, baseBranch: string): Promise<void>;
49
+ rebaseOnMain(cwd: string, featureBranch: string, baseBranch: string): Promise<void>;
50
+ getConflictedFiles(cwd: string): Promise<string[]>;
51
+ stageFiles(cwd: string, files: string[]): Promise<void>;
52
+ rebaseContinue(cwd: string): Promise<void>;
53
+ rebaseAbort(cwd: string): Promise<void>;
48
54
  }
49
55
  //# sourceMappingURL=git-pr.service.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"git-pr.service.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/services/git/git-pr.service.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wEAAwE,CAAC;AAC5G,OAAO,KAAK,EACV,cAAc,EAGd,WAAW,EACX,QAAQ,EACR,aAAa,EACb,cAAc,EACd,YAAY,EACb,MAAM,wEAAwE,CAAC;AAUhF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAE1D,qBACa,YAAa,YAAW,aAAa;IACZ,OAAO,CAAC,QAAQ,CAAC,QAAQ;gBAAR,QAAQ,EAAE,YAAY;IAErE,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAKxC,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAgBjD,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAgF9C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;IAWhF,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAevE,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IAaxE,OAAO,CAAC,gBAAgB;IAexB,OAAO,CAAC,aAAa;IAmFf,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;IAoCpD,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC;IAc/E,WAAW,CACf,GAAG,EAAE,MAAM,EACX,aAAa,EAAE,MAAM,EACrB,UAAU,EAAE,MAAM,EAClB,eAAe,CAAC,EAAE,MAAM,GACvB,OAAO,CAAC,OAAO,CAAC;IA6CnB;;;OAGG;YACW,UAAU;IAmBlB,cAAc,CAClB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,EACf,WAAW,SAAS,GACnB,OAAO,CAAC,MAAM,CAAC;IAWlB,OAAO,CAAC,WAAW;IAQnB,OAAO,CAAC,cAAc;IAMtB,OAAO,CAAC,gBAAgB;IAKxB,OAAO,CAAC,aAAa;IAcrB,OAAO,CAAC,YAAY;IAepB,OAAO,CAAC,oBAAoB;IAK5B,OAAO,CAAC,aAAa;CAiBtB"}
1
+ {"version":3,"file":"git-pr.service.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/services/git/git-pr.service.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wEAAwE,CAAC;AAC5G,OAAO,KAAK,EACV,cAAc,EAGd,WAAW,EACX,QAAQ,EACR,aAAa,EACb,cAAc,EACd,YAAY,EACb,MAAM,wEAAwE,CAAC;AAUhF,OAAO,KAAK,EAAE,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AoB;IAK5B,OAAO,CAAC,aAAa;IAoBf,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAmCxD,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAqEnF,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAelD,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAQvD,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAqB1C,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAO9C"}
@@ -612,6 +612,14 @@ let GitPrService = class GitPrService {
612
612
  parseGitError(error) {
613
613
  const message = error instanceof Error ? error.message : String(error);
614
614
  const cause = error instanceof Error ? error : undefined;
615
+ // Rebase-specific: detect "CONFLICT" during rebase operations
616
+ if (message.includes('CONFLICT') && message.includes('rebase')) {
617
+ return new GitPrError(message, GitPrErrorCode.REBASE_CONFLICT, cause);
618
+ }
619
+ // Sync-specific: non-fast-forward or diverged branch
620
+ if (message.includes('non-fast-forward') || message.includes('diverged')) {
621
+ return new GitPrError(message, GitPrErrorCode.SYNC_FAILED, cause);
622
+ }
615
623
  if (message.includes('rejected') || message.includes('conflict')) {
616
624
  return new GitPrError(message, GitPrErrorCode.MERGE_CONFLICT, cause);
617
625
  }
@@ -652,6 +660,123 @@ let GitPrService = class GitPrService {
652
660
  commitCount,
653
661
  };
654
662
  }
663
+ // --- Rebase & Sync operations ---
664
+ async syncMain(cwd, baseBranch) {
665
+ try {
666
+ // Detect current branch
667
+ const { stdout } = await this.execFile('git', ['rev-parse', '--abbrev-ref', 'HEAD'], { cwd });
668
+ const currentBranch = stdout.trim();
669
+ if (currentBranch === baseBranch) {
670
+ // On the base branch — use git pull --ff-only
671
+ await this.execFile('git', ['pull', '--ff-only', 'origin', baseBranch], { cwd });
672
+ }
673
+ else {
674
+ // On a different branch — use git fetch to update the base branch ref without switching
675
+ await this.execFile('git', ['fetch', 'origin', `${baseBranch}:${baseBranch}`], { cwd });
676
+ }
677
+ }
678
+ catch (error) {
679
+ const message = error instanceof Error ? error.message : String(error);
680
+ const cause = error instanceof Error ? error : undefined;
681
+ if (message.includes('non-fast-forward') || message.includes('diverged')) {
682
+ throw new GitPrError(`Cannot fast-forward '${baseBranch}': local branch has diverged from remote. ` +
683
+ `Resolve the divergence manually with 'git checkout ${baseBranch} && git reset --hard origin/${baseBranch}' ` +
684
+ `if you want to discard local changes on ${baseBranch}.`, GitPrErrorCode.SYNC_FAILED, cause);
685
+ }
686
+ throw new GitPrError(`Failed to sync '${baseBranch}' with remote: ${message}`, GitPrErrorCode.GIT_ERROR, cause);
687
+ }
688
+ }
689
+ async rebaseOnMain(cwd, featureBranch, baseBranch) {
690
+ // Check for dirty worktree before starting
691
+ const dirty = await this.hasUncommittedChanges(cwd);
692
+ if (dirty) {
693
+ throw new GitPrError(`Cannot rebase: working directory has uncommitted changes. ` +
694
+ `Please commit or stash your changes before rebasing.`, GitPrErrorCode.GIT_ERROR);
695
+ }
696
+ // Checkout the feature branch
697
+ try {
698
+ await this.execFile('git', ['checkout', featureBranch], { cwd });
699
+ }
700
+ catch (error) {
701
+ const message = error instanceof Error ? error.message : String(error);
702
+ const cause = error instanceof Error ? error : undefined;
703
+ if (message.includes('did not match') ||
704
+ message.includes('not a commit') ||
705
+ message.includes('pathspec')) {
706
+ throw new GitPrError(`Branch '${featureBranch}' not found.`, GitPrErrorCode.BRANCH_NOT_FOUND, cause);
707
+ }
708
+ throw new GitPrError(`Failed to checkout '${featureBranch}': ${message}`, GitPrErrorCode.GIT_ERROR, cause);
709
+ }
710
+ // Rebase onto the base branch
711
+ try {
712
+ await this.execFile('git', ['rebase', baseBranch], { cwd });
713
+ }
714
+ catch (error) {
715
+ const message = error instanceof Error ? error.message : String(error);
716
+ const cause = error instanceof Error ? error : undefined;
717
+ // Detect rebase conflict from git stderr/exit code
718
+ if (message.includes('CONFLICT') || message.includes('could not apply')) {
719
+ // Get the list of conflicted files to include in the error message
720
+ let conflictedFiles = [];
721
+ try {
722
+ conflictedFiles = await this.getConflictedFiles(cwd);
723
+ }
724
+ catch {
725
+ // Failed to get conflicted files — still report the conflict
726
+ }
727
+ const fileList = conflictedFiles.length > 0 ? ` Conflicted files: ${conflictedFiles.join(', ')}` : '';
728
+ throw new GitPrError(`Rebase of '${featureBranch}' onto '${baseBranch}' encountered conflicts.${fileList}`, GitPrErrorCode.REBASE_CONFLICT, cause);
729
+ }
730
+ throw new GitPrError(`Rebase of '${featureBranch}' onto '${baseBranch}' failed: ${message}`, GitPrErrorCode.GIT_ERROR, cause);
731
+ }
732
+ }
733
+ async getConflictedFiles(cwd) {
734
+ try {
735
+ const { stdout } = await this.execFile('git', ['diff', '--name-only', '--diff-filter=U'], {
736
+ cwd,
737
+ });
738
+ return stdout
739
+ .trim()
740
+ .split('\n')
741
+ .filter((f) => f.length > 0)
742
+ .map((f) => f.replace(/\\/g, '/'));
743
+ }
744
+ catch (error) {
745
+ throw this.parseGitError(error);
746
+ }
747
+ }
748
+ async stageFiles(cwd, files) {
749
+ try {
750
+ await this.execFile('git', ['add', ...files], { cwd });
751
+ }
752
+ catch (error) {
753
+ throw this.parseGitError(error);
754
+ }
755
+ }
756
+ async rebaseContinue(cwd) {
757
+ try {
758
+ await this.execFile('git', ['rebase', '--continue'], {
759
+ cwd,
760
+ env: { ...process.env, GIT_EDITOR: 'true' },
761
+ });
762
+ }
763
+ catch (error) {
764
+ const message = error instanceof Error ? error.message : String(error);
765
+ const cause = error instanceof Error ? error : undefined;
766
+ if (message.includes('CONFLICT') || message.includes('could not apply')) {
767
+ throw new GitPrError(`Rebase continue encountered new conflicts: ${message}`, GitPrErrorCode.REBASE_CONFLICT, cause);
768
+ }
769
+ throw this.parseGitError(error);
770
+ }
771
+ }
772
+ async rebaseAbort(cwd) {
773
+ try {
774
+ await this.execFile('git', ['rebase', '--abort'], { cwd });
775
+ }
776
+ catch (error) {
777
+ throw this.parseGitError(error);
778
+ }
779
+ }
655
780
  };
656
781
  GitPrService = __decorate([
657
782
  injectable(),
@@ -0,0 +1,5 @@
1
+ export declare function rebaseFeature(featureId: string): Promise<{
2
+ success: boolean;
3
+ error?: string;
4
+ }>;
5
+ //# sourceMappingURL=rebase-feature.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rebase-feature.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/web/app/actions/rebase-feature.ts"],"names":[],"mappings":"AAKA,wBAAsB,aAAa,CACjC,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAa/C"}
@@ -0,0 +1,16 @@
1
+ 'use server';
2
+ import { resolve } from '../../lib/server-container.js';
3
+ export async function rebaseFeature(featureId) {
4
+ if (!featureId?.trim()) {
5
+ return { success: false, error: 'Feature id is required' };
6
+ }
7
+ try {
8
+ const useCase = resolve('RebaseFeatureOnMainUseCase');
9
+ await useCase.execute(featureId);
10
+ return { success: true };
11
+ }
12
+ catch (error) {
13
+ const message = error instanceof Error ? error.message : 'Failed to rebase feature';
14
+ return { success: false, error: message };
15
+ }
16
+ }
@@ -0,0 +1,5 @@
1
+ export declare function syncRepository(repositoryId: string): Promise<{
2
+ success: boolean;
3
+ error?: string;
4
+ }>;
5
+ //# sourceMappingURL=sync-repository.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sync-repository.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/web/app/actions/sync-repository.ts"],"names":[],"mappings":"AAKA,wBAAsB,cAAc,CAClC,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAa/C"}
@@ -0,0 +1,16 @@
1
+ 'use server';
2
+ import { resolve } from '../../lib/server-container.js';
3
+ export async function syncRepository(repositoryId) {
4
+ if (!repositoryId?.trim()) {
5
+ return { success: false, error: 'Repository id is required' };
6
+ }
7
+ try {
8
+ const useCase = resolve('SyncRepositoryMainUseCase');
9
+ await useCase.execute(repositoryId);
10
+ return { success: true };
11
+ }
12
+ catch (error) {
13
+ const message = error instanceof Error ? error.message : 'Failed to sync repository';
14
+ return { success: false, error: message };
15
+ }
16
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"feature-drawer-client.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/common/control-center-drawer/feature-drawer-client.tsx"],"names":[],"mappings":"AAuCA,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAI/D,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,UAAU,CAAC;IACjB,8FAA8F;IAC9F,MAAM,CAAC,EAAE,aAAa,CAAC;CACxB;AAED,wBAAgB,mBAAmB,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,EAAE,wBAAwB,2CAqkB1F"}
1
+ {"version":3,"file":"feature-drawer-client.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/common/control-center-drawer/feature-drawer-client.tsx"],"names":[],"mappings":"AAuCA,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAI/D,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,UAAU,CAAC;IACjB,8FAA8F;IAC9F,MAAM,CAAC,EAAE,aAAa,CAAC;CACxB;AAED,wBAAgB,mBAAmB,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,EAAE,wBAAwB,2CAykB1F"}
@@ -303,6 +303,7 @@ export function FeatureDrawerClient({ view: initialView, urlTab }) {
303
303
  // ── Hooks (always called unconditionally per Rules of Hooks) ──────────
304
304
  const featureActionsInput = featureNode?.repositoryPath && featureNode?.branch
305
305
  ? {
306
+ featureId: featureNode.featureId,
306
307
  repositoryPath: featureNode.repositoryPath,
307
308
  branch: featureNode.branch,
308
309
  specPath: featureNode.specPath,
@@ -346,7 +347,7 @@ export function FeatureDrawerClient({ view: initialView, urlTab }) {
346
347
  ...(featureNode.state === 'error' && { onRetry: handleRetry }),
347
348
  ...(featureNode.state === 'pending' && { onStart: handleStart }),
348
349
  };
349
- body = (_jsx(FeatureDrawerTabs, { featureNode: enrichedNode, featureId: featureNode.featureId, initialTab: view.initialTab, urlTab: urlTab, sseEvents: events, prdData: prdData, prdSelections: prdSelections, onPrdSelect: (qId, oId) => setPrdSelections((prev) => ({ ...prev, [qId]: oId })), onPrdApprove: handlePrdApprove, onPrdReject: handlePrdReject, isPrdLoading: isLoadingPrd, techData: techData, onTechApprove: handleTechApprove, onTechReject: handleTechReject, isTechLoading: isLoadingTech, productData: isLoadingTechProduct ? null : techProductData, mergeData: mergeData, onMergeApprove: handleMergeApprove, onMergeReject: handleMergeReject, isMergeLoading: isLoadingMerge, isRejecting: isRejecting, chatInput: chatInput, onChatInputChange: setChatInput }));
350
+ body = (_jsx(FeatureDrawerTabs, { featureNode: enrichedNode, featureId: featureNode.featureId, initialTab: view.initialTab, urlTab: urlTab, sseEvents: events, prdData: prdData, prdSelections: prdSelections, onPrdSelect: (qId, oId) => setPrdSelections((prev) => ({ ...prev, [qId]: oId })), onPrdApprove: handlePrdApprove, onPrdReject: handlePrdReject, isPrdLoading: isLoadingPrd, techData: techData, onTechApprove: handleTechApprove, onTechReject: handleTechReject, isTechLoading: isLoadingTech, productData: isLoadingTechProduct ? null : techProductData, mergeData: mergeData, onMergeApprove: handleMergeApprove, onMergeReject: handleMergeReject, isMergeLoading: isLoadingMerge, onRebaseOnMain: featureActions.rebaseOnMain, rebaseLoading: featureActions.rebaseLoading, rebaseError: featureActions.rebaseError, isRejecting: isRejecting, chatInput: chatInput, onChatInputChange: setChatInput }));
350
351
  }
351
352
  return (_jsx(BaseDrawer, { open: isOpen, onClose: attemptClose, size: "md", modal: false, header: header, "data-testid": view.type === 'feature' ? 'feature-drawer' : 'repository-drawer', children: body }));
352
353
  }
@@ -1 +1 @@
1
- {"version":3,"file":"repository-drawer-client.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/common/control-center-drawer/repository-drawer-client.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAE9E,MAAM,WAAW,2BAA2B;IAC1C,IAAI,EAAE,kBAAkB,CAAC;CAC1B;AAED,wBAAgB,sBAAsB,CAAC,EAAE,IAAI,EAAE,EAAE,2BAA2B,2CAmF3E"}
1
+ {"version":3,"file":"repository-drawer-client.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/common/control-center-drawer/repository-drawer-client.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAE9E,MAAM,WAAW,2BAA2B;IAC1C,IAAI,EAAE,kBAAkB,CAAC;CAC1B;AAED,wBAAgB,sBAAsB,CAAC,EAAE,IAAI,EAAE,EAAE,2BAA2B,2CA2G3E"}
@@ -1,8 +1,8 @@
1
1
  'use client';
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
3
  import { useCallback } from 'react';
4
4
  import { useRouter, usePathname } from 'next/navigation';
5
- import { Code2, Terminal, FolderOpen } from 'lucide-react';
5
+ import { Code2, Terminal, FolderOpen, RefreshCw } from 'lucide-react';
6
6
  import { BaseDrawer } from '../../common/base-drawer/index.js';
7
7
  import { ActionButton } from '../../common/action-button/index.js';
8
8
  import { DrawerTitle, DrawerDescription } from '../../ui/drawer.js';
@@ -14,7 +14,7 @@ export function RepositoryDrawerClient({ data }) {
14
14
  const router = useRouter();
15
15
  const pathname = usePathname();
16
16
  const isOpen = pathname.startsWith('/repository/');
17
- const repoActions = useRepositoryActions(data.repositoryPath ? { repositoryPath: data.repositoryPath } : null);
17
+ const repoActions = useRepositoryActions(data.repositoryPath ? { repositoryId: data.id, repositoryPath: data.repositoryPath } : null);
18
18
  const onClose = useCallback(() => {
19
19
  router.push('/');
20
20
  }, [router]);
@@ -26,5 +26,5 @@ export function RepositoryDrawerClient({ data }) {
26
26
  }
27
27
  : undefined;
28
28
  const header = (_jsxs("div", { "data-testid": "repository-drawer-header", children: [_jsx(DrawerTitle, { children: data.name }), data.repositoryPath ? (_jsx(DrawerDescription, { className: "truncate font-mono text-xs", children: data.repositoryPath })) : null] }));
29
- return (_jsx(BaseDrawer, { open: isOpen, onClose: onClose, size: "md", modal: false, header: header, deployTarget: featureFlags.envDeploy ? repoDeployTarget : undefined, "data-testid": "repository-drawer", children: data.repositoryPath ? (_jsxs("div", { className: "flex-1 overflow-y-auto", children: [_jsx(Separator, {}), _jsxs("div", { className: "flex flex-col gap-3 p-4", children: [_jsx("div", { className: "text-muted-foreground text-xs font-semibold tracking-wider", children: "OPEN WITH" }), _jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(ActionButton, { label: "Open in IDE", onClick: repoActions.openInIde, loading: repoActions.ideLoading, error: !!repoActions.ideError, icon: Code2, variant: "outline", size: "sm" }), _jsx(ActionButton, { label: "Open in Shell", onClick: repoActions.openInShell, loading: repoActions.shellLoading, error: !!repoActions.shellError, icon: Terminal, variant: "outline", size: "sm" }), _jsx(ActionButton, { label: "Open Folder", onClick: repoActions.openFolder, loading: repoActions.folderLoading, error: !!repoActions.folderError, icon: FolderOpen, variant: "outline", size: "sm" })] })] })] })) : null }));
29
+ return (_jsx(BaseDrawer, { open: isOpen, onClose: onClose, size: "md", modal: false, header: header, deployTarget: featureFlags.envDeploy ? repoDeployTarget : undefined, "data-testid": "repository-drawer", children: data.repositoryPath ? (_jsxs("div", { className: "flex-1 overflow-y-auto", children: [_jsx(Separator, {}), _jsxs("div", { className: "flex flex-col gap-3 p-4", children: [_jsx("div", { className: "text-muted-foreground text-xs font-semibold tracking-wider", children: "OPEN WITH" }), _jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(ActionButton, { label: "Open in IDE", onClick: repoActions.openInIde, loading: repoActions.ideLoading, error: !!repoActions.ideError, icon: Code2, variant: "outline", size: "sm" }), _jsx(ActionButton, { label: "Open in Shell", onClick: repoActions.openInShell, loading: repoActions.shellLoading, error: !!repoActions.shellError, icon: Terminal, variant: "outline", size: "sm" }), _jsx(ActionButton, { label: "Open Folder", onClick: repoActions.openFolder, loading: repoActions.folderLoading, error: !!repoActions.folderError, icon: FolderOpen, variant: "outline", size: "sm" })] })] }), data.id ? (_jsxs(_Fragment, { children: [_jsx(Separator, {}), _jsxs("div", { className: "flex flex-col gap-3 p-4", children: [_jsx("div", { className: "text-muted-foreground text-xs font-semibold tracking-wider", children: "GIT OPERATIONS" }), _jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(ActionButton, { label: "Sync Main", onClick: repoActions.syncMain, loading: repoActions.syncLoading, error: !!repoActions.syncError, icon: RefreshCw, variant: "outline", size: "sm" }), repoActions.syncError ? (_jsx("p", { className: "text-destructive text-xs", children: repoActions.syncError })) : null] })] })] })) : null] })) : null }));
30
30
  }
@@ -1,4 +1,5 @@
1
1
  export interface FeatureActionsInput {
2
+ featureId: string;
2
3
  repositoryPath: string;
3
4
  branch: string;
4
5
  specPath?: string;
@@ -7,12 +8,15 @@ export interface FeatureActionsState {
7
8
  openInIde: () => Promise<void>;
8
9
  openInShell: () => Promise<void>;
9
10
  openSpecsFolder: () => Promise<void>;
11
+ rebaseOnMain: () => Promise<void>;
10
12
  ideLoading: boolean;
11
13
  shellLoading: boolean;
12
14
  specsLoading: boolean;
15
+ rebaseLoading: boolean;
13
16
  ideError: string | null;
14
17
  shellError: string | null;
15
18
  specsError: string | null;
19
+ rebaseError: string | null;
16
20
  }
17
21
  export declare function useFeatureActions(input: FeatureActionsInput | null): FeatureActionsState;
18
22
  //# sourceMappingURL=use-feature-actions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-feature-actions.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/common/feature-drawer/use-feature-actions.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,mBAAmB;IAClC,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/B,WAAW,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACjC,eAAe,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACrC,UAAU,EAAE,OAAO,CAAC;IACpB,YAAY,EAAE,OAAO,CAAC;IACtB,YAAY,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAID,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,mBAAmB,GAAG,IAAI,GAAG,mBAAmB,CA8GxF"}
1
+ {"version":3,"file":"use-feature-actions.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/common/feature-drawer/use-feature-actions.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/B,WAAW,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACjC,eAAe,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACrC,YAAY,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAClC,UAAU,EAAE,OAAO,CAAC;IACpB,YAAY,EAAE,OAAO,CAAC;IACtB,YAAY,EAAE,OAAO,CAAC;IACtB,aAAa,EAAE,OAAO,CAAC;IACvB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAID,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,mBAAmB,GAAG,IAAI,GAAG,mBAAmB,CA6IxF"}
@@ -3,21 +3,25 @@ import { useState, useCallback, useRef, useEffect } from 'react';
3
3
  import { openIde } from '../../../app/actions/open-ide.js';
4
4
  import { openShell } from '../../../app/actions/open-shell.js';
5
5
  import { openFolder } from '../../../app/actions/open-folder.js';
6
+ import { rebaseFeature } from '../../../app/actions/rebase-feature.js';
6
7
  const ERROR_CLEAR_DELAY = 5000;
7
8
  export function useFeatureActions(input) {
8
9
  const [ideLoading, setIdeLoading] = useState(false);
9
10
  const [shellLoading, setShellLoading] = useState(false);
10
11
  const [specsLoading, setSpecsLoading] = useState(false);
12
+ const [rebaseLoading, setRebaseLoading] = useState(false);
11
13
  const [ideError, setIdeError] = useState(null);
12
14
  const [shellError, setShellError] = useState(null);
13
15
  const [specsError, setSpecsError] = useState(null);
16
+ const [rebaseError, setRebaseError] = useState(null);
14
17
  const ideTimerRef = useRef(null);
15
18
  const shellTimerRef = useRef(null);
16
19
  const specsTimerRef = useRef(null);
20
+ const rebaseTimerRef = useRef(null);
17
21
  // Clear timers on unmount — read .current inside cleanup so we get the
18
22
  // actual timer value at teardown time, not the always-null value at mount.
19
23
  useEffect(() => {
20
- const refs = [ideTimerRef, shellTimerRef, specsTimerRef];
24
+ const refs = [ideTimerRef, shellTimerRef, specsTimerRef, rebaseTimerRef];
21
25
  return () => {
22
26
  for (const ref of refs) {
23
27
  if (ref.current)
@@ -79,15 +83,42 @@ export function useFeatureActions(input) {
79
83
  setSpecsLoading(false);
80
84
  }
81
85
  }, [input, specsLoading]);
86
+ const handleRebaseOnMain = useCallback(async () => {
87
+ if (!input?.featureId || rebaseLoading)
88
+ return;
89
+ if (rebaseTimerRef.current)
90
+ clearTimeout(rebaseTimerRef.current);
91
+ setRebaseLoading(true);
92
+ setRebaseError(null);
93
+ try {
94
+ const result = await rebaseFeature(input.featureId);
95
+ if (!result.success) {
96
+ const errorMessage = result.error ?? 'An unexpected error occurred';
97
+ setRebaseError(errorMessage);
98
+ rebaseTimerRef.current = setTimeout(() => setRebaseError(null), ERROR_CLEAR_DELAY);
99
+ }
100
+ }
101
+ catch (err) {
102
+ const errorMessage = err instanceof Error ? err.message : 'An unexpected error occurred';
103
+ setRebaseError(errorMessage);
104
+ rebaseTimerRef.current = setTimeout(() => setRebaseError(null), ERROR_CLEAR_DELAY);
105
+ }
106
+ finally {
107
+ setRebaseLoading(false);
108
+ }
109
+ }, [input, rebaseLoading]);
82
110
  return {
83
111
  openInIde: handleOpenIde,
84
112
  openInShell: handleOpenShell,
85
113
  openSpecsFolder: handleOpenSpecsFolder,
114
+ rebaseOnMain: handleRebaseOnMain,
86
115
  ideLoading,
87
116
  shellLoading,
88
117
  specsLoading,
118
+ rebaseLoading,
89
119
  ideError,
90
120
  shellError,
91
121
  specsError,
122
+ rebaseError,
92
123
  };
93
124
  }
@@ -29,9 +29,12 @@ export interface FeatureDrawerTabsProps {
29
29
  onMergeApprove?: () => void;
30
30
  onMergeReject?: (feedback: string, attachments: RejectAttachment[]) => void;
31
31
  isMergeLoading?: boolean;
32
+ onRebaseOnMain?: () => void;
33
+ rebaseLoading?: boolean;
34
+ rebaseError?: string | null;
32
35
  isRejecting?: boolean;
33
36
  chatInput?: string;
34
37
  onChatInputChange?: (value: string) => void;
35
38
  }
36
- export declare function FeatureDrawerTabs({ featureNode, featureId, initialTab, urlTab, prdData, prdSelections, onPrdSelect, onPrdApprove, onPrdReject, isPrdLoading, techData, onTechApprove, onTechReject, isTechLoading, productData, mergeData, onMergeApprove, onMergeReject, isMergeLoading, isRejecting, chatInput, onChatInputChange, sseEvents, }: FeatureDrawerTabsProps): import("react/jsx-runtime").JSX.Element;
39
+ export declare function FeatureDrawerTabs({ featureNode, featureId, initialTab, urlTab, prdData, prdSelections, onPrdSelect, onPrdApprove, onPrdReject, isPrdLoading, techData, onTechApprove, onTechReject, isTechLoading, productData, mergeData, onMergeApprove, onMergeReject, isMergeLoading, onRebaseOnMain, rebaseLoading, rebaseError, isRejecting, chatInput, onChatInputChange, sseEvents, }: FeatureDrawerTabsProps): import("react/jsx-runtime").JSX.Element;
37
40
  //# sourceMappingURL=feature-drawer-tabs.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"feature-drawer-tabs.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/common/feature-drawer-tabs/feature-drawer-tabs.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAS9E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAClF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AACzF,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,+CAA+C,CAAC;AACjG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAMxE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AAQ9E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uDAAuD,CAAC;AA8C3F,MAAM,WAAW,sBAAsB;IACrC,WAAW,EAA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AAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAC7C;AAwBD,wBAAgB,iBAAiB,CAAC,EAChC,WAAW,EACX,SAAS,EACT,UAAU,EACV,MAAM,EACN,OAAO,EACP,aAAa,EACb,WAAW,EACX,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,aAAa,EACb,YAAY,EACZ,aAAa,EACb,WAAW,EACX,SAAS,EACT,cAAc,EACd,aAAa,EACb,cAAc,EACd,WAAW,EACX,SAAS,EACT,iBAAiB,EACjB,SAAS,GACV,EAAE,sBAAsB,2CA8UxB"}
1
+ {"version":3,"file":"feature-drawer-tabs.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/common/feature-drawer-tabs/feature-drawer-tabs.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAS9E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAClF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AACzF,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,+CAA+C,CAAC;AACjG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAMxE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AAQ9E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uDAAuD,CAAC;AA8C3F,MAAM,WAAW,sBAAsB;IACrC,WAAW,EAAE,eAAe,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,aAAa,CAAC;IAC3B,gFAAgF;IAChF,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,mFAAmF;IACnF,SAAS,CAAC,EAAE,SAAS,iBAAiB,EAAE,CAAC;IAGzC,OAAO,CAAC,EAAE,oBAAo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EACT,UAAU,EACV,MAAM,EACN,OAAO,EACP,aAAa,EACb,WAAW,EACX,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,aAAa,EACb,YAAY,EACZ,aAAa,EACb,WAAW,EACX,SAAS,EACT,cAAc,EACd,aAAa,EACb,cAAc,EACd,cAAc,EACd,aAAa,EACb,WAAW,EACX,WAAW,EACX,SAAS,EACT,iBAAiB,EACjB,SAAS,GACV,EAAE,sBAAsB,2CAmVxB"}
@@ -64,7 +64,7 @@ const TAB_FETCHERS = {
64
64
  activity: fetchActivity,
65
65
  plan: fetchPlan,
66
66
  };
67
- export function FeatureDrawerTabs({ featureNode, featureId, initialTab, urlTab, prdData, prdSelections, onPrdSelect, onPrdApprove, onPrdReject, isPrdLoading, techData, onTechApprove, onTechReject, isTechLoading, productData, mergeData, onMergeApprove, onMergeReject, isMergeLoading, isRejecting, chatInput, onChatInputChange, sseEvents, }) {
67
+ export function FeatureDrawerTabs({ featureNode, featureId, initialTab, urlTab, prdData, prdSelections, onPrdSelect, onPrdApprove, onPrdReject, isPrdLoading, techData, onTechApprove, onTechReject, isTechLoading, productData, mergeData, onMergeApprove, onMergeReject, isMergeLoading, onRebaseOnMain, rebaseLoading, rebaseError, isRejecting, chatInput, onChatInputChange, sseEvents, }) {
68
68
  const pathname = usePathname();
69
69
  const visibleTabs = useMemo(() => computeVisibleTabs(featureNode), [featureNode]);
70
70
  const visibleTabDefs = useMemo(() => ALL_TABS.filter((t) => visibleTabs.includes(t.key)).map((t) => t.key === 'merge-review' && featureNode.lifecycle === 'maintain'
@@ -241,7 +241,7 @@ export function FeatureDrawerTabs({ featureNode, featureId, initialTab, urlTab,
241
241
  fetchTab(tab);
242
242
  }
243
243
  }, [fetchTab]);
244
- return (_jsx("div", { className: "flex min-h-0 flex-1 flex-col", children: _jsxs(Tabs, { value: activeTab, onValueChange: handleTabChange, className: "flex min-h-0 flex-1 flex-col", children: [_jsx("div", { className: "shrink-0 overflow-x-auto px-4 pt-4", children: _jsx(TabsList, { className: "flex w-full", children: visibleTabDefs.map((tab) => (_jsx(TabsTrigger, { value: tab.key, className: "flex-1", children: tab.label }, tab.key))) }) }), _jsx(TabsContent, { value: "overview", className: "mt-0 flex-1 overflow-y-auto", children: _jsx(OverviewTab, { data: featureNode }) }), _jsx(TabsContent, { value: "activity", className: "mt-0 flex-1 overflow-y-auto", children: _jsx(ActivityTab, { timings: tabs.activity.data?.timings ?? null, loading: tabs.activity.loading, error: tabs.activity.error, rejectionFeedback: tabs.activity.data?.rejectionFeedback }) }), _jsx(TabsContent, { value: "log", className: "mt-0 flex-1 overflow-hidden", children: _jsx(LogTab, { content: featureLogs.content, isConnected: featureLogs.isConnected, error: featureLogs.error }) }), _jsx(TabsContent, { value: "plan", className: "mt-0 flex-1 overflow-y-auto", children: _jsx(PlanTab, { plan: tabs.plan.data, loading: tabs.plan.loading, error: tabs.plan.error }) }), visibleTabs.includes('prd-review') ? (_jsx(TabsContent, { value: "prd-review", className: "mt-0 flex min-h-0 flex-1 flex-col", children: prdData ? (_jsx(PrdQuestionnaire, { data: prdData, selections: prdSelections ?? {}, onSelect: onPrdSelect ?? (() => undefined), onApprove: onPrdApprove ?? (() => undefined), onReject: onPrdReject, isProcessing: isPrdLoading, isRejecting: isRejecting, chatInput: chatInput, onChatInputChange: onChatInputChange })) : (_jsx("div", { className: "flex items-center justify-center p-8", children: _jsx(Loader2, { className: "text-muted-foreground h-6 w-6 animate-spin" }) })) })) : null, visibleTabs.includes('tech-decisions') ? (_jsx(TabsContent, { value: "tech-decisions", className: "mt-0 flex min-h-0 flex-1 flex-col", children: techData ? (_jsxs("div", { className: "flex min-h-0 flex-1 flex-col", children: [_jsx("div", { className: "flex-1 overflow-y-auto", children: _jsx(TechDecisionsContent, { data: techData }) }), _jsx(DrawerActionBarForTech, { onApprove: onTechApprove ?? (() => undefined), onReject: onTechReject, isProcessing: isTechLoading, isRejecting: isRejecting, chatInput: chatInput, onChatInputChange: onChatInputChange })] })) : (_jsx("div", { className: "flex items-center justify-center p-8", children: _jsx(Loader2, { className: "text-muted-foreground h-6 w-6 animate-spin" }) })) })) : null, visibleTabs.includes('product-decisions') ? (_jsx(TabsContent, { value: "product-decisions", className: "mt-0 flex-1 overflow-y-auto", children: productData === null ? (_jsx("div", { className: "flex items-center justify-center p-8", children: _jsx(Loader2, { className: "text-muted-foreground h-6 w-6 animate-spin" }) })) : productData ? (_jsx(ProductDecisionsSummary, { data: productData })) : (_jsx("p", { className: "text-muted-foreground p-4 text-center text-sm", children: "No product decisions available." })) })) : null, visibleTabs.includes('merge-review') ? (_jsx(TabsContent, { value: "merge-review", className: "mt-0 flex min-h-0 flex-1 flex-col", children: mergeData ? (_jsx(MergeReview, { data: mergeData, readOnly: featureNode.lifecycle === 'maintain', onApprove: onMergeApprove ?? (() => undefined), onReject: onMergeReject, isProcessing: isMergeLoading, isRejecting: isRejecting, chatInput: chatInput, onChatInputChange: onChatInputChange })) : (_jsx("div", { className: "flex items-center justify-center p-8", children: _jsx(Loader2, { className: "text-muted-foreground h-6 w-6 animate-spin" }) })) })) : null] }) }));
244
+ return (_jsx("div", { className: "flex min-h-0 flex-1 flex-col", children: _jsxs(Tabs, { value: activeTab, onValueChange: handleTabChange, className: "flex min-h-0 flex-1 flex-col", children: [_jsx("div", { className: "shrink-0 overflow-x-auto px-4 pt-4", children: _jsx(TabsList, { className: "flex w-full", children: visibleTabDefs.map((tab) => (_jsx(TabsTrigger, { value: tab.key, className: "flex-1", children: tab.label }, tab.key))) }) }), _jsx(TabsContent, { value: "overview", className: "mt-0 flex-1 overflow-y-auto", children: _jsx(OverviewTab, { data: featureNode, onRebaseOnMain: onRebaseOnMain, rebaseLoading: rebaseLoading, rebaseError: rebaseError }) }), _jsx(TabsContent, { value: "activity", className: "mt-0 flex-1 overflow-y-auto", children: _jsx(ActivityTab, { timings: tabs.activity.data?.timings ?? null, loading: tabs.activity.loading, error: tabs.activity.error, rejectionFeedback: tabs.activity.data?.rejectionFeedback }) }), _jsx(TabsContent, { value: "log", className: "mt-0 flex-1 overflow-hidden", children: _jsx(LogTab, { content: featureLogs.content, isConnected: featureLogs.isConnected, error: featureLogs.error }) }), _jsx(TabsContent, { value: "plan", className: "mt-0 flex-1 overflow-y-auto", children: _jsx(PlanTab, { plan: tabs.plan.data, loading: tabs.plan.loading, error: tabs.plan.error }) }), visibleTabs.includes('prd-review') ? (_jsx(TabsContent, { value: "prd-review", className: "mt-0 flex min-h-0 flex-1 flex-col", children: prdData ? (_jsx(PrdQuestionnaire, { data: prdData, selections: prdSelections ?? {}, onSelect: onPrdSelect ?? (() => undefined), onApprove: onPrdApprove ?? (() => undefined), onReject: onPrdReject, isProcessing: isPrdLoading, isRejecting: isRejecting, chatInput: chatInput, onChatInputChange: onChatInputChange })) : (_jsx("div", { className: "flex items-center justify-center p-8", children: _jsx(Loader2, { className: "text-muted-foreground h-6 w-6 animate-spin" }) })) })) : null, visibleTabs.includes('tech-decisions') ? (_jsx(TabsContent, { value: "tech-decisions", className: "mt-0 flex min-h-0 flex-1 flex-col", children: techData ? (_jsxs("div", { className: "flex min-h-0 flex-1 flex-col", children: [_jsx("div", { className: "flex-1 overflow-y-auto", children: _jsx(TechDecisionsContent, { data: techData }) }), _jsx(DrawerActionBarForTech, { onApprove: onTechApprove ?? (() => undefined), onReject: onTechReject, isProcessing: isTechLoading, isRejecting: isRejecting, chatInput: chatInput, onChatInputChange: onChatInputChange })] })) : (_jsx("div", { className: "flex items-center justify-center p-8", children: _jsx(Loader2, { className: "text-muted-foreground h-6 w-6 animate-spin" }) })) })) : null, visibleTabs.includes('product-decisions') ? (_jsx(TabsContent, { value: "product-decisions", className: "mt-0 flex-1 overflow-y-auto", children: productData === null ? (_jsx("div", { className: "flex items-center justify-center p-8", children: _jsx(Loader2, { className: "text-muted-foreground h-6 w-6 animate-spin" }) })) : productData ? (_jsx(ProductDecisionsSummary, { data: productData })) : (_jsx("p", { className: "text-muted-foreground p-4 text-center text-sm", children: "No product decisions available." })) })) : null, visibleTabs.includes('merge-review') ? (_jsx(TabsContent, { value: "merge-review", className: "mt-0 flex min-h-0 flex-1 flex-col", children: mergeData ? (_jsx(MergeReview, { data: mergeData, readOnly: featureNode.lifecycle === 'maintain', onApprove: onMergeApprove ?? (() => undefined), onReject: onMergeReject, isProcessing: isMergeLoading, isRejecting: isRejecting, chatInput: chatInput, onChatInputChange: onChatInputChange })) : (_jsx("div", { className: "flex items-center justify-center p-8", children: _jsx(Loader2, { className: "text-muted-foreground h-6 w-6 animate-spin" }) })) })) : null] }) }));
245
245
  }
246
246
  // ── Private helper ──────────────────────────────────────────────────────
247
247
  function DrawerActionBarForTech({ onApprove, onReject, isProcessing, isRejecting, chatInput, onChatInputChange, }) {
@@ -1,6 +1,9 @@
1
1
  import type { FeatureNodeData } from '../../common/feature-node/index.js';
2
2
  export interface OverviewTabProps {
3
3
  data: FeatureNodeData;
4
+ onRebaseOnMain?: () => void;
5
+ rebaseLoading?: boolean;
6
+ rebaseError?: string | null;
4
7
  }
5
- export declare function OverviewTab({ data }: OverviewTabProps): import("react/jsx-runtime").JSX.Element;
8
+ export declare function OverviewTab({ data, onRebaseOnMain, rebaseLoading, rebaseError, }: OverviewTabProps): import("react/jsx-runtime").JSX.Element;
6
9
  //# sourceMappingURL=overview-tab.d.ts.map