af360 0.1.14 → 0.1.16

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 (289) hide show
  1. package/dist/.next/BUILD_ID +1 -1
  2. package/dist/.next/app-build-manifest.json +139 -130
  3. package/dist/.next/app-path-routes-manifest.json +17 -17
  4. package/dist/.next/build-manifest.json +5 -5
  5. package/dist/.next/prerender-manifest.json +45 -45
  6. package/dist/.next/server/app/_not-found/page.js +2 -2
  7. package/dist/.next/server/app/_not-found/page.js.nft.json +1 -1
  8. package/dist/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  9. package/dist/.next/server/app/_not-found.html +1 -1
  10. package/dist/.next/server/app/_not-found.meta +8 -0
  11. package/dist/.next/server/app/_not-found.rsc +4 -4
  12. package/dist/.next/server/app/ahead/page.js +2 -2
  13. package/dist/.next/server/app/ahead/page.js.nft.json +1 -1
  14. package/dist/.next/server/app/ahead/page_client-reference-manifest.js +1 -1
  15. package/dist/.next/server/app/ahead.html +1 -1
  16. package/dist/.next/server/app/ahead.meta +8 -0
  17. package/dist/.next/server/app/ahead.rsc +5 -5
  18. package/dist/.next/server/app/api/browse/route.js +1 -1
  19. package/dist/.next/server/app/api/browse/route.js.nft.json +1 -1
  20. package/dist/.next/server/app/api/browse/route_client-reference-manifest.js +1 -1
  21. package/dist/.next/server/app/api/card/route.js +1 -1
  22. package/dist/.next/server/app/api/card/route.js.nft.json +1 -1
  23. package/dist/.next/server/app/api/card/route_client-reference-manifest.js +1 -1
  24. package/dist/.next/server/app/api/check/route.js +1 -1
  25. package/dist/.next/server/app/api/check/route.js.nft.json +1 -1
  26. package/dist/.next/server/app/api/check/route_client-reference-manifest.js +1 -1
  27. package/dist/.next/server/app/api/config/route.js +1 -1
  28. package/dist/.next/server/app/api/config/route.js.nft.json +1 -1
  29. package/dist/.next/server/app/api/config/route_client-reference-manifest.js +1 -1
  30. package/dist/.next/server/app/api/connections/route.js +3 -3
  31. package/dist/.next/server/app/api/connections/route.js.nft.json +1 -1
  32. package/dist/.next/server/app/api/connections/route_client-reference-manifest.js +1 -1
  33. package/dist/.next/server/app/api/connectors/github/route.js +1 -1
  34. package/dist/.next/server/app/api/connectors/github/route.js.nft.json +1 -1
  35. package/dist/.next/server/app/api/connectors/github/route_client-reference-manifest.js +1 -1
  36. package/dist/.next/server/app/api/consent/route.js +1 -1
  37. package/dist/.next/server/app/api/consent/route.js.nft.json +1 -1
  38. package/dist/.next/server/app/api/consent/route_client-reference-manifest.js +1 -1
  39. package/dist/.next/server/app/api/context/route.js +3 -3
  40. package/dist/.next/server/app/api/context/route.js.nft.json +1 -1
  41. package/dist/.next/server/app/api/context/route_client-reference-manifest.js +1 -1
  42. package/dist/.next/server/app/api/discover/route.js +1 -1
  43. package/dist/.next/server/app/api/discover/route.js.nft.json +1 -1
  44. package/dist/.next/server/app/api/discover/route_client-reference-manifest.js +1 -1
  45. package/dist/.next/server/app/api/expiry/route.js +1 -1
  46. package/dist/.next/server/app/api/expiry/route.js.nft.json +1 -1
  47. package/dist/.next/server/app/api/expiry/route_client-reference-manifest.js +1 -1
  48. package/dist/.next/server/app/api/first-light/route.js +1 -1
  49. package/dist/.next/server/app/api/first-light/route.js.nft.json +1 -1
  50. package/dist/.next/server/app/api/first-light/route_client-reference-manifest.js +1 -1
  51. package/dist/.next/server/app/api/handoff/route.js +1 -1
  52. package/dist/.next/server/app/api/handoff/route.js.nft.json +1 -1
  53. package/dist/.next/server/app/api/handoff/route_client-reference-manifest.js +1 -1
  54. package/dist/.next/server/app/api/health/route.js +1 -1
  55. package/dist/.next/server/app/api/health/route.js.nft.json +1 -1
  56. package/dist/.next/server/app/api/health/route_client-reference-manifest.js +1 -1
  57. package/dist/.next/server/app/api/incidents/route.js +1 -1
  58. package/dist/.next/server/app/api/incidents/route.js.nft.json +1 -1
  59. package/dist/.next/server/app/api/incidents/route_client-reference-manifest.js +1 -1
  60. package/dist/.next/server/app/api/insights/route.js +1 -1
  61. package/dist/.next/server/app/api/insights/route.js.nft.json +1 -1
  62. package/dist/.next/server/app/api/insights/route_client-reference-manifest.js +1 -1
  63. package/dist/.next/server/app/api/log/route.js +1 -1
  64. package/dist/.next/server/app/api/log/route.js.nft.json +1 -1
  65. package/dist/.next/server/app/api/log/route_client-reference-manifest.js +1 -1
  66. package/dist/.next/server/app/api/pulse/route.js +1 -1
  67. package/dist/.next/server/app/api/pulse/route.js.nft.json +1 -1
  68. package/dist/.next/server/app/api/pulse/route_client-reference-manifest.js +1 -1
  69. package/dist/.next/server/app/api/radar/route.js +1 -1
  70. package/dist/.next/server/app/api/radar/route.js.nft.json +1 -1
  71. package/dist/.next/server/app/api/radar/route_client-reference-manifest.js +1 -1
  72. package/dist/.next/server/app/api/report/route.js +1 -1
  73. package/dist/.next/server/app/api/report/route.js.nft.json +1 -1
  74. package/dist/.next/server/app/api/report/route_client-reference-manifest.js +1 -1
  75. package/dist/.next/server/app/api/services/route.js +1 -1
  76. package/dist/.next/server/app/api/services/route.js.nft.json +1 -1
  77. package/dist/.next/server/app/api/services/route_client-reference-manifest.js +1 -1
  78. package/dist/.next/server/app/api/status/route.js +1 -1
  79. package/dist/.next/server/app/api/status/route.js.nft.json +1 -1
  80. package/dist/.next/server/app/api/status/route_client-reference-manifest.js +1 -1
  81. package/dist/.next/server/app/connections/page.js +2 -2
  82. package/dist/.next/server/app/connections/page.js.nft.json +1 -1
  83. package/dist/.next/server/app/connections/page_client-reference-manifest.js +1 -1
  84. package/dist/.next/server/app/connections.html +1 -1
  85. package/dist/.next/server/app/connections.meta +8 -0
  86. package/dist/.next/server/app/connections.rsc +5 -5
  87. package/dist/.next/server/app/dashboard/page.js +2 -2
  88. package/dist/.next/server/app/dashboard/page.js.nft.json +1 -1
  89. package/dist/.next/server/app/dashboard/page_client-reference-manifest.js +1 -1
  90. package/dist/.next/server/app/dashboard.html +1 -1
  91. package/dist/.next/server/app/dashboard.meta +8 -0
  92. package/dist/.next/server/app/dashboard.rsc +4 -4
  93. package/dist/.next/server/app/discoveries/page.js +2 -2
  94. package/dist/.next/server/app/discoveries/page.js.nft.json +1 -1
  95. package/dist/.next/server/app/discoveries/page_client-reference-manifest.js +1 -1
  96. package/dist/.next/server/app/discoveries.html +1 -1
  97. package/dist/.next/server/app/discoveries.meta +8 -0
  98. package/dist/.next/server/app/discoveries.rsc +5 -5
  99. package/dist/.next/server/app/expiry/page.js +2 -2
  100. package/dist/.next/server/app/expiry/page.js.nft.json +1 -1
  101. package/dist/.next/server/app/expiry/page_client-reference-manifest.js +1 -1
  102. package/dist/.next/server/app/expiry.html +1 -1
  103. package/dist/.next/server/app/expiry.meta +8 -0
  104. package/dist/.next/server/app/expiry.rsc +4 -4
  105. package/dist/.next/server/app/fleet/page.js +2 -2
  106. package/dist/.next/server/app/fleet/page.js.nft.json +1 -1
  107. package/dist/.next/server/app/fleet/page_client-reference-manifest.js +1 -1
  108. package/dist/.next/server/app/fleet.html +1 -1
  109. package/dist/.next/server/app/fleet.meta +8 -0
  110. package/dist/.next/server/app/fleet.rsc +4 -4
  111. package/dist/.next/server/app/home/page.js +2 -2
  112. package/dist/.next/server/app/home/page.js.nft.json +1 -1
  113. package/dist/.next/server/app/home/page_client-reference-manifest.js +1 -1
  114. package/dist/.next/server/app/home.html +1 -1
  115. package/dist/.next/server/app/home.meta +8 -0
  116. package/dist/.next/server/app/home.rsc +4 -4
  117. package/dist/.next/server/app/legal/privacy/page.js +2 -2
  118. package/dist/.next/server/app/legal/privacy/page.js.nft.json +1 -1
  119. package/dist/.next/server/app/legal/privacy/page_client-reference-manifest.js +1 -1
  120. package/dist/.next/server/app/legal/terms/page.js +2 -2
  121. package/dist/.next/server/app/legal/terms/page.js.nft.json +1 -1
  122. package/dist/.next/server/app/legal/terms/page_client-reference-manifest.js +1 -1
  123. package/dist/.next/server/app/log/page.js +2 -2
  124. package/dist/.next/server/app/log/page.js.nft.json +1 -1
  125. package/dist/.next/server/app/log/page_client-reference-manifest.js +1 -1
  126. package/dist/.next/server/app/log.html +1 -1
  127. package/dist/.next/server/app/log.meta +8 -0
  128. package/dist/.next/server/app/log.rsc +5 -5
  129. package/dist/.next/server/app/page.js +2 -2
  130. package/dist/.next/server/app/page.js.nft.json +1 -1
  131. package/dist/.next/server/app/page_client-reference-manifest.js +1 -1
  132. package/dist/.next/server/app/projects/page.js +2 -2
  133. package/dist/.next/server/app/projects/page.js.nft.json +1 -1
  134. package/dist/.next/server/app/projects/page_client-reference-manifest.js +1 -1
  135. package/dist/.next/server/app/projects.html +1 -1
  136. package/dist/.next/server/app/projects.meta +8 -0
  137. package/dist/.next/server/app/projects.rsc +5 -5
  138. package/dist/.next/server/app/radar/page.js +2 -65
  139. package/dist/.next/server/app/radar/page.js.nft.json +1 -1
  140. package/dist/.next/server/app/radar/page_client-reference-manifest.js +1 -1
  141. package/dist/.next/server/app/radar.html +1 -1
  142. package/dist/.next/server/app/radar.meta +8 -0
  143. package/dist/.next/server/app/radar.rsc +5 -5
  144. package/dist/.next/server/app/report/page.js +2 -2
  145. package/dist/.next/server/app/report/page.js.nft.json +1 -1
  146. package/dist/.next/server/app/report/page_client-reference-manifest.js +1 -1
  147. package/dist/.next/server/app/report.html +1 -1
  148. package/dist/.next/server/app/report.meta +8 -0
  149. package/dist/.next/server/app/report.rsc +5 -5
  150. package/dist/.next/server/app/settings/page.js +2 -2
  151. package/dist/.next/server/app/settings/page.js.nft.json +1 -1
  152. package/dist/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  153. package/dist/.next/server/app/settings.html +1 -1
  154. package/dist/.next/server/app/settings.meta +8 -0
  155. package/dist/.next/server/app/settings.rsc +5 -5
  156. package/dist/.next/server/app/sites/page.js +2 -2
  157. package/dist/.next/server/app/sites/page.js.nft.json +1 -1
  158. package/dist/.next/server/app/sites/page_client-reference-manifest.js +1 -1
  159. package/dist/.next/server/app/sites.html +1 -1
  160. package/dist/.next/server/app/sites.meta +8 -0
  161. package/dist/.next/server/app/sites.rsc +5 -5
  162. package/dist/.next/server/app/welcome/page.js +2 -2
  163. package/dist/.next/server/app/welcome/page.js.nft.json +1 -1
  164. package/dist/.next/server/app/welcome/page_client-reference-manifest.js +1 -1
  165. package/dist/.next/server/app/welcome.html +1 -1
  166. package/dist/.next/server/app/welcome.meta +8 -0
  167. package/dist/.next/server/app/welcome.rsc +5 -5
  168. package/dist/.next/server/app-paths-manifest.json +17 -17
  169. package/dist/.next/server/chunks/1155.js +1 -1
  170. package/dist/.next/server/chunks/1232.js +1 -0
  171. package/dist/.next/server/chunks/2346.js +1 -1
  172. package/dist/.next/server/chunks/2465.js +64 -1
  173. package/dist/.next/server/chunks/2817.js +1 -1
  174. package/dist/.next/server/chunks/3897.js +22 -0
  175. package/dist/.next/server/chunks/4134.js +1 -1
  176. package/dist/.next/server/chunks/5277.js +1 -0
  177. package/dist/.next/server/chunks/5611.js +1 -1
  178. package/dist/.next/server/chunks/572.js +1 -1
  179. package/dist/.next/server/chunks/6992.js +1 -1
  180. package/dist/.next/server/chunks/7511.js +1 -1
  181. package/dist/.next/server/chunks/7719.js +1 -1
  182. package/dist/.next/server/chunks/8150.js +1 -1
  183. package/dist/.next/server/chunks/8549.js +1 -1
  184. package/dist/.next/server/chunks/876.js +1 -1
  185. package/dist/.next/server/chunks/9170.js +1 -1
  186. package/dist/.next/server/chunks/9655.js +11 -0
  187. package/dist/.next/server/middleware-build-manifest.js +1 -1
  188. package/dist/.next/server/middleware-manifest.json +5 -5
  189. package/dist/.next/server/pages/404.html +1 -1
  190. package/dist/.next/server/pages/500.html +1 -1
  191. package/dist/.next/server/pages/_document.js.nft.json +1 -1
  192. package/dist/.next/server/pages/_error.js +3 -3
  193. package/dist/.next/server/pages/_error.js.nft.json +1 -1
  194. package/dist/.next/server/pages-manifest.json +1 -1
  195. package/dist/.next/server/server-reference-manifest.json +1 -1
  196. package/dist/.next/static/chunks/1255-5cd2fe06309409a0.js +1 -0
  197. package/dist/.next/static/chunks/2619-3c9e02e22d10480a.js +1 -0
  198. package/dist/.next/static/chunks/3192-7e153722ff079fc6.js +1 -0
  199. package/dist/.next/static/chunks/5623-53fb7cea5de0afef.js +1 -0
  200. package/dist/.next/static/chunks/7897-52f8a153c1970ef0.js +1 -0
  201. package/dist/.next/static/chunks/8050-6c17ccfd85ac3208.js +1 -0
  202. package/dist/.next/static/chunks/app/ahead/page-f5789a03967af6e1.js +1 -0
  203. package/dist/.next/static/chunks/app/connections/page-5b833f9485623b92.js +1 -0
  204. package/dist/.next/static/chunks/app/discoveries/{page-52696e6ee0c8d3d5.js → page-337bb60e4cbdcebb.js} +1 -1
  205. package/dist/.next/static/chunks/app/{error-37987420de14c10c.js → error-b32d8c6d4bfa070e.js} +1 -1
  206. package/dist/.next/static/chunks/app/{layout-d14e087b541b48b1.js → layout-0f3f0098b5d1e6be.js} +1 -1
  207. package/dist/.next/static/chunks/app/log/page-1711fe02581c58e8.js +1 -0
  208. package/dist/.next/static/chunks/app/projects/page-b05c7b0c3284db79.js +1 -0
  209. package/dist/.next/static/chunks/app/radar/page-2c972e78ae153706.js +1 -0
  210. package/dist/.next/static/chunks/app/report/page-6bd98ca320f3730c.js +1 -0
  211. package/dist/.next/static/chunks/app/settings/{page-a38c457b7c57567b.js → page-d50e8193d000c9be.js} +1 -1
  212. package/dist/.next/static/chunks/app/sites/page-80cc0a08ae2339a8.js +1 -0
  213. package/dist/.next/static/chunks/app/welcome/{page-d26225bed7e1ad39.js → page-f2cd15c4b50942bc.js} +1 -1
  214. package/dist/.next/static/chunks/main-8e42304858de4a63.js +1 -0
  215. package/dist/.next/static/css/5ddef273a3ac3217.css +1 -0
  216. package/dist/.next/static/css/fbb4cf81dde34731.css +1 -0
  217. package/dist/build-id.json +228 -228
  218. package/dist/node_modules/@next/env/package.json +1 -1
  219. package/dist/node_modules/next/dist/build/swc/index.js +1 -1
  220. package/dist/node_modules/next/dist/build/webpack-config.js +2 -2
  221. package/dist/node_modules/next/dist/compiled/hash.js/sha256/256.js +1 -0
  222. package/dist/node_modules/next/dist/compiled/hash.js/sha256/package.json +1 -0
  223. package/dist/node_modules/next/dist/compiled/next-server/app-page-experimental.runtime.prod.js +13 -13
  224. package/dist/node_modules/next/dist/compiled/next-server/app-page-turbo-experimental.runtime.prod.js +13 -13
  225. package/dist/node_modules/next/dist/compiled/next-server/app-page-turbo.runtime.prod.js +10 -10
  226. package/dist/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js +11 -11
  227. package/dist/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js +2 -2
  228. package/dist/node_modules/next/dist/compiled/next-server/pages-turbo.runtime.prod.js +9 -9
  229. package/dist/node_modules/next/dist/compiled/next-server/pages.runtime.prod.js +8 -8
  230. package/dist/node_modules/next/dist/lib/has-necessary-dependencies.js +2 -0
  231. package/dist/node_modules/next/dist/lib/verify-typescript-setup.js +19 -0
  232. package/dist/node_modules/next/dist/server/base-server.js +2 -5
  233. package/dist/node_modules/next/dist/server/dev/hot-reloader-turbopack.js +1 -1
  234. package/dist/node_modules/next/dist/server/dev/hot-reloader-webpack.js +1 -1
  235. package/dist/node_modules/next/dist/server/image-optimizer.js +65 -2
  236. package/dist/node_modules/next/dist/server/lib/app-info-log.js +1 -1
  237. package/dist/node_modules/next/dist/server/lib/incremental-cache/file-system-cache.js +197 -23
  238. package/dist/node_modules/next/dist/server/lib/incremental-cache/index.js +36 -17
  239. package/dist/node_modules/next/dist/server/lib/incremental-cache/memory-cache.external.js +3 -3
  240. package/dist/node_modules/next/dist/server/lib/incremental-cache/shared-cache-controls.external.js +14 -6
  241. package/dist/node_modules/next/dist/server/lib/match-next-data-pathname.js +3 -1
  242. package/dist/node_modules/next/dist/server/lib/node-fs-methods.js +14 -0
  243. package/dist/node_modules/next/dist/server/lib/route-cache-key.js +77 -0
  244. package/dist/node_modules/next/dist/server/lib/start-server.js +1 -1
  245. package/dist/node_modules/next/dist/server/next-server.js +8 -6
  246. package/dist/node_modules/next/dist/server/response-cache/index.js +31 -15
  247. package/dist/node_modules/next/dist/server/route-matcher-providers/app-page-route-matcher-provider.js +2 -2
  248. package/dist/node_modules/next/dist/server/route-modules/pages/pages-handler.js +6 -1
  249. package/dist/node_modules/next/dist/server/route-modules/route-module.js +9 -2
  250. package/dist/node_modules/next/dist/shared/lib/canary-only.js +1 -1
  251. package/dist/node_modules/next/dist/shared/lib/router/utils/app-paths.js +17 -1
  252. package/dist/node_modules/next/dist/shared/lib/router/utils/escape-path-delimiters.js +1 -1
  253. package/dist/node_modules/next/dist/telemetry/anonymous-meta.js +1 -1
  254. package/dist/node_modules/next/dist/telemetry/events/version.js +2 -2
  255. package/dist/node_modules/next/package.json +11 -11
  256. package/dist/node_modules/source-map-js/lib/quick-sort.js +10 -1
  257. package/dist/node_modules/source-map-js/lib/source-map-consumer.js +51 -3
  258. package/dist/node_modules/source-map-js/lib/source-map-generator.js +6 -4
  259. package/dist/node_modules/source-map-js/lib/source-node.js +7 -0
  260. package/dist/node_modules/source-map-js/package.json +1 -1
  261. package/dist/package.json +3 -3
  262. package/dist/shell/bin/af360-bridge.exe +0 -0
  263. package/docs/legal/PRIVACY.md +1 -1
  264. package/lib/mask.mjs +21 -1
  265. package/package.json +3 -3
  266. package/scripts/mcp-server.mjs +19 -9
  267. package/shell/bin/af360-bridge.exe +0 -0
  268. package/dist/.next/server/chunks/1331.js +0 -22
  269. package/dist/.next/server/chunks/6584.js +0 -1
  270. package/dist/.next/server/chunks/8134.js +0 -11
  271. package/dist/.next/server/chunks/9946.js +0 -1
  272. package/dist/.next/static/chunks/1255-612df69cb02f2021.js +0 -1
  273. package/dist/.next/static/chunks/1681-b233404f9ec2fc2e.js +0 -1
  274. package/dist/.next/static/chunks/2036-e29441d605c493a4.js +0 -1
  275. package/dist/.next/static/chunks/3192-6b341d547a49fa85.js +0 -1
  276. package/dist/.next/static/chunks/5623-ec4f1a6f7695d8d1.js +0 -1
  277. package/dist/.next/static/chunks/7897-6e6c509aea495560.js +0 -1
  278. package/dist/.next/static/chunks/app/ahead/page-e72bed448dd40bd5.js +0 -1
  279. package/dist/.next/static/chunks/app/connections/page-5d6cae02e6f2b49a.js +0 -1
  280. package/dist/.next/static/chunks/app/log/page-45b4cfd8f1a29d09.js +0 -1
  281. package/dist/.next/static/chunks/app/projects/page-75a41d4a90675d93.js +0 -1
  282. package/dist/.next/static/chunks/app/radar/page-4b4aad549dffcd3a.js +0 -1
  283. package/dist/.next/static/chunks/app/report/page-145496e8f0d5bc86.js +0 -1
  284. package/dist/.next/static/chunks/app/sites/page-96a7dcf3c1e9aa19.js +0 -1
  285. package/dist/.next/static/chunks/main-6828c74376f2b965.js +0 -1
  286. package/dist/.next/static/css/94d302c686de7e23.css +0 -1
  287. package/dist/.next/static/css/9b639a814d15c5ff.css +0 -1
  288. /package/dist/.next/static/{0b943e6aa8d5ffe860588 → be31a391928486d5659f1}/_buildManifest.js +0 -0
  289. /package/dist/.next/static/{0b943e6aa8d5ffe860588 → be31a391928486d5659f1}/_ssgManifest.js +0 -0
@@ -18,6 +18,8 @@ async function hasNecessaryDependencies(baseDir, requiredPackages) {
18
18
  try {
19
19
  const pkgPath = await _fs.promises.realpath((0, _resolvefrom.resolveFrom)(baseDir, `${p.pkg}/package.json`));
20
20
  const pkgDir = (0, _path.dirname)(pkgPath);
21
+ // Default to the package.json, if the file we want isn't there we can still read the package.json
22
+ resolutions.set((0, _path.join)(p.pkg, 'package.json'), pkgPath);
21
23
  if (p.exportsRestrict) {
22
24
  const fileNameToVerify = (0, _path.relative)(p.pkg, p.file);
23
25
  if (fileNameToVerify) {
@@ -97,6 +97,25 @@ async function verifyTypeScriptSetup({ dir, distDir, cacheDir, intentDirs, tscon
97
97
  }
98
98
  // Ensure TypeScript and necessary `@types/*` are installed:
99
99
  let deps = await (0, _hasnecessarydependencies.hasNecessaryDependencies)(dir, requiredPackages);
100
+ // TypeScript 7's native compiler no longer ships the JavaScript compiler API
101
+ // (`typescript/lib/typescript.js`) that Next.js loads via `require('typescript')`.
102
+ // This causes surprising errors so proactively reject it.
103
+ const installedTypescriptPackageJsonPath = deps.resolved.get(_path.default.join('typescript', 'package.json'));
104
+ if (installedTypescriptPackageJsonPath) {
105
+ const installedTypescriptVersion = require(installedTypescriptPackageJsonPath).version;
106
+ if (installedTypescriptVersion && // Use the lowest prerelease sentinel `7.0.0-0` so that TypeScript 7
107
+ // prereleases (e.g. `7.0.0-beta`, `7.0.0-rc`, or nightly `7.0.0-dev.*`
108
+ // builds published to the `next` dist-tag) are also rejected.
109
+ _semver.default.gte(installedTypescriptVersion, '7.0.0-0', {
110
+ includePrerelease: true
111
+ })) {
112
+ throw Object.defineProperty(new _compileerror.CompileError(`TypeScript ${installedTypescriptVersion} is not supported by this version of Next.js. ` + `The TypeScript 7 native compiler does not provide the JavaScript compiler API that Next.js requires. ` + `Install TypeScript 6 (e.g. ${(0, _picocolors.bold)('npm install --save-dev typescript@^6')}) or upgrade to a Next.js v16.2.11 or later to get support for TypeScript 7.`), "__NEXT_ERROR_CODE", {
113
+ value: "E798",
114
+ enumerable: false,
115
+ configurable: true
116
+ });
117
+ }
118
+ }
100
119
  if (((_deps_missing = deps.missing) == null ? void 0 : _deps_missing.length) > 0) {
101
120
  const missingPackages = deps.missing.map((pkg)=>({
102
121
  ...pkg,
@@ -417,9 +417,6 @@ class Server {
417
417
  // wait. Also we can't `await` in the constructor.
418
418
  void this.matchers.reload();
419
419
  this.setAssetPrefix(assetPrefix);
420
- this.responseCache = this.getResponseCache({
421
- dev
422
- });
423
420
  }
424
421
  getRouteMatchers() {
425
422
  // Create a new manifest loader that get's the manifests from the server.
@@ -1462,8 +1459,8 @@ class Server {
1462
1459
  const isAppPath = Array.isArray(appPaths);
1463
1460
  let page = pathname;
1464
1461
  if (isAppPath) {
1465
- // the last item in the array is the root page, if there are parallel routes
1466
- page = appPaths[appPaths.length - 1];
1462
+ // Use the same direct entry as the build, independent of manifest order.
1463
+ page = (0, _apppaths.selectAppPageEntry)(pathname, appPaths);
1467
1464
  }
1468
1465
  const result = await this.findPageComponents({
1469
1466
  locale: (0, _requestmeta.getRequestMeta)(ctx.req, 'locale'),
@@ -145,7 +145,7 @@ async function createHotReloaderTurbopack(opts, serverFields, distDir, resetFetc
145
145
  }
146
146
  const hasRewrites = opts.fsChecker.rewrites.afterFiles.length > 0 || opts.fsChecker.rewrites.beforeFiles.length > 0 || opts.fsChecker.rewrites.fallback.length > 0;
147
147
  const hotReloaderSpan = (0, _trace.trace)('hot-reloader', undefined, {
148
- version: "15.5.21"
148
+ version: "15.5.27"
149
149
  });
150
150
  // Ensure the hotReloaderSpan is flushed immediately as it's the parentSpan for all processing
151
151
  // of the current `next dev` invocation.
@@ -262,7 +262,7 @@ class HotReloaderWebpack {
262
262
  this.previewProps = previewProps;
263
263
  this.rewrites = rewrites;
264
264
  this.hotReloaderSpan = (0, _trace.trace)('hot-reloader', undefined, {
265
- version: "15.5.21"
265
+ version: "15.5.27"
266
266
  });
267
267
  // Ensure the hotReloaderSpan is flushed immediately as it's the parentSpan for all processing
268
268
  // of the current `next dev` invocation.
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  0 && (module.exports = {
6
6
  ImageError: null,
7
7
  ImageOptimizerCache: null,
8
+ canDecodeAvif: null,
8
9
  detectContentType: null,
9
10
  extractEtag: null,
10
11
  fetchExternalImage: null,
@@ -16,6 +17,7 @@ Object.defineProperty(exports, "__esModule", {
16
17
  getPreviouslyCachedImageOrNull: null,
17
18
  getSharp: null,
18
19
  imageOptimizer: null,
20
+ isAvifDecodeSafe: null,
19
21
  optimizeImage: null,
20
22
  sendResponse: null
21
23
  });
@@ -32,6 +34,9 @@ _export(exports, {
32
34
  ImageOptimizerCache: function() {
33
35
  return ImageOptimizerCache;
34
36
  },
37
+ canDecodeAvif: function() {
38
+ return canDecodeAvif;
39
+ },
35
40
  detectContentType: function() {
36
41
  return detectContentType;
37
42
  },
@@ -65,6 +70,9 @@ _export(exports, {
65
70
  imageOptimizer: function() {
66
71
  return imageOptimizer;
67
72
  },
73
+ isAvifDecodeSafe: function() {
74
+ return isAvifDecodeSafe;
75
+ },
68
76
  optimizeImage: function() {
69
77
  return optimizeImage;
70
78
  },
@@ -195,7 +203,31 @@ function getSharp(concurrency) {
195
203
  return _sharp;
196
204
  }
197
205
  try {
206
+ var _sharp_versions;
207
+ // eslint-disable-next-line @next/internal/typechecked-require -- sharp 0.34 and 0.35 type the module differently, see SharpModule
198
208
  _sharp = require('sharp');
209
+ _sharp.block({
210
+ operation: [
211
+ 'VipsForeignLoad'
212
+ ]
213
+ });
214
+ _sharp.unblock({
215
+ operation: [
216
+ 'VipsForeignLoadJpeg',
217
+ 'VipsForeignLoadNsgif',
218
+ 'VipsForeignLoadPng',
219
+ 'VipsForeignLoadSvg',
220
+ 'VipsForeignLoadTiff',
221
+ 'VipsForeignLoadWebp'
222
+ ]
223
+ });
224
+ if (isAvifDecodeSafe(((_sharp_versions = _sharp.versions) == null ? void 0 : _sharp_versions.heif) ?? null)) {
225
+ _sharp.unblock({
226
+ operation: [
227
+ 'VipsForeignLoadHeif'
228
+ ]
229
+ });
230
+ }
199
231
  if (_sharp && _sharp.concurrency() > 1) {
200
232
  // Reducing concurrency should reduce the memory usage too.
201
233
  // We more aggressively reduce in dev but also reduce in prod.
@@ -215,6 +247,34 @@ function getSharp(concurrency) {
215
247
  }
216
248
  return _sharp;
217
249
  }
250
+ function isAvifDecodeSafe(heifVersion) {
251
+ if (heifVersion === null) {
252
+ return false;
253
+ }
254
+ const [major = Number.NaN, minor = Number.NaN, patch = Number.NaN] = heifVersion.split('.').map((part)=>Number.parseInt(part, 10));
255
+ if (Number.isNaN(major) || Number.isNaN(minor) || Number.isNaN(patch)) {
256
+ return false;
257
+ }
258
+ return major > 1 || major === 1 && minor > 23 || major === 1 && minor === 23 && patch >= 2;
259
+ }
260
+ let _avifDecodeSafe = null;
261
+ function canDecodeAvif(concurrency) {
262
+ if (_avifDecodeSafe === null) {
263
+ let heifVersion = null;
264
+ try {
265
+ var _getSharp_versions;
266
+ // Custom libvips builds do not report dependency versions, so the
267
+ // absence of a heif version is treated as unsafe.
268
+ heifVersion = ((_getSharp_versions = getSharp(concurrency).versions) == null ? void 0 : _getSharp_versions.heif) ?? null;
269
+ } catch {
270
+ // Without sharp no AVIF can be decoded either, so treat it as unsafe
271
+ // and let the image pass through unoptimized.
272
+ heifVersion = null;
273
+ }
274
+ _avifDecodeSafe = isAvifDecodeSafe(heifVersion);
275
+ }
276
+ return _avifDecodeSafe;
277
+ }
218
278
  function getSupportedMimeType(options, accept = '') {
219
279
  const mimeType = (0, _accept.mediaType)(accept, options);
220
280
  return accept.includes(mimeType) ? mimeType : '';
@@ -809,7 +869,10 @@ async function optimizeImage({ buffer, contentType, quality, width, height, conc
809
869
  }
810
870
  if (contentType === AVIF) {
811
871
  transformer.avif({
812
- quality: Math.max(quality - 20, 1),
872
+ // Scale the quality to try and match webp. This ratio was derived
873
+ // from sharp's default 80 (webp) and 50 (avif), and then verified
874
+ // using dssim and ssimulacra2 visual quality tests.
875
+ quality: Math.max(Math.round(quality * (50 / 80)), 1),
813
876
  effort: 3
814
877
  });
815
878
  } else if (contentType === WEBP) {
@@ -980,7 +1043,7 @@ async function imageOptimizer(imageUpstream, paramsResult, nextConfig, opts) {
980
1043
  upstreamEtag
981
1044
  };
982
1045
  }
983
- if (BYPASS_TYPES.includes(upstreamType)) {
1046
+ if (BYPASS_TYPES.includes(upstreamType) || upstreamType === AVIF && !canDecodeAvif(nextConfig.experimental.imgOptConcurrency)) {
984
1047
  return {
985
1048
  buffer: upstreamBuffer,
986
1049
  contentType: upstreamType,
@@ -80,7 +80,7 @@ function logStartInfo({ networkUrl, appUrl, envInfo, experimentalFeatures, maxEx
80
80
  } else {
81
81
  bundlerSuffix = '';
82
82
  }
83
- _log.bootstrap(`${(0, _picocolors.bold)((0, _picocolors.purple)(`${_log.prefixes.ready} Next.js ${"15.5.21"}`))}${bundlerSuffix}`);
83
+ _log.bootstrap(`${(0, _picocolors.bold)((0, _picocolors.purple)(`${_log.prefixes.ready} Next.js ${"15.5.27"}`))}${bundlerSuffix}`);
84
84
  if (appUrl) {
85
85
  _log.bootstrap(`- Local: ${appUrl}`);
86
86
  }
@@ -8,6 +8,7 @@ Object.defineProperty(exports, "default", {
8
8
  return FileSystemCache;
9
9
  }
10
10
  });
11
+ const _routecachekey = require("../route-cache-key");
11
12
  const _responsecache = require("../../response-cache");
12
13
  const _path = /*#__PURE__*/ _interop_require_default(require("../../../shared/lib/isomorphic/path"));
13
14
  const _constants = require("../../../lib/constants");
@@ -21,6 +22,7 @@ function _interop_require_default(obj) {
21
22
  }
22
23
  class FileSystemCache {
23
24
  static #_ = this.debug = !!process.env.NEXT_PRIVATE_DEBUG_CACHE;
25
+ static #_2 = this.seedReads = new Map();
24
26
  constructor(ctx){
25
27
  this.fs = ctx.fs;
26
28
  this.flushToDisk = ctx.flushToDisk;
@@ -40,6 +42,32 @@ class FileSystemCache {
40
42
  }
41
43
  }
42
44
  resetRequestCache() {}
45
+ getSeedReadState(key) {
46
+ return FileSystemCache.seedReads.get(`${this.serverDistDir}:${key}`);
47
+ }
48
+ beginSeedRead(key) {
49
+ const stateKey = `${this.serverDistDir}:${key}`;
50
+ let state = FileSystemCache.seedReads.get(stateKey);
51
+ if (!state) {
52
+ state = {
53
+ readers: 0,
54
+ version: 0
55
+ };
56
+ FileSystemCache.seedReads.set(stateKey, state);
57
+ }
58
+ state.readers++;
59
+ return {
60
+ stateKey,
61
+ state,
62
+ version: state.version
63
+ };
64
+ }
65
+ finishSeedRead(stateKey, state) {
66
+ state.readers--;
67
+ if (state.readers === 0 && !state.promotion) {
68
+ FileSystemCache.seedReads.delete(stateKey);
69
+ }
70
+ }
43
71
  async revalidateTag(...args) {
44
72
  let [tags] = args;
45
73
  tags = typeof tags === 'string' ? [
@@ -58,10 +86,18 @@ class FileSystemCache {
58
86
  }
59
87
  }
60
88
  async get(...args) {
61
- var _FileSystemCache_memoryCache, _data_value, _data_value1, _data_value2, _data_value3;
89
+ var _FileSystemCache_memoryCache, _this_getSeedReadState, _data_value, _data_value1, _data_value2, _data_value3;
62
90
  const [key, ctx] = args;
63
91
  const { kind } = ctx;
92
+ let readKey = key;
93
+ let seedRead;
64
94
  let data = (_FileSystemCache_memoryCache = FileSystemCache.memoryCache) == null ? void 0 : _FileSystemCache_memoryCache.get(key);
95
+ const activePromotion = (_this_getSeedReadState = this.getSeedReadState(key)) == null ? void 0 : _this_getSeedReadState.promotion;
96
+ if (!data && activePromotion) {
97
+ var _FileSystemCache_memoryCache1;
98
+ await activePromotion;
99
+ data = (_FileSystemCache_memoryCache1 = FileSystemCache.memoryCache) == null ? void 0 : _FileSystemCache_memoryCache1.get(key);
100
+ }
65
101
  if (FileSystemCache.debug) {
66
102
  if (kind === _responsecache.IncrementalCacheKind.FETCH) {
67
103
  console.log('get', key, ctx.tags, kind, !!data);
@@ -69,16 +105,40 @@ class FileSystemCache {
69
105
  console.log('get', key, kind, !!data);
70
106
  }
71
107
  }
72
- // let's check the disk for seed data
108
+ const isResponse = kind === _responsecache.IncrementalCacheKind.PAGES || kind === _responsecache.IncrementalCacheKind.APP_PAGE || kind === _responsecache.IncrementalCacheKind.APP_ROUTE;
109
+ if (!data && isResponse && key.startsWith(`/${_routecachekey.ROUTE_CACHE_DIRECTORY}/`) && process.env.NEXT_RUNTIME !== 'edge') {
110
+ const primaryPath = this.getFilePath(kind === _responsecache.IncrementalCacheKind.APP_ROUTE ? `${key}.body` : `${key}.html`, kind);
111
+ if (!this.fs.existsSync(primaryPath)) {
112
+ const marker = key.indexOf('/$/');
113
+ if (marker !== -1) {
114
+ const legacyKey = key.slice(marker + 2);
115
+ const legacyMetaPath = this.getFilePath(`${legacyKey}${_constants.NEXT_META_SUFFIX}`, kind);
116
+ try {
117
+ var _meta_routeCache;
118
+ const meta = JSON.parse(this.fs.readFileSync(legacyMetaPath, 'utf8'));
119
+ const namespaceEnd = key.indexOf('/$/');
120
+ const ownerKey = meta.routeCache ? (0, _routecachekey.getRouteCacheKey)('/', meta.routeCache.owner) : undefined;
121
+ if (((_meta_routeCache = meta.routeCache) == null ? void 0 : _meta_routeCache.key) === key && (meta.routeCache.isFallback === Boolean(ctx.isFallback) || // PPR also reads fallback shells through ordinary response and
122
+ // navigation resume-data lookups, which set isFallback: false.
123
+ kind === _responsecache.IncrementalCacheKind.APP_PAGE && ctx.isRoutePPREnabled && meta.postponed != null) && (ownerKey == null ? void 0 : ownerKey.slice(0, ownerKey.indexOf('/$/'))) === key.slice(0, namespaceEnd)) {
124
+ readKey = legacyKey;
125
+ seedRead = this.beginSeedRead(key);
126
+ }
127
+ } catch {}
128
+ }
129
+ }
130
+ }
131
+ // Check the scoped disk entry first, or a verified immutable build seed
132
+ // only when its scoped primary payload is genuinely absent.
73
133
  if (!data && process.env.NEXT_RUNTIME !== 'edge') {
74
134
  try {
75
135
  if (kind === _responsecache.IncrementalCacheKind.APP_ROUTE) {
76
- const filePath = this.getFilePath(`${key}.body`, _responsecache.IncrementalCacheKind.APP_ROUTE);
136
+ const filePath = this.getFilePath(`${readKey}.body`, _responsecache.IncrementalCacheKind.APP_ROUTE);
77
137
  const fileData = await this.fs.readFile(filePath);
78
138
  const { mtime } = await this.fs.stat(filePath);
79
139
  const meta = JSON.parse(await this.fs.readFile(filePath.replace(/\.body$/, _constants.NEXT_META_SUFFIX), 'utf8'));
80
140
  data = {
81
- lastModified: mtime.getTime(),
141
+ lastModified: meta.routeCacheLastModified ?? mtime.getTime(),
82
142
  value: {
83
143
  kind: _responsecache.CachedRouteKind.APP_ROUTE,
84
144
  body: fileData,
@@ -87,7 +147,7 @@ class FileSystemCache {
87
147
  }
88
148
  };
89
149
  } else {
90
- const filePath = this.getFilePath(kind === _responsecache.IncrementalCacheKind.FETCH ? key : `${key}.html`, kind);
150
+ const filePath = this.getFilePath(kind === _responsecache.IncrementalCacheKind.FETCH ? readKey : `${readKey}.html`, kind);
91
151
  const fileData = await this.fs.readFile(filePath, 'utf8');
92
152
  const { mtime } = await this.fs.stat(filePath);
93
153
  if (kind === _responsecache.IncrementalCacheKind.FETCH) {
@@ -119,12 +179,10 @@ class FileSystemCache {
119
179
  }
120
180
  }
121
181
  } else if (kind === _responsecache.IncrementalCacheKind.APP_PAGE) {
122
- // We try to load the metadata file, but if it fails, we don't
123
- // error. We also don't load it if this is a fallback.
124
- let meta;
125
- try {
126
- meta = JSON.parse(await this.fs.readFile(filePath.replace(/\.html$/, _constants.NEXT_META_SUFFIX), 'utf8'));
127
- } catch {}
182
+ // Metadata is required for both normal entries and fallback shells.
183
+ // Promoted entries publish their primary payload last, so a missing
184
+ // sidecar means the scoped entry is incomplete.
185
+ const meta = JSON.parse(await this.fs.readFile(filePath.replace(/\.html$/, _constants.NEXT_META_SUFFIX), 'utf8'));
128
186
  let maybeSegmentData;
129
187
  if (meta == null ? void 0 : meta.segmentPaths) {
130
188
  // Collect all the segment data for this page.
@@ -134,7 +192,7 @@ class FileSystemCache {
134
192
  // identical regardless.
135
193
  const segmentData = new Map();
136
194
  maybeSegmentData = segmentData;
137
- const segmentsDir = key + _constants.RSC_SEGMENTS_DIR_SUFFIX;
195
+ const segmentsDir = readKey + _constants.RSC_SEGMENTS_DIR_SUFFIX;
138
196
  await Promise.all(meta.segmentPaths.map(async (segmentPath)=>{
139
197
  const segmentDataFilePath = this.getFilePath(segmentsDir + segmentPath + _constants.RSC_SEGMENT_SUFFIX, _responsecache.IncrementalCacheKind.APP_PAGE);
140
198
  try {
@@ -148,10 +206,10 @@ class FileSystemCache {
148
206
  }
149
207
  let rscData;
150
208
  if (!ctx.isFallback) {
151
- rscData = await this.fs.readFile(this.getFilePath(`${key}${ctx.isRoutePPREnabled ? _constants.RSC_PREFETCH_SUFFIX : _constants.RSC_SUFFIX}`, _responsecache.IncrementalCacheKind.APP_PAGE));
209
+ rscData = await this.fs.readFile(this.getFilePath(`${readKey}${ctx.isRoutePPREnabled ? _constants.RSC_PREFETCH_SUFFIX : _constants.RSC_SUFFIX}`, _responsecache.IncrementalCacheKind.APP_PAGE));
152
210
  }
153
211
  data = {
154
- lastModified: mtime.getTime(),
212
+ lastModified: meta.routeCacheLastModified ?? mtime.getTime(),
155
213
  value: {
156
214
  kind: _responsecache.CachedRouteKind.APP_PAGE,
157
215
  html: fileData,
@@ -163,13 +221,13 @@ class FileSystemCache {
163
221
  }
164
222
  };
165
223
  } else if (kind === _responsecache.IncrementalCacheKind.PAGES) {
166
- let meta;
224
+ const meta = JSON.parse(await this.fs.readFile(filePath.replace(/\.html$/, _constants.NEXT_META_SUFFIX), 'utf8'));
167
225
  let pageData = {};
168
226
  if (!ctx.isFallback) {
169
- pageData = JSON.parse(await this.fs.readFile(this.getFilePath(`${key}${_constants.NEXT_DATA_SUFFIX}`, _responsecache.IncrementalCacheKind.PAGES), 'utf8'));
227
+ pageData = JSON.parse(await this.fs.readFile(this.getFilePath(`${readKey}${_constants.NEXT_DATA_SUFFIX}`, _responsecache.IncrementalCacheKind.PAGES), 'utf8'));
170
228
  }
171
229
  data = {
172
- lastModified: mtime.getTime(),
230
+ lastModified: meta.routeCacheLastModified ?? mtime.getTime(),
173
231
  value: {
174
232
  kind: _responsecache.CachedRouteKind.PAGES,
175
233
  html: fileData,
@@ -187,10 +245,15 @@ class FileSystemCache {
187
245
  }
188
246
  }
189
247
  if (data) {
190
- var _FileSystemCache_memoryCache1;
191
- (_FileSystemCache_memoryCache1 = FileSystemCache.memoryCache) == null ? void 0 : _FileSystemCache_memoryCache1.set(key, data);
248
+ if (!seedRead) {
249
+ var _FileSystemCache_memoryCache2;
250
+ (_FileSystemCache_memoryCache2 = FileSystemCache.memoryCache) == null ? void 0 : _FileSystemCache_memoryCache2.set(key, data);
251
+ }
192
252
  }
193
253
  } catch {
254
+ if (seedRead) {
255
+ this.finishSeedRead(seedRead.stateKey, seedRead.state);
256
+ }
194
257
  return null;
195
258
  }
196
259
  }
@@ -206,6 +269,9 @@ class FileSystemCache {
206
269
  // had a tag revalidated, if we want to be a background
207
270
  // revalidation instead we return data.lastModified = -1
208
271
  if ((0, _tagsmanifestexternal.isStale)(cacheTags, (data == null ? void 0 : data.lastModified) || Date.now())) {
272
+ if (seedRead) {
273
+ this.finishSeedRead(seedRead.stateKey, seedRead.state);
274
+ }
209
275
  return null;
210
276
  }
211
277
  }
@@ -228,10 +294,92 @@ class FileSystemCache {
228
294
  data = undefined;
229
295
  }
230
296
  }
297
+ if (seedRead && data) {
298
+ const { stateKey, state, version } = seedRead;
299
+ try {
300
+ if (state.version === version) {
301
+ var _FileSystemCache_memoryCache3;
302
+ await this.promoteSeed(key, readKey, data, ctx, stateKey, state, version);
303
+ if (state.version === version && !((_FileSystemCache_memoryCache3 = FileSystemCache.memoryCache) == null ? void 0 : _FileSystemCache_memoryCache3.get(key))) {
304
+ var _FileSystemCache_memoryCache4;
305
+ (_FileSystemCache_memoryCache4 = FileSystemCache.memoryCache) == null ? void 0 : _FileSystemCache_memoryCache4.set(key, data);
306
+ }
307
+ }
308
+ } finally{
309
+ this.finishSeedRead(stateKey, state);
310
+ }
311
+ }
231
312
  return data ?? null;
232
313
  }
314
+ async promoteSeed(key, seedKey, data, ctx, stateKey, state, version) {
315
+ const writeFileAtomic = this.fs.writeFileAtomic;
316
+ if (!this.flushToDisk || !writeFileAtomic || !data.value) return;
317
+ if (state.promotion) {
318
+ await state.promotion;
319
+ return;
320
+ }
321
+ const promotion = (async ()=>{
322
+ const value = data.value;
323
+ if (!value || state.version !== version || value.kind !== _responsecache.CachedRouteKind.PAGES && value.kind !== _responsecache.CachedRouteKind.APP_PAGE && value.kind !== _responsecache.CachedRouteKind.APP_ROUTE) {
324
+ return;
325
+ }
326
+ const kind = ctx.kind;
327
+ const primaryPath = this.getFilePath(value.kind === _responsecache.CachedRouteKind.APP_ROUTE ? `${key}.body` : `${key}.html`, kind);
328
+ if (this.fs.existsSync(primaryPath)) return;
329
+ const seedPrimaryPath = this.getFilePath(value.kind === _responsecache.CachedRouteKind.APP_ROUTE ? `${seedKey}.body` : `${seedKey}.html`, kind);
330
+ const seedMetaPath = seedPrimaryPath.replace(value.kind === _responsecache.CachedRouteKind.APP_ROUTE ? /\.body$/ : /\.html$/, _constants.NEXT_META_SUFFIX);
331
+ const meta = JSON.parse(await this.fs.readFile(seedMetaPath, 'utf8'));
332
+ meta.routeCacheLastModified = data.lastModified;
333
+ // Copy every ancillary seed file first. The scoped primary payload is
334
+ // the publication marker and is written only after metadata is complete.
335
+ const ancillaryFiles = [];
336
+ if (value.kind === _responsecache.CachedRouteKind.PAGES && !ctx.isFallback) {
337
+ ancillaryFiles.push({
338
+ path: this.getFilePath(`${key}${_constants.NEXT_DATA_SUFFIX}`, kind),
339
+ data: await this.fs.readFile(this.getFilePath(`${seedKey}${_constants.NEXT_DATA_SUFFIX}`, kind))
340
+ });
341
+ } else if (value.kind === _responsecache.CachedRouteKind.APP_PAGE) {
342
+ const rscSuffix = ctx.isRoutePPREnabled ? _constants.RSC_PREFETCH_SUFFIX : _constants.RSC_SUFFIX;
343
+ const seedRscPath = this.getFilePath(`${seedKey}${rscSuffix}`, kind);
344
+ // Next 15 PPR shells can include a full prefetch payload even when
345
+ // first read as a fallback. Preserve it for subsequent ordinary reads.
346
+ if (!ctx.isFallback || ctx.isRoutePPREnabled && this.fs.existsSync(seedRscPath)) {
347
+ ancillaryFiles.push({
348
+ path: this.getFilePath(`${key}${rscSuffix}`, kind),
349
+ data: await this.fs.readFile(seedRscPath)
350
+ });
351
+ }
352
+ ancillaryFiles.push(...await Promise.all((meta.segmentPaths ?? []).map(async (segmentPath)=>({
353
+ path: this.getFilePath(key + _constants.RSC_SEGMENTS_DIR_SUFFIX + segmentPath + _constants.RSC_SEGMENT_SUFFIX, kind),
354
+ data: await this.fs.readFile(this.getFilePath(seedKey + _constants.RSC_SEGMENTS_DIR_SUFFIX + segmentPath + _constants.RSC_SEGMENT_SUFFIX, kind))
355
+ }))));
356
+ }
357
+ const writer = new _multifilewriter.MultiFileWriter(this.fs);
358
+ for (const file of ancillaryFiles)writer.append(file.path, file.data);
359
+ await writer.wait();
360
+ if (state.version !== version) return;
361
+ const metaPath = primaryPath.replace(value.kind === _responsecache.CachedRouteKind.APP_ROUTE ? /\.body$/ : /\.html$/, _constants.NEXT_META_SUFFIX);
362
+ await this.fs.mkdir(_path.default.dirname(metaPath));
363
+ await this.fs.writeFile(metaPath, JSON.stringify(meta));
364
+ if (state.version !== version || this.fs.existsSync(primaryPath)) return;
365
+ await writeFileAtomic.call(this.fs, primaryPath, await this.fs.readFile(seedPrimaryPath));
366
+ })();
367
+ state.promotion = promotion.catch((error)=>{
368
+ if (FileSystemCache.debug) {
369
+ console.log('FileSystemCache: failed to promote build seed', error);
370
+ }
371
+ });
372
+ try {
373
+ await state.promotion;
374
+ } finally{
375
+ if (state.promotion) state.promotion = undefined;
376
+ if (state.readers === 0) FileSystemCache.seedReads.delete(stateKey);
377
+ }
378
+ }
233
379
  async set(key, data, ctx) {
234
380
  var _FileSystemCache_memoryCache;
381
+ const seedState = this.getSeedReadState(key);
382
+ if (seedState) seedState.version++;
235
383
  (_FileSystemCache_memoryCache = FileSystemCache.memoryCache) == null ? void 0 : _FileSystemCache_memoryCache.set(key, {
236
384
  value: data,
237
385
  lastModified: Date.now()
@@ -240,6 +388,7 @@ class FileSystemCache {
240
388
  console.log('set', key);
241
389
  }
242
390
  if (!this.flushToDisk || !data) return;
391
+ await (seedState == null ? void 0 : seedState.promotion);
243
392
  // Create a new writer that will prepare to write all the files to disk
244
393
  // after their containing directory is created.
245
394
  const writer = new _multifilewriter.MultiFileWriter(this.fs);
@@ -279,6 +428,14 @@ class FileSystemCache {
279
428
  segmentPaths
280
429
  };
281
430
  writer.append(htmlPath.replace(/\.html$/, _constants.NEXT_META_SUFFIX), JSON.stringify(meta));
431
+ } else {
432
+ const meta = {
433
+ headers: data.headers,
434
+ status: data.status,
435
+ postponed: undefined,
436
+ segmentPaths: undefined
437
+ };
438
+ writer.append(htmlPath.replace(/\.html$/, _constants.NEXT_META_SUFFIX), JSON.stringify(meta));
282
439
  }
283
440
  } else if (data.kind === _responsecache.CachedRouteKind.FETCH) {
284
441
  const filePath = this.getFilePath(key, _responsecache.IncrementalCacheKind.FETCH);
@@ -290,18 +447,22 @@ class FileSystemCache {
290
447
  // Wait for all FS operations to complete.
291
448
  await writer.wait();
292
449
  }
293
- getFilePath(pathname, kind) {
450
+ getFilePath(key, kind) {
451
+ let rootDir;
294
452
  switch(kind){
295
453
  case _responsecache.IncrementalCacheKind.FETCH:
296
454
  // we store in .next/cache/fetch-cache so it can be persisted
297
455
  // across deploys
298
- return _path.default.join(this.serverDistDir, '..', 'cache', 'fetch-cache', pathname);
456
+ rootDir = _path.default.join(this.serverDistDir, '..', 'cache', 'fetch-cache');
457
+ break;
299
458
  case _responsecache.IncrementalCacheKind.PAGES:
300
- return _path.default.join(this.serverDistDir, 'pages', pathname);
459
+ rootDir = _path.default.join(this.serverDistDir, 'pages');
460
+ break;
301
461
  case _responsecache.IncrementalCacheKind.IMAGE:
302
462
  case _responsecache.IncrementalCacheKind.APP_PAGE:
303
463
  case _responsecache.IncrementalCacheKind.APP_ROUTE:
304
- return _path.default.join(this.serverDistDir, 'app', pathname);
464
+ rootDir = _path.default.join(this.serverDistDir, 'app');
465
+ break;
305
466
  default:
306
467
  throw Object.defineProperty(new Error(`Unexpected file path kind: ${kind}`), "__NEXT_ERROR_CODE", {
307
468
  value: "E479",
@@ -309,6 +470,19 @@ class FileSystemCache {
309
470
  configurable: true
310
471
  });
311
472
  }
473
+ // Scoped response artifacts live outside the compiled route and ASO files.
474
+ if ((kind === _responsecache.IncrementalCacheKind.PAGES || kind === _responsecache.IncrementalCacheKind.APP_PAGE || kind === _responsecache.IncrementalCacheKind.APP_ROUTE) && key.startsWith(`/${_routecachekey.ROUTE_CACHE_DIRECTORY}/`)) {
475
+ rootDir = _path.default.join(this.serverDistDir, '.');
476
+ }
477
+ const filePath = _path.default.join(rootDir, key);
478
+ if (!(filePath.startsWith(rootDir + _path.default.sep) || filePath === rootDir)) {
479
+ throw Object.defineProperty(new Error(`Invalid file path: ${filePath}`), "__NEXT_ERROR_CODE", {
480
+ value: "E799",
481
+ enumerable: false,
482
+ configurable: true
483
+ });
484
+ }
485
+ return filePath;
312
486
  }
313
487
  }
314
488