@shipit-ai/cli 1.166.1 → 1.166.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (283) hide show
  1. package/dist/packages/core/src/application/use-cases/features/create/create-feature.use-case.d.ts.map +1 -1
  2. package/dist/packages/core/src/application/use-cases/features/create/create-feature.use-case.js +19 -2
  3. package/dist/packages/core/src/infrastructure/services/external/github-repository.service.d.ts.map +1 -1
  4. package/dist/packages/core/src/infrastructure/services/external/github-repository.service.js +14 -3
  5. package/dist/src/presentation/web/app/actions/deploy-repository.d.ts.map +1 -1
  6. package/dist/src/presentation/web/app/actions/deploy-repository.js +14 -7
  7. package/dist/src/presentation/web/app/actions/get-merge-review-data.d.ts.map +1 -1
  8. package/dist/src/presentation/web/app/actions/get-merge-review-data.js +66 -23
  9. package/dist/src/presentation/web/app/actions/open-folder.d.ts.map +1 -1
  10. package/dist/src/presentation/web/app/actions/open-folder.js +12 -4
  11. package/dist/src/presentation/web/app/actions/open-shell.d.ts.map +1 -1
  12. package/dist/src/presentation/web/app/actions/open-shell.js +46 -7
  13. package/dist/src/presentation/web/app/api/agent-events/route.d.ts.map +1 -1
  14. package/dist/src/presentation/web/app/api/agent-events/route.js +2 -6
  15. package/dist/src/presentation/web/app/api/attachments/upload-from-path/route.d.ts.map +1 -1
  16. package/dist/src/presentation/web/app/api/attachments/upload-from-path/route.js +21 -17
  17. package/dist/src/presentation/web/app/api/deployment-logs/route.d.ts.map +1 -1
  18. package/dist/src/presentation/web/app/api/deployment-logs/route.js +2 -6
  19. package/dist/src/presentation/web/app/api/directory/list/route.d.ts.map +1 -1
  20. package/dist/src/presentation/web/app/api/directory/list/route.js +39 -24
  21. package/dist/src/presentation/web/app/api/interactive/chat/[featureId]/stream/route.d.ts.map +1 -1
  22. package/dist/src/presentation/web/app/api/interactive/chat/[featureId]/stream/route.js +2 -6
  23. package/dist/src/presentation/web/app/api/interactive/sessions/[id]/stream/route.d.ts.map +1 -1
  24. package/dist/src/presentation/web/app/api/interactive/sessions/[id]/stream/route.js +2 -6
  25. package/dist/src/presentation/web/lib/path-sanitizers.d.ts +50 -0
  26. package/dist/src/presentation/web/lib/path-sanitizers.d.ts.map +1 -0
  27. package/dist/src/presentation/web/lib/path-sanitizers.js +136 -0
  28. package/dist/tsconfig.build.tsbuildinfo +1 -1
  29. package/package.json +6 -6
  30. package/web/.next/BUILD_ID +1 -1
  31. package/web/.next/build-manifest.json +3 -3
  32. package/web/.next/fallback-build-manifest.json +3 -3
  33. package/web/.next/prerender-manifest.json +3 -3
  34. package/web/.next/required-server-files.js +2 -2
  35. package/web/.next/required-server-files.json +2 -2
  36. package/web/.next/server/app/(dashboard)/@drawer/adopt/page/server-reference-manifest.json +29 -29
  37. package/web/.next/server/app/(dashboard)/@drawer/adopt/page.js +1 -1
  38. package/web/.next/server/app/(dashboard)/@drawer/adopt/page.js.nft.json +1 -1
  39. package/web/.next/server/app/(dashboard)/@drawer/adopt/page_client-reference-manifest.js +1 -1
  40. package/web/.next/server/app/(dashboard)/@drawer/chat/page/server-reference-manifest.json +27 -27
  41. package/web/.next/server/app/(dashboard)/@drawer/chat/page.js +1 -1
  42. package/web/.next/server/app/(dashboard)/@drawer/chat/page.js.nft.json +1 -1
  43. package/web/.next/server/app/(dashboard)/@drawer/chat/page_client-reference-manifest.js +1 -1
  44. package/web/.next/server/app/(dashboard)/@drawer/create/page/server-reference-manifest.json +30 -30
  45. package/web/.next/server/app/(dashboard)/@drawer/create/page.js +1 -1
  46. package/web/.next/server/app/(dashboard)/@drawer/create/page.js.nft.json +1 -1
  47. package/web/.next/server/app/(dashboard)/@drawer/create/page_client-reference-manifest.js +1 -1
  48. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/server-reference-manifest.json +37 -37
  49. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js +3 -2
  50. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  51. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  52. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/server-reference-manifest.json +37 -37
  53. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js +3 -2
  54. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js.nft.json +1 -1
  55. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page_client-reference-manifest.js +1 -1
  56. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page/server-reference-manifest.json +28 -28
  57. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page.js +1 -1
  58. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page.js.nft.json +1 -1
  59. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page_client-reference-manifest.js +1 -1
  60. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/server-reference-manifest.json +28 -28
  61. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js +1 -1
  62. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js.nft.json +1 -1
  63. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  64. package/web/.next/server/app/(dashboard)/chat/page/server-reference-manifest.json +27 -27
  65. package/web/.next/server/app/(dashboard)/chat/page.js +1 -1
  66. package/web/.next/server/app/(dashboard)/chat/page.js.nft.json +1 -1
  67. package/web/.next/server/app/(dashboard)/chat/page_client-reference-manifest.js +1 -1
  68. package/web/.next/server/app/(dashboard)/create/page/server-reference-manifest.json +30 -30
  69. package/web/.next/server/app/(dashboard)/create/page.js +1 -1
  70. package/web/.next/server/app/(dashboard)/create/page.js.nft.json +1 -1
  71. package/web/.next/server/app/(dashboard)/create/page_client-reference-manifest.js +1 -1
  72. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/server-reference-manifest.json +37 -37
  73. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js +3 -2
  74. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  75. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  76. package/web/.next/server/app/(dashboard)/feature/[featureId]/page/server-reference-manifest.json +37 -37
  77. package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js +3 -2
  78. package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js.nft.json +1 -1
  79. package/web/.next/server/app/(dashboard)/feature/[featureId]/page_client-reference-manifest.js +1 -1
  80. package/web/.next/server/app/(dashboard)/page/server-reference-manifest.json +27 -27
  81. package/web/.next/server/app/(dashboard)/page.js +1 -1
  82. package/web/.next/server/app/(dashboard)/page.js.nft.json +1 -1
  83. package/web/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
  84. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page/server-reference-manifest.json +28 -28
  85. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page.js +1 -1
  86. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page.js.nft.json +1 -1
  87. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page_client-reference-manifest.js +1 -1
  88. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/server-reference-manifest.json +28 -28
  89. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js +1 -1
  90. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js.nft.json +1 -1
  91. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  92. package/web/.next/server/app/_global-error.html +1 -1
  93. package/web/.next/server/app/_global-error.rsc +1 -1
  94. package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  95. package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  96. package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  97. package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  98. package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  99. package/web/.next/server/app/_not-found/page/server-reference-manifest.json +6 -6
  100. package/web/.next/server/app/_not-found/page.js +1 -1
  101. package/web/.next/server/app/_not-found/page.js.nft.json +1 -1
  102. package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  103. package/web/.next/server/app/api/agent-events/route.js +2 -1
  104. package/web/.next/server/app/api/agent-events/route.js.nft.json +1 -1
  105. package/web/.next/server/app/api/attachments/preview/route.js +1 -1
  106. package/web/.next/server/app/api/attachments/preview/route.js.nft.json +1 -1
  107. package/web/.next/server/app/api/attachments/upload-from-path/route.js +1 -1
  108. package/web/.next/server/app/api/attachments/upload-from-path/route.js.nft.json +1 -1
  109. package/web/.next/server/app/api/deployment-logs/route.js +2 -1
  110. package/web/.next/server/app/api/deployment-logs/route.js.nft.json +1 -1
  111. package/web/.next/server/app/api/dialog/pick-files/route.js +1 -1
  112. package/web/.next/server/app/api/dialog/pick-files/route.js.nft.json +1 -1
  113. package/web/.next/server/app/api/directory/list/route.js +1 -1
  114. package/web/.next/server/app/api/directory/list/route.js.nft.json +1 -1
  115. package/web/.next/server/app/api/evidence/route.js +1 -1
  116. package/web/.next/server/app/api/evidence/route.js.nft.json +1 -1
  117. package/web/.next/server/app/api/graph-data/route.js +1 -1
  118. package/web/.next/server/app/api/graph-data/route.js.nft.json +1 -1
  119. package/web/.next/server/app/api/interactive/chat/[featureId]/messages/route.js +1 -1
  120. package/web/.next/server/app/api/interactive/chat/[featureId]/messages/route.js.nft.json +1 -1
  121. package/web/.next/server/app/api/interactive/chat/[featureId]/stream/route.js +2 -1
  122. package/web/.next/server/app/api/interactive/chat/[featureId]/stream/route.js.nft.json +1 -1
  123. package/web/.next/server/app/api/interactive/sessions/[id]/stream/route.js +2 -1
  124. package/web/.next/server/app/api/interactive/sessions/[id]/stream/route.js.nft.json +1 -1
  125. package/web/.next/server/app/api/sessions-batch/route.js +1 -1
  126. package/web/.next/server/app/api/sessions-batch/route.js.nft.json +1 -1
  127. package/web/.next/server/app/settings/page/server-reference-manifest.json +11 -11
  128. package/web/.next/server/app/settings/page.js +1 -1
  129. package/web/.next/server/app/settings/page.js.nft.json +1 -1
  130. package/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  131. package/web/.next/server/app/skills/page/server-reference-manifest.json +11 -11
  132. package/web/.next/server/app/skills/page.js +1 -1
  133. package/web/.next/server/app/skills/page.js.nft.json +1 -1
  134. package/web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  135. package/web/.next/server/app/tools/page/server-reference-manifest.json +11 -11
  136. package/web/.next/server/app/tools/page.js +1 -1
  137. package/web/.next/server/app/tools/page.js.nft.json +1 -1
  138. package/web/.next/server/app/tools/page_client-reference-manifest.js +1 -1
  139. package/web/.next/server/app/version/page/server-reference-manifest.json +6 -6
  140. package/web/.next/server/app/version/page.js +1 -1
  141. package/web/.next/server/app/version/page.js.nft.json +1 -1
  142. package/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
  143. package/web/.next/server/chunks/{[root-of-the-server]__02xmnal._.js → [root-of-the-server]__08cpfre._.js} +2 -2
  144. package/web/.next/server/chunks/[root-of-the-server]__0_-chcy._.js +3 -0
  145. package/web/.next/server/chunks/[root-of-the-server]__0_-chcy._.js.map +1 -0
  146. package/web/.next/server/chunks/[root-of-the-server]__0aft8l4._.js +9 -0
  147. package/web/.next/server/chunks/{[root-of-the-server]__0_6fhza._.js.map → [root-of-the-server]__0aft8l4._.js.map} +1 -1
  148. package/web/.next/server/chunks/[root-of-the-server]__0e9p7em._.js +3 -0
  149. package/web/.next/server/chunks/[root-of-the-server]__0e9p7em._.js.map +1 -0
  150. package/web/.next/server/chunks/{[root-of-the-server]__0.2exzi._.js → [root-of-the-server]__0gfvkg8._.js} +2 -2
  151. package/web/.next/server/chunks/{[root-of-the-server]__0ip_e1x._.js → [root-of-the-server]__0hcp97v._.js} +2 -2
  152. package/web/.next/server/chunks/{[root-of-the-server]__09118p2._.js → [root-of-the-server]__0iel39d._.js} +2 -2
  153. package/web/.next/server/chunks/[root-of-the-server]__0kc8ify._.js +12 -0
  154. package/web/.next/server/chunks/[root-of-the-server]__0kc8ify._.js.map +1 -0
  155. package/web/.next/server/chunks/[root-of-the-server]__0r5uk_8._.js +9 -0
  156. package/web/.next/server/chunks/[root-of-the-server]__0r5uk_8._.js.map +1 -0
  157. package/web/.next/server/chunks/[root-of-the-server]__0tb~wwk._.js +1 -1
  158. package/web/.next/server/chunks/{[root-of-the-server]__04jjtl_._.js → [root-of-the-server]__0u1jyv9._.js} +2 -2
  159. package/web/.next/server/chunks/{[root-of-the-server]__07suer1._.js → [root-of-the-server]__0zu_byw._.js} +2 -2
  160. package/web/.next/server/chunks/[root-of-the-server]__13e2_kk._.js +18 -0
  161. package/web/.next/server/chunks/[root-of-the-server]__13e2_kk._.js.map +1 -0
  162. package/web/.next/server/chunks/ssr/0j.8_web__next-internal_server_app_(dashboard)_@drawer_adopt_page_actions_00~eq5i.js +1 -1
  163. package/web/.next/server/chunks/ssr/0j.8_web__next-internal_server_app_(dashboard)_@drawer_adopt_page_actions_00~eq5i.js.map +1 -1
  164. package/web/.next/server/chunks/ssr/0j.8_web__next-internal_server_app_(dashboard)_@drawer_chat_page_actions_0979_c..js +1 -1
  165. package/web/.next/server/chunks/ssr/0j.8_web__next-internal_server_app_(dashboard)_@drawer_chat_page_actions_0979_c..js.map +1 -1
  166. package/web/.next/server/chunks/ssr/0j.8_web__next-internal_server_app_(dashboard)_chat_page_actions_0dqll_1.js +1 -1
  167. package/web/.next/server/chunks/ssr/0j.8_web__next-internal_server_app_(dashboard)_chat_page_actions_0dqll_1.js.map +1 -1
  168. package/web/.next/server/chunks/ssr/0j.8_web_components_common_control-center-drawer_create-drawer-client_tsx_0g70fc5._.js +1 -1
  169. package/web/.next/server/chunks/ssr/0j.8_web_components_common_control-center-drawer_create-drawer-client_tsx_0g70fc5._.js.map +1 -1
  170. package/web/.next/server/chunks/ssr/0j.8_web_components_common_control-center-drawer_feature-drawer-client_tsx_104cna.._.js +2 -2
  171. package/web/.next/server/chunks/ssr/0j.8_web_components_common_control-center-drawer_feature-drawer-client_tsx_104cna.._.js.map +1 -1
  172. package/web/.next/server/chunks/ssr/0ukq_presentation_web_components_features_settings_settings-page-client_tsx_0j1uius._.js +1 -1
  173. package/web/.next/server/chunks/ssr/0ukq_presentation_web_components_features_settings_settings-page-client_tsx_0j1uius._.js.map +1 -1
  174. package/web/.next/server/chunks/ssr/11y9_components_common_control-center-drawer_repository-drawer-client_tsx_09z.znp._.js +1 -1
  175. package/web/.next/server/chunks/ssr/11y9_components_common_control-center-drawer_repository-drawer-client_tsx_09z.znp._.js.map +1 -1
  176. package/web/.next/server/chunks/ssr/[root-of-the-server]__04nnbmc._.js +3 -0
  177. package/web/.next/server/chunks/ssr/[root-of-the-server]__04nnbmc._.js.map +1 -0
  178. package/web/.next/server/chunks/ssr/[root-of-the-server]__07740t6._.js +3 -0
  179. package/web/.next/server/chunks/ssr/[root-of-the-server]__07740t6._.js.map +1 -0
  180. package/web/.next/server/chunks/ssr/[root-of-the-server]__0l~puw4._.js +3 -0
  181. package/web/.next/server/chunks/ssr/[root-of-the-server]__0l~puw4._.js.map +1 -0
  182. package/web/.next/server/chunks/ssr/[root-of-the-server]__0o3qggc._.js +1 -1
  183. package/web/.next/server/chunks/ssr/[root-of-the-server]__0o3qggc._.js.map +1 -1
  184. package/web/.next/server/chunks/ssr/{[root-of-the-server]__0qh.wn.._.js → [root-of-the-server]__0q3-gz.._.js} +2 -2
  185. package/web/.next/server/chunks/ssr/[root-of-the-server]__0rv1gci._.js +1 -1
  186. package/web/.next/server/chunks/ssr/[root-of-the-server]__0vwjc_m._.js +3 -0
  187. package/web/.next/server/chunks/ssr/[root-of-the-server]__0vwjc_m._.js.map +1 -0
  188. package/web/.next/server/chunks/ssr/{[root-of-the-server]__12g8h3_._.js → [root-of-the-server]__0w4__yd._.js} +3 -3
  189. package/web/.next/server/chunks/ssr/_01mq~sm._.js +1 -1
  190. package/web/.next/server/chunks/ssr/_01mq~sm._.js.map +1 -1
  191. package/web/.next/server/chunks/ssr/_01sesw0._.js +1 -1
  192. package/web/.next/server/chunks/ssr/_01sesw0._.js.map +1 -1
  193. package/web/.next/server/chunks/ssr/{_0e4npv~._.js → _04rrcmm._.js} +2 -2
  194. package/web/.next/server/chunks/ssr/{_0e4npv~._.js.map → _04rrcmm._.js.map} +1 -1
  195. package/web/.next/server/chunks/ssr/{_0nvrqsj._.js → _0c497sr._.js} +2 -2
  196. package/web/.next/server/chunks/ssr/{_0nvrqsj._.js.map → _0c497sr._.js.map} +1 -1
  197. package/web/.next/server/chunks/ssr/{_0a-ddx-._.js → _0c741v_._.js} +2 -2
  198. package/web/.next/server/chunks/ssr/{_0a-ddx-._.js.map → _0c741v_._.js.map} +1 -1
  199. package/web/.next/server/chunks/ssr/_0jpbsh_._.js +1 -1
  200. package/web/.next/server/chunks/ssr/_0jpbsh_._.js.map +1 -1
  201. package/web/.next/server/chunks/ssr/_0vyfc4b._.js +1 -1
  202. package/web/.next/server/chunks/ssr/_0vyfc4b._.js.map +1 -1
  203. package/web/.next/server/chunks/ssr/_0w-_hww._.js +1 -1
  204. package/web/.next/server/chunks/ssr/_0w-_hww._.js.map +1 -1
  205. package/web/.next/server/chunks/ssr/_0~7lwu_._.js +1 -1
  206. package/web/.next/server/chunks/ssr/_0~7lwu_._.js.map +1 -1
  207. package/web/.next/server/chunks/ssr/_109n-y4._.js +1 -1
  208. package/web/.next/server/chunks/ssr/src_presentation_web_0.e4~xc._.js +1 -1
  209. package/web/.next/server/chunks/ssr/src_presentation_web_0.e4~xc._.js.map +1 -1
  210. package/web/.next/server/chunks/ssr/src_presentation_web_00dvh.m._.js +1 -1
  211. package/web/.next/server/chunks/ssr/src_presentation_web_00dvh.m._.js.map +1 -1
  212. package/web/.next/server/chunks/ssr/src_presentation_web_06b6~lt._.js +2 -2
  213. package/web/.next/server/chunks/ssr/src_presentation_web_06b6~lt._.js.map +1 -1
  214. package/web/.next/server/chunks/ssr/src_presentation_web_08fy2mf._.js +1 -1
  215. package/web/.next/server/chunks/ssr/src_presentation_web_08fy2mf._.js.map +1 -1
  216. package/web/.next/server/chunks/ssr/src_presentation_web_0f~udu1._.js +1 -1
  217. package/web/.next/server/chunks/ssr/src_presentation_web_0f~udu1._.js.map +1 -1
  218. package/web/.next/server/chunks/ssr/src_presentation_web_0qys821._.js +2 -2
  219. package/web/.next/server/chunks/ssr/src_presentation_web_0qys821._.js.map +1 -1
  220. package/web/.next/server/chunks/ssr/src_presentation_web_0q~dt0o._.js +1 -1
  221. package/web/.next/server/chunks/ssr/src_presentation_web_0q~dt0o._.js.map +1 -1
  222. package/web/.next/server/chunks/ssr/src_presentation_web_11jrkxt._.js +1 -1
  223. package/web/.next/server/chunks/ssr/src_presentation_web_11jrkxt._.js.map +1 -1
  224. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_1199d3x.js +1 -1
  225. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_1199d3x.js.map +1 -1
  226. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app__not-found_page_actions_0m2jqxx.js +1 -1
  227. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app__not-found_page_actions_0m2jqxx.js.map +1 -1
  228. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_version_page_actions_0krkh_0.js +1 -1
  229. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_version_page_actions_0krkh_0.js.map +1 -1
  230. package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_approve-feature_ts_0pjb_re._.js +3 -0
  231. package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_approve-feature_ts_0pjb_re._.js.map +1 -0
  232. package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_load-settings_ts_0b8f3pf._.js +1 -1
  233. package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_open-ide_ts_0w2wqvu._.js +1 -1
  234. package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_open-ide_ts_0w2wqvu._.js.map +1 -1
  235. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_0l3oxx9._.js +1 -1
  236. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_0l3oxx9._.js.map +1 -1
  237. package/web/.next/server/middleware-build-manifest.js +3 -3
  238. package/web/.next/server/pages/500.html +1 -1
  239. package/web/.next/server/server-reference-manifest.js +1 -1
  240. package/web/.next/server/server-reference-manifest.json +49 -49
  241. package/web/.next/static/chunks/{0t.pzrmeoq6th.js → 0-fy~80ui.5os.js} +1 -1
  242. package/web/.next/static/chunks/{00dg6gti40.3i.js → 039ic1ygq-to3.js} +1 -1
  243. package/web/.next/static/chunks/{0ntgq3d_.m5el.js → 04xk1iouwcfcq.js} +3 -3
  244. package/web/.next/static/chunks/{0njrgvmyafrod.js → 07a4jt64wdipb.js} +1 -1
  245. package/web/.next/static/chunks/{14g1l3~6i5251.js → 07gx-h_y91lay.js} +1 -1
  246. package/web/.next/static/chunks/{0ist7260j__0m.js → 0_imq4rg3q.fe.js} +2 -2
  247. package/web/.next/static/chunks/{09dqgshddfxff.js → 0c_bi0dck80dt.js} +1 -1
  248. package/web/.next/static/chunks/{0awttldb-.7m..js → 0ex35-_jtxyjc.js} +1 -1
  249. package/web/.next/static/chunks/{0_c5~n__lz4ks.js → 0i084mozx131g.js} +1 -1
  250. package/web/.next/static/chunks/{0_--5mgqukm__.js → 0k~55i.ofbdeb.js} +1 -1
  251. package/web/.next/static/chunks/{0t8zwgaz.d1s5.js → 0oq-cvtg8rjjp.js} +1 -1
  252. package/web/.next/static/chunks/{0d-2jp.f._l2e.js → 0t_6hx6ul7umb.js} +1 -1
  253. package/web/.next/static/chunks/{0nk2r-18.7g6r.js → 0whez3wju~9ok.js} +1 -1
  254. package/web/.next/server/chunks/[root-of-the-server]__0-3b27b._.js +0 -9
  255. package/web/.next/server/chunks/[root-of-the-server]__0-3b27b._.js.map +0 -1
  256. package/web/.next/server/chunks/[root-of-the-server]__0_6fhza._.js +0 -9
  257. package/web/.next/server/chunks/[root-of-the-server]__0esdmru._.js +0 -12
  258. package/web/.next/server/chunks/[root-of-the-server]__0esdmru._.js.map +0 -1
  259. package/web/.next/server/chunks/[root-of-the-server]__0l1p8bx._.js +0 -3
  260. package/web/.next/server/chunks/[root-of-the-server]__0l1p8bx._.js.map +0 -1
  261. package/web/.next/server/chunks/[root-of-the-server]__0p~owgt._.js +0 -18
  262. package/web/.next/server/chunks/[root-of-the-server]__0p~owgt._.js.map +0 -1
  263. package/web/.next/server/chunks/[root-of-the-server]__0rru~m.._.js +0 -3
  264. package/web/.next/server/chunks/[root-of-the-server]__0rru~m.._.js.map +0 -1
  265. package/web/.next/server/chunks/ssr/[root-of-the-server]__045sv4b._.js +0 -3
  266. package/web/.next/server/chunks/ssr/[root-of-the-server]__045sv4b._.js.map +0 -1
  267. package/web/.next/server/chunks/ssr/[root-of-the-server]__0d_0_fp._.js +0 -3
  268. package/web/.next/server/chunks/ssr/[root-of-the-server]__0d_0_fp._.js.map +0 -1
  269. package/web/.next/server/chunks/ssr/[root-of-the-server]__0l4d7e.._.js +0 -3
  270. package/web/.next/server/chunks/ssr/[root-of-the-server]__0l4d7e.._.js.map +0 -1
  271. package/web/.next/server/chunks/ssr/[root-of-the-server]__0r32z03._.js +0 -3
  272. package/web/.next/server/chunks/ssr/[root-of-the-server]__0r32z03._.js.map +0 -1
  273. /package/web/.next/server/chunks/{[root-of-the-server]__02xmnal._.js.map → [root-of-the-server]__08cpfre._.js.map} +0 -0
  274. /package/web/.next/server/chunks/{[root-of-the-server]__0.2exzi._.js.map → [root-of-the-server]__0gfvkg8._.js.map} +0 -0
  275. /package/web/.next/server/chunks/{[root-of-the-server]__0ip_e1x._.js.map → [root-of-the-server]__0hcp97v._.js.map} +0 -0
  276. /package/web/.next/server/chunks/{[root-of-the-server]__09118p2._.js.map → [root-of-the-server]__0iel39d._.js.map} +0 -0
  277. /package/web/.next/server/chunks/{[root-of-the-server]__04jjtl_._.js.map → [root-of-the-server]__0u1jyv9._.js.map} +0 -0
  278. /package/web/.next/server/chunks/{[root-of-the-server]__07suer1._.js.map → [root-of-the-server]__0zu_byw._.js.map} +0 -0
  279. /package/web/.next/server/chunks/ssr/{[root-of-the-server]__0qh.wn.._.js.map → [root-of-the-server]__0q3-gz.._.js.map} +0 -0
  280. /package/web/.next/server/chunks/ssr/{[root-of-the-server]__12g8h3_._.js.map → [root-of-the-server]__0w4__yd._.js.map} +0 -0
  281. /package/web/.next/static/{ZpPnD_b687G9xVr2nzrds → ynyh_sSxbFA995FRvBUxs}/_buildManifest.js +0 -0
  282. /package/web/.next/static/{ZpPnD_b687G9xVr2nzrds → ynyh_sSxbFA995FRvBUxs}/_clientMiddlewareManifest.js +0 -0
  283. /package/web/.next/static/{ZpPnD_b687G9xVr2nzrds → ynyh_sSxbFA995FRvBUxs}/_ssgManifest.js +0 -0
@@ -1,9 +0,0 @@
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"))},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"))},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"))},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";e.s(["resolve",0,function(e){let t=globalThis.__shipitAiContainer;if(!t)throw Error("DI container not available. Ensure the CLI bootstrap or dev-server has initialized it.");return t.resolve(e)}])},33607,e=>{"use strict";var t=e.i(29932),r=e.i(88797),n=e.i(78439),a=e.i(21387),o=e.i(351),s=e.i(1286),i=e.i(31060),l=e.i(67760),d=e.i(13435),u=e.i(60316),c=e.i(37130),p=e.i(31516),h=e.i(63144),v=e.i(3719),f=e.i(66941),R=e.i(93695);e.i(76574);var x=e.i(45014),g=e.i(40060);e.s(["GET",0,function(e){try{let t=new URL(e.url).searchParams.get("runId"),r=new ReadableStream({start(r){let n=new TextEncoder,a=!1,o={featureCache:new Map,sessionCache:new Map};function s(e){if(!a)try{r.enqueue(n.encode(e))}catch{}}let i=0;async function l(){if(!a)try{let e=(0,g.resolve)("PollAgentEventsUseCase"),r=await e.execute({runIdFilter:t,snapshot:o});for(let e of r.notificationEvents)console.log(`[SSE] emit: ${e.eventType} for "${e.featureName}"${e.phaseName?` (${e.phaseName})`:""}`),s(`event: notification
2
- data: ${JSON.stringify(e)}
3
-
4
- `);for(let e of r.sessionEvents)s(`event: interactive_session
5
- data: ${JSON.stringify(e)}
6
-
7
- `);i=0}catch(e){(++i<=3||i%60==0)&&console.error(`[SSE /api/agent-events] poll error #${i}:`,e instanceof Error?e.message:e)}}l();let d=setInterval(()=>void l(),2e3),u=setInterval(()=>{s(": heartbeat\n\n")},3e4);e.signal.addEventListener("abort",()=>{a=!0,clearInterval(d),clearInterval(u);try{r.close()}catch{}},{once:!0})}});return new Response(r,{headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"}})}catch(e){return console.error("[SSE route] GET handler error:",e),new Response(JSON.stringify({error:String(e)}),{status:500,headers:{"Content-Type":"application/json"}})}},"dynamic",0,"force-dynamic"],50328);var E=e.i(50328);let m=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/agent-events/route",pathname:"/api/agent-events",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/presentation/web/app/api/agent-events/route.ts",nextConfigOutput:"",userland:E,...{}}),{workAsyncStorage:w,workUnitAsyncStorage:C,serverHooks:y}=m;async function b(e,t,n){n.requestMeta&&(0,a.setRequestMeta)(e,n.requestMeta),m.isDev&&(0,a.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let g="/api/agent-events/route";g=g.replace(/\/index$/,"")||"/";let E=await m.prepare(e,t,{srcPage:g,multiZoneDraftMode:!1});if(!E)return t.statusCode=400,t.end("Bad Request"),null==n.waitUntil||n.waitUntil.call(n,Promise.resolve()),null;let{buildId:w,params:C,nextConfig:y,parsedUrl:b,isDraftMode:A,prerenderManifest:S,routerServerContext:T,isOnDemandRevalidate:N,revalidateOnlyGenerated:P,resolvedPathname:_,clientReferenceManifest:q,serverActionsManifest:O}=E,I=(0,i.normalizeAppPath)(g),k=!!(S.dynamicRoutes[I]||S.routes[_]),U=async()=>((null==T?void 0:T.render404)?await T.render404(e,t,b,!1):t.end("This page could not be found"),null);if(k&&!A){let e=!!S.routes[_],t=S.dynamicRoutes[I];if(t&&!1===t.fallback&&!e){if(y.adapterPath)return await U();throw new R.NoFallbackError}}let H=null;!k||m.isDev||A||(H="/index"===(H=_)?"/":H);let M=!0===m.isDev||!k,j=k&&!M;O&&q&&(0,s.setManifestsSingleton)({page:g,clientReferenceManifest:q,serverActionsManifest:O});let $=e.method||"GET",D=(0,o.getTracer)(),F=D.getActiveScopeSpan(),K=!!(null==T?void 0:T.isWrappedByNextServer),L=!!(0,a.getRequestMeta)(e,"minimalMode"),B=(0,a.getRequestMeta)(e,"incrementalCache")||await m.getIncrementalCache(e,y,S,L);null==B||B.resetRequestCache(),globalThis.__incrementalCache=B;let G={params:C,previewProps:S.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts},cacheComponents:!!y.cacheComponents,supportsDynamicResponse:M,incrementalCache:B,cacheLifeProfiles:y.cacheLife,waitUntil:n.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,n,a)=>m.onRequestError(e,t,n,a,T)},sharedContext:{buildId:w}},J=new l.NodeNextRequest(e),V=new l.NodeNextResponse(t),W=d.NextRequestAdapter.fromNodeNextRequest(J,(0,d.signalFromNodeResponse)(t));try{let a,s=async e=>m.handle(W,G).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=D.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==u.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=`${$} ${n}`;e.setAttributes({"next.route":n,"http.route":n,"next.span_name":t}),e.updateName(t),a&&a!==e&&(a.setAttribute("http.route",n),a.updateName(t))}else e.updateName(`${$} ${g}`)}),i=async a=>{var o,i;let l=async({previousCacheEntry:r})=>{try{if(!L&&N&&P&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let o=await s(a);e.fetchMetrics=G.renderOpts.fetchMetrics;let i=G.renderOpts.pendingWaitUntil;i&&n.waitUntil&&(n.waitUntil(i),i=void 0);let l=G.renderOpts.collectedTags;if(!k)return await (0,p.sendResponse)(J,V,o,G.renderOpts.pendingWaitUntil),null;{let e=await o.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(o.headers);l&&(t[f.NEXT_CACHE_TAGS_HEADER]=l),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==G.renderOpts.collectedRevalidate&&!(G.renderOpts.collectedRevalidate>=f.INFINITE_CACHE)&&G.renderOpts.collectedRevalidate,n=void 0===G.renderOpts.collectedExpire||G.renderOpts.collectedExpire>=f.INFINITE_CACHE?void 0:G.renderOpts.collectedExpire;return{value:{kind:x.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 m.onRequestError(e,t,{routerKind:"App Router",routePath:g,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:j,isOnDemandRevalidate:N})},!1,T),t}},d=await m.handleResponse({req:e,nextConfig:y,cacheKey:H,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:S,isRoutePPREnabled:!1,isOnDemandRevalidate:N,revalidateOnlyGenerated:P,responseGenerator:l,waitUntil:n.waitUntil,isMinimalMode:L});if(!k)return null;if((null==d||null==(o=d.value)?void 0:o.kind)!==x.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});L||t.setHeader("x-nextjs-cache",N?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let u=(0,h.fromNodeOutgoingHttpHeaders)(d.value.headers);return L&&k||u.delete(f.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||t.getHeader("Cache-Control")||u.get("Cache-Control")||u.set("Cache-Control",(0,v.getCacheControlHeader)(d.cacheControl)),await (0,p.sendResponse)(J,V,new Response(d.value.body,{headers:u,status:d.value.status||200})),null};K&&F?await i(F):(a=D.getActiveScopeSpan(),await D.withPropagatedContext(e.headers,()=>D.trace(u.BaseServerSpan.handleRequest,{spanName:`${$} ${g}`,kind:o.SpanKind.SERVER,attributes:{"http.method":$,"http.target":e.url}},i),void 0,!K))}catch(t){if(t instanceof R.NoFallbackError||await m.onRequestError(e,t,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:j,isOnDemandRevalidate:N})},!1,T),k)throw t;return await (0,p.sendResponse)(J,V,new Response(null,{status:500})),null}}e.s(["handler",0,b,"patchFetch",0,function(){return(0,n.patchFetch)({workAsyncStorage:w,workUnitAsyncStorage:C})},"routeModule",0,m,"serverHooks",0,y,"workAsyncStorage",0,w,"workUnitAsyncStorage",0,C],33607)}];
8
-
9
- //# sourceMappingURL=%5Broot-of-the-server%5D__0-3b27b._.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../src/presentation/web/lib/server-container.ts","../../../../../../src/presentation/web/app/api/agent-events/route.ts","../../../../../../node_modules/.pnpm/next%4016.2.2_%40babel%2Bcore%407.29.0_%40playwright%2Btest%401.59.1_react-dom%4019.2.4_react%4019.2.4__react%4019.2.4/node_modules/next/dist/esm/build/templates/app-route.js"],"sourcesContent":["/**\n * Server Container Accessor\n *\n * Provides a `resolve()` helper for server components and API routes to\n * obtain DI-managed instances. The tsyringe container is placed on globalThis\n * by the CLI bootstrap (`shipit-ai ui`) or the dev-server (`pnpm dev:web`).\n */\n\nimport type { DependencyContainer, InjectionToken } from 'tsyringe';\n\nconst CONTAINER_KEY = '__shipitAiContainer';\n\n/**\n * Resolve a dependency from the DI container.\n *\n * Usage in server components / API routes:\n * ```ts\n * import { resolve } from '@/lib/server-container';\n * import { ListFeaturesUseCase } from '@shipit-ai/core/application/use-cases/features/list-features.use-case';\n *\n * const features = await resolve(ListFeaturesUseCase).execute();\n * ```\n */\nexport function resolve<T>(token: InjectionToken<T>): T {\n const container = (globalThis as Record<string, unknown>)[CONTAINER_KEY] as\n | DependencyContainer\n | undefined;\n\n if (!container) {\n throw new Error(\n 'DI container not available. Ensure the CLI bootstrap or dev-server has initialized it.'\n );\n }\n\n return container.resolve(token);\n}\n","/**\n * SSE API Route: GET /api/agent-events\n *\n * Streams agent lifecycle notification events to connected web UI clients\n * via Server-Sent Events (SSE).\n *\n * This route is a thin adapter: it owns SSE encoding, connection management,\n * heartbeat, and interval scheduling only. All business logic (crash\n * detection, event delta computation, lifecycle mapping) lives in\n * PollAgentEventsUseCase.\n *\n * - Polls features + agent runs every 2 seconds\n * - Compares against per-connection snapshot and emits only deltas\n * - Sends heartbeat comments every 30 seconds to keep connection alive\n * - Supports optional ?runId query parameter to filter events\n * - Cleans up intervals on client disconnect\n */\n\nimport { resolve } from '@/lib/server-container';\nimport type {\n PollAgentEventsUseCase,\n AgentEventsSnapshot,\n} from '@shipit-ai/core/application/use-cases/agents/poll-agent-events.use-case';\n\n// Force dynamic — SSE streams must never be statically optimized or cached\nexport const dynamic = 'force-dynamic';\n\nconst POLL_INTERVAL_MS = 2_000;\nconst HEARTBEAT_INTERVAL_MS = 30_000;\n\n/** Re-export for downstream consumers that import this type from the route. */\nexport type { InteractiveSessionEvent } from '@shipit-ai/core/application/use-cases/agents/poll-agent-events.use-case';\n\nexport function GET(request: Request): Response {\n try {\n const url = new URL(request.url);\n const runIdFilter = url.searchParams.get('runId');\n\n const stream = new ReadableStream<Uint8Array>({\n start(controller) {\n const encoder = new TextEncoder();\n let stopped = false;\n\n // Per-connection snapshot owned and mutated by the use case on each poll\n const snapshot: AgentEventsSnapshot = {\n featureCache: new Map(),\n sessionCache: new Map(),\n };\n\n function enqueue(text: string) {\n if (stopped) return;\n try {\n controller.enqueue(encoder.encode(text));\n } catch {\n // Stream may be closed\n }\n }\n\n let pollErrorCount = 0;\n\n async function poll() {\n if (stopped) return;\n\n try {\n const useCase = resolve<PollAgentEventsUseCase>('PollAgentEventsUseCase');\n const result = await useCase.execute({ runIdFilter, snapshot });\n\n for (const event of result.notificationEvents) {\n // eslint-disable-next-line no-console\n console.log(\n `[SSE] emit: ${event.eventType} for \"${event.featureName}\"${event.phaseName ? ` (${event.phaseName})` : ''}`\n );\n enqueue(`event: notification\\ndata: ${JSON.stringify(event)}\\n\\n`);\n }\n\n for (const event of result.sessionEvents) {\n enqueue(`event: interactive_session\\ndata: ${JSON.stringify(event)}\\n\\n`);\n }\n\n pollErrorCount = 0;\n } catch (error) {\n pollErrorCount++;\n // Log first few errors, then throttle to avoid spamming\n if (pollErrorCount <= 3 || pollErrorCount % 60 === 0) {\n // eslint-disable-next-line no-console\n console.error(\n `[SSE /api/agent-events] poll error #${pollErrorCount}:`,\n error instanceof Error ? error.message : error\n );\n }\n }\n }\n\n // First poll immediately, then every POLL_INTERVAL_MS\n void poll();\n const pollInterval = setInterval(() => void poll(), POLL_INTERVAL_MS);\n\n // Heartbeat to keep connection alive\n const heartbeatInterval = setInterval(() => {\n enqueue(': heartbeat\\n\\n');\n }, HEARTBEAT_INTERVAL_MS);\n\n // Cleanup on client disconnect\n const cleanup = () => {\n stopped = true;\n clearInterval(pollInterval);\n clearInterval(heartbeatInterval);\n try {\n controller.close();\n } catch {\n // Stream may already be closed\n }\n };\n\n request.signal.addEventListener('abort', cleanup, { once: true });\n },\n });\n\n return new Response(stream, {\n headers: {\n 'Content-Type': 'text/event-stream',\n 'Cache-Control': 'no-cache',\n Connection: 'keep-alive',\n },\n });\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error('[SSE route] GET handler error:', error);\n return new Response(JSON.stringify({ error: String(error) }), {\n status: 500,\n headers: { 'Content-Type': 'application/json' },\n });\n }\n}\n","import { AppRouteRouteModule } from \"next/dist/esm/server/route-modules/app-route/module.compiled\";\nimport { RouteKind } from \"next/dist/esm/server/route-kind\";\nimport { patchFetch as _patchFetch } from \"next/dist/esm/server/lib/patch-fetch\";\nimport { addRequestMeta, getRequestMeta, setRequestMeta } from \"next/dist/esm/server/request-meta\";\nimport { getTracer, SpanKind } from \"next/dist/esm/server/lib/trace/tracer\";\nimport { setManifestsSingleton } from \"next/dist/esm/server/app-render/manifests-singleton\";\nimport { normalizeAppPath } from \"next/dist/esm/shared/lib/router/utils/app-paths\";\nimport { NodeNextRequest, NodeNextResponse } from \"next/dist/esm/server/base-http/node\";\nimport { NextRequestAdapter, signalFromNodeResponse } from \"next/dist/esm/server/web/spec-extension/adapters/next-request\";\nimport { BaseServerSpan } from \"next/dist/esm/server/lib/trace/constants\";\nimport { getRevalidateReason } from \"next/dist/esm/server/instrumentation/utils\";\nimport { sendResponse } from \"next/dist/esm/server/send-response\";\nimport { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from \"next/dist/esm/server/web/utils\";\nimport { getCacheControlHeader } from \"next/dist/esm/server/lib/cache-control\";\nimport { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from \"next/dist/esm/lib/constants\";\nimport { NoFallbackError } from \"next/dist/esm/shared/lib/no-fallback-error.external\";\nimport { CachedRouteKind } from \"next/dist/esm/server/response-cache\";\nimport * as userland from \"INNER_APP_ROUTE\";\n// We inject the nextConfigOutput here so that we can use them in the route\n// module.\nconst nextConfigOutput = \"\"\nconst routeModule = new AppRouteRouteModule({\n definition: {\n kind: RouteKind.APP_ROUTE,\n page: \"/api/agent-events/route\",\n pathname: \"/api/agent-events\",\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/agent-events/route.ts\",\n nextConfigOutput,\n // The static import is used for initialization (methods, dynamic, etc.).\n userland: userland,\n // In Turbopack dev mode, also provide a getter that calls require() on every\n // request. This re-reads from devModuleCache so HMR updates are picked up,\n // and the async wrapper unwraps async-module Promises (ESM-only\n // serverExternalPackages) automatically.\n ...process.env.TURBOPACK && process.env.__NEXT_DEV_SERVER ? {\n getUserland: ()=>import(\"INNER_APP_ROUTE\")\n } : {}\n});\n// Pull out the exports that we need to expose from the module. This should\n// be eliminated when we've moved the other routes to the new format. These\n// are used to hook into the route.\nconst { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule;\nfunction patchFetch() {\n return _patchFetch({\n workAsyncStorage,\n workUnitAsyncStorage\n });\n}\nexport { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, };\nexport async function handler(req, res, ctx) {\n if (ctx.requestMeta) {\n setRequestMeta(req, ctx.requestMeta);\n }\n if (routeModule.isDev) {\n addRequestMeta(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint());\n }\n let srcPage = \"/api/agent-events/route\";\n // turbopack doesn't normalize `/index` in the page name\n // so we need to to process dynamic routes properly\n // TODO: fix turbopack providing differing value from webpack\n if (process.env.TURBOPACK) {\n srcPage = srcPage.replace(/\\/index$/, '') || '/';\n } else if (srcPage === '/index') {\n // we always normalize /index specifically\n srcPage = '/';\n }\n const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE;\n const prepareResult = await routeModule.prepare(req, res, {\n srcPage,\n multiZoneDraftMode\n });\n if (!prepareResult) {\n res.statusCode = 400;\n res.end('Bad Request');\n ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve());\n return null;\n }\n const { buildId, params, nextConfig, parsedUrl, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname, clientReferenceManifest, serverActionsManifest } = prepareResult;\n const normalizedSrcPage = normalizeAppPath(srcPage);\n let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]);\n const render404 = async ()=>{\n // TODO: should route-module itself handle rendering the 404\n if (routerServerContext == null ? void 0 : routerServerContext.render404) {\n await routerServerContext.render404(req, res, parsedUrl, false);\n } else {\n res.end('This page could not be found');\n }\n return null;\n };\n if (isIsr && !isDraftMode) {\n const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]);\n const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage];\n if (prerenderInfo) {\n if (prerenderInfo.fallback === false && !isPrerendered) {\n if (nextConfig.adapterPath) {\n return await render404();\n }\n throw new NoFallbackError();\n }\n }\n }\n let cacheKey = null;\n if (isIsr && !routeModule.isDev && !isDraftMode) {\n cacheKey = resolvedPathname;\n // ensure /index and / is normalized to one key\n cacheKey = cacheKey === '/index' ? '/' : cacheKey;\n }\n const supportsDynamicResponse = // If we're in development, we always support dynamic HTML\n routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports\n // dynamic HTML.\n !isIsr;\n // This is a revalidation request if the request is for a static\n // page and it is not being resumed from a postponed render and\n // it is not a dynamic RSC request then it is a revalidation\n // request.\n const isStaticGeneration = isIsr && !supportsDynamicResponse;\n // Before rendering (which initializes component tree modules), we have to\n // set the reference manifests to our global store so Server Action's\n // encryption util can access to them at the top level of the page module.\n if (serverActionsManifest && clientReferenceManifest) {\n setManifestsSingleton({\n page: srcPage,\n clientReferenceManifest,\n serverActionsManifest\n });\n }\n const method = req.method || 'GET';\n const tracer = getTracer();\n const activeSpan = tracer.getActiveScopeSpan();\n const isWrappedByNextServer = Boolean(routerServerContext == null ? void 0 : routerServerContext.isWrappedByNextServer);\n const isMinimalMode = Boolean(getRequestMeta(req, 'minimalMode'));\n const incrementalCache = getRequestMeta(req, 'incrementalCache') || await routeModule.getIncrementalCache(req, nextConfig, prerenderManifest, isMinimalMode);\n incrementalCache == null ? void 0 : incrementalCache.resetRequestCache();\n globalThis.__incrementalCache = incrementalCache;\n const context = {\n params,\n previewProps: prerenderManifest.preview,\n renderOpts: {\n experimental: {\n authInterrupts: Boolean(nextConfig.experimental.authInterrupts)\n },\n cacheComponents: Boolean(nextConfig.cacheComponents),\n supportsDynamicResponse,\n incrementalCache,\n cacheLifeProfiles: nextConfig.cacheLife,\n waitUntil: ctx.waitUntil,\n onClose: (cb)=>{\n res.on('close', cb);\n },\n onAfterTaskError: undefined,\n onInstrumentationRequestError: (error, _request, errorContext, silenceLog)=>routeModule.onRequestError(req, error, errorContext, silenceLog, routerServerContext)\n },\n sharedContext: {\n buildId\n }\n };\n const nodeNextReq = new NodeNextRequest(req);\n const nodeNextRes = new NodeNextResponse(res);\n const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res));\n try {\n let parentSpan;\n const invokeRouteModule = async (span)=>{\n return routeModule.handle(nextReq, context).finally(()=>{\n if (!span) return;\n span.setAttributes({\n 'http.status_code': res.statusCode,\n 'next.rsc': false\n });\n const rootSpanAttributes = tracer.getRootSpanAttributes();\n // We were unable to get attributes, probably OTEL is not enabled\n if (!rootSpanAttributes) {\n return;\n }\n if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) {\n console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);\n return;\n }\n const route = rootSpanAttributes.get('next.route');\n if (route) {\n const name = `${method} ${route}`;\n span.setAttributes({\n 'next.route': route,\n 'http.route': route,\n 'next.span_name': name\n });\n span.updateName(name);\n // Propagate http.route to the parent span if one exists (e.g.\n // a platform-created HTTP span in adapter deployments).\n if (parentSpan && parentSpan !== span) {\n parentSpan.setAttribute('http.route', route);\n parentSpan.updateName(name);\n }\n } else {\n span.updateName(`${method} ${srcPage}`);\n }\n });\n };\n const handleResponse = async (currentSpan)=>{\n var _cacheEntry_value;\n const responseGenerator = async ({ previousCacheEntry })=>{\n try {\n if (!isMinimalMode && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) {\n res.statusCode = 404;\n // on-demand revalidate always sets this header\n res.setHeader('x-nextjs-cache', 'REVALIDATED');\n res.end('This page could not be found');\n return null;\n }\n const response = await invokeRouteModule(currentSpan);\n req.fetchMetrics = context.renderOpts.fetchMetrics;\n let pendingWaitUntil = context.renderOpts.pendingWaitUntil;\n // Attempt using provided waitUntil if available\n // if it's not we fallback to sendResponse's handling\n if (pendingWaitUntil) {\n if (ctx.waitUntil) {\n ctx.waitUntil(pendingWaitUntil);\n pendingWaitUntil = undefined;\n }\n }\n const cacheTags = context.renderOpts.collectedTags;\n // If the request is for a static response, we can cache it so long\n // as it's not edge.\n if (isIsr) {\n const blob = await response.blob();\n // Copy the headers from the response.\n const headers = toNodeOutgoingHttpHeaders(response.headers);\n if (cacheTags) {\n headers[NEXT_CACHE_TAGS_HEADER] = cacheTags;\n }\n if (!headers['content-type'] && blob.type) {\n headers['content-type'] = blob.type;\n }\n const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate;\n const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire;\n // Create the cache entry for the response.\n const cacheEntry = {\n value: {\n kind: CachedRouteKind.APP_ROUTE,\n status: response.status,\n body: Buffer.from(await blob.arrayBuffer()),\n headers\n },\n cacheControl: {\n revalidate,\n expire\n }\n };\n return cacheEntry;\n } else {\n // send response without caching if not ISR\n await sendResponse(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil);\n return null;\n }\n } catch (err) {\n // if this is a background revalidate we need to report\n // the request error here as it won't be bubbled\n if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: srcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n throw err;\n }\n };\n const cacheEntry = await routeModule.handleResponse({\n req,\n nextConfig,\n cacheKey,\n routeKind: RouteKind.APP_ROUTE,\n isFallback: false,\n prerenderManifest,\n isRoutePPREnabled: false,\n isOnDemandRevalidate,\n revalidateOnlyGenerated,\n responseGenerator,\n waitUntil: ctx.waitUntil,\n isMinimalMode\n });\n // we don't create a cacheEntry for ISR\n if (!isIsr) {\n return null;\n }\n if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) {\n var _cacheEntry_value1;\n throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), \"__NEXT_ERROR_CODE\", {\n value: \"E701\",\n enumerable: false,\n configurable: true\n });\n }\n if (!isMinimalMode) {\n res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT');\n }\n // Draft mode should never be cached\n if (isDraftMode) {\n res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');\n }\n const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers);\n if (!(isMinimalMode && isIsr)) {\n headers.delete(NEXT_CACHE_TAGS_HEADER);\n }\n // If cache control is already set on the response we don't\n // override it to allow users to customize it via next.config\n if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) {\n headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl));\n }\n await sendResponse(nodeNextReq, nodeNextRes, // @ts-expect-error - Argument of type 'Buffer<ArrayBufferLike>' is not assignable to parameter of type 'BodyInit | null | undefined'.\n new Response(cacheEntry.value.body, {\n headers,\n status: cacheEntry.value.status || 200\n }));\n return null;\n };\n // TODO: activeSpan code path is for when wrapped by\n // next-server can be removed when this is no longer used\n if (isWrappedByNextServer && activeSpan) {\n await handleResponse(activeSpan);\n } else {\n parentSpan = tracer.getActiveScopeSpan();\n await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, {\n spanName: `${method} ${srcPage}`,\n kind: SpanKind.SERVER,\n attributes: {\n 'http.method': method,\n 'http.target': req.url\n }\n }, handleResponse), undefined, !isWrappedByNextServer);\n }\n } catch (err) {\n if (!(err instanceof NoFallbackError)) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: normalizedSrcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n // rethrow so that we can handle serving error page\n // If this is during static generation, throw the error again.\n if (isIsr) throw err;\n // Otherwise, send a 500 response.\n await sendResponse(nodeNextReq, nodeNextRes, new Response(null, {\n status: 500\n }));\n return null;\n }\n}\n\n//# sourceMappingURL=app-route.js.map\n"],"names":["CONTAINER_KEY","resolve","token","container","globalThis","Error","dynamic","POLL_INTERVAL_MS","HEARTBEAT_INTERVAL_MS","enqueue","GET","request","url","URL","runIdFilter","searchParams","get","stream","ReadableStream","start","controller","encoder","TextEncoder","stopped","snapshot","featureCache","Map","sessionCache","event","error","text","encode","pollErrorCount","poll","useCase","result","execute","setInterval","notificationEvents","cleanup","console","log","eventType","featureName","phaseName","JSON","stringify","close","sessionEvents","once","Response","String","message","pollInterval","heartbeatInterval","clearInterval","signal","addEventListener","headers","Connection","status"],"mappings":"i1BAuBO,SAAoBE,AAAXD,CAAmC,EACjD,IAAME,EAAaC,UAAsC,CAACJ,AAdtC,mBAcoD,CAIxE,GAAI,CAACG,EACH,MAAM,AAAIE,GADI,GAEZ,0FAIJ,OAAOF,EAAUF,OAAO,CAACC,EAC3B,4BEnCA,IAAA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,KACA,EAAA,EAAA,CAAA,CAAA,MACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,MACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,CAAA,CAAA,OAAA,IAAA,EAAA,EAAA,CAAA,CAAA,ODEA,EAAA,EAAA,CAAA,CAAA,oBAeO,SAASQ,AAAIC,CAAgB,EAClC,GAAI,CAEF,IAAMG,EADM,AACQF,IADJC,IAAIF,EAAQC,GAAG,EACPG,YAAY,CAACC,GAAG,CAAC,SAEnCC,EAAS,IAAIC,eAA2B,CAC5CC,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EAAG,EAAO,CAAC,EAAE,EAAA,CAAS,CAChC,KAAM,EAAA,QAAQ,CAAC,MAAM,CACrB,WAAY,CACR,cAAe,EACf,cAAe,EAAI,GAAG,AAC1B,CACJ,EAAG,QAAiB,EAAW,CAAC,GAE5C,CAAE,MAAO,EAAK,CAeV,GAdM,aAAe,EAAA,eAAe,EAEhC,CAFmC,KAE7B,EAAY,cAAc,CAAC,EAAK,EAAK,CACvC,WAAY,aACZ,UAAW,EACX,UAAW,QACX,iBAAkB,CAAA,EAAA,EAAA,mBAAA,AAAmB,EAAC,oBAClC,uBACA,CACJ,EACJ,GAAG,AATgB,EASJ,GAIf,EAAO,MAAM,EAKjB,OAHA,MAAM,CAAA,EAAA,EAAA,YAAA,AAAY,EAAC,EAAa,EAAa,IAAI,SAAS,KAAM,CAC5D,OAAQ,GACZ,IACO,IACX,CACJ,mCA3TA,SAAS,EACLtB,MAAO,CAAA,EAAA,EAAA,UAAW,AAAX,EAAY,kBACf,uBACA,CACJ,EACJ","ignoreList":[2]}
@@ -1,9 +0,0 @@
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"))},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"))},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"))},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";e.s(["resolve",0,function(e){let t=globalThis.__shipitAiContainer;if(!t)throw Error("DI container not available. Ensure the CLI bootstrap or dev-server has initialized it.");return t.resolve(e)}])},11855,e=>{"use strict";var t=e.i(29932),r=e.i(88797),n=e.i(78439),a=e.i(21387),o=e.i(351),i=e.i(1286),s=e.i(31060),l=e.i(67760),d=e.i(13435),u=e.i(60316),p=e.i(37130),c=e.i(31516),h=e.i(63144),v=e.i(3719),R=e.i(66941),g=e.i(93695);e.i(76574);var x=e.i(45014),m=e.i(40060);e.s(["GET",0,function(e){try{let t=new URL(e.url).searchParams.get("targetId");if(!t?.trim()){let e=new ReadableStream({start(e){let t=new TextEncoder;e.enqueue(t.encode(`event: error
2
- data: ${JSON.stringify({error:"targetId is required"})}
3
-
4
- `)),e.close()}});return new Response(e,{headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"}})}let r=new ReadableStream({start(r){let n=new TextEncoder,a=!1;function o(e){if(!a)try{r.enqueue(n.encode(e))}catch{}}let i=(0,m.resolve)("IDeploymentService"),s=e=>{e.targetId===t&&o(`event: log
5
- data: ${JSON.stringify(e)}
6
-
7
- `)};i.on("log",s);let l=setInterval(()=>{o(": heartbeat\n\n")},3e4);e.signal.addEventListener("abort",()=>{a=!0,i.off("log",s),clearInterval(l);try{r.close()}catch{}},{once:!0})}});return new Response(r,{headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"}})}catch(e){return console.error("[SSE route] GET /api/deployment-logs error:",e),new Response(JSON.stringify({error:String(e)}),{status:500,headers:{"Content-Type":"application/json"}})}},"dynamic",0,"force-dynamic"],28457);var f=e.i(28457);let w=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/deployment-logs/route",pathname:"/api/deployment-logs",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/presentation/web/app/api/deployment-logs/route.ts",nextConfigOutput:"",userland:f,...{}}),{workAsyncStorage:y,workUnitAsyncStorage:E,serverHooks:C}=w;async function b(e,t,n){n.requestMeta&&(0,a.setRequestMeta)(e,n.requestMeta),w.isDev&&(0,a.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let m="/api/deployment-logs/route";m=m.replace(/\/index$/,"")||"/";let f=await w.prepare(e,t,{srcPage:m,multiZoneDraftMode:!1});if(!f)return t.statusCode=400,t.end("Bad Request"),null==n.waitUntil||n.waitUntil.call(n,Promise.resolve()),null;let{buildId:y,params:E,nextConfig:C,parsedUrl:b,isDraftMode:T,prerenderManifest:A,routerServerContext:S,isOnDemandRevalidate:N,revalidateOnlyGenerated:q,resolvedPathname:P,clientReferenceManifest:I,serverActionsManifest:O}=f,_=(0,s.normalizeAppPath)(m),k=!!(A.dynamicRoutes[_]||A.routes[P]),H=async()=>((null==S?void 0:S.render404)?await S.render404(e,t,b,!1):t.end("This page could not be found"),null);if(k&&!T){let e=!!A.routes[P],t=A.dynamicRoutes[_];if(t&&!1===t.fallback&&!e){if(C.adapterPath)return await H();throw new g.NoFallbackError}}let U=null;!k||w.isDev||T||(U="/index"===(U=P)?"/":U);let j=!0===w.isDev||!k,D=k&&!j;O&&I&&(0,i.setManifestsSingleton)({page:m,clientReferenceManifest:I,serverActionsManifest:O});let M=e.method||"GET",$=(0,o.getTracer)(),F=$.getActiveScopeSpan(),K=!!(null==S?void 0:S.isWrappedByNextServer),L=!!(0,a.getRequestMeta)(e,"minimalMode"),B=(0,a.getRequestMeta)(e,"incrementalCache")||await w.getIncrementalCache(e,C,A,L);null==B||B.resetRequestCache(),globalThis.__incrementalCache=B;let G={params:E,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!C.experimental.authInterrupts},cacheComponents:!!C.cacheComponents,supportsDynamicResponse:j,incrementalCache:B,cacheLifeProfiles:C.cacheLife,waitUntil:n.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,n,a)=>w.onRequestError(e,t,n,a,S)},sharedContext:{buildId:y}},J=new l.NodeNextRequest(e),V=new l.NodeNextResponse(t),W=d.NextRequestAdapter.fromNodeNextRequest(J,(0,d.signalFromNodeResponse)(t));try{let a,i=async e=>w.handle(W,G).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=$.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==u.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=`${M} ${n}`;e.setAttributes({"next.route":n,"http.route":n,"next.span_name":t}),e.updateName(t),a&&a!==e&&(a.setAttribute("http.route",n),a.updateName(t))}else e.updateName(`${M} ${m}`)}),s=async a=>{var o,s;let l=async({previousCacheEntry:r})=>{try{if(!L&&N&&q&&!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=G.renderOpts.fetchMetrics;let s=G.renderOpts.pendingWaitUntil;s&&n.waitUntil&&(n.waitUntil(s),s=void 0);let l=G.renderOpts.collectedTags;if(!k)return await (0,c.sendResponse)(J,V,o,G.renderOpts.pendingWaitUntil),null;{let e=await o.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(o.headers);l&&(t[R.NEXT_CACHE_TAGS_HEADER]=l),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==G.renderOpts.collectedRevalidate&&!(G.renderOpts.collectedRevalidate>=R.INFINITE_CACHE)&&G.renderOpts.collectedRevalidate,n=void 0===G.renderOpts.collectedExpire||G.renderOpts.collectedExpire>=R.INFINITE_CACHE?void 0:G.renderOpts.collectedExpire;return{value:{kind:x.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 w.onRequestError(e,t,{routerKind:"App Router",routePath:m,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:D,isOnDemandRevalidate:N})},!1,S),t}},d=await w.handleResponse({req:e,nextConfig:C,cacheKey:U,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:N,revalidateOnlyGenerated:q,responseGenerator:l,waitUntil:n.waitUntil,isMinimalMode:L});if(!k)return null;if((null==d||null==(o=d.value)?void 0:o.kind)!==x.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(s=d.value)?void 0:s.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});L||t.setHeader("x-nextjs-cache",N?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),T&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let u=(0,h.fromNodeOutgoingHttpHeaders)(d.value.headers);return L&&k||u.delete(R.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||t.getHeader("Cache-Control")||u.get("Cache-Control")||u.set("Cache-Control",(0,v.getCacheControlHeader)(d.cacheControl)),await (0,c.sendResponse)(J,V,new Response(d.value.body,{headers:u,status:d.value.status||200})),null};K&&F?await s(F):(a=$.getActiveScopeSpan(),await $.withPropagatedContext(e.headers,()=>$.trace(u.BaseServerSpan.handleRequest,{spanName:`${M} ${m}`,kind:o.SpanKind.SERVER,attributes:{"http.method":M,"http.target":e.url}},s),void 0,!K))}catch(t){if(t instanceof g.NoFallbackError||await w.onRequestError(e,t,{routerKind:"App Router",routePath:_,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:D,isOnDemandRevalidate:N})},!1,S),k)throw t;return await (0,c.sendResponse)(J,V,new Response(null,{status:500})),null}}e.s(["handler",0,b,"patchFetch",0,function(){return(0,n.patchFetch)({workAsyncStorage:y,workUnitAsyncStorage:E})},"routeModule",0,w,"serverHooks",0,C,"workAsyncStorage",0,y,"workUnitAsyncStorage",0,E],11855)}];
8
-
9
- //# sourceMappingURL=%5Broot-of-the-server%5D__0_6fhza._.js.map
@@ -1,12 +0,0 @@
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"))},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"))},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"))},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";e.s(["resolve",0,function(e){let t=globalThis.__shipitAiContainer;if(!t)throw Error("DI container not available. Ensure the CLI bootstrap or dev-server has initialized it.");return t.resolve(e)}])},15665,e=>{"use strict";var t=e.i(29932),r=e.i(88797),n=e.i(78439),a=e.i(21387),i=e.i(351),s=e.i(1286),o=e.i(31060),l=e.i(67760),d=e.i(13435),u=e.i(60316),c=e.i(37130),p=e.i(31516),h=e.i(63144),v=e.i(3719),R=e.i(66941),x=e.i(93695);e.i(76574);var f=e.i(45014),g=e.i(40060);async function m(e,{params:t}){let{id:r}=await t;try{let t=(0,g.resolve)("IInteractiveSessionService");if(!await t.getSession(r))return new Response(JSON.stringify({error:"Session not found"}),{status:404,headers:{"Content-Type":"application/json"}});let n=new TextEncoder,a=new ReadableStream({start(a){let i=!1;function s(e){if(!i)try{a.enqueue(n.encode(e))}catch{}}s(": connected\n\n");let o=setInterval(()=>{s(": heartbeat\n\n")},15e3),l=t.subscribe(r,e=>{if(e.done)s(`event: done
2
- data: ${JSON.stringify({done:!0,sessionId:r})}
3
-
4
- `);else if(e.log){let t={log:e.log,sessionId:r};s(`event: log
5
- data: ${JSON.stringify(t)}
6
-
7
- `)}else if(e.delta){let t={delta:e.delta,sessionId:r};s(`event: delta
8
- data: ${JSON.stringify(t)}
9
-
10
- `)}});e.signal.addEventListener("abort",function(){if(!i){i=!0,clearInterval(o),l();try{a.close()}catch{}}},{once:!0})}});return new Response(a,{headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"}})}catch(e){return console.error("[GET /api/interactive/sessions/:id/stream]",e),new Response(JSON.stringify({error:String(e)}),{status:500,headers:{"Content-Type":"application/json"}})}}e.s(["GET",0,m,"dynamic",0,"force-dynamic"],95949);var w=e.i(95949);let y=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/interactive/sessions/[id]/stream/route",pathname:"/api/interactive/sessions/[id]/stream",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/presentation/web/app/api/interactive/sessions/[id]/stream/route.ts",nextConfigOutput:"",userland:w,...{}}),{workAsyncStorage:E,workUnitAsyncStorage:C,serverHooks:b}=y;async function S(e,t,n){n.requestMeta&&(0,a.setRequestMeta)(e,n.requestMeta),y.isDev&&(0,a.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let g="/api/interactive/sessions/[id]/stream/route";g=g.replace(/\/index$/,"")||"/";let m=await y.prepare(e,t,{srcPage:g,multiZoneDraftMode:!1});if(!m)return t.statusCode=400,t.end("Bad Request"),null==n.waitUntil||n.waitUntil.call(n,Promise.resolve()),null;let{buildId:w,params:E,nextConfig:C,parsedUrl:b,isDraftMode:S,prerenderManifest:A,routerServerContext:T,isOnDemandRevalidate:N,revalidateOnlyGenerated:O,resolvedPathname:q,clientReferenceManifest:P,serverActionsManifest:_}=m,I=(0,o.normalizeAppPath)(g),k=!!(A.dynamicRoutes[I]||A.routes[q]),j=async()=>((null==T?void 0:T.render404)?await T.render404(e,t,b,!1):t.end("This page could not be found"),null);if(k&&!S){let e=!!A.routes[q],t=A.dynamicRoutes[I];if(t&&!1===t.fallback&&!e){if(C.adapterPath)return await j();throw new x.NoFallbackError}}let H=null;!k||y.isDev||S||(H="/index"===(H=q)?"/":H);let U=!0===y.isDev||!k,M=k&&!U;_&&P&&(0,s.setManifestsSingleton)({page:g,clientReferenceManifest:P,serverActionsManifest:_});let D=e.method||"GET",$=(0,i.getTracer)(),F=$.getActiveScopeSpan(),K=!!(null==T?void 0:T.isWrappedByNextServer),L=!!(0,a.getRequestMeta)(e,"minimalMode"),B=(0,a.getRequestMeta)(e,"incrementalCache")||await y.getIncrementalCache(e,C,A,L);null==B||B.resetRequestCache(),globalThis.__incrementalCache=B;let G={params:E,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!C.experimental.authInterrupts},cacheComponents:!!C.cacheComponents,supportsDynamicResponse:U,incrementalCache:B,cacheLifeProfiles:C.cacheLife,waitUntil:n.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,n,a)=>y.onRequestError(e,t,n,a,T)},sharedContext:{buildId:w}},J=new l.NodeNextRequest(e),V=new l.NodeNextResponse(t),W=d.NextRequestAdapter.fromNodeNextRequest(J,(0,d.signalFromNodeResponse)(t));try{let a,s=async e=>y.handle(W,G).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=$.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==u.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),a&&a!==e&&(a.setAttribute("http.route",n),a.updateName(t))}else e.updateName(`${D} ${g}`)}),o=async a=>{var i,o;let l=async({previousCacheEntry:r})=>{try{if(!L&&N&&O&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let i=await s(a);e.fetchMetrics=G.renderOpts.fetchMetrics;let o=G.renderOpts.pendingWaitUntil;o&&n.waitUntil&&(n.waitUntil(o),o=void 0);let l=G.renderOpts.collectedTags;if(!k)return await (0,p.sendResponse)(J,V,i,G.renderOpts.pendingWaitUntil),null;{let e=await i.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(i.headers);l&&(t[R.NEXT_CACHE_TAGS_HEADER]=l),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==G.renderOpts.collectedRevalidate&&!(G.renderOpts.collectedRevalidate>=R.INFINITE_CACHE)&&G.renderOpts.collectedRevalidate,n=void 0===G.renderOpts.collectedExpire||G.renderOpts.collectedExpire>=R.INFINITE_CACHE?void 0:G.renderOpts.collectedExpire;return{value:{kind:f.CachedRouteKind.APP_ROUTE,status:i.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:n}}}}catch(t){throw(null==r?void 0:r.isStale)&&await y.onRequestError(e,t,{routerKind:"App Router",routePath:g,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:M,isOnDemandRevalidate:N})},!1,T),t}},d=await y.handleResponse({req:e,nextConfig:C,cacheKey:H,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:N,revalidateOnlyGenerated:O,responseGenerator:l,waitUntil:n.waitUntil,isMinimalMode:L});if(!k)return null;if((null==d||null==(i=d.value)?void 0:i.kind)!==f.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(o=d.value)?void 0:o.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});L||t.setHeader("x-nextjs-cache",N?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),S&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let u=(0,h.fromNodeOutgoingHttpHeaders)(d.value.headers);return L&&k||u.delete(R.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||t.getHeader("Cache-Control")||u.get("Cache-Control")||u.set("Cache-Control",(0,v.getCacheControlHeader)(d.cacheControl)),await (0,p.sendResponse)(J,V,new Response(d.value.body,{headers:u,status:d.value.status||200})),null};K&&F?await o(F):(a=$.getActiveScopeSpan(),await $.withPropagatedContext(e.headers,()=>$.trace(u.BaseServerSpan.handleRequest,{spanName:`${D} ${g}`,kind:i.SpanKind.SERVER,attributes:{"http.method":D,"http.target":e.url}},o),void 0,!K))}catch(t){if(t instanceof x.NoFallbackError||await y.onRequestError(e,t,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:M,isOnDemandRevalidate:N})},!1,T),k)throw t;return await (0,p.sendResponse)(J,V,new Response(null,{status:500})),null}}e.s(["handler",0,S,"patchFetch",0,function(){return(0,n.patchFetch)({workAsyncStorage:E,workUnitAsyncStorage:C})},"routeModule",0,y,"serverHooks",0,b,"workAsyncStorage",0,E,"workUnitAsyncStorage",0,C],15665)}];
11
-
12
- //# sourceMappingURL=%5Broot-of-the-server%5D__0esdmru._.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../src/presentation/web/lib/server-container.ts","../../../../../../node_modules/.pnpm/next%4016.2.2_%40babel%2Bcore%407.29.0_%40playwright%2Btest%401.59.1_react-dom%4019.2.4_react%4019.2.4__react%4019.2.4/node_modules/next/dist/esm/build/templates/app-route.js","../../../../../../src/presentation/web/app/api/interactive/sessions/%5Bid%5D/stream/route.ts"],"sourcesContent":["/**\n * Server Container Accessor\n *\n * Provides a `resolve()` helper for server components and API routes to\n * obtain DI-managed instances. The tsyringe container is placed on globalThis\n * by the CLI bootstrap (`shipit-ai ui`) or the dev-server (`pnpm dev:web`).\n */\n\nimport type { DependencyContainer, InjectionToken } from 'tsyringe';\n\nconst CONTAINER_KEY = '__shipitAiContainer';\n\n/**\n * Resolve a dependency from the DI container.\n *\n * Usage in server components / API routes:\n * ```ts\n * import { resolve } from '@/lib/server-container';\n * import { ListFeaturesUseCase } from '@shipit-ai/core/application/use-cases/features/list-features.use-case';\n *\n * const features = await resolve(ListFeaturesUseCase).execute();\n * ```\n */\nexport function resolve<T>(token: InjectionToken<T>): T {\n const container = (globalThis as Record<string, unknown>)[CONTAINER_KEY] as\n | DependencyContainer\n | undefined;\n\n if (!container) {\n throw new Error(\n 'DI container not available. Ensure the CLI bootstrap or dev-server has initialized it.'\n );\n }\n\n return container.resolve(token);\n}\n","import { AppRouteRouteModule } from \"next/dist/esm/server/route-modules/app-route/module.compiled\";\nimport { RouteKind } from \"next/dist/esm/server/route-kind\";\nimport { patchFetch as _patchFetch } from \"next/dist/esm/server/lib/patch-fetch\";\nimport { addRequestMeta, getRequestMeta, setRequestMeta } from \"next/dist/esm/server/request-meta\";\nimport { getTracer, SpanKind } from \"next/dist/esm/server/lib/trace/tracer\";\nimport { setManifestsSingleton } from \"next/dist/esm/server/app-render/manifests-singleton\";\nimport { normalizeAppPath } from \"next/dist/esm/shared/lib/router/utils/app-paths\";\nimport { NodeNextRequest, NodeNextResponse } from \"next/dist/esm/server/base-http/node\";\nimport { NextRequestAdapter, signalFromNodeResponse } from \"next/dist/esm/server/web/spec-extension/adapters/next-request\";\nimport { BaseServerSpan } from \"next/dist/esm/server/lib/trace/constants\";\nimport { getRevalidateReason } from \"next/dist/esm/server/instrumentation/utils\";\nimport { sendResponse } from \"next/dist/esm/server/send-response\";\nimport { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from \"next/dist/esm/server/web/utils\";\nimport { getCacheControlHeader } from \"next/dist/esm/server/lib/cache-control\";\nimport { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from \"next/dist/esm/lib/constants\";\nimport { NoFallbackError } from \"next/dist/esm/shared/lib/no-fallback-error.external\";\nimport { CachedRouteKind } from \"next/dist/esm/server/response-cache\";\nimport * as userland from \"INNER_APP_ROUTE\";\n// We inject the nextConfigOutput here so that we can use them in the route\n// module.\nconst nextConfigOutput = \"\"\nconst routeModule = new AppRouteRouteModule({\n definition: {\n kind: RouteKind.APP_ROUTE,\n page: \"/api/interactive/sessions/[id]/stream/route\",\n pathname: \"/api/interactive/sessions/[id]/stream\",\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/interactive/sessions/[id]/stream/route.ts\",\n nextConfigOutput,\n // The static import is used for initialization (methods, dynamic, etc.).\n userland: userland,\n // In Turbopack dev mode, also provide a getter that calls require() on every\n // request. This re-reads from devModuleCache so HMR updates are picked up,\n // and the async wrapper unwraps async-module Promises (ESM-only\n // serverExternalPackages) automatically.\n ...process.env.TURBOPACK && process.env.__NEXT_DEV_SERVER ? {\n getUserland: ()=>import(\"INNER_APP_ROUTE\")\n } : {}\n});\n// Pull out the exports that we need to expose from the module. This should\n// be eliminated when we've moved the other routes to the new format. These\n// are used to hook into the route.\nconst { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule;\nfunction patchFetch() {\n return _patchFetch({\n workAsyncStorage,\n workUnitAsyncStorage\n });\n}\nexport { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, };\nexport async function handler(req, res, ctx) {\n if (ctx.requestMeta) {\n setRequestMeta(req, ctx.requestMeta);\n }\n if (routeModule.isDev) {\n addRequestMeta(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint());\n }\n let srcPage = \"/api/interactive/sessions/[id]/stream/route\";\n // turbopack doesn't normalize `/index` in the page name\n // so we need to to process dynamic routes properly\n // TODO: fix turbopack providing differing value from webpack\n if (process.env.TURBOPACK) {\n srcPage = srcPage.replace(/\\/index$/, '') || '/';\n } else if (srcPage === '/index') {\n // we always normalize /index specifically\n srcPage = '/';\n }\n const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE;\n const prepareResult = await routeModule.prepare(req, res, {\n srcPage,\n multiZoneDraftMode\n });\n if (!prepareResult) {\n res.statusCode = 400;\n res.end('Bad Request');\n ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve());\n return null;\n }\n const { buildId, params, nextConfig, parsedUrl, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname, clientReferenceManifest, serverActionsManifest } = prepareResult;\n const normalizedSrcPage = normalizeAppPath(srcPage);\n let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]);\n const render404 = async ()=>{\n // TODO: should route-module itself handle rendering the 404\n if (routerServerContext == null ? void 0 : routerServerContext.render404) {\n await routerServerContext.render404(req, res, parsedUrl, false);\n } else {\n res.end('This page could not be found');\n }\n return null;\n };\n if (isIsr && !isDraftMode) {\n const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]);\n const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage];\n if (prerenderInfo) {\n if (prerenderInfo.fallback === false && !isPrerendered) {\n if (nextConfig.adapterPath) {\n return await render404();\n }\n throw new NoFallbackError();\n }\n }\n }\n let cacheKey = null;\n if (isIsr && !routeModule.isDev && !isDraftMode) {\n cacheKey = resolvedPathname;\n // ensure /index and / is normalized to one key\n cacheKey = cacheKey === '/index' ? '/' : cacheKey;\n }\n const supportsDynamicResponse = // If we're in development, we always support dynamic HTML\n routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports\n // dynamic HTML.\n !isIsr;\n // This is a revalidation request if the request is for a static\n // page and it is not being resumed from a postponed render and\n // it is not a dynamic RSC request then it is a revalidation\n // request.\n const isStaticGeneration = isIsr && !supportsDynamicResponse;\n // Before rendering (which initializes component tree modules), we have to\n // set the reference manifests to our global store so Server Action's\n // encryption util can access to them at the top level of the page module.\n if (serverActionsManifest && clientReferenceManifest) {\n setManifestsSingleton({\n page: srcPage,\n clientReferenceManifest,\n serverActionsManifest\n });\n }\n const method = req.method || 'GET';\n const tracer = getTracer();\n const activeSpan = tracer.getActiveScopeSpan();\n const isWrappedByNextServer = Boolean(routerServerContext == null ? void 0 : routerServerContext.isWrappedByNextServer);\n const isMinimalMode = Boolean(getRequestMeta(req, 'minimalMode'));\n const incrementalCache = getRequestMeta(req, 'incrementalCache') || await routeModule.getIncrementalCache(req, nextConfig, prerenderManifest, isMinimalMode);\n incrementalCache == null ? void 0 : incrementalCache.resetRequestCache();\n globalThis.__incrementalCache = incrementalCache;\n const context = {\n params,\n previewProps: prerenderManifest.preview,\n renderOpts: {\n experimental: {\n authInterrupts: Boolean(nextConfig.experimental.authInterrupts)\n },\n cacheComponents: Boolean(nextConfig.cacheComponents),\n supportsDynamicResponse,\n incrementalCache,\n cacheLifeProfiles: nextConfig.cacheLife,\n waitUntil: ctx.waitUntil,\n onClose: (cb)=>{\n res.on('close', cb);\n },\n onAfterTaskError: undefined,\n onInstrumentationRequestError: (error, _request, errorContext, silenceLog)=>routeModule.onRequestError(req, error, errorContext, silenceLog, routerServerContext)\n },\n sharedContext: {\n buildId\n }\n };\n const nodeNextReq = new NodeNextRequest(req);\n const nodeNextRes = new NodeNextResponse(res);\n const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res));\n try {\n let parentSpan;\n const invokeRouteModule = async (span)=>{\n return routeModule.handle(nextReq, context).finally(()=>{\n if (!span) return;\n span.setAttributes({\n 'http.status_code': res.statusCode,\n 'next.rsc': false\n });\n const rootSpanAttributes = tracer.getRootSpanAttributes();\n // We were unable to get attributes, probably OTEL is not enabled\n if (!rootSpanAttributes) {\n return;\n }\n if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) {\n console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);\n return;\n }\n const route = rootSpanAttributes.get('next.route');\n if (route) {\n const name = `${method} ${route}`;\n span.setAttributes({\n 'next.route': route,\n 'http.route': route,\n 'next.span_name': name\n });\n span.updateName(name);\n // Propagate http.route to the parent span if one exists (e.g.\n // a platform-created HTTP span in adapter deployments).\n if (parentSpan && parentSpan !== span) {\n parentSpan.setAttribute('http.route', route);\n parentSpan.updateName(name);\n }\n } else {\n span.updateName(`${method} ${srcPage}`);\n }\n });\n };\n const handleResponse = async (currentSpan)=>{\n var _cacheEntry_value;\n const responseGenerator = async ({ previousCacheEntry })=>{\n try {\n if (!isMinimalMode && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) {\n res.statusCode = 404;\n // on-demand revalidate always sets this header\n res.setHeader('x-nextjs-cache', 'REVALIDATED');\n res.end('This page could not be found');\n return null;\n }\n const response = await invokeRouteModule(currentSpan);\n req.fetchMetrics = context.renderOpts.fetchMetrics;\n let pendingWaitUntil = context.renderOpts.pendingWaitUntil;\n // Attempt using provided waitUntil if available\n // if it's not we fallback to sendResponse's handling\n if (pendingWaitUntil) {\n if (ctx.waitUntil) {\n ctx.waitUntil(pendingWaitUntil);\n pendingWaitUntil = undefined;\n }\n }\n const cacheTags = context.renderOpts.collectedTags;\n // If the request is for a static response, we can cache it so long\n // as it's not edge.\n if (isIsr) {\n const blob = await response.blob();\n // Copy the headers from the response.\n const headers = toNodeOutgoingHttpHeaders(response.headers);\n if (cacheTags) {\n headers[NEXT_CACHE_TAGS_HEADER] = cacheTags;\n }\n if (!headers['content-type'] && blob.type) {\n headers['content-type'] = blob.type;\n }\n const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate;\n const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire;\n // Create the cache entry for the response.\n const cacheEntry = {\n value: {\n kind: CachedRouteKind.APP_ROUTE,\n status: response.status,\n body: Buffer.from(await blob.arrayBuffer()),\n headers\n },\n cacheControl: {\n revalidate,\n expire\n }\n };\n return cacheEntry;\n } else {\n // send response without caching if not ISR\n await sendResponse(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil);\n return null;\n }\n } catch (err) {\n // if this is a background revalidate we need to report\n // the request error here as it won't be bubbled\n if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: srcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n throw err;\n }\n };\n const cacheEntry = await routeModule.handleResponse({\n req,\n nextConfig,\n cacheKey,\n routeKind: RouteKind.APP_ROUTE,\n isFallback: false,\n prerenderManifest,\n isRoutePPREnabled: false,\n isOnDemandRevalidate,\n revalidateOnlyGenerated,\n responseGenerator,\n waitUntil: ctx.waitUntil,\n isMinimalMode\n });\n // we don't create a cacheEntry for ISR\n if (!isIsr) {\n return null;\n }\n if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) {\n var _cacheEntry_value1;\n throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), \"__NEXT_ERROR_CODE\", {\n value: \"E701\",\n enumerable: false,\n configurable: true\n });\n }\n if (!isMinimalMode) {\n res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT');\n }\n // Draft mode should never be cached\n if (isDraftMode) {\n res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');\n }\n const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers);\n if (!(isMinimalMode && isIsr)) {\n headers.delete(NEXT_CACHE_TAGS_HEADER);\n }\n // If cache control is already set on the response we don't\n // override it to allow users to customize it via next.config\n if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) {\n headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl));\n }\n await sendResponse(nodeNextReq, nodeNextRes, // @ts-expect-error - Argument of type 'Buffer<ArrayBufferLike>' is not assignable to parameter of type 'BodyInit | null | undefined'.\n new Response(cacheEntry.value.body, {\n headers,\n status: cacheEntry.value.status || 200\n }));\n return null;\n };\n // TODO: activeSpan code path is for when wrapped by\n // next-server can be removed when this is no longer used\n if (isWrappedByNextServer && activeSpan) {\n await handleResponse(activeSpan);\n } else {\n parentSpan = tracer.getActiveScopeSpan();\n await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, {\n spanName: `${method} ${srcPage}`,\n kind: SpanKind.SERVER,\n attributes: {\n 'http.method': method,\n 'http.target': req.url\n }\n }, handleResponse), undefined, !isWrappedByNextServer);\n }\n } catch (err) {\n if (!(err instanceof NoFallbackError)) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: normalizedSrcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n // rethrow so that we can handle serving error page\n // If this is during static generation, throw the error again.\n if (isIsr) throw err;\n // Otherwise, send a 500 response.\n await sendResponse(nodeNextReq, nodeNextRes, new Response(null, {\n status: 500\n }));\n return null;\n }\n}\n\n//# sourceMappingURL=app-route.js.map\n","/**\n * GET /api/interactive/sessions/[id]/stream\n *\n * Per-session SSE stream delivering real-time agent stdout chunks to the browser.\n * - Subscribes to InteractiveSessionService stdout events\n * - Emits `delta` events with each token chunk\n * - Emits `done` events at end-of-turn\n * - Cleans up listener when the client disconnects\n */\n\nimport type { NextRequest } from 'next/server';\nimport { resolve } from '@/lib/server-container';\nimport type { IInteractiveSessionService } from '@shipit-ai/core/application/ports/output/services/interactive-session-service.interface';\n\nexport const dynamic = 'force-dynamic';\n\ninterface RouteParams {\n params: Promise<{ id: string }>;\n}\n\nexport async function GET(request: NextRequest, { params }: RouteParams): Promise<Response> {\n const { id: sessionId } = await params;\n\n try {\n const service = resolve<IInteractiveSessionService>('IInteractiveSessionService');\n\n // Verify session exists\n const session = await service.getSession(sessionId);\n if (!session) {\n return new Response(JSON.stringify({ error: 'Session not found' }), {\n status: 404,\n headers: { 'Content-Type': 'application/json' },\n });\n }\n\n const encoder = new TextEncoder();\n\n const stream = new ReadableStream<Uint8Array>({\n start(controller) {\n let closed = false;\n\n function enqueue(text: string) {\n if (closed) return;\n try {\n controller.enqueue(encoder.encode(text));\n } catch {\n // Stream may already be closed\n }\n }\n\n // Send initial comment so the browser knows the stream is alive\n enqueue(': connected\\n\\n');\n\n // Keep-alive heartbeat every 15s to prevent browser/proxy timeouts\n const heartbeat = setInterval(() => {\n enqueue(': heartbeat\\n\\n');\n }, 15_000);\n\n // Subscribe to real-time stdout chunks from the session service\n const unsubscribe = service.subscribe(sessionId, (chunk) => {\n if (chunk.done) {\n const payload = { done: true, sessionId };\n enqueue(`event: done\\ndata: ${JSON.stringify(payload)}\\n\\n`);\n } else if (chunk.log) {\n const payload = { log: chunk.log, sessionId };\n enqueue(`event: log\\ndata: ${JSON.stringify(payload)}\\n\\n`);\n } else if (chunk.delta) {\n const payload = { delta: chunk.delta, sessionId };\n enqueue(`event: delta\\ndata: ${JSON.stringify(payload)}\\n\\n`);\n }\n });\n\n // Cleanup on client disconnect\n function cleanup() {\n if (closed) return;\n closed = true;\n clearInterval(heartbeat);\n unsubscribe();\n try {\n controller.close();\n } catch {\n // Stream may already be closed\n }\n }\n\n request.signal.addEventListener('abort', cleanup, { once: true });\n },\n });\n\n return new Response(stream, {\n headers: {\n 'Content-Type': 'text/event-stream',\n 'Cache-Control': 'no-cache',\n Connection: 'keep-alive',\n },\n });\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error('[GET /api/interactive/sessions/:id/stream]', error);\n return new Response(JSON.stringify({ error: String(error) }), {\n status: 500,\n headers: { 'Content-Type': 'application/json' },\n });\n }\n}\n"],"names":["CONTAINER_KEY","resolve","token","container","globalThis","Error","dynamic","closed","encode","GET","request","params","id","sessionId","service","session","getSession","Response","JSON","stringify","error","status","headers","enqueue","encoder","TextEncoder","chunk","stream","ReadableStream","start","controller","text","heartbeat","setInterval","unsubscribe","subscribe","done","payload","log","delta","cleanup","clearInterval","close","signal","addEventListener","once","Connection","console","String"],"mappings":"i1BAuBO,SAAoBE,AAAXD,CAAmC,EACjD,IAAME,EAAaC,UAAsC,CAACJ,AAdtC,mBAcoD,CAIxE,GAAI,CAACG,EACH,MAAM,AAAIE,GADI,GAEZ,0FAIJ,OAAOF,EAAUF,OAAO,CAACC,EAC3B,4BCnCA,IAAA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,KACA,EAAA,EAAA,CAAA,CAAA,MACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,MACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACAK,EAAAA,CAAAA,CAAAA,OAAAA,IAAAA,EAAAA,EAAAA,CAAAA,CAAAA,OCLA,EAAA,EAAA,CAAA,CAAA,OASO,eAAeE,EAAIC,CAAoB,CAAE,CAAEC,QAAM,CAAe,EACrE,GAAM,CAAEC,GAAIC,CAAS,CAAE,CAAG,MAAMF,EAEhC,GAAI,CACF,IAAMG,EAAU,CAAA,EAAA,EAAA,OAAA,AAAO,EAA6B,8BAIpD,GAAI,CADY,AACXC,MADiBD,EAAQE,CAChB,SAD0B,CA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AFmC,KAE7B,EAAY,cAAc,CAAC,EAAK,EAAK,CACvC,WAAY,aACZ,UAAW,EACX,UAAW,QACX,iBAAkB,CAAA,EAAA,EAAA,mBAAA,AAAmB,EAAC,CAClC,0CACA,CACJ,EACJ,GAAG,AATgB,EASJ,GAIf,EAAO,MAAM,EAKjB,OAHA,MAAM,CAAA,EAAA,EAAA,YAAA,AAAY,EAAC,EAAa,EAAa,IAAI,SAAS,KAAM,CAC5D,OAAQ,GACZ,IACO,IACX,CACJ,mCA3TA,SAAS,EACL,MAAO,CAAA,EAAA,EAAA,UAAA,AAAW,EAAC,kBACf,uBACA,CACJ,EACJ","ignoreList":[1]}
@@ -1,3 +0,0 @@
1
- module.exports=[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"))},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"))},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"))},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"))},70406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},14747,(e,t,r)=>{t.exports=e.x("path",()=>require("path"))},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";e.s(["resolve",0,function(e){let t=globalThis.__shipitAiContainer;if(!t)throw Error("DI container not available. Ensure the CLI bootstrap or dev-server has initialized it.");return t.resolve(e)}])},24868,(e,t,r)=>{t.exports=e.x("fs/promises",()=>require("fs/promises"))},40915,e=>{"use strict";var t=e.i(29932),r=e.i(88797),a=e.i(78439),s=e.i(21387),n=e.i(351),o=e.i(1286),i=e.i(31060),l=e.i(67760),p=e.i(13435),d=e.i(60316),u=e.i(37130),c=e.i(31516),h=e.i(63144),x=e.i(3719),m=e.i(66941),g=e.i(93695);e.i(76574);var v=e.i(45014),f=e.i(25716),R=e.i(24868),w=e.i(14747),y=e.i(60526),b=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",".zip",".tar",".gz",".log"]),C={".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 j(e){try{let t,r,{path:a,sessionId:s}=await e.json();if(!a||!s)return f.NextResponse.json({error:"Missing required fields: path, sessionId"},{status:400});let n=(0,w.extname)(a).toLowerCase();if(!n||!E.has(n))return f.NextResponse.json({error:n?`File type "${n}" is not allowed`:"Files without an extension are not allowed"},{status:400});try{t=await (0,R.realpath)((0,w.resolve)(a))}catch{return f.NextResponse.json({error:"File not found or unreadable"},{status:404})}if(![await (0,R.realpath)(process.cwd()).catch(()=>process.cwd()),await (0,R.realpath)((0,y.homedir)()).catch(()=>(0,y.homedir)())].some(e=>t===e||t.startsWith(e+w.sep)))return f.NextResponse.json({error:"Access denied"},{status:403});try{r=await (0,R.readFile)((0,w.resolve)(a))}catch{return f.NextResponse.json({error:"File not found or unreadable"},{status:404})}if(r.length>0xa00000)return f.NextResponse.json({error:`File exceeds 10 MB limit (${(r.length/1024/1024).toFixed(1)} MB)`},{status:413});let o=(0,w.basename)(a),i=C[n]??"application/octet-stream",l=(0,b.resolve)("AttachmentStorageService").store(r,o,i,s);return f.NextResponse.json({id:l.id,name:l.name,size:Number(l.size),mimeType:l.mimeType,path:l.path,createdAt:l.createdAt})}catch(t){let e=t instanceof Error?t.message:"Upload failed";return f.NextResponse.json({error:e},{status:500})}}e.s(["POST",0,j],28686);var A=e.i(28686);let N=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:"",userland:A,...{}}),{workAsyncStorage:T,workUnitAsyncStorage:q,serverHooks:S}=N;async function P(e,t,a){a.requestMeta&&(0,s.setRequestMeta)(e,a.requestMeta),N.isDev&&(0,s.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let f="/api/attachments/upload-from-path/route";f=f.replace(/\/index$/,"")||"/";let R=await N.prepare(e,t,{srcPage:f,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:b,parsedUrl:E,isDraftMode:C,prerenderManifest:j,routerServerContext:A,isOnDemandRevalidate:T,revalidateOnlyGenerated:q,resolvedPathname:S,clientReferenceManifest:P,serverActionsManifest:_}=R,k=(0,i.normalizeAppPath)(f),O=!!(j.dynamicRoutes[k]||j.routes[S]),I=async()=>((null==A?void 0:A.render404)?await A.render404(e,t,E,!1):t.end("This page could not be found"),null);if(O&&!C){let e=!!j.routes[S],t=j.dynamicRoutes[k];if(t&&!1===t.fallback&&!e){if(b.adapterPath)return await I();throw new g.NoFallbackError}}let M=null;!O||N.isDev||C||(M="/index"===(M=S)?"/":M);let H=!0===N.isDev||!O,U=O&&!H;_&&P&&(0,o.setManifestsSingleton)({page:f,clientReferenceManifest:P,serverActionsManifest:_});let F=e.method||"GET",D=(0,n.getTracer)(),$=D.getActiveScopeSpan(),B=!!(null==A?void 0:A.isWrappedByNextServer),K=!!(0,s.getRequestMeta)(e,"minimalMode"),z=(0,s.getRequestMeta)(e,"incrementalCache")||await N.getIncrementalCache(e,b,j,K);null==z||z.resetRequestCache(),globalThis.__incrementalCache=z;let L={params:y,previewProps:j.preview,renderOpts:{experimental:{authInterrupts:!!b.experimental.authInterrupts},cacheComponents:!!b.cacheComponents,supportsDynamicResponse:H,incrementalCache:z,cacheLifeProfiles:b.cacheLife,waitUntil:a.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,a,s)=>N.onRequestError(e,t,a,s,A)},sharedContext:{buildId:w}},W=new l.NodeNextRequest(e),G=new l.NodeNextResponse(t),V=p.NextRequestAdapter.fromNodeNextRequest(W,(0,p.signalFromNodeResponse)(t));try{let s,o=async e=>N.handle(V,L).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=D.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=`${F} ${a}`;e.setAttributes({"next.route":a,"http.route":a,"next.span_name":t}),e.updateName(t),s&&s!==e&&(s.setAttribute("http.route",a),s.updateName(t))}else e.updateName(`${F} ${f}`)}),i=async s=>{var n,i;let l=async({previousCacheEntry:r})=>{try{if(!K&&T&&q&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let n=await o(s);e.fetchMetrics=L.renderOpts.fetchMetrics;let i=L.renderOpts.pendingWaitUntil;i&&a.waitUntil&&(a.waitUntil(i),i=void 0);let l=L.renderOpts.collectedTags;if(!O)return await (0,c.sendResponse)(W,G,n,L.renderOpts.pendingWaitUntil),null;{let e=await n.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(n.headers);l&&(t[m.NEXT_CACHE_TAGS_HEADER]=l),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==L.renderOpts.collectedRevalidate&&!(L.renderOpts.collectedRevalidate>=m.INFINITE_CACHE)&&L.renderOpts.collectedRevalidate,a=void 0===L.renderOpts.collectedExpire||L.renderOpts.collectedExpire>=m.INFINITE_CACHE?void 0:L.renderOpts.collectedExpire;return{value:{kind:v.CachedRouteKind.APP_ROUTE,status:n.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:a}}}}catch(t){throw(null==r?void 0:r.isStale)&&await N.onRequestError(e,t,{routerKind:"App Router",routePath:f,routeType:"route",revalidateReason:(0,u.getRevalidateReason)({isStaticGeneration:U,isOnDemandRevalidate:T})},!1,A),t}},p=await N.handleResponse({req:e,nextConfig:b,cacheKey:M,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:j,isRoutePPREnabled:!1,isOnDemandRevalidate:T,revalidateOnlyGenerated:q,responseGenerator:l,waitUntil:a.waitUntil,isMinimalMode:K});if(!O)return null;if((null==p||null==(n=p.value)?void 0:n.kind)!==v.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==p||null==(i=p.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});K||t.setHeader("x-nextjs-cache",T?"REVALIDATED":p.isMiss?"MISS":p.isStale?"STALE":"HIT"),C&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let d=(0,h.fromNodeOutgoingHttpHeaders)(p.value.headers);return K&&O||d.delete(m.NEXT_CACHE_TAGS_HEADER),!p.cacheControl||t.getHeader("Cache-Control")||d.get("Cache-Control")||d.set("Cache-Control",(0,x.getCacheControlHeader)(p.cacheControl)),await (0,c.sendResponse)(W,G,new Response(p.value.body,{headers:d,status:p.value.status||200})),null};B&&$?await i($):(s=D.getActiveScopeSpan(),await D.withPropagatedContext(e.headers,()=>D.trace(d.BaseServerSpan.handleRequest,{spanName:`${F} ${f}`,kind:n.SpanKind.SERVER,attributes:{"http.method":F,"http.target":e.url}},i),void 0,!B))}catch(t){if(t instanceof g.NoFallbackError||await N.onRequestError(e,t,{routerKind:"App Router",routePath:k,routeType:"route",revalidateReason:(0,u.getRevalidateReason)({isStaticGeneration:U,isOnDemandRevalidate:T})},!1,A),O)throw t;return await (0,c.sendResponse)(W,G,new Response(null,{status:500})),null}}e.s(["handler",0,P,"patchFetch",0,function(){return(0,a.patchFetch)({workAsyncStorage:T,workUnitAsyncStorage:q})},"routeModule",0,N,"serverHooks",0,S,"workAsyncStorage",0,T,"workUnitAsyncStorage",0,q],40915)}];
2
-
3
- //# sourceMappingURL=%5Broot-of-the-server%5D__0l1p8bx._.js.map
@@ -1 +0,0 @@
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.2.2_%40babel%2Bcore%407.29.0_%40playwright%2Btest%401.59.1_react-dom%4019.2.4_react%4019.2.4__react%4019.2.4/node_modules/next/dist/esm/build/templates/app-route.js"],"sourcesContent":["/**\n * Server Container Accessor\n *\n * Provides a `resolve()` helper for server components and API routes to\n * obtain DI-managed instances. The tsyringe container is placed on globalThis\n * by the CLI bootstrap (`shipit-ai ui`) or the dev-server (`pnpm dev:web`).\n */\n\nimport type { DependencyContainer, InjectionToken } from 'tsyringe';\n\nconst CONTAINER_KEY = '__shipitAiContainer';\n\n/**\n * Resolve a dependency from the DI container.\n *\n * Usage in server components / API routes:\n * ```ts\n * import { resolve } from '@/lib/server-container';\n * import { ListFeaturesUseCase } from '@shipit-ai/core/application/use-cases/features/list-features.use-case';\n *\n * const features = await resolve(ListFeaturesUseCase).execute();\n * ```\n */\nexport function resolve<T>(token: InjectionToken<T>): T {\n const container = (globalThis as Record<string, unknown>)[CONTAINER_KEY] as\n | DependencyContainer\n | undefined;\n\n if (!container) {\n throw new Error(\n 'DI container not available. Ensure the CLI bootstrap or dev-server has initialized it.'\n );\n }\n\n return container.resolve(token);\n}\n","import { NextResponse } from 'next/server';\nimport { readFile, realpath } from 'fs/promises';\nimport { extname, basename, resolve as resolvePath, sep } from 'path';\nimport { homedir } from 'node:os';\nimport { resolve } from '@/lib/server-container';\nimport type { AttachmentStorageService } from '@shipit-ai/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 '.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(\n {\n error: ext\n ? `File type \"${ext}\" is not allowed`\n : 'Files without an extension are not allowed',\n },\n { status: 400 }\n );\n }\n\n // Path containment: resolve symlinks then verify within allowed roots\n let physicalPath: string;\n try {\n physicalPath = await realpath(resolvePath(path));\n } catch {\n return NextResponse.json({ error: 'File not found or unreadable' }, { status: 404 });\n }\n const allowedRoots = [\n await realpath(process.cwd()).catch(() => process.cwd()),\n await realpath(homedir()).catch(() => homedir()),\n ];\n const isAllowed = allowedRoots.some(\n (root) => physicalPath === root || physicalPath.startsWith(root + sep)\n );\n if (!isAllowed) {\n return NextResponse.json({ error: 'Access denied' }, { status: 403 });\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, setRequestMeta } from \"next/dist/esm/server/request-meta\";\nimport { getTracer, SpanKind } from \"next/dist/esm/server/lib/trace/tracer\";\nimport { setManifestsSingleton } from \"next/dist/esm/server/app-render/manifests-singleton\";\nimport { normalizeAppPath } from \"next/dist/esm/shared/lib/router/utils/app-paths\";\nimport { NodeNextRequest, NodeNextResponse } from \"next/dist/esm/server/base-http/node\";\nimport { NextRequestAdapter, signalFromNodeResponse } from \"next/dist/esm/server/web/spec-extension/adapters/next-request\";\nimport { BaseServerSpan } from \"next/dist/esm/server/lib/trace/constants\";\nimport { getRevalidateReason } from \"next/dist/esm/server/instrumentation/utils\";\nimport { sendResponse } from \"next/dist/esm/server/send-response\";\nimport { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from \"next/dist/esm/server/web/utils\";\nimport { getCacheControlHeader } from \"next/dist/esm/server/lib/cache-control\";\nimport { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from \"next/dist/esm/lib/constants\";\nimport { NoFallbackError } from \"next/dist/esm/shared/lib/no-fallback-error.external\";\nimport { CachedRouteKind } from \"next/dist/esm/server/response-cache\";\nimport * as userland from \"INNER_APP_ROUTE\";\n// We inject the nextConfigOutput here so that we can use them in the route\n// module.\nconst nextConfigOutput = \"\"\nconst routeModule = new AppRouteRouteModule({\n definition: {\n kind: RouteKind.APP_ROUTE,\n page: \"/api/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 // The static import is used for initialization (methods, dynamic, etc.).\n userland: userland,\n // In Turbopack dev mode, also provide a getter that calls require() on every\n // request. This re-reads from devModuleCache so HMR updates are picked up,\n // and the async wrapper unwraps async-module Promises (ESM-only\n // serverExternalPackages) automatically.\n ...process.env.TURBOPACK && process.env.__NEXT_DEV_SERVER ? {\n getUserland: ()=>import(\"INNER_APP_ROUTE\")\n } : {}\n});\n// Pull out the exports that we need to expose from the module. This should\n// be eliminated when we've moved the other routes to the new format. These\n// are used to hook into the route.\nconst { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule;\nfunction patchFetch() {\n return _patchFetch({\n workAsyncStorage,\n workUnitAsyncStorage\n });\n}\nexport { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, };\nexport async function handler(req, res, ctx) {\n if (ctx.requestMeta) {\n setRequestMeta(req, ctx.requestMeta);\n }\n if (routeModule.isDev) {\n addRequestMeta(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint());\n }\n let srcPage = \"/api/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.adapterPath) {\n return await render404();\n }\n throw new NoFallbackError();\n }\n }\n }\n let cacheKey = null;\n if (isIsr && !routeModule.isDev && !isDraftMode) {\n cacheKey = resolvedPathname;\n // ensure /index and / is normalized to one key\n cacheKey = cacheKey === '/index' ? '/' : cacheKey;\n }\n const supportsDynamicResponse = // If we're in development, we always support dynamic HTML\n routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports\n // dynamic HTML.\n !isIsr;\n // This is a revalidation request if the request is for a static\n // page and it is not being resumed from a postponed render and\n // it is not a dynamic RSC request then it is a revalidation\n // request.\n const isStaticGeneration = isIsr && !supportsDynamicResponse;\n // Before rendering (which initializes component tree modules), we have to\n // set the reference manifests to our global store so Server Action's\n // encryption util can access to them at the top level of the page module.\n if (serverActionsManifest && clientReferenceManifest) {\n setManifestsSingleton({\n page: srcPage,\n clientReferenceManifest,\n serverActionsManifest\n });\n }\n const method = req.method || 'GET';\n const tracer = getTracer();\n const activeSpan = tracer.getActiveScopeSpan();\n const isWrappedByNextServer = Boolean(routerServerContext == null ? void 0 : routerServerContext.isWrappedByNextServer);\n const isMinimalMode = Boolean(getRequestMeta(req, 'minimalMode'));\n const incrementalCache = getRequestMeta(req, 'incrementalCache') || await routeModule.getIncrementalCache(req, nextConfig, prerenderManifest, isMinimalMode);\n incrementalCache == null ? void 0 : incrementalCache.resetRequestCache();\n globalThis.__incrementalCache = incrementalCache;\n const context = {\n params,\n previewProps: prerenderManifest.preview,\n renderOpts: {\n experimental: {\n authInterrupts: Boolean(nextConfig.experimental.authInterrupts)\n },\n cacheComponents: Boolean(nextConfig.cacheComponents),\n supportsDynamicResponse,\n incrementalCache,\n cacheLifeProfiles: nextConfig.cacheLife,\n waitUntil: ctx.waitUntil,\n onClose: (cb)=>{\n res.on('close', cb);\n },\n onAfterTaskError: undefined,\n onInstrumentationRequestError: (error, _request, errorContext, silenceLog)=>routeModule.onRequestError(req, error, errorContext, silenceLog, routerServerContext)\n },\n sharedContext: {\n buildId\n }\n };\n const nodeNextReq = new NodeNextRequest(req);\n const nodeNextRes = new NodeNextResponse(res);\n const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res));\n try {\n let parentSpan;\n const invokeRouteModule = async (span)=>{\n return routeModule.handle(nextReq, context).finally(()=>{\n if (!span) return;\n span.setAttributes({\n 'http.status_code': res.statusCode,\n 'next.rsc': false\n });\n const rootSpanAttributes = tracer.getRootSpanAttributes();\n // We were unable to get attributes, probably OTEL is not enabled\n if (!rootSpanAttributes) {\n return;\n }\n if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) {\n console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);\n return;\n }\n const route = rootSpanAttributes.get('next.route');\n if (route) {\n const name = `${method} ${route}`;\n span.setAttributes({\n 'next.route': route,\n 'http.route': route,\n 'next.span_name': name\n });\n span.updateName(name);\n // Propagate http.route to the parent span if one exists (e.g.\n // a platform-created HTTP span in adapter deployments).\n if (parentSpan && parentSpan !== span) {\n parentSpan.setAttribute('http.route', route);\n parentSpan.updateName(name);\n }\n } else {\n span.updateName(`${method} ${srcPage}`);\n }\n });\n };\n const handleResponse = async (currentSpan)=>{\n var _cacheEntry_value;\n const responseGenerator = async ({ previousCacheEntry })=>{\n try {\n if (!isMinimalMode && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) {\n res.statusCode = 404;\n // on-demand revalidate always sets this header\n res.setHeader('x-nextjs-cache', 'REVALIDATED');\n res.end('This page could not be found');\n return null;\n }\n const response = await invokeRouteModule(currentSpan);\n req.fetchMetrics = context.renderOpts.fetchMetrics;\n let pendingWaitUntil = context.renderOpts.pendingWaitUntil;\n // Attempt using provided waitUntil if available\n // if it's not we fallback to sendResponse's handling\n if (pendingWaitUntil) {\n if (ctx.waitUntil) {\n ctx.waitUntil(pendingWaitUntil);\n pendingWaitUntil = undefined;\n }\n }\n const cacheTags = context.renderOpts.collectedTags;\n // If the request is for a static response, we can cache it so long\n // as it's not edge.\n if (isIsr) {\n const blob = await response.blob();\n // Copy the headers from the response.\n const headers = toNodeOutgoingHttpHeaders(response.headers);\n if (cacheTags) {\n headers[NEXT_CACHE_TAGS_HEADER] = cacheTags;\n }\n if (!headers['content-type'] && blob.type) {\n headers['content-type'] = blob.type;\n }\n const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate;\n const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire;\n // Create the cache entry for the response.\n const cacheEntry = {\n value: {\n kind: CachedRouteKind.APP_ROUTE,\n status: response.status,\n body: Buffer.from(await blob.arrayBuffer()),\n headers\n },\n cacheControl: {\n revalidate,\n expire\n }\n };\n return cacheEntry;\n } else {\n // send response without caching if not ISR\n await sendResponse(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil);\n return null;\n }\n } catch (err) {\n // if this is a background revalidate we need to report\n // the request error here as it won't be bubbled\n if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: srcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n throw err;\n }\n };\n const cacheEntry = await routeModule.handleResponse({\n req,\n nextConfig,\n cacheKey,\n routeKind: RouteKind.APP_ROUTE,\n isFallback: false,\n prerenderManifest,\n isRoutePPREnabled: false,\n isOnDemandRevalidate,\n revalidateOnlyGenerated,\n responseGenerator,\n waitUntil: ctx.waitUntil,\n isMinimalMode\n });\n // we don't create a cacheEntry for ISR\n if (!isIsr) {\n return null;\n }\n if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) {\n var _cacheEntry_value1;\n throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), \"__NEXT_ERROR_CODE\", {\n value: \"E701\",\n enumerable: false,\n configurable: true\n });\n }\n if (!isMinimalMode) {\n res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT');\n }\n // Draft mode should never be cached\n if (isDraftMode) {\n res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');\n }\n const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers);\n if (!(isMinimalMode && isIsr)) {\n headers.delete(NEXT_CACHE_TAGS_HEADER);\n }\n // If cache control is already set on the response we don't\n // override it to allow users to customize it via next.config\n if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) {\n headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl));\n }\n await sendResponse(nodeNextReq, nodeNextRes, // @ts-expect-error - Argument of type 'Buffer<ArrayBufferLike>' is not assignable to parameter of type 'BodyInit | null | undefined'.\n new Response(cacheEntry.value.body, {\n headers,\n status: cacheEntry.value.status || 200\n }));\n return null;\n };\n // TODO: activeSpan code path is for when wrapped by\n // next-server can be removed when this is no longer used\n if (isWrappedByNextServer && activeSpan) {\n await handleResponse(activeSpan);\n } else {\n parentSpan = tracer.getActiveScopeSpan();\n await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, {\n spanName: `${method} ${srcPage}`,\n kind: SpanKind.SERVER,\n attributes: {\n 'http.method': method,\n 'http.target': req.url\n }\n }, handleResponse), undefined, !isWrappedByNextServer);\n }\n } catch (err) {\n if (!(err instanceof NoFallbackError)) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: normalizedSrcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n // rethrow so that we can handle serving error page\n // If this is during static generation, throw the error again.\n if (isIsr) throw err;\n // Otherwise, send a 500 response.\n await sendResponse(nodeNextReq, nodeNextRes, new Response(null, {\n status: 500\n }));\n return null;\n }\n}\n\n//# sourceMappingURL=app-route.js.map\n"],"names":["CONTAINER_KEY","resolve","token","container","globalThis","Error","MAX_FILE_SIZE","ALLOWED_EXTENSIONS","Set","buffer","mimeType","ext","MIME_MAP","POST","request","body","json","path","sessionId","error","status","toLowerCase","has","physicalPath","allowedRoots","process","cwd","catch","isAllowed","some","root","startsWith","length","toFixed","filename","service","attachment","store","id","name","size","Number","createdAt","message"],"mappings":"goCAuBO,SAAoBE,AAAXD,CAAmC,EACjD,IAAME,EAAaC,UAAsC,CAACJ,AAdtC,mBAcoD,CAIxE,GAAI,CAACG,EACH,MAAM,AAAIE,GADI,GAEZ,0FAIJ,OAAOF,EAAUF,OAAO,CAACC,EAC3B,qGEnCA,IAAA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,KACA,EAAA,EAAA,CAAA,CAAA,MACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,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AI,GACvC,IACO,IACX,EAGI,GAAyB,EACzB,MAAM,EAAe,EADgB,EAGrC,EAAa,EAAO,kBAAkB,GACtC,MAAM,EAAO,qBAAqB,CAAC,EAAI,OAAO,CAAE,IAAI,EAAO,KAAK,CAAC,EAAA,cAAc,CAAC,aAAa,CAAE,CACvF,SAAU,CAAA,EAAG,EAAO,CAAC,EAAE,EAAA,CAAS,CAChC,KAAM,EAAA,QAAQ,CAAC,MAAM,CACrB,WAAY,CACR,cAAe,EACf,cAAe,EAAI,GAAG,AAC1B,CACJ,EAAG,QAAiB,EAAW,CAAC,GAE5C,CAAE,MAAO,EAAK,CAeV,GAdM,aAAe,EAAA,eAAe,EAEhC,CAFmC,KAE7B,EAAY,cAAc,CAAC,EAAK,EAAK,CACvC,WAAY,aACZ,UAAW,EACX,UAAW,QACX,iBAAkB,CAAA,EAAA,EAAA,mBAAA,AAAmB,EAAC,oBAClC,uBACA,CACJ,EACJ,GAAG,AATgB,EASJ,GAIf,EAAO,MAAM,EAKjB,OAHA,MAAM,CAAA,EAAA,EAAA,YAAA,AAAY,EAAC,EAAa,EAAa,IAAI,SAAS,KAAM,CAC5D,OAAQ,GACZ,IACO,IACX,CACJ,mCA3TA,SAAS,EACL,MAAOF,CAAAA,EAAAA,EAAAA,UAAAA,AAAW,EAAC,kBACf,uBACA,CACJ,EACJ","ignoreList":[2]}
@@ -1,18 +0,0 @@
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"))},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"))},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"))},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";e.s(["resolve",0,function(e){let t=globalThis.__shipitAiContainer;if(!t)throw Error("DI container not available. Ensure the CLI bootstrap or dev-server has initialized it.");return t.resolve(e)}])},14076,e=>{"use strict";var t=e.i(29932),r=e.i(88797),a=e.i(78439),n=e.i(21387),i=e.i(351),o=e.i(1286),s=e.i(31060),l=e.i(67760),d=e.i(13435),u=e.i(60316),c=e.i(37130),p=e.i(31516),h=e.i(63144),v=e.i(3719),g=e.i(66941),R=e.i(93695);e.i(76574);var f=e.i(45014),x=e.i(40060);async function m(e,{params:t}){let{featureId:r}=await t;try{let t=(0,x.resolve)("IInteractiveSessionService"),a=new TextEncoder,n=new ReadableStream({start(n){let i=!1;function o(e){if(!i)try{n.enqueue(a.encode(e))}catch{}}o(": connected\n\n");let s=setInterval(()=>{o(": heartbeat\n\n")},15e3),l=t.subscribeByFeature(r,e=>{e.done?o(`event: done
2
- data: ${JSON.stringify({done:!0,featureId:r})}
3
-
4
- `):e.activity?(o(`event: activity
5
- data: ${JSON.stringify({activity:e.activity,featureId:r})}
6
-
7
- `),e.log&&o(`event: log
8
- data: ${JSON.stringify({log:e.log,featureId:r})}
9
-
10
- `)):e.log?o(`event: log
11
- data: ${JSON.stringify({log:e.log,featureId:r})}
12
-
13
- `):e.delta&&o(`event: delta
14
- data: ${JSON.stringify({delta:e.delta,featureId:r})}
15
-
16
- `)});e.signal.addEventListener("abort",function(){if(!i){i=!0,clearInterval(s),l();try{n.close()}catch{}}},{once:!0})}});return new Response(n,{headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"}})}catch(e){return console.error("[GET /api/interactive/chat/:featureId/stream]",e),new Response(JSON.stringify({error:String(e)}),{status:500,headers:{"Content-Type":"application/json"}})}}e.s(["GET",0,m,"dynamic",0,"force-dynamic"],37267);var y=e.i(37267);let w=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/interactive/chat/[featureId]/stream/route",pathname:"/api/interactive/chat/[featureId]/stream",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/presentation/web/app/api/interactive/chat/[featureId]/stream/route.ts",nextConfigOutput:"",userland:y,...{}}),{workAsyncStorage:E,workUnitAsyncStorage:C,serverHooks:b}=w;async function A(e,t,a){a.requestMeta&&(0,n.setRequestMeta)(e,a.requestMeta),w.isDev&&(0,n.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let x="/api/interactive/chat/[featureId]/stream/route";x=x.replace(/\/index$/,"")||"/";let m=await w.prepare(e,t,{srcPage:x,multiZoneDraftMode:!1});if(!m)return t.statusCode=400,t.end("Bad Request"),null==a.waitUntil||a.waitUntil.call(a,Promise.resolve()),null;let{buildId:y,params:E,nextConfig:C,parsedUrl:b,isDraftMode:A,prerenderManifest:S,routerServerContext:N,isOnDemandRevalidate:T,revalidateOnlyGenerated:I,resolvedPathname:O,clientReferenceManifest:q,serverActionsManifest:P}=m,_=(0,s.normalizeAppPath)(x),k=!!(S.dynamicRoutes[_]||S.routes[O]),H=async()=>((null==N?void 0:N.render404)?await N.render404(e,t,b,!1):t.end("This page could not be found"),null);if(k&&!A){let e=!!S.routes[O],t=S.dynamicRoutes[_];if(t&&!1===t.fallback&&!e){if(C.adapterPath)return await H();throw new R.NoFallbackError}}let j=null;!k||w.isDev||A||(j="/index"===(j=O)?"/":j);let U=!0===w.isDev||!k,M=k&&!U;P&&q&&(0,o.setManifestsSingleton)({page:x,clientReferenceManifest:q,serverActionsManifest:P});let D=e.method||"GET",$=(0,i.getTracer)(),F=$.getActiveScopeSpan(),K=!!(null==N?void 0:N.isWrappedByNextServer),B=!!(0,n.getRequestMeta)(e,"minimalMode"),L=(0,n.getRequestMeta)(e,"incrementalCache")||await w.getIncrementalCache(e,C,S,B);null==L||L.resetRequestCache(),globalThis.__incrementalCache=L;let J={params:E,previewProps:S.preview,renderOpts:{experimental:{authInterrupts:!!C.experimental.authInterrupts},cacheComponents:!!C.cacheComponents,supportsDynamicResponse:U,incrementalCache:L,cacheLifeProfiles:C.cacheLife,waitUntil:a.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,a,n)=>w.onRequestError(e,t,a,n,N)},sharedContext:{buildId:y}},G=new l.NodeNextRequest(e),V=new l.NodeNextResponse(t),W=d.NextRequestAdapter.fromNodeNextRequest(G,(0,d.signalFromNodeResponse)(t));try{let n,o=async e=>w.handle(W,J).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=$.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==u.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),n&&n!==e&&(n.setAttribute("http.route",a),n.updateName(t))}else e.updateName(`${D} ${x}`)}),s=async n=>{var i,s;let l=async({previousCacheEntry:r})=>{try{if(!B&&T&&I&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let i=await o(n);e.fetchMetrics=J.renderOpts.fetchMetrics;let s=J.renderOpts.pendingWaitUntil;s&&a.waitUntil&&(a.waitUntil(s),s=void 0);let l=J.renderOpts.collectedTags;if(!k)return await (0,p.sendResponse)(G,V,i,J.renderOpts.pendingWaitUntil),null;{let e=await i.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(i.headers);l&&(t[g.NEXT_CACHE_TAGS_HEADER]=l),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==J.renderOpts.collectedRevalidate&&!(J.renderOpts.collectedRevalidate>=g.INFINITE_CACHE)&&J.renderOpts.collectedRevalidate,a=void 0===J.renderOpts.collectedExpire||J.renderOpts.collectedExpire>=g.INFINITE_CACHE?void 0:J.renderOpts.collectedExpire;return{value:{kind:f.CachedRouteKind.APP_ROUTE,status:i.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:a}}}}catch(t){throw(null==r?void 0:r.isStale)&&await w.onRequestError(e,t,{routerKind:"App Router",routePath:x,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:M,isOnDemandRevalidate:T})},!1,N),t}},d=await w.handleResponse({req:e,nextConfig:C,cacheKey:j,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:S,isRoutePPREnabled:!1,isOnDemandRevalidate:T,revalidateOnlyGenerated:I,responseGenerator:l,waitUntil:a.waitUntil,isMinimalMode:B});if(!k)return null;if((null==d||null==(i=d.value)?void 0:i.kind)!==f.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(s=d.value)?void 0:s.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});B||t.setHeader("x-nextjs-cache",T?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let u=(0,h.fromNodeOutgoingHttpHeaders)(d.value.headers);return B&&k||u.delete(g.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||t.getHeader("Cache-Control")||u.get("Cache-Control")||u.set("Cache-Control",(0,v.getCacheControlHeader)(d.cacheControl)),await (0,p.sendResponse)(G,V,new Response(d.value.body,{headers:u,status:d.value.status||200})),null};K&&F?await s(F):(n=$.getActiveScopeSpan(),await $.withPropagatedContext(e.headers,()=>$.trace(u.BaseServerSpan.handleRequest,{spanName:`${D} ${x}`,kind:i.SpanKind.SERVER,attributes:{"http.method":D,"http.target":e.url}},s),void 0,!K))}catch(t){if(t instanceof R.NoFallbackError||await w.onRequestError(e,t,{routerKind:"App Router",routePath:_,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:M,isOnDemandRevalidate:T})},!1,N),k)throw t;return await (0,p.sendResponse)(G,V,new Response(null,{status:500})),null}}e.s(["handler",0,A,"patchFetch",0,function(){return(0,a.patchFetch)({workAsyncStorage:E,workUnitAsyncStorage:C})},"routeModule",0,w,"serverHooks",0,b,"workAsyncStorage",0,E,"workUnitAsyncStorage",0,C],14076)}];
17
-
18
- //# sourceMappingURL=%5Broot-of-the-server%5D__0p~owgt._.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../src/presentation/web/lib/server-container.ts","../../../../../../node_modules/.pnpm/next%4016.2.2_%40babel%2Bcore%407.29.0_%40playwright%2Btest%401.59.1_react-dom%4019.2.4_react%4019.2.4__react%4019.2.4/node_modules/next/dist/esm/build/templates/app-route.js","../../../../../../src/presentation/web/app/api/interactive/chat/%5BfeatureId%5D/stream/route.ts"],"sourcesContent":["/**\n * Server Container Accessor\n *\n * Provides a `resolve()` helper for server components and API routes to\n * obtain DI-managed instances. The tsyringe container is placed on globalThis\n * by the CLI bootstrap (`shipit-ai ui`) or the dev-server (`pnpm dev:web`).\n */\n\nimport type { DependencyContainer, InjectionToken } from 'tsyringe';\n\nconst CONTAINER_KEY = '__shipitAiContainer';\n\n/**\n * Resolve a dependency from the DI container.\n *\n * Usage in server components / API routes:\n * ```ts\n * import { resolve } from '@/lib/server-container';\n * import { ListFeaturesUseCase } from '@shipit-ai/core/application/use-cases/features/list-features.use-case';\n *\n * const features = await resolve(ListFeaturesUseCase).execute();\n * ```\n */\nexport function resolve<T>(token: InjectionToken<T>): T {\n const container = (globalThis as Record<string, unknown>)[CONTAINER_KEY] as\n | DependencyContainer\n | undefined;\n\n if (!container) {\n throw new Error(\n 'DI container not available. Ensure the CLI bootstrap or dev-server has initialized it.'\n );\n }\n\n return container.resolve(token);\n}\n","import { AppRouteRouteModule } from \"next/dist/esm/server/route-modules/app-route/module.compiled\";\nimport { RouteKind } from \"next/dist/esm/server/route-kind\";\nimport { patchFetch as _patchFetch } from \"next/dist/esm/server/lib/patch-fetch\";\nimport { addRequestMeta, getRequestMeta, setRequestMeta } from \"next/dist/esm/server/request-meta\";\nimport { getTracer, SpanKind } from \"next/dist/esm/server/lib/trace/tracer\";\nimport { setManifestsSingleton } from \"next/dist/esm/server/app-render/manifests-singleton\";\nimport { normalizeAppPath } from \"next/dist/esm/shared/lib/router/utils/app-paths\";\nimport { NodeNextRequest, NodeNextResponse } from \"next/dist/esm/server/base-http/node\";\nimport { NextRequestAdapter, signalFromNodeResponse } from \"next/dist/esm/server/web/spec-extension/adapters/next-request\";\nimport { BaseServerSpan } from \"next/dist/esm/server/lib/trace/constants\";\nimport { getRevalidateReason } from \"next/dist/esm/server/instrumentation/utils\";\nimport { sendResponse } from \"next/dist/esm/server/send-response\";\nimport { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from \"next/dist/esm/server/web/utils\";\nimport { getCacheControlHeader } from \"next/dist/esm/server/lib/cache-control\";\nimport { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from \"next/dist/esm/lib/constants\";\nimport { NoFallbackError } from \"next/dist/esm/shared/lib/no-fallback-error.external\";\nimport { CachedRouteKind } from \"next/dist/esm/server/response-cache\";\nimport * as userland from \"INNER_APP_ROUTE\";\n// We inject the nextConfigOutput here so that we can use them in the route\n// module.\nconst nextConfigOutput = \"\"\nconst routeModule = new AppRouteRouteModule({\n definition: {\n kind: RouteKind.APP_ROUTE,\n page: \"/api/interactive/chat/[featureId]/stream/route\",\n pathname: \"/api/interactive/chat/[featureId]/stream\",\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/interactive/chat/[featureId]/stream/route.ts\",\n nextConfigOutput,\n // The static import is used for initialization (methods, dynamic, etc.).\n userland: userland,\n // In Turbopack dev mode, also provide a getter that calls require() on every\n // request. This re-reads from devModuleCache so HMR updates are picked up,\n // and the async wrapper unwraps async-module Promises (ESM-only\n // serverExternalPackages) automatically.\n ...process.env.TURBOPACK && process.env.__NEXT_DEV_SERVER ? {\n getUserland: ()=>import(\"INNER_APP_ROUTE\")\n } : {}\n});\n// Pull out the exports that we need to expose from the module. This should\n// be eliminated when we've moved the other routes to the new format. These\n// are used to hook into the route.\nconst { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule;\nfunction patchFetch() {\n return _patchFetch({\n workAsyncStorage,\n workUnitAsyncStorage\n });\n}\nexport { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, };\nexport async function handler(req, res, ctx) {\n if (ctx.requestMeta) {\n setRequestMeta(req, ctx.requestMeta);\n }\n if (routeModule.isDev) {\n addRequestMeta(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint());\n }\n let srcPage = \"/api/interactive/chat/[featureId]/stream/route\";\n // turbopack doesn't normalize `/index` in the page name\n // so we need to to process dynamic routes properly\n // TODO: fix turbopack providing differing value from webpack\n if (process.env.TURBOPACK) {\n srcPage = srcPage.replace(/\\/index$/, '') || '/';\n } else if (srcPage === '/index') {\n // we always normalize /index specifically\n srcPage = '/';\n }\n const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE;\n const prepareResult = await routeModule.prepare(req, res, {\n srcPage,\n multiZoneDraftMode\n });\n if (!prepareResult) {\n res.statusCode = 400;\n res.end('Bad Request');\n ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve());\n return null;\n }\n const { buildId, params, nextConfig, parsedUrl, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname, clientReferenceManifest, serverActionsManifest } = prepareResult;\n const normalizedSrcPage = normalizeAppPath(srcPage);\n let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]);\n const render404 = async ()=>{\n // TODO: should route-module itself handle rendering the 404\n if (routerServerContext == null ? void 0 : routerServerContext.render404) {\n await routerServerContext.render404(req, res, parsedUrl, false);\n } else {\n res.end('This page could not be found');\n }\n return null;\n };\n if (isIsr && !isDraftMode) {\n const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]);\n const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage];\n if (prerenderInfo) {\n if (prerenderInfo.fallback === false && !isPrerendered) {\n if (nextConfig.adapterPath) {\n return await render404();\n }\n throw new NoFallbackError();\n }\n }\n }\n let cacheKey = null;\n if (isIsr && !routeModule.isDev && !isDraftMode) {\n cacheKey = resolvedPathname;\n // ensure /index and / is normalized to one key\n cacheKey = cacheKey === '/index' ? '/' : cacheKey;\n }\n const supportsDynamicResponse = // If we're in development, we always support dynamic HTML\n routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports\n // dynamic HTML.\n !isIsr;\n // This is a revalidation request if the request is for a static\n // page and it is not being resumed from a postponed render and\n // it is not a dynamic RSC request then it is a revalidation\n // request.\n const isStaticGeneration = isIsr && !supportsDynamicResponse;\n // Before rendering (which initializes component tree modules), we have to\n // set the reference manifests to our global store so Server Action's\n // encryption util can access to them at the top level of the page module.\n if (serverActionsManifest && clientReferenceManifest) {\n setManifestsSingleton({\n page: srcPage,\n clientReferenceManifest,\n serverActionsManifest\n });\n }\n const method = req.method || 'GET';\n const tracer = getTracer();\n const activeSpan = tracer.getActiveScopeSpan();\n const isWrappedByNextServer = Boolean(routerServerContext == null ? void 0 : routerServerContext.isWrappedByNextServer);\n const isMinimalMode = Boolean(getRequestMeta(req, 'minimalMode'));\n const incrementalCache = getRequestMeta(req, 'incrementalCache') || await routeModule.getIncrementalCache(req, nextConfig, prerenderManifest, isMinimalMode);\n incrementalCache == null ? void 0 : incrementalCache.resetRequestCache();\n globalThis.__incrementalCache = incrementalCache;\n const context = {\n params,\n previewProps: prerenderManifest.preview,\n renderOpts: {\n experimental: {\n authInterrupts: Boolean(nextConfig.experimental.authInterrupts)\n },\n cacheComponents: Boolean(nextConfig.cacheComponents),\n supportsDynamicResponse,\n incrementalCache,\n cacheLifeProfiles: nextConfig.cacheLife,\n waitUntil: ctx.waitUntil,\n onClose: (cb)=>{\n res.on('close', cb);\n },\n onAfterTaskError: undefined,\n onInstrumentationRequestError: (error, _request, errorContext, silenceLog)=>routeModule.onRequestError(req, error, errorContext, silenceLog, routerServerContext)\n },\n sharedContext: {\n buildId\n }\n };\n const nodeNextReq = new NodeNextRequest(req);\n const nodeNextRes = new NodeNextResponse(res);\n const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res));\n try {\n let parentSpan;\n const invokeRouteModule = async (span)=>{\n return routeModule.handle(nextReq, context).finally(()=>{\n if (!span) return;\n span.setAttributes({\n 'http.status_code': res.statusCode,\n 'next.rsc': false\n });\n const rootSpanAttributes = tracer.getRootSpanAttributes();\n // We were unable to get attributes, probably OTEL is not enabled\n if (!rootSpanAttributes) {\n return;\n }\n if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) {\n console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);\n return;\n }\n const route = rootSpanAttributes.get('next.route');\n if (route) {\n const name = `${method} ${route}`;\n span.setAttributes({\n 'next.route': route,\n 'http.route': route,\n 'next.span_name': name\n });\n span.updateName(name);\n // Propagate http.route to the parent span if one exists (e.g.\n // a platform-created HTTP span in adapter deployments).\n if (parentSpan && parentSpan !== span) {\n parentSpan.setAttribute('http.route', route);\n parentSpan.updateName(name);\n }\n } else {\n span.updateName(`${method} ${srcPage}`);\n }\n });\n };\n const handleResponse = async (currentSpan)=>{\n var _cacheEntry_value;\n const responseGenerator = async ({ previousCacheEntry })=>{\n try {\n if (!isMinimalMode && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) {\n res.statusCode = 404;\n // on-demand revalidate always sets this header\n res.setHeader('x-nextjs-cache', 'REVALIDATED');\n res.end('This page could not be found');\n return null;\n }\n const response = await invokeRouteModule(currentSpan);\n req.fetchMetrics = context.renderOpts.fetchMetrics;\n let pendingWaitUntil = context.renderOpts.pendingWaitUntil;\n // Attempt using provided waitUntil if available\n // if it's not we fallback to sendResponse's handling\n if (pendingWaitUntil) {\n if (ctx.waitUntil) {\n ctx.waitUntil(pendingWaitUntil);\n pendingWaitUntil = undefined;\n }\n }\n const cacheTags = context.renderOpts.collectedTags;\n // If the request is for a static response, we can cache it so long\n // as it's not edge.\n if (isIsr) {\n const blob = await response.blob();\n // Copy the headers from the response.\n const headers = toNodeOutgoingHttpHeaders(response.headers);\n if (cacheTags) {\n headers[NEXT_CACHE_TAGS_HEADER] = cacheTags;\n }\n if (!headers['content-type'] && blob.type) {\n headers['content-type'] = blob.type;\n }\n const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate;\n const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire;\n // Create the cache entry for the response.\n const cacheEntry = {\n value: {\n kind: CachedRouteKind.APP_ROUTE,\n status: response.status,\n body: Buffer.from(await blob.arrayBuffer()),\n headers\n },\n cacheControl: {\n revalidate,\n expire\n }\n };\n return cacheEntry;\n } else {\n // send response without caching if not ISR\n await sendResponse(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil);\n return null;\n }\n } catch (err) {\n // if this is a background revalidate we need to report\n // the request error here as it won't be bubbled\n if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: srcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n throw err;\n }\n };\n const cacheEntry = await routeModule.handleResponse({\n req,\n nextConfig,\n cacheKey,\n routeKind: RouteKind.APP_ROUTE,\n isFallback: false,\n prerenderManifest,\n isRoutePPREnabled: false,\n isOnDemandRevalidate,\n revalidateOnlyGenerated,\n responseGenerator,\n waitUntil: ctx.waitUntil,\n isMinimalMode\n });\n // we don't create a cacheEntry for ISR\n if (!isIsr) {\n return null;\n }\n if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) {\n var _cacheEntry_value1;\n throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), \"__NEXT_ERROR_CODE\", {\n value: \"E701\",\n enumerable: false,\n configurable: true\n });\n }\n if (!isMinimalMode) {\n res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT');\n }\n // Draft mode should never be cached\n if (isDraftMode) {\n res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');\n }\n const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers);\n if (!(isMinimalMode && isIsr)) {\n headers.delete(NEXT_CACHE_TAGS_HEADER);\n }\n // If cache control is already set on the response we don't\n // override it to allow users to customize it via next.config\n if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) {\n headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl));\n }\n await sendResponse(nodeNextReq, nodeNextRes, // @ts-expect-error - Argument of type 'Buffer<ArrayBufferLike>' is not assignable to parameter of type 'BodyInit | null | undefined'.\n new Response(cacheEntry.value.body, {\n headers,\n status: cacheEntry.value.status || 200\n }));\n return null;\n };\n // TODO: activeSpan code path is for when wrapped by\n // next-server can be removed when this is no longer used\n if (isWrappedByNextServer && activeSpan) {\n await handleResponse(activeSpan);\n } else {\n parentSpan = tracer.getActiveScopeSpan();\n await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, {\n spanName: `${method} ${srcPage}`,\n kind: SpanKind.SERVER,\n attributes: {\n 'http.method': method,\n 'http.target': req.url\n }\n }, handleResponse), undefined, !isWrappedByNextServer);\n }\n } catch (err) {\n if (!(err instanceof NoFallbackError)) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: normalizedSrcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n // rethrow so that we can handle serving error page\n // If this is during static generation, throw the error again.\n if (isIsr) throw err;\n // Otherwise, send a 500 response.\n await sendResponse(nodeNextReq, nodeNextRes, new Response(null, {\n status: 500\n }));\n return null;\n }\n}\n\n//# sourceMappingURL=app-route.js.map\n","/**\n * Feature-scoped SSE stream for real-time chat updates.\n *\n * Resolves the active session for the feature internally.\n * Emits:\n * - `delta` events with token chunks\n * - `log` events for tool use / thinking\n * - `done` events at end-of-turn\n *\n * `featureId` is a polymorphic scope key: a feature UUID, \"repo-<id>\", or \"global\".\n */\n\nimport type { NextRequest } from 'next/server';\nimport { resolve } from '@/lib/server-container';\nimport type { IInteractiveSessionService } from '@shipit-ai/core/application/ports/output/services/interactive-session-service.interface';\n\nexport const dynamic = 'force-dynamic';\n\ninterface RouteParams {\n params: Promise<{ featureId: string }>;\n}\n\nexport async function GET(request: NextRequest, { params }: RouteParams): Promise<Response> {\n const { featureId } = await params;\n\n try {\n // SSE streams use service directly for subscribe pattern\n const service = resolve<IInteractiveSessionService>('IInteractiveSessionService');\n const encoder = new TextEncoder();\n\n const stream = new ReadableStream<Uint8Array>({\n start(controller) {\n let closed = false;\n\n function enqueue(text: string) {\n if (closed) return;\n try {\n controller.enqueue(encoder.encode(text));\n } catch {\n // Stream may already be closed\n }\n }\n\n enqueue(': connected\\n\\n');\n\n const heartbeat = setInterval(() => {\n enqueue(': heartbeat\\n\\n');\n }, 15_000);\n\n const unsubscribe = service.subscribeByFeature(featureId, (chunk) => {\n if (chunk.done) {\n enqueue(`event: done\\ndata: ${JSON.stringify({ done: true, featureId })}\\n\\n`);\n } else if (chunk.activity) {\n enqueue(\n `event: activity\\ndata: ${JSON.stringify({ activity: chunk.activity, featureId })}\\n\\n`\n );\n // Also send log for the status indicator\n if (chunk.log) {\n enqueue(`event: log\\ndata: ${JSON.stringify({ log: chunk.log, featureId })}\\n\\n`);\n }\n } else if (chunk.log) {\n enqueue(`event: log\\ndata: ${JSON.stringify({ log: chunk.log, featureId })}\\n\\n`);\n } else if (chunk.delta) {\n enqueue(`event: delta\\ndata: ${JSON.stringify({ delta: chunk.delta, featureId })}\\n\\n`);\n }\n });\n\n function cleanup() {\n if (closed) return;\n closed = true;\n clearInterval(heartbeat);\n unsubscribe();\n try {\n controller.close();\n } catch {\n // Stream may already be closed\n }\n }\n\n request.signal.addEventListener('abort', cleanup, { once: true });\n },\n });\n\n return new Response(stream, {\n headers: {\n 'Content-Type': 'text/event-stream',\n 'Cache-Control': 'no-cache',\n Connection: 'keep-alive',\n },\n });\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error('[GET /api/interactive/chat/:featureId/stream]', error);\n return new Response(JSON.stringify({ error: String(error) }), {\n status: 500,\n headers: { 'Content-Type': 'application/json' },\n });\n }\n}\n"],"names":["CONTAINER_KEY","resolve","token","container","globalThis","Error","dynamic","stream","chunk","enqueue","done","GET","request","params","featureId","service","encoder","TextEncoder","ReadableStream","start","controller","JSON","closed","text","encode","Response","heartbeat","setInterval","console","unsubscribe","subscribeByFeature","stringify","activity","log","delta","cleanup","clearInterval","close","signal","addEventListener","once","headers","Connection","error","String","status"],"mappings":"i1BAuBO,SAAoBE,AAAXD,CAAmC,EACjD,IAAME,EAAaC,UAAsC,CAACJ,AAdtC,mBAcoD,CAIxE,GAAI,CAACG,EACH,MAAM,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,EAAA,EAAA,UAAA,AAAWmB,EAAC,kBACf,uBACA,CACJ,EACJ","ignoreList":[1]}
@@ -1,3 +0,0 @@
1
- module.exports=[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"))},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"))},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"))},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"))},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"))},70406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},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"))},12714,(e,t,r)=>{t.exports=e.x("node:fs/promises",()=>require("node:fs/promises"))},24934,e=>{"use strict";var t=e.i(25716);e.s(["apiError",0,function(e,r,a){if(a){let t=a instanceof Error?a.message:String(a);console.error(`[API ${e}] ${r}: ${t}`)}return t.NextResponse.json({error:r},{status:e})}])},92039,e=>{"use strict";var t=e.i(29932),r=e.i(88797),a=e.i(78439),n=e.i(21387),s=e.i(351),o=e.i(1286),i=e.i(31060),l=e.i(67760),d=e.i(13435),u=e.i(60316),p=e.i(37130),c=e.i(31516),h=e.i(63144),x=e.i(3719),f=e.i(66941),R=e.i(93695);e.i(76574);var m=e.i(45014),v=e.i(25716),w=e.i(12714),y=e.i(60526),g=e.i(50227),E=e.i(24934);async function C(e){let t,r=new URL(e.url),a=r.searchParams.get("path")??(0,y.homedir)(),n="true"===r.searchParams.get("showHidden");if(!g.default.isAbsolute(a))return v.NextResponse.json({error:"Path must be absolute"},{status:400});let s=g.default.resolve(a);try{t=await (0,w.realpath)(s)}catch{return v.NextResponse.json({error:"Directory not found"},{status:404})}if(![await (0,w.realpath)(process.cwd()).catch(()=>process.cwd()),await (0,w.realpath)((0,y.homedir)()).catch(()=>(0,y.homedir)())].some(e=>t===e||t.startsWith(e+g.default.sep)))return v.NextResponse.json({error:"Access denied"},{status:403});try{if(!(await (0,w.stat)(s)).isDirectory())return v.NextResponse.json({error:"Path is not a directory"},{status:400})}catch(e){var o;if((o=e)instanceof Error&&"code"in o&&"ENOENT"===e.code)return v.NextResponse.json({error:"Directory not found"},{status:404});return(0,E.apiError)(500,"Failed to access directory",e)}try{let e=await (0,w.readdir)(s,{withFileTypes:!0}),t=[],r=e.map(async e=>{if(!n&&e.name.startsWith("."))return null;let t=g.default.join(s,e.name);try{if(e.isDirectory()){let r=await (0,w.stat)(t);return{name:e.name,path:t,isDirectory:!0,updatedAt:r.mtime.toISOString()}}if(e.isSymbolicLink()){let r=await (0,w.stat)(t);if(r.isDirectory())return{name:e.name,path:t,isDirectory:!0,updatedAt:r.mtime.toISOString()}}}catch{}return null});for(let e of(await Promise.all(r)))null!==e&&t.push(e);return v.NextResponse.json({entries:t,currentPath:s})}catch(e){return(0,E.apiError)(500,"Failed to read directory",e)}}e.s(["GET",0,C],47661);var A=e.i(47661);let b=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/directory/list/route",pathname:"/api/directory/list",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/presentation/web/app/api/directory/list/route.ts",nextConfigOutput:"",userland:A,...{}}),{workAsyncStorage:N,workUnitAsyncStorage:P,serverHooks:S}=b;async function T(e,t,a){a.requestMeta&&(0,n.setRequestMeta)(e,a.requestMeta),b.isDev&&(0,n.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let v="/api/directory/list/route";v=v.replace(/\/index$/,"")||"/";let w=await b.prepare(e,t,{srcPage:v,multiZoneDraftMode:!1});if(!w)return t.statusCode=400,t.end("Bad Request"),null==a.waitUntil||a.waitUntil.call(a,Promise.resolve()),null;let{buildId:y,params:g,nextConfig:E,parsedUrl:C,isDraftMode:A,prerenderManifest:N,routerServerContext:P,isOnDemandRevalidate:S,revalidateOnlyGenerated:T,resolvedPathname:q,clientReferenceManifest:j,serverActionsManifest:O}=w,k=(0,i.normalizeAppPath)(v),_=!!(N.dynamicRoutes[k]||N.routes[q]),D=async()=>((null==P?void 0:P.render404)?await P.render404(e,t,C,!1):t.end("This page could not be found"),null);if(_&&!A){let e=!!N.routes[q],t=N.dynamicRoutes[k];if(t&&!1===t.fallback&&!e){if(E.adapterPath)return await D();throw new R.NoFallbackError}}let I=null;!_||b.isDev||A||(I="/index"===(I=q)?"/":I);let H=!0===b.isDev||!_,U=_&&!H;O&&j&&(0,o.setManifestsSingleton)({page:v,clientReferenceManifest:j,serverActionsManifest:O});let M=e.method||"GET",$=(0,s.getTracer)(),F=$.getActiveScopeSpan(),K=!!(null==P?void 0:P.isWrappedByNextServer),L=!!(0,n.getRequestMeta)(e,"minimalMode"),B=(0,n.getRequestMeta)(e,"incrementalCache")||await b.getIncrementalCache(e,E,N,L);null==B||B.resetRequestCache(),globalThis.__incrementalCache=B;let W={params:g,previewProps:N.preview,renderOpts:{experimental:{authInterrupts:!!E.experimental.authInterrupts},cacheComponents:!!E.cacheComponents,supportsDynamicResponse:H,incrementalCache:B,cacheLifeProfiles:E.cacheLife,waitUntil:a.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,a,n)=>b.onRequestError(e,t,a,n,P)},sharedContext:{buildId:y}},G=new l.NodeNextRequest(e),V=new l.NodeNextResponse(t),X=d.NextRequestAdapter.fromNodeNextRequest(G,(0,d.signalFromNodeResponse)(t));try{let n,o=async e=>b.handle(X,W).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=$.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==u.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=`${M} ${a}`;e.setAttributes({"next.route":a,"http.route":a,"next.span_name":t}),e.updateName(t),n&&n!==e&&(n.setAttribute("http.route",a),n.updateName(t))}else e.updateName(`${M} ${v}`)}),i=async n=>{var s,i;let l=async({previousCacheEntry:r})=>{try{if(!L&&S&&T&&!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=W.renderOpts.fetchMetrics;let i=W.renderOpts.pendingWaitUntil;i&&a.waitUntil&&(a.waitUntil(i),i=void 0);let l=W.renderOpts.collectedTags;if(!_)return await (0,c.sendResponse)(G,V,s,W.renderOpts.pendingWaitUntil),null;{let e=await s.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(s.headers);l&&(t[f.NEXT_CACHE_TAGS_HEADER]=l),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==W.renderOpts.collectedRevalidate&&!(W.renderOpts.collectedRevalidate>=f.INFINITE_CACHE)&&W.renderOpts.collectedRevalidate,a=void 0===W.renderOpts.collectedExpire||W.renderOpts.collectedExpire>=f.INFINITE_CACHE?void 0:W.renderOpts.collectedExpire;return{value:{kind:m.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 b.onRequestError(e,t,{routerKind:"App Router",routePath:v,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:U,isOnDemandRevalidate:S})},!1,P),t}},d=await b.handleResponse({req:e,nextConfig:E,cacheKey:I,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:N,isRoutePPREnabled:!1,isOnDemandRevalidate:S,revalidateOnlyGenerated:T,responseGenerator:l,waitUntil:a.waitUntil,isMinimalMode:L});if(!_)return null;if((null==d||null==(s=d.value)?void 0:s.kind)!==m.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});L||t.setHeader("x-nextjs-cache",S?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let u=(0,h.fromNodeOutgoingHttpHeaders)(d.value.headers);return L&&_||u.delete(f.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||t.getHeader("Cache-Control")||u.get("Cache-Control")||u.set("Cache-Control",(0,x.getCacheControlHeader)(d.cacheControl)),await (0,c.sendResponse)(G,V,new Response(d.value.body,{headers:u,status:d.value.status||200})),null};K&&F?await i(F):(n=$.getActiveScopeSpan(),await $.withPropagatedContext(e.headers,()=>$.trace(u.BaseServerSpan.handleRequest,{spanName:`${M} ${v}`,kind:s.SpanKind.SERVER,attributes:{"http.method":M,"http.target":e.url}},i),void 0,!K))}catch(t){if(t instanceof R.NoFallbackError||await b.onRequestError(e,t,{routerKind:"App Router",routePath:k,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:U,isOnDemandRevalidate:S})},!1,P),_)throw t;return await (0,c.sendResponse)(G,V,new Response(null,{status:500})),null}}e.s(["handler",0,T,"patchFetch",0,function(){return(0,a.patchFetch)({workAsyncStorage:N,workUnitAsyncStorage:P})},"routeModule",0,b,"serverHooks",0,S,"workAsyncStorage",0,N,"workUnitAsyncStorage",0,P],92039)}];
2
-
3
- //# sourceMappingURL=%5Broot-of-the-server%5D__0rru~m.._.js.map