@shepai/cli 1.116.2 → 1.116.3-pr372.74a25eb

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 (318) hide show
  1. package/apis/json-schema/WorkflowConfig.yaml +5 -0
  2. package/dist/packages/core/src/application/ports/output/agents/agent-session-repository.interface.d.ts +2 -0
  3. package/dist/packages/core/src/application/ports/output/agents/agent-session-repository.interface.d.ts.map +1 -1
  4. package/dist/packages/core/src/domain/factories/settings-defaults.factory.d.ts.map +1 -1
  5. package/dist/packages/core/src/domain/factories/settings-defaults.factory.js +1 -0
  6. package/dist/packages/core/src/domain/generated/output.d.ts +4 -0
  7. package/dist/packages/core/src/domain/generated/output.d.ts.map +1 -1
  8. package/dist/packages/core/src/infrastructure/persistence/sqlite/legacy-migrations.d.ts.map +1 -1
  9. package/dist/packages/core/src/infrastructure/persistence/sqlite/legacy-migrations.js +11 -0
  10. package/dist/packages/core/src/infrastructure/persistence/sqlite/mappers/settings.mapper.d.ts +1 -0
  11. package/dist/packages/core/src/infrastructure/persistence/sqlite/mappers/settings.mapper.d.ts.map +1 -1
  12. package/dist/packages/core/src/infrastructure/persistence/sqlite/mappers/settings.mapper.js +2 -0
  13. package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations.d.ts +1 -1
  14. package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations.js +1 -1
  15. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/merge/merge.node.d.ts.map +1 -1
  16. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/merge/merge.node.js +4 -2
  17. package/dist/packages/core/src/infrastructure/services/agents/sessions/claude-code-session.repository.d.ts +7 -0
  18. package/dist/packages/core/src/infrastructure/services/agents/sessions/claude-code-session.repository.d.ts.map +1 -1
  19. package/dist/packages/core/src/infrastructure/services/agents/sessions/claude-code-session.repository.js +35 -11
  20. package/dist/packages/core/src/infrastructure/services/git/worktree.service.d.ts.map +1 -1
  21. package/dist/packages/core/src/infrastructure/services/git/worktree.service.js +3 -0
  22. package/dist/src/presentation/web/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.d.ts.map +1 -1
  23. package/dist/src/presentation/web/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js +1 -0
  24. package/dist/src/presentation/web/app/(dashboard)/@drawer/feature/[featureId]/page.d.ts.map +1 -1
  25. package/dist/src/presentation/web/app/(dashboard)/@drawer/feature/[featureId]/page.js +1 -0
  26. package/dist/src/presentation/web/app/(dashboard)/get-graph-data.d.ts.map +1 -1
  27. package/dist/src/presentation/web/app/(dashboard)/get-graph-data.js +1 -0
  28. package/dist/src/presentation/web/app/actions/get-workflow-defaults.d.ts +1 -0
  29. package/dist/src/presentation/web/app/actions/get-workflow-defaults.d.ts.map +1 -1
  30. package/dist/src/presentation/web/app/actions/get-workflow-defaults.js +1 -0
  31. package/dist/src/presentation/web/app/actions/open-shell.d.ts.map +1 -1
  32. package/dist/src/presentation/web/app/actions/open-shell.js +4 -1
  33. package/dist/src/presentation/web/app/api/sessions/route.d.ts +25 -0
  34. package/dist/src/presentation/web/app/api/sessions/route.d.ts.map +1 -0
  35. package/dist/src/presentation/web/app/api/sessions/route.js +43 -0
  36. package/dist/src/presentation/web/app/build-feature-node-data.d.ts +2 -0
  37. package/dist/src/presentation/web/app/build-feature-node-data.d.ts.map +1 -1
  38. package/dist/src/presentation/web/app/build-feature-node-data.js +1 -0
  39. package/dist/src/presentation/web/app/build-graph-nodes.d.ts +2 -0
  40. package/dist/src/presentation/web/app/build-graph-nodes.d.ts.map +1 -1
  41. package/dist/src/presentation/web/app/build-graph-nodes.js +11 -0
  42. package/dist/src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.d.ts +1 -0
  43. package/dist/src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.d.ts.map +1 -1
  44. package/dist/src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.js +8 -1
  45. package/dist/src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.stories.d.ts.map +1 -1
  46. package/dist/src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.stories.js +1 -0
  47. package/dist/src/presentation/web/components/common/feature-drawer-tabs/overview-tab.js +2 -1
  48. package/dist/src/presentation/web/components/common/feature-node/feature-node-state-config.d.ts +4 -0
  49. package/dist/src/presentation/web/components/common/feature-node/feature-node-state-config.d.ts.map +1 -1
  50. package/dist/src/presentation/web/components/common/feature-node/feature-node.d.ts.map +1 -1
  51. package/dist/src/presentation/web/components/common/feature-node/feature-node.js +2 -1
  52. package/dist/src/presentation/web/components/common/feature-node/feature-sessions-dropdown.d.ts +16 -0
  53. package/dist/src/presentation/web/components/common/feature-node/feature-sessions-dropdown.d.ts.map +1 -0
  54. package/dist/src/presentation/web/components/common/feature-node/feature-sessions-dropdown.js +134 -0
  55. package/dist/src/presentation/web/components/common/feature-node/feature-sessions-dropdown.stories.d.ts +9 -0
  56. package/dist/src/presentation/web/components/common/feature-node/feature-sessions-dropdown.stories.d.ts.map +1 -0
  57. package/dist/src/presentation/web/components/common/feature-node/feature-sessions-dropdown.stories.js +77 -0
  58. package/dist/src/presentation/web/components/common/repository-node/repository-node.d.ts.map +1 -1
  59. package/dist/src/presentation/web/components/common/repository-node/repository-node.js +2 -1
  60. package/dist/src/presentation/web/components/features/settings/settings-page-client.d.ts.map +1 -1
  61. package/dist/src/presentation/web/components/features/settings/settings-page-client.js +5 -0
  62. package/dist/src/presentation/web/components/features/settings/workflow-settings-section.d.ts.map +1 -1
  63. package/dist/src/presentation/web/components/features/settings/workflow-settings-section.js +3 -1
  64. package/dist/src/presentation/web/components/features/settings/workflow-settings-section.stories.d.ts.map +1 -1
  65. package/dist/src/presentation/web/components/features/settings/workflow-settings-section.stories.js +3 -0
  66. package/dist/tsconfig.build.tsbuildinfo +1 -1
  67. package/package.json +1 -1
  68. package/web/.next/BUILD_ID +1 -1
  69. package/web/.next/app-path-routes-manifest.json +1 -0
  70. package/web/.next/build-manifest.json +2 -2
  71. package/web/.next/fallback-build-manifest.json +2 -2
  72. package/web/.next/prerender-manifest.json +3 -3
  73. package/web/.next/required-server-files.js +3 -3
  74. package/web/.next/required-server-files.json +3 -3
  75. package/web/.next/routes-manifest.json +6 -0
  76. package/web/.next/server/app/(dashboard)/@drawer/create/page/server-reference-manifest.json +20 -20
  77. package/web/.next/server/app/(dashboard)/@drawer/create/page.js +2 -2
  78. package/web/.next/server/app/(dashboard)/@drawer/create/page.js.nft.json +1 -1
  79. package/web/.next/server/app/(dashboard)/@drawer/create/page_client-reference-manifest.js +1 -1
  80. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/server-reference-manifest.json +26 -26
  81. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js +3 -3
  82. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  83. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  84. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/server-reference-manifest.json +26 -26
  85. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js +3 -3
  86. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js.nft.json +1 -1
  87. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page_client-reference-manifest.js +1 -1
  88. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/server-reference-manifest.json +18 -18
  89. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js +2 -2
  90. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js.nft.json +1 -1
  91. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  92. package/web/.next/server/app/(dashboard)/create/page/server-reference-manifest.json +20 -20
  93. package/web/.next/server/app/(dashboard)/create/page.js +2 -2
  94. package/web/.next/server/app/(dashboard)/create/page.js.nft.json +1 -1
  95. package/web/.next/server/app/(dashboard)/create/page_client-reference-manifest.js +1 -1
  96. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/server-reference-manifest.json +26 -26
  97. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js +3 -3
  98. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  99. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  100. package/web/.next/server/app/(dashboard)/feature/[featureId]/page/server-reference-manifest.json +26 -26
  101. package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js +3 -3
  102. package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js.nft.json +1 -1
  103. package/web/.next/server/app/(dashboard)/feature/[featureId]/page_client-reference-manifest.js +1 -1
  104. package/web/.next/server/app/(dashboard)/page/server-reference-manifest.json +18 -18
  105. package/web/.next/server/app/(dashboard)/page.js +2 -2
  106. package/web/.next/server/app/(dashboard)/page.js.nft.json +1 -1
  107. package/web/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
  108. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/server-reference-manifest.json +18 -18
  109. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js +2 -2
  110. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js.nft.json +1 -1
  111. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  112. package/web/.next/server/app/_global-error.html +2 -2
  113. package/web/.next/server/app/_global-error.rsc +1 -1
  114. package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  115. package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  116. package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  117. package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  118. package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  119. package/web/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
  120. package/web/.next/server/app/_not-found/page.js.nft.json +1 -1
  121. package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  122. package/web/.next/server/app/api/attachments/preview/route.js +1 -1
  123. package/web/.next/server/app/api/attachments/preview/route.js.nft.json +1 -1
  124. package/web/.next/server/app/api/evidence/route.js +1 -1
  125. package/web/.next/server/app/api/evidence/route.js.nft.json +1 -1
  126. package/web/.next/server/app/api/graph-data/route.js +1 -1
  127. package/web/.next/server/app/api/graph-data/route.js.nft.json +1 -1
  128. package/web/.next/server/app/api/sessions/route/app-paths-manifest.json +3 -0
  129. package/web/.next/server/app/api/sessions/route/build-manifest.json +11 -0
  130. package/web/.next/server/app/api/sessions/route/server-reference-manifest.json +4 -0
  131. package/web/.next/server/app/api/sessions/route.js +7 -0
  132. package/web/.next/server/app/api/sessions/route.js.map +5 -0
  133. package/web/.next/server/app/api/sessions/route.js.nft.json +1 -0
  134. package/web/.next/server/app/api/sessions/route_client-reference-manifest.js +2 -0
  135. package/web/.next/server/app/settings/page/server-reference-manifest.json +5 -5
  136. package/web/.next/server/app/settings/page.js +1 -1
  137. package/web/.next/server/app/settings/page.js.nft.json +1 -1
  138. package/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  139. package/web/.next/server/app/skills/page/server-reference-manifest.json +6 -6
  140. package/web/.next/server/app/skills/page.js +1 -1
  141. package/web/.next/server/app/skills/page.js.nft.json +1 -1
  142. package/web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  143. package/web/.next/server/app/tools/page/server-reference-manifest.json +6 -6
  144. package/web/.next/server/app/tools/page.js +1 -1
  145. package/web/.next/server/app/tools/page.js.nft.json +1 -1
  146. package/web/.next/server/app/tools/page_client-reference-manifest.js +1 -1
  147. package/web/.next/server/app/version/page/server-reference-manifest.json +1 -1
  148. package/web/.next/server/app/version/page.js +1 -1
  149. package/web/.next/server/app/version/page.js.nft.json +1 -1
  150. package/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
  151. package/web/.next/server/app-paths-manifest.json +1 -0
  152. package/web/.next/server/chunks/403f9_next_dist_esm_build_templates_app-route_370c43b1.js +1 -1
  153. package/web/.next/server/chunks/403f9_next_dist_esm_build_templates_app-route_370c43b1.js.map +1 -1
  154. package/web/.next/server/chunks/[externals]__42053d5c._.js +3 -0
  155. package/web/.next/server/chunks/[externals]__42053d5c._.js.map +1 -0
  156. package/web/.next/server/chunks/[root-of-the-server]__42b7ab55._.js +3 -0
  157. package/web/.next/server/chunks/[root-of-the-server]__42b7ab55._.js.map +1 -0
  158. package/web/.next/server/chunks/{[root-of-the-server]__7d63f9a4._.js → [root-of-the-server]__53013576._.js} +2 -2
  159. package/web/.next/server/chunks/[root-of-the-server]__6ec95237._.js +3 -0
  160. package/web/.next/server/chunks/[root-of-the-server]__6ec95237._.js.map +1 -0
  161. package/web/.next/server/chunks/[root-of-the-server]__7939ee8d._.js +3 -0
  162. package/web/.next/server/chunks/[root-of-the-server]__7939ee8d._.js.map +1 -0
  163. package/web/.next/server/chunks/{[root-of-the-server]__a1c7c02a._.js → [root-of-the-server]__92078db6._.js} +2 -2
  164. package/web/.next/server/chunks/[root-of-the-server]__a402b567._.js +1 -1
  165. package/web/.next/server/chunks/[root-of-the-server]__cd67a84c._.js.map +1 -1
  166. package/web/.next/server/chunks/b1a17_presentation_web__next-internal_server_app_api_sessions_route_actions_c041a889.js +3 -0
  167. package/web/.next/server/chunks/b1a17_presentation_web__next-internal_server_app_api_sessions_route_actions_c041a889.js.map +1 -0
  168. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js +1 -1
  169. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js.map +1 -1
  170. package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_@drawer_repository_[repositoryId]_page_actions_a1104008.js +1 -1
  171. package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_@drawer_repository_[repositoryId]_page_actions_a1104008.js.map +1 -1
  172. package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_repository_[repositoryId]_page_actions_92642200.js +1 -1
  173. package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_repository_[repositoryId]_page_actions_92642200.js.map +1 -1
  174. package/web/.next/server/chunks/ssr/[root-of-the-server]__0023a364._.js +4 -0
  175. package/web/.next/server/chunks/ssr/[root-of-the-server]__0023a364._.js.map +1 -0
  176. package/web/.next/server/chunks/ssr/{[root-of-the-server]__07a39ff2._.js → [root-of-the-server]__06fef644._.js} +2 -2
  177. package/web/.next/server/chunks/ssr/{[root-of-the-server]__07a39ff2._.js.map → [root-of-the-server]__06fef644._.js.map} +1 -1
  178. package/web/.next/server/chunks/ssr/[root-of-the-server]__11033878._.js +1 -1
  179. package/web/.next/server/chunks/ssr/[root-of-the-server]__11033878._.js.map +1 -1
  180. package/web/.next/server/chunks/ssr/[root-of-the-server]__4170d245._.js +3 -0
  181. package/web/.next/server/chunks/ssr/[root-of-the-server]__4170d245._.js.map +1 -0
  182. package/web/.next/server/chunks/ssr/[root-of-the-server]__422945ee._.js +3 -0
  183. package/web/.next/server/chunks/ssr/[root-of-the-server]__422945ee._.js.map +1 -0
  184. package/web/.next/server/chunks/ssr/[root-of-the-server]__545792ab._.js +3 -0
  185. package/web/.next/server/chunks/ssr/[root-of-the-server]__545792ab._.js.map +1 -0
  186. package/web/.next/server/chunks/ssr/[root-of-the-server]__684a868c._.js +1 -1
  187. package/web/.next/server/chunks/ssr/[root-of-the-server]__684a868c._.js.map +1 -1
  188. package/web/.next/server/chunks/ssr/[root-of-the-server]__aad040c0._.js +2 -2
  189. package/web/.next/server/chunks/ssr/[root-of-the-server]__aad040c0._.js.map +1 -1
  190. package/web/.next/server/chunks/ssr/[root-of-the-server]__b724df9e._.js +3 -0
  191. package/web/.next/server/chunks/ssr/[root-of-the-server]__b724df9e._.js.map +1 -0
  192. package/web/.next/server/chunks/ssr/[root-of-the-server]__bf1d1145._.js +3 -0
  193. package/web/.next/server/chunks/ssr/[root-of-the-server]__bf1d1145._.js.map +1 -0
  194. package/web/.next/server/chunks/ssr/[root-of-the-server]__c16bf5de._.js +1 -1
  195. package/web/.next/server/chunks/ssr/[root-of-the-server]__c16bf5de._.js.map +1 -1
  196. package/web/.next/server/chunks/ssr/[root-of-the-server]__c4dc1b5a._.js +4 -0
  197. package/web/.next/server/chunks/ssr/[root-of-the-server]__c4dc1b5a._.js.map +1 -0
  198. package/web/.next/server/chunks/ssr/[root-of-the-server]__caa857f3._.js +3 -0
  199. package/web/.next/server/chunks/ssr/[root-of-the-server]__caa857f3._.js.map +1 -0
  200. package/web/.next/server/chunks/ssr/[root-of-the-server]__e98eda15._.js +4 -0
  201. package/web/.next/server/chunks/ssr/[root-of-the-server]__e98eda15._.js.map +1 -0
  202. package/web/.next/server/chunks/ssr/[root-of-the-server]__eaed6264._.js +3 -0
  203. package/web/.next/server/chunks/ssr/[root-of-the-server]__eaed6264._.js.map +1 -0
  204. package/web/.next/server/chunks/ssr/[root-of-the-server]__fdc75809._.js +1 -1
  205. package/web/.next/server/chunks/ssr/[root-of-the-server]__fdc75809._.js.map +1 -1
  206. package/web/.next/server/chunks/ssr/_0dc2cfd3._.js +3 -0
  207. package/web/.next/server/chunks/ssr/_0dc2cfd3._.js.map +1 -0
  208. package/web/.next/server/chunks/ssr/_135edb9c._.js +1 -1
  209. package/web/.next/server/chunks/ssr/_135edb9c._.js.map +1 -1
  210. package/web/.next/server/chunks/ssr/_1bb131c4._.js.map +1 -1
  211. package/web/.next/server/chunks/ssr/_1bb79fe8._.js +3 -0
  212. package/web/.next/server/chunks/ssr/_1bb79fe8._.js.map +1 -0
  213. package/web/.next/server/chunks/ssr/_39153813._.js +3 -0
  214. package/web/.next/server/chunks/ssr/_39153813._.js.map +1 -0
  215. package/web/.next/server/chunks/ssr/_75f4ccb3._.js +3 -0
  216. package/web/.next/server/chunks/ssr/_75f4ccb3._.js.map +1 -0
  217. package/web/.next/server/chunks/ssr/_8dacd1e7._.js +1 -1
  218. package/web/.next/server/chunks/ssr/_8dacd1e7._.js.map +1 -1
  219. package/web/.next/server/chunks/ssr/_cc77a143._.js +1 -1
  220. package/web/.next/server/chunks/ssr/_cc77a143._.js.map +1 -1
  221. package/web/.next/server/chunks/ssr/_e4aecdda._.js +3 -0
  222. package/web/.next/server/chunks/ssr/_e4aecdda._.js.map +1 -0
  223. package/web/.next/server/chunks/ssr/_f605354c._.js +9 -0
  224. package/web/.next/server/chunks/ssr/_f605354c._.js.map +1 -0
  225. package/web/.next/server/chunks/ssr/{_eb4f6eeb._.js → _f700398b._.js} +2 -2
  226. package/web/.next/server/chunks/ssr/_f700398b._.js.map +1 -0
  227. package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js +1 -1
  228. package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js.map +1 -1
  229. package/web/.next/server/chunks/ssr/node_modules__pnpm_b59e4b16._.js +3 -0
  230. package/web/.next/server/chunks/ssr/node_modules__pnpm_b59e4b16._.js.map +1 -0
  231. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_888633e1.js +1 -1
  232. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_888633e1.js.map +1 -1
  233. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1fa8042e.js +1 -1
  234. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1fa8042e.js.map +1 -1
  235. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_24684200.js +1 -1
  236. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_24684200.js.map +1 -1
  237. package/web/.next/server/chunks/ssr/src_presentation_web_ca99d62d._.js +1 -1
  238. package/web/.next/server/chunks/ssr/src_presentation_web_ca99d62d._.js.map +1 -1
  239. package/web/.next/server/chunks/ssr/src_presentation_web_ce7cbc3c._.js +2 -2
  240. package/web/.next/server/chunks/ssr/src_presentation_web_ce7cbc3c._.js.map +1 -1
  241. package/web/.next/server/chunks/ssr/src_presentation_web_components_bdcfba35._.js +3 -0
  242. package/web/.next/server/chunks/ssr/src_presentation_web_components_bdcfba35._.js.map +1 -0
  243. package/web/.next/server/chunks/ssr/src_presentation_web_components_bf50c527._.js +1 -1
  244. package/web/.next/server/chunks/ssr/src_presentation_web_components_de814675._.js +1 -1
  245. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js +1 -1
  246. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js.map +1 -1
  247. package/web/.next/server/chunks/ssr/src_presentation_web_e2604413._.js +2 -2
  248. package/web/.next/server/chunks/ssr/src_presentation_web_e2604413._.js.map +1 -1
  249. package/web/.next/server/pages/500.html +2 -2
  250. package/web/.next/server/server-reference-manifest.js +1 -1
  251. package/web/.next/server/server-reference-manifest.json +31 -31
  252. package/web/.next/static/chunks/{cfbe0967135b6e39.js → 2c85955a119cb958.js} +1 -1
  253. package/web/.next/static/chunks/4562ee849ea13c3a.js +1 -0
  254. package/web/.next/static/chunks/734e1b96d65bc4e1.js +1 -0
  255. package/web/.next/static/chunks/845d8e58a91014e6.js +1 -0
  256. package/web/.next/static/chunks/85525df1b4d1aabf.js +11 -0
  257. package/web/.next/static/chunks/{9a9d4086f34130ad.js → 87ebdd9c09d98098.js} +1 -1
  258. package/web/.next/static/chunks/8bd4850f5ba10859.css +1 -0
  259. package/web/.next/static/chunks/9a8aeb9054d6763e.js +1 -0
  260. package/web/.next/static/chunks/a02878d540d8caac.js +2 -0
  261. package/web/.next/static/chunks/{34da03176ffd34e8.js → b6a6d6f997c7dc23.js} +1 -1
  262. package/web/.next/static/chunks/{f25f6e5a1c90a3a7.js → bbbb1dfab7e4f4d2.js} +1 -1
  263. package/web/.next/static/chunks/{effc681785114fed.js → c59d875a3ea688b4.js} +2 -2
  264. package/web/.next/static/chunks/cca0f5112a9260d8.js +1 -0
  265. package/web/.next/static/chunks/d3e71bbe7e8203e9.js +1 -0
  266. package/web/.next/server/chunks/[root-of-the-server]__7d5492a0._.js +0 -3
  267. package/web/.next/server/chunks/[root-of-the-server]__7d5492a0._.js.map +0 -1
  268. package/web/.next/server/chunks/ssr/7f428_lucide-react_dist_esm_icons_rocket_1575cd4d.js +0 -3
  269. package/web/.next/server/chunks/ssr/7f428_lucide-react_dist_esm_icons_rocket_1575cd4d.js.map +0 -1
  270. package/web/.next/server/chunks/ssr/[root-of-the-server]__039967e3._.js +0 -3
  271. package/web/.next/server/chunks/ssr/[root-of-the-server]__039967e3._.js.map +0 -1
  272. package/web/.next/server/chunks/ssr/[root-of-the-server]__24dd0927._.js +0 -4
  273. package/web/.next/server/chunks/ssr/[root-of-the-server]__24dd0927._.js.map +0 -1
  274. package/web/.next/server/chunks/ssr/[root-of-the-server]__2773312c._.js +0 -3
  275. package/web/.next/server/chunks/ssr/[root-of-the-server]__2773312c._.js.map +0 -1
  276. package/web/.next/server/chunks/ssr/[root-of-the-server]__5d87af2e._.js +0 -4
  277. package/web/.next/server/chunks/ssr/[root-of-the-server]__5d87af2e._.js.map +0 -1
  278. package/web/.next/server/chunks/ssr/[root-of-the-server]__6367aea0._.js +0 -3
  279. package/web/.next/server/chunks/ssr/[root-of-the-server]__6367aea0._.js.map +0 -1
  280. package/web/.next/server/chunks/ssr/[root-of-the-server]__89e8a5cc._.js +0 -4
  281. package/web/.next/server/chunks/ssr/[root-of-the-server]__89e8a5cc._.js.map +0 -1
  282. package/web/.next/server/chunks/ssr/[root-of-the-server]__b1e68e34._.js +0 -3
  283. package/web/.next/server/chunks/ssr/[root-of-the-server]__b1e68e34._.js.map +0 -1
  284. package/web/.next/server/chunks/ssr/[root-of-the-server]__cbd8062c._.js +0 -3
  285. package/web/.next/server/chunks/ssr/[root-of-the-server]__cbd8062c._.js.map +0 -1
  286. package/web/.next/server/chunks/ssr/[root-of-the-server]__e70c5627._.js +0 -3
  287. package/web/.next/server/chunks/ssr/[root-of-the-server]__e70c5627._.js.map +0 -1
  288. package/web/.next/server/chunks/ssr/_250a63ae._.js +0 -3
  289. package/web/.next/server/chunks/ssr/_250a63ae._.js.map +0 -1
  290. package/web/.next/server/chunks/ssr/_273d4632._.js +0 -3
  291. package/web/.next/server/chunks/ssr/_273d4632._.js.map +0 -1
  292. package/web/.next/server/chunks/ssr/_40d4ef7c._.js +0 -3
  293. package/web/.next/server/chunks/ssr/_40d4ef7c._.js.map +0 -1
  294. package/web/.next/server/chunks/ssr/_922aa39f._.js +0 -3
  295. package/web/.next/server/chunks/ssr/_922aa39f._.js.map +0 -1
  296. package/web/.next/server/chunks/ssr/_a68d7e1c._.js +0 -9
  297. package/web/.next/server/chunks/ssr/_a68d7e1c._.js.map +0 -1
  298. package/web/.next/server/chunks/ssr/_eb4f6eeb._.js.map +0 -1
  299. package/web/.next/server/chunks/ssr/_f5316e67._.js +0 -3
  300. package/web/.next/server/chunks/ssr/_f5316e67._.js.map +0 -1
  301. package/web/.next/server/chunks/ssr/_f8881a5d._.js +0 -3
  302. package/web/.next/server/chunks/ssr/_f8881a5d._.js.map +0 -1
  303. package/web/.next/server/chunks/ssr/src_presentation_web_components_a5e6c910._.js +0 -3
  304. package/web/.next/server/chunks/ssr/src_presentation_web_components_a5e6c910._.js.map +0 -1
  305. package/web/.next/static/chunks/216f83d2a95bfd86.js +0 -1
  306. package/web/.next/static/chunks/3a806cf059241bc9.js +0 -1
  307. package/web/.next/static/chunks/47a6ac4c6de9d0d4.js +0 -1
  308. package/web/.next/static/chunks/55c131b6fc504375.js +0 -1
  309. package/web/.next/static/chunks/57b45edf86522369.css +0 -1
  310. package/web/.next/static/chunks/a51392a0ac93bf57.js +0 -11
  311. package/web/.next/static/chunks/b1f3c0e8e9872ef8.js +0 -1
  312. package/web/.next/static/chunks/c3344fffa0d1c994.js +0 -2
  313. package/web/.next/static/chunks/e457e3c66071f496.js +0 -1
  314. /package/web/.next/server/chunks/{[root-of-the-server]__7d63f9a4._.js.map → [root-of-the-server]__53013576._.js.map} +0 -0
  315. /package/web/.next/server/chunks/{[root-of-the-server]__a1c7c02a._.js.map → [root-of-the-server]__92078db6._.js.map} +0 -0
  316. /package/web/.next/static/{eGrf0hg4yAwxZsyY_JTHJ → Cl6Z3hNe9fIyRYkAXnEVa}/_buildManifest.js +0 -0
  317. /package/web/.next/static/{eGrf0hg4yAwxZsyY_JTHJ → Cl6Z3hNe9fIyRYkAXnEVa}/_clientMiddlewareManifest.json +0 -0
  318. /package/web/.next/static/{eGrf0hg4yAwxZsyY_JTHJ → Cl6Z3hNe9fIyRYkAXnEVa}/_ssgManifest.js +0 -0
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "node": {
3
- "00f607bf9d76c9e09626bc2a6ba023015595a164e0": {
3
+ "008fcb481b6f05b347607b24f696d5fdf3584e9ac9": {
4
4
  "workers": {
5
5
  "app/(dashboard)/@drawer/create/page": {
6
6
  "moduleId": 94566,
@@ -106,7 +106,7 @@
106
106
  "filename": "src/presentation/web/app/actions/pick-folder.ts",
107
107
  "exportedName": "pickFolder"
108
108
  },
109
- "4056e26e9469cfcedb0d0285ab3efd1e4f74815e0f": {
109
+ "40289e004f012acf7fdfbd13da320f6729d1dd492f": {
110
110
  "workers": {
111
111
  "app/(dashboard)/@drawer/create/page": {
112
112
  "moduleId": 94566,
@@ -191,7 +191,7 @@
191
191
  "filename": "src/presentation/web/app/actions/get-deployment-logs.ts",
192
192
  "exportedName": "getDeploymentLogs"
193
193
  },
194
- "40cdaeb1305fbe89a4a54c2323c30bd800e870d493": {
194
+ "40615f9a539714efecc9ed1b4c310809f5c997c6b0": {
195
195
  "workers": {
196
196
  "app/(dashboard)/@drawer/create/page": {
197
197
  "moduleId": 94566,
@@ -276,7 +276,7 @@
276
276
  "filename": "src/presentation/web/app/actions/deploy-feature.ts",
277
277
  "exportedName": "deployFeature"
278
278
  },
279
- "40a40d6c17843f9506b65a643e272c8eb0c993941e": {
279
+ "40abd6a86816cda1a29db67f17d8a97bb0cec41ca5": {
280
280
  "workers": {
281
281
  "app/(dashboard)/@drawer/create/page": {
282
282
  "moduleId": 94566,
@@ -361,7 +361,7 @@
361
361
  "filename": "src/presentation/web/app/actions/deploy-repository.ts",
362
362
  "exportedName": "deployRepository"
363
363
  },
364
- "40cd8e7f3e74f12a9e1520a47f52508780cd6a8344": {
364
+ "40e93ba1e09cd48b0af271e4200208a7994a2fda9a": {
365
365
  "workers": {
366
366
  "app/(dashboard)/@drawer/create/page": {
367
367
  "moduleId": 94566,
@@ -446,7 +446,7 @@
446
446
  "filename": "src/presentation/web/app/actions/stop-deployment.ts",
447
447
  "exportedName": "stopDeployment"
448
448
  },
449
- "40cc0df95e047995b74b38bba586888bb27eaa9682": {
449
+ "40a449022d83f66615eff78fc15a9b10ed748305b3": {
450
450
  "workers": {
451
451
  "app/(dashboard)/@drawer/create/page": {
452
452
  "moduleId": 94566,
@@ -531,7 +531,7 @@
531
531
  "filename": "src/presentation/web/app/actions/get-deployment-status.ts",
532
532
  "exportedName": "getDeploymentStatus"
533
533
  },
534
- "40bb7f07805c5933331e7e3c4a3cd4603be041d8a5": {
534
+ "4058e86d356e0683def130608c88816d915906b667": {
535
535
  "workers": {
536
536
  "app/(dashboard)/@drawer/create/page": {
537
537
  "moduleId": 94566,
@@ -602,7 +602,7 @@
602
602
  "filename": "src/presentation/web/app/actions/open-ide.ts",
603
603
  "exportedName": "openIde"
604
604
  },
605
- "4059b4bf0dbd526be1e2a5b4bcca2702b24e01dba2": {
605
+ "40d9f66d438ca0904beb07757175bfef3c67b68f9a": {
606
606
  "workers": {
607
607
  "app/(dashboard)/@drawer/create/page": {
608
608
  "moduleId": 94566,
@@ -673,7 +673,7 @@
673
673
  "filename": "src/presentation/web/app/actions/open-shell.ts",
674
674
  "exportedName": "openShell"
675
675
  },
676
- "40af6cdd328b9ebd41d4851218abda4f7ccb484da1": {
676
+ "40e0ecddf6c9f6a2e33a5d06b0c15671fcedd4297b": {
677
677
  "workers": {
678
678
  "app/(dashboard)/@drawer/create/page": {
679
679
  "moduleId": 94566,
@@ -744,7 +744,7 @@
744
744
  "filename": "src/presentation/web/app/actions/open-folder.ts",
745
745
  "exportedName": "openFolder"
746
746
  },
747
- "006b08a6d395581c45a43565b7af7fe76a9534cf33": {
747
+ "007c4dec091bb1c012612655bff7735508cf51a8d4": {
748
748
  "workers": {
749
749
  "app/(dashboard)/@drawer/create/page": {
750
750
  "moduleId": 94566,
@@ -815,7 +815,7 @@
815
815
  "filename": "src/presentation/web/app/actions/agent-setup-flag.ts",
816
816
  "exportedName": "isAgentSetupComplete"
817
817
  },
818
- "00c5ebef1a39cd5d45e5542eee942c11d222256533": {
818
+ "0000f2e1f63524efc9c63533be96c26e2e1e0f225a": {
819
819
  "workers": {
820
820
  "app/(dashboard)/@drawer/create/page": {
821
821
  "moduleId": 94566,
@@ -886,7 +886,7 @@
886
886
  "filename": "src/presentation/web/app/actions/check-agent-auth.ts",
887
887
  "exportedName": "checkAgentAuth"
888
888
  },
889
- "0032424347520be2b6dd8323a4b1c5a659c74e1f26": {
889
+ "00799d05c5dac61e2118b299137ec9e5a08cf7a0d2": {
890
890
  "workers": {
891
891
  "app/(dashboard)/@drawer/create/page": {
892
892
  "moduleId": 94566,
@@ -964,7 +964,7 @@
964
964
  "filename": "src/presentation/web/app/actions/get-all-agent-models.ts",
965
965
  "exportedName": "getAllAgentModels"
966
966
  },
967
- "60c18409095d55e6fcea770467efae4ba9630a681a": {
967
+ "605ce1352b148d498397c6e3ee3de376207c480224": {
968
968
  "workers": {
969
969
  "app/(dashboard)/@drawer/create/page": {
970
970
  "moduleId": 94566,
@@ -1042,7 +1042,7 @@
1042
1042
  "filename": "src/presentation/web/app/actions/update-agent-and-model.ts",
1043
1043
  "exportedName": "updateAgentAndModel"
1044
1044
  },
1045
- "7090f553a52566a8d513ede787498b5f2c5bd9d8e5": {
1045
+ "70f3267282961bb17794348138b05e38c8a50f0b01": {
1046
1046
  "workers": {
1047
1047
  "app/(dashboard)/@drawer/create/page": {
1048
1048
  "moduleId": 94566,
@@ -1113,7 +1113,7 @@
1113
1113
  "filename": "src/presentation/web/app/actions/delete-feature.ts",
1114
1114
  "exportedName": "deleteFeature"
1115
1115
  },
1116
- "405f40fae4f889f6e8d915069e88e43a19dd526930": {
1116
+ "40f8a5aad110e2bd78a78bc3d1ef6583f85c93d7e3": {
1117
1117
  "workers": {
1118
1118
  "app/(dashboard)/@drawer/create/page": {
1119
1119
  "moduleId": 94566,
@@ -1184,7 +1184,7 @@
1184
1184
  "filename": "src/presentation/web/app/actions/resume-feature.ts",
1185
1185
  "exportedName": "resumeFeature"
1186
1186
  },
1187
- "40711c5304f424418ccafeb6113459b2124917466b": {
1187
+ "40441d2a777519296630334ef2cd3ed071ebe1c582": {
1188
1188
  "workers": {
1189
1189
  "app/(dashboard)/@drawer/create/page": {
1190
1190
  "moduleId": 94566,
@@ -1255,7 +1255,7 @@
1255
1255
  "filename": "src/presentation/web/app/actions/add-repository.ts",
1256
1256
  "exportedName": "addRepository"
1257
1257
  },
1258
- "4088082c865308ad65a82d4331dac9cf20437b2f17": {
1258
+ "40bbd36c917c8e2d0ffe2cfdea1875e0897aef1e6b": {
1259
1259
  "workers": {
1260
1260
  "app/(dashboard)/@drawer/create/page": {
1261
1261
  "moduleId": 94566,
@@ -1326,7 +1326,7 @@
1326
1326
  "filename": "src/presentation/web/app/actions/delete-repository.ts",
1327
1327
  "exportedName": "deleteRepository"
1328
1328
  },
1329
- "406c3dbd6c08d384ced0504e22c9b9adccb04d0538": {
1329
+ "406d56218bb2e6a1bafc3cfc11eb06f58900f9fec9": {
1330
1330
  "workers": {
1331
1331
  "app/(dashboard)/@drawer/create/page": {
1332
1332
  "moduleId": 94566,
@@ -1397,7 +1397,7 @@
1397
1397
  "filename": "src/presentation/web/app/actions/get-feature-metadata.ts",
1398
1398
  "exportedName": "getFeatureMetadata"
1399
1399
  },
1400
- "009bb8df4633585bf3bad197a38baac7ddbdfc1ccf": {
1400
+ "0057de5d5fed2f466f55d651a36c77e3e9dc30a2ed": {
1401
1401
  "workers": {
1402
1402
  "app/(dashboard)/@drawer/create/page": {
1403
1403
  "moduleId": 94566,
@@ -1419,7 +1419,7 @@
1419
1419
  "filename": "src/presentation/web/app/actions/get-workflow-defaults.ts",
1420
1420
  "exportedName": "getWorkflowDefaults"
1421
1421
  },
1422
- "40a120103c5b73f9aa349aa5b327113440a3b5b217": {
1422
+ "4055ab72684d6ed419e7392b4115069abe70ef493d": {
1423
1423
  "workers": {
1424
1424
  "app/(dashboard)/@drawer/create/page": {
1425
1425
  "moduleId": 94566,
@@ -1441,7 +1441,7 @@
1441
1441
  "filename": "src/presentation/web/app/actions/create-feature.ts",
1442
1442
  "exportedName": "createFeature"
1443
1443
  },
1444
- "6044328d5e5fccfd344e6054d3e59b2423b111ba8d": {
1444
+ "603d815fa2b84e12443754725570368363ca534209": {
1445
1445
  "workers": {
1446
1446
  "app/(dashboard)/@drawer/feature/[featureId]/[tab]/page": {
1447
1447
  "moduleId": 10288,
@@ -1477,7 +1477,7 @@
1477
1477
  "filename": "src/presentation/web/app/actions/approve-feature.ts",
1478
1478
  "exportedName": "approveFeature"
1479
1479
  },
1480
- "7065c3bc8e3c1f3edd5158f3c9d7edf4b4c1fae6eb": {
1480
+ "70c8b13d57ff1a8c53f21140c46f283b5e8527f4cc": {
1481
1481
  "workers": {
1482
1482
  "app/(dashboard)/@drawer/feature/[featureId]/[tab]/page": {
1483
1483
  "moduleId": 10288,
@@ -1513,7 +1513,7 @@
1513
1513
  "filename": "src/presentation/web/app/actions/reject-feature.ts",
1514
1514
  "exportedName": "rejectFeature"
1515
1515
  },
1516
- "40d592d46b24c492f14fc8c40395cf674e785b35d0": {
1516
+ "404580617caa25aa541f4c30d98ca18f8a7e66ae4a": {
1517
1517
  "workers": {
1518
1518
  "app/(dashboard)/@drawer/feature/[featureId]/[tab]/page": {
1519
1519
  "moduleId": 10288,
@@ -1549,7 +1549,7 @@
1549
1549
  "filename": "src/presentation/web/app/actions/get-feature-artifact.ts",
1550
1550
  "exportedName": "getFeatureArtifact"
1551
1551
  },
1552
- "40f31b9a14a2cb7ae38f6a1e84bd164420a66fb0e5": {
1552
+ "40b79f29b18b2f52c43c0487247755f50e072e0edb": {
1553
1553
  "workers": {
1554
1554
  "app/(dashboard)/@drawer/feature/[featureId]/[tab]/page": {
1555
1555
  "moduleId": 10288,
@@ -1585,7 +1585,7 @@
1585
1585
  "filename": "src/presentation/web/app/actions/get-research-artifact.ts",
1586
1586
  "exportedName": "getResearchArtifact"
1587
1587
  },
1588
- "406e337426592167242906dfeb0db4ad5f1449f122": {
1588
+ "40ae80d9198077ab2947b965d5b31f925e58093b35": {
1589
1589
  "workers": {
1590
1590
  "app/(dashboard)/@drawer/feature/[featureId]/[tab]/page": {
1591
1591
  "moduleId": 10288,
@@ -1621,7 +1621,7 @@
1621
1621
  "filename": "src/presentation/web/app/actions/get-merge-review-data.ts",
1622
1622
  "exportedName": "getMergeReviewData"
1623
1623
  },
1624
- "4046f42e740b359f85c3b002058e2e040f09894b60": {
1624
+ "4073be32b5635392e3f2303dbbf4a498abeb21f133": {
1625
1625
  "workers": {
1626
1626
  "app/(dashboard)/@drawer/feature/[featureId]/[tab]/page": {
1627
1627
  "moduleId": 10288,
@@ -1657,7 +1657,7 @@
1657
1657
  "filename": "src/presentation/web/app/actions/get-feature-phase-timings.ts",
1658
1658
  "exportedName": "getFeaturePhaseTimings"
1659
1659
  },
1660
- "40a00a31fadb515e6cd9e647f74a5c5e5ac014bdda": {
1660
+ "40e84290b07ee8b0e908772cc121e04ccd8e5cd3c4": {
1661
1661
  "workers": {
1662
1662
  "app/(dashboard)/@drawer/feature/[featureId]/[tab]/page": {
1663
1663
  "moduleId": 10288,
@@ -1693,7 +1693,7 @@
1693
1693
  "filename": "src/presentation/web/app/actions/get-feature-plan.ts",
1694
1694
  "exportedName": "getFeaturePlan"
1695
1695
  },
1696
- "405c4414ba12d0b5ea79be58e8496a712d441e1f42": {
1696
+ "40b1e793d040c0e83407a4ac231984cad2756e2be6": {
1697
1697
  "workers": {
1698
1698
  "app/(dashboard)/@drawer/feature/[featureId]/[tab]/page": {
1699
1699
  "moduleId": 10288,
@@ -1729,7 +1729,7 @@
1729
1729
  "filename": "src/presentation/web/app/actions/get-feature-drawer-data.ts",
1730
1730
  "exportedName": "getFeatureDrawerData"
1731
1731
  },
1732
- "003f6c852927c25e330a13b317ad4f2a8abc8327f8": {
1732
+ "00318a9012866661b1018ab7621415b38b89904002": {
1733
1733
  "workers": {
1734
1734
  "app/settings/page": {
1735
1735
  "moduleId": 67125,
@@ -1744,7 +1744,7 @@
1744
1744
  "filename": "src/presentation/web/app/actions/load-settings.ts",
1745
1745
  "exportedName": "loadSettings"
1746
1746
  },
1747
- "40cacae4928d82f47887846a1002542de708297e79": {
1747
+ "40008da45d5389103d0e3ffac74d939fa8771919bf": {
1748
1748
  "workers": {
1749
1749
  "app/settings/page": {
1750
1750
  "moduleId": 67125,
@@ -1761,5 +1761,5 @@
1761
1761
  }
1762
1762
  },
1763
1763
  "edge": {},
1764
- "encryptionKey": "cqQGgWwjLcmmgizvvvSQc/D8K9MFRVJzDJJOsIQWgCg="
1764
+ "encryptionKey": "gsgbrQ6y5ywHDc94mFRkoatRb7EwSCG7BRC8kLznTe4="
1765
1765
  }
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,93752,e=>{"use strict";let t=(0,e.i(3645).default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);e.s(["default",()=>t])},38573,e=>{"use strict";let t=(0,e.i(3645).default)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);e.s(["Terminal",()=>t],38573)},30702,e=>{"use strict";let t=(0,e.i(3645).default)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);e.s(["ExternalLink",()=>t],30702)},23925,1012,e=>{"use strict";let t=(0,e.i(3645).default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["default",()=>t],1012),e.s(["Check",()=>t],23925)},41957,e=>{"use strict";var t=e.i(20314),r=e.i(79054),s=e.i(87620),o=r.forwardRef((e,r)=>(0,t.jsx)(s.Primitive.label,{...e,ref:r,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));o.displayName="Label",e.s(["Label",()=>o,"Root",()=>o],27572);var i=e.i(27572),i=i,n=e.i(94237),a=e.i(31777);let l=(0,n.cva)("text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),c=r.forwardRef(({className:e,...r},s)=>(0,t.jsx)(i.Root,{ref:s,className:(0,a.cn)(l(),e),...r}));c.displayName=i.Root.displayName,e.s(["Label",()=>c],41957)},23405,e=>{"use strict";var t=e.i(79054);function r(e){let r=t.useRef({value:e,previous:e});return t.useMemo(()=>(r.current.value!==e&&(r.current.previous=r.current.value,r.current.value=e),r.current.previous),[e])}e.s(["usePrevious",()=>r])},11345,e=>{"use strict";let t=(0,e.i(3645).default)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);e.s(["ChevronLeft",()=>t],11345)},76016,e=>{"use strict";let t=(0,e.i(3645).default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);e.s(["ChevronRight",()=>t],76016)},61569,e=>{"use strict";let t=(0,e.i(3645).default)("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);e.s(["default",()=>t])},87342,e=>{"use strict";var t=e.i(79054),r=e.i(22528),s=e.i(5978),o=e.i(86874),i=e.i(20314);function n(e){let n=e+"CollectionProvider",[a,l]=(0,r.createContextScope)(n),[c,d]=a(n,{collectionRef:{current:null},itemMap:new Map}),u=e=>{let{scope:r,children:s}=e,o=t.default.useRef(null),n=t.default.useRef(new Map).current;return(0,i.jsx)(c,{scope:r,itemMap:n,collectionRef:o,children:s})};u.displayName=n;let p=e+"CollectionSlot",h=(0,o.createSlot)(p),f=t.default.forwardRef((e,t)=>{let{scope:r,children:o}=e,n=d(p,r),a=(0,s.useComposedRefs)(t,n.collectionRef);return(0,i.jsx)(h,{ref:a,children:o})});f.displayName=p;let m=e+"CollectionItemSlot",v="data-radix-collection-item",x=(0,o.createSlot)(m),g=t.default.forwardRef((e,r)=>{let{scope:o,children:n,...a}=e,l=t.default.useRef(null),c=(0,s.useComposedRefs)(r,l),u=d(m,o);return t.default.useEffect(()=>(u.itemMap.set(l,{ref:l,...a}),()=>void u.itemMap.delete(l))),(0,i.jsx)(x,{...{[v]:""},ref:c,children:n})});return g.displayName=m,[{Provider:u,Slot:f,ItemSlot:g},function(r){let s=d(e+"CollectionConsumer",r);return t.default.useCallback(()=>{let e=s.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${v}]`));return Array.from(s.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current))},[s.collectionRef,s.itemMap])},l]}var a=new WeakMap;function l(e,t){var r,s;let o,i,n;if("at"in Array.prototype)return Array.prototype.at.call(e,t);let a=(r=e,s=t,o=r.length,(n=(i=c(s))>=0?i:o+i)<0||n>=o?-1:n);return -1===a?void 0:e[a]}function c(e){return e!=e||0===e?0:Math.trunc(e)}(class e extends Map{#e;constructor(e){super(e),this.#e=[...super.keys()],a.set(this,!0)}set(e,t){return a.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,r){let s,o=this.has(t),i=this.#e.length,n=c(e),a=n>=0?n:i+n,l=a<0||a>=i?-1:a;if(l===this.size||o&&l===this.size-1||-1===l)return this.set(t,r),this;let d=this.size+ +!o;n<0&&a++;let u=[...this.#e],p=!1;for(let e=a;e<d;e++)if(a===e){let i=u[e];u[e]===t&&(i=u[e+1]),o&&this.delete(t),s=this.get(i),this.set(t,r)}else{p||u[e-1]!==t||(p=!0);let r=u[p?e:e-1],o=s;s=this.get(r),this.delete(r),this.set(r,o)}return this}with(t,r,s){let o=new e(this);return o.insert(t,r,s),o}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,r){let s=this.#e.indexOf(e);return -1===s?this:this.insert(s,t,r)}after(e){let t=this.#e.indexOf(e);if(-1!==(t=-1===t||t===this.size-1?-1:t+1))return this.entryAt(t)}setAfter(e,t,r){let s=this.#e.indexOf(e);return -1===s?this:this.insert(s+1,t,r)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return void 0!==t&&this.delete(t)}at(e){let t=l(this.#e,e);if(void 0!==t)return this.get(t)}entryAt(e){let t=l(this.#e,e);if(void 0!==t)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return l(this.#e,e)}from(e,t){let r=this.indexOf(e);if(-1===r)return;let s=r+t;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.at(s)}keyFrom(e,t){let r=this.indexOf(e);if(-1===r)return;let s=r+t;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.keyAt(s)}find(e,t){let r=0;for(let s of this){if(Reflect.apply(e,t,[s,r,this]))return s;r++}}findIndex(e,t){let r=0;for(let s of this){if(Reflect.apply(e,t,[s,r,this]))return r;r++}return -1}filter(t,r){let s=[],o=0;for(let e of this)Reflect.apply(t,r,[e,o,this])&&s.push(e),o++;return new e(s)}map(t,r){let s=[],o=0;for(let e of this)s.push([e[0],Reflect.apply(t,r,[e,o,this])]),o++;return new e(s)}reduce(...e){let[t,r]=e,s=0,o=r??this.at(0);for(let r of this)o=0===s&&1===e.length?r:Reflect.apply(t,this,[o,r,s,this]),s++;return o}reduceRight(...e){let[t,r]=e,s=r??this.at(-1);for(let r=this.size-1;r>=0;r--){let o=this.at(r);s=r===this.size-1&&1===e.length?o:Reflect.apply(t,this,[s,o,r,this])}return s}toSorted(t){return new e([...this.entries()].sort(t))}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let r=this.keyAt(e),s=this.get(r);t.set(r,s)}return t}toSpliced(...t){let r=[...this.entries()];return r.splice(...t),new e(r)}slice(t,r){let s=new e,o=this.size-1;if(void 0===t)return s;t<0&&(t+=this.size),void 0!==r&&r>0&&(o=r-1);for(let e=t;e<=o;e++){let t=this.keyAt(e),r=this.get(t);s.set(t,r)}return s}every(e,t){let r=0;for(let s of this){if(!Reflect.apply(e,t,[s,r,this]))return!1;r++}return!0}some(e,t){let r=0;for(let s of this){if(Reflect.apply(e,t,[s,r,this]))return!0;r++}return!1}}),e.s(["createCollection",()=>n])},49228,e=>{"use strict";let t=(0,e.i(3645).default)("git-branch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);e.s(["GitBranch",()=>t],49228)},87889,e=>{"use strict";let t=(0,e.i(3645).default)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);e.s(["Eye",()=>t],87889)},99105,44229,e=>{"use strict";let t=(0,e.i(3645).default)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);e.s(["ChevronDown",()=>t],99105);var r=e.i(93752);e.s(["Code",()=>r.default],44229)},83902,e=>{"use strict";let t=(0,e.i(3645).default)("rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]]);e.s(["Rocket",()=>t],83902)},16956,65613,e=>{"use strict";var t=e.i(21023);let r=(0,t.createServerReference)("0032424347520be2b6dd8323a4b1c5a659c74e1f26",t.callServer,void 0,t.findSourceMapURL,"getAllAgentModels");e.s(["getAllAgentModels",()=>r],16956);let s=(0,t.createServerReference)("60c18409095d55e6fcea770467efae4ba9630a681a",t.callServer,void 0,t.findSourceMapURL,"updateAgentAndModel");e.s(["updateAgentAndModel",()=>s],65613)},26370,e=>{"use strict";let t=(0,e.i(3645).default)("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);e.s(["Bot",()=>t],26370)},51911,e=>{"use strict";var t=e.i(20314),r=e.i(79054),s=e.i(91967),o=e.i(5978),i=e.i(22528),n=e.i(36589),a=e.i(23405),l=e.i(77624),c=e.i(87620),d="Switch",[u,p]=(0,i.createContextScope)(d),[h,f]=u(d),m=r.forwardRef((e,i)=>{let{__scopeSwitch:a,name:l,checked:u,defaultChecked:p,required:f,disabled:m,value:v="on",onCheckedChange:x,form:k,...b}=e,[w,C]=r.useState(null),R=(0,o.useComposedRefs)(i,e=>C(e)),j=r.useRef(!1),P=!w||k||!!w.closest("form"),[A,N]=(0,n.useControllableState)({prop:u,defaultProp:p??!1,onChange:x,caller:d});return(0,t.jsxs)(h,{scope:a,checked:A,disabled:m,children:[(0,t.jsx)(c.Primitive.button,{type:"button",role:"switch","aria-checked":A,"aria-required":f,"data-state":y(A),"data-disabled":m?"":void 0,disabled:m,value:v,...b,ref:R,onClick:(0,s.composeEventHandlers)(e.onClick,e=>{N(e=>!e),P&&(j.current=e.isPropagationStopped(),j.current||e.stopPropagation())})}),P&&(0,t.jsx)(g,{control:w,bubbles:!j.current,name:l,value:v,checked:A,required:f,disabled:m,form:k,style:{transform:"translateX(-100%)"}})]})});m.displayName=d;var v="SwitchThumb",x=r.forwardRef((e,r)=>{let{__scopeSwitch:s,...o}=e,i=f(v,s);return(0,t.jsx)(c.Primitive.span,{"data-state":y(i.checked),"data-disabled":i.disabled?"":void 0,...o,ref:r})});x.displayName=v;var g=r.forwardRef(({__scopeSwitch:e,control:s,checked:i,bubbles:n=!0,...c},d)=>{let u=r.useRef(null),p=(0,o.useComposedRefs)(u,d),h=(0,a.usePrevious)(i),f=(0,l.useSize)(s);return r.useEffect(()=>{let e=u.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(h!==i&&t){let r=new Event("click",{bubbles:n});t.call(e,i),e.dispatchEvent(r)}},[h,i,n]),(0,t.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:i,...c,tabIndex:-1,ref:p,style:{...c.style,...f,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function y(e){return e?"checked":"unchecked"}g.displayName="SwitchBubbleInput",e.s(["Root",()=>m,"Switch",()=>m,"SwitchThumb",()=>x,"Thumb",()=>x,"createSwitchScope",()=>p],95291);var k=e.i(95291),k=k,b=e.i(31777);function w({className:e,size:r="default",...s}){return(0,t.jsx)(k.Root,{"data-slot":"switch","data-size":r,className:(0,b.cn)("peer group/switch focus-visible:border-ring focus-visible:ring-ring/50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input dark:data-[state=unchecked]:bg-input/80 inline-flex shrink-0 cursor-pointer items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-[1.15rem] data-[size=default]:w-8 data-[size=sm]:h-3.5 data-[size=sm]:w-6",e),...s,children:(0,t.jsx)(k.Thumb,{"data-slot":"switch-thumb",className:(0,b.cn)("bg-background dark:data-[state=checked]:bg-primary-foreground dark:data-[state=unchecked]:bg-foreground pointer-events-none block rounded-full ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}e.s(["Switch",()=>w],51911)},90382,e=>{"use strict";var t=e.i(20314),r=e.i(79054),s=e.i(91967),o=e.i(5978),i=e.i(22528),n=e.i(53532),a=e.i(41687),l=e.i(56720),c=e.i(13123),d=e.i(52740),u=e.i(39979),p=e.i(85995),h=e.i(87620),f=e.i(86874),m=e.i(36589),v=e.i(73772),x=e.i(13044),g="Popover",[y,k]=(0,i.createContextScope)(g,[d.createPopperScope]),b=(0,d.createPopperScope)(),[w,C]=y(g),R=e=>{let{__scopePopover:s,children:o,open:i,defaultOpen:n,onOpenChange:a,modal:l=!1}=e,u=b(s),p=r.useRef(null),[h,f]=r.useState(!1),[v,x]=(0,m.useControllableState)({prop:i,defaultProp:n??!1,onChange:a,caller:g});return(0,t.jsx)(d.Root,{...u,children:(0,t.jsx)(w,{scope:s,contentId:(0,c.useId)(),triggerRef:p,open:v,onOpenChange:x,onOpenToggle:r.useCallback(()=>x(e=>!e),[x]),hasCustomAnchor:h,onCustomAnchorAdd:r.useCallback(()=>f(!0),[]),onCustomAnchorRemove:r.useCallback(()=>f(!1),[]),modal:l,children:o})})};R.displayName=g;var j="PopoverAnchor",P=r.forwardRef((e,s)=>{let{__scopePopover:o,...i}=e,n=C(j,o),a=b(o),{onCustomAnchorAdd:l,onCustomAnchorRemove:c}=n;return r.useEffect(()=>(l(),()=>c()),[l,c]),(0,t.jsx)(d.Anchor,{...a,...i,ref:s})});P.displayName=j;var A="PopoverTrigger",N=r.forwardRef((e,r)=>{let{__scopePopover:i,...n}=e,a=C(A,i),l=b(i),c=(0,o.useComposedRefs)(r,a.triggerRef),u=(0,t.jsx)(h.Primitive.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":B(a.open),...n,ref:c,onClick:(0,s.composeEventHandlers)(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?u:(0,t.jsx)(d.Anchor,{asChild:!0,...l,children:u})});N.displayName=A;var S="PopoverPortal",[M,O]=y(S,{forceMount:void 0}),T=e=>{let{__scopePopover:r,forceMount:s,children:o,container:i}=e,n=C(S,r);return(0,t.jsx)(M,{scope:r,forceMount:s,children:(0,t.jsx)(p.Presence,{present:s||n.open,children:(0,t.jsx)(u.Portal,{asChild:!0,container:i,children:o})})})};T.displayName=S;var z="PopoverContent",E=r.forwardRef((e,r)=>{let s=O(z,e.__scopePopover),{forceMount:o=s.forceMount,...i}=e,n=C(z,e.__scopePopover);return(0,t.jsx)(p.Presence,{present:o||n.open,children:n.modal?(0,t.jsx)(D,{...i,ref:r}):(0,t.jsx)(q,{...i,ref:r})})});E.displayName=z;var F=(0,f.createSlot)("PopoverContent.RemoveScroll"),D=r.forwardRef((e,i)=>{let n=C(z,e.__scopePopover),a=r.useRef(null),l=(0,o.useComposedRefs)(i,a),c=r.useRef(!1);return r.useEffect(()=>{let e=a.current;if(e)return(0,v.hideOthers)(e)},[]),(0,t.jsx)(x.RemoveScroll,{as:F,allowPinchZoom:!0,children:(0,t.jsx)(I,{...e,ref:l,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,s.composeEventHandlers)(e.onCloseAutoFocus,e=>{e.preventDefault(),c.current||n.triggerRef.current?.focus()}),onPointerDownOutside:(0,s.composeEventHandlers)(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;c.current=2===t.button||r},{checkForDefaultPrevented:!1}),onFocusOutside:(0,s.composeEventHandlers)(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),q=r.forwardRef((e,s)=>{let o=C(z,e.__scopePopover),i=r.useRef(!1),n=r.useRef(!1);return(0,t.jsx)(I,{...e,ref:s,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(i.current||o.triggerRef.current?.focus(),t.preventDefault()),i.current=!1,n.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(i.current=!0,"pointerdown"===t.detail.originalEvent.type&&(n.current=!0));let r=t.target;o.triggerRef.current?.contains(r)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&n.current&&t.preventDefault()}})}),I=r.forwardRef((e,r)=>{let{__scopePopover:s,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:c,disableOutsidePointerEvents:u,onEscapeKeyDown:p,onPointerDownOutside:h,onFocusOutside:f,onInteractOutside:m,...v}=e,x=C(z,s),g=b(s);return(0,a.useFocusGuards)(),(0,t.jsx)(l.FocusScope,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:i,onUnmountAutoFocus:c,children:(0,t.jsx)(n.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:u,onInteractOutside:m,onEscapeKeyDown:p,onPointerDownOutside:h,onFocusOutside:f,onDismiss:()=>x.onOpenChange(!1),children:(0,t.jsx)(d.Content,{"data-state":B(x.open),role:"dialog",id:x.contentId,...g,...v,ref:r,style:{...v.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),L="PopoverClose",H=r.forwardRef((e,r)=>{let{__scopePopover:o,...i}=e,n=C(L,o);return(0,t.jsx)(h.Primitive.button,{type:"button",...i,ref:r,onClick:(0,s.composeEventHandlers)(e.onClick,()=>n.onOpenChange(!1))})});H.displayName=L;var _=r.forwardRef((e,r)=>{let{__scopePopover:s,...o}=e,i=b(s);return(0,t.jsx)(d.Arrow,{...i,...o,ref:r})});function B(e){return e?"open":"closed"}_.displayName="PopoverArrow",e.s(["Anchor",()=>P,"Arrow",()=>_,"Close",()=>H,"Content",()=>E,"Popover",()=>R,"PopoverAnchor",()=>P,"PopoverArrow",()=>_,"PopoverClose",()=>H,"PopoverContent",()=>E,"PopoverPortal",()=>T,"PopoverTrigger",()=>N,"Portal",()=>T,"Root",()=>R,"Trigger",()=>N,"createPopoverScope",()=>k],89920);var U=e.i(89920),U=U,K=e.i(31777);let G=U.Root,V=U.Trigger;U.Anchor;let X=r.forwardRef(({className:e,align:r="center",sideOffset:s=4,...o},i)=>(0,t.jsx)(U.Portal,{children:(0,t.jsx)(U.Content,{ref:i,align:r,sideOffset:s,className:(0,K.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 rounded-md border p-4 shadow-md outline-none",e),...o})}));X.displayName=U.Content.displayName,e.s(["Popover",()=>G,"PopoverContent",()=>X,"PopoverTrigger",()=>V],90382)},41413,e=>{"use strict";var t=e.i(20314),r=e.i(79054),s=e.i(23925),o=e.i(11345),i=e.i(76016),n=e.i(16956),a=e.i(65613),l=e.i(86782),c=e.i(29847),d=e.i(35364),u=e.i(90382),p=e.i(31777);function h({initialAgentType:e,initialModel:h,onAgentModelChange:f,disabled:m,className:v,mode:x}){let[g,y]=r.useState(!1),[k,b]=r.useState([]),[w,C]=r.useState(!0),[R,j]=r.useState(e),[P,A]=r.useState(h),[N,S]=r.useState(null),[M,O]=r.useState(0),[T,z]=r.useState(null);r.useEffect(()=>{(0,n.getAllAgentModels)().then(b).finally(()=>C(!1))},[]),r.useEffect(()=>{if(!g){let e=setTimeout(()=>{O(0),z(null)},150);return()=>clearTimeout(e)}},[g]);let E=async(e,t)=>{if(y(!1),e!==R||t!==P){if("override"===x){j(e),A(t),f?.(e,t);return}j(e),A(t),f?.(e,t),S(null);try{let r=await (0,a.updateAgentAndModel)(e,t||null);r.ok||(j(R),A(P),f?.(R,P),S(r.error??"Failed to save"))}catch{j(R),A(P),f?.(R,P),S("Failed to save")}}},F=(0,l.getAgentTypeIcon)(R),D=k.find(e=>e.agentType===R)?.label??R,q=P?(0,c.getModelMeta)(P).displayName||P:null,I=T?k.find(e=>e.agentType===T):null;return(0,t.jsxs)("div",{className:(0,p.cn)("flex flex-col gap-1",v),children:[(0,t.jsxs)(u.Popover,{open:g,onOpenChange:y,children:[(0,t.jsx)(u.PopoverTrigger,{asChild:!0,children:(0,t.jsx)(d.Button,{variant:"outline",role:"combobox","aria-expanded":g,disabled:(m??!1)||w,className:"w-auto cursor-pointer justify-start font-normal hover:border-violet-300 hover:bg-violet-50/50 dark:hover:border-violet-700 dark:hover:bg-violet-950/30",children:(0,t.jsxs)("span",{className:"flex items-center gap-2 truncate",children:[(0,t.jsx)(F,{className:"h-4 w-4 shrink-0"}),w?"Loading…":(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:D}),q?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-muted-foreground/50 text-xs",children:"·"}),(0,t.jsx)("span",{className:"text-xs font-medium",children:q})]}):null]})]})})}),(0,t.jsx)(u.PopoverContent,{className:"w-(--radix-popover-trigger-width) overflow-hidden p-0",align:"start",children:(0,t.jsxs)("div",{className:"flex transition-transform duration-200 ease-in-out",style:{transform:`translateX(${1===M?"-50%":"0%"})`,width:"200%"},children:[(0,t.jsxs)("div",{className:"w-1/2 shrink-0",children:[(0,t.jsx)("div",{className:"text-muted-foreground border-b px-3 py-2 text-xs font-medium",children:"Select agent"}),k.map(e=>{let r=(0,l.getAgentTypeIcon)(e.agentType),o=R===e.agentType,n=e.models.length>0;return(0,t.jsxs)("button",{type:"button",className:(0,p.cn)("flex w-full cursor-pointer items-center gap-2.5 px-3 py-2 text-xs transition-colors","hover:bg-accent hover:text-accent-foreground",o&&"bg-accent/50"),onClick:()=>{n?(z(e.agentType),requestAnimationFrame(()=>{requestAnimationFrame(()=>O(1))})):E(e.agentType,"")},children:[(0,t.jsx)(r,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{className:"flex-1 text-left",children:e.label}),o&&!n?(0,t.jsx)(s.Check,{className:"text-primary h-3.5 w-3.5 shrink-0"}):null,n?(0,t.jsx)(i.ChevronRight,{className:"text-muted-foreground h-3.5 w-3.5 shrink-0"}):null]},e.agentType)})]}),(0,t.jsx)("div",{className:"w-1/2 shrink-0",children:I?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{type:"button",className:"text-muted-foreground hover:text-foreground flex w-full cursor-pointer items-center gap-1.5 border-b px-3 py-2 text-xs font-medium transition-colors",onClick:()=>{O(0),setTimeout(()=>z(null),220)},children:[(0,t.jsx)(o.ChevronLeft,{className:"h-3.5 w-3.5"}),I.label]}),I.models.map(e=>{let r=R===I.agentType&&P===e.id;return(0,t.jsxs)("button",{type:"button",className:(0,p.cn)("flex w-full cursor-pointer items-center gap-3 px-3 py-2 text-left transition-colors","hover:bg-accent hover:text-accent-foreground",r&&"bg-accent/50"),onClick:()=>E(I.agentType,e.id),children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,t.jsx)("span",{className:"text-xs font-medium",children:e.displayName}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:e.description})]}),r?(0,t.jsx)(s.Check,{className:"text-primary h-3.5 w-3.5 shrink-0"}):null]},e.id)})]}):null})]})})]}),!!N&&(0,t.jsx)("p",{className:"text-destructive text-sm",children:N})]})}e.s(["AgentModelPicker",()=>h])}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,93752,e=>{"use strict";let t=(0,e.i(3645).default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);e.s(["default",()=>t])},49228,e=>{"use strict";let t=(0,e.i(3645).default)("git-branch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);e.s(["GitBranch",()=>t],49228)},61569,99105,e=>{"use strict";var t=e.i(3645);let r=(0,t.default)("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);e.s(["default",()=>r],61569);let s=(0,t.default)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);e.s(["ChevronDown",()=>s],99105)},41957,e=>{"use strict";var t=e.i(20314),r=e.i(79054),s=e.i(87620),o=r.forwardRef((e,r)=>(0,t.jsx)(s.Primitive.label,{...e,ref:r,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));o.displayName="Label",e.s(["Label",()=>o,"Root",()=>o],27572);var i=e.i(27572),i=i,n=e.i(94237),a=e.i(31777);let l=(0,n.cva)("text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),c=r.forwardRef(({className:e,...r},s)=>(0,t.jsx)(i.Root,{ref:s,className:(0,a.cn)(l(),e),...r}));c.displayName=i.Root.displayName,e.s(["Label",()=>c],41957)},23405,e=>{"use strict";var t=e.i(79054);function r(e){let r=t.useRef({value:e,previous:e});return t.useMemo(()=>(r.current.value!==e&&(r.current.previous=r.current.value,r.current.value=e),r.current.previous),[e])}e.s(["usePrevious",()=>r])},11345,e=>{"use strict";let t=(0,e.i(3645).default)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);e.s(["ChevronLeft",()=>t],11345)},76016,e=>{"use strict";let t=(0,e.i(3645).default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);e.s(["ChevronRight",()=>t],76016)},38573,e=>{"use strict";let t=(0,e.i(3645).default)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);e.s(["Terminal",()=>t],38573)},30702,e=>{"use strict";let t=(0,e.i(3645).default)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);e.s(["ExternalLink",()=>t],30702)},23925,1012,e=>{"use strict";let t=(0,e.i(3645).default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["default",()=>t],1012),e.s(["Check",()=>t],23925)},87342,e=>{"use strict";var t=e.i(79054),r=e.i(22528),s=e.i(5978),o=e.i(86874),i=e.i(20314);function n(e){let n=e+"CollectionProvider",[a,l]=(0,r.createContextScope)(n),[c,d]=a(n,{collectionRef:{current:null},itemMap:new Map}),u=e=>{let{scope:r,children:s}=e,o=t.default.useRef(null),n=t.default.useRef(new Map).current;return(0,i.jsx)(c,{scope:r,itemMap:n,collectionRef:o,children:s})};u.displayName=n;let p=e+"CollectionSlot",h=(0,o.createSlot)(p),f=t.default.forwardRef((e,t)=>{let{scope:r,children:o}=e,n=d(p,r),a=(0,s.useComposedRefs)(t,n.collectionRef);return(0,i.jsx)(h,{ref:a,children:o})});f.displayName=p;let m=e+"CollectionItemSlot",v="data-radix-collection-item",x=(0,o.createSlot)(m),g=t.default.forwardRef((e,r)=>{let{scope:o,children:n,...a}=e,l=t.default.useRef(null),c=(0,s.useComposedRefs)(r,l),u=d(m,o);return t.default.useEffect(()=>(u.itemMap.set(l,{ref:l,...a}),()=>void u.itemMap.delete(l))),(0,i.jsx)(x,{...{[v]:""},ref:c,children:n})});return g.displayName=m,[{Provider:u,Slot:f,ItemSlot:g},function(r){let s=d(e+"CollectionConsumer",r);return t.default.useCallback(()=>{let e=s.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${v}]`));return Array.from(s.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current))},[s.collectionRef,s.itemMap])},l]}var a=new WeakMap;function l(e,t){var r,s;let o,i,n;if("at"in Array.prototype)return Array.prototype.at.call(e,t);let a=(r=e,s=t,o=r.length,(n=(i=c(s))>=0?i:o+i)<0||n>=o?-1:n);return -1===a?void 0:e[a]}function c(e){return e!=e||0===e?0:Math.trunc(e)}(class e extends Map{#e;constructor(e){super(e),this.#e=[...super.keys()],a.set(this,!0)}set(e,t){return a.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,r){let s,o=this.has(t),i=this.#e.length,n=c(e),a=n>=0?n:i+n,l=a<0||a>=i?-1:a;if(l===this.size||o&&l===this.size-1||-1===l)return this.set(t,r),this;let d=this.size+ +!o;n<0&&a++;let u=[...this.#e],p=!1;for(let e=a;e<d;e++)if(a===e){let i=u[e];u[e]===t&&(i=u[e+1]),o&&this.delete(t),s=this.get(i),this.set(t,r)}else{p||u[e-1]!==t||(p=!0);let r=u[p?e:e-1],o=s;s=this.get(r),this.delete(r),this.set(r,o)}return this}with(t,r,s){let o=new e(this);return o.insert(t,r,s),o}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,r){let s=this.#e.indexOf(e);return -1===s?this:this.insert(s,t,r)}after(e){let t=this.#e.indexOf(e);if(-1!==(t=-1===t||t===this.size-1?-1:t+1))return this.entryAt(t)}setAfter(e,t,r){let s=this.#e.indexOf(e);return -1===s?this:this.insert(s+1,t,r)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return void 0!==t&&this.delete(t)}at(e){let t=l(this.#e,e);if(void 0!==t)return this.get(t)}entryAt(e){let t=l(this.#e,e);if(void 0!==t)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return l(this.#e,e)}from(e,t){let r=this.indexOf(e);if(-1===r)return;let s=r+t;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.at(s)}keyFrom(e,t){let r=this.indexOf(e);if(-1===r)return;let s=r+t;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.keyAt(s)}find(e,t){let r=0;for(let s of this){if(Reflect.apply(e,t,[s,r,this]))return s;r++}}findIndex(e,t){let r=0;for(let s of this){if(Reflect.apply(e,t,[s,r,this]))return r;r++}return -1}filter(t,r){let s=[],o=0;for(let e of this)Reflect.apply(t,r,[e,o,this])&&s.push(e),o++;return new e(s)}map(t,r){let s=[],o=0;for(let e of this)s.push([e[0],Reflect.apply(t,r,[e,o,this])]),o++;return new e(s)}reduce(...e){let[t,r]=e,s=0,o=r??this.at(0);for(let r of this)o=0===s&&1===e.length?r:Reflect.apply(t,this,[o,r,s,this]),s++;return o}reduceRight(...e){let[t,r]=e,s=r??this.at(-1);for(let r=this.size-1;r>=0;r--){let o=this.at(r);s=r===this.size-1&&1===e.length?o:Reflect.apply(t,this,[s,o,r,this])}return s}toSorted(t){return new e([...this.entries()].sort(t))}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let r=this.keyAt(e),s=this.get(r);t.set(r,s)}return t}toSpliced(...t){let r=[...this.entries()];return r.splice(...t),new e(r)}slice(t,r){let s=new e,o=this.size-1;if(void 0===t)return s;t<0&&(t+=this.size),void 0!==r&&r>0&&(o=r-1);for(let e=t;e<=o;e++){let t=this.keyAt(e),r=this.get(t);s.set(t,r)}return s}every(e,t){let r=0;for(let s of this){if(!Reflect.apply(e,t,[s,r,this]))return!1;r++}return!0}some(e,t){let r=0;for(let s of this){if(Reflect.apply(e,t,[s,r,this]))return!0;r++}return!1}}),e.s(["createCollection",()=>n])},87889,e=>{"use strict";let t=(0,e.i(3645).default)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);e.s(["Eye",()=>t],87889)},44229,e=>{"use strict";var t=e.i(93752);e.s(["Code",()=>t.default])},83902,e=>{"use strict";let t=(0,e.i(3645).default)("rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]]);e.s(["Rocket",()=>t],83902)},75239,16195,e=>{"use strict";var t=e.i(21023);let r=(0,t.createServerReference)("00799d05c5dac61e2118b299137ec9e5a08cf7a0d2",t.callServer,void 0,t.findSourceMapURL,"getAllAgentModels");e.s(["getAllAgentModels",()=>r],75239);let s=(0,t.createServerReference)("605ce1352b148d498397c6e3ee3de376207c480224",t.callServer,void 0,t.findSourceMapURL,"updateAgentAndModel");e.s(["updateAgentAndModel",()=>s],16195)},26370,e=>{"use strict";let t=(0,e.i(3645).default)("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);e.s(["Bot",()=>t],26370)},51911,e=>{"use strict";var t=e.i(20314),r=e.i(79054),s=e.i(91967),o=e.i(5978),i=e.i(22528),n=e.i(36589),a=e.i(23405),l=e.i(77624),c=e.i(87620),d="Switch",[u,p]=(0,i.createContextScope)(d),[h,f]=u(d),m=r.forwardRef((e,i)=>{let{__scopeSwitch:a,name:l,checked:u,defaultChecked:p,required:f,disabled:m,value:v="on",onCheckedChange:x,form:k,...b}=e,[w,C]=r.useState(null),R=(0,o.useComposedRefs)(i,e=>C(e)),j=r.useRef(!1),P=!w||k||!!w.closest("form"),[A,N]=(0,n.useControllableState)({prop:u,defaultProp:p??!1,onChange:x,caller:d});return(0,t.jsxs)(h,{scope:a,checked:A,disabled:m,children:[(0,t.jsx)(c.Primitive.button,{type:"button",role:"switch","aria-checked":A,"aria-required":f,"data-state":y(A),"data-disabled":m?"":void 0,disabled:m,value:v,...b,ref:R,onClick:(0,s.composeEventHandlers)(e.onClick,e=>{N(e=>!e),P&&(j.current=e.isPropagationStopped(),j.current||e.stopPropagation())})}),P&&(0,t.jsx)(g,{control:w,bubbles:!j.current,name:l,value:v,checked:A,required:f,disabled:m,form:k,style:{transform:"translateX(-100%)"}})]})});m.displayName=d;var v="SwitchThumb",x=r.forwardRef((e,r)=>{let{__scopeSwitch:s,...o}=e,i=f(v,s);return(0,t.jsx)(c.Primitive.span,{"data-state":y(i.checked),"data-disabled":i.disabled?"":void 0,...o,ref:r})});x.displayName=v;var g=r.forwardRef(({__scopeSwitch:e,control:s,checked:i,bubbles:n=!0,...c},d)=>{let u=r.useRef(null),p=(0,o.useComposedRefs)(u,d),h=(0,a.usePrevious)(i),f=(0,l.useSize)(s);return r.useEffect(()=>{let e=u.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(h!==i&&t){let r=new Event("click",{bubbles:n});t.call(e,i),e.dispatchEvent(r)}},[h,i,n]),(0,t.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:i,...c,tabIndex:-1,ref:p,style:{...c.style,...f,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function y(e){return e?"checked":"unchecked"}g.displayName="SwitchBubbleInput",e.s(["Root",()=>m,"Switch",()=>m,"SwitchThumb",()=>x,"Thumb",()=>x,"createSwitchScope",()=>p],95291);var k=e.i(95291),k=k,b=e.i(31777);function w({className:e,size:r="default",...s}){return(0,t.jsx)(k.Root,{"data-slot":"switch","data-size":r,className:(0,b.cn)("peer group/switch focus-visible:border-ring focus-visible:ring-ring/50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input dark:data-[state=unchecked]:bg-input/80 inline-flex shrink-0 cursor-pointer items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-[1.15rem] data-[size=default]:w-8 data-[size=sm]:h-3.5 data-[size=sm]:w-6",e),...s,children:(0,t.jsx)(k.Thumb,{"data-slot":"switch-thumb",className:(0,b.cn)("bg-background dark:data-[state=checked]:bg-primary-foreground dark:data-[state=unchecked]:bg-foreground pointer-events-none block rounded-full ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}e.s(["Switch",()=>w],51911)},90382,e=>{"use strict";var t=e.i(20314),r=e.i(79054),s=e.i(91967),o=e.i(5978),i=e.i(22528),n=e.i(53532),a=e.i(41687),l=e.i(56720),c=e.i(13123),d=e.i(52740),u=e.i(39979),p=e.i(85995),h=e.i(87620),f=e.i(86874),m=e.i(36589),v=e.i(73772),x=e.i(13044),g="Popover",[y,k]=(0,i.createContextScope)(g,[d.createPopperScope]),b=(0,d.createPopperScope)(),[w,C]=y(g),R=e=>{let{__scopePopover:s,children:o,open:i,defaultOpen:n,onOpenChange:a,modal:l=!1}=e,u=b(s),p=r.useRef(null),[h,f]=r.useState(!1),[v,x]=(0,m.useControllableState)({prop:i,defaultProp:n??!1,onChange:a,caller:g});return(0,t.jsx)(d.Root,{...u,children:(0,t.jsx)(w,{scope:s,contentId:(0,c.useId)(),triggerRef:p,open:v,onOpenChange:x,onOpenToggle:r.useCallback(()=>x(e=>!e),[x]),hasCustomAnchor:h,onCustomAnchorAdd:r.useCallback(()=>f(!0),[]),onCustomAnchorRemove:r.useCallback(()=>f(!1),[]),modal:l,children:o})})};R.displayName=g;var j="PopoverAnchor",P=r.forwardRef((e,s)=>{let{__scopePopover:o,...i}=e,n=C(j,o),a=b(o),{onCustomAnchorAdd:l,onCustomAnchorRemove:c}=n;return r.useEffect(()=>(l(),()=>c()),[l,c]),(0,t.jsx)(d.Anchor,{...a,...i,ref:s})});P.displayName=j;var A="PopoverTrigger",N=r.forwardRef((e,r)=>{let{__scopePopover:i,...n}=e,a=C(A,i),l=b(i),c=(0,o.useComposedRefs)(r,a.triggerRef),u=(0,t.jsx)(h.Primitive.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":B(a.open),...n,ref:c,onClick:(0,s.composeEventHandlers)(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?u:(0,t.jsx)(d.Anchor,{asChild:!0,...l,children:u})});N.displayName=A;var S="PopoverPortal",[M,O]=y(S,{forceMount:void 0}),T=e=>{let{__scopePopover:r,forceMount:s,children:o,container:i}=e,n=C(S,r);return(0,t.jsx)(M,{scope:r,forceMount:s,children:(0,t.jsx)(p.Presence,{present:s||n.open,children:(0,t.jsx)(u.Portal,{asChild:!0,container:i,children:o})})})};T.displayName=S;var z="PopoverContent",E=r.forwardRef((e,r)=>{let s=O(z,e.__scopePopover),{forceMount:o=s.forceMount,...i}=e,n=C(z,e.__scopePopover);return(0,t.jsx)(p.Presence,{present:o||n.open,children:n.modal?(0,t.jsx)(D,{...i,ref:r}):(0,t.jsx)(q,{...i,ref:r})})});E.displayName=z;var F=(0,f.createSlot)("PopoverContent.RemoveScroll"),D=r.forwardRef((e,i)=>{let n=C(z,e.__scopePopover),a=r.useRef(null),l=(0,o.useComposedRefs)(i,a),c=r.useRef(!1);return r.useEffect(()=>{let e=a.current;if(e)return(0,v.hideOthers)(e)},[]),(0,t.jsx)(x.RemoveScroll,{as:F,allowPinchZoom:!0,children:(0,t.jsx)(I,{...e,ref:l,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,s.composeEventHandlers)(e.onCloseAutoFocus,e=>{e.preventDefault(),c.current||n.triggerRef.current?.focus()}),onPointerDownOutside:(0,s.composeEventHandlers)(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;c.current=2===t.button||r},{checkForDefaultPrevented:!1}),onFocusOutside:(0,s.composeEventHandlers)(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),q=r.forwardRef((e,s)=>{let o=C(z,e.__scopePopover),i=r.useRef(!1),n=r.useRef(!1);return(0,t.jsx)(I,{...e,ref:s,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(i.current||o.triggerRef.current?.focus(),t.preventDefault()),i.current=!1,n.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(i.current=!0,"pointerdown"===t.detail.originalEvent.type&&(n.current=!0));let r=t.target;o.triggerRef.current?.contains(r)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&n.current&&t.preventDefault()}})}),I=r.forwardRef((e,r)=>{let{__scopePopover:s,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:c,disableOutsidePointerEvents:u,onEscapeKeyDown:p,onPointerDownOutside:h,onFocusOutside:f,onInteractOutside:m,...v}=e,x=C(z,s),g=b(s);return(0,a.useFocusGuards)(),(0,t.jsx)(l.FocusScope,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:i,onUnmountAutoFocus:c,children:(0,t.jsx)(n.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:u,onInteractOutside:m,onEscapeKeyDown:p,onPointerDownOutside:h,onFocusOutside:f,onDismiss:()=>x.onOpenChange(!1),children:(0,t.jsx)(d.Content,{"data-state":B(x.open),role:"dialog",id:x.contentId,...g,...v,ref:r,style:{...v.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),L="PopoverClose",H=r.forwardRef((e,r)=>{let{__scopePopover:o,...i}=e,n=C(L,o);return(0,t.jsx)(h.Primitive.button,{type:"button",...i,ref:r,onClick:(0,s.composeEventHandlers)(e.onClick,()=>n.onOpenChange(!1))})});H.displayName=L;var _=r.forwardRef((e,r)=>{let{__scopePopover:s,...o}=e,i=b(s);return(0,t.jsx)(d.Arrow,{...i,...o,ref:r})});function B(e){return e?"open":"closed"}_.displayName="PopoverArrow",e.s(["Anchor",()=>P,"Arrow",()=>_,"Close",()=>H,"Content",()=>E,"Popover",()=>R,"PopoverAnchor",()=>P,"PopoverArrow",()=>_,"PopoverClose",()=>H,"PopoverContent",()=>E,"PopoverPortal",()=>T,"PopoverTrigger",()=>N,"Portal",()=>T,"Root",()=>R,"Trigger",()=>N,"createPopoverScope",()=>k],89920);var U=e.i(89920),U=U,K=e.i(31777);let G=U.Root,V=U.Trigger;U.Anchor;let X=r.forwardRef(({className:e,align:r="center",sideOffset:s=4,...o},i)=>(0,t.jsx)(U.Portal,{children:(0,t.jsx)(U.Content,{ref:i,align:r,sideOffset:s,className:(0,K.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 rounded-md border p-4 shadow-md outline-none",e),...o})}));X.displayName=U.Content.displayName,e.s(["Popover",()=>G,"PopoverContent",()=>X,"PopoverTrigger",()=>V],90382)},41413,e=>{"use strict";var t=e.i(20314),r=e.i(79054),s=e.i(23925),o=e.i(11345),i=e.i(76016),n=e.i(75239),a=e.i(16195),l=e.i(86782),c=e.i(29847),d=e.i(35364),u=e.i(90382),p=e.i(31777);function h({initialAgentType:e,initialModel:h,onAgentModelChange:f,disabled:m,className:v,mode:x}){let[g,y]=r.useState(!1),[k,b]=r.useState([]),[w,C]=r.useState(!0),[R,j]=r.useState(e),[P,A]=r.useState(h),[N,S]=r.useState(null),[M,O]=r.useState(0),[T,z]=r.useState(null);r.useEffect(()=>{(0,n.getAllAgentModels)().then(b).finally(()=>C(!1))},[]),r.useEffect(()=>{if(!g){let e=setTimeout(()=>{O(0),z(null)},150);return()=>clearTimeout(e)}},[g]);let E=async(e,t)=>{if(y(!1),e!==R||t!==P){if("override"===x){j(e),A(t),f?.(e,t);return}j(e),A(t),f?.(e,t),S(null);try{let r=await (0,a.updateAgentAndModel)(e,t||null);r.ok||(j(R),A(P),f?.(R,P),S(r.error??"Failed to save"))}catch{j(R),A(P),f?.(R,P),S("Failed to save")}}},F=(0,l.getAgentTypeIcon)(R),D=k.find(e=>e.agentType===R)?.label??R,q=P?(0,c.getModelMeta)(P).displayName||P:null,I=T?k.find(e=>e.agentType===T):null;return(0,t.jsxs)("div",{className:(0,p.cn)("flex flex-col gap-1",v),children:[(0,t.jsxs)(u.Popover,{open:g,onOpenChange:y,children:[(0,t.jsx)(u.PopoverTrigger,{asChild:!0,children:(0,t.jsx)(d.Button,{variant:"outline",role:"combobox","aria-expanded":g,disabled:(m??!1)||w,className:"w-auto cursor-pointer justify-start font-normal hover:border-violet-300 hover:bg-violet-50/50 dark:hover:border-violet-700 dark:hover:bg-violet-950/30",children:(0,t.jsxs)("span",{className:"flex items-center gap-2 truncate",children:[(0,t.jsx)(F,{className:"h-4 w-4 shrink-0"}),w?"Loading…":(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:D}),q?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-muted-foreground/50 text-xs",children:"·"}),(0,t.jsx)("span",{className:"text-xs font-medium",children:q})]}):null]})]})})}),(0,t.jsx)(u.PopoverContent,{className:"w-(--radix-popover-trigger-width) overflow-hidden p-0",align:"start",children:(0,t.jsxs)("div",{className:"flex transition-transform duration-200 ease-in-out",style:{transform:`translateX(${1===M?"-50%":"0%"})`,width:"200%"},children:[(0,t.jsxs)("div",{className:"w-1/2 shrink-0",children:[(0,t.jsx)("div",{className:"text-muted-foreground border-b px-3 py-2 text-xs font-medium",children:"Select agent"}),k.map(e=>{let r=(0,l.getAgentTypeIcon)(e.agentType),o=R===e.agentType,n=e.models.length>0;return(0,t.jsxs)("button",{type:"button",className:(0,p.cn)("flex w-full cursor-pointer items-center gap-2.5 px-3 py-2 text-xs transition-colors","hover:bg-accent hover:text-accent-foreground",o&&"bg-accent/50"),onClick:()=>{n?(z(e.agentType),requestAnimationFrame(()=>{requestAnimationFrame(()=>O(1))})):E(e.agentType,"")},children:[(0,t.jsx)(r,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{className:"flex-1 text-left",children:e.label}),o&&!n?(0,t.jsx)(s.Check,{className:"text-primary h-3.5 w-3.5 shrink-0"}):null,n?(0,t.jsx)(i.ChevronRight,{className:"text-muted-foreground h-3.5 w-3.5 shrink-0"}):null]},e.agentType)})]}),(0,t.jsx)("div",{className:"w-1/2 shrink-0",children:I?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{type:"button",className:"text-muted-foreground hover:text-foreground flex w-full cursor-pointer items-center gap-1.5 border-b px-3 py-2 text-xs font-medium transition-colors",onClick:()=>{O(0),setTimeout(()=>z(null),220)},children:[(0,t.jsx)(o.ChevronLeft,{className:"h-3.5 w-3.5"}),I.label]}),I.models.map(e=>{let r=R===I.agentType&&P===e.id;return(0,t.jsxs)("button",{type:"button",className:(0,p.cn)("flex w-full cursor-pointer items-center gap-3 px-3 py-2 text-left transition-colors","hover:bg-accent hover:text-accent-foreground",r&&"bg-accent/50"),onClick:()=>E(I.agentType,e.id),children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,t.jsx)("span",{className:"text-xs font-medium",children:e.displayName}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:e.description})]}),r?(0,t.jsx)(s.Check,{className:"text-primary h-3.5 w-3.5 shrink-0"}):null]},e.id)})]}):null})]})})]}),!!N&&(0,t.jsx)("p",{className:"text-destructive text-sm",children:N})]})}e.s(["AgentModelPicker",()=>h])}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,44229,e=>{"use strict";var t=e.i(93752);e.s(["Code",()=>t.default])},87889,e=>{"use strict";let t=(0,e.i(3645).default)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);e.s(["Eye",()=>t],87889)},93752,e=>{"use strict";let t=(0,e.i(3645).default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);e.s(["default",()=>t])},49228,e=>{"use strict";let t=(0,e.i(3645).default)("git-branch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);e.s(["GitBranch",()=>t],49228)},81181,e=>{"use strict";var t=e.i(95230);e.s(["Download",()=>t.default])},95230,e=>{"use strict";let t=(0,e.i(3645).default)("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]);e.s(["default",()=>t])},68304,e=>{"use strict";var t=e.i(20314),a=e.i(79054),i=e.i(91967),r=e.i(22528),s=e.i(51080),n=e.i(85995),l=e.i(87620),o=e.i(66033),d=e.i(36589),c=e.i(13123),u="Tabs",[f,h]=(0,r.createContextScope)(u,[s.createRovingFocusGroupScope]),m=(0,s.createRovingFocusGroupScope)(),[p,b]=f(u),g=a.forwardRef((e,a)=>{let{__scopeTabs:i,value:r,onValueChange:s,defaultValue:n,orientation:f="horizontal",dir:h,activationMode:m="automatic",...b}=e,g=(0,o.useDirection)(h),[x,v]=(0,d.useControllableState)({prop:r,onChange:s,defaultProp:n??"",caller:u});return(0,t.jsx)(p,{scope:i,baseId:(0,c.useId)(),value:x,onValueChange:v,orientation:f,dir:g,activationMode:m,children:(0,t.jsx)(l.Primitive.div,{dir:g,"data-orientation":f,...b,ref:a})})});g.displayName=u;var x="TabsList",v=a.forwardRef((e,a)=>{let{__scopeTabs:i,loop:r=!0,...n}=e,o=b(x,i),d=m(i);return(0,t.jsx)(s.Root,{asChild:!0,...d,orientation:o.orientation,dir:o.dir,loop:r,children:(0,t.jsx)(l.Primitive.div,{role:"tablist","aria-orientation":o.orientation,...n,ref:a})})});v.displayName=x;var y="TabsTrigger",w=a.forwardRef((e,a)=>{let{__scopeTabs:r,value:n,disabled:o=!1,...d}=e,c=b(y,r),u=m(r),f=N(c.baseId,n),h=T(c.baseId,n),p=n===c.value;return(0,t.jsx)(s.Item,{asChild:!0,...u,focusable:!o,active:p,children:(0,t.jsx)(l.Primitive.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":h,"data-state":p?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:f,...d,ref:a,onMouseDown:(0,i.composeEventHandlers)(e.onMouseDown,e=>{o||0!==e.button||!1!==e.ctrlKey?e.preventDefault():c.onValueChange(n)}),onKeyDown:(0,i.composeEventHandlers)(e.onKeyDown,e=>{[" ","Enter"].includes(e.key)&&c.onValueChange(n)}),onFocus:(0,i.composeEventHandlers)(e.onFocus,()=>{let e="manual"!==c.activationMode;p||o||!e||c.onValueChange(n)})})})});w.displayName=y;var j="TabsContent",k=a.forwardRef((e,i)=>{let{__scopeTabs:r,value:s,forceMount:o,children:d,...c}=e,u=b(j,r),f=N(u.baseId,s),h=T(u.baseId,s),m=s===u.value,p=a.useRef(m);return a.useEffect(()=>{let e=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,t.jsx)(n.Presence,{present:o||m,children:({present:a})=>(0,t.jsx)(l.Primitive.div,{"data-state":m?"active":"inactive","data-orientation":u.orientation,role:"tabpanel","aria-labelledby":f,hidden:!a,id:h,tabIndex:0,...c,ref:i,style:{...e.style,animationDuration:p.current?"0s":void 0},children:a&&d})})});function N(e,t){return`${e}-trigger-${t}`}function T(e,t){return`${e}-content-${t}`}k.displayName=j,e.s(["Content",()=>k,"List",()=>v,"Root",()=>g,"Tabs",()=>g,"TabsContent",()=>k,"TabsList",()=>v,"TabsTrigger",()=>w,"Trigger",()=>w,"createTabsScope",()=>h],43133);var C=e.i(43133),C=C,R=e.i(31777);let D=C.Root,M=a.forwardRef(({className:e,...a},i)=>(0,t.jsx)(C.List,{ref:i,className:(0,R.cn)("bg-muted text-muted-foreground inline-flex h-9 items-center justify-center rounded-lg p-1",e),...a}));M.displayName=C.List.displayName;let I=a.forwardRef(({className:e,...a},i)=>(0,t.jsx)(C.Trigger,{ref:i,className:(0,R.cn)("ring-offset-background focus-visible:ring-ring data-[state=active]:bg-background data-[state=active]:text-foreground inline-flex items-center justify-center rounded-md px-3 py-1 text-sm font-medium whitespace-nowrap transition-all focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow",e),...a}));I.displayName=C.Trigger.displayName;let P=a.forwardRef(({className:e,...a},i)=>(0,t.jsx)(C.Content,{ref:i,className:(0,R.cn)("ring-offset-background focus-visible:ring-ring mt-2 focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none",e),...a}));P.displayName=C.Content.displayName,e.s(["Tabs",()=>D,"TabsContent",()=>P,"TabsList",()=>M,"TabsTrigger",()=>I],68304)},16868,48306,80436,28267,86254,50032,42076,e=>{"use strict";var t=e.i(3645);let a=(0,t.default)("paperclip",[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]);e.s(["PaperclipIcon",()=>a],16868);var i=e.i(20314),r=e.i(31777);function s({className:e,...t}){return(0,i.jsx)("textarea",{"data-slot":"textarea",className:(0,r.cn)("placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input field-sizing-content min-h-[80px] w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...t})}e.s(["Textarea",()=>s],48306);var n=e.i(60253),l=e.i(15506),l=l,o=e.i(95230);e.s(["DownloadIcon",()=>o.default],80436);var o=o,d=e.i(2287),c=e.i(1693);e.s(["VisuallyHidden",0,c],28267);var c=c;let u=(0,t.default)("file",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]]);var f=e.i(16298),f=f;let h=(0,t.default)("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);var m=e.i(93752),m=m;e.i(35364);let p=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".ico",".bmp"]),b=new Set([".ts",".tsx",".js",".jsx",".json",".yaml",".yml",".xml",".html",".css",".md"]);function g(e){if(0===e)return"0 B";let t=Math.floor(Math.log(e)/Math.log(1024));return`${(e/Math.pow(1024,t)).toFixed(+(0!==t))} ${["B","KB","MB","GB"][t]}`}let x=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".ico",".bmp"]);function v(e,t){let a=new URLSearchParams({path:e,mimeType:t});return`/api/attachments/preview?${a.toString()}`}function y({name:e,size:t,mimeType:a,path:s,onRemove:y,loading:w=!1,disabled:j=!1}){let k,N,T=(k=e.lastIndexOf("."))>=0?e.slice(k).toLowerCase():"",C=p.has(T)?h:".pdf"===T?f.default:b.has(T)?m.default:u,R=".pdf"===T?"bg-red-50 text-red-600":p.has(T)?"bg-blue-50 text-blue-600":b.has(T)?"bg-emerald-50 text-emerald-600":"bg-gray-50 text-gray-600",D=(N=e.lastIndexOf("."))>=0&&x.has(e.slice(N).toLowerCase());return w?(0,i.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-md border",children:(0,i.jsx)(l.default,{className:"text-muted-foreground h-5 w-5 animate-spin"})}):D?(0,i.jsxs)(d.Dialog,{children:[(0,i.jsxs)("div",{className:"group relative",children:[(0,i.jsx)(d.DialogTrigger,{asChild:!0,children:(0,i.jsx)("img",{src:v(s,a),alt:e,title:e,className:"h-12 w-12 cursor-pointer rounded-md border object-cover transition-opacity hover:opacity-80"})}),!j&&(0,i.jsx)("button",{type:"button",onClick:y,className:"absolute -top-1.5 -right-1.5 hidden h-5 w-5 cursor-pointer items-center justify-center rounded-full bg-black/70 text-white group-hover:flex","aria-label":`Remove ${e}`,children:(0,i.jsx)(n.X,{className:"h-3 w-3"})})]}),(0,i.jsxs)(d.DialogContent,{className:"max-w-3xl gap-0 overflow-hidden border-0 p-0 [&>button:last-child]:!cursor-pointer [&>button:last-child]:!rounded-full [&>button:last-child]:!bg-black/70 [&>button:last-child]:!p-1.5 [&>button:last-child]:!text-white [&>button:last-child]:!opacity-100 [&>button:last-child]:!shadow-lg [&>button:last-child]:!backdrop-blur-md [&>button:last-child]:hover:!bg-black/90",children:[(0,i.jsx)(c.Root,{children:(0,i.jsxs)(d.DialogTitle,{children:["Preview: ",e]})}),(0,i.jsx)("div",{className:"relative bg-black/90",children:(0,i.jsx)("img",{src:v(s,a),alt:e,className:"h-auto max-h-[70vh] w-full object-contain"})}),(0,i.jsxs)("div",{className:"bg-background flex items-center gap-3 px-4 py-3",children:[(0,i.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,i.jsx)("span",{className:"truncate text-sm font-medium",children:e}),(0,i.jsx)("span",{className:"text-muted-foreground text-xs",children:g(t)})]}),(0,i.jsx)("a",{href:v(s,a),download:e,className:"text-muted-foreground hover:text-foreground shrink-0 cursor-pointer rounded p-1.5 transition-colors","aria-label":`Download ${e}`,children:(0,i.jsx)(o.default,{className:"h-4 w-4"})})]})]})]}):(0,i.jsxs)("div",{className:"group relative flex items-center gap-2 rounded-full border py-1 pr-3 pl-2",children:[(0,i.jsx)("div",{className:(0,r.cn)("flex h-6 w-6 shrink-0 items-center justify-center rounded-full",R),children:(0,i.jsx)(C,{className:"h-3 w-3"})}),(0,i.jsx)("span",{className:"max-w-[120px] truncate text-sm",children:e}),(0,i.jsx)("span",{className:"text-muted-foreground text-xs",children:g(t)}),!j&&(0,i.jsx)("button",{type:"button",onClick:y,className:"absolute -top-1.5 -right-1.5 hidden h-5 w-5 cursor-pointer items-center justify-center rounded-full bg-black/70 text-white group-hover:flex","aria-label":`Remove ${e}`,children:(0,i.jsx)(n.X,{className:"h-3 w-3"})})]})}async function w(){let e=await fetch("/api/dialog/pick-files",{method:"POST"});if(!e.ok)throw Error("Failed to open file dialog");let t=await e.json();return t.cancelled?null:t.files}e.s(["AttachmentChip",()=>y],86254),e.s([],50032),e.s(["pickFiles",()=>w],42076)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,93752,e=>{"use strict";let t=(0,e.i(3645).default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);e.s(["default",()=>t])},95230,e=>{"use strict";let t=(0,e.i(3645).default)("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]);e.s(["default",()=>t])},16868,48306,80436,28267,86254,50032,42076,e=>{"use strict";var t=e.i(3645);let r=(0,t.default)("paperclip",[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]);e.s(["PaperclipIcon",()=>r],16868);var a=e.i(20314),s=e.i(31777);function o({className:e,...t}){return(0,a.jsx)("textarea",{"data-slot":"textarea",className:(0,s.cn)("placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input field-sizing-content min-h-[80px] w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...t})}e.s(["Textarea",()=>o],48306);var i=e.i(60253),n=e.i(15506),n=n,l=e.i(95230);e.s(["DownloadIcon",()=>l.default],80436);var l=l,d=e.i(2287),c=e.i(1693);e.s(["VisuallyHidden",0,c],28267);var c=c;let p=(0,t.default)("file",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]]);var u=e.i(16298),u=u;let h=(0,t.default)("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);var m=e.i(93752),m=m;e.i(35364);let x=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".ico",".bmp"]),f=new Set([".ts",".tsx",".js",".jsx",".json",".yaml",".yml",".xml",".html",".css",".md"]);function g(e){if(0===e)return"0 B";let t=Math.floor(Math.log(e)/Math.log(1024));return`${(e/Math.pow(1024,t)).toFixed(+(0!==t))} ${["B","KB","MB","GB"][t]}`}let b=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".ico",".bmp"]);function v(e,t){let r=new URLSearchParams({path:e,mimeType:t});return`/api/attachments/preview?${r.toString()}`}function j({name:e,size:t,mimeType:r,path:o,onRemove:j,loading:w=!1,disabled:y=!1}){let C,k,N=(C=e.lastIndexOf("."))>=0?e.slice(C).toLowerCase():"",P=x.has(N)?h:".pdf"===N?u.default:f.has(N)?m.default:p,T=".pdf"===N?"bg-red-50 text-red-600":x.has(N)?"bg-blue-50 text-blue-600":f.has(N)?"bg-emerald-50 text-emerald-600":"bg-gray-50 text-gray-600",S=(k=e.lastIndexOf("."))>=0&&b.has(e.slice(k).toLowerCase());return w?(0,a.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-md border",children:(0,a.jsx)(n.default,{className:"text-muted-foreground h-5 w-5 animate-spin"})}):S?(0,a.jsxs)(d.Dialog,{children:[(0,a.jsxs)("div",{className:"group relative",children:[(0,a.jsx)(d.DialogTrigger,{asChild:!0,children:(0,a.jsx)("img",{src:v(o,r),alt:e,title:e,className:"h-12 w-12 cursor-pointer rounded-md border object-cover transition-opacity hover:opacity-80"})}),!y&&(0,a.jsx)("button",{type:"button",onClick:j,className:"absolute -top-1.5 -right-1.5 hidden h-5 w-5 cursor-pointer items-center justify-center rounded-full bg-black/70 text-white group-hover:flex","aria-label":`Remove ${e}`,children:(0,a.jsx)(i.X,{className:"h-3 w-3"})})]}),(0,a.jsxs)(d.DialogContent,{className:"max-w-3xl gap-0 overflow-hidden border-0 p-0 [&>button:last-child]:!cursor-pointer [&>button:last-child]:!rounded-full [&>button:last-child]:!bg-black/70 [&>button:last-child]:!p-1.5 [&>button:last-child]:!text-white [&>button:last-child]:!opacity-100 [&>button:last-child]:!shadow-lg [&>button:last-child]:!backdrop-blur-md [&>button:last-child]:hover:!bg-black/90",children:[(0,a.jsx)(c.Root,{children:(0,a.jsxs)(d.DialogTitle,{children:["Preview: ",e]})}),(0,a.jsx)("div",{className:"relative bg-black/90",children:(0,a.jsx)("img",{src:v(o,r),alt:e,className:"h-auto max-h-[70vh] w-full object-contain"})}),(0,a.jsxs)("div",{className:"bg-background flex items-center gap-3 px-4 py-3",children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,a.jsx)("span",{className:"truncate text-sm font-medium",children:e}),(0,a.jsx)("span",{className:"text-muted-foreground text-xs",children:g(t)})]}),(0,a.jsx)("a",{href:v(o,r),download:e,className:"text-muted-foreground hover:text-foreground shrink-0 cursor-pointer rounded p-1.5 transition-colors","aria-label":`Download ${e}`,children:(0,a.jsx)(l.default,{className:"h-4 w-4"})})]})]})]}):(0,a.jsxs)("div",{className:"group relative flex items-center gap-2 rounded-full border py-1 pr-3 pl-2",children:[(0,a.jsx)("div",{className:(0,s.cn)("flex h-6 w-6 shrink-0 items-center justify-center rounded-full",T),children:(0,a.jsx)(P,{className:"h-3 w-3"})}),(0,a.jsx)("span",{className:"max-w-[120px] truncate text-sm",children:e}),(0,a.jsx)("span",{className:"text-muted-foreground text-xs",children:g(t)}),!y&&(0,a.jsx)("button",{type:"button",onClick:j,className:"absolute -top-1.5 -right-1.5 hidden h-5 w-5 cursor-pointer items-center justify-center rounded-full bg-black/70 text-white group-hover:flex","aria-label":`Remove ${e}`,children:(0,a.jsx)(i.X,{className:"h-3 w-3"})})]})}async function w(){let e=await fetch("/api/dialog/pick-files",{method:"POST"});if(!e.ok)throw Error("Failed to open file dialog");let t=await e.json();return t.cancelled?null:t.files}e.s(["AttachmentChip",()=>j],86254),e.s([],50032),e.s(["pickFiles",()=>w],42076)},90382,e=>{"use strict";var t=e.i(20314),r=e.i(79054),a=e.i(91967),s=e.i(5978),o=e.i(22528),i=e.i(53532),n=e.i(41687),l=e.i(56720),d=e.i(13123),c=e.i(52740),p=e.i(39979),u=e.i(85995),h=e.i(87620),m=e.i(86874),x=e.i(36589),f=e.i(73772),g=e.i(13044),b="Popover",[v,j]=(0,o.createContextScope)(b,[c.createPopperScope]),w=(0,c.createPopperScope)(),[y,C]=v(b),k=e=>{let{__scopePopover:a,children:s,open:o,defaultOpen:i,onOpenChange:n,modal:l=!1}=e,p=w(a),u=r.useRef(null),[h,m]=r.useState(!1),[f,g]=(0,x.useControllableState)({prop:o,defaultProp:i??!1,onChange:n,caller:b});return(0,t.jsx)(c.Root,{...p,children:(0,t.jsx)(y,{scope:a,contentId:(0,d.useId)(),triggerRef:u,open:f,onOpenChange:g,onOpenToggle:r.useCallback(()=>g(e=>!e),[g]),hasCustomAnchor:h,onCustomAnchorAdd:r.useCallback(()=>m(!0),[]),onCustomAnchorRemove:r.useCallback(()=>m(!1),[]),modal:l,children:s})})};k.displayName=b;var N="PopoverAnchor",P=r.forwardRef((e,a)=>{let{__scopePopover:s,...o}=e,i=C(N,s),n=w(s),{onCustomAnchorAdd:l,onCustomAnchorRemove:d}=i;return r.useEffect(()=>(l(),()=>d()),[l,d]),(0,t.jsx)(c.Anchor,{...n,...o,ref:a})});P.displayName=N;var T="PopoverTrigger",S=r.forwardRef((e,r)=>{let{__scopePopover:o,...i}=e,n=C(T,o),l=w(o),d=(0,s.useComposedRefs)(r,n.triggerRef),p=(0,t.jsx)(h.Primitive.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":q(n.open),...i,ref:d,onClick:(0,a.composeEventHandlers)(e.onClick,n.onOpenToggle)});return n.hasCustomAnchor?p:(0,t.jsx)(c.Anchor,{asChild:!0,...l,children:p})});S.displayName=T;var R="PopoverPortal",[A,E]=v(R,{forceMount:void 0}),F=e=>{let{__scopePopover:r,forceMount:a,children:s,container:o}=e,i=C(R,r);return(0,t.jsx)(A,{scope:r,forceMount:a,children:(0,t.jsx)(u.Presence,{present:a||i.open,children:(0,t.jsx)(p.Portal,{asChild:!0,container:o,children:s})})})};F.displayName=R;var D="PopoverContent",O=r.forwardRef((e,r)=>{let a=E(D,e.__scopePopover),{forceMount:s=a.forceMount,...o}=e,i=C(D,e.__scopePopover);return(0,t.jsx)(u.Presence,{present:s||i.open,children:i.modal?(0,t.jsx)(z,{...o,ref:r}):(0,t.jsx)(L,{...o,ref:r})})});O.displayName=D;var I=(0,m.createSlot)("PopoverContent.RemoveScroll"),z=r.forwardRef((e,o)=>{let i=C(D,e.__scopePopover),n=r.useRef(null),l=(0,s.useComposedRefs)(o,n),d=r.useRef(!1);return r.useEffect(()=>{let e=n.current;if(e)return(0,f.hideOthers)(e)},[]),(0,t.jsx)(g.RemoveScroll,{as:I,allowPinchZoom:!0,children:(0,t.jsx)(M,{...e,ref:l,trapFocus:i.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,a.composeEventHandlers)(e.onCloseAutoFocus,e=>{e.preventDefault(),d.current||i.triggerRef.current?.focus()}),onPointerDownOutside:(0,a.composeEventHandlers)(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;d.current=2===t.button||r},{checkForDefaultPrevented:!1}),onFocusOutside:(0,a.composeEventHandlers)(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),L=r.forwardRef((e,a)=>{let s=C(D,e.__scopePopover),o=r.useRef(!1),i=r.useRef(!1);return(0,t.jsx)(M,{...e,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(o.current||s.triggerRef.current?.focus(),t.preventDefault()),o.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(o.current=!0,"pointerdown"===t.detail.originalEvent.type&&(i.current=!0));let r=t.target;s.triggerRef.current?.contains(r)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&i.current&&t.preventDefault()}})}),M=r.forwardRef((e,r)=>{let{__scopePopover:a,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:d,disableOutsidePointerEvents:p,onEscapeKeyDown:u,onPointerDownOutside:h,onFocusOutside:m,onInteractOutside:x,...f}=e,g=C(D,a),b=w(a);return(0,n.useFocusGuards)(),(0,t.jsx)(l.FocusScope,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:o,onUnmountAutoFocus:d,children:(0,t.jsx)(i.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:p,onInteractOutside:x,onEscapeKeyDown:u,onPointerDownOutside:h,onFocusOutside:m,onDismiss:()=>g.onOpenChange(!1),children:(0,t.jsx)(c.Content,{"data-state":q(g.open),role:"dialog",id:g.contentId,...b,...f,ref:r,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),U="PopoverClose",B=r.forwardRef((e,r)=>{let{__scopePopover:s,...o}=e,i=C(U,s);return(0,t.jsx)(h.Primitive.button,{type:"button",...o,ref:r,onClick:(0,a.composeEventHandlers)(e.onClick,()=>i.onOpenChange(!1))})});B.displayName=U;var $=r.forwardRef((e,r)=>{let{__scopePopover:a,...s}=e,o=w(a);return(0,t.jsx)(c.Arrow,{...o,...s,ref:r})});function q(e){return e?"open":"closed"}$.displayName="PopoverArrow",e.s(["Anchor",()=>P,"Arrow",()=>$,"Close",()=>B,"Content",()=>O,"Popover",()=>k,"PopoverAnchor",()=>P,"PopoverArrow",()=>$,"PopoverClose",()=>B,"PopoverContent",()=>O,"PopoverPortal",()=>F,"PopoverTrigger",()=>S,"Portal",()=>F,"Root",()=>k,"Trigger",()=>S,"createPopoverScope",()=>j],89920);var H=e.i(89920),H=H,G=e.i(31777);let _=H.Root,K=H.Trigger;H.Anchor;let W=r.forwardRef(({className:e,align:r="center",sideOffset:a=4,...s},o)=>(0,t.jsx)(H.Portal,{children:(0,t.jsx)(H.Content,{ref:o,align:r,sideOffset:a,className:(0,G.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 rounded-md border p-4 shadow-md outline-none",e),...s})}));W.displayName=H.Content.displayName,e.s(["Popover",()=>_,"PopoverContent",()=>W,"PopoverTrigger",()=>K],90382)},51911,e=>{"use strict";var t=e.i(20314),r=e.i(79054),a=e.i(91967),s=e.i(5978),o=e.i(22528),i=e.i(36589),n=e.i(23405),l=e.i(77624),d=e.i(87620),c="Switch",[p,u]=(0,o.createContextScope)(c),[h,m]=p(c),x=r.forwardRef((e,o)=>{let{__scopeSwitch:n,name:l,checked:p,defaultChecked:u,required:m,disabled:x,value:f="on",onCheckedChange:g,form:j,...w}=e,[y,C]=r.useState(null),k=(0,s.useComposedRefs)(o,e=>C(e)),N=r.useRef(!1),P=!y||j||!!y.closest("form"),[T,S]=(0,i.useControllableState)({prop:p,defaultProp:u??!1,onChange:g,caller:c});return(0,t.jsxs)(h,{scope:n,checked:T,disabled:x,children:[(0,t.jsx)(d.Primitive.button,{type:"button",role:"switch","aria-checked":T,"aria-required":m,"data-state":v(T),"data-disabled":x?"":void 0,disabled:x,value:f,...w,ref:k,onClick:(0,a.composeEventHandlers)(e.onClick,e=>{S(e=>!e),P&&(N.current=e.isPropagationStopped(),N.current||e.stopPropagation())})}),P&&(0,t.jsx)(b,{control:y,bubbles:!N.current,name:l,value:f,checked:T,required:m,disabled:x,form:j,style:{transform:"translateX(-100%)"}})]})});x.displayName=c;var f="SwitchThumb",g=r.forwardRef((e,r)=>{let{__scopeSwitch:a,...s}=e,o=m(f,a);return(0,t.jsx)(d.Primitive.span,{"data-state":v(o.checked),"data-disabled":o.disabled?"":void 0,...s,ref:r})});g.displayName=f;var b=r.forwardRef(({__scopeSwitch:e,control:a,checked:o,bubbles:i=!0,...d},c)=>{let p=r.useRef(null),u=(0,s.useComposedRefs)(p,c),h=(0,n.usePrevious)(o),m=(0,l.useSize)(a);return r.useEffect(()=>{let e=p.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(h!==o&&t){let r=new Event("click",{bubbles:i});t.call(e,o),e.dispatchEvent(r)}},[h,o,i]),(0,t.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:o,...d,tabIndex:-1,ref:u,style:{...d.style,...m,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function v(e){return e?"checked":"unchecked"}b.displayName="SwitchBubbleInput",e.s(["Root",()=>x,"Switch",()=>x,"SwitchThumb",()=>g,"Thumb",()=>g,"createSwitchScope",()=>u],95291);var j=e.i(95291),j=j,w=e.i(31777);function y({className:e,size:r="default",...a}){return(0,t.jsx)(j.Root,{"data-slot":"switch","data-size":r,className:(0,w.cn)("peer group/switch focus-visible:border-ring focus-visible:ring-ring/50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input dark:data-[state=unchecked]:bg-input/80 inline-flex shrink-0 cursor-pointer items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-[1.15rem] data-[size=default]:w-8 data-[size=sm]:h-3.5 data-[size=sm]:w-6",e),...a,children:(0,t.jsx)(j.Thumb,{"data-slot":"switch-thumb",className:(0,w.cn)("bg-background dark:data-[state=checked]:bg-primary-foreground dark:data-[state=unchecked]:bg-foreground pointer-events-none block rounded-full ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}e.s(["Switch",()=>y],51911)},41413,e=>{"use strict";var t=e.i(20314),r=e.i(79054),a=e.i(23925),s=e.i(11345),o=e.i(76016),i=e.i(75239),n=e.i(16195),l=e.i(86782),d=e.i(29847),c=e.i(35364),p=e.i(90382),u=e.i(31777);function h({initialAgentType:e,initialModel:h,onAgentModelChange:m,disabled:x,className:f,mode:g}){let[b,v]=r.useState(!1),[j,w]=r.useState([]),[y,C]=r.useState(!0),[k,N]=r.useState(e),[P,T]=r.useState(h),[S,R]=r.useState(null),[A,E]=r.useState(0),[F,D]=r.useState(null);r.useEffect(()=>{(0,i.getAllAgentModels)().then(w).finally(()=>C(!1))},[]),r.useEffect(()=>{if(!b){let e=setTimeout(()=>{E(0),D(null)},150);return()=>clearTimeout(e)}},[b]);let O=async(e,t)=>{if(v(!1),e!==k||t!==P){if("override"===g){N(e),T(t),m?.(e,t);return}N(e),T(t),m?.(e,t),R(null);try{let r=await (0,n.updateAgentAndModel)(e,t||null);r.ok||(N(k),T(P),m?.(k,P),R(r.error??"Failed to save"))}catch{N(k),T(P),m?.(k,P),R("Failed to save")}}},I=(0,l.getAgentTypeIcon)(k),z=j.find(e=>e.agentType===k)?.label??k,L=P?(0,d.getModelMeta)(P).displayName||P:null,M=F?j.find(e=>e.agentType===F):null;return(0,t.jsxs)("div",{className:(0,u.cn)("flex flex-col gap-1",f),children:[(0,t.jsxs)(p.Popover,{open:b,onOpenChange:v,children:[(0,t.jsx)(p.PopoverTrigger,{asChild:!0,children:(0,t.jsx)(c.Button,{variant:"outline",role:"combobox","aria-expanded":b,disabled:(x??!1)||y,className:"w-auto cursor-pointer justify-start font-normal hover:border-violet-300 hover:bg-violet-50/50 dark:hover:border-violet-700 dark:hover:bg-violet-950/30",children:(0,t.jsxs)("span",{className:"flex items-center gap-2 truncate",children:[(0,t.jsx)(I,{className:"h-4 w-4 shrink-0"}),y?"Loading…":(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:z}),L?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-muted-foreground/50 text-xs",children:"·"}),(0,t.jsx)("span",{className:"text-xs font-medium",children:L})]}):null]})]})})}),(0,t.jsx)(p.PopoverContent,{className:"w-(--radix-popover-trigger-width) overflow-hidden p-0",align:"start",children:(0,t.jsxs)("div",{className:"flex transition-transform duration-200 ease-in-out",style:{transform:`translateX(${1===A?"-50%":"0%"})`,width:"200%"},children:[(0,t.jsxs)("div",{className:"w-1/2 shrink-0",children:[(0,t.jsx)("div",{className:"text-muted-foreground border-b px-3 py-2 text-xs font-medium",children:"Select agent"}),j.map(e=>{let r=(0,l.getAgentTypeIcon)(e.agentType),s=k===e.agentType,i=e.models.length>0;return(0,t.jsxs)("button",{type:"button",className:(0,u.cn)("flex w-full cursor-pointer items-center gap-2.5 px-3 py-2 text-xs transition-colors","hover:bg-accent hover:text-accent-foreground",s&&"bg-accent/50"),onClick:()=>{i?(D(e.agentType),requestAnimationFrame(()=>{requestAnimationFrame(()=>E(1))})):O(e.agentType,"")},children:[(0,t.jsx)(r,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{className:"flex-1 text-left",children:e.label}),s&&!i?(0,t.jsx)(a.Check,{className:"text-primary h-3.5 w-3.5 shrink-0"}):null,i?(0,t.jsx)(o.ChevronRight,{className:"text-muted-foreground h-3.5 w-3.5 shrink-0"}):null]},e.agentType)})]}),(0,t.jsx)("div",{className:"w-1/2 shrink-0",children:M?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{type:"button",className:"text-muted-foreground hover:text-foreground flex w-full cursor-pointer items-center gap-1.5 border-b px-3 py-2 text-xs font-medium transition-colors",onClick:()=>{E(0),setTimeout(()=>D(null),220)},children:[(0,t.jsx)(s.ChevronLeft,{className:"h-3.5 w-3.5"}),M.label]}),M.models.map(e=>{let r=k===M.agentType&&P===e.id;return(0,t.jsxs)("button",{type:"button",className:(0,u.cn)("flex w-full cursor-pointer items-center gap-3 px-3 py-2 text-left transition-colors","hover:bg-accent hover:text-accent-foreground",r&&"bg-accent/50"),onClick:()=>O(M.agentType,e.id),children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,t.jsx)("span",{className:"text-xs font-medium",children:e.displayName}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:e.description})]}),r?(0,t.jsx)(a.Check,{className:"text-primary h-3.5 w-3.5 shrink-0"}):null]},e.id)})]}):null})]})})]}),!!S&&(0,t.jsx)("p",{className:"text-destructive text-sm",children:S})]})}e.s(["AgentModelPicker",()=>h])},15203,e=>{"use strict";var t=e.i(20314),r=e.i(79054),a=e.i(31406),s=e.i(60112),o=e.i(21023);let i=(0,o.createServerReference)("4055ab72684d6ed419e7392b4115069abe70ef493d",o.callServer,void 0,o.findSourceMapURL,"createFeature");var n=e.i(16868);let l=(0,e.i(3645).default)("chevrons-up-down",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);var d=e.i(97667),c=e.i(53360),p=e.i(91925),u=e.i(83428),h=e.i(31777),m=e.i(8361);e.i(1650);var x=e.i(11495),f=e.i(45811),g=e.i(35364),b=e.i(98127),v=e.i(48306),j=e.i(41957),w=e.i(81846),y=e.i(90382),C=e.i(51911),k=e.i(2828),N=e.i(30153);e.i(50032);var P=e.i(86254),T=e.i(41413),S=e.i(25235),R=e.i(78521),A=e.i(43908),E=e.i(42076);let F=new Set([".png",".jpg",".jpeg",".gif",".webp",".svg",".bmp",".ico",".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".txt",".md",".csv",".json",".yaml",".yml",".xml",".ts",".tsx",".js",".jsx",".py",".rb",".go",".rs",".java",".c",".cpp",".h",".hpp",".cs",".swift",".kt",".html",".css",".scss",".less",".sh",".bash",".zsh",".fish",".toml",".ini",".cfg",".conf",".env",".zip",".tar",".gz",".log"]),D=[{id:"allowPrd",label:"PRD",description:"Auto-approve requirements move to planning."},{id:"allowPlan",label:"Plan",description:"Auto-approve planning move to implementation."},{id:"allowMerge",label:"Merge",description:"Auto-approve merge move to Done."}],O={allowPrd:!1,allowPlan:!1,allowMerge:!1};function I({open:e,onClose:a,onSubmit:s,repositoryPath:o,isSubmitting:i=!1,workflowDefaults:l,features:d,repositories:p,initialParentId:u,currentAgentType:b,currentModel:y}){let S=(0,m.useSoundAction)("create"),R=l?.approvalGates??O,A=l?.push??!1,I=l?.openPr??!1,M=l?.ciWatchEnabled!==!1,U=l?.enableEvidence??!1,B=l?.commitEvidence??!1,[$,q]=(0,r.useState)(""),[H,G]=(0,r.useState)([]),[_,K]=(0,r.useState)({...R}),[W,V]=(0,r.useState)(A),[X,Y]=(0,r.useState)(I),[Z,J]=(0,r.useState)(l?.ciWatchEnabled!==!1),[Q,ee]=(0,r.useState)(U),[et,er]=(0,r.useState)(B),[ea,es]=(0,r.useState)(void 0),[eo,ei]=(0,r.useState)(!1),[en,el]=(0,r.useState)(void 0),[ed,ec]=(0,r.useState)(void 0),[ep,eu]=(0,r.useState)(o||void 0),[eh,em]=(0,r.useState)(p??[]),[ex,ef]=(0,r.useState)(!1),[eg,eb]=(0,r.useState)(null),[ev,ej]=(0,r.useState)(!1),ew=(0,r.useRef)(crypto.randomUUID()),ey=(0,r.useRef)(0),eC=(0,r.useRef)(null);(0,r.useEffect)(()=>{l&&(K({...l.approvalGates}),V(l.push),Y(l.openPr),J(!1!==l.ciWatchEnabled),ee(l.enableEvidence),er(l.commitEvidence))},[l]),(0,r.useEffect)(()=>{em(p??[])},[p]),(0,r.useEffect)(()=>{e&&u&&es(u)},[e,u]);let ek=(0,r.useCallback)(()=>{q(""),G([]),K({...R}),V(A),Y(I),J(M),ee(U),er(B),es(void 0),eu(o||void 0),em(p??[]),ei(!1),el(void 0),ec(void 0),eb(null),ey.current=0,ef(!1)},[R,A,I,U,M,B,o,p]),eN=""!==$.trim()||H.length>0,{attemptClose:eP}=(0,N.useGuardedDrawerClose)({open:e,isDirty:eN,onClose:a,onReset:ek}),eT=(0,r.useCallback)(async e=>{for(let t of(eb(null),e)){if(t.size>0xa00000)return void eb(`"${t.name}" exceeds 10 MB limit`);let e=function(e){let t=e.lastIndexOf(".");return t>=0?e.slice(t).toLowerCase():""}(t.name);if(e&&!F.has(e))return void eb(`File type "${e}" is not allowed`)}for(let t of e){let e=crypto.randomUUID();G(r=>[...r,{id:e,name:t.name,size:t.size,mimeType:t.type||"application/octet-stream",path:"",loading:!0}]);try{let r=new FormData;r.append("file",t),r.append("sessionId",ew.current);let a=await fetch("/api/attachments/upload",{method:"POST",body:r});if(!a.ok){let t=await a.json().catch(()=>({error:"Upload failed"}));G(t=>t.filter(t=>t.id!==e)),eb(t.error??"Upload failed");return}let s=await a.json();G(t=>t.some(t=>t.id!==e&&t.path===s.path)?t.filter(t=>t.id!==e):t.map(t=>t.id===e?{...s,id:e,loading:!1}:t))}catch{G(t=>t.filter(t=>t.id!==e)),eb("Upload failed")}}},[]),eS=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),ey.current+=1,1===ey.current&&ef(!0)},[]),eR=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),ey.current-=1,0===ey.current&&ef(!1)},[]),eA=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation()},[]),eE=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),ey.current=0,ef(!1);let t=Array.from(e.dataTransfer.files);t.length>0&&eT(t)},[eT]),eF=(0,r.useCallback)(e=>{let t=e.clipboardData?.items;if(!t)return;let r=[];for(let e of Array.from(t))if("file"===e.kind){let t=e.getAsFile();t&&r.push(t)}r.length>0&&(e.preventDefault(),eT(r))},[eT]),eD=(0,r.useCallback)(e=>{if(e.preventDefault(),!$.trim())return;let t=ep??o;t&&(S.play(),s({description:$.trim(),attachments:H.filter(e=>!e.loading),repositoryPath:t,approvalGates:{allowPrd:_.allowPrd??!1,allowPlan:_.allowPlan??!1,allowMerge:_.allowMerge??!1},push:W||X,openPr:X,ciWatchEnabled:Z,enableEvidence:Q,commitEvidence:et,fast:eo,...en?{agentType:en}:{},...ed?{model:ed}:{},...ea?{parentId:ea}:{},sessionId:ew.current}),ek())},[$,H,_,ep,o,s,W,X,Q,Z,et,eo,en,ed,ea,S,ek]),eO=(0,r.useCallback)(async()=>{try{let e=await (0,E.pickFiles)();if(!e)return;for(let t of e){let e=crypto.randomUUID();G(r=>[...r,{id:e,name:t.name,size:t.size,mimeType:"application/octet-stream",path:"",loading:!0}]);try{let r=await fetch("/api/attachments/upload-from-path",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:t.path,sessionId:ew.current})});if(!r.ok){let t=await r.json().catch(()=>({error:"Upload failed"}));G(t=>t.filter(t=>t.id!==e)),eb(t.error??"Upload failed");return}let a=await r.json();G(t=>t.some(t=>t.id!==e&&t.path===a.path)?t.filter(t=>t.id!==e):t.map(t=>t.id===e?{...a,id:e,loading:!1}:t))}catch{G(t=>t.filter(t=>t.id!==e)),eb("Upload failed")}}}catch{}},[]),eI=(0,r.useCallback)(e=>{G(t=>t.filter(t=>t.id!==e))},[]),ez=(0,r.useRef)(null),eL=(0,r.useCallback)(e=>{(e.ctrlKey||e.metaKey)&&"Enter"===e.key&&(e.preventDefault(),ez.current?.requestSubmit())},[]),eM=(0,r.useCallback)(()=>{ej(!0)},[]),eU=(0,r.useCallback)(()=>{setTimeout(()=>{let e=eC.current?.contains(document.activeElement),t=eC.current?.querySelector('[aria-expanded="true"]')!==null;e||t||ej(!1)},0)},[]),eB=d&&d.length>0,e$=!o&&!ep,eq=!o&&void 0!==p;return(0,t.jsx)(x.BaseDrawer,{open:e,onClose:eP,size:"md",modal:!1,dismissOnOutsideClick:!0,"data-testid":"feature-create-drawer",header:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"h-2.5 w-2.5 shrink-0 rounded-full bg-blue-500"}),(0,t.jsx)(f.DrawerTitle,{children:"NEW FEATURE"})]}),i?(0,t.jsx)(f.DrawerDescription,{asChild:!0,children:(0,t.jsx)("div",{children:(0,t.jsx)(w.Badge,{variant:"secondary",children:"Creating..."})})}):null]}),footer:(0,t.jsxs)("div",{className:"flex flex-row justify-end gap-2",children:[(0,t.jsx)(g.Button,{variant:"outline",onClick:eP,disabled:i,children:"Cancel"}),(0,t.jsx)(g.Button,{type:"submit",form:"create-feature-form",disabled:!$.trim()||i||e$,children:i?"Creating...":"+ Create Feature"})]}),children:(0,t.jsx)("div",{className:"overflow-y-auto p-4",children:(0,t.jsx)(k.TooltipProvider,{delayDuration:400,children:(0,t.jsxs)("form",{ref:ez,id:"create-feature-form",onSubmit:eD,onKeyDown:eL,className:"flex flex-col gap-4",children:[eq?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"repo-selector-section",children:[(0,t.jsx)(j.Label,{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"REPOSITORY"}),(0,t.jsx)(L,{repositories:eh,value:ep,onChange:eu,onAddRepository:e=>{em(t=>[...t,e]),eu(e.path)},disabled:i})]}):o?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"repo-readonly-section",children:[(0,t.jsx)(j.Label,{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"REPOSITORY"}),(0,t.jsx)("p",{className:"text-sm","data-testid":"repo-readonly-label",children:p?.find(e=>e.path===o)?.name??o.split("/").pop()})]}):null,(0,t.jsxs)("div",{role:"region","aria-label":"File drop zone","data-drag-over":ex?"true":"false",onDragEnter:eS,onDragLeave:eR,onDragOver:eA,onDrop:eE,className:(0,h.cn)("flex flex-col gap-1.5 rounded-md border-2 border-transparent p-1 transition-colors",ex&&"border-primary/50 bg-primary/5"),children:[(0,t.jsx)(j.Label,{htmlFor:"feature-description",className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"DESCRIBE YOUR FEATURE"}),(0,t.jsxs)("div",{ref:eC,onFocus:eM,onBlur:eU,className:(0,h.cn)("border-input flex h-56 flex-col overflow-hidden rounded-md border shadow-xs transition-[color,box-shadow]",ev&&"ring-ring/50 border-ring ring-[3px]"),children:[(0,t.jsx)(v.Textarea,{id:"feature-description",placeholder:"e.g. Add GitHub OAuth login with callback handling and token refresh...",value:$,onChange:e=>q(e.target.value),onPaste:eF,required:!0,disabled:i,className:"min-h-0 flex-1 resize-none rounded-none border-0 shadow-none focus-visible:ring-0"}),H.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-1.5 px-3 py-2",children:H.map(e=>(0,t.jsx)(P.AttachmentChip,{name:e.name,size:e.size,mimeType:e.mimeType,path:e.path,onRemove:()=>eI(e.id),disabled:i,loading:e.loading},e.id))}),eg?(0,t.jsx)("p",{className:"text-destructive px-3 pb-2 text-xs",children:eg}):null,(0,t.jsxs)("div",{className:"border-input flex items-center gap-3 border-t px-3 py-1.5",children:[(0,t.jsx)(T.AgentModelPicker,{initialAgentType:en??b??"claude-code",initialModel:ed??y??"claude-sonnet-4-6",mode:"override",onAgentModelChange:(e,t)=>{el(e),ec(t)},disabled:i,className:"w-55"}),(0,t.jsxs)(k.Tooltip,{children:[(0,t.jsx)(k.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"ml-auto flex cursor-pointer items-center gap-2",children:[(0,t.jsx)(C.Switch,{id:"fast-mode",checked:eo,onCheckedChange:ei,disabled:i}),(0,t.jsxs)(j.Label,{htmlFor:"fast-mode",className:"flex cursor-pointer items-center gap-1 text-sm font-medium",children:[(0,t.jsx)(c.Zap,{className:"h-3.5 w-3.5"}),"Fast Mode"]})]})}),(0,t.jsx)(k.TooltipContent,{side:"bottom",children:"Skip SDLC phases and implement directly from your prompt."})]}),(0,t.jsxs)(k.Tooltip,{children:[(0,t.jsx)(k.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",onClick:eO,disabled:i,"aria-label":"Attach files",className:"text-muted-foreground hover:text-foreground cursor-pointer rounded p-1 transition-colors",children:(0,t.jsx)(n.PaperclipIcon,{className:"h-4 w-4"})})}),(0,t.jsx)(k.TooltipContent,{side:"bottom",children:"Attach files"})]})]})]})]}),eB&&void 0!==u?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)(j.Label,{htmlFor:"parent-feature",className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"PARENT FEATURE"}),(0,t.jsx)(z,{features:d,value:ea,onChange:es,disabled:i})]}):null,(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsxs)("div",{className:"border-input flex items-center gap-4 rounded-md border px-3 py-2.5",children:[(0,t.jsxs)(k.Tooltip,{children:[(0,t.jsx)(k.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 cursor-default text-xs font-semibold tracking-wider",children:"APPROVE"})}),(0,t.jsx)(k.TooltipContent,{side:"bottom",children:"Auto-approve phase transitions without manual review."})]}),(0,t.jsx)("div",{className:"flex flex-1 items-center gap-4",children:D.map(e=>(0,t.jsxs)(k.Tooltip,{children:[(0,t.jsx)(k.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(C.Switch,{id:`approve-${e.id}`,size:"sm",checked:_[e.id]??!1,onCheckedChange:t=>K(r=>({...r,[e.id]:t})),disabled:i||eo&&("allowPrd"===e.id||"allowPlan"===e.id)}),(0,t.jsx)(j.Label,{htmlFor:`approve-${e.id}`,className:"cursor-pointer text-xs font-medium",children:e.label})]})}),(0,t.jsx)(k.TooltipContent,{side:"bottom",children:eo&&("allowPrd"===e.id||"allowPlan"===e.id)?"Skipped in Fast Mode":e.description})]},e.id))}),(0,t.jsxs)(k.Tooltip,{children:[(0,t.jsx)(k.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",onClick:()=>{let e=D.every(e=>_[e.id]),t={};for(let r of D)t[r.id]=!e;K(t)},disabled:i,className:(0,h.cn)("text-muted-foreground hover:text-foreground cursor-pointer rounded px-1.5 py-0.5 text-[10px] font-semibold tracking-wider uppercase transition-colors",D.every(e=>_[e.id])&&"text-primary"),children:"All"})}),(0,t.jsx)(k.TooltipContent,{side:"bottom",children:"Toggle all approval gates"})]})]}),(0,t.jsxs)("div",{className:"border-input flex items-center gap-4 rounded-md border px-3 py-2.5",children:[(0,t.jsxs)(k.Tooltip,{children:[(0,t.jsx)(k.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 cursor-default text-xs font-semibold tracking-wider",children:"EVIDENCE"})}),(0,t.jsx)(k.TooltipContent,{side:"bottom",children:"Collect and attach evidence after implementation."})]}),(0,t.jsxs)("div",{className:"flex flex-1 items-center gap-4",children:[(0,t.jsxs)(k.Tooltip,{children:[(0,t.jsx)(k.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(C.Switch,{id:"enable-evidence",size:"sm",checked:Q,onCheckedChange:e=>{ee(e),e||er(!1)},disabled:i}),(0,t.jsx)(j.Label,{htmlFor:"enable-evidence",className:"cursor-pointer text-xs font-medium",children:"Collect"})]})}),(0,t.jsx)(k.TooltipContent,{side:"bottom",children:"Capture screenshots and artifacts after implementation."})]}),(0,t.jsxs)(k.Tooltip,{children:[(0,t.jsx)(k.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(C.Switch,{id:"commit-evidence",size:"sm",checked:et,onCheckedChange:er,disabled:i||!Q||!X}),(0,t.jsx)(j.Label,{htmlFor:"commit-evidence",className:(0,h.cn)("cursor-pointer text-xs font-medium",(!Q||!X)&&"opacity-50"),children:"Add to PR"})]})}),(0,t.jsx)(k.TooltipContent,{side:"bottom",children:X?Q?"Include evidence in the pull request body.":"Requires evidence collection to be enabled":"Requires PR to be enabled"})]})]})]}),(0,t.jsxs)("div",{className:"border-input flex items-center gap-4 rounded-md border px-3 py-2.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 text-xs font-semibold tracking-wider",children:"GIT"}),(0,t.jsxs)("div",{className:"flex flex-1 items-center gap-4",children:[(0,t.jsxs)(k.Tooltip,{children:[(0,t.jsx)(k.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(C.Switch,{id:"push",size:"sm",checked:W||X,onCheckedChange:e=>{V(e),!e&&X&&Y(!1)},disabled:i}),(0,t.jsx)(j.Label,{htmlFor:"push",className:"cursor-pointer text-xs font-medium",children:"Push"})]})}),(0,t.jsx)(k.TooltipContent,{side:"bottom",children:"Push branch to remote after implementation."})]}),(0,t.jsxs)(k.Tooltip,{children:[(0,t.jsx)(k.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(C.Switch,{id:"open-pr",size:"sm",checked:X,onCheckedChange:e=>{Y(e),e||er(!1)},disabled:i}),(0,t.jsx)(j.Label,{htmlFor:"open-pr",className:"cursor-pointer text-xs font-medium",children:"PR"})]})}),(0,t.jsx)(k.TooltipContent,{side:"bottom",children:"Open a pull request after pushing."})]}),(0,t.jsxs)(k.Tooltip,{children:[(0,t.jsx)(k.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(C.Switch,{id:"ci-watch",size:"sm",checked:Z,onCheckedChange:J,disabled:i}),(0,t.jsx)(j.Label,{htmlFor:"ci-watch",className:"cursor-pointer text-xs font-medium",children:"Watch"})]})}),(0,t.jsx)(k.TooltipContent,{side:"bottom",children:"Watch CI and auto-fix after push."})]})]})]})]})]})})})})}function z({features:e,value:a,onChange:s,disabled:o}){let[i,n]=(0,r.useState)(!1),[c,p]=(0,r.useState)(""),u=(0,r.useRef)(null),m=e.find(e=>e.id===a),x=c.trim()?e.filter(e=>e.name.toLowerCase().includes(c.toLowerCase())||e.id.toLowerCase().includes(c.toLowerCase())):e,f=(0,r.useCallback)(e=>{s(e),n(!1),p("")},[s]);return(0,r.useEffect)(()=>{i?setTimeout(()=>u.current?.focus(),0):p("")},[i]),(0,t.jsxs)(y.Popover,{open:i,onOpenChange:n,children:[(0,t.jsx)(y.PopoverTrigger,{asChild:!0,children:(0,t.jsxs)("button",{id:"parent-feature",type:"button",role:"combobox","aria-expanded":i,"aria-label":"Parent Feature",disabled:o,"data-testid":"parent-feature-combobox",className:(0,h.cn)("border-input bg-background ring-offset-background focus:ring-ring flex h-9 w-full items-center justify-between rounded-md border px-3 py-2 text-sm focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",!m&&"text-muted-foreground"),children:[(0,t.jsx)("span",{className:"truncate",children:m?`${m.name} (${m.id.slice(0,8)})`:"Select parent feature..."}),(0,t.jsx)(l,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,t.jsx)(y.PopoverContent,{className:"w-80 p-0",align:"start","data-testid":"parent-feature-combobox-content",children:(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("div",{className:"border-b p-2",children:(0,t.jsx)(b.Input,{ref:u,placeholder:"Search features...",value:c,onChange:e=>p(e.target.value),className:"h-8 border-0 p-0 text-sm shadow-none focus-visible:ring-0","data-testid":"parent-feature-search"})}),(0,t.jsxs)("div",{className:"max-h-48 overflow-y-auto py-1",role:"listbox","aria-label":"Features",children:[(0,t.jsxs)("button",{type:"button",role:"option","aria-selected":void 0===a,onClick:()=>f(void 0),className:(0,h.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",void 0===a&&"bg-accent/50"),"data-testid":"parent-feature-option-none",children:[(0,t.jsx)(d.CheckIcon,{className:(0,h.cn)("h-4 w-4 shrink-0",void 0!==a&&"invisible")}),(0,t.jsx)("span",{className:"text-muted-foreground italic",children:"No parent"})]}),0===x.length&&c?(0,t.jsx)("p",{className:"text-muted-foreground px-3 py-2 text-sm",children:"No features found."}):x.map(e=>(0,t.jsxs)("button",{type:"button",role:"option","aria-selected":a===e.id,onClick:()=>f(e.id),className:(0,h.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",a===e.id&&"bg-accent/50"),"data-testid":`parent-feature-option-${e.id}`,children:[(0,t.jsx)(d.CheckIcon,{className:(0,h.cn)("h-4 w-4 shrink-0",a!==e.id&&"invisible")}),(0,t.jsxs)("span",{className:"truncate",children:[e.name," ",(0,t.jsxs)("span",{className:"text-muted-foreground font-mono text-xs",children:["(",e.id.slice(0,8),")"]})]})]},e.id))]})]})})]})}function L({repositories:e,value:a,onChange:s,onAddRepository:o,disabled:i}){let[n,c]=(0,r.useState)(!1),[m,x]=(0,r.useState)(""),[f,g]=(0,r.useState)(!1),[v,j]=(0,r.useState)(null),w=(0,r.useRef)(null),C=e.find(e=>e.path===a),k=m.trim()?e.filter(e=>e.name.toLowerCase().includes(m.toLowerCase())||e.path.toLowerCase().includes(m.toLowerCase())):e,N=(0,r.useCallback)(e=>{s(e),c(!1),x("")},[s]),P=(0,r.useCallback)(async()=>{if(!f){g(!0),j(null);try{let e=await (0,R.pickFolder)();if(!e)return void g(!1);let t=await (0,A.addRepository)({path:e});if(t.error){j(t.error),g(!1);return}if(t.repository){let e={id:t.repository.id,name:t.repository.name,path:t.repository.path};o?.(e),s(e.path),c(!1),x("")}}catch(e){j(e instanceof Error?e.message:"Failed to add repository")}finally{g(!1)}}},[f,o,s]);return(0,r.useEffect)(()=>{n?setTimeout(()=>w.current?.focus(),0):x("")},[n]),(0,t.jsxs)(y.Popover,{open:n,onOpenChange:c,children:[(0,t.jsx)(y.PopoverTrigger,{asChild:!0,children:(0,t.jsxs)("button",{type:"button",role:"combobox","aria-expanded":n,"aria-label":"Repository",disabled:i,"data-testid":"repository-combobox",className:(0,h.cn)("border-input bg-background ring-offset-background focus:ring-ring flex h-9 w-full items-center justify-between rounded-md border px-3 py-2 text-sm focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",!C&&"text-muted-foreground"),children:[(0,t.jsx)("span",{className:"truncate",children:C?C.name:"Select repository..."}),(0,t.jsx)(l,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,t.jsx)(y.PopoverContent,{className:"w-80 p-0",align:"start","data-testid":"repository-combobox-content",children:(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("div",{className:"border-b p-2",children:(0,t.jsx)(b.Input,{ref:w,placeholder:"Search repositories...",value:m,onChange:e=>x(e.target.value),className:"h-8 border-0 p-0 text-sm shadow-none focus-visible:ring-0","data-testid":"repository-search"})}),(0,t.jsx)("div",{className:"max-h-48 overflow-y-auto py-1",role:"listbox","aria-label":"Repositories",children:0===k.length?(0,t.jsx)("p",{className:"text-muted-foreground px-3 py-2 text-sm","data-testid":"repository-empty",children:"No repositories found."}):k.map(e=>(0,t.jsxs)("button",{type:"button",role:"option","aria-selected":a===e.path,onClick:()=>N(e.path),className:(0,h.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",a===e.path&&"bg-accent/50"),"data-testid":`repository-option-${e.id}`,children:[(0,t.jsx)(d.CheckIcon,{className:(0,h.cn)("h-4 w-4 shrink-0",a!==e.path&&"invisible")}),(0,t.jsxs)("span",{className:"flex flex-col items-start truncate",children:[(0,t.jsx)("span",{className:"truncate",children:e.name}),(0,t.jsx)("span",{className:"text-muted-foreground truncate text-xs",children:e.path})]})]},e.id))}),(0,t.jsx)(S.Separator,{}),(0,t.jsxs)("button",{type:"button",onClick:P,disabled:f,className:"hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm","data-testid":"add-repository-item",children:[f?(0,t.jsx)(u.Loader2,{className:"h-4 w-4 shrink-0 animate-spin"}):(0,t.jsx)(p.FolderPlus,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{children:"Add new repository..."})]}),v?(0,t.jsx)("p",{className:"px-3 pb-2 text-xs text-red-500","data-testid":"add-repository-error",children:v}):null]})})]})}function M({repositoryPath:e,initialParentId:o,features:n,repositories:l,workflowDefaults:d,currentAgentType:c,currentModel:p}){let u=(0,a.useRouter)(),[h,m]=(0,r.useState)(!1),x=(0,a.usePathname)().startsWith("/create"),f=!h&&x;(0,r.useEffect)(()=>{!x&&h&&m(!1)},[x,h]);let g=(0,r.useCallback)(()=>{u.push("/")},[u]),b=(0,r.useCallback)(e=>{m(!0),u.push("/"),i(e).then(t=>{t.error?s.toast.error(t.error):window.dispatchEvent(new CustomEvent("shep:feature-created",{detail:{featureId:t.feature.id,name:t.feature.name,description:t.feature.description,repositoryPath:t.feature.repositoryPath,parentId:e.parentId}}))}).catch(()=>{s.toast.error("Failed to create feature"),m(!1)})},[u]);return(0,t.jsx)(I,{open:f,onClose:g,onSubmit:b,repositoryPath:e,features:n,repositories:l,workflowDefaults:d,initialParentId:o,isSubmitting:h,currentAgentType:c,currentModel:p})}e.s(["CreateDrawerClient",()=>M],15203)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,81181,e=>{"use strict";var t=e.i(95230);e.s(["Download",()=>t.default])},49228,e=>{"use strict";let t=(0,e.i(3645).default)("git-branch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);e.s(["GitBranch",()=>t],49228)},38573,e=>{"use strict";let t=(0,e.i(3645).default)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);e.s(["Terminal",()=>t],38573)},30702,e=>{"use strict";let t=(0,e.i(3645).default)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);e.s(["ExternalLink",()=>t],30702)},81846,e=>{"use strict";var t=e.i(20314),s=e.i(94237),r=e.i(31777);let a=(0,s.cva)("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-none",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function i({className:e,variant:s,...i}){return(0,t.jsx)("div",{className:(0,r.cn)(a({variant:s}),e),...i})}e.s(["Badge",()=>i])},95230,e=>{"use strict";let t=(0,e.i(3645).default)("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]);e.s(["default",()=>t])},68304,e=>{"use strict";var t=e.i(20314),s=e.i(79054),r=e.i(91967),a=e.i(22528),i=e.i(51080),l=e.i(85995),n=e.i(87620),o=e.i(66033),c=e.i(36589),d=e.i(13123),u="Tabs",[m,f]=(0,a.createContextScope)(u,[i.createRovingFocusGroupScope]),h=(0,i.createRovingFocusGroupScope)(),[x,p]=m(u),g=s.forwardRef((e,s)=>{let{__scopeTabs:r,value:a,onValueChange:i,defaultValue:l,orientation:m="horizontal",dir:f,activationMode:h="automatic",...p}=e,g=(0,o.useDirection)(f),[v,b]=(0,c.useControllableState)({prop:a,onChange:i,defaultProp:l??"",caller:u});return(0,t.jsx)(x,{scope:r,baseId:(0,d.useId)(),value:v,onValueChange:b,orientation:m,dir:g,activationMode:h,children:(0,t.jsx)(n.Primitive.div,{dir:g,"data-orientation":m,...p,ref:s})})});g.displayName=u;var v="TabsList",b=s.forwardRef((e,s)=>{let{__scopeTabs:r,loop:a=!0,...l}=e,o=p(v,r),c=h(r);return(0,t.jsx)(i.Root,{asChild:!0,...c,orientation:o.orientation,dir:o.dir,loop:a,children:(0,t.jsx)(n.Primitive.div,{role:"tablist","aria-orientation":o.orientation,...l,ref:s})})});b.displayName=v;var y="TabsTrigger",j=s.forwardRef((e,s)=>{let{__scopeTabs:a,value:l,disabled:o=!1,...c}=e,d=p(y,a),u=h(a),m=N(d.baseId,l),f=C(d.baseId,l),x=l===d.value;return(0,t.jsx)(i.Item,{asChild:!0,...u,focusable:!o,active:x,children:(0,t.jsx)(n.Primitive.button,{type:"button",role:"tab","aria-selected":x,"aria-controls":f,"data-state":x?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:m,...c,ref:s,onMouseDown:(0,r.composeEventHandlers)(e.onMouseDown,e=>{o||0!==e.button||!1!==e.ctrlKey?e.preventDefault():d.onValueChange(l)}),onKeyDown:(0,r.composeEventHandlers)(e.onKeyDown,e=>{[" ","Enter"].includes(e.key)&&d.onValueChange(l)}),onFocus:(0,r.composeEventHandlers)(e.onFocus,()=>{let e="manual"!==d.activationMode;x||o||!e||d.onValueChange(l)})})})});j.displayName=y;var k="TabsContent",w=s.forwardRef((e,r)=>{let{__scopeTabs:a,value:i,forceMount:o,children:c,...d}=e,u=p(k,a),m=N(u.baseId,i),f=C(u.baseId,i),h=i===u.value,x=s.useRef(h);return s.useEffect(()=>{let e=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,t.jsx)(l.Presence,{present:o||h,children:({present:s})=>(0,t.jsx)(n.Primitive.div,{"data-state":h?"active":"inactive","data-orientation":u.orientation,role:"tabpanel","aria-labelledby":m,hidden:!s,id:f,tabIndex:0,...d,ref:r,style:{...e.style,animationDuration:x.current?"0s":void 0},children:s&&c})})});function N(e,t){return`${e}-trigger-${t}`}function C(e,t){return`${e}-content-${t}`}w.displayName=k,e.s(["Content",()=>w,"List",()=>b,"Root",()=>g,"Tabs",()=>g,"TabsContent",()=>w,"TabsList",()=>b,"TabsTrigger",()=>j,"Trigger",()=>j,"createTabsScope",()=>f],43133);var T=e.i(43133),T=T,R=e.i(31777);let S=T.Root,I=s.forwardRef(({className:e,...s},r)=>(0,t.jsx)(T.List,{ref:r,className:(0,R.cn)("bg-muted text-muted-foreground inline-flex h-9 items-center justify-center rounded-lg p-1",e),...s}));I.displayName=T.List.displayName;let A=s.forwardRef(({className:e,...s},r)=>(0,t.jsx)(T.Trigger,{ref:r,className:(0,R.cn)("ring-offset-background focus-visible:ring-ring data-[state=active]:bg-background data-[state=active]:text-foreground inline-flex items-center justify-center rounded-md px-3 py-1 text-sm font-medium whitespace-nowrap transition-all focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow",e),...s}));A.displayName=T.Trigger.displayName;let z=s.forwardRef(({className:e,...s},r)=>(0,t.jsx)(T.Content,{ref:r,className:(0,R.cn)("ring-offset-background focus-visible:ring-ring mt-2 focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none",e),...s}));z.displayName=T.Content.displayName,e.s(["Tabs",()=>S,"TabsContent",()=>z,"TabsList",()=>I,"TabsTrigger",()=>A],68304)},95812,35e3,e=>{"use strict";let t=(0,e.i(3645).default)("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);e.s(["Circle",()=>t],95812);var s=e.i(80986);e.s(["CheckCircle2",()=>s.default],35e3)},33548,e=>{"use strict";let t=(0,e.i(3645).default)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);e.s(["Copy",()=>t],33548)},51080,e=>{"use strict";var t=e.i(79054),s=e.i(91967),r=e.i(87342),a=e.i(5978),i=e.i(22528),l=e.i(13123),n=e.i(87620),o=e.i(29297),c=e.i(36589),d=e.i(66033),u=e.i(20314),m="rovingFocusGroup.onEntryFocus",f={bubbles:!1,cancelable:!0},h="RovingFocusGroup",[x,p,g]=(0,r.createCollection)(h),[v,b]=(0,i.createContextScope)(h,[g]),[y,j]=v(h),k=t.forwardRef((e,t)=>(0,u.jsx)(x.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,u.jsx)(x.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,u.jsx)(w,{...e,ref:t})})}));k.displayName=h;var w=t.forwardRef((e,r)=>{let{__scopeRovingFocusGroup:i,orientation:l,loop:x=!1,dir:g,currentTabStopId:v,defaultCurrentTabStopId:b,onCurrentTabStopIdChange:j,onEntryFocus:k,preventScrollOnEntryFocus:w=!1,...N}=e,C=t.useRef(null),T=(0,a.useComposedRefs)(r,C),S=(0,d.useDirection)(g),[I,A]=(0,c.useControllableState)({prop:v,defaultProp:b??null,onChange:j,caller:h}),[z,E]=t.useState(!1),M=(0,o.useCallbackRef)(k),D=p(i),L=t.useRef(!1),[F,P]=t.useState(0);return t.useEffect(()=>{let e=C.current;if(e)return e.addEventListener(m,M),()=>e.removeEventListener(m,M)},[M]),(0,u.jsx)(y,{scope:i,orientation:l,dir:S,loop:x,currentTabStopId:I,onItemFocus:t.useCallback(e=>A(e),[A]),onItemShiftTab:t.useCallback(()=>E(!0),[]),onFocusableItemAdd:t.useCallback(()=>P(e=>e+1),[]),onFocusableItemRemove:t.useCallback(()=>P(e=>e-1),[]),children:(0,u.jsx)(n.Primitive.div,{tabIndex:z||0===F?-1:0,"data-orientation":l,...N,ref:T,style:{outline:"none",...e.style},onMouseDown:(0,s.composeEventHandlers)(e.onMouseDown,()=>{L.current=!0}),onFocus:(0,s.composeEventHandlers)(e.onFocus,e=>{let t=!L.current;if(e.target===e.currentTarget&&t&&!z){let t=new CustomEvent(m,f);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=D().filter(e=>e.focusable);R([e.find(e=>e.active),e.find(e=>e.id===I),...e].filter(Boolean).map(e=>e.ref.current),w)}}L.current=!1}),onBlur:(0,s.composeEventHandlers)(e.onBlur,()=>E(!1))})})}),N="RovingFocusGroupItem",C=t.forwardRef((e,r)=>{let{__scopeRovingFocusGroup:a,focusable:i=!0,active:o=!1,tabStopId:c,children:d,...m}=e,f=(0,l.useId)(),h=c||f,g=j(N,a),v=g.currentTabStopId===h,b=p(a),{onFocusableItemAdd:y,onFocusableItemRemove:k,currentTabStopId:w}=g;return t.useEffect(()=>{if(i)return y(),()=>k()},[i,y,k]),(0,u.jsx)(x.ItemSlot,{scope:a,id:h,focusable:i,active:o,children:(0,u.jsx)(n.Primitive.span,{tabIndex:v?0:-1,"data-orientation":g.orientation,...m,ref:r,onMouseDown:(0,s.composeEventHandlers)(e.onMouseDown,e=>{i?g.onItemFocus(h):e.preventDefault()}),onFocus:(0,s.composeEventHandlers)(e.onFocus,()=>g.onItemFocus(h)),onKeyDown:(0,s.composeEventHandlers)(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void g.onItemShiftTab();if(e.target!==e.currentTarget)return;let t=function(e,t,s){var r;let a=(r=e.key,"rtl"!==s?r:"ArrowLeft"===r?"ArrowRight":"ArrowRight"===r?"ArrowLeft":r);if(!("vertical"===t&&["ArrowLeft","ArrowRight"].includes(a))&&!("horizontal"===t&&["ArrowUp","ArrowDown"].includes(a)))return T[a]}(e,g.orientation,g.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let a=b().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)a.reverse();else if("prev"===t||"next"===t){var s,r;"prev"===t&&a.reverse();let i=a.indexOf(e.currentTarget);a=g.loop?(s=a,r=i+1,s.map((e,t)=>s[(r+t)%s.length])):a.slice(i+1)}setTimeout(()=>R(a))}}),children:"function"==typeof d?d({isCurrentTabStop:v,hasTabStop:null!=w}):d})})});C.displayName=N;var T={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function R(e,t=!1){let s=document.activeElement;for(let r of e)if(r===s||(r.focus({preventScroll:t}),document.activeElement!==s))return}e.s(["Item",()=>C,"Root",()=>k,"createRovingFocusGroupScope",()=>b])},23925,1012,e=>{"use strict";let t=(0,e.i(3645).default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["default",()=>t],1012),e.s(["Check",()=>t],23925)},87342,e=>{"use strict";var t=e.i(79054),s=e.i(22528),r=e.i(5978),a=e.i(86874),i=e.i(20314);function l(e){let l=e+"CollectionProvider",[n,o]=(0,s.createContextScope)(l),[c,d]=n(l,{collectionRef:{current:null},itemMap:new Map}),u=e=>{let{scope:s,children:r}=e,a=t.default.useRef(null),l=t.default.useRef(new Map).current;return(0,i.jsx)(c,{scope:s,itemMap:l,collectionRef:a,children:r})};u.displayName=l;let m=e+"CollectionSlot",f=(0,a.createSlot)(m),h=t.default.forwardRef((e,t)=>{let{scope:s,children:a}=e,l=d(m,s),n=(0,r.useComposedRefs)(t,l.collectionRef);return(0,i.jsx)(f,{ref:n,children:a})});h.displayName=m;let x=e+"CollectionItemSlot",p="data-radix-collection-item",g=(0,a.createSlot)(x),v=t.default.forwardRef((e,s)=>{let{scope:a,children:l,...n}=e,o=t.default.useRef(null),c=(0,r.useComposedRefs)(s,o),u=d(x,a);return t.default.useEffect(()=>(u.itemMap.set(o,{ref:o,...n}),()=>void u.itemMap.delete(o))),(0,i.jsx)(g,{...{[p]:""},ref:c,children:l})});return v.displayName=x,[{Provider:u,Slot:h,ItemSlot:v},function(s){let r=d(e+"CollectionConsumer",s);return t.default.useCallback(()=>{let e=r.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${p}]`));return Array.from(r.itemMap.values()).sort((e,s)=>t.indexOf(e.ref.current)-t.indexOf(s.ref.current))},[r.collectionRef,r.itemMap])},o]}var n=new WeakMap;function o(e,t){var s,r;let a,i,l;if("at"in Array.prototype)return Array.prototype.at.call(e,t);let n=(s=e,r=t,a=s.length,(l=(i=c(r))>=0?i:a+i)<0||l>=a?-1:l);return -1===n?void 0:e[n]}function c(e){return e!=e||0===e?0:Math.trunc(e)}(class e extends Map{#e;constructor(e){super(e),this.#e=[...super.keys()],n.set(this,!0)}set(e,t){return n.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,s){let r,a=this.has(t),i=this.#e.length,l=c(e),n=l>=0?l:i+l,o=n<0||n>=i?-1:n;if(o===this.size||a&&o===this.size-1||-1===o)return this.set(t,s),this;let d=this.size+ +!a;l<0&&n++;let u=[...this.#e],m=!1;for(let e=n;e<d;e++)if(n===e){let i=u[e];u[e]===t&&(i=u[e+1]),a&&this.delete(t),r=this.get(i),this.set(t,s)}else{m||u[e-1]!==t||(m=!0);let s=u[m?e:e-1],a=r;r=this.get(s),this.delete(s),this.set(s,a)}return this}with(t,s,r){let a=new e(this);return a.insert(t,s,r),a}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,s){let r=this.#e.indexOf(e);return -1===r?this:this.insert(r,t,s)}after(e){let t=this.#e.indexOf(e);if(-1!==(t=-1===t||t===this.size-1?-1:t+1))return this.entryAt(t)}setAfter(e,t,s){let r=this.#e.indexOf(e);return -1===r?this:this.insert(r+1,t,s)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return void 0!==t&&this.delete(t)}at(e){let t=o(this.#e,e);if(void 0!==t)return this.get(t)}entryAt(e){let t=o(this.#e,e);if(void 0!==t)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return o(this.#e,e)}from(e,t){let s=this.indexOf(e);if(-1===s)return;let r=s+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let s=this.indexOf(e);if(-1===s)return;let r=s+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let s=0;for(let r of this){if(Reflect.apply(e,t,[r,s,this]))return r;s++}}findIndex(e,t){let s=0;for(let r of this){if(Reflect.apply(e,t,[r,s,this]))return s;s++}return -1}filter(t,s){let r=[],a=0;for(let e of this)Reflect.apply(t,s,[e,a,this])&&r.push(e),a++;return new e(r)}map(t,s){let r=[],a=0;for(let e of this)r.push([e[0],Reflect.apply(t,s,[e,a,this])]),a++;return new e(r)}reduce(...e){let[t,s]=e,r=0,a=s??this.at(0);for(let s of this)a=0===r&&1===e.length?s:Reflect.apply(t,this,[a,s,r,this]),r++;return a}reduceRight(...e){let[t,s]=e,r=s??this.at(-1);for(let s=this.size-1;s>=0;s--){let a=this.at(s);r=s===this.size-1&&1===e.length?a:Reflect.apply(t,this,[r,a,s,this])}return r}toSorted(t){return new e([...this.entries()].sort(t))}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let s=this.keyAt(e),r=this.get(s);t.set(s,r)}return t}toSpliced(...t){let s=[...this.entries()];return s.splice(...t),new e(s)}slice(t,s){let r=new e,a=this.size-1;if(void 0===t)return r;t<0&&(t+=this.size),void 0!==s&&s>0&&(a=s-1);for(let e=t;e<=a;e++){let t=this.keyAt(e),s=this.get(t);r.set(t,s)}return r}every(e,t){let s=0;for(let r of this){if(!Reflect.apply(e,t,[r,s,this]))return!1;s++}return!0}some(e,t){let s=0;for(let r of this){if(Reflect.apply(e,t,[r,s,this]))return!0;s++}return!1}}),e.s(["createCollection",()=>l])},83902,e=>{"use strict";let t=(0,e.i(3645).default)("rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]]);e.s(["Rocket",()=>t],83902)},44412,e=>{"use strict";var t=e.i(20314),s=e.i(79054),r=e.i(81975),a=e.i(68304),i=e.i(31777),l=e.i(83428),n=e.i(83902),o=e.i(81181),c=e.i(3645);let d=(0,c.default)("monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);var u=e.i(38573),m=e.i(49228),f=e.i(54277),h=e.i(95812),x=e.i(35e3);let p=(0,c.default)("package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]);var g=e.i(35364),v=e.i(2828),b=e.i(33548),y=e.i(23925),j=e.i(30702),k=e.i(11495);let w={linux:"Linux",darwin:"macOS",win32:"Windows"},N={ide:{label:"IDE",icon:d},"cli-agent":{label:"CLI Agent",icon:u.Terminal},vcs:{label:"VCS",icon:m.GitBranch},terminal:{label:"Terminal",icon:u.Terminal}};function C({status:e}){return"available"===e?(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-emerald-100 px-2 py-0.5 text-xs font-medium text-emerald-700 dark:bg-emerald-900/30 dark:text-emerald-400",children:[(0,t.jsx)(y.Check,{className:"h-3 w-3"}),"Installed"]}):"error"===e?(0,t.jsx)("span",{className:"inline-flex items-center gap-1 rounded-full bg-red-100 px-2 py-0.5 text-xs font-medium text-red-700 dark:bg-red-900/30 dark:text-red-400",children:"Error"}):(0,t.jsx)("span",{className:"inline-flex items-center gap-1 rounded-full bg-amber-100 px-2 py-0.5 text-xs font-medium text-amber-700 dark:bg-amber-900/30 dark:text-amber-400",children:"Missing"})}function T({tool:e,open:r,onClose:a,onRefresh:i,autoStart:c}){let[u,m]=(0,s.useState)(!1),[f,h]=(0,s.useState)(!1),{logs:x,status:v,startInstall:T}=function(e){let[t,r]=(0,s.useState)([]),[a,i]=(0,s.useState)("idle"),[l,n]=(0,s.useState)(null),o=(0,s.useRef)(null),c=(0,s.useCallback)(()=>{o.current&&(o.current.close(),o.current=null)},[]);return(0,s.useEffect)(()=>c,[c]),{logs:t,status:a,result:l,startInstall:(0,s.useCallback)(()=>{c(),r([]),n(null),i("streaming");let t=new EventSource(`/api/tools/${e}/install/stream`);o.current=t,t.onmessage=e=>{r(t=>[...t,e.data])},t.addEventListener("done",e=>{let t=JSON.parse(e.data);n(t),i("error"===t.status?"error":"done"),c()}),t.onerror=()=>{i("error"),c()}},[e,c])}}(e.id),R=(0,s.useRef)(null),S=(0,s.useRef)(!0),I=(0,s.useRef)(!1),A="available"===e.status.status,z="error"===e.status.status,E=A&&!!e.openDirectory,M=!A&&!z&&e.autoInstall;async function D(){h(!0);try{await fetch(`/api/tools/${e.id}/launch`,{method:"POST"})}finally{h(!1)}}(0,s.useEffect)(()=>{r&&c&&M&&"idle"===v&&!I.current&&(I.current=!0,T()),r||(I.current=!1)},[r,c,M,v,T]);let L=(0,s.useCallback)(()=>{let e=R.current;e&&(S.current=e.scrollTop+e.clientHeight>=e.scrollHeight-50)},[]);(0,s.useEffect)(()=>{S.current&&R.current&&(R.current.scrollTop=R.current.scrollHeight)},[x,v]),(0,s.useEffect)(()=>{"done"===v&&i&&i()},[v,i]);let F=(0,t.jsxs)("div",{className:"flex flex-col gap-1.5 pr-6",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[e.iconUrl?(0,t.jsx)("img",{src:e.iconUrl,alt:"",width:24,height:24,className:"shrink-0 dark:invert"}):(0,t.jsx)(p,{className:"text-muted-foreground h-6 w-6 shrink-0"}),(0,t.jsx)("h2",{className:"text-base font-bold",children:e.name}),(0,t.jsx)(C,{status:e.status.status})]}),(0,t.jsx)("div",{className:"flex items-center gap-2",children:e.tags.map(e=>{let s=N[e]??{label:e,icon:d},r=s.icon;return(0,t.jsxs)("span",{className:"text-muted-foreground/70 inline-flex items-center gap-0.5 text-[10px]",children:[(0,t.jsx)(r,{className:"h-3 w-3"}),s.label]},e)})})]});return(0,t.jsx)(k.BaseDrawer,{open:r,onClose:a,size:"md",modal:!0,title:e.name,header:F,"data-testid":"tool-detail-drawer",children:(0,t.jsxs)("div",{className:"flex flex-1 flex-col gap-4 overflow-y-auto p-4",children:[(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:e.description}),e.author||e.platforms?(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 text-xs",children:[e.author?(0,t.jsxs)("span",{className:"text-muted-foreground",children:["by"," ",e.website?(0,t.jsx)("a",{href:e.website,target:"_blank",rel:"noopener noreferrer",className:"text-foreground hover:underline",children:e.author}):(0,t.jsx)("span",{className:"text-foreground",children:e.author})]}):null,e.platforms&&e.platforms.length>0?(0,t.jsx)("span",{className:"text-muted-foreground",children:e.platforms.map(e=>w[e]??e).join(" · ")}):null]}):null,e.installCommand?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-semibold tracking-wide uppercase",children:"Install command"}),(0,t.jsxs)("div",{className:"relative rounded-md bg-zinc-900 text-zinc-100",children:[(0,t.jsx)("pre",{className:"overflow-x-auto px-3 py-2.5 pr-16 font-mono text-xs leading-relaxed break-all whitespace-pre-wrap",children:(0,t.jsx)("code",{children:e.installCommand})}),(0,t.jsxs)(g.Button,{variant:"ghost",size:"sm",className:"absolute top-1.5 right-1.5 h-7 cursor-pointer px-2 text-zinc-400 hover:text-zinc-100",onClick:function(){e.installCommand&&navigator.clipboard.writeText(e.installCommand).then(()=>{m(!0),setTimeout(()=>m(!1),2e3)})},"aria-label":u?"Copied!":"Copy install command",children:[u?(0,t.jsx)(y.Check,{className:"h-3.5 w-3.5 text-emerald-500"}):(0,t.jsx)(b.Copy,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{className:"ml-1 text-[10px]",children:u?"Copied!":"Copy"})]})]})]}):null,(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[M?(0,t.jsxs)(g.Button,{size:"sm",onClick:T,disabled:"streaming"===v,"aria-label":`Install ${e.name}`,className:"cursor-pointer",children:["streaming"===v?(0,t.jsx)(l.Loader2,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):(0,t.jsx)(o.Download,{className:"mr-1.5 h-3.5 w-3.5"}),"streaming"===v?"Installing...":"Install"]}):null,E?(0,t.jsxs)(g.Button,{size:"sm",variant:"outline",onClick:()=>void D(),disabled:f,"aria-label":`Launch ${e.name}`,className:"cursor-pointer",children:[f?(0,t.jsx)(l.Loader2,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):(0,t.jsx)(n.Rocket,{className:"mr-1.5 h-3.5 w-3.5"}),"Launch"]}):null,e.documentationUrl?(0,t.jsx)(g.Button,{variant:"outline",size:"sm",className:"cursor-pointer",asChild:!0,children:(0,t.jsxs)("a",{href:e.documentationUrl,target:"_blank",rel:"noopener noreferrer",children:["Docs",(0,t.jsx)(j.ExternalLink,{className:"ml-1 h-3 w-3"})]})}):null]}),("streaming"===v||"done"===v||"error"===v)&&x.length>0?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-semibold tracking-wide uppercase",children:"Install log"}),(0,t.jsxs)("div",{ref:R,onScroll:L,className:"max-h-60 overflow-auto rounded-md bg-zinc-900 p-3 font-mono text-xs leading-relaxed text-zinc-100","data-testid":"tool-install-log",children:[x.map((e,s)=>(0,t.jsx)("div",{className:"break-all whitespace-pre-wrap",children:e},s)),"done"===v?(0,t.jsx)("div",{className:"mt-2 border-t border-zinc-700 pt-2 text-emerald-400",children:"Installation complete"}):null,"error"===v?(0,t.jsx)("div",{className:"mt-2 border-t border-zinc-700 pt-2 text-red-400",children:"Installation failed"}):null]})]}):null]})})}let R={ide:{label:"IDE",icon:d},"cli-agent":{label:"CLI Agent",icon:u.Terminal},vcs:{label:"VCS",icon:m.GitBranch},terminal:{label:"Terminal",icon:u.Terminal}};function S({tool:e,onRefresh:r,className:a}){let[c,u]=(0,s.useState)(!1),[m,b]=(0,s.useState)(!1),[y,j]=(0,s.useTransition)(),k="available"===e.status.status,w="error"===e.status.status,N=k&&!!e.openDirectory;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{"data-testid":"tool-card",onClick:function(){b(!1),u(!0)},className:(0,i.cn)("bg-card group flex h-30 w-full cursor-pointer flex-col rounded-lg border p-3 transition-shadow hover:shadow-md",a),children:[(0,t.jsxs)("div",{className:"mb-2 flex items-start justify-between gap-2",children:[(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[e.iconUrl?(0,t.jsx)("img",{src:e.iconUrl,alt:"",width:20,height:20,className:"shrink-0 dark:invert"}):(0,t.jsx)(p,{className:"text-muted-foreground h-5 w-5 shrink-0"}),(0,t.jsx)("h3",{"data-testid":"tool-card-name",className:"truncate text-sm font-bold",children:e.name})]}),(0,t.jsx)("div",{"data-testid":"tool-card-tags",className:"flex shrink-0 items-center gap-1",children:e.tags.map(e=>{let s=R[e]??{label:e,icon:d},r=s.icon;return(0,t.jsxs)("span",{className:"text-muted-foreground/70 inline-flex items-center gap-0.5 text-[9px]",children:[(0,t.jsx)(r,{className:"h-2.5 w-2.5"}),s.label]},e)})})]}),(0,t.jsx)("p",{"data-testid":"tool-card-summary",className:"text-muted-foreground mt-1 truncate text-xs",children:e.summary}),(0,t.jsxs)("div",{className:"mt-auto flex items-center justify-between pt-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[w&&"error"===e.status.status?(0,t.jsxs)("span",{className:"flex items-center gap-1 truncate text-[10px] text-red-600 dark:text-red-400",title:e.status.errorMessage,children:[(0,t.jsx)(f.CircleX,{className:"h-3 w-3 shrink-0"}),e.status.errorMessage??"Error"]}):k?(0,t.jsxs)("span",{className:"flex items-center gap-1 text-[10px] text-emerald-600 dark:text-emerald-400",children:[(0,t.jsx)(x.CheckCircle2,{className:"h-3 w-3"}),"Installed"]}):(0,t.jsxs)("span",{className:"text-muted-foreground flex items-center gap-1 text-[10px]",children:[(0,t.jsx)(h.Circle,{className:"h-3 w-3"}),"Not installed"]}),e.required?(0,t.jsx)(v.TooltipProvider,{children:(0,t.jsxs)(v.Tooltip,{children:[(0,t.jsx)(v.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"rounded bg-amber-100 px-1.5 py-0.5 text-[9px] font-medium text-amber-700 dark:bg-amber-900/50 dark:text-amber-400",children:"Required"})}),(0,t.jsx)(v.TooltipContent,{side:"top",children:"This tool is required for Shep to function properly"})]})}):null]}),(0,t.jsx)("div",{className:"flex items-center gap-1",children:k&&N?(0,t.jsxs)(g.Button,{size:"sm",variant:"outline",onClick:function(t){t.stopPropagation(),j(async()=>{await fetch(`/api/tools/${e.id}/launch`,{method:"POST"})})},disabled:y,"aria-label":`Launch ${e.name}`,"data-testid":"tool-card-launch-button",className:"h-7 cursor-pointer rounded-md px-3 text-xs",children:[y?(0,t.jsx)(l.Loader2,{className:"mr-1 h-3 w-3 animate-spin"}):(0,t.jsx)(n.Rocket,{className:"mr-1 h-3 w-3"}),"Launch"]}):k||w?null:(0,t.jsxs)(g.Button,{size:"sm",variant:"default",onClick:function(t){t.stopPropagation(),b(e.autoInstall),u(!0)},"aria-label":`Install ${e.name}`,"data-testid":"tool-card-install-button",className:"h-7 cursor-pointer rounded-md px-3 text-xs",children:[(0,t.jsx)(o.Download,{className:"mr-1 h-3 w-3"}),"Install"]})})]})]}),(0,t.jsx)(T,{tool:e,open:c,onClose:()=>u(!1),onRefresh:r,autoStart:m})]})}let I={all:()=>!0,ide:e=>e.tags.includes("ide"),"cli-agent":e=>e.tags.includes("cli-agent"),vcs:e=>e.tags.includes("vcs"),terminal:e=>e.tags.includes("terminal")};function A({tools:e,className:l}){let[n,o]=(0,s.useState)(e),[c,d]=(0,s.useState)("all"),u=(0,s.useCallback)(async()=>{try{let e=await fetch("/api/tools");if(e.ok){let t=await e.json();o(t)}}catch{}},[]),m=n.filter(I[c]);return(0,t.jsxs)("div",{"data-testid":"tools-page-client",className:(0,i.cn)("space-y-4",l),children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(r.Wrench,{className:"text-muted-foreground h-4 w-4"}),(0,t.jsx)("h1",{className:"text-sm font-bold tracking-tight",children:"Tools"}),(0,t.jsxs)("span",{className:"text-muted-foreground text-[10px]",children:[n.filter(e=>"available"===e.status.status).length,"/",n.length," installed"]})]}),(0,t.jsxs)(a.Tabs,{value:c,onValueChange:e=>d(e),"data-testid":"tools-page-tabs",children:[(0,t.jsxs)(a.TabsList,{className:"h-7",children:[(0,t.jsx)(a.TabsTrigger,{value:"all","data-testid":"tools-tab-all",className:"px-2.5 text-xs",children:"All"}),(0,t.jsx)(a.TabsTrigger,{value:"ide","data-testid":"tools-tab-ide",className:"px-2.5 text-xs",children:"IDEs"}),(0,t.jsx)(a.TabsTrigger,{value:"cli-agent","data-testid":"tools-tab-cli-agent",className:"px-2.5 text-xs",children:"CLI Agents"}),(0,t.jsx)(a.TabsTrigger,{value:"vcs","data-testid":"tools-tab-vcs",className:"px-2.5 text-xs",children:"Version Control"}),(0,t.jsx)(a.TabsTrigger,{value:"terminal","data-testid":"tools-tab-terminal",className:"px-2.5 text-xs",children:"Terminals"})]}),(0,t.jsx)(a.TabsContent,{value:c,className:"mt-3",children:0===m.length?(0,t.jsxs)("div",{"data-testid":"tools-page-empty",className:"text-muted-foreground flex flex-col items-center justify-center py-12 text-center",children:[(0,t.jsx)(r.Wrench,{className:"mb-2 h-6 w-6 opacity-20"}),(0,t.jsx)("p",{className:"text-xs",children:"No tools in this category."})]}):(0,t.jsx)("div",{"data-testid":"tools-page-grid",className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:m.map(e=>(0,t.jsx)(S,{tool:e,onRefresh:u},e.id))})})]})]})}e.s(["ToolsPageClient",()=>A],44412)}]);