@shepai/cli 1.86.0 → 1.86.1

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 (165) hide show
  1. package/dist/src/presentation/web/app/api/attachments/upload-from-path/route.d.ts +3 -0
  2. package/dist/src/presentation/web/app/api/attachments/upload-from-path/route.d.ts.map +1 -0
  3. package/dist/src/presentation/web/app/api/attachments/upload-from-path/route.js +120 -0
  4. package/dist/src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.d.ts.map +1 -1
  5. package/dist/src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.js +38 -13
  6. package/dist/tsconfig.build.tsbuildinfo +1 -1
  7. package/package.json +1 -1
  8. package/web/.next/BUILD_ID +1 -1
  9. package/web/.next/app-path-routes-manifest.json +1 -0
  10. package/web/.next/build-manifest.json +2 -2
  11. package/web/.next/fallback-build-manifest.json +2 -2
  12. package/web/.next/prerender-manifest.json +3 -3
  13. package/web/.next/required-server-files.js +1 -1
  14. package/web/.next/required-server-files.json +1 -1
  15. package/web/.next/routes-manifest.json +6 -0
  16. package/web/.next/server/app/(dashboard)/@drawer/create/page/server-reference-manifest.json +18 -18
  17. package/web/.next/server/app/(dashboard)/@drawer/create/page.js +1 -1
  18. package/web/.next/server/app/(dashboard)/@drawer/create/page.js.nft.json +1 -1
  19. package/web/.next/server/app/(dashboard)/@drawer/create/page_client-reference-manifest.js +1 -1
  20. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/server-reference-manifest.json +21 -21
  21. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js +1 -1
  22. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js.nft.json +1 -1
  23. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page_client-reference-manifest.js +1 -1
  24. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/server-reference-manifest.json +14 -14
  25. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js +1 -1
  26. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js.nft.json +1 -1
  27. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  28. package/web/.next/server/app/(dashboard)/create/page/server-reference-manifest.json +18 -18
  29. package/web/.next/server/app/(dashboard)/create/page.js +1 -1
  30. package/web/.next/server/app/(dashboard)/create/page.js.nft.json +1 -1
  31. package/web/.next/server/app/(dashboard)/create/page_client-reference-manifest.js +1 -1
  32. package/web/.next/server/app/(dashboard)/feature/[featureId]/page/server-reference-manifest.json +21 -21
  33. package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js +1 -1
  34. package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js.nft.json +1 -1
  35. package/web/.next/server/app/(dashboard)/feature/[featureId]/page_client-reference-manifest.js +1 -1
  36. package/web/.next/server/app/(dashboard)/page/server-reference-manifest.json +14 -14
  37. package/web/.next/server/app/(dashboard)/page.js +1 -1
  38. package/web/.next/server/app/(dashboard)/page.js.nft.json +1 -1
  39. package/web/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
  40. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/server-reference-manifest.json +14 -14
  41. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js +1 -1
  42. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js.nft.json +1 -1
  43. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  44. package/web/.next/server/app/_global-error/page.js +1 -1
  45. package/web/.next/server/app/_global-error/page.js.nft.json +1 -1
  46. package/web/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  47. package/web/.next/server/app/_global-error.html +2 -2
  48. package/web/.next/server/app/_global-error.rsc +1 -1
  49. package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  50. package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  51. package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  52. package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  53. package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  54. package/web/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
  55. package/web/.next/server/app/_not-found/page.js +1 -1
  56. package/web/.next/server/app/_not-found/page.js.nft.json +1 -1
  57. package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  58. package/web/.next/server/app/api/attachments/preview/route.js.nft.json +1 -1
  59. package/web/.next/server/app/api/attachments/upload-from-path/route/app-paths-manifest.json +3 -0
  60. package/web/.next/server/app/api/attachments/upload-from-path/route/build-manifest.json +11 -0
  61. package/web/.next/server/app/api/attachments/upload-from-path/route/server-reference-manifest.json +4 -0
  62. package/web/.next/server/app/api/attachments/upload-from-path/route.js +7 -0
  63. package/web/.next/server/app/api/attachments/upload-from-path/route.js.map +5 -0
  64. package/web/.next/server/app/api/attachments/upload-from-path/route.js.nft.json +1 -0
  65. package/web/.next/server/app/api/attachments/upload-from-path/route_client-reference-manifest.js +2 -0
  66. package/web/.next/server/app/api/feature-logs/route.js +1 -1
  67. package/web/.next/server/app/api/feature-logs/route.js.nft.json +1 -1
  68. package/web/.next/server/app/settings/page/server-reference-manifest.json +5 -5
  69. package/web/.next/server/app/settings/page.js +1 -1
  70. package/web/.next/server/app/settings/page.js.nft.json +1 -1
  71. package/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  72. package/web/.next/server/app/skills/page/server-reference-manifest.json +6 -6
  73. package/web/.next/server/app/skills/page.js +1 -1
  74. package/web/.next/server/app/skills/page.js.nft.json +1 -1
  75. package/web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  76. package/web/.next/server/app/tools/page/server-reference-manifest.json +6 -6
  77. package/web/.next/server/app/tools/page.js +1 -1
  78. package/web/.next/server/app/tools/page.js.nft.json +1 -1
  79. package/web/.next/server/app/tools/page_client-reference-manifest.js +1 -1
  80. package/web/.next/server/app/version/page/server-reference-manifest.json +1 -1
  81. package/web/.next/server/app/version/page.js +1 -1
  82. package/web/.next/server/app/version/page.js.nft.json +1 -1
  83. package/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
  84. package/web/.next/server/app-paths-manifest.json +1 -0
  85. package/web/.next/server/chunks/8ba4b_server_app_api_attachments_upload-from-path_route_actions_05020a44.js +3 -0
  86. package/web/.next/server/chunks/8ba4b_server_app_api_attachments_upload-from-path_route_actions_05020a44.js.map +1 -0
  87. package/web/.next/server/chunks/[root-of-the-server]__a5879003._.js +3 -0
  88. package/web/.next/server/chunks/[root-of-the-server]__a5879003._.js.map +1 -0
  89. package/web/.next/server/chunks/{[root-of-the-server]__52c318d1._.js → [root-of-the-server]__d8037e14._.js} +2 -2
  90. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js +1 -1
  91. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js.map +1 -1
  92. package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_@drawer_repository_[repositoryId]_page_actions_da7eef33.js +1 -1
  93. package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_@drawer_repository_[repositoryId]_page_actions_da7eef33.js.map +1 -1
  94. package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_repository_[repositoryId]_page_actions_0a9251aa.js +1 -1
  95. package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_repository_[repositoryId]_page_actions_0a9251aa.js.map +1 -1
  96. package/web/.next/server/chunks/ssr/[root-of-the-server]__11033878._.js +1 -1
  97. package/web/.next/server/chunks/ssr/[root-of-the-server]__11033878._.js.map +1 -1
  98. package/web/.next/server/chunks/ssr/[root-of-the-server]__17143953._.js +1 -1
  99. package/web/.next/server/chunks/ssr/[root-of-the-server]__17143953._.js.map +1 -1
  100. package/web/.next/server/chunks/ssr/{[root-of-the-server]__8d9536c4._.js → [root-of-the-server]__248ee887._.js} +2 -2
  101. package/web/.next/server/chunks/ssr/[root-of-the-server]__357d99f9._.js +1 -1
  102. package/web/.next/server/chunks/ssr/[root-of-the-server]__4af0afe0._.js +3 -0
  103. package/web/.next/server/chunks/ssr/[root-of-the-server]__4be9a9bb._.js +1 -1
  104. package/web/.next/server/chunks/ssr/[root-of-the-server]__5d87af2e._.js +1 -1
  105. package/web/.next/server/chunks/ssr/{[root-of-the-server]__f8210f45._.js → [root-of-the-server]__9bc1434f._.js} +2 -2
  106. package/web/.next/server/chunks/ssr/[root-of-the-server]__9de266fa._.js +1 -1
  107. package/web/.next/server/chunks/ssr/[root-of-the-server]__9de266fa._.js.map +1 -1
  108. package/web/.next/server/chunks/ssr/[root-of-the-server]__aad040c0._.js +1 -1
  109. package/web/.next/server/chunks/ssr/[root-of-the-server]__aad040c0._.js.map +1 -1
  110. package/web/.next/server/chunks/ssr/{[root-of-the-server]__f1a05100._.js → [root-of-the-server]__b062b383._.js} +2 -2
  111. package/web/.next/server/chunks/ssr/[root-of-the-server]__b3a4cef4._.js +1 -1
  112. package/web/.next/server/chunks/ssr/[root-of-the-server]__b3a4cef4._.js.map +1 -1
  113. package/web/.next/server/chunks/ssr/[root-of-the-server]__f0d8d054._.js +2 -2
  114. package/web/.next/server/chunks/ssr/[root-of-the-server]__fdc75809._.js +1 -1
  115. package/web/.next/server/chunks/ssr/[root-of-the-server]__fdc75809._.js.map +1 -1
  116. package/web/.next/server/chunks/ssr/_135edb9c._.js +1 -1
  117. package/web/.next/server/chunks/ssr/_135edb9c._.js.map +1 -1
  118. package/web/.next/server/chunks/ssr/{_a2ec151c._.js → _61480424._.js} +2 -2
  119. package/web/.next/server/chunks/ssr/{_a2ec151c._.js.map → _61480424._.js.map} +1 -1
  120. package/web/.next/server/chunks/ssr/_752e01fd._.js +1 -1
  121. package/web/.next/server/chunks/ssr/_752e01fd._.js.map +1 -1
  122. package/web/.next/server/chunks/ssr/_8dacd1e7._.js +1 -1
  123. package/web/.next/server/chunks/ssr/_8dacd1e7._.js.map +1 -1
  124. package/web/.next/server/chunks/ssr/_cc77a143._.js +1 -1
  125. package/web/.next/server/chunks/ssr/_cc77a143._.js.map +1 -1
  126. package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js +1 -1
  127. package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js.map +1 -1
  128. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_021a05f2.js +1 -1
  129. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_021a05f2.js.map +1 -1
  130. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1fa8042e.js +1 -1
  131. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1fa8042e.js.map +1 -1
  132. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_24684200.js +1 -1
  133. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_24684200.js.map +1 -1
  134. package/web/.next/server/chunks/ssr/src_presentation_web_c4348b8a._.js +2 -2
  135. package/web/.next/server/chunks/ssr/src_presentation_web_c4348b8a._.js.map +1 -1
  136. package/web/.next/server/chunks/ssr/src_presentation_web_components_bf50c527._.js +1 -1
  137. package/web/.next/server/chunks/ssr/src_presentation_web_components_bf50c527._.js.map +1 -1
  138. package/web/.next/server/chunks/ssr/src_presentation_web_components_de814675._.js +1 -1
  139. package/web/.next/server/chunks/ssr/src_presentation_web_components_de814675._.js.map +1 -1
  140. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js +1 -1
  141. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js.map +1 -1
  142. package/web/.next/server/chunks/ssr/src_presentation_web_e4510d10._.js +2 -2
  143. package/web/.next/server/chunks/ssr/src_presentation_web_e4510d10._.js.map +1 -1
  144. package/web/.next/server/pages/500.html +2 -2
  145. package/web/.next/server/server-reference-manifest.js +1 -1
  146. package/web/.next/server/server-reference-manifest.json +28 -28
  147. package/web/.next/static/chunks/{e49abd7c0c1cdef2.js → 0b3852464455cb56.js} +1 -1
  148. package/web/.next/static/chunks/{8b59757e9f52e364.js → 177579b39fd0f63a.js} +1 -1
  149. package/web/.next/static/chunks/{eafcdd214c540495.js → 866566643c6aaecf.js} +1 -1
  150. package/web/.next/static/chunks/{ba99f8c298491782.js → 8d82ff1402dcf377.js} +1 -1
  151. package/web/.next/static/chunks/{c2e2e1720b4f9a1a.js → 9d59d178a1e154b2.js} +1 -1
  152. package/web/.next/static/chunks/{673af06602f590f0.js → c7a4303d3cf08477.js} +1 -1
  153. package/web/.next/static/chunks/{20e5c07abd2699c2.js → dd6c69087923da49.js} +2 -2
  154. package/web/.next/static/chunks/{c481a0ab2ddddbf4.js → dd6cd59c8f439583.js} +1 -1
  155. package/web/.next/static/chunks/{c267885c32e4091c.js → e1edce9ef55b5824.js} +1 -1
  156. package/web/.next/static/chunks/{98b1c6b413aeb539.js → f46a0078f2ee9c44.js} +1 -1
  157. package/web/.next/server/chunks/ssr/[root-of-the-server]__b65f78cf._.js +0 -3
  158. /package/web/.next/server/chunks/{[root-of-the-server]__52c318d1._.js.map → [root-of-the-server]__d8037e14._.js.map} +0 -0
  159. /package/web/.next/server/chunks/ssr/{[root-of-the-server]__8d9536c4._.js.map → [root-of-the-server]__248ee887._.js.map} +0 -0
  160. /package/web/.next/server/chunks/ssr/{[root-of-the-server]__b65f78cf._.js.map → [root-of-the-server]__4af0afe0._.js.map} +0 -0
  161. /package/web/.next/server/chunks/ssr/{[root-of-the-server]__f8210f45._.js.map → [root-of-the-server]__9bc1434f._.js.map} +0 -0
  162. /package/web/.next/server/chunks/ssr/{[root-of-the-server]__f1a05100._.js.map → [root-of-the-server]__b062b383._.js.map} +0 -0
  163. /package/web/.next/static/{VCU_mY2u0y_7bLsvmLjyS → T8HBuz_VR2eZQbNRNSohp}/_buildManifest.js +0 -0
  164. /package/web/.next/static/{VCU_mY2u0y_7bLsvmLjyS → T8HBuz_VR2eZQbNRNSohp}/_clientMiddlewareManifest.json +0 -0
  165. /package/web/.next/static/{VCU_mY2u0y_7bLsvmLjyS → T8HBuz_VR2eZQbNRNSohp}/_ssgManifest.js +0 -0
@@ -0,0 +1,3 @@
1
+ module.exports=[18622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},24725,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},14747,(e,t,r)=>{t.exports=e.x("path",()=>require("path"))},70406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},93695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},40060,e=>{"use strict";function t(e){let t=globalThis.__shepContainer;if(!t)throw Error("DI container not available. Ensure the CLI bootstrap or dev-server has initialized it.");return t.resolve(e)}e.s(["resolve",()=>t])},24868,(e,t,r)=>{t.exports=e.x("fs/promises",()=>require("fs/promises"))},81568,e=>{"use strict";var t=e.i(22925),r=e.i(62995),a=e.i(14112),n=e.i(31716),s=e.i(16340),o=e.i(40522),i=e.i(21994),l=e.i(5802),p=e.i(17171),d=e.i(177),u=e.i(43685),c=e.i(84832),h=e.i(92435),x=e.i(41260),m=e.i(80556),g=e.i(93695);e.i(97230);var f=e.i(35162),v=e.i(27980),R=e.i(24868),w=e.i(14747),y=e.i(40060);let E=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"]),b={".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".svg":"image/svg+xml",".bmp":"image/bmp",".ico":"image/x-icon",".pdf":"application/pdf",".txt":"text/plain",".md":"text/markdown",".json":"application/json",".yaml":"text/yaml",".yml":"text/yaml"};async function C(e){try{let t,{path:r,sessionId:a}=await e.json();if(!r||!a)return v.NextResponse.json({error:"Missing required fields: path, sessionId"},{status:400});let n=(0,w.extname)(r).toLowerCase();if(n&&!E.has(n))return v.NextResponse.json({error:`File type "${n}" is not allowed`},{status:400});try{t=await (0,R.readFile)((0,w.resolve)(r))}catch{return v.NextResponse.json({error:"File not found or unreadable"},{status:404})}if(t.length>0xa00000)return v.NextResponse.json({error:`File exceeds 10 MB limit (${(t.length/1024/1024).toFixed(1)} MB)`},{status:413});let s=(0,w.basename)(r),o=b[n]??"application/octet-stream",i=(0,y.resolve)("AttachmentStorageService").store(t,s,o,a);return v.NextResponse.json({id:i.id,name:i.name,size:Number(i.size),mimeType:i.mimeType,path:i.path,createdAt:i.createdAt})}catch(t){let e=t instanceof Error?t.message:"Upload failed";return v.NextResponse.json({error:e},{status:500})}}e.s(["POST",()=>C],28686);var j=e.i(28686);let A=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/attachments/upload-from-path/route",pathname:"/api/attachments/upload-from-path",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/presentation/web/app/api/attachments/upload-from-path/route.ts",nextConfigOutput:"standalone",userland:j}),{workAsyncStorage:N,workUnitAsyncStorage:T,serverHooks:P}=A;function k(){return(0,a.patchFetch)({workAsyncStorage:N,workUnitAsyncStorage:T})}async function q(e,t,a){A.isDev&&(0,n.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let v="/api/attachments/upload-from-path/route";v=v.replace(/\/index$/,"")||"/";let R=await A.prepare(e,t,{srcPage:v,multiZoneDraftMode:!1});if(!R)return t.statusCode=400,t.end("Bad Request"),null==a.waitUntil||a.waitUntil.call(a,Promise.resolve()),null;let{buildId:w,params:y,nextConfig:E,parsedUrl:b,isDraftMode:C,prerenderManifest:j,routerServerContext:N,isOnDemandRevalidate:T,revalidateOnlyGenerated:P,resolvedPathname:k,clientReferenceManifest:q,serverActionsManifest:S}=R,O=(0,i.normalizeAppPath)(v),_=!!(j.dynamicRoutes[O]||j.routes[k]),I=async()=>((null==N?void 0:N.render404)?await N.render404(e,t,b,!1):t.end("This page could not be found"),null);if(_&&!C){let e=!!j.routes[k],t=j.dynamicRoutes[O];if(t&&!1===t.fallback&&!e){if(E.experimental.adapterPath)return await I();throw new g.NoFallbackError}}let H=null;!_||A.isDev||C||(H="/index"===(H=k)?"/":H);let U=!0===A.isDev||!_,M=_&&!U;S&&q&&(0,o.setManifestsSingleton)({page:v,clientReferenceManifest:q,serverActionsManifest:S});let D=e.method||"GET",F=(0,s.getTracer)(),$=F.getActiveScopeSpan(),K={params:y,prerenderManifest:j,renderOpts:{experimental:{authInterrupts:!!E.experimental.authInterrupts},cacheComponents:!!E.cacheComponents,supportsDynamicResponse:U,incrementalCache:(0,n.getRequestMeta)(e,"incrementalCache"),cacheLifeProfiles:E.cacheLife,waitUntil:a.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,a,n)=>A.onRequestError(e,t,a,n,N)},sharedContext:{buildId:w}},z=new l.NodeNextRequest(e),B=new l.NodeNextResponse(t),L=p.NextRequestAdapter.fromNodeNextRequest(z,(0,p.signalFromNodeResponse)(t));try{let o=async e=>A.handle(L,K).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=F.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==d.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let a=r.get("next.route");if(a){let t=`${D} ${a}`;e.setAttributes({"next.route":a,"http.route":a,"next.span_name":t}),e.updateName(t)}else e.updateName(`${D} ${v}`)}),i=!!(0,n.getRequestMeta)(e,"minimalMode"),l=async n=>{var s,l;let p=async({previousCacheEntry:r})=>{try{if(!i&&T&&P&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let s=await o(n);e.fetchMetrics=K.renderOpts.fetchMetrics;let l=K.renderOpts.pendingWaitUntil;l&&a.waitUntil&&(a.waitUntil(l),l=void 0);let p=K.renderOpts.collectedTags;if(!_)return await (0,c.sendResponse)(z,B,s,K.renderOpts.pendingWaitUntil),null;{let e=await s.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(s.headers);p&&(t[m.NEXT_CACHE_TAGS_HEADER]=p),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==K.renderOpts.collectedRevalidate&&!(K.renderOpts.collectedRevalidate>=m.INFINITE_CACHE)&&K.renderOpts.collectedRevalidate,a=void 0===K.renderOpts.collectedExpire||K.renderOpts.collectedExpire>=m.INFINITE_CACHE?void 0:K.renderOpts.collectedExpire;return{value:{kind:f.CachedRouteKind.APP_ROUTE,status:s.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:a}}}}catch(t){throw(null==r?void 0:r.isStale)&&await A.onRequestError(e,t,{routerKind:"App Router",routePath:v,routeType:"route",revalidateReason:(0,u.getRevalidateReason)({isStaticGeneration:M,isOnDemandRevalidate:T})},!1,N),t}},d=await A.handleResponse({req:e,nextConfig:E,cacheKey:H,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:j,isRoutePPREnabled:!1,isOnDemandRevalidate:T,revalidateOnlyGenerated:P,responseGenerator:p,waitUntil:a.waitUntil,isMinimalMode:i});if(!_)return null;if((null==d||null==(s=d.value)?void 0:s.kind)!==f.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(l=d.value)?void 0:l.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});i||t.setHeader("x-nextjs-cache",T?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),C&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let g=(0,h.fromNodeOutgoingHttpHeaders)(d.value.headers);return i&&_||g.delete(m.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||t.getHeader("Cache-Control")||g.get("Cache-Control")||g.set("Cache-Control",(0,x.getCacheControlHeader)(d.cacheControl)),await (0,c.sendResponse)(z,B,new Response(d.value.body,{headers:g,status:d.value.status||200})),null};$?await l($):await F.withPropagatedContext(e.headers,()=>F.trace(d.BaseServerSpan.handleRequest,{spanName:`${D} ${v}`,kind:s.SpanKind.SERVER,attributes:{"http.method":D,"http.target":e.url}},l))}catch(t){if(t instanceof g.NoFallbackError||await A.onRequestError(e,t,{routerKind:"App Router",routePath:O,routeType:"route",revalidateReason:(0,u.getRevalidateReason)({isStaticGeneration:M,isOnDemandRevalidate:T})},!1,N),_)throw t;return await (0,c.sendResponse)(z,B,new Response(null,{status:500})),null}}e.s(["handler",()=>q,"patchFetch",()=>k,"routeModule",()=>A,"serverHooks",()=>P,"workAsyncStorage",()=>N,"workUnitAsyncStorage",()=>T],81568)}];
2
+
3
+ //# sourceMappingURL=%5Broot-of-the-server%5D__a5879003._.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../src/presentation/web/lib/server-container.ts","../../../../../../src/presentation/web/app/api/attachments/upload-from-path/route.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/dist/esm/build/templates/app-route.js"],"sourcesContent":["/**\n * Server Container Accessor\n *\n * Provides a `resolve()` helper for server components and API routes to\n * obtain DI-managed instances. The tsyringe container is placed on globalThis\n * by the CLI bootstrap (`shep ui`) or the dev-server (`pnpm dev:web`).\n */\n\nimport type { DependencyContainer, InjectionToken } from 'tsyringe';\n\nconst CONTAINER_KEY = '__shepContainer';\n\n/**\n * Resolve a dependency from the DI container.\n *\n * Usage in server components / API routes:\n * ```ts\n * import { resolve } from '@/lib/server-container';\n * import { ListFeaturesUseCase } from '@shepai/core/application/use-cases/features/list-features.use-case';\n *\n * const features = await resolve(ListFeaturesUseCase).execute();\n * ```\n */\nexport function resolve<T>(token: InjectionToken<T>): T {\n const container = (globalThis as Record<string, unknown>)[CONTAINER_KEY] as\n | DependencyContainer\n | undefined;\n\n if (!container) {\n throw new Error(\n 'DI container not available. Ensure the CLI bootstrap or dev-server has initialized it.'\n );\n }\n\n return container.resolve(token);\n}\n","import { NextResponse } from 'next/server';\nimport { readFile } from 'fs/promises';\nimport { extname, basename } from 'path';\nimport { resolve as resolvePath } from 'path';\nimport { resolve } from '@/lib/server-container';\nimport type { AttachmentStorageService } from '@shepai/core/infrastructure/services/attachment-storage.service';\n\nconst MAX_FILE_SIZE = 10 * 1024 * 1024; // 10 MB\n\nconst ALLOWED_EXTENSIONS = new Set([\n '.png',\n '.jpg',\n '.jpeg',\n '.gif',\n '.webp',\n '.svg',\n '.bmp',\n '.ico',\n '.pdf',\n '.doc',\n '.docx',\n '.xls',\n '.xlsx',\n '.ppt',\n '.pptx',\n '.txt',\n '.md',\n '.csv',\n '.json',\n '.yaml',\n '.yml',\n '.xml',\n '.ts',\n '.tsx',\n '.js',\n '.jsx',\n '.py',\n '.rb',\n '.go',\n '.rs',\n '.java',\n '.c',\n '.cpp',\n '.h',\n '.hpp',\n '.cs',\n '.swift',\n '.kt',\n '.html',\n '.css',\n '.scss',\n '.less',\n '.sh',\n '.bash',\n '.zsh',\n '.fish',\n '.toml',\n '.ini',\n '.cfg',\n '.conf',\n '.env',\n '.zip',\n '.tar',\n '.gz',\n '.log',\n]);\n\nconst MIME_MAP: Record<string, string> = {\n '.png': 'image/png',\n '.jpg': 'image/jpeg',\n '.jpeg': 'image/jpeg',\n '.gif': 'image/gif',\n '.webp': 'image/webp',\n '.svg': 'image/svg+xml',\n '.bmp': 'image/bmp',\n '.ico': 'image/x-icon',\n '.pdf': 'application/pdf',\n '.txt': 'text/plain',\n '.md': 'text/markdown',\n '.json': 'application/json',\n '.yaml': 'text/yaml',\n '.yml': 'text/yaml',\n};\n\nexport async function POST(request: Request): Promise<NextResponse> {\n try {\n const body = await request.json();\n const { path, sessionId } = body as { path?: string; sessionId?: string };\n\n if (!path || !sessionId) {\n return NextResponse.json(\n { error: 'Missing required fields: path, sessionId' },\n { status: 400 }\n );\n }\n\n const ext = extname(path).toLowerCase();\n if (ext && !ALLOWED_EXTENSIONS.has(ext)) {\n return NextResponse.json({ error: `File type \"${ext}\" is not allowed` }, { status: 400 });\n }\n\n let buffer: Buffer;\n try {\n buffer = await readFile(resolvePath(path));\n } catch {\n return NextResponse.json({ error: 'File not found or unreadable' }, { status: 404 });\n }\n\n if (buffer.length > MAX_FILE_SIZE) {\n return NextResponse.json(\n {\n error: `File exceeds 10 MB limit (${(buffer.length / 1024 / 1024).toFixed(1)} MB)`,\n },\n { status: 413 }\n );\n }\n\n const filename = basename(path);\n const mimeType = MIME_MAP[ext] ?? 'application/octet-stream';\n\n const service = resolve<AttachmentStorageService>('AttachmentStorageService');\n const attachment = service.store(buffer, filename, mimeType, sessionId);\n\n return NextResponse.json({\n id: attachment.id,\n name: attachment.name,\n size: Number(attachment.size),\n mimeType: attachment.mimeType,\n path: attachment.path,\n createdAt: attachment.createdAt,\n });\n } catch (error: unknown) {\n const message = error instanceof Error ? error.message : 'Upload failed';\n return NextResponse.json({ error: message }, { status: 500 });\n }\n}\n","import { AppRouteRouteModule } from \"next/dist/esm/server/route-modules/app-route/module.compiled\";\nimport { RouteKind } from \"next/dist/esm/server/route-kind\";\nimport { patchFetch as _patchFetch } from \"next/dist/esm/server/lib/patch-fetch\";\nimport { addRequestMeta, getRequestMeta } from \"next/dist/esm/server/request-meta\";\nimport { getTracer, SpanKind } from \"next/dist/esm/server/lib/trace/tracer\";\nimport { setManifestsSingleton } from \"next/dist/esm/server/app-render/manifests-singleton\";\nimport { normalizeAppPath } from \"next/dist/esm/shared/lib/router/utils/app-paths\";\nimport { NodeNextRequest, NodeNextResponse } from \"next/dist/esm/server/base-http/node\";\nimport { NextRequestAdapter, signalFromNodeResponse } from \"next/dist/esm/server/web/spec-extension/adapters/next-request\";\nimport { BaseServerSpan } from \"next/dist/esm/server/lib/trace/constants\";\nimport { getRevalidateReason } from \"next/dist/esm/server/instrumentation/utils\";\nimport { sendResponse } from \"next/dist/esm/server/send-response\";\nimport { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from \"next/dist/esm/server/web/utils\";\nimport { getCacheControlHeader } from \"next/dist/esm/server/lib/cache-control\";\nimport { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from \"next/dist/esm/lib/constants\";\nimport { NoFallbackError } from \"next/dist/esm/shared/lib/no-fallback-error.external\";\nimport { CachedRouteKind } from \"next/dist/esm/server/response-cache\";\nimport * as userland from \"INNER_APP_ROUTE\";\n// We inject the nextConfigOutput here so that we can use them in the route\n// module.\nconst nextConfigOutput = \"standalone\"\nconst routeModule = new AppRouteRouteModule({\n definition: {\n kind: RouteKind.APP_ROUTE,\n page: \"/api/attachments/upload-from-path/route\",\n pathname: \"/api/attachments/upload-from-path\",\n filename: \"route\",\n bundlePath: \"\"\n },\n distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '',\n relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '',\n resolvedPagePath: \"[project]/src/presentation/web/app/api/attachments/upload-from-path/route.ts\",\n nextConfigOutput,\n userland\n});\n// Pull out the exports that we need to expose from the module. This should\n// be eliminated when we've moved the other routes to the new format. These\n// are used to hook into the route.\nconst { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule;\nfunction patchFetch() {\n return _patchFetch({\n workAsyncStorage,\n workUnitAsyncStorage\n });\n}\nexport { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, };\nexport async function handler(req, res, ctx) {\n if (routeModule.isDev) {\n addRequestMeta(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint());\n }\n let srcPage = \"/api/attachments/upload-from-path/route\";\n // turbopack doesn't normalize `/index` in the page name\n // so we need to to process dynamic routes properly\n // TODO: fix turbopack providing differing value from webpack\n if (process.env.TURBOPACK) {\n srcPage = srcPage.replace(/\\/index$/, '') || '/';\n } else if (srcPage === '/index') {\n // we always normalize /index specifically\n srcPage = '/';\n }\n const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE;\n const prepareResult = await routeModule.prepare(req, res, {\n srcPage,\n multiZoneDraftMode\n });\n if (!prepareResult) {\n res.statusCode = 400;\n res.end('Bad Request');\n ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve());\n return null;\n }\n const { buildId, params, nextConfig, parsedUrl, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname, clientReferenceManifest, serverActionsManifest } = prepareResult;\n const normalizedSrcPage = normalizeAppPath(srcPage);\n let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]);\n const render404 = async ()=>{\n // TODO: should route-module itself handle rendering the 404\n if (routerServerContext == null ? void 0 : routerServerContext.render404) {\n await routerServerContext.render404(req, res, parsedUrl, false);\n } else {\n res.end('This page could not be found');\n }\n return null;\n };\n if (isIsr && !isDraftMode) {\n const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]);\n const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage];\n if (prerenderInfo) {\n if (prerenderInfo.fallback === false && !isPrerendered) {\n if (nextConfig.experimental.adapterPath) {\n return await render404();\n }\n throw new NoFallbackError();\n }\n }\n }\n let cacheKey = null;\n if (isIsr && !routeModule.isDev && !isDraftMode) {\n cacheKey = resolvedPathname;\n // ensure /index and / is normalized to one key\n cacheKey = cacheKey === '/index' ? '/' : cacheKey;\n }\n const supportsDynamicResponse = // If we're in development, we always support dynamic HTML\n routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports\n // dynamic HTML.\n !isIsr;\n // This is a revalidation request if the request is for a static\n // page and it is not being resumed from a postponed render and\n // it is not a dynamic RSC request then it is a revalidation\n // request.\n const isStaticGeneration = isIsr && !supportsDynamicResponse;\n // Before rendering (which initializes component tree modules), we have to\n // set the reference manifests to our global store so Server Action's\n // encryption util can access to them at the top level of the page module.\n if (serverActionsManifest && clientReferenceManifest) {\n setManifestsSingleton({\n page: srcPage,\n clientReferenceManifest,\n serverActionsManifest\n });\n }\n const method = req.method || 'GET';\n const tracer = getTracer();\n const activeSpan = tracer.getActiveScopeSpan();\n const context = {\n params,\n prerenderManifest,\n renderOpts: {\n experimental: {\n authInterrupts: Boolean(nextConfig.experimental.authInterrupts)\n },\n cacheComponents: Boolean(nextConfig.cacheComponents),\n supportsDynamicResponse,\n incrementalCache: getRequestMeta(req, 'incrementalCache'),\n cacheLifeProfiles: nextConfig.cacheLife,\n waitUntil: ctx.waitUntil,\n onClose: (cb)=>{\n res.on('close', cb);\n },\n onAfterTaskError: undefined,\n onInstrumentationRequestError: (error, _request, errorContext, silenceLog)=>routeModule.onRequestError(req, error, errorContext, silenceLog, routerServerContext)\n },\n sharedContext: {\n buildId\n }\n };\n const nodeNextReq = new NodeNextRequest(req);\n const nodeNextRes = new NodeNextResponse(res);\n const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res));\n try {\n const invokeRouteModule = async (span)=>{\n return routeModule.handle(nextReq, context).finally(()=>{\n if (!span) return;\n span.setAttributes({\n 'http.status_code': res.statusCode,\n 'next.rsc': false\n });\n const rootSpanAttributes = tracer.getRootSpanAttributes();\n // We were unable to get attributes, probably OTEL is not enabled\n if (!rootSpanAttributes) {\n return;\n }\n if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) {\n console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);\n return;\n }\n const route = rootSpanAttributes.get('next.route');\n if (route) {\n const name = `${method} ${route}`;\n span.setAttributes({\n 'next.route': route,\n 'http.route': route,\n 'next.span_name': name\n });\n span.updateName(name);\n } else {\n span.updateName(`${method} ${srcPage}`);\n }\n });\n };\n const isMinimalMode = Boolean(process.env.MINIMAL_MODE || getRequestMeta(req, 'minimalMode'));\n const handleResponse = async (currentSpan)=>{\n var _cacheEntry_value;\n const responseGenerator = async ({ previousCacheEntry })=>{\n try {\n if (!isMinimalMode && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) {\n res.statusCode = 404;\n // on-demand revalidate always sets this header\n res.setHeader('x-nextjs-cache', 'REVALIDATED');\n res.end('This page could not be found');\n return null;\n }\n const response = await invokeRouteModule(currentSpan);\n req.fetchMetrics = context.renderOpts.fetchMetrics;\n let pendingWaitUntil = context.renderOpts.pendingWaitUntil;\n // Attempt using provided waitUntil if available\n // if it's not we fallback to sendResponse's handling\n if (pendingWaitUntil) {\n if (ctx.waitUntil) {\n ctx.waitUntil(pendingWaitUntil);\n pendingWaitUntil = undefined;\n }\n }\n const cacheTags = context.renderOpts.collectedTags;\n // If the request is for a static response, we can cache it so long\n // as it's not edge.\n if (isIsr) {\n const blob = await response.blob();\n // Copy the headers from the response.\n const headers = toNodeOutgoingHttpHeaders(response.headers);\n if (cacheTags) {\n headers[NEXT_CACHE_TAGS_HEADER] = cacheTags;\n }\n if (!headers['content-type'] && blob.type) {\n headers['content-type'] = blob.type;\n }\n const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate;\n const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire;\n // Create the cache entry for the response.\n const cacheEntry = {\n value: {\n kind: CachedRouteKind.APP_ROUTE,\n status: response.status,\n body: Buffer.from(await blob.arrayBuffer()),\n headers\n },\n cacheControl: {\n revalidate,\n expire\n }\n };\n return cacheEntry;\n } else {\n // send response without caching if not ISR\n await sendResponse(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil);\n return null;\n }\n } catch (err) {\n // if this is a background revalidate we need to report\n // the request error here as it won't be bubbled\n if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: srcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n throw err;\n }\n };\n const cacheEntry = await routeModule.handleResponse({\n req,\n nextConfig,\n cacheKey,\n routeKind: RouteKind.APP_ROUTE,\n isFallback: false,\n prerenderManifest,\n isRoutePPREnabled: false,\n isOnDemandRevalidate,\n revalidateOnlyGenerated,\n responseGenerator,\n waitUntil: ctx.waitUntil,\n isMinimalMode\n });\n // we don't create a cacheEntry for ISR\n if (!isIsr) {\n return null;\n }\n if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) {\n var _cacheEntry_value1;\n throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), \"__NEXT_ERROR_CODE\", {\n value: \"E701\",\n enumerable: false,\n configurable: true\n });\n }\n if (!isMinimalMode) {\n res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT');\n }\n // Draft mode should never be cached\n if (isDraftMode) {\n res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');\n }\n const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers);\n if (!(isMinimalMode && isIsr)) {\n headers.delete(NEXT_CACHE_TAGS_HEADER);\n }\n // If cache control is already set on the response we don't\n // override it to allow users to customize it via next.config\n if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) {\n headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl));\n }\n await sendResponse(nodeNextReq, nodeNextRes, // @ts-expect-error - Argument of type 'Buffer<ArrayBufferLike>' is not assignable to parameter of type 'BodyInit | null | undefined'.\n new Response(cacheEntry.value.body, {\n headers,\n status: cacheEntry.value.status || 200\n }));\n return null;\n };\n // TODO: activeSpan code path is for when wrapped by\n // next-server can be removed when this is no longer used\n if (activeSpan) {\n await handleResponse(activeSpan);\n } else {\n await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, {\n spanName: `${method} ${srcPage}`,\n kind: SpanKind.SERVER,\n attributes: {\n 'http.method': method,\n 'http.target': req.url\n }\n }, handleResponse));\n }\n } catch (err) {\n if (!(err instanceof NoFallbackError)) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: normalizedSrcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n // rethrow so that we can handle serving error page\n // If this is during static generation, throw the error again.\n if (isIsr) throw err;\n // Otherwise, send a 500 response.\n await sendResponse(nodeNextReq, nodeNextRes, new Response(null, {\n status: 500\n }));\n return null;\n }\n}\n\n//# sourceMappingURL=app-route.js.map\n"],"names":[],"mappings":"8iCAuBO,SAAS,EAAW,CAAwB,EACjD,IAAM,EAAa,UAAsC,CAAC,AAdtC,eAcoD,CAIxE,GAAI,CAAC,EACH,MAAM,AAAI,GADI,GAEZ,0FAIJ,OAAO,EAAU,OAAO,CAAC,EAC3B,yHEnCA,IAAA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,MACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,KACA,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,CAAA,CAAA,OAAA,IAAA,EAAA,EAAA,CAAA,CAAA,ODhBA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OAEA,EAAA,EAAA,CAAA,CAAA,OAKA,IAAM,EAAqB,IAAI,IAAI,CACjC,OACA,OACA,QACA,OACA,QACA,OACA,OACA,OACA,OACA,OACA,QACA,OACA,QACA,OACA,QACA,OACA,MACA,OACA,QACA,QACA,OACA,OACA,MACA,OACA,MACA,OACA,MACA,MACA,MACA,MACA,QACA,KACA,OACA,KACA,OACA,MACA,SACA,MACA,QACA,OACA,QACA,QACA,MACA,QACA,OACA,QACA,QACA,OACA,OACA,QACA,OACA,OACA,OACA,MACA,OACD,EAEK,EAAmC,CACv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,EAAa,IAAI,SAAS,KAAM,CAC5D,OAAQ,GACZ,IACO,IACX,CACJ,EAEA,qCAAqC","ignoreList":[2]}
@@ -1,4 +1,4 @@
1
- module.exports=[18622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},70406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},2157,(e,t,r)=>{t.exports=e.x("node:fs",()=>require("node:fs"))},12714,(e,t,r)=>{t.exports=e.x("node:fs/promises",()=>require("node:fs/promises"))},50227,(e,t,r)=>{t.exports=e.x("node:path",()=>require("node:path"))},60526,(e,t,r)=>{t.exports=e.x("node:os",()=>require("node:os"))},93695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},40060,e=>{"use strict";function t(e){let t=globalThis.__shepContainer;if(!t)throw Error("DI container not available. Ensure the CLI bootstrap or dev-server has initialized it.");return t.resolve(e)}e.s(["resolve",()=>t])},81280,e=>{"use strict";var t=e.i(22925),r=e.i(62995),n=e.i(14112),a=e.i(31716),o=e.i(16340),i=e.i(40522),s=e.i(21994),l=e.i(5802),u=e.i(17171),d=e.i(177),c=e.i(43685),p=e.i(84832),h=e.i(92435),f=e.i(41260),x=e.i(80556),v=e.i(93695);e.i(97230);var R=e.i(35162),g=e.i(40060),w=e.i(50227),m=e.i(60526),y=e.i(12714),E=e.i(2157);function C(e){return new Response(new ReadableStream({start(t){let r=new TextEncoder;t.enqueue(r.encode(`event: error
1
+ module.exports=[2157,(e,t,r)=>{t.exports=e.x("node:fs",()=>require("node:fs"))},12714,(e,t,r)=>{t.exports=e.x("node:fs/promises",()=>require("node:fs/promises"))},50227,(e,t,r)=>{t.exports=e.x("node:path",()=>require("node:path"))},60526,(e,t,r)=>{t.exports=e.x("node:os",()=>require("node:os"))},18622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},70406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},93695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},40060,e=>{"use strict";function t(e){let t=globalThis.__shepContainer;if(!t)throw Error("DI container not available. Ensure the CLI bootstrap or dev-server has initialized it.");return t.resolve(e)}e.s(["resolve",()=>t])},81280,e=>{"use strict";var t=e.i(22925),r=e.i(62995),n=e.i(14112),a=e.i(31716),o=e.i(16340),i=e.i(40522),s=e.i(21994),l=e.i(5802),u=e.i(17171),d=e.i(177),c=e.i(43685),p=e.i(84832),h=e.i(92435),f=e.i(41260),x=e.i(80556),v=e.i(93695);e.i(97230);var R=e.i(35162),g=e.i(40060),w=e.i(50227),m=e.i(60526),y=e.i(12714),E=e.i(2157);function C(e){return new Response(new ReadableStream({start(t){let r=new TextEncoder;t.enqueue(r.encode(`event: error
2
2
  data: ${JSON.stringify({error:e})}
3
3
 
4
4
  `)),t.close()}}),{headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"}})}async function b(e){try{let t=new URL(e.url).searchParams.get("featureId");if(!t?.trim())return C("featureId is required");let r=(0,g.resolve)("IFeatureRepository"),n=await r.findById(t);if(!n)return C(`Feature not found: ${t}`);if(!n.agentRunId)return C(`Feature "${n.name}" has no agent run`);let a=(0,w.join)((0,m.homedir)(),".shep","logs",`worker-${n.agentRunId}.log`),o=new ReadableStream({start(t){let r=new TextEncoder,n=!1,o=0,i=null,s=null;function l(e){if(!n)try{t.enqueue(r.encode(e))}catch{}}async function u(){try{if((await (0,y.stat)(a)).size<=o)return null;let e=await (0,y.readFile)(a,"utf-8"),t=e.slice(o);return o=e.length,t||null}catch{return null}}async function d(){if(!n)try{let e=await u();e&&l(`event: log
@@ -9,4 +9,4 @@ data: ${JSON.stringify({content:e})}
9
9
 
10
10
  `),n)return;try{(i=(0,E.watch)(a,{persistent:!1},()=>{d()})).on("error",()=>{})}catch{}s=setInterval(()=>{d()},2e3)}catch{}})();let c=setInterval(()=>{l(": heartbeat\n\n")},3e4);e.signal.addEventListener("abort",()=>{n=!0,i&&(i.close(),i=null),s&&(clearInterval(s),s=null),clearInterval(c);try{t.close()}catch{}},{once:!0})}});return new Response(o,{headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"}})}catch(e){return console.error("[SSE route] GET /api/feature-logs error:",e),new Response(JSON.stringify({error:String(e)}),{status:500,headers:{"Content-Type":"application/json"}})}}e.s(["GET",()=>b,"dynamic",0,"force-dynamic"],91095);var T=e.i(91095);let A=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/feature-logs/route",pathname:"/api/feature-logs",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/presentation/web/app/api/feature-logs/route.ts",nextConfigOutput:"standalone",userland:T}),{workAsyncStorage:S,workUnitAsyncStorage:I,serverHooks:N}=A;function q(){return(0,n.patchFetch)({workAsyncStorage:S,workUnitAsyncStorage:I})}async function O(e,t,n){A.isDev&&(0,a.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let g="/api/feature-logs/route";g=g.replace(/\/index$/,"")||"/";let w=await A.prepare(e,t,{srcPage:g,multiZoneDraftMode:!1});if(!w)return t.statusCode=400,t.end("Bad Request"),null==n.waitUntil||n.waitUntil.call(n,Promise.resolve()),null;let{buildId:m,params:y,nextConfig:E,parsedUrl:C,isDraftMode:b,prerenderManifest:T,routerServerContext:S,isOnDemandRevalidate:I,revalidateOnlyGenerated:N,resolvedPathname:q,clientReferenceManifest:O,serverActionsManifest:P}=w,k=(0,s.normalizeAppPath)(g),_=!!(T.dynamicRoutes[k]||T.routes[q]),j=async()=>((null==S?void 0:S.render404)?await S.render404(e,t,C,!1):t.end("This page could not be found"),null);if(_&&!b){let e=!!T.routes[q],t=T.dynamicRoutes[k];if(t&&!1===t.fallback&&!e){if(E.experimental.adapterPath)return await j();throw new v.NoFallbackError}}let H=null;!_||A.isDev||b||(H="/index"===(H=q)?"/":H);let U=!0===A.isDev||!_,$=_&&!U;P&&O&&(0,i.setManifestsSingleton)({page:g,clientReferenceManifest:O,serverActionsManifest:P});let D=e.method||"GET",F=(0,o.getTracer)(),M=F.getActiveScopeSpan(),K={params:y,prerenderManifest:T,renderOpts:{experimental:{authInterrupts:!!E.experimental.authInterrupts},cacheComponents:!!E.cacheComponents,supportsDynamicResponse:U,incrementalCache:(0,a.getRequestMeta)(e,"incrementalCache"),cacheLifeProfiles:E.cacheLife,waitUntil:n.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,n,a)=>A.onRequestError(e,t,n,a,S)},sharedContext:{buildId:m}},L=new l.NodeNextRequest(e),B=new l.NodeNextResponse(t),G=u.NextRequestAdapter.fromNodeNextRequest(L,(0,u.signalFromNodeResponse)(t));try{let i=async e=>A.handle(G,K).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=F.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==d.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let n=r.get("next.route");if(n){let t=`${D} ${n}`;e.setAttributes({"next.route":n,"http.route":n,"next.span_name":t}),e.updateName(t)}else e.updateName(`${D} ${g}`)}),s=!!(0,a.getRequestMeta)(e,"minimalMode"),l=async a=>{var o,l;let u=async({previousCacheEntry:r})=>{try{if(!s&&I&&N&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let o=await i(a);e.fetchMetrics=K.renderOpts.fetchMetrics;let l=K.renderOpts.pendingWaitUntil;l&&n.waitUntil&&(n.waitUntil(l),l=void 0);let u=K.renderOpts.collectedTags;if(!_)return await (0,p.sendResponse)(L,B,o,K.renderOpts.pendingWaitUntil),null;{let e=await o.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(o.headers);u&&(t[x.NEXT_CACHE_TAGS_HEADER]=u),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==K.renderOpts.collectedRevalidate&&!(K.renderOpts.collectedRevalidate>=x.INFINITE_CACHE)&&K.renderOpts.collectedRevalidate,n=void 0===K.renderOpts.collectedExpire||K.renderOpts.collectedExpire>=x.INFINITE_CACHE?void 0:K.renderOpts.collectedExpire;return{value:{kind:R.CachedRouteKind.APP_ROUTE,status:o.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:n}}}}catch(t){throw(null==r?void 0:r.isStale)&&await A.onRequestError(e,t,{routerKind:"App Router",routePath:g,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:$,isOnDemandRevalidate:I})},!1,S),t}},d=await A.handleResponse({req:e,nextConfig:E,cacheKey:H,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:T,isRoutePPREnabled:!1,isOnDemandRevalidate:I,revalidateOnlyGenerated:N,responseGenerator:u,waitUntil:n.waitUntil,isMinimalMode:s});if(!_)return null;if((null==d||null==(o=d.value)?void 0:o.kind)!==R.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(l=d.value)?void 0:l.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});s||t.setHeader("x-nextjs-cache",I?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),b&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let v=(0,h.fromNodeOutgoingHttpHeaders)(d.value.headers);return s&&_||v.delete(x.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||t.getHeader("Cache-Control")||v.get("Cache-Control")||v.set("Cache-Control",(0,f.getCacheControlHeader)(d.cacheControl)),await (0,p.sendResponse)(L,B,new Response(d.value.body,{headers:v,status:d.value.status||200})),null};M?await l(M):await F.withPropagatedContext(e.headers,()=>F.trace(d.BaseServerSpan.handleRequest,{spanName:`${D} ${g}`,kind:o.SpanKind.SERVER,attributes:{"http.method":D,"http.target":e.url}},l))}catch(t){if(t instanceof v.NoFallbackError||await A.onRequestError(e,t,{routerKind:"App Router",routePath:k,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:$,isOnDemandRevalidate:I})},!1,S),_)throw t;return await (0,p.sendResponse)(L,B,new Response(null,{status:500})),null}}e.s(["handler",()=>O,"patchFetch",()=>q,"routeModule",()=>A,"serverHooks",()=>N,"workAsyncStorage",()=>S,"workUnitAsyncStorage",()=>I],81280)}];
11
11
 
12
- //# sourceMappingURL=%5Broot-of-the-server%5D__52c318d1._.js.map
12
+ //# sourceMappingURL=%5Broot-of-the-server%5D__d8037e14._.js.map
@@ -1,3 +1,3 @@
1
- module.exports=[93995,a=>{"use strict";var b=a.i(10973),c=a.i(96960),d=a.i(69845),e=a.i(52313),f=a.i(25674);let g=(0,f.createServerReference)("4013567db4d6f309e1f1a64baf762fe7fe362e64ee",f.callServer,void 0,f.findSourceMapURL,"createFeature");var h=a.i(25700);let i=(0,h.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"}]]),j=(0,h.default)("chevrons-up-down",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);var k=a.i(10606),l=a.i(3942),m=a.i(85536),n=a.i(19884);a.i(78454);var o=a.i(24255),p=a.i(2824),q=a.i(18948),r=a.i(90920);function s({className:a,...c}){return(0,b.jsx)("textarea",{"data-slot":"textarea",className:(0,m.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",a),...c})}var t=a.i(58860),u=a.i(58339),v=a.i(80646),w=a.i(96867),x=a.i(82934),y=a.i(96213),z=a.i(2807),A=a.i(7052),A=A,B=a.i(76096),B=B,C=a.i(45670),D=a.i(50049),D=D;let E=(0,h.default)("file",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]]);var F=a.i(42642),F=F;let G=(0,h.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 H=a.i(40617),H=H;let I=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".ico",".bmp"]),J=new Set([".ts",".tsx",".js",".jsx",".json",".yaml",".yml",".xml",".html",".css",".md"]);function K(a){if(0===a)return"0 B";let b=Math.floor(Math.log(a)/Math.log(1024));return`${(a/Math.pow(1024,b)).toFixed(+(0!==b))} ${["B","KB","MB","GB"][b]}`}let L=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".ico",".bmp"]);function M(a,b){let c=new URLSearchParams({path:a,mimeType:b});return`/api/attachments/preview?${c.toString()}`}function N({name:a,size:c,mimeType:d,path:e,onRemove:f,loading:g=!1,disabled:h=!1}){let i,j,k=(i=a.lastIndexOf("."))>=0?a.slice(i).toLowerCase():"",l=I.has(k)?G:".pdf"===k?F.default:J.has(k)?H.default:E,n=".pdf"===k?"bg-red-50 text-red-600":I.has(k)?"bg-blue-50 text-blue-600":J.has(k)?"bg-emerald-50 text-emerald-600":"bg-gray-50 text-gray-600",o=(j=a.lastIndexOf("."))>=0&&L.has(a.slice(j).toLowerCase());return g?(0,b.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-md border",children:(0,b.jsx)(A.default,{className:"text-muted-foreground h-5 w-5 animate-spin"})}):o?(0,b.jsxs)(C.Dialog,{children:[(0,b.jsxs)("div",{className:"group relative",children:[(0,b.jsx)(C.DialogTrigger,{asChild:!0,children:(0,b.jsx)("img",{src:M(e,d),alt:a,title:a,className:"h-12 w-12 cursor-pointer rounded-md border object-cover transition-opacity hover:opacity-80"})}),!h&&(0,b.jsx)("button",{type:"button",onClick:f,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 ${a}`,children:(0,b.jsx)(z.X,{className:"h-3 w-3"})})]}),(0,b.jsxs)(C.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,b.jsx)(D.Root,{children:(0,b.jsxs)(C.DialogTitle,{children:["Preview: ",a]})}),(0,b.jsx)("div",{className:"relative bg-black/90",children:(0,b.jsx)("img",{src:M(e,d),alt:a,className:"h-auto max-h-[70vh] w-full object-contain"})}),(0,b.jsxs)("div",{className:"bg-background flex items-center gap-3 px-4 py-3",children:[(0,b.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,b.jsx)("span",{className:"truncate text-sm font-medium",children:a}),(0,b.jsx)("span",{className:"text-muted-foreground text-xs",children:K(c)})]}),(0,b.jsx)("a",{href:M(e,d),download:a,className:"text-muted-foreground hover:text-foreground shrink-0 cursor-pointer rounded p-1.5 transition-colors","aria-label":`Download ${a}`,children:(0,b.jsx)(B.default,{className:"h-4 w-4"})})]})]})]}):(0,b.jsxs)("div",{className:"group relative flex items-center gap-2 rounded-full border py-1 pr-3 pl-2",children:[(0,b.jsx)("div",{className:(0,m.cn)("flex h-6 w-6 shrink-0 items-center justify-center rounded-full",n),children:(0,b.jsx)(l,{className:"h-3 w-3"})}),(0,b.jsx)("span",{className:"max-w-[120px] truncate text-sm",children:a}),(0,b.jsx)("span",{className:"text-muted-foreground text-xs",children:K(c)}),!h&&(0,b.jsx)("button",{type:"button",onClick:f,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 ${a}`,children:(0,b.jsx)(z.X,{className:"h-3 w-3"})})]})}var O=a.i(61781);async function P(){let a=await fetch("/api/dialog/pick-files",{method:"POST"});if(!a.ok)throw Error("Failed to open file dialog");let b=await a.json();return b.cancelled?null:b.files}let Q=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"]),R=[{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."}],S={allowPrd:!1,allowPlan:!1,allowMerge:!1};function T({open:a,onClose:d,onSubmit:e,repositoryPath:f,isSubmitting:g=!1,workflowDefaults:h,features:j,initialParentId:k,currentAgentType:r,currentModel:v}){let z=(0,n.useSoundAction)("create"),A=h?.approvalGates??S,B=h?.push??!1,C=h?.openPr??!1,[D,E]=(0,c.useState)(""),[F,G]=(0,c.useState)([]),[H,I]=(0,c.useState)({...A}),[J,K]=(0,c.useState)(B),[L,M]=(0,c.useState)(C),[T,V]=(0,c.useState)(void 0),[W,X]=(0,c.useState)(!1),[Y,Z]=(0,c.useState)(void 0),[$,_]=(0,c.useState)(void 0),[aa,ab]=(0,c.useState)(!1),[ac,ad]=(0,c.useState)(null),ae=(0,c.useRef)(crypto.randomUUID()),af=(0,c.useRef)(0);(0,c.useEffect)(()=>{h&&(I({...h.approvalGates}),K(h.push),M(h.openPr))},[h]),(0,c.useEffect)(()=>{a&&k&&V(k)},[a,k]);let ag=(0,c.useCallback)(()=>{E(""),G([]),I({...A}),K(B),M(C),V(void 0),X(!1),Z(void 0),_(void 0),ad(null),af.current=0,ab(!1)},[A,B,C]),ah=""!==D.trim()||F.length>0,{attemptClose:ai}=(0,y.useGuardedDrawerClose)({open:a,isDirty:ah,onClose:d,onReset:ag}),aj=(0,c.useCallback)(async a=>{for(let b of(ad(null),a)){if(b.size>0xa00000)return void ad(`"${b.name}" exceeds 10 MB limit`);let a=function(a){let b=a.lastIndexOf(".");return b>=0?a.slice(b).toLowerCase():""}(b.name);if(a&&!Q.has(a))return void ad(`File type "${a}" is not allowed`)}for(let b of a){let a=crypto.randomUUID();G(c=>[...c,{id:a,name:b.name,size:b.size,mimeType:b.type||"application/octet-stream",path:"",loading:!0}]);try{let c=new FormData;c.append("file",b),c.append("sessionId",ae.current);let d=await fetch("/api/attachments/upload",{method:"POST",body:c});if(!d.ok){let b=await d.json().catch(()=>({error:"Upload failed"}));G(b=>b.filter(b=>b.id!==a)),ad(b.error??"Upload failed");return}let e=await d.json();G(b=>b.some(b=>b.id!==a&&b.path===e.path)?b.filter(b=>b.id!==a):b.map(b=>b.id===a?{...e,id:a,loading:!1}:b))}catch{G(b=>b.filter(b=>b.id!==a)),ad("Upload failed")}}},[]),ak=(0,c.useCallback)(a=>{a.preventDefault(),a.stopPropagation(),af.current+=1,1===af.current&&ab(!0)},[]),al=(0,c.useCallback)(a=>{a.preventDefault(),a.stopPropagation(),af.current-=1,0===af.current&&ab(!1)},[]),am=(0,c.useCallback)(a=>{a.preventDefault(),a.stopPropagation()},[]),an=(0,c.useCallback)(a=>{a.preventDefault(),a.stopPropagation(),af.current=0,ab(!1);let b=Array.from(a.dataTransfer.files);b.length>0&&aj(b)},[aj]),ao=(0,c.useCallback)(a=>{let b=a.clipboardData?.items;if(!b)return;let c=[];for(let a of Array.from(b))if("file"===a.kind){let b=a.getAsFile();b&&c.push(b)}c.length>0&&(a.preventDefault(),aj(c))},[aj]),ap=(0,c.useCallback)(a=>{a.preventDefault(),D.trim()&&(z.play(),e({description:D.trim(),attachments:F.filter(a=>!a.loading),repositoryPath:f,approvalGates:{allowPrd:H.allowPrd??!1,allowPlan:H.allowPlan??!1,allowMerge:H.allowMerge??!1},push:J||L,openPr:L,fast:W,...Y?{agentType:Y}:{},...$?{model:$}:{},...T?{parentId:T}:{},sessionId:ae.current}),ag())},[D,F,H,f,e,J,L,W,Y,$,T,z,ag]),aq=(0,c.useCallback)(async()=>{try{let a=await P();a&&G(b=>{let c=new Set(b.map(a=>a.path)),d=a.filter(a=>!c.has(a.path)).map(a=>({id:crypto.randomUUID(),name:a.name,size:a.size,mimeType:"application/octet-stream",path:a.path}));return d.length>0?[...b,...d]:b})}catch{}},[]),ar=(0,c.useCallback)(a=>{G(b=>b.filter(b=>b.id!==a))},[]),as=(0,c.useRef)(null),at=(0,c.useCallback)(a=>{(a.ctrlKey||a.metaKey)&&"Enter"===a.key&&(a.preventDefault(),as.current?.requestSubmit())},[]),au=j&&j.length>0;return(0,b.jsx)(o.BaseDrawer,{open:a,onClose:ai,size:"md",modal:!1,dismissOnOutsideClick:!0,"data-testid":"feature-create-drawer",header:(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("div",{className:"h-2.5 w-2.5 shrink-0 rounded-full bg-blue-500"}),(0,b.jsx)(p.DrawerTitle,{children:"NEW FEATURE"})]}),g?(0,b.jsx)(p.DrawerDescription,{asChild:!0,children:(0,b.jsx)("div",{children:(0,b.jsx)(u.Badge,{variant:"secondary",children:"Creating..."})})}):null]}),footer:(0,b.jsxs)("div",{className:"flex flex-row justify-end gap-2",children:[(0,b.jsx)(q.Button,{variant:"outline",onClick:ai,disabled:g,children:"Cancel"}),(0,b.jsx)(q.Button,{type:"submit",form:"create-feature-form",disabled:!D.trim()||g,children:g?"Creating...":"+ Create Feature"})]}),children:(0,b.jsx)("div",{className:"overflow-y-auto p-4",children:(0,b.jsx)(x.TooltipProvider,{delayDuration:400,children:(0,b.jsxs)("form",{ref:as,id:"create-feature-form",onSubmit:ap,className:"flex flex-col gap-4",children:[(0,b.jsxs)("div",{role:"region","aria-label":"File drop zone","data-drag-over":aa?"true":"false",onDragEnter:ak,onDragLeave:al,onDragOver:am,onDrop:an,className:(0,m.cn)("flex flex-col gap-1.5 rounded-md border-2 border-transparent p-1 transition-colors",aa&&"border-primary/50 bg-primary/5"),children:[(0,b.jsx)(t.Label,{htmlFor:"feature-description",className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"DESCRIBE YOUR FEATURE"}),(0,b.jsxs)("div",{className:"border-input focus-within:ring-ring/50 focus-within:border-ring flex h-56 flex-col overflow-hidden rounded-md border shadow-xs transition-[color,box-shadow] focus-within:ring-[3px]",children:[(0,b.jsx)(s,{id:"feature-description",placeholder:"e.g. Add GitHub OAuth login with callback handling and token refresh...",value:D,onChange:a=>E(a.target.value),onKeyDown:at,onPaste:ao,required:!0,disabled:g,className:"min-h-0 flex-1 resize-none rounded-none border-0 shadow-none focus-visible:ring-0"}),F.length>0&&(0,b.jsx)("div",{className:"flex flex-wrap items-center gap-1.5 px-3 py-2",children:F.map(a=>(0,b.jsx)(N,{name:a.name,size:a.size,mimeType:a.mimeType,path:a.path,onRemove:()=>ar(a.id),disabled:g,loading:a.loading},a.id))}),ac?(0,b.jsx)("p",{className:"text-destructive px-3 pb-2 text-xs",children:ac}):null,(0,b.jsxs)("div",{className:"border-input flex items-center gap-3 border-t px-3 py-1.5",children:[(0,b.jsx)(O.AgentModelPicker,{initialAgentType:Y??r??"claude-code",initialModel:$??v??"claude-sonnet-4-6",mode:"override",onAgentModelChange:(a,b)=>{Z(a),_(b)},disabled:g,className:"w-55"}),(0,b.jsxs)(x.Tooltip,{children:[(0,b.jsx)(x.TooltipTrigger,{asChild:!0,children:(0,b.jsxs)("div",{className:"ml-auto flex cursor-pointer items-center gap-2",children:[(0,b.jsx)(w.Switch,{id:"fast-mode",checked:W,onCheckedChange:X,disabled:g}),(0,b.jsxs)(t.Label,{htmlFor:"fast-mode",className:"flex cursor-pointer items-center gap-1 text-sm font-medium",children:[(0,b.jsx)(l.Zap,{className:"h-3.5 w-3.5"}),"Fast Mode"]})]})}),(0,b.jsx)(x.TooltipContent,{side:"bottom",children:"Skip SDLC phases and implement directly from your prompt."})]}),(0,b.jsxs)(x.Tooltip,{children:[(0,b.jsx)(x.TooltipTrigger,{asChild:!0,children:(0,b.jsx)("button",{type:"button",onClick:aq,disabled:g,"aria-label":"Attach files",className:"text-muted-foreground hover:text-foreground cursor-pointer rounded p-1 transition-colors",children:(0,b.jsx)(i,{className:"h-4 w-4"})})}),(0,b.jsx)(x.TooltipContent,{side:"bottom",children:"Attach files"})]})]})]})]}),au&&void 0!==k?(0,b.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,b.jsx)(t.Label,{htmlFor:"parent-feature",className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"PARENT FEATURE"}),(0,b.jsx)(U,{features:j,value:T,onChange:V,disabled:g})]}):null,(0,b.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,b.jsxs)("div",{className:"border-input flex items-center gap-4 rounded-md border px-3 py-2.5",children:[(0,b.jsxs)(x.Tooltip,{children:[(0,b.jsx)(x.TooltipTrigger,{asChild:!0,children:(0,b.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 cursor-default text-xs font-semibold tracking-wider",children:"APPROVE"})}),(0,b.jsx)(x.TooltipContent,{side:"bottom",children:"Auto-approve phase transitions without manual review."})]}),(0,b.jsx)("div",{className:"flex flex-1 items-center gap-4",children:R.map(a=>(0,b.jsxs)(x.Tooltip,{children:[(0,b.jsx)(x.TooltipTrigger,{asChild:!0,children:(0,b.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,b.jsx)(w.Switch,{id:`approve-${a.id}`,size:"sm",checked:H[a.id]??!1,onCheckedChange:b=>I(c=>({...c,[a.id]:b})),disabled:g||W&&("allowPrd"===a.id||"allowPlan"===a.id)}),(0,b.jsx)(t.Label,{htmlFor:`approve-${a.id}`,className:"cursor-pointer text-xs font-medium",children:a.label})]})}),(0,b.jsx)(x.TooltipContent,{side:"bottom",children:W&&("allowPrd"===a.id||"allowPlan"===a.id)?"Skipped in Fast Mode":a.description})]},a.id))}),(0,b.jsxs)(x.Tooltip,{children:[(0,b.jsx)(x.TooltipTrigger,{asChild:!0,children:(0,b.jsx)("button",{type:"button",onClick:()=>{let a=R.every(a=>H[a.id]),b={};for(let c of R)b[c.id]=!a;I(b)},disabled:g,className:(0,m.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",R.every(a=>H[a.id])&&"text-primary"),children:"All"})}),(0,b.jsx)(x.TooltipContent,{side:"bottom",children:"Toggle all approval gates"})]})]}),(0,b.jsxs)("div",{className:"border-input flex items-center gap-4 rounded-md border px-3 py-2.5",children:[(0,b.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 text-xs font-semibold tracking-wider",children:"GIT"}),(0,b.jsxs)("div",{className:"flex flex-1 items-center gap-4",children:[(0,b.jsxs)(x.Tooltip,{children:[(0,b.jsx)(x.TooltipTrigger,{asChild:!0,children:(0,b.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,b.jsx)(w.Switch,{id:"push",size:"sm",checked:J||L,onCheckedChange:a=>{K(a),!a&&L&&M(!1)},disabled:g}),(0,b.jsx)(t.Label,{htmlFor:"push",className:"cursor-pointer text-xs font-medium",children:"Push"})]})}),(0,b.jsx)(x.TooltipContent,{side:"bottom",children:"Push branch to remote after implementation."})]}),(0,b.jsxs)(x.Tooltip,{children:[(0,b.jsx)(x.TooltipTrigger,{asChild:!0,children:(0,b.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,b.jsx)(w.Switch,{id:"open-pr",size:"sm",checked:L,onCheckedChange:M,disabled:g}),(0,b.jsx)(t.Label,{htmlFor:"open-pr",className:"cursor-pointer text-xs font-medium",children:"PR"})]})}),(0,b.jsx)(x.TooltipContent,{side:"bottom",children:"Open a pull request after pushing."})]})]})]})]})]})})})})}function U({features:a,value:d,onChange:e,disabled:f}){let[g,h]=(0,c.useState)(!1),[i,l]=(0,c.useState)(""),n=(0,c.useRef)(null),o=a.find(a=>a.id===d),p=i.trim()?a.filter(a=>a.name.toLowerCase().includes(i.toLowerCase())||a.id.toLowerCase().includes(i.toLowerCase())):a,q=(0,c.useCallback)(a=>{e(a),h(!1),l("")},[e]);return(0,c.useEffect)(()=>{g?setTimeout(()=>n.current?.focus(),0):l("")},[g]),(0,b.jsxs)(v.Popover,{open:g,onOpenChange:h,children:[(0,b.jsx)(v.PopoverTrigger,{asChild:!0,children:(0,b.jsxs)("button",{id:"parent-feature",type:"button",role:"combobox","aria-expanded":g,"aria-label":"Parent Feature",disabled:f,"data-testid":"parent-feature-combobox",className:(0,m.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",!o&&"text-muted-foreground"),children:[(0,b.jsx)("span",{className:"truncate",children:o?`${o.name} (${o.id.slice(0,8)})`:"Select parent feature..."}),(0,b.jsx)(j,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,b.jsx)(v.PopoverContent,{className:"w-80 p-0",align:"start","data-testid":"parent-feature-combobox-content",children:(0,b.jsxs)("div",{className:"flex flex-col",children:[(0,b.jsx)("div",{className:"border-b p-2",children:(0,b.jsx)(r.Input,{ref:n,placeholder:"Search features...",value:i,onChange:a=>l(a.target.value),className:"h-8 border-0 p-0 text-sm shadow-none focus-visible:ring-0","data-testid":"parent-feature-search"})}),(0,b.jsxs)("div",{className:"max-h-48 overflow-y-auto py-1",role:"listbox","aria-label":"Features",children:[(0,b.jsxs)("button",{type:"button",role:"option","aria-selected":void 0===d,onClick:()=>q(void 0),className:(0,m.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",void 0===d&&"bg-accent/50"),"data-testid":"parent-feature-option-none",children:[(0,b.jsx)(k.CheckIcon,{className:(0,m.cn)("h-4 w-4 shrink-0",void 0!==d&&"invisible")}),(0,b.jsx)("span",{className:"text-muted-foreground italic",children:"No parent"})]}),0===p.length&&i?(0,b.jsx)("p",{className:"text-muted-foreground px-3 py-2 text-sm",children:"No features found."}):p.map(a=>(0,b.jsxs)("button",{type:"button",role:"option","aria-selected":d===a.id,onClick:()=>q(a.id),className:(0,m.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",d===a.id&&"bg-accent/50"),"data-testid":`parent-feature-option-${a.id}`,children:[(0,b.jsx)(k.CheckIcon,{className:(0,m.cn)("h-4 w-4 shrink-0",d!==a.id&&"invisible")}),(0,b.jsxs)("span",{className:"truncate",children:[a.name," ",(0,b.jsxs)("span",{className:"text-muted-foreground font-mono text-xs",children:["(",a.id.slice(0,8),")"]})]})]},a.id))]})]})})]})}function V({repositoryPath:a,initialParentId:f,features:h,workflowDefaults:i,currentAgentType:j,currentModel:k}){let l=(0,d.useRouter)(),[m,n]=(0,c.useState)(!1),o=(0,d.usePathname)().startsWith("/create"),p=!m&&o;(0,c.useEffect)(()=>{!o&&m&&n(!1)},[o,m]);let q=(0,c.useCallback)(()=>{l.push("/")},[l]),r=(0,c.useCallback)(a=>{n(!0),l.push("/"),g(a).then(b=>{b.error?e.toast.error(b.error):window.dispatchEvent(new CustomEvent("shep:feature-created",{detail:{featureId:b.feature.id,name:b.feature.name,description:b.feature.description,repositoryPath:b.feature.repositoryPath,parentId:a.parentId}}))}).catch(()=>{e.toast.error("Failed to create feature"),n(!1)})},[l]);return(0,b.jsx)(T,{open:p,onClose:q,onSubmit:r,repositoryPath:a,features:h,workflowDefaults:i,initialParentId:f,isSubmitting:m,currentAgentType:j,currentModel:k})}a.s(["CreateDrawerClient",()=>V],93995)}];
1
+ module.exports=[93995,a=>{"use strict";var b=a.i(10973),c=a.i(96960),d=a.i(69845),e=a.i(52313),f=a.i(25674);let g=(0,f.createServerReference)("405c587498fcf213184343b35e7dfe3abe03ac0633",f.callServer,void 0,f.findSourceMapURL,"createFeature");var h=a.i(25700);let i=(0,h.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"}]]),j=(0,h.default)("chevrons-up-down",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);var k=a.i(10606),l=a.i(3942),m=a.i(85536),n=a.i(19884);a.i(78454);var o=a.i(24255),p=a.i(2824),q=a.i(18948),r=a.i(90920);function s({className:a,...c}){return(0,b.jsx)("textarea",{"data-slot":"textarea",className:(0,m.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",a),...c})}var t=a.i(58860),u=a.i(58339),v=a.i(80646),w=a.i(96867),x=a.i(82934),y=a.i(96213),z=a.i(2807),A=a.i(7052),A=A,B=a.i(76096),B=B,C=a.i(45670),D=a.i(50049),D=D;let E=(0,h.default)("file",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]]);var F=a.i(42642),F=F;let G=(0,h.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 H=a.i(40617),H=H;let I=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".ico",".bmp"]),J=new Set([".ts",".tsx",".js",".jsx",".json",".yaml",".yml",".xml",".html",".css",".md"]);function K(a){if(0===a)return"0 B";let b=Math.floor(Math.log(a)/Math.log(1024));return`${(a/Math.pow(1024,b)).toFixed(+(0!==b))} ${["B","KB","MB","GB"][b]}`}let L=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".ico",".bmp"]);function M(a,b){let c=new URLSearchParams({path:a,mimeType:b});return`/api/attachments/preview?${c.toString()}`}function N({name:a,size:c,mimeType:d,path:e,onRemove:f,loading:g=!1,disabled:h=!1}){let i,j,k=(i=a.lastIndexOf("."))>=0?a.slice(i).toLowerCase():"",l=I.has(k)?G:".pdf"===k?F.default:J.has(k)?H.default:E,n=".pdf"===k?"bg-red-50 text-red-600":I.has(k)?"bg-blue-50 text-blue-600":J.has(k)?"bg-emerald-50 text-emerald-600":"bg-gray-50 text-gray-600",o=(j=a.lastIndexOf("."))>=0&&L.has(a.slice(j).toLowerCase());return g?(0,b.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-md border",children:(0,b.jsx)(A.default,{className:"text-muted-foreground h-5 w-5 animate-spin"})}):o?(0,b.jsxs)(C.Dialog,{children:[(0,b.jsxs)("div",{className:"group relative",children:[(0,b.jsx)(C.DialogTrigger,{asChild:!0,children:(0,b.jsx)("img",{src:M(e,d),alt:a,title:a,className:"h-12 w-12 cursor-pointer rounded-md border object-cover transition-opacity hover:opacity-80"})}),!h&&(0,b.jsx)("button",{type:"button",onClick:f,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 ${a}`,children:(0,b.jsx)(z.X,{className:"h-3 w-3"})})]}),(0,b.jsxs)(C.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,b.jsx)(D.Root,{children:(0,b.jsxs)(C.DialogTitle,{children:["Preview: ",a]})}),(0,b.jsx)("div",{className:"relative bg-black/90",children:(0,b.jsx)("img",{src:M(e,d),alt:a,className:"h-auto max-h-[70vh] w-full object-contain"})}),(0,b.jsxs)("div",{className:"bg-background flex items-center gap-3 px-4 py-3",children:[(0,b.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,b.jsx)("span",{className:"truncate text-sm font-medium",children:a}),(0,b.jsx)("span",{className:"text-muted-foreground text-xs",children:K(c)})]}),(0,b.jsx)("a",{href:M(e,d),download:a,className:"text-muted-foreground hover:text-foreground shrink-0 cursor-pointer rounded p-1.5 transition-colors","aria-label":`Download ${a}`,children:(0,b.jsx)(B.default,{className:"h-4 w-4"})})]})]})]}):(0,b.jsxs)("div",{className:"group relative flex items-center gap-2 rounded-full border py-1 pr-3 pl-2",children:[(0,b.jsx)("div",{className:(0,m.cn)("flex h-6 w-6 shrink-0 items-center justify-center rounded-full",n),children:(0,b.jsx)(l,{className:"h-3 w-3"})}),(0,b.jsx)("span",{className:"max-w-[120px] truncate text-sm",children:a}),(0,b.jsx)("span",{className:"text-muted-foreground text-xs",children:K(c)}),!h&&(0,b.jsx)("button",{type:"button",onClick:f,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 ${a}`,children:(0,b.jsx)(z.X,{className:"h-3 w-3"})})]})}var O=a.i(61781);async function P(){let a=await fetch("/api/dialog/pick-files",{method:"POST"});if(!a.ok)throw Error("Failed to open file dialog");let b=await a.json();return b.cancelled?null:b.files}let Q=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"]),R=[{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."}],S={allowPrd:!1,allowPlan:!1,allowMerge:!1};function T({open:a,onClose:d,onSubmit:e,repositoryPath:f,isSubmitting:g=!1,workflowDefaults:h,features:j,initialParentId:k,currentAgentType:r,currentModel:v}){let z=(0,n.useSoundAction)("create"),A=h?.approvalGates??S,B=h?.push??!1,C=h?.openPr??!1,[D,E]=(0,c.useState)(""),[F,G]=(0,c.useState)([]),[H,I]=(0,c.useState)({...A}),[J,K]=(0,c.useState)(B),[L,M]=(0,c.useState)(C),[T,V]=(0,c.useState)(void 0),[W,X]=(0,c.useState)(!1),[Y,Z]=(0,c.useState)(void 0),[$,_]=(0,c.useState)(void 0),[aa,ab]=(0,c.useState)(!1),[ac,ad]=(0,c.useState)(null),ae=(0,c.useRef)(crypto.randomUUID()),af=(0,c.useRef)(0);(0,c.useEffect)(()=>{h&&(I({...h.approvalGates}),K(h.push),M(h.openPr))},[h]),(0,c.useEffect)(()=>{a&&k&&V(k)},[a,k]);let ag=(0,c.useCallback)(()=>{E(""),G([]),I({...A}),K(B),M(C),V(void 0),X(!1),Z(void 0),_(void 0),ad(null),af.current=0,ab(!1)},[A,B,C]),ah=""!==D.trim()||F.length>0,{attemptClose:ai}=(0,y.useGuardedDrawerClose)({open:a,isDirty:ah,onClose:d,onReset:ag}),aj=(0,c.useCallback)(async a=>{for(let b of(ad(null),a)){if(b.size>0xa00000)return void ad(`"${b.name}" exceeds 10 MB limit`);let a=function(a){let b=a.lastIndexOf(".");return b>=0?a.slice(b).toLowerCase():""}(b.name);if(a&&!Q.has(a))return void ad(`File type "${a}" is not allowed`)}for(let b of a){let a=crypto.randomUUID();G(c=>[...c,{id:a,name:b.name,size:b.size,mimeType:b.type||"application/octet-stream",path:"",loading:!0}]);try{let c=new FormData;c.append("file",b),c.append("sessionId",ae.current);let d=await fetch("/api/attachments/upload",{method:"POST",body:c});if(!d.ok){let b=await d.json().catch(()=>({error:"Upload failed"}));G(b=>b.filter(b=>b.id!==a)),ad(b.error??"Upload failed");return}let e=await d.json();G(b=>b.some(b=>b.id!==a&&b.path===e.path)?b.filter(b=>b.id!==a):b.map(b=>b.id===a?{...e,id:a,loading:!1}:b))}catch{G(b=>b.filter(b=>b.id!==a)),ad("Upload failed")}}},[]),ak=(0,c.useCallback)(a=>{a.preventDefault(),a.stopPropagation(),af.current+=1,1===af.current&&ab(!0)},[]),al=(0,c.useCallback)(a=>{a.preventDefault(),a.stopPropagation(),af.current-=1,0===af.current&&ab(!1)},[]),am=(0,c.useCallback)(a=>{a.preventDefault(),a.stopPropagation()},[]),an=(0,c.useCallback)(a=>{a.preventDefault(),a.stopPropagation(),af.current=0,ab(!1);let b=Array.from(a.dataTransfer.files);b.length>0&&aj(b)},[aj]),ao=(0,c.useCallback)(a=>{let b=a.clipboardData?.items;if(!b)return;let c=[];for(let a of Array.from(b))if("file"===a.kind){let b=a.getAsFile();b&&c.push(b)}c.length>0&&(a.preventDefault(),aj(c))},[aj]),ap=(0,c.useCallback)(a=>{a.preventDefault(),D.trim()&&(z.play(),e({description:D.trim(),attachments:F.filter(a=>!a.loading),repositoryPath:f,approvalGates:{allowPrd:H.allowPrd??!1,allowPlan:H.allowPlan??!1,allowMerge:H.allowMerge??!1},push:J||L,openPr:L,fast:W,...Y?{agentType:Y}:{},...$?{model:$}:{},...T?{parentId:T}:{},sessionId:ae.current}),ag())},[D,F,H,f,e,J,L,W,Y,$,T,z,ag]),aq=(0,c.useCallback)(async()=>{try{let a=await P();if(!a)return;for(let b of a){let a=crypto.randomUUID();G(c=>[...c,{id:a,name:b.name,size:b.size,mimeType:"application/octet-stream",path:"",loading:!0}]);try{let c=await fetch("/api/attachments/upload-from-path",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:b.path,sessionId:ae.current})});if(!c.ok){let b=await c.json().catch(()=>({error:"Upload failed"}));G(b=>b.filter(b=>b.id!==a)),ad(b.error??"Upload failed");return}let d=await c.json();G(b=>b.some(b=>b.id!==a&&b.path===d.path)?b.filter(b=>b.id!==a):b.map(b=>b.id===a?{...d,id:a,loading:!1}:b))}catch{G(b=>b.filter(b=>b.id!==a)),ad("Upload failed")}}}catch{}},[]),ar=(0,c.useCallback)(a=>{G(b=>b.filter(b=>b.id!==a))},[]),as=(0,c.useRef)(null),at=(0,c.useCallback)(a=>{(a.ctrlKey||a.metaKey)&&"Enter"===a.key&&(a.preventDefault(),as.current?.requestSubmit())},[]),au=j&&j.length>0;return(0,b.jsx)(o.BaseDrawer,{open:a,onClose:ai,size:"md",modal:!1,dismissOnOutsideClick:!0,"data-testid":"feature-create-drawer",header:(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("div",{className:"h-2.5 w-2.5 shrink-0 rounded-full bg-blue-500"}),(0,b.jsx)(p.DrawerTitle,{children:"NEW FEATURE"})]}),g?(0,b.jsx)(p.DrawerDescription,{asChild:!0,children:(0,b.jsx)("div",{children:(0,b.jsx)(u.Badge,{variant:"secondary",children:"Creating..."})})}):null]}),footer:(0,b.jsxs)("div",{className:"flex flex-row justify-end gap-2",children:[(0,b.jsx)(q.Button,{variant:"outline",onClick:ai,disabled:g,children:"Cancel"}),(0,b.jsx)(q.Button,{type:"submit",form:"create-feature-form",disabled:!D.trim()||g,children:g?"Creating...":"+ Create Feature"})]}),children:(0,b.jsx)("div",{className:"overflow-y-auto p-4",children:(0,b.jsx)(x.TooltipProvider,{delayDuration:400,children:(0,b.jsxs)("form",{ref:as,id:"create-feature-form",onSubmit:ap,className:"flex flex-col gap-4",children:[(0,b.jsxs)("div",{role:"region","aria-label":"File drop zone","data-drag-over":aa?"true":"false",onDragEnter:ak,onDragLeave:al,onDragOver:am,onDrop:an,className:(0,m.cn)("flex flex-col gap-1.5 rounded-md border-2 border-transparent p-1 transition-colors",aa&&"border-primary/50 bg-primary/5"),children:[(0,b.jsx)(t.Label,{htmlFor:"feature-description",className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"DESCRIBE YOUR FEATURE"}),(0,b.jsxs)("div",{className:"border-input focus-within:ring-ring/50 focus-within:border-ring flex h-56 flex-col overflow-hidden rounded-md border shadow-xs transition-[color,box-shadow] focus-within:ring-[3px]",children:[(0,b.jsx)(s,{id:"feature-description",placeholder:"e.g. Add GitHub OAuth login with callback handling and token refresh...",value:D,onChange:a=>E(a.target.value),onKeyDown:at,onPaste:ao,required:!0,disabled:g,className:"min-h-0 flex-1 resize-none rounded-none border-0 shadow-none focus-visible:ring-0"}),F.length>0&&(0,b.jsx)("div",{className:"flex flex-wrap items-center gap-1.5 px-3 py-2",children:F.map(a=>(0,b.jsx)(N,{name:a.name,size:a.size,mimeType:a.mimeType,path:a.path,onRemove:()=>ar(a.id),disabled:g,loading:a.loading},a.id))}),ac?(0,b.jsx)("p",{className:"text-destructive px-3 pb-2 text-xs",children:ac}):null,(0,b.jsxs)("div",{className:"border-input flex items-center gap-3 border-t px-3 py-1.5",children:[(0,b.jsx)(O.AgentModelPicker,{initialAgentType:Y??r??"claude-code",initialModel:$??v??"claude-sonnet-4-6",mode:"override",onAgentModelChange:(a,b)=>{Z(a),_(b)},disabled:g,className:"w-55"}),(0,b.jsxs)(x.Tooltip,{children:[(0,b.jsx)(x.TooltipTrigger,{asChild:!0,children:(0,b.jsxs)("div",{className:"ml-auto flex cursor-pointer items-center gap-2",children:[(0,b.jsx)(w.Switch,{id:"fast-mode",checked:W,onCheckedChange:X,disabled:g}),(0,b.jsxs)(t.Label,{htmlFor:"fast-mode",className:"flex cursor-pointer items-center gap-1 text-sm font-medium",children:[(0,b.jsx)(l.Zap,{className:"h-3.5 w-3.5"}),"Fast Mode"]})]})}),(0,b.jsx)(x.TooltipContent,{side:"bottom",children:"Skip SDLC phases and implement directly from your prompt."})]}),(0,b.jsxs)(x.Tooltip,{children:[(0,b.jsx)(x.TooltipTrigger,{asChild:!0,children:(0,b.jsx)("button",{type:"button",onClick:aq,disabled:g,"aria-label":"Attach files",className:"text-muted-foreground hover:text-foreground cursor-pointer rounded p-1 transition-colors",children:(0,b.jsx)(i,{className:"h-4 w-4"})})}),(0,b.jsx)(x.TooltipContent,{side:"bottom",children:"Attach files"})]})]})]})]}),au&&void 0!==k?(0,b.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,b.jsx)(t.Label,{htmlFor:"parent-feature",className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"PARENT FEATURE"}),(0,b.jsx)(U,{features:j,value:T,onChange:V,disabled:g})]}):null,(0,b.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,b.jsxs)("div",{className:"border-input flex items-center gap-4 rounded-md border px-3 py-2.5",children:[(0,b.jsxs)(x.Tooltip,{children:[(0,b.jsx)(x.TooltipTrigger,{asChild:!0,children:(0,b.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 cursor-default text-xs font-semibold tracking-wider",children:"APPROVE"})}),(0,b.jsx)(x.TooltipContent,{side:"bottom",children:"Auto-approve phase transitions without manual review."})]}),(0,b.jsx)("div",{className:"flex flex-1 items-center gap-4",children:R.map(a=>(0,b.jsxs)(x.Tooltip,{children:[(0,b.jsx)(x.TooltipTrigger,{asChild:!0,children:(0,b.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,b.jsx)(w.Switch,{id:`approve-${a.id}`,size:"sm",checked:H[a.id]??!1,onCheckedChange:b=>I(c=>({...c,[a.id]:b})),disabled:g||W&&("allowPrd"===a.id||"allowPlan"===a.id)}),(0,b.jsx)(t.Label,{htmlFor:`approve-${a.id}`,className:"cursor-pointer text-xs font-medium",children:a.label})]})}),(0,b.jsx)(x.TooltipContent,{side:"bottom",children:W&&("allowPrd"===a.id||"allowPlan"===a.id)?"Skipped in Fast Mode":a.description})]},a.id))}),(0,b.jsxs)(x.Tooltip,{children:[(0,b.jsx)(x.TooltipTrigger,{asChild:!0,children:(0,b.jsx)("button",{type:"button",onClick:()=>{let a=R.every(a=>H[a.id]),b={};for(let c of R)b[c.id]=!a;I(b)},disabled:g,className:(0,m.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",R.every(a=>H[a.id])&&"text-primary"),children:"All"})}),(0,b.jsx)(x.TooltipContent,{side:"bottom",children:"Toggle all approval gates"})]})]}),(0,b.jsxs)("div",{className:"border-input flex items-center gap-4 rounded-md border px-3 py-2.5",children:[(0,b.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 text-xs font-semibold tracking-wider",children:"GIT"}),(0,b.jsxs)("div",{className:"flex flex-1 items-center gap-4",children:[(0,b.jsxs)(x.Tooltip,{children:[(0,b.jsx)(x.TooltipTrigger,{asChild:!0,children:(0,b.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,b.jsx)(w.Switch,{id:"push",size:"sm",checked:J||L,onCheckedChange:a=>{K(a),!a&&L&&M(!1)},disabled:g}),(0,b.jsx)(t.Label,{htmlFor:"push",className:"cursor-pointer text-xs font-medium",children:"Push"})]})}),(0,b.jsx)(x.TooltipContent,{side:"bottom",children:"Push branch to remote after implementation."})]}),(0,b.jsxs)(x.Tooltip,{children:[(0,b.jsx)(x.TooltipTrigger,{asChild:!0,children:(0,b.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,b.jsx)(w.Switch,{id:"open-pr",size:"sm",checked:L,onCheckedChange:M,disabled:g}),(0,b.jsx)(t.Label,{htmlFor:"open-pr",className:"cursor-pointer text-xs font-medium",children:"PR"})]})}),(0,b.jsx)(x.TooltipContent,{side:"bottom",children:"Open a pull request after pushing."})]})]})]})]})]})})})})}function U({features:a,value:d,onChange:e,disabled:f}){let[g,h]=(0,c.useState)(!1),[i,l]=(0,c.useState)(""),n=(0,c.useRef)(null),o=a.find(a=>a.id===d),p=i.trim()?a.filter(a=>a.name.toLowerCase().includes(i.toLowerCase())||a.id.toLowerCase().includes(i.toLowerCase())):a,q=(0,c.useCallback)(a=>{e(a),h(!1),l("")},[e]);return(0,c.useEffect)(()=>{g?setTimeout(()=>n.current?.focus(),0):l("")},[g]),(0,b.jsxs)(v.Popover,{open:g,onOpenChange:h,children:[(0,b.jsx)(v.PopoverTrigger,{asChild:!0,children:(0,b.jsxs)("button",{id:"parent-feature",type:"button",role:"combobox","aria-expanded":g,"aria-label":"Parent Feature",disabled:f,"data-testid":"parent-feature-combobox",className:(0,m.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",!o&&"text-muted-foreground"),children:[(0,b.jsx)("span",{className:"truncate",children:o?`${o.name} (${o.id.slice(0,8)})`:"Select parent feature..."}),(0,b.jsx)(j,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,b.jsx)(v.PopoverContent,{className:"w-80 p-0",align:"start","data-testid":"parent-feature-combobox-content",children:(0,b.jsxs)("div",{className:"flex flex-col",children:[(0,b.jsx)("div",{className:"border-b p-2",children:(0,b.jsx)(r.Input,{ref:n,placeholder:"Search features...",value:i,onChange:a=>l(a.target.value),className:"h-8 border-0 p-0 text-sm shadow-none focus-visible:ring-0","data-testid":"parent-feature-search"})}),(0,b.jsxs)("div",{className:"max-h-48 overflow-y-auto py-1",role:"listbox","aria-label":"Features",children:[(0,b.jsxs)("button",{type:"button",role:"option","aria-selected":void 0===d,onClick:()=>q(void 0),className:(0,m.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",void 0===d&&"bg-accent/50"),"data-testid":"parent-feature-option-none",children:[(0,b.jsx)(k.CheckIcon,{className:(0,m.cn)("h-4 w-4 shrink-0",void 0!==d&&"invisible")}),(0,b.jsx)("span",{className:"text-muted-foreground italic",children:"No parent"})]}),0===p.length&&i?(0,b.jsx)("p",{className:"text-muted-foreground px-3 py-2 text-sm",children:"No features found."}):p.map(a=>(0,b.jsxs)("button",{type:"button",role:"option","aria-selected":d===a.id,onClick:()=>q(a.id),className:(0,m.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",d===a.id&&"bg-accent/50"),"data-testid":`parent-feature-option-${a.id}`,children:[(0,b.jsx)(k.CheckIcon,{className:(0,m.cn)("h-4 w-4 shrink-0",d!==a.id&&"invisible")}),(0,b.jsxs)("span",{className:"truncate",children:[a.name," ",(0,b.jsxs)("span",{className:"text-muted-foreground font-mono text-xs",children:["(",a.id.slice(0,8),")"]})]})]},a.id))]})]})})]})}function V({repositoryPath:a,initialParentId:f,features:h,workflowDefaults:i,currentAgentType:j,currentModel:k}){let l=(0,d.useRouter)(),[m,n]=(0,c.useState)(!1),o=(0,d.usePathname)().startsWith("/create"),p=!m&&o;(0,c.useEffect)(()=>{!o&&m&&n(!1)},[o,m]);let q=(0,c.useCallback)(()=>{l.push("/")},[l]),r=(0,c.useCallback)(a=>{n(!0),l.push("/"),g(a).then(b=>{b.error?e.toast.error(b.error):window.dispatchEvent(new CustomEvent("shep:feature-created",{detail:{featureId:b.feature.id,name:b.feature.name,description:b.feature.description,repositoryPath:b.feature.repositoryPath,parentId:a.parentId}}))}).catch(()=>{e.toast.error("Failed to create feature"),n(!1)})},[l]);return(0,b.jsx)(T,{open:p,onClose:q,onSubmit:r,repositoryPath:a,features:h,workflowDefaults:i,initialParentId:f,isSubmitting:m,currentAgentType:j,currentModel:k})}a.s(["CreateDrawerClient",()=>V],93995)}];
2
2
 
3
3
  //# sourceMappingURL=744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js.map