@shipit-ai/cli 1.164.1 → 1.164.2

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 (177) hide show
  1. package/dist/packages/core/src/infrastructure/services/agents/analyze-repo/analyze-repository-graph.d.ts +1 -1
  2. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/feature-agent-graph.d.ts +1 -1
  3. package/dist/src/presentation/web/components/ui/badge.d.ts +1 -1
  4. package/dist/src/presentation/web/components/ui/button.d.ts +1 -1
  5. package/dist/tsconfig.build.tsbuildinfo +1 -1
  6. package/package.json +1 -1
  7. package/web/.next/BUILD_ID +1 -1
  8. package/web/.next/build-manifest.json +3 -3
  9. package/web/.next/fallback-build-manifest.json +3 -3
  10. package/web/.next/prerender-manifest.json +3 -3
  11. package/web/.next/required-server-files.js +6 -6
  12. package/web/.next/required-server-files.json +6 -6
  13. package/web/.next/server/app/(dashboard)/@drawer/adopt/page/server-reference-manifest.json +29 -29
  14. package/web/.next/server/app/(dashboard)/@drawer/adopt/page.js.nft.json +1 -1
  15. package/web/.next/server/app/(dashboard)/@drawer/adopt/page_client-reference-manifest.js +1 -1
  16. package/web/.next/server/app/(dashboard)/@drawer/chat/page/server-reference-manifest.json +27 -27
  17. package/web/.next/server/app/(dashboard)/@drawer/chat/page.js.nft.json +1 -1
  18. package/web/.next/server/app/(dashboard)/@drawer/chat/page_client-reference-manifest.js +1 -1
  19. package/web/.next/server/app/(dashboard)/@drawer/create/page/server-reference-manifest.json +30 -30
  20. package/web/.next/server/app/(dashboard)/@drawer/create/page.js.nft.json +1 -1
  21. package/web/.next/server/app/(dashboard)/@drawer/create/page_client-reference-manifest.js +1 -1
  22. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/server-reference-manifest.json +37 -37
  23. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  24. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  25. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/server-reference-manifest.json +37 -37
  26. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js.nft.json +1 -1
  27. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page_client-reference-manifest.js +1 -1
  28. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page/server-reference-manifest.json +28 -28
  29. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page.js.nft.json +1 -1
  30. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page_client-reference-manifest.js +1 -1
  31. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/server-reference-manifest.json +28 -28
  32. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js.nft.json +1 -1
  33. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  34. package/web/.next/server/app/(dashboard)/chat/page/server-reference-manifest.json +27 -27
  35. package/web/.next/server/app/(dashboard)/chat/page.js.nft.json +1 -1
  36. package/web/.next/server/app/(dashboard)/chat/page_client-reference-manifest.js +1 -1
  37. package/web/.next/server/app/(dashboard)/create/page/server-reference-manifest.json +30 -30
  38. package/web/.next/server/app/(dashboard)/create/page.js.nft.json +1 -1
  39. package/web/.next/server/app/(dashboard)/create/page_client-reference-manifest.js +1 -1
  40. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/server-reference-manifest.json +37 -37
  41. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  42. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  43. package/web/.next/server/app/(dashboard)/feature/[featureId]/page/server-reference-manifest.json +37 -37
  44. package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js.nft.json +1 -1
  45. package/web/.next/server/app/(dashboard)/feature/[featureId]/page_client-reference-manifest.js +1 -1
  46. package/web/.next/server/app/(dashboard)/page/server-reference-manifest.json +27 -27
  47. package/web/.next/server/app/(dashboard)/page.js.nft.json +1 -1
  48. package/web/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
  49. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page/server-reference-manifest.json +28 -28
  50. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page.js.nft.json +1 -1
  51. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page_client-reference-manifest.js +1 -1
  52. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/server-reference-manifest.json +28 -28
  53. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js.nft.json +1 -1
  54. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  55. package/web/.next/server/app/_global-error.html +1 -1
  56. package/web/.next/server/app/_global-error.rsc +1 -1
  57. package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  58. package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  59. package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  60. package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  61. package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  62. package/web/.next/server/app/_not-found/page/server-reference-manifest.json +6 -6
  63. package/web/.next/server/app/_not-found/page.js.nft.json +1 -1
  64. package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  65. package/web/.next/server/app/settings/page/server-reference-manifest.json +9 -9
  66. package/web/.next/server/app/settings/page.js.nft.json +1 -1
  67. package/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  68. package/web/.next/server/app/skills/page/server-reference-manifest.json +11 -11
  69. package/web/.next/server/app/skills/page.js.nft.json +1 -1
  70. package/web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  71. package/web/.next/server/app/tools/page/server-reference-manifest.json +11 -11
  72. package/web/.next/server/app/tools/page.js.nft.json +1 -1
  73. package/web/.next/server/app/tools/page_client-reference-manifest.js +1 -1
  74. package/web/.next/server/app/version/page/server-reference-manifest.json +6 -6
  75. package/web/.next/server/app/version/page.js.nft.json +1 -1
  76. package/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
  77. package/web/.next/server/chunks/[root-of-the-server]__0jx0isp._.js +1 -1
  78. package/web/.next/server/chunks/[root-of-the-server]__0jx0isp._.js.map +1 -1
  79. package/web/.next/server/chunks/[root-of-the-server]__0tb~wwk._.js +1 -1
  80. package/web/.next/server/chunks/[root-of-the-server]__0tb~wwk._.js.map +1 -1
  81. package/web/.next/server/chunks/ssr/0j.8_web_components_common_control-center-drawer_create-drawer-client_tsx_0g70fc5._.js +1 -1
  82. package/web/.next/server/chunks/ssr/0j.8_web_components_common_control-center-drawer_create-drawer-client_tsx_0g70fc5._.js.map +1 -1
  83. package/web/.next/server/chunks/ssr/0j.8_web_components_common_control-center-drawer_feature-drawer-client_tsx_104cna.._.js +2 -2
  84. package/web/.next/server/chunks/ssr/0j.8_web_components_common_control-center-drawer_feature-drawer-client_tsx_104cna.._.js.map +1 -1
  85. package/web/.next/server/chunks/ssr/0ukq_presentation_web_components_features_settings_settings-page-client_tsx_0j1uius._.js +1 -1
  86. package/web/.next/server/chunks/ssr/0ukq_presentation_web_components_features_settings_settings-page-client_tsx_0j1uius._.js.map +1 -1
  87. package/web/.next/server/chunks/ssr/11y9_components_common_control-center-drawer_repository-drawer-client_tsx_09z.znp._.js +1 -1
  88. package/web/.next/server/chunks/ssr/11y9_components_common_control-center-drawer_repository-drawer-client_tsx_09z.znp._.js.map +1 -1
  89. package/web/.next/server/chunks/ssr/[root-of-the-server]__0.j0ktf._.js +1 -1
  90. package/web/.next/server/chunks/ssr/[root-of-the-server]__0.j0ktf._.js.map +1 -1
  91. package/web/.next/server/chunks/ssr/[root-of-the-server]__07m44ax._.js +1 -1
  92. package/web/.next/server/chunks/ssr/[root-of-the-server]__07m44ax._.js.map +1 -1
  93. package/web/.next/server/chunks/ssr/[root-of-the-server]__0frgz11._.js +1 -1
  94. package/web/.next/server/chunks/ssr/[root-of-the-server]__0frgz11._.js.map +1 -1
  95. package/web/.next/server/chunks/ssr/[root-of-the-server]__0oi7r67._.js +1 -1
  96. package/web/.next/server/chunks/ssr/[root-of-the-server]__0pti1a3._.js +1 -1
  97. package/web/.next/server/chunks/ssr/[root-of-the-server]__0pti1a3._.js.map +1 -1
  98. package/web/.next/server/chunks/ssr/[root-of-the-server]__0rv1gci._.js +1 -1
  99. package/web/.next/server/chunks/ssr/[root-of-the-server]__0s9k_s3._.js +1 -1
  100. package/web/.next/server/chunks/ssr/[root-of-the-server]__0s9k_s3._.js.map +1 -1
  101. package/web/.next/server/chunks/ssr/[root-of-the-server]__0v-vmgt._.js +1 -1
  102. package/web/.next/server/chunks/ssr/[root-of-the-server]__0v-vmgt._.js.map +1 -1
  103. package/web/.next/server/chunks/ssr/[root-of-the-server]__0yky~xo._.js +1 -1
  104. package/web/.next/server/chunks/ssr/[root-of-the-server]__0yky~xo._.js.map +1 -1
  105. package/web/.next/server/chunks/ssr/[root-of-the-server]__11dc42t._.js +1 -1
  106. package/web/.next/server/chunks/ssr/[root-of-the-server]__11dc42t._.js.map +1 -1
  107. package/web/.next/server/chunks/ssr/{_0aakgii._.js → _05h68we._.js} +2 -2
  108. package/web/.next/server/chunks/ssr/{_0aakgii._.js.map → _05h68we._.js.map} +1 -1
  109. package/web/.next/server/chunks/ssr/_0__4si~._.js +1 -1
  110. package/web/.next/server/chunks/ssr/_0__4si~._.js.map +1 -1
  111. package/web/.next/server/chunks/ssr/_0_m17kl._.js +1 -1
  112. package/web/.next/server/chunks/ssr/_0_m17kl._.js.map +1 -1
  113. package/web/.next/server/chunks/ssr/_0aa~oer._.js +1 -1
  114. package/web/.next/server/chunks/ssr/_0d4miu.._.js +1 -1
  115. package/web/.next/server/chunks/ssr/_0d4miu.._.js.map +1 -1
  116. package/web/.next/server/chunks/ssr/_0e8ern9._.js +1 -1
  117. package/web/.next/server/chunks/ssr/_0e8ern9._.js.map +1 -1
  118. package/web/.next/server/chunks/ssr/_0ez.1o4._.js +1 -1
  119. package/web/.next/server/chunks/ssr/_0ez.1o4._.js.map +1 -1
  120. package/web/.next/server/chunks/ssr/_0hovej-._.js +2 -2
  121. package/web/.next/server/chunks/ssr/_0hovej-._.js.map +1 -1
  122. package/web/.next/server/chunks/ssr/_0p3zs6p._.js +1 -1
  123. package/web/.next/server/chunks/ssr/_0p3zs6p._.js.map +1 -1
  124. package/web/.next/server/chunks/ssr/_0r.3n~3._.js +1 -1
  125. package/web/.next/server/chunks/ssr/_0r.3n~3._.js.map +1 -1
  126. package/web/.next/server/chunks/ssr/_0sgeiju._.js +1 -1
  127. package/web/.next/server/chunks/ssr/_0sgeiju._.js.map +1 -1
  128. package/web/.next/server/chunks/ssr/_0t59q8r._.js +1 -1
  129. package/web/.next/server/chunks/ssr/_0t59q8r._.js.map +1 -1
  130. package/web/.next/server/chunks/ssr/{_133.z2f._.js → _0ts70ov._.js} +2 -2
  131. package/web/.next/server/chunks/ssr/{_133.z2f._.js.map → _0ts70ov._.js.map} +1 -1
  132. package/web/.next/server/chunks/ssr/_0v.yfmg._.js +1 -1
  133. package/web/.next/server/chunks/ssr/_0v.yfmg._.js.map +1 -1
  134. package/web/.next/server/chunks/ssr/_0w-_hww._.js +1 -1
  135. package/web/.next/server/chunks/ssr/_0w-_hww._.js.map +1 -1
  136. package/web/.next/server/chunks/ssr/_0zk-h5w._.js +1 -1
  137. package/web/.next/server/chunks/ssr/_0zk-h5w._.js.map +1 -1
  138. package/web/.next/server/chunks/ssr/_0~ev6dw._.js +2 -2
  139. package/web/.next/server/chunks/ssr/_0~ev6dw._.js.map +1 -1
  140. package/web/.next/server/chunks/ssr/_1161g9x._.js +1 -1
  141. package/web/.next/server/chunks/ssr/_1161g9x._.js.map +1 -1
  142. package/web/.next/server/chunks/ssr/_11kuznh._.js +1 -1
  143. package/web/.next/server/chunks/ssr/_11kuznh._.js.map +1 -1
  144. package/web/.next/server/chunks/ssr/_13e1_1b._.js +3 -0
  145. package/web/.next/server/chunks/ssr/{_0427j6p._.js.map → _13e1_1b._.js.map} +1 -1
  146. package/web/.next/server/chunks/ssr/src_presentation_web_0y11iiz._.js +1 -1
  147. package/web/.next/server/chunks/ssr/src_presentation_web_0y11iiz._.js.map +1 -1
  148. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_05m2q~u.js +1 -1
  149. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_05m2q~u.js.map +1 -1
  150. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_0.6zk.t.js +1 -1
  151. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_0.6zk.t.js.map +1 -1
  152. package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_open-ide_ts_0w2wqvu._.js +1 -1
  153. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_0l3oxx9._.js +1 -1
  154. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_0l3oxx9._.js.map +1 -1
  155. package/web/.next/server/middleware/middleware-manifest.json +5 -5
  156. package/web/.next/server/middleware-build-manifest.js +3 -3
  157. package/web/.next/server/middleware-manifest.json +5 -5
  158. package/web/.next/server/pages/500.html +1 -1
  159. package/web/.next/server/server-reference-manifest.js +1 -1
  160. package/web/.next/server/server-reference-manifest.json +47 -47
  161. package/web/.next/static/chunks/{0qm-9ipi3co.d.js → 0.2owry_sk_ak.js} +1 -1
  162. package/web/.next/static/chunks/{0ureecfb3sk03.js → 01~tm1-qp0baa.js} +1 -1
  163. package/web/.next/static/chunks/{0si_11yihc0-l.js → 0_9hv9_f66hur.js} +1 -1
  164. package/web/.next/static/chunks/{0~io7k480nets.js → 0g-so1fagegtp.js} +1 -1
  165. package/web/.next/static/chunks/{09a1uo.4xdik3.js → 0in40lx7y7f8o.js} +1 -1
  166. package/web/.next/static/chunks/{0fc4~7_n~k~-y.js → 0qz02~wj25f-f.js} +1 -1
  167. package/web/.next/static/chunks/{0f698k1fycef7.js → 0rv6fo9ui94r9.js} +1 -1
  168. package/web/.next/static/chunks/{0yj1o1qkqnea0.js → 0t82zfhqgor5r.js} +1 -1
  169. package/web/.next/static/chunks/{0~d8qka._ncpd.js → 0whetjaoa5y.l.js} +2 -2
  170. package/web/.next/static/chunks/{0_5~ye5oqkvog.js → 0xs4~af3nc_15.js} +1 -1
  171. package/web/.next/static/chunks/{0dx9n.g50tq3h.js → 122mzkbtrj4-k.js} +2 -2
  172. package/web/.next/static/chunks/{0bkt5slti~l1x.js → 12pwrbjphv3z7.js} +1 -1
  173. package/web/.next/static/chunks/{0.ot~ed_rh0ui.js → 17jsatqy81xc..js} +2 -2
  174. package/web/.next/server/chunks/ssr/_0427j6p._.js +0 -3
  175. /package/web/.next/static/{ZJku-LesX1icuSm9WAIO0 → CJ4Fr1ggL4xWEe_fapYLv}/_buildManifest.js +0 -0
  176. /package/web/.next/static/{ZJku-LesX1icuSm9WAIO0 → CJ4Fr1ggL4xWEe_fapYLv}/_clientMiddlewareManifest.js +0 -0
  177. /package/web/.next/static/{ZJku-LesX1icuSm9WAIO0 → CJ4Fr1ggL4xWEe_fapYLv}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../src/presentation/web/lib/server-container.ts","../../../../../../src/presentation/web/app/api/version/route.ts","../../../../../../node_modules/.pnpm/next%4016.2.2_%40babel%2Bcore%407.29.0_%40playwright%2Btest%401.59.1_react-dom%4019.2.4_react%4019.2.4__react%4019.2.4/node_modules/next/dist/esm/build/templates/app-route.js"],"sourcesContent":["/**\n * Server Container Accessor\n *\n * Provides a `resolve()` helper for server components and API routes to\n * obtain DI-managed instances. The tsyringe container is placed on globalThis\n * by the CLI bootstrap (`shipit-ai ui`) or the dev-server (`pnpm dev:web`).\n */\n\nimport type { DependencyContainer, InjectionToken } from 'tsyringe';\n\nconst CONTAINER_KEY = '__shipitAiContainer';\n\n/**\n * Resolve a dependency from the DI container.\n *\n * Usage in server components / API routes:\n * ```ts\n * import { resolve } from '@/lib/server-container';\n * import { ListFeaturesUseCase } from '@shipit-ai/core/application/use-cases/features/list-features.use-case';\n *\n * const features = await resolve(ListFeaturesUseCase).execute();\n * ```\n */\nexport function resolve<T>(token: InjectionToken<T>): T {\n const container = (globalThis as Record<string, unknown>)[CONTAINER_KEY] as\n | DependencyContainer\n | undefined;\n\n if (!container) {\n throw new Error(\n 'DI container not available. Ensure the CLI bootstrap or dev-server has initialized it.'\n );\n }\n\n return container.resolve(token);\n}\n","import { NextResponse } from 'next/server';\n\nimport { resolve } from '@/lib/server-container';\nimport type { IVersionService } from '@shipit-ai/core/application/ports/output/services/version-service.interface';\n\n/** Prevent Next.js from statically prerendering this route at build time. */\nexport const dynamic = 'force-dynamic';\n\n/**\n * Returns runtime version info.\n *\n * Reads the version from the DI container's VersionService — the same source\n * used by `shipit-ai --version`. This avoids stale values from NEXT_PUBLIC_* env\n * vars which Next.js inlines at build time.\n */\nexport function GET(): NextResponse {\n try {\n const versionService = resolve<IVersionService>('IVersionService');\n const { version, name, description } = versionService.getVersion();\n\n return NextResponse.json({\n version,\n packageName: name,\n description,\n branch: process.env.NEXT_PUBLIC_SHIPIT_AI_BRANCH ?? '',\n commitHash: process.env.NEXT_PUBLIC_SHIPIT_AI_COMMIT ?? '',\n instancePath: process.env.NEXT_PUBLIC_SHIPIT_AI_INSTANCE_PATH ?? '',\n isDev: process.env.NODE_ENV === 'development',\n });\n } catch {\n // DI container not available (e.g. during build) — fall back to env vars\n return NextResponse.json({\n version: process.env.NEXT_PUBLIC_SHIPIT_AI_VERSION ?? 'unknown',\n packageName: process.env.NEXT_PUBLIC_SHIPIT_AI_PACKAGE_NAME ?? '@shipit-ai/cli',\n description:\n process.env.NEXT_PUBLIC_SHIPIT_AI_DESCRIPTION ?? 'Autonomous AI Native SDLC Platform',\n branch: process.env.NEXT_PUBLIC_SHIPIT_AI_BRANCH ?? '',\n commitHash: process.env.NEXT_PUBLIC_SHIPIT_AI_COMMIT ?? '',\n instancePath: process.env.NEXT_PUBLIC_SHIPIT_AI_INSTANCE_PATH ?? '',\n isDev: process.env.NODE_ENV === 'development',\n });\n }\n}\n","import { AppRouteRouteModule } from \"next/dist/esm/server/route-modules/app-route/module.compiled\";\nimport { RouteKind } from \"next/dist/esm/server/route-kind\";\nimport { patchFetch as _patchFetch } from \"next/dist/esm/server/lib/patch-fetch\";\nimport { addRequestMeta, getRequestMeta, setRequestMeta } from \"next/dist/esm/server/request-meta\";\nimport { getTracer, SpanKind } from \"next/dist/esm/server/lib/trace/tracer\";\nimport { setManifestsSingleton } from \"next/dist/esm/server/app-render/manifests-singleton\";\nimport { normalizeAppPath } from \"next/dist/esm/shared/lib/router/utils/app-paths\";\nimport { NodeNextRequest, NodeNextResponse } from \"next/dist/esm/server/base-http/node\";\nimport { NextRequestAdapter, signalFromNodeResponse } from \"next/dist/esm/server/web/spec-extension/adapters/next-request\";\nimport { BaseServerSpan } from \"next/dist/esm/server/lib/trace/constants\";\nimport { getRevalidateReason } from \"next/dist/esm/server/instrumentation/utils\";\nimport { sendResponse } from \"next/dist/esm/server/send-response\";\nimport { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from \"next/dist/esm/server/web/utils\";\nimport { getCacheControlHeader } from \"next/dist/esm/server/lib/cache-control\";\nimport { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from \"next/dist/esm/lib/constants\";\nimport { NoFallbackError } from \"next/dist/esm/shared/lib/no-fallback-error.external\";\nimport { CachedRouteKind } from \"next/dist/esm/server/response-cache\";\nimport * as userland from \"INNER_APP_ROUTE\";\n// We inject the nextConfigOutput here so that we can use them in the route\n// module.\nconst nextConfigOutput = \"\"\nconst routeModule = new AppRouteRouteModule({\n definition: {\n kind: RouteKind.APP_ROUTE,\n page: \"/api/version/route\",\n pathname: \"/api/version\",\n filename: \"route\",\n bundlePath: \"\"\n },\n distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '',\n relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '',\n resolvedPagePath: \"[project]/src/presentation/web/app/api/version/route.ts\",\n nextConfigOutput,\n // The static import is used for initialization (methods, dynamic, etc.).\n userland: userland,\n // In Turbopack dev mode, also provide a getter that calls require() on every\n // request. This re-reads from devModuleCache so HMR updates are picked up,\n // and the async wrapper unwraps async-module Promises (ESM-only\n // serverExternalPackages) automatically.\n ...process.env.TURBOPACK && process.env.__NEXT_DEV_SERVER ? {\n getUserland: ()=>import(\"INNER_APP_ROUTE\")\n } : {}\n});\n// Pull out the exports that we need to expose from the module. This should\n// be eliminated when we've moved the other routes to the new format. These\n// are used to hook into the route.\nconst { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule;\nfunction patchFetch() {\n return _patchFetch({\n workAsyncStorage,\n workUnitAsyncStorage\n });\n}\nexport { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, };\nexport async function handler(req, res, ctx) {\n if (ctx.requestMeta) {\n setRequestMeta(req, ctx.requestMeta);\n }\n if (routeModule.isDev) {\n addRequestMeta(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint());\n }\n let srcPage = \"/api/version/route\";\n // turbopack doesn't normalize `/index` in the page name\n // so we need to to process dynamic routes properly\n // TODO: fix turbopack providing differing value from webpack\n if (process.env.TURBOPACK) {\n srcPage = srcPage.replace(/\\/index$/, '') || '/';\n } else if (srcPage === '/index') {\n // we always normalize /index specifically\n srcPage = '/';\n }\n const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE;\n const prepareResult = await routeModule.prepare(req, res, {\n srcPage,\n multiZoneDraftMode\n });\n if (!prepareResult) {\n res.statusCode = 400;\n res.end('Bad Request');\n ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve());\n return null;\n }\n const { buildId, params, nextConfig, parsedUrl, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname, clientReferenceManifest, serverActionsManifest } = prepareResult;\n const normalizedSrcPage = normalizeAppPath(srcPage);\n let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]);\n const render404 = async ()=>{\n // TODO: should route-module itself handle rendering the 404\n if (routerServerContext == null ? void 0 : routerServerContext.render404) {\n await routerServerContext.render404(req, res, parsedUrl, false);\n } else {\n res.end('This page could not be found');\n }\n return null;\n };\n if (isIsr && !isDraftMode) {\n const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]);\n const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage];\n if (prerenderInfo) {\n if (prerenderInfo.fallback === false && !isPrerendered) {\n if (nextConfig.adapterPath) {\n return await render404();\n }\n throw new NoFallbackError();\n }\n }\n }\n let cacheKey = null;\n if (isIsr && !routeModule.isDev && !isDraftMode) {\n cacheKey = resolvedPathname;\n // ensure /index and / is normalized to one key\n cacheKey = cacheKey === '/index' ? '/' : cacheKey;\n }\n const supportsDynamicResponse = // If we're in development, we always support dynamic HTML\n routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports\n // dynamic HTML.\n !isIsr;\n // This is a revalidation request if the request is for a static\n // page and it is not being resumed from a postponed render and\n // it is not a dynamic RSC request then it is a revalidation\n // request.\n const isStaticGeneration = isIsr && !supportsDynamicResponse;\n // Before rendering (which initializes component tree modules), we have to\n // set the reference manifests to our global store so Server Action's\n // encryption util can access to them at the top level of the page module.\n if (serverActionsManifest && clientReferenceManifest) {\n setManifestsSingleton({\n page: srcPage,\n clientReferenceManifest,\n serverActionsManifest\n });\n }\n const method = req.method || 'GET';\n const tracer = getTracer();\n const activeSpan = tracer.getActiveScopeSpan();\n const isWrappedByNextServer = Boolean(routerServerContext == null ? void 0 : routerServerContext.isWrappedByNextServer);\n const isMinimalMode = Boolean(getRequestMeta(req, 'minimalMode'));\n const incrementalCache = getRequestMeta(req, 'incrementalCache') || await routeModule.getIncrementalCache(req, nextConfig, prerenderManifest, isMinimalMode);\n incrementalCache == null ? void 0 : incrementalCache.resetRequestCache();\n globalThis.__incrementalCache = incrementalCache;\n const context = {\n params,\n previewProps: prerenderManifest.preview,\n renderOpts: {\n experimental: {\n authInterrupts: Boolean(nextConfig.experimental.authInterrupts)\n },\n cacheComponents: Boolean(nextConfig.cacheComponents),\n supportsDynamicResponse,\n incrementalCache,\n cacheLifeProfiles: nextConfig.cacheLife,\n waitUntil: ctx.waitUntil,\n onClose: (cb)=>{\n res.on('close', cb);\n },\n onAfterTaskError: undefined,\n onInstrumentationRequestError: (error, _request, errorContext, silenceLog)=>routeModule.onRequestError(req, error, errorContext, silenceLog, routerServerContext)\n },\n sharedContext: {\n buildId\n }\n };\n const nodeNextReq = new NodeNextRequest(req);\n const nodeNextRes = new NodeNextResponse(res);\n const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res));\n try {\n let parentSpan;\n const invokeRouteModule = async (span)=>{\n return routeModule.handle(nextReq, context).finally(()=>{\n if (!span) return;\n span.setAttributes({\n 'http.status_code': res.statusCode,\n 'next.rsc': false\n });\n const rootSpanAttributes = tracer.getRootSpanAttributes();\n // We were unable to get attributes, probably OTEL is not enabled\n if (!rootSpanAttributes) {\n return;\n }\n if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) {\n console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);\n return;\n }\n const route = rootSpanAttributes.get('next.route');\n if (route) {\n const name = `${method} ${route}`;\n span.setAttributes({\n 'next.route': route,\n 'http.route': route,\n 'next.span_name': name\n });\n span.updateName(name);\n // Propagate http.route to the parent span if one exists (e.g.\n // a platform-created HTTP span in adapter deployments).\n if (parentSpan && parentSpan !== span) {\n parentSpan.setAttribute('http.route', route);\n parentSpan.updateName(name);\n }\n } else {\n span.updateName(`${method} ${srcPage}`);\n }\n });\n };\n const handleResponse = async (currentSpan)=>{\n var _cacheEntry_value;\n const responseGenerator = async ({ previousCacheEntry })=>{\n try {\n if (!isMinimalMode && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) {\n res.statusCode = 404;\n // on-demand revalidate always sets this header\n res.setHeader('x-nextjs-cache', 'REVALIDATED');\n res.end('This page could not be found');\n return null;\n }\n const response = await invokeRouteModule(currentSpan);\n req.fetchMetrics = context.renderOpts.fetchMetrics;\n let pendingWaitUntil = context.renderOpts.pendingWaitUntil;\n // Attempt using provided waitUntil if available\n // if it's not we fallback to sendResponse's handling\n if (pendingWaitUntil) {\n if (ctx.waitUntil) {\n ctx.waitUntil(pendingWaitUntil);\n pendingWaitUntil = undefined;\n }\n }\n const cacheTags = context.renderOpts.collectedTags;\n // If the request is for a static response, we can cache it so long\n // as it's not edge.\n if (isIsr) {\n const blob = await response.blob();\n // Copy the headers from the response.\n const headers = toNodeOutgoingHttpHeaders(response.headers);\n if (cacheTags) {\n headers[NEXT_CACHE_TAGS_HEADER] = cacheTags;\n }\n if (!headers['content-type'] && blob.type) {\n headers['content-type'] = blob.type;\n }\n const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate;\n const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire;\n // Create the cache entry for the response.\n const cacheEntry = {\n value: {\n kind: CachedRouteKind.APP_ROUTE,\n status: response.status,\n body: Buffer.from(await blob.arrayBuffer()),\n headers\n },\n cacheControl: {\n revalidate,\n expire\n }\n };\n return cacheEntry;\n } else {\n // send response without caching if not ISR\n await sendResponse(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil);\n return null;\n }\n } catch (err) {\n // if this is a background revalidate we need to report\n // the request error here as it won't be bubbled\n if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: srcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n throw err;\n }\n };\n const cacheEntry = await routeModule.handleResponse({\n req,\n nextConfig,\n cacheKey,\n routeKind: RouteKind.APP_ROUTE,\n isFallback: false,\n prerenderManifest,\n isRoutePPREnabled: false,\n isOnDemandRevalidate,\n revalidateOnlyGenerated,\n responseGenerator,\n waitUntil: ctx.waitUntil,\n isMinimalMode\n });\n // we don't create a cacheEntry for ISR\n if (!isIsr) {\n return null;\n }\n if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) {\n var _cacheEntry_value1;\n throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), \"__NEXT_ERROR_CODE\", {\n value: \"E701\",\n enumerable: false,\n configurable: true\n });\n }\n if (!isMinimalMode) {\n res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT');\n }\n // Draft mode should never be cached\n if (isDraftMode) {\n res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');\n }\n const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers);\n if (!(isMinimalMode && isIsr)) {\n headers.delete(NEXT_CACHE_TAGS_HEADER);\n }\n // If cache control is already set on the response we don't\n // override it to allow users to customize it via next.config\n if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) {\n headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl));\n }\n await sendResponse(nodeNextReq, nodeNextRes, // @ts-expect-error - Argument of type 'Buffer<ArrayBufferLike>' is not assignable to parameter of type 'BodyInit | null | undefined'.\n new Response(cacheEntry.value.body, {\n headers,\n status: cacheEntry.value.status || 200\n }));\n return null;\n };\n // TODO: activeSpan code path is for when wrapped by\n // next-server can be removed when this is no longer used\n if (isWrappedByNextServer && activeSpan) {\n await handleResponse(activeSpan);\n } else {\n parentSpan = tracer.getActiveScopeSpan();\n await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, {\n spanName: `${method} ${srcPage}`,\n kind: SpanKind.SERVER,\n attributes: {\n 'http.method': method,\n 'http.target': req.url\n }\n }, handleResponse), undefined, !isWrappedByNextServer);\n }\n } catch (err) {\n if (!(err instanceof NoFallbackError)) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: normalizedSrcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n // rethrow so that we can handle serving error page\n // If this is during static generation, throw the error again.\n if (isIsr) throw err;\n // Otherwise, send a 500 response.\n await sendResponse(nodeNextReq, nodeNextRes, new Response(null, {\n status: 500\n }));\n return null;\n }\n}\n\n//# sourceMappingURL=app-route.js.map\n"],"names":["CONTAINER_KEY","resolve","token","container","globalThis","Error","dynamic","version","GET","versionService","name","description","getVersion","json","packageName","branch","commitHash","instancePath","isDev"],"mappings":"ogCAuBO,SAAoBE,AAAXD,CAAmC,EACjD,IAAME,EAAaC,UAAsC,CAACJ,AAdtC,mBAcoD,CAIxE,GAAI,CAACG,EACH,MAAM,AAAIE,GADI,GAEZ,0FAIJ,OAAOF,EAAUF,OAAO,CAACC,EAC3B,4BEnCA,IAAA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,KACA,EAA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AAAS,GAAG,CAAC,kBAAkB,AAC7F,EAAQ,GAAG,CAAC,gBAAiB,CAAA,EAAA,EAAA,qBAAA,AAAqB,EAAC,EAAW,YAAY,GAE9E,MAAM,CAAA,EAAA,EAAA,YAAA,AAAY,EAAC,EAAa,EAChC,IAAI,SAAS,EAAW,KAAK,CAAC,IAAI,CAAE,SAChC,EACA,OAAQ,EAAW,KAAK,CAAC,MAAM,EAAI,GACvC,IACO,IACX,EAGI,GAAyB,EACzB,MAAM,EAAe,EADgB,EAGrC,EAAa,EAAO,kBAAkB,GACtC,MAAM,EAAO,qBAAqB,CAAC,EAAI,OAAO,CAAE,IAAI,EAAO,KAAK,CAAC,EAAA,cAAc,CAAC,aAAa,CAAE,CACvF,SAAU,CAAA,EAAG,EAAO,CAAC,EAAE,EAAA,CAAS,CAChC,KAAM,EAAA,QAAQ,CAAC,MAAM,CACrB,WAAY,CACR,cAAe,EACf,cAAe,EAAI,GAAG,AAC1B,CACJ,EAAG,GAAiB,OAAW,CAAC,GAE5C,CAAE,MAAO,EAAK,CAeV,GAdM,aAAe,EAAA,eAAe,EAEhC,CAFmC,KAE7B,EAAY,cAAc,CAAC,EAAK,EAAK,CACvC,WAAY,aACZ,UAAW,EACX,UAAW,QACX,iBAAkB,CAAA,EAAA,EAAA,mBAAA,AAAmB,EAAC,oBAClC,uBACA,CACJ,EACJ,GAAG,AATgB,EASJ,GAIf,EAAO,MAAM,EAKjB,OAHA,MAAM,CAAA,EAAA,EAAA,YAAA,AAAY,EAAC,EAAa,EAAa,IAAI,SAAS,KAAM,CAC5D,OAAQ,GACZ,IACO,IACX,CACJ,mCA3TA,SAAS,EACL,MAAO,CAAA,EAAA,EAAA,UAAA,AAAW,EAAC,kBACf,uBACA,CACJ,EACJ","ignoreList":[2]}
1
+ {"version":3,"sources":["../../../../../../src/presentation/web/lib/server-container.ts","../../../../../../src/presentation/web/app/api/version/route.ts","../../../../../../node_modules/.pnpm/next%4016.2.2_%40babel%2Bcore%407.29.0_%40playwright%2Btest%401.59.1_react-dom%4019.2.4_react%4019.2.4__react%4019.2.4/node_modules/next/dist/esm/build/templates/app-route.js"],"sourcesContent":["/**\n * Server Container Accessor\n *\n * Provides a `resolve()` helper for server components and API routes to\n * obtain DI-managed instances. The tsyringe container is placed on globalThis\n * by the CLI bootstrap (`shipit-ai ui`) or the dev-server (`pnpm dev:web`).\n */\n\nimport type { DependencyContainer, InjectionToken } from 'tsyringe';\n\nconst CONTAINER_KEY = '__shipitAiContainer';\n\n/**\n * Resolve a dependency from the DI container.\n *\n * Usage in server components / API routes:\n * ```ts\n * import { resolve } from '@/lib/server-container';\n * import { ListFeaturesUseCase } from '@shipit-ai/core/application/use-cases/features/list-features.use-case';\n *\n * const features = await resolve(ListFeaturesUseCase).execute();\n * ```\n */\nexport function resolve<T>(token: InjectionToken<T>): T {\n const container = (globalThis as Record<string, unknown>)[CONTAINER_KEY] as\n | DependencyContainer\n | undefined;\n\n if (!container) {\n throw new Error(\n 'DI container not available. Ensure the CLI bootstrap or dev-server has initialized it.'\n );\n }\n\n return container.resolve(token);\n}\n","import { NextResponse } from 'next/server';\n\nimport { resolve } from '@/lib/server-container';\nimport type { IVersionService } from '@shipit-ai/core/application/ports/output/services/version-service.interface';\n\n/** Prevent Next.js from statically prerendering this route at build time. */\nexport const dynamic = 'force-dynamic';\n\n/**\n * Returns runtime version info.\n *\n * Reads the version from the DI container's VersionService — the same source\n * used by `shipit-ai --version`. This avoids stale values from NEXT_PUBLIC_* env\n * vars which Next.js inlines at build time.\n */\nexport function GET(): NextResponse {\n try {\n const versionService = resolve<IVersionService>('IVersionService');\n const { version, name, description } = versionService.getVersion();\n\n return NextResponse.json({\n version,\n packageName: name,\n description,\n branch: process.env.NEXT_PUBLIC_SHIPIT_AI_BRANCH ?? '',\n commitHash: process.env.NEXT_PUBLIC_SHIPIT_AI_COMMIT ?? '',\n instancePath: process.env.NEXT_PUBLIC_SHIPIT_AI_INSTANCE_PATH ?? '',\n isDev: process.env.NODE_ENV === 'development',\n });\n } catch {\n // DI container not available (e.g. during build) — fall back to env vars\n return NextResponse.json({\n version: process.env.NEXT_PUBLIC_SHIPIT_AI_VERSION ?? 'unknown',\n packageName: process.env.NEXT_PUBLIC_SHIPIT_AI_PACKAGE_NAME ?? '@shipit-ai/cli',\n description:\n process.env.NEXT_PUBLIC_SHIPIT_AI_DESCRIPTION ?? 'Autonomous AI Native SDLC Platform',\n branch: process.env.NEXT_PUBLIC_SHIPIT_AI_BRANCH ?? '',\n commitHash: process.env.NEXT_PUBLIC_SHIPIT_AI_COMMIT ?? '',\n instancePath: process.env.NEXT_PUBLIC_SHIPIT_AI_INSTANCE_PATH ?? '',\n isDev: process.env.NODE_ENV === 'development',\n });\n }\n}\n","import { AppRouteRouteModule } from \"next/dist/esm/server/route-modules/app-route/module.compiled\";\nimport { RouteKind } from \"next/dist/esm/server/route-kind\";\nimport { patchFetch as _patchFetch } from \"next/dist/esm/server/lib/patch-fetch\";\nimport { addRequestMeta, getRequestMeta, setRequestMeta } from \"next/dist/esm/server/request-meta\";\nimport { getTracer, SpanKind } from \"next/dist/esm/server/lib/trace/tracer\";\nimport { setManifestsSingleton } from \"next/dist/esm/server/app-render/manifests-singleton\";\nimport { normalizeAppPath } from \"next/dist/esm/shared/lib/router/utils/app-paths\";\nimport { NodeNextRequest, NodeNextResponse } from \"next/dist/esm/server/base-http/node\";\nimport { NextRequestAdapter, signalFromNodeResponse } from \"next/dist/esm/server/web/spec-extension/adapters/next-request\";\nimport { BaseServerSpan } from \"next/dist/esm/server/lib/trace/constants\";\nimport { getRevalidateReason } from \"next/dist/esm/server/instrumentation/utils\";\nimport { sendResponse } from \"next/dist/esm/server/send-response\";\nimport { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from \"next/dist/esm/server/web/utils\";\nimport { getCacheControlHeader } from \"next/dist/esm/server/lib/cache-control\";\nimport { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from \"next/dist/esm/lib/constants\";\nimport { NoFallbackError } from \"next/dist/esm/shared/lib/no-fallback-error.external\";\nimport { CachedRouteKind } from \"next/dist/esm/server/response-cache\";\nimport * as userland from \"INNER_APP_ROUTE\";\n// We inject the nextConfigOutput here so that we can use them in the route\n// module.\nconst nextConfigOutput = \"\"\nconst routeModule = new AppRouteRouteModule({\n definition: {\n kind: RouteKind.APP_ROUTE,\n page: \"/api/version/route\",\n pathname: \"/api/version\",\n filename: \"route\",\n bundlePath: \"\"\n },\n distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '',\n relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '',\n resolvedPagePath: \"[project]/src/presentation/web/app/api/version/route.ts\",\n nextConfigOutput,\n // The static import is used for initialization (methods, dynamic, etc.).\n userland: userland,\n // In Turbopack dev mode, also provide a getter that calls require() on every\n // request. This re-reads from devModuleCache so HMR updates are picked up,\n // and the async wrapper unwraps async-module Promises (ESM-only\n // serverExternalPackages) automatically.\n ...process.env.TURBOPACK && process.env.__NEXT_DEV_SERVER ? {\n getUserland: ()=>import(\"INNER_APP_ROUTE\")\n } : {}\n});\n// Pull out the exports that we need to expose from the module. This should\n// be eliminated when we've moved the other routes to the new format. These\n// are used to hook into the route.\nconst { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule;\nfunction patchFetch() {\n return _patchFetch({\n workAsyncStorage,\n workUnitAsyncStorage\n });\n}\nexport { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, };\nexport async function handler(req, res, ctx) {\n if (ctx.requestMeta) {\n setRequestMeta(req, ctx.requestMeta);\n }\n if (routeModule.isDev) {\n addRequestMeta(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint());\n }\n let srcPage = \"/api/version/route\";\n // turbopack doesn't normalize `/index` in the page name\n // so we need to to process dynamic routes properly\n // TODO: fix turbopack providing differing value from webpack\n if (process.env.TURBOPACK) {\n srcPage = srcPage.replace(/\\/index$/, '') || '/';\n } else if (srcPage === '/index') {\n // we always normalize /index specifically\n srcPage = '/';\n }\n const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE;\n const prepareResult = await routeModule.prepare(req, res, {\n srcPage,\n multiZoneDraftMode\n });\n if (!prepareResult) {\n res.statusCode = 400;\n res.end('Bad Request');\n ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve());\n return null;\n }\n const { buildId, params, nextConfig, parsedUrl, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname, clientReferenceManifest, serverActionsManifest } = prepareResult;\n const normalizedSrcPage = normalizeAppPath(srcPage);\n let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]);\n const render404 = async ()=>{\n // TODO: should route-module itself handle rendering the 404\n if (routerServerContext == null ? void 0 : routerServerContext.render404) {\n await routerServerContext.render404(req, res, parsedUrl, false);\n } else {\n res.end('This page could not be found');\n }\n return null;\n };\n if (isIsr && !isDraftMode) {\n const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]);\n const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage];\n if (prerenderInfo) {\n if (prerenderInfo.fallback === false && !isPrerendered) {\n if (nextConfig.adapterPath) {\n return await render404();\n }\n throw new NoFallbackError();\n }\n }\n }\n let cacheKey = null;\n if (isIsr && !routeModule.isDev && !isDraftMode) {\n cacheKey = resolvedPathname;\n // ensure /index and / is normalized to one key\n cacheKey = cacheKey === '/index' ? '/' : cacheKey;\n }\n const supportsDynamicResponse = // If we're in development, we always support dynamic HTML\n routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports\n // dynamic HTML.\n !isIsr;\n // This is a revalidation request if the request is for a static\n // page and it is not being resumed from a postponed render and\n // it is not a dynamic RSC request then it is a revalidation\n // request.\n const isStaticGeneration = isIsr && !supportsDynamicResponse;\n // Before rendering (which initializes component tree modules), we have to\n // set the reference manifests to our global store so Server Action's\n // encryption util can access to them at the top level of the page module.\n if (serverActionsManifest && clientReferenceManifest) {\n setManifestsSingleton({\n page: srcPage,\n clientReferenceManifest,\n serverActionsManifest\n });\n }\n const method = req.method || 'GET';\n const tracer = getTracer();\n const activeSpan = tracer.getActiveScopeSpan();\n const isWrappedByNextServer = Boolean(routerServerContext == null ? void 0 : routerServerContext.isWrappedByNextServer);\n const isMinimalMode = Boolean(getRequestMeta(req, 'minimalMode'));\n const incrementalCache = getRequestMeta(req, 'incrementalCache') || await routeModule.getIncrementalCache(req, nextConfig, prerenderManifest, isMinimalMode);\n incrementalCache == null ? void 0 : incrementalCache.resetRequestCache();\n globalThis.__incrementalCache = incrementalCache;\n const context = {\n params,\n previewProps: prerenderManifest.preview,\n renderOpts: {\n experimental: {\n authInterrupts: Boolean(nextConfig.experimental.authInterrupts)\n },\n cacheComponents: Boolean(nextConfig.cacheComponents),\n supportsDynamicResponse,\n incrementalCache,\n cacheLifeProfiles: nextConfig.cacheLife,\n waitUntil: ctx.waitUntil,\n onClose: (cb)=>{\n res.on('close', cb);\n },\n onAfterTaskError: undefined,\n onInstrumentationRequestError: (error, _request, errorContext, silenceLog)=>routeModule.onRequestError(req, error, errorContext, silenceLog, routerServerContext)\n },\n sharedContext: {\n buildId\n }\n };\n const nodeNextReq = new NodeNextRequest(req);\n const nodeNextRes = new NodeNextResponse(res);\n const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res));\n try {\n let parentSpan;\n const invokeRouteModule = async (span)=>{\n return routeModule.handle(nextReq, context).finally(()=>{\n if (!span) return;\n span.setAttributes({\n 'http.status_code': res.statusCode,\n 'next.rsc': false\n });\n const rootSpanAttributes = tracer.getRootSpanAttributes();\n // We were unable to get attributes, probably OTEL is not enabled\n if (!rootSpanAttributes) {\n return;\n }\n if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) {\n console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);\n return;\n }\n const route = rootSpanAttributes.get('next.route');\n if (route) {\n const name = `${method} ${route}`;\n span.setAttributes({\n 'next.route': route,\n 'http.route': route,\n 'next.span_name': name\n });\n span.updateName(name);\n // Propagate http.route to the parent span if one exists (e.g.\n // a platform-created HTTP span in adapter deployments).\n if (parentSpan && parentSpan !== span) {\n parentSpan.setAttribute('http.route', route);\n parentSpan.updateName(name);\n }\n } else {\n span.updateName(`${method} ${srcPage}`);\n }\n });\n };\n const handleResponse = async (currentSpan)=>{\n var _cacheEntry_value;\n const responseGenerator = async ({ previousCacheEntry })=>{\n try {\n if (!isMinimalMode && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) {\n res.statusCode = 404;\n // on-demand revalidate always sets this header\n res.setHeader('x-nextjs-cache', 'REVALIDATED');\n res.end('This page could not be found');\n return null;\n }\n const response = await invokeRouteModule(currentSpan);\n req.fetchMetrics = context.renderOpts.fetchMetrics;\n let pendingWaitUntil = context.renderOpts.pendingWaitUntil;\n // Attempt using provided waitUntil if available\n // if it's not we fallback to sendResponse's handling\n if (pendingWaitUntil) {\n if (ctx.waitUntil) {\n ctx.waitUntil(pendingWaitUntil);\n pendingWaitUntil = undefined;\n }\n }\n const cacheTags = context.renderOpts.collectedTags;\n // If the request is for a static response, we can cache it so long\n // as it's not edge.\n if (isIsr) {\n const blob = await response.blob();\n // Copy the headers from the response.\n const headers = toNodeOutgoingHttpHeaders(response.headers);\n if (cacheTags) {\n headers[NEXT_CACHE_TAGS_HEADER] = cacheTags;\n }\n if (!headers['content-type'] && blob.type) {\n headers['content-type'] = blob.type;\n }\n const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate;\n const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire;\n // Create the cache entry for the response.\n const cacheEntry = {\n value: {\n kind: CachedRouteKind.APP_ROUTE,\n status: response.status,\n body: Buffer.from(await blob.arrayBuffer()),\n headers\n },\n cacheControl: {\n revalidate,\n expire\n }\n };\n return cacheEntry;\n } else {\n // send response without caching if not ISR\n await sendResponse(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil);\n return null;\n }\n } catch (err) {\n // if this is a background revalidate we need to report\n // the request error here as it won't be bubbled\n if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: srcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n throw err;\n }\n };\n const cacheEntry = await routeModule.handleResponse({\n req,\n nextConfig,\n cacheKey,\n routeKind: RouteKind.APP_ROUTE,\n isFallback: false,\n prerenderManifest,\n isRoutePPREnabled: false,\n isOnDemandRevalidate,\n revalidateOnlyGenerated,\n responseGenerator,\n waitUntil: ctx.waitUntil,\n isMinimalMode\n });\n // we don't create a cacheEntry for ISR\n if (!isIsr) {\n return null;\n }\n if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) {\n var _cacheEntry_value1;\n throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), \"__NEXT_ERROR_CODE\", {\n value: \"E701\",\n enumerable: false,\n configurable: true\n });\n }\n if (!isMinimalMode) {\n res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT');\n }\n // Draft mode should never be cached\n if (isDraftMode) {\n res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');\n }\n const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers);\n if (!(isMinimalMode && isIsr)) {\n headers.delete(NEXT_CACHE_TAGS_HEADER);\n }\n // If cache control is already set on the response we don't\n // override it to allow users to customize it via next.config\n if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) {\n headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl));\n }\n await sendResponse(nodeNextReq, nodeNextRes, // @ts-expect-error - Argument of type 'Buffer<ArrayBufferLike>' is not assignable to parameter of type 'BodyInit | null | undefined'.\n new Response(cacheEntry.value.body, {\n headers,\n status: cacheEntry.value.status || 200\n }));\n return null;\n };\n // TODO: activeSpan code path is for when wrapped by\n // next-server can be removed when this is no longer used\n if (isWrappedByNextServer && activeSpan) {\n await handleResponse(activeSpan);\n } else {\n parentSpan = tracer.getActiveScopeSpan();\n await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, {\n spanName: `${method} ${srcPage}`,\n kind: SpanKind.SERVER,\n attributes: {\n 'http.method': method,\n 'http.target': req.url\n }\n }, handleResponse), undefined, !isWrappedByNextServer);\n }\n } catch (err) {\n if (!(err instanceof NoFallbackError)) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: normalizedSrcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n // rethrow so that we can handle serving error page\n // If this is during static generation, throw the error again.\n if (isIsr) throw err;\n // Otherwise, send a 500 response.\n await sendResponse(nodeNextReq, nodeNextRes, new Response(null, {\n status: 500\n }));\n return null;\n }\n}\n\n//# sourceMappingURL=app-route.js.map\n"],"names":["CONTAINER_KEY","resolve","token","container","globalThis","Error","dynamic","version","GET","versionService","name","description","getVersion","json","packageName","branch","commitHash","instancePath","isDev"],"mappings":"ogCAuBO,SAAoBE,AAAXD,CAAmC,EACjD,IAAME,EAAaC,UAAsC,CAACJ,AAdtC,mBAcoD,CAIxE,G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ACO,IACX,CACJ,mCA3TA,SAAS,EACL,MAAO,CAAA,EAAA,EAAA,UAAA,AAAW,EAAC,kBACf,uBACA,CACJ,EACJ","ignoreList":[2]}
@@ -1,3 +1,3 @@
1
- module.exports=[93995,a=>{"use strict";var b=a.i(53083),c=a.i(11321),d=a.i(40674),e=a.i(52313),f=a.i(6120);let g=(0,f.createServerReference)("400cbf4d7dd921e69b088bbea9e93a24ce3bbaf66b",f.callServer,void 0,f.findSourceMapURL,"createFeature");a.i(67999);var h=a.i(89246);a.i(78454);var i=a.i(24255),j=a.i(2824),k=a.i(18948),l=a.i(584),m=a.i(58339),n=a.i(82934),o=a.i(19884),p=a.i(96213);let q=(0,f.createServerReference)("40df728644f07c8ebf5e6ef2dd505e4415f93a85a0",f.callServer,void 0,f.findSourceMapURL,"getViewerPermission");var r=a.i(39116);let s=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"]),t={allowPrd:!1,allowPlan:!1,allowMerge:!1};var u=a.i(45242),v=a.i(3942),w=a.i(46168),x=a.i(85536),y=a.i(79620),z=a.i(96867);a.i(307);var A=a.i(30931),B=a.i(61781);function C({description:a,onDescriptionChange:d,attachments:e,onRemoveFile:f,onNotesChange:g,onPaste:i,onDragEnter:j,onDragLeave:k,onDragOver:m,onDrop:o,onAddFiles:p,isDragOver:q,uploadError:r,isPromptFocused:s,onPromptFocus:t,onPromptBlur:D,fast:E,onFastChange:F,pending:G,onPendingChange:H,overrideAgent:I,overrideModel:J,currentAgentType:K,currentModel:L,onAgentModelChange:M,isSubmitting:N}){let{t:O}=(0,h.useTranslation)("web"),P=(0,c.useRef)(null);return(0,b.jsxs)("div",{role:"region","aria-label":O("createDrawer.fileDropZone"),"data-drag-over":q?"true":"false",onDragEnter:j,onDragLeave:k,onDragOver:m,onDrop:o,className:(0,x.cn)("flex flex-col gap-1.5 rounded-md border-2 border-transparent p-1 transition-colors",q&&"border-primary/50 bg-primary/5"),children:[(0,b.jsx)(l.Label,{htmlFor:"feature-description",className:"text-muted-foreground text-xs font-semibold tracking-wider",children:O("createDrawer.describeFeature")}),(0,b.jsxs)("div",{ref:P,onFocus:t,onBlur:()=>{setTimeout(()=>{let a=P.current?.contains(document.activeElement),b=P.current?.querySelector('[aria-expanded="true"]')!==null;a||b||D()},0)},className:(0,x.cn)("border-input flex h-56 flex-col overflow-hidden rounded-md border shadow-xs transition-[color,box-shadow]",s&&"ring-ring/50 border-ring ring-[3px]"),children:[(0,b.jsx)(y.Textarea,{id:"feature-description",placeholder:O("createDrawer.featurePlaceholder"),value:a,onChange:a=>d(a.target.value),onPaste:i,required:!0,disabled:N,"aria-invalid":!!r,"aria-describedby":r?"feature-upload-error":void 0,className:"min-h-0 flex-1 resize-none rounded-none border-0 shadow-none focus-visible:ring-0"}),e.length>0&&(0,b.jsx)("div",{className:"flex flex-wrap items-center gap-1.5 px-3 py-2",children:e.map(a=>(0,b.jsx)(A.AttachmentChip,{name:a.name,size:a.size,mimeType:a.mimeType,path:a.path,onRemove:()=>f(a.id),disabled:N,loading:a.loading,notes:a.notes,onNotesChange:b=>g(a.id,b)},a.id))}),r?(0,b.jsx)("p",{id:"feature-upload-error",className:"text-destructive px-3 pb-2 text-xs",role:"alert",children:r}):null,(0,b.jsxs)("div",{className:"border-input flex items-center gap-3 border-t px-3 py-1.5",children:[(0,b.jsx)(B.AgentModelPicker,{initialAgentType:I??K??"claude-code",initialModel:J??L??"claude-sonnet-4-6",mode:"override",onAgentModelChange:M,disabled:N,className:"w-55"}),(0,b.jsxs)(n.Tooltip,{children:[(0,b.jsx)(n.TooltipTrigger,{asChild:!0,children:(0,b.jsxs)("div",{className:"ml-auto flex cursor-pointer items-center gap-2",children:[(0,b.jsx)(z.Switch,{id:"pending-mode",checked:G,onCheckedChange:H,disabled:N}),(0,b.jsxs)(l.Label,{htmlFor:"pending-mode",className:"flex cursor-pointer items-center gap-1 text-sm font-medium",children:[(0,b.jsx)(w.Clock,{className:"h-3.5 w-3.5"}),O("createDrawer.pendingMode")]})]})}),(0,b.jsx)(n.TooltipContent,{side:"bottom",children:O("createDrawer.pendingModeDescription")})]}),(0,b.jsxs)(n.Tooltip,{children:[(0,b.jsx)(n.TooltipTrigger,{asChild:!0,children:(0,b.jsxs)("div",{className:"flex cursor-pointer items-center gap-2",children:[(0,b.jsx)(z.Switch,{id:"fast-mode",checked:E,onCheckedChange:F,disabled:N}),(0,b.jsxs)(l.Label,{htmlFor:"fast-mode",className:"flex cursor-pointer items-center gap-1 text-sm font-medium",children:[(0,b.jsx)(v.Zap,{className:"h-3.5 w-3.5"}),O("createDrawer.fastModeLabel")]})]})}),(0,b.jsx)(n.TooltipContent,{side:"bottom",children:O("createDrawer.fastModeDescription")})]}),(0,b.jsxs)(n.Tooltip,{children:[(0,b.jsx)(n.TooltipTrigger,{asChild:!0,children:(0,b.jsx)("button",{type:"button",onClick:p,disabled:N,"aria-label":O("chat.attachFiles"),className:"text-muted-foreground hover:text-foreground cursor-pointer rounded p-1 transition-colors",children:(0,b.jsx)(u.PaperclipIcon,{className:"h-4 w-4"})})}),(0,b.jsx)(n.TooltipContent,{side:"bottom",children:O("chat.attachFiles")})]})]})]})]})}var D=a.i(73708),E=a.i(62147),F=a.i(28002);let G=["allowPrd","allowPlan","allowMerge"];function H({approvalGates:a,onApprovalGatesChange:c,enableEvidence:d,onEnableEvidenceChange:e,commitEvidence:f,onCommitEvidenceChange:g,push:i,onPushChange:j,openPr:k,onOpenPrChange:m,ciWatchEnabled:o,onCiWatchChange:p,rebaseBeforeBranch:q,onRebaseBeforeBranchChange:r,commitSpecs:s,onCommitSpecsChange:t,forkAndPr:u,onForkAndPrChange:v,canPush:w,fast:y,computedPush:A,computedOpenPr:B,isSubmitting:C}){let{t:I}=(0,h.useTranslation)("web"),J=[{id:"allowPrd",label:I("createDrawer.prd"),description:I("createDrawer.prdDescription")},{id:"allowPlan",label:I("createDrawer.plan"),description:I("createDrawer.planDescription")},{id:"allowMerge",label:I("createDrawer.merge"),description:I("createDrawer.mergeDescription")}];return(0,b.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,b.jsxs)("div",{className:"border-input flex items-center gap-4 rounded-md border px-3 py-2.5",children:[(0,b.jsxs)(n.Tooltip,{children:[(0,b.jsx)(n.TooltipTrigger,{asChild:!0,children:(0,b.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 cursor-default text-xs font-semibold tracking-wider",children:I("createDrawer.approve")})}),(0,b.jsx)(n.TooltipContent,{side:"bottom",children:I("createDrawer.approveDescription")})]}),(0,b.jsx)("div",{className:"flex flex-1 items-center gap-4",children:J.map(d=>(0,b.jsxs)(n.Tooltip,{children:[(0,b.jsx)(n.TooltipTrigger,{asChild:!0,children:(0,b.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,b.jsx)(z.Switch,{id:`approve-${d.id}`,size:"sm",checked:a[d.id]??!1,onCheckedChange:b=>c({...a,[d.id]:b}),disabled:C||y&&("allowPrd"===d.id||"allowPlan"===d.id)}),(0,b.jsx)(l.Label,{htmlFor:`approve-${d.id}`,className:"cursor-pointer text-xs font-medium",children:d.label})]})}),(0,b.jsx)(n.TooltipContent,{side:"bottom",children:y&&("allowPrd"===d.id||"allowPlan"===d.id)?I("createDrawer.skippedInFastMode"):d.description})]},d.id))}),(0,b.jsxs)(n.Tooltip,{children:[(0,b.jsx)(n.TooltipTrigger,{asChild:!0,children:(0,b.jsx)("button",{type:"button",onClick:()=>{let b=G.every(b=>a[b]),d={};for(let a of G)d[a]=!b;c(d)},disabled:C,className:(0,x.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",G.every(b=>a[b])&&"text-primary"),children:I("createDrawer.all")})}),(0,b.jsx)(n.TooltipContent,{side:"bottom",children:I("createDrawer.toggleAllApprovalGates")})]})]}),(0,b.jsxs)("div",{className:"border-input flex items-center gap-4 rounded-md border px-3 py-2.5",children:[(0,b.jsxs)(n.Tooltip,{children:[(0,b.jsx)(n.TooltipTrigger,{asChild:!0,children:(0,b.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 cursor-default text-xs font-semibold tracking-wider",children:I("createDrawer.evidence")})}),(0,b.jsx)(n.TooltipContent,{side:"bottom",children:I("createDrawer.evidenceDescription")})]}),(0,b.jsxs)("div",{className:"flex flex-1 items-center gap-4",children:[(0,b.jsxs)(n.Tooltip,{children:[(0,b.jsx)(n.TooltipTrigger,{asChild:!0,children:(0,b.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,b.jsx)(z.Switch,{id:"enable-evidence",size:"sm",checked:d,onCheckedChange:a=>{e(a),a||g(!1)},disabled:C}),(0,b.jsx)(l.Label,{htmlFor:"enable-evidence",className:"cursor-pointer text-xs font-medium",children:I("createDrawer.collect")})]})}),(0,b.jsx)(n.TooltipContent,{side:"bottom",children:I("createDrawer.collectDescription")})]}),(0,b.jsxs)(n.Tooltip,{children:[(0,b.jsx)(n.TooltipTrigger,{asChild:!0,children:(0,b.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,b.jsx)(z.Switch,{id:"commit-evidence",size:"sm",checked:f,onCheckedChange:g,disabled:C||!d||!k&&!u}),(0,b.jsx)(l.Label,{htmlFor:"commit-evidence",className:(0,x.cn)("cursor-pointer text-xs font-medium",(!d||!k&&!u)&&"opacity-50"),children:I("createDrawer.addToPr")})]})}),(0,b.jsx)(n.TooltipContent,{side:"bottom",children:k||u?d?I("createDrawer.addToPrDescription"):I("createDrawer.requiresEvidence"):I("createDrawer.requiresPr")})]})]})]}),(0,b.jsxs)("div",{className:"border-input flex items-start gap-4 rounded-md border px-3 py-2.5",children:[(0,b.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 pt-0.5 text-xs font-semibold tracking-wider",children:I("createDrawer.git")}),(0,b.jsxs)("div",{className:"flex flex-1 flex-wrap items-center gap-4",children:[(0,b.jsxs)(n.Tooltip,{children:[(0,b.jsx)(n.TooltipTrigger,{asChild:!0,children:(0,b.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,b.jsx)(z.Switch,{id:"push",size:"sm",checked:A,onCheckedChange:a=>{j(a),!a&&k&&m(!1)},disabled:C||u}),(0,b.jsx)(l.Label,{htmlFor:"push",className:(0,x.cn)("cursor-pointer text-xs font-medium",u&&"opacity-50"),children:I("createDrawer.push")})]})}),(0,b.jsx)(n.TooltipContent,{side:"bottom",children:u?"Enabled — contributing to upstream":I("createDrawer.pushDescription")})]}),(0,b.jsxs)(n.Tooltip,{children:[(0,b.jsx)(n.TooltipTrigger,{asChild:!0,children:(0,b.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,b.jsx)(z.Switch,{id:"open-pr",size:"sm",checked:B,onCheckedChange:a=>{m(a),a||g(!1)},disabled:C||u}),(0,b.jsx)(l.Label,{htmlFor:"open-pr",className:(0,x.cn)("cursor-pointer text-xs font-medium",u&&"opacity-50"),children:I("createDrawer.pr")})]})}),(0,b.jsx)(n.TooltipContent,{side:"bottom",children:u?"Enabled — contributing to upstream":I("createDrawer.prDescription")})]}),(0,b.jsxs)(n.Tooltip,{children:[(0,b.jsx)(n.TooltipTrigger,{asChild:!0,children:(0,b.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,b.jsx)(z.Switch,{id:"ci-watch",size:"sm",checked:o,onCheckedChange:p,disabled:C}),(0,b.jsx)(l.Label,{htmlFor:"ci-watch",className:"cursor-pointer text-xs font-medium",children:I("createDrawer.watch")})]})}),(0,b.jsx)(n.TooltipContent,{side:"bottom",children:I("createDrawer.watchDescription")})]}),(0,b.jsx)("div",{className:"bg-border h-4 w-px shrink-0"}),(0,b.jsxs)(n.Tooltip,{children:[(0,b.jsx)(n.TooltipTrigger,{asChild:!0,children:(0,b.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,b.jsx)(z.Switch,{id:"rebase-before-branch",size:"sm",checked:q,onCheckedChange:r,disabled:C}),(0,b.jsxs)(l.Label,{htmlFor:"rebase-before-branch",className:"flex cursor-pointer items-center gap-1 text-xs font-medium",children:[(0,b.jsx)(F.RefreshCw,{className:"h-3 w-3"}),I("createDrawer.sync")]})]})}),(0,b.jsx)(n.TooltipContent,{side:"bottom",children:I("createDrawer.syncDescription")})]}),(0,b.jsxs)(n.Tooltip,{children:[(0,b.jsx)(n.TooltipTrigger,{asChild:!0,children:(0,b.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,b.jsx)(z.Switch,{id:"commit-specs",size:"sm",checked:s,onCheckedChange:t,disabled:C}),(0,b.jsxs)(l.Label,{htmlFor:"commit-specs",className:"flex cursor-pointer items-center gap-1 text-xs font-medium",children:[(0,b.jsx)(E.FileText,{className:"h-3 w-3"}),I("createDrawer.commitSpecs")]})]})}),(0,b.jsx)(n.TooltipContent,{side:"bottom",children:I("createDrawer.commitSpecsDescription")})]}),!w&&(0,b.jsxs)(n.Tooltip,{children:[(0,b.jsx)(n.TooltipTrigger,{asChild:!0,children:(0,b.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,b.jsx)(z.Switch,{id:"fork-and-pr",size:"sm",checked:u,onCheckedChange:a=>{v(a),a&&t(!1)},disabled:C}),(0,b.jsxs)(l.Label,{htmlFor:"fork-and-pr",className:"flex cursor-pointer items-center gap-1 text-xs font-medium",children:[(0,b.jsx)(D.GitFork,{className:"h-3 w-3"}),I("createDrawer.forkAndPr")]})]})}),(0,b.jsx)(n.TooltipContent,{side:"bottom",children:I("createDrawer.forkAndPrDescription")})]})]})]})]})}var I=a.i(14177),J=a.i(10606),K=a.i(90920),L=a.i(53823);function M({features:a,value:d,onChange:e,disabled:f}){let{t:g}=(0,h.useTranslation)("web"),[i,j]=(0,c.useState)(!1),[k,l]=(0,c.useState)(""),m=(0,c.useRef)(null),n=a.find(a=>a.id===d),o=k.trim()?a.filter(a=>a.name.toLowerCase().includes(k.toLowerCase())||a.id.toLowerCase().includes(k.toLowerCase())):a,p=(0,c.useCallback)(a=>{e(a),j(!1),l("")},[e]);return(0,c.useEffect)(()=>{i?setTimeout(()=>m.current?.focus(),0):l("")},[i]),(0,b.jsxs)(L.Popover,{open:i,onOpenChange:j,children:[(0,b.jsx)(L.PopoverTrigger,{asChild:!0,children:(0,b.jsxs)("button",{id:"parent-feature",type:"button",role:"combobox","aria-expanded":i,"aria-label":"Parent Feature",disabled:f,"data-testid":"parent-feature-combobox",className:(0,x.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",!n&&"text-muted-foreground"),children:[(0,b.jsx)("span",{className:"truncate",children:n?`${n.name} (${n.id.slice(0,8)})`:g("createDrawer.selectParent")}),(0,b.jsx)(I.ChevronsUpDown,{className:"ms-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,b.jsx)(L.PopoverContent,{className:"w-80 p-0",align:"start","data-testid":"parent-feature-combobox-content",children:(0,b.jsxs)("div",{className:"flex flex-col",children:[(0,b.jsx)("div",{className:"border-b p-2",children:(0,b.jsx)(K.Input,{ref:m,placeholder:g("createDrawer.searchFeatures"),value:k,onChange:a=>l(a.target.value),className:"h-8 border-0 p-0 text-sm shadow-none focus-visible:ring-0","data-testid":"parent-feature-search"})}),(0,b.jsxs)("div",{className:"max-h-48 overflow-y-auto py-1",role:"listbox","aria-label":"Features",children:[(0,b.jsxs)("button",{type:"button",role:"option","aria-selected":void 0===d,onClick:()=>p(void 0),className:(0,x.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",void 0===d&&"bg-accent/50"),"data-testid":"parent-feature-option-none",children:[(0,b.jsx)(J.CheckIcon,{className:(0,x.cn)("h-4 w-4 shrink-0",void 0!==d&&"invisible")}),(0,b.jsx)("span",{className:"text-muted-foreground italic",children:g("createDrawer.noParent")})]}),0===o.length&&k?(0,b.jsx)("p",{className:"text-muted-foreground px-3 py-2 text-sm",children:g("createDrawer.noFeaturesFound")}):o.map(a=>(0,b.jsxs)("button",{type:"button",role:"option","aria-selected":d===a.id,onClick:()=>p(a.id),className:(0,x.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",d===a.id&&"bg-accent/50"),"data-testid":`parent-feature-option-${a.id}`,children:[(0,b.jsx)(J.CheckIcon,{className:(0,x.cn)("h-4 w-4 shrink-0",d!==a.id&&"invisible")}),(0,b.jsxs)("span",{className:"truncate",children:[a.name," ",(0,b.jsxs)("span",{className:"text-muted-foreground font-mono text-xs",children:["(",a.id.slice(0,8),")"]})]})]},a.id))]})]})})]})}var N=a.i(42527),O=a.i(88064),P=a.i(13126),Q=a.i(21333),R=a.i(84339),S=a.i(1377);a.i(21434);var T=a.i(34379);function U({repositories:a,value:d,onChange:e,onAddRepository:f,disabled:g}){let[i,j]=(0,c.useState)(!1),[k,l]=(0,c.useState)(""),[m,n]=(0,c.useState)(!1),[o,p]=(0,c.useState)(null),[q,r]=(0,c.useState)(!1),s=(0,c.useRef)(null),{reactFileManager:t}=(0,Q.useFeatureFlags)(),{t:u}=(0,h.useTranslation)("web"),v=a.find(a=>a.path===d),w=k.trim()?a.filter(a=>a.name.toLowerCase().includes(k.toLowerCase())||a.path.toLowerCase().includes(k.toLowerCase())):a,y=(0,c.useCallback)(a=>{e(a),j(!1),l("")},[e]),z=(0,c.useCallback)(async a=>{let b=await (0,R.addRepository)({path:a});if(b.error){p(b.error),n(!1);return}if(b.repository){let a={id:b.repository.id,name:b.repository.name,path:b.repository.path};f?.(a),e(a.path),j(!1),l("")}},[f,e]),A=(0,c.useCallback)(async()=>{if(!m){if(t)return void r(!0);n(!0),p(null);try{let a=await (0,S.pickFolder)();if(!a)return void n(!1);await z(a)}catch{r(!0)}finally{n(!1)}}},[m,t,z]),B=(0,c.useCallback)(async a=>{if(r(!1),a){n(!0),p(null);try{await z(a)}catch(a){p(a instanceof Error?a.message:"Failed to add repository")}finally{n(!1)}}},[z]);return(0,c.useEffect)(()=>{i?setTimeout(()=>s.current?.focus(),0):l("")},[i]),(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(L.Popover,{open:i,onOpenChange:j,children:[(0,b.jsx)(L.PopoverTrigger,{asChild:!0,children:(0,b.jsxs)("button",{type:"button",role:"combobox","aria-expanded":i,"aria-label":"Repository","aria-invalid":!!o,"aria-describedby":o?"add-repository-error-msg":void 0,disabled:g,"data-testid":"repository-combobox",className:(0,x.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",!v&&"text-muted-foreground"),children:[(0,b.jsx)("span",{className:"truncate",children:v?v.name:"Select repository..."}),(0,b.jsx)(I.ChevronsUpDown,{className:"ms-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,b.jsx)(L.PopoverContent,{className:"w-80 p-0",align:"start","data-testid":"repository-combobox-content",children:(0,b.jsxs)("div",{className:"flex flex-col",children:[(0,b.jsx)("div",{className:"border-b p-2",children:(0,b.jsx)(K.Input,{ref:s,placeholder:u("createDrawer.searchRepositories"),value:k,onChange:a=>l(a.target.value),className:"h-8 border-0 p-0 text-sm shadow-none focus-visible:ring-0","data-testid":"repository-search"})}),(0,b.jsx)("div",{className:"max-h-48 overflow-y-auto py-1",role:"listbox","aria-label":"Repositories",children:0===w.length?(0,b.jsx)("p",{className:"text-muted-foreground px-3 py-2 text-sm","data-testid":"repository-empty",children:"No repositories found."}):w.map(a=>(0,b.jsxs)("button",{type:"button",role:"option","aria-selected":d===a.path,onClick:()=>y(a.path),className:(0,x.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",d===a.path&&"bg-accent/50"),"data-testid":`repository-option-${a.id}`,children:[(0,b.jsx)(J.CheckIcon,{className:(0,x.cn)("h-4 w-4 shrink-0",d!==a.path&&"invisible")}),(0,b.jsxs)("span",{className:"flex flex-col items-start truncate",children:[(0,b.jsx)("span",{className:"truncate",children:a.name}),(0,b.jsx)("span",{className:"text-muted-foreground truncate text-xs",children:a.path})]})]},a.id))}),(0,b.jsx)(P.Separator,{}),(0,b.jsxs)("button",{type:"button",onClick:A,disabled:m,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:[m?(0,b.jsx)(O.Loader2,{className:"h-4 w-4 shrink-0 animate-spin"}):(0,b.jsx)(N.FolderPlus,{className:"h-4 w-4 shrink-0"}),(0,b.jsx)("span",{children:"Add new repository..."})]}),o?(0,b.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:o}):null]})})]}),(0,b.jsx)(T.ReactFileManagerDialog,{open:q,onOpenChange:a=>{a||r(!1)},onSelect:B})]})}function V({open:a,onClose:d,onSubmit:e,repositoryPath:f,isSubmitting:g=!1,workflowDefaults:u,features:v,repositories:w,initialParentId:x,currentAgentType:y,currentModel:z,initialDescription:A,canPushDirectly:B}){let{t:D}=(0,h.useTranslation)("web"),E=function({open:a,onClose:b,onSubmit:d,repositoryPath:e,workflowDefaults:f,repositories:g,initialParentId:h,currentAgentType:i,currentModel:j,initialDescription:k,canPushDirectly:l}){let m=(0,o.useSoundAction)("create"),n=e&&(!g||0===g.length||g.some(a=>a.path===e))?e:"",u=f?.approvalGates??t,v=f?.push??!1,w=f?.openPr??!1,x=f?.ciWatchEnabled!==!1,y=f?.enableEvidence??!1,z=f?.commitEvidence??!1,A=f?.fast!==!1,[B,C]=(0,c.useState)(k??"");(0,c.useEffect)(()=>{k&&C(k)},[k]);let[D,E]=(0,c.useState)([]),[F,G]=(0,c.useState)({...u}),[H,I]=(0,c.useState)(v),[J,K]=(0,c.useState)(w),[L,M]=(0,c.useState)(f?.ciWatchEnabled!==!1),[N,O]=(0,c.useState)(y),[P,Q]=(0,c.useState)(z),[R,S]=(0,c.useState)(void 0),[T,U]=(0,c.useState)(A),[V,W]=(0,c.useState)(!1),[X,Y]=(0,c.useState)(!1),[Z,$]=(0,c.useState)(!0),[_,aa]=(0,c.useState)(!0),[ab,ac]=(0,c.useState)(void 0),[ad,ae]=(0,c.useState)(void 0),[af,ag]=(0,c.useState)(n||void 0),[ah,ai]=(0,c.useState)(g??[]),[aj,ak]=(0,c.useState)(!1),[al,am]=(0,c.useState)(null),[an,ao]=(0,c.useState)(!1),ap=(0,c.useRef)(crypto.randomUUID()),aq=(0,c.useRef)(0);(0,c.useEffect)(()=>{f&&(G({...f.approvalGates}),I(f.push),K(f.openPr),M(!1!==f.ciWatchEnabled),O(f.enableEvidence),Q(f.commitEvidence),U(!1!==f.fast))},[f]),(0,c.useEffect)(()=>{ai(g??[])},[g]),(0,c.useEffect)(()=>{a&&h&&S(h)},[a,h]);let[ar,as]=(0,c.useState)(l??!1);(0,c.useEffect)(()=>{as(l??!1)},[l]);let at=(0,c.useRef)(af);(0,c.useEffect)(()=>{af&&af!==at.current&&(at.current=af,q(af).then(a=>as(a.canPushDirectly)).catch(()=>as(!1)))},[af]),(0,c.useEffect)(()=>{ar&&(Y(!1),I(v),K(w),$(!0))},[ar,v,w]);let au=(0,c.useCallback)(()=>{C(""),E([]),G({...u}),I(v),K(w),M(x),O(y),Q(z),S(void 0),ag(n||void 0),ai(g??[]),U(A),W(!1),Y(!1),$(!0),aa(!0),ac(void 0),ae(void 0),am(null),aq.current=0,ak(!1)},[u,v,w,y,x,z,A,n,g]),av=""!==B.trim()||D.length>0,{attemptClose:aw}=(0,p.useGuardedDrawerClose)({open:a,isDirty:av,onClose:b,onReset:au}),ax=(0,c.useCallback)(async a=>{for(let b of(am(null),a)){if(b.size>0xa00000)return void am(`"${b.name}" exceeds 10 MB limit`);let a=function(a){let b=a.lastIndexOf(".");return b>=0?a.slice(b).toLowerCase():""}(b.name);if(a&&!s.has(a))return void am(`File type "${a}" is not allowed`)}for(let b of a){let a=crypto.randomUUID();E(c=>[...c,{id:a,name:b.name,size:b.size,mimeType:b.type||"application/octet-stream",path:"",loading:!0}]);try{let c=new FormData;c.append("file",b),c.append("sessionId",ap.current);let d=await fetch("/api/attachments/upload",{method:"POST",body:c});if(!d.ok){let b=await d.json().catch(()=>({error:"Upload failed"}));E(b=>b.filter(b=>b.id!==a)),am(b.error??"Upload failed");return}let e=await d.json();E(b=>b.some(b=>b.id!==a&&b.path===e.path)?b.filter(b=>b.id!==a):b.map(b=>b.id===a?{...e,id:a,loading:!1}:b))}catch{E(b=>b.filter(b=>b.id!==a)),am("Upload failed")}}},[]),ay=(0,c.useCallback)(a=>{a.preventDefault(),a.stopPropagation(),aq.current+=1,1===aq.current&&ak(!0)},[]),az=(0,c.useCallback)(a=>{a.preventDefault(),a.stopPropagation(),aq.current-=1,0===aq.current&&ak(!1)},[]),aA=(0,c.useCallback)(a=>{a.preventDefault(),a.stopPropagation()},[]),aB=(0,c.useCallback)(a=>{a.preventDefault(),a.stopPropagation(),aq.current=0,ak(!1);let b=Array.from(a.dataTransfer.files);b.length>0&&ax(b)},[ax]),aC=(0,c.useCallback)(a=>{let b=a.clipboardData?.items;if(!b)return;let c=[];for(let a of Array.from(b))if("file"===a.kind){let b=a.getAsFile();b&&c.push(b)}c.length>0&&(a.preventDefault(),ax(c))},[ax]),aD=(0,c.useCallback)(a=>{if(a.preventDefault(),!B.trim())return;let b=af??n;b&&(m.play(),d({description:B.trim(),attachments:D.filter(a=>!a.loading),repositoryPath:b,approvalGates:{allowPrd:F.allowPrd??!1,allowPlan:F.allowPlan??!1,allowMerge:F.allowMerge??!1},push:!!X||H||J,openPr:!!X||J,ciWatchEnabled:L,enableEvidence:N,commitEvidence:P,fast:T,forkAndPr:X,commitSpecs:Z,rebaseBeforeBranch:_,...V?{pending:V}:{},...ab?{agentType:ab}:{},...ad?{model:ad}:{},...R?{parentId:R}:{},sessionId:ap.current}),au())},[B,D,F,af,n,d,H,J,N,L,P,T,X,Z,_,V,ab,ad,R,m,au]),aE=(0,c.useCallback)(async()=>{try{let a=await (0,r.pickFiles)();if(!a)return;for(let b of a){let a=crypto.randomUUID();E(c=>[...c,{id:a,name:b.name,size:b.size,mimeType:"application/octet-stream",path:"",loading:!0}]);try{let c=await fetch("/api/attachments/upload-from-path",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:b.path,sessionId:ap.current})});if(!c.ok){let b=await c.json().catch(()=>({error:"Upload failed"}));E(b=>b.filter(b=>b.id!==a)),am(b.error??"Upload failed");return}let d=await c.json();E(b=>b.some(b=>b.id!==a&&b.path===d.path)?b.filter(b=>b.id!==a):b.map(b=>b.id===a?{...d,id:a,loading:!1}:b))}catch{E(b=>b.filter(b=>b.id!==a)),am("Upload failed")}}}catch{}},[]),aF=(0,c.useCallback)(a=>{E(b=>b.filter(b=>b.id!==a))},[]),aG=(0,c.useCallback)((a,b)=>{E(c=>c.map(c=>c.id===a?{...c,notes:b}:c))},[]);return{validRepoPath:n,canPush:ar,isDirty:av,computedPush:!!X||H||J,computedOpenPr:!!X||J,description:B,setDescription:C,attachments:D,approvalGates:F,setApprovalGates:G,push:H,setPush:I,openPr:J,setOpenPr:K,ciWatchEnabled:L,setCiWatchEnabled:M,enableEvidence:N,setEnableEvidence:O,commitEvidence:P,setCommitEvidence:Q,parentId:R,setParentId:S,fast:T,setFast:U,pending:V,setPending:W,forkAndPr:X,setForkAndPr:Y,commitSpecs:Z,setCommitSpecs:$,rebaseBeforeBranch:_,setRebaseBeforeBranch:aa,overrideAgent:ab,setOverrideAgent:ac,overrideModel:ad,setOverrideModel:ae,selectedRepoPath:af,setSelectedRepoPath:ag,localRepos:ah,setLocalRepos:ai,isDragOver:aj,uploadError:al,isPromptFocused:an,setIsPromptFocused:ao,sessionIdRef:ap,currentAgentType:i,currentModel:j,attemptClose:aw,handleFiles:ax,handleDragEnter:ay,handleDragLeave:az,handleDragOver:aA,handleDrop:aB,handlePaste:aC,handleSubmit:aD,handleAddFiles:aE,handleRemoveFile:aF,handleNotesChange:aG,resetForm:au}}({open:a,onClose:d,onSubmit:e,repositoryPath:f,workflowDefaults:u,repositories:w,initialParentId:x,currentAgentType:y,currentModel:z,initialDescription:A,canPushDirectly:B}),F=(0,c.useRef)(null),G=(0,c.useCallback)(a=>{(a.ctrlKey||a.metaKey)&&"Enter"===a.key&&(a.preventDefault(),F.current?.requestSubmit())},[]),I=v&&v.length>0,J=!E.validRepoPath&&void 0!==w,K=!E.validRepoPath&&!E.selectedRepoPath;return(0,b.jsx)(i.BaseDrawer,{open:a,onClose:E.attemptClose,size:"md",modal:!1,dismissOnOutsideClick:!0,"data-testid":"feature-create-drawer",header:(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("div",{className:"h-2.5 w-2.5 shrink-0 rounded-full bg-blue-500"}),(0,b.jsx)(j.DrawerTitle,{children:D("createDrawer.title")})]}),g?(0,b.jsx)(j.DrawerDescription,{asChild:!0,children:(0,b.jsx)("div",{children:(0,b.jsx)(m.Badge,{variant:"secondary",children:D("createDrawer.creating")})})}):null]}),footer:(0,b.jsxs)("div",{className:"flex flex-row justify-end gap-2",children:[(0,b.jsx)(k.Button,{variant:"outline",onClick:E.attemptClose,disabled:g,children:D("createDrawer.cancel")}),(0,b.jsx)(k.Button,{type:"submit",form:"create-feature-form",disabled:!E.description.trim()||g||K,children:D(g?"createDrawer.creating":"createDrawer.createFeature")})]}),children:(0,b.jsx)("div",{className:"overflow-y-auto p-4",children:(0,b.jsx)(n.TooltipProvider,{delayDuration:400,children:(0,b.jsxs)("form",{ref:F,id:"create-feature-form",onSubmit:E.handleSubmit,onKeyDown:G,className:"flex flex-col gap-4",children:[J?(0,b.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"repo-selector-section",children:[(0,b.jsx)(l.Label,{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:D("createDrawer.repository")}),(0,b.jsx)(U,{repositories:E.localRepos,value:E.selectedRepoPath,onChange:E.setSelectedRepoPath,onAddRepository:a=>{E.setLocalRepos(b=>[...b,a]),E.setSelectedRepoPath(a.path)},disabled:g})]}):E.validRepoPath?(0,b.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"repo-readonly-section",children:[(0,b.jsx)(l.Label,{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:D("createDrawer.repository")}),(0,b.jsx)("p",{className:"text-sm","data-testid":"repo-readonly-label",children:w?.find(a=>a.path===E.validRepoPath)?.name??E.validRepoPath.split("/").pop()})]}):null,(0,b.jsx)(C,{description:E.description,onDescriptionChange:E.setDescription,attachments:E.attachments,onRemoveFile:E.handleRemoveFile,onNotesChange:E.handleNotesChange,onPaste:E.handlePaste,onDragEnter:E.handleDragEnter,onDragLeave:E.handleDragLeave,onDragOver:E.handleDragOver,onDrop:E.handleDrop,onAddFiles:E.handleAddFiles,isDragOver:E.isDragOver,uploadError:E.uploadError,isPromptFocused:E.isPromptFocused,onPromptFocus:()=>E.setIsPromptFocused(!0),onPromptBlur:()=>E.setIsPromptFocused(!1),fast:E.fast,onFastChange:E.setFast,pending:E.pending,onPendingChange:E.setPending,overrideAgent:E.overrideAgent,overrideModel:E.overrideModel,currentAgentType:y,currentModel:z,onAgentModelChange:(a,b)=>{E.setOverrideAgent(a),E.setOverrideModel(b)},isSubmitting:g}),I&&void 0!==x?(0,b.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,b.jsx)(l.Label,{htmlFor:"parent-feature",className:"text-muted-foreground text-xs font-semibold tracking-wider",children:D("createDrawer.parentFeature")}),(0,b.jsx)(M,{features:v,value:E.parentId,onChange:E.setParentId,disabled:g})]}):null,(0,b.jsx)(H,{approvalGates:E.approvalGates,onApprovalGatesChange:E.setApprovalGates,enableEvidence:E.enableEvidence,onEnableEvidenceChange:E.setEnableEvidence,commitEvidence:E.commitEvidence,onCommitEvidenceChange:E.setCommitEvidence,push:E.push,onPushChange:E.setPush,openPr:E.openPr,onOpenPrChange:E.setOpenPr,ciWatchEnabled:E.ciWatchEnabled,onCiWatchChange:E.setCiWatchEnabled,rebaseBeforeBranch:E.rebaseBeforeBranch,onRebaseBeforeBranchChange:E.setRebaseBeforeBranch,commitSpecs:E.commitSpecs,onCommitSpecsChange:E.setCommitSpecs,forkAndPr:E.forkAndPr,onForkAndPrChange:E.setForkAndPr,canPush:E.canPush,fast:E.fast,computedPush:E.computedPush,computedOpenPr:E.computedOpenPr,isSubmitting:g})]})})})})}a.s(["CreateDrawerClient",0,function({repositoryPath:a,initialParentId:f,initialDescription:h,features:i,repositories:j,workflowDefaults:k,currentAgentType:l,currentModel:m,canPushDirectly:n}){let o=(0,d.useRouter)(),[p,q]=(0,c.useState)(!1),r=(0,d.usePathname)().startsWith("/create"),s=!p&&r;(0,c.useEffect)(()=>{!r&&p&&q(!1)},[r,p]);let t=(0,c.useCallback)(()=>{o.push("/")},[o]),u=(0,c.useCallback)(a=>{q(!0),o.push("/"),g(a).then(b=>{b.error?e.toast.error(b.error):window.dispatchEvent(new CustomEvent("shipit-ai:feature-created",{detail:{featureId:b.feature.id,name:b.feature.name,description:b.feature.description,repositoryPath:b.feature.repositoryPath,parentId:a.parentId}}))}).catch(()=>{e.toast.error("Failed to create feature"),q(!1)})},[o]);return(0,b.jsx)(V,{open:s,onClose:t,onSubmit:u,repositoryPath:a,features:i,repositories:j,workflowDefaults:k,initialParentId:f,initialDescription:h,isSubmitting:p,currentAgentType:l,currentModel:m,canPushDirectly:n})}],93995)}];
1
+ module.exports=[93995,a=>{"use strict";var b=a.i(53083),c=a.i(11321),d=a.i(40674),e=a.i(52313),f=a.i(6120);let g=(0,f.createServerReference)("40334965bad865df464de0583e49535e5c2f29a6bf",f.callServer,void 0,f.findSourceMapURL,"createFeature");a.i(67999);var h=a.i(89246);a.i(78454);var i=a.i(24255),j=a.i(2824),k=a.i(18948),l=a.i(584),m=a.i(58339),n=a.i(82934),o=a.i(19884),p=a.i(96213);let q=(0,f.createServerReference)("409f0d96e27b61bc387e0d2573fb24b2ae2b64eec4",f.callServer,void 0,f.findSourceMapURL,"getViewerPermission");var r=a.i(39116);let s=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"]),t={allowPrd:!1,allowPlan:!1,allowMerge:!1};var u=a.i(45242),v=a.i(3942),w=a.i(46168),x=a.i(85536),y=a.i(79620),z=a.i(96867);a.i(307);var A=a.i(30931),B=a.i(61781);function C({description:a,onDescriptionChange:d,attachments:e,onRemoveFile:f,onNotesChange:g,onPaste:i,onDragEnter:j,onDragLeave:k,onDragOver:m,onDrop:o,onAddFiles:p,isDragOver:q,uploadError:r,isPromptFocused:s,onPromptFocus:t,onPromptBlur:D,fast:E,onFastChange:F,pending:G,onPendingChange:H,overrideAgent:I,overrideModel:J,currentAgentType:K,currentModel:L,onAgentModelChange:M,isSubmitting:N}){let{t:O}=(0,h.useTranslation)("web"),P=(0,c.useRef)(null);return(0,b.jsxs)("div",{role:"region","aria-label":O("createDrawer.fileDropZone"),"data-drag-over":q?"true":"false",onDragEnter:j,onDragLeave:k,onDragOver:m,onDrop:o,className:(0,x.cn)("flex flex-col gap-1.5 rounded-md border-2 border-transparent p-1 transition-colors",q&&"border-primary/50 bg-primary/5"),children:[(0,b.jsx)(l.Label,{htmlFor:"feature-description",className:"text-muted-foreground text-xs font-semibold tracking-wider",children:O("createDrawer.describeFeature")}),(0,b.jsxs)("div",{ref:P,onFocus:t,onBlur:()=>{setTimeout(()=>{let a=P.current?.contains(document.activeElement),b=P.current?.querySelector('[aria-expanded="true"]')!==null;a||b||D()},0)},className:(0,x.cn)("border-input flex h-56 flex-col overflow-hidden rounded-md border shadow-xs transition-[color,box-shadow]",s&&"ring-ring/50 border-ring ring-[3px]"),children:[(0,b.jsx)(y.Textarea,{id:"feature-description",placeholder:O("createDrawer.featurePlaceholder"),value:a,onChange:a=>d(a.target.value),onPaste:i,required:!0,disabled:N,"aria-invalid":!!r,"aria-describedby":r?"feature-upload-error":void 0,className:"min-h-0 flex-1 resize-none rounded-none border-0 shadow-none focus-visible:ring-0"}),e.length>0&&(0,b.jsx)("div",{className:"flex flex-wrap items-center gap-1.5 px-3 py-2",children:e.map(a=>(0,b.jsx)(A.AttachmentChip,{name:a.name,size:a.size,mimeType:a.mimeType,path:a.path,onRemove:()=>f(a.id),disabled:N,loading:a.loading,notes:a.notes,onNotesChange:b=>g(a.id,b)},a.id))}),r?(0,b.jsx)("p",{id:"feature-upload-error",className:"text-destructive px-3 pb-2 text-xs",role:"alert",children:r}):null,(0,b.jsxs)("div",{className:"border-input flex items-center gap-3 border-t px-3 py-1.5",children:[(0,b.jsx)(B.AgentModelPicker,{initialAgentType:I??K??"claude-code",initialModel:J??L??"claude-sonnet-4-6",mode:"override",onAgentModelChange:M,disabled:N,className:"w-55"}),(0,b.jsxs)(n.Tooltip,{children:[(0,b.jsx)(n.TooltipTrigger,{asChild:!0,children:(0,b.jsxs)("div",{className:"ml-auto flex cursor-pointer items-center gap-2",children:[(0,b.jsx)(z.Switch,{id:"pending-mode",checked:G,onCheckedChange:H,disabled:N}),(0,b.jsxs)(l.Label,{htmlFor:"pending-mode",className:"flex cursor-pointer items-center gap-1 text-sm font-medium",children:[(0,b.jsx)(w.Clock,{className:"h-3.5 w-3.5"}),O("createDrawer.pendingMode")]})]})}),(0,b.jsx)(n.TooltipContent,{side:"bottom",children:O("createDrawer.pendingModeDescription")})]}),(0,b.jsxs)(n.Tooltip,{children:[(0,b.jsx)(n.TooltipTrigger,{asChild:!0,children:(0,b.jsxs)("div",{className:"flex cursor-pointer items-center gap-2",children:[(0,b.jsx)(z.Switch,{id:"fast-mode",checked:E,onCheckedChange:F,disabled:N}),(0,b.jsxs)(l.Label,{htmlFor:"fast-mode",className:"flex cursor-pointer items-center gap-1 text-sm font-medium",children:[(0,b.jsx)(v.Zap,{className:"h-3.5 w-3.5"}),O("createDrawer.fastModeLabel")]})]})}),(0,b.jsx)(n.TooltipContent,{side:"bottom",children:O("createDrawer.fastModeDescription")})]}),(0,b.jsxs)(n.Tooltip,{children:[(0,b.jsx)(n.TooltipTrigger,{asChild:!0,children:(0,b.jsx)("button",{type:"button",onClick:p,disabled:N,"aria-label":O("chat.attachFiles"),className:"text-muted-foreground hover:text-foreground cursor-pointer rounded p-1 transition-colors",children:(0,b.jsx)(u.PaperclipIcon,{className:"h-4 w-4"})})}),(0,b.jsx)(n.TooltipContent,{side:"bottom",children:O("chat.attachFiles")})]})]})]})]})}var D=a.i(73708),E=a.i(62147),F=a.i(28002);let G=["allowPrd","allowPlan","allowMerge"];function H({approvalGates:a,onApprovalGatesChange:c,enableEvidence:d,onEnableEvidenceChange:e,commitEvidence:f,onCommitEvidenceChange:g,push:i,onPushChange:j,openPr:k,onOpenPrChange:m,ciWatchEnabled:o,onCiWatchChange:p,rebaseBeforeBranch:q,onRebaseBeforeBranchChange:r,commitSpecs:s,onCommitSpecsChange:t,forkAndPr:u,onForkAndPrChange:v,canPush:w,fast:y,computedPush:A,computedOpenPr:B,isSubmitting:C}){let{t:I}=(0,h.useTranslation)("web"),J=[{id:"allowPrd",label:I("createDrawer.prd"),description:I("createDrawer.prdDescription")},{id:"allowPlan",label:I("createDrawer.plan"),description:I("createDrawer.planDescription")},{id:"allowMerge",label:I("createDrawer.merge"),description:I("createDrawer.mergeDescription")}];return(0,b.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,b.jsxs)("div",{className:"border-input flex items-center gap-4 rounded-md border px-3 py-2.5",children:[(0,b.jsxs)(n.Tooltip,{children:[(0,b.jsx)(n.TooltipTrigger,{asChild:!0,children:(0,b.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 cursor-default text-xs font-semibold tracking-wider",children:I("createDrawer.approve")})}),(0,b.jsx)(n.TooltipContent,{side:"bottom",children:I("createDrawer.approveDescription")})]}),(0,b.jsx)("div",{className:"flex flex-1 items-center gap-4",children:J.map(d=>(0,b.jsxs)(n.Tooltip,{children:[(0,b.jsx)(n.TooltipTrigger,{asChild:!0,children:(0,b.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,b.jsx)(z.Switch,{id:`approve-${d.id}`,size:"sm",checked:a[d.id]??!1,onCheckedChange:b=>c({...a,[d.id]:b}),disabled:C||y&&("allowPrd"===d.id||"allowPlan"===d.id)}),(0,b.jsx)(l.Label,{htmlFor:`approve-${d.id}`,className:"cursor-pointer text-xs font-medium",children:d.label})]})}),(0,b.jsx)(n.TooltipContent,{side:"bottom",children:y&&("allowPrd"===d.id||"allowPlan"===d.id)?I("createDrawer.skippedInFastMode"):d.description})]},d.id))}),(0,b.jsxs)(n.Tooltip,{children:[(0,b.jsx)(n.TooltipTrigger,{asChild:!0,children:(0,b.jsx)("button",{type:"button",onClick:()=>{let b=G.every(b=>a[b]),d={};for(let a of G)d[a]=!b;c(d)},disabled:C,className:(0,x.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",G.every(b=>a[b])&&"text-primary"),children:I("createDrawer.all")})}),(0,b.jsx)(n.TooltipContent,{side:"bottom",children:I("createDrawer.toggleAllApprovalGates")})]})]}),(0,b.jsxs)("div",{className:"border-input flex items-center gap-4 rounded-md border px-3 py-2.5",children:[(0,b.jsxs)(n.Tooltip,{children:[(0,b.jsx)(n.TooltipTrigger,{asChild:!0,children:(0,b.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 cursor-default text-xs font-semibold tracking-wider",children:I("createDrawer.evidence")})}),(0,b.jsx)(n.TooltipContent,{side:"bottom",children:I("createDrawer.evidenceDescription")})]}),(0,b.jsxs)("div",{className:"flex flex-1 items-center gap-4",children:[(0,b.jsxs)(n.Tooltip,{children:[(0,b.jsx)(n.TooltipTrigger,{asChild:!0,children:(0,b.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,b.jsx)(z.Switch,{id:"enable-evidence",size:"sm",checked:d,onCheckedChange:a=>{e(a),a||g(!1)},disabled:C}),(0,b.jsx)(l.Label,{htmlFor:"enable-evidence",className:"cursor-pointer text-xs font-medium",children:I("createDrawer.collect")})]})}),(0,b.jsx)(n.TooltipContent,{side:"bottom",children:I("createDrawer.collectDescription")})]}),(0,b.jsxs)(n.Tooltip,{children:[(0,b.jsx)(n.TooltipTrigger,{asChild:!0,children:(0,b.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,b.jsx)(z.Switch,{id:"commit-evidence",size:"sm",checked:f,onCheckedChange:g,disabled:C||!d||!k&&!u}),(0,b.jsx)(l.Label,{htmlFor:"commit-evidence",className:(0,x.cn)("cursor-pointer text-xs font-medium",(!d||!k&&!u)&&"opacity-50"),children:I("createDrawer.addToPr")})]})}),(0,b.jsx)(n.TooltipContent,{side:"bottom",children:k||u?d?I("createDrawer.addToPrDescription"):I("createDrawer.requiresEvidence"):I("createDrawer.requiresPr")})]})]})]}),(0,b.jsxs)("div",{className:"border-input flex items-start gap-4 rounded-md border px-3 py-2.5",children:[(0,b.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 pt-0.5 text-xs font-semibold tracking-wider",children:I("createDrawer.git")}),(0,b.jsxs)("div",{className:"flex flex-1 flex-wrap items-center gap-4",children:[(0,b.jsxs)(n.Tooltip,{children:[(0,b.jsx)(n.TooltipTrigger,{asChild:!0,children:(0,b.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,b.jsx)(z.Switch,{id:"push",size:"sm",checked:A,onCheckedChange:a=>{j(a),!a&&k&&m(!1)},disabled:C||u}),(0,b.jsx)(l.Label,{htmlFor:"push",className:(0,x.cn)("cursor-pointer text-xs font-medium",u&&"opacity-50"),children:I("createDrawer.push")})]})}),(0,b.jsx)(n.TooltipContent,{side:"bottom",children:u?"Enabled — contributing to upstream":I("createDrawer.pushDescription")})]}),(0,b.jsxs)(n.Tooltip,{children:[(0,b.jsx)(n.TooltipTrigger,{asChild:!0,children:(0,b.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,b.jsx)(z.Switch,{id:"open-pr",size:"sm",checked:B,onCheckedChange:a=>{m(a),a||g(!1)},disabled:C||u}),(0,b.jsx)(l.Label,{htmlFor:"open-pr",className:(0,x.cn)("cursor-pointer text-xs font-medium",u&&"opacity-50"),children:I("createDrawer.pr")})]})}),(0,b.jsx)(n.TooltipContent,{side:"bottom",children:u?"Enabled — contributing to upstream":I("createDrawer.prDescription")})]}),(0,b.jsxs)(n.Tooltip,{children:[(0,b.jsx)(n.TooltipTrigger,{asChild:!0,children:(0,b.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,b.jsx)(z.Switch,{id:"ci-watch",size:"sm",checked:o,onCheckedChange:p,disabled:C}),(0,b.jsx)(l.Label,{htmlFor:"ci-watch",className:"cursor-pointer text-xs font-medium",children:I("createDrawer.watch")})]})}),(0,b.jsx)(n.TooltipContent,{side:"bottom",children:I("createDrawer.watchDescription")})]}),(0,b.jsx)("div",{className:"bg-border h-4 w-px shrink-0"}),(0,b.jsxs)(n.Tooltip,{children:[(0,b.jsx)(n.TooltipTrigger,{asChild:!0,children:(0,b.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,b.jsx)(z.Switch,{id:"rebase-before-branch",size:"sm",checked:q,onCheckedChange:r,disabled:C}),(0,b.jsxs)(l.Label,{htmlFor:"rebase-before-branch",className:"flex cursor-pointer items-center gap-1 text-xs font-medium",children:[(0,b.jsx)(F.RefreshCw,{className:"h-3 w-3"}),I("createDrawer.sync")]})]})}),(0,b.jsx)(n.TooltipContent,{side:"bottom",children:I("createDrawer.syncDescription")})]}),(0,b.jsxs)(n.Tooltip,{children:[(0,b.jsx)(n.TooltipTrigger,{asChild:!0,children:(0,b.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,b.jsx)(z.Switch,{id:"commit-specs",size:"sm",checked:s,onCheckedChange:t,disabled:C}),(0,b.jsxs)(l.Label,{htmlFor:"commit-specs",className:"flex cursor-pointer items-center gap-1 text-xs font-medium",children:[(0,b.jsx)(E.FileText,{className:"h-3 w-3"}),I("createDrawer.commitSpecs")]})]})}),(0,b.jsx)(n.TooltipContent,{side:"bottom",children:I("createDrawer.commitSpecsDescription")})]}),!w&&(0,b.jsxs)(n.Tooltip,{children:[(0,b.jsx)(n.TooltipTrigger,{asChild:!0,children:(0,b.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,b.jsx)(z.Switch,{id:"fork-and-pr",size:"sm",checked:u,onCheckedChange:a=>{v(a),a&&t(!1)},disabled:C}),(0,b.jsxs)(l.Label,{htmlFor:"fork-and-pr",className:"flex cursor-pointer items-center gap-1 text-xs font-medium",children:[(0,b.jsx)(D.GitFork,{className:"h-3 w-3"}),I("createDrawer.forkAndPr")]})]})}),(0,b.jsx)(n.TooltipContent,{side:"bottom",children:I("createDrawer.forkAndPrDescription")})]})]})]})]})}var I=a.i(14177),J=a.i(10606),K=a.i(90920),L=a.i(53823);function M({features:a,value:d,onChange:e,disabled:f}){let{t:g}=(0,h.useTranslation)("web"),[i,j]=(0,c.useState)(!1),[k,l]=(0,c.useState)(""),m=(0,c.useRef)(null),n=a.find(a=>a.id===d),o=k.trim()?a.filter(a=>a.name.toLowerCase().includes(k.toLowerCase())||a.id.toLowerCase().includes(k.toLowerCase())):a,p=(0,c.useCallback)(a=>{e(a),j(!1),l("")},[e]);return(0,c.useEffect)(()=>{i?setTimeout(()=>m.current?.focus(),0):l("")},[i]),(0,b.jsxs)(L.Popover,{open:i,onOpenChange:j,children:[(0,b.jsx)(L.PopoverTrigger,{asChild:!0,children:(0,b.jsxs)("button",{id:"parent-feature",type:"button",role:"combobox","aria-expanded":i,"aria-label":"Parent Feature",disabled:f,"data-testid":"parent-feature-combobox",className:(0,x.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",!n&&"text-muted-foreground"),children:[(0,b.jsx)("span",{className:"truncate",children:n?`${n.name} (${n.id.slice(0,8)})`:g("createDrawer.selectParent")}),(0,b.jsx)(I.ChevronsUpDown,{className:"ms-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,b.jsx)(L.PopoverContent,{className:"w-80 p-0",align:"start","data-testid":"parent-feature-combobox-content",children:(0,b.jsxs)("div",{className:"flex flex-col",children:[(0,b.jsx)("div",{className:"border-b p-2",children:(0,b.jsx)(K.Input,{ref:m,placeholder:g("createDrawer.searchFeatures"),value:k,onChange:a=>l(a.target.value),className:"h-8 border-0 p-0 text-sm shadow-none focus-visible:ring-0","data-testid":"parent-feature-search"})}),(0,b.jsxs)("div",{className:"max-h-48 overflow-y-auto py-1",role:"listbox","aria-label":"Features",children:[(0,b.jsxs)("button",{type:"button",role:"option","aria-selected":void 0===d,onClick:()=>p(void 0),className:(0,x.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",void 0===d&&"bg-accent/50"),"data-testid":"parent-feature-option-none",children:[(0,b.jsx)(J.CheckIcon,{className:(0,x.cn)("h-4 w-4 shrink-0",void 0!==d&&"invisible")}),(0,b.jsx)("span",{className:"text-muted-foreground italic",children:g("createDrawer.noParent")})]}),0===o.length&&k?(0,b.jsx)("p",{className:"text-muted-foreground px-3 py-2 text-sm",children:g("createDrawer.noFeaturesFound")}):o.map(a=>(0,b.jsxs)("button",{type:"button",role:"option","aria-selected":d===a.id,onClick:()=>p(a.id),className:(0,x.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",d===a.id&&"bg-accent/50"),"data-testid":`parent-feature-option-${a.id}`,children:[(0,b.jsx)(J.CheckIcon,{className:(0,x.cn)("h-4 w-4 shrink-0",d!==a.id&&"invisible")}),(0,b.jsxs)("span",{className:"truncate",children:[a.name," ",(0,b.jsxs)("span",{className:"text-muted-foreground font-mono text-xs",children:["(",a.id.slice(0,8),")"]})]})]},a.id))]})]})})]})}var N=a.i(42527),O=a.i(88064),P=a.i(13126),Q=a.i(21333),R=a.i(51639),S=a.i(1377);a.i(21434);var T=a.i(34379);function U({repositories:a,value:d,onChange:e,onAddRepository:f,disabled:g}){let[i,j]=(0,c.useState)(!1),[k,l]=(0,c.useState)(""),[m,n]=(0,c.useState)(!1),[o,p]=(0,c.useState)(null),[q,r]=(0,c.useState)(!1),s=(0,c.useRef)(null),{reactFileManager:t}=(0,Q.useFeatureFlags)(),{t:u}=(0,h.useTranslation)("web"),v=a.find(a=>a.path===d),w=k.trim()?a.filter(a=>a.name.toLowerCase().includes(k.toLowerCase())||a.path.toLowerCase().includes(k.toLowerCase())):a,y=(0,c.useCallback)(a=>{e(a),j(!1),l("")},[e]),z=(0,c.useCallback)(async a=>{let b=await (0,R.addRepository)({path:a});if(b.error){p(b.error),n(!1);return}if(b.repository){let a={id:b.repository.id,name:b.repository.name,path:b.repository.path};f?.(a),e(a.path),j(!1),l("")}},[f,e]),A=(0,c.useCallback)(async()=>{if(!m){if(t)return void r(!0);n(!0),p(null);try{let a=await (0,S.pickFolder)();if(!a)return void n(!1);await z(a)}catch{r(!0)}finally{n(!1)}}},[m,t,z]),B=(0,c.useCallback)(async a=>{if(r(!1),a){n(!0),p(null);try{await z(a)}catch(a){p(a instanceof Error?a.message:"Failed to add repository")}finally{n(!1)}}},[z]);return(0,c.useEffect)(()=>{i?setTimeout(()=>s.current?.focus(),0):l("")},[i]),(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(L.Popover,{open:i,onOpenChange:j,children:[(0,b.jsx)(L.PopoverTrigger,{asChild:!0,children:(0,b.jsxs)("button",{type:"button",role:"combobox","aria-expanded":i,"aria-label":"Repository","aria-invalid":!!o,"aria-describedby":o?"add-repository-error-msg":void 0,disabled:g,"data-testid":"repository-combobox",className:(0,x.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",!v&&"text-muted-foreground"),children:[(0,b.jsx)("span",{className:"truncate",children:v?v.name:"Select repository..."}),(0,b.jsx)(I.ChevronsUpDown,{className:"ms-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,b.jsx)(L.PopoverContent,{className:"w-80 p-0",align:"start","data-testid":"repository-combobox-content",children:(0,b.jsxs)("div",{className:"flex flex-col",children:[(0,b.jsx)("div",{className:"border-b p-2",children:(0,b.jsx)(K.Input,{ref:s,placeholder:u("createDrawer.searchRepositories"),value:k,onChange:a=>l(a.target.value),className:"h-8 border-0 p-0 text-sm shadow-none focus-visible:ring-0","data-testid":"repository-search"})}),(0,b.jsx)("div",{className:"max-h-48 overflow-y-auto py-1",role:"listbox","aria-label":"Repositories",children:0===w.length?(0,b.jsx)("p",{className:"text-muted-foreground px-3 py-2 text-sm","data-testid":"repository-empty",children:"No repositories found."}):w.map(a=>(0,b.jsxs)("button",{type:"button",role:"option","aria-selected":d===a.path,onClick:()=>y(a.path),className:(0,x.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",d===a.path&&"bg-accent/50"),"data-testid":`repository-option-${a.id}`,children:[(0,b.jsx)(J.CheckIcon,{className:(0,x.cn)("h-4 w-4 shrink-0",d!==a.path&&"invisible")}),(0,b.jsxs)("span",{className:"flex flex-col items-start truncate",children:[(0,b.jsx)("span",{className:"truncate",children:a.name}),(0,b.jsx)("span",{className:"text-muted-foreground truncate text-xs",children:a.path})]})]},a.id))}),(0,b.jsx)(P.Separator,{}),(0,b.jsxs)("button",{type:"button",onClick:A,disabled:m,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:[m?(0,b.jsx)(O.Loader2,{className:"h-4 w-4 shrink-0 animate-spin"}):(0,b.jsx)(N.FolderPlus,{className:"h-4 w-4 shrink-0"}),(0,b.jsx)("span",{children:"Add new repository..."})]}),o?(0,b.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:o}):null]})})]}),(0,b.jsx)(T.ReactFileManagerDialog,{open:q,onOpenChange:a=>{a||r(!1)},onSelect:B})]})}function V({open:a,onClose:d,onSubmit:e,repositoryPath:f,isSubmitting:g=!1,workflowDefaults:u,features:v,repositories:w,initialParentId:x,currentAgentType:y,currentModel:z,initialDescription:A,canPushDirectly:B}){let{t:D}=(0,h.useTranslation)("web"),E=function({open:a,onClose:b,onSubmit:d,repositoryPath:e,workflowDefaults:f,repositories:g,initialParentId:h,currentAgentType:i,currentModel:j,initialDescription:k,canPushDirectly:l}){let m=(0,o.useSoundAction)("create"),n=e&&(!g||0===g.length||g.some(a=>a.path===e))?e:"",u=f?.approvalGates??t,v=f?.push??!1,w=f?.openPr??!1,x=f?.ciWatchEnabled!==!1,y=f?.enableEvidence??!1,z=f?.commitEvidence??!1,A=f?.fast!==!1,[B,C]=(0,c.useState)(k??"");(0,c.useEffect)(()=>{k&&C(k)},[k]);let[D,E]=(0,c.useState)([]),[F,G]=(0,c.useState)({...u}),[H,I]=(0,c.useState)(v),[J,K]=(0,c.useState)(w),[L,M]=(0,c.useState)(f?.ciWatchEnabled!==!1),[N,O]=(0,c.useState)(y),[P,Q]=(0,c.useState)(z),[R,S]=(0,c.useState)(void 0),[T,U]=(0,c.useState)(A),[V,W]=(0,c.useState)(!1),[X,Y]=(0,c.useState)(!1),[Z,$]=(0,c.useState)(!0),[_,aa]=(0,c.useState)(!0),[ab,ac]=(0,c.useState)(void 0),[ad,ae]=(0,c.useState)(void 0),[af,ag]=(0,c.useState)(n||void 0),[ah,ai]=(0,c.useState)(g??[]),[aj,ak]=(0,c.useState)(!1),[al,am]=(0,c.useState)(null),[an,ao]=(0,c.useState)(!1),ap=(0,c.useRef)(crypto.randomUUID()),aq=(0,c.useRef)(0);(0,c.useEffect)(()=>{f&&(G({...f.approvalGates}),I(f.push),K(f.openPr),M(!1!==f.ciWatchEnabled),O(f.enableEvidence),Q(f.commitEvidence),U(!1!==f.fast))},[f]),(0,c.useEffect)(()=>{ai(g??[])},[g]),(0,c.useEffect)(()=>{a&&h&&S(h)},[a,h]);let[ar,as]=(0,c.useState)(l??!1);(0,c.useEffect)(()=>{as(l??!1)},[l]);let at=(0,c.useRef)(af);(0,c.useEffect)(()=>{af&&af!==at.current&&(at.current=af,q(af).then(a=>as(a.canPushDirectly)).catch(()=>as(!1)))},[af]),(0,c.useEffect)(()=>{ar&&(Y(!1),I(v),K(w),$(!0))},[ar,v,w]);let au=(0,c.useCallback)(()=>{C(""),E([]),G({...u}),I(v),K(w),M(x),O(y),Q(z),S(void 0),ag(n||void 0),ai(g??[]),U(A),W(!1),Y(!1),$(!0),aa(!0),ac(void 0),ae(void 0),am(null),aq.current=0,ak(!1)},[u,v,w,y,x,z,A,n,g]),av=""!==B.trim()||D.length>0,{attemptClose:aw}=(0,p.useGuardedDrawerClose)({open:a,isDirty:av,onClose:b,onReset:au}),ax=(0,c.useCallback)(async a=>{for(let b of(am(null),a)){if(b.size>0xa00000)return void am(`"${b.name}" exceeds 10 MB limit`);let a=function(a){let b=a.lastIndexOf(".");return b>=0?a.slice(b).toLowerCase():""}(b.name);if(a&&!s.has(a))return void am(`File type "${a}" is not allowed`)}for(let b of a){let a=crypto.randomUUID();E(c=>[...c,{id:a,name:b.name,size:b.size,mimeType:b.type||"application/octet-stream",path:"",loading:!0}]);try{let c=new FormData;c.append("file",b),c.append("sessionId",ap.current);let d=await fetch("/api/attachments/upload",{method:"POST",body:c});if(!d.ok){let b=await d.json().catch(()=>({error:"Upload failed"}));E(b=>b.filter(b=>b.id!==a)),am(b.error??"Upload failed");return}let e=await d.json();E(b=>b.some(b=>b.id!==a&&b.path===e.path)?b.filter(b=>b.id!==a):b.map(b=>b.id===a?{...e,id:a,loading:!1}:b))}catch{E(b=>b.filter(b=>b.id!==a)),am("Upload failed")}}},[]),ay=(0,c.useCallback)(a=>{a.preventDefault(),a.stopPropagation(),aq.current+=1,1===aq.current&&ak(!0)},[]),az=(0,c.useCallback)(a=>{a.preventDefault(),a.stopPropagation(),aq.current-=1,0===aq.current&&ak(!1)},[]),aA=(0,c.useCallback)(a=>{a.preventDefault(),a.stopPropagation()},[]),aB=(0,c.useCallback)(a=>{a.preventDefault(),a.stopPropagation(),aq.current=0,ak(!1);let b=Array.from(a.dataTransfer.files);b.length>0&&ax(b)},[ax]),aC=(0,c.useCallback)(a=>{let b=a.clipboardData?.items;if(!b)return;let c=[];for(let a of Array.from(b))if("file"===a.kind){let b=a.getAsFile();b&&c.push(b)}c.length>0&&(a.preventDefault(),ax(c))},[ax]),aD=(0,c.useCallback)(a=>{if(a.preventDefault(),!B.trim())return;let b=af??n;b&&(m.play(),d({description:B.trim(),attachments:D.filter(a=>!a.loading),repositoryPath:b,approvalGates:{allowPrd:F.allowPrd??!1,allowPlan:F.allowPlan??!1,allowMerge:F.allowMerge??!1},push:!!X||H||J,openPr:!!X||J,ciWatchEnabled:L,enableEvidence:N,commitEvidence:P,fast:T,forkAndPr:X,commitSpecs:Z,rebaseBeforeBranch:_,...V?{pending:V}:{},...ab?{agentType:ab}:{},...ad?{model:ad}:{},...R?{parentId:R}:{},sessionId:ap.current}),au())},[B,D,F,af,n,d,H,J,N,L,P,T,X,Z,_,V,ab,ad,R,m,au]),aE=(0,c.useCallback)(async()=>{try{let a=await (0,r.pickFiles)();if(!a)return;for(let b of a){let a=crypto.randomUUID();E(c=>[...c,{id:a,name:b.name,size:b.size,mimeType:"application/octet-stream",path:"",loading:!0}]);try{let c=await fetch("/api/attachments/upload-from-path",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:b.path,sessionId:ap.current})});if(!c.ok){let b=await c.json().catch(()=>({error:"Upload failed"}));E(b=>b.filter(b=>b.id!==a)),am(b.error??"Upload failed");return}let d=await c.json();E(b=>b.some(b=>b.id!==a&&b.path===d.path)?b.filter(b=>b.id!==a):b.map(b=>b.id===a?{...d,id:a,loading:!1}:b))}catch{E(b=>b.filter(b=>b.id!==a)),am("Upload failed")}}}catch{}},[]),aF=(0,c.useCallback)(a=>{E(b=>b.filter(b=>b.id!==a))},[]),aG=(0,c.useCallback)((a,b)=>{E(c=>c.map(c=>c.id===a?{...c,notes:b}:c))},[]);return{validRepoPath:n,canPush:ar,isDirty:av,computedPush:!!X||H||J,computedOpenPr:!!X||J,description:B,setDescription:C,attachments:D,approvalGates:F,setApprovalGates:G,push:H,setPush:I,openPr:J,setOpenPr:K,ciWatchEnabled:L,setCiWatchEnabled:M,enableEvidence:N,setEnableEvidence:O,commitEvidence:P,setCommitEvidence:Q,parentId:R,setParentId:S,fast:T,setFast:U,pending:V,setPending:W,forkAndPr:X,setForkAndPr:Y,commitSpecs:Z,setCommitSpecs:$,rebaseBeforeBranch:_,setRebaseBeforeBranch:aa,overrideAgent:ab,setOverrideAgent:ac,overrideModel:ad,setOverrideModel:ae,selectedRepoPath:af,setSelectedRepoPath:ag,localRepos:ah,setLocalRepos:ai,isDragOver:aj,uploadError:al,isPromptFocused:an,setIsPromptFocused:ao,sessionIdRef:ap,currentAgentType:i,currentModel:j,attemptClose:aw,handleFiles:ax,handleDragEnter:ay,handleDragLeave:az,handleDragOver:aA,handleDrop:aB,handlePaste:aC,handleSubmit:aD,handleAddFiles:aE,handleRemoveFile:aF,handleNotesChange:aG,resetForm:au}}({open:a,onClose:d,onSubmit:e,repositoryPath:f,workflowDefaults:u,repositories:w,initialParentId:x,currentAgentType:y,currentModel:z,initialDescription:A,canPushDirectly:B}),F=(0,c.useRef)(null),G=(0,c.useCallback)(a=>{(a.ctrlKey||a.metaKey)&&"Enter"===a.key&&(a.preventDefault(),F.current?.requestSubmit())},[]),I=v&&v.length>0,J=!E.validRepoPath&&void 0!==w,K=!E.validRepoPath&&!E.selectedRepoPath;return(0,b.jsx)(i.BaseDrawer,{open:a,onClose:E.attemptClose,size:"md",modal:!1,dismissOnOutsideClick:!0,"data-testid":"feature-create-drawer",header:(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("div",{className:"h-2.5 w-2.5 shrink-0 rounded-full bg-blue-500"}),(0,b.jsx)(j.DrawerTitle,{children:D("createDrawer.title")})]}),g?(0,b.jsx)(j.DrawerDescription,{asChild:!0,children:(0,b.jsx)("div",{children:(0,b.jsx)(m.Badge,{variant:"secondary",children:D("createDrawer.creating")})})}):null]}),footer:(0,b.jsxs)("div",{className:"flex flex-row justify-end gap-2",children:[(0,b.jsx)(k.Button,{variant:"outline",onClick:E.attemptClose,disabled:g,children:D("createDrawer.cancel")}),(0,b.jsx)(k.Button,{type:"submit",form:"create-feature-form",disabled:!E.description.trim()||g||K,children:D(g?"createDrawer.creating":"createDrawer.createFeature")})]}),children:(0,b.jsx)("div",{className:"overflow-y-auto p-4",children:(0,b.jsx)(n.TooltipProvider,{delayDuration:400,children:(0,b.jsxs)("form",{ref:F,id:"create-feature-form",onSubmit:E.handleSubmit,onKeyDown:G,className:"flex flex-col gap-4",children:[J?(0,b.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"repo-selector-section",children:[(0,b.jsx)(l.Label,{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:D("createDrawer.repository")}),(0,b.jsx)(U,{repositories:E.localRepos,value:E.selectedRepoPath,onChange:E.setSelectedRepoPath,onAddRepository:a=>{E.setLocalRepos(b=>[...b,a]),E.setSelectedRepoPath(a.path)},disabled:g})]}):E.validRepoPath?(0,b.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"repo-readonly-section",children:[(0,b.jsx)(l.Label,{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:D("createDrawer.repository")}),(0,b.jsx)("p",{className:"text-sm","data-testid":"repo-readonly-label",children:w?.find(a=>a.path===E.validRepoPath)?.name??E.validRepoPath.split("/").pop()})]}):null,(0,b.jsx)(C,{description:E.description,onDescriptionChange:E.setDescription,attachments:E.attachments,onRemoveFile:E.handleRemoveFile,onNotesChange:E.handleNotesChange,onPaste:E.handlePaste,onDragEnter:E.handleDragEnter,onDragLeave:E.handleDragLeave,onDragOver:E.handleDragOver,onDrop:E.handleDrop,onAddFiles:E.handleAddFiles,isDragOver:E.isDragOver,uploadError:E.uploadError,isPromptFocused:E.isPromptFocused,onPromptFocus:()=>E.setIsPromptFocused(!0),onPromptBlur:()=>E.setIsPromptFocused(!1),fast:E.fast,onFastChange:E.setFast,pending:E.pending,onPendingChange:E.setPending,overrideAgent:E.overrideAgent,overrideModel:E.overrideModel,currentAgentType:y,currentModel:z,onAgentModelChange:(a,b)=>{E.setOverrideAgent(a),E.setOverrideModel(b)},isSubmitting:g}),I&&void 0!==x?(0,b.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,b.jsx)(l.Label,{htmlFor:"parent-feature",className:"text-muted-foreground text-xs font-semibold tracking-wider",children:D("createDrawer.parentFeature")}),(0,b.jsx)(M,{features:v,value:E.parentId,onChange:E.setParentId,disabled:g})]}):null,(0,b.jsx)(H,{approvalGates:E.approvalGates,onApprovalGatesChange:E.setApprovalGates,enableEvidence:E.enableEvidence,onEnableEvidenceChange:E.setEnableEvidence,commitEvidence:E.commitEvidence,onCommitEvidenceChange:E.setCommitEvidence,push:E.push,onPushChange:E.setPush,openPr:E.openPr,onOpenPrChange:E.setOpenPr,ciWatchEnabled:E.ciWatchEnabled,onCiWatchChange:E.setCiWatchEnabled,rebaseBeforeBranch:E.rebaseBeforeBranch,onRebaseBeforeBranchChange:E.setRebaseBeforeBranch,commitSpecs:E.commitSpecs,onCommitSpecsChange:E.setCommitSpecs,forkAndPr:E.forkAndPr,onForkAndPrChange:E.setForkAndPr,canPush:E.canPush,fast:E.fast,computedPush:E.computedPush,computedOpenPr:E.computedOpenPr,isSubmitting:g})]})})})})}a.s(["CreateDrawerClient",0,function({repositoryPath:a,initialParentId:f,initialDescription:h,features:i,repositories:j,workflowDefaults:k,currentAgentType:l,currentModel:m,canPushDirectly:n}){let o=(0,d.useRouter)(),[p,q]=(0,c.useState)(!1),r=(0,d.usePathname)().startsWith("/create"),s=!p&&r;(0,c.useEffect)(()=>{!r&&p&&q(!1)},[r,p]);let t=(0,c.useCallback)(()=>{o.push("/")},[o]),u=(0,c.useCallback)(a=>{q(!0),o.push("/"),g(a).then(b=>{b.error?e.toast.error(b.error):window.dispatchEvent(new CustomEvent("shipit-ai:feature-created",{detail:{featureId:b.feature.id,name:b.feature.name,description:b.feature.description,repositoryPath:b.feature.repositoryPath,parentId:a.parentId}}))}).catch(()=>{e.toast.error("Failed to create feature"),q(!1)})},[o]);return(0,b.jsx)(V,{open:s,onClose:t,onSubmit:u,repositoryPath:a,features:i,repositories:j,workflowDefaults:k,initialParentId:f,initialDescription:h,isSubmitting:p,currentAgentType:l,currentModel:m,canPushDirectly:n})}],93995)}];
2
2
 
3
3
  //# sourceMappingURL=0j.8_web_components_common_control-center-drawer_create-drawer-client_tsx_0g70fc5._.js.map