dev3000 0.0.94 → 0.0.96

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 (278) hide show
  1. package/dist/dev-environment.d.ts.map +1 -1
  2. package/dist/dev-environment.js +22 -26
  3. package/dist/dev-environment.js.map +1 -1
  4. package/mcp-server/.next/BUILD_ID +1 -1
  5. package/mcp-server/.next/build-manifest.json +8 -10
  6. package/mcp-server/.next/fallback-build-manifest.json +3 -5
  7. package/mcp-server/.next/images-manifest.json +8 -2
  8. package/mcp-server/.next/next-minimal-server.js.nft.json +1 -1
  9. package/mcp-server/.next/next-server.js.nft.json +1 -1
  10. package/mcp-server/.next/prerender-manifest.json +3 -3
  11. package/mcp-server/.next/required-server-files.json +21 -20
  12. package/mcp-server/.next/server/app/_global-error/page/build-manifest.json +5 -5
  13. package/mcp-server/.next/server/app/_global-error/page.js +8 -8
  14. package/mcp-server/.next/server/app/_global-error/page.js.nft.json +1 -1
  15. package/mcp-server/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  16. package/mcp-server/.next/server/app/_global-error.html +2 -2
  17. package/mcp-server/.next/server/app/_global-error.meta +6 -1
  18. package/mcp-server/.next/server/app/_global-error.rsc +11 -13
  19. package/mcp-server/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +5 -0
  20. package/mcp-server/.next/server/app/_global-error.segments/_index.segment.rsc +4 -0
  21. package/mcp-server/.next/server/app/_global-error.segments/_tree.segment.rsc +7 -0
  22. package/mcp-server/.next/server/app/_not-found/page/build-manifest.json +5 -5
  23. package/mcp-server/.next/server/app/_not-found/page.js +10 -10
  24. package/mcp-server/.next/server/app/_not-found/page.js.nft.json +1 -1
  25. package/mcp-server/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  26. package/mcp-server/.next/server/app/_not-found.html +1 -1
  27. package/mcp-server/.next/server/app/_not-found.meta +7 -1
  28. package/mcp-server/.next/server/app/_not-found.rsc +12 -14
  29. package/mcp-server/.next/server/app/_not-found.segments/_index.segment.rsc +5 -0
  30. package/mcp-server/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +5 -0
  31. package/mcp-server/.next/server/app/_not-found.segments/_not-found.segment.rsc +4 -0
  32. package/mcp-server/.next/server/app/_not-found.segments/_tree.segment.rsc +8 -0
  33. package/mcp-server/.next/server/app/api/jank/[session]/route.js +6 -6
  34. package/mcp-server/.next/server/app/api/jank/[session]/route.js.nft.json +1 -1
  35. package/mcp-server/.next/server/app/api/logs/append/route.js +4 -4
  36. package/mcp-server/.next/server/app/api/logs/append/route.js.nft.json +1 -1
  37. package/mcp-server/.next/server/app/api/logs/head/route.js +4 -4
  38. package/mcp-server/.next/server/app/api/logs/head/route.js.nft.json +1 -1
  39. package/mcp-server/.next/server/app/api/logs/list/route.js +4 -4
  40. package/mcp-server/.next/server/app/api/logs/list/route.js.nft.json +1 -1
  41. package/mcp-server/.next/server/app/api/logs/rotate/route.js +5 -5
  42. package/mcp-server/.next/server/app/api/logs/rotate/route.js.nft.json +1 -1
  43. package/mcp-server/.next/server/app/api/logs/stream/route.js +4 -4
  44. package/mcp-server/.next/server/app/api/logs/stream/route.js.nft.json +1 -1
  45. package/mcp-server/.next/server/app/api/logs/tail/route.js +4 -4
  46. package/mcp-server/.next/server/app/api/logs/tail/route.js.nft.json +1 -1
  47. package/mcp-server/.next/server/app/api/orchestrator/route.js +5 -5
  48. package/mcp-server/.next/server/app/api/orchestrator/route.js.nft.json +1 -1
  49. package/mcp-server/.next/server/app/api/screenshots/[filename]/route.js +5 -5
  50. package/mcp-server/.next/server/app/api/screenshots/[filename]/route.js.nft.json +1 -1
  51. package/mcp-server/.next/server/app/api/screenshots/list/route.js +5 -5
  52. package/mcp-server/.next/server/app/api/screenshots/list/route.js.nft.json +1 -1
  53. package/mcp-server/.next/server/app/api/tools/route.js +5 -5
  54. package/mcp-server/.next/server/app/api/tools/route.js.nft.json +1 -1
  55. package/mcp-server/.next/server/app/index.html +1 -1
  56. package/mcp-server/.next/server/app/index.meta +7 -2
  57. package/mcp-server/.next/server/app/index.rsc +14 -16
  58. package/mcp-server/.next/server/app/index.segments/__PAGE__.segment.rsc +9 -0
  59. package/mcp-server/.next/server/app/index.segments/_index.segment.rsc +5 -0
  60. package/mcp-server/.next/server/app/index.segments/_tree.segment.rsc +8 -0
  61. package/mcp-server/.next/server/app/logs/page/build-manifest.json +5 -5
  62. package/mcp-server/.next/server/app/logs/page.js +13 -13
  63. package/mcp-server/.next/server/app/logs/page.js.nft.json +1 -1
  64. package/mcp-server/.next/server/app/logs/page_client-reference-manifest.js +1 -1
  65. package/mcp-server/.next/server/app/mcp/route.js +4 -4
  66. package/mcp-server/.next/server/app/mcp/route.js.nft.json +1 -1
  67. package/mcp-server/.next/server/app/page/build-manifest.json +5 -5
  68. package/mcp-server/.next/server/app/page.js +12 -12
  69. package/mcp-server/.next/server/app/page.js.nft.json +1 -1
  70. package/mcp-server/.next/server/app/page_client-reference-manifest.js +1 -1
  71. package/mcp-server/.next/server/app/video/[session]/page/build-manifest.json +5 -5
  72. package/mcp-server/.next/server/app/video/[session]/page.js +12 -12
  73. package/mcp-server/.next/server/app/video/[session]/page.js.nft.json +1 -1
  74. package/mcp-server/.next/server/app/video/[session]/page_client-reference-manifest.js +1 -1
  75. package/mcp-server/.next/server/chunks/962f0_next_80b90dc3._.js +17 -0
  76. package/mcp-server/.next/server/chunks/962f0_next_80b90dc3._.js.map +1 -0
  77. package/mcp-server/.next/server/chunks/962f0_next_dist_esm_build_templates_app-route_fbcab413.js +3 -0
  78. package/mcp-server/.next/server/chunks/962f0_next_dist_esm_build_templates_app-route_fbcab413.js.map +1 -0
  79. package/mcp-server/.next/server/chunks/[root-of-the-server]__05e1e17a._.js +11 -0
  80. package/mcp-server/.next/server/chunks/[root-of-the-server]__05e1e17a._.js.map +1 -0
  81. package/mcp-server/.next/server/chunks/[root-of-the-server]__0f1f904c._.js +4 -0
  82. package/mcp-server/.next/server/chunks/[root-of-the-server]__0f1f904c._.js.map +1 -0
  83. package/mcp-server/.next/server/chunks/[root-of-the-server]__37cbcfad._.js +3 -0
  84. package/mcp-server/.next/server/chunks/[root-of-the-server]__3899cb0e._.js +3 -0
  85. package/mcp-server/.next/server/chunks/{[root-of-the-server]__cc81580c._.js.map → [root-of-the-server]__3899cb0e._.js.map} +1 -1
  86. package/mcp-server/.next/server/chunks/[root-of-the-server]__40003a13._.js +3 -0
  87. package/mcp-server/.next/server/chunks/[root-of-the-server]__40003a13._.js.map +1 -0
  88. package/mcp-server/.next/server/chunks/[root-of-the-server]__4e52a647._.js +3 -0
  89. package/mcp-server/.next/server/chunks/[root-of-the-server]__4e52a647._.js.map +1 -0
  90. package/mcp-server/.next/server/chunks/[root-of-the-server]__746ebd24._.js +3 -0
  91. package/mcp-server/.next/server/chunks/[root-of-the-server]__746ebd24._.js.map +1 -0
  92. package/mcp-server/.next/server/chunks/[root-of-the-server]__7820f710._.js +7 -0
  93. package/mcp-server/.next/server/chunks/[root-of-the-server]__7820f710._.js.map +1 -0
  94. package/mcp-server/.next/server/chunks/[root-of-the-server]__8caade4f._.js +17 -0
  95. package/mcp-server/.next/server/chunks/[root-of-the-server]__8caade4f._.js.map +1 -0
  96. package/mcp-server/.next/server/chunks/[root-of-the-server]__94037b23._.js +2 -2
  97. package/mcp-server/.next/server/chunks/[root-of-the-server]__94037b23._.js.map +1 -1
  98. package/mcp-server/.next/server/chunks/[root-of-the-server]__9a45c8f9._.js +1 -1
  99. package/mcp-server/.next/server/chunks/[root-of-the-server]__9a45c8f9._.js.map +1 -1
  100. package/mcp-server/.next/server/chunks/[root-of-the-server]__ae49815f._.js +2 -2
  101. package/mcp-server/.next/server/chunks/[root-of-the-server]__ae49815f._.js.map +1 -1
  102. package/mcp-server/.next/server/chunks/[root-of-the-server]__be04c8ec._.js +3 -0
  103. package/mcp-server/.next/server/chunks/[root-of-the-server]__be04c8ec._.js.map +1 -0
  104. package/mcp-server/.next/server/chunks/[root-of-the-server]__cc74dbef._.js +2 -2
  105. package/mcp-server/.next/server/chunks/[root-of-the-server]__cc74dbef._.js.map +1 -1
  106. package/mcp-server/.next/server/chunks/[root-of-the-server]__d8c4b7af._.js +3 -0
  107. package/mcp-server/.next/server/chunks/[root-of-the-server]__d8c4b7af._.js.map +1 -0
  108. package/mcp-server/.next/server/chunks/[root-of-the-server]__db4dce5b._.js +3 -0
  109. package/mcp-server/.next/server/chunks/[root-of-the-server]__db4dce5b._.js.map +1 -0
  110. package/mcp-server/.next/server/chunks/[root-of-the-server]__e1a64519._.js +1 -1
  111. package/mcp-server/.next/server/chunks/[root-of-the-server]__e1a64519._.js.map +1 -1
  112. package/mcp-server/.next/server/chunks/[root-of-the-server]__e305b486._.js +3 -0
  113. package/mcp-server/.next/server/chunks/[root-of-the-server]__e305b486._.js.map +1 -0
  114. package/mcp-server/.next/server/chunks/[turbopack]_runtime.js +1 -1
  115. package/mcp-server/.next/server/chunks/[turbopack]_runtime.js.map +1 -1
  116. package/mcp-server/.next/server/chunks/ssr/962f0_next_dist_0ff128f8._.js +6 -0
  117. package/mcp-server/.next/server/chunks/ssr/962f0_next_dist_0ff128f8._.js.map +1 -0
  118. package/mcp-server/.next/server/chunks/ssr/962f0_next_dist_431de271._.js +3 -0
  119. package/mcp-server/.next/server/chunks/ssr/962f0_next_dist_431de271._.js.map +1 -0
  120. package/mcp-server/.next/server/chunks/ssr/962f0_next_dist_7f9577da._.js +24 -0
  121. package/mcp-server/.next/server/chunks/ssr/962f0_next_dist_7f9577da._.js.map +1 -0
  122. package/mcp-server/.next/server/chunks/ssr/962f0_next_dist_a28dc041._.js +3 -0
  123. package/mcp-server/.next/server/chunks/ssr/962f0_next_dist_a28dc041._.js.map +1 -0
  124. package/mcp-server/.next/server/chunks/ssr/962f0_next_dist_a8de8a6b._.js +4 -0
  125. package/mcp-server/.next/server/chunks/ssr/962f0_next_dist_a8de8a6b._.js.map +1 -0
  126. package/mcp-server/.next/server/chunks/ssr/962f0_next_dist_client_components_0633a613._.js +3 -0
  127. package/mcp-server/.next/server/chunks/ssr/{d1d76_next_dist_client_components_6557bb14._.js.map → 962f0_next_dist_client_components_0633a613._.js.map} +1 -1
  128. package/mcp-server/.next/server/chunks/ssr/{d1d76_next_dist_client_components_builtin_forbidden_c162dd05.js → 962f0_next_dist_client_components_builtin_forbidden_828a4c7b.js} +2 -2
  129. package/mcp-server/.next/server/chunks/ssr/{d1d76_next_dist_client_components_builtin_forbidden_c162dd05.js.map → 962f0_next_dist_client_components_builtin_forbidden_828a4c7b.js.map} +1 -1
  130. package/mcp-server/.next/server/chunks/ssr/962f0_next_dist_client_components_builtin_global-error_c9f9f74f.js +3 -0
  131. package/mcp-server/.next/server/chunks/ssr/{d1d76_next_dist_client_components_builtin_global-error_3d982957.js.map → 962f0_next_dist_client_components_builtin_global-error_c9f9f74f.js.map} +1 -1
  132. package/mcp-server/.next/server/chunks/ssr/{d1d76_next_dist_client_components_builtin_unauthorized_e4f02ffd.js → 962f0_next_dist_client_components_builtin_unauthorized_0a08bab6.js} +2 -2
  133. package/mcp-server/.next/server/chunks/ssr/{d1d76_next_dist_client_components_builtin_unauthorized_e4f02ffd.js.map → 962f0_next_dist_client_components_builtin_unauthorized_0a08bab6.js.map} +1 -1
  134. package/mcp-server/.next/server/chunks/ssr/962f0_next_dist_esm_build_templates_app-page_077a704a.js +4 -0
  135. package/mcp-server/.next/server/chunks/ssr/962f0_next_dist_esm_build_templates_app-page_077a704a.js.map +1 -0
  136. package/mcp-server/.next/server/chunks/ssr/[root-of-the-server]__00b0a236._.js +3 -0
  137. package/mcp-server/.next/server/chunks/ssr/{[root-of-the-server]__61c905ce._.js.map → [root-of-the-server]__00b0a236._.js.map} +1 -1
  138. package/mcp-server/.next/server/chunks/ssr/[root-of-the-server]__1c9d4256._.js +3 -0
  139. package/mcp-server/.next/server/chunks/ssr/{[root-of-the-server]__9f07837d._.js.map → [root-of-the-server]__1c9d4256._.js.map} +1 -1
  140. package/mcp-server/.next/server/chunks/ssr/[root-of-the-server]__28056c4f._.js +3 -0
  141. package/mcp-server/.next/server/chunks/ssr/{[root-of-the-server]__cf030fda._.js.map → [root-of-the-server]__28056c4f._.js.map} +1 -1
  142. package/mcp-server/.next/server/chunks/ssr/{[root-of-the-server]__a4bb31a6._.js → [root-of-the-server]__295a5dca._.js} +2 -2
  143. package/mcp-server/.next/server/chunks/ssr/{[root-of-the-server]__a4bb31a6._.js.map → [root-of-the-server]__295a5dca._.js.map} +1 -1
  144. package/mcp-server/.next/server/chunks/ssr/[root-of-the-server]__2c3254f5._.js +3 -0
  145. package/mcp-server/.next/server/chunks/ssr/[root-of-the-server]__4e8e802a._.js +3 -0
  146. package/mcp-server/.next/server/chunks/ssr/[root-of-the-server]__4e8e802a._.js.map +1 -0
  147. package/mcp-server/.next/server/chunks/ssr/[root-of-the-server]__712e3fd9._.js +4 -0
  148. package/mcp-server/.next/server/chunks/ssr/{[root-of-the-server]__db74836a._.js.map → [root-of-the-server]__712e3fd9._.js.map} +1 -1
  149. package/mcp-server/.next/server/chunks/ssr/[root-of-the-server]__7a510847._.js +3 -0
  150. package/mcp-server/.next/server/chunks/ssr/{[root-of-the-server]__9bc632fa._.js.map → [root-of-the-server]__7a510847._.js.map} +1 -1
  151. package/mcp-server/.next/server/chunks/ssr/[root-of-the-server]__93844002._.js +3 -0
  152. package/mcp-server/.next/server/chunks/ssr/{[root-of-the-server]__fc10c8f1._.js.map → [root-of-the-server]__93844002._.js.map} +1 -1
  153. package/mcp-server/.next/server/chunks/ssr/[root-of-the-server]__9fa75557._.js +3 -0
  154. package/mcp-server/.next/server/chunks/ssr/{[root-of-the-server]__05689c01._.js.map → [root-of-the-server]__9fa75557._.js.map} +1 -1
  155. package/mcp-server/.next/server/chunks/ssr/[root-of-the-server]__d545d815._.js +3 -0
  156. package/mcp-server/.next/server/chunks/ssr/{[root-of-the-server]__aed64cd3._.js.map → [root-of-the-server]__d545d815._.js.map} +1 -1
  157. package/mcp-server/.next/server/chunks/ssr/[turbopack]_runtime.js +1 -1
  158. package/mcp-server/.next/server/chunks/ssr/[turbopack]_runtime.js.map +1 -1
  159. package/mcp-server/.next/server/chunks/ssr/_2485ac42._.js +4 -0
  160. package/mcp-server/.next/server/chunks/ssr/_2485ac42._.js.map +1 -0
  161. package/mcp-server/.next/server/chunks/ssr/_7665d4b6._.js +8 -0
  162. package/mcp-server/.next/server/chunks/ssr/_7665d4b6._.js.map +1 -0
  163. package/mcp-server/.next/server/chunks/ssr/_85b0bb0e._.js +4 -0
  164. package/mcp-server/.next/server/chunks/ssr/_85b0bb0e._.js.map +1 -0
  165. package/mcp-server/.next/server/chunks/ssr/_ab0d4e66._.js +4 -0
  166. package/mcp-server/.next/server/chunks/ssr/_ab0d4e66._.js.map +1 -0
  167. package/mcp-server/.next/server/chunks/ssr/_f8d18179._.js +8 -0
  168. package/mcp-server/.next/server/chunks/ssr/_f8d18179._.js.map +1 -0
  169. package/mcp-server/.next/server/chunks/ssr/mcp-server_app_layout_tsx_afa41767._.js +1 -1
  170. package/mcp-server/.next/server/chunks/ssr/mcp-server_app_page_tsx_9fc46577._.js +1 -1
  171. package/mcp-server/.next/server/chunks/ssr/mcp-server_app_page_tsx_9fc46577._.js.map +1 -1
  172. package/mcp-server/.next/server/chunks/ssr/mcp-server_components_dark-mode-toggle_tsx_f31dd15d._.js +1 -1
  173. package/mcp-server/.next/server/chunks/ssr/mcp-server_components_dark-mode-toggle_tsx_f31dd15d._.js.map +1 -1
  174. package/mcp-server/.next/server/chunks/ssr/node_modules__pnpm_c4e917e2._.js +5 -0
  175. package/mcp-server/.next/server/chunks/ssr/node_modules__pnpm_c4e917e2._.js.map +1 -0
  176. package/mcp-server/.next/server/middleware-build-manifest.js +6 -8
  177. package/mcp-server/.next/server/server-reference-manifest.js +1 -1
  178. package/mcp-server/.next/server/server-reference-manifest.json +1 -1
  179. package/mcp-server/.next/static/chunks/05266f8dc7f39515.js +1 -0
  180. package/mcp-server/.next/static/chunks/254fc038b458fc24.js +1 -0
  181. package/mcp-server/.next/static/chunks/47dfa4a59a973c81.js +3 -0
  182. package/mcp-server/.next/static/chunks/523922d638939c73.js +3 -0
  183. package/mcp-server/.next/static/chunks/65304580f587f083.js +4 -0
  184. package/mcp-server/.next/static/chunks/6ceb8223d9b0e885.js +1 -0
  185. package/mcp-server/.next/static/chunks/8ed7fe711322c4f9.css +1 -0
  186. package/mcp-server/.next/static/chunks/9d92c8368f54bcf4.js +1 -0
  187. package/mcp-server/.next/static/chunks/c5e14dcc4f8e1b05.js +20 -0
  188. package/mcp-server/.next/static/chunks/cf974972e06aaa61.js +3 -0
  189. package/mcp-server/.next/static/chunks/{711519b5a2e53fc8.js → e161f5ca5017b065.js} +1 -1
  190. package/mcp-server/.next/static/chunks/f4943fd29d67839f.js +1 -0
  191. package/mcp-server/.next/static/chunks/turbopack-d86fbc741b623284.js +3 -0
  192. package/mcp-server/app/mcp/client-manager.ts +4 -3
  193. package/mcp-server/app/mcp/route.ts +52 -14
  194. package/mcp-server/next.config.mjs +2 -1
  195. package/mcp-server/tsconfig.json +1 -1
  196. package/package.json +4 -4
  197. package/mcp-server/.next/server/chunks/[root-of-the-server]__013bbeea._.js +0 -7
  198. package/mcp-server/.next/server/chunks/[root-of-the-server]__013bbeea._.js.map +0 -1
  199. package/mcp-server/.next/server/chunks/[root-of-the-server]__05e38acd._.js +0 -3
  200. package/mcp-server/.next/server/chunks/[root-of-the-server]__05e38acd._.js.map +0 -1
  201. package/mcp-server/.next/server/chunks/[root-of-the-server]__2056c8b5._.js +0 -3
  202. package/mcp-server/.next/server/chunks/[root-of-the-server]__2056c8b5._.js.map +0 -1
  203. package/mcp-server/.next/server/chunks/[root-of-the-server]__3130ceec._.js +0 -3
  204. package/mcp-server/.next/server/chunks/[root-of-the-server]__3130ceec._.js.map +0 -1
  205. package/mcp-server/.next/server/chunks/[root-of-the-server]__5114419d._.js +0 -3
  206. package/mcp-server/.next/server/chunks/[root-of-the-server]__5114419d._.js.map +0 -1
  207. package/mcp-server/.next/server/chunks/[root-of-the-server]__5248c9ff._.js +0 -3
  208. package/mcp-server/.next/server/chunks/[root-of-the-server]__73645708._.js +0 -11
  209. package/mcp-server/.next/server/chunks/[root-of-the-server]__73645708._.js.map +0 -1
  210. package/mcp-server/.next/server/chunks/[root-of-the-server]__8fc8f497._.js +0 -4
  211. package/mcp-server/.next/server/chunks/[root-of-the-server]__8fc8f497._.js.map +0 -1
  212. package/mcp-server/.next/server/chunks/[root-of-the-server]__9c489027._.js +0 -3
  213. package/mcp-server/.next/server/chunks/[root-of-the-server]__9c489027._.js.map +0 -1
  214. package/mcp-server/.next/server/chunks/[root-of-the-server]__a004a307._.js +0 -3
  215. package/mcp-server/.next/server/chunks/[root-of-the-server]__a004a307._.js.map +0 -1
  216. package/mcp-server/.next/server/chunks/[root-of-the-server]__cc81580c._.js +0 -3
  217. package/mcp-server/.next/server/chunks/[root-of-the-server]__d200fe4a._.js +0 -3
  218. package/mcp-server/.next/server/chunks/[root-of-the-server]__d200fe4a._.js.map +0 -1
  219. package/mcp-server/.next/server/chunks/[root-of-the-server]__dc0b0022._.js +0 -17
  220. package/mcp-server/.next/server/chunks/[root-of-the-server]__dc0b0022._.js.map +0 -1
  221. package/mcp-server/.next/server/chunks/d1d76_next_09a9e080._.js +0 -17
  222. package/mcp-server/.next/server/chunks/d1d76_next_09a9e080._.js.map +0 -1
  223. package/mcp-server/.next/server/chunks/d1d76_next_dist_esm_build_templates_app-route_820fc951.js +0 -3
  224. package/mcp-server/.next/server/chunks/d1d76_next_dist_esm_build_templates_app-route_820fc951.js.map +0 -1
  225. package/mcp-server/.next/server/chunks/ssr/[root-of-the-server]__02a8c992._.js +0 -3
  226. package/mcp-server/.next/server/chunks/ssr/[root-of-the-server]__05689c01._.js +0 -3
  227. package/mcp-server/.next/server/chunks/ssr/[root-of-the-server]__61c905ce._.js +0 -3
  228. package/mcp-server/.next/server/chunks/ssr/[root-of-the-server]__8863b0f6._.js +0 -3
  229. package/mcp-server/.next/server/chunks/ssr/[root-of-the-server]__8863b0f6._.js.map +0 -1
  230. package/mcp-server/.next/server/chunks/ssr/[root-of-the-server]__9bc632fa._.js +0 -3
  231. package/mcp-server/.next/server/chunks/ssr/[root-of-the-server]__9f07837d._.js +0 -3
  232. package/mcp-server/.next/server/chunks/ssr/[root-of-the-server]__aed64cd3._.js +0 -3
  233. package/mcp-server/.next/server/chunks/ssr/[root-of-the-server]__cf030fda._.js +0 -3
  234. package/mcp-server/.next/server/chunks/ssr/[root-of-the-server]__db74836a._.js +0 -3
  235. package/mcp-server/.next/server/chunks/ssr/[root-of-the-server]__fc10c8f1._.js +0 -3
  236. package/mcp-server/.next/server/chunks/ssr/_0b8335fc._.js +0 -8
  237. package/mcp-server/.next/server/chunks/ssr/_0b8335fc._.js.map +0 -1
  238. package/mcp-server/.next/server/chunks/ssr/_6129d8ec._.js +0 -4
  239. package/mcp-server/.next/server/chunks/ssr/_6129d8ec._.js.map +0 -1
  240. package/mcp-server/.next/server/chunks/ssr/_74bf5366._.js +0 -8
  241. package/mcp-server/.next/server/chunks/ssr/_74bf5366._.js.map +0 -1
  242. package/mcp-server/.next/server/chunks/ssr/_7d3d2f5f._.js +0 -4
  243. package/mcp-server/.next/server/chunks/ssr/_7d3d2f5f._.js.map +0 -1
  244. package/mcp-server/.next/server/chunks/ssr/_e4aa8f16._.js +0 -4
  245. package/mcp-server/.next/server/chunks/ssr/_e4aa8f16._.js.map +0 -1
  246. package/mcp-server/.next/server/chunks/ssr/d1d76_next_dist_032c5c2e._.js +0 -3
  247. package/mcp-server/.next/server/chunks/ssr/d1d76_next_dist_032c5c2e._.js.map +0 -1
  248. package/mcp-server/.next/server/chunks/ssr/d1d76_next_dist_08b22e19._.js +0 -3
  249. package/mcp-server/.next/server/chunks/ssr/d1d76_next_dist_08b22e19._.js.map +0 -1
  250. package/mcp-server/.next/server/chunks/ssr/d1d76_next_dist_369453b3._.js +0 -6
  251. package/mcp-server/.next/server/chunks/ssr/d1d76_next_dist_369453b3._.js.map +0 -1
  252. package/mcp-server/.next/server/chunks/ssr/d1d76_next_dist_ad253fdc._.js +0 -4
  253. package/mcp-server/.next/server/chunks/ssr/d1d76_next_dist_ad253fdc._.js.map +0 -1
  254. package/mcp-server/.next/server/chunks/ssr/d1d76_next_dist_b9509b36._.js +0 -6
  255. package/mcp-server/.next/server/chunks/ssr/d1d76_next_dist_b9509b36._.js.map +0 -1
  256. package/mcp-server/.next/server/chunks/ssr/d1d76_next_dist_client_components_6557bb14._.js +0 -3
  257. package/mcp-server/.next/server/chunks/ssr/d1d76_next_dist_client_components_builtin_global-error_3d982957.js +0 -3
  258. package/mcp-server/.next/server/chunks/ssr/d1d76_next_dist_esm_build_templates_app-page_134a93a5.js +0 -4
  259. package/mcp-server/.next/server/chunks/ssr/d1d76_next_dist_esm_build_templates_app-page_134a93a5.js.map +0 -1
  260. package/mcp-server/.next/server/chunks/ssr/node_modules__pnpm_3d10aa72._.js +0 -3
  261. package/mcp-server/.next/server/chunks/ssr/node_modules__pnpm_3d10aa72._.js.map +0 -1
  262. package/mcp-server/.next/static/chunks/1d2676338b51bbcf.js +0 -1
  263. package/mcp-server/.next/static/chunks/312a4c1c7f6436ef.js +0 -1
  264. package/mcp-server/.next/static/chunks/4b6eda65c6f5aada.js +0 -1
  265. package/mcp-server/.next/static/chunks/526448e84b58822c.js +0 -1
  266. package/mcp-server/.next/static/chunks/7abbb9a17b62c1fa.js +0 -1
  267. package/mcp-server/.next/static/chunks/8364b81221aabb64.js +0 -1
  268. package/mcp-server/.next/static/chunks/a42830291751fe48.js +0 -1
  269. package/mcp-server/.next/static/chunks/addab50e23821c6c.js +0 -1
  270. package/mcp-server/.next/static/chunks/bb2e6ac36794beea.css +0 -1
  271. package/mcp-server/.next/static/chunks/c578923146856601.js +0 -1
  272. package/mcp-server/.next/static/chunks/f08166f7946c2e06.js +0 -1
  273. package/mcp-server/.next/static/chunks/turbopack-22a9e2c19fd12b04.js +0 -3
  274. /package/mcp-server/.next/server/chunks/{[root-of-the-server]__5248c9ff._.js.map → [root-of-the-server]__37cbcfad._.js.map} +0 -0
  275. /package/mcp-server/.next/server/chunks/ssr/{[root-of-the-server]__02a8c992._.js.map → [root-of-the-server]__2c3254f5._.js.map} +0 -0
  276. /package/mcp-server/.next/static/{ZeZ7S325drnA0SH-odcGY → IjjcEdBSrakBEegq2HWWk}/_buildManifest.js +0 -0
  277. /package/mcp-server/.next/static/{ZeZ7S325drnA0SH-odcGY → IjjcEdBSrakBEegq2HWWk}/_clientMiddlewareManifest.json +0 -0
  278. /package/mcp-server/.next/static/{ZeZ7S325drnA0SH-odcGY → IjjcEdBSrakBEegq2HWWk}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["turbopack:///[project]/node_modules/.pnpm/next@16.0.0-canary.10_babel-plugin-react-compiler@19.1.0-rc.3_react-dom@19.1.1_react@19.1.1__react@19.1.1/node_modules/next/dist/esm/build/templates/app-route.js","turbopack:///[project]/mcp-server/app/api/jank/[session]/route.ts"],"sourcesContent":["import { AppRouteRouteModule } from \"next/dist/esm/server/route-modules/app-route/module.compiled\";\nimport { RouteKind } from \"next/dist/esm/server/route-kind\";\nimport { patchFetch as _patchFetch } from \"next/dist/esm/server/lib/patch-fetch\";\nimport { addRequestMeta, getRequestMeta } from \"next/dist/esm/server/request-meta\";\nimport { getTracer, SpanKind } from \"next/dist/esm/server/lib/trace/tracer\";\nimport { setReferenceManifestsSingleton } from \"next/dist/esm/server/app-render/encryption-utils\";\nimport { createServerModuleMap } from \"next/dist/esm/server/app-render/action-utils\";\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/jank/[session]/route\",\n pathname: \"/api/jank/[session]\",\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]/mcp-server/app/api/jank/[session]/route.ts\",\n nextConfigOutput,\n userland\n});\n// Pull out the exports that we need to expose from the module. This should\n// be eliminated when we've moved the other routes to the new format. These\n// are used to hook into the route.\nconst { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule;\nfunction patchFetch() {\n return _patchFetch({\n workAsyncStorage,\n workUnitAsyncStorage\n });\n}\nexport { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, };\nexport async function handler(req, res, ctx) {\n var _nextConfig_experimental;\n if (routeModule.isDev) {\n addRequestMeta(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint());\n }\n let srcPage = \"/api/jank/[session]/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, 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 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 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 setReferenceManifestsSingleton({\n page: srcPage,\n clientReferenceManifest,\n serverActionsManifest,\n serverModuleMap: createServerModuleMap({\n serverActionsManifest\n })\n });\n }\n const method = req.method || 'GET';\n const tracer = getTracer();\n const activeSpan = tracer.getActiveScopeSpan();\n const context = {\n params,\n prerenderManifest,\n renderOpts: {\n experimental: {\n cacheComponents: Boolean(nextConfig.experimental.cacheComponents),\n authInterrupts: Boolean(nextConfig.experimental.authInterrupts)\n },\n supportsDynamicResponse,\n incrementalCache: getRequestMeta(req, 'incrementalCache'),\n cacheLifeProfiles: (_nextConfig_experimental = nextConfig.experimental) == null ? void 0 : _nextConfig_experimental.cacheLife,\n waitUntil: ctx.waitUntil,\n onClose: (cb)=>{\n res.on('close', cb);\n },\n onAfterTaskError: undefined,\n onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext)\n },\n sharedContext: {\n buildId\n }\n };\n const nodeNextReq = new NodeNextRequest(req);\n const nodeNextRes = new NodeNextResponse(res);\n const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res));\n try {\n const invokeRouteModule = async (span)=>{\n return routeModule.handle(nextReq, context).finally(()=>{\n if (!span) return;\n span.setAttributes({\n 'http.status_code': res.statusCode,\n 'next.rsc': false\n });\n const rootSpanAttributes = tracer.getRootSpanAttributes();\n // We were unable to get attributes, probably OTEL is not enabled\n if (!rootSpanAttributes) {\n return;\n }\n if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) {\n console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);\n return;\n }\n const route = rootSpanAttributes.get('next.route');\n if (route) {\n const name = `${method} ${route}`;\n span.setAttributes({\n 'next.route': route,\n 'http.route': route,\n 'next.span_name': name\n });\n span.updateName(name);\n } else {\n span.updateName(`${method} ${srcPage}`);\n }\n });\n };\n const handleResponse = async (currentSpan)=>{\n var _cacheEntry_value;\n const responseGenerator = async ({ previousCacheEntry })=>{\n try {\n if (!getRequestMeta(req, 'minimalMode') && 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 await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: srcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, 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 });\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 (!getRequestMeta(req, 'minimalMode')) {\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 (!(getRequestMeta(req, 'minimalMode') && isIsr)) {\n headers.delete(NEXT_CACHE_TAGS_HEADER);\n }\n // If cache control is already set on the response we don't\n // override it to allow users to customize it via next.config\n if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) {\n headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl));\n }\n await sendResponse(nodeNextReq, nodeNextRes, // @ts-expect-error - Argument of type 'Buffer<ArrayBufferLike>' is not assignable to parameter of type 'BodyInit | null | undefined'.\n new Response(cacheEntry.value.body, {\n headers,\n status: cacheEntry.value.status || 200\n }));\n return null;\n };\n // TODO: activeSpan code path is for when wrapped by\n // next-server can be removed when this is no longer used\n if (activeSpan) {\n await handleResponse(activeSpan);\n } else {\n await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, {\n spanName: `${method} ${srcPage}`,\n kind: SpanKind.SERVER,\n attributes: {\n 'http.method': method,\n 'http.target': req.url\n }\n }, handleResponse));\n }\n } catch (err) {\n if (!(err instanceof NoFallbackError)) {\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: normalizedSrcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n });\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","import { existsSync, readdirSync, readFileSync } from \"fs\"\nimport { type NextRequest, NextResponse } from \"next/server\"\nimport { tmpdir } from \"os\"\nimport { join } from \"path\"\nimport pixelmatch from \"pixelmatch\"\nimport { PNG } from \"pngjs\"\n\n/**\n * Fetch real CLS data from screencast metadata\n * ScreencastManager now injects a PerformanceObserver to capture real layout shifts\n */\nasync function getRealCLSData(\n screenshotDir: string,\n session: string\n): Promise<{\n shifts: Array<{ score: number; timestamp: number; sources?: unknown[] }>\n totalCLS: number\n grade: string\n cssViewport?: { width: number; height: number; devicePixelRatio: number }\n} | null> {\n try {\n const metadataPath = join(screenshotDir, `${session}-metadata.json`)\n if (!existsSync(metadataPath)) {\n return null\n }\n\n const metadata = JSON.parse(readFileSync(metadataPath, \"utf-8\"))\n if (!metadata.layoutShifts || metadata.layoutShifts.length === 0) {\n return null\n }\n\n return {\n shifts: metadata.layoutShifts,\n totalCLS: metadata.totalCLS || 0,\n grade: metadata.clsGrade || \"unknown\",\n cssViewport: metadata.cssViewport\n }\n } catch (error) {\n console.error(\"Failed to fetch real CLS data:\", error)\n return null\n }\n}\n\nexport async function GET(_request: NextRequest, { params }: { params: Promise<{ session: string }> }) {\n const { session } = await params\n const screenshotDir = process.env.SCREENSHOT_DIR || join(tmpdir(), \"dev3000-mcp-deps\", \"public\", \"screenshots\")\n\n // Try to get real CLS data from screencast metadata\n const realCLS = await getRealCLSData(screenshotDir, session)\n\n if (realCLS && realCLS.shifts.length === 0) {\n // No layout shifts detected by PerformanceObserver\n return NextResponse.json({\n clsMarkers: [],\n source: \"performance-observer\",\n actualCLS: 0,\n grade: \"good\",\n message: \"No layout shifts detected by PerformanceObserver\"\n })\n }\n\n if (!existsSync(screenshotDir)) {\n return NextResponse.json({ clsMarkers: [] })\n }\n\n // Find files for this session\n const files = readdirSync(screenshotDir)\n const sessionFiles = files\n .filter((f) => f.startsWith(session) && f.includes(\"-jank-\") && f.endsWith(\".png\"))\n .sort((a, b) => {\n const aTime = parseInt(a.match(/-(\\d+)ms\\.png$/)?.[1] || \"0\", 10)\n const bTime = parseInt(b.match(/-(\\d+)ms\\.png$/)?.[1] || \"0\", 10)\n return aTime - bTime\n })\n\n if (sessionFiles.length < 2) {\n return NextResponse.json({ clsMarkers: [] })\n }\n\n const clsMarkers: Array<{\n timestamp: number\n boundingBox: { x: number; y: number; width: number; height: number } | null\n }> = []\n\n const debugInfo: Array<{\n comparison: string\n diffPercentage: number\n shiftRegions?: number\n isValid: boolean\n }> = []\n\n // Compare consecutive frames\n for (let i = 1; i < sessionFiles.length; i++) {\n const prevFile = join(screenshotDir, sessionFiles[i - 1])\n const currFile = join(screenshotDir, sessionFiles[i])\n\n try {\n const prevPng = PNG.sync.read(readFileSync(prevFile))\n const currPng = PNG.sync.read(readFileSync(currFile))\n\n if (prevPng.width !== currPng.width || prevPng.height !== currPng.height) {\n continue\n }\n\n const diff = new PNG({ width: prevPng.width, height: prevPng.height })\n const numDiffPixels = pixelmatch(prevPng.data, currPng.data, diff.data, prevPng.width, prevPng.height, {\n threshold: 0.1\n })\n\n const totalPixels = prevPng.width * prevPng.height\n const diffPercentage = (numDiffPixels / totalPixels) * 100\n\n // Skip if almost no changes (< 0.05% = likely just anti-aliasing)\n if (diffPercentage < 0.05) {\n continue\n }\n\n // Detect LAYOUT SHIFTS by looking for horizontal bands of changes\n // (content moving down/up will create horizontal bands of differences)\n const rowChangeCounts = new Array(prevPng.height).fill(0)\n\n for (let y = 0; y < prevPng.height; y++) {\n for (let x = 0; x < prevPng.width; x++) {\n const idx = (prevPng.width * y + x) * 4\n if (diff.data[idx] > 0 || diff.data[idx + 1] > 0 || diff.data[idx + 2] > 0) {\n rowChangeCounts[y]++\n }\n }\n }\n\n // Find regions with significant row changes (indicating vertical shifts)\n let shiftRegions: Array<{ startY: number; endY: number; intensity: number }> = []\n let currentRegionStart = -1\n let currentRegionIntensity = 0\n\n for (let y = 0; y < prevPng.height; y++) {\n const rowChangePercentage = (rowChangeCounts[y] / prevPng.width) * 100\n\n // If this row has significant changes (>10% of pixels in the row changed)\n if (rowChangePercentage > 10) {\n if (currentRegionStart === -1) {\n currentRegionStart = y\n currentRegionIntensity = rowChangePercentage\n } else {\n currentRegionIntensity = Math.max(currentRegionIntensity, rowChangePercentage)\n }\n } else if (currentRegionStart !== -1) {\n // End of a shift region\n shiftRegions.push({\n startY: currentRegionStart,\n endY: y - 1,\n intensity: currentRegionIntensity\n })\n currentRegionStart = -1\n currentRegionIntensity = 0\n }\n }\n\n // Close final region if needed\n if (currentRegionStart !== -1) {\n shiftRegions.push({\n startY: currentRegionStart,\n endY: prevPng.height - 1,\n intensity: currentRegionIntensity\n })\n }\n\n // Filter shift regions: must be at least 5px tall and have high intensity\n shiftRegions = shiftRegions.filter((region) => {\n const height = region.endY - region.startY\n return height >= 5 && region.intensity > 20\n })\n\n // If we found layout shift regions, calculate bounding box\n if (shiftRegions.length > 0) {\n let minX = prevPng.width\n let minY = prevPng.height\n let maxX = 0\n let maxY = 0\n\n for (const region of shiftRegions) {\n for (let y = region.startY; y <= region.endY; y++) {\n for (let x = 0; x < prevPng.width; x++) {\n const idx = (prevPng.width * y + x) * 4\n if (diff.data[idx] > 0 || diff.data[idx + 1] > 0 || diff.data[idx + 2] > 0) {\n minX = Math.min(minX, x)\n minY = Math.min(minY, y)\n maxX = Math.max(maxX, x)\n maxY = Math.max(maxY, y)\n }\n }\n }\n }\n\n // Collect debug info\n debugInfo.push({\n comparison: `${sessionFiles[i - 1]} vs ${sessionFiles[i]}`,\n diffPercentage: Number.parseFloat(diffPercentage.toFixed(2)),\n shiftRegions: shiftRegions.length,\n isValid: true\n })\n\n if (minX < maxX && minY < maxY) {\n const timeMatch = sessionFiles[i].match(/-(\\d+)ms\\.png$/)\n const timeSinceStart = timeMatch ? parseInt(timeMatch[1], 10) : 0\n\n // Add padding to bounding box (10px)\n const padding = 10\n const boundingBox = {\n x: Math.max(0, minX - padding),\n y: Math.max(0, minY - padding),\n width: Math.min(prevPng.width, maxX - minX + padding * 2),\n height: Math.min(prevPng.height, maxY - minY + padding * 2)\n }\n\n // Only include bounding box if it's reasonable (< 50% of screen)\n // If it's too large, the detection is likely inaccurate\n const boxArea = boundingBox.width * boundingBox.height\n const screenArea = prevPng.width * prevPng.height\n const areaPercentage = (boxArea / screenArea) * 100\n const boundingBoxToUse = boxArea < screenArea * 0.5 ? boundingBox : null\n\n console.log(\"[JANK API] Pixel-diff bounding box:\", {\n boundingBox,\n areaPercentage: `${areaPercentage.toFixed(2)}%`,\n rejected: !boundingBoxToUse,\n reason: !boundingBoxToUse ? \"too large (>50% of screen)\" : \"accepted\"\n })\n\n clsMarkers.push({ timestamp: timeSinceStart, boundingBox: boundingBoxToUse })\n }\n } else {\n // No shift regions found - likely just content changes (images loading)\n debugInfo.push({\n comparison: `${sessionFiles[i - 1]} vs ${sessionFiles[i]}`,\n diffPercentage: Number.parseFloat(diffPercentage.toFixed(2)),\n shiftRegions: 0,\n isValid: false\n })\n }\n } catch {\n // Skip frames that can't be compared\n }\n }\n\n // Get screenshot dimensions to calculate coordinate scaling\n let screenshotWidth = 1920 // default\n let screenshotHeight = 1080 // default\n if (sessionFiles.length > 0) {\n try {\n const firstScreenshot = PNG.sync.read(readFileSync(join(screenshotDir, sessionFiles[0])))\n screenshotWidth = firstScreenshot.width\n screenshotHeight = firstScreenshot.height\n } catch {\n // Use defaults\n }\n }\n\n // If we have real CLS data, cross-reference with pixel-diff to filter false positives\n if (realCLS) {\n // Match each real CLS shift to the closest pixel-diff marker\n // This avoids duplicate markers for the same shift\n const filteredMarkers = realCLS.shifts\n .map((shift) => {\n // Find closest pixel-diff marker within 50ms\n let closestMarker = null\n let closestDistance = Infinity\n\n for (const marker of clsMarkers) {\n const distance = Math.abs(shift.timestamp - marker.timestamp)\n if (distance < 50 && distance < closestDistance) {\n closestMarker = marker\n closestDistance = distance\n }\n }\n\n if (!closestMarker) return null\n\n // Try to use real CLS bounding box if available\n const source = shift.sources?.[0] as {\n node?: string\n previousRect?: { x: number; y: number; width: number; height: number }\n currentRect?: { x: number; y: number; width: number; height: number }\n actualRect?: { x: number; y: number; width: number; height: number }\n }\n let boundingBox = closestMarker.boundingBox\n\n // Prefer actualRect (queried via querySelector) - it's in CSS pixels relative to viewport\n // Convert to screenshot pixels using CSS viewport dimensions\n if (source?.actualRect && realCLS?.cssViewport) {\n const cssRect = source.actualRect\n const cssViewportWidth = realCLS.cssViewport.width\n const cssViewportHeight = realCLS.cssViewport.height\n\n console.log(\"[JANK API] actualRect (CSS pixels):\", cssRect)\n console.log(\"[JANK API] CSS viewport:\", { width: cssViewportWidth, height: cssViewportHeight })\n console.log(\"[JANK API] Screenshot dimensions:\", { width: screenshotWidth, height: screenshotHeight })\n\n // Calculate scale factor: screenshot pixels / CSS pixels\n const scaleX = screenshotWidth / cssViewportWidth\n const scaleY = screenshotHeight / cssViewportHeight\n\n console.log(\"[JANK API] Calculated scale:\", { x: scaleX.toFixed(3), y: scaleY.toFixed(3) })\n\n // Convert CSS pixels to screenshot pixels\n boundingBox = {\n x: Math.round(cssRect.x * scaleX),\n y: Math.round(cssRect.y * scaleY),\n width: Math.round(cssRect.width * scaleX),\n height: Math.round(cssRect.height * scaleY)\n }\n\n console.log(\"[JANK API] Bounding box (screenshot pixels):\", boundingBox)\n } else {\n console.log(\"[JANK API] No actualRect or cssViewport available, cannot determine bounding box\")\n }\n\n return {\n ...closestMarker,\n boundingBox,\n clsScore: shift.score,\n element: source?.node || \"unknown\"\n }\n })\n .filter(Boolean)\n\n return NextResponse.json({\n clsMarkers: filteredMarkers,\n realLayoutShifts: realCLS.shifts,\n debug: debugInfo,\n source: \"performance-observer-validated\",\n actualCLS: realCLS.totalCLS,\n grade: realCLS.grade,\n note: `Real CLS: ${realCLS.totalCLS.toFixed(4)} (${realCLS.grade}). Filtered ${clsMarkers.length - filteredMarkers.length} false positives from pixel-diff.`\n })\n }\n\n return NextResponse.json({\n clsMarkers,\n debug: debugInfo,\n source: \"pixel-diff-fallback\",\n note: \"PerformanceObserver data not available, using pixel-diff analysis (may include false positives)\"\n })\n}\n"],"names":[],"mappings":"uCAAA,IAAA,EAAA,EAAA,CAAA,CAAA,MACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,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,CAAA,CAAA,MAAA,IAAA,EAAA,EAAA,CAAA,CAAA,OCjBA,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,OAMA,eAAe,EACb,CAAqB,CACrB,CA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AAI,SAAS,EAAW,KAAK,CAAC,IAAI,CAAE,SAChC,EACA,OAAQ,EAAW,KAAK,CAAC,MAAM,EAAI,GACvC,IACO,IACX,EAGI,EACA,MAAM,EAAe,EADT,CAGZ,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,GAEf,CAAE,MAAO,EAAK,CAcV,GAbI,AAAE,CAAD,YAAgB,EAAA,eAAe,EAChC,CADmC,KAC7B,EAAY,cAAc,CAAC,EAAK,EAAK,CACvC,WAAY,aACZ,UAAW,EACX,UAAW,QACX,iBAAkB,CAAA,EAAA,EAAA,mBAAA,AAAmB,EAAC,oBAClC,uBACA,CACJ,EACJ,GAIA,EAAO,MAAM,EAKjB,OAHA,MAAM,CAAA,EAAA,EAAA,YAAA,AAAY,EAAC,EAAa,EAAa,IAAI,SAAS,KAAM,CAC5D,OAAQ,GACZ,IACO,IACX,CACJ,EAEA,qCAAqC","ignoreList":[0]}
@@ -0,0 +1,11 @@
1
+ module.exports=[22734,(e,t,r)=>{t.exports=e.x("fs",()=>require("fs"))},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"))},56704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},70406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},7627,e=>{"use strict";var t=e.i(12e3),r=e.i(32560),a=e.i(76834),n=e.i(74423),o=e.i(39932),i=e.i(18271),s=e.i(39350),l=e.i(69635),d=e.i(58154),u=e.i(98378),p=e.i(2818),c=e.i(65015),h=e.i(62177),x=e.i(46523),R=e.i(96843),g=e.i(97497),v=e.i(93695);e.i(2239);var f=e.i(13167),m=e.i(22734);async function E(e){let{searchParams:t}=new URL(e.url),r=t.get("logPath")||process.env.LOG_FILE_PATH||"./ai-dev-tools/consolidated.log";if(!(0,m.existsSync)(r))return new Response("Log file not found",{status:404});let a=new TextEncoder,n=0;return new Response(new ReadableStream({start(t){try{let e=(0,m.readFileSync)(r,"utf-8"),o=e.split("\n").filter(e=>e.trim());n=e.length,t.enqueue(a.encode(`data: ${JSON.stringify({lines:o})}
2
+
3
+ `))}catch(e){t.enqueue(a.encode(`data: ${JSON.stringify({error:"Failed to read log"})}
4
+
5
+ `))}let o=(0,m.watchFile)(r,{interval:1e3},()=>{try{let e=(0,m.readFileSync)(r,"utf-8");if(e.length>n){let r=e.slice(n).split("\n").filter(e=>e.trim());r.length>0&&t.enqueue(a.encode(`data: ${JSON.stringify({newLines:r})}
6
+
7
+ `)),n=e.length}}catch(e){t.enqueue(a.encode(`data: ${JSON.stringify({error:"Failed to read log updates"})}
8
+
9
+ `))}});e.signal.addEventListener("abort",()=>{o.unref(),t.close()})}}),{headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"}})}e.s(["GET",()=>E],35443);var w=e.i(35443);let y=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/logs/stream/route",pathname:"/api/logs/stream",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/mcp-server/app/api/logs/stream/route.ts",nextConfigOutput:"",userland:w}),{workAsyncStorage:C,workUnitAsyncStorage:A,serverHooks:b}=y;function S(){return(0,a.patchFetch)({workAsyncStorage:C,workUnitAsyncStorage:A})}async function N(e,t,a){var m;y.isDev&&(0,n.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let E="/api/logs/stream/route";E=E.replace(/\/index$/,"")||"/";let w=await y.prepare(e,t,{srcPage:E,multiZoneDraftMode:!1});if(!w)return t.statusCode=400,t.end("Bad Request"),null==a.waitUntil||a.waitUntil.call(a,Promise.resolve()),null;let{buildId:C,params:A,nextConfig:b,isDraftMode:S,prerenderManifest:N,routerServerContext:T,isOnDemandRevalidate:q,revalidateOnlyGenerated:O,resolvedPathname:P,clientReferenceManifest:_,serverActionsManifest:k}=w,M=(0,l.normalizeAppPath)(E),H=!!(N.dynamicRoutes[M]||N.routes[P]);if(H&&!S){let e=!!N.routes[P],t=N.dynamicRoutes[M];if(t&&!1===t.fallback&&!e)throw new v.NoFallbackError}let U=null;!H||y.isDev||S||(U="/index"===(U=P)?"/":U);let I=!0===y.isDev||!H,j=H&&!I;k&&_&&(0,i.setReferenceManifestsSingleton)({page:E,clientReferenceManifest:_,serverActionsManifest:k,serverModuleMap:(0,s.createServerModuleMap)({serverActionsManifest:k})});let F=e.method||"GET",D=(0,o.getTracer)(),$=D.getActiveScopeSpan(),L={params:A,prerenderManifest:N,renderOpts:{experimental:{cacheComponents:!!b.experimental.cacheComponents,authInterrupts:!!b.experimental.authInterrupts},supportsDynamicResponse:I,incrementalCache:(0,n.getRequestMeta)(e,"incrementalCache"),cacheLifeProfiles:null==(m=b.experimental)?void 0:m.cacheLife,waitUntil:a.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,a)=>y.onRequestError(e,t,a,T)},sharedContext:{buildId:C}},K=new d.NodeNextRequest(e),B=new d.NodeNextResponse(t),G=u.NextRequestAdapter.fromNodeNextRequest(K,(0,u.signalFromNodeResponse)(t));try{let i=async e=>y.handle(G,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")!==p.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)}else e.updateName(`${F} ${E}`)}),s=async o=>{var s,l;let d=async({previousCacheEntry:r})=>{try{if(!(0,n.getRequestMeta)(e,"minimalMode")&&q&&O&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let s=await i(o);e.fetchMetrics=L.renderOpts.fetchMetrics;let l=L.renderOpts.pendingWaitUntil;l&&a.waitUntil&&(a.waitUntil(l),l=void 0);let d=L.renderOpts.collectedTags;if(!H)return await (0,h.sendResponse)(K,B,s,L.renderOpts.pendingWaitUntil),null;{let e=await s.blob(),t=(0,x.toNodeOutgoingHttpHeaders)(s.headers);d&&(t[g.NEXT_CACHE_TAGS_HEADER]=d),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==L.renderOpts.collectedRevalidate&&!(L.renderOpts.collectedRevalidate>=g.INFINITE_CACHE)&&L.renderOpts.collectedRevalidate,a=void 0===L.renderOpts.collectedExpire||L.renderOpts.collectedExpire>=g.INFINITE_CACHE?void 0:L.renderOpts.collectedExpire;return{value:{kind:f.CachedRouteKind.APP_ROUTE,status:s.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:a}}}}catch(t){throw(null==r?void 0:r.isStale)&&await y.onRequestError(e,t,{routerKind:"App Router",routePath:E,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:j,isOnDemandRevalidate:q})},T),t}},u=await y.handleResponse({req:e,nextConfig:b,cacheKey:U,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:N,isRoutePPREnabled:!1,isOnDemandRevalidate:q,revalidateOnlyGenerated:O,responseGenerator:d,waitUntil:a.waitUntil});if(!H)return null;if((null==u||null==(s=u.value)?void 0:s.kind)!==f.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==u||null==(l=u.value)?void 0:l.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});(0,n.getRequestMeta)(e,"minimalMode")||t.setHeader("x-nextjs-cache",q?"REVALIDATED":u.isMiss?"MISS":u.isStale?"STALE":"HIT"),S&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let p=(0,x.fromNodeOutgoingHttpHeaders)(u.value.headers);return(0,n.getRequestMeta)(e,"minimalMode")&&H||p.delete(g.NEXT_CACHE_TAGS_HEADER),!u.cacheControl||t.getHeader("Cache-Control")||p.get("Cache-Control")||p.set("Cache-Control",(0,R.getCacheControlHeader)(u.cacheControl)),await (0,h.sendResponse)(K,B,new Response(u.value.body,{headers:p,status:u.value.status||200})),null};$?await s($):await D.withPropagatedContext(e.headers,()=>D.trace(p.BaseServerSpan.handleRequest,{spanName:`${F} ${E}`,kind:o.SpanKind.SERVER,attributes:{"http.method":F,"http.target":e.url}},s))}catch(t){if(t instanceof v.NoFallbackError||await y.onRequestError(e,t,{routerKind:"App Router",routePath:M,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:j,isOnDemandRevalidate:q})}),H)throw t;return await (0,h.sendResponse)(K,B,new Response(null,{status:500})),null}}e.s(["handler",()=>N,"patchFetch",()=>S,"routeModule",()=>y,"serverHooks",()=>b,"workAsyncStorage",()=>C,"workUnitAsyncStorage",()=>A],7627)}];
10
+
11
+ //# sourceMappingURL=%5Broot-of-the-server%5D__05e1e17a._.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["turbopack:///[project]/mcp-server/app/api/logs/stream/route.ts","turbopack:///[project]/node_modules/.pnpm/next@16.0.0-canary.10_babel-plugin-react-compiler@19.1.0-rc.3_react-dom@19.1.1_react@19.1.1__react@19.1.1/node_modules/next/dist/esm/build/templates/app-route.js"],"sourcesContent":["import { existsSync, readFileSync, watchFile } from \"fs\"\nimport type { NextRequest } from \"next/server\"\n\nexport async function GET(request: NextRequest) {\n const { searchParams } = new URL(request.url)\n const logPath = searchParams.get(\"logPath\") || process.env.LOG_FILE_PATH || \"./ai-dev-tools/consolidated.log\"\n\n if (!existsSync(logPath)) {\n return new Response(\"Log file not found\", { status: 404 })\n }\n\n const encoder = new TextEncoder()\n let lastSize = 0\n\n const stream = new ReadableStream({\n start(controller) {\n // Send initial content\n try {\n const content = readFileSync(logPath, \"utf-8\")\n const lines = content.split(\"\\n\").filter((line) => line.trim())\n lastSize = content.length\n\n // Send initial lines\n controller.enqueue(encoder.encode(`data: ${JSON.stringify({ lines })}\\n\\n`))\n } catch (_error) {\n controller.enqueue(encoder.encode(`data: ${JSON.stringify({ error: \"Failed to read log\" })}\\n\\n`))\n }\n\n // Watch for file changes\n const watcher = watchFile(logPath, { interval: 1000 }, () => {\n try {\n const content = readFileSync(logPath, \"utf-8\")\n if (content.length > lastSize) {\n const newContent = content.slice(lastSize)\n const newLines = newContent.split(\"\\n\").filter((line) => line.trim())\n if (newLines.length > 0) {\n controller.enqueue(encoder.encode(`data: ${JSON.stringify({ newLines })}\\n\\n`))\n }\n lastSize = content.length\n }\n } catch (_error) {\n controller.enqueue(encoder.encode(`data: ${JSON.stringify({ error: \"Failed to read log updates\" })}\\n\\n`))\n }\n })\n\n // Cleanup on close\n request.signal.addEventListener(\"abort\", () => {\n watcher.unref()\n controller.close()\n })\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}\n","import { AppRouteRouteModule } from \"next/dist/esm/server/route-modules/app-route/module.compiled\";\nimport { RouteKind } from \"next/dist/esm/server/route-kind\";\nimport { patchFetch as _patchFetch } from \"next/dist/esm/server/lib/patch-fetch\";\nimport { addRequestMeta, getRequestMeta } from \"next/dist/esm/server/request-meta\";\nimport { getTracer, SpanKind } from \"next/dist/esm/server/lib/trace/tracer\";\nimport { setReferenceManifestsSingleton } from \"next/dist/esm/server/app-render/encryption-utils\";\nimport { createServerModuleMap } from \"next/dist/esm/server/app-render/action-utils\";\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/logs/stream/route\",\n pathname: \"/api/logs/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]/mcp-server/app/api/logs/stream/route.ts\",\n nextConfigOutput,\n userland\n});\n// Pull out the exports that we need to expose from the module. This should\n// be eliminated when we've moved the other routes to the new format. These\n// are used to hook into the route.\nconst { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule;\nfunction patchFetch() {\n return _patchFetch({\n workAsyncStorage,\n workUnitAsyncStorage\n });\n}\nexport { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, };\nexport async function handler(req, res, ctx) {\n var _nextConfig_experimental;\n if (routeModule.isDev) {\n addRequestMeta(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint());\n }\n let srcPage = \"/api/logs/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, 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 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 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 setReferenceManifestsSingleton({\n page: srcPage,\n clientReferenceManifest,\n serverActionsManifest,\n serverModuleMap: createServerModuleMap({\n serverActionsManifest\n })\n });\n }\n const method = req.method || 'GET';\n const tracer = getTracer();\n const activeSpan = tracer.getActiveScopeSpan();\n const context = {\n params,\n prerenderManifest,\n renderOpts: {\n experimental: {\n cacheComponents: Boolean(nextConfig.experimental.cacheComponents),\n authInterrupts: Boolean(nextConfig.experimental.authInterrupts)\n },\n supportsDynamicResponse,\n incrementalCache: getRequestMeta(req, 'incrementalCache'),\n cacheLifeProfiles: (_nextConfig_experimental = nextConfig.experimental) == null ? void 0 : _nextConfig_experimental.cacheLife,\n waitUntil: ctx.waitUntil,\n onClose: (cb)=>{\n res.on('close', cb);\n },\n onAfterTaskError: undefined,\n onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext)\n },\n sharedContext: {\n buildId\n }\n };\n const nodeNextReq = new NodeNextRequest(req);\n const nodeNextRes = new NodeNextResponse(res);\n const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res));\n try {\n const invokeRouteModule = async (span)=>{\n return routeModule.handle(nextReq, context).finally(()=>{\n if (!span) return;\n span.setAttributes({\n 'http.status_code': res.statusCode,\n 'next.rsc': false\n });\n const rootSpanAttributes = tracer.getRootSpanAttributes();\n // We were unable to get attributes, probably OTEL is not enabled\n if (!rootSpanAttributes) {\n return;\n }\n if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) {\n console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);\n return;\n }\n const route = rootSpanAttributes.get('next.route');\n if (route) {\n const name = `${method} ${route}`;\n span.setAttributes({\n 'next.route': route,\n 'http.route': route,\n 'next.span_name': name\n });\n span.updateName(name);\n } else {\n span.updateName(`${method} ${srcPage}`);\n }\n });\n };\n const handleResponse = async (currentSpan)=>{\n var _cacheEntry_value;\n const responseGenerator = async ({ previousCacheEntry })=>{\n try {\n if (!getRequestMeta(req, 'minimalMode') && 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 await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: srcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, 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 });\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 (!getRequestMeta(req, 'minimalMode')) {\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 (!(getRequestMeta(req, 'minimalMode') && isIsr)) {\n headers.delete(NEXT_CACHE_TAGS_HEADER);\n }\n // If cache control is already set on the response we don't\n // override it to allow users to customize it via next.config\n if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) {\n headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl));\n }\n await sendResponse(nodeNextReq, nodeNextRes, // @ts-expect-error - Argument of type 'Buffer<ArrayBufferLike>' is not assignable to parameter of type 'BodyInit | null | undefined'.\n new Response(cacheEntry.value.body, {\n headers,\n status: cacheEntry.value.status || 200\n }));\n return null;\n };\n // TODO: activeSpan code path is for when wrapped by\n // next-server can be removed when this is no longer used\n if (activeSpan) {\n await handleResponse(activeSpan);\n } else {\n await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, {\n spanName: `${method} ${srcPage}`,\n kind: SpanKind.SERVER,\n attributes: {\n 'http.method': method,\n 'http.target': req.url\n }\n }, handleResponse));\n }\n } catch (err) {\n if (!(err instanceof NoFallbackError)) {\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: normalizedSrcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n });\n }\n // rethrow so that we can handle serving error page\n // If this is during static generation, throw the error again.\n if (isIsr) throw err;\n // Otherwise, send a 500 response.\n await sendResponse(nodeNextReq, nodeNextRes, new Response(null, {\n status: 500\n }));\n return null;\n }\n}\n\n//# sourceMappingURL=app-route.js.map\n"],"names":[],"mappings":"s3BCAA,IAAA,EAAA,EAAA,CAAA,CAAA,MACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA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W,EACX,UAAW,QACX,iBAAkB,CAAA,EAAA,EAAA,mBAAA,AAAmB,EAAC,oBAClC,uBACA,CACJ,EACJ,GAIA,EAAO,MAAM,EAKjB,OAHA,MAAM,CAAA,EAAA,EAAA,YAAA,AAAY,EAAC,EAAa,EAAa,IAAI,SAAS,KAAM,CAC5D,OAAQ,GACZ,IACO,IACX,CACJ,EAEA,qCAAqC","ignoreList":[1]}
@@ -0,0 +1,4 @@
1
+ module.exports=[18622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},70406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},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"))},22734,(e,t,r)=>{t.exports=e.x("fs",()=>require("fs"))},24150,e=>{"use strict";var t=e.i(12e3),r=e.i(32560),n=e.i(76834),o=e.i(74423),a=e.i(39932),s=e.i(18271),i=e.i(39350),l=e.i(69635),d=e.i(58154),p=e.i(98378),u=e.i(2818),c=e.i(65015),h=e.i(62177),x=e.i(46523),R=e.i(96843),g=e.i(97497),v=e.i(93695);e.i(2239);var w=e.i(13167),A=e.i(22734),m=e.i(14747);async function C(e){try{let{entry:t,source:r}=await e.json();if(!t)return Response.json({error:"Log entry is required"},{status:400,headers:{"Access-Control-Allow-Origin":"*","Access-Control-Allow-Methods":"POST, OPTIONS","Access-Control-Allow-Headers":"Content-Type"}});let n=process.env.LOG_FILE_PATH||"./ai-dev-tools/consolidated.log",o=(0,m.dirname)(n);(0,A.existsSync)(o)||(0,A.mkdirSync)(o,{recursive:!0});let a=`${t}
2
+ `;return(0,A.appendFileSync)(n,a,"utf-8"),Response.json({success:!0,message:"Log entry appended",source:r||"unknown"},{headers:{"Access-Control-Allow-Origin":"*","Access-Control-Allow-Methods":"POST, OPTIONS","Access-Control-Allow-Headers":"Content-Type"}})}catch(e){return console.error("Failed to append log:",e),Response.json({error:e instanceof Error?e.message:"Unknown error"},{status:500,headers:{"Access-Control-Allow-Origin":"*","Access-Control-Allow-Methods":"POST, OPTIONS","Access-Control-Allow-Headers":"Content-Type"}})}}async function f(){return new Response(null,{status:200,headers:{"Access-Control-Allow-Origin":"*","Access-Control-Allow-Methods":"POST, OPTIONS","Access-Control-Allow-Headers":"Content-Type"}})}e.s(["OPTIONS",()=>f,"POST",()=>C],2996);var y=e.i(2996);let E=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/logs/append/route",pathname:"/api/logs/append",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/mcp-server/app/api/logs/append/route.ts",nextConfigOutput:"",userland:y}),{workAsyncStorage:O,workUnitAsyncStorage:T,serverHooks:P}=E;function S(){return(0,n.patchFetch)({workAsyncStorage:O,workUnitAsyncStorage:T})}async function N(e,t,n){var A;E.isDev&&(0,o.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let m="/api/logs/append/route";m=m.replace(/\/index$/,"")||"/";let C=await E.prepare(e,t,{srcPage:m,multiZoneDraftMode:!1});if(!C)return t.statusCode=400,t.end("Bad Request"),null==n.waitUntil||n.waitUntil.call(n,Promise.resolve()),null;let{buildId:f,params:y,nextConfig:O,isDraftMode:T,prerenderManifest:P,routerServerContext:S,isOnDemandRevalidate:N,revalidateOnlyGenerated:b,resolvedPathname:q,clientReferenceManifest:M,serverActionsManifest:k}=C,H=(0,l.normalizeAppPath)(m),_=!!(P.dynamicRoutes[H]||P.routes[q]);if(_&&!T){let e=!!P.routes[q],t=P.dynamicRoutes[H];if(t&&!1===t.fallback&&!e)throw new v.NoFallbackError}let I=null;!_||E.isDev||T||(I="/index"===(I=q)?"/":I);let j=!0===E.isDev||!_,U=_&&!j;k&&M&&(0,s.setReferenceManifestsSingleton)({page:m,clientReferenceManifest:M,serverActionsManifest:k,serverModuleMap:(0,i.createServerModuleMap)({serverActionsManifest:k})});let D=e.method||"GET",F=(0,a.getTracer)(),$=F.getActiveScopeSpan(),L={params:y,prerenderManifest:P,renderOpts:{experimental:{cacheComponents:!!O.experimental.cacheComponents,authInterrupts:!!O.experimental.authInterrupts},supportsDynamicResponse:j,incrementalCache:(0,o.getRequestMeta)(e,"incrementalCache"),cacheLifeProfiles:null==(A=O.experimental)?void 0:A.cacheLife,waitUntil:n.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,n)=>E.onRequestError(e,t,n,S)},sharedContext:{buildId:f}},K=new d.NodeNextRequest(e),B=new d.NodeNextResponse(t),G=p.NextRequestAdapter.fromNodeNextRequest(K,(0,p.signalFromNodeResponse)(t));try{let s=async e=>E.handle(G,L).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=F.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==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)}else e.updateName(`${D} ${m}`)}),i=async a=>{var i,l;let d=async({previousCacheEntry:r})=>{try{if(!(0,o.getRequestMeta)(e,"minimalMode")&&N&&b&&!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=L.renderOpts.fetchMetrics;let l=L.renderOpts.pendingWaitUntil;l&&n.waitUntil&&(n.waitUntil(l),l=void 0);let d=L.renderOpts.collectedTags;if(!_)return await (0,h.sendResponse)(K,B,i,L.renderOpts.pendingWaitUntil),null;{let e=await i.blob(),t=(0,x.toNodeOutgoingHttpHeaders)(i.headers);d&&(t[g.NEXT_CACHE_TAGS_HEADER]=d),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==L.renderOpts.collectedRevalidate&&!(L.renderOpts.collectedRevalidate>=g.INFINITE_CACHE)&&L.renderOpts.collectedRevalidate,n=void 0===L.renderOpts.collectedExpire||L.renderOpts.collectedExpire>=g.INFINITE_CACHE?void 0:L.renderOpts.collectedExpire;return{value:{kind:w.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 E.onRequestError(e,t,{routerKind:"App Router",routePath:m,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:U,isOnDemandRevalidate:N})},S),t}},p=await E.handleResponse({req:e,nextConfig:O,cacheKey:I,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:P,isRoutePPREnabled:!1,isOnDemandRevalidate:N,revalidateOnlyGenerated:b,responseGenerator:d,waitUntil:n.waitUntil});if(!_)return null;if((null==p||null==(i=p.value)?void 0:i.kind)!==w.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==p||null==(l=p.value)?void 0:l.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});(0,o.getRequestMeta)(e,"minimalMode")||t.setHeader("x-nextjs-cache",N?"REVALIDATED":p.isMiss?"MISS":p.isStale?"STALE":"HIT"),T&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let u=(0,x.fromNodeOutgoingHttpHeaders)(p.value.headers);return(0,o.getRequestMeta)(e,"minimalMode")&&_||u.delete(g.NEXT_CACHE_TAGS_HEADER),!p.cacheControl||t.getHeader("Cache-Control")||u.get("Cache-Control")||u.set("Cache-Control",(0,R.getCacheControlHeader)(p.cacheControl)),await (0,h.sendResponse)(K,B,new Response(p.value.body,{headers:u,status:p.value.status||200})),null};$?await i($):await F.withPropagatedContext(e.headers,()=>F.trace(u.BaseServerSpan.handleRequest,{spanName:`${D} ${m}`,kind:a.SpanKind.SERVER,attributes:{"http.method":D,"http.target":e.url}},i))}catch(t){if(t instanceof v.NoFallbackError||await E.onRequestError(e,t,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:U,isOnDemandRevalidate:N})}),_)throw t;return await (0,h.sendResponse)(K,B,new Response(null,{status:500})),null}}e.s(["handler",()=>N,"patchFetch",()=>S,"routeModule",()=>E,"serverHooks",()=>P,"workAsyncStorage",()=>O,"workUnitAsyncStorage",()=>T],24150)}];
3
+
4
+ //# sourceMappingURL=%5Broot-of-the-server%5D__0f1f904c._.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["turbopack:///[project]/mcp-server/app/api/logs/append/route.ts","turbopack:///[project]/node_modules/.pnpm/next@16.0.0-canary.10_babel-plugin-react-compiler@19.1.0-rc.3_react-dom@19.1.1_react@19.1.1__react@19.1.1/node_modules/next/dist/esm/build/templates/app-route.js"],"sourcesContent":["import { appendFileSync, existsSync, mkdirSync } from \"fs\"\nimport type { NextRequest } from \"next/server\"\nimport { dirname } from \"path\"\n\ninterface LogEntry {\n entry: string\n source?: string\n}\n\nexport async function POST(request: NextRequest): Promise<Response> {\n try {\n const body = await request.json()\n const { entry, source }: LogEntry = body\n\n if (!entry) {\n return Response.json(\n { error: \"Log entry is required\" },\n {\n status: 400,\n headers: {\n \"Access-Control-Allow-Origin\": \"*\",\n \"Access-Control-Allow-Methods\": \"POST, OPTIONS\",\n \"Access-Control-Allow-Headers\": \"Content-Type\"\n }\n }\n )\n }\n\n const logPath = process.env.LOG_FILE_PATH || \"./ai-dev-tools/consolidated.log\"\n\n // Ensure directory exists\n const logDir = dirname(logPath)\n if (!existsSync(logDir)) {\n mkdirSync(logDir, { recursive: true })\n }\n\n // Append the log entry\n const logLine = `${entry}\\n`\n appendFileSync(logPath, logLine, \"utf-8\")\n\n return Response.json(\n {\n success: true,\n message: \"Log entry appended\",\n source: source || \"unknown\"\n },\n {\n headers: {\n \"Access-Control-Allow-Origin\": \"*\",\n \"Access-Control-Allow-Methods\": \"POST, OPTIONS\",\n \"Access-Control-Allow-Headers\": \"Content-Type\"\n }\n }\n )\n } catch (error) {\n console.error(\"Failed to append log:\", error)\n return Response.json(\n {\n error: error instanceof Error ? error.message : \"Unknown error\"\n },\n {\n status: 500,\n headers: {\n \"Access-Control-Allow-Origin\": \"*\",\n \"Access-Control-Allow-Methods\": \"POST, OPTIONS\",\n \"Access-Control-Allow-Headers\": \"Content-Type\"\n }\n }\n )\n }\n}\n\nexport async function OPTIONS(): Promise<Response> {\n return new Response(null, {\n status: 200,\n headers: {\n \"Access-Control-Allow-Origin\": \"*\",\n \"Access-Control-Allow-Methods\": \"POST, OPTIONS\",\n \"Access-Control-Allow-Headers\": \"Content-Type\"\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 } from \"next/dist/esm/server/request-meta\";\nimport { getTracer, SpanKind } from \"next/dist/esm/server/lib/trace/tracer\";\nimport { setReferenceManifestsSingleton } from \"next/dist/esm/server/app-render/encryption-utils\";\nimport { createServerModuleMap } from \"next/dist/esm/server/app-render/action-utils\";\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/logs/append/route\",\n pathname: \"/api/logs/append\",\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]/mcp-server/app/api/logs/append/route.ts\",\n nextConfigOutput,\n userland\n});\n// Pull out the exports that we need to expose from the module. This should\n// be eliminated when we've moved the other routes to the new format. These\n// are used to hook into the route.\nconst { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule;\nfunction patchFetch() {\n return _patchFetch({\n workAsyncStorage,\n workUnitAsyncStorage\n });\n}\nexport { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, };\nexport async function handler(req, res, ctx) {\n var _nextConfig_experimental;\n if (routeModule.isDev) {\n addRequestMeta(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint());\n }\n let srcPage = \"/api/logs/append/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, 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 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 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 setReferenceManifestsSingleton({\n page: srcPage,\n clientReferenceManifest,\n serverActionsManifest,\n serverModuleMap: createServerModuleMap({\n serverActionsManifest\n })\n });\n }\n const method = req.method || 'GET';\n const tracer = getTracer();\n const activeSpan = tracer.getActiveScopeSpan();\n const context = {\n params,\n prerenderManifest,\n renderOpts: {\n experimental: {\n cacheComponents: Boolean(nextConfig.experimental.cacheComponents),\n authInterrupts: Boolean(nextConfig.experimental.authInterrupts)\n },\n supportsDynamicResponse,\n incrementalCache: getRequestMeta(req, 'incrementalCache'),\n cacheLifeProfiles: (_nextConfig_experimental = nextConfig.experimental) == null ? void 0 : _nextConfig_experimental.cacheLife,\n waitUntil: ctx.waitUntil,\n onClose: (cb)=>{\n res.on('close', cb);\n },\n onAfterTaskError: undefined,\n onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext)\n },\n sharedContext: {\n buildId\n }\n };\n const nodeNextReq = new NodeNextRequest(req);\n const nodeNextRes = new NodeNextResponse(res);\n const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res));\n try {\n const invokeRouteModule = async (span)=>{\n return routeModule.handle(nextReq, context).finally(()=>{\n if (!span) return;\n span.setAttributes({\n 'http.status_code': res.statusCode,\n 'next.rsc': false\n });\n const rootSpanAttributes = tracer.getRootSpanAttributes();\n // We were unable to get attributes, probably OTEL is not enabled\n if (!rootSpanAttributes) {\n return;\n }\n if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) {\n console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);\n return;\n }\n const route = rootSpanAttributes.get('next.route');\n if (route) {\n const name = `${method} ${route}`;\n span.setAttributes({\n 'next.route': route,\n 'http.route': route,\n 'next.span_name': name\n });\n span.updateName(name);\n } else {\n span.updateName(`${method} ${srcPage}`);\n }\n });\n };\n const handleResponse = async (currentSpan)=>{\n var _cacheEntry_value;\n const responseGenerator = async ({ previousCacheEntry })=>{\n try {\n if (!getRequestMeta(req, 'minimalMode') && 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 await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: srcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, 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 });\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 (!getRequestMeta(req, 'minimalMode')) {\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 (!(getRequestMeta(req, 'minimalMode') && isIsr)) {\n headers.delete(NEXT_CACHE_TAGS_HEADER);\n }\n // If cache control is already set on the response we don't\n // override it to allow users to customize it via next.config\n if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) {\n headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl));\n }\n await sendResponse(nodeNextReq, nodeNextRes, // @ts-expect-error - Argument of type 'Buffer<ArrayBufferLike>' is not assignable to parameter of type 'BodyInit | null | undefined'.\n new Response(cacheEntry.value.body, {\n headers,\n status: cacheEntry.value.status || 200\n }));\n return null;\n };\n // TODO: activeSpan code path is for when wrapped by\n // next-server can be removed when this is no longer used\n if (activeSpan) {\n await handleResponse(activeSpan);\n } else {\n await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, {\n spanName: `${method} ${srcPage}`,\n kind: SpanKind.SERVER,\n attributes: {\n 'http.method': method,\n 'http.target': req.url\n }\n }, handleResponse));\n }\n } catch (err) {\n if (!(err instanceof NoFallbackError)) {\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: normalizedSrcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n });\n }\n // rethrow so that we can handle serving error page\n // If this is during static generation, throw the error again.\n if (isIsr) throw err;\n // Otherwise, send a 500 response.\n await sendResponse(nodeNextReq, nodeNextRes, new Response(null, {\n status: 500\n }));\n return null;\n }\n}\n\n//# sourceMappingURL=app-route.js.map\n"],"names":[],"mappings":"k7BCAA,IAAA,EAAA,EAAA,CAAA,CAAA,MACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,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,CAAA,CAAA,MAAA,IAAA,EAAA,EAAA,CAAA,CAAA,ODjBA,EAAA,EAAA,CAAA,CAAA,OAEA,EAAA,EAAA,CAAA,CAAA,OAOO,eAAe,EAAK,CAAoB,EAC7C,GAAI,CAEF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,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,GAEf,CAAE,MAAO,EAAK,CAcV,GAbI,AAAE,CAAD,YAAgB,EAAA,eAAe,EAChC,CADmC,KAC7B,EAAY,cAAc,CAAC,EAAK,EAAK,CACvC,WAAY,aACZ,UAAW,EACX,UAAW,QACX,iBAAkB,CAAA,EAAA,EAAA,mBAAA,AAAmB,EAAC,oBAClC,uBACA,CACJ,EACJ,GAIA,EAAO,MAAM,EAKjB,OAHA,MAAM,CAAA,EAAA,EAAA,YAAA,AAAY,EAAC,EAAa,EAAa,IAAI,SAAS,KAAM,CAC5D,OAAQ,GACZ,IACO,IACX,CACJ,EAEA,qCAAqC","ignoreList":[1]}
@@ -0,0 +1,3 @@
1
+ module.exports=[93695,(e,r,t)=>{r.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},22734,(e,r,t)=>{r.exports=e.x("fs",()=>require("fs"))},24725,(e,r,t)=>{r.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"))},18622,(e,r,t)=>{r.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(e,r,t)=>{r.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,r,t)=>{r.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},70406,(e,r,t)=>{r.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},14747,(e,r,t)=>{r.exports=e.x("path",()=>require("path"))},24361,(e,r,t)=>{r.exports=e.x("util",()=>require("util"))},46786,(e,r,t)=>{r.exports=e.x("os",()=>require("os"))}];
2
+
3
+ //# sourceMappingURL=%5Broot-of-the-server%5D__37cbcfad._.js.map
@@ -0,0 +1,3 @@
1
+ module.exports=[22734,(e,t,r)=>{t.exports=e.x("fs",()=>require("fs"))},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"))},56704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},70406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},70719,e=>{"use strict";var t=e.i(12e3),r=e.i(32560),n=e.i(76834),a=e.i(74423),o=e.i(39932),s=e.i(18271),i=e.i(39350),l=e.i(69635),d=e.i(58154),u=e.i(98378),p=e.i(2818),c=e.i(65015),h=e.i(62177),R=e.i(46523),x=e.i(96843),v=e.i(97497),g=e.i(93695);e.i(2239);var f=e.i(13167),m=e.i(22734);async function E(e){try{let{searchParams:t}=new URL(e.url),r=parseInt(t.get("lines")||"50",10),n=t.get("logPath")||process.env.LOG_FILE_PATH||"./ai-dev-tools/consolidated.log";if(!(0,m.existsSync)(n))return Response.json({error:"Log file not found"},{status:404});let a=(0,m.readFileSync)(n,"utf-8").split("\n").filter(e=>e.trim()),o={logs:a.slice(-r).join("\n"),total:a.length};return Response.json(o)}catch(t){let e={error:t instanceof Error?t.message:"Unknown error"};return Response.json(e,{status:500})}}e.s(["GET",()=>E],10089);var w=e.i(10089);let y=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/logs/tail/route",pathname:"/api/logs/tail",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/mcp-server/app/api/logs/tail/route.ts",nextConfigOutput:"",userland:w}),{workAsyncStorage:C,workUnitAsyncStorage:A,serverHooks:b}=y;function T(){return(0,n.patchFetch)({workAsyncStorage:C,workUnitAsyncStorage:A})}async function P(e,t,n){var m;y.isDev&&(0,a.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let E="/api/logs/tail/route";E=E.replace(/\/index$/,"")||"/";let w=await y.prepare(e,t,{srcPage:E,multiZoneDraftMode:!1});if(!w)return t.statusCode=400,t.end("Bad Request"),null==n.waitUntil||n.waitUntil.call(n,Promise.resolve()),null;let{buildId:C,params:A,nextConfig:b,isDraftMode:T,prerenderManifest:P,routerServerContext:N,isOnDemandRevalidate:q,revalidateOnlyGenerated:O,resolvedPathname:S,clientReferenceManifest:_,serverActionsManifest:k}=w,M=(0,l.normalizeAppPath)(E),j=!!(P.dynamicRoutes[M]||P.routes[S]);if(j&&!T){let e=!!P.routes[S],t=P.dynamicRoutes[M];if(t&&!1===t.fallback&&!e)throw new g.NoFallbackError}let H=null;!j||y.isDev||T||(H="/index"===(H=S)?"/":H);let U=!0===y.isDev||!j,I=j&&!U;k&&_&&(0,s.setReferenceManifestsSingleton)({page:E,clientReferenceManifest:_,serverActionsManifest:k,serverModuleMap:(0,i.createServerModuleMap)({serverActionsManifest:k})});let D=e.method||"GET",F=(0,o.getTracer)(),L=F.getActiveScopeSpan(),$={params:A,prerenderManifest:P,renderOpts:{experimental:{cacheComponents:!!b.experimental.cacheComponents,authInterrupts:!!b.experimental.authInterrupts},supportsDynamicResponse:U,incrementalCache:(0,a.getRequestMeta)(e,"incrementalCache"),cacheLifeProfiles:null==(m=b.experimental)?void 0:m.cacheLife,waitUntil:n.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,n)=>y.onRequestError(e,t,n,N)},sharedContext:{buildId:C}},K=new d.NodeNextRequest(e),B=new d.NodeNextResponse(t),G=u.NextRequestAdapter.fromNodeNextRequest(K,(0,u.signalFromNodeResponse)(t));try{let s=async e=>y.handle(G,$).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=F.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==p.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let n=r.get("next.route");if(n){let t=`${D} ${n}`;e.setAttributes({"next.route":n,"http.route":n,"next.span_name":t}),e.updateName(t)}else e.updateName(`${D} ${E}`)}),i=async o=>{var i,l;let d=async({previousCacheEntry:r})=>{try{if(!(0,a.getRequestMeta)(e,"minimalMode")&&q&&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(o);e.fetchMetrics=$.renderOpts.fetchMetrics;let l=$.renderOpts.pendingWaitUntil;l&&n.waitUntil&&(n.waitUntil(l),l=void 0);let d=$.renderOpts.collectedTags;if(!j)return await (0,h.sendResponse)(K,B,i,$.renderOpts.pendingWaitUntil),null;{let e=await i.blob(),t=(0,R.toNodeOutgoingHttpHeaders)(i.headers);d&&(t[v.NEXT_CACHE_TAGS_HEADER]=d),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==$.renderOpts.collectedRevalidate&&!($.renderOpts.collectedRevalidate>=v.INFINITE_CACHE)&&$.renderOpts.collectedRevalidate,n=void 0===$.renderOpts.collectedExpire||$.renderOpts.collectedExpire>=v.INFINITE_CACHE?void 0:$.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:E,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:I,isOnDemandRevalidate:q})},N),t}},u=await y.handleResponse({req:e,nextConfig:b,cacheKey:H,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:P,isRoutePPREnabled:!1,isOnDemandRevalidate:q,revalidateOnlyGenerated:O,responseGenerator:d,waitUntil:n.waitUntil});if(!j)return null;if((null==u||null==(i=u.value)?void 0:i.kind)!==f.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==u||null==(l=u.value)?void 0:l.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});(0,a.getRequestMeta)(e,"minimalMode")||t.setHeader("x-nextjs-cache",q?"REVALIDATED":u.isMiss?"MISS":u.isStale?"STALE":"HIT"),T&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let p=(0,R.fromNodeOutgoingHttpHeaders)(u.value.headers);return(0,a.getRequestMeta)(e,"minimalMode")&&j||p.delete(v.NEXT_CACHE_TAGS_HEADER),!u.cacheControl||t.getHeader("Cache-Control")||p.get("Cache-Control")||p.set("Cache-Control",(0,x.getCacheControlHeader)(u.cacheControl)),await (0,h.sendResponse)(K,B,new Response(u.value.body,{headers:p,status:u.value.status||200})),null};L?await i(L):await F.withPropagatedContext(e.headers,()=>F.trace(p.BaseServerSpan.handleRequest,{spanName:`${D} ${E}`,kind:o.SpanKind.SERVER,attributes:{"http.method":D,"http.target":e.url}},i))}catch(t){if(t instanceof g.NoFallbackError||await y.onRequestError(e,t,{routerKind:"App Router",routePath:M,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:I,isOnDemandRevalidate:q})}),j)throw t;return await (0,h.sendResponse)(K,B,new Response(null,{status:500})),null}}e.s(["handler",()=>P,"patchFetch",()=>T,"routeModule",()=>y,"serverHooks",()=>b,"workAsyncStorage",()=>C,"workUnitAsyncStorage",()=>A],70719)}];
2
+
3
+ //# sourceMappingURL=%5Broot-of-the-server%5D__3899cb0e._.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["turbopack:///[project]/mcp-server/app/api/logs/list/route.ts","turbopack:///[project]/node_modules/.pnpm/next@15.6.0-canary.31_babel-plugin-react-compiler@19.1.0-rc.3_react-dom@19.1.1_react@19.1.1__react@19.1.1/node_modules/next/dist/esm/build/templates/app-route.js"],"sourcesContent":["import { existsSync, readdirSync, statSync } from \"fs\"\nimport type { NextRequest } from \"next/server\"\nimport { basename, dirname, join } from \"path\"\nimport type { LogFile, LogListError, LogListResponse } from \"@/types\"\n\nexport async function GET(_request: NextRequest): Promise<Response> {\n try {\n const currentLogPath = process.env.LOG_FILE_PATH || \"/var/log/dev3000/dev3000.log\"\n\n if (!existsSync(currentLogPath)) {\n const errorResponse: LogListError = { error: \"Current log file not found\" }\n return Response.json(errorResponse, { status: 404 })\n }\n\n // Get the directory containing the current log\n const logDir = dirname(currentLogPath)\n const currentLogName = basename(currentLogPath)\n\n // Extract project name from current log filename\n // Format: dev3000-{projectName}-{timestamp}.log\n const projectMatch = currentLogName.match(/^dev3000-(.+?)-\\d{4}-\\d{2}-\\d{2}T/)\n const projectName = projectMatch ? projectMatch[1] : \"unknown\"\n\n // Find all log files for this project\n const files: LogFile[] = []\n\n try {\n const dirContents = readdirSync(logDir)\n const logFiles = dirContents\n .filter((file) => file.startsWith(`dev3000-${projectName}-`) && file.endsWith(\".log\"))\n .map((file) => {\n const filePath = join(logDir, file)\n const stats = statSync(filePath)\n\n // Extract timestamp from filename\n const timestampMatch = file.match(/(\\d{4}-\\d{2}-\\d{2}T[\\d-]+Z)/)\n const timestamp = timestampMatch ? timestampMatch[1].replace(/-/g, \":\") : \"\"\n\n return {\n name: file,\n path: filePath,\n timestamp,\n size: stats.size,\n mtime: stats.mtime,\n isCurrent: file === currentLogName\n }\n })\n .sort((a, b) => b.mtime.getTime() - a.mtime.getTime()) // Most recent first\n\n files.push(...logFiles)\n } catch (error) {\n console.warn(\"Could not read log directory:\", error)\n }\n\n const response: LogListResponse = {\n files,\n currentFile: currentLogPath,\n projectName\n }\n\n return Response.json(response)\n } catch (error) {\n const errorResponse: LogListError = {\n error: error instanceof Error ? error.message : \"Unknown error\"\n }\n return Response.json(errorResponse, { 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 { getRequestMeta } from \"next/dist/esm/server/request-meta\";\nimport { getTracer, SpanKind } from \"next/dist/esm/server/lib/trace/tracer\";\nimport { setReferenceManifestsSingleton } from \"next/dist/esm/server/app-render/encryption-utils\";\nimport { createServerModuleMap } from \"next/dist/esm/server/app-render/action-utils\";\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/logs/list/route\",\n pathname: \"/api/logs/list\",\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]/mcp-server/app/api/logs/list/route.ts\",\n nextConfigOutput,\n userland\n});\n// Pull out the exports that we need to expose from the module. This should\n// be eliminated when we've moved the other routes to the new format. These\n// are used to hook into the route.\nconst { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule;\nfunction patchFetch() {\n return _patchFetch({\n workAsyncStorage,\n workUnitAsyncStorage\n });\n}\nexport { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, };\nexport async function handler(req, res, ctx) {\n var _nextConfig_experimental;\n let srcPage = \"/api/logs/list/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, 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 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 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 setReferenceManifestsSingleton({\n page: srcPage,\n clientReferenceManifest,\n serverActionsManifest,\n serverModuleMap: createServerModuleMap({\n serverActionsManifest\n })\n });\n }\n const method = req.method || 'GET';\n const tracer = getTracer();\n const activeSpan = tracer.getActiveScopeSpan();\n const context = {\n params,\n prerenderManifest,\n renderOpts: {\n experimental: {\n cacheComponents: Boolean(nextConfig.experimental.cacheComponents),\n authInterrupts: Boolean(nextConfig.experimental.authInterrupts)\n },\n supportsDynamicResponse,\n incrementalCache: getRequestMeta(req, 'incrementalCache'),\n cacheLifeProfiles: (_nextConfig_experimental = nextConfig.experimental) == null ? void 0 : _nextConfig_experimental.cacheLife,\n waitUntil: ctx.waitUntil,\n onClose: (cb)=>{\n res.on('close', cb);\n },\n onAfterTaskError: undefined,\n onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext)\n },\n sharedContext: {\n buildId\n }\n };\n const nodeNextReq = new NodeNextRequest(req);\n const nodeNextRes = new NodeNextResponse(res);\n const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res));\n try {\n const invokeRouteModule = async (span)=>{\n return routeModule.handle(nextReq, context).finally(()=>{\n if (!span) return;\n span.setAttributes({\n 'http.status_code': res.statusCode,\n 'next.rsc': false\n });\n const rootSpanAttributes = tracer.getRootSpanAttributes();\n // We were unable to get attributes, probably OTEL is not enabled\n if (!rootSpanAttributes) {\n return;\n }\n if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) {\n console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);\n return;\n }\n const route = rootSpanAttributes.get('next.route');\n if (route) {\n const name = `${method} ${route}`;\n span.setAttributes({\n 'next.route': route,\n 'http.route': route,\n 'next.span_name': name\n });\n span.updateName(name);\n } else {\n span.updateName(`${method} ${srcPage}`);\n }\n });\n };\n const handleResponse = async (currentSpan)=>{\n var _cacheEntry_value;\n const responseGenerator = async ({ previousCacheEntry })=>{\n try {\n if (!getRequestMeta(req, 'minimalMode') && 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 await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: srcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, 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 });\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 (!getRequestMeta(req, 'minimalMode')) {\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 (!(getRequestMeta(req, 'minimalMode') && isIsr)) {\n headers.delete(NEXT_CACHE_TAGS_HEADER);\n }\n // If cache control is already set on the response we don't\n // override it to allow users to customize it via next.config\n if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) {\n headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl));\n }\n await sendResponse(nodeNextReq, nodeNextRes, // @ts-expect-error - Argument of type 'Buffer<ArrayBufferLike>' is not assignable to parameter of type 'BodyInit | null | undefined'.\n new Response(cacheEntry.value.body, {\n headers,\n status: cacheEntry.value.status || 200\n }));\n return null;\n };\n // TODO: activeSpan code path is for when wrapped by\n // next-server can be removed when this is no longer used\n if (activeSpan) {\n await handleResponse(activeSpan);\n } else {\n await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, {\n spanName: `${method} ${srcPage}`,\n kind: SpanKind.SERVER,\n attributes: {\n 'http.method': method,\n 'http.target': req.url\n }\n }, handleResponse));\n }\n } catch (err) {\n if (!(err instanceof NoFallbackError)) {\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: normalizedSrcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n });\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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EACX,UAAW,QACX,iBAAkB,CAAA,EAAA,EAAA,mBAAA,AAAmB,EAAC,oBAClC,uBACA,CACJ,EACJ,GAIA,EAAO,MAAM,EAKjB,OAHA,MAAM,CAAA,EAAA,EAAA,YAAA,AAAY,EAAC,EAAa,EAAa,IAAI,SAAS,KAAM,CAC5D,OAAQ,GACZ,IACO,IACX,CACJ,EAEA,qCAAqC","ignoreList":[1]}
1
+ {"version":3,"sources":["turbopack:///[project]/node_modules/.pnpm/next@16.0.0-canary.10_babel-plugin-react-compiler@19.1.0-rc.3_react-dom@19.1.1_react@19.1.1__react@19.1.1/node_modules/next/dist/esm/build/templates/app-route.js","turbopack:///[project]/mcp-server/app/api/logs/tail/route.ts"],"sourcesContent":["import { AppRouteRouteModule } from \"next/dist/esm/server/route-modules/app-route/module.compiled\";\nimport { RouteKind } from \"next/dist/esm/server/route-kind\";\nimport { patchFetch as _patchFetch } from \"next/dist/esm/server/lib/patch-fetch\";\nimport { addRequestMeta, getRequestMeta } from \"next/dist/esm/server/request-meta\";\nimport { getTracer, SpanKind } from \"next/dist/esm/server/lib/trace/tracer\";\nimport { setReferenceManifestsSingleton } from \"next/dist/esm/server/app-render/encryption-utils\";\nimport { createServerModuleMap } from \"next/dist/esm/server/app-render/action-utils\";\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/logs/tail/route\",\n pathname: \"/api/logs/tail\",\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]/mcp-server/app/api/logs/tail/route.ts\",\n nextConfigOutput,\n userland\n});\n// Pull out the exports that we need to expose from the module. This should\n// be eliminated when we've moved the other routes to the new format. These\n// are used to hook into the route.\nconst { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule;\nfunction patchFetch() {\n return _patchFetch({\n workAsyncStorage,\n workUnitAsyncStorage\n });\n}\nexport { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, };\nexport async function handler(req, res, ctx) {\n var _nextConfig_experimental;\n if (routeModule.isDev) {\n addRequestMeta(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint());\n }\n let srcPage = \"/api/logs/tail/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, 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 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 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 setReferenceManifestsSingleton({\n page: srcPage,\n clientReferenceManifest,\n serverActionsManifest,\n serverModuleMap: createServerModuleMap({\n serverActionsManifest\n })\n });\n }\n const method = req.method || 'GET';\n const tracer = getTracer();\n const activeSpan = tracer.getActiveScopeSpan();\n const context = {\n params,\n prerenderManifest,\n renderOpts: {\n experimental: {\n cacheComponents: Boolean(nextConfig.experimental.cacheComponents),\n authInterrupts: Boolean(nextConfig.experimental.authInterrupts)\n },\n supportsDynamicResponse,\n incrementalCache: getRequestMeta(req, 'incrementalCache'),\n cacheLifeProfiles: (_nextConfig_experimental = nextConfig.experimental) == null ? void 0 : _nextConfig_experimental.cacheLife,\n waitUntil: ctx.waitUntil,\n onClose: (cb)=>{\n res.on('close', cb);\n },\n onAfterTaskError: undefined,\n onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext)\n },\n sharedContext: {\n buildId\n }\n };\n const nodeNextReq = new NodeNextRequest(req);\n const nodeNextRes = new NodeNextResponse(res);\n const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res));\n try {\n const invokeRouteModule = async (span)=>{\n return routeModule.handle(nextReq, context).finally(()=>{\n if (!span) return;\n span.setAttributes({\n 'http.status_code': res.statusCode,\n 'next.rsc': false\n });\n const rootSpanAttributes = tracer.getRootSpanAttributes();\n // We were unable to get attributes, probably OTEL is not enabled\n if (!rootSpanAttributes) {\n return;\n }\n if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) {\n console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);\n return;\n }\n const route = rootSpanAttributes.get('next.route');\n if (route) {\n const name = `${method} ${route}`;\n span.setAttributes({\n 'next.route': route,\n 'http.route': route,\n 'next.span_name': name\n });\n span.updateName(name);\n } else {\n span.updateName(`${method} ${srcPage}`);\n }\n });\n };\n const handleResponse = async (currentSpan)=>{\n var _cacheEntry_value;\n const responseGenerator = async ({ previousCacheEntry })=>{\n try {\n if (!getRequestMeta(req, 'minimalMode') && 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 await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: srcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, 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 });\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 (!getRequestMeta(req, 'minimalMode')) {\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 (!(getRequestMeta(req, 'minimalMode') && isIsr)) {\n headers.delete(NEXT_CACHE_TAGS_HEADER);\n }\n // If cache control is already set on the response we don't\n // override it to allow users to customize it via next.config\n if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) {\n headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl));\n }\n await sendResponse(nodeNextReq, nodeNextRes, // @ts-expect-error - Argument of type 'Buffer<ArrayBufferLike>' is not assignable to parameter of type 'BodyInit | null | undefined'.\n new Response(cacheEntry.value.body, {\n headers,\n status: cacheEntry.value.status || 200\n }));\n return null;\n };\n // TODO: activeSpan code path is for when wrapped by\n // next-server can be removed when this is no longer used\n if (activeSpan) {\n await handleResponse(activeSpan);\n } else {\n await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, {\n spanName: `${method} ${srcPage}`,\n kind: SpanKind.SERVER,\n attributes: {\n 'http.method': method,\n 'http.target': req.url\n }\n }, handleResponse));\n }\n } catch (err) {\n if (!(err instanceof NoFallbackError)) {\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: normalizedSrcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n });\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","import { existsSync, readFileSync } from \"fs\"\nimport type { NextRequest } from \"next/server\"\nimport type { LogsApiError, LogsApiResponse } from \"@/types\"\n\nexport async function GET(request: NextRequest): Promise<Response> {\n try {\n const { searchParams } = new URL(request.url)\n const lines = parseInt(searchParams.get(\"lines\") || \"50\", 10)\n const logPath = searchParams.get(\"logPath\") || process.env.LOG_FILE_PATH || \"./ai-dev-tools/consolidated.log\"\n\n if (!existsSync(logPath)) {\n const errorResponse: LogsApiError = { error: \"Log file not found\" }\n return Response.json(errorResponse, { status: 404 })\n }\n\n const logContent = readFileSync(logPath, \"utf-8\")\n const allLines = logContent.split(\"\\n\").filter((line) => line.trim())\n const tailLines = allLines.slice(-lines)\n\n const response: LogsApiResponse = {\n logs: tailLines.join(\"\\n\"),\n total: allLines.length\n }\n\n return Response.json(response)\n } catch (error) {\n const errorResponse: LogsApiError = {\n error: error instanceof Error ? error.message : \"Unknown error\"\n }\n return Response.json(errorResponse, { status: 500 })\n }\n}\n"],"names":[],"mappings":"u3BAAA,IAAA,EAAA,EAAA,CAAA,CAAA,MACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,MACA,EAAA,EAAA,C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O,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,GAEf,CAAE,MAAO,EAAK,CAcV,GAbI,AAAE,CAAD,YAAgB,EAAA,eAAe,EAChC,CADmC,KAC7B,EAAY,cAAc,CAAC,EAAK,EAAK,CACvC,WAAY,aACZ,UAAW,EACX,UAAW,QACX,iBAAkB,CAAA,EAAA,EAAA,mBAAA,AAAmB,EAAC,oBAClC,uBACA,CACJ,EACJ,GAIA,EAAO,MAAM,EAKjB,OAHA,MAAM,CAAA,EAAA,EAAA,YAAA,AAAY,EAAC,EAAa,EAAa,IAAI,SAAS,KAAM,CAC5D,OAAQ,GACZ,IACO,IACX,CACJ,EAEA,qCAAqC","ignoreList":[0]}
@@ -0,0 +1,3 @@
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"))},22734,(e,t,r)=>{t.exports=e.x("fs",()=>require("fs"))},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"))},18622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},70406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},14747,(e,t,r)=>{t.exports=e.x("path",()=>require("path"))},33405,(e,t,r)=>{t.exports=e.x("child_process",()=>require("child_process"))},2157,(e,t,r)=>{t.exports=e.x("node:fs",()=>require("node:fs"))},60526,(e,t,r)=>{t.exports=e.x("node:os",()=>require("node:os"))},50227,(e,t,r)=>{t.exports=e.x("node:path",()=>require("node:path"))},42450,e=>{"use strict";var t=e.i(12e3),r=e.i(32560),a=e.i(76834),n=e.i(74423),o=e.i(39932),s=e.i(18271),i=e.i(39350),l=e.i(69635),d=e.i(58154),p=e.i(98378),c=e.i(2818),u=e.i(65015),h=e.i(62177),x=e.i(46523),m=e.i(96843),v=e.i(97497),R=e.i(93695);e.i(2239);var g=e.i(13167),f=e.i(2157),C=e.i(60526),E=e.i(50227),y=e.i(37859),w=e.i(20539);async function P(e){let t=(0,w.getMCPClientManager)(),r=t.getConnectedMCPs(),a=t.getAllTools(),n=(0,E.join)((0,C.homedir)(),".d3k"),o=[];try{if((0,f.existsSync)(n))for(let e of(0,f.readdirSync)(n).filter(e=>e.endsWith(".json")))try{let t=(0,E.join)(n,e),r=JSON.parse((0,f.readFileSync)(t,"utf-8")),a=e.replace(".json","");o.push({name:a,cdpUrl:r.cdpUrl,appPort:r.appPort})}catch{}}catch(e){console.error("[Orchestrator API] Failed to read session files:",e)}let s=r.map(e=>{let t=a.filter(t=>t.mcpName===e),r=o.filter(t=>"chrome-devtools"===e?t.cdpUrl:"nextjs-dev"===e&&t.appPort);return{name:e,connected:!0,toolCount:t.length,tools:t.map(e=>e.tool.name),projects:r.map(e=>e.name)}});return y.NextResponse.json({orchestratorEnabled:!0,connectedMCPs:r,totalConnections:r.length,mcpDetails:s,totalProjects:o.length,projects:o.map(e=>e.name),message:r.length>0?`Connected to ${r.length} downstream MCP${r.length>1?"s":""} across ${o.length} project${1!==o.length?"s":""}`:"No downstream MCPs connected (waiting for dev3000 to start Chrome/dev server)"})}e.s(["GET",()=>P,"dynamic",0,"force-dynamic"],64269);var A=e.i(64269);let j=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/orchestrator/route",pathname:"/api/orchestrator",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/mcp-server/app/api/orchestrator/route.ts",nextConfigOutput:"",userland:A}),{workAsyncStorage:q,workUnitAsyncStorage:b,serverHooks:N}=j;function M(){return(0,a.patchFetch)({workAsyncStorage:q,workUnitAsyncStorage:b})}async function T(e,t,a){var f;j.isDev&&(0,n.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let C="/api/orchestrator/route";C=C.replace(/\/index$/,"")||"/";let E=await j.prepare(e,t,{srcPage:C,multiZoneDraftMode:!1});if(!E)return t.statusCode=400,t.end("Bad Request"),null==a.waitUntil||a.waitUntil.call(a,Promise.resolve()),null;let{buildId:y,params:w,nextConfig:P,isDraftMode:A,prerenderManifest:q,routerServerContext:b,isOnDemandRevalidate:N,revalidateOnlyGenerated:M,resolvedPathname:T,clientReferenceManifest:_,serverActionsManifest:S}=E,k=(0,l.normalizeAppPath)(C),O=!!(q.dynamicRoutes[k]||q.routes[T]);if(O&&!A){let e=!!q.routes[T],t=q.dynamicRoutes[k];if(t&&!1===t.fallback&&!e)throw new R.NoFallbackError}let U=null;!O||j.isDev||A||(U="/index"===(U=T)?"/":U);let H=!0===j.isDev||!O,I=O&&!H;S&&_&&(0,s.setReferenceManifestsSingleton)({page:C,clientReferenceManifest:_,serverActionsManifest:S,serverModuleMap:(0,i.createServerModuleMap)({serverActionsManifest:S})});let D=e.method||"GET",$=(0,o.getTracer)(),F=$.getActiveScopeSpan(),K={params:w,prerenderManifest:q,renderOpts:{experimental:{cacheComponents:!!P.experimental.cacheComponents,authInterrupts:!!P.experimental.authInterrupts},supportsDynamicResponse:H,incrementalCache:(0,n.getRequestMeta)(e,"incrementalCache"),cacheLifeProfiles:null==(f=P.experimental)?void 0:f.cacheLife,waitUntil:a.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,a)=>j.onRequestError(e,t,a,b)},sharedContext:{buildId:y}},B=new d.NodeNextRequest(e),L=new d.NodeNextResponse(t),G=p.NextRequestAdapter.fromNodeNextRequest(B,(0,p.signalFromNodeResponse)(t));try{let s=async e=>j.handle(G,K).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")!==c.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let a=r.get("next.route");if(a){let t=`${D} ${a}`;e.setAttributes({"next.route":a,"http.route":a,"next.span_name":t}),e.updateName(t)}else e.updateName(`${D} ${C}`)}),i=async o=>{var i,l;let d=async({previousCacheEntry:r})=>{try{if(!(0,n.getRequestMeta)(e,"minimalMode")&&N&&M&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let i=await s(o);e.fetchMetrics=K.renderOpts.fetchMetrics;let l=K.renderOpts.pendingWaitUntil;l&&a.waitUntil&&(a.waitUntil(l),l=void 0);let d=K.renderOpts.collectedTags;if(!O)return await (0,h.sendResponse)(B,L,i,K.renderOpts.pendingWaitUntil),null;{let e=await i.blob(),t=(0,x.toNodeOutgoingHttpHeaders)(i.headers);d&&(t[v.NEXT_CACHE_TAGS_HEADER]=d),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==K.renderOpts.collectedRevalidate&&!(K.renderOpts.collectedRevalidate>=v.INFINITE_CACHE)&&K.renderOpts.collectedRevalidate,a=void 0===K.renderOpts.collectedExpire||K.renderOpts.collectedExpire>=v.INFINITE_CACHE?void 0:K.renderOpts.collectedExpire;return{value:{kind:g.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 j.onRequestError(e,t,{routerKind:"App Router",routePath:C,routeType:"route",revalidateReason:(0,u.getRevalidateReason)({isStaticGeneration:I,isOnDemandRevalidate:N})},b),t}},p=await j.handleResponse({req:e,nextConfig:P,cacheKey:U,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:q,isRoutePPREnabled:!1,isOnDemandRevalidate:N,revalidateOnlyGenerated:M,responseGenerator:d,waitUntil:a.waitUntil});if(!O)return null;if((null==p||null==(i=p.value)?void 0:i.kind)!==g.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==p||null==(l=p.value)?void 0:l.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});(0,n.getRequestMeta)(e,"minimalMode")||t.setHeader("x-nextjs-cache",N?"REVALIDATED":p.isMiss?"MISS":p.isStale?"STALE":"HIT"),A&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let c=(0,x.fromNodeOutgoingHttpHeaders)(p.value.headers);return(0,n.getRequestMeta)(e,"minimalMode")&&O||c.delete(v.NEXT_CACHE_TAGS_HEADER),!p.cacheControl||t.getHeader("Cache-Control")||c.get("Cache-Control")||c.set("Cache-Control",(0,m.getCacheControlHeader)(p.cacheControl)),await (0,h.sendResponse)(B,L,new Response(p.value.body,{headers:c,status:p.value.status||200})),null};F?await i(F):await $.withPropagatedContext(e.headers,()=>$.trace(c.BaseServerSpan.handleRequest,{spanName:`${D} ${C}`,kind:o.SpanKind.SERVER,attributes:{"http.method":D,"http.target":e.url}},i))}catch(t){if(t instanceof R.NoFallbackError||await j.onRequestError(e,t,{routerKind:"App Router",routePath:k,routeType:"route",revalidateReason:(0,u.getRevalidateReason)({isStaticGeneration:I,isOnDemandRevalidate:N})}),O)throw t;return await (0,h.sendResponse)(B,L,new Response(null,{status:500})),null}}e.s(["handler",()=>T,"patchFetch",()=>M,"routeModule",()=>j,"serverHooks",()=>N,"workAsyncStorage",()=>q,"workUnitAsyncStorage",()=>b],42450)},70729,e=>{e.v(t=>Promise.all(["server/chunks/[externals]_node:crypto_c20cce38._.js"].map(t=>e.l(t))).then(()=>t(66680)))}];
2
+
3
+ //# sourceMappingURL=%5Broot-of-the-server%5D__40003a13._.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["turbopack:///[project]/node_modules/.pnpm/next@16.0.0-canary.10_babel-plugin-react-compiler@19.1.0-rc.3_react-dom@19.1.1_react@19.1.1__react@19.1.1/node_modules/next/dist/esm/build/templates/app-route.js","turbopack:///[project]/mcp-server/app/api/orchestrator/route.ts"],"sourcesContent":["import { AppRouteRouteModule } from \"next/dist/esm/server/route-modules/app-route/module.compiled\";\nimport { RouteKind } from \"next/dist/esm/server/route-kind\";\nimport { patchFetch as _patchFetch } from \"next/dist/esm/server/lib/patch-fetch\";\nimport { addRequestMeta, getRequestMeta } from \"next/dist/esm/server/request-meta\";\nimport { getTracer, SpanKind } from \"next/dist/esm/server/lib/trace/tracer\";\nimport { setReferenceManifestsSingleton } from \"next/dist/esm/server/app-render/encryption-utils\";\nimport { createServerModuleMap } from \"next/dist/esm/server/app-render/action-utils\";\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/orchestrator/route\",\n pathname: \"/api/orchestrator\",\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]/mcp-server/app/api/orchestrator/route.ts\",\n nextConfigOutput,\n userland\n});\n// Pull out the exports that we need to expose from the module. This should\n// be eliminated when we've moved the other routes to the new format. These\n// are used to hook into the route.\nconst { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule;\nfunction patchFetch() {\n return _patchFetch({\n workAsyncStorage,\n workUnitAsyncStorage\n });\n}\nexport { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, };\nexport async function handler(req, res, ctx) {\n var _nextConfig_experimental;\n if (routeModule.isDev) {\n addRequestMeta(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint());\n }\n let srcPage = \"/api/orchestrator/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, 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 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 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 setReferenceManifestsSingleton({\n page: srcPage,\n clientReferenceManifest,\n serverActionsManifest,\n serverModuleMap: createServerModuleMap({\n serverActionsManifest\n })\n });\n }\n const method = req.method || 'GET';\n const tracer = getTracer();\n const activeSpan = tracer.getActiveScopeSpan();\n const context = {\n params,\n prerenderManifest,\n renderOpts: {\n experimental: {\n cacheComponents: Boolean(nextConfig.experimental.cacheComponents),\n authInterrupts: Boolean(nextConfig.experimental.authInterrupts)\n },\n supportsDynamicResponse,\n incrementalCache: getRequestMeta(req, 'incrementalCache'),\n cacheLifeProfiles: (_nextConfig_experimental = nextConfig.experimental) == null ? void 0 : _nextConfig_experimental.cacheLife,\n waitUntil: ctx.waitUntil,\n onClose: (cb)=>{\n res.on('close', cb);\n },\n onAfterTaskError: undefined,\n onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext)\n },\n sharedContext: {\n buildId\n }\n };\n const nodeNextReq = new NodeNextRequest(req);\n const nodeNextRes = new NodeNextResponse(res);\n const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res));\n try {\n const invokeRouteModule = async (span)=>{\n return routeModule.handle(nextReq, context).finally(()=>{\n if (!span) return;\n span.setAttributes({\n 'http.status_code': res.statusCode,\n 'next.rsc': false\n });\n const rootSpanAttributes = tracer.getRootSpanAttributes();\n // We were unable to get attributes, probably OTEL is not enabled\n if (!rootSpanAttributes) {\n return;\n }\n if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) {\n console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);\n return;\n }\n const route = rootSpanAttributes.get('next.route');\n if (route) {\n const name = `${method} ${route}`;\n span.setAttributes({\n 'next.route': route,\n 'http.route': route,\n 'next.span_name': name\n });\n span.updateName(name);\n } else {\n span.updateName(`${method} ${srcPage}`);\n }\n });\n };\n const handleResponse = async (currentSpan)=>{\n var _cacheEntry_value;\n const responseGenerator = async ({ previousCacheEntry })=>{\n try {\n if (!getRequestMeta(req, 'minimalMode') && 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 await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: srcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, 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 });\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 (!getRequestMeta(req, 'minimalMode')) {\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 (!(getRequestMeta(req, 'minimalMode') && isIsr)) {\n headers.delete(NEXT_CACHE_TAGS_HEADER);\n }\n // If cache control is already set on the response we don't\n // override it to allow users to customize it via next.config\n if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) {\n headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl));\n }\n await sendResponse(nodeNextReq, nodeNextRes, // @ts-expect-error - Argument of type 'Buffer<ArrayBufferLike>' is not assignable to parameter of type 'BodyInit | null | undefined'.\n new Response(cacheEntry.value.body, {\n headers,\n status: cacheEntry.value.status || 200\n }));\n return null;\n };\n // TODO: activeSpan code path is for when wrapped by\n // next-server can be removed when this is no longer used\n if (activeSpan) {\n await handleResponse(activeSpan);\n } else {\n await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, {\n spanName: `${method} ${srcPage}`,\n kind: SpanKind.SERVER,\n attributes: {\n 'http.method': method,\n 'http.target': req.url\n }\n }, handleResponse));\n }\n } catch (err) {\n if (!(err instanceof NoFallbackError)) {\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: normalizedSrcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n });\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","import { existsSync, readdirSync, readFileSync } from \"node:fs\"\nimport { homedir } from \"node:os\"\nimport { join } from \"node:path\"\nimport { NextResponse } from \"next/server\"\nimport { getMCPClientManager } from \"@/app/mcp/client-manager\"\n\nexport const dynamic = \"force-dynamic\"\n\nexport async function GET(_request: Request) {\n const clientManager = getMCPClientManager()\n const connectedMCPs = clientManager.getConnectedMCPs()\n const allTools = clientManager.getAllTools()\n\n // Read session files to get project info\n const sessionDir = join(homedir(), \".d3k\")\n const projects: Array<{ name: string; cdpUrl?: string; appPort?: number }> = []\n\n try {\n if (existsSync(sessionDir)) {\n const sessionFiles = readdirSync(sessionDir).filter((f) => f.endsWith(\".json\"))\n\n for (const file of sessionFiles) {\n try {\n const sessionPath = join(sessionDir, file)\n const sessionData = JSON.parse(readFileSync(sessionPath, \"utf-8\"))\n const projectName = file.replace(\".json\", \"\")\n\n projects.push({\n name: projectName,\n cdpUrl: sessionData.cdpUrl,\n appPort: sessionData.appPort\n })\n } catch {\n // Skip invalid session files\n }\n }\n }\n } catch (error) {\n console.error(\"[Orchestrator API] Failed to read session files:\", error)\n }\n\n const mcpDetails = connectedMCPs.map((mcpName) => {\n const tools = allTools.filter((t) => t.mcpName === mcpName)\n\n // Determine which projects this MCP is connected to\n const connectedProjects = projects.filter((p) => {\n if (mcpName === \"chrome-devtools\") return p.cdpUrl\n if (mcpName === \"nextjs-dev\") return p.appPort\n return false\n })\n\n return {\n name: mcpName,\n connected: true,\n toolCount: tools.length,\n tools: tools.map((t) => t.tool.name),\n projects: connectedProjects.map((p) => p.name)\n }\n })\n\n return NextResponse.json({\n orchestratorEnabled: true,\n connectedMCPs: connectedMCPs,\n totalConnections: connectedMCPs.length,\n mcpDetails,\n totalProjects: projects.length,\n projects: projects.map((p) => p.name),\n message:\n connectedMCPs.length > 0\n ? `Connected to ${connectedMCPs.length} downstream MCP${connectedMCPs.length > 1 ? \"s\" : \"\"} across ${projects.length} project${projects.length !== 1 ? \"s\" : \"\"}`\n : \"No downstream MCPs connected (waiting for dev3000 to start Chrome/dev server)\"\n })\n}\n"],"names":[],"mappings":"w3CAAA,IAAA,EAAA,EAAA,CAAA,CAAA,MACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,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,CAAA,CAAA,MAAA,IAAA,EAAA,EAAA,CAAA,CAAA,OCjBA,EAAA,EAAA,CAAA,CAAA,MACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OAIO,eAAe,EAAI,CAAiB,EACzC,IAAM,EAAgB,CAAA,EAAA,EAAA,mBAAA,AAAmB,IACnC,EAAgB,EAAc,gBAAgB,GAC9C,EAAW,EAAc,WAAW,GAGpC,EAAa,CAAA,EAAA,EAAA,IAAA,AAAI,EAAC,CAAA,EAAA,EAAA,OAAA,AAAO,IAAI,QAC7B,EAAuE,EAAE,CAE/E,GAAI,CACF,GAAI,CAAA,EAAA,EAAA,UAAA,AAAU,EAA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