@shepai/cli 1.178.0 → 1.178.1-pr541.46448db

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 (178) hide show
  1. package/README.md +2 -0
  2. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/merge/merge.node.d.ts.map +1 -1
  3. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/merge/merge.node.js +31 -5
  4. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/prompts/merge-prompts.d.ts +14 -0
  5. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/prompts/merge-prompts.d.ts.map +1 -1
  6. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/prompts/merge-prompts.js +63 -0
  7. package/dist/packages/core/src/infrastructure/services/git/git-pr.service.d.ts.map +1 -1
  8. package/dist/packages/core/src/infrastructure/services/git/git-pr.service.js +57 -10
  9. package/dist/tsconfig.build.tsbuildinfo +1 -1
  10. package/package.json +1 -1
  11. package/web/.next/BUILD_ID +1 -1
  12. package/web/.next/build-manifest.json +2 -2
  13. package/web/.next/fallback-build-manifest.json +2 -2
  14. package/web/.next/prerender-manifest.json +3 -3
  15. package/web/.next/required-server-files.js +3 -3
  16. package/web/.next/required-server-files.json +3 -3
  17. package/web/.next/server/app/(dashboard)/@drawer/adopt/page/server-reference-manifest.json +30 -30
  18. package/web/.next/server/app/(dashboard)/@drawer/adopt/page.js.nft.json +1 -1
  19. package/web/.next/server/app/(dashboard)/@drawer/adopt/page_client-reference-manifest.js +1 -1
  20. package/web/.next/server/app/(dashboard)/@drawer/chat/page/server-reference-manifest.json +28 -28
  21. package/web/.next/server/app/(dashboard)/@drawer/chat/page.js.nft.json +1 -1
  22. package/web/.next/server/app/(dashboard)/@drawer/chat/page_client-reference-manifest.js +1 -1
  23. package/web/.next/server/app/(dashboard)/@drawer/create/page/server-reference-manifest.json +31 -31
  24. package/web/.next/server/app/(dashboard)/@drawer/create/page.js.nft.json +1 -1
  25. package/web/.next/server/app/(dashboard)/@drawer/create/page_client-reference-manifest.js +1 -1
  26. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/server-reference-manifest.json +39 -39
  27. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  28. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  29. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/server-reference-manifest.json +39 -39
  30. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js.nft.json +1 -1
  31. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page_client-reference-manifest.js +1 -1
  32. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page/server-reference-manifest.json +29 -29
  33. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page.js.nft.json +1 -1
  34. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page_client-reference-manifest.js +1 -1
  35. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/server-reference-manifest.json +29 -29
  36. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js.nft.json +1 -1
  37. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  38. package/web/.next/server/app/(dashboard)/chat/page/server-reference-manifest.json +28 -28
  39. package/web/.next/server/app/(dashboard)/chat/page.js.nft.json +1 -1
  40. package/web/.next/server/app/(dashboard)/chat/page_client-reference-manifest.js +1 -1
  41. package/web/.next/server/app/(dashboard)/create/page/server-reference-manifest.json +31 -31
  42. package/web/.next/server/app/(dashboard)/create/page.js.nft.json +1 -1
  43. package/web/.next/server/app/(dashboard)/create/page_client-reference-manifest.js +1 -1
  44. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/server-reference-manifest.json +39 -39
  45. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  46. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  47. package/web/.next/server/app/(dashboard)/feature/[featureId]/page/server-reference-manifest.json +39 -39
  48. package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js.nft.json +1 -1
  49. package/web/.next/server/app/(dashboard)/feature/[featureId]/page_client-reference-manifest.js +1 -1
  50. package/web/.next/server/app/(dashboard)/page/server-reference-manifest.json +28 -28
  51. package/web/.next/server/app/(dashboard)/page.js.nft.json +1 -1
  52. package/web/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
  53. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page/server-reference-manifest.json +29 -29
  54. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page.js.nft.json +1 -1
  55. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page_client-reference-manifest.js +1 -1
  56. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/server-reference-manifest.json +29 -29
  57. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js.nft.json +1 -1
  58. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  59. package/web/.next/server/app/_global-error.html +2 -2
  60. package/web/.next/server/app/_global-error.rsc +1 -1
  61. package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  62. package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  63. package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  64. package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  65. package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  66. package/web/.next/server/app/_not-found/page/server-reference-manifest.json +6 -6
  67. package/web/.next/server/app/_not-found/page.js.nft.json +1 -1
  68. package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  69. package/web/.next/server/app/features/page/server-reference-manifest.json +6 -6
  70. package/web/.next/server/app/features/page.js.nft.json +1 -1
  71. package/web/.next/server/app/features/page_client-reference-manifest.js +1 -1
  72. package/web/.next/server/app/settings/page/server-reference-manifest.json +9 -9
  73. package/web/.next/server/app/settings/page.js.nft.json +1 -1
  74. package/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  75. package/web/.next/server/app/skills/page/server-reference-manifest.json +13 -13
  76. package/web/.next/server/app/skills/page.js.nft.json +1 -1
  77. package/web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  78. package/web/.next/server/app/tools/page/server-reference-manifest.json +11 -11
  79. package/web/.next/server/app/tools/page.js.nft.json +1 -1
  80. package/web/.next/server/app/tools/page_client-reference-manifest.js +1 -1
  81. package/web/.next/server/app/version/page/server-reference-manifest.json +6 -6
  82. package/web/.next/server/app/version/page.js.nft.json +1 -1
  83. package/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
  84. package/web/.next/server/chunks/[root-of-the-server]__a402b567._.js +1 -1
  85. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js +1 -1
  86. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js.map +1 -1
  87. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_feature-drawer-client_tsx_e9755fc8._.js +2 -2
  88. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_feature-drawer-client_tsx_e9755fc8._.js.map +1 -1
  89. package/web/.next/server/chunks/ssr/[root-of-the-server]__1cd4327c._.js +1 -1
  90. package/web/.next/server/chunks/ssr/[root-of-the-server]__1cd4327c._.js.map +1 -1
  91. package/web/.next/server/chunks/ssr/[root-of-the-server]__1f389e5d._.js +1 -1
  92. package/web/.next/server/chunks/ssr/[root-of-the-server]__1f389e5d._.js.map +1 -1
  93. package/web/.next/server/chunks/ssr/[root-of-the-server]__357d99f9._.js +1 -1
  94. package/web/.next/server/chunks/ssr/[root-of-the-server]__46b10380._.js +1 -1
  95. package/web/.next/server/chunks/ssr/[root-of-the-server]__46b10380._.js.map +1 -1
  96. package/web/.next/server/chunks/ssr/[root-of-the-server]__540c615f._.js +2 -2
  97. package/web/.next/server/chunks/ssr/[root-of-the-server]__6c7d3936._.js +1 -1
  98. package/web/.next/server/chunks/ssr/[root-of-the-server]__6c7d3936._.js.map +1 -1
  99. package/web/.next/server/chunks/ssr/[root-of-the-server]__8b512877._.js +1 -1
  100. package/web/.next/server/chunks/ssr/[root-of-the-server]__8b512877._.js.map +1 -1
  101. package/web/.next/server/chunks/ssr/[root-of-the-server]__990dba2d._.js +1 -1
  102. package/web/.next/server/chunks/ssr/[root-of-the-server]__990dba2d._.js.map +1 -1
  103. package/web/.next/server/chunks/ssr/[root-of-the-server]__b7b96453._.js +1 -1
  104. package/web/.next/server/chunks/ssr/[root-of-the-server]__b7b96453._.js.map +1 -1
  105. package/web/.next/server/chunks/ssr/[root-of-the-server]__cc9c7bbb._.js +1 -1
  106. package/web/.next/server/chunks/ssr/[root-of-the-server]__cc9c7bbb._.js.map +1 -1
  107. package/web/.next/server/chunks/ssr/_05c23ad9._.js +1 -1
  108. package/web/.next/server/chunks/ssr/_05c23ad9._.js.map +1 -1
  109. package/web/.next/server/chunks/ssr/_16eb4fec._.js +1 -1
  110. package/web/.next/server/chunks/ssr/_16eb4fec._.js.map +1 -1
  111. package/web/.next/server/chunks/ssr/_1e08a336._.js +1 -1
  112. package/web/.next/server/chunks/ssr/{_83e1c526._.js → _328c12b0._.js} +2 -2
  113. package/web/.next/server/chunks/ssr/{_83e1c526._.js.map → _328c12b0._.js.map} +1 -1
  114. package/web/.next/server/chunks/ssr/_496c9117._.js +1 -1
  115. package/web/.next/server/chunks/ssr/_496c9117._.js.map +1 -1
  116. package/web/.next/server/chunks/ssr/_56b9d60f._.js +1 -1
  117. package/web/.next/server/chunks/ssr/_56b9d60f._.js.map +1 -1
  118. package/web/.next/server/chunks/ssr/_6abfa39e._.js +1 -1
  119. package/web/.next/server/chunks/ssr/{_49b9ba41._.js → _d7fd9d40._.js} +2 -2
  120. package/web/.next/server/chunks/ssr/{_49b9ba41._.js.map → _d7fd9d40._.js.map} +1 -1
  121. package/web/.next/server/chunks/ssr/{_64efdf53._.js → _f1f73040._.js} +2 -2
  122. package/web/.next/server/chunks/ssr/{_64efdf53._.js.map → _f1f73040._.js.map} +1 -1
  123. package/web/.next/server/chunks/ssr/_f8c55130._.js +1 -1
  124. package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js +1 -1
  125. package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js.map +1 -1
  126. package/web/.next/server/chunks/ssr/f3a1f_components_common_control-center-drawer_repository-drawer-client_tsx_39a00c03._.js +1 -1
  127. package/web/.next/server/chunks/ssr/f3a1f_components_common_control-center-drawer_repository-drawer-client_tsx_39a00c03._.js.map +1 -1
  128. package/web/.next/server/chunks/ssr/src_presentation_web_06109d28._.js +2 -2
  129. package/web/.next/server/chunks/ssr/src_presentation_web_06109d28._.js.map +1 -1
  130. package/web/.next/server/chunks/ssr/src_presentation_web_0bca70f8._.js +1 -1
  131. package/web/.next/server/chunks/ssr/src_presentation_web_0bca70f8._.js.map +1 -1
  132. package/web/.next/server/chunks/ssr/src_presentation_web_367cdbe0._.js +1 -1
  133. package/web/.next/server/chunks/ssr/src_presentation_web_367cdbe0._.js.map +1 -1
  134. package/web/.next/server/chunks/ssr/src_presentation_web_57fed7fd._.js +1 -1
  135. package/web/.next/server/chunks/ssr/src_presentation_web_57fed7fd._.js.map +1 -1
  136. package/web/.next/server/chunks/ssr/src_presentation_web_7f567f6d._.js +1 -1
  137. package/web/.next/server/chunks/ssr/src_presentation_web_7f567f6d._.js.map +1 -1
  138. package/web/.next/server/chunks/ssr/src_presentation_web_972f58d5._.js +1 -1
  139. package/web/.next/server/chunks/ssr/src_presentation_web_972f58d5._.js.map +1 -1
  140. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_4ce30db7.js +1 -1
  141. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_4ce30db7.js.map +1 -1
  142. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_e4032193.js +1 -1
  143. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_e4032193.js.map +1 -1
  144. package/web/.next/server/chunks/ssr/src_presentation_web_a71b18a2._.js +1 -1
  145. package/web/.next/server/chunks/ssr/src_presentation_web_a71b18a2._.js.map +1 -1
  146. package/web/.next/server/chunks/ssr/src_presentation_web_bebe675e._.js +1 -1
  147. package/web/.next/server/chunks/ssr/src_presentation_web_bebe675e._.js.map +1 -1
  148. package/web/.next/server/chunks/ssr/src_presentation_web_c93e8bc6._.js +1 -1
  149. package/web/.next/server/chunks/ssr/src_presentation_web_c93e8bc6._.js.map +1 -1
  150. package/web/.next/server/chunks/ssr/src_presentation_web_components_895e5bfa._.js +1 -1
  151. package/web/.next/server/chunks/ssr/src_presentation_web_components_895e5bfa._.js.map +1 -1
  152. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js +1 -1
  153. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js.map +1 -1
  154. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_skills_8a174cac._.js +1 -1
  155. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_skills_8a174cac._.js.map +1 -1
  156. package/web/.next/server/chunks/ssr/src_presentation_web_e729f44a._.js +2 -2
  157. package/web/.next/server/chunks/ssr/src_presentation_web_e729f44a._.js.map +1 -1
  158. package/web/.next/server/pages/500.html +2 -2
  159. package/web/.next/server/server-reference-manifest.js +1 -1
  160. package/web/.next/server/server-reference-manifest.json +51 -51
  161. package/web/.next/static/chunks/2453c9bb2ed49ae2.js +3 -0
  162. package/web/.next/static/chunks/{e167803ac69c66c7.js → 4a2a7849180d6c35.js} +1 -1
  163. package/web/.next/static/chunks/{5f57f0d80d3db147.js → 4a415ab361ca731b.js} +1 -1
  164. package/web/.next/static/chunks/{2cc487403c107f3f.js → 4b154aa063bc82c1.js} +3 -3
  165. package/web/.next/static/chunks/{0b7251e5d717dd17.js → 6af952d63bf3aafe.js} +1 -1
  166. package/web/.next/static/chunks/{9e9cddf8e38342e8.js → 84172d8483b37100.js} +1 -1
  167. package/web/.next/static/chunks/{35bf9838f21d1818.js → 96c832101989512f.js} +1 -1
  168. package/web/.next/static/chunks/{25a0d3f50b0a26c1.js → 9f2cc1dd89b19d25.js} +1 -1
  169. package/web/.next/static/chunks/{0fd39d549d277843.js → b026b1bb429a9491.js} +1 -1
  170. package/web/.next/static/chunks/{5df9da8b40e298ee.js → c9424f67c1665567.js} +1 -1
  171. package/web/.next/static/chunks/{c6fdd161a9e5b554.js → df4c00579f57bc2c.js} +1 -1
  172. package/web/.next/static/chunks/{36e3d626ed8defca.js → e1b525fb0d68aecb.js} +1 -1
  173. package/web/.next/static/chunks/{ac586c86d71187fc.js → e8cf602905c9e4b7.js} +1 -1
  174. package/web/.next/static/chunks/{8286914ac835a1cc.js → fa321a361a8211ac.js} +1 -1
  175. package/web/.next/static/chunks/8777b2a0a2e85fd1.js +0 -3
  176. /package/web/.next/static/{sfBZvlx-erv7S1C49vRSU → v-gXVigBMiUhPmia-w6ib}/_buildManifest.js +0 -0
  177. /package/web/.next/static/{sfBZvlx-erv7S1C49vRSU → v-gXVigBMiUhPmia-w6ib}/_clientMiddlewareManifest.json +0 -0
  178. /package/web/.next/static/{sfBZvlx-erv7S1C49vRSU → v-gXVigBMiUhPmia-w6ib}/_ssgManifest.js +0 -0
package/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ ![Shep](docs/screenshots/shep-card.jpg)
2
+
1
3
  <div align="center">
2
4
 
3
5
  <h1>
@@ -1 +1 @@
1
- {"version":3,"file":"merge.node.d.ts","sourceRoot":"","sources":["../../../../../../../../../../packages/core/src/infrastructure/services/agents/feature-agent/nodes/merge/merge.node.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+DAA+D,CAAC;AACpG,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yEAAyE,CAAC;AAClH,OAAO,KAAK,EACV,WAAW,EACX,aAAa,EACd,MAAM,iEAAiE,CAAC;AAoBzE,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,uEAAuE,CAAC;AAC3H,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mEAAmE,CAAC;AAEzG,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,cAAc,CAAC;IACzB,cAAc,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,WAAW,CAAC,CAAC;IAC1E,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAC7C,gBAAgB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACnD,iBAAiB,EAAE,IAAI,CAAC,kBAAkB,EAAE,UAAU,GAAG,QAAQ,CAAC,CAAC;IACnE;;OAEG;IACH,gBAAgB,EAAE,CAChB,GAAG,EAAE,MAAM,EACX,aAAa,EAAE,MAAM,EACrB,UAAU,EAAE,MAAM,EAClB,aAAa,EAAE,MAAM,EACrB,SAAS,CAAC,EAAE,OAAO,KAChB,OAAO,CAAC,IAAI,CAAC,CAAC;IACnB;;;OAGG;IACH,WAAW,EAAE,CACX,GAAG,EAAE,MAAM,EACX,aAAa,EAAE,MAAM,EACrB,UAAU,EAAE,MAAM,EAClB,eAAe,CAAC,EAAE,MAAM,KACrB,OAAO,CAAC,OAAO,CAAC,CAAC;IACtB;;OAEG;IACH,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACxD,YAAY,EAAE,aAAa,CAAC;IAC5B,cAAc,CAAC,EAAE,eAAe,CAAC;IACjC,6BAA6B,EAAE,IAAI,CAAC,6BAA6B,EAAE,SAAS,CAAC,CAAC;CAC/E;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,aAAa,IAGnC,OAAO,iBAAiB,KAAG,OAAO,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAmZ7E"}
1
+ {"version":3,"file":"merge.node.d.ts","sourceRoot":"","sources":["../../../../../../../../../../packages/core/src/infrastructure/services/agents/feature-agent/nodes/merge/merge.node.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+DAA+D,CAAC;AACpG,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yEAAyE,CAAC;AAClH,OAAO,KAAK,EACV,WAAW,EACX,aAAa,EACd,MAAM,iEAAiE,CAAC;AAwBzE,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,uEAAuE,CAAC;AAC3H,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mEAAmE,CAAC;AAEzG,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,cAAc,CAAC;IACzB,cAAc,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,WAAW,CAAC,CAAC;IAC1E,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAC7C,gBAAgB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACnD,iBAAiB,EAAE,IAAI,CAAC,kBAAkB,EAAE,UAAU,GAAG,QAAQ,CAAC,CAAC;IACnE;;OAEG;IACH,gBAAgB,EAAE,CAChB,GAAG,EAAE,MAAM,EACX,aAAa,EAAE,MAAM,EACrB,UAAU,EAAE,MAAM,EAClB,aAAa,EAAE,MAAM,EACrB,SAAS,CAAC,EAAE,OAAO,KAChB,OAAO,CAAC,IAAI,CAAC,CAAC;IACnB;;;OAGG;IACH,WAAW,EAAE,CACX,GAAG,EAAE,MAAM,EACX,aAAa,EAAE,MAAM,EACrB,UAAU,EAAE,MAAM,EAClB,eAAe,CAAC,EAAE,MAAM,KACrB,OAAO,CAAC,OAAO,CAAC,CAAC;IACtB;;OAEG;IACH,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACxD,YAAY,EAAE,aAAa,CAAC;IAC5B,cAAc,CAAC,EAAE,eAAe,CAAC;IACjC,6BAA6B,EAAE,IAAI,CAAC,6BAA6B,EAAE,SAAS,CAAC,CAAC;CAC/E;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,aAAa,IAGnC,OAAO,iBAAiB,KAAG,OAAO,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAub7E"}
@@ -18,7 +18,8 @@ import { createNodeLogger, shouldInterrupt, retryExecute, buildExecutorOptions,
18
18
  import { reportNodeStart } from '../../heartbeat.js';
19
19
  import { recordPhaseStart, recordPhaseEnd, recordApprovalWaitStart, updatePhasePrompt, } from '../../phase-timing-context.js';
20
20
  import { updateNodeLifecycle } from '../../lifecycle-context.js';
21
- import { buildCommitPushPrPrompt } from '../prompts/merge-prompts.js';
21
+ import { buildCommitPushPrPrompt, buildLocalSquashMergePrompt } from '../prompts/merge-prompts.js';
22
+ import { GitPrError, GitPrErrorCode, } from '../../../../../../application/ports/output/services/git-pr-service.interface.js';
22
23
  import { parseCommitHash, parsePrUrl } from './merge-output-parser.js';
23
24
  import { runCiWatchFixLoop } from './ci-watch-fix-loop.js';
24
25
  import { getSettings } from '../../../../../services/settings.service.js';
@@ -308,12 +309,37 @@ export function createMergeNode(deps) {
308
309
  // No PR: programmatic local squash merge in the ORIGINAL repo (not the worktree,
309
310
  // which IS the feature branch and must not be modified during merge).
310
311
  // Uses direct git commands instead of an agent for reliability.
312
+ // On MERGE_CONFLICT, falls back to agent-based merge for conflict resolution.
311
313
  log.info('Programmatic local squash merge (no agent needed)');
312
314
  const commitMsg = `feat: squash merge ${branch} into ${baseBranch}`;
313
- await deps.localMergeSquash(state.repositoryPath, branch, baseBranch, commitMsg, remoteAvailable);
314
- log.info('Local squash merge completed successfully');
315
- messages.push(`[merge] Local squash merge completed`);
316
- merged = true;
315
+ try {
316
+ await deps.localMergeSquash(state.repositoryPath, branch, baseBranch, commitMsg, remoteAvailable);
317
+ log.info('Local squash merge completed successfully');
318
+ messages.push(`[merge] Local squash merge completed`);
319
+ merged = true;
320
+ }
321
+ catch (mergeErr) {
322
+ // Fall back to agent-based merge when conflicts are detected.
323
+ // The agent can resolve conflicts using its full coding capabilities.
324
+ const isConflict = mergeErr instanceof GitPrError && mergeErr.code === GitPrErrorCode.MERGE_CONFLICT;
325
+ if (!isConflict)
326
+ throw mergeErr;
327
+ const conflictDetails = mergeErr instanceof Error ? mergeErr.message : String(mergeErr);
328
+ log.info('Merge conflict detected — falling back to agent-based merge for conflict resolution');
329
+ messages.push(`[merge] Conflict detected, delegating to agent for resolution`);
330
+ const mergePrompt = buildLocalSquashMergePrompt(state.repositoryPath, branch, baseBranch, commitMsg, conflictDetails);
331
+ const mergeResult = await retryExecute(executor, mergePrompt, options, {
332
+ logger: log,
333
+ });
334
+ totalInputTokens += mergeResult.usage?.inputTokens ?? 0;
335
+ totalOutputTokens += mergeResult.usage?.outputTokens ?? 0;
336
+ totalCostUsd += mergeResult.usage?.costUsd ?? 0;
337
+ totalNumTurns += mergeResult.usage?.numTurns ?? 0;
338
+ totalDurationApiMs += mergeResult.usage?.durationApiMs ?? 0;
339
+ log.info('Agent-based merge completed successfully');
340
+ messages.push(`[merge] Agent resolved conflicts and completed merge`);
341
+ merged = true;
342
+ }
317
343
  }
318
344
  }
319
345
  // --- Update feature lifecycle ---
@@ -32,6 +32,20 @@ export declare function formatEvidenceSection(evidence: Evidence[], branch?: str
32
32
  * on state.push and state.openPr flags.
33
33
  */
34
34
  export declare function buildCommitPushPrPrompt(state: FeatureAgentState, branch: string, baseBranch: string, repoUrl?: string): string;
35
+ /**
36
+ * Build a prompt for agent-based local squash merge with conflict resolution.
37
+ *
38
+ * Used as a fallback when the programmatic localMergeSquash encounters merge
39
+ * conflicts. The agent resolves conflicts using its full coding capabilities,
40
+ * then commits and cleans up.
41
+ *
42
+ * @param repositoryPath - Path to the original repository (not worktree)
43
+ * @param featureBranch - Branch to squash-merge from
44
+ * @param baseBranch - Target branch (e.g. main)
45
+ * @param commitMessage - Commit message for the squash merge commit
46
+ * @param conflictDetails - Stdout/stderr from the failed merge attempt describing the conflicts
47
+ */
48
+ export declare function buildLocalSquashMergePrompt(repositoryPath: string, featureBranch: string, baseBranch: string, commitMessage: string, conflictDetails: string): string;
35
49
  /**
36
50
  * Build a prompt for the CI watch/fix agent call.
37
51
  *
@@ -1 +1 @@
1
- {"version":3,"file":"merge-prompts.d.ts","sourceRoot":"","sources":["../../../../../../../../../../packages/core/src/infrastructure/services/agents/feature-agent/nodes/prompts/merge-prompts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAgB,KAAK,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAE3E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAyCxD;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAU9F;AAuCD;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,QAAQ,EAAE,EACpB,MAAM,CAAC,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,MAAM,GACf,MAAM,CAUR;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,iBAAiB,EACxB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE,MAAM,GACf,MAAM,CA2ER;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,MAAM,EACnB,aAAa,EAAE,MAAM,EACrB,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,GACb,MAAM,CA0BR;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAqDzD"}
1
+ {"version":3,"file":"merge-prompts.d.ts","sourceRoot":"","sources":["../../../../../../../../../../packages/core/src/infrastructure/services/agents/feature-agent/nodes/prompts/merge-prompts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAgB,KAAK,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAE3E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAyCxD;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAU9F;AAuCD;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,QAAQ,EAAE,EACpB,MAAM,CAAC,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,MAAM,GACf,MAAM,CAUR;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,iBAAiB,EACxB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE,MAAM,GACf,MAAM,CA2ER;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,2BAA2B,CACzC,cAAc,EAAE,MAAM,EACtB,aAAa,EAAE,MAAM,EACrB,UAAU,EAAE,MAAM,EAClB,aAAa,EAAE,MAAM,EACrB,eAAe,EAAE,MAAM,GACtB,MAAM,CAiDR;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,MAAM,EACnB,aAAa,EAAE,MAAM,EACrB,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,GACb,MAAM,CA0BR;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAqDzD"}
@@ -188,6 +188,69 @@ ${!state.commitSpecs ? '- Do NOT commit the `specs/` directory — it must stay
188
188
  - Do NOT run \`git pull\`, \`git rebase\`, or \`git merge\` — this is a fresh branch, push it directly
189
189
  - If there are no changes to commit, skip the commit step and report that no changes were found`;
190
190
  }
191
+ /**
192
+ * Build a prompt for agent-based local squash merge with conflict resolution.
193
+ *
194
+ * Used as a fallback when the programmatic localMergeSquash encounters merge
195
+ * conflicts. The agent resolves conflicts using its full coding capabilities,
196
+ * then commits and cleans up.
197
+ *
198
+ * @param repositoryPath - Path to the original repository (not worktree)
199
+ * @param featureBranch - Branch to squash-merge from
200
+ * @param baseBranch - Target branch (e.g. main)
201
+ * @param commitMessage - Commit message for the squash merge commit
202
+ * @param conflictDetails - Stdout/stderr from the failed merge attempt describing the conflicts
203
+ */
204
+ export function buildLocalSquashMergePrompt(repositoryPath, featureBranch, baseBranch, commitMessage, conflictDetails) {
205
+ return `You are resolving merge conflicts for a local squash merge.
206
+
207
+ ## Context
208
+
209
+ A programmatic \`git merge --squash\` of \`${featureBranch}\` into \`${baseBranch}\` failed due to merge conflicts.
210
+ The repo has already been cleaned up (merge aborted). You need to perform the merge manually, resolving all conflicts.
211
+
212
+ ## Conflict Details
213
+
214
+ \`\`\`
215
+ ${conflictDetails}
216
+ \`\`\`
217
+
218
+ ## Working Directory
219
+
220
+ ${repositoryPath}
221
+
222
+ ## Instructions
223
+
224
+ Follow these steps EXACTLY:
225
+
226
+ 1. Make sure you are on the \`${baseBranch}\` branch:
227
+ \`git checkout ${baseBranch}\`
228
+
229
+ 2. Start the squash merge:
230
+ \`git merge --squash ${featureBranch}\`
231
+
232
+ 3. Resolve ALL merge conflicts:
233
+ - For each conflicted file, open it and resolve the conflict markers (\`<<<<<<<\`, \`=======\`, \`>>>>>>>\`)
234
+ - Choose the correct resolution by understanding what both sides intended
235
+ - For lock files (package-lock.json, yarn.lock, pnpm-lock.yaml), accept the feature branch version and regenerate if possible, or accept theirs
236
+ - For config files (.gitignore, tsconfig.json, etc.), merge both sides' additions
237
+ - Stage each resolved file: \`git add <file>\`
238
+
239
+ 4. After ALL conflicts are resolved, commit:
240
+ \`git commit -m "${commitMessage.replace(/"/g, '\\"')}"\`
241
+
242
+ 5. Delete the feature branch:
243
+ \`git branch -d ${featureBranch}\` (non-fatal if it fails)
244
+
245
+ ## Constraints
246
+
247
+ - Work in the repository at: ${repositoryPath}
248
+ - Do NOT push — this is a local-only operation
249
+ - Do NOT modify any source code beyond resolving conflicts
250
+ - Do NOT create new files
251
+ - If a conflict cannot be resolved confidently, prefer the feature branch version (theirs in squash context)
252
+ - Ensure the final commit has no conflict markers remaining`;
253
+ }
191
254
  /**
192
255
  * Build a prompt for the CI watch/fix agent call.
193
256
  *
@@ -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,OAA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AAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAqB1C,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAQvC,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IActD,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAQpC,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAQrC,mBAAmB,CACvB,GAAG,EAAE,MAAM,EACX,aAAa,EAAE,MAAM,EACrB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;CAe9C"}
@@ -216,6 +216,27 @@ let GitPrService = class GitPrService {
216
216
  }
217
217
  async localMergeSquash(cwd, featureBranch, baseBranch, commitMessage, hasRemote = false) {
218
218
  try {
219
+ // Clean up any stale merge/rebase state and dirty index BEFORE checkout.
220
+ // A previous failed merge may have left the repo in a merge state, causing
221
+ // "you need to resolve your current index first" on checkout.
222
+ try {
223
+ await this.execFile('git', ['merge', '--abort'], { cwd });
224
+ }
225
+ catch {
226
+ // No merge in progress — expected, non-fatal
227
+ }
228
+ try {
229
+ await this.execFile('git', ['reset', '--hard', 'HEAD'], { cwd });
230
+ }
231
+ catch {
232
+ // Reset failure is non-fatal
233
+ }
234
+ try {
235
+ await this.execFile('git', ['clean', '-fd'], { cwd });
236
+ }
237
+ catch {
238
+ // Clean failure is non-fatal
239
+ }
219
240
  // Fetch latest from remote if available
220
241
  if (hasRemote) {
221
242
  try {
@@ -236,16 +257,42 @@ let GitPrService = class GitPrService {
236
257
  // Pull failure is non-fatal — proceed with local state
237
258
  }
238
259
  }
239
- // Clean untracked files that may conflict with the merge (e.g. files created
240
- // by a prior agent call that leaked into the original repo directory)
260
+ // Squash merge the feature branch.
261
+ // git merge --squash writes conflict info to STDOUT (not stderr), so the
262
+ // error.message from execFile won't contain "CONFLICT". We must check
263
+ // error.stdout to detect conflicts and include it in diagnostics.
241
264
  try {
242
- await this.execFile('git', ['clean', '-fd'], { cwd });
265
+ await this.execFile('git', ['merge', '--squash', featureBranch], { cwd });
243
266
  }
244
- catch {
245
- // Clean failure is non-fatal
267
+ catch (mergeError) {
268
+ // Abort the in-progress merge to leave the repo clean
269
+ try {
270
+ await this.execFile('git', ['merge', '--abort'], { cwd });
271
+ }
272
+ catch {
273
+ // merge --abort may fail if there's no merge in progress; non-fatal
274
+ try {
275
+ await this.execFile('git', ['reset', '--merge'], { cwd });
276
+ }
277
+ catch {
278
+ // Last-resort cleanup; non-fatal
279
+ }
280
+ }
281
+ // Check stdout for CONFLICT text (git merge --squash puts it there, not stderr)
282
+ const stdout = mergeError?.stdout ?? '';
283
+ const stderr = mergeError?.stderr ?? '';
284
+ const combined = `${stdout}\n${stderr}`;
285
+ const mergeMsg = mergeError instanceof Error ? mergeError.message : String(mergeError);
286
+ if (combined.includes('CONFLICT') ||
287
+ combined.includes('conflict') ||
288
+ mergeMsg.includes('CONFLICT') ||
289
+ mergeMsg.includes('conflict')) {
290
+ throw new GitPrError(`Merge conflict while squash-merging ${featureBranch} into ${baseBranch}: ${combined.trim()}`, GitPrErrorCode.MERGE_CONFLICT, mergeError instanceof Error ? mergeError : undefined);
291
+ }
292
+ // Include stdout in the error for better diagnostics
293
+ const detail = combined.trim() || mergeMsg;
294
+ throw new GitPrError(`Local squash merge failed: ${detail}`, GitPrErrorCode.GIT_ERROR, mergeError instanceof Error ? mergeError : undefined);
246
295
  }
247
- // Squash merge the feature branch
248
- await this.execFile('git', ['merge', '--squash', featureBranch], { cwd });
249
296
  // Commit the squash merge (skip if nothing to commit — branches may be equivalent)
250
297
  const { stdout: status } = await this.execFile('git', ['status', '--porcelain'], { cwd });
251
298
  if (status.trim().length > 0) {
@@ -274,11 +321,11 @@ let GitPrService = class GitPrService {
274
321
  }
275
322
  }
276
323
  catch (error) {
324
+ // Re-throw GitPrErrors as-is (already properly classified above)
325
+ if (error instanceof GitPrError)
326
+ throw error;
277
327
  const message = error instanceof Error ? error.message : String(error);
278
328
  const cause = error instanceof Error ? error : undefined;
279
- if (message.includes('CONFLICT') || message.includes('conflict')) {
280
- throw new GitPrError(`Merge conflict while squash-merging ${featureBranch} into ${baseBranch}: ${message}`, GitPrErrorCode.MERGE_CONFLICT, cause);
281
- }
282
329
  throw new GitPrError(`Local squash merge failed: ${message}`, GitPrErrorCode.GIT_ERROR, cause);
283
330
  }
284
331
  }