@shepai/cli 1.24.0 → 1.26.0

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 (209) hide show
  1. package/dist/packages/core/src/application/use-cases/features/create/metadata-generator.d.ts.map +1 -1
  2. package/dist/packages/core/src/application/use-cases/features/create/metadata-generator.js +3 -0
  3. package/dist/packages/core/src/infrastructure/di/populate-use-cases-bridge.d.ts.map +1 -1
  4. package/dist/packages/core/src/infrastructure/di/populate-use-cases-bridge.js +2 -0
  5. package/dist/packages/core/src/infrastructure/di/use-cases-bridge.d.ts +9 -1
  6. package/dist/packages/core/src/infrastructure/di/use-cases-bridge.d.ts.map +1 -1
  7. package/dist/packages/core/src/infrastructure/di/use-cases-bridge.js +17 -1
  8. package/dist/packages/core/src/infrastructure/services/ide-launchers/antigravity.launcher.d.ts.map +1 -1
  9. package/dist/packages/core/src/infrastructure/services/ide-launchers/compute-worktree-path.d.ts +17 -0
  10. package/dist/packages/core/src/infrastructure/services/ide-launchers/compute-worktree-path.d.ts.map +1 -0
  11. package/dist/packages/core/src/infrastructure/services/ide-launchers/compute-worktree-path.js +24 -0
  12. package/dist/packages/core/src/infrastructure/services/ide-launchers/cursor.launcher.d.ts.map +1 -1
  13. package/dist/packages/core/src/infrastructure/services/ide-launchers/ide-launcher.interface.d.ts.map +1 -1
  14. package/dist/packages/core/src/infrastructure/services/ide-launchers/ide-launcher.registry.d.ts.map +1 -1
  15. package/dist/packages/core/src/infrastructure/services/ide-launchers/launch-ide.d.ts +30 -0
  16. package/dist/packages/core/src/infrastructure/services/ide-launchers/launch-ide.d.ts.map +1 -0
  17. package/dist/packages/core/src/infrastructure/services/ide-launchers/launch-ide.js +41 -0
  18. package/dist/packages/core/src/infrastructure/services/ide-launchers/vscode.launcher.d.ts.map +1 -1
  19. package/dist/packages/core/src/infrastructure/services/ide-launchers/windsurf.launcher.d.ts.map +1 -1
  20. package/dist/packages/core/src/infrastructure/services/ide-launchers/zed.launcher.d.ts.map +1 -1
  21. package/dist/packages/core/src/infrastructure/services/settings.service.d.ts +3 -1
  22. package/dist/packages/core/src/infrastructure/services/settings.service.d.ts.map +1 -1
  23. package/dist/packages/core/src/infrastructure/services/settings.service.js +27 -12
  24. package/dist/src/presentation/cli/commands/agent/show.command.d.ts.map +1 -1
  25. package/dist/src/presentation/cli/commands/agent/show.command.js +1 -8
  26. package/dist/src/presentation/cli/commands/feat/show.command.d.ts.map +1 -1
  27. package/dist/src/presentation/cli/commands/feat/show.command.js +1 -8
  28. package/dist/src/presentation/cli/commands/ide-open.command.d.ts.map +1 -1
  29. package/dist/src/presentation/cli/commands/ide-open.command.js +11 -21
  30. package/dist/src/presentation/web/app/api/features/create/route.d.ts +5 -0
  31. package/dist/src/presentation/web/app/api/features/create/route.d.ts.map +1 -0
  32. package/dist/src/presentation/web/app/api/features/create/route.js +32 -0
  33. package/dist/src/presentation/web/app/api/ide/open/route.d.ts +9 -0
  34. package/dist/src/presentation/web/app/api/ide/open/route.d.ts.map +1 -0
  35. package/dist/src/presentation/web/app/api/ide/open/route.js +29 -0
  36. package/dist/src/presentation/web/app/api/shell/open/route.d.ts +9 -0
  37. package/dist/src/presentation/web/app/api/shell/open/route.d.ts.map +1 -0
  38. package/dist/src/presentation/web/app/api/shell/open/route.js +51 -0
  39. package/dist/src/presentation/web/app/api/validate-toolbar-input.d.ts +17 -0
  40. package/dist/src/presentation/web/app/api/validate-toolbar-input.d.ts.map +1 -0
  41. package/dist/src/presentation/web/app/api/validate-toolbar-input.js +25 -0
  42. package/dist/src/presentation/web/app/layout.d.ts.map +1 -1
  43. package/dist/src/presentation/web/app/layout.js +2 -1
  44. package/dist/src/presentation/web/app/page.d.ts.map +1 -1
  45. package/dist/src/presentation/web/app/page.js +2 -0
  46. package/dist/src/presentation/web/components/common/feature-drawer/feature-drawer.d.ts.map +1 -1
  47. package/dist/src/presentation/web/components/common/feature-drawer/feature-drawer.js +11 -2
  48. package/dist/src/presentation/web/components/common/feature-drawer/feature-drawer.stories.d.ts +8 -0
  49. package/dist/src/presentation/web/components/common/feature-drawer/feature-drawer.stories.d.ts.map +1 -1
  50. package/dist/src/presentation/web/components/common/feature-drawer/feature-drawer.stories.js +31 -0
  51. package/dist/src/presentation/web/components/common/feature-drawer/use-feature-actions.d.ts +14 -0
  52. package/dist/src/presentation/web/components/common/feature-drawer/use-feature-actions.d.ts.map +1 -0
  53. package/dist/src/presentation/web/components/common/feature-drawer/use-feature-actions.js +58 -0
  54. package/dist/src/presentation/web/components/common/feature-node/feature-node-state-config.d.ts +4 -0
  55. package/dist/src/presentation/web/components/common/feature-node/feature-node-state-config.d.ts.map +1 -1
  56. package/dist/src/presentation/web/components/common/feature-node/feature-node.stories.d.ts.map +1 -1
  57. package/dist/src/presentation/web/components/common/feature-node/feature-node.stories.js +18 -0
  58. package/dist/src/presentation/web/components/common/index.d.ts +1 -0
  59. package/dist/src/presentation/web/components/common/index.d.ts.map +1 -1
  60. package/dist/src/presentation/web/components/common/index.js +1 -0
  61. package/dist/src/presentation/web/components/features/control-center/control-center-inner.d.ts.map +1 -1
  62. package/dist/src/presentation/web/components/features/control-center/control-center-inner.js +2 -2
  63. package/dist/src/presentation/web/components/features/control-center/control-center.stories.d.ts.map +1 -1
  64. package/dist/src/presentation/web/components/features/control-center/control-center.stories.js +16 -0
  65. package/dist/src/presentation/web/components/features/control-center/use-control-center-state.d.ts +1 -0
  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 +47 -9
  68. package/dist/src/presentation/web/components/features/features-canvas/features-canvas.stories.d.ts.map +1 -1
  69. package/dist/src/presentation/web/components/features/features-canvas/features-canvas.stories.js +44 -0
  70. package/dist/src/presentation/web/dev-server.js +17 -4
  71. package/dist/tsconfig.build.tsbuildinfo +1 -1
  72. package/package.json +1 -1
  73. package/web/.next/BUILD_ID +1 -1
  74. package/web/.next/app-path-routes-manifest.json +3 -0
  75. package/web/.next/build-manifest.json +2 -2
  76. package/web/.next/cache/.previewinfo +1 -1
  77. package/web/.next/cache/.rscinfo +1 -1
  78. package/web/.next/cache/.tsbuildinfo +1 -1
  79. package/web/.next/cache/config.json +3 -3
  80. package/web/.next/fallback-build-manifest.json +2 -2
  81. package/web/.next/prerender-manifest.json +3 -3
  82. package/web/.next/required-server-files.js +1 -1
  83. package/web/.next/required-server-files.json +1 -1
  84. package/web/.next/routes-manifest.json +18 -0
  85. package/web/.next/server/app/_global-error/page.js +1 -1
  86. package/web/.next/server/app/_global-error/page.js.nft.json +1 -1
  87. package/web/.next/server/app/_global-error.html +2 -2
  88. package/web/.next/server/app/_global-error.rsc +1 -1
  89. package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  90. package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  91. package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  92. package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  93. package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  94. package/web/.next/server/app/_not-found/page.js +2 -2
  95. package/web/.next/server/app/_not-found/page.js.nft.json +1 -1
  96. package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  97. package/web/.next/server/app/_not-found.html +2 -2
  98. package/web/.next/server/app/_not-found.rsc +14 -13
  99. package/web/.next/server/app/_not-found.segments/_full.segment.rsc +14 -13
  100. package/web/.next/server/app/_not-found.segments/_head.segment.rsc +3 -3
  101. package/web/.next/server/app/_not-found.segments/_index.segment.rsc +6 -5
  102. package/web/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
  103. package/web/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
  104. package/web/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  105. package/web/.next/server/app/api/dialog/pick-files/route.js +2 -2
  106. package/web/.next/server/app/api/dialog/pick-files/route.js.nft.json +1 -1
  107. package/web/.next/server/app/api/dialog/pick-folder/route.js +2 -2
  108. package/web/.next/server/app/api/dialog/pick-folder/route.js.nft.json +1 -1
  109. package/web/.next/server/app/api/features/create/route/app-paths-manifest.json +3 -0
  110. package/web/.next/server/app/api/features/create/route/build-manifest.json +11 -0
  111. package/web/.next/server/app/api/features/create/route/server-reference-manifest.json +4 -0
  112. package/web/.next/server/app/api/features/create/route.js +6 -0
  113. package/web/.next/server/app/api/features/create/route.js.map +5 -0
  114. package/web/.next/server/app/api/features/create/route.js.nft.json +1 -0
  115. package/web/.next/server/app/api/features/create/route_client-reference-manifest.js +2 -0
  116. package/web/.next/server/app/api/ide/open/route/app-paths-manifest.json +3 -0
  117. package/web/.next/server/app/api/ide/open/route/build-manifest.json +11 -0
  118. package/web/.next/server/app/api/ide/open/route/server-reference-manifest.json +4 -0
  119. package/web/.next/server/app/api/ide/open/route.js +6 -0
  120. package/web/.next/server/app/api/ide/open/route.js.map +5 -0
  121. package/web/.next/server/app/api/ide/open/route.js.nft.json +1 -0
  122. package/web/.next/server/app/api/ide/open/route_client-reference-manifest.js +2 -0
  123. package/web/.next/server/app/api/shell/open/route/app-paths-manifest.json +3 -0
  124. package/web/.next/server/app/api/shell/open/route/build-manifest.json +11 -0
  125. package/web/.next/server/app/api/shell/open/route/server-reference-manifest.json +4 -0
  126. package/web/.next/server/app/api/shell/open/route.js +6 -0
  127. package/web/.next/server/app/api/shell/open/route.js.map +5 -0
  128. package/web/.next/server/app/api/shell/open/route.js.nft.json +1 -0
  129. package/web/.next/server/app/api/shell/open/route_client-reference-manifest.js +2 -0
  130. package/web/.next/server/app/page.js +2 -2
  131. package/web/.next/server/app/page.js.nft.json +1 -1
  132. package/web/.next/server/app/page_client-reference-manifest.js +1 -1
  133. package/web/.next/server/app/version/page.js +2 -2
  134. package/web/.next/server/app/version/page.js.nft.json +1 -1
  135. package/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
  136. package/web/.next/server/app/version.html +2 -2
  137. package/web/.next/server/app/version.rsc +13 -12
  138. package/web/.next/server/app/version.segments/_full.segment.rsc +13 -12
  139. package/web/.next/server/app/version.segments/_head.segment.rsc +1 -1
  140. package/web/.next/server/app/version.segments/_index.segment.rsc +4 -3
  141. package/web/.next/server/app/version.segments/_tree.segment.rsc +2 -2
  142. package/web/.next/server/app/version.segments/version/__PAGE__.segment.rsc +2 -2
  143. package/web/.next/server/app/version.segments/version.segment.rsc +1 -1
  144. package/web/.next/server/app-paths-manifest.json +3 -0
  145. package/web/.next/server/chunks/744ca_web__next-internal_server_app_api_features_create_route_actions_de49a114.js +3 -0
  146. package/web/.next/server/chunks/744ca_web__next-internal_server_app_api_features_create_route_actions_de49a114.js.map +1 -0
  147. package/web/.next/server/chunks/744ca_web__next-internal_server_app_api_shell_open_route_actions_814dc5b6.js +3 -0
  148. package/web/.next/server/chunks/744ca_web__next-internal_server_app_api_shell_open_route_actions_814dc5b6.js.map +1 -0
  149. package/web/.next/server/chunks/[root-of-the-server]__1913013c._.js +3 -0
  150. package/web/.next/server/chunks/{[root-of-the-server]__95785ac7._.js.map → [root-of-the-server]__1913013c._.js.map} +1 -1
  151. package/web/.next/server/chunks/[root-of-the-server]__56ac1509._.js +3 -0
  152. package/web/.next/server/chunks/[root-of-the-server]__56ac1509._.js.map +1 -0
  153. package/web/.next/server/chunks/[root-of-the-server]__602cce1b._.js +3 -0
  154. package/web/.next/server/chunks/[root-of-the-server]__602cce1b._.js.map +1 -0
  155. package/web/.next/server/chunks/{[root-of-the-server]__00833626._.js → [root-of-the-server]__ba6c5641._.js} +2 -2
  156. package/web/.next/server/chunks/{[root-of-the-server]__00833626._.js.map → [root-of-the-server]__ba6c5641._.js.map} +1 -1
  157. package/web/.next/server/chunks/{[root-of-the-server]__22cabd43._.js → [root-of-the-server]__bb4fc5b5._.js} +3 -3
  158. package/web/.next/server/chunks/{[root-of-the-server]__22cabd43._.js.map → [root-of-the-server]__bb4fc5b5._.js.map} +1 -1
  159. package/web/.next/server/chunks/[root-of-the-server]__eaa478b7._.js +8 -0
  160. package/web/.next/server/chunks/[root-of-the-server]__eaa478b7._.js.map +1 -0
  161. package/web/.next/server/chunks/b1a17_presentation_web__next-internal_server_app_api_ide_open_route_actions_9fe6e1cd.js +3 -0
  162. package/web/.next/server/chunks/b1a17_presentation_web__next-internal_server_app_api_ide_open_route_actions_9fe6e1cd.js.map +1 -0
  163. package/web/.next/server/chunks/ssr/[root-of-the-server]__97377864._.js +3 -0
  164. package/web/.next/server/chunks/ssr/[root-of-the-server]__a21ef212._.js +3 -0
  165. package/web/.next/server/chunks/ssr/[root-of-the-server]__a21ef212._.js.map +1 -0
  166. package/web/.next/server/chunks/ssr/[root-of-the-server]__f12b60be._.js +1 -1
  167. package/web/.next/server/chunks/ssr/[root-of-the-server]__f285e474._.js +3 -0
  168. package/web/.next/server/chunks/ssr/_09afa42a._.js +1 -1
  169. package/web/.next/server/chunks/ssr/_09afa42a._.js.map +1 -1
  170. package/web/.next/server/chunks/ssr/_1c3962d7._.js +10 -0
  171. package/web/.next/server/chunks/ssr/_1c3962d7._.js.map +1 -0
  172. package/web/.next/server/chunks/ssr/src_presentation_web_67178b88._.js +13 -0
  173. package/web/.next/server/chunks/ssr/src_presentation_web_67178b88._.js.map +1 -0
  174. package/web/.next/server/chunks/ssr/src_presentation_web_components_e599bb8c._.js +3 -0
  175. package/web/.next/server/chunks/ssr/src_presentation_web_components_e599bb8c._.js.map +1 -0
  176. package/web/.next/server/chunks/ssr/src_presentation_web_ed0934e5._.js +1 -1
  177. package/web/.next/server/chunks/ssr/src_presentation_web_ed0934e5._.js.map +1 -1
  178. package/web/.next/server/pages/404.html +2 -2
  179. package/web/.next/server/pages/500.html +2 -2
  180. package/web/.next/server/server-reference-manifest.js +1 -1
  181. package/web/.next/server/server-reference-manifest.json +1 -1
  182. package/web/.next/static/chunks/78ef4acb26e4d6ea.js +1 -0
  183. package/web/.next/static/chunks/79009d1ca0d944d2.js +5 -0
  184. package/web/.next/static/chunks/86ff2b6444e06e88.css +2 -0
  185. package/web/.next/static/chunks/{f6b5484377f4e78e.js → c2854b6c6d0ca1f3.js} +2 -2
  186. package/web/.next/trace +1 -1
  187. package/web/.next/trace-build +1 -1
  188. package/web/.next/types/link.d.ts +3 -0
  189. package/web/.next/types/routes.d.ts +4 -1
  190. package/web/.next/types/validator.ts +27 -0
  191. package/web/.next/server/chunks/[root-of-the-server]__95785ac7._.js +0 -3
  192. package/web/.next/server/chunks/ssr/[root-of-the-server]__757c7912._.js +0 -3
  193. package/web/.next/server/chunks/ssr/[root-of-the-server]__7c64f85c._.js +0 -3
  194. package/web/.next/server/chunks/ssr/[root-of-the-server]__7c64f85c._.js.map +0 -1
  195. package/web/.next/server/chunks/ssr/[root-of-the-server]__dbd220d2._.js +0 -3
  196. package/web/.next/server/chunks/ssr/_1f9347c8._.js +0 -7
  197. package/web/.next/server/chunks/ssr/_1f9347c8._.js.map +0 -1
  198. package/web/.next/server/chunks/ssr/_a0c04017._.js +0 -6
  199. package/web/.next/server/chunks/ssr/_a0c04017._.js.map +0 -1
  200. package/web/.next/server/chunks/ssr/src_presentation_web_372075f9._.js +0 -13
  201. package/web/.next/server/chunks/ssr/src_presentation_web_372075f9._.js.map +0 -1
  202. package/web/.next/static/chunks/74748b4d725c5c74.css +0 -2
  203. package/web/.next/static/chunks/8bc34062bc0f4ddc.js +0 -1
  204. package/web/.next/static/chunks/f5099c5888ef9a74.js +0 -5
  205. /package/web/.next/server/chunks/ssr/{[root-of-the-server]__757c7912._.js.map → [root-of-the-server]__97377864._.js.map} +0 -0
  206. /package/web/.next/server/chunks/ssr/{[root-of-the-server]__dbd220d2._.js.map → [root-of-the-server]__f285e474._.js.map} +0 -0
  207. /package/web/.next/static/{LOfelu4nKYgB7PB1XlRqc → _6j6GS-S6zPiASj5tsxJ8}/_buildManifest.js +0 -0
  208. /package/web/.next/static/{LOfelu4nKYgB7PB1XlRqc → _6j6GS-S6zPiASj5tsxJ8}/_clientMiddlewareManifest.json +0 -0
  209. /package/web/.next/static/{LOfelu4nKYgB7PB1XlRqc → _6j6GS-S6zPiASj5tsxJ8}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"metadata-generator.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/core/src/application/use-cases/features/create/metadata-generator.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mEAAmE,CAAC;AAChH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAKlD,qBACa,iBAAiB;IAG1B,OAAO,CAAC,QAAQ,CAAC,gBAAgB;gBAAhB,gBAAgB,EAAE,sBAAsB;IAG3D;;;OAGG;IACG,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;IAyCnE;;OAEG;IACH,OAAO,CAAC,cAAc;IAgBtB;;;OAGG;IACH,OAAO,CAAC,MAAM;CAgBf"}
1
+ {"version":3,"file":"metadata-generator.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/core/src/application/use-cases/features/create/metadata-generator.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mEAAmE,CAAC;AAChH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAKlD,qBACa,iBAAiB;IAG1B,OAAO,CAAC,QAAQ,CAAC,gBAAgB;gBAAhB,gBAAgB,EAAE,sBAAsB;IAG3D;;;OAGG;IACG,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;IA4CnE;;OAEG;IACH,OAAO,CAAC,cAAc;IAgBtB;;;OAGG;IACH,OAAO,CAAC,MAAM;CAgBf"}
@@ -53,6 +53,9 @@ JSON only, no markdown fences.`;
53
53
  silent: true,
54
54
  });
55
55
  const cleaned = this.stripCodeFence(result.result);
56
+ if (!cleaned) {
57
+ throw new Error('AI returned empty response for metadata generation');
58
+ }
56
59
  const parsed = JSON.parse(cleaned);
57
60
  if (!parsed.slug || !parsed.name || !parsed.description) {
58
61
  throw new Error('Missing required fields in AI response');
@@ -1 +1 @@
1
- {"version":3,"file":"populate-use-cases-bridge.d.ts","sourceRoot":"","sources":["../../../../../../packages/core/src/infrastructure/di/populate-use-cases-bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAKpD;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,EAAE,mBAAmB,GAAG,IAAI,CAOnE"}
1
+ {"version":3,"file":"populate-use-cases-bridge.d.ts","sourceRoot":"","sources":["../../../../../../packages/core/src/infrastructure/di/populate-use-cases-bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAMpD;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,EAAE,mBAAmB,GAAG,IAAI,CAQnE"}
@@ -12,6 +12,7 @@
12
12
  * @see use-cases-bridge.ts for the reader side (web-safe).
13
13
  */
14
14
  import { ListFeaturesUseCase } from '../../application/use-cases/features/list-features.use-case.js';
15
+ import { CreateFeatureUseCase } from '../../application/use-cases/features/create/create-feature.use-case.js';
15
16
  import { SHEP_USE_CASES_KEY } from './use-cases-bridge.js';
16
17
  /**
17
18
  * Populate the globalThis bridge with resolved use cases from the DI container.
@@ -21,6 +22,7 @@ export function populateUseCasesBridge(c) {
21
22
  const bridge = {
22
23
  listFeatures: c.resolve(ListFeaturesUseCase),
23
24
  agentRunRepo: c.resolve('IAgentRunRepository'),
25
+ createFeature: c.resolve(CreateFeatureUseCase),
24
26
  };
25
27
  globalThis[SHEP_USE_CASES_KEY] = bridge;
26
28
  process[SHEP_USE_CASES_KEY] = bridge;
@@ -17,7 +17,8 @@
17
17
  */
18
18
  import type { Feature, AgentRun } from '../../domain/generated/output.js';
19
19
  import type { FeatureListFilters } from '../../application/ports/output/repositories/feature-repository.interface.js';
20
- export type { FeatureListFilters };
20
+ import type { CreateFeatureInput, CreateFeatureResult } from '../../application/use-cases/features/create/types.js';
21
+ export type { FeatureListFilters, CreateFeatureInput, CreateFeatureResult };
21
22
  /** The globalThis key shared between writer and reader. */
22
23
  export declare const SHEP_USE_CASES_KEY = "__shepUseCases";
23
24
  /**
@@ -31,4 +32,11 @@ export declare function getFeatures(filters?: FeatureListFilters): Promise<Featu
31
32
  * Returns null if the DI bridge is not initialized or the run is not found.
32
33
  */
33
34
  export declare function getAgentRun(id: string): Promise<AgentRun | null>;
35
+ /**
36
+ * Create a new feature via the DI-managed use case.
37
+ * Unlike getFeatures/getAgentRun, this function propagates errors so callers
38
+ * (API routes) can return proper HTTP error responses and surface messages to the user.
39
+ * Throws if the bridge is not initialized or the use case fails.
40
+ */
41
+ export declare function createFeature(input: CreateFeatureInput): Promise<CreateFeatureResult>;
34
42
  //# sourceMappingURL=use-cases-bridge.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-cases-bridge.d.ts","sourceRoot":"","sources":["../../../../../../packages/core/src/infrastructure/di/use-cases-bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6EAA6E,CAAC;AAEtH,YAAY,EAAE,kBAAkB,EAAE,CAAC;AAEnC,2DAA2D;AAC3D,eAAO,MAAM,kBAAkB,mBAAmB,CAAC;AAiCnD;;;;GAIG;AACH,wBAAsB,WAAW,CAAC,OAAO,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAWlF;AAED;;;GAGG;AACH,wBAAsB,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAStE"}
1
+ {"version":3,"file":"use-cases-bridge.d.ts","sourceRoot":"","sources":["../../../../../../packages/core/src/infrastructure/di/use-cases-bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6EAA6E,CAAC;AACtH,OAAO,KAAK,EACV,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,sDAAsD,CAAC;AAE9D,YAAY,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,CAAC;AAE5E,2DAA2D;AAC3D,eAAO,MAAM,kBAAkB,mBAAmB,CAAC;AAqCnD;;;;GAIG;AACH,wBAAsB,WAAW,CAAC,OAAO,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAWlF;AAED;;;GAGG;AACH,wBAAsB,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAStE;AAED;;;;;GAKG;AACH,wBAAsB,aAAa,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAO3F"}
@@ -23,10 +23,13 @@ function isShepUseCases(value) {
23
23
  const maybe = value;
24
24
  const listFeatures = maybe.listFeatures;
25
25
  const agentRunRepo = maybe.agentRunRepo;
26
+ const createFeature = maybe.createFeature;
26
27
  return (!!listFeatures &&
27
28
  typeof listFeatures.execute === 'function' &&
28
29
  !!agentRunRepo &&
29
- typeof agentRunRepo.findById === 'function');
30
+ typeof agentRunRepo.findById === 'function' &&
31
+ !!createFeature &&
32
+ typeof createFeature.execute === 'function');
30
33
  }
31
34
  function getUseCases() {
32
35
  const globalBridge = globalThis[SHEP_USE_CASES_KEY];
@@ -70,3 +73,16 @@ export async function getAgentRun(id) {
70
73
  return null;
71
74
  }
72
75
  }
76
+ /**
77
+ * Create a new feature via the DI-managed use case.
78
+ * Unlike getFeatures/getAgentRun, this function propagates errors so callers
79
+ * (API routes) can return proper HTTP error responses and surface messages to the user.
80
+ * Throws if the bridge is not initialized or the use case fails.
81
+ */
82
+ export async function createFeature(input) {
83
+ const useCases = getUseCases();
84
+ if (!useCases?.createFeature) {
85
+ throw new Error('Use-cases bridge is not initialized. Ensure the CLI process is running.');
86
+ }
87
+ return useCases.createFeature.execute(input);
88
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"antigravity.launcher.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/services/ide-launchers/antigravity.launcher.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAE5D,qBAAa,mBAAoB,YAAW,WAAW;IACrD,QAAQ,CAAC,IAAI,iBAAiB;IAC9B,QAAQ,CAAC,QAAQ,0BAA0B;IAC3C,QAAQ,CAAC,MAAM,iBAAiB;IAE1B,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAQzC,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC;CAOnC"}
1
+ {"version":3,"file":"antigravity.launcher.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/services/ide-launchers/antigravity.launcher.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAE5D,qBAAa,mBAAoB,YAAW,WAAW;IACrD,QAAQ,CAAC,IAAI,iBAAiB;IAC9B,QAAQ,CAAC,QAAQ,0BAA0B;IAC3C,QAAQ,CAAC,MAAM,iBAAiB;IAE1B,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAQzC,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC;CAOnC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Compute Worktree Path
3
+ *
4
+ * Pure utility that computes the filesystem path for a feature's git worktree
5
+ * given a repository path and branch name.
6
+ *
7
+ * Path format: ~/.shep/repos/<sha256-hash-prefix>/wt/<branch-slug>
8
+ */
9
+ /**
10
+ * Compute the worktree path for a given repository and branch.
11
+ *
12
+ * @param repoPath - Absolute path to the repository
13
+ * @param branch - Git branch name (slashes are replaced with hyphens)
14
+ * @returns Absolute path to the worktree directory under ~/.shep/repos/
15
+ */
16
+ export declare function computeWorktreePath(repoPath: string, branch: string): string;
17
+ //# sourceMappingURL=compute-worktree-path.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compute-worktree-path.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/services/ide-launchers/compute-worktree-path.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAQH;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAI5E"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Compute Worktree Path
3
+ *
4
+ * Pure utility that computes the filesystem path for a feature's git worktree
5
+ * given a repository path and branch name.
6
+ *
7
+ * Path format: ~/.shep/repos/<sha256-hash-prefix>/wt/<branch-slug>
8
+ */
9
+ import { createHash } from 'node:crypto';
10
+ import { homedir } from 'node:os';
11
+ import { join } from 'node:path';
12
+ const SHEP_HOME_DIR = join(homedir(), '.shep');
13
+ /**
14
+ * Compute the worktree path for a given repository and branch.
15
+ *
16
+ * @param repoPath - Absolute path to the repository
17
+ * @param branch - Git branch name (slashes are replaced with hyphens)
18
+ * @returns Absolute path to the worktree directory under ~/.shep/repos/
19
+ */
20
+ export function computeWorktreePath(repoPath, branch) {
21
+ const repoHash = createHash('sha256').update(repoPath).digest('hex').slice(0, 16);
22
+ const slug = branch.replace(/\//g, '-');
23
+ return join(SHEP_HOME_DIR, 'repos', repoHash, 'wt', slug);
24
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"cursor.launcher.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/services/ide-launchers/cursor.launcher.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAE5D,qBAAa,cAAe,YAAW,WAAW;IAChD,QAAQ,CAAC,IAAI,YAAY;IACzB,QAAQ,CAAC,QAAQ,qBAAqB;IACtC,QAAQ,CAAC,MAAM,YAAY;IAErB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAQzC,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC;CAOnC"}
1
+ {"version":3,"file":"cursor.launcher.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/services/ide-launchers/cursor.launcher.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAE5D,qBAAa,cAAe,YAAW,WAAW;IAChD,QAAQ,CAAC,IAAI,YAAY;IACzB,QAAQ,CAAC,QAAQ,qBAAqB;IACtC,QAAQ,CAAC,MAAM,YAAY;IAErB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAQzC,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC;CAOnC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ide-launcher.interface.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/services/ide-launchers/ide-launcher.interface.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AAEtE,MAAM,WAAW,WAAW;IAC1B,wDAAwD;IACxD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,4DAA4D;IAC5D,QAAQ,CAAC,QAAQ,EAAE,UAAU,CAAC;IAE9B,2DAA2D;IAC3D,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAExB;;;;;;OAMG;IACH,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEpC;;;;OAIG;IACH,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;CACpC"}
1
+ {"version":3,"file":"ide-launcher.interface.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/services/ide-launchers/ide-launcher.interface.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAEnE,MAAM,WAAW,WAAW;IAC1B,wDAAwD;IACxD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,4DAA4D;IAC5D,QAAQ,CAAC,QAAQ,EAAE,UAAU,CAAC;IAE9B,2DAA2D;IAC3D,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAExB;;;;;;OAMG;IACH,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEpC;;;;OAIG;IACH,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;CACpC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ide-launcher.registry.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/services/ide-launchers/ide-launcher.registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AACtE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAO/D;;;;GAIG;AACH,wBAAgB,sBAAsB,IAAI,GAAG,CAAC,UAAU,EAAE,WAAW,CAAC,CAcrE"}
1
+ {"version":3,"file":"ide-launcher.registry.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/services/ide-launchers/ide-launcher.registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAO5D;;;;GAIG;AACH,wBAAgB,sBAAsB,IAAI,GAAG,CAAC,UAAU,EAAE,WAAW,CAAC,CAcrE"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Shared IDE launch logic used by both CLI and Web presentation layers.
3
+ *
4
+ * Returns a discriminated union so callers can map errors to their own format
5
+ * (CLI messages vs HTTP status codes).
6
+ */
7
+ import type { EditorType } from '../../../domain/generated/output.js';
8
+ export interface LaunchIdeInput {
9
+ /** Which editor to launch. */
10
+ editorId: EditorType;
11
+ /** Absolute path to the repository root. */
12
+ repositoryPath: string;
13
+ /** Git branch name. */
14
+ branch: string;
15
+ /** Whether to verify binary availability before launching. Default: false. */
16
+ checkAvailability?: boolean;
17
+ }
18
+ export interface LaunchIdeSuccess {
19
+ ok: true;
20
+ editorName: string;
21
+ worktreePath: string;
22
+ }
23
+ export interface LaunchIdeFailed {
24
+ ok: false;
25
+ code: 'unknown_editor' | 'editor_unavailable' | 'launch_failed';
26
+ message: string;
27
+ }
28
+ export type LaunchIdeResult = LaunchIdeSuccess | LaunchIdeFailed;
29
+ export declare function launchIde(input: LaunchIdeInput): Promise<LaunchIdeResult>;
30
+ //# sourceMappingURL=launch-ide.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"launch-ide.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/services/ide-launchers/launch-ide.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAInE,MAAM,WAAW,cAAc;IAC7B,8BAA8B;IAC9B,QAAQ,EAAE,UAAU,CAAC;IACrB,4CAA4C;IAC5C,cAAc,EAAE,MAAM,CAAC;IACvB,uBAAuB;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,8EAA8E;IAC9E,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,IAAI,CAAC;IACT,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,KAAK,CAAC;IACV,IAAI,EAAE,gBAAgB,GAAG,oBAAoB,GAAG,eAAe,CAAC;IAChE,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,eAAe,GAAG,gBAAgB,GAAG,eAAe,CAAC;AAEjE,wBAAsB,SAAS,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,CAAC,eAAe,CAAC,CAkC/E"}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Shared IDE launch logic used by both CLI and Web presentation layers.
3
+ *
4
+ * Returns a discriminated union so callers can map errors to their own format
5
+ * (CLI messages vs HTTP status codes).
6
+ */
7
+ import { createLauncherRegistry } from './ide-launcher.registry.js';
8
+ import { computeWorktreePath } from './compute-worktree-path.js';
9
+ export async function launchIde(input) {
10
+ const registry = createLauncherRegistry();
11
+ const launcher = registry.get(input.editorId);
12
+ if (!launcher) {
13
+ return {
14
+ ok: false,
15
+ code: 'unknown_editor',
16
+ message: `No launcher found for editor: ${input.editorId}. Supported: ${[...registry.keys()].join(', ')}`,
17
+ };
18
+ }
19
+ if (input.checkAvailability) {
20
+ const available = await launcher.checkAvailable();
21
+ if (!available) {
22
+ return {
23
+ ok: false,
24
+ code: 'editor_unavailable',
25
+ message: `${launcher.name} is not available — ensure "${launcher.binary}" is installed and on your PATH`,
26
+ };
27
+ }
28
+ }
29
+ try {
30
+ const worktreePath = computeWorktreePath(input.repositoryPath, input.branch);
31
+ await launcher.launch(worktreePath);
32
+ return { ok: true, editorName: launcher.name, worktreePath };
33
+ }
34
+ catch (error) {
35
+ return {
36
+ ok: false,
37
+ code: 'launch_failed',
38
+ message: error instanceof Error ? error.message : 'Failed to launch IDE',
39
+ };
40
+ }
41
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"vscode.launcher.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/services/ide-launchers/vscode.launcher.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAE5D,qBAAa,cAAe,YAAW,WAAW;IAChD,QAAQ,CAAC,IAAI,aAAa;IAC1B,QAAQ,CAAC,QAAQ,qBAAqB;IACtC,QAAQ,CAAC,MAAM,UAAU;IAEnB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAQzC,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC;CAOnC"}
1
+ {"version":3,"file":"vscode.launcher.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/services/ide-launchers/vscode.launcher.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAE5D,qBAAa,cAAe,YAAW,WAAW;IAChD,QAAQ,CAAC,IAAI,aAAa;IAC1B,QAAQ,CAAC,QAAQ,qBAAqB;IACtC,QAAQ,CAAC,MAAM,UAAU;IAEnB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAQzC,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC;CAOnC"}
@@ -1 +1 @@
1
- {"version":3,"file":"windsurf.launcher.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/services/ide-launchers/windsurf.launcher.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAE5D,qBAAa,gBAAiB,YAAW,WAAW;IAClD,QAAQ,CAAC,IAAI,cAAc;IAC3B,QAAQ,CAAC,QAAQ,uBAAuB;IACxC,QAAQ,CAAC,MAAM,cAAc;IAEvB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAQzC,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC;CAOnC"}
1
+ {"version":3,"file":"windsurf.launcher.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/services/ide-launchers/windsurf.launcher.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAE5D,qBAAa,gBAAiB,YAAW,WAAW;IAClD,QAAQ,CAAC,IAAI,cAAc;IAC3B,QAAQ,CAAC,QAAQ,uBAAuB;IACxC,QAAQ,CAAC,MAAM,cAAc;IAEvB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAQzC,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC;CAOnC"}
@@ -1 +1 @@
1
- {"version":3,"file":"zed.launcher.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/services/ide-launchers/zed.launcher.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAE5D,qBAAa,WAAY,YAAW,WAAW;IAC7C,QAAQ,CAAC,IAAI,SAAS;IACtB,QAAQ,CAAC,QAAQ,kBAAkB;IACnC,QAAQ,CAAC,MAAM,SAAS;IAElB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAQzC,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC;CAOnC"}
1
+ {"version":3,"file":"zed.launcher.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/services/ide-launchers/zed.launcher.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAE5D,qBAAa,WAAY,YAAW,WAAW;IAC7C,QAAQ,CAAC,IAAI,SAAS;IACtB,QAAQ,CAAC,QAAQ,kBAAkB;IACnC,QAAQ,CAAC,MAAM,SAAS;IAElB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAQzC,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC;CAOnC"}
@@ -2,7 +2,9 @@
2
2
  * Settings Service
3
3
  *
4
4
  * Provides global access to application settings within the CLI.
5
- * Implements singleton pattern for consistent settings access.
5
+ * Uses globalThis/process storage so the singleton survives Turbopack
6
+ * module re-evaluations in Next.js API routes (same pattern as the
7
+ * use-cases bridge in di/use-cases-bridge.ts).
6
8
  *
7
9
  * Usage:
8
10
  * ```typescript
@@ -1 +1 @@
1
- {"version":3,"file":"settings.service.d.ts","sourceRoot":"","sources":["../../../../../../packages/core/src/infrastructure/services/settings.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAQjE;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAM3D;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,IAAI,QAAQ,CAMtC;AAED;;;;GAIG;AACH,wBAAgB,WAAW,IAAI,OAAO,CAErC;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,IAAI,IAAI,CAEpC"}
1
+ {"version":3,"file":"settings.service.d.ts","sourceRoot":"","sources":["../../../../../../packages/core/src/infrastructure/services/settings.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAsBjE;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAM3D;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,IAAI,QAAQ,CAOtC;AAED;;;;GAIG;AACH,wBAAgB,WAAW,IAAI,OAAO,CAErC;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,IAAI,IAAI,CAEpC"}
@@ -2,7 +2,9 @@
2
2
  * Settings Service
3
3
  *
4
4
  * Provides global access to application settings within the CLI.
5
- * Implements singleton pattern for consistent settings access.
5
+ * Uses globalThis/process storage so the singleton survives Turbopack
6
+ * module re-evaluations in Next.js API routes (same pattern as the
7
+ * use-cases bridge in di/use-cases-bridge.ts).
6
8
  *
7
9
  * Usage:
8
10
  * ```typescript
@@ -12,11 +14,23 @@
12
14
  * console.log(settings.models.analyze); // 'claude-opus-4'
13
15
  * ```
14
16
  */
15
- /**
16
- * Singleton settings instance.
17
- * Set during CLI initialization, accessed throughout application lifecycle.
18
- */
19
- let settingsInstance = null;
17
+ /** The globalThis / process key for the settings singleton. */
18
+ const SHEP_SETTINGS_KEY = '__shepSettings';
19
+ /** Read the settings instance from globalThis, falling back to process. */
20
+ function readSettings() {
21
+ const fromGlobal = globalThis[SHEP_SETTINGS_KEY];
22
+ if (fromGlobal != null)
23
+ return fromGlobal;
24
+ const fromProcess = process[SHEP_SETTINGS_KEY];
25
+ if (fromProcess != null)
26
+ return fromProcess;
27
+ return null;
28
+ }
29
+ /** Write the settings instance to both globalThis and process. */
30
+ function writeSettings(value) {
31
+ globalThis[SHEP_SETTINGS_KEY] = value;
32
+ process[SHEP_SETTINGS_KEY] = value;
33
+ }
20
34
  /**
21
35
  * Initialize the settings service with loaded settings.
22
36
  * Must be called once during CLI bootstrap.
@@ -25,10 +39,10 @@ let settingsInstance = null;
25
39
  * @throws Error if settings are already initialized
26
40
  */
27
41
  export function initializeSettings(settings) {
28
- if (settingsInstance !== null) {
42
+ if (readSettings() !== null) {
29
43
  throw new Error('Settings already initialized. Cannot re-initialize.');
30
44
  }
31
- settingsInstance = settings;
45
+ writeSettings(settings);
32
46
  }
33
47
  /**
34
48
  * Get the current application settings.
@@ -43,10 +57,11 @@ export function initializeSettings(settings) {
43
57
  * ```
44
58
  */
45
59
  export function getSettings() {
46
- if (settingsInstance === null) {
60
+ const instance = readSettings();
61
+ if (instance === null) {
47
62
  throw new Error('Settings not initialized. Call initializeSettings() during CLI bootstrap.');
48
63
  }
49
- return settingsInstance;
64
+ return instance;
50
65
  }
51
66
  /**
52
67
  * Check if settings have been initialized.
@@ -54,7 +69,7 @@ export function getSettings() {
54
69
  * @returns True if settings are initialized, false otherwise
55
70
  */
56
71
  export function hasSettings() {
57
- return settingsInstance !== null;
72
+ return readSettings() !== null;
58
73
  }
59
74
  /**
60
75
  * Reset settings instance (for testing purposes only).
@@ -63,5 +78,5 @@ export function hasSettings() {
63
78
  * @internal
64
79
  */
65
80
  export function resetSettings() {
66
- settingsInstance = null;
81
+ writeSettings(null);
67
82
  }
@@ -1 +1 @@
1
- {"version":3,"file":"show.command.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/cli/commands/agent/show.command.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAyBpC,wBAAgB,iBAAiB,IAAI,OAAO,CAoG3C"}
1
+ {"version":3,"file":"show.command.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/cli/commands/agent/show.command.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAiBpC,wBAAgB,iBAAiB,IAAI,OAAO,CAoG3C"}
@@ -8,17 +8,10 @@
8
8
  * shep agent show <id>
9
9
  */
10
10
  import { Command } from 'commander';
11
- import { createHash } from 'node:crypto';
12
- import { join } from 'node:path';
13
11
  import { colors, messages, symbols, renderDetailView } from '../../ui/index.js';
14
12
  import { resolveAgentRun } from './resolve-run.js';
15
13
  import { container } from '../../../../../packages/core/src/infrastructure/di/container.js';
16
- import { SHEP_HOME_DIR } from '../../../../../packages/core/src/infrastructure/services/filesystem/shep-directory.service.js';
17
- function computeWorktreePath(repoPath, branch) {
18
- const repoHash = createHash('sha256').update(repoPath).digest('hex').slice(0, 16);
19
- const slug = branch.replace(/\//g, '-');
20
- return join(SHEP_HOME_DIR, 'repos', repoHash, 'wt', slug);
21
- }
14
+ import { computeWorktreePath } from '../../../../../packages/core/src/infrastructure/services/ide-launchers/compute-worktree-path.js';
22
15
  function isProcessAlive(pid) {
23
16
  try {
24
17
  process.kill(pid, 0);
@@ -1 +1 @@
1
- {"version":3,"file":"show.command.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/cli/commands/feat/show.command.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAuEpC,wBAAgB,iBAAiB,IAAI,OAAO,CA4I3C"}
1
+ {"version":3,"file":"show.command.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/cli/commands/feat/show.command.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA+DpC,wBAAgB,iBAAiB,IAAI,OAAO,CA4I3C"}
@@ -7,17 +7,10 @@
7
7
  * Usage: shep feat show <id>
8
8
  */
9
9
  import { Command } from 'commander';
10
- import { createHash } from 'node:crypto';
11
- import { join } from 'node:path';
12
10
  import { container } from '../../../../../packages/core/src/infrastructure/di/container.js';
13
11
  import { ShowFeatureUseCase } from '../../../../../packages/core/src/application/use-cases/features/show-feature.use-case.js';
14
12
  import { colors, symbols, messages, renderDetailView } from '../../ui/index.js';
15
- import { SHEP_HOME_DIR } from '../../../../../packages/core/src/infrastructure/services/filesystem/shep-directory.service.js';
16
- function computeWorktreePath(repoPath, branch) {
17
- const repoHash = createHash('sha256').update(repoPath).digest('hex').slice(0, 16);
18
- const slug = branch.replace(/\//g, '-');
19
- return join(SHEP_HOME_DIR, 'repos', repoHash, 'wt', slug);
20
- }
13
+ import { computeWorktreePath } from '../../../../../packages/core/src/infrastructure/services/ide-launchers/compute-worktree-path.js';
21
14
  /** Map graph node names to human-readable phase labels (active). */
22
15
  const NODE_TO_PHASE = {
23
16
  analyze: 'Analyzing',
@@ -1 +1 @@
1
- {"version":3,"file":"ide-open.command.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/cli/commands/ide-open.command.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA+CpC,wBAAgB,oBAAoB,IAAI,OAAO,CAwC9C"}
1
+ {"version":3,"file":"ide-open.command.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/cli/commands/ide-open.command.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAsCpC,wBAAgB,oBAAoB,IAAI,OAAO,CAkC9C"}
@@ -6,20 +6,12 @@
6
6
  * Usage: shep ide <feat-id> [--vscode|--cursor|--windsurf|--zed|--antigravity]
7
7
  */
8
8
  import { Command } from 'commander';
9
- import { createHash } from 'node:crypto';
10
- import { join } from 'node:path';
11
9
  import { EditorType } from '../../../../packages/core/src/domain/generated/output.js';
12
10
  import { container } from '../../../../packages/core/src/infrastructure/di/container.js';
13
11
  import { ShowFeatureUseCase } from '../../../../packages/core/src/application/use-cases/features/show-feature.use-case.js';
14
12
  import { getSettings } from '../../../../packages/core/src/infrastructure/services/settings.service.js';
15
- import { createLauncherRegistry } from '../../../../packages/core/src/infrastructure/services/ide-launchers/ide-launcher.registry.js';
16
- import { SHEP_HOME_DIR } from '../../../../packages/core/src/infrastructure/services/filesystem/shep-directory.service.js';
13
+ import { launchIde } from '../../../../packages/core/src/infrastructure/services/ide-launchers/launch-ide.js';
17
14
  import { messages } from '../ui/index.js';
18
- function computeWorktreePath(repoPath, branch) {
19
- const repoHash = createHash('sha256').update(repoPath).digest('hex').slice(0, 16);
20
- const slug = branch.replace(/\//g, '-');
21
- return join(SHEP_HOME_DIR, 'repos', repoHash, 'wt', slug);
22
- }
23
15
  /** IDE flag names mapped to their EditorType values. */
24
16
  const IDE_FLAG_MAP = {
25
17
  vscode: EditorType.VsCode,
@@ -51,22 +43,20 @@ export function createIdeOpenCommand() {
51
43
  .option('--antigravity', 'Open in Antigravity')
52
44
  .action(async (featId, options) => {
53
45
  try {
54
- // Resolve the editor
55
46
  const editorId = resolveEditorId(options);
56
- const registry = createLauncherRegistry();
57
- const launcher = registry.get(editorId);
58
- if (!launcher) {
59
- messages.error(`Unknown editor "${editorId}". Supported: ${[...registry.keys()].join(', ')}`, new Error(`Unknown editor: ${editorId}`));
47
+ const useCase = container.resolve(ShowFeatureUseCase);
48
+ const feature = await useCase.execute(featId);
49
+ const result = await launchIde({
50
+ editorId,
51
+ repositoryPath: feature.repositoryPath,
52
+ branch: feature.branch,
53
+ });
54
+ if (!result.ok) {
55
+ messages.error(result.message, new Error(result.message));
60
56
  process.exitCode = 1;
61
57
  return;
62
58
  }
63
- // Resolve the feature
64
- const useCase = container.resolve(ShowFeatureUseCase);
65
- const feature = await useCase.execute(featId);
66
- // Compute worktree path and launch
67
- const worktreePath = computeWorktreePath(feature.repositoryPath, feature.branch);
68
- await launcher.launch(worktreePath);
69
- messages.success(`Opened ${launcher.name} at ${worktreePath}`);
59
+ messages.success(`Opened ${result.editorName} at ${result.worktreePath}`);
70
60
  }
71
61
  catch (error) {
72
62
  const err = error instanceof Error ? error : new Error(String(error));
@@ -0,0 +1,5 @@
1
+ import { NextResponse } from 'next/server';
2
+ export declare function POST(request: Request): Promise<NextResponse<{
3
+ error: string;
4
+ }> | NextResponse<import("../../../../../../../packages/core/src/infrastructure/di/use-cases-bridge.js").CreateFeatureResult>>;
5
+ //# sourceMappingURL=route.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../../../../../src/presentation/web/app/api/features/create/route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AA2B3C,wBAAsB,IAAI,CAAC,OAAO,EAAE,OAAO;;kGA0B1C"}
@@ -0,0 +1,32 @@
1
+ import { NextResponse } from 'next/server';
2
+ import { createFeature } from '../../../../../../../packages/core/src/infrastructure/di/use-cases-bridge.js';
3
+ function composeUserInput(name, description, attachments) {
4
+ let userInput = `Feature: ${name}`;
5
+ if (description) {
6
+ userInput += `\n\n${description}`;
7
+ }
8
+ if (attachments && attachments.length > 0) {
9
+ const paths = attachments.map((a) => `- ${a.path}`).join('\n');
10
+ userInput += `\n\nAttached files:\n${paths}`;
11
+ }
12
+ return userInput;
13
+ }
14
+ export async function POST(request) {
15
+ const body = await request.json();
16
+ const { name, description, repositoryPath, attachments } = body;
17
+ if (!name?.trim()) {
18
+ return NextResponse.json({ error: 'name is required' }, { status: 400 });
19
+ }
20
+ if (!repositoryPath?.trim()) {
21
+ return NextResponse.json({ error: 'repositoryPath is required' }, { status: 400 });
22
+ }
23
+ const userInput = composeUserInput(name, description, attachments);
24
+ try {
25
+ const result = await createFeature({ userInput, repositoryPath });
26
+ return NextResponse.json(result);
27
+ }
28
+ catch (error) {
29
+ const message = error instanceof Error ? error.message : 'Failed to create feature';
30
+ return NextResponse.json({ error: message }, { status: 500 });
31
+ }
32
+ }
@@ -0,0 +1,9 @@
1
+ import { NextResponse } from 'next/server';
2
+ export declare function POST(request: Request): Promise<NextResponse<{
3
+ error: string;
4
+ }> | NextResponse<{
5
+ success: boolean;
6
+ editor: string;
7
+ path: string;
8
+ }>>;
9
+ //# sourceMappingURL=route.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../../../../../src/presentation/web/app/api/ide/open/route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAK3C,wBAAsB,IAAI,CAAC,OAAO,EAAE,OAAO;;;;;;IA8B1C"}
@@ -0,0 +1,29 @@
1
+ import { NextResponse } from 'next/server';
2
+ import { getSettings } from '../../../../../../../packages/core/src/infrastructure/services/settings.service.js';
3
+ import { launchIde } from '../../../../../../../packages/core/src/infrastructure/services/ide-launchers/launch-ide.js';
4
+ import { validateToolbarInput } from '../../validate-toolbar-input.js';
5
+ export async function POST(request) {
6
+ const body = await request.json();
7
+ const validation = validateToolbarInput(body);
8
+ if ('error' in validation) {
9
+ return NextResponse.json({ error: validation.error }, { status: validation.status });
10
+ }
11
+ const { repositoryPath, branch } = validation;
12
+ const settings = getSettings();
13
+ const editor = settings.environment.defaultEditor;
14
+ const result = await launchIde({
15
+ editorId: editor,
16
+ repositoryPath,
17
+ branch,
18
+ checkAvailability: true,
19
+ });
20
+ if (!result.ok) {
21
+ const status = result.code === 'launch_failed' ? 500 : 404;
22
+ return NextResponse.json({ error: result.message }, { status });
23
+ }
24
+ return NextResponse.json({
25
+ success: true,
26
+ editor: result.editorName,
27
+ path: result.worktreePath,
28
+ });
29
+ }
@@ -0,0 +1,9 @@
1
+ import { NextResponse } from 'next/server';
2
+ export declare function POST(request: Request): Promise<NextResponse<{
3
+ error: string;
4
+ }> | NextResponse<{
5
+ success: boolean;
6
+ path: string;
7
+ shell: string;
8
+ }>>;
9
+ //# sourceMappingURL=route.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../../../../../src/presentation/web/app/api/shell/open/route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAO3C,wBAAsB,IAAI,CAAC,OAAO,EAAE,OAAO;;;;;;IAsD1C"}