@shepai/cli 1.130.0 → 1.130.1-pr396.844e95f

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 (286) hide show
  1. package/apis/json-schema/FeatureFlags.yaml +5 -0
  2. package/dist/packages/core/src/application/ports/output/services/git-pr-service.interface.d.ts +73 -5
  3. package/dist/packages/core/src/application/ports/output/services/git-pr-service.interface.d.ts.map +1 -1
  4. package/dist/packages/core/src/application/ports/output/services/git-pr-service.interface.js +6 -4
  5. package/dist/packages/core/src/application/use-cases/features/rebase-feature-on-main.use-case.d.ts +28 -0
  6. package/dist/packages/core/src/application/use-cases/features/rebase-feature-on-main.use-case.d.ts.map +1 -0
  7. package/dist/packages/core/src/application/use-cases/features/rebase-feature-on-main.use-case.js +81 -0
  8. package/dist/packages/core/src/application/use-cases/repositories/sync-repository-main.use-case.d.ts +16 -0
  9. package/dist/packages/core/src/application/use-cases/repositories/sync-repository-main.use-case.d.ts.map +1 -0
  10. package/dist/packages/core/src/application/use-cases/repositories/sync-repository-main.use-case.js +43 -0
  11. package/dist/packages/core/src/domain/factories/settings-defaults.factory.d.ts.map +1 -1
  12. package/dist/packages/core/src/domain/factories/settings-defaults.factory.js +1 -0
  13. package/dist/packages/core/src/domain/generated/output.d.ts +4 -0
  14. package/dist/packages/core/src/domain/generated/output.d.ts.map +1 -1
  15. package/dist/packages/core/src/infrastructure/di/container.d.ts.map +1 -1
  16. package/dist/packages/core/src/infrastructure/di/container.js +15 -0
  17. package/dist/packages/core/src/infrastructure/persistence/sqlite/mappers/settings.mapper.d.ts +1 -0
  18. package/dist/packages/core/src/infrastructure/persistence/sqlite/mappers/settings.mapper.d.ts.map +1 -1
  19. package/dist/packages/core/src/infrastructure/persistence/sqlite/mappers/settings.mapper.js +2 -0
  20. package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/042-add-feature-flag-git-rebase-sync.d.ts +11 -0
  21. package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/042-add-feature-flag-git-rebase-sync.d.ts.map +1 -0
  22. package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/042-add-feature-flag-git-rebase-sync.js +17 -0
  23. package/dist/packages/core/src/infrastructure/repositories/sqlite-settings.repository.d.ts.map +1 -1
  24. package/dist/packages/core/src/infrastructure/repositories/sqlite-settings.repository.js +3 -2
  25. package/dist/packages/core/src/infrastructure/services/agents/common/agent-validator.service.js +1 -1
  26. package/dist/packages/core/src/infrastructure/services/agents/common/executors/cursor-executor.service.d.ts +5 -5
  27. package/dist/packages/core/src/infrastructure/services/agents/common/executors/cursor-executor.service.js +8 -8
  28. package/dist/packages/core/src/infrastructure/services/agents/conflict-resolution/conflict-resolution.prompt.d.ts +35 -0
  29. package/dist/packages/core/src/infrastructure/services/agents/conflict-resolution/conflict-resolution.prompt.d.ts.map +1 -0
  30. package/dist/packages/core/src/infrastructure/services/agents/conflict-resolution/conflict-resolution.prompt.js +66 -0
  31. package/dist/packages/core/src/infrastructure/services/agents/conflict-resolution/conflict-resolution.service.d.ts +42 -0
  32. package/dist/packages/core/src/infrastructure/services/agents/conflict-resolution/conflict-resolution.service.d.ts.map +1 -0
  33. package/dist/packages/core/src/infrastructure/services/agents/conflict-resolution/conflict-resolution.service.js +169 -0
  34. package/dist/packages/core/src/infrastructure/services/deployment/deployment.service.d.ts +21 -1
  35. package/dist/packages/core/src/infrastructure/services/deployment/deployment.service.d.ts.map +1 -1
  36. package/dist/packages/core/src/infrastructure/services/deployment/deployment.service.js +152 -12
  37. package/dist/packages/core/src/infrastructure/services/deployment/detect-dev-script.d.ts +1 -0
  38. package/dist/packages/core/src/infrastructure/services/deployment/detect-dev-script.d.ts.map +1 -1
  39. package/dist/packages/core/src/infrastructure/services/deployment/detect-dev-script.js +3 -2
  40. package/dist/packages/core/src/infrastructure/services/git/git-pr.service.d.ts +6 -0
  41. package/dist/packages/core/src/infrastructure/services/git/git-pr.service.d.ts.map +1 -1
  42. package/dist/packages/core/src/infrastructure/services/git/git-pr.service.js +134 -0
  43. package/dist/src/presentation/web/app/(dashboard)/get-graph-data.d.ts.map +1 -1
  44. package/dist/src/presentation/web/app/(dashboard)/get-graph-data.js +5 -12
  45. package/dist/src/presentation/web/app/actions/check-agent-auth.js +1 -1
  46. package/dist/src/presentation/web/app/actions/rebase-feature.d.ts +5 -0
  47. package/dist/src/presentation/web/app/actions/rebase-feature.d.ts.map +1 -0
  48. package/dist/src/presentation/web/app/actions/rebase-feature.js +16 -0
  49. package/dist/src/presentation/web/app/actions/sync-repository.d.ts +5 -0
  50. package/dist/src/presentation/web/app/actions/sync-repository.d.ts.map +1 -0
  51. package/dist/src/presentation/web/app/actions/sync-repository.js +16 -0
  52. package/dist/src/presentation/web/components/common/control-center-drawer/feature-drawer-client.d.ts.map +1 -1
  53. package/dist/src/presentation/web/components/common/control-center-drawer/feature-drawer-client.js +2 -1
  54. package/dist/src/presentation/web/components/common/control-center-drawer/repository-drawer-client.d.ts.map +1 -1
  55. package/dist/src/presentation/web/components/common/control-center-drawer/repository-drawer-client.js +4 -4
  56. package/dist/src/presentation/web/components/common/feature-drawer/use-feature-actions.d.ts +4 -0
  57. package/dist/src/presentation/web/components/common/feature-drawer/use-feature-actions.d.ts.map +1 -1
  58. package/dist/src/presentation/web/components/common/feature-drawer/use-feature-actions.js +32 -1
  59. package/dist/src/presentation/web/components/common/feature-drawer-tabs/feature-drawer-tabs.d.ts +4 -1
  60. package/dist/src/presentation/web/components/common/feature-drawer-tabs/feature-drawer-tabs.d.ts.map +1 -1
  61. package/dist/src/presentation/web/components/common/feature-drawer-tabs/feature-drawer-tabs.js +2 -2
  62. package/dist/src/presentation/web/components/common/feature-drawer-tabs/overview-tab.d.ts +4 -1
  63. package/dist/src/presentation/web/components/common/feature-drawer-tabs/overview-tab.d.ts.map +1 -1
  64. package/dist/src/presentation/web/components/common/feature-drawer-tabs/overview-tab.js +8 -3
  65. package/dist/src/presentation/web/components/common/feature-drawer-tabs/overview-tab.stories.d.ts +6 -0
  66. package/dist/src/presentation/web/components/common/feature-drawer-tabs/overview-tab.stories.d.ts.map +1 -1
  67. package/dist/src/presentation/web/components/common/feature-drawer-tabs/overview-tab.stories.js +30 -0
  68. package/dist/src/presentation/web/components/common/open-action-menu/open-action-menu.stories.d.ts.map +1 -1
  69. package/dist/src/presentation/web/components/common/open-action-menu/open-action-menu.stories.js +3 -0
  70. package/dist/src/presentation/web/components/common/repository-node/repository-drawer.d.ts.map +1 -1
  71. package/dist/src/presentation/web/components/common/repository-node/repository-drawer.js +5 -3
  72. package/dist/src/presentation/web/components/common/repository-node/repository-node.js +1 -1
  73. package/dist/src/presentation/web/components/common/repository-node/use-repository-actions.d.ts +4 -0
  74. package/dist/src/presentation/web/components/common/repository-node/use-repository-actions.d.ts.map +1 -1
  75. package/dist/src/presentation/web/components/common/repository-node/use-repository-actions.js +11 -0
  76. package/dist/src/presentation/web/components/features/settings/feature-flags-settings-section.d.ts.map +1 -1
  77. package/dist/src/presentation/web/components/features/settings/feature-flags-settings-section.js +3 -0
  78. package/dist/src/presentation/web/components/features/settings/feature-flags-settings-section.stories.d.ts.map +1 -1
  79. package/dist/src/presentation/web/components/features/settings/feature-flags-settings-section.stories.js +3 -0
  80. package/dist/src/presentation/web/components/features/settings/settings-page-client.d.ts.map +1 -1
  81. package/dist/src/presentation/web/components/features/settings/settings-page-client.js +5 -0
  82. package/dist/src/presentation/web/components/features/settings/settings-page-client.stories.d.ts.map +1 -1
  83. package/dist/src/presentation/web/components/features/settings/settings-page-client.stories.js +1 -0
  84. package/dist/src/presentation/web/components/layouts/app-sidebar/app-sidebar.stories.d.ts.map +1 -1
  85. package/dist/src/presentation/web/components/layouts/app-sidebar/app-sidebar.stories.js +1 -0
  86. package/dist/src/presentation/web/dev-server.js +7 -0
  87. package/dist/src/presentation/web/hooks/feature-flags-context.d.ts.map +1 -1
  88. package/dist/src/presentation/web/hooks/feature-flags-context.js +1 -0
  89. package/dist/src/presentation/web/lib/feature-flags.d.ts +2 -0
  90. package/dist/src/presentation/web/lib/feature-flags.d.ts.map +1 -1
  91. package/dist/src/presentation/web/lib/feature-flags.js +5 -0
  92. package/dist/tsconfig.build.tsbuildinfo +1 -1
  93. package/package.json +1 -1
  94. package/web/.next/BUILD_ID +1 -1
  95. package/web/.next/build-manifest.json +2 -2
  96. package/web/.next/fallback-build-manifest.json +2 -2
  97. package/web/.next/prerender-manifest.json +3 -3
  98. package/web/.next/required-server-files.js +3 -3
  99. package/web/.next/required-server-files.json +3 -3
  100. package/web/.next/server/app/(dashboard)/@drawer/adopt/page/server-reference-manifest.json +63 -48
  101. package/web/.next/server/app/(dashboard)/@drawer/adopt/page.js +2 -2
  102. package/web/.next/server/app/(dashboard)/@drawer/adopt/page.js.nft.json +1 -1
  103. package/web/.next/server/app/(dashboard)/@drawer/adopt/page_client-reference-manifest.js +1 -1
  104. package/web/.next/server/app/(dashboard)/@drawer/create/page/server-reference-manifest.json +63 -48
  105. package/web/.next/server/app/(dashboard)/@drawer/create/page.js +2 -2
  106. package/web/.next/server/app/(dashboard)/@drawer/create/page.js.nft.json +1 -1
  107. package/web/.next/server/app/(dashboard)/@drawer/create/page_client-reference-manifest.js +1 -1
  108. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/server-reference-manifest.json +90 -60
  109. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js +2 -2
  110. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  111. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  112. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/server-reference-manifest.json +90 -60
  113. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js +2 -2
  114. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js.nft.json +1 -1
  115. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page_client-reference-manifest.js +1 -1
  116. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/server-reference-manifest.json +59 -44
  117. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js +2 -2
  118. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js.nft.json +1 -1
  119. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  120. package/web/.next/server/app/(dashboard)/create/page/server-reference-manifest.json +63 -48
  121. package/web/.next/server/app/(dashboard)/create/page.js +2 -2
  122. package/web/.next/server/app/(dashboard)/create/page.js.nft.json +1 -1
  123. package/web/.next/server/app/(dashboard)/create/page_client-reference-manifest.js +1 -1
  124. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/server-reference-manifest.json +90 -60
  125. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js +2 -2
  126. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  127. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  128. package/web/.next/server/app/(dashboard)/feature/[featureId]/page/server-reference-manifest.json +90 -60
  129. package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js +2 -2
  130. package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js.nft.json +1 -1
  131. package/web/.next/server/app/(dashboard)/feature/[featureId]/page_client-reference-manifest.js +1 -1
  132. package/web/.next/server/app/(dashboard)/page/server-reference-manifest.json +59 -44
  133. package/web/.next/server/app/(dashboard)/page.js +2 -2
  134. package/web/.next/server/app/(dashboard)/page.js.nft.json +1 -1
  135. package/web/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
  136. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/server-reference-manifest.json +59 -44
  137. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js +2 -2
  138. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js.nft.json +1 -1
  139. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  140. package/web/.next/server/app/_global-error.html +2 -2
  141. package/web/.next/server/app/_global-error.rsc +1 -1
  142. package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  143. package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  144. package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  145. package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  146. package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  147. package/web/.next/server/app/_not-found/page/server-reference-manifest.json +3 -3
  148. package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  149. package/web/.next/server/app/api/attachments/preview/route.js.nft.json +1 -1
  150. package/web/.next/server/app/api/evidence/route.js.nft.json +1 -1
  151. package/web/.next/server/app/api/graph-data/route.js.nft.json +1 -1
  152. package/web/.next/server/app/settings/page/server-reference-manifest.json +8 -8
  153. package/web/.next/server/app/settings/page.js.nft.json +1 -1
  154. package/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  155. package/web/.next/server/app/skills/page/server-reference-manifest.json +8 -8
  156. package/web/.next/server/app/skills/page.js.nft.json +1 -1
  157. package/web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  158. package/web/.next/server/app/tools/page/server-reference-manifest.json +8 -8
  159. package/web/.next/server/app/tools/page.js.nft.json +1 -1
  160. package/web/.next/server/app/tools/page_client-reference-manifest.js +1 -1
  161. package/web/.next/server/app/version/page/server-reference-manifest.json +3 -3
  162. package/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
  163. package/web/.next/server/chunks/403f9_next_dist_esm_build_templates_app-route_370c43b1.js +1 -1
  164. package/web/.next/server/chunks/403f9_next_dist_esm_build_templates_app-route_370c43b1.js.map +1 -1
  165. package/web/.next/server/chunks/[root-of-the-server]__a402b567._.js +1 -1
  166. package/web/.next/server/chunks/[root-of-the-server]__cd67a84c._.js.map +1 -1
  167. package/web/.next/server/chunks/[root-of-the-server]__d1dc8fcd._.js.map +1 -1
  168. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js +1 -1
  169. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js.map +1 -1
  170. package/web/.next/server/chunks/ssr/[root-of-the-server]__357d99f9._.js +1 -1
  171. package/web/.next/server/chunks/ssr/[root-of-the-server]__39ecb785._.js +4 -0
  172. package/web/.next/server/chunks/ssr/[root-of-the-server]__39ecb785._.js.map +1 -0
  173. package/web/.next/server/chunks/ssr/[root-of-the-server]__43f51aa6._.js +1 -1
  174. package/web/.next/server/chunks/ssr/[root-of-the-server]__43f51aa6._.js.map +1 -1
  175. package/web/.next/server/chunks/ssr/[root-of-the-server]__465c0deb._.js +4 -0
  176. package/web/.next/server/chunks/ssr/[root-of-the-server]__465c0deb._.js.map +1 -0
  177. package/web/.next/server/chunks/ssr/[root-of-the-server]__5142820f._.js +2 -2
  178. package/web/.next/server/chunks/ssr/[root-of-the-server]__5142820f._.js.map +1 -1
  179. package/web/.next/server/chunks/ssr/[root-of-the-server]__57018345._.js.map +1 -1
  180. package/web/.next/server/chunks/ssr/[root-of-the-server]__6bb00d90._.js +2 -2
  181. package/web/.next/server/chunks/ssr/[root-of-the-server]__6bb00d90._.js.map +1 -1
  182. package/web/.next/server/chunks/ssr/[root-of-the-server]__7894f27f._.js +1 -1
  183. package/web/.next/server/chunks/ssr/[root-of-the-server]__7894f27f._.js.map +1 -1
  184. package/web/.next/server/chunks/ssr/[root-of-the-server]__815546bd._.js +1 -1
  185. package/web/.next/server/chunks/ssr/[root-of-the-server]__815546bd._.js.map +1 -1
  186. package/web/.next/server/chunks/ssr/[root-of-the-server]__84f72684._.js +1 -1
  187. package/web/.next/server/chunks/ssr/[root-of-the-server]__8b6d1e18._.js +4 -0
  188. package/web/.next/server/chunks/ssr/[root-of-the-server]__8b6d1e18._.js.map +1 -0
  189. package/web/.next/server/chunks/ssr/[root-of-the-server]__8f6c27af._.js +6 -0
  190. package/web/.next/server/chunks/ssr/[root-of-the-server]__8f6c27af._.js.map +1 -0
  191. package/web/.next/server/chunks/ssr/[root-of-the-server]__910e9de5._.js +4 -0
  192. package/web/.next/server/chunks/ssr/[root-of-the-server]__910e9de5._.js.map +1 -0
  193. package/web/.next/server/chunks/ssr/[root-of-the-server]__a04af228._.js +4 -0
  194. package/web/.next/server/chunks/ssr/[root-of-the-server]__a04af228._.js.map +1 -0
  195. package/web/.next/server/chunks/ssr/[root-of-the-server]__a32728d0._.js +4 -0
  196. package/web/.next/server/chunks/ssr/[root-of-the-server]__a32728d0._.js.map +1 -0
  197. package/web/.next/server/chunks/ssr/[root-of-the-server]__d6ab9c36._.js +6 -0
  198. package/web/.next/server/chunks/ssr/[root-of-the-server]__d6ab9c36._.js.map +1 -0
  199. package/web/.next/server/chunks/ssr/[root-of-the-server]__f2eb7d62._.js +4 -0
  200. package/web/.next/server/chunks/ssr/[root-of-the-server]__f2eb7d62._.js.map +1 -0
  201. package/web/.next/server/chunks/ssr/[root-of-the-server]__f3036814._.js +4 -0
  202. package/web/.next/server/chunks/ssr/[root-of-the-server]__f3036814._.js.map +1 -0
  203. package/web/.next/server/chunks/ssr/_0020fddd._.js +1 -1
  204. package/web/.next/server/chunks/ssr/_0020fddd._.js.map +1 -1
  205. package/web/.next/server/chunks/ssr/_02ec1aea._.js +1 -1
  206. package/web/.next/server/chunks/ssr/_02ec1aea._.js.map +1 -1
  207. package/web/.next/server/chunks/ssr/{_2081d51d._.js → _140d896d._.js} +2 -2
  208. package/web/.next/server/chunks/ssr/{_2081d51d._.js.map → _140d896d._.js.map} +1 -1
  209. package/web/.next/server/chunks/ssr/_7dca1882._.js +1 -1
  210. package/web/.next/server/chunks/ssr/_7dca1882._.js.map +1 -1
  211. package/web/.next/server/chunks/ssr/_a37f5f18._.js +1 -1
  212. package/web/.next/server/chunks/ssr/_a37f5f18._.js.map +1 -1
  213. package/web/.next/server/chunks/ssr/_a9f57758._.js +1 -1
  214. package/web/.next/server/chunks/ssr/_a9f57758._.js.map +1 -1
  215. package/web/.next/server/chunks/ssr/_b3f6e6e9._.js +3 -0
  216. package/web/.next/server/chunks/ssr/_b3f6e6e9._.js.map +1 -0
  217. package/web/.next/server/chunks/ssr/_d4b20e29._.js.map +1 -1
  218. package/web/.next/server/chunks/ssr/_d8575088._.js +1 -1
  219. package/web/.next/server/chunks/ssr/_d8575088._.js.map +1 -1
  220. package/web/.next/server/chunks/ssr/_f39a1adb._.js +1 -1
  221. package/web/.next/server/chunks/ssr/_f39a1adb._.js.map +1 -1
  222. package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js +1 -1
  223. package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js.map +1 -1
  224. package/web/.next/server/chunks/ssr/f3a1f_components_common_control-center-drawer_repository-drawer-client_tsx_39a00c03._.js +1 -1
  225. package/web/.next/server/chunks/ssr/f3a1f_components_common_control-center-drawer_repository-drawer-client_tsx_39a00c03._.js.map +1 -1
  226. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1b176e3c.js +1 -1
  227. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1b176e3c.js.map +1 -1
  228. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_bd9f0dda.js +1 -1
  229. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_bd9f0dda.js.map +1 -1
  230. package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_open-ide_ts_baaca5d5._.js +3 -0
  231. package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_open-ide_ts_baaca5d5._.js.map +1 -0
  232. package/web/.next/server/chunks/ssr/src_presentation_web_ca99d62d._.js +1 -1
  233. package/web/.next/server/chunks/ssr/src_presentation_web_ca99d62d._.js.map +1 -1
  234. package/web/.next/server/chunks/ssr/src_presentation_web_components_e599bb8c._.js +1 -1
  235. package/web/.next/server/chunks/ssr/src_presentation_web_components_e599bb8c._.js.map +1 -1
  236. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js +1 -1
  237. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js.map +1 -1
  238. package/web/.next/server/chunks/ssr/src_presentation_web_e0b3ea67._.js +3 -0
  239. package/web/.next/server/chunks/ssr/{src_presentation_web_de41598a._.js.map → src_presentation_web_e0b3ea67._.js.map} +1 -1
  240. package/web/.next/server/pages/500.html +2 -2
  241. package/web/.next/server/server-reference-manifest.js +1 -1
  242. package/web/.next/server/server-reference-manifest.json +410 -296
  243. package/web/.next/static/chunks/1abca3015dac5760.js +1 -0
  244. package/web/.next/static/chunks/{724dfca1907b26d7.js → 2a8589502f1a3fee.js} +1 -1
  245. package/web/.next/static/chunks/{3b5d54efc5f21506.js → 30ebb9e7d1c85344.js} +1 -1
  246. package/web/.next/static/chunks/{090b4b644f4526bf.js → 3862a16b8161e178.js} +1 -1
  247. package/web/.next/static/chunks/{747b3443a866e39f.js → 4c141b4e9a55bce7.js} +1 -1
  248. package/web/.next/static/chunks/{90a32a641dd33f9a.js → 67d61a2c2eba7344.js} +1 -1
  249. package/web/.next/static/chunks/{22d08ce7fbc67732.js → 81b305ae4f28a883.js} +1 -1
  250. package/web/.next/static/chunks/{f8ce00057329618b.js → ba4f86a38068e68f.js} +1 -1
  251. package/web/.next/static/chunks/{339e72cfa282c94b.js → bb21c9f0d314b89b.js} +1 -1
  252. package/web/.next/static/chunks/bfda4e4194a4a633.js +1 -0
  253. package/web/.next/static/chunks/{8d936038e7d013d2.js → c016b9d991594eef.js} +1 -1
  254. package/web/.next/static/chunks/{bdf477379453ead2.js → c329033db1c63a56.js} +2 -2
  255. package/web/.next/static/chunks/{9387d6dde6140968.js → e9d1ed018e858117.js} +2 -2
  256. package/web/.next/static/chunks/{0b7fe2ac4f078f54.js → f070c67389a686ff.js} +1 -1
  257. package/web/.next/server/chunks/ssr/744ca_web__next-internal_server_app_(dashboard)_@drawer_adopt_page_actions_4e741df2.js +0 -3
  258. package/web/.next/server/chunks/ssr/744ca_web__next-internal_server_app_(dashboard)_@drawer_adopt_page_actions_4e741df2.js.map +0 -1
  259. package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_@drawer_repository_[repositoryId]_page_actions_026fdffa.js +0 -3
  260. package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_@drawer_repository_[repositoryId]_page_actions_026fdffa.js.map +0 -1
  261. package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_repository_[repositoryId]_page_actions_8b91e197.js +0 -3
  262. package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_repository_[repositoryId]_page_actions_8b91e197.js.map +0 -1
  263. package/web/.next/server/chunks/ssr/[root-of-the-server]__755cfe02._.js +0 -3
  264. package/web/.next/server/chunks/ssr/[root-of-the-server]__755cfe02._.js.map +0 -1
  265. package/web/.next/server/chunks/ssr/[root-of-the-server]__99ab2519._.js +0 -4
  266. package/web/.next/server/chunks/ssr/[root-of-the-server]__99ab2519._.js.map +0 -1
  267. package/web/.next/server/chunks/ssr/[root-of-the-server]__a628fb91._.js +0 -3
  268. package/web/.next/server/chunks/ssr/[root-of-the-server]__a628fb91._.js.map +0 -1
  269. package/web/.next/server/chunks/ssr/[root-of-the-server]__bfba58e6._.js +0 -3
  270. package/web/.next/server/chunks/ssr/[root-of-the-server]__bfba58e6._.js.map +0 -1
  271. package/web/.next/server/chunks/ssr/[root-of-the-server]__c3ab8422._.js +0 -3
  272. package/web/.next/server/chunks/ssr/[root-of-the-server]__c3ab8422._.js.map +0 -1
  273. package/web/.next/server/chunks/ssr/_c6edd1ef._.js +0 -3
  274. package/web/.next/server/chunks/ssr/_c6edd1ef._.js.map +0 -1
  275. package/web/.next/server/chunks/ssr/src_presentation_web_8e7fe0d1._.js +0 -5
  276. package/web/.next/server/chunks/ssr/src_presentation_web_8e7fe0d1._.js.map +0 -1
  277. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_ca051134.js +0 -3
  278. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_ca051134.js.map +0 -1
  279. package/web/.next/server/chunks/ssr/src_presentation_web_b9023017._.js +0 -5
  280. package/web/.next/server/chunks/ssr/src_presentation_web_b9023017._.js.map +0 -1
  281. package/web/.next/server/chunks/ssr/src_presentation_web_de41598a._.js +0 -3
  282. package/web/.next/static/chunks/bcdcdce9139bfd25.js +0 -1
  283. package/web/.next/static/chunks/eb9841ec4d80af01.js +0 -1
  284. /package/web/.next/static/{FkranKu-K5LY21_CdI_Jp → g-QN4RQQtXsVFedVM1Dcs}/_buildManifest.js +0 -0
  285. /package/web/.next/static/{FkranKu-K5LY21_CdI_Jp → g-QN4RQQtXsVFedVM1Dcs}/_clientMiddlewareManifest.json +0 -0
  286. /package/web/.next/static/{FkranKu-K5LY21_CdI_Jp → g-QN4RQQtXsVFedVM1Dcs}/_ssgManifest.js +0 -0
@@ -9,18 +9,20 @@
9
9
  * On startup, call `recoverAll()` to reconcile the DB with actual
10
10
  * process state (clean up dead PIDs, re-adopt live ones).
11
11
  */
12
- import { spawn } from 'node:child_process';
12
+ import { spawn, execFileSync } from 'node:child_process';
13
+ import { existsSync } from 'node:fs';
14
+ import { join } from 'node:path';
15
+ import net from 'node:net';
13
16
  import { EventEmitter } from 'node:events';
14
- // NOTE: We intentionally do NOT use tree-kill here. tree-kill traverses
15
- // /proc to find child processes which can accidentally kill parent processes
16
- // (including the Shep web UI). Instead, we use process.kill(-pid) to send
17
- // signals to the process GROUP (since we spawn with detached: true, the
18
- // child gets its own process group via setsid()).
17
+ // On Unix we use process.kill(-pid) to send signals to the process GROUP
18
+ // (detached: true puts the child in its own group via setsid()).
19
+ // On Windows, negative PIDs are not supported use taskkill /T for tree kill.
19
20
  import { DeploymentState } from '../../../domain/generated/output.js';
20
21
  import { detectDevScript } from './detect-dev-script.js';
21
22
  import { createDeploymentLogger } from './deployment-logger.js';
22
23
  import { parsePort } from './parse-port.js';
23
24
  import { LogRingBuffer } from './log-ring-buffer.js';
25
+ import { IS_WINDOWS } from '../../platform.js';
24
26
  const log = createDeploymentLogger('[DeploymentService]');
25
27
  const POLL_INTERVAL_MS = 200;
26
28
  const MAX_WAIT_MS = 5000;
@@ -28,6 +30,20 @@ const defaultDeps = {
28
30
  spawn,
29
31
  detectDevScript,
30
32
  kill: (pid, signal) => {
33
+ if (IS_WINDOWS) {
34
+ // On Windows, negative PIDs are not supported. Use taskkill /T to
35
+ // kill the entire process tree (shell + child dev server).
36
+ try {
37
+ execFileSync('taskkill', ['/F', '/T', '/PID', String(pid)], {
38
+ stdio: 'ignore',
39
+ windowsHide: true,
40
+ });
41
+ }
42
+ catch {
43
+ // Process already dead
44
+ }
45
+ return;
46
+ }
31
47
  try {
32
48
  // Kill the entire process group (negative PID) — safe because
33
49
  // detached: true puts the child in its own group via setsid().
@@ -69,7 +85,16 @@ export class DeploymentService {
69
85
  }
70
86
  /**
71
87
  * Recover dev servers from the database on startup.
72
- * Validates each PID is still alive; removes dead rows.
88
+ *
89
+ * Three recovery strategies based on process state:
90
+ * 1. Alive + Ready (has URL) → re-adopt, then validate URL asynchronously
91
+ * 2. Alive + Booting (no URL) → kill orphan and re-spawn (can't re-attach stdout)
92
+ * 3. Dead → re-spawn if target directory still exists
93
+ *
94
+ * After sync recovery, fires off async URL health checks for re-adopted
95
+ * processes. Zombies (alive but not serving) are killed and re-spawned.
96
+ *
97
+ * All re-spawns are wrapped in try/catch so one failure doesn't block others.
73
98
  */
74
99
  recoverAll() {
75
100
  if (!this.db)
@@ -89,7 +114,10 @@ export class DeploymentService {
89
114
  }
90
115
  log.info(`Recovering ${rows.length} dev server(s) from database`);
91
116
  for (const row of rows) {
92
- if (this.deps.isAlive(row.pid)) {
117
+ const alive = this.deps.isAlive(row.pid);
118
+ const hasUrl = row.state === DeploymentState.Ready && row.url;
119
+ if (alive && hasUrl) {
120
+ // Strategy 1: Process alive and Ready — re-adopt, then validate URL async
93
121
  log.info(`Recovered "${row.target_id}" (pid=${row.pid}, state=${row.state}, url=${row.url})`);
94
122
  const entry = {
95
123
  pid: row.pid,
@@ -104,10 +132,36 @@ export class DeploymentService {
104
132
  logs: new LogRingBuffer(),
105
133
  };
106
134
  this.deployments.set(row.target_id, entry);
135
+ // Fire-and-forget: validate URL is actually responding, kill zombie if not
136
+ this.validateAndRespawn(entry);
137
+ continue;
138
+ }
139
+ if (alive) {
140
+ // Strategy 2: Process alive but stuck in Booting — can't re-attach stdout
141
+ // Kill the orphan so we can re-spawn with proper listeners
142
+ log.info(`Orphan "${row.target_id}" (pid=${row.pid}) stuck in ${row.state} — killing to re-spawn`);
143
+ try {
144
+ this.deps.kill(row.pid, 'SIGKILL');
145
+ }
146
+ catch {
147
+ // already dead
148
+ }
107
149
  }
108
150
  else {
109
- log.info(`Stale dev server "${row.target_id}" (pid=${row.pid}) — removing from DB`);
110
- this.dbDelete(row.target_id);
151
+ log.info(`Dev server "${row.target_id}" (pid=${row.pid}) is dead will re-spawn`);
152
+ }
153
+ // Strategy 2 & 3: Re-spawn if target directory still has a package.json
154
+ this.dbDelete(row.target_id);
155
+ if (!existsSync(join(row.target_path, 'package.json'))) {
156
+ log.warn(`Skipping re-spawn for "${row.target_id}" — no package.json at "${row.target_path}"`);
157
+ continue;
158
+ }
159
+ try {
160
+ log.info(`Re-spawning dev server for "${row.target_id}" at "${row.target_path}"`);
161
+ this.start(row.target_id, row.target_path, row.target_type);
162
+ }
163
+ catch (err) {
164
+ log.error(`Failed to re-spawn "${row.target_id}": ${err}`);
111
165
  }
112
166
  }
113
167
  }
@@ -132,13 +186,34 @@ export class DeploymentService {
132
186
  throw new Error(detection.error);
133
187
  }
134
188
  // Build spawn args based on package manager
135
- const { packageManager, scriptName, command } = detection;
189
+ const { packageManager, scriptName, command, needsInstall } = detection;
136
190
  const args = packageManager === 'npm' ? ['run', scriptName] : [scriptName];
191
+ // Install dependencies if node_modules is missing (e.g. fresh worktree)
192
+ if (needsInstall) {
193
+ log.info(`node_modules missing in "${targetPath}" — running ${packageManager} install`);
194
+ try {
195
+ execFileSync(packageManager, ['install'], {
196
+ cwd: targetPath,
197
+ shell: true,
198
+ stdio: 'ignore',
199
+ ...(IS_WINDOWS ? { windowsHide: true } : {}),
200
+ });
201
+ log.info('Dependencies installed successfully');
202
+ }
203
+ catch (err) {
204
+ log.error(`Dependency install failed: ${err}`);
205
+ throw new Error(`Failed to install dependencies: ${err}`);
206
+ }
207
+ }
137
208
  log.info(`Spawning dev server: command="${command}", packageManager="${packageManager}", scriptName="${scriptName}", cwd="${targetPath}"`);
138
209
  const child = this.deps.spawn(packageManager, args, {
139
210
  shell: true,
140
211
  cwd: targetPath,
141
- detached: true,
212
+ // On Unix, detached: true creates a process group via setsid() so we can
213
+ // kill the entire tree with process.kill(-pid). On Windows this flag causes
214
+ // CREATE_NEW_CONSOLE which opens a visible terminal window and disconnects
215
+ // stdout/stderr — we don't need it because taskkill /F /T handles tree kill.
216
+ ...(IS_WINDOWS ? { windowsHide: true } : { detached: true }),
142
217
  stdio: ['ignore', 'pipe', 'pipe'],
143
218
  });
144
219
  if (!child.pid) {
@@ -452,4 +527,69 @@ export class DeploymentService {
452
527
  });
453
528
  });
454
529
  }
530
+ /**
531
+ * Async health check for a recovered entry. Probes the URL port via TCP.
532
+ * If the port is not responding (zombie process), kills and re-spawns.
533
+ * Fire-and-forget — errors are logged, never thrown.
534
+ */
535
+ async validateAndRespawn(entry) {
536
+ if (!entry.url)
537
+ return;
538
+ const responding = await this.probePort(entry.url);
539
+ if (responding) {
540
+ log.info(`[${entry.targetId}] URL health check passed — "${entry.url}" is responding`);
541
+ return;
542
+ }
543
+ log.warn(`[${entry.targetId}] URL health check FAILED — "${entry.url}" not responding, killing zombie (pid=${entry.pid})`);
544
+ // Kill the zombie
545
+ try {
546
+ this.deps.kill(entry.pid, 'SIGKILL');
547
+ }
548
+ catch {
549
+ // already dead
550
+ }
551
+ this.deployments.delete(entry.targetId);
552
+ this.dbDelete(entry.targetId);
553
+ // Re-spawn if target still exists
554
+ if (!existsSync(join(entry.targetPath, 'package.json'))) {
555
+ log.warn(`Skipping re-spawn for "${entry.targetId}" — no package.json at "${entry.targetPath}"`);
556
+ return;
557
+ }
558
+ try {
559
+ log.info(`Re-spawning dev server for "${entry.targetId}" at "${entry.targetPath}"`);
560
+ this.start(entry.targetId, entry.targetPath, entry.targetType);
561
+ }
562
+ catch (err) {
563
+ log.error(`Failed to re-spawn "${entry.targetId}": ${err}`);
564
+ }
565
+ }
566
+ /**
567
+ * TCP connect probe to check if a URL's port is accepting connections.
568
+ * Returns true if the port responds within 2 seconds, false otherwise.
569
+ */
570
+ probePort(url) {
571
+ return new Promise((resolve) => {
572
+ try {
573
+ const parsed = new URL(url);
574
+ const port = parseInt(parsed.port || (parsed.protocol === 'https:' ? '443' : '80'), 10);
575
+ const socket = net.createConnection({ host: parsed.hostname, port });
576
+ const timeout = setTimeout(() => {
577
+ socket.destroy();
578
+ resolve(false);
579
+ }, 2000);
580
+ socket.on('connect', () => {
581
+ clearTimeout(timeout);
582
+ socket.destroy();
583
+ resolve(true);
584
+ });
585
+ socket.on('error', () => {
586
+ clearTimeout(timeout);
587
+ resolve(false);
588
+ });
589
+ }
590
+ catch {
591
+ resolve(false);
592
+ }
593
+ });
594
+ }
455
595
  }
@@ -10,6 +10,7 @@ export interface DetectDevScriptSuccess {
10
10
  packageManager: string;
11
11
  scriptName: string;
12
12
  command: string;
13
+ needsInstall: boolean;
13
14
  }
14
15
  export interface DetectDevScriptError {
15
16
  success: false;
@@ -1 +1 @@
1
- {"version":3,"file":"detect-dev-script.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/services/deployment/detect-dev-script.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAgBH,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,IAAI,CAAC;IACd,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,KAAK,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,MAAM,qBAAqB,GAAG,sBAAsB,GAAG,oBAAoB,CAAC;AAIlF;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,qBAAqB,CAuCtE"}
1
+ {"version":3,"file":"detect-dev-script.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/services/deployment/detect-dev-script.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAgBH,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,IAAI,CAAC;IACd,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,KAAK,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,MAAM,qBAAqB,GAAG,sBAAsB,GAAG,oBAAoB,CAAC;AAIlF;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,qBAAqB,CAwCtE"}
@@ -50,8 +50,9 @@ export function detectDevScript(dirPath) {
50
50
  const packageManager = detectPackageManager(dirPath);
51
51
  // Build the command — pnpm/yarn use `<pm> <script>`, npm uses `npm run <script>`
52
52
  const command = packageManager === 'npm' ? `npm run ${scriptName}` : `${packageManager} ${scriptName}`;
53
- log.info(`detected packageManager="${packageManager}", scriptName="${scriptName}", command="${command}"`);
54
- return { success: true, packageManager, scriptName, command };
53
+ const needsInstall = !existsSync(join(dirPath, 'node_modules'));
54
+ log.info(`detected packageManager="${packageManager}", scriptName="${scriptName}", command="${command}", needsInstall=${needsInstall}`);
55
+ return { success: true, packageManager, scriptName, command, needsInstall };
55
56
  }
56
57
  /**
57
58
  * Detect the package manager by checking for lockfile presence.
@@ -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":"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"}
1
+ {"version":3,"file":"git-pr.service.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/services/git/git-pr.service.ts"],"names":[],"mappings":"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"}
@@ -609,6 +609,14 @@ let GitPrService = class GitPrService {
609
609
  parseGitError(error) {
610
610
  const message = error instanceof Error ? error.message : String(error);
611
611
  const cause = error instanceof Error ? error : undefined;
612
+ // Rebase-specific: detect "CONFLICT" during rebase operations
613
+ if (message.includes('CONFLICT') && message.includes('rebase')) {
614
+ return new GitPrError(message, GitPrErrorCode.REBASE_CONFLICT, cause);
615
+ }
616
+ // Sync-specific: non-fast-forward or diverged branch
617
+ if (message.includes('non-fast-forward') || message.includes('diverged')) {
618
+ return new GitPrError(message, GitPrErrorCode.SYNC_FAILED, cause);
619
+ }
612
620
  if (message.includes('rejected') || message.includes('conflict')) {
613
621
  return new GitPrError(message, GitPrErrorCode.MERGE_CONFLICT, cause);
614
622
  }
@@ -649,6 +657,132 @@ let GitPrService = class GitPrService {
649
657
  commitCount,
650
658
  };
651
659
  }
660
+ // --- Rebase & Sync operations ---
661
+ async syncMain(cwd, baseBranch) {
662
+ try {
663
+ // Detect current branch
664
+ const { stdout } = await this.execFile('git', ['rev-parse', '--abbrev-ref', 'HEAD'], { cwd });
665
+ const currentBranch = stdout.trim();
666
+ if (currentBranch === baseBranch) {
667
+ // On the base branch — use git pull --ff-only
668
+ await this.execFile('git', ['pull', '--ff-only', 'origin', baseBranch], { cwd });
669
+ }
670
+ else {
671
+ // On a different branch — fetch the remote ref only (updates origin/<baseBranch>).
672
+ // We intentionally do NOT update the local <baseBranch> ref because it may be
673
+ // checked out in another worktree, which causes git to refuse the update with:
674
+ // "fatal: refusing to fetch into branch 'refs/heads/main' checked out at ..."
675
+ await this.execFile('git', ['fetch', 'origin', 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') ||
682
+ message.includes('Not possible to fast-forward') ||
683
+ message.includes('diverged')) {
684
+ throw new GitPrError(`Cannot fast-forward '${baseBranch}': local branch has diverged from remote. ` +
685
+ `Resolve the divergence manually with 'git checkout ${baseBranch} && git reset --hard origin/${baseBranch}' ` +
686
+ `if you want to discard local changes on ${baseBranch}.`, GitPrErrorCode.SYNC_FAILED, cause);
687
+ }
688
+ throw new GitPrError(`Failed to sync '${baseBranch}' with remote: ${message}`, GitPrErrorCode.GIT_ERROR, cause);
689
+ }
690
+ }
691
+ async rebaseOnMain(cwd, featureBranch, baseBranch) {
692
+ // Check for dirty worktree before starting
693
+ const dirty = await this.hasUncommittedChanges(cwd);
694
+ if (dirty) {
695
+ throw new GitPrError(`Cannot rebase: working directory has uncommitted changes. ` +
696
+ `Please commit or stash your changes before rebasing.`, GitPrErrorCode.GIT_ERROR);
697
+ }
698
+ // Checkout the feature branch
699
+ try {
700
+ await this.execFile('git', ['checkout', featureBranch], { cwd });
701
+ }
702
+ catch (error) {
703
+ const message = error instanceof Error ? error.message : String(error);
704
+ const cause = error instanceof Error ? error : undefined;
705
+ if (message.includes('did not match') ||
706
+ message.includes('not a commit') ||
707
+ message.includes('pathspec')) {
708
+ throw new GitPrError(`Branch '${featureBranch}' not found.`, GitPrErrorCode.BRANCH_NOT_FOUND, cause);
709
+ }
710
+ throw new GitPrError(`Failed to checkout '${featureBranch}': ${message}`, GitPrErrorCode.GIT_ERROR, cause);
711
+ }
712
+ // Rebase onto origin/<baseBranch> (the remote-tracking ref).
713
+ // We use origin/<baseBranch> rather than the local <baseBranch> because:
714
+ // 1. syncMain fetches origin/<baseBranch> — it's always up-to-date
715
+ // 2. The local <baseBranch> may be checked out in another worktree and stale
716
+ const rebaseTarget = `origin/${baseBranch}`;
717
+ try {
718
+ await this.execFile('git', ['rebase', rebaseTarget], { cwd });
719
+ }
720
+ catch (error) {
721
+ const message = error instanceof Error ? error.message : String(error);
722
+ const cause = error instanceof Error ? error : undefined;
723
+ // Detect rebase conflict from git stderr/exit code
724
+ if (message.includes('CONFLICT') || message.includes('could not apply')) {
725
+ // Get the list of conflicted files to include in the error message
726
+ let conflictedFiles = [];
727
+ try {
728
+ conflictedFiles = await this.getConflictedFiles(cwd);
729
+ }
730
+ catch {
731
+ // Failed to get conflicted files — still report the conflict
732
+ }
733
+ const fileList = conflictedFiles.length > 0 ? ` Conflicted files: ${conflictedFiles.join(', ')}` : '';
734
+ throw new GitPrError(`Rebase of '${featureBranch}' onto '${baseBranch}' encountered conflicts.${fileList}`, GitPrErrorCode.REBASE_CONFLICT, cause);
735
+ }
736
+ throw new GitPrError(`Rebase of '${featureBranch}' onto '${baseBranch}' failed: ${message}`, GitPrErrorCode.GIT_ERROR, cause);
737
+ }
738
+ }
739
+ async getConflictedFiles(cwd) {
740
+ try {
741
+ const { stdout } = await this.execFile('git', ['diff', '--name-only', '--diff-filter=U'], {
742
+ cwd,
743
+ });
744
+ return stdout
745
+ .trim()
746
+ .split('\n')
747
+ .filter((f) => f.length > 0)
748
+ .map((f) => f.replace(/\\/g, '/'));
749
+ }
750
+ catch (error) {
751
+ throw this.parseGitError(error);
752
+ }
753
+ }
754
+ async stageFiles(cwd, files) {
755
+ try {
756
+ await this.execFile('git', ['add', ...files], { cwd });
757
+ }
758
+ catch (error) {
759
+ throw this.parseGitError(error);
760
+ }
761
+ }
762
+ async rebaseContinue(cwd) {
763
+ try {
764
+ await this.execFile('git', ['rebase', '--continue'], {
765
+ cwd,
766
+ env: { ...process.env, GIT_EDITOR: 'true' },
767
+ });
768
+ }
769
+ catch (error) {
770
+ const message = error instanceof Error ? error.message : String(error);
771
+ const cause = error instanceof Error ? error : undefined;
772
+ if (message.includes('CONFLICT') || message.includes('could not apply')) {
773
+ throw new GitPrError(`Rebase continue encountered new conflicts: ${message}`, GitPrErrorCode.REBASE_CONFLICT, cause);
774
+ }
775
+ throw this.parseGitError(error);
776
+ }
777
+ }
778
+ async rebaseAbort(cwd) {
779
+ try {
780
+ await this.execFile('git', ['rebase', '--abort'], { cwd });
781
+ }
782
+ catch (error) {
783
+ throw this.parseGitError(error);
784
+ }
785
+ }
652
786
  };
653
787
  GitPrService = __decorate([
654
788
  injectable(),
@@ -1 +1 @@
1
- {"version":3,"file":"get-graph-data.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/web/app/(dashboard)/get-graph-data.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAE5E,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAI1C,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAwFD,MAAM,MAAM,aAAa,GACrB;IAAE,MAAM,EAAE,SAAS,CAAA;CAAE,GACrB;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,WAAW,CAAA;CAAE,GACtC;IAAE,MAAM,EAAE,YAAY,CAAA;CAAE,CAAC;AA6B7B,wBAAsB,YAAY,IAAI,OAAO,CAAC;IAAE,KAAK,EAAE,cAAc,EAAE,CAAC;IAAC,KAAK,EAAE,IAAI,EAAE,CAAA;CAAE,CAAC,CA6DxF"}
1
+ {"version":3,"file":"get-graph-data.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/web/app/(dashboard)/get-graph-data.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAE5E,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAI1C,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAiFD,MAAM,MAAM,aAAa,GACrB;IAAE,MAAM,EAAE,SAAS,CAAA;CAAE,GACrB;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,WAAW,CAAA;CAAE,GACtC;IAAE,MAAM,EAAE,YAAY,CAAA;CAAE,CAAC;AA6B7B,wBAAsB,YAAY,IAAI,OAAO,CAAC;IAAE,KAAK,EAAE,cAAc,EAAE,CAAC;IAAC,KAAK,EAAE,IAAI,EAAE,CAAA;CAAE,CAAC,CA6DxF"}
@@ -31,13 +31,7 @@ async function refreshRepoGitInfo(repo) {
31
31
  gitInfoCache.set(repo.path, { kind: 'not-a-repo', checkedAt: Date.now() });
32
32
  return;
33
33
  }
34
- const cached = gitInfoCache.get(repo.path);
35
- if (cached?.kind === 'repo' && cached.sha === headSha) {
36
- // HEAD unchanged — just bump checkedAt
37
- cached.checkedAt = Date.now();
38
- return;
39
- }
40
- // HEAD changed — fetch branch + subject & author in parallel
34
+ // Fetch branch + subject & author in parallel
41
35
  const [currentBranch, logLine] = await Promise.all([
42
36
  gitCommand(repo.path, ['symbolic-ref', '--short', 'HEAD']),
43
37
  gitCommand(repo.path, ['log', '-1', `--format=%s${FIELD_SEP}%an`]),
@@ -45,7 +39,8 @@ async function refreshRepoGitInfo(repo) {
45
39
  if (!currentBranch)
46
40
  return;
47
41
  const [commitMessage, committer] = (logLine ?? '').split(FIELD_SEP);
48
- // Behind count
42
+ // Behind count — always compute, even when on the default branch,
43
+ // because local main can be behind origin/main.
49
44
  let behindCount = null;
50
45
  const defaultBranchRef = await gitCommand(repo.path, [
51
46
  'symbolic-ref',
@@ -53,7 +48,8 @@ async function refreshRepoGitInfo(repo) {
53
48
  'refs/remotes/origin/HEAD',
54
49
  ]);
55
50
  const defaultBranch = defaultBranchRef?.replace('origin/', '') ?? null;
56
- if (defaultBranch && currentBranch !== defaultBranch) {
51
+ if (defaultBranch) {
52
+ // Compare current branch (or default branch itself) against origin
57
53
  const behind = await gitCommand(repo.path, [
58
54
  'rev-list',
59
55
  '--count',
@@ -63,9 +59,6 @@ async function refreshRepoGitInfo(repo) {
63
59
  if (isNaN(behindCount))
64
60
  behindCount = null;
65
61
  }
66
- else {
67
- behindCount = 0;
68
- }
69
62
  gitInfoCache.set(repo.path, {
70
63
  kind: 'repo',
71
64
  sha: headSha,
@@ -21,7 +21,7 @@ const AGENT_TOOL_MAP = {
21
21
  };
22
22
  const AGENT_BINARY_MAP = {
23
23
  'claude-code': 'claude',
24
- cursor: 'agent',
24
+ cursor: 'cursor-agent',
25
25
  'gemini-cli': 'gemini',
26
26
  };
27
27
  /**
@@ -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,2CA8lB1F"}
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,2CAkmB1F"}
@@ -319,6 +319,7 @@ export function FeatureDrawerClient({ view: initialView, urlTab }) {
319
319
  // ── Hooks (always called unconditionally per Rules of Hooks) ──────────
320
320
  const featureActionsInput = featureNode?.repositoryPath && featureNode?.branch
321
321
  ? {
322
+ featureId: featureNode.featureId,
322
323
  repositoryPath: featureNode.repositoryPath,
323
324
  branch: featureNode.branch,
324
325
  specPath: featureNode.specPath,
@@ -362,7 +363,7 @@ export function FeatureDrawerClient({ view: initialView, urlTab }) {
362
363
  ...(featureNode.state === 'error' && { onRetry: handleRetry }),
363
364
  ...(featureNode.state === 'pending' && { onStart: handleStart }),
364
365
  };
365
- 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 }));
366
+ 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: featureFlags.gitRebaseSync ? featureActions.rebaseOnMain : undefined, rebaseLoading: featureActions.rebaseLoading, rebaseError: featureActions.rebaseError, isRejecting: isRejecting, chatInput: chatInput, onChatInputChange: setChatInput }));
366
367
  }
367
368
  return (_jsx(BaseDrawer, { open: isOpen, onClose: attemptClose, size: "md", modal: false, header: header, "data-testid": view.type === 'feature' ? 'feature-drawer' : 'repository-drawer', children: body }));
368
369
  }
@@ -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 && featureFlags.gitRebaseSync ? (_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"}