@shepai/cli 1.177.0 → 1.178.1

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 (341) hide show
  1. package/apis/json-schema/Language.yaml +1 -0
  2. package/dist/packages/core/src/application/ports/output/services/agent-auth-detector.interface.d.ts +23 -0
  3. package/dist/packages/core/src/application/ports/output/services/agent-auth-detector.interface.d.ts.map +1 -0
  4. package/dist/packages/core/src/application/ports/output/services/agent-auth-detector.interface.js +13 -0
  5. package/dist/packages/core/src/application/ports/output/services/file-system-service.interface.d.ts +18 -0
  6. package/dist/packages/core/src/application/ports/output/services/file-system-service.interface.d.ts.map +1 -0
  7. package/dist/packages/core/src/application/ports/output/services/file-system-service.interface.js +7 -0
  8. package/dist/packages/core/src/application/ports/output/services/index.d.ts +3 -0
  9. package/dist/packages/core/src/application/ports/output/services/index.d.ts.map +1 -1
  10. package/dist/packages/core/src/application/ports/output/services/project-scaffold-service.interface.d.ts +33 -0
  11. package/dist/packages/core/src/application/ports/output/services/project-scaffold-service.interface.d.ts.map +1 -0
  12. package/dist/packages/core/src/application/ports/output/services/project-scaffold-service.interface.js +9 -0
  13. package/dist/packages/core/src/application/use-cases/agents/check-agent-auth.use-case.d.ts +42 -0
  14. package/dist/packages/core/src/application/use-cases/agents/check-agent-auth.use-case.d.ts.map +1 -0
  15. package/dist/packages/core/src/application/use-cases/agents/check-agent-auth.use-case.js +134 -0
  16. package/dist/packages/core/src/application/use-cases/projects/create-project.use-case.d.ts +43 -0
  17. package/dist/packages/core/src/application/use-cases/projects/create-project.use-case.d.ts.map +1 -0
  18. package/dist/packages/core/src/application/use-cases/projects/create-project.use-case.js +84 -0
  19. package/dist/packages/core/src/application/use-cases/repositories/delete-repository.use-case.d.ts +13 -2
  20. package/dist/packages/core/src/application/use-cases/repositories/delete-repository.use-case.d.ts.map +1 -1
  21. package/dist/packages/core/src/application/use-cases/repositories/delete-repository.use-case.js +14 -3
  22. package/dist/packages/core/src/infrastructure/di/container.d.ts.map +1 -1
  23. package/dist/packages/core/src/infrastructure/di/container.js +16 -0
  24. package/dist/packages/core/src/infrastructure/services/agent-auth-detector/platform-agent-auth-detector.service.d.ts +35 -0
  25. package/dist/packages/core/src/infrastructure/services/agent-auth-detector/platform-agent-auth-detector.service.d.ts.map +1 -0
  26. package/dist/packages/core/src/infrastructure/services/agent-auth-detector/platform-agent-auth-detector.service.js +165 -0
  27. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/merge/merge.node.d.ts.map +1 -1
  28. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/merge/merge.node.js +31 -5
  29. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/prompts/merge-prompts.d.ts +14 -0
  30. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/prompts/merge-prompts.d.ts.map +1 -1
  31. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/prompts/merge-prompts.js +63 -0
  32. package/dist/packages/core/src/infrastructure/services/file-system.service.d.ts +10 -0
  33. package/dist/packages/core/src/infrastructure/services/file-system.service.d.ts.map +1 -0
  34. package/dist/packages/core/src/infrastructure/services/file-system.service.js +22 -0
  35. package/dist/packages/core/src/infrastructure/services/git/git-pr.service.d.ts.map +1 -1
  36. package/dist/packages/core/src/infrastructure/services/git/git-pr.service.js +57 -10
  37. package/dist/packages/core/src/infrastructure/services/project-scaffold/fs-project-scaffold.service.d.ts +22 -0
  38. package/dist/packages/core/src/infrastructure/services/project-scaffold/fs-project-scaffold.service.d.ts.map +1 -0
  39. package/dist/packages/core/src/infrastructure/services/project-scaffold/fs-project-scaffold.service.js +74 -0
  40. package/dist/src/presentation/web/app/actions/check-agent-auth.d.ts +10 -2
  41. package/dist/src/presentation/web/app/actions/check-agent-auth.d.ts.map +1 -1
  42. package/dist/src/presentation/web/app/actions/check-agent-auth.js +7 -199
  43. package/dist/src/presentation/web/app/actions/create-project-folder.d.ts +16 -0
  44. package/dist/src/presentation/web/app/actions/create-project-folder.d.ts.map +1 -0
  45. package/dist/src/presentation/web/app/actions/create-project-folder.js +18 -0
  46. package/dist/src/presentation/web/app/actions/delete-repository.d.ts +4 -1
  47. package/dist/src/presentation/web/app/actions/delete-repository.d.ts.map +1 -1
  48. package/dist/src/presentation/web/app/actions/delete-repository.js +2 -2
  49. package/dist/src/presentation/web/components/common/feature-node/feature-node.d.ts.map +1 -1
  50. package/dist/src/presentation/web/components/common/feature-node/feature-node.js +2 -2
  51. package/dist/src/presentation/web/components/common/repository-node/repository-node-config.d.ts +3 -1
  52. package/dist/src/presentation/web/components/common/repository-node/repository-node-config.d.ts.map +1 -1
  53. package/dist/src/presentation/web/components/common/repository-node/repository-node.d.ts.map +1 -1
  54. package/dist/src/presentation/web/components/common/repository-node/repository-node.js +13 -4
  55. package/dist/src/presentation/web/components/features/control-center/control-center-empty-state.d.ts.map +1 -1
  56. package/dist/src/presentation/web/components/features/control-center/control-center-empty-state.js +5 -3
  57. package/dist/src/presentation/web/components/features/control-center/control-center-inner.d.ts.map +1 -1
  58. package/dist/src/presentation/web/components/features/control-center/control-center-inner.js +134 -124
  59. package/dist/src/presentation/web/components/features/control-center/new-project-dialog.d.ts +8 -0
  60. package/dist/src/presentation/web/components/features/control-center/new-project-dialog.d.ts.map +1 -0
  61. package/dist/src/presentation/web/components/features/control-center/new-project-dialog.js +43 -0
  62. package/dist/src/presentation/web/components/features/control-center/use-canvas-event-listeners.d.ts +27 -0
  63. package/dist/src/presentation/web/components/features/control-center/use-canvas-event-listeners.d.ts.map +1 -0
  64. package/dist/src/presentation/web/components/features/control-center/use-canvas-event-listeners.js +84 -0
  65. package/dist/src/presentation/web/components/features/control-center/use-control-center-state.d.ts +3 -1
  66. package/dist/src/presentation/web/components/features/control-center/use-control-center-state.d.ts.map +1 -1
  67. package/dist/src/presentation/web/components/features/control-center/use-control-center-state.js +4 -2
  68. package/dist/src/presentation/web/components/features/control-center/use-fab-actions.d.ts +21 -0
  69. package/dist/src/presentation/web/components/features/control-center/use-fab-actions.d.ts.map +1 -0
  70. package/dist/src/presentation/web/components/features/control-center/use-fab-actions.js +70 -0
  71. package/dist/src/presentation/web/components/features/control-center/use-workspace-fit-view.d.ts +27 -0
  72. package/dist/src/presentation/web/components/features/control-center/use-workspace-fit-view.d.ts.map +1 -0
  73. package/dist/src/presentation/web/components/features/control-center/use-workspace-fit-view.js +48 -0
  74. package/dist/src/presentation/web/components/features/control-center/welcome-agent-setup.d.ts.map +1 -1
  75. package/dist/src/presentation/web/components/features/control-center/welcome-agent-setup.js +8 -1
  76. package/dist/src/presentation/web/components/features/features-canvas/canvas-toolbar.d.ts +3 -1
  77. package/dist/src/presentation/web/components/features/features-canvas/canvas-toolbar.d.ts.map +1 -1
  78. package/dist/src/presentation/web/components/features/features-canvas/canvas-toolbar.js +3 -3
  79. package/dist/src/presentation/web/components/features/features-canvas/features-canvas.d.ts.map +1 -1
  80. package/dist/src/presentation/web/components/features/features-canvas/features-canvas.js +1 -1
  81. package/dist/src/presentation/web/components/features/features-canvas/manage-workspace-dialog.d.ts +15 -0
  82. package/dist/src/presentation/web/components/features/features-canvas/manage-workspace-dialog.d.ts.map +1 -0
  83. package/dist/src/presentation/web/components/features/features-canvas/manage-workspace-dialog.js +74 -0
  84. package/dist/src/presentation/web/components/features/features-canvas/workspace-name-dialog.d.ts +11 -0
  85. package/dist/src/presentation/web/components/features/features-canvas/workspace-name-dialog.d.ts.map +1 -0
  86. package/dist/src/presentation/web/components/features/features-canvas/workspace-name-dialog.js +22 -0
  87. package/dist/src/presentation/web/components/features/features-canvas/workspace-selector.d.ts +13 -0
  88. package/dist/src/presentation/web/components/features/features-canvas/workspace-selector.d.ts.map +1 -0
  89. package/dist/src/presentation/web/components/features/features-canvas/workspace-selector.js +21 -0
  90. package/dist/src/presentation/web/hooks/use-workspaces.d.ts +37 -0
  91. package/dist/src/presentation/web/hooks/use-workspaces.d.ts.map +1 -0
  92. package/dist/src/presentation/web/hooks/use-workspaces.js +219 -0
  93. package/dist/src/presentation/web/lib/derive-graph.d.ts +3 -1
  94. package/dist/src/presentation/web/lib/derive-graph.d.ts.map +1 -1
  95. package/dist/translations/ar/web.json +4 -1
  96. package/dist/translations/de/web.json +4 -1
  97. package/dist/translations/en/web.json +4 -1
  98. package/dist/translations/es/web.json +4 -1
  99. package/dist/translations/fr/web.json +4 -1
  100. package/dist/translations/he/web.json +4 -1
  101. package/dist/translations/pt/web.json +4 -1
  102. package/dist/translations/ru/web.json +4 -1
  103. package/dist/translations/uk/web.json +3 -0
  104. package/dist/tsconfig.build.tsbuildinfo +1 -1
  105. package/package.json +1 -1
  106. package/web/.next/BUILD_ID +1 -1
  107. package/web/.next/build-manifest.json +2 -2
  108. package/web/.next/fallback-build-manifest.json +2 -2
  109. package/web/.next/prerender-manifest.json +3 -3
  110. package/web/.next/required-server-files.js +2 -2
  111. package/web/.next/required-server-files.json +2 -2
  112. package/web/.next/server/app/(dashboard)/@drawer/adopt/page/server-reference-manifest.json +73 -58
  113. package/web/.next/server/app/(dashboard)/@drawer/adopt/page.js +1 -2
  114. package/web/.next/server/app/(dashboard)/@drawer/adopt/page.js.nft.json +1 -1
  115. package/web/.next/server/app/(dashboard)/@drawer/adopt/page_client-reference-manifest.js +1 -1
  116. package/web/.next/server/app/(dashboard)/@drawer/chat/page/server-reference-manifest.json +69 -54
  117. package/web/.next/server/app/(dashboard)/@drawer/chat/page.js +1 -2
  118. package/web/.next/server/app/(dashboard)/@drawer/chat/page.js.nft.json +1 -1
  119. package/web/.next/server/app/(dashboard)/@drawer/chat/page_client-reference-manifest.js +1 -1
  120. package/web/.next/server/app/(dashboard)/@drawer/create/page/server-reference-manifest.json +75 -60
  121. package/web/.next/server/app/(dashboard)/@drawer/create/page.js +1 -2
  122. package/web/.next/server/app/(dashboard)/@drawer/create/page.js.nft.json +1 -1
  123. package/web/.next/server/app/(dashboard)/@drawer/create/page_client-reference-manifest.js +1 -1
  124. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/server-reference-manifest.json +91 -76
  125. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js +1 -2
  126. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  127. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  128. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/server-reference-manifest.json +91 -76
  129. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js +1 -2
  130. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js.nft.json +1 -1
  131. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page_client-reference-manifest.js +1 -1
  132. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page/server-reference-manifest.json +71 -56
  133. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page.js +1 -2
  134. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page.js.nft.json +1 -1
  135. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page_client-reference-manifest.js +1 -1
  136. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/server-reference-manifest.json +71 -56
  137. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js +1 -2
  138. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js.nft.json +1 -1
  139. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  140. package/web/.next/server/app/(dashboard)/chat/page/server-reference-manifest.json +69 -54
  141. package/web/.next/server/app/(dashboard)/chat/page.js +1 -2
  142. package/web/.next/server/app/(dashboard)/chat/page.js.nft.json +1 -1
  143. package/web/.next/server/app/(dashboard)/chat/page_client-reference-manifest.js +1 -1
  144. package/web/.next/server/app/(dashboard)/create/page/server-reference-manifest.json +75 -60
  145. package/web/.next/server/app/(dashboard)/create/page.js +1 -2
  146. package/web/.next/server/app/(dashboard)/create/page.js.nft.json +1 -1
  147. package/web/.next/server/app/(dashboard)/create/page_client-reference-manifest.js +1 -1
  148. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/server-reference-manifest.json +91 -76
  149. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js +1 -2
  150. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  151. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  152. package/web/.next/server/app/(dashboard)/feature/[featureId]/page/server-reference-manifest.json +91 -76
  153. package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js +1 -2
  154. package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js.nft.json +1 -1
  155. package/web/.next/server/app/(dashboard)/feature/[featureId]/page_client-reference-manifest.js +1 -1
  156. package/web/.next/server/app/(dashboard)/page/server-reference-manifest.json +69 -54
  157. package/web/.next/server/app/(dashboard)/page.js +1 -2
  158. package/web/.next/server/app/(dashboard)/page.js.nft.json +1 -1
  159. package/web/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
  160. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page/server-reference-manifest.json +71 -56
  161. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page.js +1 -2
  162. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page.js.nft.json +1 -1
  163. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page_client-reference-manifest.js +1 -1
  164. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/server-reference-manifest.json +71 -56
  165. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js +1 -2
  166. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js.nft.json +1 -1
  167. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  168. package/web/.next/server/app/_global-error.html +2 -2
  169. package/web/.next/server/app/_global-error.rsc +1 -1
  170. package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  171. package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  172. package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  173. package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  174. package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  175. package/web/.next/server/app/_not-found/page/server-reference-manifest.json +6 -6
  176. package/web/.next/server/app/_not-found/page.js.nft.json +1 -1
  177. package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  178. package/web/.next/server/app/api/attachments/preview/route.js.nft.json +1 -1
  179. package/web/.next/server/app/api/evidence/route.js.nft.json +1 -1
  180. package/web/.next/server/app/api/graph-data/route.js.nft.json +1 -1
  181. package/web/.next/server/app/api/interactive/chat/[featureId]/messages/route.js.nft.json +1 -1
  182. package/web/.next/server/app/features/page/server-reference-manifest.json +6 -6
  183. package/web/.next/server/app/features/page.js.nft.json +1 -1
  184. package/web/.next/server/app/features/page_client-reference-manifest.js +1 -1
  185. package/web/.next/server/app/settings/page/server-reference-manifest.json +9 -9
  186. package/web/.next/server/app/settings/page.js.nft.json +1 -1
  187. package/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  188. package/web/.next/server/app/skills/page/server-reference-manifest.json +13 -13
  189. package/web/.next/server/app/skills/page.js.nft.json +1 -1
  190. package/web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  191. package/web/.next/server/app/tools/page/server-reference-manifest.json +11 -11
  192. package/web/.next/server/app/tools/page.js.nft.json +1 -1
  193. package/web/.next/server/app/tools/page_client-reference-manifest.js +1 -1
  194. package/web/.next/server/app/version/page/server-reference-manifest.json +6 -6
  195. package/web/.next/server/app/version/page.js.nft.json +1 -1
  196. package/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
  197. package/web/.next/server/chunks/[root-of-the-server]__a402b567._.js +1 -1
  198. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js +1 -1
  199. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js.map +1 -1
  200. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_feature-drawer-client_tsx_e9755fc8._.js +2 -2
  201. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_feature-drawer-client_tsx_e9755fc8._.js.map +1 -1
  202. package/web/.next/server/chunks/ssr/[root-of-the-server]__1cd4327c._.js +1 -1
  203. package/web/.next/server/chunks/ssr/[root-of-the-server]__1cd4327c._.js.map +1 -1
  204. package/web/.next/server/chunks/ssr/[root-of-the-server]__1f389e5d._.js +1 -1
  205. package/web/.next/server/chunks/ssr/[root-of-the-server]__1f389e5d._.js.map +1 -1
  206. package/web/.next/server/chunks/ssr/[root-of-the-server]__23b5ca2c._.js +1 -1
  207. package/web/.next/server/chunks/ssr/[root-of-the-server]__357d99f9._.js +1 -1
  208. package/web/.next/server/chunks/ssr/[root-of-the-server]__46b10380._.js +3 -0
  209. package/web/.next/server/chunks/ssr/[root-of-the-server]__46b10380._.js.map +1 -0
  210. package/web/.next/server/chunks/ssr/[root-of-the-server]__540c615f._.js +2 -2
  211. package/web/.next/server/chunks/ssr/[root-of-the-server]__6c7d3936._.js +1 -1
  212. package/web/.next/server/chunks/ssr/[root-of-the-server]__6c7d3936._.js.map +1 -1
  213. package/web/.next/server/chunks/ssr/[root-of-the-server]__7528eb6f._.js +1 -1
  214. package/web/.next/server/chunks/ssr/[root-of-the-server]__8b512877._.js +3 -0
  215. package/web/.next/server/chunks/ssr/[root-of-the-server]__8b512877._.js.map +1 -0
  216. package/web/.next/server/chunks/ssr/[root-of-the-server]__990dba2d._.js +3 -0
  217. package/web/.next/server/chunks/ssr/[root-of-the-server]__990dba2d._.js.map +1 -0
  218. package/web/.next/server/chunks/ssr/[root-of-the-server]__b7b96453._.js +1 -1
  219. package/web/.next/server/chunks/ssr/[root-of-the-server]__b7b96453._.js.map +1 -1
  220. package/web/.next/server/chunks/ssr/[root-of-the-server]__cc9c7bbb._.js +3 -0
  221. package/web/.next/server/chunks/ssr/[root-of-the-server]__cc9c7bbb._.js.map +1 -0
  222. package/web/.next/server/chunks/ssr/_05c23ad9._.js +1 -1
  223. package/web/.next/server/chunks/ssr/_05c23ad9._.js.map +1 -1
  224. package/web/.next/server/chunks/ssr/_16eb4fec._.js +1 -1
  225. package/web/.next/server/chunks/ssr/_16eb4fec._.js.map +1 -1
  226. package/web/.next/server/chunks/ssr/_35b56ded._.js +3 -0
  227. package/web/.next/server/chunks/ssr/_35b56ded._.js.map +1 -0
  228. package/web/.next/server/chunks/ssr/{_4cbb7f95._.js → _496c9117._.js} +2 -2
  229. package/web/.next/server/chunks/ssr/{_4cbb7f95._.js.map → _496c9117._.js.map} +1 -1
  230. package/web/.next/server/chunks/ssr/_56b9d60f._.js +1 -1
  231. package/web/.next/server/chunks/ssr/_56b9d60f._.js.map +1 -1
  232. package/web/.next/server/chunks/ssr/_6abfa39e._.js +1 -1
  233. package/web/.next/server/chunks/ssr/_79a4a04a._.js +3 -0
  234. package/web/.next/server/chunks/ssr/_79a4a04a._.js.map +1 -0
  235. package/web/.next/server/chunks/ssr/{_3fc2374c._.js → _a1cc5e68._.js} +2 -2
  236. package/web/.next/server/chunks/ssr/_a1cc5e68._.js.map +1 -0
  237. package/web/.next/server/chunks/ssr/{_19a779c6._.js → _a2e317b3._.js} +2 -2
  238. package/web/.next/server/chunks/ssr/{_19a779c6._.js.map → _a2e317b3._.js.map} +1 -1
  239. package/web/.next/server/chunks/ssr/_f8c55130._.js +1 -1
  240. package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js +1 -1
  241. package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js.map +1 -1
  242. package/web/.next/server/chunks/ssr/f3a1f_components_common_control-center-drawer_repository-drawer-client_tsx_39a00c03._.js +1 -1
  243. package/web/.next/server/chunks/ssr/f3a1f_components_common_control-center-drawer_repository-drawer-client_tsx_39a00c03._.js.map +1 -1
  244. package/web/.next/server/chunks/ssr/src_presentation_web_06109d28._.js +5 -0
  245. package/web/.next/server/chunks/ssr/src_presentation_web_06109d28._.js.map +1 -0
  246. package/web/.next/server/chunks/ssr/src_presentation_web_0bca70f8._.js +3 -0
  247. package/web/.next/server/chunks/ssr/src_presentation_web_0bca70f8._.js.map +1 -0
  248. package/web/.next/server/chunks/ssr/src_presentation_web_367cdbe0._.js +3 -0
  249. package/web/.next/server/chunks/ssr/src_presentation_web_367cdbe0._.js.map +1 -0
  250. package/web/.next/server/chunks/ssr/src_presentation_web_57fed7fd._.js +3 -0
  251. package/web/.next/server/chunks/ssr/src_presentation_web_57fed7fd._.js.map +1 -0
  252. package/web/.next/server/chunks/ssr/src_presentation_web_7f567f6d._.js +3 -0
  253. package/web/.next/server/chunks/ssr/src_presentation_web_7f567f6d._.js.map +1 -0
  254. package/web/.next/server/chunks/ssr/src_presentation_web_972f58d5._.js +3 -0
  255. package/web/.next/server/chunks/ssr/src_presentation_web_972f58d5._.js.map +1 -0
  256. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_4ce30db7.js +1 -1
  257. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_4ce30db7.js.map +1 -1
  258. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_e4032193.js +1 -1
  259. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_e4032193.js.map +1 -1
  260. package/web/.next/server/chunks/ssr/src_presentation_web_a71b18a2._.js +3 -0
  261. package/web/.next/server/chunks/ssr/src_presentation_web_a71b18a2._.js.map +1 -0
  262. package/web/.next/server/chunks/ssr/src_presentation_web_app_features_feature-tree-page-client_tsx_34c5cbbf._.js +2 -2
  263. package/web/.next/server/chunks/ssr/src_presentation_web_app_features_feature-tree-page-client_tsx_34c5cbbf._.js.map +1 -1
  264. package/web/.next/server/chunks/ssr/src_presentation_web_bebe675e._.js +3 -0
  265. package/web/.next/server/chunks/ssr/src_presentation_web_bebe675e._.js.map +1 -0
  266. package/web/.next/server/chunks/ssr/src_presentation_web_c93e8bc6._.js +3 -0
  267. package/web/.next/server/chunks/ssr/src_presentation_web_c93e8bc6._.js.map +1 -0
  268. package/web/.next/server/chunks/ssr/src_presentation_web_components_895e5bfa._.js +1 -1
  269. package/web/.next/server/chunks/ssr/src_presentation_web_components_895e5bfa._.js.map +1 -1
  270. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js +1 -1
  271. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js.map +1 -1
  272. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_skills_8a174cac._.js +1 -1
  273. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_skills_8a174cac._.js.map +1 -1
  274. package/web/.next/server/chunks/ssr/src_presentation_web_e729f44a._.js +5 -0
  275. package/web/.next/server/chunks/ssr/src_presentation_web_e729f44a._.js.map +1 -0
  276. package/web/.next/server/chunks/ssr/translations_23dd5e7e._.js +1 -1
  277. package/web/.next/server/chunks/ssr/translations_23dd5e7e._.js.map +1 -1
  278. package/web/.next/server/pages/500.html +2 -2
  279. package/web/.next/server/server-reference-manifest.js +1 -1
  280. package/web/.next/server/server-reference-manifest.json +590 -484
  281. package/web/.next/static/chunks/{b5d355eb59916926.js → 0b6c8ca8403db859.js} +2 -2
  282. package/web/.next/static/chunks/{eaa1b979d63d322b.js → 0ff97e3b2c05f514.js} +1 -1
  283. package/web/.next/static/chunks/124b79a5d2a760fb.css +1 -0
  284. package/web/.next/static/chunks/{829d2f8ef2715f2f.js → 27b1e99ab97bdf52.js} +3 -3
  285. package/web/.next/static/chunks/28ad440cbb92bebe.js +1 -0
  286. package/web/.next/static/chunks/{4c20d4cd4786a0c8.js → 2ce798babf8adbc5.js} +1 -1
  287. package/web/.next/static/chunks/{ef897f150084ef85.js → 374e00e5b4ab142e.js} +1 -1
  288. package/web/.next/static/chunks/4052a4971fbbac9c.js +1 -0
  289. package/web/.next/static/chunks/{0a706f8508eae0a8.js → 44dc686d971c7513.js} +3 -3
  290. package/web/.next/static/chunks/{0d0e2661bd167e0f.js → 64a765a6eec07603.js} +1 -1
  291. package/web/.next/static/chunks/{bb479c31b5b53bac.js → 74c37f189bc83156.js} +2 -2
  292. package/web/.next/static/chunks/8057357cf1f9b4ef.js +1 -0
  293. package/web/.next/static/chunks/{b5a916fec4cdc897.js → 8ecdaada8068211c.js} +1 -1
  294. package/web/.next/static/chunks/b2c52514837b4fc4.js +1 -0
  295. package/web/.next/static/chunks/{efd57b6ffc7cbd54.js → b567f6c06cc7013a.js} +1 -1
  296. package/web/.next/static/chunks/{c0e4cd44851a9293.js → bbc95353509ede89.js} +1 -1
  297. package/web/.next/static/chunks/{77d6506c7d1f711f.js → f2ec6318c5ff73b8.js} +1 -1
  298. package/web/.next/static/chunks/{18f429029d702545.js → f7741bf45b42ac62.js} +1 -1
  299. package/web/.next/server/chunks/ssr/744ca_web__next-internal_server_app_(dashboard)_@drawer_adopt_page_actions_ad0071c9.js +0 -3
  300. package/web/.next/server/chunks/ssr/744ca_web__next-internal_server_app_(dashboard)_@drawer_adopt_page_actions_ad0071c9.js.map +0 -1
  301. package/web/.next/server/chunks/ssr/744ca_web__next-internal_server_app_(dashboard)_@drawer_chat_page_actions_90d98b2b.js +0 -3
  302. package/web/.next/server/chunks/ssr/744ca_web__next-internal_server_app_(dashboard)_@drawer_chat_page_actions_90d98b2b.js.map +0 -1
  303. package/web/.next/server/chunks/ssr/744ca_web__next-internal_server_app_(dashboard)_chat_page_actions_d3828105.js +0 -3
  304. package/web/.next/server/chunks/ssr/744ca_web__next-internal_server_app_(dashboard)_chat_page_actions_d3828105.js.map +0 -1
  305. package/web/.next/server/chunks/ssr/[root-of-the-server]__51ec77a8._.js +0 -3
  306. package/web/.next/server/chunks/ssr/[root-of-the-server]__51ec77a8._.js.map +0 -1
  307. package/web/.next/server/chunks/ssr/[root-of-the-server]__66047a1b._.js +0 -3
  308. package/web/.next/server/chunks/ssr/[root-of-the-server]__66047a1b._.js.map +0 -1
  309. package/web/.next/server/chunks/ssr/[root-of-the-server]__a932cd3a._.js +0 -3
  310. package/web/.next/server/chunks/ssr/[root-of-the-server]__a932cd3a._.js.map +0 -1
  311. package/web/.next/server/chunks/ssr/[root-of-the-server]__aa72e794._.js +0 -3
  312. package/web/.next/server/chunks/ssr/[root-of-the-server]__aa72e794._.js.map +0 -1
  313. package/web/.next/server/chunks/ssr/_073183f4._.js +0 -3
  314. package/web/.next/server/chunks/ssr/_073183f4._.js.map +0 -1
  315. package/web/.next/server/chunks/ssr/_3fc2374c._.js.map +0 -1
  316. package/web/.next/server/chunks/ssr/_57b1af27._.js +0 -3
  317. package/web/.next/server/chunks/ssr/_57b1af27._.js.map +0 -1
  318. package/web/.next/server/chunks/ssr/src_presentation_web_17d39233._.js +0 -3
  319. package/web/.next/server/chunks/ssr/src_presentation_web_17d39233._.js.map +0 -1
  320. package/web/.next/server/chunks/ssr/src_presentation_web_54b02639._.js +0 -5
  321. package/web/.next/server/chunks/ssr/src_presentation_web_54b02639._.js.map +0 -1
  322. package/web/.next/server/chunks/ssr/src_presentation_web_7b7b9e3b._.js +0 -5
  323. package/web/.next/server/chunks/ssr/src_presentation_web_7b7b9e3b._.js.map +0 -1
  324. package/web/.next/server/chunks/ssr/src_presentation_web_807cba76._.js +0 -3
  325. package/web/.next/server/chunks/ssr/src_presentation_web_807cba76._.js.map +0 -1
  326. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_90b5e66e.js +0 -3
  327. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_90b5e66e.js.map +0 -1
  328. package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_open-ide_ts_baaca5d5._.js +0 -3
  329. package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_open-ide_ts_baaca5d5._.js.map +0 -1
  330. package/web/.next/server/chunks/ssr/src_presentation_web_e1cd1869._.js +0 -3
  331. package/web/.next/server/chunks/ssr/src_presentation_web_e1cd1869._.js.map +0 -1
  332. package/web/.next/server/chunks/ssr/src_presentation_web_e3a30e30._.js +0 -3
  333. package/web/.next/server/chunks/ssr/src_presentation_web_e3a30e30._.js.map +0 -1
  334. package/web/.next/static/chunks/3fc5b2287f192799.js +0 -1
  335. package/web/.next/static/chunks/a20f2d6f76f469b7.css +0 -1
  336. package/web/.next/static/chunks/ddd34e939acc204f.js +0 -1
  337. package/web/.next/static/chunks/f9d948464ed409cb.js +0 -1
  338. package/web/.next/static/chunks/fc0232384ec2b48d.js +0 -1
  339. /package/web/.next/static/{UZ2czjiAnEl1RF-HTzHyA → d9JsHxuahs7UrJKwH-FGH}/_buildManifest.js +0 -0
  340. /package/web/.next/static/{UZ2czjiAnEl1RF-HTzHyA → d9JsHxuahs7UrJKwH-FGH}/_clientMiddlewareManifest.json +0 -0
  341. /package/web/.next/static/{UZ2czjiAnEl1RF-HTzHyA → d9JsHxuahs7UrJKwH-FGH}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platform-agent-auth-detector.service.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/services/agent-auth-detector/platform-agent-auth-detector.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AASH,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAChE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6EAA6E,CAAC;AAuB7H,qBACa,gCAAiC,YAAW,yBAAyB;IAC1E,eAAe,CAAC,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC;IAaxF;;;OAGG;IACH,OAAO,CAAC,cAAc;IA2CtB;;;OAGG;IACH,OAAO,CAAC,eAAe;CAqCxB"}
@@ -0,0 +1,165 @@
1
+ /**
2
+ * Platform Agent Auth Detector Service
3
+ *
4
+ * Concrete adapter for IAgentAuthDetectorService. Detects whether the user
5
+ * is authenticated with a given AI coding agent using a two-tier strategy:
6
+ *
7
+ * Tier 1 (instant, ~5ms): env vars + credentials file existence + macOS
8
+ * Keychain entry. No subprocess.
9
+ *
10
+ * Tier 2 (subprocess, ~200ms): runs the agent's `auth status` subcommand
11
+ * when one exists. Skipped for Claude Code (no non-interactive auth
12
+ * subcommand — interactive `claude auth status` hangs and gets killed).
13
+ *
14
+ * Conservative by design: any detection failure returns false rather than
15
+ * throwing, so the UI can show "needs auth" instead of crashing.
16
+ *
17
+ * Cross-platform: macOS uses Keychain via `security`, Linux/Windows fall
18
+ * back to the file-based credential location.
19
+ */
20
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
21
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
22
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
23
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
24
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
25
+ };
26
+ import { execFile, execFileSync } from 'node:child_process';
27
+ import { existsSync } from 'node:fs';
28
+ import { homedir, platform } from 'node:os';
29
+ import { join } from 'node:path';
30
+ import { injectable } from 'tsyringe';
31
+ import { AgentType } from '../../../domain/generated/output.js';
32
+ import { IS_WINDOWS } from '../../platform.js';
33
+ const IS_MACOS = platform() === 'darwin';
34
+ /**
35
+ * On macOS, Claude Code stores OAuth credentials in the Keychain under the
36
+ * service name "Claude Code-credentials" (not in ~/.claude/.credentials.json).
37
+ * Use `security find-generic-password` to detect the entry without reading it.
38
+ */
39
+ function macKeychainHasClaudeCreds() {
40
+ if (!IS_MACOS)
41
+ return false;
42
+ try {
43
+ execFileSync('security', ['find-generic-password', '-s', 'Claude Code-credentials'], {
44
+ stdio: 'ignore',
45
+ timeout: 1500,
46
+ });
47
+ return true;
48
+ }
49
+ catch {
50
+ return false;
51
+ }
52
+ }
53
+ let PlatformAgentAuthDetectorService = class PlatformAgentAuthDetectorService {
54
+ async isAuthenticated(agentType, binaryName) {
55
+ // Tier 1: instant heuristics
56
+ if (!this.tier1AuthCheck(agentType)) {
57
+ return false;
58
+ }
59
+ // Tier 2: optional subprocess verify (best-effort, ~200ms)
60
+ if (binaryName) {
61
+ return this.tier2AuthVerify(agentType, binaryName);
62
+ }
63
+ return true;
64
+ }
65
+ /**
66
+ * Instant credential/env check (~5ms, no subprocess).
67
+ * Returns true if credentials likely exist for this agent type.
68
+ */
69
+ tier1AuthCheck(agentType) {
70
+ const home = homedir();
71
+ switch (agentType) {
72
+ case AgentType.ClaudeCode: {
73
+ if (process.env['ANTHROPIC_API_KEY'])
74
+ return true;
75
+ if (process.env['CLAUDE_CODE_USE_BEDROCK'])
76
+ return true;
77
+ if (process.env['CLAUDE_CODE_USE_VERTEX'])
78
+ return true;
79
+ if (process.env['CLAUDE_CODE_OAUTH_TOKEN'])
80
+ return true;
81
+ // macOS: credentials live in Keychain (no .credentials.json on disk).
82
+ if (macKeychainHasClaudeCreds())
83
+ return true;
84
+ // Linux / Windows: file-based credentials.
85
+ const credPath = join(home, '.claude', '.credentials.json');
86
+ return existsSync(credPath);
87
+ }
88
+ case AgentType.Cursor: {
89
+ if (process.env['CURSOR_API_KEY'])
90
+ return true;
91
+ // Cursor Agent stores creds after `agent login` — check common locations
92
+ const cursorDir = join(home, '.cursor');
93
+ return existsSync(cursorDir);
94
+ }
95
+ case AgentType.GeminiCli: {
96
+ if (process.env['GEMINI_API_KEY'])
97
+ return true;
98
+ if (process.env['GOOGLE_API_KEY'])
99
+ return true;
100
+ if (process.env['GOOGLE_APPLICATION_CREDENTIALS'])
101
+ return true;
102
+ const accountsPath = join(home, '.gemini', 'google_accounts.json');
103
+ return existsSync(accountsPath);
104
+ }
105
+ case AgentType.CopilotCli: {
106
+ if (process.env['GITHUB_TOKEN'])
107
+ return true;
108
+ if (process.env['GH_TOKEN'])
109
+ return true;
110
+ if (process.env['GITHUB_AUTH_TOKEN'])
111
+ return true;
112
+ // GitHub CLI stores creds after `gh auth login` — check common locations
113
+ const ghDir = IS_WINDOWS ? join(home, '.copilot') : join(home, '.config', 'gh');
114
+ return existsSync(ghDir);
115
+ }
116
+ default:
117
+ // dev, aider, continue, codex-cli — assume no auth needed
118
+ return true;
119
+ }
120
+ }
121
+ /**
122
+ * Subprocess verification (~200ms). Only called if tier 1 passes, to
123
+ * confirm tokens aren't expired.
124
+ */
125
+ tier2AuthVerify(agentType, binaryName) {
126
+ return new Promise((resolveAuth) => {
127
+ let cmd;
128
+ let args;
129
+ switch (agentType) {
130
+ case AgentType.ClaudeCode:
131
+ // Claude Code has no non-interactive `auth status` subcommand. Running
132
+ // `claude auth status` launches an interactive session that hangs and
133
+ // gets killed by the timeout, producing a false negative. Trust tier 1
134
+ // (env vars / Keychain on macOS / .credentials.json elsewhere).
135
+ resolveAuth(true);
136
+ return;
137
+ case AgentType.Cursor:
138
+ cmd = binaryName;
139
+ args = ['status'];
140
+ break;
141
+ case AgentType.CopilotCli:
142
+ cmd = 'gh';
143
+ args = ['auth', 'status'];
144
+ break;
145
+ default:
146
+ // No tier 2 command available — trust tier 1
147
+ resolveAuth(true);
148
+ return;
149
+ }
150
+ try {
151
+ const opts = IS_WINDOWS ? { timeout: 5000, windowsHide: true } : { timeout: 5000 };
152
+ execFile(cmd, args, opts, (error) => {
153
+ resolveAuth(!error);
154
+ });
155
+ }
156
+ catch {
157
+ resolveAuth(false);
158
+ }
159
+ });
160
+ }
161
+ };
162
+ PlatformAgentAuthDetectorService = __decorate([
163
+ injectable()
164
+ ], PlatformAgentAuthDetectorService);
165
+ export { PlatformAgentAuthDetectorService };
@@ -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
  *
@@ -0,0 +1,10 @@
1
+ /**
2
+ * File System Service Implementation
3
+ *
4
+ * Concrete adapter for IFileSystemService backed by node:fs/promises.
5
+ */
6
+ import type { IFileSystemService } from '../../application/ports/output/services/file-system-service.interface.js';
7
+ export declare class FileSystemService implements IFileSystemService {
8
+ removeDirectory(dirPath: string): Promise<void>;
9
+ }
10
+ //# sourceMappingURL=file-system.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-system.service.d.ts","sourceRoot":"","sources":["../../../../../../packages/core/src/infrastructure/services/file-system.service.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0EAA0E,CAAC;AAEnH,qBACa,iBAAkB,YAAW,kBAAkB;IACpD,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAGtD"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * File System Service Implementation
3
+ *
4
+ * Concrete adapter for IFileSystemService backed by node:fs/promises.
5
+ */
6
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
7
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
8
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
9
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
10
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
11
+ };
12
+ import { rm } from 'node:fs/promises';
13
+ import { injectable } from 'tsyringe';
14
+ let FileSystemService = class FileSystemService {
15
+ async removeDirectory(dirPath) {
16
+ await rm(dirPath, { recursive: true, force: true });
17
+ }
18
+ };
19
+ FileSystemService = __decorate([
20
+ injectable()
21
+ ], FileSystemService);
22
+ export { FileSystemService };
@@ -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,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,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,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAYvE,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAA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Ac,CAAC,GAAG,EAAE,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
  }
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Filesystem Project Scaffold Service
3
+ *
4
+ * Concrete adapter for IProjectScaffoldService. Owns "where projects live"
5
+ * ($SHEP_HOME/projects) and how they are bootstrapped: mkdir + git init +
6
+ * empty initial commit so the canvas can resolve a real HEAD immediately.
7
+ *
8
+ * Cross-platform: uses path.join (no hardcoded separators), windowsHide on
9
+ * spawned processes, and normalizes the returned path to forward slashes.
10
+ */
11
+ import type { IProjectScaffoldService, ScaffoldProjectInput, ScaffoldProjectResult } from '../../../application/ports/output/services/project-scaffold-service.interface.js';
12
+ export declare class FsProjectScaffoldService implements IProjectScaffoldService {
13
+ /**
14
+ * Resolve the projects root lazily so test isolation via SHEP_HOME works
15
+ * even when this adapter is constructed before the env var is set.
16
+ */
17
+ private getProjectsRoot;
18
+ private getProjectPath;
19
+ projectExists(slug: string): Promise<boolean>;
20
+ scaffoldProject(input: ScaffoldProjectInput): Promise<ScaffoldProjectResult>;
21
+ }
22
+ //# sourceMappingURL=fs-project-scaffold.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fs-project-scaffold.service.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/services/project-scaffold/fs-project-scaffold.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAUH,OAAO,KAAK,EACV,uBAAuB,EACvB,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,kFAAkF,CAAC;AAM1F,qBACa,wBAAyB,YAAW,uBAAuB;IACtE;;;OAGG;IACH,OAAO,CAAC,eAAe;IAIvB,OAAO,CAAC,cAAc;IAIhB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAI7C,eAAe,CAAC,KAAK,EAAE,oBAAoB,GAAG,OAAO,CAAC,qBAAqB,CAAC;CAoCnF"}
@@ -0,0 +1,74 @@
1
+ /**
2
+ * Filesystem Project Scaffold Service
3
+ *
4
+ * Concrete adapter for IProjectScaffoldService. Owns "where projects live"
5
+ * ($SHEP_HOME/projects) and how they are bootstrapped: mkdir + git init +
6
+ * empty initial commit so the canvas can resolve a real HEAD immediately.
7
+ *
8
+ * Cross-platform: uses path.join (no hardcoded separators), windowsHide on
9
+ * spawned processes, and normalizes the returned path to forward slashes.
10
+ */
11
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
12
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
13
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
14
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
15
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
16
+ };
17
+ import { execFile } from 'node:child_process';
18
+ import { existsSync } from 'node:fs';
19
+ import { mkdir } from 'node:fs/promises';
20
+ import { join } from 'node:path';
21
+ import { promisify } from 'node:util';
22
+ import { injectable } from 'tsyringe';
23
+ import { IS_WINDOWS } from '../../platform.js';
24
+ import { getShepHomeDir } from '../filesystem/shep-directory.service.js';
25
+ const execFileAsync = promisify(execFile);
26
+ let FsProjectScaffoldService = class FsProjectScaffoldService {
27
+ /**
28
+ * Resolve the projects root lazily so test isolation via SHEP_HOME works
29
+ * even when this adapter is constructed before the env var is set.
30
+ */
31
+ getProjectsRoot() {
32
+ return join(getShepHomeDir(), 'projects');
33
+ }
34
+ getProjectPath(slug) {
35
+ return join(this.getProjectsRoot(), slug);
36
+ }
37
+ async projectExists(slug) {
38
+ return existsSync(this.getProjectPath(slug));
39
+ }
40
+ async scaffoldProject(input) {
41
+ const projectPath = this.getProjectPath(input.slug);
42
+ await mkdir(projectPath, { recursive: true });
43
+ // Initialise git so the canvas can resolve a real HEAD immediately
44
+ // (otherwise `git rev-parse HEAD` fails and the repo node is stuck in
45
+ // the "loading" skeleton state). Pass user.name/user.email as command-
46
+ // level config so the empty commit works regardless of whether the user
47
+ // has configured global git identity. Tolerate failures: the folder
48
+ // still exists, so the caller can continue.
49
+ try {
50
+ const opts = IS_WINDOWS ? { cwd: projectPath, windowsHide: true } : { cwd: projectPath };
51
+ await execFileAsync('git', ['init', '-b', 'main'], opts);
52
+ await execFileAsync('git', [
53
+ '-c',
54
+ 'user.name=Shep',
55
+ '-c',
56
+ 'user.email=shep@local',
57
+ 'commit',
58
+ '--allow-empty',
59
+ '-m',
60
+ 'Initial commit',
61
+ ], opts);
62
+ }
63
+ catch (err) {
64
+ // eslint-disable-next-line no-console -- adapter: surface git init failures in dev logs
65
+ console.warn('[FsProjectScaffoldService] git init failed:', err);
66
+ }
67
+ // Normalise to forward slashes per the cross-platform path rule.
68
+ return { path: projectPath.replace(/\\/g, '/') };
69
+ }
70
+ };
71
+ FsProjectScaffoldService = __decorate([
72
+ injectable()
73
+ ], FsProjectScaffoldService);
74
+ export { FsProjectScaffoldService };
@@ -1,3 +1,8 @@
1
+ /**
2
+ * Result shape for the agent auth checklist on the onboarding empty state.
3
+ * Matches CheckAgentAuthResult from the use case 1:1 — kept locally so the
4
+ * web type stays serializable through the Server Actions boundary.
5
+ */
1
6
  export interface AgentAuthStatus {
2
7
  agentType: string;
3
8
  /** Whether the CLI tool binary is installed */
@@ -14,8 +19,11 @@ export interface AgentAuthStatus {
14
19
  authCommand: string | null;
15
20
  }
16
21
  /**
17
- * Check agent tool installation + auth status.
18
- * Uses two-tier detection: instant file/env check, then optional subprocess verify.
22
+ * Thin server-action wrapper around CheckAgentAuthUseCase. All agent-type
23
+ * mapping, tool lookup, and platform credential detection live in:
24
+ *
25
+ * packages/core/src/application/use-cases/agents/check-agent-auth.use-case.ts
26
+ * packages/core/src/infrastructure/services/agent-auth-detector/platform-agent-auth-detector.service.ts
19
27
  */
20
28
  export declare function checkAgentAuth(): Promise<AgentAuthStatus>;
21
29
  //# sourceMappingURL=check-agent-auth.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"check-agent-auth.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/web/app/actions/check-agent-auth.ts"],"names":[],"mappings":"AAWA,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,+CAA+C;IAC/C,SAAS,EAAE,OAAO,CAAC;IACnB,8CAA8C;IAC9C,aAAa,EAAE,OAAO,CAAC;IACvB,yCAAyC;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,gDAAgD;IAChD,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,0FAA0F;IAC1F,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,wDAAwD;IACxD,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AA6GD;;;GAGG;AACH,wBAAsB,cAAc,IAAI,OAAO,CAAC,eAAe,CAAC,CAwF/D"}
1
+ {"version":3,"file":"check-agent-auth.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/web/app/actions/check-agent-auth.ts"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,+CAA+C;IAC/C,SAAS,EAAE,OAAO,CAAC;IACnB,8CAA8C;IAC9C,aAAa,EAAE,OAAO,CAAC;IACvB,yCAAyC;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,gDAAgD;IAChD,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,0FAA0F;IAC1F,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,wDAAwD;IACxD,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED;;;;;;GAMG;AACH,wBAAsB,cAAc,IAAI,OAAO,CAAC,eAAe,CAAC,CAG/D"}