@farm.js/core 0.2.0-beta.1 → 0.2.0-beta.4

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 (691) hide show
  1. package/dist/THIRD-PARTY-LICENSES.md +3220 -0
  2. package/dist/after.cjs +3 -3
  3. package/dist/after.mjs +1 -1
  4. package/dist/{agent-mcp-handler-GDY5CPPW.mjs → agent-mcp-handler-BY7VJQ4W.mjs} +5 -5
  5. package/dist/agent-mcp-handler-S4UTE7NO.cjs +21 -0
  6. package/dist/{agent-mcp.d-CMGqpUbk.d.mts → agent-mcp.d-BdFnjlAT.d.mts} +1 -1
  7. package/dist/{agent-mcp.d-BdM0pIrD.d.ts → agent-mcp.d-CAwDC9y4.d.ts} +1 -1
  8. package/dist/agent-runtime.cjs +25 -22
  9. package/dist/agent-runtime.d.mts +1 -1
  10. package/dist/agent-runtime.d.ts +1 -1
  11. package/dist/agent-runtime.mjs +2 -2
  12. package/dist/analyzer-3AMJK27J.cjs +17 -0
  13. package/dist/{analyzer-RYSF2BM3.mjs → analyzer-K3S4YRAH.mjs} +3 -3
  14. package/dist/api/client.cjs +16 -16
  15. package/dist/api/client.mjs +1 -1
  16. package/dist/api/client.native.cjs +21 -18
  17. package/dist/api/client.native.mjs +1 -1
  18. package/dist/api/node.cjs +29 -26
  19. package/dist/api/node.d.mts +3 -3
  20. package/dist/api/node.d.ts +3 -3
  21. package/dist/api/node.mjs +1 -1
  22. package/dist/api/route-manager.cjs +45 -45
  23. package/dist/api/route-manager.d.mts +3 -3
  24. package/dist/api/route-manager.d.ts +3 -3
  25. package/dist/api/route-manager.mjs +4 -4
  26. package/dist/api/runtime.cjs +25 -25
  27. package/dist/api/runtime.d.mts +2 -2
  28. package/dist/api/runtime.d.ts +2 -2
  29. package/dist/api/runtime.mjs +1 -1
  30. package/dist/api.cjs +57 -57
  31. package/dist/api.d.mts +4 -4
  32. package/dist/api.d.ts +4 -4
  33. package/dist/api.mjs +5 -5
  34. package/dist/{app-manifest.d-BeDB2OVm.d.mts → app-manifest.d-COs1wBGz.d.mts} +1 -1
  35. package/dist/{app-manifest.d-COhjPgHn.d.ts → app-manifest.d-Dczk-fwt.d.ts} +1 -1
  36. package/dist/app-markdown-compiler-4RCCOTTF.cjs +33007 -0
  37. package/dist/app-markdown-compiler-OM2AMFRK.mjs +32402 -0
  38. package/dist/app-markdown.cjs +18 -16
  39. package/dist/app-markdown.d.mts +3 -3
  40. package/dist/app-markdown.d.ts +3 -3
  41. package/dist/app-markdown.mjs +8 -6
  42. package/dist/{app.d-CoY-zsJt.d.ts → app.d-DREl_yXh.d.ts} +26 -10
  43. package/dist/{app.d-DE5KNbmf.d.mts → app.d-LepnxO-5.d.mts} +26 -10
  44. package/dist/cache.cjs +8 -8
  45. package/dist/cache.mjs +1 -1
  46. package/dist/{chunk-AG27TI6Q.mjs → chunk-23NBOP43.mjs} +3 -0
  47. package/dist/{chunk-OLKYHTLN.cjs → chunk-25CHWAZY.cjs} +14 -10
  48. package/dist/{chunk-26WP75W5.cjs → chunk-27IPPPCV.cjs} +51 -40
  49. package/dist/{chunk-PHCJJJZV.cjs → chunk-2HC46EGU.cjs} +6 -2
  50. package/dist/{chunk-MF3IA2AW.cjs → chunk-2L4M6YUG.cjs} +6 -1
  51. package/dist/{chunk-YPAOC3FO.mjs → chunk-2ORWY3SE.mjs} +4 -4
  52. package/dist/{chunk-VGZIIOU6.cjs → chunk-2PSN2PUJ.cjs} +12 -8
  53. package/dist/{chunk-CIY74JLV.cjs → chunk-2RA2VIKN.cjs} +9 -5
  54. package/dist/{chunk-NZRAUCUL.cjs → chunk-2UV765GT.cjs} +26 -20
  55. package/dist/{chunk-A3LNXQJJ.cjs → chunk-2VLW3HWJ.cjs} +9 -2
  56. package/dist/{chunk-4EBC7EMW.cjs → chunk-323JTLXR.cjs} +6 -1
  57. package/dist/{chunk-7KJJ4SBS.cjs → chunk-32HGOX3M.cjs} +6 -1
  58. package/dist/{chunk-RKQOMG2X.cjs → chunk-3ACTVXZG.cjs} +9 -5
  59. package/dist/{chunk-N3H7UPBM.cjs → chunk-3EZHMZGD.cjs} +6 -1
  60. package/dist/{chunk-LQWIIBI2.cjs → chunk-3KLDTMIC.cjs} +6 -1
  61. package/dist/{chunk-OO7DYIJD.cjs → chunk-3YT7DIIS.cjs} +7 -1
  62. package/dist/{chunk-HR5GU4UU.cjs → chunk-4A6WSOZH.cjs} +55 -49
  63. package/dist/{chunk-E5UN4OWX.cjs → chunk-4JARM2QQ.cjs} +6 -1
  64. package/dist/{chunk-VGVRGGP4.cjs → chunk-4JCX33RZ.cjs} +13 -8
  65. package/dist/chunk-4RLFAN7T.cjs +6 -0
  66. package/dist/{chunk-OZUINP2P.cjs → chunk-4USE4SEU.cjs} +19 -15
  67. package/dist/{chunk-PENBZAHJ.cjs → chunk-57OAZCWQ.cjs} +6 -1
  68. package/dist/{chunk-TWFJJPE7.cjs → chunk-5BZ7PR3T.cjs} +42 -38
  69. package/dist/{chunk-JYQ6DGPW.cjs → chunk-5P3TZGS3.cjs} +52 -45
  70. package/dist/{chunk-2U2GRXP5.mjs → chunk-5UMPMVNF.mjs} +1 -1
  71. package/dist/{chunk-OZC2JPW6.cjs → chunk-5XYJ5KRN.cjs} +6 -1
  72. package/dist/{chunk-QKW6DLDT.cjs → chunk-5YT2ZSWS.cjs} +17 -13
  73. package/dist/{chunk-QCKSYYXK.cjs → chunk-63S7DAEG.cjs} +21 -17
  74. package/dist/{chunk-FDGYDQGL.cjs → chunk-66WIOZXX.cjs} +7 -1
  75. package/dist/{chunk-MHKPXX3J.cjs → chunk-6AUPJYHF.cjs} +13 -9
  76. package/dist/{chunk-DVJM55D2.cjs → chunk-6FIY4KBC.cjs} +6 -1
  77. package/dist/{chunk-TIZJYHB7.mjs → chunk-6IUWKO2Q.mjs} +15 -0
  78. package/dist/{chunk-VWIW47FW.cjs → chunk-6K7LEL2T.cjs} +6 -1
  79. package/dist/{chunk-UZCMMJJT.cjs → chunk-6NQ63L6N.cjs} +6 -1
  80. package/dist/{chunk-BTVDYS4B.cjs → chunk-6QCZWAGO.cjs} +6 -1
  81. package/dist/{chunk-RDADQG5S.cjs → chunk-6QWCFVGL.cjs} +14 -7
  82. package/dist/{chunk-JRGR5Z4K.cjs → chunk-6VC7NUY3.cjs} +6 -1
  83. package/dist/{chunk-CKPTIEDX.cjs → chunk-7BFFBYLN.cjs} +6 -1
  84. package/dist/{chunk-7Q7UB4TL.cjs → chunk-7GKZDRY2.cjs} +9 -5
  85. package/dist/{chunk-WP77JDKI.cjs → chunk-7JI7W2MD.cjs} +34 -30
  86. package/dist/{chunk-C7LCTVJ2.cjs → chunk-7JZVCHNF.cjs} +10 -6
  87. package/dist/{chunk-QZUCVJZJ.cjs → chunk-7M3X4CBY.cjs} +6 -1
  88. package/dist/{chunk-7JUIK547.cjs → chunk-7MQMWGTL.cjs} +6 -1
  89. package/dist/{chunk-PIUTGRDI.cjs → chunk-7O3YJ6NP.cjs} +6 -1
  90. package/dist/{chunk-SXCL2MIN.cjs → chunk-7V5MQSBL.cjs} +9 -1
  91. package/dist/{chunk-7U4XF76R.cjs → chunk-7ZDLE77P.cjs} +12 -8
  92. package/dist/{chunk-NU5XLYRN.cjs → chunk-A2ELHZBZ.cjs} +10 -1
  93. package/dist/{chunk-DMSXZNQR.cjs → chunk-ADCVSTFV.cjs} +18 -11
  94. package/dist/{chunk-ISSFWEPY.mjs → chunk-AGEBFYHF.mjs} +35 -18
  95. package/dist/{chunk-ND65INFS.cjs → chunk-AGT633OM.cjs} +27 -23
  96. package/dist/{chunk-WEZTGM7N.cjs → chunk-APKULXZV.cjs} +11 -9
  97. package/dist/chunk-AZJEQ5CR.cjs +6 -0
  98. package/dist/{chunk-ZMSVKVI3.cjs → chunk-B2VSX33T.cjs} +6 -1
  99. package/dist/{chunk-AQIRXBBY.cjs → chunk-B6JPBPBQ.cjs} +6 -1
  100. package/dist/{chunk-QBXS4TNG.mjs → chunk-BL54BTVJ.mjs} +1 -1
  101. package/dist/{chunk-W76C7TCW.cjs → chunk-BNVQSUZK.cjs} +6 -2
  102. package/dist/{chunk-MNUYXZV7.cjs → chunk-BNWADCG2.cjs} +6 -1
  103. package/dist/{chunk-CCAUIBIS.cjs → chunk-BRWSQDKO.cjs} +10 -1
  104. package/dist/{chunk-6BMAGVDI.cjs → chunk-C4DZAEVT.cjs} +48 -41
  105. package/dist/{chunk-KQS27YN7.cjs → chunk-C6DR4JAR.cjs} +14 -10
  106. package/dist/{chunk-Y3WG64CP.cjs → chunk-CH2JX3CM.cjs} +6 -1
  107. package/dist/{chunk-KQ6TYQU7.cjs → chunk-COMBIEAP.cjs} +44 -36
  108. package/dist/{chunk-YU2MNIIY.mjs → chunk-CRF5MOLO.mjs} +17 -4
  109. package/dist/{chunk-YUQUGVSV.cjs → chunk-CTTXHHZG.cjs} +50 -46
  110. package/dist/{chunk-FDZZ6K3N.cjs → chunk-CUW7K4AU.cjs} +14 -10
  111. package/dist/{chunk-NQ3Y6E2T.mjs → chunk-CV4MOEMO.mjs} +2 -2
  112. package/dist/chunk-CWSUKW2H.cjs +6 -0
  113. package/dist/{chunk-DZC2XGK4.mjs → chunk-D5OY5OKA.mjs} +132 -48
  114. package/dist/{chunk-T3SMMLSB.cjs → chunk-DB4NOIQC.cjs} +12 -8
  115. package/dist/{chunk-PKV3JGMS.mjs → chunk-DFLCEMQ3.mjs} +1 -1
  116. package/dist/{chunk-OWOUTKIJ.cjs → chunk-DQYMTSF3.cjs} +6 -1
  117. package/dist/{chunk-7V5M43ND.mjs → chunk-DVL3UVYT.mjs} +2 -2
  118. package/dist/{chunk-ZSVFI7JM.cjs → chunk-DVXT7RLV.cjs} +23 -18
  119. package/dist/{chunk-UNOXV37V.cjs → chunk-DYGHX2UR.cjs} +6 -1
  120. package/dist/{chunk-M3JYBZO2.cjs → chunk-E5AC7E25.cjs} +24 -20
  121. package/dist/{chunk-LSHX2H5G.cjs → chunk-EBE6BK54.cjs} +6 -1
  122. package/dist/{chunk-YNPVG2GG.mjs → chunk-EBVKVDQA.mjs} +1 -1
  123. package/dist/{chunk-WT6RAN2I.cjs → chunk-EGMJ5KEU.cjs} +6 -1
  124. package/dist/{chunk-22KXTL3I.cjs → chunk-EJLMRNSV.cjs} +24 -19
  125. package/dist/{chunk-RDNKQ5MK.cjs → chunk-EMM3YXXI.cjs} +19 -15
  126. package/dist/{chunk-EACD6ND7.cjs → chunk-ERSLQ4C7.cjs} +18 -11
  127. package/dist/{chunk-4WXNTAOM.mjs → chunk-EUVHELJL.mjs} +1 -1
  128. package/dist/{chunk-J6TZRYCO.cjs → chunk-F5JTXLS7.cjs} +6 -1
  129. package/dist/{chunk-FLKG2PYH.cjs → chunk-F5T55PYX.cjs} +103 -95
  130. package/dist/{chunk-N2ZMSSPP.cjs → chunk-FYVSAWJP.cjs} +77 -70
  131. package/dist/{chunk-HUGPJFOC.cjs → chunk-G22QP2MX.cjs} +9 -5
  132. package/dist/{chunk-PMJSG4JS.cjs → chunk-G5KGLMPN.cjs} +6 -1
  133. package/dist/{chunk-R5U7OIPI.cjs → chunk-GAII22G2.cjs} +6 -1
  134. package/dist/{chunk-6CTFVBAT.cjs → chunk-GKYOFMPQ.cjs} +6 -1
  135. package/dist/{chunk-JYT7AN37.cjs → chunk-GLP3ID53.cjs} +6 -1
  136. package/dist/{chunk-QBJ6N5MT.mjs → chunk-GN2RXH72.mjs} +1 -1
  137. package/dist/{chunk-RQRTH57V.cjs → chunk-GQONHUMI.cjs} +6 -1
  138. package/dist/{chunk-EOXPRC2C.cjs → chunk-GQQID5IB.cjs} +7 -1
  139. package/dist/{chunk-IUKBPBM7.cjs → chunk-GUDYDNKU.cjs} +6 -1
  140. package/dist/{chunk-6GJZJAED.mjs → chunk-GUNPDMSX.mjs} +1 -1
  141. package/dist/{chunk-KCJBIWBM.mjs → chunk-GVORDLLV.mjs} +1 -1
  142. package/dist/{chunk-ZZGQD3LL.mjs → chunk-GXWCR7PP.mjs} +11 -5
  143. package/dist/{chunk-VS7HLH4S.cjs → chunk-GYH2B4YQ.cjs} +12 -8
  144. package/dist/{chunk-IJPRCQHW.cjs → chunk-H3TYWCMG.cjs} +18 -14
  145. package/dist/{chunk-2OF5RPVU.cjs → chunk-H5AC3XSE.cjs} +18 -14
  146. package/dist/{chunk-ZIOFRBIU.cjs → chunk-H7INTSUK.cjs} +15 -9
  147. package/dist/{chunk-RFNQTQ44.cjs → chunk-HBRCMX24.cjs} +10 -5
  148. package/dist/{chunk-XRSNW4IU.mjs → chunk-HDZ2AMDD.mjs} +5 -0
  149. package/dist/{chunk-UA77C2ZA.cjs → chunk-HF3JJPH4.cjs} +58 -50
  150. package/dist/{chunk-CPMK7EFR.mjs → chunk-HFOME6I2.mjs} +7 -7
  151. package/dist/{chunk-XGL42MQ7.mjs → chunk-HIDZM23B.mjs} +1 -1
  152. package/dist/{chunk-T7UC2ORA.cjs → chunk-HP7QYVST.cjs} +7 -1
  153. package/dist/{chunk-JP5TWUK2.cjs → chunk-HSAHQBMG.cjs} +8 -4
  154. package/dist/{chunk-3BTN3NP7.cjs → chunk-I5PDHLKE.cjs} +6 -2
  155. package/dist/{chunk-L4B7PB3H.cjs → chunk-IASZIYNM.cjs} +1384 -757
  156. package/dist/{chunk-2RSVYJT6.cjs → chunk-IBZW57NW.cjs} +9 -5
  157. package/dist/{chunk-KORZ6PRE.cjs → chunk-IDUGG7VR.cjs} +6 -1
  158. package/dist/{chunk-6JHZPB52.cjs → chunk-IEZFFXSC.cjs} +10 -6
  159. package/dist/{chunk-VACYUMXW.cjs → chunk-IGA3OTFY.cjs} +37 -29
  160. package/dist/{chunk-4ZVKDHS6.cjs → chunk-IGBQSUT5.cjs} +55 -40
  161. package/dist/{chunk-OQOII62L.mjs → chunk-II4ENBE4.mjs} +1 -1
  162. package/dist/{chunk-JIBEFLQ7.cjs → chunk-IKYNDANT.cjs} +7 -1
  163. package/dist/{chunk-Z43CIBUR.cjs → chunk-IU4YTFFQ.cjs} +16 -12
  164. package/dist/{chunk-KBGZ5FD6.cjs → chunk-IVEV44O2.cjs} +6 -2
  165. package/dist/{chunk-MCSRMEQV.cjs → chunk-J2JMESBJ.cjs} +6 -1
  166. package/dist/{chunk-WMRGIQTA.cjs → chunk-J3RIMCBD.cjs} +6 -1
  167. package/dist/{chunk-N4AQNEXR.cjs → chunk-JIBZ6SCC.cjs} +6 -1
  168. package/dist/{chunk-IZYFP7IN.cjs → chunk-JOSR2E2C.cjs} +17 -13
  169. package/dist/{chunk-AOKXITZ6.cjs → chunk-JOZDAIKZ.cjs} +6 -1
  170. package/dist/{chunk-NG2EZ6QS.cjs → chunk-JYQMGMKT.cjs} +20 -6
  171. package/dist/{chunk-J6RFB324.cjs → chunk-JZCUDAH2.cjs} +6 -1
  172. package/dist/{chunk-ECVSRE4Y.mjs → chunk-K44IR6WC.mjs} +1 -1
  173. package/dist/{chunk-SUCDVKUB.cjs → chunk-K6LZMZNB.cjs} +6 -1
  174. package/dist/{chunk-GYJT2U7J.cjs → chunk-KAD5WBY4.cjs} +9 -5
  175. package/dist/{chunk-52Q4OB4A.cjs → chunk-KBURN62Z.cjs} +10 -6
  176. package/dist/{chunk-O4JYMU5N.cjs → chunk-KDUVIJSZ.cjs} +22 -18
  177. package/dist/{chunk-2LHZD3OP.cjs → chunk-KEBD377T.cjs} +6 -2
  178. package/dist/{chunk-3DE6RK7K.cjs → chunk-KHTJVI6B.cjs} +6 -1
  179. package/dist/{chunk-OY5XDG24.cjs → chunk-KI3B3H5K.cjs} +9 -5
  180. package/dist/{chunk-KRU3XPOW.cjs → chunk-KM7ZRKCH.cjs} +61 -49
  181. package/dist/{chunk-P2355C6E.cjs → chunk-KSRWTQ6J.cjs} +6 -1
  182. package/dist/{chunk-SHIWRBFI.cjs → chunk-KUG3P3GY.cjs} +6 -1
  183. package/dist/{chunk-T7HGXF7D.cjs → chunk-KXCPX3HE.cjs} +11 -7
  184. package/dist/{chunk-C5QHZ626.cjs → chunk-KXXZDS7C.cjs} +6 -1
  185. package/dist/{chunk-DUIP64BF.cjs → chunk-KYFTDHNN.cjs} +6 -1
  186. package/dist/{chunk-VXCFJWK5.cjs → chunk-L6CW5AWM.cjs} +6 -1
  187. package/dist/{chunk-XGPRM7OK.cjs → chunk-LEK3P2ZD.cjs} +16 -7
  188. package/dist/{chunk-HA7YRO53.cjs → chunk-LF7HAALM.cjs} +6 -1
  189. package/dist/{chunk-2KMIJDY6.cjs → chunk-LG62AYPQ.cjs} +6 -1
  190. package/dist/{chunk-SMUW7UST.mjs → chunk-LO5BNR6Y.mjs} +7 -2
  191. package/dist/{chunk-4A6A6P4T.mjs → chunk-LOQVWATF.mjs} +2 -2
  192. package/dist/{chunk-PEQJ4UUT.mjs → chunk-LP6DIYGA.mjs} +2 -2
  193. package/dist/{chunk-PWDBWXQI.cjs → chunk-LVYUTMW4.cjs} +6 -1
  194. package/dist/{chunk-EBKYRP2P.mjs → chunk-LWQ6IESX.mjs} +1 -1
  195. package/dist/{chunk-XRRHPBG2.cjs → chunk-M6W3AN57.cjs} +6 -1
  196. package/dist/{chunk-PZXYAWYG.cjs → chunk-M7RS7HSB.cjs} +13 -8
  197. package/dist/{chunk-27ESPHQA.cjs → chunk-MBDDLYT5.cjs} +59 -38
  198. package/dist/{chunk-CEVXKJKF.cjs → chunk-MMSCWTJT.cjs} +6 -1
  199. package/dist/{chunk-OOOUYA6L.mjs → chunk-MRDI6MTL.mjs} +8 -8
  200. package/dist/{chunk-B3HQTGXS.cjs → chunk-N4AM7Q34.cjs} +83 -74
  201. package/dist/{chunk-DXUXQP2T.cjs → chunk-N4C72FCD.cjs} +6 -1
  202. package/dist/{chunk-H7REG7OX.cjs → chunk-NKW4JEOH.cjs} +13 -9
  203. package/dist/{chunk-XRFGOYXG.cjs → chunk-NMMCBJZM.cjs} +17 -12
  204. package/dist/{chunk-FJGA3XWL.cjs → chunk-NNHIV3O2.cjs} +9 -2
  205. package/dist/{chunk-SHDCKRP4.cjs → chunk-NQUZDXKJ.cjs} +7 -3
  206. package/dist/{chunk-Y3DO7BIJ.cjs → chunk-O7B6LJWE.cjs} +10 -3
  207. package/dist/{chunk-5GFTMTX3.cjs → chunk-OBERQH7M.cjs} +42 -37
  208. package/dist/{chunk-NW3DL2PM.cjs → chunk-OCQSYDMG.cjs} +11 -4
  209. package/dist/{chunk-ZNXU4E6A.cjs → chunk-OSLI2SCA.cjs} +83 -72
  210. package/dist/{chunk-HLYRXN2I.cjs → chunk-OUOUPA37.cjs} +6 -1
  211. package/dist/{chunk-YIGUFJMR.cjs → chunk-OVSK47CZ.cjs} +6 -1
  212. package/dist/{chunk-ATYTLVSI.cjs → chunk-OX63SW6N.cjs} +7 -1
  213. package/dist/{chunk-YKHRCY4T.cjs → chunk-P2LSRUQB.cjs} +6 -1
  214. package/dist/{chunk-XJDB564A.cjs → chunk-P4ZLFUNB.cjs} +7 -2
  215. package/dist/{chunk-2OFP3IVA.cjs → chunk-P5RNGH52.cjs} +32 -18
  216. package/dist/{chunk-VZWAXQME.mjs → chunk-P67RLOMO.mjs} +34 -2
  217. package/dist/{chunk-6FXBJPF5.cjs → chunk-PCF54MSR.cjs} +6 -1
  218. package/dist/{chunk-GVYZCJZH.cjs → chunk-PHYSFHJK.cjs} +6 -1
  219. package/dist/{chunk-4DCWVSL2.cjs → chunk-PHZ7MLRQ.cjs} +6 -1
  220. package/dist/{chunk-PCAEJNQF.cjs → chunk-PNMRXZS5.cjs} +13 -9
  221. package/dist/{chunk-HS4JPIGR.cjs → chunk-PRKFECGT.cjs} +7 -3
  222. package/dist/{chunk-OIPPISQ6.cjs → chunk-PSALMEHJ.cjs} +431 -212
  223. package/dist/{chunk-YUCU6XB4.cjs → chunk-PYPHM7AS.cjs} +9 -4
  224. package/dist/{chunk-ZPQY7O64.cjs → chunk-QBCR2EHA.cjs} +9 -5
  225. package/dist/{chunk-H7OFZJCV.cjs → chunk-QBMMQS25.cjs} +14 -8
  226. package/dist/{chunk-Y2FEFQAY.cjs → chunk-QCVP22KW.cjs} +8 -5
  227. package/dist/{chunk-J3GFOQOL.cjs → chunk-QGJL7EPX.cjs} +13 -9
  228. package/dist/{chunk-2PE5STAR.cjs → chunk-QHHEL4ZO.cjs} +6 -2
  229. package/dist/{chunk-LTOT5KVJ.mjs → chunk-QKXQFBNL.mjs} +1 -1
  230. package/dist/{chunk-L6E5BSNU.cjs → chunk-QT7MJL5E.cjs} +7 -3
  231. package/dist/{chunk-ERMUL73L.cjs → chunk-QTGYT2DF.cjs} +6 -1
  232. package/dist/{chunk-WBTHHTBO.cjs → chunk-QW5I5D5T.cjs} +6 -1
  233. package/dist/{chunk-IIHZ2BEE.cjs → chunk-QZRFEHMS.cjs} +15 -11
  234. package/dist/{chunk-HXNLKCWH.cjs → chunk-QZVPBDF7.cjs} +6 -1
  235. package/dist/{chunk-W53Z4WDI.cjs → chunk-R6GOH5CH.cjs} +18 -14
  236. package/dist/{chunk-2BEGVSDF.cjs → chunk-RBDAW6IZ.cjs} +7 -3
  237. package/dist/{chunk-PLJMEUAN.cjs → chunk-RFKPIAOF.cjs} +9 -1
  238. package/dist/{chunk-HQEYZSF3.cjs → chunk-RGIHE6YL.cjs} +6 -2
  239. package/dist/{chunk-6B44ZU5P.cjs → chunk-RHORD2K2.cjs} +19 -15
  240. package/dist/{chunk-5AL2GXAU.mjs → chunk-RKWZ6F5D.mjs} +2 -2
  241. package/dist/{chunk-OCS3PSYR.cjs → chunk-RLC7NNTA.cjs} +6 -1
  242. package/dist/{chunk-STF6VDYQ.cjs → chunk-RQSPBWXJ.cjs} +6 -1
  243. package/dist/{chunk-RWR7SMD7.cjs → chunk-S2QSTMBE.cjs} +7 -3
  244. package/dist/{chunk-HZY63K5C.mjs → chunk-S6MGFULY.mjs} +2 -2
  245. package/dist/{chunk-GCJ4GNMC.cjs → chunk-SGBEJBBB.cjs} +8 -4
  246. package/dist/chunk-SGRWZEQC.cjs +44 -0
  247. package/dist/{chunk-NDMPGFKL.cjs → chunk-SIQPXYBB.cjs} +6 -1
  248. package/dist/{chunk-2HTNASSB.cjs → chunk-SM4Y7CL4.cjs} +10 -6
  249. package/dist/{chunk-UNJZGVPU.cjs → chunk-SQ5O5EDN.cjs} +6 -1
  250. package/dist/{chunk-A25FXJ7D.cjs → chunk-SWOJU7LI.cjs} +6 -1
  251. package/dist/{chunk-BNH53KOT.cjs → chunk-SZBBBLLS.cjs} +6 -1
  252. package/dist/{chunk-23BZ7ZH6.mjs → chunk-T4NOMZTS.mjs} +7 -4
  253. package/dist/{chunk-ML4TOUZP.cjs → chunk-T4YCWRCJ.cjs} +6 -1
  254. package/dist/{chunk-NDOE76QC.cjs → chunk-TDAH76RR.cjs} +8 -4
  255. package/dist/{chunk-D22BUQKW.cjs → chunk-TFCBJFP7.cjs} +6 -1
  256. package/dist/{chunk-ICOJ2BC6.mjs → chunk-TP3ISVRU.mjs} +26 -19
  257. package/dist/{chunk-3EIPOTZV.cjs → chunk-TP7JAC3T.cjs} +6 -2
  258. package/dist/{chunk-4IE3YK7U.mjs → chunk-TQCDN4DV.mjs} +1 -1
  259. package/dist/{chunk-FB4CWSC2.cjs → chunk-TSLXAEGM.cjs} +16 -12
  260. package/dist/{chunk-2NOHVIJ3.cjs → chunk-U2HFXURZ.cjs} +36 -13
  261. package/dist/{chunk-SHD265HW.cjs → chunk-U3NUGF2E.cjs} +7 -1
  262. package/dist/{chunk-SVXOCTQ2.cjs → chunk-UARKTC55.cjs} +6 -1
  263. package/dist/{chunk-KBIM7PFQ.cjs → chunk-UBH2OARS.cjs} +758 -643
  264. package/dist/{chunk-WX752VMN.mjs → chunk-UCRNNDNS.mjs} +1 -1
  265. package/dist/{chunk-UZM3PDKK.cjs → chunk-UGL4BDNB.cjs} +27 -3
  266. package/dist/{chunk-GBMWLDCC.cjs → chunk-UHTXBC4Q.cjs} +7 -1
  267. package/dist/{chunk-47JV57DA.cjs → chunk-UOFTT6S4.cjs} +6 -1
  268. package/dist/{chunk-MO4UTDQ6.mjs → chunk-V36K4TSU.mjs} +2 -2
  269. package/dist/{chunk-SPKZCFPH.mjs → chunk-V5F6HN7E.mjs} +4 -4
  270. package/dist/{chunk-I2RBHZF7.cjs → chunk-VB7P66Q4.cjs} +6 -1
  271. package/dist/{chunk-BIAGSYIZ.cjs → chunk-VD7ENQP2.cjs} +54 -47
  272. package/dist/{chunk-NVXU5BEG.mjs → chunk-VGX75645.mjs} +266 -61
  273. package/dist/{chunk-NLBHLPEO.cjs → chunk-VIDUNAQE.cjs} +6 -1
  274. package/dist/{chunk-6ETHVRFO.cjs → chunk-VMIR4SUL.cjs} +760 -714
  275. package/dist/{chunk-VM57CK74.cjs → chunk-VNWKJOJF.cjs} +6 -1
  276. package/dist/{chunk-HENPVGZC.cjs → chunk-VQYGXWCS.cjs} +103 -63
  277. package/dist/{chunk-AMMFRXFW.mjs → chunk-VS4ABIJJ.mjs} +1 -1
  278. package/dist/{chunk-MPU5DOXX.cjs → chunk-VUCDMV3Q.cjs} +6 -1
  279. package/dist/{chunk-CIQCJ72N.mjs → chunk-VVIO7QGN.mjs} +772 -176
  280. package/dist/{chunk-L2GUEYHR.cjs → chunk-VZ2P6GRC.cjs} +8 -1
  281. package/dist/{chunk-3SPECQXI.cjs → chunk-W4KSV6GX.cjs} +13 -9
  282. package/dist/{chunk-KMGHXIDA.cjs → chunk-W4WFKRLR.cjs} +17 -13
  283. package/dist/chunk-W7BMZI3I.cjs +6 -0
  284. package/dist/{chunk-HR4N2K4V.mjs → chunk-WABOJXAA.mjs} +2 -2
  285. package/dist/{chunk-LTXKRIST.mjs → chunk-WANLI3ZC.mjs} +2 -2
  286. package/dist/{chunk-SNP33A33.cjs → chunk-WCPGU6J6.cjs} +6 -1
  287. package/dist/{chunk-2OR5WAD5.cjs → chunk-WFNL24R6.cjs} +58 -43
  288. package/dist/{chunk-XOFJUSWC.cjs → chunk-WJ5ADUI2.cjs} +18 -14
  289. package/dist/{chunk-Z7ZRBCAB.mjs → chunk-WLOIUPV2.mjs} +97 -66
  290. package/dist/{chunk-TE7AX6HB.mjs → chunk-WV63R4GE.mjs} +1 -1
  291. package/dist/{chunk-JCYDWJVO.cjs → chunk-WZSLDPVZ.cjs} +13 -9
  292. package/dist/{chunk-O5YM6GU3.mjs → chunk-X2TC6PBK.mjs} +1 -1
  293. package/dist/{chunk-BSX5OGSD.cjs → chunk-XE3E4MER.cjs} +24 -20
  294. package/dist/{chunk-3BIASUGR.cjs → chunk-XEPUUTGC.cjs} +6 -1
  295. package/dist/{chunk-HQKCSJEH.cjs → chunk-XH4GQ7MT.cjs} +17 -10
  296. package/dist/{chunk-SIECKBNK.cjs → chunk-XJEOHDPN.cjs} +6 -1
  297. package/dist/{chunk-5AMH6AFA.cjs → chunk-XK7SRVHC.cjs} +15 -11
  298. package/dist/chunk-XPVS4HKU.cjs +16 -0
  299. package/dist/{chunk-WKVYF2B5.cjs → chunk-XSJYXUY6.cjs} +6 -1
  300. package/dist/{chunk-5DX3O6TT.cjs → chunk-XSLYRNNA.cjs} +8 -4
  301. package/dist/{chunk-UUQNJDGH.cjs → chunk-XTQPYWQW.cjs} +6 -1
  302. package/dist/{chunk-3HLQTOVU.cjs → chunk-XVD5Y6S4.cjs} +6 -1
  303. package/dist/{chunk-7Q2YWZF7.cjs → chunk-XXBWKAJF.cjs} +14 -10
  304. package/dist/{chunk-YDXLC4DW.cjs → chunk-XZ6L3FUU.cjs} +6 -1
  305. package/dist/{chunk-FZ7OUN5M.cjs → chunk-Y3HLU2XL.cjs} +6 -2
  306. package/dist/{chunk-I2BYNELA.cjs → chunk-Y6WRVFD6.cjs} +9 -5
  307. package/dist/{chunk-OOZEU5KK.cjs → chunk-YC3LKWJO.cjs} +6 -1
  308. package/dist/{chunk-SXXSQVKK.cjs → chunk-YCIFGYBY.cjs} +13 -8
  309. package/dist/{chunk-CYOTNHDF.cjs → chunk-YHALJBYT.cjs} +6 -2
  310. package/dist/{chunk-WOAXQ5MZ.cjs → chunk-YLEL4ZRQ.cjs} +18 -14
  311. package/dist/{chunk-WEGAVN37.cjs → chunk-YMJK6VWQ.cjs} +6 -1
  312. package/dist/{chunk-2HW5LWAH.cjs → chunk-YQ5NVEFS.cjs} +6 -1
  313. package/dist/{chunk-AQLHD6HZ.cjs → chunk-YQXLBYY2.cjs} +20 -11
  314. package/dist/{chunk-IBEHVSU4.cjs → chunk-YUV5XXDC.cjs} +6 -1
  315. package/dist/{chunk-PWMJBCAN.cjs → chunk-YV47TSSB.cjs} +7 -3
  316. package/dist/{chunk-X333W5KV.cjs → chunk-YZMSJRM5.cjs} +6 -1
  317. package/dist/{chunk-VFMHE5D3.cjs → chunk-Z23OCU33.cjs} +29 -25
  318. package/dist/{chunk-DBYNZIIQ.cjs → chunk-Z2JQR56W.cjs} +6 -1
  319. package/dist/{chunk-RK3YYUX6.cjs → chunk-ZKVA2TV6.cjs} +6 -1
  320. package/dist/{chunk-SAPG45RA.cjs → chunk-ZPZGC6OD.cjs} +31 -27
  321. package/dist/{chunk-DV52ZS53.cjs → chunk-ZRRNF26T.cjs} +6 -2
  322. package/dist/{chunk-PO5MXV5X.cjs → chunk-ZSSBEPN4.cjs} +6 -1
  323. package/dist/{cli-runtime.d-qL44rqYO.d.mts → cli-runtime.d-BGaFPum1.d.mts} +5 -5
  324. package/dist/{cli-runtime.d-jqZ7YCsm.d.ts → cli-runtime.d-Bvfxt4uo.d.ts} +5 -5
  325. package/dist/client/lifecycle.cjs +8 -3
  326. package/dist/client/lifecycle.mjs +1 -1
  327. package/dist/{client-component.d-B2L2LyAr.d.mts → client-component.d-BA6kXI5L.d.mts} +1 -1
  328. package/dist/{client-component.d-BDD5aiUb.d.ts → client-component.d-LSEmRhuI.d.ts} +1 -1
  329. package/dist/client-plugins.cjs +8 -3
  330. package/dist/{client-plugins.d-Crct3m_r.d.ts → client-plugins.d-CQ6AGHP0.d.ts} +44 -4
  331. package/dist/{client-plugins.d-Dzc3vOw_.d.mts → client-plugins.d-CVUMc2ai.d.mts} +44 -4
  332. package/dist/client-plugins.d.mts +1 -1
  333. package/dist/client-plugins.d.ts +1 -1
  334. package/dist/client-plugins.mjs +1 -1
  335. package/dist/client.cjs +51 -51
  336. package/dist/client.d.mts +7 -7
  337. package/dist/client.d.ts +7 -7
  338. package/dist/client.mjs +4 -4
  339. package/dist/config.cjs +3 -3
  340. package/dist/config.d.mts +1 -1
  341. package/dist/config.d.ts +1 -1
  342. package/dist/config.mjs +1 -1
  343. package/dist/cron.cjs +9 -9
  344. package/dist/cron.mjs +1 -1
  345. package/dist/deferred.cjs +3 -3
  346. package/dist/deferred.mjs +1 -1
  347. package/dist/deployment.cjs +3 -3
  348. package/dist/deployment.mjs +1 -1
  349. package/dist/desktop.cjs +4 -1
  350. package/dist/desktop.d.mts +2 -2
  351. package/dist/desktop.d.ts +2 -2
  352. package/dist/desktop.mjs +1 -1
  353. package/dist/{dev-guard-VIEEA4LS.cjs → dev-guard-M3ZCDWCK.cjs} +14 -11
  354. package/dist/{dev-guard-K3GJDPEQ.mjs → dev-guard-TFVWJNIB.mjs} +2 -2
  355. package/dist/{devtools-JTJA2KIZ.cjs → devtools-OBQY3XOY.cjs} +72 -69
  356. package/dist/{devtools-5DBTT2DI.mjs → devtools-RYTO2V7G.mjs} +7 -7
  357. package/dist/{devtools-client-BKBCCORT.cjs → devtools-client-3K67NMWA.cjs} +7 -4
  358. package/dist/{devtools-client-L4MUWD6K.mjs → devtools-client-WAMA6Q77.mjs} +1 -1
  359. package/dist/{devtools-ui-C2EMF2SO.cjs → devtools-ui-TPBPQEEB.cjs} +4 -1
  360. package/dist/{devtools-ui-BOG33MT5.mjs → devtools-ui-UYEVDADD.mjs} +1 -1
  361. package/dist/docs.cjs +72 -72
  362. package/dist/docs.d.mts +3 -3
  363. package/dist/docs.d.ts +3 -3
  364. package/dist/docs.mjs +9 -9
  365. package/dist/env-types.cjs +4 -4
  366. package/dist/env-types.mjs +1 -1
  367. package/dist/env.cjs +4 -4
  368. package/dist/env.mjs +1 -1
  369. package/dist/environment/vite.cjs +16 -16
  370. package/dist/environment/vite.mjs +3 -3
  371. package/dist/environment.cjs +3 -3
  372. package/dist/environment.mjs +1 -1
  373. package/dist/font.cjs +3 -3
  374. package/dist/font.mjs +1 -1
  375. package/dist/{handler.d-B1S1ZBqS.d.mts → handler.d-DLKZDAYR.d.mts} +1 -1
  376. package/dist/{handler.d-ZweCBJD4.d.ts → handler.d-nkrNn_0M.d.ts} +1 -1
  377. package/dist/headers.cjs +6 -6
  378. package/dist/{headers.d-C-yGl_f6.d.mts → headers.d-C3k520Fc.d.mts} +1 -1
  379. package/dist/{headers.d-BgBdQN8x.d.ts → headers.d-DVBrYnqP.d.ts} +1 -1
  380. package/dist/headers.mjs +1 -1
  381. package/dist/i18n/client.cjs +23 -20
  382. package/dist/i18n/client.mjs +1 -1
  383. package/dist/i18n/index.cjs +12 -7
  384. package/dist/i18n/index.mjs +1 -1
  385. package/dist/i18n/server.cjs +11 -11
  386. package/dist/i18n/server.mjs +1 -1
  387. package/dist/image/server.cjs +8 -8
  388. package/dist/image/server.mjs +1 -1
  389. package/dist/image/sharp.cjs +21 -18
  390. package/dist/image/sharp.mjs +1 -1
  391. package/dist/image.cjs +7 -4
  392. package/dist/image.mjs +1 -1
  393. package/dist/index.cjs +232 -216
  394. package/dist/{index.d-13h3oDu7.d.mts → index.d-5PDB032w.d.mts} +1 -1
  395. package/dist/{index.d-CtoniAXT.d.ts → index.d-e5WhoB07.d.ts} +1 -1
  396. package/dist/index.d.mts +23 -23
  397. package/dist/index.d.ts +23 -23
  398. package/dist/index.mjs +53 -49
  399. package/dist/instrumentation.cjs +5 -5
  400. package/dist/instrumentation.mjs +1 -1
  401. package/dist/integrations/orm.cjs +7 -7
  402. package/dist/integrations/orm.d.mts +1 -1
  403. package/dist/integrations/orm.d.ts +1 -1
  404. package/dist/integrations/orm.mjs +3 -3
  405. package/dist/integrations.cjs +24 -22
  406. package/dist/integrations.d.mts +1 -1
  407. package/dist/integrations.d.ts +1 -1
  408. package/dist/integrations.mjs +4 -2
  409. package/dist/internal/app-markdown-runtime.cjs +16 -14
  410. package/dist/internal/app-markdown-runtime.d.mts +10 -5
  411. package/dist/internal/app-markdown-runtime.d.ts +10 -5
  412. package/dist/internal/app-markdown-runtime.mjs +7 -5
  413. package/dist/internal/build-runtime.cjs +186 -181
  414. package/dist/internal/build-runtime.d.mts +4 -4
  415. package/dist/internal/build-runtime.d.ts +4 -4
  416. package/dist/internal/build-runtime.mjs +38 -38
  417. package/dist/internal/cli-runtime.cjs +105 -100
  418. package/dist/internal/cli-runtime.d.mts +7 -7
  419. package/dist/internal/cli-runtime.d.ts +7 -7
  420. package/dist/internal/cli-runtime.mjs +17 -17
  421. package/dist/internal/client-error-overlay.cjs +12 -9
  422. package/dist/internal/client-error-overlay.mjs +2 -2
  423. package/dist/internal/client-runtime.cjs +37 -26
  424. package/dist/internal/client-runtime.d.mts +5 -5
  425. package/dist/internal/client-runtime.d.ts +5 -5
  426. package/dist/internal/client-runtime.mjs +1 -1
  427. package/dist/internal/compression-runtime.cjs +4 -4
  428. package/dist/internal/compression-runtime.d.mts +1 -1
  429. package/dist/internal/compression-runtime.d.ts +1 -1
  430. package/dist/internal/compression-runtime.mjs +1 -1
  431. package/dist/internal/config-runtime.cjs +85 -82
  432. package/dist/internal/config-runtime.d.mts +3 -3
  433. package/dist/internal/config-runtime.d.ts +3 -3
  434. package/dist/internal/config-runtime.mjs +9 -9
  435. package/dist/internal/desktop-guard.cjs +5 -5
  436. package/dist/internal/desktop-guard.mjs +1 -1
  437. package/dist/internal/docs-precompiled-runtime.cjs +10 -7
  438. package/dist/internal/docs-precompiled-runtime.mjs +1 -1
  439. package/dist/internal/form-actions-client.cjs +4 -1
  440. package/dist/internal/form-actions-client.mjs +1 -1
  441. package/dist/internal/form-actions.cjs +13 -13
  442. package/dist/internal/form-actions.mjs +1 -1
  443. package/dist/internal/infra-analytics-runtime.cjs +32 -29
  444. package/dist/internal/infra-analytics-runtime.mjs +8 -8
  445. package/dist/internal/island-codec.cjs +4 -4
  446. package/dist/internal/island-codec.mjs +1 -1
  447. package/dist/internal/island-value-store.cjs +4 -1
  448. package/dist/internal/island-value-store.mjs +1 -1
  449. package/dist/internal/islands-action-client.cjs +10 -10
  450. package/dist/internal/islands-action-client.mjs +1 -1
  451. package/dist/internal/islands-boot.cjs +6 -3
  452. package/dist/internal/islands-boot.mjs +1 -1
  453. package/dist/internal/islands-runtime.cjs +12 -9
  454. package/dist/internal/islands-runtime.mjs +2 -2
  455. package/dist/internal/islands-server-tree.cjs +4 -1
  456. package/dist/internal/islands-server-tree.mjs +1 -1
  457. package/dist/internal/islands-server.cjs +9 -6
  458. package/dist/internal/islands-server.mjs +1 -1
  459. package/dist/internal/islx-actions-client.cjs +13 -10
  460. package/dist/internal/islx-actions-client.mjs +1 -1
  461. package/dist/internal/islx-actions-server.cjs +4 -1
  462. package/dist/internal/islx-actions-server.mjs +1 -1
  463. package/dist/internal/islx-client.cjs +7 -4
  464. package/dist/internal/islx-client.mjs +2 -2
  465. package/dist/internal/islx-react.cjs +4 -1
  466. package/dist/internal/islx-server.cjs +4 -1
  467. package/dist/internal/isolated-boundary.cjs +5 -5
  468. package/dist/internal/isolated-boundary.mjs +1 -1
  469. package/dist/internal/metadata-image-runtime.cjs +8 -8
  470. package/dist/internal/metadata-image-runtime.d.mts +2 -2
  471. package/dist/internal/metadata-image-runtime.d.ts +2 -2
  472. package/dist/internal/metadata-image-runtime.mjs +1 -1
  473. package/dist/internal/native-server-fns.cjs +10 -10
  474. package/dist/internal/native-server-fns.mjs +4 -4
  475. package/dist/internal/navigation-neutral.cjs +6 -3
  476. package/dist/internal/navigation-neutral.mjs +1 -1
  477. package/dist/internal/product-telemetry-runtime.cjs +4 -4
  478. package/dist/internal/product-telemetry-runtime.mjs +3 -3
  479. package/dist/internal/production-node-env.cjs +3 -3
  480. package/dist/internal/production-node-env.mjs +2 -2
  481. package/dist/internal/production-runtime.cjs +97 -89
  482. package/dist/internal/production-runtime.d.mts +10 -10
  483. package/dist/internal/production-runtime.d.ts +10 -10
  484. package/dist/internal/production-runtime.mjs +14 -14
  485. package/dist/internal/react-cache.cjs +10 -7
  486. package/dist/internal/react-cache.mjs +1 -1
  487. package/dist/internal/renderer-islands.cjs +4 -1
  488. package/dist/internal/renderer-islands.mjs +1 -1
  489. package/dist/internal/request-cookies.cjs +3 -3
  490. package/dist/internal/request-cookies.mjs +1 -1
  491. package/dist/internal/server-fn-transform.cjs +3 -3
  492. package/dist/internal/server-fn-transform.mjs +1 -1
  493. package/dist/internal/server-tree.cjs +5 -5
  494. package/dist/internal/server-tree.mjs +1 -1
  495. package/dist/internal/spa-router.cjs +20 -20
  496. package/dist/internal/spa-router.d.mts +3 -3
  497. package/dist/internal/spa-router.d.ts +3 -3
  498. package/dist/internal/spa-router.mjs +3 -3
  499. package/dist/internal/start-manifest.cjs +4 -1
  500. package/dist/internal/start-manifest.d.mts +1 -1
  501. package/dist/internal/start-manifest.d.ts +1 -1
  502. package/dist/internal/start-manifest.mjs +1 -1
  503. package/dist/internal/vercel-edge-middleware.cjs +23 -20
  504. package/dist/internal/vercel-edge-middleware.mjs +1 -1
  505. package/dist/json-ld.cjs +4 -1
  506. package/dist/json-ld.mjs +1 -1
  507. package/dist/layers-GP57TBE2.cjs +21 -0
  508. package/dist/{layers-744BBUY5.mjs → layers-IMRXNZRB.mjs} +1 -1
  509. package/dist/{libsql-http-M6LMNXCN.cjs → libsql-http-5GYGFVGC.cjs} +94 -87
  510. package/dist/{libsql-http-2QD224YS.mjs → libsql-http-PBJXNEOX.mjs} +1 -1
  511. package/dist/manager-3DFQDKJ6.cjs +18 -0
  512. package/dist/{manager-7BNSJKME.mjs → manager-GZUTAN5Q.mjs} +2 -2
  513. package/dist/markdown.cjs +12 -12
  514. package/dist/markdown.d.mts +1 -1
  515. package/dist/markdown.d.ts +1 -1
  516. package/dist/markdown.mjs +2 -2
  517. package/dist/middleware.cjs +32 -32
  518. package/dist/middleware.d.mts +1 -1
  519. package/dist/middleware.d.ts +1 -1
  520. package/dist/middleware.mjs +4 -4
  521. package/dist/mobile.cjs +4 -1
  522. package/dist/mobile.mjs +1 -1
  523. package/dist/{modules-3Q2ZCY4Q.mjs → modules-IVJXVV4W.mjs} +1 -1
  524. package/dist/modules-JDPCBWND.cjs +13 -0
  525. package/dist/{mount.d-_6Un9wdK.d.mts → mount.d-COIrFH0i.d.mts} +1 -1
  526. package/dist/{mount.d-DyKlRR6z.d.ts → mount.d-Cbz8vsSZ.d.ts} +1 -1
  527. package/dist/{native-server-fn-handler-PYK65A46.mjs → native-server-fn-handler-IMLQMSIR.mjs} +1 -1
  528. package/dist/native-server-fn-handler-U7I6H6MM.cjs +30 -0
  529. package/dist/{native-specs-A7YOL463.mjs → native-specs-4DOPYSOJ.mjs} +1 -1
  530. package/dist/native-specs-IXHEIZCD.cjs +15 -0
  531. package/dist/{native-tree-LNO7K6JR.mjs → native-tree-2GQMSOLV.mjs} +3 -3
  532. package/dist/native-tree-PHCV43W4.cjs +28 -0
  533. package/dist/native.cjs +4 -1
  534. package/dist/native.mjs +1 -1
  535. package/dist/{navigation-delegate.d-BbW1_pf_.d.ts → navigation-delegate.d-dlnYTX-Y.d.ts} +1 -1
  536. package/dist/{navigation-delegate.d-B9GjWbov.d.mts → navigation-delegate.d-yulG9Dp5.d.mts} +1 -1
  537. package/dist/navigation.cjs +26 -26
  538. package/dist/navigation.d.mts +4 -4
  539. package/dist/navigation.d.ts +4 -4
  540. package/dist/navigation.mjs +5 -5
  541. package/dist/{nitro-FK3SZM4H.mjs → nitro-6HSEGMWJ.mjs} +2 -2
  542. package/dist/{nitro-YDFMH5PY.cjs → nitro-K4MCBBB6.cjs} +31 -28
  543. package/dist/{node-module-bundle-ZWCQJCKA.mjs → node-module-bundle-4IN4YCDV.mjs} +1 -1
  544. package/dist/node-module-bundle-PHKRIHI6.cjs +15 -0
  545. package/dist/observability.cjs +3 -3
  546. package/dist/observability.mjs +1 -1
  547. package/dist/og.cjs +4 -1
  548. package/dist/og.mjs +1 -1
  549. package/dist/platform.cjs +4 -1
  550. package/dist/platform.mjs +1 -1
  551. package/dist/{plugin-EVKQZBNW.mjs → plugin-B7I5QVBE.mjs} +2 -2
  552. package/dist/plugin-QYBJSGHG.cjs +33 -0
  553. package/dist/plugin.cjs +175 -170
  554. package/dist/plugin.d.mts +5 -5
  555. package/dist/plugin.d.ts +5 -5
  556. package/dist/plugin.mjs +31 -31
  557. package/dist/{port-STMSGUVU.cjs → port-2YV5GBDN.cjs} +13 -10
  558. package/dist/{port-CEZTV776.mjs → port-4ZIDLV4Z.mjs} +1 -1
  559. package/dist/query/client.cjs +38 -34
  560. package/dist/query/client.mjs +3 -3
  561. package/dist/query/index.cjs +5 -5
  562. package/dist/query/index.mjs +1 -1
  563. package/dist/query/parsers.cjs +3 -3
  564. package/dist/query/parsers.mjs +1 -1
  565. package/dist/query/server.cjs +8 -5
  566. package/dist/query/server.mjs +1 -1
  567. package/dist/{render-plan.d-DaM1NPnm.d.mts → render-plan.d-BW56oxMP.d.mts} +1 -1
  568. package/dist/{render-plan.d-D0FV9lDT.d.ts → render-plan.d-Cz7bQmcf.d.ts} +1 -1
  569. package/dist/renderer/none/server.cjs +4 -1
  570. package/dist/renderer/none/server.mjs +1 -1
  571. package/dist/renderer/react/client.cjs +4 -1
  572. package/dist/renderer/react/client.mjs +1 -1
  573. package/dist/renderer/react/server.cjs +14 -11
  574. package/dist/renderer/react/server.mjs +1 -1
  575. package/dist/renderer/react/vite.cjs +4 -1
  576. package/dist/renderer/react/vite.mjs +1 -1
  577. package/dist/renderer-client.cjs +67 -64
  578. package/dist/renderer-client.d.mts +5 -5
  579. package/dist/renderer-client.d.ts +5 -5
  580. package/dist/renderer-client.mjs +3 -3
  581. package/dist/renderer.cjs +11 -6
  582. package/dist/renderer.d.mts +22 -11
  583. package/dist/renderer.d.ts +22 -11
  584. package/dist/renderer.mjs +1 -1
  585. package/dist/request.cjs +9 -4
  586. package/dist/{request.d-CrXC7voZ.d.ts → request.d-BaFROByP.d.ts} +1 -1
  587. package/dist/{request.d-DVSLilGx.d.mts → request.d-BwgX-7Wi.d.mts} +1 -1
  588. package/dist/request.d.mts +2 -2
  589. package/dist/request.d.ts +2 -2
  590. package/dist/request.mjs +1 -1
  591. package/dist/{route-rendering.d-CWi3UYtR.d.mts → route-rendering.d-BzeFPYGc.d.mts} +1 -1
  592. package/dist/{route-rendering.d-OfbM_rj8.d.ts → route-rendering.d-D4kUuncg.d.ts} +1 -1
  593. package/dist/router.cjs +5 -5
  594. package/dist/{router.d-Bm9FNSu3.d.ts → router.d-B9qJdgjt.d.ts} +1 -1
  595. package/dist/{router.d-YKVirmj4.d.mts → router.d-D-p8WElf.d.mts} +1 -1
  596. package/dist/router.mjs +1 -1
  597. package/dist/routes.cjs +16 -16
  598. package/dist/routes.d.mts +3 -3
  599. package/dist/routes.d.ts +3 -3
  600. package/dist/routes.mjs +1 -1
  601. package/dist/{rsc-pipeline-W5DSWDHD.mjs → rsc-pipeline-Y6D6KBES.mjs} +12 -12
  602. package/dist/rsc-pipeline-YHVEHWTU.cjs +91 -0
  603. package/dist/{runtime-UOZKSM5S.mjs → runtime-62ZIEV6U.mjs} +11 -11
  604. package/dist/{runtime-YV4X5FAK.cjs → runtime-LKEMFXHW.cjs} +129 -119
  605. package/dist/{runtime.d-BVj6apd0.d.mts → runtime.d-BUtDIrRJ.d.mts} +1 -1
  606. package/dist/{runtime.d-D7QYVJGO.d.ts → runtime.d-Du64AX3R.d.ts} +1 -1
  607. package/dist/safe-fetch.cjs +4 -4
  608. package/dist/safe-fetch.mjs +1 -1
  609. package/dist/{schema-dev-notice-EUPAUJVN.mjs → schema-dev-notice-EZAOFO7A.mjs} +1 -1
  610. package/dist/{schema-dev-notice-ZSCL47CT.cjs → schema-dev-notice-Y4J5KPEY.cjs} +16 -13
  611. package/dist/schema.cjs +4 -4
  612. package/dist/schema.mjs +1 -1
  613. package/dist/{search-client-GIXIEU75.mjs → search-client-HN3ZY6AK.mjs} +1 -1
  614. package/dist/search-client-Z7KDVD4C.cjs +15 -0
  615. package/dist/server-action-security.cjs +10 -10
  616. package/dist/server-action-security.mjs +1 -1
  617. package/dist/{server-components-status.d-BDVcxi0z.d.mts → server-components-status.d-B0YP-m9A.d.mts} +1 -1
  618. package/dist/{server-components-status.d-CfKDpmCH.d.ts → server-components-status.d-CvFhb6-t.d.ts} +1 -1
  619. package/dist/server-fn-client.cjs +4 -4
  620. package/dist/server-fn-client.mjs +1 -1
  621. package/dist/server-fn.cjs +17 -17
  622. package/dist/server-fn.mjs +1 -1
  623. package/dist/server-plugins.cjs +21 -16
  624. package/dist/server-plugins.d.mts +3 -3
  625. package/dist/server-plugins.d.ts +3 -3
  626. package/dist/server-plugins.mjs +1 -1
  627. package/dist/server-query-client.cjs +10 -10
  628. package/dist/server-query-client.mjs +1 -1
  629. package/dist/server-query.cjs +19 -19
  630. package/dist/server-query.mjs +1 -1
  631. package/dist/server.cjs +225 -216
  632. package/dist/server.d.mts +11 -11
  633. package/dist/server.d.ts +11 -11
  634. package/dist/server.mjs +34 -34
  635. package/dist/session-J7NTZI56.cjs +24 -0
  636. package/dist/{session-4IB34X35.mjs → session-ZFM3RDG2.mjs} +3 -3
  637. package/dist/{spa-router.d-DGmropfK.d.mts → spa-router.d-CkR14oGH.d.mts} +2 -2
  638. package/dist/{spa-router.d-nE1jHNGt.d.ts → spa-router.d-D4ye2WFk.d.ts} +2 -2
  639. package/dist/{ssg.d-jXlUAKzg.d.ts → ssg.d-BCJB_f7B.d.ts} +2 -2
  640. package/dist/{ssg.d-DS-gXUbf.d.mts → ssg.d-DFs97VTY.d.mts} +2 -2
  641. package/dist/storage.cjs +4 -4
  642. package/dist/storage.mjs +2 -2
  643. package/dist/{store-core.d-B5cwOd8g.d.ts → store-core.d-0W2YScl8.d.ts} +2 -2
  644. package/dist/{store-core.d-C-gATBwd.d.mts → store-core.d-Vk5UDKeC.d.mts} +2 -2
  645. package/dist/testing.cjs +65 -62
  646. package/dist/testing.d.mts +1 -1
  647. package/dist/testing.d.ts +1 -1
  648. package/dist/testing.mjs +4 -4
  649. package/dist/theme/client.cjs +5 -5
  650. package/dist/theme/client.mjs +1 -1
  651. package/dist/theme/index.cjs +4 -4
  652. package/dist/theme/index.mjs +1 -1
  653. package/dist/theme/runtime.cjs +3 -3
  654. package/dist/theme/runtime.mjs +1 -1
  655. package/dist/theme/server.cjs +8 -8
  656. package/dist/theme/server.mjs +1 -1
  657. package/dist/{utils.d-BODwBtkz.d.ts → utils.d-Ba3N28fk.d.ts} +1 -1
  658. package/dist/{utils.d-Cmj-fzds.d.mts → utils.d-Cloiko8d.d.mts} +1 -1
  659. package/dist/version.cjs +3 -3
  660. package/dist/version.mjs +2 -2
  661. package/dist/vite.cjs +168 -168
  662. package/dist/vite.d.mts +6 -6
  663. package/dist/vite.d.ts +6 -6
  664. package/dist/vite.mjs +31 -31
  665. package/dist/workflows.cjs +14 -14
  666. package/dist/workflows.mjs +2 -2
  667. package/package.json +5 -5
  668. package/LICENSE +0 -22
  669. package/dist/agent-mcp-handler-IUL6OPC3.cjs +0 -21
  670. package/dist/analyzer-IIWSUXSQ.cjs +0 -17
  671. package/dist/chunk-3376ZTRC.cjs +0 -1
  672. package/dist/chunk-K5NI5YQR.cjs +0 -1
  673. package/dist/chunk-MCJLA63J.cjs +0 -1
  674. package/dist/chunk-THGSPDFD.cjs +0 -40
  675. package/dist/chunk-V3Y3R3JJ.cjs +0 -9
  676. package/dist/chunk-YTAABQEV.cjs +0 -1
  677. package/dist/layers-XLOMMQP7.cjs +0 -21
  678. package/dist/manager-37UJPUN4.cjs +0 -18
  679. package/dist/modules-KDHFBQ6L.cjs +0 -13
  680. package/dist/native-server-fn-handler-57TCQPSM.cjs +0 -30
  681. package/dist/native-specs-JDPH26AO.cjs +0 -15
  682. package/dist/native-tree-5TENEQ7Y.cjs +0 -28
  683. package/dist/node-module-bundle-TNSY5PAC.cjs +0 -15
  684. package/dist/plugin-MWO3G2XM.cjs +0 -33
  685. package/dist/rsc-pipeline-LGXJGGMW.cjs +0 -91
  686. package/dist/search-client-A7YJT7JZ.cjs +0 -15
  687. package/dist/session-MOYQJ7E6.cjs +0 -24
  688. package/dist/{chunk-IVP5Q4BX.mjs → chunk-6IKUYFNQ.mjs} +0 -0
  689. package/dist/{chunk-D7LXBLUW.mjs → chunk-FYTZZM5U.mjs} +3 -3
  690. /package/dist/{chunk-URBP6DLH.mjs → chunk-LQZXCSYG.mjs} +0 -0
  691. /package/dist/{chunk-M6AJZ4XR.mjs → chunk-QNJUQIUZ.mjs} +0 -0
@@ -22,25 +22,26 @@ import {
22
22
  createFarmNodeServerEntry,
23
23
  createReactProductionModePlugin,
24
24
  withProductionNodeEnv
25
- } from "./chunk-ZZGQD3LL.mjs";
25
+ } from "./chunk-GXWCR7PP.mjs";
26
26
  import {
27
27
  generateNativeMCPPluginSource
28
28
  } from "./chunk-KQH2COEJ.mjs";
29
29
  import {
30
30
  FARM_MOBILE_SESSION_PLUGIN
31
- } from "./chunk-6GJZJAED.mjs";
31
+ } from "./chunk-GUNPDMSX.mjs";
32
32
  import {
33
33
  collectFarmNativeServerFns,
34
34
  findFarmNativeScreenFiles
35
- } from "./chunk-2U2GRXP5.mjs";
35
+ } from "./chunk-5UMPMVNF.mjs";
36
36
  import {
37
37
  assertFarmDocsAdapterServesNoGuardedPages,
38
38
  compileFarmDocsAdapterEdgeManifest,
39
39
  createFarmDocsAPIHandler,
40
40
  farmDocsAdapterServesGuardedPages,
41
41
  listFarmDocsAdapterPages,
42
+ listFarmDocsAdapterRoutes,
42
43
  listFarmDocsPagePaths
43
- } from "./chunk-VZWAXQME.mjs";
44
+ } from "./chunk-P67RLOMO.mjs";
44
45
  import {
45
46
  FARM_DOCS_LAST_MODIFIED_MANIFEST,
46
47
  createFarmDocsHandler,
@@ -53,7 +54,7 @@ import {
53
54
  loadFarmDocsPage,
54
55
  resolveFarmDocsContentDir,
55
56
  toFarmDocsMarkdownPage
56
- } from "./chunk-KCJBIWBM.mjs";
57
+ } from "./chunk-GVORDLLV.mjs";
57
58
  import {
58
59
  generateFarmDocsSearchClientRuntime,
59
60
  isFarmDocsSearchEnabled,
@@ -70,7 +71,7 @@ import {
70
71
  getDeployTargetForPreset,
71
72
  hasCustomFarmRouteContext,
72
73
  resolveDeployOutputPath
73
- } from "./chunk-OOOUYA6L.mjs";
74
+ } from "./chunk-MRDI6MTL.mjs";
74
75
  import {
75
76
  resolveFarmInstrumentationFile
76
77
  } from "./chunk-QRNYSISP.mjs";
@@ -116,27 +117,27 @@ import {
116
117
  resolveFarmNotFoundComponentPath,
117
118
  resolveFarmRouteRootStrategy,
118
119
  toBakedMarkdownSourcePath
119
- } from "./chunk-DZC2XGK4.mjs";
120
+ } from "./chunk-D5OY5OKA.mjs";
120
121
  import {
121
122
  TAILWIND_CSS_BROWSER_TARGET,
122
123
  generateFarmClientPluginEntryCode,
123
124
  hasFarmServerRuntimePlugins,
124
125
  includesTailwindVitePlugin,
125
126
  loadTailwindVitePlugin
126
- } from "./chunk-MO4UTDQ6.mjs";
127
+ } from "./chunk-V36K4TSU.mjs";
127
128
  import {
128
129
  PluginManager
129
- } from "./chunk-IVP5Q4BX.mjs";
130
+ } from "./chunk-6IKUYFNQ.mjs";
130
131
  import {
131
132
  generateFarmTypeArtifacts,
132
133
  readRouteRenderingDirectiveFromFile,
133
134
  resolveRouteRenderingConfig,
134
135
  resolveRouteRenderingConfigFromFile
135
- } from "./chunk-23BZ7ZH6.mjs";
136
+ } from "./chunk-T4NOMZTS.mjs";
136
137
  import {
137
138
  FARM_PRERENDER_ENV,
138
139
  _farmWebMCPReportsEnabled
139
- } from "./chunk-ISSFWEPY.mjs";
140
+ } from "./chunk-AGEBFYHF.mjs";
140
141
  import {
141
142
  HOISTED_HEAD_ELEMENT,
142
143
  appMiddlewareMayHandlePath,
@@ -149,12 +150,13 @@ import {
149
150
  layoutsCanCoverSamePage,
150
151
  routeBoundaryCoversDirectory,
151
152
  stripRouteGroups
152
- } from "./chunk-PEQJ4UUT.mjs";
153
+ } from "./chunk-LP6DIYGA.mjs";
153
154
  import {
154
155
  FARM_NATIVE_TREE_CONTENT_TYPE
155
156
  } from "./chunk-LLZSYFOM.mjs";
156
157
  import {
157
- farmPluginMayAffectRuntimePath
158
+ farmPluginMayAffectRuntimePath,
159
+ normalizeFarmPluginRuntimeEndpointPath
158
160
  } from "./chunk-UUMKLGUU.mjs";
159
161
  import {
160
162
  FARM_API_CATALOG_PATH,
@@ -163,15 +165,15 @@ import {
163
165
  listFarmBuiltInRoutePaths,
164
166
  resolveFarmApiCatalogInput,
165
167
  resolveFarmAppManifestInput
166
- } from "./chunk-YPAOC3FO.mjs";
168
+ } from "./chunk-2ORWY3SE.mjs";
167
169
  import {
168
170
  FARM_DEFAULT_MCP_PATH,
169
171
  createFarmDefaultMCPServer,
170
172
  farmConfigMountsMCP
171
- } from "./chunk-HR4N2K4V.mjs";
173
+ } from "./chunk-WABOJXAA.mjs";
172
174
  import {
173
175
  isFarmPreviewDeploymentEnvironment
174
- } from "./chunk-PKV3JGMS.mjs";
176
+ } from "./chunk-DFLCEMQ3.mjs";
175
177
  import {
176
178
  FARM_NATIVE_SERVER_FN_PLUGIN
177
179
  } from "./chunk-L4RTTTVE.mjs";
@@ -192,7 +194,7 @@ import {
192
194
  withFarmSourceSnapshot,
193
195
  withFarmSourceSnapshotOf,
194
196
  withPackageClientBoundaryCache
195
- } from "./chunk-NVXU5BEG.mjs";
197
+ } from "./chunk-VGX75645.mjs";
196
198
  import {
197
199
  generateFarmDocsAdapterClientRuntime,
198
200
  getFarmDocsAdapterConfigModule
@@ -249,31 +251,33 @@ import {
249
251
  isFarmMarkdownPageFile,
250
252
  parseMarkdownFrontmatter,
251
253
  readFarmMarkdownRouteConfig
252
- } from "./chunk-ICOJ2BC6.mjs";
254
+ } from "./chunk-TP3ISVRU.mjs";
253
255
  import {
254
256
  resolveFarmMdxComponentsModulePath,
255
257
  resolveMdxConfig
256
258
  } from "./chunk-UIJOLBUL.mjs";
257
259
  import {
258
260
  getFarmMarkdownAlternatePath
259
- } from "./chunk-YU2MNIIY.mjs";
261
+ } from "./chunk-CRF5MOLO.mjs";
260
262
  import {
261
263
  withPlainDiagnostics
262
264
  } from "./chunk-AYDVUCXD.mjs";
263
265
  import {
264
266
  applyFarmWorkflowVercelCrons,
265
267
  prepareFarmWorkflowsForNitro
266
- } from "./chunk-LTOT5KVJ.mjs";
268
+ } from "./chunk-QKXQFBNL.mjs";
267
269
  import {
268
270
  getFarmIntegrationPluginServerRuntime,
269
- getIntegrationProviders
270
- } from "./chunk-XRSNW4IU.mjs";
271
+ getIntegrationProviders,
272
+ providerSupportsIslands
273
+ } from "./chunk-HDZ2AMDD.mjs";
271
274
  import {
272
- FARM_INTEGRATION_API_BASE_PATH_KEY
275
+ FARM_INTEGRATION_API_BASE_PATH_KEY,
276
+ isFarmIntegration
273
277
  } from "./chunk-CZOXZ6WQ.mjs";
274
278
  import {
275
279
  _collectFarmStorageModules
276
- } from "./chunk-QBJ6N5MT.mjs";
280
+ } from "./chunk-GN2RXH72.mjs";
277
281
  import {
278
282
  appendMiddlewareDirectory,
279
283
  appendMiddlewareRoutePath,
@@ -281,9 +285,10 @@ import {
281
285
  } from "./chunk-QD34VE4N.mjs";
282
286
  import {
283
287
  APIRouteManager
284
- } from "./chunk-SPKZCFPH.mjs";
288
+ } from "./chunk-V5F6HN7E.mjs";
285
289
  import {
286
- hasPolyroutePlugin
290
+ hasPolyroutePlugin,
291
+ isPolyrouteRouteFileName
287
292
  } from "./chunk-GTHBWZUK.mjs";
288
293
  import {
289
294
  readFarmI18nCatalogs
@@ -312,10 +317,10 @@ import {
312
317
  } from "./chunk-2I6PUKWJ.mjs";
313
318
  import {
314
319
  FARM_VERSION
315
- } from "./chunk-EBKYRP2P.mjs";
320
+ } from "./chunk-LWQ6IESX.mjs";
316
321
  import {
317
322
  FARM_VIDEO_PLAYER_PATH
318
- } from "./chunk-AG27TI6Q.mjs";
323
+ } from "./chunk-23NBOP43.mjs";
319
324
  import {
320
325
  getFarmPresetRuntime,
321
326
  resolveCloudflareProcessEnvFlags
@@ -468,7 +473,8 @@ function parseRange(header, size) {
468
473
  }
469
474
  `;
470
475
  function createNitroStaticRangePlugin(nitroPackageEntry, canonicalPages = []) {
471
- const redirects = canonicalPages.filter((url) => url !== "/" && !url.startsWith("//")).map((url) => [url.endsWith("/") ? url.slice(0, -1) : url + "/", url]);
476
+ const pages = [...new Set(canonicalPages.filter((url) => !url.startsWith("//")))];
477
+ const redirects = pages.filter((url) => url !== "/").map((url) => [url.endsWith("/") ? url.slice(0, -1) : url + "/", url]);
472
478
  const original = "?farm-static-handler";
473
479
  const handlerFile = path.join(path.dirname(nitroPackageEntry), "internal", "static.mjs");
474
480
  const handlerIds = /* @__PURE__ */ new Set([toPosix(handlerFile)]);
@@ -487,13 +493,19 @@ function createNitroStaticRangePlugin(nitroPackageEntry, canonicalPages = []) {
487
493
  handler(id) {
488
494
  const file = id.split("?", 1)[0];
489
495
  if (!handlerIds.has(toPosix(file))) return null;
490
- if (redirects.length && !id.endsWith(original)) {
496
+ if (pages.length && !id.endsWith(original)) {
491
497
  return `import serve from ${JSON.stringify(toPosix(file) + original)};
492
498
  const redirects = new Map(${JSON.stringify(redirects)});
499
+ const pages = new Set(${JSON.stringify(pages)});
500
+ const MARKDOWN_ACCEPT = /text\\/(?:markdown|plain)/i;
493
501
  export default function(event) {
494
502
  const url = new URL(event.req.url);
495
503
  const target = redirects.get(url.pathname);
496
504
  if (target !== undefined) return new Response(null, { status: 308, headers: { Location: target + url.search } });
505
+ if (pages.has(url.pathname)) {
506
+ if (MARKDOWN_ACCEPT.test(event.req.headers.get("accept") || "")) return;
507
+ event.res.headers.append("Vary", "Accept");
508
+ }
497
509
  return serve(event);
498
510
  }`;
499
511
  }
@@ -578,7 +590,7 @@ async function resolveHashedClientJsSrc(clientOutputDir) {
578
590
  // src/nitro/universal-build.ts
579
591
  import os from "os";
580
592
  import path17 from "path";
581
- import { constants as fsConstants, existsSync as existsSync3, readFileSync as readFileSync2, realpathSync as realpathSync3, statSync } from "fs";
593
+ import { constants as fsConstants2, existsSync as existsSync3, readFileSync as readFileSync2, realpathSync as realpathSync3, statSync } from "fs";
582
594
  import { initSync as initModuleLexer, parse as lexModule } from "es-module-lexer";
583
595
  import { fileURLToPath } from "url";
584
596
  import { builtinModules, createRequire as createRequire2 } from "module";
@@ -775,6 +787,7 @@ import fs from "fs/promises";
775
787
  import path4 from "path";
776
788
  var FARM_CLIENT_MODULE_PRELOADS_PLACEHOLDER = "__farm_client_module_preloads__";
777
789
  var FARM_CLIENT_MODULE_PRELOADS_FILE = "client-module-preloads.json";
790
+ var ROLLDOWN_RUNTIME_MODULE = "\0rolldown/runtime.js";
778
791
  function collectFarmClientModulePreloads(bundle, options) {
779
792
  const chunks = Object.values(bundle).filter(
780
793
  (output) => output.type === "chunk"
@@ -804,18 +817,38 @@ function collectFarmClientModulePreloads(bundle, options) {
804
817
  };
805
818
  const entryFiles = staticImports(entry, /* @__PURE__ */ new Set([entry.fileName]), []);
806
819
  const entryLoaded = /* @__PURE__ */ new Set([entry.fileName, ...entryFiles]);
820
+ const entryModule = entry.facadeModuleId;
821
+ const stubEntry = entry.moduleIds?.length === 0 && Boolean(entryModule);
822
+ const entryCodeFiles = entryFiles.filter((fileName) => {
823
+ const ids = byFile.get(fileName)?.moduleIds;
824
+ if (!ids) return false;
825
+ if (ids.length === 1 && ids[0] === ROLLDOWN_RUNTIME_MODULE) return true;
826
+ return stubEntry && ids.some((id) => id === entryModule || id === ROLLDOWN_RUNTIME_MODULE);
827
+ });
807
828
  const modules = {};
829
+ const addModule = (id, chunk) => {
830
+ const moduleId = id.split("?")[0];
831
+ if (!path4.isAbsolute(moduleId)) return;
832
+ const key = toViteModuleId(moduleId, options.root);
833
+ if (modules[key]) return;
834
+ const loaded = /* @__PURE__ */ new Set([...entryLoaded, chunk.fileName]);
835
+ modules[key] = [chunk.fileName, ...staticImports(chunk, loaded, [])].map(index);
836
+ };
808
837
  for (const chunk of chunks) {
809
838
  if (!chunk.isDynamicEntry || !chunk.facadeModuleId || entryLoaded.has(chunk.fileName)) {
810
839
  continue;
811
840
  }
812
- const moduleId = chunk.facadeModuleId.split("?")[0];
813
- if (!path4.isAbsolute(moduleId)) continue;
814
- const loaded = /* @__PURE__ */ new Set([...entryLoaded, chunk.fileName]);
815
- modules[toViteModuleId(moduleId, options.root)] = [
816
- chunk.fileName,
817
- ...staticImports(chunk, loaded, [])
818
- ].map(index);
841
+ addModule(chunk.facadeModuleId, chunk);
842
+ }
843
+ if (options.isDynamicallyImported) {
844
+ const dynamicTargets = new Set(chunks.flatMap((chunk) => chunk.dynamicImports ?? []));
845
+ for (const chunk of chunks) {
846
+ if (chunk.facadeModuleId || !dynamicTargets.has(chunk.fileName)) continue;
847
+ if (entryLoaded.has(chunk.fileName)) continue;
848
+ for (const id of chunk.moduleIds ?? []) {
849
+ if (options.isDynamicallyImported(id)) addModule(id, chunk);
850
+ }
851
+ }
819
852
  }
820
853
  const dynamicFiles = (moduleIds, before = []) => {
821
854
  const into = [];
@@ -840,6 +873,7 @@ function collectFarmClientModulePreloads(bundle, options) {
840
873
  return {
841
874
  files,
842
875
  entry: entryFiles.map(index),
876
+ ...entryCodeFiles.length > 0 ? { entryCode: entryCodeFiles.map(index) } : {},
843
877
  router: dynamicFiles(options.routerModules).map(index),
844
878
  ...rendererFiles.length > 0 ? { renderer: rendererFiles.map(index) } : {},
845
879
  ...rootFiles.length > 0 ? { root: rootFiles.map(index) } : {},
@@ -872,7 +906,8 @@ function createFarmClientModulePreloadPlugin(options) {
872
906
  ...options,
873
907
  rendererModules,
874
908
  actionModules,
875
- serverTreeModules
909
+ serverTreeModules,
910
+ isDynamicallyImported: (id) => (this.getModuleInfo(id)?.dynamicImporters.length ?? 0) > 0
876
911
  })
877
912
  )
878
913
  );
@@ -895,72 +930,6 @@ function encodeFarmBuildJSONPlaceholder(value) {
895
930
  return JSON.stringify(JSON.stringify(value)).slice(1, -1).replace(/'/g, "\\u0027").replace(/`/g, "\\u0060").replace(/\$/g, "\\u0024").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
896
931
  }
897
932
 
898
- // src/nitro/islands-react-chunk.ts
899
- var REACT_MODULE = /[\\/]node_modules[\\/](?:react|react-dom|scheduler)[\\/]/;
900
- var REACT_DOM_MODULE = /[\\/]node_modules[\\/]react-dom[\\/]/;
901
- var FARM_EAGER_COMPILE_HINT = "//# allFunctionsCalledOnLoad";
902
- function createFarmIslandsReactOutput() {
903
- let entryImportsReact;
904
- return {
905
- codeSplitting: {
906
- groups: [
907
- {
908
- debugName: "react",
909
- name(moduleId, context) {
910
- if (!REACT_MODULE.test(moduleId)) return null;
911
- entryImportsReact ?? (entryImportsReact = reactLoadsWithAnEntry(moduleId, context));
912
- return entryImportsReact ? null : "react";
913
- }
914
- }
915
- ]
916
- },
917
- // After minification, so the hint stays the chunk's first line; its source map accounts for it.
918
- // Rolldown adds a line after any string, an empty one too, so other chunks get none.
919
- postBanner: ((chunk) => entryImportsReact === false && chunk.moduleIds.some((id) => REACT_DOM_MODULE.test(id)) ? FARM_EAGER_COMPILE_HINT : void 0)
920
- };
921
- }
922
- function reactLoadsWithAnEntry(moduleId, context) {
923
- const react = /* @__PURE__ */ new Set();
924
- const pending = [moduleId];
925
- for (let id = pending.pop(); id !== void 0; id = pending.pop()) {
926
- if (react.has(id) || !REACT_MODULE.test(id)) continue;
927
- react.add(id);
928
- const info = context.getModuleInfo(id);
929
- if (info) pending.push(...info.importedIds, ...info.importers);
930
- }
931
- const seen = /* @__PURE__ */ new Set();
932
- pending.push(...react);
933
- for (let id = pending.pop(); id !== void 0; id = pending.pop()) {
934
- if (seen.has(id)) continue;
935
- seen.add(id);
936
- const info = context.getModuleInfo(id);
937
- if (!info) continue;
938
- if (info.isEntry) return true;
939
- pending.push(...info.importers);
940
- }
941
- return false;
942
- }
943
- var CHUNKING_OPTIONS = [
944
- "manualChunks",
945
- "advancedChunks",
946
- "codeSplitting",
947
- "inlineDynamicImports"
948
- ];
949
- function createFarmIslandsReactChunkPlugin() {
950
- return {
951
- name: "farm-islands-react-chunk",
952
- enforce: "post",
953
- outputOptions: {
954
- order: "post",
955
- handler(options) {
956
- if (CHUNKING_OPTIONS.some((key) => options[key] !== void 0)) return null;
957
- const { codeSplitting, postBanner } = createFarmIslandsReactOutput();
958
- return { ...options, codeSplitting, postBanner: options.postBanner ?? postBanner };
959
- }
960
- }
961
- };
962
- }
963
-
964
933
  // src/nitro/client-route-table.ts
965
934
  import fs2 from "fs/promises";
966
935
  import path5 from "path";
@@ -1237,6 +1206,7 @@ function normalizeManifestSource(root, modulePath) {
1237
1206
  }
1238
1207
 
1239
1208
  // src/nitro/vercel-route-runtime.ts
1209
+ import { constants as fsConstants } from "fs";
1240
1210
  import path8 from "path";
1241
1211
  async function createFarmVercelRouteRuntimeFunctions(outputDir, manifest, fs5, basePath = "/") {
1242
1212
  const dynamicRoutes = manifest.routes.filter(
@@ -1269,7 +1239,8 @@ async function createFarmVercelRouteRuntimeFunctions(outputDir, manifest, fs5, b
1269
1239
  groupIndex += 1;
1270
1240
  const functionName = `__farm_runtime_${groupIndex}`;
1271
1241
  const functionDir = path8.join(functionsDir, `${functionName}.func`);
1272
- await fs5.cp(baseFunctionDir, functionDir, { recursive: true, force: true });
1242
+ await fs5.rm(functionDir, { recursive: true, force: true });
1243
+ await linkVercelFunctionFiles(baseFunctionDir, functionDir, fs5);
1273
1244
  await configureVercelFunction(functionDir, group.config, fs5);
1274
1245
  destinations.set(key, `/${functionName}`);
1275
1246
  }
@@ -1288,6 +1259,26 @@ async function createFarmVercelRouteRuntimeFunctions(outputDir, manifest, fs5, b
1288
1259
  }
1289
1260
  return routes;
1290
1261
  }
1262
+ var LINK_FALLBACK_CODES = /* @__PURE__ */ new Set(["EXDEV", "EPERM", "ENOTSUP", "EMLINK"]);
1263
+ async function linkVercelFunctionFiles(source, target, fs5, root = true) {
1264
+ await fs5.mkdir(target, { recursive: true });
1265
+ const entries = await fs5.readdir(source, { withFileTypes: true });
1266
+ await Promise.all(
1267
+ entries.map(async (entry) => {
1268
+ const from = path8.join(source, entry.name);
1269
+ const to = path8.join(target, entry.name);
1270
+ if (entry.isDirectory()) return linkVercelFunctionFiles(from, to, fs5, false);
1271
+ if (entry.isSymbolicLink()) return fs5.cp(from, to, { verbatimSymlinks: true });
1272
+ if (root && entry.name === ".vc-config.json") return fs5.copyFile(from, to);
1273
+ try {
1274
+ await fs5.link(from, to);
1275
+ } catch (error) {
1276
+ if (!LINK_FALLBACK_CODES.has(error.code ?? "")) throw error;
1277
+ await fs5.copyFile(from, to, fsConstants.COPYFILE_FICLONE);
1278
+ }
1279
+ })
1280
+ );
1281
+ }
1291
1282
  function farmRoutePatternToVercelSource(pattern, basePath = "/") {
1292
1283
  const normalized = normalizePattern(pattern);
1293
1284
  const normalizedBasePath = normalizeBasePath(basePath);
@@ -1418,21 +1409,31 @@ function createFarmVercelImmutableAssetRoute() {
1418
1409
  };
1419
1410
  }
1420
1411
  function buildFarmVercelRoutes(options) {
1421
- const { presetRoutes, runtimeRoutes, middlewareRoutes = [], canonicalSlashRoutes = [] } = options;
1412
+ const {
1413
+ presetRoutes,
1414
+ runtimeRoutes,
1415
+ middlewareRoutes = [],
1416
+ canonicalSlashRoutes = [],
1417
+ markdownRoutes = [],
1418
+ notFoundRoutes
1419
+ } = options;
1422
1420
  const filesystemIndex = presetRoutes.findIndex((route) => route.handle === "filesystem");
1423
1421
  const sourceRoutes = filesystemIndex >= 0 ? presetRoutes.slice(0, filesystemIndex) : [];
1424
1422
  const preservedSourceRoutes = sourceRoutes.filter((route) => route.continue !== true);
1425
1423
  return [
1424
+ ...markdownRoutes,
1426
1425
  ...middlewareRoutes,
1427
1426
  ...preservedSourceRoutes,
1428
1427
  ...canonicalSlashRoutes,
1429
1428
  createFarmVercelImmutableAssetRoute(),
1430
1429
  { handle: "filesystem" },
1431
1430
  ...runtimeRoutes,
1432
- {
1433
- src: "/(.*)",
1434
- dest: "/__nitro"
1435
- }
1431
+ ...notFoundRoutes ?? [
1432
+ {
1433
+ src: "/(.*)",
1434
+ dest: "/__nitro"
1435
+ }
1436
+ ]
1436
1437
  ];
1437
1438
  }
1438
1439
  function escapeRegExp2(value) {
@@ -1473,6 +1474,91 @@ function createFarmVercelCanonicalSlashRoutes(publicPaths) {
1473
1474
  dest: "/__nitro"
1474
1475
  }));
1475
1476
  }
1477
+ var FARM_VERCEL_MARKDOWN_ACCEPT_PATTERN = ".*text/(?:markdown|plain).*";
1478
+ function createFarmVercelMarkdownRoutes(publicPaths) {
1479
+ return groupFarmVercelRouteAlternatives([...new Set(publicPaths)], escapeRegExp2).map((group) => ({
1480
+ src: group.src,
1481
+ has: [{ type: "header", key: "accept", value: FARM_VERCEL_MARKDOWN_ACCEPT_PATTERN }],
1482
+ dest: "/__nitro"
1483
+ }));
1484
+ }
1485
+
1486
+ // src/nitro/vercel-not-found.ts
1487
+ var FARM_STATIC_NOT_FOUND_PATH = "/404.html";
1488
+ var FARM_STATIC_NOT_FOUND_REFUSAL_TYPE = "application/x-farm-static-not-found-refusal";
1489
+ function createFarmVercelStaticNotFoundRoutes(input) {
1490
+ const basePath = normalizeBasePath2(input.basePath);
1491
+ const alternatives = /* @__PURE__ */ new Set();
1492
+ for (const base of /* @__PURE__ */ new Set(["", basePath])) {
1493
+ for (const pattern of input.routePatterns) {
1494
+ alternatives.add(withOptionalTrailingSlash(farmRoutePatternToVercelSource(pattern, base)));
1495
+ }
1496
+ for (const pattern of input.prefixPatterns) {
1497
+ const source = farmRoutePatternToVercelSource(pattern, base);
1498
+ alternatives.add(source === "/" ? "/.*" : `${source}(?:/.*)?`);
1499
+ }
1500
+ for (const pathname of input.paths) {
1501
+ alternatives.add(withOptionalTrailingSlash(escapeRegExp3(withBasePath(pathname, base))));
1502
+ }
1503
+ for (const source of input.matcherSources) {
1504
+ const alternative = getFarmMatcherSourceAlternative(source);
1505
+ if (alternative === null) {
1506
+ throw new Error(
1507
+ `Farm cannot serve a static 404 page: ${JSON.stringify(source)} can match any path.`
1508
+ );
1509
+ }
1510
+ alternatives.add(`${escapeRegExp3(base)}${alternative}`);
1511
+ }
1512
+ alternatives.add(`${escapeRegExp3(base)}/.*\\.md`);
1513
+ }
1514
+ return [
1515
+ ...groupFarmVercelRouteAlternatives([...alternatives], (source) => source).map((group) => ({
1516
+ src: group.src,
1517
+ dest: "/__nitro"
1518
+ })),
1519
+ {
1520
+ src: "/.*",
1521
+ has: [{ type: "header", key: "accept", value: FARM_VERCEL_MARKDOWN_ACCEPT_PATTERN }],
1522
+ dest: "/__nitro"
1523
+ },
1524
+ { src: "/.*", dest: withBasePath(FARM_STATIC_NOT_FOUND_PATH, basePath), status: 404 }
1525
+ ];
1526
+ }
1527
+ function getFarmMatcherSourceAlternative(source) {
1528
+ const normalized = source.startsWith("/") ? source : `/${source}`;
1529
+ const special = normalized.search(/[:*?()[\]{}+\\|^$]/);
1530
+ const literal = special === -1 ? normalized : normalized.slice(0, special);
1531
+ const prefix = literal.replace(/\/+$/, "");
1532
+ if (special === -1) return prefix ? `${escapeRegExp3(prefix)}(?:/.*)?` : "/?";
1533
+ if (literal.endsWith("/")) return prefix ? `${escapeRegExp3(prefix)}(?:/.*)?` : null;
1534
+ return `${escapeRegExp3(literal)}.*`;
1535
+ }
1536
+ function getFarmStaticNotFoundHandlerSources(handlers, farmHandlers) {
1537
+ const sources = [];
1538
+ for (const handler of handlers) {
1539
+ if (farmHandlers.has(handler.handler)) continue;
1540
+ if (!handler.route || getFarmMatcherSourceAlternative(handler.route) === null) return null;
1541
+ sources.push(handler.route);
1542
+ }
1543
+ return sources;
1544
+ }
1545
+ function withOptionalTrailingSlash(source) {
1546
+ return source === "/" || source.endsWith("/") ? source : `${source}/?`;
1547
+ }
1548
+ function withBasePath(pathname, basePath) {
1549
+ const normalized = pathname.startsWith("/") ? pathname : `/${pathname}`;
1550
+ if (!basePath) return normalized;
1551
+ return normalized === "/" ? basePath : `${basePath}${normalized}`;
1552
+ }
1553
+ function normalizeBasePath2(value) {
1554
+ const trimmed = value?.trim() ?? "";
1555
+ if (!trimmed || trimmed === "/") return "";
1556
+ const withSlash = trimmed.startsWith("/") ? trimmed : `/${trimmed}`;
1557
+ return withSlash.replace(/\/+$/g, "");
1558
+ }
1559
+ function escapeRegExp3(value) {
1560
+ return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
1561
+ }
1476
1562
 
1477
1563
  // src/nitro/ssr-public-assets.ts
1478
1564
  import path10 from "path";
@@ -1879,6 +1965,95 @@ async function writeFarmClientBrotliAssets(clientOutputDir) {
1879
1965
  await Promise.all(Array.from({ length: availableParallelism() }, next));
1880
1966
  }
1881
1967
 
1968
+ // src/nitro/islands-react-chunk.ts
1969
+ var REACT_MODULE = /[\\/]node_modules[\\/](?:react|react-dom|scheduler)[\\/]/;
1970
+ var REACT_DOM_MODULE = /[\\/]node_modules[\\/]react-dom[\\/]/;
1971
+ var FARM_EAGER_COMPILE_HINT = "//# allFunctionsCalledOnLoad";
1972
+ function createFarmIslandsReactOutput() {
1973
+ let entryImportsReact;
1974
+ return {
1975
+ codeSplitting: {
1976
+ groups: [
1977
+ {
1978
+ debugName: "react",
1979
+ name(moduleId, context) {
1980
+ if (!REACT_MODULE.test(moduleId)) return null;
1981
+ entryImportsReact ?? (entryImportsReact = reactLoadsWithAnEntry(moduleId, context));
1982
+ return entryImportsReact ? null : "react";
1983
+ }
1984
+ }
1985
+ ]
1986
+ },
1987
+ // After minification, so the hint stays the chunk's first line; its source map accounts for it.
1988
+ // Rolldown adds a line after any string, an empty one too, so other chunks get none.
1989
+ postBanner: ((chunk) => entryImportsReact === false && chunk.moduleIds.some((id) => REACT_DOM_MODULE.test(id)) ? FARM_EAGER_COMPILE_HINT : void 0)
1990
+ };
1991
+ }
1992
+ function reactLoadsWithAnEntry(moduleId, context) {
1993
+ const react = /* @__PURE__ */ new Set();
1994
+ const pending = [moduleId];
1995
+ for (let id = pending.pop(); id !== void 0; id = pending.pop()) {
1996
+ if (react.has(id) || !REACT_MODULE.test(id)) continue;
1997
+ react.add(id);
1998
+ const info = context.getModuleInfo(id);
1999
+ if (info) pending.push(...info.importedIds, ...info.importers);
2000
+ }
2001
+ const seen = /* @__PURE__ */ new Set();
2002
+ pending.push(...react);
2003
+ for (let id = pending.pop(); id !== void 0; id = pending.pop()) {
2004
+ if (seen.has(id)) continue;
2005
+ seen.add(id);
2006
+ const info = context.getModuleInfo(id);
2007
+ if (!info) continue;
2008
+ if (info.isEntry) return true;
2009
+ pending.push(...info.importers);
2010
+ }
2011
+ return false;
2012
+ }
2013
+
2014
+ // src/nitro/client-chunks.ts
2015
+ var FARM_CLIENT_INLINE_CHUNK_BYTES = 32 * 1024;
2016
+ var STYLE_MODULE = /\.(?:css|scss|sass|less|styl|stylus|pcss|postcss|sss)(?:\?|$)/;
2017
+ var CHUNKING_OPTIONS = [
2018
+ "manualChunks",
2019
+ "advancedChunks",
2020
+ "codeSplitting",
2021
+ "inlineDynamicImports"
2022
+ ];
2023
+ function canInlineCommonChunks(options) {
2024
+ const format = options.format ?? "es";
2025
+ return (format === "es" || format === "esm" || format === "module") && options.strictExecutionOrder !== false && !options.preserveModules;
2026
+ }
2027
+ function createFarmClientChunksPlugin(options) {
2028
+ return {
2029
+ name: "farm-client-chunks",
2030
+ enforce: "post",
2031
+ outputOptions: {
2032
+ order: "post",
2033
+ handler(output) {
2034
+ if (CHUNKING_OPTIONS.some((key) => output[key] !== void 0)) return null;
2035
+ const inline = options.inlineCommonChunks && canInlineCommonChunks(output);
2036
+ const islands = options.islandsReact ? createFarmIslandsReactOutput() : void 0;
2037
+ if (!inline && !islands) return null;
2038
+ const codeSplitting = {
2039
+ ...islands?.codeSplitting,
2040
+ ...inline ? {
2041
+ experimentalInlineCommonChunks: {
2042
+ maxSize: FARM_CLIENT_INLINE_CHUNK_BYTES,
2043
+ exclude: STYLE_MODULE
2044
+ }
2045
+ } : {}
2046
+ };
2047
+ return {
2048
+ ...output,
2049
+ codeSplitting,
2050
+ ...islands ? { postBanner: output.postBanner ?? islands.postBanner } : {}
2051
+ };
2052
+ }
2053
+ }
2054
+ };
2055
+ }
2056
+
1882
2057
  // src/middleware/static-config.ts
1883
2058
  function literalMatcher(node) {
1884
2059
  if (!node) return void 0;
@@ -1967,7 +2142,7 @@ function farmTargetRunsEdgeMiddleware(preset) {
1967
2142
  function isFarmEdgeMiddlewareRoute(route) {
1968
2143
  return typeof route.config === "object" && route.config?.runtime === "edge";
1969
2144
  }
1970
- function escapeRegExp3(value) {
2145
+ function escapeRegExp4(value) {
1971
2146
  return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
1972
2147
  }
1973
2148
  function toFarmVercelEdgeGuardedUrls(pathnames, basePath) {
@@ -1979,7 +2154,7 @@ function createFarmVercelEdgeMiddlewareRoutes(pathnames, basePath = "/") {
1979
2154
  const publicPaths = toFarmVercelEdgeGuardedUrls(pathnames, basePath);
1980
2155
  return groupFarmVercelRouteAlternatives(publicPaths, (pathname) => {
1981
2156
  const trimmed = pathname.replace(/\/+$/, "");
1982
- return trimmed ? `${escapeRegExp3(trimmed)}(?:/|/index\\.html|\\.html)?` : "/(?:index\\.html)?";
2157
+ return trimmed ? `${escapeRegExp4(trimmed)}(?:/|/index\\.html|\\.html)?` : "/(?:index\\.html)?";
1983
2158
  }).map((group) => ({
1984
2159
  src: group.src,
1985
2160
  middlewarePath: FARM_VERCEL_EDGE_MIDDLEWARE_FUNCTION,
@@ -2249,6 +2424,7 @@ var NITRO_EXTERNAL_MODULES = /* @__PURE__ */ new Set([
2249
2424
  var NITRO_REACT_RUNTIME_MODULES = /* @__PURE__ */ new Set(["react", "react-dom", "react-dom/server"]);
2250
2425
  var FARM_SSR_PACKAGE_IMPORT = "#farm-ssr-entry";
2251
2426
  var FARM_SSR_OUTPUT_DIR = "farm-ssr";
2427
+ var PREBUILT_SSR_PRESETS = /* @__PURE__ */ new Set(["node-server", "vercel"]);
2252
2428
  var FARM_CLIENT_BUILD_TARGET = ["es2020", "edge88", "firefox78", "chrome87", "safari14"];
2253
2429
  function resolveNitroRuntimeDependency(root, specifier) {
2254
2430
  return createRequire2(resolveNitroPackageEntry(root)).resolve(specifier).split(path17.sep).join("/");
@@ -2750,6 +2926,13 @@ function resolveBuildDocsContentDir(docs, root, srcDir) {
2750
2926
  const rootDocsDir = path17.join(root, entryDir);
2751
2927
  return existsSync3(rootDocsDir) ? rootDocsDir : null;
2752
2928
  }
2929
+ function getFarmDocsBundledRootPaths(docs, root, srcDir) {
2930
+ return getFarmDocsRoots(docs).slice(1).map((docsRoot) => {
2931
+ const contentDir = resolveBuildDocsContentDir(docsRoot, root, srcDir);
2932
+ const relativePath = contentDir ? path17.relative(root, contentDir) : "";
2933
+ return relativePath === ".." || relativePath.startsWith(`..${path17.sep}`) || path17.isAbsolute(relativePath) ? "" : relativePath.split(path17.sep).join("/");
2934
+ });
2935
+ }
2753
2936
  function hasProjectPostcssConfig(root) {
2754
2937
  const candidates = [
2755
2938
  "postcss.config.js",
@@ -3128,7 +3311,11 @@ async function writeSSRAssetsToClient(bundle, outputDir, polyroute) {
3128
3311
  }
3129
3312
  const filePath = path17.join(outputDir, fileName);
3130
3313
  await fs5.mkdir(path17.dirname(filePath), { recursive: true });
3131
- await fs5.writeFile(filePath, output.source);
3314
+ try {
3315
+ await fs5.writeFile(filePath, output.source, { flag: "wx" });
3316
+ } catch (error) {
3317
+ if (error.code !== "EEXIST") throw error;
3318
+ }
3132
3319
  }
3133
3320
  }
3134
3321
  async function writeFarmVideoPlayerToClient(outputDir) {
@@ -3237,7 +3424,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3237
3424
  farmPlugin,
3238
3425
  farmServerOnlyEntriesPlugin
3239
3426
  } = await import("./vite.mjs");
3240
- const { PluginManager: PluginManager2 } = await import("./plugin-EVKQZBNW.mjs");
3427
+ const { PluginManager: PluginManager2 } = await import("./plugin-B7I5QVBE.mjs");
3241
3428
  const fs5 = await import("fs/promises");
3242
3429
  const pluginManager = new PluginManager2({
3243
3430
  config,
@@ -3250,11 +3437,11 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3250
3437
  (provider) => provider.component || provider.type === "clerk"
3251
3438
  );
3252
3439
  const unsupportedIntegrationProvider = integrationProviders.find(
3253
- (provider) => provider.supportsIsolatedHydration !== true
3440
+ (provider) => !providerSupportsIslands(provider)
3254
3441
  );
3255
3442
  if (config.experimental?.isolatedClientHydration === "enabled" && resolveFarmServerComponentsMode(config.experimental?.serverComponents) !== "rsc" && unsupportedIntegrationProvider) {
3256
3443
  logger.warn(
3257
- `[Farm.js] isolated hydration kept route-wide because integration provider "${unsupportedIntegrationProvider.name}" does not declare supportsIsolatedHydration: true.`
3444
+ `[Farm.js] Client components hydrate with their route, not as islands, because integration provider "${unsupportedIntegrationProvider.name}" doesn't declare \`islands: true\`.`
3258
3445
  );
3259
3446
  }
3260
3447
  const isolatedMode = resolveFarmIsolatedClientHydrationMode(
@@ -3691,9 +3878,17 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3691
3878
  ...tailwindVitePlugin ? [tailwindVitePlugin] : [],
3692
3879
  ...rendererVitePlugins,
3693
3880
  ...config.vite.plugins || [],
3694
- // React in one chunk, unless the app's config or one of its plugins splits chunks.
3695
- ...islandsMode && isReactRenderer(config.renderer) ? [createFarmIslandsReactChunkPlugin()] : [],
3696
- farmServerOnlyEntriesPlugin({ platform, distDir: config.distDir || ".farm" }),
3881
+ // Small shared chunks copied into their readers, and React in one chunk in islands mode,
3882
+ // unless the app's config or one of its plugins splits chunks.
3883
+ createFarmClientChunksPlugin({
3884
+ inlineCommonChunks: platform === "web",
3885
+ islandsReact: islandsMode && isReactRenderer(config.renderer)
3886
+ }),
3887
+ farmServerOnlyEntriesPlugin({
3888
+ // A desktop app's client is the web target, and its `platform()` says "desktop".
3889
+ platform: platform === "web" && config.desktop ? "desktop" : platform,
3890
+ distDir: config.distDir || ".farm"
3891
+ }),
3697
3892
  farmNavigationPlugin(config.renderer),
3698
3893
  farmDocsClientConfigPlugin(
3699
3894
  adapterOwnsDocsRuntime ? getFarmDocsAdapterConfigModule(config.docs) : void 0
@@ -7350,7 +7545,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
7350
7545
  farmPlugin,
7351
7546
  farmServerOnlyEntriesPlugin
7352
7547
  } = await import("./vite.mjs");
7353
- const { PluginManager: PluginManager2 } = await import("./plugin-EVKQZBNW.mjs");
7548
+ const { PluginManager: PluginManager2 } = await import("./plugin-B7I5QVBE.mjs");
7354
7549
  const fs5 = await import("fs/promises");
7355
7550
  const pluginManager = new PluginManager2({
7356
7551
  config,
@@ -7454,7 +7649,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
7454
7649
  const appDirs = getFarmAppDirectories(config);
7455
7650
  let openAPIReference = null;
7456
7651
  if (config.openapi.enabled && config.openapi.route) {
7457
- const { OpenAPIManager, renderOpenAPIReferenceHTML } = await import("./manager-7BNSJKME.mjs");
7652
+ const { OpenAPIManager, renderOpenAPIReferenceHTML } = await import("./manager-GZUTAN5Q.mjs");
7458
7653
  const openAPIManager = new OpenAPIManager(appDirs, config.openapi, {
7459
7654
  mode: "production",
7460
7655
  apiBaseURL: config.api.baseURL,
@@ -7866,7 +8061,10 @@ function generateFarmDocsAdapterHandlerArguments(docs, docsConfigModulePath) {
7866
8061
  if (docs?.roots?.length) {
7867
8062
  return {
7868
8063
  factory: "createFarmDocsAdapterMultiRuntimeHandler",
7869
- config: `[farmDocsResolvedConfig, ...farmDocsResolvedConfig.roots].map((farmDocsRoot) => (${runtimeConfig("farmDocsRoot")}))`
8064
+ config: `[farmDocsResolvedConfig, ...farmDocsResolvedConfig.roots].map((farmDocsRoot) => ({
8065
+ ...${runtimeConfig("farmDocsRoot")},
8066
+ rootDir: farmDocsRoot.rootDir || farmDocsRuntimeRoot,
8067
+ }))`
7870
8068
  };
7871
8069
  }
7872
8070
  return {
@@ -7874,7 +8072,7 @@ function generateFarmDocsAdapterHandlerArguments(docs, docsConfigModulePath) {
7874
8072
  config: runtimeConfig("farmDocsResolvedConfig")
7875
8073
  };
7876
8074
  }
7877
- function generateFarmDocsRuntimeConfigExpression(docs, precompiled = false) {
8075
+ function generateFarmDocsRuntimeConfigExpression(docs, precompiled = false, bundledRootPaths = []) {
7878
8076
  if (!docs.enabled) return "null";
7879
8077
  const serializableDocs = docs.roots?.length ? {
7880
8078
  ...docs,
@@ -7911,17 +8109,18 @@ function generateFarmDocsRuntimeConfigExpression(docs, precompiled = false) {
7911
8109
  }
7912
8110
  : ${JSON.stringify({ ...serializableDocs, runtimeConfig: void 0 })}`;
7913
8111
  if (!docs.roots?.length) return expression;
7914
- return `((farmDocs) => ({
8112
+ return `((farmDocs, farmDocsBundledRootPaths) => ({
7915
8113
  ...farmDocs,
7916
8114
  roots: farmDocs.roots.map((farmDocsRoot, index) => {
7917
- const contentDir = farmDocsBundledRootsDir
8115
+ const rootDir = farmDocsBundledRootsDir
7918
8116
  ? farmDocsJoin(farmDocsBundledRootsDir, String(index))
7919
8117
  : null;
8118
+ const contentDir = rootDir && farmDocsJoin(rootDir, farmDocsBundledRootPaths[index] || "");
7920
8119
  return contentDir && farmDocsExistsSync(contentDir)
7921
- ? { ...farmDocsRoot, contentDir, config: { ...farmDocsRoot.config, contentDir } }
8120
+ ? { ...farmDocsRoot, rootDir, contentDir, config: { ...farmDocsRoot.config, contentDir } }
7922
8121
  : farmDocsRoot;
7923
8122
  }),
7924
- }))(${expression})`;
8123
+ }))(${expression}, ${JSON.stringify(bundledRootPaths)})`;
7925
8124
  }
7926
8125
  function toVirtualEntryImportSpecifier(modulePath) {
7927
8126
  return JSON.stringify(modulePath.replace(/\\/g, "/"));
@@ -8242,6 +8441,7 @@ ReactDOMServer.configureApp(__farmAppSetup);`;
8242
8441
  }
8243
8442
  function generateVirtualEntryCode(apiRoutes, pageRoutes, layoutRoutes, routeSlots, errorRoutes, metadataImageRoutes, applicationMetadataRoutes, middlewareRoutes, redirectRoutes, configuredRewriteRoutes, configuredHeaderRoutes, openAPIReference, notFoundPath, instrumentationPath, config, farmDocsPrecompiledManifest, configModulePath, hasServerRuntimeIntegrations, hasRuntimeIntegrationConfig, hasConfiguredRuntimePlugins, hasServerRuntimePlugins, preset, i18nCatalogs, isolatedClientBoundaryModules, hydrationPlanCache, mobileShellLoadingRoutes = [], farmDocsAnalyticsPages = []) {
8244
8443
  const farmRendererDisabled = isFarmRendererDisabled(config.renderer);
8444
+ const farmStaticNotFoundBuild = preset === "vercel" && config.experimental?.staticNotFound === true && !farmRendererDisabled;
8245
8445
  const searchPreserveRoutes = pageRoutes.flatMap(
8246
8446
  (route) => route.searchPreserve ? [route.searchPreserve] : []
8247
8447
  );
@@ -8366,7 +8566,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
8366
8566
  })
8367
8567
  );
8368
8568
  const unsupportedIntegrationProvider = renderedIntegrationProviders.find(
8369
- (provider) => provider.supportsIsolatedHydration !== true
8569
+ (provider) => !providerSupportsIslands(provider)
8370
8570
  );
8371
8571
  const isolatedHydrationMode = resolveFarmIsolatedClientHydrationMode(
8372
8572
  config.experimental?.isolatedClientHydration,
@@ -8435,12 +8635,16 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
8435
8635
  ].filter(Boolean).join("\n");
8436
8636
  const apiImports = [];
8437
8637
  const apiRegistrations = [];
8638
+ const nativeAPIRoutes = [];
8438
8639
  apiRoutes.forEach((route, index) => {
8439
8640
  if (!route.filePath) return;
8440
8641
  const varName = `apiRoute${index}`;
8441
8642
  apiImports.push(
8442
8643
  `import * as ${varName} from ${toVirtualEntryImportSpecifier(route.filePath)};`
8443
8644
  );
8645
+ if (isPolyrouteRouteFileName(path17.basename(route.filePath))) {
8646
+ nativeAPIRoutes.push(`[${JSON.stringify(route.path)}, ${varName}]`);
8647
+ }
8444
8648
  apiRegistrations.push(`
8445
8649
  {
8446
8650
  path: ${JSON.stringify(route.path)},
@@ -9112,7 +9316,24 @@ const FarmDefault404Page = typeof React.markFunctionComponent === "function"
9112
9316
  function createFarmNotFoundElement(pathname) {
9113
9317
  const NotFoundPage = hasCustomNotFound && CustomNotFoundComponent ? CustomNotFoundComponent : FarmDefault404Page;
9114
9318
  return React.createElement(NotFoundPage, { pathname: pathname });
9319
+ }${farmStaticNotFoundBuild ? `
9320
+
9321
+ // The build's own request for the not-found page it writes for Vercel. Nitro's prerender worker
9322
+ // sets the variable, so no visitor's request is mistaken for it.
9323
+ function isFarmStaticNotFoundPrerender(pathname) {
9324
+ return (
9325
+ typeof process !== "undefined" &&
9326
+ process.env?.${FARM_PRERENDER_ENV} === "1" &&
9327
+ pathname === ${JSON.stringify(applyFarmBasePath(FARM_STATIC_NOT_FOUND_PATH, config.basePath))}
9328
+ );
9115
9329
  }
9330
+
9331
+ function createFarmStaticNotFoundRefusal(reason) {
9332
+ return new Response(reason, {
9333
+ status: 404,
9334
+ headers: { "Content-Type": ${JSON.stringify(FARM_STATIC_NOT_FOUND_REFUSAL_TYPE)} },
9335
+ });
9336
+ }` : ""}
9116
9337
  ${nativeMCP.registerSource}
9117
9338
  // Config middleware from layers is appended in layer order ahead of the
9118
9339
  // project's, the same merge development applies (mergeFarmLayerConfig).
@@ -9323,7 +9544,11 @@ const farmDocsBundledRootsDir = (() => {
9323
9544
  return null;
9324
9545
  }
9325
9546
  })();` : ""}
9326
- const farmDocsResolvedConfig = ${generateFarmDocsRuntimeConfigExpression(config.docs, hasPrecompiledDocs)};
9547
+ const farmDocsResolvedConfig = ${generateFarmDocsRuntimeConfigExpression(
9548
+ config.docs,
9549
+ hasPrecompiledDocs,
9550
+ config.docs?.enabled && config.docs.roots?.length ? getFarmDocsBundledRootPaths(config.docs, config.root, config.srcDir) : []
9551
+ )};
9327
9552
  const farmDocsRuntimeRoot = ${hasPrecompiledDocs ? '"."' : `farmDocsBundledContentDir || ${JSON.stringify(config.root)}`};
9328
9553
  // Docs pages a path-specific guard covers, decided at build time. The docs API and the
9329
9554
  // root llms/sitemap files answer anyone, so they leave these pages out.
@@ -9363,8 +9588,8 @@ const farmDocsModulePreloadPaths = farmDocsModulePreloads
9363
9588
  : undefined;
9364
9589
  ${adapterOwnsDocsRuntime && !hasPrecompiledDocs ? `// The renderer contract's server exports, for a docs UI that builds its pages with them.
9365
9590
  const farmDocsAppRenderer = ${isReactRenderer(config.renderer) ? '{ name: "react", createElement: React.createElement, Fragment: React.Fragment, renderToString: ReactDOMServer.renderToString }' : "__farmRendererServer"};
9366
- ` : ""}const farmDocsHandler = ${config.docs?.enabled ? hasPrecompiledDocs ? "farmDocsPrecompiledRuntime.handleDocsRequest" : adapterOwnsDocsRuntime ? `${adapterHandler.factory}(${adapterHandler.config}, {
9367
- rootDir: farmDocsRuntimeRoot,
9591
+ ` : ""}const farmDocsHandler = ${config.docs?.enabled ? hasPrecompiledDocs ? "farmDocsPrecompiledRuntime.handleDocsRequest" : adapterOwnsDocsRuntime ? `${adapterHandler.factory}(${adapterHandler.config}, {${config.docs.roots?.length ? "" : `
9592
+ rootDir: farmDocsRuntimeRoot,`}
9368
9593
  // A production build's content cannot change, so the adapter reads its
9369
9594
  // navigation once instead of scanning the content directory per request.
9370
9595
  immutableContent: true,
@@ -9415,6 +9640,22 @@ const farmDocsAppRenderer = ${isReactRenderer(config.renderer) ? '{ name: "react
9415
9640
  })` : "null"};
9416
9641
  const farmDocsAPIHandler = ${config.docs?.enabled ? hasPrecompiledDocs ? "farmDocsPrecompiledRuntime.handleAPIRequest" : adapterOwnsDocsRuntime ? "null" : `createFarmDocsAPIHandler({ rootDir: farmDocsRuntimeRoot, srcDir: ${JSON.stringify(config.srcDir)}, docs: farmDocsResolvedConfig, isPathGuarded: isFarmDocsPathGuarded, basePath: ${JSON.stringify(config.basePath)} })` : "null"};
9417
9642
 
9643
+ // A long-running server calls this before it listens, so a Polyroute route's first request
9644
+ // doesn't wait for its WebAssembly to compile and its instance to start. Polyroute releases
9645
+ // without \`prepare()\` skip it. Polyroute doesn't keep a failed start, so a route that
9646
+ // fails here tries again on its first request, as it did before this step existed.
9647
+ export async function farmPrepareNativeRoutes() {${nativeAPIRoutes.length > 0 ? `
9648
+ await Promise.all(
9649
+ [${nativeAPIRoutes.join(", ")}].map(async ([routePath, routeModule]) => {
9650
+ try {
9651
+ await routeModule.default?.prepare?.();
9652
+ } catch (error) {
9653
+ console.error(\`[Farm] Couldn't prepare route \${routePath} before listening; its first request will try again:\`, error);
9654
+ }
9655
+ }),
9656
+ );
9657
+ ` : ""}}
9658
+
9418
9659
  // API routes bundled at build time
9419
9660
  const apiRoutes = ${apiRoutes.length > 0 ? "mergePluginAPIRoutes(" : ""}[${apiRegistrations.join(",")}
9420
9661
  ]${apiRoutes.length > 0 ? `, configuredPlugins, ${JSON.stringify(apiRoutes.map(({ path: path19, methods }) => ({ path: path19, methods })))}, { bodySizeLimit: ${JSON.stringify(config.server.bodySizeLimit)}, dispatch: dispatchFarmPluginAPIRequest })` : ""};
@@ -10468,10 +10709,14 @@ const FARM_ACTION_REFERENCE_PATTERN = /"\\$":"a"|name="\\$F_REF_/;
10468
10709
  // A server tree in a document's markup: the payload a page or layout root rebuilds from.
10469
10710
  const FARM_SERVER_TREE_PATTERN = /<script type="f\\/tree"/;
10470
10711
 
10712
+ // What the entry runs before its own code (Rolldown's runtime, and the chunk holding the entry's
10713
+ // code when the entry chunk is a stub) loads at the entry script's priority. The other preloads
10714
+ // are low, so they don't hold back the first paint's CSS and fonts.
10471
10715
  function renderFarmClientModulePreload(index) {
10716
+ const entryCode = farmClientModulePreloads.entryCode;
10472
10717
  return '\\n <link rel="modulepreload" href="/' +
10473
10718
  escapeFarmHtmlAttribute(farmClientModulePreloads.files[index]) +
10474
- '" fetchpriority="low">';
10719
+ (entryCode && entryCode.includes(index) ? '">' : '" fetchpriority="low">');
10475
10720
  }
10476
10721
 
10477
10722
  // The manifest indexes of the modules a document's hydrating page and its markup
@@ -12024,6 +12269,10 @@ ${hasServerRuntimeIntegrations ? `
12024
12269
  // In place for a page the adapter built with createHtmlResponse, so its HTML string stays.
12025
12270
  const bufferedDocsResponse = farmPreloadHeadersResponse(wrappedDocsResponse, (headers) => {
12026
12271
  headers.set("x-farm-preload-buffered", "1");
12272
+ // The docs engine answers this URL with Markdown for an Accept that asks for it, so a
12273
+ // shared cache keys the page on Accept. An adapter's page does not always say so, and
12274
+ // only a page that is also an app route gets it from Markdown negotiation.
12275
+ appendFarmVary(headers, "Accept");
12027
12276
  });
12028
12277
  return applyProductionMiddlewareHeaders(bufferedDocsResponse, middlewareHeaders);
12029
12278
  }
@@ -13586,7 +13835,8 @@ ${farmRendererDisabled ? `
13586
13835
  ), middlewareHeaders);
13587
13836
  }
13588
13837
 
13589
- try {
13838
+ try {${farmStaticNotFoundBuild ? `
13839
+ const farmNotFoundRequestReads = _getRequestReadCount() + _getRequestCookieReadCount();` : ""}
13590
13840
  // Wrap 404 page with root layout if available
13591
13841
  let notFoundElement = createFarmNotFoundElement(pathname);
13592
13842
  // No page matched, so a layout inside a route group cannot apply.
@@ -13610,8 +13860,16 @@ ${farmRendererDisabled ? `
13610
13860
  hasCustomNotFound ? CustomNotFoundModule : null,
13611
13861
  ),
13612
13862
  { pathname },
13613
- );
13614
-
13863
+ );${farmStaticNotFoundBuild ? `
13864
+ // experimental.staticNotFound: Vercel serves this render to every missing URL. A render that
13865
+ // read cookies or headers, here or through an auth helper, belongs to one visitor.
13866
+ if (
13867
+ isFarmStaticNotFoundPrerender(pathname) &&
13868
+ _getRequestReadCount() + _getRequestCookieReadCount() !== farmNotFoundRequestReads
13869
+ ) {
13870
+ return createFarmStaticNotFoundRefusal("the not-found page reads cookies or headers");
13871
+ }` : ""}
13872
+
13615
13873
  // Check if layout provides full HTML document
13616
13874
  const fullDocument = extractFarmFullDocument(html);
13617
13875
  const hasFullDocument = fullDocument !== null;
@@ -13680,7 +13938,11 @@ ${farmRendererDisabled ? `
13680
13938
  }
13681
13939
  }), middlewareHeaders), fullHtml);
13682
13940
  } catch (error) {
13683
- console.error("404 render error:", error);
13941
+ console.error("404 render error:", error);${farmStaticNotFoundBuild ? `
13942
+ // The fallback names this request's path, which a file served at every URL can't.
13943
+ if (isFarmStaticNotFoundPrerender(pathname)) {
13944
+ return createFarmStaticNotFoundRefusal("the not-found page failed to render");
13945
+ }` : ""}
13684
13946
  const fallbackDocument = applyFarmThemeDocument(
13685
13947
  \`<!DOCTYPE html><html><head><title>404</title></head><body><h1>404 - Page Not Found</h1><p>The page \${pathname} doesn't exist.</p><a href="\${escapeFarmHtmlAttribute(applyFarmBasePath("/", farmResolvedRuntimeConfig.basePath))}">Go Home</a></body></html>\`,
13686
13948
  farmThemeConfig,
@@ -14048,6 +14310,189 @@ function getPhysicalPrerenderBypassReason(options) {
14048
14310
  }
14049
14311
  return void 0;
14050
14312
  }
14313
+ function normalizeStaticNotFoundPath(pathname) {
14314
+ const normalized = pathname.startsWith("/") ? pathname : `/${pathname}`;
14315
+ return normalized.replace(/\/+$/, "") || "/";
14316
+ }
14317
+ var FARM_STATIC_NOT_FOUND_PROBE = "/__farm-static-not-found-probe__/0";
14318
+ async function resolveFarmStaticNotFoundPlan(options) {
14319
+ const { config, routeManager } = options;
14320
+ if (config.experimental?.staticNotFound !== true) return null;
14321
+ if (options.preset !== "vercel") {
14322
+ return { reason: `it applies to the vercel target, not "${options.preset}"` };
14323
+ }
14324
+ if (isFarmRendererDisabled(config.renderer)) {
14325
+ return { reason: "the app sets `renderer: false`, so a missing URL gets a JSON 404" };
14326
+ }
14327
+ if (config.i18n.enabled) return { reason: "i18n may redirect any path to a locale" };
14328
+ const routePatterns = /* @__PURE__ */ new Set();
14329
+ const prefixPatterns = /* @__PURE__ */ new Set([
14330
+ "/api",
14331
+ resolveFarmAPIServerBasePath(config.api),
14332
+ "/_farm",
14333
+ "/__farm",
14334
+ "/.well-known",
14335
+ "/mcp"
14336
+ ]);
14337
+ const paths = /* @__PURE__ */ new Set([
14338
+ "/robots.txt",
14339
+ "/sitemap.xml",
14340
+ "/llms.txt",
14341
+ "/llms-full.txt",
14342
+ config.images.path
14343
+ ]);
14344
+ const matcherSources = /* @__PURE__ */ new Set();
14345
+ const addMatcherSource = (source, owner) => {
14346
+ if (getFarmMatcherSourceAlternative(source) === null) {
14347
+ return `${owner} \`${source}\` may match any path`;
14348
+ }
14349
+ matcherSources.add(source);
14350
+ return null;
14351
+ };
14352
+ const addMatchers = (matcher, owner) => {
14353
+ const matchers = matcher === void 0 ? [] : Array.isArray(matcher) ? matcher : [matcher];
14354
+ if (matchers.length === 0) return `${owner} has no \`matcher\`, so it runs for every path`;
14355
+ for (const entry of matchers) {
14356
+ if (typeof entry !== "string") {
14357
+ return `${owner} has a function or regular-expression \`matcher\``;
14358
+ }
14359
+ const refusal = addMatcherSource(entry, `${owner}'s matcher`);
14360
+ if (refusal) return refusal;
14361
+ }
14362
+ return null;
14363
+ };
14364
+ for (const entry of options.routeRuntimeManifest.routes) {
14365
+ if (entry.kind !== "page" && entry.kind !== "metadata") continue;
14366
+ if (/^\/\[\[?\.\.\./.test(entry.pattern)) {
14367
+ return { reason: `the page \`${entry.pattern}\` answers every path` };
14368
+ }
14369
+ routePatterns.add(entry.pattern);
14370
+ }
14371
+ for (const image of routeManager.getMetadataImages().values()) {
14372
+ routePatterns.add(`${image.pattern === "/" ? "" : image.pattern}/${image.fileName}`);
14373
+ }
14374
+ const apiPrefixes = [...prefixPatterns].map(normalizeStaticNotFoundPath);
14375
+ for (const routePath of options.apiRoutePaths) {
14376
+ const pathname = normalizeStaticNotFoundPath(routePath);
14377
+ if (apiPrefixes.some((prefix) => pathname === prefix || pathname.startsWith(`${prefix}/`))) {
14378
+ continue;
14379
+ }
14380
+ if (/^\/\[\[?\.\.\./.test(pathname)) {
14381
+ return { reason: `the API route \`${routePath}\` answers every path` };
14382
+ }
14383
+ routePatterns.add(pathname);
14384
+ }
14385
+ for (const plugin of config.plugins || []) {
14386
+ if (getFarmIntegrationPluginServerRuntime(plugin) === false) continue;
14387
+ if (plugin.name === FARM_MOBILE_SESSION_PLUGIN) continue;
14388
+ if (farmPluginMayAffectRuntimePath(plugin, FARM_STATIC_NOT_FOUND_PROBE)) {
14389
+ return { reason: `the server plugin "${plugin.name}" may answer any path` };
14390
+ }
14391
+ for (const endpoint of plugin.runtime?.endpoints ?? []) {
14392
+ paths.add(
14393
+ normalizeFarmPluginRuntimeEndpointPath(
14394
+ endpoint.path,
14395
+ `Farm plugin "${plugin.name}" runtime endpoint`
14396
+ )
14397
+ );
14398
+ }
14399
+ }
14400
+ if (hasFarmMiddlewareConfig(config.middleware)) {
14401
+ const entries = Array.isArray(config.middleware) ? config.middleware : [config.middleware];
14402
+ for (const entry of entries) {
14403
+ const refusal = addMatchers(entry.matcher, "middleware in the config");
14404
+ if (refusal) return { reason: refusal };
14405
+ }
14406
+ }
14407
+ for (const route of options.middlewareRoutes) {
14408
+ if (normalizeStaticNotFoundPath(route.path) !== "/") {
14409
+ prefixPatterns.add(route.path);
14410
+ continue;
14411
+ }
14412
+ const fileConfig = route.config ?? await readMiddlewareFileConfig(route.filePath);
14413
+ if (!fileConfig || fileConfig === "unknown") {
14414
+ return {
14415
+ reason: "middleware.ts at the app root has no literal `config.matcher`, so it runs for every path"
14416
+ };
14417
+ }
14418
+ const refusal = addMatchers(fileConfig.matcher, "middleware.ts at the app root");
14419
+ if (refusal) return { reason: refusal };
14420
+ }
14421
+ for (const [key, integration] of Object.entries(config.integrations || {})) {
14422
+ if (!isFarmIntegration(integration)) continue;
14423
+ for (const entry of integration.middleware ?? []) {
14424
+ const refusal = addMatchers(entry.matcher, `the "${key}" integration's middleware`);
14425
+ if (refusal) return { reason: refusal };
14426
+ }
14427
+ for (const route of integration.routes ?? []) {
14428
+ const refusal = addMatcherSource(route.path, `the "${key}" integration's route`);
14429
+ if (refusal) return { reason: refusal };
14430
+ }
14431
+ }
14432
+ for (const source of options.redirectSources) {
14433
+ const refusal = addMatcherSource(source, "the redirect source");
14434
+ if (refusal) return { reason: refusal };
14435
+ }
14436
+ for (const source of options.rewriteSources) {
14437
+ const refusal = addMatcherSource(source, "the rewrite source");
14438
+ if (refusal) return { reason: refusal };
14439
+ }
14440
+ if (config.docs?.enabled) {
14441
+ for (const docsRoot of getFarmDocsRoots(config.docs)) {
14442
+ const entry = normalizeStaticNotFoundPath(docsRoot.entry);
14443
+ if (entry === "/") return { reason: "the docs entry is `/`, so docs answer every path" };
14444
+ prefixPatterns.add(entry);
14445
+ }
14446
+ if (hasFarmDocsRuntimeAdapter(config.docs)) {
14447
+ const adapterRoutes = await listFarmDocsAdapterRoutes(config.docs, {
14448
+ root: options.root,
14449
+ srcDir: config.srcDir
14450
+ });
14451
+ if (!adapterRoutes) {
14452
+ return {
14453
+ reason: `the docs adapter ${JSON.stringify(config.docs.adapter.id)} does not list the paths it answers; upgrade it`
14454
+ };
14455
+ }
14456
+ for (const pathname of adapterRoutes.paths) paths.add(pathname);
14457
+ for (const prefix of adapterRoutes.prefixes) {
14458
+ if (normalizeStaticNotFoundPath(prefix) === "/") {
14459
+ return {
14460
+ reason: `the docs adapter ${JSON.stringify(config.docs.adapter.id)} answers every path`
14461
+ };
14462
+ }
14463
+ prefixPatterns.add(prefix);
14464
+ }
14465
+ }
14466
+ }
14467
+ if (config.server.health.enabled) {
14468
+ paths.add(config.server.health.livenessPath);
14469
+ paths.add(config.server.health.readinessPath);
14470
+ }
14471
+ if (config.openapi.enabled) {
14472
+ if (config.openapi.route) paths.add(config.openapi.route);
14473
+ if (config.openapi.specRoute) paths.add(config.openapi.specRoute);
14474
+ }
14475
+ if (config.workflows.route) prefixPatterns.add(config.workflows.route);
14476
+ const notFoundPath = resolveFarmNotFoundComponentPath(
14477
+ config,
14478
+ getFarmAppDirectories(config),
14479
+ routeManager.getRendererNotFoundPath()
14480
+ );
14481
+ if (notFoundPath && /\bpathname\b/.test(readFileSync2(notFoundPath, "utf8"))) {
14482
+ return {
14483
+ reason: `the not-found page (${path17.relative(options.root, notFoundPath)}) reads \`pathname\`, which a file served at every URL cannot give each one`
14484
+ };
14485
+ }
14486
+ return {
14487
+ input: {
14488
+ basePath: config.basePath,
14489
+ routePatterns: [...routePatterns],
14490
+ prefixPatterns: [...prefixPatterns],
14491
+ paths: [...paths],
14492
+ matcherSources: [...matcherSources]
14493
+ }
14494
+ };
14495
+ }
14051
14496
  async function getFarmDocsPrerenderPages(config, root, preset) {
14052
14497
  if (!config.docs?.enabled || !config.docs.prerender) return [];
14053
14498
  if (getFarmPresetRuntime(preset) === "edge") {
@@ -14102,6 +14547,15 @@ function hasFarmNitroCacheRouteRule(routeRules) {
14102
14547
  return swr !== void 0 && swr !== false || cache !== void 0 && cache !== false || !!headers && typeof headers === "object" && Object.keys(headers).length > 0;
14103
14548
  });
14104
14549
  }
14550
+ function getFarmRouteRuleHeaderNames(routeRules) {
14551
+ const names = /* @__PURE__ */ new Set();
14552
+ for (const rule of Object.values(routeRules || {})) {
14553
+ const headers = rule?.headers;
14554
+ if (!headers || typeof headers !== "object") continue;
14555
+ for (const name of Object.keys(headers)) names.add(name.toLowerCase());
14556
+ }
14557
+ return [...names].sort();
14558
+ }
14105
14559
  async function buildNitroUniversal(config, routeManager, apiRouteManager, serverRenderer, preset, root, distDir, ssrBundle, ssrEntryFile, clientOutputDir, routeRuntimeManifest, configuredHeaderRoutes, nitroBuilderResultPromise, pluginManager, markdownPrecompiledPages) {
14106
14560
  const [fs5, nitroBuilderResult] = await Promise.all([
14107
14561
  import("fs/promises"),
@@ -14131,7 +14585,7 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
14131
14585
  const ssrExternalsArePackaged = [...ssrExternalPackages].every(
14132
14586
  (packageName) => copiedRuntimePackages.has(packageName)
14133
14587
  );
14134
- const isPrebuiltSSRCandidate = preset === "node-server" && ssrExternalsArePackaged;
14588
+ const isPrebuiltSSRCandidate = PREBUILT_SSR_PRESETS.has(preset) && ssrExternalsArePackaged;
14135
14589
  logger.info(`\u{1F4E6} Nitro output directory: ${outputDir}`);
14136
14590
  logger.info(`\u{1F4E6} SSR entry file: ${ssrEntryFile}`);
14137
14591
  logger.info(`\u{1F4E6} Preset: ${preset}`);
@@ -14214,6 +14668,23 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
14214
14668
  for (const skipped of skippedPrerenderRoutes) {
14215
14669
  logger.info(`\u21AA Keeping SSG route ${skipped.pathname} server-handled (${skipped.reason})`);
14216
14670
  }
14671
+ const staticNotFoundPlan = await resolveFarmStaticNotFoundPlan({
14672
+ config,
14673
+ root,
14674
+ preset,
14675
+ routeManager,
14676
+ apiRoutePaths: apiRouteManager.getRoutes().keys(),
14677
+ routeRuntimeManifest,
14678
+ middlewareRoutes,
14679
+ redirectSources,
14680
+ rewriteSources
14681
+ });
14682
+ if (staticNotFoundPlan && "reason" in staticNotFoundPlan) {
14683
+ logger.info(
14684
+ `\u21AA Keeping missing URLs server-handled: experimental.staticNotFound is off because ${staticNotFoundPlan.reason}`
14685
+ );
14686
+ }
14687
+ const staticNotFoundPrerenderPath = staticNotFoundPlan && "input" in staticNotFoundPlan ? applyFarmBasePath(FARM_STATIC_NOT_FOUND_PATH, config.basePath) : null;
14217
14688
  if (farmWorkflows.workflows.length > 0) {
14218
14689
  logger.info(`\u23F1\uFE0F Found ${farmWorkflows.workflows.length} Farm workflow task(s)`);
14219
14690
  }
@@ -14312,17 +14783,19 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
14312
14783
  const nitroEntryPath = path17.join(ssrOutputDir, "nitro-entry.mjs");
14313
14784
  const nodeAdapterModule = preset === "node-server" ? resolveNitroRuntimeDependency(root, "srvx/node") : null;
14314
14785
  const hasNitroCacheRouteRules = hasFarmNitroCacheRouteRule(config.routeRules);
14786
+ const hasPrerenderedPages = prerenderRoutes.length > 0;
14787
+ const usesNitroResponseHook = hasNitroCacheRouteRules || hasPrerenderedPages;
14315
14788
  const nitroEntryCode = `
14316
14789
  // Farm.js Nitro Entry
14317
14790
  // This file adapts Farm's Web fetch handler to Nitro's event handler contract.
14318
14791
 
14319
14792
  import { useNitroHooks } from '#nitro/runtime/app'
14320
- import handler, { farmProductionLifecycle, createFarmNodeRequestAbortSignal${nodeAdapterModule ? ", getFarmOwnedBufferedHtml, useFarmNodePageResponse" : ""} } from './${ssrEntryFile}'${nodeAdapterModule ? `
14793
+ import handler, { farmPrepareNativeRoutes, farmProductionLifecycle, createFarmNodeRequestAbortSignal${nodeAdapterModule ? ", getFarmOwnedBufferedHtml, useFarmNodePageResponse" : ""} } from './${ssrEntryFile}'${nodeAdapterModule ? `
14321
14794
  import { FastResponse } from ${JSON.stringify(nodeAdapterModule)}
14322
14795
 
14323
14796
  useFarmNodePageResponse(FastResponse)` : ""}
14324
14797
 
14325
- export { farmProductionLifecycle }
14798
+ export { farmPrepareNativeRoutes, farmProductionLifecycle }
14326
14799
 
14327
14800
  let farmCloseHookRegistered = false
14328
14801
  function registerFarmCloseHook() {
@@ -14332,12 +14805,50 @@ function registerFarmCloseHook() {
14332
14805
  farmProductionLifecycle.close('production-server-closed')
14333
14806
  )
14334
14807
  }
14335
- ${hasNitroCacheRouteRules ? `
14808
+ ${usesNitroResponseHook ? `
14809
+ const FARM_PRIVATE_CACHE_DIRECTIVE = /(?:^|,)\\s*(?:private|no-store)\\s*(?:[,=]|$)/i
14810
+ ` : ""}${hasPrerenderedPages ? `
14811
+ // A prerendered page's route rule holds its static file's headers, and H3 sets them on
14812
+ // whatever the server answers at that URL after Farm answered: a Markdown request by
14813
+ // Accept, or the URL's other trailing-slash spelling. Farm's answer keeps its own headers,
14814
+ // so a CDN caches its Markdown as it does for a page that renders on request. Headers an
14815
+ // app's routeRules set still apply, and so does the file's private policy.
14816
+ const FARM_ROUTE_RULE_HEADERS = new Set(${JSON.stringify(getFarmRouteRuleHeaderNames(config.routeRules))})
14817
+ const farmPrerenderedPageHeadersKey = Symbol.for('farm.prerenderedPageHeaders')
14818
+ let farmPrerenderedPageHookRegistered = false
14819
+ function keepFarmPrerenderedPageHeaders(event, response) {
14820
+ const ruleHeaders = event.context?.routeRules?.headers
14821
+ if (!ruleHeaders || !event.context) return
14822
+ const own = []
14823
+ for (const name of Object.keys(ruleHeaders)) {
14824
+ const key = name.toLowerCase()
14825
+ if (FARM_ROUTE_RULE_HEADERS.has(key)) continue
14826
+ if (key === 'cache-control' && FARM_PRIVATE_CACHE_DIRECTIVE.test(String(ruleHeaders[name]))) continue
14827
+ own.push([key, response.headers.get(key)])
14828
+ }
14829
+ if (own.length === 0) return
14830
+ if (!farmPrerenderedPageHookRegistered) {
14831
+ farmPrerenderedPageHookRegistered = true
14832
+ useNitroHooks().hook('response', (response, responseEvent) => {
14833
+ const headers = responseEvent.context?.[farmPrerenderedPageHeadersKey]
14834
+ if (!headers) return
14835
+ try {
14836
+ for (const [key, value] of headers) {
14837
+ if (value === null) response.headers.delete(key)
14838
+ else if (response.headers.get(key) !== value) response.headers.set(key, value)
14839
+ }
14840
+ } catch {
14841
+ // Immutable headers belong to a response Nitro passed through untouched.
14842
+ }
14843
+ })
14844
+ }
14845
+ event.context[farmPrerenderedPageHeadersKey] = own
14846
+ }
14847
+ ` : ""}${hasNitroCacheRouteRules ? `
14336
14848
  // A swr route rule caches through Nitro, which writes its own public Cache-Control on
14337
14849
  // the event after Farm answered, and a headers route rule sets its headers there too. H3
14338
14850
  // lets those replace the response's. A response middleware let through keeps Farm's
14339
14851
  // private policy and no CDN cache header, so no CDN serves it to others.
14340
- const FARM_PRIVATE_CACHE_DIRECTIVE = /(?:^|,)\\s*(?:private|no-store)\\s*(?:[,=]|$)/i
14341
14852
  const FARM_CDN_CACHE_CONTROL_HEADERS = [
14342
14853
  'cdn-cache-control',
14343
14854
  'vercel-cdn-cache-control',
@@ -14484,7 +14995,8 @@ ${hasNitroCacheRouteRules ? " let farmGuardedResponse = false\n" : ""} const r
14484
14995
  if (farmVary) {
14485
14996
  const nitroHeaders = event.res.headers
14486
14997
  if (nitroHeaders.has('Vary')) mergeVaryHeaders(nitroHeaders, farmVary)
14487
- }${hasNitroCacheRouteRules ? `
14998
+ }${hasPrerenderedPages ? `
14999
+ if (event.context?.routeRules?.prerender) keepFarmPrerenderedPageHeaders(event, response)` : ""}${hasNitroCacheRouteRules ? `
14488
15000
  const farmCacheControl = response.headers.get('cache-control')
14489
15001
  if (
14490
15002
  // A guarded response, or any response Farm kept private under a swr or cache rule: the
@@ -14638,8 +15150,8 @@ function toFarmNodeResponse(request, response) {
14638
15150
  ...farmNodeServerEntryPath ? { entry: farmNodeServerEntryPath } : {},
14639
15151
  ...farmBunServerEntryPath ? { entry: farmBunServerEntryPath } : {},
14640
15152
  ...farmNetlifyEntryPath ? { entry: farmNetlifyEntryPath } : {},
14641
- // The response hook that keeps a private Cache-Control under a swr or headers rule (nitro-entry).
14642
- ...hasNitroCacheRouteRules ? { features: { runtimeHooks: true } } : {},
15153
+ // The response hooks that keep Farm's headers under a route rule's (nitro-entry).
15154
+ ...usesNitroResponseHook ? { features: { runtimeHooks: true } } : {},
14643
15155
  rootDir: root,
14644
15156
  // Farm registers every handler, task, and plugin explicitly. Scanning the
14645
15157
  // project root would bundle an app's own `middleware/`, `api/`, `routes/`,
@@ -14664,7 +15176,7 @@ function toFarmNodeResponse(request, response) {
14664
15176
  // print sizes after the build. A self-hosted server is never shipped compressed,
14665
15177
  // so list plain sizes; zipped serverless and edge bundles keep the gzip column.
14666
15178
  ...preset === "node-server" || preset === "bun" ? { logging: { compressedSizes: false } } : {},
14667
- ...prerenderRoutes.length > 0 ? {
15179
+ ...prerenderRoutes.length > 0 || staticNotFoundPrerenderPath ? {
14668
15180
  prerender: {
14669
15181
  crawlLinks: false,
14670
15182
  failOnError: true,
@@ -14672,7 +15184,13 @@ function toFarmNodeResponse(request, response) {
14672
15184
  // answered independently, as by the production server, so keeping several
14673
15185
  // in flight overlaps the worker's rendering with this thread's per-route work.
14674
15186
  concurrency: Math.min(os.availableParallelism(), 8),
14675
- routes: prerenderRoutes.map(toPrerenderPublicPath),
15187
+ workers: resolveFarmPrerenderWorkers(
15188
+ prerenderRoutes.length + (staticNotFoundPrerenderPath ? 1 : 0)
15189
+ ),
15190
+ routes: [
15191
+ ...prerenderRoutes.map(toPrerenderPublicPath),
15192
+ ...staticNotFoundPrerenderPath ? [staticNotFoundPrerenderPath] : []
15193
+ ],
14676
15194
  // Cloudflare's asset server answers a directory index (about/index.html) at the
14677
15195
  // trailing-slash URL and redirects the other spelling to it, so a page is written as
14678
15196
  // about.html unless trailingSlash asks for the slash, as Nitro's Netlify and Vercel
@@ -14717,7 +15235,8 @@ function toFarmNodeResponse(request, response) {
14717
15235
  ...configuredNitroRouteRules,
14718
15236
  // Exact user rules must retain their runtime settings without replacing
14719
15237
  // the headers and prerender marker generated for a safe physical page.
14720
- ...prerenderNitroRouteRules
15238
+ ...prerenderNitroRouteRules,
15239
+ ...staticNotFoundPrerenderPath ? { [staticNotFoundPrerenderPath]: { prerender: true } } : {}
14721
15240
  },
14722
15241
  rollupConfig: {
14723
15242
  external: nitroRollupExternal,
@@ -14742,7 +15261,7 @@ function toFarmNodeResponse(request, response) {
14742
15261
  if (pluginManager) {
14743
15262
  nitroConfig = await pluginManager.runHookSerial("beforeNitroBuild", nitroConfig);
14744
15263
  }
14745
- const expectedServerDir = path17.join(outputDir, "server");
15264
+ const expectedServerDir = runtimeServerOutputDir;
14746
15265
  const customRollupKeys = Object.keys(nitroConfig.rollupConfig || {}).filter(
14747
15266
  (key) => key !== "external" && key !== "plugins"
14748
15267
  );
@@ -14760,8 +15279,8 @@ function toFarmNodeResponse(request, response) {
14760
15279
  (handler) => path17.resolve(handler?.handler || "") === nitroEntryPath
14761
15280
  )
14762
15281
  );
14763
- const canReusePrebuiltSSR = isPrebuiltSSRCandidate && nitroConfig.preset === "node-server" && nitroBuildIsFarms && path17.resolve(nitroConfig.output?.serverDir || "") === path17.resolve(expectedServerDir);
14764
- const prerenderReusesPrebuiltSSR = prerenderRoutes.length > 0 && ssrExternalsArePackaged && nitroBuildIsFarms;
15282
+ const canReusePrebuiltSSR = isPrebuiltSSRCandidate && PREBUILT_SSR_PRESETS.has(nitroConfig.preset ?? "") && nitroBuildIsFarms && path17.resolve(nitroConfig.output?.serverDir || "") === path17.resolve(expectedServerDir);
15283
+ const prerenderReusesPrebuiltSSR = (prerenderRoutes.length > 0 || staticNotFoundPrerenderPath !== null) && ssrExternalsArePackaged && nitroBuildIsFarms;
14765
15284
  const selectRolldownBuilder = canReusePrebuiltSSR && requestedBuilder === void 0 && await canUseRolldownBuilder();
14766
15285
  if (selectRolldownBuilder) nitroConfig.builder = "rolldown";
14767
15286
  const useRolldownBuilder = canReusePrebuiltSSR && (nitroConfig.builder ?? process.env.NITRO_BUILDER) === "rolldown";
@@ -14861,6 +15380,22 @@ function toFarmNodeResponse(request, response) {
14861
15380
  nitroInstance.routing.sync();
14862
15381
  });
14863
15382
  }
15383
+ let staticNotFoundWritten = false;
15384
+ let staticNotFoundRefusal = null;
15385
+ if (staticNotFoundPrerenderPath) {
15386
+ nitroInstance.hooks.hook("prerender:generate", (route) => {
15387
+ if (route.route !== staticNotFoundPrerenderPath) return;
15388
+ const status = route.error?.status ?? 200;
15389
+ const contentType = route.contentType?.toLowerCase() ?? "";
15390
+ route.error = void 0;
15391
+ if (status === 404 && contentType.includes("text/html")) {
15392
+ staticNotFoundWritten = true;
15393
+ return;
15394
+ }
15395
+ route.skip = true;
15396
+ staticNotFoundRefusal = contentType.includes(FARM_STATIC_NOT_FOUND_REFUSAL_TYPE) ? route.contents || "the not-found page can't be served as a file" : `the build's request for the not-found page answered ${status} instead of 404`;
15397
+ });
15398
+ }
14864
15399
  if (farmNodeServerEntryPath || farmBunServerEntryPath || farmNetlifyEntryPath) {
14865
15400
  nitroInstance.hooks.hook("prerender:config", (prerendererConfig) => {
14866
15401
  delete prerendererConfig.entry;
@@ -14879,7 +15414,7 @@ function toFarmNodeResponse(request, response) {
14879
15414
  });
14880
15415
  await nitroBuilder.prepare(nitroInstance);
14881
15416
  await nitroBuilder.copyPublicAssets(nitroInstance);
14882
- if (prerenderReusesPrebuiltSSR && !canReusePrebuiltSSR) {
15417
+ if (prerenderReusesPrebuiltSSR && (!canReusePrebuiltSSR || preset !== "node-server")) {
14883
15418
  nitroInstance.hooks.hook("prerender:config", (prerendererConfig) => {
14884
15419
  const configuredPlugins = prerendererConfig.rollupConfig?.plugins;
14885
15420
  const plugins = Array.isArray(configuredPlugins) ? configuredPlugins : configuredPlugins ? [configuredPlugins] : [];
@@ -14917,6 +15452,15 @@ function toFarmNodeResponse(request, response) {
14917
15452
  });
14918
15453
  });
14919
15454
  }
15455
+ if (isVercel && docsPrerenderPages.some((pathname) => prerenderRoutes.includes(pathname))) {
15456
+ nitroInstance.hooks.hook("prerender:init", (prerenderer) => {
15457
+ prerenderer.hooks.hook("compiled", async () => {
15458
+ await copyFarmDocsContentForVercel(config, root, prerenderer.options.output.serverDir, fs5, {
15459
+ log: false
15460
+ });
15461
+ });
15462
+ });
15463
+ }
14920
15464
  nitroInstance.hooks.hook("rollup:before", (_nitro, rollupConfig) => {
14921
15465
  nameCodeSplittingGroups(rollupConfig);
14922
15466
  });
@@ -14936,8 +15480,10 @@ function toFarmNodeResponse(request, response) {
14936
15480
  }
14937
15481
  });
14938
15482
  }
14939
- if (prerenderRoutes.length > 0) {
14940
- logger.info(`\u{1F4C4} Pre-rendering ${prerenderRoutes.length} SSG page(s)`);
15483
+ if (prerenderRoutes.length > 0 || staticNotFoundPrerenderPath) {
15484
+ if (prerenderRoutes.length > 0) {
15485
+ logger.info(`\u{1F4C4} Pre-rendering ${prerenderRoutes.length} SSG page(s)`);
15486
+ }
14941
15487
  const previousPrerender = process.env[FARM_PRERENDER_ENV];
14942
15488
  process.env[FARM_PRERENDER_ENV] = "1";
14943
15489
  try {
@@ -14985,7 +15531,7 @@ function toFarmNodeResponse(request, response) {
14985
15531
  const copyResults = await Promise.allSettled([
14986
15532
  prebuiltSSRFilesResult.value ? writeSSRBundleFiles(
14987
15533
  prebuiltSSRFilesResult.value,
14988
- path17.join(outputDir, "server", FARM_SSR_OUTPUT_DIR),
15534
+ path17.join(expectedServerDir, FARM_SSR_OUTPUT_DIR),
14989
15535
  fs5
14990
15536
  ) : Promise.resolve(),
14991
15537
  runtimeCopyPromise
@@ -14995,7 +15541,7 @@ function toFarmNodeResponse(request, response) {
14995
15541
  );
14996
15542
  if (failedCopy) throw failedCopy.reason;
14997
15543
  if (canReusePrebuiltSSR) {
14998
- await registerPrebuiltSSRPackageImport(path17.join(outputDir, "server"), ssrEntryFile, fs5);
15544
+ await registerPrebuiltSSRPackageImport(expectedServerDir, ssrEntryFile, fs5);
14999
15545
  logger.info("\u26A1 Reused Farm's prebuilt SSR bundle for the Node output");
15000
15546
  }
15001
15547
  if (useRolldownBuilder) {
@@ -15012,9 +15558,45 @@ function toFarmNodeResponse(request, response) {
15012
15558
  root,
15013
15559
  preset,
15014
15560
  distDir,
15015
- outputDir
15561
+ outputDir,
15562
+ serverDir: path17.resolve(nitroInstance.options.output.serverDir)
15016
15563
  });
15017
15564
  }
15565
+ let staticNotFoundRoutes;
15566
+ if (staticNotFoundPlan && "input" in staticNotFoundPlan && staticNotFoundPrerenderPath) {
15567
+ const toHandlerKey = (handler) => toPosixPath(path17.resolve(root, handler));
15568
+ const handlerSources = getFarmStaticNotFoundHandlerSources(
15569
+ nitroInstance.options.handlers.map((handler) => ({
15570
+ route: handler.route,
15571
+ handler: toHandlerKey(handler.handler)
15572
+ })),
15573
+ new Set(
15574
+ [nitroEntryPath, farmWorkflows.handlerPath].filter((handler) => Boolean(handler)).map(toHandlerKey)
15575
+ )
15576
+ );
15577
+ if (!handlerSources) {
15578
+ staticNotFoundRefusal = "a Nitro handler that a plugin or module adds may answer any path";
15579
+ } else if (staticNotFoundWritten) {
15580
+ staticNotFoundRoutes = createFarmVercelStaticNotFoundRoutes({
15581
+ ...staticNotFoundPlan.input,
15582
+ matcherSources: [...staticNotFoundPlan.input.matcherSources, ...handlerSources]
15583
+ });
15584
+ const fileHeaders = nitroInstance.options.routeRules[staticNotFoundPrerenderPath]?.headers;
15585
+ const cspHeaders = Object.fromEntries(
15586
+ Object.entries(fileHeaders || {}).filter(
15587
+ ([name]) => name.toLowerCase().startsWith("content-security-policy")
15588
+ )
15589
+ );
15590
+ const notFoundRoute = staticNotFoundRoutes[staticNotFoundRoutes.length - 1];
15591
+ if (notFoundRoute && Object.keys(cspHeaders).length > 0) notFoundRoute.headers = cspHeaders;
15592
+ logger.info("\u{1F4C4} Serving the not-found page as a file to missing URLs");
15593
+ }
15594
+ if (!staticNotFoundRoutes) {
15595
+ logger.info(
15596
+ `\u21AA Keeping missing URLs server-handled: experimental.staticNotFound is off because ${staticNotFoundRefusal ?? "the build did not write the not-found page"}`
15597
+ );
15598
+ }
15599
+ }
15018
15600
  if (isVercel) {
15019
15601
  await postProcessVercelOutput(
15020
15602
  root,
@@ -15029,11 +15611,15 @@ function toFarmNodeResponse(request, response) {
15029
15611
  middlewareRoutes: edgeMiddlewareRoutes,
15030
15612
  guardedPages: edgeGuardedPrerenderRoutes
15031
15613
  },
15032
- prerenderRoutes.map(toPrerenderPublicPath)
15614
+ prerenderRoutes.map(toPrerenderPublicPath),
15615
+ staticNotFoundRoutes
15033
15616
  );
15034
15617
  }
15035
15618
  logger.success(`\u2705 Nitro build completed with preset: ${preset}`);
15036
15619
  }
15620
+ function resolveFarmPrerenderWorkers(routeCount) {
15621
+ return Math.max(1, Math.min(4, os.availableParallelism() - 1, Math.ceil(routeCount / 50)));
15622
+ }
15037
15623
  function resolveFarmNitroOutputConfig(preset, outputDir) {
15038
15624
  const isVercel = preset === "vercel";
15039
15625
  return {
@@ -15122,14 +15708,14 @@ async function moveVercelOutputPath(src, dest, fs5) {
15122
15708
  return;
15123
15709
  } catch (error) {
15124
15710
  const code = error?.code;
15125
- if (code !== "EPERM" && code !== "EACCES" && code !== "EXDEV" && code !== "ENOTEMPTY") {
15711
+ if (code !== "EPERM" && code !== "EACCES" && code !== "EXDEV" && code !== "ENOTEMPTY" && code !== "EEXIST") {
15126
15712
  throw error;
15127
15713
  }
15128
15714
  }
15129
15715
  await fs5.cp(src, dest, { recursive: true, force: true });
15130
15716
  await fs5.rm(src, { recursive: true, force: true });
15131
15717
  }
15132
- async function postProcessVercelOutput(root, outputDir, fs5, config, farmWorkflows, routeRuntimeManifest, cronJobs, edgeMiddleware, prerenderedPages) {
15718
+ async function postProcessVercelOutput(root, outputDir, fs5, config, farmWorkflows, routeRuntimeManifest, cronJobs, edgeMiddleware, prerenderedPages, notFoundRoutes) {
15133
15719
  const serverDir = path17.join(outputDir, "server");
15134
15720
  const functionsDir = path17.join(outputDir, "functions");
15135
15721
  const nitroFuncDir = path17.join(functionsDir, "__nitro.func");
@@ -15178,7 +15764,9 @@ async function postProcessVercelOutput(root, outputDir, fs5, config, farmWorkflo
15178
15764
  presetRoutes: Array.isArray(vercelConfig.routes) ? vercelConfig.routes : [],
15179
15765
  runtimeRoutes,
15180
15766
  middlewareRoutes: edgeMiddlewareRoutes.length > 0 ? createFarmVercelEdgeMiddlewareRoutes(edgeMiddleware.guardedPages, config.basePath) : [],
15181
- canonicalSlashRoutes: createFarmVercelCanonicalSlashRoutes(prerenderedPages)
15767
+ canonicalSlashRoutes: createFarmVercelCanonicalSlashRoutes(prerenderedPages),
15768
+ markdownRoutes: createFarmVercelMarkdownRoutes(prerenderedPages),
15769
+ notFoundRoutes
15182
15770
  });
15183
15771
  const vercelConfigWithWorkflowCrons = applyFarmWorkflowVercelCrons(
15184
15772
  vercelConfig,
@@ -15188,7 +15776,7 @@ async function postProcessVercelOutput(root, outputDir, fs5, config, farmWorkflo
15188
15776
  await fs5.writeFile(configPath, JSON.stringify(vercelConfigWithCrons, null, 2));
15189
15777
  logger.info("\u2705 Post-processed Vercel output for Build Output API v3");
15190
15778
  }
15191
- async function copyFarmDocsContentForVercel(config, root, nitroFuncDir, fs5) {
15779
+ async function copyFarmDocsContentForVercel(config, root, nitroFuncDir, fs5, options = {}) {
15192
15780
  if (!config.docs?.enabled) return;
15193
15781
  const [mainRoot, ...extraRoots] = getFarmDocsRoots(config.docs);
15194
15782
  await copyFarmDocsRootContent(
@@ -15196,26 +15784,31 @@ async function copyFarmDocsContentForVercel(config, root, nitroFuncDir, fs5) {
15196
15784
  root,
15197
15785
  config.srcDir,
15198
15786
  path17.join(nitroFuncDir, "farm-docs-content"),
15199
- fs5
15787
+ fs5,
15788
+ options
15200
15789
  );
15790
+ const bundledRootPaths = getFarmDocsBundledRootPaths(config.docs, root, config.srcDir);
15201
15791
  for (const [index, docsRoot] of extraRoots.entries()) {
15792
+ const bundledRootDir = path17.join(nitroFuncDir, "farm-docs-roots", String(index));
15793
+ await fs5.rm(bundledRootDir, { recursive: true, force: true });
15202
15794
  await copyFarmDocsRootContent(
15203
15795
  docsRoot,
15204
15796
  root,
15205
15797
  config.srcDir,
15206
- path17.join(nitroFuncDir, "farm-docs-roots", String(index)),
15207
- fs5
15798
+ path17.join(bundledRootDir, ...bundledRootPaths[index].split("/")),
15799
+ fs5,
15800
+ options
15208
15801
  );
15209
15802
  }
15210
15803
  }
15211
- async function copyFarmDocsRootContent(docs, root, srcDir, bundledContentDir, fs5) {
15804
+ async function copyFarmDocsRootContent(docs, root, srcDir, bundledContentDir, fs5, { log = true } = {}) {
15212
15805
  const docsContentDir = resolveBuildDocsContentDir(docs, root, srcDir);
15213
15806
  if (!docsContentDir) return;
15214
15807
  const lastModifiedManifest = createFarmDocsLastModifiedManifest(docsContentDir, {
15215
15808
  fallback: "now"
15216
15809
  });
15217
15810
  const undatedPages = lastModifiedManifest.unknown?.length ?? 0;
15218
- if (undatedPages > 0) {
15811
+ if (log && undatedPages > 0) {
15219
15812
  logger.warn(
15220
15813
  `${undatedPages} docs page(s) were last changed before this shallow clone's Git history, so they show no "Last updated" date. Build from a full clone (git fetch --unshallow) or set lastModified in the page's frontmatter.`
15221
15814
  );
@@ -15232,7 +15825,9 @@ async function copyFarmDocsRootContent(docs, root, srcDir, bundledContentDir, fs
15232
15825
  `${JSON.stringify(lastModifiedManifest, null, 2)}
15233
15826
  `
15234
15827
  );
15235
- logger.info(`\u{1F4DA} Bundled docs content for Vercel: ${path17.relative(root, docsContentDir)}`);
15828
+ if (log) {
15829
+ logger.info(`\u{1F4DA} Bundled docs content for Vercel: ${path17.relative(root, docsContentDir)}`);
15830
+ }
15236
15831
  }
15237
15832
  function resolveServerFunctionPlatform(preset) {
15238
15833
  return preset === "vercel" || preset === "netlify" ? { os: "linux", cpu: "x64", libc: "glibc" } : null;
@@ -15291,7 +15886,7 @@ async function stageSharpRuntime(config, root, distDir, fs5, preset) {
15291
15886
  dereference: true,
15292
15887
  // Reflinks make native runtime packaging nearly metadata-only on
15293
15888
  // supporting filesystems and transparently fall back to byte copies.
15294
- mode: fsConstants.COPYFILE_FICLONE
15889
+ mode: fsConstants2.COPYFILE_FICLONE
15295
15890
  }),
15296
15891
  ...Object.keys(dependencies).map((dependency) => copyPackage(dependency, packageRequire))
15297
15892
  ]);
@@ -15361,7 +15956,7 @@ async function mergeStagedDirectory(sourceDir, targetDir, fs5) {
15361
15956
  await fs5.cp(sourcePath, targetPath, {
15362
15957
  force: true,
15363
15958
  dereference: true,
15364
- mode: fsConstants.COPYFILE_FICLONE
15959
+ mode: fsConstants2.COPYFILE_FICLONE
15365
15960
  });
15366
15961
  await fs5.rm(sourcePath, { force: true });
15367
15962
  })
@@ -15396,7 +15991,7 @@ async function copyMetadataImageRuntime(root, nitroFuncDir, fs5) {
15396
15991
  recursive: true,
15397
15992
  force: true,
15398
15993
  dereference: true,
15399
- mode: fsConstants.COPYFILE_FICLONE
15994
+ mode: fsConstants2.COPYFILE_FICLONE
15400
15995
  });
15401
15996
  const functionPackage = await readNitroOutputPackage(nitroFuncDir, fs5);
15402
15997
  functionPackage.dependencies = {
@@ -15521,7 +16116,7 @@ async function createFarmProjectModuleSsrEnvironment() {
15521
16116
  },
15522
16117
  hmr: false,
15523
16118
  createImportMeta: createNodeImportMeta,
15524
- sourcemapInterceptor: "node"
16119
+ sourcemapInterceptor: "prepareStackTrace"
15525
16120
  })
15526
16121
  });
15527
16122
  }
@@ -15827,7 +16422,7 @@ async function buildClient2(viteBuild, config, root, srcDir, outputDir) {
15827
16422
  farmPlugin,
15828
16423
  farmServerOnlyEntriesPlugin
15829
16424
  } = await import("./vite.mjs");
15830
- const { PluginManager: PluginManager2 } = await import("./plugin-EVKQZBNW.mjs");
16425
+ const { PluginManager: PluginManager2 } = await import("./plugin-B7I5QVBE.mjs");
15831
16426
  const pluginManager = new PluginManager2({
15832
16427
  config,
15833
16428
  isDev: false,
@@ -15856,7 +16451,7 @@ async function buildClient2(viteBuild, config, root, srcDir, outputDir) {
15856
16451
  }
15857
16452
  async function buildSSR(viteBuild, config, root, srcDir, outputDir) {
15858
16453
  const { farmI18nClientBridgePlugin, farmIslandContainersPlugin, farmPlugin } = await import("./vite.mjs");
15859
- const { PluginManager: PluginManager2 } = await import("./plugin-EVKQZBNW.mjs");
16454
+ const { PluginManager: PluginManager2 } = await import("./plugin-B7I5QVBE.mjs");
15860
16455
  const pluginManager = new PluginManager2({
15861
16456
  config,
15862
16457
  isDev: false,
@@ -15898,7 +16493,7 @@ function resolveLegacyPageEntry(config, root, srcDir) {
15898
16493
  }
15899
16494
  async function buildNitro(config, routeManager, apiRouteManager, serverRenderer, preset, root, distDir, pluginManager) {
15900
16495
  const [{ createNitroConfig }, { createNitro, build: nitroBuild }] = await Promise.all([
15901
- import("./nitro-FK3SZM4H.mjs"),
16496
+ import("./nitro-6HSEGMWJ.mjs"),
15902
16497
  import("nitro/builder")
15903
16498
  ]);
15904
16499
  let nitroConfig = await createNitroConfig(
@@ -15982,7 +16577,8 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
15982
16577
  root,
15983
16578
  preset,
15984
16579
  distDir,
15985
- outputDir: resolveDeployOutputPath(root, config.deploy.outputDir)
16580
+ outputDir: resolveDeployOutputPath(root, config.deploy.outputDir),
16581
+ serverDir: path18.resolve(nitro.options.output.serverDir)
15986
16582
  });
15987
16583
  }
15988
16584
  }