@shipit-ai/cli 1.170.0-pr13.d3605b0 → 1.170.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (250) hide show
  1. package/apis/json-schema/LiteLLMProxyConfig.yaml +1 -4
  2. package/dist/packages/core/src/domain/generated/output.d.ts +1 -35
  3. package/dist/packages/core/src/domain/generated/output.d.ts.map +1 -1
  4. package/dist/packages/core/src/domain/generated/output.js +0 -6
  5. package/dist/packages/core/src/infrastructure/persistence/sqlite/mappers/settings.mapper.d.ts +0 -5
  6. package/dist/packages/core/src/infrastructure/persistence/sqlite/mappers/settings.mapper.d.ts.map +1 -1
  7. package/dist/packages/core/src/infrastructure/persistence/sqlite/mappers/settings.mapper.js +1 -24
  8. package/dist/packages/core/src/infrastructure/repositories/sqlite-settings.repository.d.ts.map +1 -1
  9. package/dist/packages/core/src/infrastructure/repositories/sqlite-settings.repository.js +5 -36
  10. package/dist/packages/core/src/infrastructure/services/agents/common/agent-executor-provider.service.d.ts.map +1 -1
  11. package/dist/packages/core/src/infrastructure/services/agents/common/agent-executor-provider.service.js +1 -7
  12. package/dist/packages/core/src/infrastructure/services/agents/common/executors/claude-code-executor.service.d.ts +1 -4
  13. package/dist/packages/core/src/infrastructure/services/agents/common/executors/claude-code-executor.service.d.ts.map +1 -1
  14. package/dist/packages/core/src/infrastructure/services/agents/common/executors/claude-code-executor.service.js +0 -44
  15. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/feature-agent-worker.d.ts.map +1 -1
  16. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/feature-agent-worker.js +0 -5
  17. package/dist/src/presentation/web/components/features/plugins/plugins-page-client.d.ts.map +1 -1
  18. package/dist/src/presentation/web/components/features/plugins/plugins-page-client.js +2 -11
  19. package/dist/src/presentation/web/components/features/settings/feature-flags-settings-section.d.ts.map +1 -1
  20. package/dist/src/presentation/web/components/features/settings/feature-flags-settings-section.js +1 -3
  21. package/dist/src/presentation/web/components/features/settings/litellm-proxy-settings-section.d.ts.map +1 -1
  22. package/dist/src/presentation/web/components/features/settings/litellm-proxy-settings-section.js +8 -5
  23. package/dist/src/presentation/web/components/features/settings/settings-page-client.d.ts.map +1 -1
  24. package/dist/src/presentation/web/components/features/settings/settings-page-client.js +1 -2
  25. package/dist/src/presentation/web/components/features/skills/skills-page-client.d.ts.map +1 -1
  26. package/dist/src/presentation/web/components/features/skills/skills-page-client.js +2 -6
  27. package/dist/src/presentation/web/components/features/tools/tools-page-client.d.ts.map +1 -1
  28. package/dist/src/presentation/web/components/features/tools/tools-page-client.js +4 -23
  29. package/dist/translations/ar/web.json +1 -18
  30. package/dist/translations/de/web.json +1 -18
  31. package/dist/translations/en/web.json +1 -18
  32. package/dist/translations/es/web.json +1 -18
  33. package/dist/translations/fr/web.json +1 -18
  34. package/dist/translations/he/web.json +1 -18
  35. package/dist/translations/pt/web.json +1 -18
  36. package/dist/translations/ru/web.json +1 -18
  37. package/dist/tsconfig.build.tsbuildinfo +1 -1
  38. package/package.json +1 -1
  39. package/web/.next/BUILD_ID +1 -1
  40. package/web/.next/build-manifest.json +3 -3
  41. package/web/.next/fallback-build-manifest.json +3 -3
  42. package/web/.next/prerender-manifest.json +3 -3
  43. package/web/.next/required-server-files.js +3 -3
  44. package/web/.next/required-server-files.json +3 -3
  45. package/web/.next/server/app/(dashboard)/@drawer/adopt/page/server-reference-manifest.json +29 -29
  46. package/web/.next/server/app/(dashboard)/@drawer/adopt/page.js.nft.json +1 -1
  47. package/web/.next/server/app/(dashboard)/@drawer/adopt/page_client-reference-manifest.js +1 -1
  48. package/web/.next/server/app/(dashboard)/@drawer/chat/page/server-reference-manifest.json +27 -27
  49. package/web/.next/server/app/(dashboard)/@drawer/chat/page.js.nft.json +1 -1
  50. package/web/.next/server/app/(dashboard)/@drawer/chat/page_client-reference-manifest.js +1 -1
  51. package/web/.next/server/app/(dashboard)/@drawer/create/page/server-reference-manifest.json +31 -31
  52. package/web/.next/server/app/(dashboard)/@drawer/create/page.js.nft.json +1 -1
  53. package/web/.next/server/app/(dashboard)/@drawer/create/page_client-reference-manifest.js +1 -1
  54. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/server-reference-manifest.json +37 -37
  55. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  56. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  57. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/server-reference-manifest.json +37 -37
  58. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js.nft.json +1 -1
  59. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page_client-reference-manifest.js +1 -1
  60. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page/server-reference-manifest.json +28 -28
  61. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page.js.nft.json +1 -1
  62. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page_client-reference-manifest.js +1 -1
  63. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/server-reference-manifest.json +28 -28
  64. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js.nft.json +1 -1
  65. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  66. package/web/.next/server/app/(dashboard)/chat/page/server-reference-manifest.json +27 -27
  67. package/web/.next/server/app/(dashboard)/chat/page.js.nft.json +1 -1
  68. package/web/.next/server/app/(dashboard)/chat/page_client-reference-manifest.js +1 -1
  69. package/web/.next/server/app/(dashboard)/create/page/server-reference-manifest.json +31 -31
  70. package/web/.next/server/app/(dashboard)/create/page.js.nft.json +1 -1
  71. package/web/.next/server/app/(dashboard)/create/page_client-reference-manifest.js +1 -1
  72. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/server-reference-manifest.json +37 -37
  73. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  74. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  75. package/web/.next/server/app/(dashboard)/feature/[featureId]/page/server-reference-manifest.json +37 -37
  76. package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js.nft.json +1 -1
  77. package/web/.next/server/app/(dashboard)/feature/[featureId]/page_client-reference-manifest.js +1 -1
  78. package/web/.next/server/app/(dashboard)/page/server-reference-manifest.json +27 -27
  79. package/web/.next/server/app/(dashboard)/page.js.nft.json +1 -1
  80. package/web/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
  81. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page/server-reference-manifest.json +28 -28
  82. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page.js.nft.json +1 -1
  83. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page_client-reference-manifest.js +1 -1
  84. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/server-reference-manifest.json +28 -28
  85. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js.nft.json +1 -1
  86. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  87. package/web/.next/server/app/_global-error.html +1 -1
  88. package/web/.next/server/app/_global-error.rsc +1 -1
  89. package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  90. package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  91. package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  92. package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  93. package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  94. package/web/.next/server/app/_not-found/page/server-reference-manifest.json +6 -6
  95. package/web/.next/server/app/_not-found/page.js.nft.json +1 -1
  96. package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  97. package/web/.next/server/app/api/attachments/preview/route.js.nft.json +1 -1
  98. package/web/.next/server/app/api/dialog/pick-files/route.js.nft.json +1 -1
  99. package/web/.next/server/app/api/evidence/route.js.nft.json +1 -1
  100. package/web/.next/server/app/api/graph-data/route.js.nft.json +1 -1
  101. package/web/.next/server/app/api/interactive/chat/[featureId]/messages/route.js.nft.json +1 -1
  102. package/web/.next/server/app/plugins/page/server-reference-manifest.json +15 -15
  103. package/web/.next/server/app/plugins/page.js.nft.json +1 -1
  104. package/web/.next/server/app/plugins/page_client-reference-manifest.js +1 -1
  105. package/web/.next/server/app/settings/page/server-reference-manifest.json +12 -12
  106. package/web/.next/server/app/settings/page.js.nft.json +1 -1
  107. package/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  108. package/web/.next/server/app/skills/page/server-reference-manifest.json +11 -11
  109. package/web/.next/server/app/skills/page.js.nft.json +1 -1
  110. package/web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  111. package/web/.next/server/app/tools/page/server-reference-manifest.json +11 -11
  112. package/web/.next/server/app/tools/page.js.nft.json +1 -1
  113. package/web/.next/server/app/tools/page_client-reference-manifest.js +1 -1
  114. package/web/.next/server/app/version/page/server-reference-manifest.json +6 -6
  115. package/web/.next/server/app/version/page.js.nft.json +1 -1
  116. package/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
  117. package/web/.next/server/chunks/11es_next_dist_esm_build_templates_app-route_067cwst.js +1 -1
  118. package/web/.next/server/chunks/11es_next_dist_esm_build_templates_app-route_067cwst.js.map +1 -1
  119. package/web/.next/server/chunks/[root-of-the-server]__0tb~wwk._.js +1 -1
  120. package/web/.next/server/chunks/ssr/0j.8_web_components_common_control-center-drawer_create-drawer-client_tsx_0g70fc5._.js +1 -1
  121. package/web/.next/server/chunks/ssr/0j.8_web_components_common_control-center-drawer_create-drawer-client_tsx_0g70fc5._.js.map +1 -1
  122. package/web/.next/server/chunks/ssr/0j.8_web_components_common_control-center-drawer_feature-drawer-client_tsx_104cna.._.js +2 -2
  123. package/web/.next/server/chunks/ssr/0j.8_web_components_common_control-center-drawer_feature-drawer-client_tsx_104cna.._.js.map +1 -1
  124. package/web/.next/server/chunks/ssr/0ukq_presentation_web_components_features_settings_settings-page-client_tsx_0j1uius._.js +1 -1
  125. package/web/.next/server/chunks/ssr/0ukq_presentation_web_components_features_settings_settings-page-client_tsx_0j1uius._.js.map +1 -1
  126. package/web/.next/server/chunks/ssr/11y9_components_common_control-center-drawer_repository-drawer-client_tsx_09z.znp._.js +1 -1
  127. package/web/.next/server/chunks/ssr/11y9_components_common_control-center-drawer_repository-drawer-client_tsx_09z.znp._.js.map +1 -1
  128. package/web/.next/server/chunks/ssr/[root-of-the-server]__0.5ojmt._.js +1 -1
  129. package/web/.next/server/chunks/ssr/[root-of-the-server]__0.5ojmt._.js.map +1 -1
  130. package/web/.next/server/chunks/ssr/[root-of-the-server]__05_qc0n._.js +1 -1
  131. package/web/.next/server/chunks/ssr/[root-of-the-server]__05_qc0n._.js.map +1 -1
  132. package/web/.next/server/chunks/ssr/[root-of-the-server]__0ge~xny._.js +1 -1
  133. package/web/.next/server/chunks/ssr/[root-of-the-server]__0ge~xny._.js.map +1 -1
  134. package/web/.next/server/chunks/ssr/[root-of-the-server]__0qda~yi._.js +1 -1
  135. package/web/.next/server/chunks/ssr/[root-of-the-server]__0qda~yi._.js.map +1 -1
  136. package/web/.next/server/chunks/ssr/[root-of-the-server]__0rv1gci._.js +1 -1
  137. package/web/.next/server/chunks/ssr/[root-of-the-server]__0tq2syh._.js +1 -1
  138. package/web/.next/server/chunks/ssr/[root-of-the-server]__0t~u8sd._.js +1 -1
  139. package/web/.next/server/chunks/ssr/[root-of-the-server]__0t~u8sd._.js.map +1 -1
  140. package/web/.next/server/chunks/ssr/{[root-of-the-server]__0dec29w._.js → [root-of-the-server]__0~v1~b9._.js} +2 -2
  141. package/web/.next/server/chunks/ssr/{[root-of-the-server]__0dec29w._.js.map → [root-of-the-server]__0~v1~b9._.js.map} +1 -1
  142. package/web/.next/server/chunks/ssr/[root-of-the-server]__10tll_l._.js +1 -1
  143. package/web/.next/server/chunks/ssr/[root-of-the-server]__10tll_l._.js.map +1 -1
  144. package/web/.next/server/chunks/ssr/[root-of-the-server]__12j29w-._.js +1 -1
  145. package/web/.next/server/chunks/ssr/[root-of-the-server]__12j29w-._.js.map +1 -1
  146. package/web/.next/server/chunks/ssr/{_0mdgz5u._.js → _0.ra89t._.js} +2 -2
  147. package/web/.next/server/chunks/ssr/{_0mdgz5u._.js.map → _0.ra89t._.js.map} +1 -1
  148. package/web/.next/server/chunks/ssr/_01sesw0._.js +1 -1
  149. package/web/.next/server/chunks/ssr/_01sesw0._.js.map +1 -1
  150. package/web/.next/server/chunks/ssr/_069y.js._.js +2 -2
  151. package/web/.next/server/chunks/ssr/_069y.js._.js.map +1 -1
  152. package/web/.next/server/chunks/ssr/{_02g0xyh._.js → _069ybyi._.js} +2 -2
  153. package/web/.next/server/chunks/ssr/{_02g0xyh._.js.map → _069ybyi._.js.map} +1 -1
  154. package/web/.next/server/chunks/ssr/_083k45~._.js +1 -1
  155. package/web/.next/server/chunks/ssr/_083k45~._.js.map +1 -1
  156. package/web/.next/server/chunks/ssr/{_0rqycsg._.js → _0_17.-n._.js} +2 -2
  157. package/web/.next/server/chunks/ssr/{_0rqycsg._.js.map → _0_17.-n._.js.map} +1 -1
  158. package/web/.next/server/chunks/ssr/_0__4si~._.js +1 -1
  159. package/web/.next/server/chunks/ssr/_0__4si~._.js.map +1 -1
  160. package/web/.next/server/chunks/ssr/_0_m17kl._.js +1 -1
  161. package/web/.next/server/chunks/ssr/_0_m17kl._.js.map +1 -1
  162. package/web/.next/server/chunks/ssr/_0d4miu.._.js +1 -1
  163. package/web/.next/server/chunks/ssr/_0d4miu.._.js.map +1 -1
  164. package/web/.next/server/chunks/ssr/_0e8ern9._.js +1 -1
  165. package/web/.next/server/chunks/ssr/_0e8ern9._.js.map +1 -1
  166. package/web/.next/server/chunks/ssr/{_0o.xc6x._.js → _0kt18~b._.js} +2 -2
  167. package/web/.next/server/chunks/ssr/_0kt18~b._.js.map +1 -0
  168. package/web/.next/server/chunks/ssr/_0p3~u8u._.js +2 -2
  169. package/web/.next/server/chunks/ssr/_0p3~u8u._.js.map +1 -1
  170. package/web/.next/server/chunks/ssr/_0r.3n~3._.js +1 -1
  171. package/web/.next/server/chunks/ssr/_0r.3n~3._.js.map +1 -1
  172. package/web/.next/server/chunks/ssr/_0t59q8r._.js +1 -1
  173. package/web/.next/server/chunks/ssr/_0t59q8r._.js.map +1 -1
  174. package/web/.next/server/chunks/ssr/_0tcccbb._.js.map +1 -1
  175. package/web/.next/server/chunks/ssr/_0u3d8.n._.js +1 -1
  176. package/web/.next/server/chunks/ssr/_0u3d8.n._.js.map +1 -1
  177. package/web/.next/server/chunks/ssr/_0vyfc4b._.js +1 -1
  178. package/web/.next/server/chunks/ssr/_0vyfc4b._.js.map +1 -1
  179. package/web/.next/server/chunks/ssr/_0w-_hww._.js +1 -1
  180. package/web/.next/server/chunks/ssr/_0w-_hww._.js.map +1 -1
  181. package/web/.next/server/chunks/ssr/_0zk-h5w._.js +1 -1
  182. package/web/.next/server/chunks/ssr/_0zk-h5w._.js.map +1 -1
  183. package/web/.next/server/chunks/ssr/_0~7lwu_._.js +1 -1
  184. package/web/.next/server/chunks/ssr/_0~7lwu_._.js.map +1 -1
  185. package/web/.next/server/chunks/ssr/_10joy2y._.js +1 -1
  186. package/web/.next/server/chunks/ssr/_10joy2y._.js.map +1 -1
  187. package/web/.next/server/chunks/ssr/_1161g9x._.js +1 -1
  188. package/web/.next/server/chunks/ssr/_1161g9x._.js.map +1 -1
  189. package/web/.next/server/chunks/ssr/_12uy.45._.js +3 -0
  190. package/web/.next/server/chunks/ssr/_12uy.45._.js.map +1 -0
  191. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_plugins_page_actions_0rdndum.js +1 -1
  192. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_plugins_page_actions_0rdndum.js.map +1 -1
  193. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_05m2q~u.js +1 -1
  194. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_05m2q~u.js.map +1 -1
  195. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_0.6zk.t.js +1 -1
  196. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_0.6zk.t.js.map +1 -1
  197. package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_approve-feature_ts_0pjb_re._.js +1 -1
  198. package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_open-ide_ts_0w2wqvu._.js +1 -1
  199. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_0l3oxx9._.js +1 -1
  200. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_0l3oxx9._.js.map +1 -1
  201. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_tools_tools-page-client_tsx_0aji.op._.js +1 -1
  202. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_tools_tools-page-client_tsx_0aji.op._.js.map +1 -1
  203. package/web/.next/server/middleware-build-manifest.js +3 -3
  204. package/web/.next/server/pages/500.html +1 -1
  205. package/web/.next/server/server-reference-manifest.js +1 -1
  206. package/web/.next/server/server-reference-manifest.json +55 -55
  207. package/web/.next/static/chunks/{0wcqsl6fpljkf.js → 01zrwm.x3kpdo.js} +1 -1
  208. package/web/.next/static/chunks/{056k4f_cj86_m.js → 024vi1xxw5ccj.js} +2 -2
  209. package/web/.next/static/chunks/{0f1m9w6~4f-.w.js → 043zp6fpfaz07.js} +3 -3
  210. package/web/.next/static/chunks/{0dq~u_3-zgq73.js → 09lcrhxslt-u8.js} +1 -1
  211. package/web/.next/static/chunks/0aq9-lg.5r.nk.js +5 -0
  212. package/web/.next/static/chunks/{0pik.2.wvg.el.js → 0dprl~vdhvhk7.js} +1 -1
  213. package/web/.next/static/chunks/{13mkca.j8w.7_.js → 0e.8n42~fpeqa.js} +1 -1
  214. package/web/.next/static/chunks/0jt5jzg88skg5.js +1 -0
  215. package/web/.next/static/chunks/{14ulzux4y._m-.js → 0lwuepa24tqxy.js} +1 -1
  216. package/web/.next/static/chunks/0lz-oq74e_ciu.js +1 -0
  217. package/web/.next/static/chunks/{012cnd7koqv6d.js → 0nkujbu62z1jl.js} +1 -1
  218. package/web/.next/static/chunks/{0i~5fqskcb~~p.js → 0rb5cx51f5u8h.js} +1 -1
  219. package/web/.next/static/chunks/0tdbctvrma.oi.js +1 -0
  220. package/web/.next/static/chunks/{05_pa1uvg8ndq.js → 0vq.b40jzhi7r.js} +3 -3
  221. package/web/.next/static/chunks/0wd.i4f822qoa.js +1 -0
  222. package/web/.next/static/chunks/{0nfd9bvcnbcgl.js → 0xo.hi4px83w2.js} +1 -1
  223. package/web/.next/static/chunks/0xzs6jdtkmbic.js +1 -0
  224. package/web/.next/static/chunks/{0dbuetfm_wux5.js → 0~4c6tnw7xnnl.js} +1 -1
  225. package/web/.next/static/chunks/13q1peb_t9vj8.js +1 -0
  226. package/web/.next/static/chunks/{0r05-2~73nsxp.js → 16jgc8hqxrp.u.js} +1 -1
  227. package/apis/json-schema/ClaudeCodeProxyConfig.yaml +0 -20
  228. package/apis/json-schema/LiteLLMProxyRoutingMode.yaml +0 -8
  229. package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/055-add-litellm-proxy-agent-config.d.ts +0 -15
  230. package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/055-add-litellm-proxy-agent-config.d.ts.map +0 -1
  231. package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/055-add-litellm-proxy-agent-config.js +0 -32
  232. package/dist/src/presentation/web/components/features/settings/litellm-proxy-routing-section.d.ts +0 -6
  233. package/dist/src/presentation/web/components/features/settings/litellm-proxy-routing-section.d.ts.map +0 -1
  234. package/dist/src/presentation/web/components/features/settings/litellm-proxy-routing-section.js +0 -72
  235. package/dist/src/presentation/web/components/features/settings/litellm-proxy-routing-section.stories.d.ts +0 -16
  236. package/dist/src/presentation/web/components/features/settings/litellm-proxy-routing-section.stories.d.ts.map +0 -1
  237. package/dist/src/presentation/web/components/features/settings/litellm-proxy-routing-section.stories.js +0 -64
  238. package/web/.next/server/chunks/ssr/_0kaec~c._.js +0 -3
  239. package/web/.next/server/chunks/ssr/_0kaec~c._.js.map +0 -1
  240. package/web/.next/server/chunks/ssr/_0o.xc6x._.js.map +0 -1
  241. package/web/.next/static/chunks/0.s8cxri-_s9l.js +0 -1
  242. package/web/.next/static/chunks/0inayq2zzadja.js +0 -1
  243. package/web/.next/static/chunks/0kjqz.9e9sou2.js +0 -1
  244. package/web/.next/static/chunks/0nnltbyg963sg.js +0 -1
  245. package/web/.next/static/chunks/0ug478hm-8bog.js +0 -5
  246. package/web/.next/static/chunks/10rtagfoabp3b.js +0 -1
  247. package/web/.next/static/chunks/112xn3.b2hrmh.js +0 -1
  248. /package/web/.next/static/{W6C3cWcub-2kZuXP7c21j → kDUolP-Zj2jCRleGJJGX0}/_buildManifest.js +0 -0
  249. /package/web/.next/static/{W6C3cWcub-2kZuXP7c21j → kDUolP-Zj2jCRleGJJGX0}/_clientMiddlewareManifest.js +0 -0
  250. /package/web/.next/static/{W6C3cWcub-2kZuXP7c21j → kDUolP-Zj2jCRleGJJGX0}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,96612,e=>{"use strict";let s=(0,e.i(54864).default)("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);e.s(["RefreshCw",0,s],96612)},64376,e=>{"use strict";let s=(0,e.i(54864).default)("layout-dashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);e.s(["LayoutDashboard",0,s],64376)},50990,e=>{"use strict";let s=(0,e.i(54864).default)("file-pen",[["path",{d:"M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34",key:"o6klzx"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z",key:"zhnas1"}]]);e.s(["FileEdit",0,s],50990)},24901,e=>{"use strict";let s=(0,e.i(54864).default)("file-plus",[["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"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]]);e.s(["FilePlus",0,s],24901)},10661,e=>{"use strict";var s=e.i(96871),t=e.i(16539),a=e.i(33109),r=e.i(17759),i=e.i(70727),n=e.i(63524),l=e.i(96612),o=e.i(96646),d=e.i(92568),c=e.i(67088),x=e.i(85149),h=e.i(79561),m=e.i(64376),p=e.i(85202),u=e.i(60589),g=e.i(64778),j=e.i(60958),b=e.i(23325),f=e.i(54864);let v=(0,f.default)("tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);var y=e.i(83764),N=e.i(50990),k=e.i(24901);let C=(0,f.default)("file-check-corner",[["path",{d:"M10.5 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v6",key:"g5mvt7"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m14 20 2 2 4-4",key:"15kota"}]]);var T=e.i(31777);e.i(1650);var z=e.i(11495);e.i(99348);var w=e.i(17466),P=e.i(2828),L=e.i(68304),S=e.i(74442),M=e.i(8537),R=e.i(75921),D=e.i(28112),F=e.i(96976);let B=(0,F.createServerReference)("604992a4b15b227b11459c865dc2ac9f32a8eb3d5e",F.callServer,void 0,F.findSourceMapURL,"getGitRepoInfo"),I="text-muted-foreground hover:bg-foreground/8 hover:text-foreground inline-flex size-8 items-center justify-center rounded-[3px] disabled:opacity-40",A="bg-border/60 mx-1.5 h-5 w-px shrink-0";function O({icon:e,title:t,children:a}){return(0,s.jsxs)("div",{className:"px-3 pt-4 pb-1",children:[(0,s.jsxs)("div",{className:"text-foreground mb-2 flex items-center gap-1.5 text-sm font-semibold tracking-wider uppercase",children:[(0,s.jsx)(e,{className:"size-4 opacity-50"}),t]}),a]})}function $({children:e,className:t}){return(0,s.jsx)("div",{className:(0,T.cn)("bg-muted/60 rounded-md border border-transparent p-3",t),children:e})}function E({label:e,children:t}){return(0,s.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,s.jsx)("span",{className:"text-foreground/40 text-[11px] font-medium tracking-wider uppercase",children:e}),(0,s.jsx)("span",{className:"text-sm leading-snug",children:t})]})}function H({data:e,syncError:a}){let[r,i]=(0,t.useState)(null),[n,l]=(0,t.useState)(!1);if((0,t.useEffect)(()=>{if(!e.repositoryPath)return;let s=!1;return l(!0),B(e.repositoryPath,8).then(e=>{s||i(e)}).catch(()=>{}).finally(()=>{s||l(!1)}),()=>{s=!0}},[e.repositoryPath]),!e.repositoryPath)return null;let o=r?.workingTree,d=o&&(o.staged>0||o.modified>0||o.untracked>0),c=r?.diffStats;return(0,s.jsxs)("div",{className:"pb-4",children:[n?(0,s.jsxs)("div",{className:"text-foreground/40 flex items-center gap-2 px-4 py-8 text-sm",children:[(0,s.jsx)(h.LoaderCircle,{className:"size-4 animate-spin"})," Loading repository info..."]}):null,r?(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-2 px-3 pt-3",children:[(0,s.jsx)($,{children:(0,s.jsxs)(E,{label:"Branch",children:[(0,s.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,s.jsx)(u.GitBranch,{className:"text-foreground/30 size-3.5 shrink-0"}),(0,s.jsx)("code",{className:"font-mono text-sm",children:r.currentBranch??e.branch??"—"})]}),null!=e.behindCount&&e.behindCount>0?(0,s.jsxs)("span",{className:"mt-0.5 block text-xs text-orange-600 dark:text-orange-400",children:[e.behindCount," behind default"]}):null]})}),(0,s.jsx)($,{children:(0,s.jsx)(E,{label:"Working Tree",children:d?(0,s.jsxs)("div",{className:"flex flex-wrap gap-x-3 gap-y-0.5",children:[o.staged>0?(0,s.jsxs)("span",{className:"inline-flex items-center gap-1 text-sm text-green-600 dark:text-green-400",children:[(0,s.jsx)(C,{className:"size-3.5"})," ",o.staged," staged"]}):null,o.modified>0?(0,s.jsxs)("span",{className:"inline-flex items-center gap-1 text-sm text-amber-600 dark:text-amber-400",children:[(0,s.jsx)(N.FileEdit,{className:"size-3.5"})," ",o.modified," modified"]}):null,o.untracked>0?(0,s.jsxs)("span",{className:"text-foreground/50 inline-flex items-center gap-1 text-sm",children:[(0,s.jsx)(k.FilePlus,{className:"size-3.5"})," ",o.untracked," untracked"]}):null]}):(0,s.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-sm text-green-600 dark:text-green-400",children:[(0,s.jsx)(x.Check,{className:"size-3.5"})," Clean"]})})}),c?(0,s.jsx)($,{children:(0,s.jsx)(E,{label:"Uncommitted Changes",children:(0,s.jsxs)("div",{className:"flex items-center gap-3 text-sm",children:[(0,s.jsxs)("span",{children:[c.filesChanged," file",1!==c.filesChanged?"s":""]}),(0,s.jsxs)("span",{className:"text-green-600 dark:text-green-400",children:["+",c.insertions]}),(0,s.jsxs)("span",{className:"text-red-500 dark:text-red-400",children:["-",c.deletions]})]})})}):null,r.remotes.length>0?(0,s.jsx)($,{children:(0,s.jsx)(E,{label:"Remote",children:r.remotes.map(e=>(0,s.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-sm",children:[(0,s.jsx)(b.Globe,{className:"text-foreground/30 size-3.5 shrink-0"}),(0,s.jsx)("span",{className:"truncate",children:e.url.replace(/\.git$/,"").replace(/^https?:\/\/([^@]+@)?/,"").replace(/x-access-token:[^@]+@/,"")})]},e.name))})}):null,r.stashCount>0?(0,s.jsx)($,{children:(0,s.jsx)(E,{label:"Stashes",children:(0,s.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-sm",children:[(0,s.jsx)(y.Archive,{className:"text-foreground/30 size-3.5 shrink-0"}),r.stashCount," stash",1!==r.stashCount?"es":""]})})}):null,r.tags.length>0?(0,s.jsx)($,{children:(0,s.jsx)(E,{label:"Tags",children:(0,s.jsx)("div",{className:"flex flex-wrap gap-1.5",children:r.tags.map(e=>(0,s.jsxs)("span",{className:"bg-foreground/[0.04] inline-flex items-center gap-0.5 rounded px-1.5 py-0.5 text-xs",children:[(0,s.jsx)(v,{className:"text-foreground/30 size-2.5"}),e]},e))})})}):null]}):null,r&&r.commits.length>0?(0,s.jsx)(O,{icon:g.GitCommitHorizontal,title:"Recent Commits",children:(0,s.jsxs)("div",{className:"relative ml-3",children:[(0,s.jsx)("div",{className:"bg-border absolute top-2 bottom-2 left-[5px] w-px"}),r.commits.map((e,t)=>(0,s.jsxs)("div",{className:"group relative flex gap-3 py-1.5",children:[(0,s.jsx)("div",{className:(0,T.cn)("relative z-10 mt-1.5 size-[11px] shrink-0 rounded-full border-2",0===t?"border-primary bg-primary":"border-border bg-background group-hover:border-foreground/30")}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,s.jsx)("p",{className:"min-w-0 truncate text-sm leading-snug",children:e.subject}),(0,s.jsx)("code",{className:"text-foreground/30 shrink-0 font-mono text-[11px]",children:e.shortHash})]}),(0,s.jsxs)("div",{className:"text-foreground/40 mt-0.5 flex items-center gap-2 text-xs",children:[(0,s.jsx)("span",{children:e.author}),(0,s.jsx)("span",{children:"·"}),(0,s.jsx)("span",{children:e.relativeDate}),e.branch?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{children:"·"}),(0,s.jsxs)("span",{className:"inline-flex items-center gap-0.5",children:[(0,s.jsx)(u.GitBranch,{className:"size-3"}),e.branch]})]}):null]})]})]},e.hash))]})}):null,r&&r.branches.length>1?(0,s.jsx)(O,{icon:u.GitBranch,title:"Branches",children:(0,s.jsx)("div",{className:"flex flex-col",children:[...r.branches].sort((e,s)=>{let t,a,r,i;return e.isCurrent&&!s.isCurrent?-1:!e.isCurrent&&s.isCurrent?1:(t=e.name,/^(main|master)$/.test(t)&&(a=s.name,!/^(main|master)$/.test(a)))?-1:+(r=e.name,!!(!/^(main|master)$/.test(r)&&(i=s.name,/^(main|master)$/.test(i))))}).map(e=>(0,s.jsxs)("div",{className:(0,T.cn)("flex items-center justify-between rounded px-2 py-1.5",e.isCurrent&&"bg-muted/60"),children:[(0,s.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-sm",children:[e.isCurrent?(0,s.jsx)("span",{className:"size-2 shrink-0 rounded-full bg-green-500"}):/^(main|master)$/.test(e.name)?(0,s.jsx)("span",{className:"size-2 shrink-0 rounded-full bg-blue-500"}):(0,s.jsx)("span",{className:"bg-foreground/10 size-2 shrink-0 rounded-full"}),(0,s.jsx)("code",{className:"font-mono text-[13px]",children:e.name}),e.isCurrent?(0,s.jsx)("span",{className:"text-foreground/40 text-[10px]",children:"current"}):null]}),(0,s.jsx)("span",{className:"text-foreground/40 text-xs",children:e.lastCommitDate})]},e.name))})}):null,a?(0,s.jsx)(O,{icon:j.TriangleAlert,title:"Issues",children:(0,s.jsx)($,{className:"bg-destructive/5 border-transparent",children:(0,s.jsx)("p",{className:"text-destructive text-sm",children:a})})}):null]})}e.s(["RepositoryDrawerClient",0,function({data:e,initialTab:u}){let g=(0,R.useFeatureFlags)(),j=(0,a.useRouter)(),b=(0,a.usePathname)().startsWith("/repository/"),[f,v]=(0,t.useState)(u??"overview"),[y,N]=(0,t.useState)(!1),k=(0,S.useRepositoryActions)(e.repositoryPath?{repositoryId:e.id,repositoryPath:e.repositoryPath}:null),C=(0,t.useCallback)(()=>{j.push("/")},[j]),F=(0,M.useDeployAction)(e.repositoryPath?{targetId:e.repositoryPath,targetType:"repository",repositoryPath:e.repositoryPath}:null),B="Booting"===F.status||"Ready"===F.status,O=(0,t.useCallback)(()=>{e.repositoryPath&&(navigator.clipboard.writeText(e.repositoryPath),N(!0),setTimeout(()=>N(!1),2e3))},[e.repositoryPath]),$=e.id?`repo-${e.id}`:`repo-${e.name}`;return(0,s.jsx)(z.BaseDrawer,{open:b,onClose:C,size:"lg",modal:!1,"data-testid":"repository-drawer",children:(0,s.jsxs)(L.Tabs,{value:f,onValueChange:v,className:"flex min-h-0 flex-1 flex-col",children:[(0,s.jsxs)(L.TabsList,{className:"bg-muted/50 h-auto w-full shrink-0 justify-start gap-0 rounded-none border-b p-0",children:[(0,s.jsxs)(L.TabsTrigger,{value:"overview",className:"text-muted-foreground hover:bg-muted hover:text-foreground data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:border-t-primary [&:not([data-state=active])]:border-r-border relative h-auto rounded-none border-t-2 border-r border-t-transparent border-r-transparent bg-transparent px-3.5 py-2.5 text-[13px] font-normal shadow-none transition-none last:border-r-transparent data-[state=active]:shadow-none",children:[(0,s.jsx)(m.LayoutDashboard,{className:"mr-1.5 size-4"}),"Overview"]}),(0,s.jsxs)(L.TabsTrigger,{value:"chat",className:"text-muted-foreground hover:bg-muted hover:text-foreground data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:border-t-primary [&:not([data-state=active])]:border-r-border relative h-auto rounded-none border-t-2 border-r border-t-transparent border-r-transparent bg-transparent px-3.5 py-2.5 text-[13px] font-normal shadow-none transition-none last:border-r-transparent data-[state=active]:shadow-none",children:[(0,s.jsx)(p.MessageSquare,{className:"mr-1.5 size-4"}),"Chat"]})]}),(0,s.jsxs)("div",{className:"bg-muted/40 shrink-0 border-b",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 px-4 pe-10 pt-2.5 pb-2","data-testid":"repository-drawer-header",children:[(0,s.jsx)("h2",{className:"text-foreground min-w-0 truncate text-base font-semibold tracking-tight",children:e.name}),e.repositoryPath?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"text-muted-foreground/40 text-xs",children:"/"}),(0,s.jsx)("span",{className:"text-muted-foreground min-w-0 truncate font-mono text-[11px]",children:e.repositoryPath})]}):null]}),e.repositoryPath?(0,s.jsx)("div",{"data-testid":"repository-drawer-toolbar",children:(0,s.jsxs)("div",{className:"flex h-9 items-center px-1.5",children:[(0,s.jsxs)(P.TooltipProvider,{delayDuration:300,children:[(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsxs)(P.Tooltip,{children:[(0,s.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,s.jsx)("button",{type:"button",className:I,onClick:k.openInIde,disabled:k.ideLoading,"aria-label":"Open in IDE",children:k.ideLoading?(0,s.jsx)(h.LoaderCircle,{className:"size-3.5 animate-spin"}):(0,s.jsx)(r.Code2,{className:"size-4"})})}),(0,s.jsx)(P.TooltipContent,{side:"bottom",className:"text-xs",children:"Open in IDE"})]}),(0,s.jsxs)(P.Tooltip,{children:[(0,s.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,s.jsx)("button",{type:"button",className:I,onClick:k.openInShell,disabled:k.shellLoading,"aria-label":"Open terminal",children:k.shellLoading?(0,s.jsx)(h.LoaderCircle,{className:"size-3.5 animate-spin"}):(0,s.jsx)(i.Terminal,{className:"size-4"})})}),(0,s.jsx)(P.TooltipContent,{side:"bottom",className:"text-xs",children:"Open terminal"})]}),(0,s.jsxs)(P.Tooltip,{children:[(0,s.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,s.jsx)("button",{type:"button",className:I,onClick:k.openFolder,disabled:k.folderLoading,"aria-label":"Open folder",children:k.folderLoading?(0,s.jsx)(h.LoaderCircle,{className:"size-3.5 animate-spin"}):(0,s.jsx)(n.FolderOpen,{className:"size-4"})})}),(0,s.jsx)(P.TooltipContent,{side:"bottom",className:"text-xs",children:"Open folder"})]}),(0,s.jsxs)(P.Tooltip,{children:[(0,s.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,s.jsx)("button",{type:"button",className:I,onClick:O,"aria-label":"Copy path",children:y?(0,s.jsx)(x.Check,{className:"size-3.5 text-green-500"}):(0,s.jsx)(c.Copy,{className:"size-4"})})}),(0,s.jsx)(P.TooltipContent,{side:"bottom",className:"text-xs",children:y?"Copied!":"Copy path"})]})]}),e.id&&g.gitRebaseSync?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:A}),(0,s.jsxs)(P.Tooltip,{children:[(0,s.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,s.jsx)("button",{type:"button",className:I,onClick:k.syncMain,disabled:k.syncLoading,"aria-label":"Sync main",children:k.syncLoading?(0,s.jsx)(h.LoaderCircle,{className:"size-3.5 animate-spin"}):(0,s.jsx)(l.RefreshCw,{className:"size-4"})})}),(0,s.jsx)(P.TooltipContent,{side:"bottom",className:"text-xs",children:"Sync main"})]})]}):null,g.envDeploy?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:A}),(0,s.jsxs)(P.Tooltip,{children:[(0,s.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,s.jsx)("button",{type:"button",disabled:F.deployLoading||F.stopLoading,onClick:B?F.stop:F.deploy,className:(0,T.cn)("inline-flex size-7 items-center justify-center rounded-[3px] disabled:opacity-40",B?"text-red-500 hover:bg-red-500/10 hover:text-red-400":"text-green-500 hover:bg-green-500/10 hover:text-green-400"),"aria-label":B?"Stop dev server":"Start dev server",children:F.deployLoading||F.stopLoading?(0,s.jsx)(h.LoaderCircle,{className:"size-3.5 animate-spin"}):B?(0,s.jsx)(d.Square,{className:"size-4"}):(0,s.jsx)(o.Play,{className:"size-4"})})}),(0,s.jsx)(P.TooltipContent,{side:"bottom",className:"text-xs",children:B?"Stop dev server":"Start dev server"})]}),B?(0,s.jsx)(w.DeploymentStatusBadge,{status:F.status,url:F.url,targetId:e.repositoryPath}):null]}):null]}),(0,s.jsx)("div",{className:"flex-1"})]})}):null]}),(0,s.jsx)(L.TabsContent,{value:"overview",className:"mt-0 flex-1 overflow-y-auto",children:(0,s.jsx)(H,{data:e,syncError:k.syncError})}),(0,s.jsx)(L.TabsContent,{value:"chat",className:"mt-0 flex min-h-0 flex-1 flex-col overflow-hidden",children:(0,s.jsx)(D.ChatTab,{featureId:$,worktreePath:e.repositoryPath})})]})})}],10661)}]);
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,15203,e=>{"use strict";var t=e.i(96871),r=e.i(16539),a=e.i(33109),s=e.i(60112),i=e.i(96976);let o=(0,i.createServerReference)("40dd1e500a33c7002b1820fc08aebc110af000069a",i.callServer,void 0,i.findSourceMapURL,"createFeature");e.i(26759);var n=e.i(97164);e.i(1650);var l=e.i(11495),d=e.i(45811),c=e.i(35364),p=e.i(41957),u=e.i(81846),h=e.i(2828),m=e.i(8361),x=e.i(30153);let f=(0,i.createServerReference)("409b9ee97fb02d5a344035d88bd37b3a9c0534736a",i.callServer,void 0,i.findSourceMapURL,"getViewerPermission");var g=e.i(42076);let b=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"]),j={allowPrd:!1,allowPlan:!1,allowMerge:!1};var v=e.i(82639),w=e.i(22570),C=e.i(45977),y=e.i(31777),D=e.i(48306),N=e.i(51911);e.i(50032);var T=e.i(86254),k=e.i(9749);function P({description:e,onDescriptionChange:a,attachments:s,onRemoveFile:i,onNotesChange:o,onPaste:l,onDragEnter:d,onDragLeave:c,onDragOver:u,onDrop:m,onAddFiles:x,isDragOver:f,uploadError:g,isPromptFocused:b,onPromptFocus:j,onPromptBlur:S,fast:F,onFastChange:E,pending:R,onPendingChange:L,overrideAgent:M,overrideModel:A,currentAgentType:I,currentModel:O,onAgentModelChange:z,isSubmitting:U}){let{t:B}=(0,n.useTranslation)("web"),_=(0,r.useRef)(null);return(0,t.jsxs)("div",{role:"region","aria-label":B("createDrawer.fileDropZone"),"data-drag-over":f?"true":"false",onDragEnter:d,onDragLeave:c,onDragOver:u,onDrop:m,className:(0,y.cn)("flex flex-col gap-1.5 rounded-md border-2 border-transparent p-1 transition-colors",f&&"border-primary/50 bg-primary/5"),children:[(0,t.jsx)(p.Label,{htmlFor:"feature-description",className:"text-muted-foreground text-xs font-semibold tracking-wider",children:B("createDrawer.describeFeature")}),(0,t.jsxs)("div",{ref:_,onFocus:j,onBlur:()=>{setTimeout(()=>{let e=_.current?.contains(document.activeElement),t=_.current?.querySelector('[aria-expanded="true"]')!==null;e||t||S()},0)},className:(0,y.cn)("border-input flex h-56 flex-col overflow-hidden rounded-md border shadow-xs transition-[color,box-shadow]",b&&"ring-ring/50 border-ring ring-[3px]"),children:[(0,t.jsx)(D.Textarea,{id:"feature-description",placeholder:B("createDrawer.featurePlaceholder"),value:e,onChange:e=>a(e.target.value),onPaste:l,required:!0,disabled:U,"aria-invalid":!!g,"aria-describedby":g?"feature-upload-error":void 0,className:"min-h-0 flex-1 resize-none rounded-none border-0 shadow-none focus-visible:ring-0"}),s.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-1.5 px-3 py-2",children:s.map(e=>(0,t.jsx)(T.AttachmentChip,{name:e.name,size:e.size,mimeType:e.mimeType,path:e.path,onRemove:()=>i(e.id),disabled:U,loading:e.loading,notes:e.notes,onNotesChange:t=>o(e.id,t)},e.id))}),g?(0,t.jsx)("p",{id:"feature-upload-error",className:"text-destructive px-3 pb-2 text-xs",role:"alert",children:g}):null,(0,t.jsxs)("div",{className:"border-input flex items-center gap-3 border-t px-3 py-1.5",children:[(0,t.jsx)(k.AgentModelPicker,{initialAgentType:M??I??"claude-code",initialModel:A??O??"claude-sonnet-4-6",mode:"override",onAgentModelChange:z,disabled:U,className:"w-55"}),(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"ml-auto flex cursor-pointer items-center gap-2",children:[(0,t.jsx)(N.Switch,{id:"pending-mode",checked:R,onCheckedChange:L,disabled:U}),(0,t.jsxs)(p.Label,{htmlFor:"pending-mode",className:"flex cursor-pointer items-center gap-1 text-sm font-medium",children:[(0,t.jsx)(C.Clock,{className:"h-3.5 w-3.5"}),B("createDrawer.pendingMode")]})]})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:B("createDrawer.pendingModeDescription")})]}),(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-2",children:[(0,t.jsx)(N.Switch,{id:"fast-mode",checked:F,onCheckedChange:E,disabled:U}),(0,t.jsxs)(p.Label,{htmlFor:"fast-mode",className:"flex cursor-pointer items-center gap-1 text-sm font-medium",children:[(0,t.jsx)(w.Zap,{className:"h-3.5 w-3.5"}),B("createDrawer.fastModeLabel")]})]})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:B("createDrawer.fastModeDescription")})]}),(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",onClick:x,disabled:U,"aria-label":B("chat.attachFiles"),className:"text-muted-foreground hover:text-foreground cursor-pointer rounded p-1 transition-colors",children:(0,t.jsx)(v.PaperclipIcon,{className:"h-4 w-4"})})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:B("chat.attachFiles")})]})]})]})]})}var S=e.i(8791),F=e.i(13867),E=e.i(96612),R=e.i(27381),L=e.i(47373);let M=(0,i.createServerReference)("401e1c3498152c791474ba9627e72559d0d329b281",i.callServer,void 0,i.findSourceMapURL,"getAgentPermissionOptions"),A=["allowPrd","allowPlan","allowMerge"];function I({approvalGates:e,onApprovalGatesChange:r,enableEvidence:a,onEnableEvidenceChange:s,commitEvidence:i,onCommitEvidenceChange:o,push:l,onPushChange:d,openPr:c,onOpenPrChange:u,ciWatchEnabled:m,onCiWatchChange:x,rebaseBeforeBranch:f,onRebaseBeforeBranchChange:g,commitSpecs:b,onCommitSpecsChange:j,forkAndPr:v,onForkAndPrChange:w,canPush:C,fast:D,computedPush:T,computedOpenPr:k,isSubmitting:P,agentType:R,permissionMode:L,onPermissionModeChange:M}){let{t:z}=(0,n.useTranslation)("web"),U=[{id:"allowPrd",label:z("createDrawer.prd"),description:z("createDrawer.prdDescription")},{id:"allowPlan",label:z("createDrawer.plan"),description:z("createDrawer.planDescription")},{id:"allowMerge",label:z("createDrawer.merge"),description:z("createDrawer.mergeDescription")}];return(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)(h.Tooltip,{children:[(0,t.jsx)(h.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:z("createDrawer.approve")})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:z("createDrawer.approveDescription")})]}),(0,t.jsx)("div",{className:"flex flex-1 items-center gap-4",children:U.map(a=>(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(N.Switch,{id:`approve-${a.id}`,size:"sm",checked:e[a.id]??!1,onCheckedChange:t=>r({...e,[a.id]:t}),disabled:P||D&&("allowPrd"===a.id||"allowPlan"===a.id)}),(0,t.jsx)(p.Label,{htmlFor:`approve-${a.id}`,className:"cursor-pointer text-xs font-medium",children:a.label})]})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:D&&("allowPrd"===a.id||"allowPlan"===a.id)?z("createDrawer.skippedInFastMode"):a.description})]},a.id))}),(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",onClick:()=>{let t=A.every(t=>e[t]),a={};for(let e of A)a[e]=!t;r(a)},disabled:P,className:(0,y.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",A.every(t=>e[t])&&"text-primary"),children:z("createDrawer.all")})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:z("createDrawer.toggleAllApprovalGates")})]})]}),(0,t.jsxs)("div",{className:"border-input flex items-center gap-4 rounded-md border px-3 py-2.5",children:[(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.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:z("createDrawer.evidence")})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:z("createDrawer.evidenceDescription")})]}),(0,t.jsxs)("div",{className:"flex flex-1 items-center gap-4",children:[(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(N.Switch,{id:"enable-evidence",size:"sm",checked:a,onCheckedChange:e=>{s(e),e||o(!1)},disabled:P}),(0,t.jsx)(p.Label,{htmlFor:"enable-evidence",className:"cursor-pointer text-xs font-medium",children:z("createDrawer.collect")})]})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:z("createDrawer.collectDescription")})]}),(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(N.Switch,{id:"commit-evidence",size:"sm",checked:i,onCheckedChange:o,disabled:P||!a||!c&&!v}),(0,t.jsx)(p.Label,{htmlFor:"commit-evidence",className:(0,y.cn)("cursor-pointer text-xs font-medium",(!a||!c&&!v)&&"opacity-50"),children:z("createDrawer.addToPr")})]})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:c||v?a?z("createDrawer.addToPrDescription"):z("createDrawer.requiresEvidence"):z("createDrawer.requiresPr")})]})]})]}),(0,t.jsxs)("div",{className:"border-input flex items-start gap-4 rounded-md border px-3 py-2.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 pt-0.5 text-xs font-semibold tracking-wider",children:z("createDrawer.git")}),(0,t.jsxs)("div",{className:"flex flex-1 flex-wrap items-center gap-4",children:[(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(N.Switch,{id:"push",size:"sm",checked:T,onCheckedChange:e=>{d(e),!e&&c&&u(!1)},disabled:P||v}),(0,t.jsx)(p.Label,{htmlFor:"push",className:(0,y.cn)("cursor-pointer text-xs font-medium",v&&"opacity-50"),children:z("createDrawer.push")})]})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:v?"Enabled — contributing to upstream":z("createDrawer.pushDescription")})]}),(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(N.Switch,{id:"open-pr",size:"sm",checked:k,onCheckedChange:e=>{u(e),e||o(!1)},disabled:P||v}),(0,t.jsx)(p.Label,{htmlFor:"open-pr",className:(0,y.cn)("cursor-pointer text-xs font-medium",v&&"opacity-50"),children:z("createDrawer.pr")})]})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:v?"Enabled — contributing to upstream":z("createDrawer.prDescription")})]}),(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(N.Switch,{id:"ci-watch",size:"sm",checked:m,onCheckedChange:x,disabled:P}),(0,t.jsx)(p.Label,{htmlFor:"ci-watch",className:"cursor-pointer text-xs font-medium",children:z("createDrawer.watch")})]})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:z("createDrawer.watchDescription")})]}),(0,t.jsx)("div",{className:"bg-border h-4 w-px shrink-0"}),(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(N.Switch,{id:"rebase-before-branch",size:"sm",checked:f,onCheckedChange:g,disabled:P}),(0,t.jsxs)(p.Label,{htmlFor:"rebase-before-branch",className:"flex cursor-pointer items-center gap-1 text-xs font-medium",children:[(0,t.jsx)(E.RefreshCw,{className:"h-3 w-3"}),z("createDrawer.sync")]})]})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:z("createDrawer.syncDescription")})]}),(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(N.Switch,{id:"commit-specs",size:"sm",checked:b,onCheckedChange:j,disabled:P}),(0,t.jsxs)(p.Label,{htmlFor:"commit-specs",className:"flex cursor-pointer items-center gap-1 text-xs font-medium",children:[(0,t.jsx)(F.FileText,{className:"h-3 w-3"}),z("createDrawer.commitSpecs")]})]})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:z("createDrawer.commitSpecsDescription")})]}),!C&&(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(N.Switch,{id:"fork-and-pr",size:"sm",checked:v,onCheckedChange:e=>{w(e),e&&j(!1)},disabled:P}),(0,t.jsxs)(p.Label,{htmlFor:"fork-and-pr",className:"flex cursor-pointer items-center gap-1 text-xs font-medium",children:[(0,t.jsx)(S.GitFork,{className:"h-3 w-3"}),z("createDrawer.forkAndPr")]})]})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:z("createDrawer.forkAndPrDescription")})]})]})]}),R&&M?(0,t.jsx)(O,{agentType:R,permissionMode:L,onPermissionModeChange:M,isSubmitting:P}):null]})}function O({agentType:e,permissionMode:a,onPermissionModeChange:s,isSubmitting:i}){let{t:o}=(0,n.useTranslation)("web"),[l,d]=(0,r.useState)([]);return((0,r.useEffect)(()=>{let t=!1;return M(e).then(e=>{t||d(e)}),()=>{t=!0}},[e]),0===l.length)?null:(0,t.jsxs)("div",{className:"border-input flex items-center gap-4 rounded-md border px-3 py-2.5",children:[(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("span",{className:"text-muted-foreground flex w-16 shrink-0 cursor-default items-center gap-1 text-xs font-semibold tracking-wider",children:[(0,t.jsx)(R.Shield,{className:"h-3 w-3"}),o("feature.create.permissionMode")]})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:o("settings.agent.permissions.description",{agent:e})})]}),(0,t.jsx)("div",{className:"flex-1",children:(0,t.jsxs)(L.Select,{value:a??"__default__",onValueChange:e=>s("__default__"===e?void 0:e),disabled:i,children:[(0,t.jsx)(L.SelectTrigger,{id:"permission-mode","data-testid":"permission-mode-select",className:"h-7 text-xs",children:(0,t.jsx)(L.SelectValue,{})}),(0,t.jsxs)(L.SelectContent,{children:[(0,t.jsx)(L.SelectItem,{value:"__default__",children:o("feature.create.permissionModeDefault")}),l.map(e=>(0,t.jsx)(L.SelectItem,{value:e.value,children:e.label},e.value))]})]})})]})}var z=e.i(56060),U=e.i(91653),B=e.i(98127),_=e.i(49563);function G({features:e,value:a,onChange:s,disabled:i}){let{t:o}=(0,n.useTranslation)("web"),[l,d]=(0,r.useState)(!1),[c,p]=(0,r.useState)(""),u=(0,r.useRef)(null),h=e.find(e=>e.id===a),m=c.trim()?e.filter(e=>e.name.toLowerCase().includes(c.toLowerCase())||e.id.toLowerCase().includes(c.toLowerCase())):e,x=(0,r.useCallback)(e=>{s(e),d(!1),p("")},[s]);return(0,r.useEffect)(()=>{l?setTimeout(()=>u.current?.focus(),0):p("")},[l]),(0,t.jsxs)(_.Popover,{open:l,onOpenChange:d,children:[(0,t.jsx)(_.PopoverTrigger,{asChild:!0,children:(0,t.jsxs)("button",{id:"parent-feature",type:"button",role:"combobox","aria-expanded":l,"aria-label":"Parent Feature",disabled:i,"data-testid":"parent-feature-combobox",className:(0,y.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",!h&&"text-muted-foreground"),children:[(0,t.jsx)("span",{className:"truncate",children:h?`${h.name} (${h.id.slice(0,8)})`:o("createDrawer.selectParent")}),(0,t.jsx)(z.ChevronsUpDown,{className:"ms-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,t.jsx)(_.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:o("createDrawer.searchFeatures"),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:()=>x(void 0),className:(0,y.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)(U.CheckIcon,{className:(0,y.cn)("h-4 w-4 shrink-0",void 0!==a&&"invisible")}),(0,t.jsx)("span",{className:"text-muted-foreground italic",children:o("createDrawer.noParent")})]}),0===m.length&&c?(0,t.jsx)("p",{className:"text-muted-foreground px-3 py-2 text-sm",children:o("createDrawer.noFeaturesFound")}):m.map(e=>(0,t.jsxs)("button",{type:"button",role:"option","aria-selected":a===e.id,onClick:()=>x(e.id),className:(0,y.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)(U.CheckIcon,{className:(0,y.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))]})]})})]})}var W=e.i(47930),$=e.i(79561),q=e.i(25235),K=e.i(75921),V=e.i(47254),Z=e.i(78521);e.i(13322);var J=e.i(61201);function H({repositories:e,value:a,onChange:s,onAddRepository:i,disabled:o}){let[l,d]=(0,r.useState)(!1),[c,p]=(0,r.useState)(""),[u,h]=(0,r.useState)(!1),[m,x]=(0,r.useState)(null),[f,g]=(0,r.useState)(!1),b=(0,r.useRef)(null),{reactFileManager:j}=(0,K.useFeatureFlags)(),{t:v}=(0,n.useTranslation)("web"),w=e.find(e=>e.path===a),C=c.trim()?e.filter(e=>e.name.toLowerCase().includes(c.toLowerCase())||e.path.toLowerCase().includes(c.toLowerCase())):e,D=(0,r.useCallback)(e=>{s(e),d(!1),p("")},[s]),N=(0,r.useCallback)(async e=>{let t=await (0,V.addRepository)({path:e});if(t.error){x(t.error),h(!1);return}if(t.repository){let e={id:t.repository.id,name:t.repository.name,path:t.repository.path};i?.(e),s(e.path),d(!1),p("")}},[i,s]),T=(0,r.useCallback)(async()=>{if(!u){if(j)return void g(!0);h(!0),x(null);try{let e=await (0,Z.pickFolder)();if(!e)return void h(!1);await N(e)}catch{g(!0)}finally{h(!1)}}},[u,j,N]),k=(0,r.useCallback)(async e=>{if(g(!1),e){h(!0),x(null);try{await N(e)}catch(e){x(e instanceof Error?e.message:"Failed to add repository")}finally{h(!1)}}},[N]);return(0,r.useEffect)(()=>{l?setTimeout(()=>b.current?.focus(),0):p("")},[l]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(_.Popover,{open:l,onOpenChange:d,children:[(0,t.jsx)(_.PopoverTrigger,{asChild:!0,children:(0,t.jsxs)("button",{type:"button",role:"combobox","aria-expanded":l,"aria-label":"Repository","aria-invalid":!!m,"aria-describedby":m?"add-repository-error-msg":void 0,disabled:o,"data-testid":"repository-combobox",className:(0,y.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",!w&&"text-muted-foreground"),children:[(0,t.jsx)("span",{className:"truncate",children:w?w.name:"Select repository..."}),(0,t.jsx)(z.ChevronsUpDown,{className:"ms-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,t.jsx)(_.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:b,placeholder:v("createDrawer.searchRepositories"),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":"repository-search"})}),(0,t.jsx)("div",{className:"max-h-48 overflow-y-auto py-1",role:"listbox","aria-label":"Repositories",children:0===C.length?(0,t.jsx)("p",{className:"text-muted-foreground px-3 py-2 text-sm","data-testid":"repository-empty",children:"No repositories found."}):C.map(e=>(0,t.jsxs)("button",{type:"button",role:"option","aria-selected":a===e.path,onClick:()=>D(e.path),className:(0,y.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)(U.CheckIcon,{className:(0,y.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)(q.Separator,{}),(0,t.jsxs)("button",{type:"button",onClick:T,disabled:u,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:[u?(0,t.jsx)($.LoaderCircle,{className:"h-4 w-4 shrink-0 animate-spin"}):(0,t.jsx)(W.FolderPlus,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{children:"Add new repository..."})]}),m?(0,t.jsx)("p",{id:"add-repository-error-msg",className:"px-3 pb-2 text-xs text-red-500",role:"alert","data-testid":"add-repository-error",children:m}):null]})})]}),(0,t.jsx)(J.ReactFileManagerDialog,{open:f,onOpenChange:e=>{e||g(!1)},onSelect:k})]})}function Q({open:e,onClose:a,onSubmit:s,repositoryPath:i,isSubmitting:o=!1,workflowDefaults:v,features:w,repositories:C,initialParentId:y,currentAgentType:D,currentModel:N,initialDescription:T,canPushDirectly:k}){let{t:S}=(0,n.useTranslation)("web"),F=function({open:e,onClose:t,onSubmit:a,repositoryPath:s,workflowDefaults:i,repositories:o,initialParentId:n,currentAgentType:l,currentModel:d,initialDescription:c,canPushDirectly:p}){let u=(0,m.useSoundAction)("create"),h=s&&(!o||0===o.length||o.some(e=>e.path===s))?s:"",v=i?.approvalGates??j,w=i?.push??!1,C=i?.openPr??!1,y=i?.ciWatchEnabled!==!1,D=i?.enableEvidence??!1,N=i?.commitEvidence??!1,T=i?.fast!==!1,[k,P]=(0,r.useState)(c??"");(0,r.useEffect)(()=>{c&&P(c)},[c]);let[S,F]=(0,r.useState)([]),[E,R]=(0,r.useState)({...v}),[L,M]=(0,r.useState)(w),[A,I]=(0,r.useState)(C),[O,z]=(0,r.useState)(i?.ciWatchEnabled!==!1),[U,B]=(0,r.useState)(D),[_,G]=(0,r.useState)(N),[W,$]=(0,r.useState)(void 0),[q,K]=(0,r.useState)(T),[V,Z]=(0,r.useState)(!1),[J,H]=(0,r.useState)(!1),[Q,X]=(0,r.useState)(!0),[Y,ee]=(0,r.useState)(!0),[et,er]=(0,r.useState)(void 0),[ea,es]=(0,r.useState)(void 0),[ei,eo]=(0,r.useState)(void 0),[en,el]=(0,r.useState)(h||void 0),[ed,ec]=(0,r.useState)(o??[]),[ep,eu]=(0,r.useState)(!1),[eh,em]=(0,r.useState)(null),[ex,ef]=(0,r.useState)(!1),eg=(0,r.useRef)(crypto.randomUUID()),eb=(0,r.useRef)(0);(0,r.useEffect)(()=>{i&&(R({...i.approvalGates}),M(i.push),I(i.openPr),z(!1!==i.ciWatchEnabled),B(i.enableEvidence),G(i.commitEvidence),K(!1!==i.fast))},[i]),(0,r.useEffect)(()=>{ec(o??[])},[o]),(0,r.useEffect)(()=>{e&&n&&$(n)},[e,n]);let[ej,ev]=(0,r.useState)(p??!1);(0,r.useEffect)(()=>{ev(p??!1)},[p]);let ew=(0,r.useRef)(en);(0,r.useEffect)(()=>{en&&en!==ew.current&&(ew.current=en,f(en).then(e=>ev(e.canPushDirectly)).catch(()=>ev(!1)))},[en]),(0,r.useEffect)(()=>{ej&&(H(!1),M(w),I(C),X(!0))},[ej,w,C]);let eC=(0,r.useCallback)(()=>{P(""),F([]),R({...v}),M(w),I(C),z(y),B(D),G(N),$(void 0),el(h||void 0),ec(o??[]),K(T),Z(!1),H(!1),X(!0),ee(!0),er(void 0),es(void 0),eo(void 0),em(null),eb.current=0,eu(!1)},[v,w,C,D,y,N,T,h,o]),ey=""!==k.trim()||S.length>0,{attemptClose:eD}=(0,x.useGuardedDrawerClose)({open:e,isDirty:ey,onClose:t,onReset:eC}),eN=(0,r.useCallback)(async e=>{for(let t of(em(null),e)){if(t.size>0xa00000)return void em(`"${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&&!b.has(e))return void em(`File type "${e}" is not allowed`)}for(let t of e){let e=crypto.randomUUID();F(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",eg.current);let a=await fetch("/api/attachments/upload",{method:"POST",body:r});if(!a.ok){let t=await a.json().catch(()=>({error:"Upload failed"}));F(t=>t.filter(t=>t.id!==e)),em(t.error??"Upload failed");return}let s=await a.json();F(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{F(t=>t.filter(t=>t.id!==e)),em("Upload failed")}}},[]),eT=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),eb.current+=1,1===eb.current&&eu(!0)},[]),ek=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),eb.current-=1,0===eb.current&&eu(!1)},[]),eP=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation()},[]),eS=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),eb.current=0,eu(!1);let t=Array.from(e.dataTransfer.files);t.length>0&&eN(t)},[eN]),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(),eN(r))},[eN]),eE=(0,r.useCallback)(e=>{if(e.preventDefault(),!k.trim())return;let t=en??h;t&&(u.play(),a({description:k.trim(),attachments:S.filter(e=>!e.loading),repositoryPath:t,approvalGates:{allowPrd:E.allowPrd??!1,allowPlan:E.allowPlan??!1,allowMerge:E.allowMerge??!1},push:!!J||L||A,openPr:!!J||A,ciWatchEnabled:O,enableEvidence:U,commitEvidence:_,fast:q,forkAndPr:J,commitSpecs:Q,rebaseBeforeBranch:Y,...V?{pending:V}:{},...et?{agentType:et}:{},...ea?{model:ea}:{},...ei?{permissionMode:ei}:{},...W?{parentId:W}:{},sessionId:eg.current}),eC())},[k,S,E,en,h,a,L,A,U,O,_,q,J,Q,Y,V,et,ea,ei,W,u,eC]),eR=(0,r.useCallback)(async()=>{try{let e=await (0,g.pickFiles)();if(!e)return;for(let t of e){let e=crypto.randomUUID();F(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:eg.current})});if(!r.ok){let t=await r.json().catch(()=>({error:"Upload failed"}));F(t=>t.filter(t=>t.id!==e)),em(t.error??"Upload failed");return}let a=await r.json();F(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{F(t=>t.filter(t=>t.id!==e)),em("Upload failed")}}}catch{}},[]),eL=(0,r.useCallback)(e=>{F(t=>t.filter(t=>t.id!==e))},[]),eM=(0,r.useCallback)((e,t)=>{F(r=>r.map(r=>r.id===e?{...r,notes:t}:r))},[]);return{validRepoPath:h,canPush:ej,isDirty:ey,computedPush:!!J||L||A,computedOpenPr:!!J||A,description:k,setDescription:P,attachments:S,approvalGates:E,setApprovalGates:R,push:L,setPush:M,openPr:A,setOpenPr:I,ciWatchEnabled:O,setCiWatchEnabled:z,enableEvidence:U,setEnableEvidence:B,commitEvidence:_,setCommitEvidence:G,parentId:W,setParentId:$,fast:q,setFast:K,pending:V,setPending:Z,forkAndPr:J,setForkAndPr:H,commitSpecs:Q,setCommitSpecs:X,rebaseBeforeBranch:Y,setRebaseBeforeBranch:ee,overrideAgent:et,setOverrideAgent:er,overrideModel:ea,setOverrideModel:es,permissionMode:ei,setPermissionMode:eo,selectedRepoPath:en,setSelectedRepoPath:el,localRepos:ed,setLocalRepos:ec,isDragOver:ep,uploadError:eh,isPromptFocused:ex,setIsPromptFocused:ef,sessionIdRef:eg,currentAgentType:l,currentModel:d,attemptClose:eD,handleFiles:eN,handleDragEnter:eT,handleDragLeave:ek,handleDragOver:eP,handleDrop:eS,handlePaste:eF,handleSubmit:eE,handleAddFiles:eR,handleRemoveFile:eL,handleNotesChange:eM,resetForm:eC}}({open:e,onClose:a,onSubmit:s,repositoryPath:i,workflowDefaults:v,repositories:C,initialParentId:y,currentAgentType:D,currentModel:N,initialDescription:T,canPushDirectly:k}),E=(0,r.useRef)(null),R=(0,r.useCallback)(e=>{(e.ctrlKey||e.metaKey)&&"Enter"===e.key&&(e.preventDefault(),E.current?.requestSubmit())},[]),L=w&&w.length>0,M=!F.validRepoPath&&void 0!==C,A=!F.validRepoPath&&!F.selectedRepoPath;return(0,t.jsx)(l.BaseDrawer,{open:e,onClose:F.attemptClose,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)(d.DrawerTitle,{children:S("createDrawer.title")})]}),o?(0,t.jsx)(d.DrawerDescription,{asChild:!0,children:(0,t.jsx)("div",{children:(0,t.jsx)(u.Badge,{variant:"secondary",children:S("createDrawer.creating")})})}):null]}),footer:(0,t.jsxs)("div",{className:"flex flex-row justify-end gap-2",children:[(0,t.jsx)(c.Button,{variant:"outline",onClick:F.attemptClose,disabled:o,children:S("createDrawer.cancel")}),(0,t.jsx)(c.Button,{type:"submit",form:"create-feature-form",disabled:!F.description.trim()||o||A,children:S(o?"createDrawer.creating":"createDrawer.createFeature")})]}),children:(0,t.jsx)("div",{className:"overflow-y-auto p-4",children:(0,t.jsx)(h.TooltipProvider,{delayDuration:400,children:(0,t.jsxs)("form",{ref:E,id:"create-feature-form",onSubmit:F.handleSubmit,onKeyDown:R,className:"flex flex-col gap-4",children:[M?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"repo-selector-section",children:[(0,t.jsx)(p.Label,{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:S("createDrawer.repository")}),(0,t.jsx)(H,{repositories:F.localRepos,value:F.selectedRepoPath,onChange:F.setSelectedRepoPath,onAddRepository:e=>{F.setLocalRepos(t=>[...t,e]),F.setSelectedRepoPath(e.path)},disabled:o})]}):F.validRepoPath?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"repo-readonly-section",children:[(0,t.jsx)(p.Label,{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:S("createDrawer.repository")}),(0,t.jsx)("p",{className:"text-sm","data-testid":"repo-readonly-label",children:C?.find(e=>e.path===F.validRepoPath)?.name??F.validRepoPath.split("/").pop()})]}):null,(0,t.jsx)(P,{description:F.description,onDescriptionChange:F.setDescription,attachments:F.attachments,onRemoveFile:F.handleRemoveFile,onNotesChange:F.handleNotesChange,onPaste:F.handlePaste,onDragEnter:F.handleDragEnter,onDragLeave:F.handleDragLeave,onDragOver:F.handleDragOver,onDrop:F.handleDrop,onAddFiles:F.handleAddFiles,isDragOver:F.isDragOver,uploadError:F.uploadError,isPromptFocused:F.isPromptFocused,onPromptFocus:()=>F.setIsPromptFocused(!0),onPromptBlur:()=>F.setIsPromptFocused(!1),fast:F.fast,onFastChange:F.setFast,pending:F.pending,onPendingChange:F.setPending,overrideAgent:F.overrideAgent,overrideModel:F.overrideModel,currentAgentType:D,currentModel:N,onAgentModelChange:(e,t)=>{F.setOverrideAgent(e),F.setOverrideModel(t)},isSubmitting:o}),L&&void 0!==y?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)(p.Label,{htmlFor:"parent-feature",className:"text-muted-foreground text-xs font-semibold tracking-wider",children:S("createDrawer.parentFeature")}),(0,t.jsx)(G,{features:w,value:F.parentId,onChange:F.setParentId,disabled:o})]}):null,(0,t.jsx)(I,{approvalGates:F.approvalGates,onApprovalGatesChange:F.setApprovalGates,enableEvidence:F.enableEvidence,onEnableEvidenceChange:F.setEnableEvidence,commitEvidence:F.commitEvidence,onCommitEvidenceChange:F.setCommitEvidence,push:F.push,onPushChange:F.setPush,openPr:F.openPr,onOpenPrChange:F.setOpenPr,ciWatchEnabled:F.ciWatchEnabled,onCiWatchChange:F.setCiWatchEnabled,rebaseBeforeBranch:F.rebaseBeforeBranch,onRebaseBeforeBranchChange:F.setRebaseBeforeBranch,commitSpecs:F.commitSpecs,onCommitSpecsChange:F.setCommitSpecs,forkAndPr:F.forkAndPr,onForkAndPrChange:F.setForkAndPr,canPush:F.canPush,fast:F.fast,computedPush:F.computedPush,computedOpenPr:F.computedOpenPr,isSubmitting:o,agentType:F.overrideAgent??D,permissionMode:F.permissionMode,onPermissionModeChange:F.setPermissionMode})]})})})})}e.s(["CreateDrawerClient",0,function({repositoryPath:e,initialParentId:i,initialDescription:n,features:l,repositories:d,workflowDefaults:c,currentAgentType:p,currentModel:u,canPushDirectly:h}){let m=(0,a.useRouter)(),[x,f]=(0,r.useState)(!1),g=(0,a.usePathname)().startsWith("/create"),b=!x&&g;(0,r.useEffect)(()=>{!g&&x&&f(!1)},[g,x]);let j=(0,r.useCallback)(()=>{m.push("/")},[m]),v=(0,r.useCallback)(e=>{f(!0),m.push("/"),o(e).then(t=>{t.error?s.toast.error(t.error):window.dispatchEvent(new CustomEvent("shipit-ai: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"),f(!1)})},[m]);return(0,t.jsx)(Q,{open:b,onClose:j,onSubmit:v,repositoryPath:e,features:l,repositories:d,workflowDefaults:c,initialParentId:i,initialDescription:n,isSubmitting:x,currentAgentType:p,currentModel:u,canPushDirectly:h})}],15203)}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,15203,e=>{"use strict";var t=e.i(96871),r=e.i(16539),a=e.i(33109),s=e.i(60112),i=e.i(96976);let o=(0,i.createServerReference)("40a061cd48b7a2c2da3901f690354129cae6a01b8a",i.callServer,void 0,i.findSourceMapURL,"createFeature");e.i(26759);var n=e.i(97164);e.i(1650);var l=e.i(11495),c=e.i(45811),d=e.i(35364),p=e.i(41957),u=e.i(81846),h=e.i(2828),m=e.i(8361),x=e.i(30153);let f=(0,i.createServerReference)("402090a84e8f04b92fdca4f891f4cb32793cb1e1b2",i.callServer,void 0,i.findSourceMapURL,"getViewerPermission");var g=e.i(42076);let b=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"]),j={allowPrd:!1,allowPlan:!1,allowMerge:!1};var v=e.i(82639),w=e.i(22570),C=e.i(45977),y=e.i(31777),D=e.i(48306),N=e.i(51911);e.i(50032);var T=e.i(86254),k=e.i(9749);function P({description:e,onDescriptionChange:a,attachments:s,onRemoveFile:i,onNotesChange:o,onPaste:l,onDragEnter:c,onDragLeave:d,onDragOver:u,onDrop:m,onAddFiles:x,isDragOver:f,uploadError:g,isPromptFocused:b,onPromptFocus:j,onPromptBlur:S,fast:F,onFastChange:E,pending:R,onPendingChange:L,overrideAgent:M,overrideModel:A,currentAgentType:I,currentModel:O,onAgentModelChange:z,isSubmitting:U}){let{t:B}=(0,n.useTranslation)("web"),_=(0,r.useRef)(null);return(0,t.jsxs)("div",{role:"region","aria-label":B("createDrawer.fileDropZone"),"data-drag-over":f?"true":"false",onDragEnter:c,onDragLeave:d,onDragOver:u,onDrop:m,className:(0,y.cn)("flex flex-col gap-1.5 rounded-md border-2 border-transparent p-1 transition-colors",f&&"border-primary/50 bg-primary/5"),children:[(0,t.jsx)(p.Label,{htmlFor:"feature-description",className:"text-muted-foreground text-xs font-semibold tracking-wider",children:B("createDrawer.describeFeature")}),(0,t.jsxs)("div",{ref:_,onFocus:j,onBlur:()=>{setTimeout(()=>{let e=_.current?.contains(document.activeElement),t=_.current?.querySelector('[aria-expanded="true"]')!==null;e||t||S()},0)},className:(0,y.cn)("border-input flex h-56 flex-col overflow-hidden rounded-md border shadow-xs transition-[color,box-shadow]",b&&"ring-ring/50 border-ring ring-[3px]"),children:[(0,t.jsx)(D.Textarea,{id:"feature-description",placeholder:B("createDrawer.featurePlaceholder"),value:e,onChange:e=>a(e.target.value),onPaste:l,required:!0,disabled:U,"aria-invalid":!!g,"aria-describedby":g?"feature-upload-error":void 0,className:"min-h-0 flex-1 resize-none rounded-none border-0 shadow-none focus-visible:ring-0"}),s.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-1.5 px-3 py-2",children:s.map(e=>(0,t.jsx)(T.AttachmentChip,{name:e.name,size:e.size,mimeType:e.mimeType,path:e.path,onRemove:()=>i(e.id),disabled:U,loading:e.loading,notes:e.notes,onNotesChange:t=>o(e.id,t)},e.id))}),g?(0,t.jsx)("p",{id:"feature-upload-error",className:"text-destructive px-3 pb-2 text-xs",role:"alert",children:g}):null,(0,t.jsxs)("div",{className:"border-input flex items-center gap-3 border-t px-3 py-1.5",children:[(0,t.jsx)(k.AgentModelPicker,{initialAgentType:M??I??"claude-code",initialModel:A??O??"claude-sonnet-4-6",mode:"override",onAgentModelChange:z,disabled:U,className:"w-55"}),(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"ml-auto flex cursor-pointer items-center gap-2",children:[(0,t.jsx)(N.Switch,{id:"pending-mode",checked:R,onCheckedChange:L,disabled:U}),(0,t.jsxs)(p.Label,{htmlFor:"pending-mode",className:"flex cursor-pointer items-center gap-1 text-sm font-medium",children:[(0,t.jsx)(C.Clock,{className:"h-3.5 w-3.5"}),B("createDrawer.pendingMode")]})]})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:B("createDrawer.pendingModeDescription")})]}),(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-2",children:[(0,t.jsx)(N.Switch,{id:"fast-mode",checked:F,onCheckedChange:E,disabled:U}),(0,t.jsxs)(p.Label,{htmlFor:"fast-mode",className:"flex cursor-pointer items-center gap-1 text-sm font-medium",children:[(0,t.jsx)(w.Zap,{className:"h-3.5 w-3.5"}),B("createDrawer.fastModeLabel")]})]})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:B("createDrawer.fastModeDescription")})]}),(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",onClick:x,disabled:U,"aria-label":B("chat.attachFiles"),className:"text-muted-foreground hover:text-foreground cursor-pointer rounded p-1 transition-colors",children:(0,t.jsx)(v.PaperclipIcon,{className:"h-4 w-4"})})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:B("chat.attachFiles")})]})]})]})]})}var S=e.i(8791),F=e.i(13867),E=e.i(96612),R=e.i(27381),L=e.i(47373);let M=(0,i.createServerReference)("40bed5069aa67bf9f032f528cd3b1601d77d0540a2",i.callServer,void 0,i.findSourceMapURL,"getAgentPermissionOptions"),A=["allowPrd","allowPlan","allowMerge"];function I({approvalGates:e,onApprovalGatesChange:r,enableEvidence:a,onEnableEvidenceChange:s,commitEvidence:i,onCommitEvidenceChange:o,push:l,onPushChange:c,openPr:d,onOpenPrChange:u,ciWatchEnabled:m,onCiWatchChange:x,rebaseBeforeBranch:f,onRebaseBeforeBranchChange:g,commitSpecs:b,onCommitSpecsChange:j,forkAndPr:v,onForkAndPrChange:w,canPush:C,fast:D,computedPush:T,computedOpenPr:k,isSubmitting:P,agentType:R,permissionMode:L,onPermissionModeChange:M}){let{t:z}=(0,n.useTranslation)("web"),U=[{id:"allowPrd",label:z("createDrawer.prd"),description:z("createDrawer.prdDescription")},{id:"allowPlan",label:z("createDrawer.plan"),description:z("createDrawer.planDescription")},{id:"allowMerge",label:z("createDrawer.merge"),description:z("createDrawer.mergeDescription")}];return(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)(h.Tooltip,{children:[(0,t.jsx)(h.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:z("createDrawer.approve")})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:z("createDrawer.approveDescription")})]}),(0,t.jsx)("div",{className:"flex flex-1 items-center gap-4",children:U.map(a=>(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(N.Switch,{id:`approve-${a.id}`,size:"sm",checked:e[a.id]??!1,onCheckedChange:t=>r({...e,[a.id]:t}),disabled:P||D&&("allowPrd"===a.id||"allowPlan"===a.id)}),(0,t.jsx)(p.Label,{htmlFor:`approve-${a.id}`,className:"cursor-pointer text-xs font-medium",children:a.label})]})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:D&&("allowPrd"===a.id||"allowPlan"===a.id)?z("createDrawer.skippedInFastMode"):a.description})]},a.id))}),(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",onClick:()=>{let t=A.every(t=>e[t]),a={};for(let e of A)a[e]=!t;r(a)},disabled:P,className:(0,y.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",A.every(t=>e[t])&&"text-primary"),children:z("createDrawer.all")})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:z("createDrawer.toggleAllApprovalGates")})]})]}),(0,t.jsxs)("div",{className:"border-input flex items-center gap-4 rounded-md border px-3 py-2.5",children:[(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.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:z("createDrawer.evidence")})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:z("createDrawer.evidenceDescription")})]}),(0,t.jsxs)("div",{className:"flex flex-1 items-center gap-4",children:[(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(N.Switch,{id:"enable-evidence",size:"sm",checked:a,onCheckedChange:e=>{s(e),e||o(!1)},disabled:P}),(0,t.jsx)(p.Label,{htmlFor:"enable-evidence",className:"cursor-pointer text-xs font-medium",children:z("createDrawer.collect")})]})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:z("createDrawer.collectDescription")})]}),(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(N.Switch,{id:"commit-evidence",size:"sm",checked:i,onCheckedChange:o,disabled:P||!a||!d&&!v}),(0,t.jsx)(p.Label,{htmlFor:"commit-evidence",className:(0,y.cn)("cursor-pointer text-xs font-medium",(!a||!d&&!v)&&"opacity-50"),children:z("createDrawer.addToPr")})]})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:d||v?a?z("createDrawer.addToPrDescription"):z("createDrawer.requiresEvidence"):z("createDrawer.requiresPr")})]})]})]}),(0,t.jsxs)("div",{className:"border-input flex items-start gap-4 rounded-md border px-3 py-2.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 pt-0.5 text-xs font-semibold tracking-wider",children:z("createDrawer.git")}),(0,t.jsxs)("div",{className:"flex flex-1 flex-wrap items-center gap-4",children:[(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(N.Switch,{id:"push",size:"sm",checked:T,onCheckedChange:e=>{c(e),!e&&d&&u(!1)},disabled:P||v}),(0,t.jsx)(p.Label,{htmlFor:"push",className:(0,y.cn)("cursor-pointer text-xs font-medium",v&&"opacity-50"),children:z("createDrawer.push")})]})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:v?"Enabled — contributing to upstream":z("createDrawer.pushDescription")})]}),(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(N.Switch,{id:"open-pr",size:"sm",checked:k,onCheckedChange:e=>{u(e),e||o(!1)},disabled:P||v}),(0,t.jsx)(p.Label,{htmlFor:"open-pr",className:(0,y.cn)("cursor-pointer text-xs font-medium",v&&"opacity-50"),children:z("createDrawer.pr")})]})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:v?"Enabled — contributing to upstream":z("createDrawer.prDescription")})]}),(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(N.Switch,{id:"ci-watch",size:"sm",checked:m,onCheckedChange:x,disabled:P}),(0,t.jsx)(p.Label,{htmlFor:"ci-watch",className:"cursor-pointer text-xs font-medium",children:z("createDrawer.watch")})]})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:z("createDrawer.watchDescription")})]}),(0,t.jsx)("div",{className:"bg-border h-4 w-px shrink-0"}),(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(N.Switch,{id:"rebase-before-branch",size:"sm",checked:f,onCheckedChange:g,disabled:P}),(0,t.jsxs)(p.Label,{htmlFor:"rebase-before-branch",className:"flex cursor-pointer items-center gap-1 text-xs font-medium",children:[(0,t.jsx)(E.RefreshCw,{className:"h-3 w-3"}),z("createDrawer.sync")]})]})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:z("createDrawer.syncDescription")})]}),(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(N.Switch,{id:"commit-specs",size:"sm",checked:b,onCheckedChange:j,disabled:P}),(0,t.jsxs)(p.Label,{htmlFor:"commit-specs",className:"flex cursor-pointer items-center gap-1 text-xs font-medium",children:[(0,t.jsx)(F.FileText,{className:"h-3 w-3"}),z("createDrawer.commitSpecs")]})]})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:z("createDrawer.commitSpecsDescription")})]}),!C&&(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(N.Switch,{id:"fork-and-pr",size:"sm",checked:v,onCheckedChange:e=>{w(e),e&&j(!1)},disabled:P}),(0,t.jsxs)(p.Label,{htmlFor:"fork-and-pr",className:"flex cursor-pointer items-center gap-1 text-xs font-medium",children:[(0,t.jsx)(S.GitFork,{className:"h-3 w-3"}),z("createDrawer.forkAndPr")]})]})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:z("createDrawer.forkAndPrDescription")})]})]})]}),R&&M?(0,t.jsx)(O,{agentType:R,permissionMode:L,onPermissionModeChange:M,isSubmitting:P}):null]})}function O({agentType:e,permissionMode:a,onPermissionModeChange:s,isSubmitting:i}){let{t:o}=(0,n.useTranslation)("web"),[l,c]=(0,r.useState)([]);return((0,r.useEffect)(()=>{let t=!1;return M(e).then(e=>{t||c(e)}),()=>{t=!0}},[e]),0===l.length)?null:(0,t.jsxs)("div",{className:"border-input flex items-center gap-4 rounded-md border px-3 py-2.5",children:[(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("span",{className:"text-muted-foreground flex w-16 shrink-0 cursor-default items-center gap-1 text-xs font-semibold tracking-wider",children:[(0,t.jsx)(R.Shield,{className:"h-3 w-3"}),o("feature.create.permissionMode")]})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:o("settings.agent.permissions.description",{agent:e})})]}),(0,t.jsx)("div",{className:"flex-1",children:(0,t.jsxs)(L.Select,{value:a??"__default__",onValueChange:e=>s("__default__"===e?void 0:e),disabled:i,children:[(0,t.jsx)(L.SelectTrigger,{id:"permission-mode","data-testid":"permission-mode-select",className:"h-7 text-xs",children:(0,t.jsx)(L.SelectValue,{})}),(0,t.jsxs)(L.SelectContent,{children:[(0,t.jsx)(L.SelectItem,{value:"__default__",children:o("feature.create.permissionModeDefault")}),l.map(e=>(0,t.jsx)(L.SelectItem,{value:e.value,children:e.label},e.value))]})]})})]})}var z=e.i(56060),U=e.i(91653),B=e.i(98127),_=e.i(90382);function G({features:e,value:a,onChange:s,disabled:i}){let{t:o}=(0,n.useTranslation)("web"),[l,c]=(0,r.useState)(!1),[d,p]=(0,r.useState)(""),u=(0,r.useRef)(null),h=e.find(e=>e.id===a),m=d.trim()?e.filter(e=>e.name.toLowerCase().includes(d.toLowerCase())||e.id.toLowerCase().includes(d.toLowerCase())):e,x=(0,r.useCallback)(e=>{s(e),c(!1),p("")},[s]);return(0,r.useEffect)(()=>{l?setTimeout(()=>u.current?.focus(),0):p("")},[l]),(0,t.jsxs)(_.Popover,{open:l,onOpenChange:c,children:[(0,t.jsx)(_.PopoverTrigger,{asChild:!0,children:(0,t.jsxs)("button",{id:"parent-feature",type:"button",role:"combobox","aria-expanded":l,"aria-label":"Parent Feature",disabled:i,"data-testid":"parent-feature-combobox",className:(0,y.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",!h&&"text-muted-foreground"),children:[(0,t.jsx)("span",{className:"truncate",children:h?`${h.name} (${h.id.slice(0,8)})`:o("createDrawer.selectParent")}),(0,t.jsx)(z.ChevronsUpDown,{className:"ms-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,t.jsx)(_.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:o("createDrawer.searchFeatures"),value:d,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:()=>x(void 0),className:(0,y.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)(U.CheckIcon,{className:(0,y.cn)("h-4 w-4 shrink-0",void 0!==a&&"invisible")}),(0,t.jsx)("span",{className:"text-muted-foreground italic",children:o("createDrawer.noParent")})]}),0===m.length&&d?(0,t.jsx)("p",{className:"text-muted-foreground px-3 py-2 text-sm",children:o("createDrawer.noFeaturesFound")}):m.map(e=>(0,t.jsxs)("button",{type:"button",role:"option","aria-selected":a===e.id,onClick:()=>x(e.id),className:(0,y.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)(U.CheckIcon,{className:(0,y.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))]})]})})]})}var W=e.i(47930),$=e.i(79561),q=e.i(25235),K=e.i(75921),V=e.i(88329),Z=e.i(78521);e.i(13322);var J=e.i(61201);function H({repositories:e,value:a,onChange:s,onAddRepository:i,disabled:o}){let[l,c]=(0,r.useState)(!1),[d,p]=(0,r.useState)(""),[u,h]=(0,r.useState)(!1),[m,x]=(0,r.useState)(null),[f,g]=(0,r.useState)(!1),b=(0,r.useRef)(null),{reactFileManager:j}=(0,K.useFeatureFlags)(),{t:v}=(0,n.useTranslation)("web"),w=e.find(e=>e.path===a),C=d.trim()?e.filter(e=>e.name.toLowerCase().includes(d.toLowerCase())||e.path.toLowerCase().includes(d.toLowerCase())):e,D=(0,r.useCallback)(e=>{s(e),c(!1),p("")},[s]),N=(0,r.useCallback)(async e=>{let t=await (0,V.addRepository)({path:e});if(t.error){x(t.error),h(!1);return}if(t.repository){let e={id:t.repository.id,name:t.repository.name,path:t.repository.path};i?.(e),s(e.path),c(!1),p("")}},[i,s]),T=(0,r.useCallback)(async()=>{if(!u){if(j)return void g(!0);h(!0),x(null);try{let e=await (0,Z.pickFolder)();if(!e)return void h(!1);await N(e)}catch{g(!0)}finally{h(!1)}}},[u,j,N]),k=(0,r.useCallback)(async e=>{if(g(!1),e){h(!0),x(null);try{await N(e)}catch(e){x(e instanceof Error?e.message:"Failed to add repository")}finally{h(!1)}}},[N]);return(0,r.useEffect)(()=>{l?setTimeout(()=>b.current?.focus(),0):p("")},[l]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(_.Popover,{open:l,onOpenChange:c,children:[(0,t.jsx)(_.PopoverTrigger,{asChild:!0,children:(0,t.jsxs)("button",{type:"button",role:"combobox","aria-expanded":l,"aria-label":"Repository","aria-invalid":!!m,"aria-describedby":m?"add-repository-error-msg":void 0,disabled:o,"data-testid":"repository-combobox",className:(0,y.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",!w&&"text-muted-foreground"),children:[(0,t.jsx)("span",{className:"truncate",children:w?w.name:"Select repository..."}),(0,t.jsx)(z.ChevronsUpDown,{className:"ms-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,t.jsx)(_.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:b,placeholder:v("createDrawer.searchRepositories"),value:d,onChange:e=>p(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===C.length?(0,t.jsx)("p",{className:"text-muted-foreground px-3 py-2 text-sm","data-testid":"repository-empty",children:"No repositories found."}):C.map(e=>(0,t.jsxs)("button",{type:"button",role:"option","aria-selected":a===e.path,onClick:()=>D(e.path),className:(0,y.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)(U.CheckIcon,{className:(0,y.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)(q.Separator,{}),(0,t.jsxs)("button",{type:"button",onClick:T,disabled:u,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:[u?(0,t.jsx)($.LoaderCircle,{className:"h-4 w-4 shrink-0 animate-spin"}):(0,t.jsx)(W.FolderPlus,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{children:"Add new repository..."})]}),m?(0,t.jsx)("p",{id:"add-repository-error-msg",className:"px-3 pb-2 text-xs text-red-500",role:"alert","data-testid":"add-repository-error",children:m}):null]})})]}),(0,t.jsx)(J.ReactFileManagerDialog,{open:f,onOpenChange:e=>{e||g(!1)},onSelect:k})]})}function Q({open:e,onClose:a,onSubmit:s,repositoryPath:i,isSubmitting:o=!1,workflowDefaults:v,features:w,repositories:C,initialParentId:y,currentAgentType:D,currentModel:N,initialDescription:T,canPushDirectly:k}){let{t:S}=(0,n.useTranslation)("web"),F=function({open:e,onClose:t,onSubmit:a,repositoryPath:s,workflowDefaults:i,repositories:o,initialParentId:n,currentAgentType:l,currentModel:c,initialDescription:d,canPushDirectly:p}){let u=(0,m.useSoundAction)("create"),h=s&&(!o||0===o.length||o.some(e=>e.path===s))?s:"",v=i?.approvalGates??j,w=i?.push??!1,C=i?.openPr??!1,y=i?.ciWatchEnabled!==!1,D=i?.enableEvidence??!1,N=i?.commitEvidence??!1,T=i?.fast!==!1,[k,P]=(0,r.useState)(d??"");(0,r.useEffect)(()=>{d&&P(d)},[d]);let[S,F]=(0,r.useState)([]),[E,R]=(0,r.useState)({...v}),[L,M]=(0,r.useState)(w),[A,I]=(0,r.useState)(C),[O,z]=(0,r.useState)(i?.ciWatchEnabled!==!1),[U,B]=(0,r.useState)(D),[_,G]=(0,r.useState)(N),[W,$]=(0,r.useState)(void 0),[q,K]=(0,r.useState)(T),[V,Z]=(0,r.useState)(!1),[J,H]=(0,r.useState)(!1),[Q,X]=(0,r.useState)(!0),[Y,ee]=(0,r.useState)(!0),[et,er]=(0,r.useState)(void 0),[ea,es]=(0,r.useState)(void 0),[ei,eo]=(0,r.useState)(void 0),[en,el]=(0,r.useState)(h||void 0),[ec,ed]=(0,r.useState)(o??[]),[ep,eu]=(0,r.useState)(!1),[eh,em]=(0,r.useState)(null),[ex,ef]=(0,r.useState)(!1),eg=(0,r.useRef)(crypto.randomUUID()),eb=(0,r.useRef)(0);(0,r.useEffect)(()=>{i&&(R({...i.approvalGates}),M(i.push),I(i.openPr),z(!1!==i.ciWatchEnabled),B(i.enableEvidence),G(i.commitEvidence),K(!1!==i.fast))},[i]),(0,r.useEffect)(()=>{ed(o??[])},[o]),(0,r.useEffect)(()=>{e&&n&&$(n)},[e,n]);let[ej,ev]=(0,r.useState)(p??!1);(0,r.useEffect)(()=>{ev(p??!1)},[p]);let ew=(0,r.useRef)(en);(0,r.useEffect)(()=>{en&&en!==ew.current&&(ew.current=en,f(en).then(e=>ev(e.canPushDirectly)).catch(()=>ev(!1)))},[en]),(0,r.useEffect)(()=>{ej&&(H(!1),M(w),I(C),X(!0))},[ej,w,C]);let eC=(0,r.useCallback)(()=>{P(""),F([]),R({...v}),M(w),I(C),z(y),B(D),G(N),$(void 0),el(h||void 0),ed(o??[]),K(T),Z(!1),H(!1),X(!0),ee(!0),er(void 0),es(void 0),eo(void 0),em(null),eb.current=0,eu(!1)},[v,w,C,D,y,N,T,h,o]),ey=""!==k.trim()||S.length>0,{attemptClose:eD}=(0,x.useGuardedDrawerClose)({open:e,isDirty:ey,onClose:t,onReset:eC}),eN=(0,r.useCallback)(async e=>{for(let t of(em(null),e)){if(t.size>0xa00000)return void em(`"${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&&!b.has(e))return void em(`File type "${e}" is not allowed`)}for(let t of e){let e=crypto.randomUUID();F(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",eg.current);let a=await fetch("/api/attachments/upload",{method:"POST",body:r});if(!a.ok){let t=await a.json().catch(()=>({error:"Upload failed"}));F(t=>t.filter(t=>t.id!==e)),em(t.error??"Upload failed");return}let s=await a.json();F(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{F(t=>t.filter(t=>t.id!==e)),em("Upload failed")}}},[]),eT=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),eb.current+=1,1===eb.current&&eu(!0)},[]),ek=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),eb.current-=1,0===eb.current&&eu(!1)},[]),eP=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation()},[]),eS=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),eb.current=0,eu(!1);let t=Array.from(e.dataTransfer.files);t.length>0&&eN(t)},[eN]),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(),eN(r))},[eN]),eE=(0,r.useCallback)(e=>{if(e.preventDefault(),!k.trim())return;let t=en??h;t&&(u.play(),a({description:k.trim(),attachments:S.filter(e=>!e.loading),repositoryPath:t,approvalGates:{allowPrd:E.allowPrd??!1,allowPlan:E.allowPlan??!1,allowMerge:E.allowMerge??!1},push:!!J||L||A,openPr:!!J||A,ciWatchEnabled:O,enableEvidence:U,commitEvidence:_,fast:q,forkAndPr:J,commitSpecs:Q,rebaseBeforeBranch:Y,...V?{pending:V}:{},...et?{agentType:et}:{},...ea?{model:ea}:{},...ei?{permissionMode:ei}:{},...W?{parentId:W}:{},sessionId:eg.current}),eC())},[k,S,E,en,h,a,L,A,U,O,_,q,J,Q,Y,V,et,ea,ei,W,u,eC]),eR=(0,r.useCallback)(async()=>{try{let e=await (0,g.pickFiles)();if(!e)return;for(let t of e){let e=crypto.randomUUID();F(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:eg.current})});if(!r.ok){let t=await r.json().catch(()=>({error:"Upload failed"}));F(t=>t.filter(t=>t.id!==e)),em(t.error??"Upload failed");return}let a=await r.json();F(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{F(t=>t.filter(t=>t.id!==e)),em("Upload failed")}}}catch{}},[]),eL=(0,r.useCallback)(e=>{F(t=>t.filter(t=>t.id!==e))},[]),eM=(0,r.useCallback)((e,t)=>{F(r=>r.map(r=>r.id===e?{...r,notes:t}:r))},[]);return{validRepoPath:h,canPush:ej,isDirty:ey,computedPush:!!J||L||A,computedOpenPr:!!J||A,description:k,setDescription:P,attachments:S,approvalGates:E,setApprovalGates:R,push:L,setPush:M,openPr:A,setOpenPr:I,ciWatchEnabled:O,setCiWatchEnabled:z,enableEvidence:U,setEnableEvidence:B,commitEvidence:_,setCommitEvidence:G,parentId:W,setParentId:$,fast:q,setFast:K,pending:V,setPending:Z,forkAndPr:J,setForkAndPr:H,commitSpecs:Q,setCommitSpecs:X,rebaseBeforeBranch:Y,setRebaseBeforeBranch:ee,overrideAgent:et,setOverrideAgent:er,overrideModel:ea,setOverrideModel:es,permissionMode:ei,setPermissionMode:eo,selectedRepoPath:en,setSelectedRepoPath:el,localRepos:ec,setLocalRepos:ed,isDragOver:ep,uploadError:eh,isPromptFocused:ex,setIsPromptFocused:ef,sessionIdRef:eg,currentAgentType:l,currentModel:c,attemptClose:eD,handleFiles:eN,handleDragEnter:eT,handleDragLeave:ek,handleDragOver:eP,handleDrop:eS,handlePaste:eF,handleSubmit:eE,handleAddFiles:eR,handleRemoveFile:eL,handleNotesChange:eM,resetForm:eC}}({open:e,onClose:a,onSubmit:s,repositoryPath:i,workflowDefaults:v,repositories:C,initialParentId:y,currentAgentType:D,currentModel:N,initialDescription:T,canPushDirectly:k}),E=(0,r.useRef)(null),R=(0,r.useCallback)(e=>{(e.ctrlKey||e.metaKey)&&"Enter"===e.key&&(e.preventDefault(),E.current?.requestSubmit())},[]),L=w&&w.length>0,M=!F.validRepoPath&&void 0!==C,A=!F.validRepoPath&&!F.selectedRepoPath;return(0,t.jsx)(l.BaseDrawer,{open:e,onClose:F.attemptClose,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)(c.DrawerTitle,{children:S("createDrawer.title")})]}),o?(0,t.jsx)(c.DrawerDescription,{asChild:!0,children:(0,t.jsx)("div",{children:(0,t.jsx)(u.Badge,{variant:"secondary",children:S("createDrawer.creating")})})}):null]}),footer:(0,t.jsxs)("div",{className:"flex flex-row justify-end gap-2",children:[(0,t.jsx)(d.Button,{variant:"outline",onClick:F.attemptClose,disabled:o,children:S("createDrawer.cancel")}),(0,t.jsx)(d.Button,{type:"submit",form:"create-feature-form",disabled:!F.description.trim()||o||A,children:S(o?"createDrawer.creating":"createDrawer.createFeature")})]}),children:(0,t.jsx)("div",{className:"overflow-y-auto p-4",children:(0,t.jsx)(h.TooltipProvider,{delayDuration:400,children:(0,t.jsxs)("form",{ref:E,id:"create-feature-form",onSubmit:F.handleSubmit,onKeyDown:R,className:"flex flex-col gap-4",children:[M?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"repo-selector-section",children:[(0,t.jsx)(p.Label,{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:S("createDrawer.repository")}),(0,t.jsx)(H,{repositories:F.localRepos,value:F.selectedRepoPath,onChange:F.setSelectedRepoPath,onAddRepository:e=>{F.setLocalRepos(t=>[...t,e]),F.setSelectedRepoPath(e.path)},disabled:o})]}):F.validRepoPath?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"repo-readonly-section",children:[(0,t.jsx)(p.Label,{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:S("createDrawer.repository")}),(0,t.jsx)("p",{className:"text-sm","data-testid":"repo-readonly-label",children:C?.find(e=>e.path===F.validRepoPath)?.name??F.validRepoPath.split("/").pop()})]}):null,(0,t.jsx)(P,{description:F.description,onDescriptionChange:F.setDescription,attachments:F.attachments,onRemoveFile:F.handleRemoveFile,onNotesChange:F.handleNotesChange,onPaste:F.handlePaste,onDragEnter:F.handleDragEnter,onDragLeave:F.handleDragLeave,onDragOver:F.handleDragOver,onDrop:F.handleDrop,onAddFiles:F.handleAddFiles,isDragOver:F.isDragOver,uploadError:F.uploadError,isPromptFocused:F.isPromptFocused,onPromptFocus:()=>F.setIsPromptFocused(!0),onPromptBlur:()=>F.setIsPromptFocused(!1),fast:F.fast,onFastChange:F.setFast,pending:F.pending,onPendingChange:F.setPending,overrideAgent:F.overrideAgent,overrideModel:F.overrideModel,currentAgentType:D,currentModel:N,onAgentModelChange:(e,t)=>{F.setOverrideAgent(e),F.setOverrideModel(t)},isSubmitting:o}),L&&void 0!==y?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)(p.Label,{htmlFor:"parent-feature",className:"text-muted-foreground text-xs font-semibold tracking-wider",children:S("createDrawer.parentFeature")}),(0,t.jsx)(G,{features:w,value:F.parentId,onChange:F.setParentId,disabled:o})]}):null,(0,t.jsx)(I,{approvalGates:F.approvalGates,onApprovalGatesChange:F.setApprovalGates,enableEvidence:F.enableEvidence,onEnableEvidenceChange:F.setEnableEvidence,commitEvidence:F.commitEvidence,onCommitEvidenceChange:F.setCommitEvidence,push:F.push,onPushChange:F.setPush,openPr:F.openPr,onOpenPrChange:F.setOpenPr,ciWatchEnabled:F.ciWatchEnabled,onCiWatchChange:F.setCiWatchEnabled,rebaseBeforeBranch:F.rebaseBeforeBranch,onRebaseBeforeBranchChange:F.setRebaseBeforeBranch,commitSpecs:F.commitSpecs,onCommitSpecsChange:F.setCommitSpecs,forkAndPr:F.forkAndPr,onForkAndPrChange:F.setForkAndPr,canPush:F.canPush,fast:F.fast,computedPush:F.computedPush,computedOpenPr:F.computedOpenPr,isSubmitting:o,agentType:F.overrideAgent??D,permissionMode:F.permissionMode,onPermissionModeChange:F.setPermissionMode})]})})})})}e.s(["CreateDrawerClient",0,function({repositoryPath:e,initialParentId:i,initialDescription:n,features:l,repositories:c,workflowDefaults:d,currentAgentType:p,currentModel:u,canPushDirectly:h}){let m=(0,a.useRouter)(),[x,f]=(0,r.useState)(!1),g=(0,a.usePathname)().startsWith("/create"),b=!x&&g;(0,r.useEffect)(()=>{!g&&x&&f(!1)},[g,x]);let j=(0,r.useCallback)(()=>{m.push("/")},[m]),v=(0,r.useCallback)(e=>{f(!0),m.push("/"),o(e).then(t=>{t.error?s.toast.error(t.error):window.dispatchEvent(new CustomEvent("shipit-ai: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"),f(!1)})},[m]);return(0,t.jsx)(Q,{open:b,onClose:j,onSubmit:v,repositoryPath:e,features:l,repositories:c,workflowDefaults:d,initialParentId:i,initialDescription:n,isSubmitting:x,currentAgentType:p,currentModel:u,canPushDirectly:h})}],15203)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,84735,e=>{"use strict";let t=(0,e.i(54864).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",0,t],84735)},70727,e=>{"use strict";let t=(0,e.i(54864).default)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);e.s(["Terminal",0,t],70727)},60589,e=>{"use strict";let t=(0,e.i(54864).default)("git-branch",[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]]);e.s(["GitBranch",0,t],60589)},63995,e=>{"use strict";let t=(0,e.i(54864).default)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);e.s(["default",0,t])},29549,e=>{"use strict";let t=(0,e.i(54864).default)("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);e.s(["Circle",0,t],29549)},81481,e=>{"use strict";let t=(0,e.i(54864).default)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);e.s(["Info",0,t],81481)},79558,e=>{"use strict";var t=e.i(88641);e.s(["Download",()=>t.default])},86024,e=>{"use strict";let t=(0,e.i(54864).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"}]]);e.s(["Package",0,t],86024)},89048,e=>{"use strict";let t=(0,e.i(54864).default)("rocket",[["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}],["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-.09",key:"u4xsad"}],["path",{d:"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z",key:"676m9"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05",key:"92ym6u"}]]);e.s(["Rocket",0,t],89048)},44412,e=>{"use strict";var t=e.i(96871),a=e.i(16539),s=e.i(43606),l=e.i(68304),r=e.i(31777),n=e.i(79561),i=e.i(89048),o=e.i(79558),d=e.i(66358),c=e.i(29549),m=e.i(46380),x=e.i(86024),u=e.i(81481),h=e.i(63995),h=h,p=e.i(35364),g=e.i(2828),f=e.i(67088),j=e.i(85149),b=e.i(84735);let N=(0,e.i(54864).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 k=e.i(70727),v=e.i(60589),w=e.i(11495);let y={linux:"Linux",darwin:"macOS",win32:"Windows"},C={ide:{label:"IDE",icon:N},"cli-agent":{label:"CLI Agent",icon:k.Terminal},vcs:{label:"VCS",icon:v.GitBranch},terminal:{label:"Terminal",icon:k.Terminal}};function T({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)(j.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 I({tool:e,open:s,onClose:l,onRefresh:r,autoStart:d}){let[c,m]=(0,a.useState)(!1),[u,h]=(0,a.useState)(!1),{logs:g,status:k,startInstall:v}=function(e){let[t,s]=(0,a.useState)([]),[l,r]=(0,a.useState)("idle"),[n,i]=(0,a.useState)(null),o=(0,a.useRef)(null),d=(0,a.useCallback)(()=>{o.current&&(o.current.close(),o.current=null)},[]);return(0,a.useEffect)(()=>d,[d]),{logs:t,status:l,result:n,startInstall:(0,a.useCallback)(()=>{d(),s([]),i(null),r("streaming");let t=new EventSource(`/api/tools/${e}/install/stream`);o.current=t,t.onmessage=e=>{s(t=>[...t,e.data])},t.addEventListener("done",e=>{let t=JSON.parse(e.data);i(t),r("error"===t.status?"error":"done"),d()}),t.onerror=()=>{r("error"),d()}},[e,d])}}(e.id),S=(0,a.useRef)(null),M=(0,a.useRef)(!0),z=(0,a.useRef)(!1),L="available"===e.status.status,E="error"===e.status.status,P=L&&!!e.openDirectory,B=!L&&!E&&e.autoInstall;async function V(){h(!0);try{await fetch(`/api/tools/${e.id}/launch`,{method:"POST"})}finally{h(!1)}}(0,a.useEffect)(()=>{s&&d&&B&&"idle"===k&&!z.current&&(z.current=!0,v()),s||(z.current=!1)},[s,d,B,k,v]);let D=(0,a.useCallback)(()=>{let e=S.current;e&&(M.current=e.scrollTop+e.clientHeight>=e.scrollHeight-50)},[]);(0,a.useEffect)(()=>{M.current&&S.current&&(S.current.scrollTop=S.current.scrollHeight)},[g,k]),(0,a.useEffect)(()=>{"done"===k&&r&&r()},[k,r]);let R=(0,t.jsxs)("div",{className:"flex flex-col gap-1.5 pe-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"}):(0,t.jsx)(x.Package,{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)(T,{status:e.status.status})]}),(0,t.jsx)("div",{className:"flex items-center gap-2",children:e.tags.map(e=>{let a=C[e]??{label:e,icon:N},s=a.icon;return(0,t.jsxs)("span",{className:"text-muted-foreground/70 inline-flex items-center gap-0.5 text-[10px]",children:[(0,t.jsx)(s,{className:"h-3 w-3"}),a.label]},e)})})]});return(0,t.jsx)(w.BaseDrawer,{open:s,onClose:l,size:"md",modal:!0,title:e.name,header:R,"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=>y[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 pe-16 font-mono text-xs leading-relaxed break-all whitespace-pre-wrap",children:(0,t.jsx)("code",{children:e.installCommand})}),(0,t.jsxs)(p.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":c?"Copied!":"Copy install command",children:[c?(0,t.jsx)(j.Check,{className:"h-3.5 w-3.5 text-emerald-500"}):(0,t.jsx)(f.Copy,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{className:"ms-1 text-[10px]",children:c?"Copied!":"Copy"})]})]})]}):null,(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[B?(0,t.jsxs)(p.Button,{size:"sm",onClick:v,disabled:"streaming"===k,"aria-label":`Install ${e.name}`,className:"cursor-pointer",children:["streaming"===k?(0,t.jsx)(n.LoaderCircle,{className:"me-1.5 h-3.5 w-3.5 animate-spin"}):(0,t.jsx)(o.Download,{className:"me-1.5 h-3.5 w-3.5"}),"streaming"===k?"Installing...":"Install"]}):null,P?(0,t.jsxs)(p.Button,{size:"sm",variant:"outline",onClick:()=>void V(),disabled:u,"aria-label":`Launch ${e.name}`,className:"cursor-pointer",children:[u?(0,t.jsx)(n.LoaderCircle,{className:"me-1.5 h-3.5 w-3.5 animate-spin"}):(0,t.jsx)(i.Rocket,{className:"me-1.5 h-3.5 w-3.5"}),"Launch"]}):null,e.documentationUrl?(0,t.jsx)(p.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)(b.ExternalLink,{className:"ms-1 h-3 w-3"})]})}):null]}),("streaming"===k||"done"===k||"error"===k)&&g.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:S,onScroll:D,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:[g.map((e,a)=>(0,t.jsx)("div",{className:"break-all whitespace-pre-wrap",children:e},a)),"done"===k?(0,t.jsx)("div",{className:"mt-2 border-t border-zinc-700 pt-2 text-emerald-400",children:"Installation complete"}):null,"error"===k?(0,t.jsx)("div",{className:"mt-2 border-t border-zinc-700 pt-2 text-red-400",children:"Installation failed"}):null]})]}):null]})})}let S={ide:"IDE","cli-agent":"CLI Agent",vcs:"VCS",terminal:"Terminal"};function M({tool:e,onRefresh:s,className:l}){let[f,j]=(0,a.useState)(!1),[b,N]=(0,a.useState)(!1),[k,v]=(0,a.useTransition)(),w="available"===e.status.status,y="error"===e.status.status,C=w&&!!e.openDirectory;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{"data-testid":"tool-card",onClick:function(){N(!1),j(!0)},className:(0,r.cn)("bg-card editorial-shadow group flex w-full cursor-pointer flex-col gap-4 rounded-xl p-5","transition-all duration-300 hover:-translate-y-0.5 hover:shadow-md hover:ring-slate-300 dark:hover:ring-slate-600",l),children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,t.jsx)("div",{className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-lg bg-slate-100 p-2 ring-1 ring-slate-200/50 dark:bg-slate-800 dark:ring-slate-700/50",children:e.iconUrl?(0,t.jsx)("img",{src:e.iconUrl,alt:"",width:28,height:28,className:"h-full w-full"}):(0,t.jsx)(x.Package,{className:"text-muted-foreground h-full w-full"})}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("h3",{"data-testid":"tool-card-name",className:"text-foreground truncate text-sm leading-tight font-bold tracking-tight",children:e.name}),e.author?(0,t.jsxs)("div",{className:"mt-1 flex items-center gap-1.5",children:[(0,t.jsx)("span",{"data-testid":"tool-card-vendor-label",className:"text-[9px] font-bold tracking-wider text-slate-400 uppercase",children:"Vendor"}),(0,t.jsx)("span",{"data-testid":"tool-card-vendor",className:"text-muted-foreground truncate text-xs font-medium",children:e.author})]}):e.tags.length>0?(0,t.jsxs)("div",{className:"mt-1 flex items-center gap-1.5",children:[(0,t.jsx)("span",{className:"text-[9px] font-bold tracking-wider text-slate-400 uppercase",children:"Tag"}),(0,t.jsx)("span",{"data-testid":"tool-card-tags",className:"text-muted-foreground truncate text-xs font-medium",children:e.tags.map(e=>S[e]??e).join(" · ")})]}):null]})]}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[y&&"error"===e.status.status?(0,t.jsxs)("span",{className:"flex items-center gap-1 text-[10px] font-medium text-red-600 dark:text-red-400",title:e.status.errorMessage,children:[(0,t.jsx)(d.CircleX,{className:"h-3 w-3 shrink-0"}),"Error"]}):w?(0,t.jsxs)("span",{className:"flex items-center gap-1 text-[10px] font-medium text-emerald-600 dark:text-emerald-400",children:[(0,t.jsx)(m.CircleCheck,{className:"h-3 w-3"}),"Installed"]}):(0,t.jsxs)("span",{className:"text-muted-foreground flex items-center gap-1 text-[10px] font-medium",children:[(0,t.jsx)(c.Circle,{className:"h-3 w-3"}),"Not installed"]}),e.required?(0,t.jsx)(g.TooltipProvider,{children:(0,t.jsxs)(g.Tooltip,{children:[(0,t.jsx)(g.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"shrink-0 rounded-full bg-amber-100 px-2 py-0.5 text-[9px] font-bold tracking-wider text-amber-700 uppercase dark:bg-amber-900/40 dark:text-amber-400",children:"Required"})}),(0,t.jsx)(g.TooltipContent,{side:"top",children:"This tool is required for ShipIT to function properly"})]})}):null]})]}),(0,t.jsx)("p",{"data-testid":"tool-card-summary",className:"text-muted-foreground -mt-2 line-clamp-2 text-xs leading-relaxed",children:e.summary}),(0,t.jsx)("div",{className:"mt-auto flex flex-col gap-1.5",children:w&&C?(0,t.jsxs)(p.Button,{variant:"default",onClick:function(t){t.stopPropagation(),v(async()=>{await fetch(`/api/tools/${e.id}/launch`,{method:"POST"})})},disabled:k,"aria-label":`Launch ${e.name}`,"data-testid":"tool-card-launch-button",className:"h-9 w-full cursor-pointer rounded-lg text-xs font-bold tracking-wide transition-all duration-300 hover:-translate-y-0.5 hover:shadow-md",children:[k?(0,t.jsx)(n.LoaderCircle,{className:"me-1 h-3.5 w-3.5 animate-spin"}):(0,t.jsx)(i.Rocket,{className:"me-1 h-3.5 w-3.5"}),"Launch"]}):w||y?y?(0,t.jsxs)(p.Button,{variant:"outline",onClick:e=>{e.stopPropagation(),N(!1),j(!0)},"aria-label":`View error details for ${e.name}`,"data-testid":"tool-card-error-button",className:"h-9 w-full cursor-pointer rounded-lg border-red-300 text-xs font-bold tracking-wide text-red-600 transition-all duration-300 hover:-translate-y-0.5 hover:bg-red-50 hover:shadow-md dark:border-red-900 dark:text-red-400 dark:hover:bg-red-950/30",children:[(0,t.jsx)(h.default,{className:"me-1 h-3.5 w-3.5"}),"View Error"]}):(0,t.jsxs)(p.Button,{variant:"outline",onClick:e=>{e.stopPropagation(),N(!1),j(!0)},"aria-label":`View details for ${e.name}`,"data-testid":"tool-card-details-button",className:"h-9 w-full cursor-pointer rounded-lg text-xs font-bold tracking-wide transition-all duration-300 hover:-translate-y-0.5 hover:shadow-md",children:[(0,t.jsx)(u.Info,{className:"me-1 h-3.5 w-3.5"}),"View Details"]}):(0,t.jsxs)(p.Button,{variant:"default",onClick:function(t){t.stopPropagation(),N(e.autoInstall),j(!0)},"aria-label":`Install ${e.name}`,"data-testid":"tool-card-install-button",className:"h-9 w-full cursor-pointer rounded-lg text-xs font-bold tracking-wide transition-all duration-300 hover:-translate-y-0.5 hover:shadow-md",children:[(0,t.jsx)(o.Download,{className:"me-1 h-3.5 w-3.5"}),"Install"]})})]}),(0,t.jsx)(I,{tool:e,open:f,onClose:()=>j(!1),onRefresh:s,autoStart:b})]})}let z={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")};e.s(["ToolsPageClient",0,function({tools:e,className:n}){let[i,o]=(0,a.useState)(e),[d,c]=(0,a.useState)("all"),m=(0,a.useCallback)(async()=>{try{let e=await fetch("/api/tools");if(e.ok){let t=await e.json();o(t)}}catch{}},[]),x=i.filter(z[d]),u=i.filter(e=>"available"===e.status.status).length;return(0,t.jsxs)("div",{"data-testid":"tools-page-client",className:(0,r.cn)("space-y-8",n),children:[(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("div",{className:"flex items-center gap-2",children:(0,t.jsx)("span",{className:"text-[10px] font-bold tracking-[0.2em] text-slate-400 uppercase",children:"Developer Portal"})}),(0,t.jsxs)("div",{className:"flex items-baseline gap-3",children:[(0,t.jsx)("h1",{className:"text-foreground text-3xl font-black tracking-tight",children:"Tools"}),(0,t.jsxs)("span",{className:"text-muted-foreground text-sm font-medium",children:[u," of ",i.length," installed"]})]})]}),(0,t.jsxs)(l.Tabs,{value:d,onValueChange:e=>c(e),"data-testid":"tools-page-tabs",children:[(0,t.jsxs)(l.TabsList,{"data-editorial":"true",className:"bg-card editorial-shadow h-10 p-1",children:[(0,t.jsx)(l.TabsTrigger,{value:"all","data-testid":"tools-tab-all",className:"cursor-pointer px-4 text-xs font-bold",children:"All"}),(0,t.jsx)(l.TabsTrigger,{value:"ide","data-testid":"tools-tab-ide",className:"cursor-pointer px-4 text-xs font-bold",children:"IDEs"}),(0,t.jsx)(l.TabsTrigger,{value:"cli-agent","data-testid":"tools-tab-cli-agent",className:"cursor-pointer px-4 text-xs font-bold",children:"CLI Agents"}),(0,t.jsx)(l.TabsTrigger,{value:"vcs","data-testid":"tools-tab-vcs",className:"cursor-pointer px-4 text-xs font-bold",children:"Version Control"}),(0,t.jsx)(l.TabsTrigger,{value:"terminal","data-testid":"tools-tab-terminal",className:"cursor-pointer px-4 text-xs font-bold",children:"Terminals"})]}),(0,t.jsx)(l.TabsContent,{value:d,className:"mt-6",children:0===x.length?(0,t.jsxs)("div",{"data-testid":"tools-page-empty",className:"text-muted-foreground flex flex-col items-center justify-center py-16 text-center",children:[(0,t.jsx)(s.Wrench,{className:"mb-3 h-8 w-8 opacity-20"}),(0,t.jsx)("p",{className:"text-sm",children:"No tools in this category."})]}):(0,t.jsx)("div",{"data-testid":"tools-page-grid",className:"grid grid-cols-1 gap-6 md:grid-cols-2 xl:grid-cols-3",children:x.map(e=>(0,t.jsx)(M,{tool:e,onRefresh:m},e.id))})})]})]})}],44412)}]);
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,84735,e=>{"use strict";let t=(0,e.i(54864).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",0,t],84735)},70727,e=>{"use strict";let t=(0,e.i(54864).default)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);e.s(["Terminal",0,t],70727)},1650,e=>{"use strict";e.i(11495),e.s([])},51911,e=>{"use strict";var t=e.i(96871),a=e.i(16539),s=e.i(91967),l=e.i(22353),n=e.i(9413),i=e.i(36567),r=e.i(9641),d=e.i(70391),o=e.i(85565),c="Switch",[u,p]=(0,n.createContextScope)(c),[x,m]=u(c),f=a.forwardRef((e,n)=>{let{__scopeSwitch:r,name:d,checked:u,defaultChecked:p,required:m,disabled:f,value:g="on",onCheckedChange:h,form:b,...y}=e,[w,N]=a.useState(null),k=(0,l.useComposedRefs)(n,e=>N(e)),S=a.useRef(!1),C=!w||b||!!w.closest("form"),[P,R]=(0,i.useControllableState)({prop:u,defaultProp:p??!1,onChange:h,caller:c});return(0,t.jsxs)(x,{scope:r,checked:P,disabled:f,children:[(0,t.jsx)(o.Primitive.button,{type:"button",role:"switch","aria-checked":P,"aria-required":m,"data-state":j(P),"data-disabled":f?"":void 0,disabled:f,value:g,...y,ref:k,onClick:(0,s.composeEventHandlers)(e.onClick,e=>{R(e=>!e),C&&(S.current=e.isPropagationStopped(),S.current||e.stopPropagation())})}),C&&(0,t.jsx)(v,{control:w,bubbles:!S.current,name:d,value:g,checked:P,required:m,disabled:f,form:b,style:{transform:"translateX(-100%)"}})]})});f.displayName=c;var g="SwitchThumb",h=a.forwardRef((e,a)=>{let{__scopeSwitch:s,...l}=e,n=m(g,s);return(0,t.jsx)(o.Primitive.span,{"data-state":j(n.checked),"data-disabled":n.disabled?"":void 0,...l,ref:a})});h.displayName=g;var v=a.forwardRef(({__scopeSwitch:e,control:s,checked:n,bubbles:i=!0,...o},c)=>{let u=a.useRef(null),p=(0,l.useComposedRefs)(u,c),x=(0,r.usePrevious)(n),m=(0,d.useSize)(s);return a.useEffect(()=>{let e=u.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(x!==n&&t){let a=new Event("click",{bubbles:i});t.call(e,n),e.dispatchEvent(a)}},[x,n,i]),(0,t.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:p,style:{...o.style,...m,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function j(e){return e?"checked":"unchecked"}v.displayName="SwitchBubbleInput",e.s(["Root",0,f,"Switch",0,f,"SwitchThumb",0,h,"Thumb",0,h,"createSwitchScope",0,p],76587);var b=e.i(76587),b=b,y=e.i(31777);e.s(["Switch",0,function({className:e,size:a="default",...s}){return(0,t.jsx)(b.Root,{"data-slot":"switch","data-size":a,className:(0,y.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)(b.Thumb,{"data-slot":"switch-thumb",className:(0,y.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 rtl:data-[state=checked]:-translate-x-[calc(100%-2px)]")})})}],51911)},956,e=>{"use strict";var t=e.i(96871),a=e.i(16539),s=e.i(31777);let l=a.forwardRef(({className:e,...a},l)=>(0,t.jsx)("div",{ref:l,className:(0,s.cn)("bg-card text-card-foreground editorial-shadow rounded-xl border",e),...a}));l.displayName="Card";let n=a.forwardRef(({className:e,...a},l)=>(0,t.jsx)("div",{ref:l,className:(0,s.cn)("flex flex-col space-y-1.5 p-6",e),...a}));n.displayName="CardHeader";let i=a.forwardRef(({className:e,...a},l)=>(0,t.jsx)("div",{ref:l,className:(0,s.cn)("leading-none font-semibold tracking-tight",e),...a}));i.displayName="CardTitle";let r=a.forwardRef(({className:e,...a},l)=>(0,t.jsx)("div",{ref:l,className:(0,s.cn)("text-muted-foreground text-sm",e),...a}));r.displayName="CardDescription";let d=a.forwardRef(({className:e,...a},l)=>(0,t.jsx)("div",{ref:l,className:(0,s.cn)("p-6 pt-0",e),...a}));d.displayName="CardContent",a.forwardRef(({className:e,...a},l)=>(0,t.jsx)("div",{ref:l,className:(0,s.cn)("flex items-center p-6 pt-0",e),...a})).displayName="CardFooter",e.s(["Card",0,l,"CardContent",0,d,"CardDescription",0,r,"CardHeader",0,n,"CardTitle",0,i])},54793,7729,e=>{"use strict";var t=e.i(96871),a=e.i(31777);e.s(["EmptyState",0,function({icon:e,title:s,description:l,action:n,className:i,...r}){return(0,t.jsxs)("div",{className:(0,a.cn)("flex flex-col items-center gap-4 px-4 py-12 text-center",i),...r,children:[e?(0,t.jsx)("div",{className:"text-muted-foreground",children:e}):null,(0,t.jsx)("h3",{className:"text-lg font-semibold",children:s}),l?(0,t.jsx)("p",{className:"text-muted-foreground max-w-md text-sm",children:l}):null,n?(0,t.jsx)("div",{className:"mt-2",children:n}):null]})}],7729),e.s([],54793)},9443,85871,e=>{"use strict";var t=e.i(96871),a=e.i(31777);e.s(["PageHeader",0,function({title:e,description:s,eyebrow:l,children:n,className:i}){return(0,t.jsxs)("header",{className:(0,a.cn)("flex items-center justify-between gap-4",i),children:[(0,t.jsxs)("div",{className:"space-y-1.5",children:[l?(0,t.jsx)("span",{className:"text-[10px] font-bold tracking-[0.2em] text-slate-400 uppercase",children:l}):null,(0,t.jsx)("div",{className:"flex items-baseline gap-3",children:(0,t.jsx)("h1",{className:"text-foreground text-3xl font-black tracking-tight",children:e})}),s?(0,t.jsx)("p",{className:"text-muted-foreground text-sm font-medium",children:s}):null]}),n?(0,t.jsx)("div",{"data-slot":"actions",children:n}):null]})}],85871),e.s([],9443)},26530,e=>{"use strict";var t=e.i(96871),a=e.i(16539),s=e.i(68787),l=e.i(47952),n=e.i(23835),n=n,i=e.i(60112),r=e.i(98127),d=e.i(35364);e.i(9443);var o=e.i(85871);e.i(54793);var c=e.i(7729),u=e.i(956),p=e.i(81846),x=e.i(51911);e.i(26759);var m=e.i(97164);function f({plugin:e,installed:a,onSelect:s,onToggle:l}){let{t:n}=(0,m.useTranslation)("web");return(0,t.jsxs)(u.Card,{className:"cursor-pointer p-5 transition-all duration-300 hover:scale-[1.02] hover:shadow-md hover:ring-slate-300 dark:hover:ring-slate-600",role:"button",tabIndex:0,onClick:()=>s(e),onKeyDown:t=>{("Enter"===t.key||" "===t.key)&&(t.preventDefault(),s(e))},"data-testid":`plugin-card-${e.name}`,children:[(0,t.jsx)("h3",{className:"text-foreground text-sm leading-tight font-bold tracking-tight",children:e.name}),e.version?(0,t.jsxs)("p",{className:"text-muted-foreground mt-1 font-mono text-xs",children:["v",e.version]}):null,(0,t.jsx)("p",{className:"text-muted-foreground mt-3 line-clamp-2 text-xs leading-relaxed",children:e.description}),(0,t.jsxs)("div",{className:"mt-4 flex flex-wrap items-center gap-1.5",children:[e.category?(0,t.jsx)(p.Badge,{variant:"outline",children:e.category}):null,a?(0,t.jsx)(p.Badge,{variant:"secondary",children:n("plugins.installed")}):(0,t.jsx)(p.Badge,{variant:"outline",className:"opacity-50",children:n("plugins.notInstalled")})]}),a?(0,t.jsxs)("div",{className:"mt-3 flex items-center gap-2",onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),children:[(0,t.jsx)(x.Switch,{checked:a.enabled,onCheckedChange:t=>l?.(e.name,t),"data-testid":`plugin-toggle-${e.name}`}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:n(a.enabled?"plugins.disable":"plugins.enable")})]}):null]})}e.i(1650);var g=e.i(11495),h=e.i(45811),v=e.i(25235),j=e.i(84735);function b({plugin:e,installed:a,open:s,onClose:l,onInstall:n,onUninstall:i}){let{t:r}=(0,m.useTranslation)("web");if(!e)return null;let o=function(e){let{source:t}=e;if("github"===t.source&&t.repo)return`https://github.com/${t.repo}`;if(("url"===t.source||"git-subdir"===t.source)&&t.url)try{let e=new URL(t.url);if("https:"===e.protocol)return t.url}catch{}return null}(e);return(0,t.jsxs)(g.BaseDrawer,{open:s,onClose:l,children:[(0,t.jsx)(h.DrawerTitle,{className:"text-foreground text-lg font-bold tracking-tight",children:e.name}),(0,t.jsx)(h.DrawerDescription,{className:"text-muted-foreground mt-1 text-sm",children:e.description}),(0,t.jsx)(v.Separator,{className:"my-4"}),(0,t.jsxs)("div",{className:"space-y-3",children:[e.version?(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-sm",children:r("plugins.version")}),(0,t.jsxs)("span",{className:"font-mono text-sm",children:["v",e.version]})]}):null,e.category?(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-sm",children:r("plugins.category")}),(0,t.jsx)(p.Badge,{variant:"outline",children:e.category})]}):null,o?(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-sm",children:r("plugins.source")}),(0,t.jsxs)("a",{href:o,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:text-primary/80 inline-flex items-center gap-1 text-sm underline underline-offset-2",children:[e.source.repo??"Repository",(0,t.jsx)(j.ExternalLink,{className:"size-3"})]})]}):null,e.keywords&&e.keywords.length>0?(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5 pt-2",children:e.keywords.map(e=>(0,t.jsx)(p.Badge,{variant:"outline",className:"text-xs",children:e},e))}):null]}),(0,t.jsx)(v.Separator,{className:"my-4"}),(0,t.jsx)("div",{className:"flex gap-2",children:a?(0,t.jsx)(d.Button,{variant:"destructive",size:"sm",onClick:()=>i?.(e.name),"data-testid":"plugin-uninstall-button",children:r("plugins.uninstall")}):(0,t.jsx)(d.Button,{size:"sm",onClick:()=>n?.(e.name),"data-testid":"plugin-install-button",children:r("plugins.install")})})]})}var y=e.i(96976);let w=(0,y.createServerReference)("00da62707810c406ed40610f92bdac3586b04fee34",y.callServer,void 0,y.findSourceMapURL,"fetchPluginCatalogAction"),N=(0,y.createServerReference)("70d00550e026d5ba89cddaa41ba5ff5abd1683eebc",y.callServer,void 0,y.findSourceMapURL,"installPluginAction"),k=(0,y.createServerReference)("60ea2373eac1be7049a20497feee7c17f0bcf4645a",y.callServer,void 0,y.findSourceMapURL,"uninstallPluginAction"),S=(0,y.createServerReference)("703fede651fd52d1987d6855237a454290200ef692",y.callServer,void 0,y.findSourceMapURL,"togglePluginAction");e.s(["PluginsPageClient",0,function({proxyConfigured:e,isClaudeCode:u}){let{t:p}=(0,m.useTranslation)("web"),[,x]=(0,a.useTransition)(),[g,h]=(0,a.useState)(""),[v,j]=(0,a.useState)(null),[y,C]=(0,a.useState)(null),[P,R]=(0,a.useState)(null),[z,T]=(0,a.useState)([]),[B,D]=(0,a.useState)([]),[E,H]=(0,a.useState)(!0);(0,a.useEffect)(()=>{e?w().then(e=>{T(e.plugins),D(e.installedPlugins),H(!1)}):H(!1)},[e]);let L=(0,a.useMemo)(()=>{let e=new Set;for(let t of z)t.category&&e.add(t.category);return Array.from(e).sort()},[z]),M=(0,a.useMemo)(()=>{let e=g.toLowerCase();return z.filter(t=>{if(v&&t.category!==v)return!1;if(y){let e=!!B.find(e=>e.id.startsWith(`${t.name}@`));if("installed"===y&&!e||"not-installed"===y&&e)return!1}if(e){let a=t.name.toLowerCase().includes(e),s=t.description.toLowerCase().includes(e);if(!a&&!s)return!1}return!0})},[z,g,v,y,B]),A=e=>B.find(t=>t.id.startsWith(`${e}@`)),I=(e,t)=>{x(async()=>{let a=await S(e,"default",t);a.success?(i.toast.success(`${e} ${t?"enabled":"disabled"}`),D((await w()).installedPlugins)):i.toast.error(a.error??"Toggle failed")})};return u?e?E?(0,t.jsxs)("div",{className:"flex flex-col gap-8 p-8",children:[(0,t.jsx)(o.PageHeader,{eyebrow:"Developer Portal",title:p("plugins.title")}),(0,t.jsxs)("div",{className:"text-muted-foreground text-center text-sm",children:[p("accessibility.loading"),"..."]})]}):0===z.length?(0,t.jsxs)("div",{className:"flex flex-col gap-8 p-8",children:[(0,t.jsx)(o.PageHeader,{eyebrow:"Developer Portal",title:p("plugins.title")}),(0,t.jsx)(c.EmptyState,{icon:(0,t.jsx)(l.Blocks,{className:"size-10"}),title:p("plugins.emptyState")})]}):(0,t.jsxs)("div",{className:"flex flex-col gap-8 p-8",children:[(0,t.jsx)(o.PageHeader,{eyebrow:"Developer Portal",title:p("plugins.title")}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(s.Search,{className:"text-muted-foreground absolute top-1/2 left-3 size-4 -translate-y-1/2"}),(0,t.jsx)(r.Input,{placeholder:p("plugins.searchPlaceholder"),value:g,onChange:e=>h(e.target.value),className:"ps-9","data-testid":"plugin-search"})]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)(d.Button,{variant:null===v?"default":"outline",size:"sm",onClick:()=>j(null),children:p("plugins.allCategories")}),L.map(e=>(0,t.jsx)(d.Button,{variant:v===e?"default":"outline",size:"sm",onClick:()=>j(e===v?null:e),children:e},e))]}),(0,t.jsx)("div",{className:"bg-border h-6 w-px"}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)(d.Button,{variant:null===y?"default":"outline",size:"sm",onClick:()=>C(null),children:"All Status"}),(0,t.jsx)(d.Button,{variant:"installed"===y?"default":"outline",size:"sm",onClick:()=>C("installed"===y?null:"installed"),children:p("plugins.installed")}),(0,t.jsx)(d.Button,{variant:"not-installed"===y?"default":"outline",size:"sm",onClick:()=>C("not-installed"===y?null:"not-installed"),children:p("plugins.notInstalled")})]})]}),M.length>0?(0,t.jsx)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:M.map(e=>(0,t.jsx)(f,{plugin:e,installed:A(e.name),onSelect:R,onToggle:I},e.name))}):(0,t.jsx)(c.EmptyState,{icon:(0,t.jsx)(s.Search,{className:"size-10"}),title:p("plugins.emptyState"),action:(0,t.jsx)(d.Button,{variant:"outline",onClick:()=>{h(""),j(null),C(null)},children:p("plugins.clearFilters")})}),(0,t.jsx)(b,{plugin:P,installed:P?A(P.name):void 0,open:!!P,onClose:()=>R(null),onInstall:e=>{x(async()=>{let t=await N(e,"default");t.success?(i.toast.success(`${e} installed`),D((await w()).installedPlugins)):i.toast.error(t.error??"Installation failed")})},onUninstall:e=>{x(async()=>{let t=await k(e,"default");t.success?(i.toast.success(`${e} uninstalled`),D((await w()).installedPlugins)):i.toast.error(t.error??"Uninstallation failed")})}})]}):(0,t.jsxs)("div",{className:"flex flex-col gap-8 p-8",children:[(0,t.jsx)(o.PageHeader,{eyebrow:"Developer Portal",title:p("plugins.title")}),(0,t.jsx)(c.EmptyState,{icon:(0,t.jsx)(n.default,{className:"size-10"}),title:p("plugins.noProxy")})]}):(0,t.jsxs)("div",{className:"flex flex-col gap-8 p-8",children:[(0,t.jsx)(o.PageHeader,{eyebrow:"Developer Portal",title:p("plugins.title")}),(0,t.jsx)(c.EmptyState,{icon:(0,t.jsx)(n.default,{className:"size-10"}),title:p("plugins.wrongAgent")})]})}],26530)}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,84735,e=>{"use strict";let t=(0,e.i(54864).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",0,t],84735)},70727,e=>{"use strict";let t=(0,e.i(54864).default)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);e.s(["Terminal",0,t],70727)},1650,e=>{"use strict";e.i(11495),e.s([])},51911,e=>{"use strict";var t=e.i(96871),a=e.i(16539),s=e.i(91967),l=e.i(22353),r=e.i(9413),i=e.i(36567),n=e.i(9641),c=e.i(70391),o=e.i(85565),d="Switch",[u,p]=(0,r.createContextScope)(d),[x,m]=u(d),f=a.forwardRef((e,r)=>{let{__scopeSwitch:n,name:c,checked:u,defaultChecked:p,required:m,disabled:f,value:g="on",onCheckedChange:h,form:b,...y}=e,[w,N]=a.useState(null),k=(0,l.useComposedRefs)(r,e=>N(e)),S=a.useRef(!1),C=!w||b||!!w.closest("form"),[P,R]=(0,i.useControllableState)({prop:u,defaultProp:p??!1,onChange:h,caller:d});return(0,t.jsxs)(x,{scope:n,checked:P,disabled:f,children:[(0,t.jsx)(o.Primitive.button,{type:"button",role:"switch","aria-checked":P,"aria-required":m,"data-state":j(P),"data-disabled":f?"":void 0,disabled:f,value:g,...y,ref:k,onClick:(0,s.composeEventHandlers)(e.onClick,e=>{R(e=>!e),C&&(S.current=e.isPropagationStopped(),S.current||e.stopPropagation())})}),C&&(0,t.jsx)(v,{control:w,bubbles:!S.current,name:c,value:g,checked:P,required:m,disabled:f,form:b,style:{transform:"translateX(-100%)"}})]})});f.displayName=d;var g="SwitchThumb",h=a.forwardRef((e,a)=>{let{__scopeSwitch:s,...l}=e,r=m(g,s);return(0,t.jsx)(o.Primitive.span,{"data-state":j(r.checked),"data-disabled":r.disabled?"":void 0,...l,ref:a})});h.displayName=g;var v=a.forwardRef(({__scopeSwitch:e,control:s,checked:r,bubbles:i=!0,...o},d)=>{let u=a.useRef(null),p=(0,l.useComposedRefs)(u,d),x=(0,n.usePrevious)(r),m=(0,c.useSize)(s);return a.useEffect(()=>{let e=u.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(x!==r&&t){let a=new Event("click",{bubbles:i});t.call(e,r),e.dispatchEvent(a)}},[x,r,i]),(0,t.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...o,tabIndex:-1,ref:p,style:{...o.style,...m,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function j(e){return e?"checked":"unchecked"}v.displayName="SwitchBubbleInput",e.s(["Root",0,f,"Switch",0,f,"SwitchThumb",0,h,"Thumb",0,h,"createSwitchScope",0,p],76587);var b=e.i(76587),b=b,y=e.i(31777);e.s(["Switch",0,function({className:e,size:a="default",...s}){return(0,t.jsx)(b.Root,{"data-slot":"switch","data-size":a,className:(0,y.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)(b.Thumb,{"data-slot":"switch-thumb",className:(0,y.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 rtl:data-[state=checked]:-translate-x-[calc(100%-2px)]")})})}],51911)},956,e=>{"use strict";var t=e.i(96871),a=e.i(16539),s=e.i(31777);let l=a.forwardRef(({className:e,...a},l)=>(0,t.jsx)("div",{ref:l,className:(0,s.cn)("bg-card text-card-foreground editorial-shadow rounded-xl border",e),...a}));l.displayName="Card";let r=a.forwardRef(({className:e,...a},l)=>(0,t.jsx)("div",{ref:l,className:(0,s.cn)("flex flex-col space-y-1.5 p-6",e),...a}));r.displayName="CardHeader";let i=a.forwardRef(({className:e,...a},l)=>(0,t.jsx)("div",{ref:l,className:(0,s.cn)("leading-none font-semibold tracking-tight",e),...a}));i.displayName="CardTitle";let n=a.forwardRef(({className:e,...a},l)=>(0,t.jsx)("div",{ref:l,className:(0,s.cn)("text-muted-foreground text-sm",e),...a}));n.displayName="CardDescription";let c=a.forwardRef(({className:e,...a},l)=>(0,t.jsx)("div",{ref:l,className:(0,s.cn)("p-6 pt-0",e),...a}));c.displayName="CardContent",a.forwardRef(({className:e,...a},l)=>(0,t.jsx)("div",{ref:l,className:(0,s.cn)("flex items-center p-6 pt-0",e),...a})).displayName="CardFooter",e.s(["Card",0,l,"CardContent",0,c,"CardDescription",0,n,"CardHeader",0,r,"CardTitle",0,i])},54793,7729,e=>{"use strict";var t=e.i(96871),a=e.i(31777);e.s(["EmptyState",0,function({icon:e,title:s,description:l,action:r,className:i,...n}){return(0,t.jsxs)("div",{className:(0,a.cn)("flex flex-col items-center gap-4 px-4 py-12 text-center",i),...n,children:[e?(0,t.jsx)("div",{className:"text-muted-foreground",children:e}):null,(0,t.jsx)("h3",{className:"text-lg font-semibold",children:s}),l?(0,t.jsx)("p",{className:"text-muted-foreground max-w-md text-sm",children:l}):null,r?(0,t.jsx)("div",{className:"mt-2",children:r}):null]})}],7729),e.s([],54793)},9443,85871,e=>{"use strict";var t=e.i(96871),a=e.i(31777);e.s(["PageHeader",0,function({title:e,description:s,eyebrow:l,children:r,className:i}){return(0,t.jsxs)("header",{className:(0,a.cn)("flex items-center justify-between gap-4",i),children:[(0,t.jsxs)("div",{className:"space-y-1.5",children:[l?(0,t.jsx)("span",{className:"text-[10px] font-bold tracking-[0.2em] text-slate-400 uppercase",children:l}):null,(0,t.jsx)("div",{className:"flex items-baseline gap-3",children:(0,t.jsx)("h1",{className:"text-foreground text-3xl font-black tracking-tight",children:e})}),s?(0,t.jsx)("p",{className:"text-muted-foreground text-sm font-medium",children:s}):null]}),r?(0,t.jsx)("div",{"data-slot":"actions",children:r}):null]})}],85871),e.s([],9443)},26530,e=>{"use strict";var t=e.i(96871),a=e.i(16539),s=e.i(68787),l=e.i(47952),r=e.i(23835),r=r,i=e.i(60112),n=e.i(98127),c=e.i(35364);e.i(9443);var o=e.i(85871);e.i(54793);var d=e.i(7729),u=e.i(956),p=e.i(81846),x=e.i(51911);e.i(26759);var m=e.i(97164);function f({plugin:e,installed:a,onSelect:s,onToggle:l}){let{t:r}=(0,m.useTranslation)("web");return(0,t.jsxs)(u.Card,{className:"cursor-pointer p-5 transition-all duration-300 hover:scale-[1.02] hover:shadow-md hover:ring-slate-300 dark:hover:ring-slate-600",role:"button",tabIndex:0,onClick:()=>s(e),onKeyDown:t=>{("Enter"===t.key||" "===t.key)&&(t.preventDefault(),s(e))},"data-testid":`plugin-card-${e.name}`,children:[(0,t.jsx)("h3",{className:"text-foreground text-sm leading-tight font-bold tracking-tight",children:e.name}),e.version?(0,t.jsxs)("p",{className:"text-muted-foreground mt-1 font-mono text-xs",children:["v",e.version]}):null,(0,t.jsx)("p",{className:"text-muted-foreground mt-3 line-clamp-2 text-xs leading-relaxed",children:e.description}),(0,t.jsxs)("div",{className:"mt-4 flex flex-wrap items-center gap-1.5",children:[e.category?(0,t.jsx)(p.Badge,{variant:"outline",children:e.category}):null,a?(0,t.jsx)(p.Badge,{variant:"secondary",children:r("plugins.installed")}):(0,t.jsx)(p.Badge,{variant:"outline",className:"opacity-50",children:r("plugins.notInstalled")})]}),a?(0,t.jsxs)("div",{className:"mt-3 flex items-center gap-2",onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),children:[(0,t.jsx)(x.Switch,{checked:a.enabled,onCheckedChange:t=>l?.(e.name,t),"data-testid":`plugin-toggle-${e.name}`}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:r(a.enabled?"plugins.disable":"plugins.enable")})]}):null]})}e.i(1650);var g=e.i(11495),h=e.i(45811),v=e.i(25235),j=e.i(84735);function b({plugin:e,installed:a,open:s,onClose:l,onInstall:r,onUninstall:i}){let{t:n}=(0,m.useTranslation)("web");if(!e)return null;let o=function(e){let{source:t}=e;if("github"===t.source&&t.repo)return`https://github.com/${t.repo}`;if(("url"===t.source||"git-subdir"===t.source)&&t.url)try{let e=new URL(t.url);if("https:"===e.protocol)return t.url}catch{}return null}(e);return(0,t.jsxs)(g.BaseDrawer,{open:s,onClose:l,children:[(0,t.jsx)(h.DrawerTitle,{className:"text-foreground text-lg font-bold tracking-tight",children:e.name}),(0,t.jsx)(h.DrawerDescription,{className:"text-muted-foreground mt-1 text-sm",children:e.description}),(0,t.jsx)(v.Separator,{className:"my-4"}),(0,t.jsxs)("div",{className:"space-y-3",children:[e.version?(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-sm",children:n("plugins.version")}),(0,t.jsxs)("span",{className:"font-mono text-sm",children:["v",e.version]})]}):null,e.category?(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-sm",children:n("plugins.category")}),(0,t.jsx)(p.Badge,{variant:"outline",children:e.category})]}):null,o?(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-sm",children:n("plugins.source")}),(0,t.jsxs)("a",{href:o,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:text-primary/80 inline-flex items-center gap-1 text-sm underline underline-offset-2",children:[e.source.repo??"Repository",(0,t.jsx)(j.ExternalLink,{className:"size-3"})]})]}):null,e.keywords&&e.keywords.length>0?(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5 pt-2",children:e.keywords.map(e=>(0,t.jsx)(p.Badge,{variant:"outline",className:"text-xs",children:e},e))}):null]}),(0,t.jsx)(v.Separator,{className:"my-4"}),(0,t.jsx)("div",{className:"flex gap-2",children:a?(0,t.jsx)(c.Button,{variant:"destructive",size:"sm",onClick:()=>i?.(e.name),"data-testid":"plugin-uninstall-button",children:n("plugins.uninstall")}):(0,t.jsx)(c.Button,{size:"sm",onClick:()=>r?.(e.name),"data-testid":"plugin-install-button",children:n("plugins.install")})})]})}var y=e.i(96976);let w=(0,y.createServerReference)("00425186092e8f157f7f69938da2571e7544ffcc9e",y.callServer,void 0,y.findSourceMapURL,"fetchPluginCatalogAction"),N=(0,y.createServerReference)("70c58f5fb7756301b307fcdc06f9a3299a7ae88ba4",y.callServer,void 0,y.findSourceMapURL,"installPluginAction"),k=(0,y.createServerReference)("60418c739948e9045a8f01b8a21c0a9b63c91da2e2",y.callServer,void 0,y.findSourceMapURL,"uninstallPluginAction"),S=(0,y.createServerReference)("70ddfec2653c4477600d5f8c140fa22c2e72ab43bd",y.callServer,void 0,y.findSourceMapURL,"togglePluginAction");e.s(["PluginsPageClient",0,function({proxyConfigured:e,isClaudeCode:u}){let{t:p}=(0,m.useTranslation)("web"),[,x]=(0,a.useTransition)(),[g,h]=(0,a.useState)(""),[v,j]=(0,a.useState)(null),[y,C]=(0,a.useState)(null),[P,R]=(0,a.useState)([]),[z,T]=(0,a.useState)([]),[B,D]=(0,a.useState)(!0);(0,a.useEffect)(()=>{e?w().then(e=>{R(e.plugins),T(e.installedPlugins),D(!1)}):D(!1)},[e]);let E=(0,a.useMemo)(()=>{let e=new Set;for(let t of P)t.category&&e.add(t.category);return Array.from(e).sort()},[P]),H=(0,a.useMemo)(()=>{let e=g.toLowerCase();return P.filter(t=>{if(v&&t.category!==v)return!1;if(e){let a=t.name.toLowerCase().includes(e),s=t.description.toLowerCase().includes(e);if(!a&&!s)return!1}return!0})},[P,g,v]),L=e=>z.find(t=>t.id.startsWith(`${e}@`)),M=(e,t)=>{x(async()=>{let a=await S(e,"default",t);a.success?(i.toast.success(`${e} ${t?"enabled":"disabled"}`),T((await w()).installedPlugins)):i.toast.error(a.error??"Toggle failed")})};return u?e?B?(0,t.jsxs)("div",{className:"flex flex-col gap-8 p-8",children:[(0,t.jsx)(o.PageHeader,{eyebrow:"Developer Portal",title:p("plugins.title")}),(0,t.jsxs)("div",{className:"text-muted-foreground text-center text-sm",children:[p("accessibility.loading"),"..."]})]}):0===P.length?(0,t.jsxs)("div",{className:"flex flex-col gap-8 p-8",children:[(0,t.jsx)(o.PageHeader,{eyebrow:"Developer Portal",title:p("plugins.title")}),(0,t.jsx)(d.EmptyState,{icon:(0,t.jsx)(l.Blocks,{className:"size-10"}),title:p("plugins.emptyState")})]}):(0,t.jsxs)("div",{className:"flex flex-col gap-8 p-8",children:[(0,t.jsx)(o.PageHeader,{eyebrow:"Developer Portal",title:p("plugins.title")}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(s.Search,{className:"text-muted-foreground absolute top-1/2 left-3 size-4 -translate-y-1/2"}),(0,t.jsx)(n.Input,{placeholder:p("plugins.searchPlaceholder"),value:g,onChange:e=>h(e.target.value),className:"ps-9","data-testid":"plugin-search"})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)(c.Button,{variant:null===v?"default":"outline",size:"sm",onClick:()=>j(null),children:p("plugins.allCategories")}),E.map(e=>(0,t.jsx)(c.Button,{variant:v===e?"default":"outline",size:"sm",onClick:()=>j(e===v?null:e),children:e},e))]}),H.length>0?(0,t.jsx)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:H.map(e=>(0,t.jsx)(f,{plugin:e,installed:L(e.name),onSelect:C,onToggle:M},e.name))}):(0,t.jsx)(d.EmptyState,{icon:(0,t.jsx)(s.Search,{className:"size-10"}),title:p("plugins.emptyState"),action:(0,t.jsx)(c.Button,{variant:"outline",onClick:()=>{h(""),j(null)},children:p("plugins.clearFilters")})}),(0,t.jsx)(b,{plugin:y,installed:y?L(y.name):void 0,open:!!y,onClose:()=>C(null),onInstall:e=>{x(async()=>{let t=await N(e,"default");t.success?(i.toast.success(`${e} installed`),T((await w()).installedPlugins)):i.toast.error(t.error??"Installation failed")})},onUninstall:e=>{x(async()=>{let t=await k(e,"default");t.success?(i.toast.success(`${e} uninstalled`),T((await w()).installedPlugins)):i.toast.error(t.error??"Uninstallation failed")})}})]}):(0,t.jsxs)("div",{className:"flex flex-col gap-8 p-8",children:[(0,t.jsx)(o.PageHeader,{eyebrow:"Developer Portal",title:p("plugins.title")}),(0,t.jsx)(d.EmptyState,{icon:(0,t.jsx)(r.default,{className:"size-10"}),title:p("plugins.noProxy")})]}):(0,t.jsxs)("div",{className:"flex flex-col gap-8 p-8",children:[(0,t.jsx)(o.PageHeader,{eyebrow:"Developer Portal",title:p("plugins.title")}),(0,t.jsx)(d.EmptyState,{icon:(0,t.jsx)(r.default,{className:"size-10"}),title:p("plugins.wrongAgent")})]})}],26530)}]);
@@ -1,20 +0,0 @@
1
- $schema: https://json-schema.org/draft/2020-12/schema
2
- $id: ClaudeCodeProxyConfig.yaml
3
- type: object
4
- properties:
5
- routingMode:
6
- $ref: LiteLLMProxyRoutingMode.yaml
7
- description: How Claude Code routes API traffic through the proxy
8
- customHeaders:
9
- type: string
10
- description: "Newline-separated key: value headers for ANTHROPIC_CUSTOM_HEADERS"
11
- sonnetModel:
12
- type: string
13
- description: Model name override for ANTHROPIC_DEFAULT_SONNET_MODEL
14
- haikuModel:
15
- type: string
16
- description: Model name override for ANTHROPIC_DEFAULT_HAIKU_MODEL
17
- opusModel:
18
- type: string
19
- description: Model name override for ANTHROPIC_DEFAULT_OPUS_MODEL
20
- description: Per-agent proxy routing config for Claude Code
@@ -1,8 +0,0 @@
1
- $schema: https://json-schema.org/draft/2020-12/schema
2
- $id: LiteLLMProxyRoutingMode.yaml
3
- type: string
4
- enum:
5
- - direct
6
- - proxy
7
- - passthrough
8
- description: How agent API traffic is routed through LiteLLM proxy
@@ -1,15 +0,0 @@
1
- /**
2
- * Migration 055: Add LiteLLM proxy per-agent routing config for Claude Code.
3
- *
4
- * Columns (settings table):
5
- * - litellm_proxy_cc_routing_mode TEXT (default NULL — treated as "direct")
6
- * - litellm_proxy_cc_custom_headers TEXT (default NULL)
7
- * - litellm_proxy_cc_sonnet_model TEXT (default NULL)
8
- * - litellm_proxy_cc_haiku_model TEXT (default NULL)
9
- * - litellm_proxy_cc_opus_model TEXT (default NULL)
10
- */
11
- import type { MigrationParams } from 'umzug';
12
- import type Database from 'better-sqlite3';
13
- export declare function up({ context: db }: MigrationParams<Database.Database>): Promise<void>;
14
- export declare function down({ context: db }: MigrationParams<Database.Database>): Promise<void>;
15
- //# sourceMappingURL=055-add-litellm-proxy-agent-config.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"055-add-litellm-proxy-agent-config.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/core/src/infrastructure/persistence/sqlite/migrations/055-add-litellm-proxy-agent-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAE3C,wBAAsB,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,eAAe,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAmB3F;AAED,wBAAsB,IAAI,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,eAAe,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAE7F"}
@@ -1,32 +0,0 @@
1
- /**
2
- * Migration 055: Add LiteLLM proxy per-agent routing config for Claude Code.
3
- *
4
- * Columns (settings table):
5
- * - litellm_proxy_cc_routing_mode TEXT (default NULL — treated as "direct")
6
- * - litellm_proxy_cc_custom_headers TEXT (default NULL)
7
- * - litellm_proxy_cc_sonnet_model TEXT (default NULL)
8
- * - litellm_proxy_cc_haiku_model TEXT (default NULL)
9
- * - litellm_proxy_cc_opus_model TEXT (default NULL)
10
- */
11
- export async function up({ context: db }) {
12
- const columns = db.pragma('table_info(settings)');
13
- const names = new Set(columns.map((c) => c.name));
14
- if (!names.has('litellm_proxy_cc_routing_mode')) {
15
- db.exec('ALTER TABLE settings ADD COLUMN litellm_proxy_cc_routing_mode TEXT');
16
- }
17
- if (!names.has('litellm_proxy_cc_custom_headers')) {
18
- db.exec('ALTER TABLE settings ADD COLUMN litellm_proxy_cc_custom_headers TEXT');
19
- }
20
- if (!names.has('litellm_proxy_cc_sonnet_model')) {
21
- db.exec('ALTER TABLE settings ADD COLUMN litellm_proxy_cc_sonnet_model TEXT');
22
- }
23
- if (!names.has('litellm_proxy_cc_haiku_model')) {
24
- db.exec('ALTER TABLE settings ADD COLUMN litellm_proxy_cc_haiku_model TEXT');
25
- }
26
- if (!names.has('litellm_proxy_cc_opus_model')) {
27
- db.exec('ALTER TABLE settings ADD COLUMN litellm_proxy_cc_opus_model TEXT');
28
- }
29
- }
30
- export async function down({ context: db }) {
31
- void db;
32
- }
@@ -1,6 +0,0 @@
1
- import type { Settings } from '../../../../../../packages/core/src/domain/generated/output.js';
2
- export interface LiteLLMProxyRoutingSectionProps {
3
- settings: Settings;
4
- }
5
- export declare function LiteLLMProxyRoutingSection({ settings }: LiteLLMProxyRoutingSectionProps): import("react/jsx-runtime").JSX.Element;
6
- //# sourceMappingURL=litellm-proxy-routing-section.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"litellm-proxy-routing-section.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/features/settings/litellm-proxy-routing-section.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yCAAyC,CAAC;AAaxE,MAAM,WAAW,+BAA+B;IAC9C,QAAQ,EAAE,QAAQ,CAAC;CACpB;AAED,wBAAgB,0BAA0B,CAAC,EAAE,QAAQ,EAAE,EAAE,+BAA+B,2CA2LvF"}
@@ -1,72 +0,0 @@
1
- 'use client';
2
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
- import { useState, useTransition } from 'react';
4
- import { Route } from 'lucide-react';
5
- import { toast } from 'sonner';
6
- import { useTranslation } from 'react-i18next';
7
- import { updateSettingsAction } from '../../../app/actions/update-settings.js';
8
- import { LiteLLMProxyRoutingMode } from '../../../../../../packages/core/src/domain/generated/output.js';
9
- import { SettingsSection, SettingsRow } from './settings-section-utils.js';
10
- import { Input } from '../../ui/input.js';
11
- import { Textarea } from '../../ui/textarea.js';
12
- import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from '../../ui/select.js';
13
- export function LiteLLMProxyRoutingSection({ settings }) {
14
- const { t } = useTranslation('web');
15
- const [, startTransition] = useTransition();
16
- const cc = settings.litellmProxy?.claudeCode;
17
- const [routingMode, setRoutingMode] = useState(cc?.routingMode ?? LiteLLMProxyRoutingMode.direct);
18
- const [customHeaders, setCustomHeaders] = useState(cc?.customHeaders ?? '');
19
- const [sonnetModel, setSonnetModel] = useState(cc?.sonnetModel ?? '');
20
- const [haikuModel, setHaikuModel] = useState(cc?.haikuModel ?? '');
21
- const [opusModel, setOpusModel] = useState(cc?.opusModel ?? '');
22
- const originalCustomHeaders = cc?.customHeaders ?? '';
23
- const originalSonnetModel = cc?.sonnetModel ?? '';
24
- const originalHaikuModel = cc?.haikuModel ?? '';
25
- const originalOpusModel = cc?.opusModel ?? '';
26
- const showProxyFields = routingMode !== LiteLLMProxyRoutingMode.direct;
27
- function save(payload) {
28
- startTransition(async () => {
29
- const result = await updateSettingsAction(payload);
30
- if (!result.success) {
31
- toast.error(result.error ?? t('settings.failedToSave'));
32
- }
33
- });
34
- }
35
- function buildPayload(overrides) {
36
- return {
37
- litellmProxy: {
38
- baseUrl: settings.litellmProxy?.baseUrl,
39
- apiKey: settings.litellmProxy?.apiKey,
40
- marketplaceEnabled: !!settings.litellmProxy?.baseUrl,
41
- claudeCode: {
42
- routingMode: overrides?.routingMode ?? routingMode,
43
- customHeaders: (overrides?.customHeaders ?? customHeaders) || undefined,
44
- sonnetModel: (overrides?.sonnetModel ?? sonnetModel) || undefined,
45
- haikuModel: (overrides?.haikuModel ?? haikuModel) || undefined,
46
- opusModel: (overrides?.opusModel ?? opusModel) || undefined,
47
- },
48
- },
49
- };
50
- }
51
- function handleModeChange(value) {
52
- setRoutingMode(value);
53
- save(buildPayload({ routingMode: value }));
54
- }
55
- return (_jsxs(SettingsSection, { icon: Route, title: t('settings.litellmProxy.routing.title'), description: t('settings.litellmProxy.routing.description'), testId: "litellm-proxy-routing-section", tooltip: t('settings.litellmProxy.routing.hint'), children: [_jsx(SettingsRow, { label: t('settings.litellmProxy.routing.mode'), description: t('settings.litellmProxy.routing.modeDescription'), htmlFor: "litellm-routing-mode", children: _jsxs(Select, { value: routingMode, onValueChange: handleModeChange, children: [_jsx(SelectTrigger, { id: "litellm-routing-mode", "data-testid": "litellm-routing-mode-select", className: "w-48 text-xs", children: _jsx(SelectValue, {}) }), _jsxs(SelectContent, { children: [_jsx(SelectItem, { value: LiteLLMProxyRoutingMode.direct, children: t('settings.litellmProxy.routing.modeDirect') }), _jsx(SelectItem, { value: LiteLLMProxyRoutingMode.proxy, children: t('settings.litellmProxy.routing.modeProxy') }), _jsx(SelectItem, { value: LiteLLMProxyRoutingMode.passthrough, children: t('settings.litellmProxy.routing.modePassthrough') })] })] }) }), routingMode === LiteLLMProxyRoutingMode.passthrough && (_jsx(SettingsRow, { label: "", description: t('settings.litellmProxy.routing.passthroughHelp'), children: _jsx("span", {}) })), showProxyFields ? (_jsxs(_Fragment, { children: [_jsx(SettingsRow, { label: t('settings.litellmProxy.routing.customHeaders'), description: t('settings.litellmProxy.routing.customHeadersDescription'), htmlFor: "litellm-custom-headers", children: _jsx(Textarea, { id: "litellm-custom-headers", "data-testid": "litellm-custom-headers-input", placeholder: 'x-litellm-customer-id: my-user\nx-litellm-tags: project:acme', value: customHeaders, onChange: (e) => setCustomHeaders(e.target.value), onBlur: () => {
56
- if (customHeaders !== originalCustomHeaders) {
57
- save(buildPayload({ customHeaders }));
58
- }
59
- }, rows: 3, className: "w-64 text-xs" }) }), _jsx(SettingsRow, { label: t('settings.litellmProxy.routing.sonnetModel'), description: t('settings.litellmProxy.routing.modelOverrideDescription'), htmlFor: "litellm-sonnet-model", children: _jsx(Input, { id: "litellm-sonnet-model", "data-testid": "litellm-sonnet-model-input", type: "text", placeholder: "claude-sonnet-4-6", value: sonnetModel, onChange: (e) => setSonnetModel(e.target.value), onBlur: () => {
60
- if (sonnetModel !== originalSonnetModel) {
61
- save(buildPayload({ sonnetModel }));
62
- }
63
- }, className: "w-64 text-xs" }) }), _jsx(SettingsRow, { label: t('settings.litellmProxy.routing.haikuModel'), htmlFor: "litellm-haiku-model", children: _jsx(Input, { id: "litellm-haiku-model", "data-testid": "litellm-haiku-model-input", type: "text", placeholder: "claude-haiku-4-5", value: haikuModel, onChange: (e) => setHaikuModel(e.target.value), onBlur: () => {
64
- if (haikuModel !== originalHaikuModel) {
65
- save(buildPayload({ haikuModel }));
66
- }
67
- }, className: "w-64 text-xs" }) }), _jsx(SettingsRow, { label: t('settings.litellmProxy.routing.opusModel'), htmlFor: "litellm-opus-model", children: _jsx(Input, { id: "litellm-opus-model", "data-testid": "litellm-opus-model-input", type: "text", placeholder: "claude-opus-4-6", value: opusModel, onChange: (e) => setOpusModel(e.target.value), onBlur: () => {
68
- if (opusModel !== originalOpusModel) {
69
- save(buildPayload({ opusModel }));
70
- }
71
- }, className: "w-64 text-xs" }) })] })) : null] }));
72
- }
@@ -1,16 +0,0 @@
1
- import type { StoryObj } from '@storybook/react-vite';
2
- import { LiteLLMProxyRoutingSection } from './litellm-proxy-routing-section.js';
3
- declare const meta: {
4
- title: string;
5
- component: typeof LiteLLMProxyRoutingSection;
6
- tags: string[];
7
- parameters: {
8
- layout: string;
9
- };
10
- };
11
- export default meta;
12
- type Story = StoryObj<typeof meta>;
13
- export declare const DirectMode: Story;
14
- export declare const ProxyMode: Story;
15
- export declare const PassthroughMode: Story;
16
- //# sourceMappingURL=litellm-proxy-routing-section.stories.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"litellm-proxy-routing-section.stories.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/features/settings/litellm-proxy-routing-section.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAa7E,QAAA,MAAM,IAAI;;;;;;;CAOyC,CAAC;AAEpD,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,UAAU,EAAE,KAYxB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAgBvB,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KAa7B,CAAC"}