@shepai/cli 1.103.1 → 1.104.0-pr299.a2cc06c

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 (215) hide show
  1. package/dist/packages/core/src/application/use-cases/upgrade/upgrade-cli.use-case.d.ts +27 -0
  2. package/dist/packages/core/src/application/use-cases/upgrade/upgrade-cli.use-case.d.ts.map +1 -0
  3. package/dist/packages/core/src/application/use-cases/upgrade/upgrade-cli.use-case.js +128 -0
  4. package/dist/packages/core/src/infrastructure/di/container.d.ts.map +1 -1
  5. package/dist/packages/core/src/infrastructure/di/container.js +5 -0
  6. package/dist/packages/core/src/infrastructure/services/agents/common/executors/dev-executor.service.d.ts.map +1 -1
  7. package/dist/packages/core/src/infrastructure/services/agents/common/executors/dev-executor.service.js +5 -3
  8. package/dist/packages/core/src/infrastructure/services/agents/sessions/claude-code-session.repository.js +1 -1
  9. package/dist/packages/core/src/infrastructure/services/deployment/deployment.service.d.ts +1 -1
  10. package/dist/packages/core/src/infrastructure/services/deployment/deployment.service.d.ts.map +1 -1
  11. package/dist/packages/core/src/infrastructure/services/deployment/deployment.service.js +8 -7
  12. package/dist/packages/core/src/infrastructure/services/ide-launchers/json-driven-ide-launcher.service.d.ts.map +1 -1
  13. package/dist/packages/core/src/infrastructure/services/ide-launchers/json-driven-ide-launcher.service.js +6 -8
  14. package/dist/packages/core/src/infrastructure/services/process/tree-kill.d.ts +12 -0
  15. package/dist/packages/core/src/infrastructure/services/process/tree-kill.d.ts.map +1 -0
  16. package/dist/packages/core/src/infrastructure/services/process/tree-kill.js +11 -0
  17. package/dist/packages/core/src/infrastructure/services/spec/spec-initializer.service.js +1 -1
  18. package/dist/packages/core/src/infrastructure/services/tool-installer/binary-exists.d.ts +25 -0
  19. package/dist/packages/core/src/infrastructure/services/tool-installer/binary-exists.d.ts.map +1 -0
  20. package/dist/packages/core/src/infrastructure/services/tool-installer/binary-exists.js +32 -0
  21. package/dist/packages/core/src/infrastructure/services/tool-installer/tool-installer.service.d.ts.map +1 -1
  22. package/dist/packages/core/src/infrastructure/services/tool-installer/tool-installer.service.js +4 -27
  23. package/dist/packages/core/src/infrastructure/services/tool-installer/tools/alacritty.json +3 -2
  24. package/dist/packages/core/src/infrastructure/services/tool-installer/tools/claude-code.json +3 -2
  25. package/dist/packages/core/src/infrastructure/services/tool-installer/tools/cursor-cli.json +3 -2
  26. package/dist/packages/core/src/infrastructure/services/tool-installer/tools/cursor.json +2 -1
  27. package/dist/packages/core/src/infrastructure/services/tool-installer/tools/gh.json +2 -1
  28. package/dist/packages/core/src/infrastructure/services/tool-installer/tools/git.json +2 -1
  29. package/dist/packages/core/src/infrastructure/services/tool-installer/tools/vscode.json +2 -1
  30. package/dist/packages/core/src/infrastructure/services/tool-installer/tools/warp.json +3 -2
  31. package/dist/packages/core/src/infrastructure/services/tool-installer/tools/windsurf.json +3 -2
  32. package/dist/packages/core/src/infrastructure/services/tool-installer/tools/zed.json +3 -2
  33. package/dist/src/presentation/cli/commands/daemon/start-daemon.d.ts.map +1 -1
  34. package/dist/src/presentation/cli/commands/daemon/start-daemon.js +1 -0
  35. package/dist/src/presentation/cli/commands/daemon/stop-daemon.d.ts.map +1 -1
  36. package/dist/src/presentation/cli/commands/daemon/stop-daemon.js +5 -4
  37. package/dist/src/presentation/cli/ui/symbols.d.ts +1 -1
  38. package/dist/src/presentation/web/app/actions/deploy-repository.d.ts.map +1 -1
  39. package/dist/src/presentation/web/app/actions/deploy-repository.js +2 -1
  40. package/dist/src/presentation/web/app/actions/open-folder.d.ts.map +1 -1
  41. package/dist/src/presentation/web/app/actions/open-folder.js +4 -2
  42. package/dist/src/presentation/web/app/actions/open-ide.d.ts.map +1 -1
  43. package/dist/src/presentation/web/app/actions/open-ide.js +2 -1
  44. package/dist/src/presentation/web/app/actions/open-shell.d.ts.map +1 -1
  45. package/dist/src/presentation/web/app/actions/open-shell.js +4 -2
  46. package/dist/src/presentation/web/app/api/cli-upgrade/route.d.ts +3 -0
  47. package/dist/src/presentation/web/app/api/cli-upgrade/route.d.ts.map +1 -0
  48. package/dist/src/presentation/web/app/api/cli-upgrade/route.js +31 -0
  49. package/dist/src/presentation/web/components/common/control-center-drawer/feature-drawer-client.d.ts.map +1 -1
  50. package/dist/src/presentation/web/components/common/control-center-drawer/feature-drawer-client.js +1 -1
  51. package/dist/src/presentation/web/components/common/feature-drawer-tabs/activity-tab.d.ts.map +1 -1
  52. package/dist/src/presentation/web/components/common/feature-drawer-tabs/activity-tab.js +50 -8
  53. package/dist/src/presentation/web/components/common/feature-drawer-tabs/feature-drawer-tabs.d.ts +4 -1
  54. package/dist/src/presentation/web/components/common/feature-drawer-tabs/feature-drawer-tabs.d.ts.map +1 -1
  55. package/dist/src/presentation/web/components/common/feature-drawer-tabs/feature-drawer-tabs.js +31 -11
  56. package/dist/src/presentation/web/components/common/feature-drawer-tabs/overview-tab.d.ts.map +1 -1
  57. package/dist/src/presentation/web/components/common/feature-drawer-tabs/overview-tab.js +35 -2
  58. package/dist/src/presentation/web/components/common/merge-review/diff-view.js +1 -1
  59. package/dist/src/presentation/web/components/common/version-badge/version-badge.d.ts.map +1 -1
  60. package/dist/src/presentation/web/components/common/version-badge/version-badge.js +6 -2
  61. package/dist/src/presentation/web/components/common/version-badge/version-badge.stories.d.ts +2 -2
  62. package/dist/src/presentation/web/components/common/version-badge/version-badge.stories.d.ts.map +1 -1
  63. package/dist/src/presentation/web/components/common/version-badge/version-badge.stories.js +20 -3
  64. package/dist/src/presentation/web/hooks/use-cli-upgrade.d.ts +11 -0
  65. package/dist/src/presentation/web/hooks/use-cli-upgrade.d.ts.map +1 -0
  66. package/dist/src/presentation/web/hooks/use-cli-upgrade.js +73 -0
  67. package/dist/tsconfig.build.tsbuildinfo +1 -1
  68. package/package.json +3 -1
  69. package/web/.next/BUILD_ID +1 -1
  70. package/web/.next/app-path-routes-manifest.json +1 -0
  71. package/web/.next/build-manifest.json +2 -2
  72. package/web/.next/fallback-build-manifest.json +2 -2
  73. package/web/.next/prerender-manifest.json +3 -3
  74. package/web/.next/required-server-files.js +3 -3
  75. package/web/.next/required-server-files.json +3 -3
  76. package/web/.next/routes-manifest.json +6 -0
  77. package/web/.next/server/app/(dashboard)/@drawer/create/page/server-reference-manifest.json +20 -20
  78. package/web/.next/server/app/(dashboard)/@drawer/create/page.js.nft.json +1 -1
  79. package/web/.next/server/app/(dashboard)/@drawer/create/page_client-reference-manifest.js +1 -1
  80. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/server-reference-manifest.json +25 -25
  81. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  82. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  83. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/server-reference-manifest.json +25 -25
  84. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js.nft.json +1 -1
  85. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page_client-reference-manifest.js +1 -1
  86. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/server-reference-manifest.json +18 -18
  87. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js.nft.json +1 -1
  88. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  89. package/web/.next/server/app/(dashboard)/create/page/server-reference-manifest.json +20 -20
  90. package/web/.next/server/app/(dashboard)/create/page.js.nft.json +1 -1
  91. package/web/.next/server/app/(dashboard)/create/page_client-reference-manifest.js +1 -1
  92. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/server-reference-manifest.json +25 -25
  93. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  94. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  95. package/web/.next/server/app/(dashboard)/feature/[featureId]/page/server-reference-manifest.json +25 -25
  96. package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js.nft.json +1 -1
  97. package/web/.next/server/app/(dashboard)/feature/[featureId]/page_client-reference-manifest.js +1 -1
  98. package/web/.next/server/app/(dashboard)/page/server-reference-manifest.json +18 -18
  99. package/web/.next/server/app/(dashboard)/page.js.nft.json +1 -1
  100. package/web/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
  101. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/server-reference-manifest.json +18 -18
  102. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js.nft.json +1 -1
  103. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  104. package/web/.next/server/app/_global-error.html +2 -2
  105. package/web/.next/server/app/_global-error.rsc +1 -1
  106. package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  107. package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  108. package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  109. package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  110. package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  111. package/web/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
  112. package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  113. package/web/.next/server/app/api/attachments/preview/route.js.nft.json +1 -1
  114. package/web/.next/server/app/api/cli-upgrade/route/app-paths-manifest.json +3 -0
  115. package/web/.next/server/app/api/cli-upgrade/route/build-manifest.json +11 -0
  116. package/web/.next/server/app/api/cli-upgrade/route/server-reference-manifest.json +4 -0
  117. package/web/.next/server/app/api/cli-upgrade/route.js +6 -0
  118. package/web/.next/server/app/api/cli-upgrade/route.js.map +5 -0
  119. package/web/.next/server/app/api/cli-upgrade/route.js.nft.json +1 -0
  120. package/web/.next/server/app/api/cli-upgrade/route_client-reference-manifest.js +2 -0
  121. package/web/.next/server/app/api/evidence/route.js.nft.json +1 -1
  122. package/web/.next/server/app/settings/page/server-reference-manifest.json +5 -5
  123. package/web/.next/server/app/settings/page.js.nft.json +1 -1
  124. package/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  125. package/web/.next/server/app/skills/page/server-reference-manifest.json +6 -6
  126. package/web/.next/server/app/skills/page.js.nft.json +1 -1
  127. package/web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  128. package/web/.next/server/app/tools/page/server-reference-manifest.json +6 -6
  129. package/web/.next/server/app/tools/page.js.nft.json +1 -1
  130. package/web/.next/server/app/tools/page_client-reference-manifest.js +1 -1
  131. package/web/.next/server/app/version/page/server-reference-manifest.json +1 -1
  132. package/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
  133. package/web/.next/server/app-paths-manifest.json +1 -0
  134. package/web/.next/server/chunks/744ca_web__next-internal_server_app_api_cli-upgrade_route_actions_dc509b52.js +3 -0
  135. package/web/.next/server/chunks/744ca_web__next-internal_server_app_api_cli-upgrade_route_actions_dc509b52.js.map +1 -0
  136. package/web/.next/server/chunks/[root-of-the-server]__d2c18946._.js +11 -0
  137. package/web/.next/server/chunks/[root-of-the-server]__d2c18946._.js.map +1 -0
  138. package/web/.next/server/chunks/[root-of-the-server]__f47bb8a5._.js +1 -1
  139. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js +1 -1
  140. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js.map +1 -1
  141. package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_@drawer_repository_[repositoryId]_page_actions_0a7546ed.js +1 -1
  142. package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_@drawer_repository_[repositoryId]_page_actions_0a7546ed.js.map +1 -1
  143. package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_repository_[repositoryId]_page_actions_978cbb4c.js +1 -1
  144. package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_repository_[repositoryId]_page_actions_978cbb4c.js.map +1 -1
  145. package/web/.next/server/chunks/ssr/[root-of-the-server]__11033878._.js +1 -1
  146. package/web/.next/server/chunks/ssr/[root-of-the-server]__11033878._.js.map +1 -1
  147. package/web/.next/server/chunks/ssr/[root-of-the-server]__24dd0927._.js +2 -2
  148. package/web/.next/server/chunks/ssr/[root-of-the-server]__24dd0927._.js.map +1 -1
  149. package/web/.next/server/chunks/ssr/[root-of-the-server]__357d99f9._.js +1 -1
  150. package/web/.next/server/chunks/ssr/[root-of-the-server]__51fc98b0._.js +1 -1
  151. package/web/.next/server/chunks/ssr/[root-of-the-server]__51fc98b0._.js.map +1 -1
  152. package/web/.next/server/chunks/ssr/[root-of-the-server]__57f37786._.js +1 -1
  153. package/web/.next/server/chunks/ssr/[root-of-the-server]__57f37786._.js.map +1 -1
  154. package/web/.next/server/chunks/ssr/[root-of-the-server]__5d87af2e._.js +1 -1
  155. package/web/.next/server/chunks/ssr/[root-of-the-server]__708dcad1._.js +1 -1
  156. package/web/.next/server/chunks/ssr/[root-of-the-server]__708dcad1._.js.map +1 -1
  157. package/web/.next/server/chunks/ssr/[root-of-the-server]__845a9d2a._.js +1 -1
  158. package/web/.next/server/chunks/ssr/[root-of-the-server]__845a9d2a._.js.map +1 -1
  159. package/web/.next/server/chunks/ssr/[root-of-the-server]__89e8a5cc._.js +2 -2
  160. package/web/.next/server/chunks/ssr/[root-of-the-server]__89e8a5cc._.js.map +1 -1
  161. package/web/.next/server/chunks/ssr/[root-of-the-server]__8e002910._.js +1 -1
  162. package/web/.next/server/chunks/ssr/[root-of-the-server]__8e002910._.js.map +1 -1
  163. package/web/.next/server/chunks/ssr/[root-of-the-server]__aad040c0._.js +2 -2
  164. package/web/.next/server/chunks/ssr/[root-of-the-server]__aad040c0._.js.map +1 -1
  165. package/web/.next/server/chunks/ssr/[root-of-the-server]__fdc75809._.js +1 -1
  166. package/web/.next/server/chunks/ssr/[root-of-the-server]__fdc75809._.js.map +1 -1
  167. package/web/.next/server/chunks/ssr/_135edb9c._.js +1 -1
  168. package/web/.next/server/chunks/ssr/_135edb9c._.js.map +1 -1
  169. package/web/.next/server/chunks/ssr/{_82e0cb85._.js → _2e3ec01b._.js} +2 -2
  170. package/web/.next/server/chunks/ssr/{_82e0cb85._.js.map → _2e3ec01b._.js.map} +1 -1
  171. package/web/.next/server/chunks/ssr/{_b3352e34._.js → _4038d4ba._.js} +2 -2
  172. package/web/.next/server/chunks/ssr/{_b3352e34._.js.map → _4038d4ba._.js.map} +1 -1
  173. package/web/.next/server/chunks/ssr/{_23e5ab2c._.js → _606f5d13._.js} +2 -2
  174. package/web/.next/server/chunks/ssr/{_23e5ab2c._.js.map → _606f5d13._.js.map} +1 -1
  175. package/web/.next/server/chunks/ssr/_8dacd1e7._.js +1 -1
  176. package/web/.next/server/chunks/ssr/_8dacd1e7._.js.map +1 -1
  177. package/web/.next/server/chunks/ssr/_cc77a143._.js +1 -1
  178. package/web/.next/server/chunks/ssr/_cc77a143._.js.map +1 -1
  179. package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js +1 -1
  180. package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js.map +1 -1
  181. package/web/.next/server/chunks/ssr/src_presentation_web_7275ce5d._.js +2 -2
  182. package/web/.next/server/chunks/ssr/src_presentation_web_7275ce5d._.js.map +1 -1
  183. package/web/.next/server/chunks/ssr/src_presentation_web_758dfa10._.js +2 -2
  184. package/web/.next/server/chunks/ssr/src_presentation_web_758dfa10._.js.map +1 -1
  185. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_84803221.js +1 -1
  186. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_84803221.js.map +1 -1
  187. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1fa8042e.js +1 -1
  188. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1fa8042e.js.map +1 -1
  189. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_24684200.js +1 -1
  190. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_24684200.js.map +1 -1
  191. package/web/.next/server/chunks/ssr/src_presentation_web_components_bf50c527._.js +1 -1
  192. package/web/.next/server/chunks/ssr/src_presentation_web_components_de814675._.js +1 -1
  193. package/web/.next/server/chunks/ssr/src_presentation_web_components_e599bb8c._.js +1 -1
  194. package/web/.next/server/chunks/ssr/src_presentation_web_components_e599bb8c._.js.map +1 -1
  195. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js +1 -1
  196. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js.map +1 -1
  197. package/web/.next/server/pages/500.html +2 -2
  198. package/web/.next/server/server-reference-manifest.js +1 -1
  199. package/web/.next/server/server-reference-manifest.json +30 -30
  200. package/web/.next/static/chunks/{a0f87e10178f4c0e.js → 04f85d1bb4c9bd9f.js} +1 -1
  201. package/web/.next/static/chunks/{d7cc1b6cf702a840.js → 106f17ea546b4873.js} +2 -2
  202. package/web/.next/static/chunks/{4fd27329675da3a8.js → 3a19191db405a122.js} +1 -1
  203. package/web/.next/static/chunks/3bb35e0689e8b6b7.js +1 -0
  204. package/web/.next/static/chunks/{2e2bbd77e10e036c.js → 57a806a72d427ce2.js} +1 -1
  205. package/web/.next/static/chunks/{2016bacd1f5fcc12.js → 58f603517ee8f671.js} +1 -1
  206. package/web/.next/static/chunks/{396a8b5222dfe0f1.js → 5cd861cac966b22e.js} +1 -1
  207. package/web/.next/static/chunks/{8d98f1d9341e7698.js → 7e08e1d6fc515719.js} +1 -1
  208. package/web/.next/static/chunks/{3e1f5c0f67be293f.js → 9ae5355ecbb986c4.js} +1 -1
  209. package/web/.next/static/chunks/{8b1d0f725365fc83.js → ad4c597b1d9f2868.js} +1 -1
  210. package/web/.next/static/chunks/fe424cb940ac3b65.js +2 -0
  211. package/web/.next/static/chunks/0c1c3c49b2145c9b.js +0 -2
  212. package/web/.next/static/chunks/2a6f05312c4f37ce.js +0 -1
  213. /package/web/.next/static/{7gAZbyat8KbbWMGw1K8nJ → KRcEMJYZ0qHENkXOfvNU-}/_buildManifest.js +0 -0
  214. /package/web/.next/static/{7gAZbyat8KbbWMGw1K8nJ → KRcEMJYZ0qHENkXOfvNU-}/_clientMiddlewareManifest.json +0 -0
  215. /package/web/.next/static/{7gAZbyat8KbbWMGw1K8nJ → KRcEMJYZ0qHENkXOfvNU-}/_ssgManifest.js +0 -0
@@ -0,0 +1,27 @@
1
+ /**
2
+ * UpgradeCliUseCase
3
+ *
4
+ * Executes a self-upgrade of @shepai/cli to the latest published version.
5
+ * Mirrors the CLI upgrade command logic but designed for use from the web layer.
6
+ *
7
+ * Flow:
8
+ * 1. Check latest version from npm registry (fail-open)
9
+ * 2. Compare with current version — return early if up to date
10
+ * 3. Run `npm i -g @shepai/cli@latest` with streamed output
11
+ * 4. Return result with old/new version info
12
+ */
13
+ import type { IVersionService } from '../../ports/output/services/version-service.interface.js';
14
+ export interface UpgradeResult {
15
+ status: 'up-to-date' | 'upgraded' | 'error';
16
+ currentVersion: string;
17
+ latestVersion: string | null;
18
+ errorMessage?: string;
19
+ }
20
+ export declare class UpgradeCliUseCase {
21
+ private readonly versionService;
22
+ constructor(versionService: IVersionService);
23
+ execute(onOutput?: (data: string) => void): Promise<UpgradeResult>;
24
+ private getLatestVersion;
25
+ private runNpmInstall;
26
+ }
27
+ //# sourceMappingURL=upgrade-cli.use-case.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upgrade-cli.use-case.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/application/use-cases/upgrade/upgrade-cli.use-case.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0DAA0D,CAAC;AAEhG,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,YAAY,GAAG,UAAU,GAAG,OAAO,CAAC;IAC5C,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAID,qBACa,iBAAiB;IAG1B,OAAO,CAAC,QAAQ,CAAC,cAAc;gBAAd,cAAc,EAAE,eAAe;IAG5C,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,aAAa,CAAC;IAkCxE,OAAO,CAAC,gBAAgB;IA6CxB,OAAO,CAAC,aAAa;CAuBtB"}
@@ -0,0 +1,128 @@
1
+ /**
2
+ * UpgradeCliUseCase
3
+ *
4
+ * Executes a self-upgrade of @shepai/cli to the latest published version.
5
+ * Mirrors the CLI upgrade command logic but designed for use from the web layer.
6
+ *
7
+ * Flow:
8
+ * 1. Check latest version from npm registry (fail-open)
9
+ * 2. Compare with current version — return early if up to date
10
+ * 3. Run `npm i -g @shepai/cli@latest` with streamed output
11
+ * 4. Return result with old/new version info
12
+ */
13
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
14
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
15
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
16
+ 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;
17
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
18
+ };
19
+ var __metadata = (this && this.__metadata) || function (k, v) {
20
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
21
+ };
22
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
23
+ return function (target, key) { decorator(target, key, paramIndex); }
24
+ };
25
+ import { injectable, inject } from 'tsyringe';
26
+ import { spawn } from 'node:child_process';
27
+ const VERSION_CHECK_TIMEOUT_MS = 10_000;
28
+ let UpgradeCliUseCase = class UpgradeCliUseCase {
29
+ versionService;
30
+ constructor(versionService) {
31
+ this.versionService = versionService;
32
+ }
33
+ async execute(onOutput) {
34
+ const { version: currentVersion } = this.versionService.getVersion();
35
+ // 1. Check latest version (fail-open)
36
+ const latestVersion = await this.getLatestVersion(onOutput);
37
+ // 2. Already up to date
38
+ if (latestVersion && latestVersion === currentVersion) {
39
+ onOutput?.(`Already up to date (v${currentVersion})\n`);
40
+ return { status: 'up-to-date', currentVersion, latestVersion };
41
+ }
42
+ // 3. Run upgrade
43
+ const target = latestVersion ? `v${latestVersion}` : 'latest';
44
+ onOutput?.(`Upgrading from v${currentVersion} to ${target}...\n`);
45
+ try {
46
+ const exitCode = await this.runNpmInstall(onOutput);
47
+ if (exitCode === 0) {
48
+ onOutput?.(`Successfully upgraded to ${target}\n`);
49
+ return { status: 'upgraded', currentVersion, latestVersion };
50
+ }
51
+ else {
52
+ const msg = `npm install exited with code ${exitCode}`;
53
+ onOutput?.(`Error: ${msg}\n`);
54
+ return { status: 'error', currentVersion, latestVersion, errorMessage: msg };
55
+ }
56
+ }
57
+ catch (error) {
58
+ const msg = error instanceof Error ? error.message : 'Installation failed';
59
+ onOutput?.(`Error: ${msg}\n`);
60
+ return { status: 'error', currentVersion, latestVersion, errorMessage: msg };
61
+ }
62
+ }
63
+ getLatestVersion(onOutput) {
64
+ return new Promise((resolve) => {
65
+ let output = '';
66
+ let settled = false;
67
+ const child = spawn('npm', ['view', '@shepai/cli', 'version'], {
68
+ stdio: ['ignore', 'pipe', 'pipe'],
69
+ });
70
+ const timeout = setTimeout(() => {
71
+ if (!settled) {
72
+ settled = true;
73
+ child.kill();
74
+ onOutput?.('Version check timed out, proceeding with upgrade...\n');
75
+ resolve(null);
76
+ }
77
+ }, VERSION_CHECK_TIMEOUT_MS);
78
+ child.stdout?.on('data', (data) => {
79
+ output += data.toString();
80
+ });
81
+ child.on('close', (code) => {
82
+ if (!settled) {
83
+ settled = true;
84
+ clearTimeout(timeout);
85
+ if (code === 0 && output.trim()) {
86
+ resolve(output.trim());
87
+ }
88
+ else {
89
+ resolve(null);
90
+ }
91
+ }
92
+ });
93
+ child.on('error', () => {
94
+ if (!settled) {
95
+ settled = true;
96
+ clearTimeout(timeout);
97
+ onOutput?.('Could not check latest version\n');
98
+ resolve(null);
99
+ }
100
+ });
101
+ });
102
+ }
103
+ runNpmInstall(onOutput) {
104
+ return new Promise((resolve, reject) => {
105
+ const child = spawn('npm', ['i', '-g', '@shepai/cli@latest'], {
106
+ stdio: ['ignore', 'pipe', 'pipe'],
107
+ });
108
+ child.stdout?.on('data', (data) => {
109
+ onOutput?.(data.toString());
110
+ });
111
+ child.stderr?.on('data', (data) => {
112
+ onOutput?.(data.toString());
113
+ });
114
+ child.on('close', (code) => {
115
+ resolve(code ?? 1);
116
+ });
117
+ child.on('error', (err) => {
118
+ reject(err);
119
+ });
120
+ });
121
+ }
122
+ };
123
+ UpgradeCliUseCase = __decorate([
124
+ injectable(),
125
+ __param(0, inject('IVersionService')),
126
+ __metadata("design:paramtypes", [Object])
127
+ ], UpgradeCliUseCase);
128
+ export { UpgradeCliUseCase };
@@ -1 +1 @@
1
- {"version":3,"file":"container.d.ts","sourceRoot":"","sources":["../../../../../../packages/core/src/infrastructure/di/container.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAiHrC;;;;;;GAMG;AACH,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,OAAO,SAAS,CAAC,CA0SrE;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,IAAI,OAAO,CAEhD;AAED;;;GAGG;AACH,OAAO,EAAE,SAAS,EAAE,CAAC"}
1
+ {"version":3,"file":"container.d.ts","sourceRoot":"","sources":["../../../../../../packages/core/src/infrastructure/di/container.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAkHrC;;;;;;GAMG;AACH,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,OAAO,SAAS,CAAC,CA8SrE;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,IAAI,OAAO,CAEhD;AAED;;;GAGG;AACH,OAAO,EAAE,SAAS,EAAE,CAAC"}
@@ -77,6 +77,7 @@ import { DeleteRepositoryUseCase } from '../../application/use-cases/repositorie
77
77
  import { CheckAndUnblockFeaturesUseCase } from '../../application/use-cases/features/check-and-unblock-features.use-case.js';
78
78
  import { UpdateFeatureLifecycleUseCase } from '../../application/use-cases/features/update/update-feature-lifecycle.use-case.js';
79
79
  import { CleanupFeatureWorktreeUseCase } from '../../application/use-cases/features/cleanup-feature-worktree.use-case.js';
80
+ import { UpgradeCliUseCase } from '../../application/use-cases/upgrade/upgrade-cli.use-case.js';
80
81
  // Session listing
81
82
  import { ClaudeCodeSessionRepository } from '../services/agents/sessions/claude-code-session.repository.js';
82
83
  import { StubSessionRepository } from '../services/agents/sessions/stub-session.repository.js';
@@ -279,6 +280,7 @@ export async function initializeContainer() {
279
280
  container.registerSingleton(CheckAndUnblockFeaturesUseCase);
280
281
  container.registerSingleton(UpdateFeatureLifecycleUseCase);
281
282
  container.registerSingleton(CleanupFeatureWorktreeUseCase);
283
+ container.registerSingleton(UpgradeCliUseCase);
282
284
  // Session repositories (per-AgentType string tokens)
283
285
  container.register(`IAgentSessionRepository:${AgentType.ClaudeCode}`, {
284
286
  useFactory: () => new ClaudeCodeSessionRepository(),
@@ -360,6 +362,9 @@ export async function initializeContainer() {
360
362
  container.register('CleanupFeatureWorktreeUseCase', {
361
363
  useFactory: (c) => c.resolve(CleanupFeatureWorktreeUseCase),
362
364
  });
365
+ container.register('UpgradeCliUseCase', {
366
+ useFactory: (c) => c.resolve(UpgradeCliUseCase),
367
+ });
363
368
  _initialized = true;
364
369
  return container;
365
370
  }
@@ -1 +1 @@
1
- {"version":3,"file":"dev-executor.service.d.ts","sourceRoot":"","sources":["../../../../../../../../../packages/core/src/infrastructure/services/agents/common/executors/dev-executor.service.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAC;AACzF,OAAO,KAAK,EACV,cAAc,EACd,qBAAqB,EACrB,oBAAoB,EACpB,yBAAyB,EAC1B,MAAM,4EAA4E,CAAC;AAmIpF,qBAAa,uBAAwB,YAAW,cAAc;IAC5D,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAsB;IACnD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;;IAM3B,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAOvF,aAAa,CAClB,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,qBAAqB,GAC9B,aAAa,CAAC,yBAAyB,CAAC;IAK3C,eAAe,CAAC,QAAQ,EAAE,YAAY,GAAG,OAAO;IAIhD,OAAO,CAAC,QAAQ;CAmEjB"}
1
+ {"version":3,"file":"dev-executor.service.d.ts","sourceRoot":"","sources":["../../../../../../../../../packages/core/src/infrastructure/services/agents/common/executors/dev-executor.service.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAC;AACzF,OAAO,KAAK,EACV,cAAc,EACd,qBAAqB,EACrB,oBAAoB,EACpB,yBAAyB,EAC1B,MAAM,4EAA4E,CAAC;AAwIpF,qBAAa,uBAAwB,YAAW,cAAc;IAC5D,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAsB;IACnD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;;IAM3B,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAOvF,aAAa,CAClB,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,qBAAqB,GAC9B,aAAa,CAAC,yBAAyB,CAAC;IAK3C,eAAe,CAAC,QAAQ,EAAE,YAAY,GAAG,OAAO;IAIhD,OAAO,CAAC,QAAQ;CAmEjB"}
@@ -101,20 +101,22 @@ const CI_FIX_RESULT = 'Fixed CI failure: corrected import path. All checks now p
101
101
  * plan.prompt.ts:199.
102
102
  */
103
103
  function extractSpecDir(prompt) {
104
+ // Match both Unix absolute paths (/...) and Windows absolute paths (C:\...)
105
+ const ABS_PATH = String.raw `(?:\/|[A-Za-z]:[/\\])[^\s\n]+`;
104
106
  // Analyze ("Write your analysis to:"), requirements ("Update the file at:"),
105
107
  // research ("Write your research to:")
106
- const fileMatch = prompt.match(/(?:Write your \w+ to|Update the file at):\s+(\/[^\s\n]+)/);
108
+ const fileMatch = prompt.match(new RegExp(`(?:Write your \\w+ to|Update the file at):\\s+(${ABS_PATH})`));
107
109
  if (fileMatch)
108
110
  return path.dirname(fileMatch[1]);
109
111
  // Plan: "Write to BOTH /path/plan.yaml AND /path/tasks.yaml"
110
- const planMatch = prompt.match(/Write to BOTH\s+(\/[^\s\n]+)\/plan\.yaml/);
112
+ const planMatch = prompt.match(new RegExp(`Write to BOTH\\s+(${ABS_PATH})[/\\\\]plan\\.yaml`));
111
113
  if (planMatch)
112
114
  return planMatch[1];
113
115
  return null;
114
116
  }
115
117
  /** Validate extracted specDir: must be absolute, no ".." traversal. */
116
118
  function validateSpecDir(specDir) {
117
- if (!specDir.startsWith('/'))
119
+ if (!path.isAbsolute(specDir))
118
120
  throw new Error(`DevAgentExecutorService: invalid specDir (not absolute): ${specDir}`);
119
121
  if (specDir.includes('..'))
120
122
  throw new Error(`DevAgentExecutorService: invalid specDir (contains ".."): ${specDir}`);
@@ -311,7 +311,7 @@ let ClaudeCodeSessionRepository = class ClaudeCodeSessionRepository {
311
311
  const home = os.homedir();
312
312
  if (filePath === home)
313
313
  return '~';
314
- if (filePath.startsWith(`${home}/`)) {
314
+ if (filePath.startsWith(`${home}${path.sep}`)) {
315
315
  return `~${filePath.slice(home.length)}`;
316
316
  }
317
317
  return filePath;
@@ -51,7 +51,7 @@ export declare class DeploymentService implements IDeploymentService {
51
51
  */
52
52
  off(event: 'log', handler: (entry: LogEntry) => void): void;
53
53
  /**
54
- * Send SIGKILL to a process group.
54
+ * Send SIGKILL to a process tree.
55
55
  */
56
56
  private killProcess;
57
57
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"deployment.service.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/services/deployment/deployment.service.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,KAAK,EAAqB,MAAM,oBAAoB,CAAC;AAG9D,OAAO,KAAK,EACV,kBAAkB,EAClB,gBAAgB,EAChB,QAAQ,EACT,MAAM,qEAAqE,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAoBzD,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,OAAO,KAAK,CAAC;IACpB,eAAe,EAAE,OAAO,eAAe,CAAC;IACxC,IAAI,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,OAAO,GAAG,MAAM,KAAK,IAAI,CAAC;IAC7D,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;CACnC;AAgBD,qBAAa,iBAAkB,YAAW,kBAAkB;IAC1D,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAsC;IAClE,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAwB;IAC7C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAsB;gBAElC,IAAI,GAAE,OAAO,CAAC,qBAAqB,CAAM;IAIrD;;;OAGG;IACH,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI;IA+EjD;;;OAGG;IACH,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI;IAYpD;;OAEG;IACG,IAAI,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAyC3C;;OAEG;IACH,OAAO,IAAI,IAAI;IAOf;;OAEG;IACH,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,QAAQ,EAAE,GAAG,IAAI;IAM5C;;OAEG;IACH,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,IAAI,GAAG,IAAI;IAI1D;;OAEG;IACH,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,IAAI,GAAG,IAAI;IAI3D;;OAEG;IACH,OAAO,CAAC,WAAW;IAQnB;;;OAGG;IACH,OAAO,CAAC,oBAAoB;IA+D5B;;OAEG;YACW,aAAa;IAW3B;;OAEG;IACH,OAAO,CAAC,WAAW;CASpB"}
1
+ {"version":3,"file":"deployment.service.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/services/deployment/deployment.service.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,KAAK,EAAqB,MAAM,oBAAoB,CAAC;AAI9D,OAAO,KAAK,EACV,kBAAkB,EAClB,gBAAgB,EAChB,QAAQ,EACT,MAAM,qEAAqE,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAoBzD,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,OAAO,KAAK,CAAC;IACpB,eAAe,EAAE,OAAO,eAAe,CAAC;IACxC,IAAI,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,OAAO,GAAG,MAAM,KAAK,IAAI,CAAC;IAC7D,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;CACnC;AAgBD,qBAAa,iBAAkB,YAAW,kBAAkB;IAC1D,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAsC;IAClE,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAwB;IAC7C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAsB;gBAElC,IAAI,GAAE,OAAO,CAAC,qBAAqB,CAAM;IAIrD;;;OAGG;IACH,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI;IA+EjD;;;OAGG;IACH,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI;IAYpD;;OAEG;IACG,IAAI,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAyC3C;;OAEG;IACH,OAAO,IAAI,IAAI;IAOf;;OAEG;IACH,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,QAAQ,EAAE,GAAG,IAAI;IAM5C;;OAEG;IACH,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,IAAI,GAAG,IAAI;IAI1D;;OAEG;IACH,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,IAAI,GAAG,IAAI;IAI3D;;OAEG;IACH,OAAO,CAAC,WAAW;IAQnB;;;OAGG;IACH,OAAO,CAAC,oBAAoB;IA+D5B;;OAEG;YACW,aAAa;IAW3B;;OAEG;IACH,OAAO,CAAC,WAAW;CASpB"}
@@ -8,6 +8,7 @@
8
8
  */
9
9
  import { spawn } from 'node:child_process';
10
10
  import { EventEmitter } from 'node:events';
11
+ import treeKill from 'tree-kill';
11
12
  import { DeploymentState } from '../../../domain/generated/output.js';
12
13
  import { detectDevScript } from './detect-dev-script.js';
13
14
  import { createDeploymentLogger } from './deployment-logger.js';
@@ -19,7 +20,7 @@ const MAX_WAIT_MS = 5000;
19
20
  const defaultDeps = {
20
21
  spawn,
21
22
  detectDevScript,
22
- kill: (pid, signal) => process.kill(pid, signal),
23
+ kill: (pid, signal) => treeKill(pid, signal),
23
24
  isAlive: (pid) => {
24
25
  try {
25
26
  process.kill(pid, 0);
@@ -123,11 +124,11 @@ export class DeploymentService {
123
124
  log.info(`stop("${targetId}") — no deployment found, nothing to stop`);
124
125
  return;
125
126
  }
126
- log.info(`stop("${targetId}") — sending SIGTERM to process group (pid=${entry.pid})`);
127
+ log.info(`stop("${targetId}") — sending SIGTERM to process tree (pid=${entry.pid})`);
127
128
  entry.logs.clear();
128
- // Send SIGTERM to process group
129
+ // Send SIGTERM to process tree (tree-kill handles child processes)
129
130
  try {
130
- this.deps.kill(-entry.pid, 'SIGTERM');
131
+ this.deps.kill(entry.pid, 'SIGTERM');
131
132
  }
132
133
  catch {
133
134
  log.info(`stop("${targetId}") — process already dead on SIGTERM`);
@@ -140,7 +141,7 @@ export class DeploymentService {
140
141
  log.warn(`stop("${targetId}") — process did not exit after ${MAX_WAIT_MS}ms, escalating to SIGKILL`);
141
142
  // Escalate to SIGKILL
142
143
  try {
143
- this.deps.kill(-entry.pid, 'SIGKILL');
144
+ this.deps.kill(entry.pid, 'SIGKILL');
144
145
  }
145
146
  catch {
146
147
  // Process may have exited between check and kill
@@ -183,11 +184,11 @@ export class DeploymentService {
183
184
  this.emitter.off(event, handler);
184
185
  }
185
186
  /**
186
- * Send SIGKILL to a process group.
187
+ * Send SIGKILL to a process tree.
187
188
  */
188
189
  killProcess(entry) {
189
190
  try {
190
- this.deps.kill(-entry.pid, 'SIGKILL');
191
+ this.deps.kill(entry.pid, 'SIGKILL');
191
192
  }
192
193
  catch {
193
194
  // Process may already be dead
@@ -1 +1 @@
1
- {"version":3,"file":"json-driven-ide-launcher.service.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/services/ide-launchers/json-driven-ide-launcher.service.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,OAAO,KAAK,EACV,mBAAmB,EACnB,eAAe,EAChB,MAAM,8EAA8E,CAAC;AAetF;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAGnF;AAED,qBACa,4BAA6B,YAAW,mBAAmB;IACtE,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAwB;;IAiB1C,MAAM,CACV,QAAQ,EAAE,MAAM,EAChB,aAAa,EAAE,MAAM,EACrB,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE,GAC/B,OAAO,CAAC,eAAe,CAAC;IA8D3B,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAWtD"}
1
+ {"version":3,"file":"json-driven-ide-launcher.service.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/services/ide-launchers/json-driven-ide-launcher.service.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH,OAAO,KAAK,EACV,mBAAmB,EACnB,eAAe,EAChB,MAAM,8EAA8E,CAAC;AAetF;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAGnF;AAED,qBACa,4BAA6B,YAAW,mBAAmB;IACtE,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAwB;;IAiB1C,MAAM,CACV,QAAQ,EAAE,MAAM,EAChB,aAAa,EAAE,MAAM,EACrB,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE,GAC/B,OAAO,CAAC,eAAe,CAAC;IA8DrB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAQ5D"}
@@ -16,8 +16,9 @@ var __metadata = (this && this.__metadata) || function (k, v) {
16
16
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
17
17
  };
18
18
  import { injectable } from 'tsyringe';
19
- import { spawn, execFile } from 'node:child_process';
19
+ import { spawn } from 'node:child_process';
20
20
  import { platform } from 'node:os';
21
+ import { checkBinaryExists } from '../tool-installer/binary-exists.js';
21
22
  import { TOOL_METADATA } from '../tool-installer/tool-metadata.js';
22
23
  /**
23
24
  * Resolve a platform-specific value from a string or per-platform record.
@@ -101,16 +102,13 @@ let JsonDrivenIdeLauncherService = class JsonDrivenIdeLauncherService {
101
102
  };
102
103
  }
103
104
  }
104
- checkAvailability(editorId) {
105
+ async checkAvailability(editorId) {
105
106
  const entry = this.editors.get(editorId);
106
107
  if (!entry)
107
- return Promise.resolve(false);
108
+ return false;
108
109
  const binary = resolvePlatformValue(entry.binary);
109
- return new Promise((resolve) => {
110
- execFile('which', [binary], (err) => {
111
- resolve(!err);
112
- });
113
- });
110
+ const result = await checkBinaryExists(binary);
111
+ return result.found;
114
112
  }
115
113
  };
116
114
  JsonDrivenIdeLauncherService = __decorate([
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Cross-platform process tree termination.
3
+ *
4
+ * Re-exports the npm `tree-kill` package for use by the presentation layer,
5
+ * which cannot resolve packages installed in packages/core/node_modules
6
+ * directly (pnpm workspace isolation).
7
+ *
8
+ * Uses taskkill /T /F on Windows, kill/ps/pgrep on Unix.
9
+ */
10
+ import treeKill from 'tree-kill';
11
+ export { treeKill };
12
+ //# sourceMappingURL=tree-kill.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tree-kill.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/services/process/tree-kill.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,QAAQ,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,QAAQ,EAAE,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Cross-platform process tree termination.
3
+ *
4
+ * Re-exports the npm `tree-kill` package for use by the presentation layer,
5
+ * which cannot resolve packages installed in packages/core/node_modules
6
+ * directly (pnpm workspace isolation).
7
+ *
8
+ * Uses taskkill /T /F on Windows, kill/ps/pgrep on Unix.
9
+ */
10
+ import treeKill from 'tree-kill';
11
+ export { treeKill };
@@ -35,7 +35,7 @@ function applyTemplate(template, vars) {
35
35
  return result;
36
36
  }
37
37
  // ─── YAML Templates ────────────────────────────────────────────────
38
- // These match .claude/skills/shep-kit:new-feature/templates/ exactly.
38
+ // These match .claude/skills/shep-kit-new-feature/templates/ exactly.
39
39
  const SPEC_YAML = `# Feature Specification (YAML)
40
40
  # This is the source of truth. Markdown is auto-generated from this file.
41
41
 
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Cross-platform binary existence check.
3
+ *
4
+ * Wraps the npm `which` package to provide a single cross-platform API
5
+ * for checking if a binary exists in the system PATH. Works on Unix
6
+ * (which) and Windows (where.exe + PATHEXT resolution) without platform
7
+ * branching.
8
+ */
9
+ /**
10
+ * Check if a binary exists in the system PATH.
11
+ *
12
+ * Uses the npm `which` package which handles Windows PATHEXT resolution
13
+ * internally (.exe, .cmd, .bat extensions).
14
+ *
15
+ * Returns:
16
+ * - `{ found: true }` when the binary is on PATH
17
+ * - `{ found: false, notInPath: true }` when the binary is not on PATH
18
+ * - `{ found: false, error }` for genuine errors (e.g. permission denied)
19
+ */
20
+ export declare const checkBinaryExists: (binary: string) => Promise<{
21
+ found: boolean;
22
+ notInPath?: boolean;
23
+ error?: Error;
24
+ }>;
25
+ //# sourceMappingURL=binary-exists.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"binary-exists.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/services/tool-installer/binary-exists.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH;;;;;;;;;;GAUG;AACH,eAAO,MAAM,iBAAiB,GAC5B,QAAQ,MAAM,KACb,OAAO,CAAC;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,KAAK,CAAA;CAAE,CAUhE,CAAC"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Cross-platform binary existence check.
3
+ *
4
+ * Wraps the npm `which` package to provide a single cross-platform API
5
+ * for checking if a binary exists in the system PATH. Works on Unix
6
+ * (which) and Windows (where.exe + PATHEXT resolution) without platform
7
+ * branching.
8
+ */
9
+ import which from 'which';
10
+ /**
11
+ * Check if a binary exists in the system PATH.
12
+ *
13
+ * Uses the npm `which` package which handles Windows PATHEXT resolution
14
+ * internally (.exe, .cmd, .bat extensions).
15
+ *
16
+ * Returns:
17
+ * - `{ found: true }` when the binary is on PATH
18
+ * - `{ found: false, notInPath: true }` when the binary is not on PATH
19
+ * - `{ found: false, error }` for genuine errors (e.g. permission denied)
20
+ */
21
+ export const checkBinaryExists = async (binary) => {
22
+ try {
23
+ const result = await which(binary, { nothrow: true });
24
+ if (result !== null) {
25
+ return { found: true };
26
+ }
27
+ return { found: false, notInPath: true };
28
+ }
29
+ catch (error) {
30
+ return { found: false, error: error instanceof Error ? error : new Error(String(error)) };
31
+ }
32
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"tool-installer.service.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/services/tool-installer/tool-installer.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAKH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sEAAsE,CAAC;AAClH,OAAO,KAAK,EACV,sBAAsB,EACtB,kBAAkB,EAEnB,MAAM,qCAAqC,CAAC;AAsD7C,qBACa,wBAAyB,YAAW,qBAAqB;IACpE;;;OAGG;IACG,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAoC1E;;;OAGG;IACH,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,kBAAkB,GAAG,IAAI;IAqB9D;;;OAGG;IACG,cAAc,CAClB,QAAQ,EAAE,MAAM,EAChB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAChC,OAAO,CAAC,sBAAsB,CAAC;IAgFlC;;OAEG;IACH,OAAO,CAAC,6BAA6B;CA4BtC"}
1
+ {"version":3,"file":"tool-installer.service.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/services/tool-installer/tool-installer.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAKH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sEAAsE,CAAC;AAClH,OAAO,KAAK,EACV,sBAAsB,EACtB,kBAAkB,EAEnB,MAAM,qCAAqC,CAAC;AA2B7C,qBACa,wBAAyB,YAAW,qBAAqB;IACpE;;;OAGG;IACG,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAoC1E;;;OAGG;IACH,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,kBAAkB,GAAG,IAAI;IAqB9D;;;OAGG;IACG,cAAc,CAClB,QAAQ,EAAE,MAAM,EAChB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAChC,OAAO,CAAC,sBAAsB,CAAC;IAgFlC;;OAEG;IACH,OAAO,CAAC,6BAA6B;CA4BtC"}
@@ -18,10 +18,11 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
18
18
  return c > 3 && r && Object.defineProperty(target, key, r), r;
19
19
  };
20
20
  import { injectable } from 'tsyringe';
21
- import { exec, execFile, spawn } from 'node:child_process';
21
+ import { exec, spawn } from 'node:child_process';
22
22
  import { platform } from 'node:os';
23
23
  import { createAvailableStatus, createMissingStatus, createErrorStatus, } from '../../../domain/value-objects/tool-installation-status.js';
24
24
  import { TOOL_METADATA } from './tool-metadata.js';
25
+ import { checkBinaryExists } from './binary-exists.js';
25
26
  /**
26
27
  * Resolve binary name for the current platform.
27
28
  * Supports both simple string binaries and per-platform maps.
@@ -31,30 +32,6 @@ function resolveBinary(metadata) {
31
32
  return metadata.binary;
32
33
  return metadata.binary[platform()] ?? Object.values(metadata.binary)[0];
33
34
  }
34
- /**
35
- * Check if a binary exists in the system PATH using 'which' command.
36
- *
37
- * `which` exits with code 1 when the binary is simply not in PATH.
38
- * Node's execFile wraps that as an Error, but it's a normal "not found"
39
- * result. Only truly unexpected failures (ENOENT for `which` itself,
40
- * EACCES, signals, etc.) are surfaced via the `error` field.
41
- */
42
- const checkBinaryExists = (binary) => {
43
- return new Promise((resolve) => {
44
- execFile('which', [binary], (err) => {
45
- if (!err)
46
- return resolve({ found: true });
47
- // execFile errors from a non-zero exit code have a numeric `code` property.
48
- // That's the normal "binary not found in PATH" case.
49
- const code = err.code;
50
- if (code === undefined || typeof code === 'number') {
51
- return resolve({ found: false, notInPath: true });
52
- }
53
- // Anything else (ENOENT for `which` itself, EACCES, etc.) is a real error.
54
- resolve({ found: false, error: err });
55
- });
56
- });
57
- };
58
35
  /**
59
36
  * Run a shell command and resolve true when it exits 0, false otherwise.
60
37
  * Used as a fallback for GUI apps whose binary isn't in PATH (e.g. Warp, iTerm2).
@@ -130,8 +107,8 @@ let ToolInstallerServiceImpl = class ToolInstallerServiceImpl {
130
107
  }
131
108
  return new Promise((resolve) => {
132
109
  let output = '';
133
- const child = spawn('sh', ['-c', installCommand.command], {
134
- shell: false,
110
+ const child = spawn(installCommand.command, [], {
111
+ shell: true,
135
112
  stdio: ['pipe', 'pipe', 'pipe'],
136
113
  env: {
137
114
  ...process.env,
@@ -5,13 +5,14 @@
5
5
  "tags": ["terminal"],
6
6
  "author": "Alacritty Contributors",
7
7
  "website": "https://alacritty.org",
8
- "platforms": ["linux", "darwin"],
8
+ "platforms": ["linux", "darwin", "win32"],
9
9
  "iconUrl": "https://cdn.simpleicons.org/alacritty",
10
10
  "binary": "alacritty",
11
11
  "packageManager": "brew",
12
12
  "commands": {
13
13
  "darwin": "brew install --cask alacritty",
14
- "linux": "sudo apt-get update && sudo apt-get install -y alacritty"
14
+ "linux": "sudo apt-get update && sudo apt-get install -y alacritty",
15
+ "win32": "winget install --id Alacritty.Alacritty -e --source winget"
15
16
  },
16
17
  "timeout": 300000,
17
18
  "documentationUrl": "https://alacritty.org/",
@@ -5,13 +5,14 @@
5
5
  "tags": ["cli-agent"],
6
6
  "author": "Anthropic",
7
7
  "website": "https://claude.ai/code",
8
- "platforms": ["linux", "darwin"],
8
+ "platforms": ["linux", "darwin", "win32"],
9
9
  "iconUrl": "https://cdn.simpleicons.org/claude",
10
10
  "binary": "claude",
11
11
  "packageManager": "curl",
12
12
  "commands": {
13
13
  "linux": "curl -fsSL https://claude.ai/install.sh | bash",
14
- "darwin": "curl -fsSL https://claude.ai/install.sh | bash"
14
+ "darwin": "curl -fsSL https://claude.ai/install.sh | bash",
15
+ "win32": "npm install -g @anthropic-ai/claude-code"
15
16
  },
16
17
  "timeout": 300000,
17
18
  "documentationUrl": "https://code.claude.com/docs/en/overview",
@@ -5,13 +5,14 @@
5
5
  "tags": ["cli-agent"],
6
6
  "author": "Anysphere",
7
7
  "website": "https://cursor.com",
8
- "platforms": ["linux", "darwin"],
8
+ "platforms": ["linux", "darwin", "win32"],
9
9
  "iconUrl": "https://cdn.simpleicons.org/cursor",
10
10
  "binary": "cursor-agent",
11
11
  "packageManager": "curl",
12
12
  "commands": {
13
13
  "linux": "curl https://cursor.com/install -fsS | bash",
14
- "darwin": "curl https://cursor.com/install -fsS | bash"
14
+ "darwin": "curl https://cursor.com/install -fsS | bash",
15
+ "win32": "winget install --id Anysphere.Cursor -e --source winget"
15
16
  },
16
17
  "timeout": 300000,
17
18
  "documentationUrl": "https://www.codecademy.com/article/getting-started-with-cursor-cli",
@@ -11,7 +11,8 @@
11
11
  "packageManager": "manual",
12
12
  "commands": {
13
13
  "linux": "Download from https://cursor.com/download and install the AppImage manually",
14
- "darwin": "Download from https://cursor.com/download or use: brew install --cask cursor"
14
+ "darwin": "Download from https://cursor.com/download or use: brew install --cask cursor",
15
+ "win32": "winget install --id Anysphere.Cursor -e --source winget"
15
16
  },
16
17
  "timeout": 600000,
17
18
  "documentationUrl": "https://cursor.com/download",
@@ -11,7 +11,8 @@
11
11
  "packageManager": "apt",
12
12
  "commands": {
13
13
  "linux": "(type -p wget >/dev/null || (sudo apt update && sudo apt-get install wget -y)) && sudo mkdir -p -m 755 /etc/apt/keyrings && out=$(mktemp) && wget -nv -O$out https://cli.github.com/packages/githubcli-archive-keyring.gpg && cat $out | sudo tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null && sudo chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg && echo \"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main\" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null && sudo apt update && sudo apt install gh -y",
14
- "darwin": "brew install gh"
14
+ "darwin": "brew install gh",
15
+ "win32": "winget install --id GitHub.cli -e --source winget"
15
16
  },
16
17
  "timeout": 300000,
17
18
  "documentationUrl": "https://cli.github.com/manual/",
@@ -11,7 +11,8 @@
11
11
  "packageManager": "apt",
12
12
  "commands": {
13
13
  "linux": "sudo apt-get update && sudo apt-get install -y git",
14
- "darwin": "xcode-select --install"
14
+ "darwin": "xcode-select --install",
15
+ "win32": "winget install --id Git.Git -e --source winget"
15
16
  },
16
17
  "timeout": 300000,
17
18
  "documentationUrl": "https://git-scm.com/doc",
@@ -11,7 +11,8 @@
11
11
  "packageManager": "apt",
12
12
  "commands": {
13
13
  "linux": "curl -fsSL https://packages.microsoft.com/keys/microsoft.asc | sudo gpg --yes --dearmor -o /usr/share/keyrings/packages.microsoft.gpg && echo \"deb [arch=amd64 signed-by=/usr/share/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main\" | sudo tee /etc/apt/sources.list.d/vscode.list > /dev/null && sudo apt-get update && sudo apt-get install -y code",
14
- "darwin": "brew install visual-studio-code"
14
+ "darwin": "brew install visual-studio-code",
15
+ "win32": "winget install --id Microsoft.VisualStudioCode -e --source winget"
15
16
  },
16
17
  "timeout": 300000,
17
18
  "documentationUrl": "https://code.visualstudio.com/docs/setup/linux",
@@ -5,12 +5,13 @@
5
5
  "tags": ["terminal"],
6
6
  "author": "Warp",
7
7
  "website": "https://www.warp.dev",
8
- "platforms": ["darwin"],
8
+ "platforms": ["darwin", "win32"],
9
9
  "iconUrl": "https://cdn.simpleicons.org/warp",
10
10
  "binary": "warp",
11
11
  "packageManager": "brew",
12
12
  "commands": {
13
- "darwin": "brew install --cask warp"
13
+ "darwin": "brew install --cask warp",
14
+ "win32": "winget install --id Warp.Warp -e --source winget"
14
15
  },
15
16
  "timeout": 300000,
16
17
  "documentationUrl": "https://docs.warp.dev/",