@shepai/cli 1.118.0 → 1.119.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 (358) hide show
  1. package/apis/json-schema/PhaseTiming.yaml +22 -1
  2. package/apis/json-schema/WorkflowConfig.yaml +10 -0
  3. package/dist/packages/core/src/application/ports/output/agents/agent-session-repository.interface.d.ts +2 -0
  4. package/dist/packages/core/src/application/ports/output/agents/agent-session-repository.interface.d.ts.map +1 -1
  5. package/dist/packages/core/src/application/ports/output/agents/phase-timing-repository.interface.d.ts +3 -3
  6. package/dist/packages/core/src/application/ports/output/agents/phase-timing-repository.interface.d.ts.map +1 -1
  7. package/dist/packages/core/src/application/ports/output/services/git-pr-service.interface.d.ts +2 -1
  8. package/dist/packages/core/src/application/ports/output/services/git-pr-service.interface.d.ts.map +1 -1
  9. package/dist/packages/core/src/domain/factories/settings-defaults.factory.d.ts.map +1 -1
  10. package/dist/packages/core/src/domain/factories/settings-defaults.factory.js +1 -0
  11. package/dist/packages/core/src/domain/generated/output.d.ts +37 -1
  12. package/dist/packages/core/src/domain/generated/output.d.ts.map +1 -1
  13. package/dist/packages/core/src/infrastructure/persistence/sqlite/mappers/settings.mapper.d.ts +1 -0
  14. package/dist/packages/core/src/infrastructure/persistence/sqlite/mappers/settings.mapper.d.ts.map +1 -1
  15. package/dist/packages/core/src/infrastructure/persistence/sqlite/mappers/settings.mapper.js +2 -0
  16. package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/037-add-ci-watch-enabled.d.ts +11 -0
  17. package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/037-add-ci-watch-enabled.d.ts.map +1 -0
  18. package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/037-add-ci-watch-enabled.js +15 -0
  19. package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/038-add-phase-execution-metadata.d.ts +11 -0
  20. package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/038-add-phase-execution-metadata.d.ts.map +1 -0
  21. package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/038-add-phase-execution-metadata.js +27 -0
  22. package/dist/packages/core/src/infrastructure/repositories/sqlite-phase-timing.repository.d.ts +1 -1
  23. package/dist/packages/core/src/infrastructure/repositories/sqlite-phase-timing.repository.d.ts.map +1 -1
  24. package/dist/packages/core/src/infrastructure/repositories/sqlite-phase-timing.repository.js +32 -0
  25. package/dist/packages/core/src/infrastructure/services/agents/common/executors/dev-executor.service.d.ts.map +1 -1
  26. package/dist/packages/core/src/infrastructure/services/agents/common/executors/dev-executor.service.js +8 -1
  27. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/merge/ci-watch-fix-loop.d.ts.map +1 -1
  28. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/merge/ci-watch-fix-loop.js +3 -2
  29. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/merge/merge.node.d.ts.map +1 -1
  30. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/merge/merge.node.js +29 -7
  31. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/node-helpers.d.ts.map +1 -1
  32. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/node-helpers.js +19 -8
  33. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/prompts/merge-prompts.d.ts +5 -10
  34. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/prompts/merge-prompts.d.ts.map +1 -1
  35. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/prompts/merge-prompts.js +5 -73
  36. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/phase-timing-context.d.ts +17 -3
  37. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/phase-timing-context.d.ts.map +1 -1
  38. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/phase-timing-context.js +11 -3
  39. package/dist/packages/core/src/infrastructure/services/agents/sessions/claude-code-session.repository.d.ts +7 -0
  40. package/dist/packages/core/src/infrastructure/services/agents/sessions/claude-code-session.repository.d.ts.map +1 -1
  41. package/dist/packages/core/src/infrastructure/services/agents/sessions/claude-code-session.repository.js +35 -11
  42. package/dist/packages/core/src/infrastructure/services/git/git-pr.service.d.ts +1 -1
  43. package/dist/packages/core/src/infrastructure/services/git/git-pr.service.d.ts.map +1 -1
  44. package/dist/packages/core/src/infrastructure/services/git/git-pr.service.js +12 -3
  45. package/dist/src/presentation/web/app/(dashboard)/@drawer/create/page.d.ts +1 -0
  46. package/dist/src/presentation/web/app/(dashboard)/@drawer/create/page.d.ts.map +1 -1
  47. package/dist/src/presentation/web/app/(dashboard)/@drawer/create/page.js +2 -2
  48. package/dist/src/presentation/web/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.d.ts.map +1 -1
  49. package/dist/src/presentation/web/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js +1 -0
  50. package/dist/src/presentation/web/app/(dashboard)/@drawer/feature/[featureId]/page.d.ts.map +1 -1
  51. package/dist/src/presentation/web/app/(dashboard)/@drawer/feature/[featureId]/page.js +1 -0
  52. package/dist/src/presentation/web/app/(dashboard)/get-graph-data.d.ts.map +1 -1
  53. package/dist/src/presentation/web/app/(dashboard)/get-graph-data.js +1 -0
  54. package/dist/src/presentation/web/app/actions/get-feature-phase-timings.d.ts +2 -0
  55. package/dist/src/presentation/web/app/actions/get-feature-phase-timings.d.ts.map +1 -1
  56. package/dist/src/presentation/web/app/actions/get-feature-phase-timings.js +2 -0
  57. package/dist/src/presentation/web/app/actions/get-merge-review-data.d.ts.map +1 -1
  58. package/dist/src/presentation/web/app/actions/get-merge-review-data.js +49 -13
  59. package/dist/src/presentation/web/app/actions/get-workflow-defaults.d.ts +1 -0
  60. package/dist/src/presentation/web/app/actions/get-workflow-defaults.d.ts.map +1 -1
  61. package/dist/src/presentation/web/app/actions/get-workflow-defaults.js +1 -0
  62. package/dist/src/presentation/web/app/api/sessions/route.d.ts +24 -0
  63. package/dist/src/presentation/web/app/api/sessions/route.d.ts.map +1 -0
  64. package/dist/src/presentation/web/app/api/sessions/route.js +230 -0
  65. package/dist/src/presentation/web/app/build-feature-node-data.d.ts +2 -0
  66. package/dist/src/presentation/web/app/build-feature-node-data.d.ts.map +1 -1
  67. package/dist/src/presentation/web/app/build-feature-node-data.js +1 -0
  68. package/dist/src/presentation/web/app/build-graph-nodes.d.ts +2 -0
  69. package/dist/src/presentation/web/app/build-graph-nodes.d.ts.map +1 -1
  70. package/dist/src/presentation/web/app/build-graph-nodes.js +11 -0
  71. package/dist/src/presentation/web/components/common/control-center-drawer/create-drawer-client.d.ts +2 -1
  72. package/dist/src/presentation/web/components/common/control-center-drawer/create-drawer-client.d.ts.map +1 -1
  73. package/dist/src/presentation/web/components/common/control-center-drawer/create-drawer-client.js +2 -2
  74. package/dist/src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.d.ts +4 -1
  75. package/dist/src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.d.ts.map +1 -1
  76. package/dist/src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.js +16 -3
  77. package/dist/src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.stories.d.ts.map +1 -1
  78. package/dist/src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.stories.js +1 -0
  79. package/dist/src/presentation/web/components/common/feature-drawer-tabs/activity-tab.d.ts.map +1 -1
  80. package/dist/src/presentation/web/components/common/feature-drawer-tabs/activity-tab.js +36 -10
  81. package/dist/src/presentation/web/components/common/feature-drawer-tabs/feature-drawer-tabs.d.ts.map +1 -1
  82. package/dist/src/presentation/web/components/common/feature-drawer-tabs/feature-drawer-tabs.js +7 -2
  83. package/dist/src/presentation/web/components/common/feature-drawer-tabs/overview-tab.js +2 -1
  84. package/dist/src/presentation/web/components/common/feature-node/feature-node-state-config.d.ts +4 -0
  85. package/dist/src/presentation/web/components/common/feature-node/feature-node-state-config.d.ts.map +1 -1
  86. package/dist/src/presentation/web/components/common/feature-node/feature-node.d.ts.map +1 -1
  87. package/dist/src/presentation/web/components/common/feature-node/feature-node.js +2 -1
  88. package/dist/src/presentation/web/components/common/feature-node/feature-sessions-dropdown.d.ts +21 -0
  89. package/dist/src/presentation/web/components/common/feature-node/feature-sessions-dropdown.d.ts.map +1 -0
  90. package/dist/src/presentation/web/components/common/feature-node/feature-sessions-dropdown.js +138 -0
  91. package/dist/src/presentation/web/components/common/feature-node/feature-sessions-dropdown.stories.d.ts +9 -0
  92. package/dist/src/presentation/web/components/common/feature-node/feature-sessions-dropdown.stories.d.ts.map +1 -0
  93. package/dist/src/presentation/web/components/common/feature-node/feature-sessions-dropdown.stories.js +77 -0
  94. package/dist/src/presentation/web/components/common/merge-review/merge-review-config.d.ts +3 -3
  95. package/dist/src/presentation/web/components/common/merge-review/merge-review-config.d.ts.map +1 -1
  96. package/dist/src/presentation/web/components/common/merge-review/merge-review.d.ts +1 -1
  97. package/dist/src/presentation/web/components/common/merge-review/merge-review.d.ts.map +1 -1
  98. package/dist/src/presentation/web/components/common/merge-review/merge-review.js +14 -20
  99. package/dist/src/presentation/web/components/common/merge-review/merge-review.stories.d.ts +6 -0
  100. package/dist/src/presentation/web/components/common/merge-review/merge-review.stories.d.ts.map +1 -1
  101. package/dist/src/presentation/web/components/common/merge-review/merge-review.stories.js +74 -0
  102. package/dist/src/presentation/web/components/common/repository-node/repository-node.d.ts.map +1 -1
  103. package/dist/src/presentation/web/components/common/repository-node/repository-node.js +35 -2
  104. package/dist/src/presentation/web/components/features/settings/settings-page-client.d.ts.map +1 -1
  105. package/dist/src/presentation/web/components/features/settings/settings-page-client.js +16 -1
  106. package/dist/src/presentation/web/components/features/settings/workflow-settings-section.d.ts.map +1 -1
  107. package/dist/src/presentation/web/components/features/settings/workflow-settings-section.js +6 -1
  108. package/dist/src/presentation/web/components/features/settings/workflow-settings-section.stories.d.ts.map +1 -1
  109. package/dist/src/presentation/web/components/features/settings/workflow-settings-section.stories.js +3 -0
  110. package/dist/tsconfig.build.tsbuildinfo +1 -1
  111. package/package.json +1 -1
  112. package/web/.next/BUILD_ID +1 -1
  113. package/web/.next/app-path-routes-manifest.json +1 -0
  114. package/web/.next/build-manifest.json +2 -2
  115. package/web/.next/fallback-build-manifest.json +2 -2
  116. package/web/.next/prerender-manifest.json +3 -3
  117. package/web/.next/required-server-files.js +2 -2
  118. package/web/.next/required-server-files.json +2 -2
  119. package/web/.next/routes-manifest.json +6 -0
  120. package/web/.next/server/app/(dashboard)/@drawer/create/page/server-reference-manifest.json +21 -21
  121. package/web/.next/server/app/(dashboard)/@drawer/create/page.js +2 -2
  122. package/web/.next/server/app/(dashboard)/@drawer/create/page.js.nft.json +1 -1
  123. package/web/.next/server/app/(dashboard)/@drawer/create/page_client-reference-manifest.js +1 -1
  124. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/server-reference-manifest.json +27 -27
  125. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js +3 -3
  126. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  127. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  128. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/server-reference-manifest.json +27 -27
  129. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js +3 -3
  130. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js.nft.json +1 -1
  131. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page_client-reference-manifest.js +1 -1
  132. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/server-reference-manifest.json +19 -19
  133. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js +2 -2
  134. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js.nft.json +1 -1
  135. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  136. package/web/.next/server/app/(dashboard)/create/page/server-reference-manifest.json +21 -21
  137. package/web/.next/server/app/(dashboard)/create/page.js +2 -2
  138. package/web/.next/server/app/(dashboard)/create/page.js.nft.json +1 -1
  139. package/web/.next/server/app/(dashboard)/create/page_client-reference-manifest.js +1 -1
  140. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/server-reference-manifest.json +27 -27
  141. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js +3 -3
  142. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  143. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  144. package/web/.next/server/app/(dashboard)/feature/[featureId]/page/server-reference-manifest.json +27 -27
  145. package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js +3 -3
  146. package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js.nft.json +1 -1
  147. package/web/.next/server/app/(dashboard)/feature/[featureId]/page_client-reference-manifest.js +1 -1
  148. package/web/.next/server/app/(dashboard)/page/server-reference-manifest.json +19 -19
  149. package/web/.next/server/app/(dashboard)/page.js +2 -2
  150. package/web/.next/server/app/(dashboard)/page.js.nft.json +1 -1
  151. package/web/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
  152. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/server-reference-manifest.json +19 -19
  153. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js +2 -2
  154. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js.nft.json +1 -1
  155. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  156. package/web/.next/server/app/_global-error.html +2 -2
  157. package/web/.next/server/app/_global-error.rsc +1 -1
  158. package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  159. package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  160. package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  161. package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  162. package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  163. package/web/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
  164. package/web/.next/server/app/_not-found/page.js.nft.json +1 -1
  165. package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  166. package/web/.next/server/app/api/attachments/preview/route.js +1 -1
  167. package/web/.next/server/app/api/attachments/preview/route.js.nft.json +1 -1
  168. package/web/.next/server/app/api/evidence/route.js +1 -1
  169. package/web/.next/server/app/api/evidence/route.js.nft.json +1 -1
  170. package/web/.next/server/app/api/graph-data/route.js +1 -1
  171. package/web/.next/server/app/api/graph-data/route.js.nft.json +1 -1
  172. package/web/.next/server/app/api/sessions/route/app-paths-manifest.json +3 -0
  173. package/web/.next/server/app/api/sessions/route/build-manifest.json +11 -0
  174. package/web/.next/server/app/api/sessions/route/server-reference-manifest.json +4 -0
  175. package/web/.next/server/app/api/sessions/route.js +7 -0
  176. package/web/.next/server/app/api/sessions/route.js.map +5 -0
  177. package/web/.next/server/app/api/sessions/route.js.nft.json +1 -0
  178. package/web/.next/server/app/api/sessions/route_client-reference-manifest.js +2 -0
  179. package/web/.next/server/app/settings/page/server-reference-manifest.json +6 -6
  180. package/web/.next/server/app/settings/page.js +1 -1
  181. package/web/.next/server/app/settings/page.js.nft.json +1 -1
  182. package/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  183. package/web/.next/server/app/skills/page/server-reference-manifest.json +6 -6
  184. package/web/.next/server/app/skills/page.js +1 -1
  185. package/web/.next/server/app/skills/page.js.nft.json +1 -1
  186. package/web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  187. package/web/.next/server/app/tools/page/server-reference-manifest.json +6 -6
  188. package/web/.next/server/app/tools/page.js +1 -1
  189. package/web/.next/server/app/tools/page.js.nft.json +1 -1
  190. package/web/.next/server/app/tools/page_client-reference-manifest.js +1 -1
  191. package/web/.next/server/app/version/page/server-reference-manifest.json +1 -1
  192. package/web/.next/server/app/version/page.js +1 -1
  193. package/web/.next/server/app/version/page.js.nft.json +1 -1
  194. package/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
  195. package/web/.next/server/app-paths-manifest.json +1 -0
  196. package/web/.next/server/chunks/403f9_next_dist_esm_build_templates_app-route_370c43b1.js +1 -1
  197. package/web/.next/server/chunks/403f9_next_dist_esm_build_templates_app-route_370c43b1.js.map +1 -1
  198. package/web/.next/server/chunks/[root-of-the-server]__0fe7788d._.js +3 -0
  199. package/web/.next/server/chunks/[root-of-the-server]__0fe7788d._.js.map +1 -0
  200. package/web/.next/server/chunks/[root-of-the-server]__42b7ab55._.js +3 -0
  201. package/web/.next/server/chunks/[root-of-the-server]__42b7ab55._.js.map +1 -0
  202. package/web/.next/server/chunks/{[root-of-the-server]__7d63f9a4._.js → [root-of-the-server]__53013576._.js} +2 -2
  203. package/web/.next/server/chunks/{[root-of-the-server]__a1c7c02a._.js → [root-of-the-server]__92078db6._.js} +2 -2
  204. package/web/.next/server/chunks/[root-of-the-server]__a402b567._.js +1 -1
  205. package/web/.next/server/chunks/[root-of-the-server]__cd67a84c._.js.map +1 -1
  206. package/web/.next/server/chunks/b1a17_presentation_web__next-internal_server_app_api_sessions_route_actions_c041a889.js +3 -0
  207. package/web/.next/server/chunks/b1a17_presentation_web__next-internal_server_app_api_sessions_route_actions_c041a889.js.map +1 -0
  208. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js +1 -1
  209. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js.map +1 -1
  210. package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_@drawer_repository_[repositoryId]_page_actions_ed372306.js +1 -1
  211. package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_@drawer_repository_[repositoryId]_page_actions_ed372306.js.map +1 -1
  212. package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_repository_[repositoryId]_page_actions_32e26434.js +1 -1
  213. package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_repository_[repositoryId]_page_actions_32e26434.js.map +1 -1
  214. package/web/.next/server/chunks/ssr/{[root-of-the-server]__07a39ff2._.js → [root-of-the-server]__06fef644._.js} +2 -2
  215. package/web/.next/server/chunks/ssr/{[root-of-the-server]__07a39ff2._.js.map → [root-of-the-server]__06fef644._.js.map} +1 -1
  216. package/web/.next/server/chunks/ssr/[root-of-the-server]__3b14e5a0._.js +3 -0
  217. package/web/.next/server/chunks/ssr/[root-of-the-server]__3b14e5a0._.js.map +1 -0
  218. package/web/.next/server/chunks/ssr/[root-of-the-server]__545792ab._.js +3 -0
  219. package/web/.next/server/chunks/ssr/[root-of-the-server]__545792ab._.js.map +1 -0
  220. package/web/.next/server/chunks/ssr/[root-of-the-server]__684a868c._.js +1 -1
  221. package/web/.next/server/chunks/ssr/[root-of-the-server]__684a868c._.js.map +1 -1
  222. package/web/.next/server/chunks/ssr/[root-of-the-server]__6b17a22d._.js +1 -1
  223. package/web/.next/server/chunks/ssr/[root-of-the-server]__6b17a22d._.js.map +1 -1
  224. package/web/.next/server/chunks/ssr/[root-of-the-server]__6bb00d90._.js +2 -2
  225. package/web/.next/server/chunks/ssr/[root-of-the-server]__6bb00d90._.js.map +1 -1
  226. package/web/.next/server/chunks/ssr/[root-of-the-server]__804c006d._.js +1 -1
  227. package/web/.next/server/chunks/ssr/[root-of-the-server]__804c006d._.js.map +1 -1
  228. package/web/.next/server/chunks/ssr/[root-of-the-server]__8b59c03e._.js +3 -0
  229. package/web/.next/server/chunks/ssr/[root-of-the-server]__8b59c03e._.js.map +1 -0
  230. package/web/.next/server/chunks/ssr/[root-of-the-server]__8c553503._.js +4 -0
  231. package/web/.next/server/chunks/ssr/{[root-of-the-server]__2ff2daf6._.js.map → [root-of-the-server]__8c553503._.js.map} +1 -1
  232. package/web/.next/server/chunks/ssr/[root-of-the-server]__994ad9fe._.js +3 -0
  233. package/web/.next/server/chunks/ssr/[root-of-the-server]__994ad9fe._.js.map +1 -0
  234. package/web/.next/server/chunks/ssr/[root-of-the-server]__9f155c0e._.js +3 -0
  235. package/web/.next/server/chunks/ssr/[root-of-the-server]__9f155c0e._.js.map +1 -0
  236. package/web/.next/server/chunks/ssr/[root-of-the-server]__a022445f._.js +4 -0
  237. package/web/.next/server/chunks/ssr/[root-of-the-server]__a022445f._.js.map +1 -0
  238. package/web/.next/server/chunks/ssr/[root-of-the-server]__a7de2711._.js +4 -0
  239. package/web/.next/server/chunks/ssr/[root-of-the-server]__a7de2711._.js.map +1 -0
  240. package/web/.next/server/chunks/ssr/[root-of-the-server]__b724df9e._.js +3 -0
  241. package/web/.next/server/chunks/ssr/[root-of-the-server]__b724df9e._.js.map +1 -0
  242. package/web/.next/server/chunks/ssr/[root-of-the-server]__c16bf5de._.js +1 -1
  243. package/web/.next/server/chunks/ssr/[root-of-the-server]__c16bf5de._.js.map +1 -1
  244. package/web/.next/server/chunks/ssr/[root-of-the-server]__c9777776._.js +1 -1
  245. package/web/.next/server/chunks/ssr/[root-of-the-server]__c9777776._.js.map +1 -1
  246. package/web/.next/server/chunks/ssr/[root-of-the-server]__c9c1cfee._.js +3 -0
  247. package/web/.next/server/chunks/ssr/[root-of-the-server]__c9c1cfee._.js.map +1 -0
  248. package/web/.next/server/chunks/ssr/_135edb9c._.js +1 -1
  249. package/web/.next/server/chunks/ssr/_135edb9c._.js.map +1 -1
  250. package/web/.next/server/chunks/ssr/_1bb131c4._.js.map +1 -1
  251. package/web/.next/server/chunks/ssr/_1bb79fe8._.js +3 -0
  252. package/web/.next/server/chunks/ssr/_1bb79fe8._.js.map +1 -0
  253. package/web/.next/server/chunks/ssr/_2f6f48b8._.js +1 -1
  254. package/web/.next/server/chunks/ssr/_2f6f48b8._.js.map +1 -1
  255. package/web/.next/server/chunks/ssr/_59ae996e._.js +3 -0
  256. package/web/.next/server/chunks/ssr/_59ae996e._.js.map +1 -0
  257. package/web/.next/server/chunks/ssr/_75f4ccb3._.js +3 -0
  258. package/web/.next/server/chunks/ssr/_75f4ccb3._.js.map +1 -0
  259. package/web/.next/server/chunks/ssr/_ab069e13._.js +3 -0
  260. package/web/.next/server/chunks/ssr/_ab069e13._.js.map +1 -0
  261. package/web/.next/server/chunks/ssr/{_5f868392._.js → _aeb74a70._.js} +2 -2
  262. package/web/.next/server/chunks/ssr/_aeb74a70._.js.map +1 -0
  263. package/web/.next/server/chunks/ssr/_bed4bbb9._.js +3 -0
  264. package/web/.next/server/chunks/ssr/_bed4bbb9._.js.map +1 -0
  265. package/web/.next/server/chunks/ssr/_cc77a143._.js +1 -1
  266. package/web/.next/server/chunks/ssr/_cc77a143._.js.map +1 -1
  267. package/web/.next/server/chunks/ssr/_f605354c._.js +9 -0
  268. package/web/.next/server/chunks/ssr/_f605354c._.js.map +1 -0
  269. package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js +1 -1
  270. package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js.map +1 -1
  271. package/web/.next/server/chunks/ssr/node_modules__pnpm_b59e4b16._.js +3 -0
  272. package/web/.next/server/chunks/ssr/node_modules__pnpm_b59e4b16._.js.map +1 -0
  273. package/web/.next/server/chunks/ssr/src_presentation_web_0835b28e._.js +2 -2
  274. package/web/.next/server/chunks/ssr/src_presentation_web_0835b28e._.js.map +1 -1
  275. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_e99d78dd.js +1 -1
  276. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_e99d78dd.js.map +1 -1
  277. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1fa8042e.js +1 -1
  278. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1fa8042e.js.map +1 -1
  279. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_24684200.js +1 -1
  280. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_24684200.js.map +1 -1
  281. package/web/.next/server/chunks/ssr/src_presentation_web_ca99d62d._.js +1 -1
  282. package/web/.next/server/chunks/ssr/src_presentation_web_ca99d62d._.js.map +1 -1
  283. package/web/.next/server/chunks/ssr/src_presentation_web_components_bdcfba35._.js +3 -0
  284. package/web/.next/server/chunks/ssr/src_presentation_web_components_bdcfba35._.js.map +1 -0
  285. package/web/.next/server/chunks/ssr/src_presentation_web_components_bf50c527._.js +1 -1
  286. package/web/.next/server/chunks/ssr/src_presentation_web_components_de814675._.js +1 -1
  287. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js +1 -1
  288. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js.map +1 -1
  289. package/web/.next/server/chunks/ssr/src_presentation_web_e8034a29._.js +2 -2
  290. package/web/.next/server/chunks/ssr/src_presentation_web_e8034a29._.js.map +1 -1
  291. package/web/.next/server/pages/500.html +2 -2
  292. package/web/.next/server/server-reference-manifest.js +1 -1
  293. package/web/.next/server/server-reference-manifest.json +33 -33
  294. package/web/.next/static/chunks/1c5310cfde612b81.js +1 -0
  295. package/web/.next/static/chunks/{da24af4a494de11a.js → 2b35632c1b784fae.js} +1 -1
  296. package/web/.next/static/chunks/{dc81cb5172953533.js → 30097f88cdf8fad8.js} +1 -1
  297. package/web/.next/static/chunks/3678617c34576e18.js +2 -0
  298. package/web/.next/static/chunks/4562ee849ea13c3a.js +1 -0
  299. package/web/.next/static/chunks/{169d4ce4e5fa10d2.js → 69c6d3ba1606e98d.js} +1 -1
  300. package/web/.next/static/chunks/{bf46b5bf0d9d43b3.js → 7c57a9143e66868c.js} +2 -2
  301. package/web/.next/static/chunks/845d8e58a91014e6.js +1 -0
  302. package/web/.next/static/chunks/{7ce5aacd9b492e8c.js → c1a6934d2281c088.js} +1 -1
  303. package/web/.next/static/chunks/c4477c532d2081e8.js +1 -0
  304. package/web/.next/static/chunks/cca0f5112a9260d8.js +1 -0
  305. package/web/.next/static/chunks/d2739454715e5ef2.css +1 -0
  306. package/web/.next/static/chunks/ed113fb744f2e4d8.js +11 -0
  307. package/web/.next/static/chunks/{9285299c4fb0f020.js → f3c4a7bb76c69b01.js} +1 -1
  308. package/web/.next/server/chunks/[root-of-the-server]__7d5492a0._.js +0 -3
  309. package/web/.next/server/chunks/[root-of-the-server]__7d5492a0._.js.map +0 -1
  310. package/web/.next/server/chunks/ssr/7f428_lucide-react_dist_esm_icons_rocket_1575cd4d.js +0 -3
  311. package/web/.next/server/chunks/ssr/7f428_lucide-react_dist_esm_icons_rocket_1575cd4d.js.map +0 -1
  312. package/web/.next/server/chunks/ssr/[root-of-the-server]__2ff2daf6._.js +0 -4
  313. package/web/.next/server/chunks/ssr/[root-of-the-server]__3155add4._.js +0 -3
  314. package/web/.next/server/chunks/ssr/[root-of-the-server]__3155add4._.js.map +0 -1
  315. package/web/.next/server/chunks/ssr/[root-of-the-server]__6367aea0._.js +0 -3
  316. package/web/.next/server/chunks/ssr/[root-of-the-server]__6367aea0._.js.map +0 -1
  317. package/web/.next/server/chunks/ssr/[root-of-the-server]__7b707feb._.js +0 -4
  318. package/web/.next/server/chunks/ssr/[root-of-the-server]__7b707feb._.js.map +0 -1
  319. package/web/.next/server/chunks/ssr/[root-of-the-server]__8763fd7a._.js +0 -4
  320. package/web/.next/server/chunks/ssr/[root-of-the-server]__8763fd7a._.js.map +0 -1
  321. package/web/.next/server/chunks/ssr/[root-of-the-server]__9c56d724._.js +0 -3
  322. package/web/.next/server/chunks/ssr/[root-of-the-server]__9c56d724._.js.map +0 -1
  323. package/web/.next/server/chunks/ssr/[root-of-the-server]__cfc116d5._.js +0 -3
  324. package/web/.next/server/chunks/ssr/[root-of-the-server]__cfc116d5._.js.map +0 -1
  325. package/web/.next/server/chunks/ssr/[root-of-the-server]__d3841d9e._.js +0 -3
  326. package/web/.next/server/chunks/ssr/[root-of-the-server]__d3841d9e._.js.map +0 -1
  327. package/web/.next/server/chunks/ssr/[root-of-the-server]__db9afe04._.js +0 -3
  328. package/web/.next/server/chunks/ssr/[root-of-the-server]__db9afe04._.js.map +0 -1
  329. package/web/.next/server/chunks/ssr/_250a63ae._.js +0 -3
  330. package/web/.next/server/chunks/ssr/_250a63ae._.js.map +0 -1
  331. package/web/.next/server/chunks/ssr/_273d4632._.js +0 -3
  332. package/web/.next/server/chunks/ssr/_273d4632._.js.map +0 -1
  333. package/web/.next/server/chunks/ssr/_5f868392._.js.map +0 -1
  334. package/web/.next/server/chunks/ssr/_922aa39f._.js +0 -3
  335. package/web/.next/server/chunks/ssr/_922aa39f._.js.map +0 -1
  336. package/web/.next/server/chunks/ssr/_a68d7e1c._.js +0 -9
  337. package/web/.next/server/chunks/ssr/_a68d7e1c._.js.map +0 -1
  338. package/web/.next/server/chunks/ssr/_c6ec0fa4._.js +0 -3
  339. package/web/.next/server/chunks/ssr/_c6ec0fa4._.js.map +0 -1
  340. package/web/.next/server/chunks/ssr/_ca5a8b32._.js +0 -3
  341. package/web/.next/server/chunks/ssr/_ca5a8b32._.js.map +0 -1
  342. package/web/.next/server/chunks/ssr/_f5316e67._.js +0 -3
  343. package/web/.next/server/chunks/ssr/_f5316e67._.js.map +0 -1
  344. package/web/.next/server/chunks/ssr/src_presentation_web_components_a5e6c910._.js +0 -3
  345. package/web/.next/server/chunks/ssr/src_presentation_web_components_a5e6c910._.js.map +0 -1
  346. package/web/.next/static/chunks/15a2249cbec45bee.js +0 -11
  347. package/web/.next/static/chunks/3a806cf059241bc9.js +0 -1
  348. package/web/.next/static/chunks/3fb7682246dbaf45.js +0 -1
  349. package/web/.next/static/chunks/55c131b6fc504375.js +0 -1
  350. package/web/.next/static/chunks/59e6b9b540f05bf1.js +0 -1
  351. package/web/.next/static/chunks/62a8173911f8f130.css +0 -1
  352. package/web/.next/static/chunks/b1f3c0e8e9872ef8.js +0 -1
  353. package/web/.next/static/chunks/f7577de2f653acfc.js +0 -2
  354. /package/web/.next/server/chunks/{[root-of-the-server]__7d63f9a4._.js.map → [root-of-the-server]__53013576._.js.map} +0 -0
  355. /package/web/.next/server/chunks/{[root-of-the-server]__a1c7c02a._.js.map → [root-of-the-server]__92078db6._.js.map} +0 -0
  356. /package/web/.next/static/{akrvSvVQ4BzHsJ1sA0rS7 → qmHUdyRBvaVksgjcL6w-m}/_buildManifest.js +0 -0
  357. /package/web/.next/static/{akrvSvVQ4BzHsJ1sA0rS7 → qmHUdyRBvaVksgjcL6w-m}/_clientMiddlewareManifest.json +0 -0
  358. /package/web/.next/static/{akrvSvVQ4BzHsJ1sA0rS7 → qmHUdyRBvaVksgjcL6w-m}/_ssgManifest.js +0 -0
@@ -1,4 +1,4 @@
1
1
  module.exports=[74533,(a,b,c)=>{b.exports=a.x("node:child_process",()=>require("node:child_process"))},92658,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"registerServerReference",{enumerable:!0,get:function(){return d.registerServerReference}});let d=a.r(28478)},12581,(a,b,c)=>{"use strict";function d(a){for(let b=0;b<a.length;b++){let c=a[b];if("function"!=typeof c)throw Object.defineProperty(Error(`A "use server" file can only export async functions, found ${typeof c}.
2
- Read more: https://nextjs.org/docs/messages/invalid-use-server-value`),"__NEXT_ERROR_CODE",{value:"E352",enumerable:!1,configurable:!0})}}Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"ensureServerEntryExports",{enumerable:!0,get:function(){return d}})},12513,a=>{"use strict";var b=a.i(92658),c=a.i(74533);let d={platform:process.platform,exec:(a,b)=>(0,c.execSync)(a,b)},e={darwin:"osascript -e 'POSIX path of (choose folder with prompt \"Select a repository folder\")'",linux:'zenity --file-selection --directory --title="Select a repository folder" 2>/dev/null',win32:"powershell -NoProfile -Command \"Add-Type -AssemblyName System.Windows.Forms; $f = New-Object System.Windows.Forms.FolderBrowserDialog; $f.Description = 'Select a repository folder'; if ($f.ShowDialog() -eq 'OK') { $f.SelectedPath } else { exit 1 }\""};class f{deps;constructor(a={}){this.deps={...d,...a}}getCommand(){return e[this.deps.platform]??null}pickFolder(){let a=this.getCommand();if(!a)throw Error(`Unsupported platform: ${this.deps.platform}`);try{let b=this.deps.exec(a,{encoding:"utf-8",timeout:6e4}).trim();return b.length>0?b:null}catch(a){var b;if("object"==typeof(b=a)&&null!==b&&"status"in b&&1===a.status)return null;throw a}}}async function g(){let a=new f;try{return{path:a.pickFolder()}}catch(a){return{path:null,error:a instanceof Error?a.message:"Failed to open folder dialog"}}}(0,a.i(12581).ensureServerEntryExports)([g]),(0,b.registerServerReference)(g,"0037950abfc38f16ef684f0d18955e7cb7805d4752",null),a.s(["pickFolder",()=>g],12513)},86139,a=>{"use strict";var b=a.i(12513);a.s([],53565),a.i(53565),a.s(["0037950abfc38f16ef684f0d18955e7cb7805d4752",()=>b.pickFolder],86139)}];
2
+ Read more: https://nextjs.org/docs/messages/invalid-use-server-value`),"__NEXT_ERROR_CODE",{value:"E352",enumerable:!1,configurable:!0})}}Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"ensureServerEntryExports",{enumerable:!0,get:function(){return d}})},12513,a=>{"use strict";var b=a.i(92658),c=a.i(74533);let d={platform:process.platform,exec:(a,b)=>(0,c.execSync)(a,b)},e={darwin:"osascript -e 'POSIX path of (choose folder with prompt \"Select a repository folder\")'",linux:'zenity --file-selection --directory --title="Select a repository folder" 2>/dev/null',win32:"powershell -NoProfile -Command \"Add-Type -AssemblyName System.Windows.Forms; $f = New-Object System.Windows.Forms.FolderBrowserDialog; $f.Description = 'Select a repository folder'; if ($f.ShowDialog() -eq 'OK') { $f.SelectedPath } else { exit 1 }\""};class f{deps;constructor(a={}){this.deps={...d,...a}}getCommand(){return e[this.deps.platform]??null}pickFolder(){let a=this.getCommand();if(!a)throw Error(`Unsupported platform: ${this.deps.platform}`);try{let b=this.deps.exec(a,{encoding:"utf-8",timeout:6e4}).trim();return b.length>0?b:null}catch(a){var b;if("object"==typeof(b=a)&&null!==b&&"status"in b&&1===a.status)return null;throw a}}}async function g(){let a=new f;try{return{path:a.pickFolder()}}catch(a){return{path:null,error:a instanceof Error?a.message:"Failed to open folder dialog"}}}(0,a.i(12581).ensureServerEntryExports)([g]),(0,b.registerServerReference)(g,"00d33ce7fe440a4d4e55d65f865c1f22282142eb69",null),a.s(["pickFolder",()=>g],12513)},86139,a=>{"use strict";var b=a.i(12513);a.s([],53565),a.i(53565),a.s(["00d33ce7fe440a4d4e55d65f865c1f22282142eb69",()=>b.pickFolder],86139)}];
3
3
 
4
4
  //# sourceMappingURL=%5Broot-of-the-server%5D__804c006d._.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../node_modules/.pnpm/next%4016.1.6_%40babel%2Bcore%407.29.0_%40playwright%2Btest%401.58.1_react-dom%4019.2.4_react%4019.2.4__react%4019.2.4/node_modules/next/src/build/webpack/loaders/next-flight-loader/server-reference.ts","../../../../../../../node_modules/.pnpm/next%4016.1.6_%40babel%2Bcore%407.29.0_%40playwright%2Btest%401.58.1_react-dom%4019.2.4_react%4019.2.4__react%4019.2.4/node_modules/next/src/build/webpack/loaders/next-flight-loader/action-validate.ts","../../../../../../../packages/core/src/infrastructure/services/folder-dialog.service.ts","../../../../../../../src/presentation/web/app/actions/pick-folder.ts","../../../../../../../src/presentation/web/.next-internal/server/app/version/page/actions.js%20%28server%20actions%20loader%29"],"sourcesContent":["/* eslint-disable import/no-extraneous-dependencies */\nexport { registerServerReference } from 'react-server-dom-webpack/server'\n","// This function ensures that all the exported values are valid server actions,\n// during the runtime. By definition all actions are required to be async\n// functions, but here we can only check that they are functions.\nexport function ensureServerEntryExports(actions: any[]) {\n for (let i = 0; i < actions.length; i++) {\n const action = actions[i]\n if (typeof action !== 'function') {\n throw new Error(\n `A \"use server\" file can only export async functions, found ${typeof action}.\\nRead more: https://nextjs.org/docs/messages/invalid-use-server-value`\n )\n }\n }\n}\n","import { execSync } from 'node:child_process';\n\nexport interface FolderDialogDeps {\n platform: NodeJS.Platform;\n exec: (cmd: string, opts?: { encoding: BufferEncoding; timeout?: number }) => string;\n}\n\nconst defaultDeps: FolderDialogDeps = {\n platform: process.platform,\n exec: (cmd, opts) => execSync(cmd, opts) as unknown as string,\n};\n\n/**\n * Platform-specific commands that open a native OS folder picker dialog.\n * Each returns the chosen absolute folder path on stdout, or exits non-zero / returns empty on cancel.\n */\nconst PLATFORM_COMMANDS: Record<string, string> = {\n darwin: `osascript -e 'POSIX path of (choose folder with prompt \"Select a repository folder\")'`,\n linux: `zenity --file-selection --directory --title=\"Select a repository folder\" 2>/dev/null`,\n win32: `powershell -NoProfile -Command \"Add-Type -AssemblyName System.Windows.Forms; $f = New-Object System.Windows.Forms.FolderBrowserDialog; $f.Description = 'Select a repository folder'; if ($f.ShowDialog() -eq 'OK') { $f.SelectedPath } else { exit 1 }\"`,\n};\n\nexport class FolderDialogService {\n private deps: FolderDialogDeps;\n\n constructor(deps: Partial<FolderDialogDeps> = {}) {\n this.deps = { ...defaultDeps, ...deps };\n }\n\n /** Returns the OS-specific command string, or null if the platform is unsupported. */\n getCommand(): string | null {\n return PLATFORM_COMMANDS[this.deps.platform] ?? null;\n }\n\n /**\n * Opens a native folder picker dialog and returns the selected absolute path.\n * Returns `null` if the user cancels the dialog.\n * Throws if the platform is unsupported or the command fails unexpectedly.\n */\n pickFolder(): string | null {\n const command = this.getCommand();\n if (!command) {\n throw new Error(`Unsupported platform: ${this.deps.platform}`);\n }\n\n try {\n const result = this.deps.exec(command, { encoding: 'utf-8', timeout: 60_000 });\n const trimmed = result.trim();\n return trimmed.length > 0 ? trimmed : null;\n } catch (error: unknown) {\n // User cancelled the dialog — exit code 1 from osascript/zenity/powershell\n if (isExecError(error) && error.status === 1) {\n return null;\n }\n throw error;\n }\n }\n}\n\nfunction isExecError(error: unknown): error is { status: number } {\n return typeof error === 'object' && error !== null && 'status' in error;\n}\n","'use server';\n\nimport { FolderDialogService } from '@shepai/core/infrastructure/services/folder-dialog.service';\n\nexport async function pickFolder(): Promise<{ path: string | null; error?: string }> {\n const service = new FolderDialogService();\n\n try {\n const path = service.pickFolder();\n return { path };\n } catch (error: unknown) {\n const message = error instanceof Error ? error.message : 'Failed to open folder dialog';\n return { path: null, error: message };\n }\n}\n","export {pickFolder as '0037950abfc38f16ef684f0d18955e7cb7805d4752'} from 'ACTIONS_MODULE0'\n"],"names":["registerServerReference","ensureServerEntryExports","actions","i","length","action","Error"],"mappings":"oIAAoD,OAAA,cAAA,CAAA,EAAA,aAAA,oCAC3CA,0BAAAA,qCAAAA,EAAAA,uBAAuB,YAAQ,CAAA,CAAA,IAAA,iCCEjC,SAASC,EAAyBC,CAAc,EACrD,IAAK,IAAIC,EAAI,EAAGA,EAAID,EAAQE,MAAM,CAAED,IAAK,CACvC,IAAME,EAASH,CAAO,CAACC,EAAE,CACzB,GAAI,AAAkB,YAAY,OAAvBE,EACT,MAAM,OAAA,cAEL,CAFK,AAAIC,MACR,CAAC,2DAA2D,EAAE,OAAOD,EAAO;AAAA,oEAAuE,CAAC,EADhJ,oBAAA,OAAA,mBAAA,gBAAA,CAEN,EAEJ,CACF,0EATgBJ,2BAAAA,qCAAAA,8CCHhB,EAAA,EAAA,CAAA,CAAA,OAOA,IAAM,EAAgC,CACpC,SAAU,QAAQ,QAAQ,CAC1B,KAAM,CAAC,EAAK,IAAS,CAAA,EAAA,EAAA,QAAQ,AAAR,EAAS,EAAK,EACrC,EAMM,EAA4C,CAChD,OAAQ,CAAC,qFAAqF,CAAC,GAC/F,MAAO,CAAC,oFAAoF,CAAC,CAC7F,MAAO,CAAC,wPAAwP,CAAC,EACnQ,CAEO,OAAM,EACH,IAAuB,AAE/B,aAAY,EAAkC,CAAC,CAAC,CAAE,CAChD,IAAI,CAAC,IAAI,CAAG,CAAE,GAAG,CAAW,CAAE,GAAG,CAAI,AAAC,CACxC,CAGA,YAA4B,CAC1B,OAAO,CAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAI,IAClD,CAOA,YAA4B,CAC1B,IAAM,EAAU,IAAI,CAAC,UAAU,GAC/B,GAAI,CAAC,EACH,MAAM,AAAI,CADE,KACI,CAAC,sBAAsB,EAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAA,CAAE,EAG/D,GAAI,CAEF,IAAM,EADS,AACC,IADG,CAAC,IAAI,CAAC,IAAI,CAAC,EAAS,CAAE,SAAU,QAAS,QAAS,GAAO,GACrD,IAAI,GAC3B,OAAO,EAAQ,MAAM,CAAG,EAAI,EAAU,IACxC,CAAE,MAAO,EAAgB,OAEvB,GAAI,AASgB,UAAjB,OADY,AACL,EATM,GAQa,CACa,OAAV,GAAkB,WAAY,GATnB,GAAG,CAApB,EAAM,MAAM,CACpC,OAAO,IAET,OAAM,CACR,CACF,CACF,CCrDO,eAAe,IACpB,IAAM,EAAU,IAAI,EAEpB,GAAI,CAEF,MAAO,CAAE,KADI,EAAQ,UAAU,EACjB,CAChB,CAAE,MAAO,EAAgB,CAEvB,MAAO,CAAE,KAAM,KAAM,MADL,CACY,YADK,MAAQ,EAAM,OAAO,CAAG,8BACrB,CACtC,CACF,0CAVsB,IAAA,CAAA,EAAA,EAAA,uBAAA,EAAA,EAAA,6CAAA,8DCJtB,IAAA,EAAA,EAAA,CAAA,CAAA","ignoreList":[0,1]}
1
+ {"version":3,"sources":["../../../../../../../node_modules/.pnpm/next%4016.1.6_%40babel%2Bcore%407.29.0_%40playwright%2Btest%401.58.1_react-dom%4019.2.4_react%4019.2.4__react%4019.2.4/node_modules/next/src/build/webpack/loaders/next-flight-loader/server-reference.ts","../../../../../../../node_modules/.pnpm/next%4016.1.6_%40babel%2Bcore%407.29.0_%40playwright%2Btest%401.58.1_react-dom%4019.2.4_react%4019.2.4__react%4019.2.4/node_modules/next/src/build/webpack/loaders/next-flight-loader/action-validate.ts","../../../../../../../packages/core/src/infrastructure/services/folder-dialog.service.ts","../../../../../../../src/presentation/web/app/actions/pick-folder.ts","../../../../../../../src/presentation/web/.next-internal/server/app/version/page/actions.js%20%28server%20actions%20loader%29"],"sourcesContent":["/* eslint-disable import/no-extraneous-dependencies */\nexport { registerServerReference } from 'react-server-dom-webpack/server'\n","// This function ensures that all the exported values are valid server actions,\n// during the runtime. By definition all actions are required to be async\n// functions, but here we can only check that they are functions.\nexport function ensureServerEntryExports(actions: any[]) {\n for (let i = 0; i < actions.length; i++) {\n const action = actions[i]\n if (typeof action !== 'function') {\n throw new Error(\n `A \"use server\" file can only export async functions, found ${typeof action}.\\nRead more: https://nextjs.org/docs/messages/invalid-use-server-value`\n )\n }\n }\n}\n","import { execSync } from 'node:child_process';\n\nexport interface FolderDialogDeps {\n platform: NodeJS.Platform;\n exec: (cmd: string, opts?: { encoding: BufferEncoding; timeout?: number }) => string;\n}\n\nconst defaultDeps: FolderDialogDeps = {\n platform: process.platform,\n exec: (cmd, opts) => execSync(cmd, opts) as unknown as string,\n};\n\n/**\n * Platform-specific commands that open a native OS folder picker dialog.\n * Each returns the chosen absolute folder path on stdout, or exits non-zero / returns empty on cancel.\n */\nconst PLATFORM_COMMANDS: Record<string, string> = {\n darwin: `osascript -e 'POSIX path of (choose folder with prompt \"Select a repository folder\")'`,\n linux: `zenity --file-selection --directory --title=\"Select a repository folder\" 2>/dev/null`,\n win32: `powershell -NoProfile -Command \"Add-Type -AssemblyName System.Windows.Forms; $f = New-Object System.Windows.Forms.FolderBrowserDialog; $f.Description = 'Select a repository folder'; if ($f.ShowDialog() -eq 'OK') { $f.SelectedPath } else { exit 1 }\"`,\n};\n\nexport class FolderDialogService {\n private deps: FolderDialogDeps;\n\n constructor(deps: Partial<FolderDialogDeps> = {}) {\n this.deps = { ...defaultDeps, ...deps };\n }\n\n /** Returns the OS-specific command string, or null if the platform is unsupported. */\n getCommand(): string | null {\n return PLATFORM_COMMANDS[this.deps.platform] ?? null;\n }\n\n /**\n * Opens a native folder picker dialog and returns the selected absolute path.\n * Returns `null` if the user cancels the dialog.\n * Throws if the platform is unsupported or the command fails unexpectedly.\n */\n pickFolder(): string | null {\n const command = this.getCommand();\n if (!command) {\n throw new Error(`Unsupported platform: ${this.deps.platform}`);\n }\n\n try {\n const result = this.deps.exec(command, { encoding: 'utf-8', timeout: 60_000 });\n const trimmed = result.trim();\n return trimmed.length > 0 ? trimmed : null;\n } catch (error: unknown) {\n // User cancelled the dialog — exit code 1 from osascript/zenity/powershell\n if (isExecError(error) && error.status === 1) {\n return null;\n }\n throw error;\n }\n }\n}\n\nfunction isExecError(error: unknown): error is { status: number } {\n return typeof error === 'object' && error !== null && 'status' in error;\n}\n","'use server';\n\nimport { FolderDialogService } from '@shepai/core/infrastructure/services/folder-dialog.service';\n\nexport async function pickFolder(): Promise<{ path: string | null; error?: string }> {\n const service = new FolderDialogService();\n\n try {\n const path = service.pickFolder();\n return { path };\n } catch (error: unknown) {\n const message = error instanceof Error ? error.message : 'Failed to open folder dialog';\n return { path: null, error: message };\n }\n}\n","export {pickFolder as '00d33ce7fe440a4d4e55d65f865c1f22282142eb69'} from 'ACTIONS_MODULE0'\n"],"names":["registerServerReference","ensureServerEntryExports","actions","i","length","action","Error"],"mappings":"oIAAoD,OAAA,cAAA,CAAA,EAAA,aAAA,oCAC3CA,0BAAAA,qCAAAA,EAAAA,uBAAuB,YAAQ,CAAA,CAAA,IAAA,iCCEjC,SAASC,EAAyBC,CAAc,EACrD,IAAK,IAAIC,EAAI,EAAGA,EAAID,EAAQE,MAAM,CAAED,IAAK,CACvC,IAAME,EAASH,CAAO,CAACC,EAAE,CACzB,GAAI,AAAkB,YAAY,OAAvBE,EACT,MAAM,OAAA,cAEL,CAFK,AAAIC,MACR,CAAC,2DAA2D,EAAE,OAAOD,EAAO;AAAA,oEAAuE,CAAC,EADhJ,oBAAA,OAAA,mBAAA,gBAAA,CAEN,EAEJ,CACF,0EATgBJ,2BAAAA,qCAAAA,8CCHhB,EAAA,EAAA,CAAA,CAAA,OAOA,IAAM,EAAgC,CACpC,SAAU,QAAQ,QAAQ,CAC1B,KAAM,CAAC,EA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@@
1
+ module.exports=[31747,a=>{"use strict";var b=a.i(81719),c=a.i(14703),d=a.i(79372);function e(a,e,f){let g=(e?.status===b.AgentRunStatus.running||e?.status===b.AgentRunStatus.pending)&&e?.pid?(0,d.isProcessAlive)(e.pid):void 0;return{name:a.name,description:a.description??a.slug,featureId:a.id,lifecycle:(0,c.deriveLifecycle)(a,e),repositoryPath:a.repositoryPath,branch:a.branch,specPath:a.specPath,state:(0,c.deriveNodeState)(a,e,void 0!==g?{isPidAlive:g}:void 0),progress:(0,c.deriveProgress)(a),summary:a.description,userQuery:a.userQuery,createdAt:a.createdAt instanceof Date?a.createdAt.getTime():a.createdAt,...a.fast&&{fastMode:!0},approvalGates:a.approvalGates,push:a.push,openPr:a.openPr,...f?.enableEvidence!=null&&{enableEvidence:f.enableEvidence},...f?.commitEvidence!=null&&{commitEvidence:f.commitEvidence},...f?.ciWatchEnabled!=null&&{ciWatchEnabled:f.ciWatchEnabled},...f?.repositoryName&&{repositoryName:f.repositoryName},...f?.baseBranch&&{baseBranch:f.baseBranch},...f?.oneLiner&&{oneLiner:f.oneLiner},...f?.remoteUrl&&{remoteUrl:f.remoteUrl},...e?.agentType&&{agentType:e.agentType},...e?.modelId&&{modelId:e.modelId},...e?.error&&{errorMessage:e.error},...null!=a.plan&&{hasPlan:!0},...a.pr&&{pr:{url:a.pr.url,number:a.pr.number,status:a.pr.status,ciStatus:a.pr.ciStatus,commitHash:a.pr.commitHash,mergeable:a.pr.mergeable}}}}a.s(["buildFeatureNodeData",()=>e])},61402,76052,13008,74607,6542,740,12104,54433,a=>{"use strict";var b=a.i(92658),c=a.i(96380),d=a.i(12581);async function e(a,b){if(!a.trim())return{approved:!1,error:"Feature id is required"};try{let d=(0,c.resolve)("IFeatureRepository"),e=await d.findById(a);if(!e)return{approved:!1,error:"Feature not found"};if(!e.agentRunId)return{approved:!1,error:"Feature has no agent run"};let f=(0,c.resolve)("ApproveAgentRunUseCase"),g=await f.execute(e.agentRunId,b);if(!g.approved)return{approved:!1,error:g.reason};return{approved:!0}}catch(a){return{approved:!1,error:a instanceof Error?a.message:"Failed to approve feature"}}}async function f(a,b,d){if(!a.trim())return{rejected:!1,error:"Feature id is required"};if(!b.trim())return{rejected:!1,error:"Feedback is required"};try{let e=(0,c.resolve)("IFeatureRepository"),f=await e.findById(a);if(!f)return{rejected:!1,error:"Feature not found"};if(!f.agentRunId)return{rejected:!1,error:"Feature has no agent run"};let g=(0,c.resolve)("RejectAgentRunUseCase"),h=await g.execute(f.agentRunId,b,d);if(!h.rejected)return{rejected:!1,error:h.reason};return{rejected:!0,iteration:h.iteration,iterationWarning:h.iterationWarning}}catch(a){return{rejected:!1,error:a instanceof Error?a.message:"Failed to reject feature"}}}async function g(a){if(!a.trim())return{error:"Feature id is required"};try{let b=(0,c.resolve)("GetFeatureArtifactUseCase"),d=await b.execute(a),e={question:"Goal",context:d.oneLiner,questions:d.openQuestions.map((a,b)=>({id:`q-${b}`,question:a.question,type:"select",options:(a.options??[]).map((a,c)=>({id:`q-${b}-opt-${c}`,label:a.option,rationale:a.description,...a.selected?{recommended:!0}:{}}))})),finalAction:{id:"approve-reqs",label:"Approve Requirements",description:"Finalize and lock the requirements for implementation"}},f={question:"Goal",context:d.oneLiner,questions:d.openQuestions.filter(a=>a.resolved).map(a=>{let b=a.options?.find(a=>a.selected);return{question:a.question,selectedOption:b?.option??a.answer??"N/A",rationale:a.selectionRationale??b?.description??"",wasRecommended:!1}})};return{questionnaire:e,productDecisions:f,artifact:d}}catch(a){return{error:a instanceof Error?a.message:"Failed to load feature artifact"}}}async function h(a){if(!a.trim())return{error:"Feature id is required"};try{var b;let d=(0,c.resolve)("GetResearchArtifactUseCase");return{techDecisions:{name:(b=await d.execute(a)).name,summary:b.summary,decisions:b.decisions,technologies:b.technologies}}}catch(a){return{error:a instanceof Error?a.message:"Failed to load research artifact"}}}(0,d.ensureServerEntryExports)([e]),(0,b.registerServerReference)(e,"6061a1bdf48e7a187d3c2e02b93c9b90738b8e243e",null),a.s(["approveFeature",()=>e],61402),(0,d.ensureServerEntryExports)([f]),(0,b.registerServerReference)(f,"7035fb61dfb18a61df1343dbcdc64e3b199138f5da",null),a.s(["rejectFeature",()=>f],76052),(0,d.ensureServerEntryExports)([g]),(0,b.registerServerReference)(g,"40357238e71028fac79c645f852368bdced0aa13d7",null),a.s(["getFeatureArtifact",()=>g],13008),(0,d.ensureServerEntryExports)([h]),(0,b.registerServerReference)(h,"406fc98a613a6f207e3bdc0ced1e686ffbb03f9bd8",null),a.s(["getResearchArtifact",()=>h],74607);var i=a.i(66680),j=a.i(2157),k=a.i(50227),l=a.i(29918),m=a.i(32278);async function n(a){if(!a.trim())return{error:"Feature id is required"};try{var b,d;let e,f,g=(0,c.resolve)("IFeatureRepository"),h=await g.findById(a);if(!h)return{error:"Feature not found"};let n=h.pr?{url:h.pr.url,number:h.pr.number,status:h.pr.status,commitHash:h.pr.commitHash,ciStatus:h.pr.ciStatus,mergeable:h.pr.mergeable}:void 0,o=h.branch?{source:h.branch,target:"main"}:void 0,p=h.worktreePath??(h.repositoryPath&&h.branch?(0,l.computeWorktreePath)(h.repositoryPath,h.branch):null),q=h.repositoryPath?(b=h.repositoryPath,f=(0,i.createHash)("sha256").update(b).digest("hex").slice(0,16),(0,k.join)((0,m.getShepHomeDir)(),"repos",f,"evidence",a).replace(/\\/g,"/")):p?(0,k.join)((0,k.dirname)((0,k.dirname)(p)),"evidence",a).replace(/\\/g,"/"):null;if(q)try{let a=(0,k.join)(q,"manifest.json");(0,j.existsSync)(a)&&(d=JSON.parse((0,j.readFileSync)(a,"utf-8")),e=d.map(a=>{if(a.relativePath.startsWith("/")){if((0,j.existsSync)(a.relativePath))return a;let b=(0,k.join)(q,(0,k.basename)(a.relativePath)).replace(/\\/g,"/");return(0,j.existsSync)(b)?{...a,relativePath:b}:a}let b=(0,k.join)(q,(0,k.basename)(a.relativePath)).replace(/\\/g,"/");return{...a,relativePath:b}}))}catch{}if(!p)return{pr:n,branch:o,evidence:e,warning:n?void 0:"No PR or diff data available"};try{let a=(0,c.resolve)("IGitPrService"),[b,d]=await Promise.all([a.getPrDiffSummary(p,"main"),a.getFileDiffs(p,"main").catch(()=>void 0)]);return{pr:n,branch:o,diffSummary:b,fileDiffs:d,evidence:e}}catch{return{pr:n,branch:o,evidence:e,warning:"Diff statistics unavailable"}}}catch(a){return{error:a instanceof Error?a.message:"Failed to load merge review data"}}}async function o(a){if(!a.trim())return{error:"Feature id is required"};try{let b=(0,c.resolve)("IPhaseTimingRepository"),d=(await b.findByFeatureId(a)).map(a=>({agentRunId:a.agentRunId,phase:a.phase,startedAt:a.startedAt,completedAt:a.completedAt,durationMs:null!=a.durationMs?Number(a.durationMs):void 0,waitingApprovalAt:a.waitingApprovalAt,approvalWaitMs:null!=a.approvalWaitMs?Number(a.approvalWaitMs):void 0,inputTokens:null!=a.inputTokens?Number(a.inputTokens):void 0,outputTokens:null!=a.outputTokens?Number(a.outputTokens):void 0})),e=await p(a);return{timings:d,rejectionFeedback:e}}catch(a){return{error:a instanceof Error?a.message:"Failed to load phase timings"}}}async function p(b){try{let d=(0,c.resolve)("IFeatureRepository"),e=await d.findById(b);if(!e?.specPath)return[];let{readFileSync:f}=await a.A(6714),{join:g}=await a.A(11105),h=(await a.A(29718)).default,i=f(g(e.specPath,"spec.yaml"),"utf-8"),j=h.load(i);if(!Array.isArray(j?.rejectionFeedback))return[];return j.rejectionFeedback.map(a=>({iteration:Number(a.iteration??1),message:String(a.message??""),phase:a.phase?String(a.phase):void 0,timestamp:a.timestamp?String(a.timestamp):void 0,attachments:Array.isArray(a.attachments)?a.attachments.map(String):void 0}))}catch{return[]}}async function q(a){if(!a.trim())return{error:"Feature id is required"};try{let b=(0,c.resolve)("IFeatureRepository"),d=await b.findById(a);if(!d)return{error:"Feature not found"};if(!d.plan)return{plan:void 0};return{plan:{state:d.plan.state,overview:d.plan.overview,tasks:d.plan.tasks.map(a=>({title:a.title??"",description:a.description??"",state:a.state,actionItems:(a.actionItems??[]).map(a=>({name:a.name,description:a.description,acceptanceCriteria:(a.acceptanceCriteria??[]).map(a=>({description:a.description,verified:a.verified}))}))}))}}}catch(a){return{error:a instanceof Error?a.message:"Failed to load feature plan"}}}(0,d.ensureServerEntryExports)([n]),(0,b.registerServerReference)(n,"402874b2bbc860ff2a557c75e1580f61d03dadbc11",null),a.s(["getMergeReviewData",()=>n],6542),(0,d.ensureServerEntryExports)([o]),(0,b.registerServerReference)(o,"409ae8631dd66ef4036d0d9d922fc2c24cb344d13c",null),a.s(["getFeaturePhaseTimings",()=>o],740),(0,d.ensureServerEntryExports)([q]),(0,b.registerServerReference)(q,"40902286e33d2278cd76407142168234afce2450b5",null),a.s(["getFeaturePlan",()=>q],12104);var r=a.i(31747),s=a.i(33244);async function t(a){try{let b=(0,c.resolve)("IFeatureRepository"),d=(0,c.resolve)("IAgentRunRepository"),e=(0,c.resolve)("IRepositoryRepository"),f=(0,c.resolve)("IGitPrService"),g=(0,c.resolve)("GetFeatureArtifactUseCase"),h=await b.findById(a);if(!h)return null;let i=h.agentRunId?await d.findById(h.agentRunId):null,[j,k,l,m]=await Promise.all([e.findByPath(h.repositoryPath).catch(()=>null),f.getDefaultBranch(h.repositoryPath).catch(()=>"main"),g.execute(a).catch(()=>null),f.getRemoteUrl(h.repositoryPath).catch(()=>null)]),{workflow:n}=(0,s.getSettings)();return(0,r.buildFeatureNodeData)(h,i,{repositoryName:j?.name,baseBranch:k,oneLiner:l?.oneLiner,remoteUrl:m??void 0,enableEvidence:n.enableEvidence,commitEvidence:n.commitEvidence})}catch{return null}}(0,d.ensureServerEntryExports)([t]),(0,b.registerServerReference)(t,"405ef365874e67155b4b7e0077d0cc59b5e4dc7e2f",null),a.s(["getFeatureDrawerData",()=>t],54433)},2243,a=>{"use strict";var b=a.i(12513),c=a.i(94691),d=a.i(33841),e=a.i(46646),f=a.i(68670),g=a.i(85321),h=a.i(84095),i=a.i(56799),j=a.i(80496),k=a.i(41872),l=a.i(9959),m=a.i(23504),n=a.i(27900),o=a.i(50845),p=a.i(26604),q=a.i(54723),r=a.i(49560),s=a.i(39353),t=a.i(29207),u=a.i(61402),v=a.i(76052),w=a.i(13008),x=a.i(74607),y=a.i(6542),z=a.i(740),A=a.i(12104),B=a.i(54433);a.s([],69210),a.i(69210),a.s(["000091d01c4c0addfba03a24acc2a50d2250ea644f",()=>k.isAgentSetupComplete,"0001aa3186d88ffd6a6ecc56b4e0a9291659773c55",()=>m.getAllAgentModels,"00b72044c095acd5ae935a6a82077d3017ffdb1e52",()=>l.checkAgentAuth,"00d33ce7fe440a4d4e55d65f865c1f22282142eb69",()=>b.pickFolder,"4014ab1b94b133351b1455fab9508732c54cfa4404",()=>j.openFolder,"4017aa4e8e7a621babeb50836c6ecea68032a1a223",()=>s.deleteRepository,"40192e8ab56a976d7b4ab02e5ac4e86b81844753c0",()=>c.getDeploymentLogs,"4023507b2023a0497138424d17b98825c8a34fea63",()=>t.getFeatureMetadata,"402874b2bbc860ff2a557c75e1580f61d03dadbc11",()=>y.getMergeReviewData,"40357238e71028fac79c645f852368bdced0aa13d7",()=>w.getFeatureArtifact,"403b7d14d71a50b757c8522b059b3e4a5e38ca630f",()=>p.resumeFeature,"404482b612d7fe0416d9267ac8ae08eff97c415cb8",()=>q.startFeature,"405ef365874e67155b4b7e0077d0cc59b5e4dc7e2f",()=>B.getFeatureDrawerData,"406fc98a613a6f207e3bdc0ced1e686ffbb03f9bd8",()=>x.getResearchArtifact,"407be534406b318f0e53b8cf725a013960c34c4eab",()=>e.deployRepository,"408ac7d206a1f4cb627a91f3253487c4ce8f30344b",()=>i.openShell,"40902286e33d2278cd76407142168234afce2450b5",()=>A.getFeaturePlan,"409ae8631dd66ef4036d0d9d922fc2c24cb344d13c",()=>z.getFeaturePhaseTimings,"40c56f5c3a822bb270b79ce59904bd1a4547ae8dd4",()=>d.deployFeature,"40d09eba9db80f1749ca75d8a81bf4ecfe354213f4",()=>r.addRepository,"40d59de3ebfc390247f9ec9e895121aa1e442bb248",()=>h.openIde,"40e8b017976f8965562a10c76df713c49c812175a5",()=>f.stopDeployment,"40edcd4f8ffa551f80627eea24794aeb5eb5b4bf1d",()=>g.getDeploymentStatus,"603ee219eebb20f5875fe7610d566307abd16e5c79",()=>n.updateAgentAndModel,"6061a1bdf48e7a187d3c2e02b93c9b90738b8e243e",()=>u.approveFeature,"7035fb61dfb18a61df1343dbcdc64e3b199138f5da",()=>v.rejectFeature,"70c01a5598d1f60b9749f583a466fdd9c7149baf07",()=>o.deleteFeature],2243)},6714,a=>{a.v(a=>Promise.resolve().then(()=>a(2157)))},11105,a=>{a.v(a=>Promise.resolve().then(()=>a(50227)))},29718,a=>{a.v(b=>Promise.all(["server/chunks/ssr/90b01_js-yaml_dist_js-yaml_mjs_c897fb57._.js"].map(b=>a.l(b))).then(()=>b(32996)))}];
2
+
3
+ //# sourceMappingURL=%5Broot-of-the-server%5D__8b59c03e._.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../src/presentation/web/app/build-feature-node-data.ts","../../../../../../../src/presentation/web/app/actions/approve-feature.ts","../../../../../../../src/presentation/web/app/actions/reject-feature.ts","../../../../../../../src/presentation/web/app/actions/get-feature-artifact.ts","../../../../../../../src/presentation/web/app/actions/get-research-artifact.ts","../../../../../../../src/presentation/web/app/actions/get-merge-review-data.ts","../../../../../../../src/presentation/web/app/actions/get-feature-phase-timings.ts","../../../../../../../src/presentation/web/app/actions/get-feature-plan.ts","../../../../../../../src/presentation/web/app/actions/get-feature-drawer-data.ts","../../../../../../../src/presentation/web/.next-internal/server/app/%28dashboard%29/%40drawer/feature/%5BfeatureId%5D/%5Btab%5D/page/actions.js%20%28server%20actions%20loader%29"],"sourcesContent":["import type { Feature, AgentRun } from '@shepai/core/domain/generated/output';\nimport { AgentRunStatus } from '@shepai/core/domain/generated/output';\nimport {\n deriveNodeState,\n deriveProgress,\n deriveLifecycle,\n} from '@/components/common/feature-node/derive-feature-state';\nimport { isProcessAlive } from '@shepai/core/infrastructure/services/process/is-process-alive';\nimport type { FeatureNodeData } from '@/components/common/feature-node';\n\nexport interface BuildFeatureNodeDataOptions {\n baseBranch?: string;\n repositoryName?: string;\n /** AI-generated one-liner from FeatureArtifact */\n oneLiner?: string;\n /** Remote URL for the repository (HTTPS) */\n remoteUrl?: string;\n /** Whether evidence collection is enabled (global workflow setting) */\n enableEvidence?: boolean;\n /** Whether evidence is committed to the PR body (global workflow setting) */\n commitEvidence?: boolean;\n /** Whether CI watch/fix loop is enabled (global workflow setting) */\n ciWatchEnabled?: boolean;\n}\n\n/**\n * Builds a FeatureNodeData object from a Feature entity and optional AgentRun.\n * This is the single-feature version of the logic in `buildGraphNodes`.\n */\nexport function buildFeatureNodeData(\n feature: Feature,\n run: AgentRun | null,\n options?: BuildFeatureNodeDataOptions\n): FeatureNodeData {\n // Detect crashed agents: DB says running/pending but PID is dead\n const isActive = run?.status === AgentRunStatus.running || run?.status === AgentRunStatus.pending;\n const pidAlive = isActive && run?.pid ? isProcessAlive(run.pid) : undefined;\n\n return {\n name: feature.name,\n description: feature.description ?? feature.slug,\n featureId: feature.id,\n lifecycle: deriveLifecycle(feature, run),\n repositoryPath: feature.repositoryPath,\n branch: feature.branch,\n specPath: feature.specPath,\n state: deriveNodeState(\n feature,\n run,\n pidAlive !== undefined ? { isPidAlive: pidAlive } : undefined\n ),\n progress: deriveProgress(feature),\n summary: feature.description,\n userQuery: feature.userQuery,\n createdAt: feature.createdAt instanceof Date ? feature.createdAt.getTime() : feature.createdAt,\n ...(feature.fast && { fastMode: true }),\n approvalGates: feature.approvalGates,\n push: feature.push,\n openPr: feature.openPr,\n ...(options?.enableEvidence != null && { enableEvidence: options.enableEvidence }),\n ...(options?.commitEvidence != null && { commitEvidence: options.commitEvidence }),\n ...(options?.ciWatchEnabled != null && { ciWatchEnabled: options.ciWatchEnabled }),\n ...(options?.repositoryName && { repositoryName: options.repositoryName }),\n ...(options?.baseBranch && { baseBranch: options.baseBranch }),\n ...(options?.oneLiner && { oneLiner: options.oneLiner }),\n ...(options?.remoteUrl && { remoteUrl: options.remoteUrl }),\n ...(run?.agentType && { agentType: run.agentType as FeatureNodeData['agentType'] }),\n ...(run?.modelId && { modelId: run.modelId }),\n ...(run?.error && { errorMessage: run.error }),\n ...(feature.plan != null && { hasPlan: true }),\n ...(feature.pr && {\n pr: {\n url: feature.pr.url,\n number: feature.pr.number,\n status: feature.pr.status,\n ciStatus: feature.pr.ciStatus,\n commitHash: feature.pr.commitHash,\n mergeable: feature.pr.mergeable,\n },\n }),\n };\n}\n","'use server';\n\nimport { resolve } from '@/lib/server-container';\nimport type { ApproveAgentRunUseCase } from '@shepai/core/application/use-cases/agents/approve-agent-run.use-case';\nimport type { IFeatureRepository } from '@shepai/core/application/ports/output/repositories/feature-repository.interface';\nimport type { PrdApprovalPayload } from '@shepai/core/domain/generated/output';\n\nexport async function approveFeature(\n featureId: string,\n payload?: PrdApprovalPayload\n): Promise<{ approved: boolean; error?: string }> {\n if (!featureId.trim()) {\n return { approved: false, error: 'Feature id is required' };\n }\n\n try {\n const featureRepo = resolve<IFeatureRepository>('IFeatureRepository');\n const feature = await featureRepo.findById(featureId);\n\n if (!feature) {\n return { approved: false, error: 'Feature not found' };\n }\n\n if (!feature.agentRunId) {\n return { approved: false, error: 'Feature has no agent run' };\n }\n\n const approveUseCase = resolve<ApproveAgentRunUseCase>('ApproveAgentRunUseCase');\n const result = await approveUseCase.execute(feature.agentRunId, payload);\n\n if (!result.approved) {\n return { approved: false, error: result.reason };\n }\n\n return { approved: true };\n } catch (error: unknown) {\n const message = error instanceof Error ? error.message : 'Failed to approve feature';\n return { approved: false, error: message };\n }\n}\n","'use server';\n\nimport { resolve } from '@/lib/server-container';\nimport type { RejectAgentRunUseCase } from '@shepai/core/application/use-cases/agents/reject-agent-run.use-case';\nimport type { IFeatureRepository } from '@shepai/core/application/ports/output/repositories/feature-repository.interface';\n\nexport async function rejectFeature(\n featureId: string,\n feedback: string,\n attachments?: string[]\n): Promise<{\n rejected: boolean;\n iteration?: number;\n iterationWarning?: boolean;\n error?: string;\n}> {\n if (!featureId.trim()) {\n return { rejected: false, error: 'Feature id is required' };\n }\n\n if (!feedback.trim()) {\n return { rejected: false, error: 'Feedback is required' };\n }\n\n try {\n const featureRepo = resolve<IFeatureRepository>('IFeatureRepository');\n const feature = await featureRepo.findById(featureId);\n\n if (!feature) {\n return { rejected: false, error: 'Feature not found' };\n }\n\n if (!feature.agentRunId) {\n return { rejected: false, error: 'Feature has no agent run' };\n }\n\n const rejectUseCase = resolve<RejectAgentRunUseCase>('RejectAgentRunUseCase');\n const result = await rejectUseCase.execute(feature.agentRunId, feedback, attachments);\n\n if (!result.rejected) {\n return { rejected: false, error: result.reason };\n }\n\n return {\n rejected: true,\n iteration: result.iteration,\n iterationWarning: result.iterationWarning,\n };\n } catch (error: unknown) {\n const message = error instanceof Error ? error.message : 'Failed to reject feature';\n return { rejected: false, error: message };\n }\n}\n","'use server';\n\nimport { resolve } from '@/lib/server-container';\nimport type { GetFeatureArtifactUseCase } from '@shepai/core/application/use-cases/features/get-feature-artifact.use-case';\nimport type { FeatureArtifact } from '@shepai/core/domain/generated/output';\nimport type { PrdQuestionnaireData } from '@shepai/core/domain/generated/output';\nimport type { ProductDecisionsSummaryData } from '@/components/common/product-decisions-summary';\n\ninterface GetFeatureArtifactResult {\n questionnaire?: PrdQuestionnaireData;\n productDecisions?: ProductDecisionsSummaryData;\n artifact?: FeatureArtifact;\n error?: string;\n}\n\n/**\n * Map FeatureArtifact openQuestions into the PrdQuestionnaireData shape\n * expected by the PrdQuestionnaireDrawer component.\n */\nfunction toQuestionnaireData(artifact: FeatureArtifact): PrdQuestionnaireData {\n return {\n question: 'Goal',\n context: artifact.oneLiner,\n questions: artifact.openQuestions.map((oq, idx) => ({\n id: `q-${idx}`,\n question: oq.question,\n type: 'select' as const,\n options: (oq.options ?? []).map((opt, optIdx) => ({\n id: `q-${idx}-opt-${optIdx}`,\n label: opt.option,\n rationale: opt.description,\n ...(opt.selected ? { recommended: true } : {}),\n })),\n })),\n finalAction: {\n id: 'approve-reqs',\n label: 'Approve Requirements',\n description: 'Finalize and lock the requirements for implementation',\n },\n };\n}\n\n/**\n * Map FeatureArtifact openQuestions into a read-only summary for the\n * Product Decisions tab in the tech review drawer.\n */\nfunction toProductDecisionsData(artifact: FeatureArtifact): ProductDecisionsSummaryData {\n return {\n question: 'Goal',\n context: artifact.oneLiner,\n questions: artifact.openQuestions\n .filter((oq) => oq.resolved)\n .map((oq) => {\n const selected = oq.options?.find((o) => o.selected);\n return {\n question: oq.question,\n selectedOption: selected?.option ?? oq.answer ?? 'N/A',\n rationale: oq.selectionRationale ?? selected?.description ?? '',\n wasRecommended: false,\n };\n }),\n };\n}\n\nexport async function getFeatureArtifact(featureId: string): Promise<GetFeatureArtifactResult> {\n if (!featureId.trim()) {\n return { error: 'Feature id is required' };\n }\n\n try {\n const useCase = resolve<GetFeatureArtifactUseCase>('GetFeatureArtifactUseCase');\n const artifact = await useCase.execute(featureId);\n const questionnaire = toQuestionnaireData(artifact);\n const productDecisions = toProductDecisionsData(artifact);\n return { questionnaire, productDecisions, artifact };\n } catch (error: unknown) {\n const message = error instanceof Error ? error.message : 'Failed to load feature artifact';\n return { error: message };\n }\n}\n","'use server';\n\nimport { resolve } from '@/lib/server-container';\nimport type { GetResearchArtifactUseCase } from '@shepai/core/application/use-cases/features/get-research-artifact.use-case';\nimport type { ResearchArtifact, TechDecision } from '@shepai/core/domain/generated/output';\n\nexport interface TechDecisionsReviewData {\n name: string;\n summary: string;\n decisions: TechDecision[];\n technologies: string[];\n}\n\ninterface GetResearchArtifactResult {\n techDecisions?: TechDecisionsReviewData;\n error?: string;\n}\n\nfunction toTechDecisionsData(artifact: ResearchArtifact): TechDecisionsReviewData {\n return {\n name: artifact.name,\n summary: artifact.summary,\n decisions: artifact.decisions,\n technologies: artifact.technologies,\n };\n}\n\nexport async function getResearchArtifact(featureId: string): Promise<GetResearchArtifactResult> {\n if (!featureId.trim()) {\n return { error: 'Feature id is required' };\n }\n\n try {\n const useCase = resolve<GetResearchArtifactUseCase>('GetResearchArtifactUseCase');\n const artifact = await useCase.execute(featureId);\n const techDecisions = toTechDecisionsData(artifact);\n return { techDecisions };\n } catch (error: unknown) {\n const message = error instanceof Error ? error.message : 'Failed to load research artifact';\n return { error: message };\n }\n}\n","'use server';\n\nimport { createHash } from 'node:crypto';\nimport { readFileSync, existsSync } from 'node:fs';\nimport { basename, join, dirname } from 'node:path';\nimport { resolve } from '@/lib/server-container';\nimport type { IFeatureRepository } from '@shepai/core/application/ports/output/repositories/feature-repository.interface';\nimport type { IGitPrService } from '@shepai/core/application/ports/output/services/git-pr-service.interface';\nimport type {\n MergeReviewData,\n MergeReviewEvidence,\n} from '@/components/common/merge-review/merge-review-config';\nimport { computeWorktreePath } from '@shepai/core/infrastructure/services/ide-launchers/compute-worktree-path';\nimport { getShepHomeDir } from '@shepai/core/infrastructure/services/filesystem/shep-directory.service';\n\ntype GetMergeReviewDataResult = MergeReviewData | { error: string };\n\n/**\n * Compute the shep evidence directory for a given repository and feature.\n * Path: ~/.shep/repos/<sha256-hash-prefix>/evidence/<featureId>/\n */\nfunction computeEvidenceDir(repositoryPath: string, featureId: string): string {\n const repoHash = createHash('sha256').update(repositoryPath).digest('hex').slice(0, 16);\n return join(getShepHomeDir(), 'repos', repoHash, 'evidence', featureId).replace(/\\\\/g, '/');\n}\n\n/**\n * Normalize evidence paths so they all point to the shep evidence directory.\n * When commitEvidence was enabled, the manifest may contain relative paths\n * (e.g. \"specs/066-feature/evidence/file.png\"). After merge the worktree is\n * deleted so those paths no longer resolve. The evidence files were also saved\n * to the shep evidence dir with the same filename, so we map relative paths\n * to absolute paths there.\n */\nfunction normalizeEvidencePaths(\n evidence: MergeReviewEvidence[],\n evidenceDir: string\n): MergeReviewEvidence[] {\n return evidence.map((e) => {\n if (e.relativePath.startsWith('/')) {\n // Already absolute — check if the file exists; if not, try the evidence dir\n if (existsSync(e.relativePath)) return e;\n const fallback = join(evidenceDir, basename(e.relativePath)).replace(/\\\\/g, '/');\n if (existsSync(fallback)) return { ...e, relativePath: fallback };\n return e;\n }\n // Relative path — resolve to evidence dir using the filename\n const absolutePath = join(evidenceDir, basename(e.relativePath)).replace(/\\\\/g, '/');\n return { ...e, relativePath: absolutePath };\n });\n}\n\nexport async function getMergeReviewData(featureId: string): Promise<GetMergeReviewDataResult> {\n if (!featureId.trim()) {\n return { error: 'Feature id is required' };\n }\n\n try {\n const featureRepo = resolve<IFeatureRepository>('IFeatureRepository');\n const feature = await featureRepo.findById(featureId);\n\n if (!feature) {\n return { error: 'Feature not found' };\n }\n\n const pr = feature.pr\n ? {\n url: feature.pr.url,\n number: feature.pr.number,\n status: feature.pr.status,\n commitHash: feature.pr.commitHash,\n ciStatus: feature.pr.ciStatus,\n mergeable: feature.pr.mergeable,\n }\n : undefined;\n\n const branch = feature.branch ? { source: feature.branch, target: 'main' } : undefined;\n\n const worktreePath =\n feature.worktreePath ??\n (feature.repositoryPath && feature.branch\n ? computeWorktreePath(feature.repositoryPath, feature.branch)\n : null);\n\n // Load evidence manifest (best-effort).\n // Evidence is stored independently of the worktree at:\n // ~/.shep/repos/<hash>/evidence/<featureId>/manifest.json\n // We compute this path from repositoryPath so evidence is accessible\n // even after the worktree has been deleted post-merge.\n let evidence: MergeReviewEvidence[] | undefined;\n const evidenceDir = feature.repositoryPath\n ? computeEvidenceDir(feature.repositoryPath, featureId)\n : worktreePath\n ? join(dirname(dirname(worktreePath)), 'evidence', featureId).replace(/\\\\/g, '/')\n : null;\n\n if (evidenceDir) {\n try {\n const manifestPath = join(evidenceDir, 'manifest.json');\n if (existsSync(manifestPath)) {\n const raw: MergeReviewEvidence[] = JSON.parse(readFileSync(manifestPath, 'utf-8'));\n evidence = normalizeEvidencePaths(raw, evidenceDir);\n }\n } catch {\n // Evidence unavailable — not critical\n }\n }\n\n if (!worktreePath) {\n return {\n pr,\n branch,\n evidence,\n warning: pr ? undefined : 'No PR or diff data available',\n };\n }\n\n try {\n const gitPrService = resolve<IGitPrService>('IGitPrService');\n const [diffSummary, fileDiffs] = await Promise.all([\n gitPrService.getPrDiffSummary(worktreePath, 'main'),\n gitPrService.getFileDiffs(worktreePath, 'main').catch(() => undefined),\n ]);\n return { pr, branch, diffSummary, fileDiffs, evidence };\n } catch {\n return {\n pr,\n branch,\n evidence,\n warning: 'Diff statistics unavailable',\n };\n }\n } catch (error: unknown) {\n const message = error instanceof Error ? error.message : 'Failed to load merge review data';\n return { error: message };\n }\n}\n","'use server';\n\nimport { resolve } from '@/lib/server-container';\nimport type { IPhaseTimingRepository } from '@shepai/core/application/ports/output/agents/phase-timing-repository.interface';\nimport type { IFeatureRepository } from '@shepai/core/application/ports/output/repositories/feature-repository.interface';\n\nexport interface PhaseTimingData {\n agentRunId: string;\n phase: string;\n startedAt: string;\n completedAt?: string;\n durationMs?: number;\n waitingApprovalAt?: string;\n approvalWaitMs?: number;\n inputTokens?: number;\n outputTokens?: number;\n}\n\nexport interface RejectionFeedbackData {\n iteration: number;\n message: string;\n phase?: string;\n timestamp?: string;\n attachments?: string[];\n}\n\ntype GetPhaseTimingsResult =\n | { timings: PhaseTimingData[]; rejectionFeedback: RejectionFeedbackData[] }\n | { error: string };\n\nexport async function getFeaturePhaseTimings(featureId: string): Promise<GetPhaseTimingsResult> {\n if (!featureId.trim()) {\n return { error: 'Feature id is required' };\n }\n\n try {\n const repo = resolve<IPhaseTimingRepository>('IPhaseTimingRepository');\n const phaseTimings = await repo.findByFeatureId(featureId);\n\n const timings: PhaseTimingData[] = phaseTimings.map((t) => ({\n agentRunId: t.agentRunId,\n phase: t.phase,\n startedAt: t.startedAt,\n completedAt: t.completedAt,\n durationMs: t.durationMs != null ? Number(t.durationMs) : undefined,\n waitingApprovalAt: t.waitingApprovalAt,\n approvalWaitMs: t.approvalWaitMs != null ? Number(t.approvalWaitMs) : undefined,\n inputTokens: t.inputTokens != null ? Number(t.inputTokens) : undefined,\n outputTokens: t.outputTokens != null ? Number(t.outputTokens) : undefined,\n }));\n\n // Read rejection feedback from spec.yaml\n const rejectionFeedback = await readRejectionFeedback(featureId);\n\n return { timings, rejectionFeedback };\n } catch (error: unknown) {\n const message = error instanceof Error ? error.message : 'Failed to load phase timings';\n return { error: message };\n }\n}\n\nasync function readRejectionFeedback(featureId: string): Promise<RejectionFeedbackData[]> {\n try {\n const featureRepo = resolve<IFeatureRepository>('IFeatureRepository');\n const feature = await featureRepo.findById(featureId);\n if (!feature?.specPath) return [];\n\n const { readFileSync } = await import('node:fs');\n const { join } = await import('node:path');\n const yaml = (await import('js-yaml')).default;\n\n const specContent = readFileSync(join(feature.specPath, 'spec.yaml'), 'utf-8');\n const spec = yaml.load(specContent) as Record<string, unknown>;\n\n if (!Array.isArray(spec?.rejectionFeedback)) return [];\n\n return (spec.rejectionFeedback as Record<string, unknown>[]).map((entry) => ({\n iteration: Number(entry.iteration ?? 1),\n message: String(entry.message ?? ''),\n phase: entry.phase ? String(entry.phase) : undefined,\n timestamp: entry.timestamp ? String(entry.timestamp) : undefined,\n attachments: Array.isArray(entry.attachments)\n ? (entry.attachments as unknown[]).map(String)\n : undefined,\n }));\n } catch {\n return [];\n }\n}\n","'use server';\n\nimport { resolve } from '@/lib/server-container';\nimport type { IFeatureRepository } from '@shepai/core/application/ports/output/repositories/feature-repository.interface';\n\nexport interface AcceptanceCriterionData {\n description: string;\n verified: boolean;\n}\n\nexport interface ActionItemData {\n name: string;\n description: string;\n acceptanceCriteria: AcceptanceCriterionData[];\n}\n\nexport interface PlanTaskData {\n title: string;\n description: string;\n state: string;\n actionItems: ActionItemData[];\n}\n\nexport interface PlanData {\n state: string;\n overview: string;\n tasks: PlanTaskData[];\n}\n\ntype GetPlanResult = { plan: PlanData | undefined } | { error: string };\n\nexport async function getFeaturePlan(featureId: string): Promise<GetPlanResult> {\n if (!featureId.trim()) {\n return { error: 'Feature id is required' };\n }\n\n try {\n const repo = resolve<IFeatureRepository>('IFeatureRepository');\n const feature = await repo.findById(featureId);\n\n if (!feature) {\n return { error: 'Feature not found' };\n }\n\n if (!feature.plan) {\n return { plan: undefined };\n }\n\n const plan: PlanData = {\n state: feature.plan.state,\n overview: feature.plan.overview,\n tasks: feature.plan.tasks.map((t) => ({\n title: t.title ?? '',\n description: t.description ?? '',\n state: t.state,\n actionItems: (t.actionItems ?? []).map((ai) => ({\n name: ai.name,\n description: ai.description,\n acceptanceCriteria: (ai.acceptanceCriteria ?? []).map((ac) => ({\n description: ac.description,\n verified: ac.verified,\n })),\n })),\n })),\n };\n\n return { plan };\n } catch (error: unknown) {\n const message = error instanceof Error ? error.message : 'Failed to load feature plan';\n return { error: message };\n }\n}\n","'use server';\n\nimport { resolve } from '@/lib/server-container';\nimport type { IFeatureRepository } from '@shepai/core/application/ports/output/repositories/feature-repository.interface';\nimport type { IAgentRunRepository } from '@shepai/core/application/ports/output/agents/agent-run-repository.interface';\nimport type { IRepositoryRepository } from '@shepai/core/application/ports/output/repositories/repository-repository.interface';\nimport type { IGitPrService } from '@shepai/core/application/ports/output/services/git-pr-service.interface';\nimport type { GetFeatureArtifactUseCase } from '@shepai/core/application/use-cases/features/get-feature-artifact.use-case';\nimport { buildFeatureNodeData } from '@/app/build-feature-node-data';\nimport { getSettings } from '@shepai/core/infrastructure/services/settings.service';\nimport type { FeatureNodeData } from '@/components/common/feature-node';\n\n/**\n * Fetches full FeatureNodeData for a given feature ID.\n * Used by the drawer for targeted data syncing without triggering\n * a full router.refresh() / server component re-render.\n *\n * CI status and mergeable status are read from the DB (already updated\n * by PrSyncWatcherService) instead of making duplicate GitHub API calls.\n */\nexport async function getFeatureDrawerData(featureId: string): Promise<FeatureNodeData | null> {\n try {\n const featureRepo = resolve<IFeatureRepository>('IFeatureRepository');\n const agentRunRepo = resolve<IAgentRunRepository>('IAgentRunRepository');\n const repoRepo = resolve<IRepositoryRepository>('IRepositoryRepository');\n const gitPrService = resolve<IGitPrService>('IGitPrService');\n const getArtifact = resolve<GetFeatureArtifactUseCase>('GetFeatureArtifactUseCase');\n\n const feature = await featureRepo.findById(featureId);\n if (!feature) return null;\n\n const run = feature.agentRunId ? await agentRunRepo.findById(feature.agentRunId) : null;\n\n // CI status and mergeable status are read from the feature record (updated by\n // PrSyncWatcherService every 30s) — no duplicate GitHub API calls needed.\n // Only getDefaultBranch and getRemoteUrl are kept as they are local git operations.\n const [repo, baseBranch, artifact, remoteUrl] = await Promise.all([\n repoRepo.findByPath(feature.repositoryPath).catch(() => null),\n gitPrService.getDefaultBranch(feature.repositoryPath).catch(() => 'main'),\n getArtifact.execute(featureId).catch(() => null),\n gitPrService.getRemoteUrl(feature.repositoryPath).catch(() => null),\n ]);\n\n const { workflow } = getSettings();\n\n return buildFeatureNodeData(feature, run, {\n repositoryName: repo?.name,\n baseBranch,\n oneLiner: artifact?.oneLiner,\n remoteUrl: remoteUrl ?? undefined,\n enableEvidence: workflow.enableEvidence,\n commitEvidence: workflow.commitEvidence,\n });\n } catch {\n return null;\n }\n}\n","export {pickFolder as '00d33ce7fe440a4d4e55d65f865c1f22282142eb69'} from 'ACTIONS_MODULE0'\nexport {getDeploymentLogs as '40192e8ab56a976d7b4ab02e5ac4e86b81844753c0'} from 'ACTIONS_MODULE1'\nexport {deployFeature as '40c56f5c3a822bb270b79ce59904bd1a4547ae8dd4'} from 'ACTIONS_MODULE2'\nexport {deployRepository as '407be534406b318f0e53b8cf725a013960c34c4eab'} from 'ACTIONS_MODULE3'\nexport {stopDeployment as '40e8b017976f8965562a10c76df713c49c812175a5'} from 'ACTIONS_MODULE4'\nexport {getDeploymentStatus as '40edcd4f8ffa551f80627eea24794aeb5eb5b4bf1d'} from 'ACTIONS_MODULE5'\nexport {openIde as '40d59de3ebfc390247f9ec9e895121aa1e442bb248'} from 'ACTIONS_MODULE6'\nexport {openShell as '408ac7d206a1f4cb627a91f3253487c4ce8f30344b'} from 'ACTIONS_MODULE7'\nexport {openFolder as '4014ab1b94b133351b1455fab9508732c54cfa4404'} from 'ACTIONS_MODULE8'\nexport {isAgentSetupComplete as '000091d01c4c0addfba03a24acc2a50d2250ea644f'} from 'ACTIONS_MODULE9'\nexport {checkAgentAuth as '00b72044c095acd5ae935a6a82077d3017ffdb1e52'} from 'ACTIONS_MODULE10'\nexport {getAllAgentModels as '0001aa3186d88ffd6a6ecc56b4e0a9291659773c55'} from 'ACTIONS_MODULE11'\nexport {updateAgentAndModel as '603ee219eebb20f5875fe7610d566307abd16e5c79'} from 'ACTIONS_MODULE12'\nexport {deleteFeature as '70c01a5598d1f60b9749f583a466fdd9c7149baf07'} from 'ACTIONS_MODULE13'\nexport {resumeFeature as '403b7d14d71a50b757c8522b059b3e4a5e38ca630f'} from 'ACTIONS_MODULE14'\nexport {startFeature as '404482b612d7fe0416d9267ac8ae08eff97c415cb8'} from 'ACTIONS_MODULE15'\nexport {addRepository as '40d09eba9db80f1749ca75d8a81bf4ecfe354213f4'} from 'ACTIONS_MODULE16'\nexport {deleteRepository as '4017aa4e8e7a621babeb50836c6ecea68032a1a223'} from 'ACTIONS_MODULE17'\nexport {getFeatureMetadata as '4023507b2023a0497138424d17b98825c8a34fea63'} from 'ACTIONS_MODULE18'\nexport {approveFeature as '6061a1bdf48e7a187d3c2e02b93c9b90738b8e243e'} from 'ACTIONS_MODULE19'\nexport {rejectFeature as '7035fb61dfb18a61df1343dbcdc64e3b199138f5da'} from 'ACTIONS_MODULE20'\nexport {getFeatureArtifact as '40357238e71028fac79c645f852368bdced0aa13d7'} from 'ACTIONS_MODULE21'\nexport {getResearchArtifact as '406fc98a613a6f207e3bdc0ced1e686ffbb03f9bd8'} from 'ACTIONS_MODULE22'\nexport {getMergeReviewData as '402874b2bbc860ff2a557c75e1580f61d03dadbc11'} from 'ACTIONS_MODULE23'\nexport {getFeaturePhaseTimings as '409ae8631dd66ef4036d0d9d922fc2c24cb344d13c'} from 'ACTIONS_MODULE24'\nexport {getFeaturePlan as '40902286e33d2278cd76407142168234afce2450b5'} from 'ACTIONS_MODULE25'\nexport {getFeatureDrawerData as '405ef365874e67155b4b7e0077d0cc59b5e4dc7e2f'} from 'AC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AAA,AAAoB,EAAC,EAAS,EAAK,CACxC,eAAgB,GAAM,gBACtB,EACA,SAAU,GAAU,SACpB,UAAW,QAAa,EACxB,eAAgB,EAAS,cAAc,CACvC,eAAgB,EAAS,cAAc,AACzC,EACF,CAAE,KAAM,CACN,OAAO,IACT,CACF,iCApCsB,IAAA,CAAA,EAAA,EAAA,uBAAA,EAAA,EAAA,6CAAA,uECpBtB,IAAA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,MACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,MACA,EAAA,EAAA,CAAA,CAAA,KACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA"}
@@ -0,0 +1,4 @@
1
+ module.exports=[23504,27900,a=>{"use strict";var b=a.i(92658),c=a.i(96380);let d={"claude-opus-4-6":{displayName:"Opus 4.6",description:"Most capable, complex tasks"},"claude-sonnet-4-6":{displayName:"Sonnet 4.6",description:"Fast & balanced"},"claude-haiku-4-5":{displayName:"Haiku 4.5",description:"Lightweight & quick"},"gemini-3.1-pro":{displayName:"Gemini 3.1 Pro",description:"Advanced reasoning"},"gemini-3-flash":{displayName:"Gemini 3 Flash",description:"Ultra-fast responses"},"gemini-2.5-pro":{displayName:"Gemini 2.5 Pro",description:"Reliable workhorse"},"gemini-2.5-flash":{displayName:"Gemini 2.5 Flash",description:"Speed-optimized"},"gpt-5.4-high":{displayName:"GPT-5.4",description:"Latest reasoning model"},"gpt-5.2":{displayName:"GPT-5.2",description:"Flagship model"},"gpt-5.3-codex":{displayName:"GPT-5.3 Codex",description:"Code specialist"},"composer-1.5":{displayName:"Composer 1.5",description:"Multi-file editing"},"grok-code":{displayName:"Grok Code",description:"xAI code model"},"gpt-8":{displayName:"GPT-8",description:"Writes code before you think it"},"opus-7":{displayName:"Opus 7",description:"Achieved consciousness, ships on time"}},e={displayName:"",description:""};function f(a){let b=d[a];return b||{...e,displayName:a.replace(/^claude-/,"").replace(/^gemini-/,"Gemini ").replace(/^gpt-/,"GPT-").replace(/-/g," ").replace(/\b\w/g,a=>a.toUpperCase())}}var g=a.i(12581);let h={"claude-code":"Claude Code",cursor:"Cursor CLI","gemini-cli":"Gemini CLI",dev:"Demo"},i={"claude-code":0,cursor:1,"gemini-cli":2,dev:99};async function j(){try{let a=(0,c.resolve)("IAgentExecutorFactory");return a.getSupportedAgents().map(b=>({agentType:b,label:h[b]??b,models:a.getSupportedModels(b).map(a=>({id:a,...f(a)}))})).map(a=>"dev"===a.agentType&&0===a.models.length?{...a,models:[{id:"gpt-8",...f("gpt-8")},{id:"opus-7",...f("opus-7")}]}:a).filter(a=>a.models.length>0).sort((a,b)=>(i[a.agentType]??50)-(i[b.agentType]??50))}catch{return[]}}(0,g.ensureServerEntryExports)([j]),(0,b.registerServerReference)(j,"0001aa3186d88ffd6a6ecc56b4e0a9291659773c55",null),a.s(["getAllAgentModels",()=>j],23504);var k=a.i(33244);async function l(a,b){if(!a.trim())return{ok:!1,error:"agent type is required"};try{let d=(0,c.resolve)("CompleteWebOnboardingUseCase"),e=await d.execute({agentType:a.trim(),model:b});return(0,k.resetSettings)(),(0,k.initializeSettings)(e),{ok:!0}}catch(a){return{ok:!1,error:a instanceof Error?a.message:"Failed to update agent and model"}}}(0,g.ensureServerEntryExports)([l]),(0,b.registerServerReference)(l,"603ee219eebb20f5875fe7610d566307abd16e5c79",null),a.s(["updateAgentAndModel",()=>l],27900)},96380,a=>{"use strict";function b(a){let b=globalThis.__shepContainer;if(!b)throw Error("DI container not available. Ensure the CLI bootstrap or dev-server has initialized it.");return b.resolve(a)}a.s(["resolve",()=>b])},2157,(a,b,c)=>{b.exports=a.x("node:fs",()=>require("node:fs"))},12714,(a,b,c)=>{b.exports=a.x("node:fs/promises",()=>require("node:fs/promises"))},50227,(a,b,c)=>{b.exports=a.x("node:path",()=>require("node:path"))},60526,(a,b,c)=>{b.exports=a.x("node:os",()=>require("node:os"))},32278,a=>{"use strict";a.i(12714);var b=a.i(60526),c=a.i(50227);function d(){return process.env.SHEP_HOME??(0,c.join)((0,b.homedir)(),".shep")}a.i(2157),a.s(["getShepHomeDir",()=>d])},74533,(a,b,c)=>{b.exports=a.x("node:child_process",()=>require("node:child_process"))},92658,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"registerServerReference",{enumerable:!0,get:function(){return d.registerServerReference}});let d=a.r(28478)},12581,(a,b,c)=>{"use strict";function d(a){for(let b=0;b<a.length;b++){let c=a[b];if("function"!=typeof c)throw Object.defineProperty(Error(`A "use server" file can only export async functions, found ${typeof c}.
2
+ Read more: https://nextjs.org/docs/messages/invalid-use-server-value`),"__NEXT_ERROR_CODE",{value:"E352",enumerable:!1,configurable:!0})}}Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"ensureServerEntryExports",{enumerable:!0,get:function(){return d}})},12513,a=>{"use strict";var b=a.i(92658),c=a.i(74533);let d={platform:process.platform,exec:(a,b)=>(0,c.execSync)(a,b)},e={darwin:"osascript -e 'POSIX path of (choose folder with prompt \"Select a repository folder\")'",linux:'zenity --file-selection --directory --title="Select a repository folder" 2>/dev/null',win32:"powershell -NoProfile -Command \"Add-Type -AssemblyName System.Windows.Forms; $f = New-Object System.Windows.Forms.FolderBrowserDialog; $f.Description = 'Select a repository folder'; if ($f.ShowDialog() -eq 'OK') { $f.SelectedPath } else { exit 1 }\""};class f{deps;constructor(a={}){this.deps={...d,...a}}getCommand(){return e[this.deps.platform]??null}pickFolder(){let a=this.getCommand();if(!a)throw Error(`Unsupported platform: ${this.deps.platform}`);try{let b=this.deps.exec(a,{encoding:"utf-8",timeout:6e4}).trim();return b.length>0?b:null}catch(a){var b;if("object"==typeof(b=a)&&null!==b&&"status"in b&&1===a.status)return null;throw a}}}async function g(){let a=new f;try{return{path:a.pickFolder()}}catch(a){return{path:null,error:a instanceof Error?a.message:"Failed to open folder dialog"}}}(0,a.i(12581).ensureServerEntryExports)([g]),(0,b.registerServerReference)(g,"00d33ce7fe440a4d4e55d65f865c1f22282142eb69",null),a.s(["pickFolder",()=>g],12513)},57764,(a,b,c)=>{b.exports=a.x("node:url",()=>require("node:url"))},43738,a=>{"use strict";var b=a.i(2157),c=a.i(50227),d=a.i(57764);let e={get url(){return`file://${a.P("packages/core/src/infrastructure/services/tool-installer/tool-metadata.ts")}`}},f=["name","summary","description","tags","binary","packageManager","commands","timeout","documentationUrl","verifyCommand"],g=function(){let a,g=(0,c.join)((0,d.fileURLToPath)(e.url),"..","tools"),h={};try{a=(0,b.readdirSync)(g).filter(a=>a.endsWith(".json"))}catch{return h}for(let d of a){let a=(0,c.basename)(d,".json");try{let e=(0,b.readFileSync)((0,c.join)(g,d),"utf-8"),i=JSON.parse(e);if(f.filter(a=>!(a in i)).length>0)continue;h[a]=i}catch{}}return h}();function h(){return Object.entries(g).filter(([,a])=>a.tags.includes("terminal")&&null!=a.openDirectory)}a.s(["getTerminalEntries",()=>h])},15046,(a,b,c)=>{"use strict";var d,e=(a,b)=>()=>(b||a((b={exports:{}}).exports,b),b.exports),f=e(b=>{Object.defineProperty(b,"__esModule",{value:!0}),b.sync=b.isexe=void 0;var c=a.r(2157),d=a.r(12714);b.isexe=async(a,b={})=>{let{ignoreErrors:c=!1}=b;try{return e(await (0,d.stat)(a),b)}catch(a){if(c||"EACCES"===a.code)return!1;throw a}},b.sync=(a,b={})=>{let{ignoreErrors:d=!1}=b;try{return e((0,c.statSync)(a),b)}catch(a){if(d||"EACCES"===a.code)return!1;throw a}};var e=(a,b)=>a.isFile()&&f(a,b),f=(a,b)=>{let c=b.uid??process.getuid?.(),d=b.groups??process.getgroups?.()??[],e=b.gid??process.getgid?.()??d[0];if(void 0===c||void 0===e)throw Error("cannot get uid or gid");let f=new Set([e,...d]),g=a.mode,h=a.uid,i=a.gid,j=parseInt("100",8),k=parseInt("010",8);return!!(g&parseInt("001",8)||g&k&&f.has(i)||g&j&&h===c||g&(j|k)&&0===c)}}),g=e(b=>{Object.defineProperty(b,"__esModule",{value:!0}),b.sync=b.isexe=void 0;var c=a.r(2157),d=a.r(12714),e=a.r(50227);b.isexe=async(a,b={})=>{let{ignoreErrors:c=!1}=b;try{return f(await (0,d.stat)(a),a,b)}catch(a){if(c||"EACCES"===a.code)return!1;throw a}},b.sync=(a,b={})=>{let{ignoreErrors:d=!1}=b;try{return f((0,c.statSync)(a),a,b)}catch(a){if(d||"EACCES"===a.code)return!1;throw a}};var f=(a,b,c)=>a.isFile()&&((a,b)=>{let{pathExt:c=process.env.PATHEXT||""}=b,d=c.split(e.delimiter);if(-1!==d.indexOf(""))return!0;for(let b of d){let c=b.toLowerCase(),d=a.substring(a.length-c.length).toLowerCase();if(c&&d===c)return!0}return!1})(b,c)}),h=e(a=>{Object.defineProperty(a,"__esModule",{value:!0})}),i=c&&c.__createBinding||(Object.create?function(a,b,c,d){void 0===d&&(d=c);var e=Object.getOwnPropertyDescriptor(b,c);(!e||("get"in e?!b.__esModule:e.writable||e.configurable))&&(e={enumerable:!0,get:function(){return b[c]}}),Object.defineProperty(a,d,e)}:function(a,b,c,d){void 0===d&&(d=c),a[d]=b[c]}),j=c&&c.__setModuleDefault||(Object.create?function(a,b){Object.defineProperty(a,"default",{enumerable:!0,value:b})}:function(a,b){a.default=b}),k=c&&c.__importStar||(d=function(a){return(d=Object.getOwnPropertyNames||function(a){var b=[];for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[b.length]=c);return b})(a)},function(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c=d(a),e=0;e<c.length;e++)"default"!==c[e]&&i(b,a,c[e]);return j(b,a),b}),l=c&&c.__exportStar||function(a,b){for(var c in a)"default"===c||Object.prototype.hasOwnProperty.call(b,c)||i(b,a,c)};Object.defineProperty(c,"__esModule",{value:!0}),c.sync=c.isexe=c.posix=c.win32=void 0;var m=k(f());c.posix=m;var n=k(g());c.win32=n,l(h(),c);var o="win32"===(process.env._ISEXE_TEST_PLATFORM_||process.platform)?n:m;c.isexe=o.isexe,c.sync=o.sync},11346,(a,b,c)=>{let{isexe:d,sync:e}=a.r(15046),{join:f,delimiter:g,sep:h,posix:i}=a.r(14747);process.platform;let j=new RegExp(`[${i.sep}${h===i.sep?"":h}]`.replace(/(\\)/g,"\\$1")),k=RegExp(`^\\.${j.source}`),l=a=>Object.assign(Error(`not found: ${a}`),{code:"ENOENT"}),m=(a,{path:b=process.env.PATH,pathExt:c=process.env.PATHEXT,delimiter:d=g})=>({pathEnv:a.match(j)?[""]:[...(b||"").split(d)],pathExt:[""]}),n=(a,b)=>{let c=/^".*"$/.test(a)?a.slice(1,-1):a;return(!c&&k.test(b)?b.slice(0,2):"")+f(c,b)},o=async(a,b={})=>{let{pathEnv:c,pathExt:e,pathExtExe:f}=m(a,b),g=[];for(let h of c){let c=n(h,a);for(let a of e){let e=c+a;if(await d(e,{pathExt:f,ignoreErrors:!0})){if(!b.all)return e;g.push(e)}}}if(b.all&&g.length)return g;if(b.nothrow)return null;throw l(a)};b.exports=o,o.sync=(a,b={})=>{let{pathEnv:c,pathExt:d,pathExtExe:f}=m(a,b),g=[];for(let h of c){let c=n(h,a);for(let a of d){let d=c+a;if(e(d,{pathExt:f,ignoreErrors:!0})){if(!b.all)return d;g.push(d)}}}if(b.all&&g.length)return g;if(b.nothrow)return null;throw l(a)}},86561,79195,a=>{"use strict";var b=a.i(92658),c=a.i(2157),d=a.i(50227),e=a.i(96380),f=a.i(32278),g=a.i(12581);async function h(){try{let b=(0,e.resolve)("LoadSettingsUseCase"),g=await b.execute(),h=(0,f.getShepHomeDir)(),i="Unknown";try{var a;let b=(0,d.join)(h,"data");i=(a=(0,c.statSync)(b).size)<1024?`${a} B`:a<1048576?`${(a/1024).toFixed(1)} KB`:`${(a/1048576).toFixed(1)} MB`}catch{}return{settings:g,shepHome:h,dbFileSize:i}}catch(a){return{error:a instanceof Error?a.message:"Failed to load settings"}}}(0,g.ensureServerEntryExports)([h]),(0,b.registerServerReference)(h,"008a5ad2e4f7c18ccc1d146adf8a562f4c4e9122c1",null),a.s(["loadSettings",()=>h],86561);var i=a.i(60526),j=a.i(43738),k=a.i(11346);let l=async a=>{try{let b=await (0,k.default)(a,{nothrow:!0});if(null!==b)return{found:!0};return{found:!1,notInPath:!0}}catch(a){return{found:!1,error:a instanceof Error?a:Error(String(a))}}};async function m(){let b=(0,i.platform)(),c=(0,j.getTerminalEntries)(),d=[];for(let[e,f]of c){if(f.platforms&&!f.platforms.includes(b))continue;if("system-terminal"===e){d.unshift({id:"system",name:f.name,available:!0});continue}let c="string"==typeof f.binary?f.binary:f.binary[b];if(!c)continue;let g=!1;if(f.verifyCommand.startsWith("test "))try{let{execSync:b}=await a.A(82848);b(f.verifyCommand,{stdio:"ignore"}),g=!0}catch{g=!1}else g=(await l(c)).found;d.push({id:e,name:f.name,available:g})}return d.some(a=>"system"===a.id)||d.unshift({id:"system",name:"System Terminal",available:!0}),d}(0,g.ensureServerEntryExports)([m]),(0,b.registerServerReference)(m,"00af762c982b156f8f0346f4758780afaeca1f2f72",null),a.s(["getAvailableTerminals",()=>m],79195)},82848,a=>{a.v(a=>Promise.resolve().then(()=>a(74533)))}];
3
+
4
+ //# sourceMappingURL=%5Broot-of-the-server%5D__8c553503._.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../src/presentation/web/app/actions/get-all-agent-models.ts","../../../../../../../src/presentation/web/lib/model-metadata.ts","../../../../../../../src/presentation/web/app/actions/update-agent-and-model.ts","../../../../../../../node_modules/.pnpm/next%4016.1.6_%40babel%2Bcore%407.29.0_%40playwright%2Btest%401.58.1_react-dom%4019.2.4_react%4019.2.4__react%4019.2.4/node_modules/next/src/build/webpack/loaders/next-flight-loader/server-reference.ts","../../../../../../../node_modules/.pnpm/next%4016.1.6_%40babel%2Bcore%407.29.0_%40playwright%2Btest%401.58.1_react-dom%4019.2.4_react%4019.2.4__react%4019.2.4/node_modules/next/src/build/webpack/loaders/next-flight-loader/action-validate.ts","../../../../../../../packages/core/src/infrastructure/services/folder-dialog.service.ts","../../../../../../../src/presentation/web/app/actions/pick-folder.ts","../../../../../../../src/presentation/web/lib/server-container.ts","../../../../../../../packages/core/src/infrastructure/services/filesystem/shep-directory.service.ts","../../../../../../../packages/core/src/infrastructure/services/tool-installer/tool-metadata.ts","../../../../../../../node_modules/.pnpm/isexe%403.1.5/node_modules/isexe/src/posix.ts","../../../../../../../node_modules/.pnpm/isexe%403.1.5/node_modules/isexe/src/win32.ts","../../../../../../../node_modules/.pnpm/isexe%403.1.5/node_modules/isexe/dist/commonjs/options.js","../../../../../../../node_modules/.pnpm/isexe%403.1.5/node_modules/isexe/src/index.ts","../../../../../../../node_modules/.pnpm/which%405.0.0/node_modules/which/lib/index.js","../../../../../../../src/presentation/web/app/actions/load-settings.ts","../../../../../../../src/presentation/web/app/actions/get-available-terminals.ts","../../../../../../../packages/core/src/infrastructure/services/tool-installer/binary-exists.ts"],"sourcesContent":["'use server';\n\nimport { resolve } from '@/lib/server-container';\nimport { getModelMeta } from '@/lib/model-metadata';\nimport type { IAgentExecutorFactory } from '@shepai/core/application/ports/output/agents/agent-executor-factory.interface';\n\nexport interface ModelInfo {\n id: string;\n displayName: string;\n description: string;\n}\n\nexport interface AgentModelGroup {\n agentType: string;\n label: string;\n models: ModelInfo[];\n}\n\nconst AGENT_LABELS: Record<string, string> = {\n 'claude-code': 'Claude Code',\n cursor: 'Cursor CLI',\n 'gemini-cli': 'Gemini CLI',\n dev: 'Demo',\n};\n\n/** Sort weight — higher = further down. Demo always last. */\nconst AGENT_ORDER: Record<string, number> = {\n 'claude-code': 0,\n cursor: 1,\n 'gemini-cli': 2,\n dev: 99,\n};\n\nexport async function getAllAgentModels(): Promise<AgentModelGroup[]> {\n try {\n const factory = resolve<IAgentExecutorFactory>('IAgentExecutorFactory');\n const agents = factory.getSupportedAgents();\n return agents\n .map((agentType) => ({\n agentType: agentType as string,\n label: AGENT_LABELS[agentType as string] ?? (agentType as string),\n models: factory.getSupportedModels(agentType).map((id) => ({\n id,\n ...getModelMeta(id),\n })),\n }))\n .map((g) => {\n // Dev agent gets fun demo models\n if (g.agentType === 'dev' && g.models.length === 0) {\n return {\n ...g,\n models: [\n { id: 'gpt-8', ...getModelMeta('gpt-8') },\n { id: 'opus-7', ...getModelMeta('opus-7') },\n ],\n };\n }\n return g;\n })\n .filter((g) => g.models.length > 0)\n .sort((a, b) => (AGENT_ORDER[a.agentType] ?? 50) - (AGENT_ORDER[b.agentType] ?? 50));\n } catch {\n return [];\n }\n}\n","export interface ModelMeta {\n displayName: string;\n description: string;\n}\n\n/**\n * Presentation-layer metadata for known LLM model identifiers.\n * Maps raw model IDs to human-friendly display names and short descriptions.\n */\nconst MODEL_METADATA: Record<string, ModelMeta> = {\n // Claude models\n 'claude-opus-4-6': { displayName: 'Opus 4.6', description: 'Most capable, complex tasks' },\n 'claude-sonnet-4-6': { displayName: 'Sonnet 4.6', description: 'Fast & balanced' },\n 'claude-haiku-4-5': { displayName: 'Haiku 4.5', description: 'Lightweight & quick' },\n\n // Gemini models\n 'gemini-3.1-pro': { displayName: 'Gemini 3.1 Pro', description: 'Advanced reasoning' },\n 'gemini-3-flash': { displayName: 'Gemini 3 Flash', description: 'Ultra-fast responses' },\n 'gemini-2.5-pro': { displayName: 'Gemini 2.5 Pro', description: 'Reliable workhorse' },\n 'gemini-2.5-flash': { displayName: 'Gemini 2.5 Flash', description: 'Speed-optimized' },\n\n // OpenAI models\n 'gpt-5.4-high': { displayName: 'GPT-5.4', description: 'Latest reasoning model' },\n 'gpt-5.2': { displayName: 'GPT-5.2', description: 'Flagship model' },\n 'gpt-5.3-codex': { displayName: 'GPT-5.3 Codex', description: 'Code specialist' },\n\n // Other\n 'composer-1.5': { displayName: 'Composer 1.5', description: 'Multi-file editing' },\n 'grok-code': { displayName: 'Grok Code', description: 'xAI code model' },\n\n // Demo / fun models\n 'gpt-8': { displayName: 'GPT-8', description: 'Writes code before you think it' },\n 'opus-7': { displayName: 'Opus 7', description: 'Achieved consciousness, ships on time' },\n};\n\nconst FALLBACK: ModelMeta = { displayName: '', description: '' };\n\nexport function getModelMeta(modelId: string): ModelMeta {\n const meta = MODEL_METADATA[modelId];\n if (meta) return meta;\n // Fallback: prettify the raw ID\n return {\n ...FALLBACK,\n displayName: modelId\n .replace(/^claude-/, '')\n .replace(/^gemini-/, 'Gemini ')\n .replace(/^gpt-/, 'GPT-')\n .replace(/-/g, ' ')\n .replace(/\\b\\w/g, (c) => c.toUpperCase()),\n };\n}\n","'use server';\n\nimport { resolve } from '@/lib/server-container';\nimport {\n resetSettings,\n initializeSettings,\n} from '@shepai/core/infrastructure/services/settings.service';\nimport type { CompleteWebOnboardingUseCase } from '@shepai/core/application/use-cases/settings/complete-web-onboarding.use-case';\nimport type { AgentType } from '@shepai/core/domain/generated/output';\n\nexport async function updateAgentAndModel(\n agentType: string,\n model: string | null\n): Promise<{ ok: boolean; error?: string }> {\n if (!agentType.trim()) {\n return { ok: false, error: 'agent type is required' };\n }\n\n try {\n const useCase = resolve<CompleteWebOnboardingUseCase>('CompleteWebOnboardingUseCase');\n const updatedSettings = await useCase.execute({\n agentType: agentType.trim() as AgentType,\n model,\n });\n\n resetSettings();\n initializeSettings(updatedSettings);\n\n return { ok: true };\n } catch (error: unknown) {\n const message = error instanceof Error ? error.message : 'Failed to update agent and model';\n return { ok: false, error: message };\n }\n}\n","/* eslint-disable import/no-extraneous-dependencies */\nexport { registerServerReference } from 'react-server-dom-webpack/server'\n","// This function ensures that all the exported values are valid server actions,\n// during the runtime. By definition all actions are required to be async\n// functions, but here we can only check that they are functions.\nexport function ensureServerEntryExports(actions: any[]) {\n for (let i = 0; i < actions.length; i++) {\n const action = actions[i]\n if (typeof action !== 'function') {\n throw new Error(\n `A \"use server\" file can only export async functions, found ${typeof action}.\\nRead more: https://nextjs.org/docs/messages/invalid-use-server-value`\n )\n }\n }\n}\n","import { execSync } from 'node:child_process';\n\nexport interface FolderDialogDeps {\n platform: NodeJS.Platform;\n exec: (cmd: string, opts?: { encoding: BufferEncoding; timeout?: number }) => string;\n}\n\nconst defaultDeps: FolderDialogDeps = {\n platform: process.platform,\n exec: (cmd, opts) => execSync(cmd, opts) as unknown as string,\n};\n\n/**\n * Platform-specific commands that open a native OS folder picker dialog.\n * Each returns the chosen absolute folder path on stdout, or exits non-zero / returns empty on cancel.\n */\nconst PLATFORM_COMMANDS: Record<string, string> = {\n darwin: `osascript -e 'POSIX path of (choose folder with prompt \"Select a repository folder\")'`,\n linux: `zenity --file-selection --directory --title=\"Select a repository folder\" 2>/dev/null`,\n win32: `powershell -NoProfile -Command \"Add-Type -AssemblyName System.Windows.Forms; $f = New-Object System.Windows.Forms.FolderBrowserDialog; $f.Description = 'Select a repository folder'; if ($f.ShowDialog() -eq 'OK') { $f.SelectedPath } else { exit 1 }\"`,\n};\n\nexport class FolderDialogService {\n private deps: FolderDialogDeps;\n\n constructor(deps: Partial<FolderDialogDeps> = {}) {\n this.deps = { ...defaultDeps, ...deps };\n }\n\n /** Returns the OS-specific command string, or null if the platform is unsupported. */\n getCommand(): string | null {\n return PLATFORM_COMMANDS[this.deps.platform] ?? null;\n }\n\n /**\n * Opens a native folder picker dialog and returns the selected absolute path.\n * Returns `null` if the user cancels the dialog.\n * Throws if the platform is unsupported or the command fails unexpectedly.\n */\n pickFolder(): string | null {\n const command = this.getCommand();\n if (!command) {\n throw new Error(`Unsupported platform: ${this.deps.platform}`);\n }\n\n try {\n const result = this.deps.exec(command, { encoding: 'utf-8', timeout: 60_000 });\n const trimmed = result.trim();\n return trimmed.length > 0 ? trimmed : null;\n } catch (error: unknown) {\n // User cancelled the dialog — exit code 1 from osascript/zenity/powershell\n if (isExecError(error) && error.status === 1) {\n return null;\n }\n throw error;\n }\n }\n}\n\nfunction isExecError(error: unknown): error is { status: number } {\n return typeof error === 'object' && error !== null && 'status' in error;\n}\n","'use server';\n\nimport { FolderDialogService } from '@shepai/core/infrastructure/services/folder-dialog.service';\n\nexport async function pickFolder(): Promise<{ path: string | null; error?: string }> {\n const service = new FolderDialogService();\n\n try {\n const path = service.pickFolder();\n return { path };\n } catch (error: unknown) {\n const message = error instanceof Error ? error.message : 'Failed to open folder dialog';\n return { path: null, error: message };\n }\n}\n","/**\n * Server Container Accessor\n *\n * Provides a `resolve()` helper for server components and API routes to\n * obtain DI-managed instances. The tsyringe container is placed on globalThis\n * by the CLI bootstrap (`shep ui`) or the dev-server (`pnpm dev:web`).\n */\n\nimport type { DependencyContainer, InjectionToken } from 'tsyringe';\n\nconst CONTAINER_KEY = '__shepContainer';\n\n/**\n * Resolve a dependency from the DI container.\n *\n * Usage in server components / API routes:\n * ```ts\n * import { resolve } from '@/lib/server-container';\n * import { ListFeaturesUseCase } from '@shepai/core/application/use-cases/features/list-features.use-case';\n *\n * const features = await resolve(ListFeaturesUseCase).execute();\n * ```\n */\nexport function resolve<T>(token: InjectionToken<T>): T {\n const container = (globalThis as Record<string, unknown>)[CONTAINER_KEY] as\n | DependencyContainer\n | undefined;\n\n if (!container) {\n throw new Error(\n 'DI container not available. Ensure the CLI bootstrap or dev-server has initialized it.'\n );\n }\n\n return container.resolve(token);\n}\n","/**\n * Shep Directory Service\n *\n * Manages the ~/.shep/ directory for global settings and data storage.\n * Ensures directory exists with correct permissions before database operations.\n *\n * Supports SHEP_HOME env var for test isolation (overrides default ~/.shep/).\n */\n\nimport { mkdir } from 'node:fs/promises';\nimport { homedir } from 'node:os';\nimport { join } from 'node:path';\nimport { existsSync } from 'node:fs';\n\n/**\n * Resolves the Shep home directory.\n * Respects SHEP_HOME env var for test isolation, falls back to ~/.shep/\n */\nfunction resolveShepHomeDir(): string {\n return process.env.SHEP_HOME ?? join(homedir(), '.shep');\n}\n\n/**\n * Gets the path to the Shep home directory.\n * Uses SHEP_HOME env var if set, otherwise ~/.shep/\n *\n * @returns Path to shep home directory\n */\nexport function getShepHomeDir(): string {\n return resolveShepHomeDir();\n}\n\n/**\n * Gets the path to the SQLite database file.\n *\n * @returns Path to the database file\n */\nexport function getShepDbPath(): string {\n return join(resolveShepHomeDir(), 'data');\n}\n\n/**\n * Gets the path to the daemon state file.\n * Uses SHEP_HOME env var if set (for test isolation), otherwise ~/.shep/daemon.json\n *\n * @returns Path to daemon.json\n */\nexport function getDaemonStatePath(): string {\n return join(resolveShepHomeDir(), 'daemon.json');\n}\n\n/**\n * Gets the path to the daemon log file.\n * Uses SHEP_HOME env var if set (for test isolation), otherwise ~/.shep/daemon.log\n *\n * @returns Path to daemon.log\n */\nexport function getDaemonLogPath(): string {\n return join(resolveShepHomeDir(), 'daemon.log');\n}\n\n/**\n * Ensures the shep home directory exists with correct permissions.\n * Creates the directory if it doesn't exist.\n * Safe to call multiple times (idempotent).\n *\n * Permissions: 700 (rwx------) - only owner can read/write/execute\n *\n * @throws Error if directory cannot be created (permissions, disk space, etc.)\n */\nexport async function ensureShepDirectory(): Promise<void> {\n const shepDir = resolveShepHomeDir();\n\n if (existsSync(shepDir)) {\n return;\n }\n\n try {\n await mkdir(shepDir, {\n recursive: true,\n mode: 0o700,\n });\n } catch (error) {\n throw new Error(\n `Failed to create Shep directory at ${shepDir}: ${error instanceof Error ? error.message : String(error)}`\n );\n }\n}\n","/**\n * Tool Installation Metadata\n *\n * Dynamically loads tool definitions from individual JSON files in the tools/ directory.\n * Each JSON file defines installation commands and metadata for a single development tool.\n *\n * To add a new tool, create a JSON file in tools/ matching the ToolMetadata schema:\n * tools/<tool-name>.json\n */\n\nimport { readdirSync, readFileSync } from 'node:fs';\nimport { join, basename } from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nexport interface ToolMetadata {\n /** Human-readable display name */\n name: string;\n\n /** Short one-line summary */\n summary: string;\n\n /** Detailed description */\n description: string;\n\n /** Tool tags for grouping in listings. A tool can belong to multiple categories. */\n tags: ('ide' | 'cli-agent' | 'vcs' | 'terminal')[];\n\n /** Company or developer name */\n author?: string;\n\n /** Main website/homepage URL (separate from documentation) */\n website?: string;\n\n /** Supported platforms (os.platform() values) */\n platforms?: ('linux' | 'darwin' | 'win32')[];\n\n /** URL to the tool's icon/logo image */\n iconUrl?: string;\n\n /** Binary name to check with 'which' command (string or per-platform map) */\n binary: string | Record<string, string>;\n\n /** Package manager or installation method */\n packageManager: string;\n\n /** Platform-specific installation commands as shell strings (keyed by os.platform()) */\n commands: Record<string, string>;\n\n /** Installation timeout in milliseconds */\n timeout: number;\n\n /** Official documentation URL */\n documentationUrl: string;\n\n /** Command to verify installation (e.g., \"code --version\") */\n verifyCommand: string;\n\n /** Whether the tool supports automated installation (default: true) */\n autoInstall?: boolean;\n\n /** Whether this tool is required for the platform to function (default: false) */\n required?: boolean;\n\n /** Command to open a directory in this tool.\n * String format: \"code {dir}\" — single command for all platforms.\n * Object format: { \"linux\": \"antigravity {dir}\", \"darwin\": \"agy {dir}\" } — per-platform commands. */\n openDirectory?: string | Record<string, string>;\n\n /** Override default spawn options for the launch process.\n * Defaults: { detached: true, stdio: \"ignore\" } (GUI IDEs).\n * CLI agents should use { shell: true, stdio: \"inherit\" } to run in the current terminal. */\n spawnOptions?: {\n shell?: boolean;\n stdio?: 'ignore' | 'inherit' | 'pipe';\n detached?: boolean;\n };\n\n /** Platform-specific command to launch this tool in a new terminal window.\n * Used when launching from the web UI where no terminal is available.\n * When set, the launcher spawns a new terminal window with this command.\n * Supports {dir} placeholder like openDirectory.\n * Example: \"x-terminal-emulator -e bash -c 'cd {dir} && claude'\" */\n terminalCommand?: string | Record<string, string>;\n}\n\nconst REQUIRED_FIELDS: (keyof ToolMetadata)[] = [\n 'name',\n 'summary',\n 'description',\n 'tags',\n 'binary',\n 'packageManager',\n 'commands',\n 'timeout',\n 'documentationUrl',\n 'verifyCommand',\n];\n\nfunction loadToolMetadata(): Record<string, ToolMetadata> {\n // NOTE: This module uses import.meta.url to resolve the tools/ directory.\n // It works correctly when loaded in the Node.js CLI bootstrap context but\n // breaks when bundled by Turbopack (import.meta.url points to the chunk\n // location where tools/ doesn't exist). API routes should access tool\n // metadata via the DI container, not by importing this module directly.\n const toolsDir = join(fileURLToPath(import.meta.url), '..', 'tools');\n const metadata: Record<string, ToolMetadata> = {};\n\n let files: string[];\n try {\n files = readdirSync(toolsDir).filter((f) => f.endsWith('.json'));\n } catch {\n return metadata;\n }\n\n for (const file of files) {\n const toolName = basename(file, '.json');\n try {\n const raw = readFileSync(join(toolsDir, file), 'utf-8');\n const parsed = JSON.parse(raw) as ToolMetadata;\n\n const missing = REQUIRED_FIELDS.filter((field) => !(field in parsed));\n if (missing.length > 0) {\n continue;\n }\n\n metadata[toolName] = parsed;\n } catch {\n // Skip malformed JSON files\n }\n }\n\n return metadata;\n}\n\nexport const TOOL_METADATA: Record<string, ToolMetadata> = loadToolMetadata();\n\n/**\n * Returns entries from TOOL_METADATA that can open a directory as an IDE.\n * A tool qualifies if it has an `openDirectory` field, regardless of category.\n * Each entry is [toolId, metadata].\n */\nexport function getIdeEntries(): [string, ToolMetadata][] {\n return Object.entries(TOOL_METADATA).filter(([, meta]) => meta.openDirectory != null);\n}\n\n/**\n * Returns entries from TOOL_METADATA tagged as \"terminal\" that have an\n * `openDirectory` field. Each entry is [toolId, metadata].\n */\nexport function getTerminalEntries(): [string, ToolMetadata][] {\n return Object.entries(TOOL_METADATA).filter(\n ([, meta]) => meta.tags.includes('terminal') && meta.openDirectory != null\n );\n}\n","/**\n * This is the Posix implementation of isexe, which uses the file\n * mode and uid/gid values.\n *\n * @module\n */\n\nimport { Stats, statSync } from 'node:fs'\nimport { stat } from 'node:fs/promises'\nimport { IsexeOptions } from './options.js'\n\n/**\n * Determine whether a path is executable according to the mode and\n * current (or specified) user and group IDs.\n */\nexport const isexe = async (\n path: string,\n options: IsexeOptions = {},\n): Promise<boolean> => {\n const { ignoreErrors = false } = options\n try {\n return checkStat(await stat(path), options)\n } catch (e) {\n const er = e as NodeJS.ErrnoException\n if (ignoreErrors || er.code === 'EACCES') return false\n throw er\n }\n}\n\n/**\n * Synchronously determine whether a path is executable according to\n * the mode and current (or specified) user and group IDs.\n */\nexport const sync = (\n path: string,\n options: IsexeOptions = {},\n): boolean => {\n const { ignoreErrors = false } = options\n try {\n return checkStat(statSync(path), options)\n } catch (e) {\n const er = e as NodeJS.ErrnoException\n if (ignoreErrors || er.code === 'EACCES') return false\n throw er\n }\n}\n\nconst checkStat = (stat: Stats, options: IsexeOptions) =>\n stat.isFile() && checkMode(stat, options)\n\nconst checkMode = (stat: Stats, options: IsexeOptions) => {\n const myUid = options.uid ?? process.getuid?.()\n const myGroups = options.groups ?? process.getgroups?.() ?? []\n const myGid = options.gid ?? process.getgid?.() ?? myGroups[0]\n if (myUid === undefined || myGid === undefined) {\n throw new Error('cannot get uid or gid')\n }\n\n const groups = new Set([myGid, ...myGroups])\n\n const mod = stat.mode\n const uid = stat.uid\n const gid = stat.gid\n\n const u = parseInt('100', 8)\n const g = parseInt('010', 8)\n const o = parseInt('001', 8)\n const ug = u | g\n\n return !!(\n mod & o ||\n (mod & g && groups.has(gid)) ||\n (mod & u && uid === myUid) ||\n (mod & ug && myUid === 0)\n )\n}\n","/**\n * This is the Windows implementation of isexe, which uses the file\n * extension and PATHEXT setting.\n *\n * @module\n */\n\nimport { Stats, statSync } from 'node:fs'\nimport { stat } from 'node:fs/promises'\nimport { IsexeOptions } from './options.js'\nimport { delimiter } from 'node:path'\n\n/**\n * Determine whether a path is executable based on the file extension\n * and PATHEXT environment variable (or specified pathExt option)\n */\nexport const isexe = async (\n path: string,\n options: IsexeOptions = {},\n): Promise<boolean> => {\n const { ignoreErrors = false } = options\n try {\n return checkStat(await stat(path), path, options)\n } catch (e) {\n const er = e as NodeJS.ErrnoException\n if (ignoreErrors || er.code === 'EACCES') return false\n throw er\n }\n}\n\n/**\n * Synchronously determine whether a path is executable based on the file\n * extension and PATHEXT environment variable (or specified pathExt option)\n */\nexport const sync = (\n path: string,\n options: IsexeOptions = {},\n): boolean => {\n const { ignoreErrors = false } = options\n try {\n return checkStat(statSync(path), path, options)\n } catch (e) {\n const er = e as NodeJS.ErrnoException\n if (ignoreErrors || er.code === 'EACCES') return false\n throw er\n }\n}\n\nconst checkPathExt = (path: string, options: IsexeOptions) => {\n const { pathExt = process.env.PATHEXT || '' } = options\n const peSplit = pathExt.split(delimiter)\n if (peSplit.indexOf('') !== -1) {\n return true\n }\n\n for (const pes of peSplit) {\n const p = pes.toLowerCase()\n const ext = path.substring(path.length - p.length).toLowerCase()\n\n if (p && ext === p) {\n return true\n }\n }\n return false\n}\n\nconst checkStat = (stat: Stats, path: string, options: IsexeOptions) =>\n stat.isFile() && checkPathExt(path, options)\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=options.js.map","import * as posix from './posix.js'\nimport * as win32 from './win32.js'\nexport * from './options.js'\nexport { win32, posix }\n\nconst platform = process.env._ISEXE_TEST_PLATFORM_ || process.platform\nconst impl = platform === 'win32' ? win32 : posix\n\n/**\n * Determine whether a path is executable on the current platform.\n */\nexport const isexe = impl.isexe\n/**\n * Synchronously determine whether a path is executable on the\n * current platform.\n */\nexport const sync = impl.sync\n","const { isexe, sync: isexeSync } = require('isexe')\nconst { join, delimiter, sep, posix } = require('path')\n\nconst isWindows = process.platform === 'win32'\n\n// used to check for slashed in commands passed in. always checks for the posix\n// seperator on all platforms, and checks for the current separator when not on\n// a posix platform. don't use the isWindows check for this since that is mocked\n// in tests but we still need the code to actually work when called. that is also\n// why it is ignored from coverage.\n/* istanbul ignore next */\nconst rSlash = new RegExp(`[${posix.sep}${sep === posix.sep ? '' : sep}]`.replace(/(\\\\)/g, '\\\\$1'))\nconst rRel = new RegExp(`^\\\\.${rSlash.source}`)\n\nconst getNotFoundError = (cmd) =>\n Object.assign(new Error(`not found: ${cmd}`), { code: 'ENOENT' })\n\nconst getPathInfo = (cmd, {\n path: optPath = process.env.PATH,\n pathExt: optPathExt = process.env.PATHEXT,\n delimiter: optDelimiter = delimiter,\n}) => {\n // If it has a slash, then we don't bother searching the pathenv.\n // just check the file itself, and that's it.\n const pathEnv = cmd.match(rSlash) ? [''] : [\n // windows always checks the cwd first\n ...(isWindows ? [process.cwd()] : []),\n ...(optPath || /* istanbul ignore next: very unusual */ '').split(optDelimiter),\n ]\n\n if (isWindows) {\n const pathExtExe = optPathExt ||\n ['.EXE', '.CMD', '.BAT', '.COM'].join(optDelimiter)\n const pathExt = pathExtExe.split(optDelimiter).flatMap((item) => [item, item.toLowerCase()])\n if (cmd.includes('.') && pathExt[0] !== '') {\n pathExt.unshift('')\n }\n return { pathEnv, pathExt, pathExtExe }\n }\n\n return { pathEnv, pathExt: [''] }\n}\n\nconst getPathPart = (raw, cmd) => {\n const pathPart = /^\".*\"$/.test(raw) ? raw.slice(1, -1) : raw\n const prefix = !pathPart && rRel.test(cmd) ? cmd.slice(0, 2) : ''\n return prefix + join(pathPart, cmd)\n}\n\nconst which = async (cmd, opt = {}) => {\n const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt)\n const found = []\n\n for (const envPart of pathEnv) {\n const p = getPathPart(envPart, cmd)\n\n for (const ext of pathExt) {\n const withExt = p + ext\n const is = await isexe(withExt, { pathExt: pathExtExe, ignoreErrors: true })\n if (is) {\n if (!opt.all) {\n return withExt\n }\n found.push(withExt)\n }\n }\n }\n\n if (opt.all && found.length) {\n return found\n }\n\n if (opt.nothrow) {\n return null\n }\n\n throw getNotFoundError(cmd)\n}\n\nconst whichSync = (cmd, opt = {}) => {\n const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt)\n const found = []\n\n for (const pathEnvPart of pathEnv) {\n const p = getPathPart(pathEnvPart, cmd)\n\n for (const ext of pathExt) {\n const withExt = p + ext\n const is = isexeSync(withExt, { pathExt: pathExtExe, ignoreErrors: true })\n if (is) {\n if (!opt.all) {\n return withExt\n }\n found.push(withExt)\n }\n }\n }\n\n if (opt.all && found.length) {\n return found\n }\n\n if (opt.nothrow) {\n return null\n }\n\n throw getNotFoundError(cmd)\n}\n\nmodule.exports = which\nwhich.sync = whichSync\n","'use server';\n\nimport { statSync } from 'node:fs';\nimport { join } from 'node:path';\nimport { resolve } from '@/lib/server-container';\nimport type { LoadSettingsUseCase } from '@shepai/core/application/use-cases/settings/load-settings.use-case';\nimport { getShepHomeDir } from '@shepai/core/infrastructure/services/filesystem/shep-directory.service';\nimport type { Settings } from '@shepai/core/domain/generated/output';\n\nexport interface LoadSettingsResult {\n settings?: Settings;\n shepHome?: string;\n dbFileSize?: string;\n error?: string;\n}\n\nfunction formatFileSize(bytes: number): string {\n if (bytes < 1024) return `${bytes} B`;\n if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;\n return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;\n}\n\nexport async function loadSettings(): Promise<LoadSettingsResult> {\n try {\n const useCase = resolve<LoadSettingsUseCase>('LoadSettingsUseCase');\n const settings = await useCase.execute();\n\n const shepHome = getShepHomeDir();\n let dbFileSize = 'Unknown';\n try {\n const dbPath = join(shepHome, 'data');\n const stat = statSync(dbPath);\n dbFileSize = formatFileSize(stat.size);\n } catch {\n // DB file may not exist yet\n }\n\n return { settings, shepHome, dbFileSize };\n } catch (error: unknown) {\n const message = error instanceof Error ? error.message : 'Failed to load settings';\n return { error: message };\n }\n}\n","'use server';\n\nimport { platform } from 'node:os';\nimport { getTerminalEntries } from '@shepai/core/infrastructure/services/tool-installer/tool-metadata';\nimport { checkBinaryExists } from '@shepai/core/infrastructure/services/tool-installer/binary-exists';\n\nexport interface AvailableTerminal {\n id: string;\n name: string;\n available: boolean;\n}\n\n/**\n * Returns the list of terminal entries from tool metadata, filtered to the\n * current platform, with availability checks. The \"system-terminal\" entry\n * is always marked available and listed first.\n */\nexport async function getAvailableTerminals(): Promise<AvailableTerminal[]> {\n const currentPlatform = platform();\n const entries = getTerminalEntries();\n\n const results: AvailableTerminal[] = [];\n\n for (const [id, meta] of entries) {\n // Skip terminals not supported on this platform\n if (\n meta.platforms &&\n !meta.platforms.includes(currentPlatform as 'linux' | 'darwin' | 'win32')\n ) {\n continue;\n }\n\n // System terminal is always available\n if (id === 'system-terminal') {\n results.unshift({ id: 'system', name: meta.name, available: true });\n continue;\n }\n\n // Check binary availability\n const binary = typeof meta.binary === 'string' ? meta.binary : meta.binary[currentPlatform];\n if (!binary) continue;\n\n // For app-bundle terminals (Warp, iTerm2) that use verifyCommand instead of binary check\n let available = false;\n if (meta.verifyCommand.startsWith('test ')) {\n // Use verifyCommand for app-bundle checks (e.g., \"test -d /Applications/Warp.app\")\n try {\n const { execSync } = await import('node:child_process');\n execSync(meta.verifyCommand, { stdio: 'ignore' });\n available = true;\n } catch {\n available = false;\n }\n } else {\n const result = await checkBinaryExists(binary);\n available = result.found;\n }\n\n results.push({ id, name: meta.name, available });\n }\n\n // Ensure system terminal is always present even if not in tool metadata\n if (!results.some((r) => r.id === 'system')) {\n results.unshift({ id: 'system', name: 'System Terminal', available: true });\n }\n\n return results;\n}\n","/**\n * Cross-platform binary existence check.\n *\n * Wraps the npm `which` package to provide a single cross-platform API\n * for checking if a binary exists in the system PATH. Works on Unix\n * (which) and Windows (where.exe + PATHEXT resolution) without platform\n * branching.\n */\n\nimport which from 'which';\n\n/**\n * Check if a binary exists in the system PATH.\n *\n * Uses the npm `which` package which handles Windows PATHEXT resolution\n * internally (.exe, .cmd, .bat extensions).\n *\n * Returns:\n * - `{ found: true }` when the binary is on PATH\n * - `{ found: false, notInPath: true }` when the binary is not on PATH\n * - `{ found: false, error }` for genuine errors (e.g. permission denied)\n */\nexport const checkBinaryExists = async (\n binary: string\n): Promise<{ found: boolean; notInPath?: boolean; error?: Error }> => {\n try {\n const result = await which(binary, { nothrow: true });\n if (result !== null) {\n return { found: true };\n }\n return { found: false, notInPath: true };\n } catch (error) {\n return { found: false, error: error instanceof Error ? error : new Error(String(error)) };\n }\n};\n"],"names":["registerServerReference","ensureServerEntryExports","actions","i","length","action","Error","node_fs_1","promises_1","isexe","path","options","ignoreErrors","checkStat","e","er","exports","sync","stat","checkMode","myUid","myGroups","myGid","groups","mod","uid","gid","u","g","o","ug","node_path_1","checkPathExt","pathExt","peSplit","pes","p","ext","require_options","__commonJSMin","posix","__importStar","win32","__exportStar","platform","impl"],"mappings":"8DAEA,EAAA,EAAA,CAAA,CAAA,OCOA,IAAM,EAA4C,CAEhD,kBAAmB,CAAE,YAAa,WAAY,YAAa,6BAA8B,EACzF,oBAAqB,CAAE,YAAa,aAAc,YAAa,iBAAkB,EACjF,mBAAoB,CAAE,YAAa,YAAa,YAAa,qBAAsB,EAGnF,iBAAkB,CAAE,YAAa,iBAAkB,YAAa,oBAAqB,EACrF,iBAAkB,CAAE,YAAa,iBAAkB,YAAa,sBAAuB,EACvF,iBAAkB,CAAE,YAAa,iBAAkB,YAAa,oBAAqB,EACrF,mBAAoB,CAAE,YAAa,mBAAoB,YAAa,iBAAkB,EAGtF,eAAgB,CAAE,YAAa,UAAW,YAAa,wBAAyB,EAChF,UAAW,CAAE,YAAa,UAAW,YAAa,gBAAiB,EACnE,gBAAiB,CAAE,YAAa,gBAAiB,YAAa,iBAAkB,EAGhF,eAAgB,CAAE,YAAa,eAAgB,YAAa,oBAAqB,EACjF,YAAa,CAAE,YAAa,YAAa,YAAa,gBAAiB,EAGvE,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AAK,IAAI,WAAE,CAAU,EAChD,CAOA,OAJI,AAAC,EAAQ,IAAI,CAAC,AAAC,GAAe,WAAT,AAAoB,EAAlB,EAAE,GAC3B,EAAQ,OAAO,CAAC,CAAE,GAAI,SAAU,KAAM,kBAAmB,WAAW,CAAK,GAGpE,CACT,iCAlDsB,IAAA,CAAA,EAAA,EAAA,uBAAA,EAAA,EAAA,6CAAA","ignoreList":[3,4,14]}
1
+ {"version":3,"sources":["../../../../../../../src/presentation/web/app/actions/get-all-agent-models.ts","../../../../../../../src/presentation/web/lib/model-metadata.ts","../../../../../../../src/presentation/web/app/actions/update-agent-and-model.ts","../../../../../../../src/presentation/web/lib/server-container.ts","../../../../../../../packages/core/src/infrastructure/services/filesystem/shep-directory.service.ts","../../../../../../../node_modules/.pnpm/next%4016.1.6_%40babel%2Bcore%407.29.0_%40playwright%2Btest%401.58.1_react-dom%4019.2.4_react%4019.2.4__react%4019.2.4/node_modules/next/src/build/webpack/loaders/next-flight-loader/server-reference.ts","../../../../../../../node_modules/.pnpm/next%4016.1.6_%40babel%2Bcore%407.29.0_%40playwright%2Btest%401.58.1_react-dom%4019.2.4_react%4019.2.4__react%4019.2.4/node_modules/next/src/build/webpack/loaders/next-flight-loader/action-validate.ts","../../../../../../../packages/core/src/infrastructure/services/folder-dialog.service.ts","../../../../../../../src/presentation/web/app/actions/pick-folder.ts","../../../../../../../packages/core/src/infrastructure/services/tool-installer/tool-metadata.ts","../../../../../../../node_modules/.pnpm/isexe%403.1.5/node_modules/isexe/src/posix.ts","../../../../../../../node_modules/.pnpm/isexe%403.1.5/node_modules/isexe/src/win32.ts","../../../../../../../node_modules/.pnpm/isexe%403.1.5/node_modules/isexe/dist/commonjs/options.js","../../../../../../../node_modules/.pnpm/isexe%403.1.5/node_modules/isexe/src/index.ts","../../../../../../../node_modules/.pnpm/which%405.0.0/node_modules/which/lib/index.js","../../../../../../../src/presentation/web/app/actions/load-settings.ts","../../../../../../../src/presentation/web/app/actions/get-available-terminals.ts","../../../../../../../packages/core/src/infrastructure/services/tool-installer/binary-exists.ts"],"sourcesContent":["'use server';\n\nimport { resolve } from '@/lib/server-container';\nimport { getModelMeta } from '@/lib/model-metadata';\nimport type { IAgentExecutorFactory } from '@shepai/core/application/ports/output/agents/agent-executor-factory.interface';\n\nexport interface ModelInfo {\n id: string;\n displayName: string;\n description: string;\n}\n\nexport interface AgentModelGroup {\n agentType: string;\n label: string;\n models: ModelInfo[];\n}\n\nconst AGENT_LABELS: Record<string, string> = {\n 'claude-code': 'Claude Code',\n cursor: 'Cursor CLI',\n 'gemini-cli': 'Gemini CLI',\n dev: 'Demo',\n};\n\n/** Sort weight — higher = further down. Demo always last. */\nconst AGENT_ORDER: Record<string, number> = {\n 'claude-code': 0,\n cursor: 1,\n 'gemini-cli': 2,\n dev: 99,\n};\n\nexport async function getAllAgentModels(): Promise<AgentModelGroup[]> {\n try {\n const factory = resolve<IAgentExecutorFactory>('IAgentExecutorFactory');\n const agents = factory.getSupportedAgents();\n return agents\n .map((agentType) => ({\n agentType: agentType as string,\n label: AGENT_LABELS[agentType as string] ?? (agentType as string),\n models: factory.getSupportedModels(agentType).map((id) => ({\n id,\n ...getModelMeta(id),\n })),\n }))\n .map((g) => {\n // Dev agent gets fun demo models\n if (g.agentType === 'dev' && g.models.length === 0) {\n return {\n ...g,\n models: [\n { id: 'gpt-8', ...getModelMeta('gpt-8') },\n { id: 'opus-7', ...getModelMeta('opus-7') },\n ],\n };\n }\n return g;\n })\n .filter((g) => g.models.length > 0)\n .sort((a, b) => (AGENT_ORDER[a.agentType] ?? 50) - (AGENT_ORDER[b.agentType] ?? 50));\n } catch {\n return [];\n }\n}\n","export interface ModelMeta {\n displayName: string;\n description: string;\n}\n\n/**\n * Presentation-layer metadata for known LLM model identifiers.\n * Maps raw model IDs to human-friendly display names and short descriptions.\n */\nconst MODEL_METADATA: Record<string, ModelMeta> = {\n // Claude models\n 'claude-opus-4-6': { displayName: 'Opus 4.6', description: 'Most capable, complex tasks' },\n 'claude-sonnet-4-6': { displayName: 'Sonnet 4.6', description: 'Fast & balanced' },\n 'claude-haiku-4-5': { displayName: 'Haiku 4.5', description: 'Lightweight & quick' },\n\n // Gemini models\n 'gemini-3.1-pro': { displayName: 'Gemini 3.1 Pro', description: 'Advanced reasoning' },\n 'gemini-3-flash': { displayName: 'Gemini 3 Flash', description: 'Ultra-fast responses' },\n 'gemini-2.5-pro': { displayName: 'Gemini 2.5 Pro', description: 'Reliable workhorse' },\n 'gemini-2.5-flash': { displayName: 'Gemini 2.5 Flash', description: 'Speed-optimized' },\n\n // OpenAI models\n 'gpt-5.4-high': { displayName: 'GPT-5.4', description: 'Latest reasoning model' },\n 'gpt-5.2': { displayName: 'GPT-5.2', description: 'Flagship model' },\n 'gpt-5.3-codex': { displayName: 'GPT-5.3 Codex', description: 'Code specialist' },\n\n // Other\n 'composer-1.5': { displayName: 'Composer 1.5', description: 'Multi-file editing' },\n 'grok-code': { displayName: 'Grok Code', description: 'xAI code model' },\n\n // Demo / fun models\n 'gpt-8': { displayName: 'GPT-8', description: 'Writes code before you think it' },\n 'opus-7': { displayName: 'Opus 7', description: 'Achieved consciousness, ships on time' },\n};\n\nconst FALLBACK: ModelMeta = { displayName: '', description: '' };\n\nexport function getModelMeta(modelId: string): ModelMeta {\n const meta = MODEL_METADATA[modelId];\n if (meta) return meta;\n // Fallback: prettify the raw ID\n return {\n ...FALLBACK,\n displayName: modelId\n .replace(/^claude-/, '')\n .replace(/^gemini-/, 'Gemini ')\n .replace(/^gpt-/, 'GPT-')\n .replace(/-/g, ' ')\n .replace(/\\b\\w/g, (c) => c.toUpperCase()),\n };\n}\n","'use server';\n\nimport { resolve } from '@/lib/server-container';\nimport {\n resetSettings,\n initializeSettings,\n} from '@shepai/core/infrastructure/services/settings.service';\nimport type { CompleteWebOnboardingUseCase } from '@shepai/core/application/use-cases/settings/complete-web-onboarding.use-case';\nimport type { AgentType } from '@shepai/core/domain/generated/output';\n\nexport async function updateAgentAndModel(\n agentType: string,\n model: string | null\n): Promise<{ ok: boolean; error?: string }> {\n if (!agentType.trim()) {\n return { ok: false, error: 'agent type is required' };\n }\n\n try {\n const useCase = resolve<CompleteWebOnboardingUseCase>('CompleteWebOnboardingUseCase');\n const updatedSettings = await useCase.execute({\n agentType: agentType.trim() as AgentType,\n model,\n });\n\n resetSettings();\n initializeSettings(updatedSettings);\n\n return { ok: true };\n } catch (error: unknown) {\n const message = error instanceof Error ? error.message : 'Failed to update agent and model';\n return { ok: false, error: message };\n }\n}\n","/**\n * Server Container Accessor\n *\n * Provides a `resolve()` helper for server components and API routes to\n * obtain DI-managed instances. The tsyringe container is placed on globalThis\n * by the CLI bootstrap (`shep ui`) or the dev-server (`pnpm dev:web`).\n */\n\nimport type { DependencyContainer, InjectionToken } from 'tsyringe';\n\nconst CONTAINER_KEY = '__shepContainer';\n\n/**\n * Resolve a dependency from the DI container.\n *\n * Usage in server components / API routes:\n * ```ts\n * import { resolve } from '@/lib/server-container';\n * import { ListFeaturesUseCase } from '@shepai/core/application/use-cases/features/list-features.use-case';\n *\n * const features = await resolve(ListFeaturesUseCase).execute();\n * ```\n */\nexport function resolve<T>(token: InjectionToken<T>): T {\n const container = (globalThis as Record<string, unknown>)[CONTAINER_KEY] as\n | DependencyContainer\n | undefined;\n\n if (!container) {\n throw new Error(\n 'DI container not available. Ensure the CLI bootstrap or dev-server has initialized it.'\n );\n }\n\n return container.resolve(token);\n}\n","/**\n * Shep Directory Service\n *\n * Manages the ~/.shep/ directory for global settings and data storage.\n * Ensures directory exists with correct permissions before database operations.\n *\n * Supports SHEP_HOME env var for test isolation (overrides default ~/.shep/).\n */\n\nimport { mkdir } from 'node:fs/promises';\nimport { homedir } from 'node:os';\nimport { join } from 'node:path';\nimport { existsSync } from 'node:fs';\n\n/**\n * Resolves the Shep home directory.\n * Respects SHEP_HOME env var for test isolation, falls back to ~/.shep/\n */\nfunction resolveShepHomeDir(): string {\n return process.env.SHEP_HOME ?? join(homedir(), '.shep');\n}\n\n/**\n * Gets the path to the Shep home directory.\n * Uses SHEP_HOME env var if set, otherwise ~/.shep/\n *\n * @returns Path to shep home directory\n */\nexport function getShepHomeDir(): string {\n return resolveShepHomeDir();\n}\n\n/**\n * Gets the path to the SQLite database file.\n *\n * @returns Path to the database file\n */\nexport function getShepDbPath(): string {\n return join(resolveShepHomeDir(), 'data');\n}\n\n/**\n * Gets the path to the daemon state file.\n * Uses SHEP_HOME env var if set (for test isolation), otherwise ~/.shep/daemon.json\n *\n * @returns Path to daemon.json\n */\nexport function getDaemonStatePath(): string {\n return join(resolveShepHomeDir(), 'daemon.json');\n}\n\n/**\n * Gets the path to the daemon log file.\n * Uses SHEP_HOME env var if set (for test isolation), otherwise ~/.shep/daemon.log\n *\n * @returns Path to daemon.log\n */\nexport function getDaemonLogPath(): string {\n return join(resolveShepHomeDir(), 'daemon.log');\n}\n\n/**\n * Ensures the shep home directory exists with correct permissions.\n * Creates the directory if it doesn't exist.\n * Safe to call multiple times (idempotent).\n *\n * Permissions: 700 (rwx------) - only owner can read/write/execute\n *\n * @throws Error if directory cannot be created (permissions, disk space, etc.)\n */\nexport async function ensureShepDirectory(): Promise<void> {\n const shepDir = resolveShepHomeDir();\n\n if (existsSync(shepDir)) {\n return;\n }\n\n try {\n await mkdir(shepDir, {\n recursive: true,\n mode: 0o700,\n });\n } catch (error) {\n throw new Error(\n `Failed to create Shep directory at ${shepDir}: ${error instanceof Error ? error.message : String(error)}`\n );\n }\n}\n","/* eslint-disable import/no-extraneous-dependencies */\nexport { registerServerReference } from 'react-server-dom-webpack/server'\n","// This function ensures that all the exported values are valid server actions,\n// during the runtime. By definition all actions are required to be async\n// functions, but here we can only check that they are functions.\nexport function ensureServerEntryExports(actions: any[]) {\n for (let i = 0; i < actions.length; i++) {\n const action = actions[i]\n if (typeof action !== 'function') {\n throw new Error(\n `A \"use server\" file can only export async functions, found ${typeof action}.\\nRead more: https://nextjs.org/docs/messages/invalid-use-server-value`\n )\n }\n }\n}\n","import { execSync } from 'node:child_process';\n\nexport interface FolderDialogDeps {\n platform: NodeJS.Platform;\n exec: (cmd: string, opts?: { encoding: BufferEncoding; timeout?: number }) => string;\n}\n\nconst defaultDeps: FolderDialogDeps = {\n platform: process.platform,\n exec: (cmd, opts) => execSync(cmd, opts) as unknown as string,\n};\n\n/**\n * Platform-specific commands that open a native OS folder picker dialog.\n * Each returns the chosen absolute folder path on stdout, or exits non-zero / returns empty on cancel.\n */\nconst PLATFORM_COMMANDS: Record<string, string> = {\n darwin: `osascript -e 'POSIX path of (choose folder with prompt \"Select a repository folder\")'`,\n linux: `zenity --file-selection --directory --title=\"Select a repository folder\" 2>/dev/null`,\n win32: `powershell -NoProfile -Command \"Add-Type -AssemblyName System.Windows.Forms; $f = New-Object System.Windows.Forms.FolderBrowserDialog; $f.Description = 'Select a repository folder'; if ($f.ShowDialog() -eq 'OK') { $f.SelectedPath } else { exit 1 }\"`,\n};\n\nexport class FolderDialogService {\n private deps: FolderDialogDeps;\n\n constructor(deps: Partial<FolderDialogDeps> = {}) {\n this.deps = { ...defaultDeps, ...deps };\n }\n\n /** Returns the OS-specific command string, or null if the platform is unsupported. */\n getCommand(): string | null {\n return PLATFORM_COMMANDS[this.deps.platform] ?? null;\n }\n\n /**\n * Opens a native folder picker dialog and returns the selected absolute path.\n * Returns `null` if the user cancels the dialog.\n * Throws if the platform is unsupported or the command fails unexpectedly.\n */\n pickFolder(): string | null {\n const command = this.getCommand();\n if (!command) {\n throw new Error(`Unsupported platform: ${this.deps.platform}`);\n }\n\n try {\n const result = this.deps.exec(command, { encoding: 'utf-8', timeout: 60_000 });\n const trimmed = result.trim();\n return trimmed.length > 0 ? trimmed : null;\n } catch (error: unknown) {\n // User cancelled the dialog — exit code 1 from osascript/zenity/powershell\n if (isExecError(error) && error.status === 1) {\n return null;\n }\n throw error;\n }\n }\n}\n\nfunction isExecError(error: unknown): error is { status: number } {\n return typeof error === 'object' && error !== null && 'status' in error;\n}\n","'use server';\n\nimport { FolderDialogService } from '@shepai/core/infrastructure/services/folder-dialog.service';\n\nexport async function pickFolder(): Promise<{ path: string | null; error?: string }> {\n const service = new FolderDialogService();\n\n try {\n const path = service.pickFolder();\n return { path };\n } catch (error: unknown) {\n const message = error instanceof Error ? error.message : 'Failed to open folder dialog';\n return { path: null, error: message };\n }\n}\n","/**\n * Tool Installation Metadata\n *\n * Dynamically loads tool definitions from individual JSON files in the tools/ directory.\n * Each JSON file defines installation commands and metadata for a single development tool.\n *\n * To add a new tool, create a JSON file in tools/ matching the ToolMetadata schema:\n * tools/<tool-name>.json\n */\n\nimport { readdirSync, readFileSync } from 'node:fs';\nimport { join, basename } from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nexport interface ToolMetadata {\n /** Human-readable display name */\n name: string;\n\n /** Short one-line summary */\n summary: string;\n\n /** Detailed description */\n description: string;\n\n /** Tool tags for grouping in listings. A tool can belong to multiple categories. */\n tags: ('ide' | 'cli-agent' | 'vcs' | 'terminal')[];\n\n /** Company or developer name */\n author?: string;\n\n /** Main website/homepage URL (separate from documentation) */\n website?: string;\n\n /** Supported platforms (os.platform() values) */\n platforms?: ('linux' | 'darwin' | 'win32')[];\n\n /** URL to the tool's icon/logo image */\n iconUrl?: string;\n\n /** Binary name to check with 'which' command (string or per-platform map) */\n binary: string | Record<string, string>;\n\n /** Package manager or installation method */\n packageManager: string;\n\n /** Platform-specific installation commands as shell strings (keyed by os.platform()) */\n commands: Record<string, string>;\n\n /** Installation timeout in milliseconds */\n timeout: number;\n\n /** Official documentation URL */\n documentationUrl: string;\n\n /** Command to verify installation (e.g., \"code --version\") */\n verifyCommand: string;\n\n /** Whether the tool supports automated installation (default: true) */\n autoInstall?: boolean;\n\n /** Whether this tool is required for the platform to function (default: false) */\n required?: boolean;\n\n /** Command to open a directory in this tool.\n * String format: \"code {dir}\" — single command for all platforms.\n * Object format: { \"linux\": \"antigravity {dir}\", \"darwin\": \"agy {dir}\" } — per-platform commands. */\n openDirectory?: string | Record<string, string>;\n\n /** Override default spawn options for the launch process.\n * Defaults: { detached: true, stdio: \"ignore\" } (GUI IDEs).\n * CLI agents should use { shell: true, stdio: \"inherit\" } to run in the current terminal. */\n spawnOptions?: {\n shell?: boolean;\n stdio?: 'ignore' | 'inherit' | 'pipe';\n detached?: boolean;\n };\n\n /** Platform-specific command to launch this tool in a new terminal window.\n * Used when launching from the web UI where no terminal is available.\n * When set, the launcher spawns a new terminal window with this command.\n * Supports {dir} placeholder like openDirectory.\n * Example: \"x-terminal-emulator -e bash -c 'cd {dir} && claude'\" */\n terminalCommand?: string | Record<string, string>;\n}\n\nconst REQUIRED_FIELDS: (keyof ToolMetadata)[] = [\n 'name',\n 'summary',\n 'description',\n 'tags',\n 'binary',\n 'packageManager',\n 'commands',\n 'timeout',\n 'documentationUrl',\n 'verifyCommand',\n];\n\nfunction loadToolMetadata(): Record<string, ToolMetadata> {\n // NOTE: This module uses import.meta.url to resolve the tools/ directory.\n // It works correctly when loaded in the Node.js CLI bootstrap context but\n // breaks when bundled by Turbopack (import.meta.url points to the chunk\n // location where tools/ doesn't exist). API routes should access tool\n // metadata via the DI container, not by importing this module directly.\n const toolsDir = join(fileURLToPath(import.meta.url), '..', 'tools');\n const metadata: Record<string, ToolMetadata> = {};\n\n let files: string[];\n try {\n files = readdirSync(toolsDir).filter((f) => f.endsWith('.json'));\n } catch {\n return metadata;\n }\n\n for (const file of files) {\n const toolName = basename(file, '.json');\n try {\n const raw = readFileSync(join(toolsDir, file), 'utf-8');\n const parsed = JSON.parse(raw) as ToolMetadata;\n\n const missing = REQUIRED_FIELDS.filter((field) => !(field in parsed));\n if (missing.length > 0) {\n continue;\n }\n\n metadata[toolName] = parsed;\n } catch {\n // Skip malformed JSON files\n }\n }\n\n return metadata;\n}\n\nexport const TOOL_METADATA: Record<string, ToolMetadata> = loadToolMetadata();\n\n/**\n * Returns entries from TOOL_METADATA that can open a directory as an IDE.\n * A tool qualifies if it has an `openDirectory` field, regardless of category.\n * Each entry is [toolId, metadata].\n */\nexport function getIdeEntries(): [string, ToolMetadata][] {\n return Object.entries(TOOL_METADATA).filter(([, meta]) => meta.openDirectory != null);\n}\n\n/**\n * Returns entries from TOOL_METADATA tagged as \"terminal\" that have an\n * `openDirectory` field. Each entry is [toolId, metadata].\n */\nexport function getTerminalEntries(): [string, ToolMetadata][] {\n return Object.entries(TOOL_METADATA).filter(\n ([, meta]) => meta.tags.includes('terminal') && meta.openDirectory != null\n );\n}\n","/**\n * This is the Posix implementation of isexe, which uses the file\n * mode and uid/gid values.\n *\n * @module\n */\n\nimport { Stats, statSync } from 'node:fs'\nimport { stat } from 'node:fs/promises'\nimport { IsexeOptions } from './options.js'\n\n/**\n * Determine whether a path is executable according to the mode and\n * current (or specified) user and group IDs.\n */\nexport const isexe = async (\n path: string,\n options: IsexeOptions = {},\n): Promise<boolean> => {\n const { ignoreErrors = false } = options\n try {\n return checkStat(await stat(path), options)\n } catch (e) {\n const er = e as NodeJS.ErrnoException\n if (ignoreErrors || er.code === 'EACCES') return false\n throw er\n }\n}\n\n/**\n * Synchronously determine whether a path is executable according to\n * the mode and current (or specified) user and group IDs.\n */\nexport const sync = (\n path: string,\n options: IsexeOptions = {},\n): boolean => {\n const { ignoreErrors = false } = options\n try {\n return checkStat(statSync(path), options)\n } catch (e) {\n const er = e as NodeJS.ErrnoException\n if (ignoreErrors || er.code === 'EACCES') return false\n throw er\n }\n}\n\nconst checkStat = (stat: Stats, options: IsexeOptions) =>\n stat.isFile() && checkMode(stat, options)\n\nconst checkMode = (stat: Stats, options: IsexeOptions) => {\n const myUid = options.uid ?? process.getuid?.()\n const myGroups = options.groups ?? process.getgroups?.() ?? []\n const myGid = options.gid ?? process.getgid?.() ?? myGroups[0]\n if (myUid === undefined || myGid === undefined) {\n throw new Error('cannot get uid or gid')\n }\n\n const groups = new Set([myGid, ...myGroups])\n\n const mod = stat.mode\n const uid = stat.uid\n const gid = stat.gid\n\n const u = parseInt('100', 8)\n const g = parseInt('010', 8)\n const o = parseInt('001', 8)\n const ug = u | g\n\n return !!(\n mod & o ||\n (mod & g && groups.has(gid)) ||\n (mod & u && uid === myUid) ||\n (mod & ug && myUid === 0)\n )\n}\n","/**\n * This is the Windows implementation of isexe, which uses the file\n * extension and PATHEXT setting.\n *\n * @module\n */\n\nimport { Stats, statSync } from 'node:fs'\nimport { stat } from 'node:fs/promises'\nimport { IsexeOptions } from './options.js'\nimport { delimiter } from 'node:path'\n\n/**\n * Determine whether a path is executable based on the file extension\n * and PATHEXT environment variable (or specified pathExt option)\n */\nexport const isexe = async (\n path: string,\n options: IsexeOptions = {},\n): Promise<boolean> => {\n const { ignoreErrors = false } = options\n try {\n return checkStat(await stat(path), path, options)\n } catch (e) {\n const er = e as NodeJS.ErrnoException\n if (ignoreErrors || er.code === 'EACCES') return false\n throw er\n }\n}\n\n/**\n * Synchronously determine whether a path is executable based on the file\n * extension and PATHEXT environment variable (or specified pathExt option)\n */\nexport const sync = (\n path: string,\n options: IsexeOptions = {},\n): boolean => {\n const { ignoreErrors = false } = options\n try {\n return checkStat(statSync(path), path, options)\n } catch (e) {\n const er = e as NodeJS.ErrnoException\n if (ignoreErrors || er.code === 'EACCES') return false\n throw er\n }\n}\n\nconst checkPathExt = (path: string, options: IsexeOptions) => {\n const { pathExt = process.env.PATHEXT || '' } = options\n const peSplit = pathExt.split(delimiter)\n if (peSplit.indexOf('') !== -1) {\n return true\n }\n\n for (const pes of peSplit) {\n const p = pes.toLowerCase()\n const ext = path.substring(path.length - p.length).toLowerCase()\n\n if (p && ext === p) {\n return true\n }\n }\n return false\n}\n\nconst checkStat = (stat: Stats, path: string, options: IsexeOptions) =>\n stat.isFile() && checkPathExt(path, options)\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=options.js.map","import * as posix from './posix.js'\nimport * as win32 from './win32.js'\nexport * from './options.js'\nexport { win32, posix }\n\nconst platform = process.env._ISEXE_TEST_PLATFORM_ || process.platform\nconst impl = platform === 'win32' ? win32 : posix\n\n/**\n * Determine whether a path is executable on the current platform.\n */\nexport const isexe = impl.isexe\n/**\n * Synchronously determine whether a path is executable on the\n * current platform.\n */\nexport const sync = impl.sync\n","const { isexe, sync: isexeSync } = require('isexe')\nconst { join, delimiter, sep, posix } = require('path')\n\nconst isWindows = process.platform === 'win32'\n\n// used to check for slashed in commands passed in. always checks for the posix\n// seperator on all platforms, and checks for the current separator when not on\n// a posix platform. don't use the isWindows check for this since that is mocked\n// in tests but we still need the code to actually work when called. that is also\n// why it is ignored from coverage.\n/* istanbul ignore next */\nconst rSlash = new RegExp(`[${posix.sep}${sep === posix.sep ? '' : sep}]`.replace(/(\\\\)/g, '\\\\$1'))\nconst rRel = new RegExp(`^\\\\.${rSlash.source}`)\n\nconst getNotFoundError = (cmd) =>\n Object.assign(new Error(`not found: ${cmd}`), { code: 'ENOENT' })\n\nconst getPathInfo = (cmd, {\n path: optPath = process.env.PATH,\n pathExt: optPathExt = process.env.PATHEXT,\n delimiter: optDelimiter = delimiter,\n}) => {\n // If it has a slash, then we don't bother searching the pathenv.\n // just check the file itself, and that's it.\n const pathEnv = cmd.match(rSlash) ? [''] : [\n // windows always checks the cwd first\n ...(isWindows ? [process.cwd()] : []),\n ...(optPath || /* istanbul ignore next: very unusual */ '').split(optDelimiter),\n ]\n\n if (isWindows) {\n const pathExtExe = optPathExt ||\n ['.EXE', '.CMD', '.BAT', '.COM'].join(optDelimiter)\n const pathExt = pathExtExe.split(optDelimiter).flatMap((item) => [item, item.toLowerCase()])\n if (cmd.includes('.') && pathExt[0] !== '') {\n pathExt.unshift('')\n }\n return { pathEnv, pathExt, pathExtExe }\n }\n\n return { pathEnv, pathExt: [''] }\n}\n\nconst getPathPart = (raw, cmd) => {\n const pathPart = /^\".*\"$/.test(raw) ? raw.slice(1, -1) : raw\n const prefix = !pathPart && rRel.test(cmd) ? cmd.slice(0, 2) : ''\n return prefix + join(pathPart, cmd)\n}\n\nconst which = async (cmd, opt = {}) => {\n const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt)\n const found = []\n\n for (const envPart of pathEnv) {\n const p = getPathPart(envPart, cmd)\n\n for (const ext of pathExt) {\n const withExt = p + ext\n const is = await isexe(withExt, { pathExt: pathExtExe, ignoreErrors: true })\n if (is) {\n if (!opt.all) {\n return withExt\n }\n found.push(withExt)\n }\n }\n }\n\n if (opt.all && found.length) {\n return found\n }\n\n if (opt.nothrow) {\n return null\n }\n\n throw getNotFoundError(cmd)\n}\n\nconst whichSync = (cmd, opt = {}) => {\n const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt)\n const found = []\n\n for (const pathEnvPart of pathEnv) {\n const p = getPathPart(pathEnvPart, cmd)\n\n for (const ext of pathExt) {\n const withExt = p + ext\n const is = isexeSync(withExt, { pathExt: pathExtExe, ignoreErrors: true })\n if (is) {\n if (!opt.all) {\n return withExt\n }\n found.push(withExt)\n }\n }\n }\n\n if (opt.all && found.length) {\n return found\n }\n\n if (opt.nothrow) {\n return null\n }\n\n throw getNotFoundError(cmd)\n}\n\nmodule.exports = which\nwhich.sync = whichSync\n","'use server';\n\nimport { statSync } from 'node:fs';\nimport { join } from 'node:path';\nimport { resolve } from '@/lib/server-container';\nimport type { LoadSettingsUseCase } from '@shepai/core/application/use-cases/settings/load-settings.use-case';\nimport { getShepHomeDir } from '@shepai/core/infrastructure/services/filesystem/shep-directory.service';\nimport type { Settings } from '@shepai/core/domain/generated/output';\n\nexport interface LoadSettingsResult {\n settings?: Settings;\n shepHome?: string;\n dbFileSize?: string;\n error?: string;\n}\n\nfunction formatFileSize(bytes: number): string {\n if (bytes < 1024) return `${bytes} B`;\n if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;\n return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;\n}\n\nexport async function loadSettings(): Promise<LoadSettingsResult> {\n try {\n const useCase = resolve<LoadSettingsUseCase>('LoadSettingsUseCase');\n const settings = await useCase.execute();\n\n const shepHome = getShepHomeDir();\n let dbFileSize = 'Unknown';\n try {\n const dbPath = join(shepHome, 'data');\n const stat = statSync(dbPath);\n dbFileSize = formatFileSize(stat.size);\n } catch {\n // DB file may not exist yet\n }\n\n return { settings, shepHome, dbFileSize };\n } catch (error: unknown) {\n const message = error instanceof Error ? error.message : 'Failed to load settings';\n return { error: message };\n }\n}\n","'use server';\n\nimport { platform } from 'node:os';\nimport { getTerminalEntries } from '@shepai/core/infrastructure/services/tool-installer/tool-metadata';\nimport { checkBinaryExists } from '@shepai/core/infrastructure/services/tool-installer/binary-exists';\n\nexport interface AvailableTerminal {\n id: string;\n name: string;\n available: boolean;\n}\n\n/**\n * Returns the list of terminal entries from tool metadata, filtered to the\n * current platform, with availability checks. The \"system-terminal\" entry\n * is always marked available and listed first.\n */\nexport async function getAvailableTerminals(): Promise<AvailableTerminal[]> {\n const currentPlatform = platform();\n const entries = getTerminalEntries();\n\n const results: AvailableTerminal[] = [];\n\n for (const [id, meta] of entries) {\n // Skip terminals not supported on this platform\n if (\n meta.platforms &&\n !meta.platforms.includes(currentPlatform as 'linux' | 'darwin' | 'win32')\n ) {\n continue;\n }\n\n // System terminal is always available\n if (id === 'system-terminal') {\n results.unshift({ id: 'system', name: meta.name, available: true });\n continue;\n }\n\n // Check binary availability\n const binary = typeof meta.binary === 'string' ? meta.binary : meta.binary[currentPlatform];\n if (!binary) continue;\n\n // For app-bundle terminals (Warp, iTerm2) that use verifyCommand instead of binary check\n let available = false;\n if (meta.verifyCommand.startsWith('test ')) {\n // Use verifyCommand for app-bundle checks (e.g., \"test -d /Applications/Warp.app\")\n try {\n const { execSync } = await import('node:child_process');\n execSync(meta.verifyCommand, { stdio: 'ignore' });\n available = true;\n } catch {\n available = false;\n }\n } else {\n const result = await checkBinaryExists(binary);\n available = result.found;\n }\n\n results.push({ id, name: meta.name, available });\n }\n\n // Ensure system terminal is always present even if not in tool metadata\n if (!results.some((r) => r.id === 'system')) {\n results.unshift({ id: 'system', name: 'System Terminal', available: true });\n }\n\n return results;\n}\n","/**\n * Cross-platform binary existence check.\n *\n * Wraps the npm `which` package to provide a single cross-platform API\n * for checking if a binary exists in the system PATH. Works on Unix\n * (which) and Windows (where.exe + PATHEXT resolution) without platform\n * branching.\n */\n\nimport which from 'which';\n\n/**\n * Check if a binary exists in the system PATH.\n *\n * Uses the npm `which` package which handles Windows PATHEXT resolution\n * internally (.exe, .cmd, .bat extensions).\n *\n * Returns:\n * - `{ found: true }` when the binary is on PATH\n * - `{ found: false, notInPath: true }` when the binary is not on PATH\n * - `{ found: false, error }` for genuine errors (e.g. permission denied)\n */\nexport const checkBinaryExists = async (\n binary: string\n): Promise<{ found: boolean; notInPath?: boolean; error?: Error }> => {\n try {\n const result = await which(binary, { nothrow: true });\n if (result !== null) {\n return { found: true };\n }\n return { found: false, notInPath: true };\n } catch (error) {\n return { found: false, error: error instanceof Error ? error : new Error(String(error)) };\n }\n};\n"],"names":["registerServerReference","ensureServerEntryExports","actions","i","length","action","Error","node_fs_1","promises_1","isexe","path","options","ignoreErrors","checkStat","e","er","exports","sync","stat","checkMode","myUid","myGroups","myGid","groups","mod","uid","gid","u","g","o","ug","node_path_1","checkPathExt","pathExt","peSplit","pes","p","ext","require_options","__commonJSMin","posix","__importStar","win32","__exportStar","platform","impl"],"mappings":"8DAEA,EAAA,EAAA,CAAA,CAAA,OCOA,IAAM,EAA4C,CAEhD,kBAAmB,CAAE,YAAa,WAAY,YAAa,6BAA8B,EACzF,oBAAqB,CAAE,YAAa,aAAc,YAAa,iBAAkB,EACjF,mBAAoB,CAAE,YAAa,YAAa,YAAa,qBAAsB,EAGnF,iBAAkB,CAAE,YAAa,iBAAkB,YAAa,oBAAqB,EACrF,iBAAkB,CAAE,YAAa,iBAAkB,YAAa,sBAAuB,EACvF,iBAAkB,CAAE,YAAa,iBAAkB,YAAa,oBAAqB,EACrF,mBAAoB,CAAE,YAAa,mBAAoB,YAAa,iBAAkB,EAGtF,eAAgB,CAAE,YAAa,UAAW,YAAa,wBAAyB,EAChF,UAAW,CAAE,YAAa,UAAW,YAAa,gBAAiB,EAC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AAS,GAC/C,EAAY,EACd,CAAE,KAAM,CACN,GAAY,CACd,MAGA,EAAY,CADG,MAAM,EAAkB,EAAA,EACpB,KAAK,CAG1B,EAAQ,IAAI,CAAC,IAAE,EAAI,KAAM,EAAK,IAAI,WAAE,CAAU,EAChD,CAOA,OAJI,AAAC,EAAQ,IAAI,CAAC,AAAC,GAAe,WAAT,AAAoB,EAAlB,EAAE,GAC3B,EAAQ,OAAO,CAAC,CAAE,GAAI,SAAU,KAAM,kBAAmB,WAAW,CAAK,GAGpE,CACT,iCAlDsB,IAAA,CAAA,EAAA,EAAA,uBAAA,EAAA,EAAA,6CAAA","ignoreList":[5,6,14]}
@@ -0,0 +1,3 @@
1
+ module.exports=[31747,a=>{"use strict";var b=a.i(81719),c=a.i(14703),d=a.i(79372);function e(a,e,f){let g=(e?.status===b.AgentRunStatus.running||e?.status===b.AgentRunStatus.pending)&&e?.pid?(0,d.isProcessAlive)(e.pid):void 0;return{name:a.name,description:a.description??a.slug,featureId:a.id,lifecycle:(0,c.deriveLifecycle)(a,e),repositoryPath:a.repositoryPath,branch:a.branch,specPath:a.specPath,state:(0,c.deriveNodeState)(a,e,void 0!==g?{isPidAlive:g}:void 0),progress:(0,c.deriveProgress)(a),summary:a.description,userQuery:a.userQuery,createdAt:a.createdAt instanceof Date?a.createdAt.getTime():a.createdAt,...a.fast&&{fastMode:!0},approvalGates:a.approvalGates,push:a.push,openPr:a.openPr,...f?.enableEvidence!=null&&{enableEvidence:f.enableEvidence},...f?.commitEvidence!=null&&{commitEvidence:f.commitEvidence},...f?.ciWatchEnabled!=null&&{ciWatchEnabled:f.ciWatchEnabled},...f?.repositoryName&&{repositoryName:f.repositoryName},...f?.baseBranch&&{baseBranch:f.baseBranch},...f?.oneLiner&&{oneLiner:f.oneLiner},...f?.remoteUrl&&{remoteUrl:f.remoteUrl},...e?.agentType&&{agentType:e.agentType},...e?.modelId&&{modelId:e.modelId},...e?.error&&{errorMessage:e.error},...null!=a.plan&&{hasPlan:!0},...a.pr&&{pr:{url:a.pr.url,number:a.pr.number,status:a.pr.status,ciStatus:a.pr.ciStatus,commitHash:a.pr.commitHash,mergeable:a.pr.mergeable}}}}a.s(["buildFeatureNodeData",()=>e])},61402,76052,13008,74607,6542,740,12104,54433,a=>{"use strict";var b=a.i(92658),c=a.i(96380),d=a.i(12581);async function e(a,b){if(!a.trim())return{approved:!1,error:"Feature id is required"};try{let d=(0,c.resolve)("IFeatureRepository"),e=await d.findById(a);if(!e)return{approved:!1,error:"Feature not found"};if(!e.agentRunId)return{approved:!1,error:"Feature has no agent run"};let f=(0,c.resolve)("ApproveAgentRunUseCase"),g=await f.execute(e.agentRunId,b);if(!g.approved)return{approved:!1,error:g.reason};return{approved:!0}}catch(a){return{approved:!1,error:a instanceof Error?a.message:"Failed to approve feature"}}}async function f(a,b,d){if(!a.trim())return{rejected:!1,error:"Feature id is required"};if(!b.trim())return{rejected:!1,error:"Feedback is required"};try{let e=(0,c.resolve)("IFeatureRepository"),f=await e.findById(a);if(!f)return{rejected:!1,error:"Feature not found"};if(!f.agentRunId)return{rejected:!1,error:"Feature has no agent run"};let g=(0,c.resolve)("RejectAgentRunUseCase"),h=await g.execute(f.agentRunId,b,d);if(!h.rejected)return{rejected:!1,error:h.reason};return{rejected:!0,iteration:h.iteration,iterationWarning:h.iterationWarning}}catch(a){return{rejected:!1,error:a instanceof Error?a.message:"Failed to reject feature"}}}async function g(a){if(!a.trim())return{error:"Feature id is required"};try{let b=(0,c.resolve)("GetFeatureArtifactUseCase"),d=await b.execute(a),e={question:"Goal",context:d.oneLiner,questions:d.openQuestions.map((a,b)=>({id:`q-${b}`,question:a.question,type:"select",options:(a.options??[]).map((a,c)=>({id:`q-${b}-opt-${c}`,label:a.option,rationale:a.description,...a.selected?{recommended:!0}:{}}))})),finalAction:{id:"approve-reqs",label:"Approve Requirements",description:"Finalize and lock the requirements for implementation"}},f={question:"Goal",context:d.oneLiner,questions:d.openQuestions.filter(a=>a.resolved).map(a=>{let b=a.options?.find(a=>a.selected);return{question:a.question,selectedOption:b?.option??a.answer??"N/A",rationale:a.selectionRationale??b?.description??"",wasRecommended:!1}})};return{questionnaire:e,productDecisions:f,artifact:d}}catch(a){return{error:a instanceof Error?a.message:"Failed to load feature artifact"}}}async function h(a){if(!a.trim())return{error:"Feature id is required"};try{var b;let d=(0,c.resolve)("GetResearchArtifactUseCase");return{techDecisions:{name:(b=await d.execute(a)).name,summary:b.summary,decisions:b.decisions,technologies:b.technologies}}}catch(a){return{error:a instanceof Error?a.message:"Failed to load research artifact"}}}(0,d.ensureServerEntryExports)([e]),(0,b.registerServerReference)(e,"6061a1bdf48e7a187d3c2e02b93c9b90738b8e243e",null),a.s(["approveFeature",()=>e],61402),(0,d.ensureServerEntryExports)([f]),(0,b.registerServerReference)(f,"7035fb61dfb18a61df1343dbcdc64e3b199138f5da",null),a.s(["rejectFeature",()=>f],76052),(0,d.ensureServerEntryExports)([g]),(0,b.registerServerReference)(g,"40357238e71028fac79c645f852368bdced0aa13d7",null),a.s(["getFeatureArtifact",()=>g],13008),(0,d.ensureServerEntryExports)([h]),(0,b.registerServerReference)(h,"406fc98a613a6f207e3bdc0ced1e686ffbb03f9bd8",null),a.s(["getResearchArtifact",()=>h],74607);var i=a.i(66680),j=a.i(2157),k=a.i(50227),l=a.i(29918),m=a.i(32278);async function n(a){if(!a.trim())return{error:"Feature id is required"};try{var b,d;let e,f,g=(0,c.resolve)("IFeatureRepository"),h=await g.findById(a);if(!h)return{error:"Feature not found"};let n=h.pr?{url:h.pr.url,number:h.pr.number,status:h.pr.status,commitHash:h.pr.commitHash,ciStatus:h.pr.ciStatus,mergeable:h.pr.mergeable}:void 0,o=h.branch?{source:h.branch,target:"main"}:void 0,p=h.worktreePath??(h.repositoryPath&&h.branch?(0,l.computeWorktreePath)(h.repositoryPath,h.branch):null),q=h.repositoryPath?(b=h.repositoryPath,f=(0,i.createHash)("sha256").update(b).digest("hex").slice(0,16),(0,k.join)((0,m.getShepHomeDir)(),"repos",f,"evidence",a).replace(/\\/g,"/")):p?(0,k.join)((0,k.dirname)((0,k.dirname)(p)),"evidence",a).replace(/\\/g,"/"):null;if(q)try{let a=(0,k.join)(q,"manifest.json");(0,j.existsSync)(a)&&(d=JSON.parse((0,j.readFileSync)(a,"utf-8")),e=d.map(a=>{if(a.relativePath.startsWith("/")){if((0,j.existsSync)(a.relativePath))return a;let b=(0,k.join)(q,(0,k.basename)(a.relativePath)).replace(/\\/g,"/");return(0,j.existsSync)(b)?{...a,relativePath:b}:a}let b=(0,k.join)(q,(0,k.basename)(a.relativePath)).replace(/\\/g,"/");return{...a,relativePath:b}}))}catch{}if(!p)return{pr:n,branch:o,evidence:e,warning:n?void 0:"No PR or diff data available"};try{let a=(0,c.resolve)("IGitPrService"),[b,d]=await Promise.all([a.getPrDiffSummary(p,"main"),a.getFileDiffs(p,"main").catch(()=>void 0)]);return{pr:n,branch:o,diffSummary:b,fileDiffs:d,evidence:e}}catch{return{pr:n,branch:o,evidence:e,warning:"Diff statistics unavailable"}}}catch(a){return{error:a instanceof Error?a.message:"Failed to load merge review data"}}}async function o(a){if(!a.trim())return{error:"Feature id is required"};try{let b=(0,c.resolve)("IPhaseTimingRepository"),d=(await b.findByFeatureId(a)).map(a=>({agentRunId:a.agentRunId,phase:a.phase,startedAt:a.startedAt,completedAt:a.completedAt,durationMs:null!=a.durationMs?Number(a.durationMs):void 0,waitingApprovalAt:a.waitingApprovalAt,approvalWaitMs:null!=a.approvalWaitMs?Number(a.approvalWaitMs):void 0,inputTokens:null!=a.inputTokens?Number(a.inputTokens):void 0,outputTokens:null!=a.outputTokens?Number(a.outputTokens):void 0})),e=await p(a);return{timings:d,rejectionFeedback:e}}catch(a){return{error:a instanceof Error?a.message:"Failed to load phase timings"}}}async function p(b){try{let d=(0,c.resolve)("IFeatureRepository"),e=await d.findById(b);if(!e?.specPath)return[];let{readFileSync:f}=await a.A(6714),{join:g}=await a.A(11105),h=(await a.A(29718)).default,i=f(g(e.specPath,"spec.yaml"),"utf-8"),j=h.load(i);if(!Array.isArray(j?.rejectionFeedback))return[];return j.rejectionFeedback.map(a=>({iteration:Number(a.iteration??1),message:String(a.message??""),phase:a.phase?String(a.phase):void 0,timestamp:a.timestamp?String(a.timestamp):void 0,attachments:Array.isArray(a.attachments)?a.attachments.map(String):void 0}))}catch{return[]}}async function q(a){if(!a.trim())return{error:"Feature id is required"};try{let b=(0,c.resolve)("IFeatureRepository"),d=await b.findById(a);if(!d)return{error:"Feature not found"};if(!d.plan)return{plan:void 0};return{plan:{state:d.plan.state,overview:d.plan.overview,tasks:d.plan.tasks.map(a=>({title:a.title??"",description:a.description??"",state:a.state,actionItems:(a.actionItems??[]).map(a=>({name:a.name,description:a.description,acceptanceCriteria:(a.acceptanceCriteria??[]).map(a=>({description:a.description,verified:a.verified}))}))}))}}}catch(a){return{error:a instanceof Error?a.message:"Failed to load feature plan"}}}(0,d.ensureServerEntryExports)([n]),(0,b.registerServerReference)(n,"402874b2bbc860ff2a557c75e1580f61d03dadbc11",null),a.s(["getMergeReviewData",()=>n],6542),(0,d.ensureServerEntryExports)([o]),(0,b.registerServerReference)(o,"409ae8631dd66ef4036d0d9d922fc2c24cb344d13c",null),a.s(["getFeaturePhaseTimings",()=>o],740),(0,d.ensureServerEntryExports)([q]),(0,b.registerServerReference)(q,"40902286e33d2278cd76407142168234afce2450b5",null),a.s(["getFeaturePlan",()=>q],12104);var r=a.i(31747),s=a.i(33244);async function t(a){try{let b=(0,c.resolve)("IFeatureRepository"),d=(0,c.resolve)("IAgentRunRepository"),e=(0,c.resolve)("IRepositoryRepository"),f=(0,c.resolve)("IGitPrService"),g=(0,c.resolve)("GetFeatureArtifactUseCase"),h=await b.findById(a);if(!h)return null;let i=h.agentRunId?await d.findById(h.agentRunId):null,[j,k,l,m]=await Promise.all([e.findByPath(h.repositoryPath).catch(()=>null),f.getDefaultBranch(h.repositoryPath).catch(()=>"main"),g.execute(a).catch(()=>null),f.getRemoteUrl(h.repositoryPath).catch(()=>null)]),{workflow:n}=(0,s.getSettings)();return(0,r.buildFeatureNodeData)(h,i,{repositoryName:j?.name,baseBranch:k,oneLiner:l?.oneLiner,remoteUrl:m??void 0,enableEvidence:n.enableEvidence,commitEvidence:n.commitEvidence})}catch{return null}}(0,d.ensureServerEntryExports)([t]),(0,b.registerServerReference)(t,"405ef365874e67155b4b7e0077d0cc59b5e4dc7e2f",null),a.s(["getFeatureDrawerData",()=>t],54433)},15473,a=>{"use strict";var b=a.i(12513),c=a.i(94691),d=a.i(33841),e=a.i(46646),f=a.i(68670),g=a.i(85321),h=a.i(84095),i=a.i(56799),j=a.i(80496),k=a.i(41872),l=a.i(9959),m=a.i(23504),n=a.i(27900),o=a.i(50845),p=a.i(26604),q=a.i(54723),r=a.i(49560),s=a.i(39353),t=a.i(29207),u=a.i(61402),v=a.i(76052),w=a.i(13008),x=a.i(74607),y=a.i(6542),z=a.i(740),A=a.i(12104),B=a.i(54433);a.s([],37745),a.i(37745),a.s(["000091d01c4c0addfba03a24acc2a50d2250ea644f",()=>k.isAgentSetupComplete,"0001aa3186d88ffd6a6ecc56b4e0a9291659773c55",()=>m.getAllAgentModels,"00b72044c095acd5ae935a6a82077d3017ffdb1e52",()=>l.checkAgentAuth,"00d33ce7fe440a4d4e55d65f865c1f22282142eb69",()=>b.pickFolder,"4014ab1b94b133351b1455fab9508732c54cfa4404",()=>j.openFolder,"4017aa4e8e7a621babeb50836c6ecea68032a1a223",()=>s.deleteRepository,"40192e8ab56a976d7b4ab02e5ac4e86b81844753c0",()=>c.getDeploymentLogs,"4023507b2023a0497138424d17b98825c8a34fea63",()=>t.getFeatureMetadata,"402874b2bbc860ff2a557c75e1580f61d03dadbc11",()=>y.getMergeReviewData,"40357238e71028fac79c645f852368bdced0aa13d7",()=>w.getFeatureArtifact,"403b7d14d71a50b757c8522b059b3e4a5e38ca630f",()=>p.resumeFeature,"404482b612d7fe0416d9267ac8ae08eff97c415cb8",()=>q.startFeature,"405ef365874e67155b4b7e0077d0cc59b5e4dc7e2f",()=>B.getFeatureDrawerData,"406fc98a613a6f207e3bdc0ced1e686ffbb03f9bd8",()=>x.getResearchArtifact,"407be534406b318f0e53b8cf725a013960c34c4eab",()=>e.deployRepository,"408ac7d206a1f4cb627a91f3253487c4ce8f30344b",()=>i.openShell,"40902286e33d2278cd76407142168234afce2450b5",()=>A.getFeaturePlan,"409ae8631dd66ef4036d0d9d922fc2c24cb344d13c",()=>z.getFeaturePhaseTimings,"40c56f5c3a822bb270b79ce59904bd1a4547ae8dd4",()=>d.deployFeature,"40d09eba9db80f1749ca75d8a81bf4ecfe354213f4",()=>r.addRepository,"40d59de3ebfc390247f9ec9e895121aa1e442bb248",()=>h.openIde,"40e8b017976f8965562a10c76df713c49c812175a5",()=>f.stopDeployment,"40edcd4f8ffa551f80627eea24794aeb5eb5b4bf1d",()=>g.getDeploymentStatus,"603ee219eebb20f5875fe7610d566307abd16e5c79",()=>n.updateAgentAndModel,"6061a1bdf48e7a187d3c2e02b93c9b90738b8e243e",()=>u.approveFeature,"7035fb61dfb18a61df1343dbcdc64e3b199138f5da",()=>v.rejectFeature,"70c01a5598d1f60b9749f583a466fdd9c7149baf07",()=>o.deleteFeature],15473)},6714,a=>{a.v(a=>Promise.resolve().then(()=>a(2157)))},11105,a=>{a.v(a=>Promise.resolve().then(()=>a(50227)))},29718,a=>{a.v(b=>Promise.all(["server/chunks/ssr/90b01_js-yaml_dist_js-yaml_mjs_c897fb57._.js"].map(b=>a.l(b))).then(()=>b(32996)))}];
2
+
3
+ //# sourceMappingURL=%5Broot-of-the-server%5D__994ad9fe._.js.map