@shepai/cli 1.150.1 → 1.150.2-pr467.6c2662f

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 (175) hide show
  1. package/dist/packages/core/src/application/ports/output/services/github-repository-service.interface.d.ts +17 -0
  2. package/dist/packages/core/src/application/ports/output/services/github-repository-service.interface.d.ts.map +1 -1
  3. package/dist/packages/core/src/application/ports/output/services/github-repository-service.interface.js +12 -0
  4. package/dist/packages/core/src/infrastructure/services/external/github-repository.service.d.ts +1 -0
  5. package/dist/packages/core/src/infrastructure/services/external/github-repository.service.d.ts.map +1 -1
  6. package/dist/packages/core/src/infrastructure/services/external/github-repository.service.js +18 -1
  7. package/dist/src/presentation/web/app/(dashboard)/@drawer/create/page.d.ts.map +1 -1
  8. package/dist/src/presentation/web/app/(dashboard)/@drawer/create/page.js +6 -2
  9. package/dist/src/presentation/web/app/actions/get-merge-review-data.d.ts.map +1 -1
  10. package/dist/src/presentation/web/app/actions/get-merge-review-data.js +10 -1
  11. package/dist/src/presentation/web/app/actions/get-viewer-permission.d.ts +4 -0
  12. package/dist/src/presentation/web/app/actions/get-viewer-permission.d.ts.map +1 -0
  13. package/dist/src/presentation/web/app/actions/get-viewer-permission.js +14 -0
  14. package/dist/src/presentation/web/components/common/control-center-drawer/create-drawer-client.d.ts +2 -1
  15. package/dist/src/presentation/web/components/common/control-center-drawer/create-drawer-client.d.ts.map +1 -1
  16. package/dist/src/presentation/web/components/common/control-center-drawer/create-drawer-client.js +2 -2
  17. package/dist/src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.d.ts +3 -1
  18. package/dist/src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.d.ts.map +1 -1
  19. package/dist/src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.js +29 -3
  20. package/dist/src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.stories.d.ts +10 -0
  21. package/dist/src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.stories.d.ts.map +1 -1
  22. package/dist/src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.stories.js +37 -3
  23. package/dist/tsconfig.build.tsbuildinfo +1 -1
  24. package/package.json +1 -1
  25. package/web/.next/BUILD_ID +1 -1
  26. package/web/.next/build-manifest.json +2 -2
  27. package/web/.next/fallback-build-manifest.json +2 -2
  28. package/web/.next/prerender-manifest.json +3 -3
  29. package/web/.next/required-server-files.js +3 -3
  30. package/web/.next/required-server-files.json +3 -3
  31. package/web/.next/server/app/(dashboard)/@drawer/adopt/page/server-reference-manifest.json +28 -28
  32. package/web/.next/server/app/(dashboard)/@drawer/adopt/page.js +1 -1
  33. package/web/.next/server/app/(dashboard)/@drawer/adopt/page.js.nft.json +1 -1
  34. package/web/.next/server/app/(dashboard)/@drawer/adopt/page_client-reference-manifest.js +1 -1
  35. package/web/.next/server/app/(dashboard)/@drawer/create/page/server-reference-manifest.json +71 -56
  36. package/web/.next/server/app/(dashboard)/@drawer/create/page.js +1 -1
  37. package/web/.next/server/app/(dashboard)/@drawer/create/page.js.nft.json +1 -1
  38. package/web/.next/server/app/(dashboard)/@drawer/create/page_client-reference-manifest.js +1 -1
  39. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/server-reference-manifest.json +36 -36
  40. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  41. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  42. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/server-reference-manifest.json +36 -36
  43. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js.nft.json +1 -1
  44. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page_client-reference-manifest.js +1 -1
  45. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/server-reference-manifest.json +26 -26
  46. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js.nft.json +1 -1
  47. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  48. package/web/.next/server/app/(dashboard)/create/page/server-reference-manifest.json +71 -56
  49. package/web/.next/server/app/(dashboard)/create/page.js +1 -1
  50. package/web/.next/server/app/(dashboard)/create/page.js.nft.json +1 -1
  51. package/web/.next/server/app/(dashboard)/create/page_client-reference-manifest.js +1 -1
  52. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/server-reference-manifest.json +36 -36
  53. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  54. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  55. package/web/.next/server/app/(dashboard)/feature/[featureId]/page/server-reference-manifest.json +36 -36
  56. package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js.nft.json +1 -1
  57. package/web/.next/server/app/(dashboard)/feature/[featureId]/page_client-reference-manifest.js +1 -1
  58. package/web/.next/server/app/(dashboard)/page/server-reference-manifest.json +26 -26
  59. package/web/.next/server/app/(dashboard)/page.js.nft.json +1 -1
  60. package/web/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
  61. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/server-reference-manifest.json +26 -26
  62. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js.nft.json +1 -1
  63. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  64. package/web/.next/server/app/_global-error.html +2 -2
  65. package/web/.next/server/app/_global-error.rsc +1 -1
  66. package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  67. package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  68. package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  69. package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  70. package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  71. package/web/.next/server/app/_not-found/page/server-reference-manifest.json +3 -3
  72. package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  73. package/web/.next/server/app/api/attachments/preview/route.js.nft.json +1 -1
  74. package/web/.next/server/app/api/evidence/route.js.nft.json +1 -1
  75. package/web/.next/server/app/api/graph-data/route.js.nft.json +1 -1
  76. package/web/.next/server/app/settings/page/server-reference-manifest.json +8 -8
  77. package/web/.next/server/app/settings/page.js.nft.json +1 -1
  78. package/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  79. package/web/.next/server/app/skills/page/server-reference-manifest.json +8 -8
  80. package/web/.next/server/app/skills/page.js.nft.json +1 -1
  81. package/web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  82. package/web/.next/server/app/tools/page/server-reference-manifest.json +8 -8
  83. package/web/.next/server/app/tools/page.js.nft.json +1 -1
  84. package/web/.next/server/app/tools/page_client-reference-manifest.js +1 -1
  85. package/web/.next/server/app/version/page/server-reference-manifest.json +3 -3
  86. package/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
  87. package/web/.next/server/chunks/[root-of-the-server]__a402b567._.js +1 -1
  88. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js +1 -1
  89. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js.map +1 -1
  90. package/web/.next/server/chunks/ssr/[root-of-the-server]__2138fa7e._.js +2 -2
  91. package/web/.next/server/chunks/ssr/[root-of-the-server]__2138fa7e._.js.map +1 -1
  92. package/web/.next/server/chunks/ssr/[root-of-the-server]__29580090._.js +1 -1
  93. package/web/.next/server/chunks/ssr/[root-of-the-server]__29580090._.js.map +1 -1
  94. package/web/.next/server/chunks/ssr/[root-of-the-server]__357d99f9._.js +1 -1
  95. package/web/.next/server/chunks/ssr/[root-of-the-server]__3ef34e4c._.js +1 -1
  96. package/web/.next/server/chunks/ssr/[root-of-the-server]__3ef34e4c._.js.map +1 -1
  97. package/web/.next/server/chunks/ssr/[root-of-the-server]__43f51aa6._.js +1 -1
  98. package/web/.next/server/chunks/ssr/[root-of-the-server]__43f51aa6._.js.map +1 -1
  99. package/web/.next/server/chunks/ssr/[root-of-the-server]__815546bd._.js +1 -1
  100. package/web/.next/server/chunks/ssr/[root-of-the-server]__815546bd._.js.map +1 -1
  101. package/web/.next/server/chunks/ssr/[root-of-the-server]__aad040c0._.js +2 -2
  102. package/web/.next/server/chunks/ssr/[root-of-the-server]__aad040c0._.js.map +1 -1
  103. package/web/.next/server/chunks/ssr/[root-of-the-server]__c094882b._.js +1 -1
  104. package/web/.next/server/chunks/ssr/[root-of-the-server]__c094882b._.js.map +1 -1
  105. package/web/.next/server/chunks/ssr/[root-of-the-server]__c9777776._.js +1 -1
  106. package/web/.next/server/chunks/ssr/[root-of-the-server]__c9777776._.js.map +1 -1
  107. package/web/.next/server/chunks/ssr/[root-of-the-server]__d48c5b11._.js +1 -1
  108. package/web/.next/server/chunks/ssr/[root-of-the-server]__d48c5b11._.js.map +1 -1
  109. package/web/.next/server/chunks/ssr/[root-of-the-server]__dac5dbf1._.js +1 -1
  110. package/web/.next/server/chunks/ssr/[root-of-the-server]__dac5dbf1._.js.map +1 -1
  111. package/web/.next/server/chunks/ssr/[root-of-the-server]__fae8b355._.js +1 -1
  112. package/web/.next/server/chunks/ssr/[root-of-the-server]__fae8b355._.js.map +1 -1
  113. package/web/.next/server/chunks/ssr/{_e6f4ec90._.js → _0234897c._.js} +2 -2
  114. package/web/.next/server/chunks/ssr/{_e6f4ec90._.js.map → _0234897c._.js.map} +1 -1
  115. package/web/.next/server/chunks/ssr/_05c23ad9._.js +1 -1
  116. package/web/.next/server/chunks/ssr/_05c23ad9._.js.map +1 -1
  117. package/web/.next/server/chunks/ssr/{_0c5f56e3._.js → _0c473fef._.js} +3 -3
  118. package/web/.next/server/chunks/ssr/_0c473fef._.js.map +1 -0
  119. package/web/.next/server/chunks/ssr/_16eb4fec._.js +1 -1
  120. package/web/.next/server/chunks/ssr/_16eb4fec._.js.map +1 -1
  121. package/web/.next/server/chunks/ssr/_1b719e7f._.js +1 -1
  122. package/web/.next/server/chunks/ssr/_1b719e7f._.js.map +1 -1
  123. package/web/.next/server/chunks/ssr/{_0d43f72b._.js → _367598ce._.js} +2 -2
  124. package/web/.next/server/chunks/ssr/{_0d43f72b._.js.map → _367598ce._.js.map} +1 -1
  125. package/web/.next/server/chunks/ssr/_37e8548b._.js +1 -1
  126. package/web/.next/server/chunks/ssr/_37e8548b._.js.map +1 -1
  127. package/web/.next/server/chunks/ssr/_55d763e2._.js +1 -1
  128. package/web/.next/server/chunks/ssr/_55d763e2._.js.map +1 -1
  129. package/web/.next/server/chunks/ssr/_6256a985._.js +1 -1
  130. package/web/.next/server/chunks/ssr/_6256a985._.js.map +1 -1
  131. package/web/.next/server/chunks/ssr/_8fcc39d4._.js +1 -1
  132. package/web/.next/server/chunks/ssr/_8fcc39d4._.js.map +1 -1
  133. package/web/.next/server/chunks/ssr/_b71645b4._.js +1 -1
  134. package/web/.next/server/chunks/ssr/_b71645b4._.js.map +1 -1
  135. package/web/.next/server/chunks/ssr/_d8575088._.js +1 -1
  136. package/web/.next/server/chunks/ssr/_d8575088._.js.map +1 -1
  137. package/web/.next/server/chunks/ssr/{_64bdfc6f._.js → _e9e9ed20._.js} +3 -3
  138. package/web/.next/server/chunks/ssr/_e9e9ed20._.js.map +1 -0
  139. package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js +1 -1
  140. package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js.map +1 -1
  141. package/web/.next/server/chunks/ssr/src_presentation_web_18bac1de._.js +3 -0
  142. package/web/.next/server/chunks/ssr/{src_presentation_web_edb9a758._.js.map → src_presentation_web_18bac1de._.js.map} +1 -1
  143. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1b176e3c.js +1 -1
  144. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1b176e3c.js.map +1 -1
  145. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_bd9f0dda.js +1 -1
  146. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_bd9f0dda.js.map +1 -1
  147. package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_open-ide_ts_baaca5d5._.js +1 -1
  148. package/web/.next/server/chunks/ssr/src_presentation_web_components_e599bb8c._.js +1 -1
  149. package/web/.next/server/chunks/ssr/src_presentation_web_components_e599bb8c._.js.map +1 -1
  150. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js +1 -1
  151. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js.map +1 -1
  152. package/web/.next/server/pages/500.html +2 -2
  153. package/web/.next/server/server-reference-manifest.js +1 -1
  154. package/web/.next/server/server-reference-manifest.json +122 -100
  155. package/web/.next/static/chunks/0b27ddded4e18a6f.js +1 -0
  156. package/web/.next/static/chunks/229de67931d63e89.js +5 -0
  157. package/web/.next/static/chunks/{b0e2a4995f8cb125.js → 230700832a8f1968.js} +1 -1
  158. package/web/.next/static/chunks/{3eb70de6fd8230d1.js → 3a0f7dfe1a106fd8.js} +1 -1
  159. package/web/.next/static/chunks/{2fb8c2e502e09420.js → 3f53fc84b7c2d4e8.js} +1 -1
  160. package/web/.next/static/chunks/{9493276589211dde.js → 404d17c7fcc88815.js} +2 -2
  161. package/web/.next/static/chunks/{af5f5590d479d23b.js → 4c85a0b215e4fd08.js} +1 -1
  162. package/web/.next/static/chunks/{e3e34a3ecc0dda04.js → 5f635593e0f295b7.js} +1 -1
  163. package/web/.next/static/chunks/{20c158b8a29d2567.js → 720c7276e72e0849.js} +1 -1
  164. package/web/.next/static/chunks/997d11773e793e62.js +1 -0
  165. package/web/.next/static/chunks/{9e0540b3bb6d8e94.js → ec55158ab986498b.js} +1 -1
  166. package/web/.next/static/chunks/{3a92705d60c43efd.js → ec7a966968b528e8.js} +1 -1
  167. package/web/.next/server/chunks/ssr/_0c5f56e3._.js.map +0 -1
  168. package/web/.next/server/chunks/ssr/_64bdfc6f._.js.map +0 -1
  169. package/web/.next/server/chunks/ssr/src_presentation_web_edb9a758._.js +0 -3
  170. package/web/.next/static/chunks/65a81bc1667bd5e5.js +0 -1
  171. package/web/.next/static/chunks/ceaacf9d11979fc4.js +0 -5
  172. package/web/.next/static/chunks/f711ef106ef5e8d3.js +0 -1
  173. /package/web/.next/static/{89D8MDDa2_39rRqMnpKG7 → erhyZYhBrIbNM1gQULjZF}/_buildManifest.js +0 -0
  174. /package/web/.next/static/{89D8MDDa2_39rRqMnpKG7 → erhyZYhBrIbNM1gQULjZF}/_clientMiddlewareManifest.json +0 -0
  175. /package/web/.next/static/{89D8MDDa2_39rRqMnpKG7 → erhyZYhBrIbNM1gQULjZF}/_ssgManifest.js +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../../node_modules/.pnpm/next%4016.1.6_%40babel%2Bcore%407.29.0_%40playwright%2Btest%401.58.1_react-dom%4019.2.4_react%4019.2.4__react%4019.2.4/node_modules/next/src/build/webpack/loaders/next-flight-loader/server-reference.ts","../../../../../../../node_modules/.pnpm/next%4016.1.6_%40babel%2Bcore%407.29.0_%40playwright%2Btest%401.58.1_react-dom%4019.2.4_react%4019.2.4__react%4019.2.4/node_modules/next/src/build/webpack/loaders/next-flight-loader/action-validate.ts","../../../../../../../packages/core/src/infrastructure/services/folder-dialog.service.ts","../../../../../../../src/presentation/web/app/actions/pick-folder.ts","../../../../../../../src/presentation/web/app/actions/list-github-repositories.ts","../../../../../../../packages/core/src/application/ports/output/services/github-repository-service.interface.ts","../../../../../../../src/presentation/web/app/actions/import-github-repository.ts","../../../../../../../src/presentation/web/app/actions/deploy-feature.ts","../../../../../../../packages/core/src/infrastructure/services/deployment/deployment-logger.ts","../../../../../../../src/presentation/web/lib/is-same-shep-instance.ts","../../../../../../../src/presentation/web/app/actions/deploy-repository.ts","../../../../../../../src/presentation/web/app/actions/stop-deployment.ts","../../../../../../../src/presentation/web/app/actions/get-deployment-status.ts","../../../../../../../src/presentation/web/app/actions/get-deployment-logs.ts","../../../../../../../src/presentation/web/app/actions/get-all-agent-models.ts","../../../../../../../src/presentation/web/lib/model-metadata.ts","../../../../../../../src/presentation/web/app/actions/update-agent-and-model.ts","../../../../../../../src/presentation/web/app/actions/get-workflow-defaults.ts","../../../../../../../src/presentation/web/app/actions/create-feature.ts","../../../../../../../src/presentation/web/app/actions/compose-user-input.ts","../../../../../../../src/presentation/web/.next-internal/server/app/%28dashboard%29/%40drawer/create/page/actions.js%20%28server%20actions%20loader%29"],"sourcesContent":["/* eslint-disable import/no-extraneous-dependencies */\nexport { registerServerReference } from 'react-server-dom-webpack/server'\n","// This function ensures that all the exported values are valid server actions,\n// during the runtime. By definition all actions are required to be async\n// functions, but here we can only check that they are functions.\nexport function ensureServerEntryExports(actions: any[]) {\n for (let i = 0; i < actions.length; i++) {\n const action = actions[i]\n if (typeof action !== 'function') {\n throw new Error(\n `A \"use server\" file can only export async functions, found ${typeof action}.\\nRead more: https://nextjs.org/docs/messages/invalid-use-server-value`\n )\n }\n }\n}\n","import { execSync } from 'node:child_process';\n\nexport interface FolderDialogDeps {\n platform: NodeJS.Platform;\n exec: (cmd: string, opts?: { encoding: BufferEncoding; timeout?: number }) => string;\n}\n\nconst defaultDeps: FolderDialogDeps = {\n platform: process.platform,\n exec: (cmd, opts) => execSync(cmd, opts) as unknown as string,\n};\n\n/**\n * Platform-specific commands that open a native OS folder picker dialog.\n * Each returns the chosen absolute folder path on stdout, or exits non-zero / returns empty on cancel.\n */\nconst PLATFORM_COMMANDS: Record<string, string> = {\n darwin: `osascript -e 'POSIX path of (choose folder with prompt \"Select a repository folder\")'`,\n linux: `zenity --file-selection --directory --title=\"Select a repository folder\" 2>/dev/null`,\n win32: `powershell -NoProfile -Command \"Add-Type -AssemblyName System.Windows.Forms; $f = New-Object System.Windows.Forms.FolderBrowserDialog; $f.Description = 'Select a repository folder'; if ($f.ShowDialog() -eq 'OK') { $f.SelectedPath } else { exit 1 }\"`,\n};\n\nexport class FolderDialogService {\n private deps: FolderDialogDeps;\n\n constructor(deps: Partial<FolderDialogDeps> = {}) {\n this.deps = { ...defaultDeps, ...deps };\n }\n\n /** Returns the OS-specific command string, or null if the platform is unsupported. */\n getCommand(): string | null {\n return PLATFORM_COMMANDS[this.deps.platform] ?? null;\n }\n\n /**\n * Opens a native folder picker dialog and returns the selected absolute path.\n * Returns `null` if the user cancels the dialog.\n * Throws if the platform is unsupported or the command fails unexpectedly.\n */\n pickFolder(): string | null {\n const command = this.getCommand();\n if (!command) {\n throw new Error(`Unsupported platform: ${this.deps.platform}`);\n }\n\n try {\n const result = this.deps.exec(command, { encoding: 'utf-8', timeout: 60_000 });\n const trimmed = result.trim();\n return trimmed.length > 0 ? trimmed : null;\n } catch (error: unknown) {\n // User cancelled the dialog — exit code 1 from osascript/zenity/powershell\n if (isExecError(error) && error.status === 1) {\n return null;\n }\n throw error;\n }\n }\n}\n\nfunction isExecError(error: unknown): error is { status: number } {\n return typeof error === 'object' && error !== null && 'status' in error;\n}\n","'use server';\n\nimport { FolderDialogService } from '@shepai/core/infrastructure/services/folder-dialog.service';\n\nexport async function pickFolder(): Promise<{ path: string | null; error?: string }> {\n const service = new FolderDialogService();\n\n try {\n const path = service.pickFolder();\n return { path };\n } catch (error: unknown) {\n const message = error instanceof Error ? error.message : 'Failed to open folder dialog';\n return { path: null, error: message };\n }\n}\n","'use server';\n\nimport { resolve } from '@/lib/server-container';\nimport type { ListGitHubRepositoriesUseCase } from '@shepai/core/application/use-cases/repositories/list-github-repositories.use-case';\nimport type { GitHubRepo } from '@shepai/core/application/ports/output/services/github-repository-service.interface';\nimport { GitHubAuthError } from '@shepai/core/application/ports/output/services/github-repository-service.interface';\n\ninterface ListGitHubRepositoriesInput {\n search?: string;\n limit?: number;\n}\n\nexport async function listGitHubRepositories(\n input?: ListGitHubRepositoriesInput\n): Promise<{ repos?: GitHubRepo[]; error?: string }> {\n try {\n const useCase = resolve<ListGitHubRepositoriesUseCase>('ListGitHubRepositoriesUseCase');\n const repos = await useCase.execute(input);\n return { repos };\n } catch (error: unknown) {\n if (error instanceof GitHubAuthError) {\n return { error: 'GitHub CLI is not authenticated. Run `gh auth login` to sign in.' };\n }\n const message = error instanceof Error ? error.message : 'Failed to list repositories';\n return { error: message };\n }\n}\n","/**\n * GitHub Repository Service Interface\n *\n * Output port for GitHub repository operations via the gh CLI.\n * Implementations manage authentication checks, repository cloning,\n * user repository listing, and GitHub URL parsing.\n */\n\n// ---------------------------------------------------------------------------\n// Error classes\n// ---------------------------------------------------------------------------\n\n/**\n * Thrown when the GitHub CLI is not authenticated.\n */\nexport class GitHubAuthError extends Error {\n constructor(message: string, cause?: Error) {\n super(message);\n this.name = 'GitHubAuthError';\n Object.setPrototypeOf(this, new.target.prototype);\n if (cause) this.cause = cause;\n }\n}\n\n/**\n * Thrown when a `gh repo clone` operation fails.\n */\nexport class GitHubCloneError extends Error {\n constructor(message: string, cause?: Error) {\n super(message);\n this.name = 'GitHubCloneError';\n Object.setPrototypeOf(this, new.target.prototype);\n if (cause) this.cause = cause;\n }\n}\n\n/**\n * Thrown when a GitHub URL cannot be parsed into owner/repo.\n */\nexport class GitHubUrlParseError extends Error {\n constructor(message: string, cause?: Error) {\n super(message);\n this.name = 'GitHubUrlParseError';\n Object.setPrototypeOf(this, new.target.prototype);\n if (cause) this.cause = cause;\n }\n}\n\n/**\n * Thrown when listing the user's GitHub repositories fails.\n */\nexport class GitHubRepoListError extends Error {\n constructor(message: string, cause?: Error) {\n super(message);\n this.name = 'GitHubRepoListError';\n Object.setPrototypeOf(this, new.target.prototype);\n if (cause) this.cause = cause;\n }\n}\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\n/**\n * A GitHub repository as returned by `gh repo list --json`.\n */\nexport interface GitHubRepo {\n /** Repository name (e.g. \"my-project\") */\n name: string;\n /** Full owner/repo identifier (e.g. \"octocat/my-project\") */\n nameWithOwner: string;\n /** Repository description (may be empty string) */\n description: string;\n /** Whether the repository is private */\n isPrivate: boolean;\n /** ISO 8601 timestamp of the most recent push */\n pushedAt: string;\n}\n\n/**\n * Options for listing user repositories.\n */\nexport interface ListUserRepositoriesOptions {\n /** Maximum number of repos to return (default: 30) */\n limit?: number;\n /** Filter repos by name substring */\n search?: string;\n}\n\n/**\n * Options for cloning a repository.\n */\nexport interface CloneOptions {\n /** Callback invoked with stderr chunks during clone for progress display */\n onProgress?: (data: string) => void;\n}\n\n/**\n * Result of parsing a GitHub URL.\n */\nexport interface ParsedGitHubUrl {\n /** Repository owner (e.g. \"octocat\") */\n owner: string;\n /** Repository name (e.g. \"my-project\") */\n repo: string;\n /** Combined owner/repo (e.g. \"octocat/my-project\") */\n nameWithOwner: string;\n}\n\n// ---------------------------------------------------------------------------\n// Service interface\n// ---------------------------------------------------------------------------\n\n/**\n * Output port for GitHub repository operations.\n *\n * Implementations use the `gh` CLI for all GitHub interactions.\n */\nexport interface IGitHubRepositoryService {\n /**\n * Verify that the GitHub CLI is authenticated.\n *\n * @throws {GitHubAuthError} if `gh auth status` indicates the user is not logged in\n */\n checkAuth(): Promise<void>;\n\n /**\n * Clone a GitHub repository to a local destination directory.\n *\n * @param nameWithOwner - Full owner/repo identifier (e.g. \"octocat/my-project\")\n * @param destination - Absolute path to clone into\n * @param options - Optional clone configuration (e.g. progress callback)\n * @throws {GitHubCloneError} if the clone subprocess fails\n */\n cloneRepository(\n nameWithOwner: string,\n destination: string,\n options?: CloneOptions\n ): Promise<void>;\n\n /**\n * List the authenticated user's GitHub repositories.\n *\n * @param options - Optional filtering and pagination\n * @returns Array of GitHub repositories sorted by most recently pushed\n * @throws {GitHubRepoListError} if the list operation fails\n */\n listUserRepositories(options?: ListUserRepositoriesOptions): Promise<GitHubRepo[]>;\n\n /**\n * Parse a GitHub URL or shorthand into its owner/repo components.\n *\n * Supported formats:\n * - `https://github.com/owner/repo`\n * - `https://github.com/owner/repo.git`\n * - `git@github.com:owner/repo.git`\n * - `owner/repo` (shorthand)\n *\n * @param url - The GitHub URL or shorthand to parse\n * @returns Parsed owner, repo, and nameWithOwner\n * @throws {GitHubUrlParseError} if the URL does not match any supported format\n */\n parseGitHubUrl(url: string): ParsedGitHubUrl;\n}\n","'use server';\n\nimport { resolve } from '@/lib/server-container';\nimport type { ImportGitHubRepositoryUseCase } from '@shepai/core/application/use-cases/repositories/import-github-repository.use-case';\nimport type { Repository } from '@shepai/core/domain/generated/output';\nimport {\n GitHubAuthError,\n GitHubUrlParseError,\n GitHubCloneError,\n} from '@shepai/core/application/ports/output/services/github-repository-service.interface';\n\ninterface ImportGitHubRepositoryInput {\n url: string;\n dest?: string;\n}\n\nexport async function importGitHubRepository(\n input: ImportGitHubRepositoryInput\n): Promise<{ repository?: Repository; error?: string }> {\n const { url, dest } = input;\n\n if (!url?.trim()) {\n return { error: 'GitHub URL is required' };\n }\n\n try {\n const useCase = resolve<ImportGitHubRepositoryUseCase>('ImportGitHubRepositoryUseCase');\n const repository = await useCase.execute({ url, dest });\n return { repository };\n } catch (error: unknown) {\n if (error instanceof GitHubAuthError) {\n return { error: 'GitHub CLI is not authenticated. Run `gh auth login` to sign in.' };\n }\n if (error instanceof GitHubUrlParseError) {\n return { error: `Invalid GitHub URL: ${error.message}` };\n }\n if (error instanceof GitHubCloneError) {\n return { error: `Clone failed: ${error.message}` };\n }\n const message = error instanceof Error ? error.message : 'Failed to import repository';\n return { error: message };\n }\n}\n","'use server';\n\nimport { existsSync } from 'node:fs';\nimport { resolve } from '@/lib/server-container';\nimport { createDeploymentLogger } from '@shepai/core/infrastructure/services/deployment/deployment-logger';\nimport { computeWorktreePath } from '@shepai/core/infrastructure/services/ide-launchers/compute-worktree-path';\nimport type { IFeatureRepository } from '@shepai/core/application/ports/output/repositories/feature-repository.interface';\nimport type { IDeploymentService } from '@shepai/core/application/ports/output/services/deployment-service.interface';\nimport { DeploymentState } from '@shepai/core/domain/generated/output';\nimport { isSameShepInstance } from '@/lib/is-same-shep-instance';\n\nconst log = createDeploymentLogger('[deployFeature]');\n\nexport async function deployFeature(\n featureId: string\n): Promise<{ success: boolean; error?: string; state?: DeploymentState }> {\n log.info(`called — featureId=\"${featureId}\"`);\n\n if (!featureId?.trim()) {\n log.warn('rejected — featureId is empty');\n return { success: false, error: 'featureId is required' };\n }\n\n try {\n const featureRepo = resolve<IFeatureRepository>('IFeatureRepository');\n const feature = await featureRepo.findById(featureId);\n\n if (!feature) {\n log.warn(`feature not found in repository: \"${featureId}\"`);\n return { success: false, error: `Feature not found: ${featureId}` };\n }\n\n log.info(\n `feature found — repositoryPath=\"${feature.repositoryPath}\", branch=\"${feature.branch}\"`\n );\n\n const worktreePath = computeWorktreePath(feature.repositoryPath, feature.branch);\n log.info(`computed worktreePath=\"${worktreePath}\"`);\n\n if (!existsSync(worktreePath)) {\n log.warn(`worktree path does not exist on disk: \"${worktreePath}\"`);\n return { success: false, error: `Worktree path does not exist: ${worktreePath}` };\n }\n\n if (isSameShepInstance(feature.repositoryPath)) {\n log.warn('rejected — feature belongs to the running shep instance');\n return {\n success: false,\n error: 'Cannot start a dev server for features of the repository Shep is running from',\n };\n }\n\n log.info('worktree path exists, calling deploymentService.start()');\n const deploymentService = resolve<IDeploymentService>('IDeploymentService');\n deploymentService.start(featureId, worktreePath, 'feature');\n\n log.info('start() returned successfully — state=Booting');\n return { success: true, state: DeploymentState.Booting };\n } catch (error: unknown) {\n const message = error instanceof Error ? error.message : 'Failed to deploy feature';\n log.error(`error: ${message}`, error);\n return { success: false, error: message };\n }\n}\n","/* eslint-disable no-console */\n\n/**\n * Debug-gated logger for deployment services.\n *\n * - `info` and `debug` only emit when `process.env.DEBUG` is set.\n * - `warn` and `error` always emit (they indicate real problems).\n */\n\nconst noop = () => undefined;\n\nexport function createDeploymentLogger(prefix: string) {\n const isDebug = !!process.env.DEBUG;\n\n return {\n info: isDebug ? (...args: unknown[]) => console.info(prefix, ...args) : noop,\n debug: isDebug ? (...args: unknown[]) => console.debug(prefix, ...args) : noop,\n warn: (...args: unknown[]) => console.warn(prefix, ...args),\n error: (...args: unknown[]) => console.error(prefix, ...args),\n };\n}\n","import { realpathSync } from 'node:fs';\nimport { resolve } from 'node:path';\n\n/**\n * Check if a target path is the same directory (or a worktree of) the\n * currently running shep instance. Starting a dev server there would spawn\n * another shep instance that conflicts with the shared ~/.shep/data DB.\n */\nexport function isSameShepInstance(targetPath: string): boolean {\n const instancePath = process.env.NEXT_PUBLIC_SHEP_INSTANCE_PATH ?? process.cwd();\n\n try {\n const normalizedTarget = realpathSync(resolve(targetPath)).replace(/\\\\/g, '/');\n const normalizedInstance = realpathSync(resolve(instancePath)).replace(/\\\\/g, '/');\n return normalizedTarget === normalizedInstance;\n } catch {\n return false;\n }\n}\n","'use server';\n\nimport { existsSync } from 'node:fs';\nimport { isAbsolute } from 'node:path';\nimport { resolve } from '@/lib/server-container';\nimport { createDeploymentLogger } from '@shepai/core/infrastructure/services/deployment/deployment-logger';\nimport type { IDeploymentService } from '@shepai/core/application/ports/output/services/deployment-service.interface';\nimport { DeploymentState } from '@shepai/core/domain/generated/output';\nimport { isSameShepInstance } from '@/lib/is-same-shep-instance';\n\nconst log = createDeploymentLogger('[deployRepository]');\n\nexport async function deployRepository(\n repositoryPath: string\n): Promise<{ success: boolean; error?: string; state?: DeploymentState }> {\n log.info(`called — repositoryPath=\"${repositoryPath}\"`);\n\n if (!repositoryPath || !isAbsolute(repositoryPath)) {\n log.warn('rejected — not an absolute path');\n return { success: false, error: 'repositoryPath must be an absolute path' };\n }\n\n try {\n if (!existsSync(repositoryPath)) {\n log.warn(`directory does not exist: \"${repositoryPath}\"`);\n return { success: false, error: `Directory does not exist: ${repositoryPath}` };\n }\n\n if (isSameShepInstance(repositoryPath)) {\n log.warn('rejected — target is the running shep instance');\n return {\n success: false,\n error: 'Cannot start a dev server for the repository Shep is running from',\n };\n }\n\n log.info('directory exists, calling deploymentService.start()');\n const deploymentService = resolve<IDeploymentService>('IDeploymentService');\n deploymentService.start(repositoryPath, repositoryPath, 'repository');\n\n log.info('start() returned successfully — state=Booting');\n return { success: true, state: DeploymentState.Booting };\n } catch (error: unknown) {\n const message = error instanceof Error ? error.message : 'Failed to deploy repository';\n log.error(`error: ${message}`, error);\n return { success: false, error: message };\n }\n}\n","'use server';\n\nimport { resolve } from '@/lib/server-container';\nimport type { IDeploymentService } from '@shepai/core/application/ports/output/services/deployment-service.interface';\n\nexport async function stopDeployment(\n targetId: string\n): Promise<{ success: boolean; error?: string }> {\n if (!targetId?.trim()) {\n return { success: false, error: 'targetId is required' };\n }\n\n try {\n const deploymentService = resolve<IDeploymentService>('IDeploymentService');\n await deploymentService.stop(targetId);\n\n return { success: true };\n } catch (error: unknown) {\n const message = error instanceof Error ? error.message : 'Failed to stop deployment';\n return { success: false, error: message };\n }\n}\n","'use server';\n\nimport { resolve } from '@/lib/server-container';\nimport type {\n IDeploymentService,\n DeploymentStatus,\n} from '@shepai/core/application/ports/output/services/deployment-service.interface';\n\nexport async function getDeploymentStatus(targetId: string): Promise<DeploymentStatus | null> {\n if (!targetId?.trim()) {\n return null;\n }\n\n const deploymentService = resolve<IDeploymentService>('IDeploymentService');\n return deploymentService.getStatus(targetId);\n}\n","'use server';\n\nimport { resolve } from '@/lib/server-container';\nimport type {\n IDeploymentService,\n LogEntry,\n} from '@shepai/core/application/ports/output/services/deployment-service.interface';\n\nexport async function getDeploymentLogs(targetId: string): Promise<LogEntry[] | null> {\n if (!targetId?.trim()) {\n return null;\n }\n\n const deploymentService = resolve<IDeploymentService>('IDeploymentService');\n return deploymentService.getLogs(targetId);\n}\n","'use server';\n\nimport { resolve } from '@/lib/server-container';\nimport { getModelMeta } from '@/lib/model-metadata';\nimport type { IAgentExecutorFactory } from '@shepai/core/application/ports/output/agents/agent-executor-factory.interface';\n\nexport interface ModelInfo {\n id: string;\n displayName: string;\n description: string;\n}\n\nexport interface AgentModelGroup {\n agentType: string;\n label: string;\n models: ModelInfo[];\n}\n\nconst AGENT_LABELS: Record<string, string> = {\n 'claude-code': 'Claude Code',\n cursor: 'Cursor CLI',\n 'gemini-cli': 'Gemini CLI',\n dev: 'Demo',\n};\n\n/** Sort weight — higher = further down. Demo always last. */\nconst AGENT_ORDER: Record<string, number> = {\n 'claude-code': 0,\n cursor: 1,\n 'gemini-cli': 2,\n dev: 99,\n};\n\nexport async function getAllAgentModels(): Promise<AgentModelGroup[]> {\n try {\n const factory = resolve<IAgentExecutorFactory>('IAgentExecutorFactory');\n const agents = factory.getSupportedAgents();\n return agents\n .map((agentType) => ({\n agentType: agentType as string,\n label: AGENT_LABELS[agentType as string] ?? (agentType as string),\n models: factory.getSupportedModels(agentType).map((id) => ({\n id,\n ...getModelMeta(id),\n })),\n }))\n .map((g) => {\n // Dev agent gets fun demo models\n if (g.agentType === 'dev' && g.models.length === 0) {\n return {\n ...g,\n models: [\n { id: 'gpt-8', ...getModelMeta('gpt-8') },\n { id: 'opus-7', ...getModelMeta('opus-7') },\n ],\n };\n }\n return g;\n })\n .filter((g) => g.models.length > 0)\n .sort((a, b) => (AGENT_ORDER[a.agentType] ?? 50) - (AGENT_ORDER[b.agentType] ?? 50));\n } catch {\n return [];\n }\n}\n","export interface ModelMeta {\n displayName: string;\n description: string;\n}\n\n/**\n * Presentation-layer metadata for known LLM model identifiers.\n * Maps raw model IDs to human-friendly display names and short descriptions.\n */\nconst MODEL_METADATA: Record<string, ModelMeta> = {\n // Claude models\n 'claude-opus-4-6': { displayName: 'Opus 4.6', description: 'Most capable, complex tasks' },\n 'claude-sonnet-4-6': { displayName: 'Sonnet 4.6', description: 'Fast & balanced' },\n 'claude-haiku-4-5': { displayName: 'Haiku 4.5', description: 'Lightweight & quick' },\n\n // Gemini models\n 'gemini-3.1-pro': { displayName: 'Gemini 3.1 Pro', description: 'Advanced reasoning' },\n 'gemini-3-flash': { displayName: 'Gemini 3 Flash', description: 'Ultra-fast responses' },\n 'gemini-2.5-pro': { displayName: 'Gemini 2.5 Pro', description: 'Reliable workhorse' },\n 'gemini-2.5-flash': { displayName: 'Gemini 2.5 Flash', description: 'Speed-optimized' },\n\n // OpenAI models\n 'gpt-5.4-high': { displayName: 'GPT-5.4', description: 'Latest reasoning model' },\n 'gpt-5.2': { displayName: 'GPT-5.2', description: 'Flagship model' },\n 'gpt-5.3-codex': { displayName: 'GPT-5.3 Codex', description: 'Code specialist' },\n\n // Other\n 'composer-1.5': { displayName: 'Composer 1.5', description: 'Multi-file editing' },\n 'grok-code': { displayName: 'Grok Code', description: 'xAI code model' },\n\n // Demo / fun models\n 'gpt-8': { displayName: 'GPT-8', description: 'Writes code before you think it' },\n 'opus-7': { displayName: 'Opus 7', description: 'Achieved consciousness, ships on time' },\n};\n\nconst FALLBACK: ModelMeta = { displayName: '', description: '' };\n\nexport function getModelMeta(modelId: string): ModelMeta {\n const meta = MODEL_METADATA[modelId];\n if (meta) return meta;\n // Fallback: prettify the raw ID\n return {\n ...FALLBACK,\n displayName: modelId\n .replace(/^claude-/, '')\n .replace(/^gemini-/, 'Gemini ')\n .replace(/^gpt-/, 'GPT-')\n .replace(/-/g, ' ')\n .replace(/\\b\\w/g, (c) => c.toUpperCase()),\n };\n}\n","'use server';\n\nimport { resolve } from '@/lib/server-container';\nimport {\n resetSettings,\n initializeSettings,\n} from '@shepai/core/infrastructure/services/settings.service';\nimport type { CompleteWebOnboardingUseCase } from '@shepai/core/application/use-cases/settings/complete-web-onboarding.use-case';\nimport type { AgentType } from '@shepai/core/domain/generated/output';\n\nexport async function updateAgentAndModel(\n agentType: string,\n model: string | null\n): Promise<{ ok: boolean; error?: string }> {\n if (!agentType.trim()) {\n return { ok: false, error: 'agent type is required' };\n }\n\n try {\n const useCase = resolve<CompleteWebOnboardingUseCase>('CompleteWebOnboardingUseCase');\n const updatedSettings = await useCase.execute({\n agentType: agentType.trim() as AgentType,\n model,\n });\n\n resetSettings();\n initializeSettings(updatedSettings);\n\n return { ok: true };\n } catch (error: unknown) {\n const message = error instanceof Error ? error.message : 'Failed to update agent and model';\n return { ok: false, error: message };\n }\n}\n","'use server';\n\nimport { getSettings } from '@shepai/core/infrastructure/services/settings.service';\n\nexport interface WorkflowDefaults {\n approvalGates: {\n allowPrd: boolean;\n allowPlan: boolean;\n allowMerge: boolean;\n };\n push: boolean;\n openPr: boolean;\n ciWatchEnabled: boolean;\n enableEvidence: boolean;\n commitEvidence: boolean;\n}\n\nexport async function getWorkflowDefaults(): Promise<WorkflowDefaults> {\n const settings = getSettings();\n const { workflow } = settings;\n\n return {\n approvalGates: {\n allowPrd: workflow.approvalGateDefaults.allowPrd,\n allowPlan: workflow.approvalGateDefaults.allowPlan,\n allowMerge: workflow.approvalGateDefaults.allowMerge,\n },\n push: workflow.approvalGateDefaults.pushOnImplementationComplete,\n openPr: workflow.openPrOnImplementationComplete,\n ciWatchEnabled: workflow.ciWatchEnabled,\n enableEvidence: workflow.enableEvidence,\n commitEvidence: workflow.commitEvidence,\n };\n}\n","'use server';\n\nimport { resolve } from '@/lib/server-container';\nimport type { CreateFeatureUseCase } from '@shepai/core/application/use-cases/features/create/create-feature.use-case';\nimport type { Feature } from '@shepai/core/domain/generated/output';\nimport { composeUserInput } from './compose-user-input';\n\ninterface Attachment {\n path: string;\n name: string;\n notes?: string;\n}\n\ninterface ApprovalGates {\n allowPrd: boolean;\n allowPlan: boolean;\n allowMerge: boolean;\n}\n\ninterface CreateFeatureInput {\n description: string;\n repositoryPath: string;\n attachments?: Attachment[];\n sessionId?: string;\n approvalGates?: {\n allowPrd: boolean;\n allowPlan: boolean;\n allowMerge?: boolean;\n };\n push?: boolean;\n openPr?: boolean;\n parentId?: string;\n /** When true, skip SDLC phases and implement directly from the prompt. */\n fast?: boolean;\n /** When true, create the feature in pending state (no agent spawned). */\n pending?: boolean;\n /** Fork repo and create PR to upstream at merge time. */\n forkAndPr?: boolean;\n /** Commit specs/evidences into the repo (default: true, auto-false when forkAndPr). */\n commitSpecs?: boolean;\n /** Enable CI watch/fix loop after push. */\n ciWatchEnabled?: boolean;\n /** Enable evidence collection after implementation. */\n enableEvidence?: boolean;\n /** Commit evidence to PR. */\n commitEvidence?: boolean;\n /** Optional agent type override for this feature run */\n agentType?: string;\n /** Optional model identifier for this feature run */\n model?: string;\n}\n\nexport async function createFeature(\n input: CreateFeatureInput\n): Promise<{ feature?: Feature; error?: string }> {\n const {\n description,\n repositoryPath,\n attachments,\n sessionId,\n approvalGates,\n push,\n openPr,\n parentId,\n fast,\n pending,\n forkAndPr,\n commitSpecs,\n ciWatchEnabled,\n enableEvidence,\n commitEvidence,\n agentType,\n model,\n } = input;\n\n if (!description?.trim()) {\n return { error: 'description is required' };\n }\n\n if (!repositoryPath?.trim()) {\n return { error: 'repositoryPath is required' };\n }\n\n const userInput = composeUserInput(description, attachments);\n const gates: ApprovalGates = {\n allowPrd: approvalGates?.allowPrd ?? false,\n allowPlan: approvalGates?.allowPlan ?? false,\n allowMerge: approvalGates?.allowMerge ?? false,\n };\n\n try {\n const createFeatureUseCase = resolve<CreateFeatureUseCase>('CreateFeatureUseCase');\n\n // Phase 1 (fast): create DB record with real UUID — returns immediately\n const { feature, shouldSpawn } = await createFeatureUseCase.createRecord({\n userInput,\n repositoryPath,\n approvalGates: gates,\n push: push ?? false,\n openPr: openPr ?? false,\n ...(parentId ? { parentId } : {}),\n description,\n ...(fast ? { fast } : {}),\n ...(pending ? { pending } : {}),\n ...(forkAndPr != null ? { forkAndPr } : {}),\n ...(commitSpecs != null ? { commitSpecs } : {}),\n ...(ciWatchEnabled != null ? { ciWatchEnabled } : {}),\n ...(enableEvidence != null ? { enableEvidence } : {}),\n ...(commitEvidence != null ? { commitEvidence } : {}),\n ...(agentType ? { agentType } : {}),\n ...(model ? { model } : {}),\n });\n\n // Phase 2 (background): metadata generation, worktree, spec, agent spawn\n // Fire-and-forget — the UI gets the real feature ID immediately\n createFeatureUseCase\n .initializeAndSpawn(\n feature,\n {\n userInput,\n repositoryPath,\n approvalGates: gates,\n push: push ?? false,\n openPr: openPr ?? false,\n ...(parentId ? { parentId } : {}),\n ...(fast ? { fast } : {}),\n ...(pending ? { pending } : {}),\n ...(forkAndPr != null ? { forkAndPr } : {}),\n ...(commitSpecs != null ? { commitSpecs } : {}),\n ...(agentType ? { agentType } : {}),\n ...(model ? { model } : {}),\n ...(sessionId ? { sessionId } : {}),\n },\n shouldSpawn\n )\n .catch((err: unknown) => {\n // eslint-disable-next-line no-console\n console.error('[createFeature] initializeAndSpawn failed:', err);\n });\n\n return { feature };\n } catch (error: unknown) {\n const message = error instanceof Error ? error.message : 'Failed to create feature';\n return { error: message };\n }\n}\n","interface Attachment {\n path: string;\n name: string;\n notes?: string;\n}\n\nexport function composeUserInput(\n description: string,\n attachments: Attachment[] | undefined\n): string {\n if (!attachments || attachments.length === 0) {\n return description;\n }\n\n const refs = attachments\n .map((a) => (a.notes?.trim() ? `@${a.path} [Note: ${a.notes.trim()}]` : `@${a.path}`))\n .join(' ');\n return `${description}\\n\\n${refs}`;\n}\n","export {pickFolder as '0015a12e807beac804c1dbf66a2bb5fdf0153e76a3'} from 'ACTIONS_MODULE0'\nexport {listGitHubRepositories as '404512030c2bfdbfea7878010a042425f0beafd8aa'} from 'ACTIONS_MODULE1'\nexport {importGitHubRepository as '404b171a7aa19f30ecca2c7128b908757d9acac939'} from 'ACTIONS_MODULE2'\nexport {deployFeature as '40619e63ab814aa809aac2379ca2b45f55129ac4d6'} from 'ACTIONS_MODULE3'\nexport {deployRepository as '408456b6b1460b9dd5c54a30f265c78b0020f7d370'} from 'ACTIONS_MODULE4'\nexport {stopDeployment as '40eb42ef39a26a70d8df28bd850c23f01372d8e533'} from 'ACTIONS_MODULE5'\nexport {getDeploymentStatus as '404bb1488d9a42dc9b7889047754d1b134ddd1ea7c'} from 'ACTIONS_MODULE6'\nexport {openIde as '407bf8db4bcf0e44944adcfe63af7c51554f2128bf'} from 'ACTIONS_MODULE7'\nexport {openShell as '401a6cf5089d2de81c96f4f730782b43e15139f13c'} from 'ACTIONS_MODULE8'\nexport {openFolder as '4051e169bb9b4497c67643d1855a3666510a0cf33b'} from 'ACTIONS_MODULE9'\nexport {syncRepository as '403131c999d31ea5ddbf03c92c98da7bfc98147ce9'} from 'ACTIONS_MODULE10'\nexport {getDeploymentLogs as '40827b0ae10c2be27cbd3d38f3be86a74c374da53b'} from 'ACTIONS_MODULE11'\nexport {isAgentSetupComplete as '007f6542d38d48b03066015a98c3559c692f2f375d'} from 'ACTIONS_MODULE12'\nexport {checkAgentAuth as '004788e71885a230f5771c8d1edd20a8fbd9ba8572'} from 'ACTIONS_MODULE13'\nexport {checkToolStatus as '00c12a14b3555137c1fd7c4e76f25863ac463f591c'} from 'ACTIONS_MODULE14'\nexport {getAllAgentModels as '00f2aee200baff57628bc3913106497bed300dc443'} from 'ACTIONS_MODULE15'\nexport {updateAgentAndModel as '60c55618a1279c50270f6c07bf7dcb040598557343'} from 'ACTIONS_MODULE16'\nexport {archiveFeature as '40e209eeb394ffaac2b70444751c86b2f22b8914c8'} from 'ACTIONS_MODULE17'\nexport {deleteFeature as '78b012b8971e246236498136deded8aa98b97dac89'} from 'ACTIONS_MODULE18'\nexport {resumeFeature as '40f5db362f6fb3c4f6670fab880046d589500e1852'} from 'ACTIONS_MODULE19'\nexport {startFeature as '4050abcee4a714fd7cb0e8f92271be2b5eb714ec58'} from 'ACTIONS_MODULE20'\nexport {stopFeature as '40c66017ebca8e7db140abc54e98aba5ea253cba48'} from 'ACTIONS_MODULE21'\nexport {unarchiveFeature as '4098fb36106d97f277bbdbb2d2b2707ee4f39292c7'} from 'ACTIONS_MODULE22'\nexport {addRepository as '408286befbf3b48a7552cfae33211b3fb423f188f1'} from 'ACTIONS_MODULE23'\nexport {deleteRepository as '4024cabc01fe1d6ba0eb2a1f7adace8da3cb1b98ec'} from 'ACTIONS_MODULE24'\nexport {getFeatureMetadata as '403fe4acb2bc15466c91b1ee7913b6c559266ea50e'} from 'ACTIONS_MODULE25'\nexport {getWorkflowDefaults as '0057c19c99fbac05295ee5c3208107b1032adf3656'} from 'ACTIONS_MODULE26'\nexport {createFeature as '409213e5fb6042ead5df899374f8991a2bccab9b64'} from 'ACTIONS_MODULE27'\n"],"names":["registerServerReference","ensureServerEntryExports","actions","i","length","action","Error"],"mappings":"6CAAoD,OAAA,cAAA,CAAA,EAAA,aAAA,oCAC3CA,0BAAAA,qCAAAA,EAAAA,uBAAuB,YAAQ,CAAA,CAAA,IAAA,iCCEjC,SAASC,EAAyBC,CAAc,EACrD,IAAK,IAAIC,EAAI,EAAGA,EAAID,EAAQE,MAAM,CAAED,IAAK,CACvC,IAAME,EAASH,CAAO,CAACC,EAAE,CACzB,GAAsB,YAAlB,AAA8B,OAAvBE,EACT,MAAM,OAAA,cAEL,CAFK,AAAIC,MACR,CAAC,2DAA2D,EAAE,OAAOD,EAAO;AAAA,oEAAuE,CAAC,EADhJ,oBAAA,OAAA,mBAAA,eAAA,EAEN,EAEJ,CACF,0EATgBJ,2BAAAA,qCAAAA,0DCHhB,EAAA,EAAA,CAAA,CAAA,OAOA,IAAM,EAAgC,CACpC,SAAU,QAAQ,QAAQ,CAC1B,KAAM,CAAC,EAAK,IAAS,CAAA,EAAA,EAAA,QAAA,AAAQ,EAAC,EAAK,EACrC,EAMM,EAA4C,CAChD,OAAQ,CAAC,qFAAqF,CAAC,GAC/F,MAAO,CAAC,oFAAoF,CAAC,CAC7F,MAAO,CAAC,wPAAwP,CAAC,EACnQ,CAEO,OAAM,EACH,IAAuB,AAE/B,aAAY,EAAkC,CAAC,CAAC,CAAE,CAChD,IAAI,CAAC,IAAI,CAAG,CAAE,GAAG,CAAW,CAAE,GAAG,CAAI,AAAC,CACxC,CAGA,YAA4B,CAC1B,OAAO,CAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAI,IAClD,CAOA,YAA4B,CAC1B,IAAM,EAAU,IAAI,CAAC,UAAU,GAC/B,GAAI,CAAC,EACH,MAA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AA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,MACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA","ignoreList":[0,1]}
@@ -1,3 +0,0 @@
1
- module.exports=[80646,a=>{"use strict";var b=a.i(10973),c=a.i(96960),d=a.i(59653),e=a.i(6175),f=a.i(7420),g=a.i(58761),h=a.i(51473),i=a.i(59675),j=a.i(5472),k=a.i(75988),l=a.i(80930),m=a.i(14272),n=a.i(66873),o=a.i(90986),p=a.i(17329),q=a.i(16164),r=a.i(45291),s="Popover",[t,u]=(0,f.createContextScope)(s,[k.createPopperScope]),v=(0,k.createPopperScope)(),[w,x]=t(s),y=a=>{let{__scopePopover:d,children:e,open:f,defaultOpen:g,onOpenChange:h,modal:i=!1}=a,l=v(d),m=c.useRef(null),[n,o]=c.useState(!1),[q,r]=(0,p.useControllableState)({prop:f,defaultProp:g??!1,onChange:h,caller:s});return(0,b.jsx)(k.Root,{...l,children:(0,b.jsx)(w,{scope:d,contentId:(0,j.useId)(),triggerRef:m,open:q,onOpenChange:r,onOpenToggle:c.useCallback(()=>r(a=>!a),[r]),hasCustomAnchor:n,onCustomAnchorAdd:c.useCallback(()=>o(!0),[]),onCustomAnchorRemove:c.useCallback(()=>o(!1),[]),modal:i,children:e})})};y.displayName=s;var z="PopoverAnchor",A=c.forwardRef((a,d)=>{let{__scopePopover:e,...f}=a,g=x(z,e),h=v(e),{onCustomAnchorAdd:i,onCustomAnchorRemove:j}=g;return c.useEffect(()=>(i(),()=>j()),[i,j]),(0,b.jsx)(k.Anchor,{...h,...f,ref:d})});A.displayName=z;var B="PopoverTrigger",C=c.forwardRef((a,c)=>{let{__scopePopover:f,...g}=a,h=x(B,f),i=v(f),j=(0,e.useComposedRefs)(c,h.triggerRef),l=(0,b.jsx)(n.Primitive.button,{type:"button","aria-haspopup":"dialog","aria-expanded":h.open,"aria-controls":h.contentId,"data-state":Q(h.open),...g,ref:j,onClick:(0,d.composeEventHandlers)(a.onClick,h.onOpenToggle)});return h.hasCustomAnchor?l:(0,b.jsx)(k.Anchor,{asChild:!0,...i,children:l})});C.displayName=B;var D="PopoverPortal",[E,F]=t(D,{forceMount:void 0}),G=a=>{let{__scopePopover:c,forceMount:d,children:e,container:f}=a,g=x(D,c);return(0,b.jsx)(E,{scope:c,forceMount:d,children:(0,b.jsx)(m.Presence,{present:d||g.open,children:(0,b.jsx)(l.Portal,{asChild:!0,container:f,children:e})})})};G.displayName=D;var H="PopoverContent",I=c.forwardRef((a,c)=>{let d=F(H,a.__scopePopover),{forceMount:e=d.forceMount,...f}=a,g=x(H,a.__scopePopover);return(0,b.jsx)(m.Presence,{present:e||g.open,children:g.modal?(0,b.jsx)(K,{...f,ref:c}):(0,b.jsx)(L,{...f,ref:c})})});I.displayName=H;var J=(0,o.createSlot)("PopoverContent.RemoveScroll"),K=c.forwardRef((a,f)=>{let g=x(H,a.__scopePopover),h=c.useRef(null),i=(0,e.useComposedRefs)(f,h),j=c.useRef(!1);return c.useEffect(()=>{let a=h.current;if(a)return(0,q.hideOthers)(a)},[]),(0,b.jsx)(r.RemoveScroll,{as:J,allowPinchZoom:!0,children:(0,b.jsx)(M,{...a,ref:i,trapFocus:g.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,d.composeEventHandlers)(a.onCloseAutoFocus,a=>{a.preventDefault(),j.current||g.triggerRef.current?.focus()}),onPointerDownOutside:(0,d.composeEventHandlers)(a.onPointerDownOutside,a=>{let b=a.detail.originalEvent,c=0===b.button&&!0===b.ctrlKey;j.current=2===b.button||c},{checkForDefaultPrevented:!1}),onFocusOutside:(0,d.composeEventHandlers)(a.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),L=c.forwardRef((a,d)=>{let e=x(H,a.__scopePopover),f=c.useRef(!1),g=c.useRef(!1);return(0,b.jsx)(M,{...a,ref:d,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:b=>{a.onCloseAutoFocus?.(b),b.defaultPrevented||(f.current||e.triggerRef.current?.focus(),b.preventDefault()),f.current=!1,g.current=!1},onInteractOutside:b=>{a.onInteractOutside?.(b),b.defaultPrevented||(f.current=!0,"pointerdown"===b.detail.originalEvent.type&&(g.current=!0));let c=b.target;e.triggerRef.current?.contains(c)&&b.preventDefault(),"focusin"===b.detail.originalEvent.type&&g.current&&b.preventDefault()}})}),M=c.forwardRef((a,c)=>{let{__scopePopover:d,trapFocus:e,onOpenAutoFocus:f,onCloseAutoFocus:j,disableOutsidePointerEvents:l,onEscapeKeyDown:m,onPointerDownOutside:n,onFocusOutside:o,onInteractOutside:p,...q}=a,r=x(H,d),s=v(d);return(0,h.useFocusGuards)(),(0,b.jsx)(i.FocusScope,{asChild:!0,loop:!0,trapped:e,onMountAutoFocus:f,onUnmountAutoFocus:j,children:(0,b.jsx)(g.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:p,onEscapeKeyDown:m,onPointerDownOutside:n,onFocusOutside:o,onDismiss:()=>r.onOpenChange(!1),children:(0,b.jsx)(k.Content,{"data-state":Q(r.open),role:"dialog",id:r.contentId,...s,...q,ref:c,style:{...q.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),N="PopoverClose",O=c.forwardRef((a,c)=>{let{__scopePopover:e,...f}=a,g=x(N,e);return(0,b.jsx)(n.Primitive.button,{type:"button",...f,ref:c,onClick:(0,d.composeEventHandlers)(a.onClick,()=>g.onOpenChange(!1))})});O.displayName=N;var P=c.forwardRef((a,c)=>{let{__scopePopover:d,...e}=a,f=v(d);return(0,b.jsx)(k.Arrow,{...f,...e,ref:c})});function Q(a){return a?"open":"closed"}P.displayName="PopoverArrow",a.s(["Anchor",()=>A,"Arrow",()=>P,"Close",()=>O,"Content",()=>I,"Popover",()=>y,"PopoverAnchor",()=>A,"PopoverArrow",()=>P,"PopoverClose",()=>O,"PopoverContent",()=>I,"PopoverPortal",()=>G,"PopoverTrigger",()=>C,"Portal",()=>G,"Root",()=>y,"Trigger",()=>C,"createPopoverScope",()=>u],61452);var R=a.i(61452),R=R,S=a.i(85536);let T=R.Root,U=R.Trigger;R.Anchor;let V=c.forwardRef(({className:a,align:c="center",sideOffset:d=4,...e},f)=>(0,b.jsx)(R.Portal,{children:(0,b.jsx)(R.Content,{ref:f,align:c,sideOffset:d,className:(0,S.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 rounded-md border p-4 shadow-md outline-none",a),...e})}));V.displayName=R.Content.displayName,a.s(["Popover",()=>T,"PopoverContent",()=>V,"PopoverTrigger",()=>U],80646)},7882,50388,a=>{"use strict";var b=a.i(25674);let c=(0,b.createServerReference)("00f2aee200baff57628bc3913106497bed300dc443",b.callServer,void 0,b.findSourceMapURL,"getAllAgentModels");a.s(["getAllAgentModels",()=>c],7882);let d=(0,b.createServerReference)("60c55618a1279c50270f6c07bf7dcb040598557343",b.callServer,void 0,b.findSourceMapURL,"updateAgentAndModel");a.s(["updateAgentAndModel",()=>d],50388)},96867,61781,a=>{"use strict";var b=a.i(10973),c=a.i(96960),d=a.i(59653),e=a.i(6175),f=a.i(7420),g=a.i(17329),h=a.i(64005),i=a.i(74432),j=a.i(66873),k="Switch",[l,m]=(0,f.createContextScope)(k),[n,o]=l(k),p=c.forwardRef((a,f)=>{let{__scopeSwitch:h,name:i,checked:l,defaultChecked:m,required:o,disabled:p,value:q="on",onCheckedChange:r,form:u,...v}=a,[w,x]=c.useState(null),y=(0,e.useComposedRefs)(f,a=>x(a)),z=c.useRef(!1),A=!w||u||!!w.closest("form"),[B,C]=(0,g.useControllableState)({prop:l,defaultProp:m??!1,onChange:r,caller:k});return(0,b.jsxs)(n,{scope:h,checked:B,disabled:p,children:[(0,b.jsx)(j.Primitive.button,{type:"button",role:"switch","aria-checked":B,"aria-required":o,"data-state":t(B),"data-disabled":p?"":void 0,disabled:p,value:q,...v,ref:y,onClick:(0,d.composeEventHandlers)(a.onClick,a=>{C(a=>!a),A&&(z.current=a.isPropagationStopped(),z.current||a.stopPropagation())})}),A&&(0,b.jsx)(s,{control:w,bubbles:!z.current,name:i,value:q,checked:B,required:o,disabled:p,form:u,style:{transform:"translateX(-100%)"}})]})});p.displayName=k;var q="SwitchThumb",r=c.forwardRef((a,c)=>{let{__scopeSwitch:d,...e}=a,f=o(q,d);return(0,b.jsx)(j.Primitive.span,{"data-state":t(f.checked),"data-disabled":f.disabled?"":void 0,...e,ref:c})});r.displayName=q;var s=c.forwardRef(({__scopeSwitch:a,control:d,checked:f,bubbles:g=!0,...j},k)=>{let l=c.useRef(null),m=(0,e.useComposedRefs)(l,k),n=(0,h.usePrevious)(f),o=(0,i.useSize)(d);return c.useEffect(()=>{let a=l.current;if(!a)return;let b=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(n!==f&&b){let c=new Event("click",{bubbles:g});b.call(a,f),a.dispatchEvent(c)}},[n,f,g]),(0,b.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:f,...j,tabIndex:-1,ref:m,style:{...j.style,...o,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function t(a){return a?"checked":"unchecked"}s.displayName="SwitchBubbleInput",a.s(["Root",()=>p,"Switch",()=>p,"SwitchThumb",()=>r,"Thumb",()=>r,"createSwitchScope",()=>m],91918);var u=a.i(91918),u=u,v=a.i(85536);function w({className:a,size:c="default",...d}){return(0,b.jsx)(u.Root,{"data-slot":"switch","data-size":c,className:(0,v.cn)("peer group/switch focus-visible:border-ring focus-visible:ring-ring/50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input dark:data-[state=unchecked]:bg-input/80 inline-flex shrink-0 cursor-pointer items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-[1.15rem] data-[size=default]:w-8 data-[size=sm]:h-3.5 data-[size=sm]:w-6",a),...d,children:(0,b.jsx)(u.Thumb,{"data-slot":"switch-thumb",className:(0,v.cn)("bg-background dark:data-[state=checked]:bg-primary-foreground dark:data-[state=unchecked]:bg-foreground pointer-events-none block rounded-full ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}a.s(["Switch",()=>w],96867);var x=a.i(72016),y=a.i(94132),z=a.i(3410),A=a.i(7882),B=a.i(50388),C=a.i(17606),D=a.i(83852),E=a.i(18948),F=a.i(80646);function G({initialAgentType:a,initialModel:d,onAgentModelChange:e,disabled:f,className:g,mode:h}){let[i,j]=c.useState(!1),[k,l]=c.useState([]),[m,n]=c.useState(!0),[o,p]=c.useState(a),[q,r]=c.useState(d),[s,t]=c.useState(null),[u,w]=c.useState(0),[G,H]=c.useState(null);c.useEffect(()=>{(0,A.getAllAgentModels)().then(l).finally(()=>n(!1))},[]),c.useEffect(()=>{if(!i){let a=setTimeout(()=>{w(0),H(null)},150);return()=>clearTimeout(a)}},[i]);let I=async(a,b)=>{if(j(!1),a!==o||b!==q){if("override"===h){p(a),r(b),e?.(a,b);return}p(a),r(b),e?.(a,b),t(null);try{let c=await (0,B.updateAgentAndModel)(a,b||null);c.ok||(p(o),r(q),e?.(o,q),t(c.error??"Failed to save"))}catch{p(o),r(q),e?.(o,q),t("Failed to save")}}},J=(0,C.getAgentTypeIcon)(o),K=k.find(a=>a.agentType===o)?.label??o,L=q?(0,D.getModelMeta)(q).displayName||q:null,M=G?k.find(a=>a.agentType===G):null;return(0,b.jsxs)("div",{className:(0,v.cn)("flex flex-col gap-1",g),children:[(0,b.jsxs)(F.Popover,{open:i,onOpenChange:j,children:[(0,b.jsx)(F.PopoverTrigger,{asChild:!0,children:(0,b.jsx)(E.Button,{variant:"outline",role:"combobox","aria-expanded":i,disabled:(f??!1)||m,className:"w-auto cursor-pointer justify-start font-normal hover:border-violet-300 hover:bg-violet-50/50 dark:hover:border-violet-700 dark:hover:bg-violet-950/30",children:(0,b.jsxs)("span",{className:"flex items-center gap-2 truncate",children:[(0,b.jsx)(J,{className:"h-4 w-4 shrink-0"}),m?"Loading…":(0,b.jsxs)("span",{className:"flex items-center gap-1",children:[(0,b.jsx)("span",{className:"text-muted-foreground text-xs",children:K}),L?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("span",{className:"text-muted-foreground/50 text-xs",children:"·"}),(0,b.jsx)("span",{className:"text-xs font-medium",children:L})]}):null]})]})})}),(0,b.jsx)(F.PopoverContent,{className:"w-(--radix-popover-trigger-width) overflow-hidden p-0",align:"start",children:(0,b.jsxs)("div",{className:"flex transition-transform duration-200 ease-in-out",style:{transform:`translateX(${1===u?"-50%":"0%"})`,width:"200%"},children:[(0,b.jsxs)("div",{className:"w-1/2 shrink-0",children:[(0,b.jsx)("div",{className:"text-muted-foreground border-b px-3 py-2 text-xs font-medium",children:"Select agent"}),k.map(a=>{let c=(0,C.getAgentTypeIcon)(a.agentType),d=o===a.agentType,e=a.models.length>0;return(0,b.jsxs)("button",{type:"button",className:(0,v.cn)("flex w-full cursor-pointer items-center gap-2.5 px-3 py-2 text-xs transition-colors","hover:bg-accent hover:text-accent-foreground",d&&"bg-accent/50"),onClick:()=>{e?(H(a.agentType),requestAnimationFrame(()=>{requestAnimationFrame(()=>w(1))})):I(a.agentType,"")},children:[(0,b.jsx)(c,{className:"h-4 w-4 shrink-0"}),(0,b.jsx)("span",{className:"flex-1 text-left",children:a.label}),d&&!e?(0,b.jsx)(x.Check,{className:"text-primary h-3.5 w-3.5 shrink-0"}):null,e?(0,b.jsx)(z.ChevronRight,{className:"text-muted-foreground h-3.5 w-3.5 shrink-0"}):null]},a.agentType)})]}),(0,b.jsx)("div",{className:"w-1/2 shrink-0",children:M?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("button",{type:"button",className:"text-muted-foreground hover:text-foreground flex w-full cursor-pointer items-center gap-1.5 border-b px-3 py-2 text-xs font-medium transition-colors",onClick:()=>{w(0),setTimeout(()=>H(null),220)},children:[(0,b.jsx)(y.ChevronLeft,{className:"h-3.5 w-3.5"}),M.label]}),M.models.map(a=>{let c=o===M.agentType&&q===a.id;return(0,b.jsxs)("button",{type:"button",className:(0,v.cn)("flex w-full cursor-pointer items-center gap-3 px-3 py-2 text-left transition-colors","hover:bg-accent hover:text-accent-foreground",c&&"bg-accent/50"),onClick:()=>I(M.agentType,a.id),children:[(0,b.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,b.jsx)("span",{className:"text-xs font-medium",children:a.displayName}),(0,b.jsx)("span",{className:"text-muted-foreground text-xs",children:a.description})]}),c?(0,b.jsx)(x.Check,{className:"text-primary h-3.5 w-3.5 shrink-0"}):null]},a.id)})]}):null})]})})]}),!!s&&(0,b.jsx)("p",{className:"text-destructive text-sm",children:s})]})}a.s(["AgentModelPicker",()=>G],61781)}];
2
-
3
- //# sourceMappingURL=src_presentation_web_edb9a758._.js.map
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,93752,e=>{"use strict";let t=(0,e.i(3645).default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);e.s(["default",()=>t])},95230,e=>{"use strict";let t=(0,e.i(3645).default)("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]);e.s(["default",()=>t])},16868,e=>{"use strict";let t=(0,e.i(3645).default)("paperclip",[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]);e.s(["PaperclipIcon",()=>t],16868)},16298,e=>{"use strict";let t=(0,e.i(3645).default)("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);e.s(["default",()=>t])},70471,e=>{"use strict";var t=e.i(16298);e.s(["FileText",()=>t.default])},48306,64764,80436,17087,28267,57484,e=>{"use strict";var t=e.i(20314),r=e.i(31777);function a({className:e,...a}){return(0,t.jsx)("textarea",{"data-slot":"textarea",className:(0,r.cn)("placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input field-sizing-content min-h-[80px] w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...a})}e.s(["Textarea",()=>a],48306);var s=e.i(15506);e.s(["Loader2Icon",()=>s.default],64764);var o=e.i(95230);e.s(["DownloadIcon",()=>o.default],80436);var i=e.i(3645);let n=(0,i.default)("sticky-note",[["path",{d:"M21 9a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 15 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2z",key:"1dfntj"}],["path",{d:"M15 3v5a1 1 0 0 0 1 1h5",key:"6s6qgf"}]]);e.s(["StickyNoteIcon",()=>n],17087);var l=e.i(1693);e.s(["VisuallyHidden",0,l],28267);let d=(0,i.default)("file",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]]);e.s(["FileIcon",()=>d],57484)},50032,86254,42076,e=>{"use strict";var t=e.i(20314),r=e.i(60253),a=e.i(64764),s=e.i(80436),o=e.i(17087),i=e.i(31777),n=e.i(2287),l=e.i(48306),d=e.i(2828),c=e.i(28267),p=e.i(57484),u=e.i(16298),u=u;let h=(0,e.i(3645).default)("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);var m=e.i(93752),m=m;e.i(35364);let x=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".ico",".bmp"]),f=new Set([".ts",".tsx",".js",".jsx",".json",".yaml",".yml",".xml",".html",".css",".md"]);function g(e){if(0===e)return"0 B";let t=Math.floor(Math.log(e)/Math.log(1024));return`${(e/Math.pow(1024,t)).toFixed(+(0!==t))} ${["B","KB","MB","GB"][t]}`}let b=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".ico",".bmp"]);function v(e,t){let r=new URLSearchParams({path:e,mimeType:t});return`/api/attachments/preview?${r.toString()}`}function j({name:e,size:j,mimeType:w,path:y,onRemove:C,loading:k=!1,disabled:N=!1,notes:T,onNotesChange:P}){let S,R,F=(S=e.lastIndexOf("."))>=0?e.slice(S).toLowerCase():"",A=x.has(F)?h:".pdf"===F?u.default:f.has(F)?m.default:p.FileIcon,E=".pdf"===F?"bg-red-50 text-red-600":x.has(F)?"bg-blue-50 text-blue-600":f.has(F)?"bg-emerald-50 text-emerald-600":"bg-gray-50 text-gray-600",D=(R=e.lastIndexOf("."))>=0&&b.has(e.slice(R).toLowerCase());if(k)return(0,t.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-md border",children:(0,t.jsx)(a.Loader2Icon,{className:"text-muted-foreground h-5 w-5 animate-spin"})});if(D){let a=(0,t.jsxs)("button",{type:"button",className:"relative block cursor-pointer rounded-md",children:[(0,t.jsx)("img",{src:v(y,w),alt:e,title:e,className:"h-12 w-12 rounded-md border object-cover transition-opacity hover:opacity-80"}),T?(0,t.jsx)("span",{className:"ring-background absolute -right-1 -bottom-1 flex h-4 w-4 items-center justify-center rounded-full bg-amber-500 text-white shadow-sm ring-2",children:(0,t.jsx)(o.StickyNoteIcon,{className:"h-2.5 w-2.5"})}):null]});return(0,t.jsx)(d.TooltipProvider,{delayDuration:200,children:(0,t.jsxs)(n.Dialog,{children:[(0,t.jsxs)(d.Tooltip,{children:[(0,t.jsxs)("div",{className:"group relative",children:[(0,t.jsx)(d.TooltipTrigger,{asChild:!0,children:(0,t.jsx)(n.DialogTrigger,{asChild:!0,children:a})}),!N&&(0,t.jsx)("button",{type:"button",onClick:C,className:"absolute -top-1.5 -right-1.5 hidden h-5 w-5 cursor-pointer items-center justify-center rounded-full bg-black/70 text-white group-hover:flex","aria-label":`Remove ${e}`,children:(0,t.jsx)(r.X,{className:"h-3 w-3"})})]}),T?(0,t.jsx)(d.TooltipContent,{side:"bottom",className:"max-w-[220px] border border-amber-200 bg-amber-50 text-amber-950 dark:border-amber-800 dark:bg-amber-950 dark:text-amber-100",children:(0,t.jsx)("p",{className:"line-clamp-3 text-xs leading-snug",children:T})}):null]}),(0,t.jsxs)(n.DialogContent,{className:"max-w-3xl gap-0 overflow-hidden border-0 p-0 [&>button:last-child]:!cursor-pointer [&>button:last-child]:!rounded-full [&>button:last-child]:!bg-black/70 [&>button:last-child]:!p-1.5 [&>button:last-child]:!text-white [&>button:last-child]:!opacity-100 [&>button:last-child]:!shadow-lg [&>button:last-child]:!backdrop-blur-md [&>button:last-child]:hover:!bg-black/90",children:[(0,t.jsx)(c.VisuallyHidden.Root,{children:(0,t.jsxs)(n.DialogTitle,{children:["Preview: ",e]})}),(0,t.jsx)("div",{className:"relative bg-black/90",children:(0,t.jsx)("img",{src:v(y,w),alt:e,className:"h-auto max-h-[70vh] w-full object-contain"})}),(0,t.jsxs)("div",{className:"bg-background flex flex-col gap-2 px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,t.jsx)("span",{className:"truncate text-sm font-medium",children:e}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:g(j)})]}),(0,t.jsx)("a",{href:v(y,w),download:e,className:"text-muted-foreground hover:text-foreground shrink-0 cursor-pointer rounded p-1.5 transition-colors","aria-label":`Download ${e}`,children:(0,t.jsx)(s.DownloadIcon,{className:"h-4 w-4"})})]}),P?(0,t.jsx)(l.Textarea,{placeholder:"Add notes about this image…",value:T??"",onChange:e=>P(e.target.value),rows:2,className:"resize-none text-sm","aria-label":"Image notes"}):T?(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:T}):null]})]})]})})}return(0,t.jsxs)("div",{className:"group relative flex items-center gap-2 rounded-full border py-1 pr-3 pl-2",children:[(0,t.jsx)("div",{className:(0,i.cn)("flex h-6 w-6 shrink-0 items-center justify-center rounded-full",E),children:(0,t.jsx)(A,{className:"h-3 w-3"})}),(0,t.jsx)("span",{className:"max-w-[120px] truncate text-sm",children:e}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:g(j)}),!N&&(0,t.jsx)("button",{type:"button",onClick:C,className:"absolute -top-1.5 -right-1.5 hidden h-5 w-5 cursor-pointer items-center justify-center rounded-full bg-black/70 text-white group-hover:flex","aria-label":`Remove ${e}`,children:(0,t.jsx)(r.X,{className:"h-3 w-3"})})]})}async function w(){let e=await fetch("/api/dialog/pick-files",{method:"POST"});if(!e.ok)throw Error("Failed to open file dialog");let t=await e.json();return t.cancelled?null:t.files}e.s(["AttachmentChip",()=>j],86254),e.s([],50032),e.s(["pickFiles",()=>w],42076)},90382,e=>{"use strict";var t=e.i(20314),r=e.i(79054),a=e.i(91967),s=e.i(5978),o=e.i(22528),i=e.i(53532),n=e.i(41687),l=e.i(56720),d=e.i(13123),c=e.i(52740),p=e.i(39979),u=e.i(85995),h=e.i(87620),m=e.i(86874),x=e.i(36589),f=e.i(73772),g=e.i(13044),b="Popover",[v,j]=(0,o.createContextScope)(b,[c.createPopperScope]),w=(0,c.createPopperScope)(),[y,C]=v(b),k=e=>{let{__scopePopover:a,children:s,open:o,defaultOpen:i,onOpenChange:n,modal:l=!1}=e,p=w(a),u=r.useRef(null),[h,m]=r.useState(!1),[f,g]=(0,x.useControllableState)({prop:o,defaultProp:i??!1,onChange:n,caller:b});return(0,t.jsx)(c.Root,{...p,children:(0,t.jsx)(y,{scope:a,contentId:(0,d.useId)(),triggerRef:u,open:f,onOpenChange:g,onOpenToggle:r.useCallback(()=>g(e=>!e),[g]),hasCustomAnchor:h,onCustomAnchorAdd:r.useCallback(()=>m(!0),[]),onCustomAnchorRemove:r.useCallback(()=>m(!1),[]),modal:l,children:s})})};k.displayName=b;var N="PopoverAnchor",T=r.forwardRef((e,a)=>{let{__scopePopover:s,...o}=e,i=C(N,s),n=w(s),{onCustomAnchorAdd:l,onCustomAnchorRemove:d}=i;return r.useEffect(()=>(l(),()=>d()),[l,d]),(0,t.jsx)(c.Anchor,{...n,...o,ref:a})});T.displayName=N;var P="PopoverTrigger",S=r.forwardRef((e,r)=>{let{__scopePopover:o,...i}=e,n=C(P,o),l=w(o),d=(0,s.useComposedRefs)(r,n.triggerRef),p=(0,t.jsx)(h.Primitive.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":$(n.open),...i,ref:d,onClick:(0,a.composeEventHandlers)(e.onClick,n.onOpenToggle)});return n.hasCustomAnchor?p:(0,t.jsx)(c.Anchor,{asChild:!0,...l,children:p})});S.displayName=P;var R="PopoverPortal",[F,A]=v(R,{forceMount:void 0}),E=e=>{let{__scopePopover:r,forceMount:a,children:s,container:o}=e,i=C(R,r);return(0,t.jsx)(F,{scope:r,forceMount:a,children:(0,t.jsx)(u.Presence,{present:a||i.open,children:(0,t.jsx)(p.Portal,{asChild:!0,container:o,children:s})})})};E.displayName=R;var D="PopoverContent",I=r.forwardRef((e,r)=>{let a=A(D,e.__scopePopover),{forceMount:s=a.forceMount,...o}=e,i=C(D,e.__scopePopover);return(0,t.jsx)(u.Presence,{present:s||i.open,children:i.modal?(0,t.jsx)(M,{...o,ref:r}):(0,t.jsx)(O,{...o,ref:r})})});I.displayName=D;var z=(0,m.createSlot)("PopoverContent.RemoveScroll"),M=r.forwardRef((e,o)=>{let i=C(D,e.__scopePopover),n=r.useRef(null),l=(0,s.useComposedRefs)(o,n),d=r.useRef(!1);return r.useEffect(()=>{let e=n.current;if(e)return(0,f.hideOthers)(e)},[]),(0,t.jsx)(g.RemoveScroll,{as:z,allowPinchZoom:!0,children:(0,t.jsx)(L,{...e,ref:l,trapFocus:i.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,a.composeEventHandlers)(e.onCloseAutoFocus,e=>{e.preventDefault(),d.current||i.triggerRef.current?.focus()}),onPointerDownOutside:(0,a.composeEventHandlers)(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;d.current=2===t.button||r},{checkForDefaultPrevented:!1}),onFocusOutside:(0,a.composeEventHandlers)(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),O=r.forwardRef((e,a)=>{let s=C(D,e.__scopePopover),o=r.useRef(!1),i=r.useRef(!1);return(0,t.jsx)(L,{...e,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(o.current||s.triggerRef.current?.focus(),t.preventDefault()),o.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(o.current=!0,"pointerdown"===t.detail.originalEvent.type&&(i.current=!0));let r=t.target;s.triggerRef.current?.contains(r)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&i.current&&t.preventDefault()}})}),L=r.forwardRef((e,r)=>{let{__scopePopover:a,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:d,disableOutsidePointerEvents:p,onEscapeKeyDown:u,onPointerDownOutside:h,onFocusOutside:m,onInteractOutside:x,...f}=e,g=C(D,a),b=w(a);return(0,n.useFocusGuards)(),(0,t.jsx)(l.FocusScope,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:o,onUnmountAutoFocus:d,children:(0,t.jsx)(i.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:p,onInteractOutside:x,onEscapeKeyDown:u,onPointerDownOutside:h,onFocusOutside:m,onDismiss:()=>g.onOpenChange(!1),children:(0,t.jsx)(c.Content,{"data-state":$(g.open),role:"dialog",id:g.contentId,...b,...f,ref:r,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),U="PopoverClose",B=r.forwardRef((e,r)=>{let{__scopePopover:s,...o}=e,i=C(U,s);return(0,t.jsx)(h.Primitive.button,{type:"button",...o,ref:r,onClick:(0,a.composeEventHandlers)(e.onClick,()=>i.onOpenChange(!1))})});B.displayName=U;var H=r.forwardRef((e,r)=>{let{__scopePopover:a,...s}=e,o=w(a);return(0,t.jsx)(c.Arrow,{...o,...s,ref:r})});function $(e){return e?"open":"closed"}H.displayName="PopoverArrow",e.s(["Anchor",()=>T,"Arrow",()=>H,"Close",()=>B,"Content",()=>I,"Popover",()=>k,"PopoverAnchor",()=>T,"PopoverArrow",()=>H,"PopoverClose",()=>B,"PopoverContent",()=>I,"PopoverPortal",()=>E,"PopoverTrigger",()=>S,"Portal",()=>E,"Root",()=>k,"Trigger",()=>S,"createPopoverScope",()=>j],89920);var q=e.i(89920),q=q,G=e.i(31777);let V=q.Root,_=q.Trigger;q.Anchor;let K=r.forwardRef(({className:e,align:r="center",sideOffset:a=4,...s},o)=>(0,t.jsx)(q.Portal,{children:(0,t.jsx)(q.Content,{ref:o,align:r,sideOffset:a,className:(0,G.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 rounded-md border p-4 shadow-md outline-none",e),...s})}));K.displayName=q.Content.displayName,e.s(["Popover",()=>V,"PopoverContent",()=>K,"PopoverTrigger",()=>_],90382)},83843,e=>{"use strict";let t=(0,e.i(3645).default)("chevrons-up-down",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);e.s(["ChevronsUpDown",()=>t],83843)},51911,41413,e=>{"use strict";var t=e.i(20314),r=e.i(79054),a=e.i(91967),s=e.i(5978),o=e.i(22528),i=e.i(36589),n=e.i(23405),l=e.i(77624),d=e.i(87620),c="Switch",[p,u]=(0,o.createContextScope)(c),[h,m]=p(c),x=r.forwardRef((e,o)=>{let{__scopeSwitch:n,name:l,checked:p,defaultChecked:u,required:m,disabled:x,value:f="on",onCheckedChange:g,form:j,...w}=e,[y,C]=r.useState(null),k=(0,s.useComposedRefs)(o,e=>C(e)),N=r.useRef(!1),T=!y||j||!!y.closest("form"),[P,S]=(0,i.useControllableState)({prop:p,defaultProp:u??!1,onChange:g,caller:c});return(0,t.jsxs)(h,{scope:n,checked:P,disabled:x,children:[(0,t.jsx)(d.Primitive.button,{type:"button",role:"switch","aria-checked":P,"aria-required":m,"data-state":v(P),"data-disabled":x?"":void 0,disabled:x,value:f,...w,ref:k,onClick:(0,a.composeEventHandlers)(e.onClick,e=>{S(e=>!e),T&&(N.current=e.isPropagationStopped(),N.current||e.stopPropagation())})}),T&&(0,t.jsx)(b,{control:y,bubbles:!N.current,name:l,value:f,checked:P,required:m,disabled:x,form:j,style:{transform:"translateX(-100%)"}})]})});x.displayName=c;var f="SwitchThumb",g=r.forwardRef((e,r)=>{let{__scopeSwitch:a,...s}=e,o=m(f,a);return(0,t.jsx)(d.Primitive.span,{"data-state":v(o.checked),"data-disabled":o.disabled?"":void 0,...s,ref:r})});g.displayName=f;var b=r.forwardRef(({__scopeSwitch:e,control:a,checked:o,bubbles:i=!0,...d},c)=>{let p=r.useRef(null),u=(0,s.useComposedRefs)(p,c),h=(0,n.usePrevious)(o),m=(0,l.useSize)(a);return r.useEffect(()=>{let e=p.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(h!==o&&t){let r=new Event("click",{bubbles:i});t.call(e,o),e.dispatchEvent(r)}},[h,o,i]),(0,t.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:o,...d,tabIndex:-1,ref:u,style:{...d.style,...m,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function v(e){return e?"checked":"unchecked"}b.displayName="SwitchBubbleInput",e.s(["Root",()=>x,"Switch",()=>x,"SwitchThumb",()=>g,"Thumb",()=>g,"createSwitchScope",()=>u],95291);var j=e.i(95291),j=j,w=e.i(31777);function y({className:e,size:r="default",...a}){return(0,t.jsx)(j.Root,{"data-slot":"switch","data-size":r,className:(0,w.cn)("peer group/switch focus-visible:border-ring focus-visible:ring-ring/50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input dark:data-[state=unchecked]:bg-input/80 inline-flex shrink-0 cursor-pointer items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-[1.15rem] data-[size=default]:w-8 data-[size=sm]:h-3.5 data-[size=sm]:w-6",e),...a,children:(0,t.jsx)(j.Thumb,{"data-slot":"switch-thumb",className:(0,w.cn)("bg-background dark:data-[state=checked]:bg-primary-foreground dark:data-[state=unchecked]:bg-foreground pointer-events-none block rounded-full ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}e.s(["Switch",()=>y],51911);var C=e.i(23925),k=e.i(11345),N=e.i(76016),T=e.i(66123),P=e.i(41249),S=e.i(86782),R=e.i(29847),F=e.i(35364),A=e.i(90382);function E({initialAgentType:e,initialModel:a,onAgentModelChange:s,disabled:o,className:i,mode:n}){let[l,d]=r.useState(!1),[c,p]=r.useState([]),[u,h]=r.useState(!0),[m,x]=r.useState(e),[f,g]=r.useState(a),[b,v]=r.useState(null),[j,y]=r.useState(0),[E,D]=r.useState(null);r.useEffect(()=>{(0,T.getAllAgentModels)().then(p).finally(()=>h(!1))},[]),r.useEffect(()=>{if(!l){let e=setTimeout(()=>{y(0),D(null)},150);return()=>clearTimeout(e)}},[l]);let I=async(e,t)=>{if(d(!1),e!==m||t!==f){if("override"===n){x(e),g(t),s?.(e,t);return}x(e),g(t),s?.(e,t),v(null);try{let r=await (0,P.updateAgentAndModel)(e,t||null);r.ok||(x(m),g(f),s?.(m,f),v(r.error??"Failed to save"))}catch{x(m),g(f),s?.(m,f),v("Failed to save")}}},z=(0,S.getAgentTypeIcon)(m),M=c.find(e=>e.agentType===m)?.label??m,O=f?(0,R.getModelMeta)(f).displayName||f:null,L=E?c.find(e=>e.agentType===E):null;return(0,t.jsxs)("div",{className:(0,w.cn)("flex flex-col gap-1",i),children:[(0,t.jsxs)(A.Popover,{open:l,onOpenChange:d,children:[(0,t.jsx)(A.PopoverTrigger,{asChild:!0,children:(0,t.jsx)(F.Button,{variant:"outline",role:"combobox","aria-expanded":l,disabled:(o??!1)||u,className:"w-auto cursor-pointer justify-start font-normal hover:border-violet-300 hover:bg-violet-50/50 dark:hover:border-violet-700 dark:hover:bg-violet-950/30",children:(0,t.jsxs)("span",{className:"flex items-center gap-2 truncate",children:[(0,t.jsx)(z,{className:"h-4 w-4 shrink-0"}),u?"Loading…":(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:M}),O?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-muted-foreground/50 text-xs",children:"·"}),(0,t.jsx)("span",{className:"text-xs font-medium",children:O})]}):null]})]})})}),(0,t.jsx)(A.PopoverContent,{className:"w-(--radix-popover-trigger-width) overflow-hidden p-0",align:"start",children:(0,t.jsxs)("div",{className:"flex transition-transform duration-200 ease-in-out",style:{transform:`translateX(${1===j?"-50%":"0%"})`,width:"200%"},children:[(0,t.jsxs)("div",{className:"w-1/2 shrink-0",children:[(0,t.jsx)("div",{className:"text-muted-foreground border-b px-3 py-2 text-xs font-medium",children:"Select agent"}),c.map(e=>{let r=(0,S.getAgentTypeIcon)(e.agentType),a=m===e.agentType,s=e.models.length>0;return(0,t.jsxs)("button",{type:"button",className:(0,w.cn)("flex w-full cursor-pointer items-center gap-2.5 px-3 py-2 text-xs transition-colors","hover:bg-accent hover:text-accent-foreground",a&&"bg-accent/50"),onClick:()=>{s?(D(e.agentType),requestAnimationFrame(()=>{requestAnimationFrame(()=>y(1))})):I(e.agentType,"")},children:[(0,t.jsx)(r,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{className:"flex-1 text-left",children:e.label}),a&&!s?(0,t.jsx)(C.Check,{className:"text-primary h-3.5 w-3.5 shrink-0"}):null,s?(0,t.jsx)(N.ChevronRight,{className:"text-muted-foreground h-3.5 w-3.5 shrink-0"}):null]},e.agentType)})]}),(0,t.jsx)("div",{className:"w-1/2 shrink-0",children:L?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{type:"button",className:"text-muted-foreground hover:text-foreground flex w-full cursor-pointer items-center gap-1.5 border-b px-3 py-2 text-xs font-medium transition-colors",onClick:()=>{y(0),setTimeout(()=>D(null),220)},children:[(0,t.jsx)(k.ChevronLeft,{className:"h-3.5 w-3.5"}),L.label]}),L.models.map(e=>{let r=m===L.agentType&&f===e.id;return(0,t.jsxs)("button",{type:"button",className:(0,w.cn)("flex w-full cursor-pointer items-center gap-3 px-3 py-2 text-left transition-colors","hover:bg-accent hover:text-accent-foreground",r&&"bg-accent/50"),onClick:()=>I(L.agentType,e.id),children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,t.jsx)("span",{className:"text-xs font-medium",children:e.displayName}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:e.description})]}),r?(0,t.jsx)(C.Check,{className:"text-primary h-3.5 w-3.5 shrink-0"}):null]},e.id)})]}):null})]})})]}),!!b&&(0,t.jsx)("p",{className:"text-destructive text-sm",children:b})]})}e.s(["AgentModelPicker",()=>E],41413)},15203,e=>{"use strict";var t=e.i(20314),r=e.i(79054),a=e.i(31406),s=e.i(60112),o=e.i(21023);let i=(0,o.createServerReference)("409213e5fb6042ead5df899374f8991a2bccab9b64",o.callServer,void 0,o.findSourceMapURL,"createFeature");var n=e.i(16868),l=e.i(83843),d=e.i(97667),c=e.i(53360),p=e.i(55016),u=e.i(91925),h=e.i(83428);let m=(0,e.i(3645).default)("git-fork",[["circle",{cx:"12",cy:"18",r:"3",key:"1mpf1b"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["path",{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9",key:"1uq4wg"}],["path",{d:"M12 12v3",key:"158kv8"}]]);var x=e.i(70471),f=e.i(31777),g=e.i(8361);e.i(1650);var b=e.i(11495),v=e.i(45811),j=e.i(35364),w=e.i(98127),y=e.i(48306),C=e.i(41957),k=e.i(81846),N=e.i(90382),T=e.i(51911),P=e.i(2828),S=e.i(30153);e.i(50032);var R=e.i(86254),F=e.i(41413),A=e.i(25235),E=e.i(78521);e.i(13322);var D=e.i(61201),I=e.i(75921),z=e.i(51519),M=e.i(42076);let O=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"]),L=[{id:"allowPrd",label:"PRD",description:"Auto-approve requirements move to planning."},{id:"allowPlan",label:"Plan",description:"Auto-approve planning move to implementation."},{id:"allowMerge",label:"Merge",description:"Auto-approve merge move to Done."}],U={allowPrd:!1,allowPlan:!1,allowMerge:!1};function B({open:e,onClose:a,onSubmit:s,repositoryPath:o,isSubmitting:i=!1,workflowDefaults:l,features:d,repositories:u,initialParentId:h,currentAgentType:w,currentModel:N,initialDescription:A}){let E=(0,g.useSoundAction)("create"),D=o&&(!u||0===u.length||u.some(e=>e.path===o))?o:"",I=l?.approvalGates??U,z=l?.push??!1,B=l?.openPr??!1,q=l?.ciWatchEnabled!==!1,G=l?.enableEvidence??!1,V=l?.commitEvidence??!1,[_,K]=(0,r.useState)(A??"");(0,r.useEffect)(()=>{A&&K(A)},[A]);let[W,X]=(0,r.useState)([]),[Y,Z]=(0,r.useState)({...I}),[J,Q]=(0,r.useState)(z),[ee,et]=(0,r.useState)(B),[er,ea]=(0,r.useState)(l?.ciWatchEnabled!==!1),[es,eo]=(0,r.useState)(G),[ei,en]=(0,r.useState)(V),[el,ed]=(0,r.useState)(void 0),[ec,ep]=(0,r.useState)(!1),[eu,eh]=(0,r.useState)(!1),[em,ex]=(0,r.useState)(!1),[ef,eg]=(0,r.useState)(!0),[eb,ev]=(0,r.useState)(void 0),[ej,ew]=(0,r.useState)(void 0),[ey,eC]=(0,r.useState)(D||void 0),[ek,eN]=(0,r.useState)(u??[]),[eT,eP]=(0,r.useState)(!1),[eS,eR]=(0,r.useState)(null),[eF,eA]=(0,r.useState)(!1),eE=(0,r.useRef)(crypto.randomUUID()),eD=(0,r.useRef)(0),eI=(0,r.useRef)(null);(0,r.useEffect)(()=>{l&&(Z({...l.approvalGates}),Q(l.push),et(l.openPr),ea(!1!==l.ciWatchEnabled),eo(l.enableEvidence),en(l.commitEvidence))},[l]),(0,r.useEffect)(()=>{eN(u??[])},[u]),(0,r.useEffect)(()=>{e&&h&&ed(h)},[e,h]);let ez=(0,r.useCallback)(()=>{K(""),X([]),Z({...I}),Q(z),et(B),ea(q),eo(G),en(V),ed(void 0),eC(D||void 0),eN(u??[]),ep(!1),eh(!1),ex(!1),eg(!0),ev(void 0),ew(void 0),eR(null),eD.current=0,eP(!1)},[I,z,B,G,q,V,D,u]),eM=""!==_.trim()||W.length>0,{attemptClose:eO}=(0,S.useGuardedDrawerClose)({open:e,isDirty:eM,onClose:a,onReset:ez}),eL=(0,r.useCallback)(async e=>{for(let t of(eR(null),e)){if(t.size>0xa00000)return void eR(`"${t.name}" exceeds 10 MB limit`);let e=function(e){let t=e.lastIndexOf(".");return t>=0?e.slice(t).toLowerCase():""}(t.name);if(e&&!O.has(e))return void eR(`File type "${e}" is not allowed`)}for(let t of e){let e=crypto.randomUUID();X(r=>[...r,{id:e,name:t.name,size:t.size,mimeType:t.type||"application/octet-stream",path:"",loading:!0}]);try{let r=new FormData;r.append("file",t),r.append("sessionId",eE.current);let a=await fetch("/api/attachments/upload",{method:"POST",body:r});if(!a.ok){let t=await a.json().catch(()=>({error:"Upload failed"}));X(t=>t.filter(t=>t.id!==e)),eR(t.error??"Upload failed");return}let s=await a.json();X(t=>t.some(t=>t.id!==e&&t.path===s.path)?t.filter(t=>t.id!==e):t.map(t=>t.id===e?{...s,id:e,loading:!1}:t))}catch{X(t=>t.filter(t=>t.id!==e)),eR("Upload failed")}}},[]),eU=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),eD.current+=1,1===eD.current&&eP(!0)},[]),eB=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),eD.current-=1,0===eD.current&&eP(!1)},[]),eH=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation()},[]),e$=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),eD.current=0,eP(!1);let t=Array.from(e.dataTransfer.files);t.length>0&&eL(t)},[eL]),eq=(0,r.useCallback)(e=>{let t=e.clipboardData?.items;if(!t)return;let r=[];for(let e of Array.from(t))if("file"===e.kind){let t=e.getAsFile();t&&r.push(t)}r.length>0&&(e.preventDefault(),eL(r))},[eL]),eG=(0,r.useCallback)(e=>{if(e.preventDefault(),!_.trim())return;let t=ey??D;t&&(E.play(),s({description:_.trim(),attachments:W.filter(e=>!e.loading),repositoryPath:t,approvalGates:{allowPrd:Y.allowPrd??!1,allowPlan:Y.allowPlan??!1,allowMerge:Y.allowMerge??!1},push:!!em||J||ee,openPr:!!em||ee,ciWatchEnabled:er,enableEvidence:es,commitEvidence:ei,fast:ec,forkAndPr:em,commitSpecs:ef,...eu?{pending:eu}:{},...eb?{agentType:eb}:{},...ej?{model:ej}:{},...el?{parentId:el}:{},sessionId:eE.current}),ez())},[_,W,Y,ey,D,s,J,ee,es,er,ei,ec,em,ef,eu,eb,ej,el,E,ez]),eV=(0,r.useCallback)(async()=>{try{let e=await (0,M.pickFiles)();if(!e)return;for(let t of e){let e=crypto.randomUUID();X(r=>[...r,{id:e,name:t.name,size:t.size,mimeType:"application/octet-stream",path:"",loading:!0}]);try{let r=await fetch("/api/attachments/upload-from-path",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:t.path,sessionId:eE.current})});if(!r.ok){let t=await r.json().catch(()=>({error:"Upload failed"}));X(t=>t.filter(t=>t.id!==e)),eR(t.error??"Upload failed");return}let a=await r.json();X(t=>t.some(t=>t.id!==e&&t.path===a.path)?t.filter(t=>t.id!==e):t.map(t=>t.id===e?{...a,id:e,loading:!1}:t))}catch{X(t=>t.filter(t=>t.id!==e)),eR("Upload failed")}}}catch{}},[]),e_=(0,r.useCallback)(e=>{X(t=>t.filter(t=>t.id!==e))},[]),eK=(0,r.useCallback)((e,t)=>{X(r=>r.map(r=>r.id===e?{...r,notes:t}:r))},[]),eW=(0,r.useRef)(null),eX=(0,r.useCallback)(e=>{(e.ctrlKey||e.metaKey)&&"Enter"===e.key&&(e.preventDefault(),eW.current?.requestSubmit())},[]),eY=(0,r.useCallback)(()=>{eA(!0)},[]),eZ=(0,r.useCallback)(()=>{setTimeout(()=>{let e=eI.current?.contains(document.activeElement),t=eI.current?.querySelector('[aria-expanded="true"]')!==null;e||t||eA(!1)},0)},[]),eJ=d&&d.length>0,eQ=!D&&!ey,e0=!D&&void 0!==u;return(0,t.jsx)(b.BaseDrawer,{open:e,onClose:eO,size:"md",modal:!1,dismissOnOutsideClick:!0,"data-testid":"feature-create-drawer",header:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"h-2.5 w-2.5 shrink-0 rounded-full bg-blue-500"}),(0,t.jsx)(v.DrawerTitle,{children:"NEW FEATURE"})]}),i?(0,t.jsx)(v.DrawerDescription,{asChild:!0,children:(0,t.jsx)("div",{children:(0,t.jsx)(k.Badge,{variant:"secondary",children:"Creating..."})})}):null]}),footer:(0,t.jsxs)("div",{className:"flex flex-row justify-end gap-2",children:[(0,t.jsx)(j.Button,{variant:"outline",onClick:eO,disabled:i,children:"Cancel"}),(0,t.jsx)(j.Button,{type:"submit",form:"create-feature-form",disabled:!_.trim()||i||eQ,children:i?"Creating...":"+ Create Feature"})]}),children:(0,t.jsx)("div",{className:"overflow-y-auto p-4",children:(0,t.jsx)(P.TooltipProvider,{delayDuration:400,children:(0,t.jsxs)("form",{ref:eW,id:"create-feature-form",onSubmit:eG,onKeyDown:eX,className:"flex flex-col gap-4",children:[e0?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"repo-selector-section",children:[(0,t.jsx)(C.Label,{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"REPOSITORY"}),(0,t.jsx)($,{repositories:ek,value:ey,onChange:eC,onAddRepository:e=>{eN(t=>[...t,e]),eC(e.path)},disabled:i})]}):D?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"repo-readonly-section",children:[(0,t.jsx)(C.Label,{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"REPOSITORY"}),(0,t.jsx)("p",{className:"text-sm","data-testid":"repo-readonly-label",children:u?.find(e=>e.path===D)?.name??D.split("/").pop()})]}):null,(0,t.jsxs)("div",{role:"region","aria-label":"File drop zone","data-drag-over":eT?"true":"false",onDragEnter:eU,onDragLeave:eB,onDragOver:eH,onDrop:e$,className:(0,f.cn)("flex flex-col gap-1.5 rounded-md border-2 border-transparent p-1 transition-colors",eT&&"border-primary/50 bg-primary/5"),children:[(0,t.jsx)(C.Label,{htmlFor:"feature-description",className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"DESCRIBE YOUR FEATURE"}),(0,t.jsxs)("div",{ref:eI,onFocus:eY,onBlur:eZ,className:(0,f.cn)("border-input flex h-56 flex-col overflow-hidden rounded-md border shadow-xs transition-[color,box-shadow]",eF&&"ring-ring/50 border-ring ring-[3px]"),children:[(0,t.jsx)(y.Textarea,{id:"feature-description",placeholder:"e.g. Add GitHub OAuth login with callback handling and token refresh...",value:_,onChange:e=>K(e.target.value),onPaste:eq,required:!0,disabled:i,className:"min-h-0 flex-1 resize-none rounded-none border-0 shadow-none focus-visible:ring-0"}),W.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-1.5 px-3 py-2",children:W.map(e=>(0,t.jsx)(R.AttachmentChip,{name:e.name,size:e.size,mimeType:e.mimeType,path:e.path,onRemove:()=>e_(e.id),disabled:i,loading:e.loading,notes:e.notes,onNotesChange:t=>eK(e.id,t)},e.id))}),eS?(0,t.jsx)("p",{className:"text-destructive px-3 pb-2 text-xs",children:eS}):null,(0,t.jsxs)("div",{className:"border-input flex items-center gap-3 border-t px-3 py-1.5",children:[(0,t.jsx)(F.AgentModelPicker,{initialAgentType:eb??w??"claude-code",initialModel:ej??N??"claude-sonnet-4-6",mode:"override",onAgentModelChange:(e,t)=>{ev(e),ew(t)},disabled:i,className:"w-55"}),(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"ml-auto flex cursor-pointer items-center gap-2",children:[(0,t.jsx)(T.Switch,{id:"pending-mode",checked:eu,onCheckedChange:eh,disabled:i}),(0,t.jsxs)(C.Label,{htmlFor:"pending-mode",className:"flex cursor-pointer items-center gap-1 text-sm font-medium",children:[(0,t.jsx)(p.Clock,{className:"h-3.5 w-3.5"}),"Pending"]})]})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",children:"Create without starting — start manually later."})]}),(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-2",children:[(0,t.jsx)(T.Switch,{id:"fast-mode",checked:ec,onCheckedChange:ep,disabled:i}),(0,t.jsxs)(C.Label,{htmlFor:"fast-mode",className:"flex cursor-pointer items-center gap-1 text-sm font-medium",children:[(0,t.jsx)(c.Zap,{className:"h-3.5 w-3.5"}),"Fast Mode"]})]})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",children:"Skip SDLC phases and implement directly from your prompt."})]}),(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",onClick:eV,disabled:i,"aria-label":"Attach files",className:"text-muted-foreground hover:text-foreground cursor-pointer rounded p-1 transition-colors",children:(0,t.jsx)(n.PaperclipIcon,{className:"h-4 w-4"})})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",children:"Attach files"})]})]})]})]}),eJ&&void 0!==h?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)(C.Label,{htmlFor:"parent-feature",className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"PARENT FEATURE"}),(0,t.jsx)(H,{features:d,value:el,onChange:ed,disabled:i})]}):null,(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsxs)("div",{className:"border-input flex items-center gap-4 rounded-md border px-3 py-2.5",children:[(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 cursor-default text-xs font-semibold tracking-wider",children:"APPROVE"})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",children:"Auto-approve phase transitions without manual review."})]}),(0,t.jsx)("div",{className:"flex flex-1 items-center gap-4",children:L.map(e=>(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(T.Switch,{id:`approve-${e.id}`,size:"sm",checked:Y[e.id]??!1,onCheckedChange:t=>Z(r=>({...r,[e.id]:t})),disabled:i||ec&&("allowPrd"===e.id||"allowPlan"===e.id)}),(0,t.jsx)(C.Label,{htmlFor:`approve-${e.id}`,className:"cursor-pointer text-xs font-medium",children:e.label})]})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",children:ec&&("allowPrd"===e.id||"allowPlan"===e.id)?"Skipped in Fast Mode":e.description})]},e.id))}),(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",onClick:()=>{let e=L.every(e=>Y[e.id]),t={};for(let r of L)t[r.id]=!e;Z(t)},disabled:i,className:(0,f.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",L.every(e=>Y[e.id])&&"text-primary"),children:"All"})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",children:"Toggle all approval gates"})]})]}),(0,t.jsxs)("div",{className:"border-input flex items-center gap-4 rounded-md border px-3 py-2.5",children:[(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 cursor-default text-xs font-semibold tracking-wider",children:"EVIDENCE"})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",children:"Collect and attach evidence after implementation."})]}),(0,t.jsxs)("div",{className:"flex flex-1 items-center gap-4",children:[(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(T.Switch,{id:"enable-evidence",size:"sm",checked:es,onCheckedChange:e=>{eo(e),e||en(!1)},disabled:i}),(0,t.jsx)(C.Label,{htmlFor:"enable-evidence",className:"cursor-pointer text-xs font-medium",children:"Collect"})]})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",children:"Capture screenshots and artifacts after implementation."})]}),(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(T.Switch,{id:"commit-evidence",size:"sm",checked:ei,onCheckedChange:en,disabled:i||!es||!ee&&!em}),(0,t.jsx)(C.Label,{htmlFor:"commit-evidence",className:(0,f.cn)("cursor-pointer text-xs font-medium",(!es||!ee&&!em)&&"opacity-50"),children:"Add to PR"})]})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",children:ee||em?es?"Include evidence in the pull request body.":"Requires evidence collection to be enabled":"Requires PR to be enabled"})]})]})]}),(0,t.jsxs)("div",{className:"border-input flex items-start gap-4 rounded-md border px-3 py-2.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 pt-0.5 text-xs font-semibold tracking-wider",children:"GIT"}),(0,t.jsxs)("div",{className:"flex flex-1 flex-wrap items-center gap-4",children:[(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(T.Switch,{id:"push",size:"sm",checked:!!em||J||ee,onCheckedChange:e=>{Q(e),!e&&ee&&et(!1)},disabled:i||em}),(0,t.jsx)(C.Label,{htmlFor:"push",className:(0,f.cn)("cursor-pointer text-xs font-medium",em&&"opacity-50"),children:"Push"})]})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",children:em?"Enabled — contributing to upstream":"Push branch to remote after implementation."})]}),(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(T.Switch,{id:"open-pr",size:"sm",checked:!!em||ee,onCheckedChange:e=>{et(e),e||en(!1)},disabled:i||em}),(0,t.jsx)(C.Label,{htmlFor:"open-pr",className:(0,f.cn)("cursor-pointer text-xs font-medium",em&&"opacity-50"),children:"PR"})]})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",children:em?"Enabled — contributing to upstream":"Open a pull request after pushing."})]}),(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(T.Switch,{id:"ci-watch",size:"sm",checked:er,onCheckedChange:ea,disabled:i}),(0,t.jsx)(C.Label,{htmlFor:"ci-watch",className:"cursor-pointer text-xs font-medium",children:"Watch"})]})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",children:"Watch CI and auto-fix after push."})]}),(0,t.jsx)("div",{className:"bg-border h-4 w-px shrink-0"}),(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(T.Switch,{id:"commit-specs",size:"sm",checked:ef,onCheckedChange:eg,disabled:i}),(0,t.jsxs)(C.Label,{htmlFor:"commit-specs",className:"flex cursor-pointer items-center gap-1 text-xs font-medium",children:[(0,t.jsx)(x.FileText,{className:"h-3 w-3"}),"Commit Specs"]})]})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",children:"Commit specs to repository."})]}),(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(T.Switch,{id:"fork-and-pr",size:"sm",checked:em,onCheckedChange:e=>{ex(e),e&&eg(!1)},disabled:i}),(0,t.jsxs)(C.Label,{htmlFor:"fork-and-pr",className:"flex cursor-pointer items-center gap-1 text-xs font-medium",children:[(0,t.jsx)(m,{className:"h-3 w-3"}),"Fork & PR"]})]})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",children:"Contribute via fork (PR to upstream)."})]})]})]})]})]})})})})}function H({features:e,value:a,onChange:s,disabled:o}){let[i,n]=(0,r.useState)(!1),[c,p]=(0,r.useState)(""),u=(0,r.useRef)(null),h=e.find(e=>e.id===a),m=c.trim()?e.filter(e=>e.name.toLowerCase().includes(c.toLowerCase())||e.id.toLowerCase().includes(c.toLowerCase())):e,x=(0,r.useCallback)(e=>{s(e),n(!1),p("")},[s]);return(0,r.useEffect)(()=>{i?setTimeout(()=>u.current?.focus(),0):p("")},[i]),(0,t.jsxs)(N.Popover,{open:i,onOpenChange:n,children:[(0,t.jsx)(N.PopoverTrigger,{asChild:!0,children:(0,t.jsxs)("button",{id:"parent-feature",type:"button",role:"combobox","aria-expanded":i,"aria-label":"Parent Feature",disabled:o,"data-testid":"parent-feature-combobox",className:(0,f.cn)("border-input bg-background ring-offset-background focus:ring-ring flex h-9 w-full items-center justify-between rounded-md border px-3 py-2 text-sm focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",!h&&"text-muted-foreground"),children:[(0,t.jsx)("span",{className:"truncate",children:h?`${h.name} (${h.id.slice(0,8)})`:"Select parent feature..."}),(0,t.jsx)(l.ChevronsUpDown,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,t.jsx)(N.PopoverContent,{className:"w-80 p-0",align:"start","data-testid":"parent-feature-combobox-content",children:(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("div",{className:"border-b p-2",children:(0,t.jsx)(w.Input,{ref:u,placeholder:"Search features...",value:c,onChange:e=>p(e.target.value),className:"h-8 border-0 p-0 text-sm shadow-none focus-visible:ring-0","data-testid":"parent-feature-search"})}),(0,t.jsxs)("div",{className:"max-h-48 overflow-y-auto py-1",role:"listbox","aria-label":"Features",children:[(0,t.jsxs)("button",{type:"button",role:"option","aria-selected":void 0===a,onClick:()=>x(void 0),className:(0,f.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",void 0===a&&"bg-accent/50"),"data-testid":"parent-feature-option-none",children:[(0,t.jsx)(d.CheckIcon,{className:(0,f.cn)("h-4 w-4 shrink-0",void 0!==a&&"invisible")}),(0,t.jsx)("span",{className:"text-muted-foreground italic",children:"No parent"})]}),0===m.length&&c?(0,t.jsx)("p",{className:"text-muted-foreground px-3 py-2 text-sm",children:"No features found."}):m.map(e=>(0,t.jsxs)("button",{type:"button",role:"option","aria-selected":a===e.id,onClick:()=>x(e.id),className:(0,f.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",a===e.id&&"bg-accent/50"),"data-testid":`parent-feature-option-${e.id}`,children:[(0,t.jsx)(d.CheckIcon,{className:(0,f.cn)("h-4 w-4 shrink-0",a!==e.id&&"invisible")}),(0,t.jsxs)("span",{className:"truncate",children:[e.name," ",(0,t.jsxs)("span",{className:"text-muted-foreground font-mono text-xs",children:["(",e.id.slice(0,8),")"]})]})]},e.id))]})]})})]})}function $({repositories:e,value:a,onChange:s,onAddRepository:o,disabled:i}){let[n,c]=(0,r.useState)(!1),[p,m]=(0,r.useState)(""),[x,g]=(0,r.useState)(!1),[b,v]=(0,r.useState)(null),[j,y]=(0,r.useState)(!1),C=(0,r.useRef)(null),{reactFileManager:k}=(0,I.useFeatureFlags)(),T=e.find(e=>e.path===a),P=p.trim()?e.filter(e=>e.name.toLowerCase().includes(p.toLowerCase())||e.path.toLowerCase().includes(p.toLowerCase())):e,S=(0,r.useCallback)(e=>{s(e),c(!1),m("")},[s]),R=(0,r.useCallback)(async e=>{let t=await (0,z.addRepository)({path:e});if(t.error){v(t.error),g(!1);return}if(t.repository){let e={id:t.repository.id,name:t.repository.name,path:t.repository.path};o?.(e),s(e.path),c(!1),m("")}},[o,s]),F=(0,r.useCallback)(async()=>{if(!x){if(k)return void y(!0);g(!0),v(null);try{let e=await (0,E.pickFolder)();if(!e)return void g(!1);await R(e)}catch{y(!0)}finally{g(!1)}}},[x,k,R]),M=(0,r.useCallback)(async e=>{if(y(!1),e){g(!0),v(null);try{await R(e)}catch(e){v(e instanceof Error?e.message:"Failed to add repository")}finally{g(!1)}}},[R]);return(0,r.useEffect)(()=>{n?setTimeout(()=>C.current?.focus(),0):m("")},[n]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(N.Popover,{open:n,onOpenChange:c,children:[(0,t.jsx)(N.PopoverTrigger,{asChild:!0,children:(0,t.jsxs)("button",{type:"button",role:"combobox","aria-expanded":n,"aria-label":"Repository",disabled:i,"data-testid":"repository-combobox",className:(0,f.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",!T&&"text-muted-foreground"),children:[(0,t.jsx)("span",{className:"truncate",children:T?T.name:"Select repository..."}),(0,t.jsx)(l.ChevronsUpDown,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,t.jsx)(N.PopoverContent,{className:"w-80 p-0",align:"start","data-testid":"repository-combobox-content",children:(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("div",{className:"border-b p-2",children:(0,t.jsx)(w.Input,{ref:C,placeholder:"Search repositories...",value:p,onChange:e=>m(e.target.value),className:"h-8 border-0 p-0 text-sm shadow-none focus-visible:ring-0","data-testid":"repository-search"})}),(0,t.jsx)("div",{className:"max-h-48 overflow-y-auto py-1",role:"listbox","aria-label":"Repositories",children:0===P.length?(0,t.jsx)("p",{className:"text-muted-foreground px-3 py-2 text-sm","data-testid":"repository-empty",children:"No repositories found."}):P.map(e=>(0,t.jsxs)("button",{type:"button",role:"option","aria-selected":a===e.path,onClick:()=>S(e.path),className:(0,f.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",a===e.path&&"bg-accent/50"),"data-testid":`repository-option-${e.id}`,children:[(0,t.jsx)(d.CheckIcon,{className:(0,f.cn)("h-4 w-4 shrink-0",a!==e.path&&"invisible")}),(0,t.jsxs)("span",{className:"flex flex-col items-start truncate",children:[(0,t.jsx)("span",{className:"truncate",children:e.name}),(0,t.jsx)("span",{className:"text-muted-foreground truncate text-xs",children:e.path})]})]},e.id))}),(0,t.jsx)(A.Separator,{}),(0,t.jsxs)("button",{type:"button",onClick:F,disabled:x,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:[x?(0,t.jsx)(h.Loader2,{className:"h-4 w-4 shrink-0 animate-spin"}):(0,t.jsx)(u.FolderPlus,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{children:"Add new repository..."})]}),b?(0,t.jsx)("p",{className:"px-3 pb-2 text-xs text-red-500","data-testid":"add-repository-error",children:b}):null]})})]}),(0,t.jsx)(D.ReactFileManagerDialog,{open:j,onOpenChange:e=>{e||y(!1)},onSelect:M})]})}function q({repositoryPath:e,initialParentId:o,initialDescription:n,features:l,repositories:d,workflowDefaults:c,currentAgentType:p,currentModel:u}){let h=(0,a.useRouter)(),[m,x]=(0,r.useState)(!1),f=(0,a.usePathname)().startsWith("/create"),g=!m&&f;(0,r.useEffect)(()=>{!f&&m&&x(!1)},[f,m]);let b=(0,r.useCallback)(()=>{h.push("/")},[h]),v=(0,r.useCallback)(e=>{x(!0),h.push("/"),i(e).then(t=>{t.error?s.toast.error(t.error):window.dispatchEvent(new CustomEvent("shep:feature-created",{detail:{featureId:t.feature.id,name:t.feature.name,description:t.feature.description,repositoryPath:t.feature.repositoryPath,parentId:e.parentId}}))}).catch(()=>{s.toast.error("Failed to create feature"),x(!1)})},[h]);return(0,t.jsx)(B,{open:g,onClose:b,onSubmit:v,repositoryPath:e,features:l,repositories:d,workflowDefaults:c,initialParentId:o,initialDescription:n,isSubmitting:m,currentAgentType:p,currentModel:u})}e.s(["CreateDrawerClient",()=>q],15203)}]);