@shepai/cli 1.169.0 → 1.169.1-pr524.e574f82

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 (201) hide show
  1. package/dist/packages/core/src/application/ports/output/services/git-pr-service.interface.d.ts +8 -0
  2. package/dist/packages/core/src/application/ports/output/services/git-pr-service.interface.d.ts.map +1 -1
  3. package/dist/packages/core/src/application/use-cases/features/rebase-feature-on-main.use-case.d.ts.map +1 -1
  4. package/dist/packages/core/src/application/use-cases/features/rebase-feature-on-main.use-case.js +23 -2
  5. package/dist/packages/core/src/application/use-cases/upgrade/upgrade-cli.use-case.d.ts +1 -0
  6. package/dist/packages/core/src/application/use-cases/upgrade/upgrade-cli.use-case.d.ts.map +1 -1
  7. package/dist/packages/core/src/application/use-cases/upgrade/upgrade-cli.use-case.js +59 -2
  8. package/dist/packages/core/src/infrastructure/services/agents/conflict-resolution/conflict-resolution.prompt.d.ts +21 -0
  9. package/dist/packages/core/src/infrastructure/services/agents/conflict-resolution/conflict-resolution.prompt.d.ts.map +1 -1
  10. package/dist/packages/core/src/infrastructure/services/agents/conflict-resolution/conflict-resolution.prompt.js +61 -0
  11. package/dist/packages/core/src/infrastructure/services/agents/conflict-resolution/conflict-resolution.service.d.ts +16 -0
  12. package/dist/packages/core/src/infrastructure/services/agents/conflict-resolution/conflict-resolution.service.d.ts.map +1 -1
  13. package/dist/packages/core/src/infrastructure/services/agents/conflict-resolution/conflict-resolution.service.js +47 -4
  14. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/evidence.node.js +1 -1
  15. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/fast-implement.node.js +1 -1
  16. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/implement.node.js +1 -1
  17. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/merge/merge.node.js +1 -1
  18. package/dist/packages/core/src/infrastructure/services/git/git-pr.service.d.ts +1 -0
  19. package/dist/packages/core/src/infrastructure/services/git/git-pr.service.d.ts.map +1 -1
  20. package/dist/packages/core/src/infrastructure/services/git/git-pr.service.js +8 -0
  21. package/dist/src/presentation/cli/commands/upgrade.command.d.ts.map +1 -1
  22. package/dist/src/presentation/cli/commands/upgrade.command.js +68 -3
  23. package/dist/translations/ar/cli.json +2 -0
  24. package/dist/translations/de/cli.json +2 -0
  25. package/dist/translations/en/cli.json +2 -0
  26. package/dist/translations/es/cli.json +2 -0
  27. package/dist/translations/fr/cli.json +2 -0
  28. package/dist/translations/he/cli.json +2 -0
  29. package/dist/translations/pt/cli.json +2 -0
  30. package/dist/translations/ru/cli.json +2 -0
  31. package/dist/tsconfig.build.tsbuildinfo +1 -1
  32. package/package.json +2 -1
  33. package/web/.next/BUILD_ID +1 -1
  34. package/web/.next/build-manifest.json +2 -2
  35. package/web/.next/fallback-build-manifest.json +2 -2
  36. package/web/.next/prerender-manifest.json +3 -3
  37. package/web/.next/required-server-files.js +3 -3
  38. package/web/.next/required-server-files.json +3 -3
  39. package/web/.next/server/app/(dashboard)/@drawer/adopt/page/server-reference-manifest.json +29 -29
  40. package/web/.next/server/app/(dashboard)/@drawer/adopt/page.js.nft.json +1 -1
  41. package/web/.next/server/app/(dashboard)/@drawer/adopt/page_client-reference-manifest.js +1 -1
  42. package/web/.next/server/app/(dashboard)/@drawer/chat/page/server-reference-manifest.json +27 -27
  43. package/web/.next/server/app/(dashboard)/@drawer/chat/page.js.nft.json +1 -1
  44. package/web/.next/server/app/(dashboard)/@drawer/chat/page_client-reference-manifest.js +1 -1
  45. package/web/.next/server/app/(dashboard)/@drawer/create/page/server-reference-manifest.json +30 -30
  46. package/web/.next/server/app/(dashboard)/@drawer/create/page.js.nft.json +1 -1
  47. package/web/.next/server/app/(dashboard)/@drawer/create/page_client-reference-manifest.js +1 -1
  48. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/server-reference-manifest.json +38 -38
  49. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  50. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  51. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/server-reference-manifest.json +38 -38
  52. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js.nft.json +1 -1
  53. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page_client-reference-manifest.js +1 -1
  54. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page/server-reference-manifest.json +28 -28
  55. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page.js.nft.json +1 -1
  56. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page_client-reference-manifest.js +1 -1
  57. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/server-reference-manifest.json +28 -28
  58. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js.nft.json +1 -1
  59. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  60. package/web/.next/server/app/(dashboard)/chat/page/server-reference-manifest.json +27 -27
  61. package/web/.next/server/app/(dashboard)/chat/page.js.nft.json +1 -1
  62. package/web/.next/server/app/(dashboard)/chat/page_client-reference-manifest.js +1 -1
  63. package/web/.next/server/app/(dashboard)/create/page/server-reference-manifest.json +30 -30
  64. package/web/.next/server/app/(dashboard)/create/page.js.nft.json +1 -1
  65. package/web/.next/server/app/(dashboard)/create/page_client-reference-manifest.js +1 -1
  66. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/server-reference-manifest.json +38 -38
  67. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  68. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  69. package/web/.next/server/app/(dashboard)/feature/[featureId]/page/server-reference-manifest.json +38 -38
  70. package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js.nft.json +1 -1
  71. package/web/.next/server/app/(dashboard)/feature/[featureId]/page_client-reference-manifest.js +1 -1
  72. package/web/.next/server/app/(dashboard)/page/server-reference-manifest.json +27 -27
  73. package/web/.next/server/app/(dashboard)/page.js.nft.json +1 -1
  74. package/web/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
  75. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page/server-reference-manifest.json +28 -28
  76. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page.js.nft.json +1 -1
  77. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page_client-reference-manifest.js +1 -1
  78. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/server-reference-manifest.json +28 -28
  79. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js.nft.json +1 -1
  80. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  81. package/web/.next/server/app/_global-error.html +2 -2
  82. package/web/.next/server/app/_global-error.rsc +1 -1
  83. package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  84. package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  85. package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  86. package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  87. package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  88. package/web/.next/server/app/_not-found/page/server-reference-manifest.json +6 -6
  89. package/web/.next/server/app/_not-found/page.js.nft.json +1 -1
  90. package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  91. package/web/.next/server/app/features/page/server-reference-manifest.json +6 -6
  92. package/web/.next/server/app/features/page.js.nft.json +1 -1
  93. package/web/.next/server/app/features/page_client-reference-manifest.js +1 -1
  94. package/web/.next/server/app/settings/page/server-reference-manifest.json +9 -9
  95. package/web/.next/server/app/settings/page.js.nft.json +1 -1
  96. package/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  97. package/web/.next/server/app/skills/page/server-reference-manifest.json +11 -11
  98. package/web/.next/server/app/skills/page.js.nft.json +1 -1
  99. package/web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  100. package/web/.next/server/app/tools/page/server-reference-manifest.json +11 -11
  101. package/web/.next/server/app/tools/page.js.nft.json +1 -1
  102. package/web/.next/server/app/tools/page_client-reference-manifest.js +1 -1
  103. package/web/.next/server/app/version/page/server-reference-manifest.json +6 -6
  104. package/web/.next/server/app/version/page.js.nft.json +1 -1
  105. package/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
  106. package/web/.next/server/chunks/[root-of-the-server]__a402b567._.js +1 -1
  107. package/web/.next/server/chunks/[root-of-the-server]__ab4951b1._.js +1 -1
  108. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js +1 -1
  109. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js.map +1 -1
  110. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_feature-drawer-client_tsx_e9755fc8._.js +2 -2
  111. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_feature-drawer-client_tsx_e9755fc8._.js.map +1 -1
  112. package/web/.next/server/chunks/ssr/[root-of-the-server]__1f389e5d._.js +1 -1
  113. package/web/.next/server/chunks/ssr/[root-of-the-server]__1f389e5d._.js.map +1 -1
  114. package/web/.next/server/chunks/ssr/[root-of-the-server]__357d99f9._.js +1 -1
  115. package/web/.next/server/chunks/ssr/[root-of-the-server]__4fb81977._.js +1 -1
  116. package/web/.next/server/chunks/ssr/[root-of-the-server]__4fb81977._.js.map +1 -1
  117. package/web/.next/server/chunks/ssr/[root-of-the-server]__6c7d3936._.js +1 -1
  118. package/web/.next/server/chunks/ssr/[root-of-the-server]__6c7d3936._.js.map +1 -1
  119. package/web/.next/server/chunks/ssr/[root-of-the-server]__7dcd0917._.js +1 -1
  120. package/web/.next/server/chunks/ssr/[root-of-the-server]__7dcd0917._.js.map +1 -1
  121. package/web/.next/server/chunks/ssr/[root-of-the-server]__7ffd3598._.js +2 -2
  122. package/web/.next/server/chunks/ssr/[root-of-the-server]__7ffd3598._.js.map +1 -1
  123. package/web/.next/server/chunks/ssr/[root-of-the-server]__b020c17d._.js +2 -2
  124. package/web/.next/server/chunks/ssr/[root-of-the-server]__b020c17d._.js.map +1 -1
  125. package/web/.next/server/chunks/ssr/[root-of-the-server]__b7b96453._.js +1 -1
  126. package/web/.next/server/chunks/ssr/[root-of-the-server]__b7b96453._.js.map +1 -1
  127. package/web/.next/server/chunks/ssr/[root-of-the-server]__ba7f5873._.js +1 -1
  128. package/web/.next/server/chunks/ssr/[root-of-the-server]__ba7f5873._.js.map +1 -1
  129. package/web/.next/server/chunks/ssr/[root-of-the-server]__c5e09f6f._.js +1 -1
  130. package/web/.next/server/chunks/ssr/[root-of-the-server]__c5e09f6f._.js.map +1 -1
  131. package/web/.next/server/chunks/ssr/[root-of-the-server]__e88da4ee._.js +1 -1
  132. package/web/.next/server/chunks/ssr/_02e01240._.js +1 -1
  133. package/web/.next/server/chunks/ssr/_02e01240._.js.map +1 -1
  134. package/web/.next/server/chunks/ssr/_05c23ad9._.js +1 -1
  135. package/web/.next/server/chunks/ssr/_05c23ad9._.js.map +1 -1
  136. package/web/.next/server/chunks/ssr/_0727935d._.js +1 -1
  137. package/web/.next/server/chunks/ssr/_0727935d._.js.map +1 -1
  138. package/web/.next/server/chunks/ssr/{_2b63b860._.js → _13dbdd2a._.js} +2 -2
  139. package/web/.next/server/chunks/ssr/{_2b63b860._.js.map → _13dbdd2a._.js.map} +1 -1
  140. package/web/.next/server/chunks/ssr/_16eb4fec._.js +1 -1
  141. package/web/.next/server/chunks/ssr/_16eb4fec._.js.map +1 -1
  142. package/web/.next/server/chunks/ssr/_18886033._.js +1 -1
  143. package/web/.next/server/chunks/ssr/_18886033._.js.map +1 -1
  144. package/web/.next/server/chunks/ssr/_22e00a14._.js +1 -1
  145. package/web/.next/server/chunks/ssr/_22e00a14._.js.map +1 -1
  146. package/web/.next/server/chunks/ssr/_4cbb7f95._.js +1 -1
  147. package/web/.next/server/chunks/ssr/_4cbb7f95._.js.map +1 -1
  148. package/web/.next/server/chunks/ssr/_56b9d60f._.js +1 -1
  149. package/web/.next/server/chunks/ssr/_56b9d60f._.js.map +1 -1
  150. package/web/.next/server/chunks/ssr/{_a104e947._.js → _6ff800b5._.js} +2 -2
  151. package/web/.next/server/chunks/ssr/{_a104e947._.js.map → _6ff800b5._.js.map} +1 -1
  152. package/web/.next/server/chunks/ssr/_7689fb87._.js +3 -0
  153. package/web/.next/server/chunks/ssr/{_fecec23a._.js.map → _7689fb87._.js.map} +1 -1
  154. package/web/.next/server/chunks/ssr/_a1068852._.js +1 -1
  155. package/web/.next/server/chunks/ssr/_a5a5901d._.js +1 -1
  156. package/web/.next/server/chunks/ssr/_a5a5901d._.js.map +1 -1
  157. package/web/.next/server/chunks/ssr/_ad09f271._.js +1 -1
  158. package/web/.next/server/chunks/ssr/_ad09f271._.js.map +1 -1
  159. package/web/.next/server/chunks/ssr/_c3f595c6._.js +1 -1
  160. package/web/.next/server/chunks/ssr/_c3f595c6._.js.map +1 -1
  161. package/web/.next/server/chunks/ssr/_ea9e1556._.js +1 -1
  162. package/web/.next/server/chunks/ssr/_ea9e1556._.js.map +1 -1
  163. package/web/.next/server/chunks/ssr/_f1ba9be6._.js +2 -2
  164. package/web/.next/server/chunks/ssr/_f1ba9be6._.js.map +1 -1
  165. package/web/.next/server/chunks/ssr/_f33cd07e._.js +2 -2
  166. package/web/.next/server/chunks/ssr/_f33cd07e._.js.map +1 -1
  167. package/web/.next/server/chunks/ssr/_f8b45233._.js +1 -1
  168. package/web/.next/server/chunks/ssr/_f8b45233._.js.map +1 -1
  169. package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js +1 -1
  170. package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js.map +1 -1
  171. package/web/.next/server/chunks/ssr/f3a1f_components_common_control-center-drawer_repository-drawer-client_tsx_39a00c03._.js +1 -1
  172. package/web/.next/server/chunks/ssr/f3a1f_components_common_control-center-drawer_repository-drawer-client_tsx_39a00c03._.js.map +1 -1
  173. package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_open-ide_ts_baaca5d5._.js +1 -1
  174. package/web/.next/server/chunks/ssr/src_presentation_web_components_895e5bfa._.js +1 -1
  175. package/web/.next/server/chunks/ssr/src_presentation_web_components_895e5bfa._.js.map +1 -1
  176. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js +1 -1
  177. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js.map +1 -1
  178. package/web/.next/server/pages/500.html +2 -2
  179. package/web/.next/server/server-reference-manifest.js +1 -1
  180. package/web/.next/server/server-reference-manifest.json +48 -48
  181. package/web/.next/static/chunks/11c0751a110512fe.js +1 -0
  182. package/web/.next/static/chunks/{57e11c48bcd1d9b8.js → 21c2c118fbca72d6.js} +1 -1
  183. package/web/.next/static/chunks/{f1885dd59965e0f9.js → 24a9b6b70d115270.js} +2 -2
  184. package/web/.next/static/chunks/4ec421c6392d6239.js +1 -0
  185. package/web/.next/static/chunks/{99bfac1c0b8b19b7.js → 5f938a3a92820198.js} +1 -1
  186. package/web/.next/static/chunks/68d94611a56aadfb.js +1 -0
  187. package/web/.next/static/chunks/{4d5d80adb4397ced.js → 93fb65830aa9be92.js} +2 -2
  188. package/web/.next/static/chunks/{f8f63039d0d6f80b.js → b3239c8b4808bc71.js} +1 -1
  189. package/web/.next/static/chunks/{0f17267e5c90b232.js → c1f2e8bd60c4fda7.js} +1 -1
  190. package/web/.next/static/chunks/{3c730d304bc35629.js → c8764d04fc97cfd0.js} +1 -1
  191. package/web/.next/static/chunks/{7f3ce661fcc57b65.js → cce219b0d01fdd7e.js} +2 -2
  192. package/web/.next/static/chunks/dd7a3e5fcb78cfab.js +1 -0
  193. package/web/.next/static/chunks/{9fa49aeaf54d09fd.js → e8cbe15fc9a98e48.js} +1 -1
  194. package/web/.next/server/chunks/ssr/_fecec23a._.js +0 -3
  195. package/web/.next/static/chunks/32d411963c1ef448.js +0 -1
  196. package/web/.next/static/chunks/725e8bc88459d9d0.js +0 -1
  197. package/web/.next/static/chunks/84586f075208b491.js +0 -1
  198. package/web/.next/static/chunks/9d57e438c993d9f3.js +0 -1
  199. /package/web/.next/static/{t2E8atZdYFJbeTbPcqx9J → 0gC5sfDes_GyMDzbWHrbK}/_buildManifest.js +0 -0
  200. /package/web/.next/static/{t2E8atZdYFJbeTbPcqx9J → 0gC5sfDes_GyMDzbWHrbK}/_clientMiddlewareManifest.json +0 -0
  201. /package/web/.next/static/{t2E8atZdYFJbeTbPcqx9J → 0gC5sfDes_GyMDzbWHrbK}/_ssgManifest.js +0 -0
@@ -407,6 +407,14 @@ export interface IGitPrService {
407
407
  * @throws GitPrError with GIT_ERROR code on failure (including stash pop conflicts)
408
408
  */
409
409
  stashPop(cwd: string): Promise<void>;
410
+ /**
411
+ * Drop the most recent stash entry without applying it.
412
+ * Runs `git stash drop`.
413
+ *
414
+ * @param cwd - Working directory path
415
+ * @throws GitPrError with GIT_ERROR code on failure (e.g., no stash entries)
416
+ */
417
+ stashDrop(cwd: string): Promise<void>;
410
418
  /**
411
419
  * Get the sync status (ahead/behind counts) between a feature branch
412
420
  * and a base branch's remote-tracking ref.
@@ -1 +1 @@
1
- {"version":3,"file":"git-pr-service.interface.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/core/src/application/ports/output/services/git-pr-service.interface.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC;AAEvE;;GAEG;AACH,oBAAY,cAAc;IACxB,YAAY,iBAAiB;IAC7B,gBAAgB,qBA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,CAAC,GAAG,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEpF;;;;;;;OAOG;IACH,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAEnD;;;;;;;OAOG;IACH,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAExD;;;;;;;;OAQG;IACH,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE3C;;;;;;OAMG;IACH,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAExC;;;;;;;;OAQG;IACH,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAEvD;;;;;;OAMG;IACH,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAErC;;;;;;;;;;;;;OAaG;IACH,mBAAmB,CACjB,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,CAAC;CAC/C"}
1
+ {"version":3,"file":"git-pr-service.interface.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/core/src/application/ports/output/services/git-pr-service.interface.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC;AAEvE;;GAEG;AACH,oBAAY,cAAc;IACxB,YAAY,iBAAiB;IAC7B,gBAAgB,qBAAqB;IACrC,UAAU,eAAe;IACzB,YAAY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Aa,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEpF;;;;;;;OAOG;IACH,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAEnD;;;;;;;OAOG;IACH,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAExD;;;;;;;;OAQG;IACH,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE3C;;;;;;OAMG;IACH,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAExC;;;;;;;;OAQG;IACH,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAEvD;;;;;;OAMG;IACH,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAErC;;;;;;OAMG;IACH,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEtC;;;;;;;;;;;;;OAaG;IACH,mBAAmB,CACjB,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,CAAC;CAC/C"}
@@ -1 +1 @@
1
- {"version":3,"file":"rebase-feature-on-main.use-case.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/application/use-cases/features/rebase-feature-on-main.use-case.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iEAAiE,CAAC;AAC1G,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yDAAyD,CAAC;AAK7F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2DAA2D,CAAC;AAClG,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6DAA6D,CAAC;AACvG,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gEAAgE,CAAC;AAE7G,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,4FAA4F,CAAC;AAE5I,qBACa,0BAA0B;IAGnC,OAAO,CAAC,QAAQ,CAAC,WAAW;IAE5B,OAAO,CAAC,QAAQ,CAAC,YAAY;IAE7B,OAAO,CAAC,QAAQ,CAAC,eAAe;IAEhC,OAAO,CAAC,QAAQ,CAAC,yBAAyB;IAE1C,OAAO,CAAC,QAAQ,CAAC,YAAY;IAE7B,OAAO,CAAC,QAAQ,CAAC,eAAe;gBAVf,WAAW,EAAE,kBAAkB,EAE/B,YAAY,EAAE,aAAa,EAE3B,eAAe,EAAE,gBAAgB,EAEjC,yBAAyB,EAAE,yBAAyB,EAEpD,YAAY,EAAE,mBAAmB,EAEjC,eAAe,EAAE,sBAAsB;IAGpD,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;YA+EjC,cAAc;IAwB5B;;;;OAIG;YACW,UAAU;CAOzB"}
1
+ {"version":3,"file":"rebase-feature-on-main.use-case.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/application/use-cases/features/rebase-feature-on-main.use-case.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iEAAiE,CAAC;AAC1G,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yDAAyD,CAAC;AAK7F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2DAA2D,CAAC;AAClG,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6DAA6D,CAAC;AACvG,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gEAAgE,CAAC;AAE7G,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,4FAA4F,CAAC;AAE5I,qBACa,0BAA0B;IAGnC,OAAO,CAAC,QAAQ,CAAC,WAAW;IAE5B,OAAO,CAAC,QAAQ,CAAC,YAAY;IAE7B,OAAO,CAAC,QAAQ,CAAC,eAAe;IAEhC,OAAO,CAAC,QAAQ,CAAC,yBAAyB;IAE1C,OAAO,CAAC,QAAQ,CAAC,YAAY;IAE7B,OAAO,CAAC,QAAQ,CAAC,eAAe;gBAVf,WAAW,EAAE,kBAAkB,EAE/B,YAAY,EAAE,aAAa,EAE3B,eAAe,EAAE,gBAAgB,EAEjC,yBAAyB,EAAE,yBAAyB,EAEpD,YAAY,EAAE,mBAAmB,EAEjC,eAAe,EAAE,sBAAsB;IAGpD,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;YAyGjC,cAAc;IAwB5B;;;;OAIG;YACW,UAAU;CAOzB"}
@@ -77,7 +77,8 @@ let RebaseFeatureOnMainUseCase = class RebaseFeatureOnMainUseCase {
77
77
  const cwd = await this.resolveCwd(feature.repositoryPath, feature.branch);
78
78
  const defaultBranch = await this.gitPrService.getDefaultBranch(feature.repositoryPath);
79
79
  // Stash uncommitted changes if present (smart rebase)
80
- const didStash = await this.gitPrService.stash(cwd, 'shep-rebase: auto-stash before rebase');
80
+ const didStash = await this.gitPrService.stash(cwd, `shep-auto-stash: ${feature.branch}`);
81
+ let stashPopError;
81
82
  try {
82
83
  // Auto-sync main before rebasing (per spec decision)
83
84
  await this.gitPrService.syncMain(cwd, defaultBranch);
@@ -98,9 +99,29 @@ let RebaseFeatureOnMainUseCase = class RebaseFeatureOnMainUseCase {
98
99
  finally {
99
100
  // Restore stashed changes after rebase (whether it succeeded or failed)
100
101
  if (didStash) {
101
- await this.gitPrService.stashPop(cwd);
102
+ try {
103
+ await this.gitPrService.stashPop(cwd);
104
+ }
105
+ catch {
106
+ // Stash pop failed — likely conflicts between rebased code and stashed changes.
107
+ // Invoke agent-powered resolution, then drop the stash entry on success.
108
+ try {
109
+ await this.conflictResolutionService.resolveStashPop(cwd, feature.branch, defaultBranch);
110
+ await this.gitPrService.stashDrop(cwd);
111
+ }
112
+ catch {
113
+ stashPopError = new Error(`Rebase succeeded but failed to restore your uncommitted changes. ` +
114
+ `The rebase is complete, but your stashed work-in-progress could not be applied cleanly. ` +
115
+ `Run \`git stash pop\` manually to resolve the remaining conflicts. ` +
116
+ `Your stash entry is preserved.`);
117
+ }
118
+ }
102
119
  }
103
120
  }
121
+ // Throw stash pop error after the finally block to satisfy no-unsafe-finally
122
+ if (stashPopError) {
123
+ throw stashPopError;
124
+ }
104
125
  // Rebase succeeded (possibly with resolved conflicts)
105
126
  await this.completeTiming(agentRunId, phaseTimingId, startMs, 'success');
106
127
  }
@@ -24,6 +24,7 @@ export declare class UpgradeCliUseCase {
24
24
  constructor(versionService: IVersionService, daemonService: IDaemonService);
25
25
  execute(onOutput?: (data: string) => void): Promise<UpgradeResult>;
26
26
  private getLatestVersion;
27
+ private preDownloadPackage;
27
28
  /**
28
29
  * Schedule a daemon self-restart after upgrade.
29
30
  * Reads the current daemon port, spawns a new daemon process with the
@@ -1 +1 @@
1
- {"version":3,"file":"upgrade-cli.use-case.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/application/use-cases/upgrade/upgrade-cli.use-case.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0DAA0D,CAAC;AAChG,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yDAAyD,CAAC;AAE9F,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,YAAY,GAAG,UAAU,GAAG,OAAO,CAAC;IAC5C,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAOD,qBACa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 -24,7 +24,11 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
24
24
  };
25
25
  import { injectable, inject } from 'tsyringe';
26
26
  import { spawn } from 'node:child_process';
27
+ import { mkdtempSync, rmSync } from 'node:fs';
28
+ import { tmpdir } from 'node:os';
29
+ import { join } from 'node:path';
27
30
  const VERSION_CHECK_TIMEOUT_MS = 10_000;
31
+ const NPM_CACHE_ADD_TIMEOUT_MS = 120_000;
28
32
  /** Delay (ms) before the current process exits to allow the SSE response to flush. */
29
33
  const SELF_RESTART_DELAY_MS = 1_000;
30
34
  let UpgradeCliUseCase = class UpgradeCliUseCase {
@@ -43,8 +47,14 @@ let UpgradeCliUseCase = class UpgradeCliUseCase {
43
47
  onOutput?.(`Already up to date (v${currentVersion})\n`);
44
48
  return { status: 'up-to-date', currentVersion, latestVersion };
45
49
  }
46
- // 3. Run upgrade
50
+ // 3. Pre-download the package into npm cache before install
47
51
  const target = latestVersion ? `v${latestVersion}` : 'latest';
52
+ onOutput?.(`Downloading @shepai/cli@latest...\n`);
53
+ const cached = await this.preDownloadPackage();
54
+ if (!cached) {
55
+ onOutput?.('Pre-download did not complete — proceeding with install...\n');
56
+ }
57
+ // 4. Run install (fast if cached)
48
58
  onOutput?.(`Upgrading from v${currentVersion} to ${target}...\n`);
49
59
  try {
50
60
  const exitCode = await this.runNpmInstall(onOutput);
@@ -104,6 +114,53 @@ let UpgradeCliUseCase = class UpgradeCliUseCase {
104
114
  });
105
115
  });
106
116
  }
117
+ preDownloadPackage() {
118
+ let tmpDir;
119
+ try {
120
+ tmpDir = mkdtempSync(join(tmpdir(), 'shep-upgrade-'));
121
+ }
122
+ catch {
123
+ return Promise.resolve(false);
124
+ }
125
+ const cleanup = () => {
126
+ try {
127
+ rmSync(tmpDir, { recursive: true, force: true });
128
+ }
129
+ catch {
130
+ /* best-effort */
131
+ }
132
+ };
133
+ return new Promise((resolve) => {
134
+ let settled = false;
135
+ const child = spawn('npm', ['install', '--prefix', tmpDir, '--ignore-scripts', '@shepai/cli@latest'], {
136
+ stdio: ['ignore', 'ignore', 'pipe'],
137
+ });
138
+ const timeout = setTimeout(() => {
139
+ if (!settled) {
140
+ settled = true;
141
+ child.kill();
142
+ cleanup();
143
+ resolve(false);
144
+ }
145
+ }, NPM_CACHE_ADD_TIMEOUT_MS);
146
+ child.on('close', (code) => {
147
+ if (!settled) {
148
+ settled = true;
149
+ clearTimeout(timeout);
150
+ cleanup();
151
+ resolve(code === 0);
152
+ }
153
+ });
154
+ child.on('error', () => {
155
+ if (!settled) {
156
+ settled = true;
157
+ clearTimeout(timeout);
158
+ cleanup();
159
+ resolve(false);
160
+ }
161
+ });
162
+ });
163
+ }
107
164
  /**
108
165
  * Schedule a daemon self-restart after upgrade.
109
166
  * Reads the current daemon port, spawns a new daemon process with the
@@ -130,7 +187,7 @@ let UpgradeCliUseCase = class UpgradeCliUseCase {
130
187
  }
131
188
  runNpmInstall(onOutput) {
132
189
  return new Promise((resolve, reject) => {
133
- const child = spawn('npm', ['i', '-g', '@shepai/cli@latest'], {
190
+ const child = spawn('npm', ['i', '-g', '@shepai/cli@latest', '--prefer-offline'], {
134
191
  stdio: ['ignore', 'pipe', 'pipe'],
135
192
  });
136
193
  child.stdout?.on('data', (data) => {
@@ -32,4 +32,25 @@ export interface ConflictResolutionPromptParams {
32
32
  * all conflict markers by editing files in the working directory.
33
33
  */
34
34
  export declare function buildConflictResolutionPrompt(params: ConflictResolutionPromptParams): string;
35
+ export interface StashPopResolutionPromptParams {
36
+ /** Files with conflict markers from stash pop */
37
+ conflictedFiles: ConflictedFile[];
38
+ /** The feature branch */
39
+ featureBranch: string;
40
+ /** The base branch the feature was rebased onto */
41
+ baseBranch: string;
42
+ /** 1-based attempt number */
43
+ attemptNumber: number;
44
+ /** Maximum allowed attempts */
45
+ maxAttempts: number;
46
+ /** Feedback from previous failed attempt */
47
+ previousFeedback?: string;
48
+ }
49
+ /**
50
+ * Build a prompt for resolving stash pop conflicts.
51
+ *
52
+ * Stash pop conflicts occur when rebased code conflicts with uncommitted
53
+ * changes that were stashed before the rebase.
54
+ */
55
+ export declare function buildStashPopResolutionPrompt(params: StashPopResolutionPromptParams): string;
35
56
  //# sourceMappingURL=conflict-resolution.prompt.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"conflict-resolution.prompt.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/core/src/infrastructure/services/agents/conflict-resolution/conflict-resolution.prompt.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,WAAW,cAAc;IAC7B,wCAAwC;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,oDAAoD;IACpD,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,8BAA8B;IAC7C,kCAAkC;IAClC,eAAe,EAAE,cAAc,EAAE,CAAC;IAClC,uCAAuC;IACvC,aAAa,EAAE,MAAM,CAAC;IACtB,yCAAyC;IACzC,UAAU,EAAE,MAAM,CAAC;IACnB,6BAA6B;IAC7B,aAAa,EAAE,MAAM,CAAC;IACtB,+BAA+B;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,qEAAqE;IACrE,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAAC,MAAM,EAAE,8BAA8B,GAAG,MAAM,CAgE5F"}
1
+ {"version":3,"file":"conflict-resolution.prompt.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/core/src/infrastructure/services/agents/conflict-resolution/conflict-resolution.prompt.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,WAAW,cAAc;IAC7B,wCAAwC;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,oDAAoD;IACpD,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,8BAA8B;IAC7C,kCAAkC;IAClC,eAAe,EAAE,cAAc,EAAE,CAAC;IAClC,uCAAuC;IACvC,aAAa,EAAE,MAAM,CAAC;IACtB,yCAAyC;IACzC,UAAU,EAAE,MAAM,CAAC;IACnB,6BAA6B;IAC7B,aAAa,EAAE,MAAM,CAAC;IACtB,+BAA+B;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,qEAAqE;IACrE,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAAC,MAAM,EAAE,8BAA8B,GAAG,MAAM,CAgE5F;AAED,MAAM,WAAW,8BAA8B;IAC7C,iDAAiD;IACjD,eAAe,EAAE,cAAc,EAAE,CAAC;IAClC,yBAAyB;IACzB,aAAa,EAAE,MAAM,CAAC;IACtB,mDAAmD;IACnD,UAAU,EAAE,MAAM,CAAC;IACnB,6BAA6B;IAC7B,aAAa,EAAE,MAAM,CAAC;IACtB,+BAA+B;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,4CAA4C;IAC5C,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAAC,MAAM,EAAE,8BAA8B,GAAG,MAAM,CAkE5F"}
@@ -64,3 +64,64 @@ ${fileSection}
64
64
  - Do NOT run tests, builds, or linters — only resolve the conflict markers
65
65
  - Every conflicted file must have zero remaining conflict markers when you are done`;
66
66
  }
67
+ /**
68
+ * Build a prompt for resolving stash pop conflicts.
69
+ *
70
+ * Stash pop conflicts occur when rebased code conflicts with uncommitted
71
+ * changes that were stashed before the rebase.
72
+ */
73
+ export function buildStashPopResolutionPrompt(params) {
74
+ const { conflictedFiles, featureBranch, baseBranch, attemptNumber, maxAttempts, previousFeedback, } = params;
75
+ const fileSection = conflictedFiles
76
+ .map((f) => `### \`${f.path}\`
77
+
78
+ \`\`\`
79
+ ${f.content}
80
+ \`\`\``)
81
+ .join('\n\n');
82
+ const feedbackSection = previousFeedback
83
+ ? `
84
+ ## Previous Attempt Feedback
85
+
86
+ Your previous resolution attempt (${attemptNumber - 1}/${maxAttempts}) was incomplete:
87
+
88
+ ${previousFeedback}
89
+
90
+ You MUST resolve all remaining conflict markers in this attempt.
91
+ `
92
+ : '';
93
+ return `You are resolving git stash pop conflicts (attempt ${attemptNumber}/${maxAttempts}).
94
+
95
+ ## Context
96
+
97
+ - Feature branch: \`${featureBranch}\`
98
+ - Base branch: \`${baseBranch}\`
99
+ - The feature branch was just rebased onto \`${baseBranch}\`.
100
+ - Uncommitted changes were stashed before the rebase and are now being restored via stash pop.
101
+ - The stash pop caused conflicts because the rebased code modified the same files as the stashed uncommitted changes.
102
+ ${feedbackSection}
103
+ ## Conflicted Files
104
+
105
+ The following files contain conflict markers from the stash pop:
106
+
107
+ ${fileSection}
108
+
109
+ ## Instructions
110
+
111
+ 1. Read each conflicted file listed above
112
+ 2. Resolve ALL conflict markers (\`<<<<<<<\`, \`=======\`, \`>>>>>>>\`) by editing the files
113
+ 3. For each conflict:
114
+ - The \`<<<<<<< Updated upstream\` section contains the rebased code (current branch state after rebase)
115
+ - The \`>>>>>>> Stashed changes\` section contains the user's uncommitted work-in-progress
116
+ 4. Preserve the user's uncommitted changes where possible — these are work-in-progress edits the user was actively developing
117
+ 5. Integrate the rebased code changes that don't conflict with the user's intent
118
+
119
+ ## Constraints
120
+
121
+ - Edit ONLY the conflicted files listed above — do NOT modify any other files
122
+ - Remove ALL conflict markers (\`<<<<<<<\`, \`=======\`, \`>>>>>>>\`) from every conflicted file
123
+ - Do NOT add new files or delete files
124
+ - Do NOT run git commands — only edit files to resolve conflicts
125
+ - Do NOT run tests, builds, or linters — only resolve the conflict markers
126
+ - Every conflicted file must have zero remaining conflict markers when you are done`;
127
+ }
@@ -26,6 +26,22 @@ export declare class ConflictResolutionService {
26
26
  * @param baseBranch - Base branch being rebased onto
27
27
  */
28
28
  resolve(cwd: string, featureBranch: string, baseBranch: string): Promise<void>;
29
+ /**
30
+ * Resolve conflicts from a failed stash pop.
31
+ *
32
+ * After a rebase, stash pop may fail if the rebased code conflicts with
33
+ * stashed uncommitted changes. This method invokes the agent to resolve
34
+ * those conflicts, validates, and stages the resolved files.
35
+ *
36
+ * Unlike resolve(), this does NOT call rebaseContinue — the rebase is
37
+ * already complete. On success, the caller is responsible for dropping
38
+ * the stash entry.
39
+ *
40
+ * @param cwd - Working directory (repo root or worktree path)
41
+ * @param featureBranch - Feature branch name
42
+ * @param baseBranch - Base branch name
43
+ */
44
+ resolveStashPop(cwd: string, featureBranch: string, baseBranch: string): Promise<void>;
29
45
  /**
30
46
  * Read the contents of conflicted files from the working directory.
31
47
  */
@@ -1 +1 @@
1
- {"version":3,"file":"conflict-resolution.service.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/core/src/infrastructure/services/agents/conflict-resolution/conflict-resolution.service.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wEAAwE,CAAC;AACrH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iEAAiE,CAAC;AAerG,qBACa,yBAAyB;IAGlC,OAAO,CAAC,QAAQ,CAAC,aAAa;IAE9B,OAAO,CAAC,QAAQ,CAAC,YAAY;gBAFZ,aAAa,EAAE,sBAAsB,EAErC,YAAY,EAAE,aAAa;IAG9C;;;;;;;;;;;;;OAaG;IACG,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAkEpF;;OAEG;IACH,OAAO,CAAC,0BAA0B;IAWlC;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAgB1B;;OAEG;IACH,OAAO,CAAC,iCAAiC;CAyB1C"}
1
+ {"version":3,"file":"conflict-resolution.service.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/core/src/infrastructure/services/agents/conflict-resolution/conflict-resolution.service.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wEAAwE,CAAC;AACrH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iEAAiE,CAAC;AAgBrG,qBACa,yBAAyB;IAGlC,OAAO,CAAC,QAAQ,CAAC,aAAa;IAE9B,OAAO,CAAC,QAAQ,CAAC,YAAY;gBAFZ,aAAa,EAAE,sBAAsB,EAErC,YAAY,EAAE,aAAa;IAG9C;;;;;;;;;;;;;OAaG;IACG,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAkEpF;;;;;;;;;;;;;;OAcG;IACG,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAuC5F;;OAEG;IACH,OAAO,CAAC,0BAA0B;IAWlC;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAgB1B;;OAEG;IACH,OAAO,CAAC,iCAAiC;CAyB1C"}
@@ -21,7 +21,7 @@ import { injectable, inject } from 'tsyringe';
21
21
  import { readFileSync } from 'node:fs';
22
22
  import { join } from 'node:path';
23
23
  import { GitPrError, GitPrErrorCode, } from '../../../../application/ports/output/services/git-pr-service.interface.js';
24
- import { buildConflictResolutionPrompt, } from './conflict-resolution.prompt.js';
24
+ import { buildConflictResolutionPrompt, buildStashPopResolutionPrompt, } from './conflict-resolution.prompt.js';
25
25
  const MAX_RETRIES_PER_COMMIT = 3;
26
26
  /** Conflict markers that indicate unresolved conflicts */
27
27
  const CONFLICT_MARKERS = ['<<<<<<<', '=======', '>>>>>>>'];
@@ -86,9 +86,9 @@ let ConflictResolutionService = class ConflictResolutionService {
86
86
  await this.gitPrService.stageFiles(cwd, conflictedFiles);
87
87
  try {
88
88
  await this.gitPrService.rebaseContinue(cwd);
89
- // rebaseContinue succeeded — check if there are more conflicts
90
- // from subsequent commits (loop continues)
91
- return; // No more conflicts
89
+ // rebaseContinue succeeded — loop back to check if subsequent
90
+ // commits have conflicts (getConflictedFiles at top of while loop)
91
+ continue;
92
92
  }
93
93
  catch (error) {
94
94
  if (error instanceof GitPrError && error.code === GitPrErrorCode.REBASE_CONFLICT) {
@@ -99,6 +99,49 @@ let ConflictResolutionService = class ConflictResolutionService {
99
99
  }
100
100
  }
101
101
  }
102
+ /**
103
+ * Resolve conflicts from a failed stash pop.
104
+ *
105
+ * After a rebase, stash pop may fail if the rebased code conflicts with
106
+ * stashed uncommitted changes. This method invokes the agent to resolve
107
+ * those conflicts, validates, and stages the resolved files.
108
+ *
109
+ * Unlike resolve(), this does NOT call rebaseContinue — the rebase is
110
+ * already complete. On success, the caller is responsible for dropping
111
+ * the stash entry.
112
+ *
113
+ * @param cwd - Working directory (repo root or worktree path)
114
+ * @param featureBranch - Feature branch name
115
+ * @param baseBranch - Base branch name
116
+ */
117
+ async resolveStashPop(cwd, featureBranch, baseBranch) {
118
+ const conflictedFiles = await this.gitPrService.getConflictedFiles(cwd);
119
+ if (conflictedFiles.length === 0) {
120
+ return;
121
+ }
122
+ const executor = await this.agentProvider.getExecutor();
123
+ for (let attempt = 1; attempt <= MAX_RETRIES_PER_COMMIT; attempt++) {
124
+ const fileContents = this.readConflictedFileContents(cwd, conflictedFiles);
125
+ const previousFeedback = attempt > 1 ? this.buildFeedbackFromRemainingMarkers(cwd, conflictedFiles) : undefined;
126
+ const prompt = buildStashPopResolutionPrompt({
127
+ conflictedFiles: fileContents,
128
+ featureBranch,
129
+ baseBranch,
130
+ attemptNumber: attempt,
131
+ maxAttempts: MAX_RETRIES_PER_COMMIT,
132
+ previousFeedback,
133
+ });
134
+ await executor.execute(prompt, { cwd });
135
+ if (this.validateResolution(cwd, conflictedFiles)) {
136
+ await this.gitPrService.stageFiles(cwd, conflictedFiles);
137
+ return;
138
+ }
139
+ }
140
+ const remaining = conflictedFiles.join(', ');
141
+ throw new Error(`Failed to resolve stash pop conflicts after ${MAX_RETRIES_PER_COMMIT} attempts. ` +
142
+ `Unresolved files: ${remaining}. Your stash entry is preserved — ` +
143
+ `run \`git stash pop\` manually to resolve.`);
144
+ }
102
145
  /**
103
146
  * Read the contents of conflicted files from the working directory.
104
147
  */
@@ -86,7 +86,7 @@ export function createEvidenceNode(executor) {
86
86
  const commitEvidence = state.commitEvidence;
87
87
  const settings = hasSettings() ? getSettings() : undefined;
88
88
  const maxRetries = settings?.workflow.evidenceRetries ?? DEFAULT_MAX_RETRIES;
89
- const options = buildExecutorOptions(state);
89
+ const options = buildExecutorOptions(state, undefined, 'evidence');
90
90
  const tasks = parseTasks(state.specDir);
91
91
  // --- Validation retry loop ---
92
92
  let allEvidence = [];
@@ -48,7 +48,7 @@ export function createFastImplementNode(executor) {
48
48
  agentType: executor.agentType,
49
49
  });
50
50
  try {
51
- const options = buildExecutorOptions(state);
51
+ const options = buildExecutorOptions(state, undefined, 'fast-implement');
52
52
  log.info(`Executing agent at cwd=${options.cwd}`);
53
53
  log.info(`Prompt length: ${prompt.length} chars`);
54
54
  const result = await retryExecute(executor, prompt, options, { logger: log });
@@ -112,7 +112,7 @@ export function createImplementNode(executor) {
112
112
  }
113
113
  log.info(`Phase ${phase.id} "${phase.name}" — ${phaseTasks.length} task(s), parallel: ${phase.parallel}`);
114
114
  updateFeatureProgress(state.specDir, completedTasks, totalTasks, `implementing-${phase.id}`, phaseTasks[0].id, log);
115
- const options = buildExecutorOptions(state);
115
+ const options = buildExecutorOptions(state, undefined, 'implement');
116
116
  const promptContext = { isLastPhase, phaseIndex: i, totalPhases };
117
117
  const phaseStartTime = Date.now();
118
118
  const phaseTimingId = await recordPhaseStart(`implement:${phase.id}`, {
@@ -83,7 +83,7 @@ export function createMergeNode(deps) {
83
83
  const feature = await deps.featureRepository.findById(state.featureId);
84
84
  const branch = feature?.branch ?? `feat/${state.featureId}`;
85
85
  const baseBranch = await deps.getDefaultBranch(cwd);
86
- const options = buildExecutorOptions(state);
86
+ const options = buildExecutorOptions(state, undefined, 'merge');
87
87
  let commitHash = state.commitHash;
88
88
  let prUrl = state.prUrl;
89
89
  let prNumber = state.prNumber;
@@ -53,6 +53,7 @@ export declare class GitPrService implements IGitPrService {
53
53
  rebaseAbort(cwd: string): Promise<void>;
54
54
  stash(cwd: string, message?: string): Promise<boolean>;
55
55
  stashPop(cwd: string): Promise<void>;
56
+ stashDrop(cwd: string): Promise<void>;
56
57
  getBranchSyncStatus(cwd: string, featureBranch: string, baseBranch: string): Promise<{
57
58
  ahead: number;
58
59
  behind: number;
@@ -1 +1 @@
1
- {"version":3,"file":"git-pr.service.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/services/git/git-pr.service.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wEAAwE,CAAC;AAC5G,OAAO,KAAK,EACV,cAAc,EAGd,WAAW,EACX,QAAQ,EACR,aAAa,EACb,cAAc,EACd,YAAY,EACb,MAAM,wEAAwE,CAAC;AAUhF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAG1D,qBACa,YAAa,YAAW,aAAa;IACZ,OAAO,CAAC,QAAQ,CAAC,QAAQ;gBAAR,QAAQ,EAAE,YAAY;IAErE,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAKxC,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAgBjD,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAgF9C,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAKnD,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAKpD,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAWxD,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,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G,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAQpC,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"}
1
+ {"version":3,"file":"git-pr.service.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/services/git/git-pr.service.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wEAAwE,CAAC;AAC5G,OAAO,KAAK,EACV,cAAc,EAGd,WAAW,EACX,QAAQ,EACR,aAAa,EACb,cAAc,EACd,YAAY,EACb,MAAM,wEAAwE,CAAC;AAUhF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAG1D,qBACa,YAAa,YAAW,aAAa;IACZ,OAAO,CAAC,QAAQ,CAAC,QAAQ;gBAAR,QAAQ,EAAE,YAAY;IAErE,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAKxC,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAgBjD,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAgF9C,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAKnD,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAKpD,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAWxD,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,OA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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"}
@@ -814,6 +814,14 @@ let GitPrService = class GitPrService {
814
814
  throw this.parseGitError(error);
815
815
  }
816
816
  }
817
+ async stashDrop(cwd) {
818
+ try {
819
+ await this.execFile('git', ['stash', 'drop'], { cwd });
820
+ }
821
+ catch (error) {
822
+ throw this.parseGitError(error);
823
+ }
824
+ }
817
825
  async getBranchSyncStatus(cwd, featureBranch, baseBranch) {
818
826
  try {
819
827
  const remoteRef = `origin/${baseBranch}`;
@@ -1 +1 @@
1
- {"version":3,"file":"upgrade.command.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/cli/commands/upgrade.command.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,KAAK,IAAI,YAAY,EAAqB,MAAM,oBAAoB,CAAC;AAS9E,KAAK,OAAO,GAAG,OAAO,YAAY,CAAC;AA8EnC;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,GAAE,OAAsB,GAAG,OAAO,CAqE7E"}
1
+ {"version":3,"file":"upgrade.command.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/cli/commands/upgrade.command.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,KAAK,IAAI,YAAY,EAAqB,MAAM,oBAAoB,CAAC;AAY9E,KAAK,OAAO,GAAG,OAAO,YAAY,CAAC;AA8InC;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,GAAE,OAAsB,GAAG,OAAO,CA6E7E"}
@@ -8,12 +8,16 @@
8
8
  */
9
9
  import { Command } from 'commander';
10
10
  import { spawn as defaultSpawn } from 'node:child_process';
11
+ import { mkdtempSync, rmSync } from 'node:fs';
12
+ import { tmpdir } from 'node:os';
13
+ import { join } from 'node:path';
11
14
  import { container } from '../../../../packages/core/src/infrastructure/di/container.js';
12
15
  import { messages } from '../ui/index.js';
13
16
  import { getCliI18n } from '../i18n.js';
14
17
  import { stopDaemon } from './daemon/stop-daemon.js';
15
18
  import { startDaemon } from './daemon/start-daemon.js';
16
19
  const VERSION_CHECK_TIMEOUT_MS = 10_000;
20
+ const NPM_CACHE_ADD_TIMEOUT_MS = 120_000;
17
21
  /** On Windows, npm is a .cmd batch file — spawn() needs shell: true to resolve it. */
18
22
  const IS_WINDOWS = process.platform === 'win32';
19
23
  /**
@@ -61,13 +65,67 @@ function getLatestVersion(spawnFn) {
61
65
  });
62
66
  });
63
67
  }
68
+ /**
69
+ * Pre-download the package AND all transitive dependencies into npm's cache.
70
+ * Uses `npm install --prefix <tmpdir>` which resolves the full dependency tree
71
+ * and populates the cache. The temp directory is cleaned up afterwards.
72
+ * Returns true if the pre-download succeeded, false otherwise (fail-open).
73
+ */
74
+ function preDownloadPackage(spawnFn) {
75
+ let tmpDir;
76
+ try {
77
+ tmpDir = mkdtempSync(join(tmpdir(), 'shep-upgrade-'));
78
+ }
79
+ catch {
80
+ return Promise.resolve(false);
81
+ }
82
+ const cleanup = () => {
83
+ try {
84
+ rmSync(tmpDir, { recursive: true, force: true });
85
+ }
86
+ catch {
87
+ /* best-effort */
88
+ }
89
+ };
90
+ return new Promise((resolve) => {
91
+ let settled = false;
92
+ const child = spawnFn('npm', ['install', '--prefix', tmpDir, '--ignore-scripts', '@shepai/cli@latest'], {
93
+ stdio: ['ignore', 'ignore', 'pipe'],
94
+ ...(IS_WINDOWS && { shell: true }),
95
+ });
96
+ const timeout = setTimeout(() => {
97
+ if (!settled) {
98
+ settled = true;
99
+ child.kill();
100
+ cleanup();
101
+ resolve(false);
102
+ }
103
+ }, NPM_CACHE_ADD_TIMEOUT_MS);
104
+ child.on('close', (code) => {
105
+ if (!settled) {
106
+ settled = true;
107
+ clearTimeout(timeout);
108
+ cleanup();
109
+ resolve(code === 0);
110
+ }
111
+ });
112
+ child.on('error', () => {
113
+ if (!settled) {
114
+ settled = true;
115
+ clearTimeout(timeout);
116
+ cleanup();
117
+ resolve(false);
118
+ }
119
+ });
120
+ });
121
+ }
64
122
  /**
65
123
  * Run npm i -g @shepai/cli@latest with inherited stdio.
66
124
  * Returns the exit code, or rejects on spawn error.
67
125
  */
68
126
  function runNpmInstall(spawnFn) {
69
127
  return new Promise((resolve, reject) => {
70
- const child = spawnFn('npm', ['i', '-g', '@shepai/cli@latest'], {
128
+ const child = spawnFn('npm', ['i', '-g', '@shepai/cli@latest', '--prefer-offline'], {
71
129
  stdio: 'inherit',
72
130
  ...(IS_WINDOWS && { shell: true }),
73
131
  });
@@ -107,7 +165,14 @@ export function createUpgradeCommand(spawnFn = defaultSpawn) {
107
165
  else {
108
166
  messages.info(t('cli:commands.upgrade.upgradingToLatest', { current: currentVersion }));
109
167
  }
110
- // 4. Check daemon state before install (FR-1)
168
+ // 4. Pre-download the package into npm cache BEFORE stopping the daemon.
169
+ // This minimizes downtime — the actual install will read from cache.
170
+ messages.info(t('cli:commands.upgrade.downloadingPackage'));
171
+ const cached = await preDownloadPackage(spawnFn);
172
+ if (!cached) {
173
+ messages.warning(t('cli:commands.upgrade.downloadFailed'));
174
+ }
175
+ // 5. Check daemon state and stop if running
111
176
  const daemonService = container.resolve('IDaemonService');
112
177
  const daemonState = await daemonService.read();
113
178
  const daemonWasRunning = daemonState !== null && daemonService.isAlive(daemonState.pid);
@@ -116,7 +181,7 @@ export function createUpgradeCommand(spawnFn = defaultSpawn) {
116
181
  messages.info(t('cli:commands.upgrade.stoppingDaemon'));
117
182
  await stopDaemon(daemonService);
118
183
  }
119
- // 5. Run npm i -g @shepai/cli@latest; always restore daemon in finally (FR-2, FR-3)
184
+ // 6. Run npm i -g @shepai/cli@latest; always restore daemon in finally
120
185
  let installExitCode = 1;
121
186
  try {
122
187
  installExitCode = await runNpmInstall(spawnFn);
@@ -565,6 +565,8 @@
565
565
  "alreadyUpToDate": "محدّث بالفعل (v{{version}})",
566
566
  "upgradingFromTo": "الترقية من v{{current}} إلى v{{latest}}",
567
567
  "upgradingToLatest": "الترقية من v{{current}} إلى الأحدث",
568
+ "downloadingPackage": "جارٍ تنزيل الإصدار الجديد...",
569
+ "downloadFailed": "لم يكتمل التنزيل المسبق — المتابعة بالتثبيت",
568
570
  "stoppingDaemon": "جارٍ إيقاف الخدمة الخلفية قبل الترقية...",
569
571
  "restartingDaemon": "جارٍ إعادة تشغيل الخدمة الخلفية...",
570
572
  "daemonRestarted": "تمت إعادة تشغيل الخدمة الخلفية بنجاح.",
@@ -565,6 +565,8 @@
565
565
  "alreadyUpToDate": "Bereits aktuell (v{{version}})",
566
566
  "upgradingFromTo": "Aktualisierung von v{{current}} auf v{{latest}}",
567
567
  "upgradingToLatest": "Aktualisierung von v{{current}} auf die neueste Version",
568
+ "downloadingPackage": "Neue Version wird heruntergeladen...",
569
+ "downloadFailed": "Vorab-Download nicht abgeschlossen — Installation wird fortgesetzt",
568
570
  "stoppingDaemon": "Dienst wird vor Aktualisierung gestoppt...",
569
571
  "restartingDaemon": "Dienst wird neu gestartet...",
570
572
  "daemonRestarted": "Dienst erfolgreich neu gestartet.",
@@ -565,6 +565,8 @@
565
565
  "alreadyUpToDate": "Already up to date (v{{version}})",
566
566
  "upgradingFromTo": "Upgrading from v{{current}} to v{{latest}}",
567
567
  "upgradingToLatest": "Upgrading from v{{current}} to latest",
568
+ "downloadingPackage": "Downloading new version...",
569
+ "downloadFailed": "Pre-download did not complete — proceeding with install",
568
570
  "stoppingDaemon": "Stopping daemon before upgrade...",
569
571
  "restartingDaemon": "Restarting daemon...",
570
572
  "daemonRestarted": "Daemon restarted successfully.",