@farm.js/core 0.1.39 → 0.1.40

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 (362) hide show
  1. package/dist/{agent-mcp-BhneNPb4.d.mts → agent-mcp-DRlXq3lM.d.ts} +1 -1
  2. package/dist/{agent-mcp-HcTYQmNX.d.ts → agent-mcp-XNF4JqHw.d.mts} +1 -1
  3. package/dist/{agent-mcp-handler-OLRMZONF.mjs → agent-mcp-handler-HVV5LNXF.mjs} +6 -6
  4. package/dist/{agent-mcp-handler-MRGP3WJ3.cjs → agent-mcp-handler-YKG7KVCY.cjs} +7 -7
  5. package/dist/agent-runtime.cjs +10 -6
  6. package/dist/agent-runtime.d.mts +5 -7
  7. package/dist/agent-runtime.d.ts +5 -7
  8. package/dist/agent-runtime.mjs +9 -5
  9. package/dist/api/client.cjs +3 -3
  10. package/dist/api/client.d.mts +3 -3
  11. package/dist/api/client.d.ts +3 -3
  12. package/dist/api/client.mjs +2 -2
  13. package/dist/api/route-manager.cjs +15 -13
  14. package/dist/api/route-manager.d.mts +7 -9
  15. package/dist/api/route-manager.d.ts +7 -9
  16. package/dist/api/route-manager.mjs +14 -12
  17. package/dist/api/runtime.cjs +12 -10
  18. package/dist/api/runtime.d.mts +6 -8
  19. package/dist/api/runtime.d.ts +6 -8
  20. package/dist/api/runtime.mjs +11 -9
  21. package/dist/{api-client-CyFtZFJ4.d.ts → api-client-BJv9mTbO.d.ts} +2 -2
  22. package/dist/{api-client-BjMmY8OD.d.mts → api-client-Dk9QOLwr.d.mts} +2 -2
  23. package/dist/api.cjs +17 -15
  24. package/dist/api.d.mts +9 -11
  25. package/dist/api.d.ts +9 -11
  26. package/dist/api.mjs +16 -14
  27. package/dist/{app-CMkoghtp.d.ts → app-CDJHPqZn.d.ts} +11 -4
  28. package/dist/{app-DVzmmbNO.d.mts → app-CWjCklhF.d.mts} +11 -4
  29. package/dist/app-markdown.cjs +7 -6
  30. package/dist/app-markdown.d.mts +6 -8
  31. package/dist/app-markdown.d.ts +6 -8
  32. package/dist/app-markdown.mjs +6 -5
  33. package/dist/cache.cjs +6 -3
  34. package/dist/cache.d.mts +23 -2
  35. package/dist/cache.d.ts +23 -2
  36. package/dist/cache.mjs +5 -2
  37. package/dist/{chunk-3UEVPCGW.mjs → chunk-2DMWQWNJ.mjs} +6 -1
  38. package/dist/{chunk-ZXH4TS3F.cjs → chunk-2JG2LJDI.cjs} +3 -64
  39. package/dist/{chunk-QTXBII4Z.cjs → chunk-3TB5QGUW.cjs} +5 -5
  40. package/dist/chunk-45QJHGZM.cjs +1063 -0
  41. package/dist/{chunk-QYMZOOC5.mjs → chunk-45UZKX2J.mjs} +12 -44
  42. package/dist/{chunk-FUCSUGDM.cjs → chunk-4A3YUB4D.cjs} +3 -3
  43. package/dist/{chunk-FUZEBRP3.mjs → chunk-4GP3XZ4Z.mjs} +5 -3
  44. package/dist/chunk-4TLUFAIP.cjs +92 -0
  45. package/dist/chunk-4U5XZDLG.cjs +80 -0
  46. package/dist/{chunk-VXEEATVD.cjs → chunk-4XO5GSD6.cjs} +2 -2
  47. package/dist/{chunk-P664ZVTV.mjs → chunk-4ZZNPK25.mjs} +2 -2
  48. package/dist/{chunk-YFYUYWL7.cjs → chunk-54QWHSNR.cjs} +697 -422
  49. package/dist/{chunk-W36M2BQ4.mjs → chunk-5E65AL7P.mjs} +3 -3
  50. package/dist/{chunk-3LOLJTFV.cjs → chunk-5JEC43MQ.cjs} +11 -11
  51. package/dist/{chunk-INL3THCU.mjs → chunk-5LL6TKII.mjs} +1 -1
  52. package/dist/{chunk-KIIMAWOJ.cjs → chunk-5NAVKJCZ.cjs} +35 -105
  53. package/dist/{chunk-PGZDEPTM.cjs → chunk-5XS5NCVM.cjs} +10 -10
  54. package/dist/{chunk-HXRYZWTA.mjs → chunk-62DY5GKS.mjs} +3 -3
  55. package/dist/{chunk-LSKZMJMP.cjs → chunk-64SBBZDU.cjs} +38 -1
  56. package/dist/chunk-6BWKJ6QS.cjs +43 -0
  57. package/dist/{chunk-JSROZYYO.cjs → chunk-6D24SDKO.cjs} +1 -20
  58. package/dist/{chunk-EIPC3FDA.cjs → chunk-6ILGLCXF.cjs} +9 -5
  59. package/dist/chunk-6QOLZITB.cjs +22 -0
  60. package/dist/{chunk-RW63BOV7.cjs → chunk-7FHZ3E6D.cjs} +2 -2
  61. package/dist/chunk-7GNWGLWB.mjs +14 -0
  62. package/dist/{chunk-34UCJRQO.cjs → chunk-7RNAKBWF.cjs} +2 -2
  63. package/dist/{chunk-MSSFIQGM.mjs → chunk-7VAJSSPG.mjs} +41 -10
  64. package/dist/{chunk-PVZE2JGJ.mjs → chunk-ACLPN56I.mjs} +43 -25
  65. package/dist/{chunk-JCYYXBAJ.cjs → chunk-AGR7F3LA.cjs} +3 -3
  66. package/dist/{chunk-UPJLHLJU.cjs → chunk-ALPWLT27.cjs} +4 -4
  67. package/dist/{chunk-ATSDUUFK.mjs → chunk-AX7S67YV.mjs} +33 -40
  68. package/dist/{chunk-CUM5NYL5.mjs → chunk-AXB5P7BK.mjs} +1 -1
  69. package/dist/{chunk-2ZYGC6SS.cjs → chunk-B6IMBBOS.cjs} +3 -3
  70. package/dist/{chunk-472NCAZ7.cjs → chunk-B77AUCBV.cjs} +3 -3
  71. package/dist/{chunk-H5CLOUZS.cjs → chunk-BMOBTMDR.cjs} +5 -5
  72. package/dist/{chunk-CQMVIOYP.mjs → chunk-BPGO2IEP.mjs} +7 -7
  73. package/dist/{chunk-E2ROOWQC.cjs → chunk-BPOTSHDO.cjs} +24 -87
  74. package/dist/chunk-BRYPZIMB.mjs +6 -0
  75. package/dist/{chunk-WFRT7JPX.mjs → chunk-BYQVROIP.mjs} +2 -2
  76. package/dist/{chunk-HALDNTIV.mjs → chunk-BYR3RQPB.mjs} +10 -73
  77. package/dist/{chunk-IWZKTWHZ.cjs → chunk-CA62IQY3.cjs} +7 -2
  78. package/dist/chunk-CALY6QG6.mjs +963 -0
  79. package/dist/{chunk-WC5UV2HQ.cjs → chunk-CBXBGM72.cjs} +2 -2
  80. package/dist/{chunk-WW46B6HA.cjs → chunk-CGR525MJ.cjs} +84 -45
  81. package/dist/{chunk-6V4TDWEC.cjs → chunk-CGVPXIRN.cjs} +18 -1
  82. package/dist/{chunk-677THUVP.mjs → chunk-CKFK3Z2V.mjs} +1 -1
  83. package/dist/chunk-CZS6OACQ.mjs +63 -0
  84. package/dist/{chunk-SGBJ247Q.cjs → chunk-D4ROBNTK.cjs} +2 -2
  85. package/dist/{chunk-WEW2JVA4.cjs → chunk-D5IHNDHI.cjs} +6 -6
  86. package/dist/{chunk-ULASELLA.cjs → chunk-DATEWH3W.cjs} +13 -1
  87. package/dist/{chunk-QUCXCDE2.cjs → chunk-DKU6NXRK.cjs} +1 -1
  88. package/dist/{chunk-NBBEQLOK.cjs → chunk-E55H6UKH.cjs} +9 -9
  89. package/dist/{chunk-AS2VPMEE.cjs → chunk-EGCT3AHF.cjs} +1440 -8172
  90. package/dist/{chunk-SDOTRX3V.cjs → chunk-EORXKFLR.cjs} +7 -7
  91. package/dist/{chunk-HD5CF3OE.mjs → chunk-ETPEZLS3.mjs} +2 -2
  92. package/dist/{chunk-RVXFINNS.cjs → chunk-EW4MEVLE.cjs} +30 -30
  93. package/dist/{chunk-HYTZYOW2.mjs → chunk-FCOLU5P6.mjs} +1172 -7904
  94. package/dist/chunk-FGH3ZXTP.mjs +1063 -0
  95. package/dist/{chunk-HRETEZ2Z.cjs → chunk-FLZ4H25A.cjs} +37 -35
  96. package/dist/chunk-FVPXT2JR.cjs +63 -0
  97. package/dist/{chunk-D2ULAULS.cjs → chunk-FXFKIJDA.cjs} +9 -7
  98. package/dist/chunk-GC3EM6H4.mjs +80 -0
  99. package/dist/chunk-GKQL726H.cjs +6096 -0
  100. package/dist/{chunk-5PWXMJOH.cjs → chunk-GNVEJUT5.cjs} +36 -36
  101. package/dist/{chunk-E3UK5IIB.cjs → chunk-GS3WR5HX.cjs} +5 -3
  102. package/dist/{chunk-QFW2IH5E.mjs → chunk-GZTUT75U.mjs} +5 -2
  103. package/dist/chunk-H3EGVQE5.mjs +22 -0
  104. package/dist/{chunk-LMPAPBUA.cjs → chunk-H44XGLFU.cjs} +36 -68
  105. package/dist/{chunk-SOP2EAA6.mjs → chunk-H56MQYEG.mjs} +1 -1
  106. package/dist/chunk-HANGSYMB.mjs +67 -0
  107. package/dist/{chunk-5BWWFHR2.mjs → chunk-HBEBV7OZ.mjs} +3 -3
  108. package/dist/{chunk-RSOJ7DRT.mjs → chunk-HCSVR4YZ.mjs} +1 -58
  109. package/dist/{chunk-P3PLW4FR.mjs → chunk-HKFBMHCD.mjs} +4 -4
  110. package/dist/{chunk-MLY2RP5R.mjs → chunk-I63UCMXW.mjs} +6 -2
  111. package/dist/{chunk-TO4GJ56K.cjs → chunk-I64GEPOB.cjs} +58 -18
  112. package/dist/{chunk-VNGH5MLF.mjs → chunk-I6UVKUYK.mjs} +1 -1
  113. package/dist/{chunk-EPYU2EBL.mjs → chunk-IF4NU2NG.mjs} +1 -1
  114. package/dist/{chunk-IVLZZZEI.mjs → chunk-IM7DY3ED.mjs} +1 -1
  115. package/dist/{chunk-YKZRDB5Z.mjs → chunk-IMQO6ZUU.mjs} +2 -2
  116. package/dist/{chunk-F5QO4FNE.mjs → chunk-INQ64HTJ.mjs} +43 -11
  117. package/dist/{chunk-BXDJXFQG.cjs → chunk-IRYK4Z5M.cjs} +4 -4
  118. package/dist/{chunk-UWPLULNK.mjs → chunk-JGHCKIRI.mjs} +84 -24
  119. package/dist/{chunk-BFJTHYTN.mjs → chunk-JIYYX7WU.mjs} +10 -8
  120. package/dist/{chunk-6MVFL3R5.cjs → chunk-JR4QCLJY.cjs} +1 -58
  121. package/dist/{chunk-Q2KB32T4.mjs → chunk-JXB6DVCO.mjs} +5 -5
  122. package/dist/{chunk-CGBDNNSM.cjs → chunk-KEXK442I.cjs} +44 -12
  123. package/dist/{chunk-5D2JIPLH.cjs → chunk-KK22JPQM.cjs} +10 -10
  124. package/dist/{chunk-EA5K5BKU.mjs → chunk-KNHBTJP6.mjs} +18 -1
  125. package/dist/{chunk-MVL2RAJW.mjs → chunk-KYN5ODF6.mjs} +1 -1
  126. package/dist/{chunk-B5J2YVG7.cjs → chunk-LDPKAYVS.cjs} +2 -2
  127. package/dist/chunk-LFHCG2DU.mjs +43 -0
  128. package/dist/{chunk-FZ6YYU2W.mjs → chunk-MGMF4VP7.mjs} +38 -1
  129. package/dist/{chunk-KTSUBU2E.mjs → chunk-MNUSIXGS.mjs} +2 -2
  130. package/dist/{chunk-MYIZXDZA.mjs → chunk-MOSYH4CY.mjs} +1 -1
  131. package/dist/{chunk-4ZFL5GFN.cjs → chunk-OILHPMFX.cjs} +86 -26
  132. package/dist/{chunk-AJQTP4OO.mjs → chunk-OJ7JP7RJ.mjs} +1 -1
  133. package/dist/{chunk-VWBHM3F6.mjs → chunk-OLQ73ZO5.mjs} +1 -1
  134. package/dist/{chunk-5OKBARDN.cjs → chunk-OZN4XL6L.cjs} +10 -10
  135. package/dist/{chunk-T5OJPTVN.cjs → chunk-P4TYB4SF.cjs} +2 -2
  136. package/dist/chunk-P7XDC7UJ.mjs +92 -0
  137. package/dist/{chunk-5ULKUBIA.cjs → chunk-PGW7HZE2.cjs} +6 -6
  138. package/dist/{chunk-SHLXACIO.cjs → chunk-PJ42JESY.cjs} +1 -9
  139. package/dist/{chunk-U6QLDL3G.mjs → chunk-PNCM5MFD.mjs} +1 -1
  140. package/dist/{chunk-OAHTRMIC.mjs → chunk-PYQ3ZG4Z.mjs} +11 -11
  141. package/dist/{chunk-KMTGADN3.mjs → chunk-QCVIRVHE.mjs} +1 -9
  142. package/dist/{chunk-RWFLWR5J.cjs → chunk-QJM7A4CR.cjs} +17 -15
  143. package/dist/{chunk-BWIQR4DH.cjs → chunk-RHGK2JEN.cjs} +56 -63
  144. package/dist/{chunk-QV4VE2OW.mjs → chunk-S6ENKNNG.mjs} +5 -3
  145. package/dist/{chunk-HRSAQ23K.cjs → chunk-SHFXCE5A.cjs} +4 -4
  146. package/dist/{chunk-EKN7NSZO.cjs → chunk-SZLNU3GJ.cjs} +8 -5
  147. package/dist/{chunk-WLL43JMO.mjs → chunk-T36UJS3X.mjs} +7 -5
  148. package/dist/{chunk-CNNOLE4O.mjs → chunk-T4II4MMW.mjs} +1 -1
  149. package/dist/{chunk-GKBWWRBG.mjs → chunk-T6DLMX5V.mjs} +11 -11
  150. package/dist/{chunk-CIOT4HGT.cjs → chunk-TAKG7ZCD.cjs} +14 -14
  151. package/dist/{chunk-SKVTP5PR.mjs → chunk-TFX4RTH2.mjs} +1 -62
  152. package/dist/chunk-TI7UANHI.cjs +77 -0
  153. package/dist/{chunk-6BK3K2GB.mjs → chunk-UIDWEU7M.mjs} +83 -44
  154. package/dist/{chunk-EGCTIS5F.mjs → chunk-UM3ZV5EP.mjs} +1 -1
  155. package/dist/{chunk-YWN746US.cjs → chunk-UMQAK3KP.cjs} +85 -54
  156. package/dist/chunk-UNJZGVPU.cjs +6 -0
  157. package/dist/{chunk-XKG2BLFN.cjs → chunk-UXMIFB44.cjs} +18 -35
  158. package/dist/{chunk-DMEPTZTI.mjs → chunk-VBN3UAPQ.mjs} +47 -7
  159. package/dist/chunk-VDRM36QB.cjs +963 -0
  160. package/dist/{chunk-RG4A6LB2.cjs → chunk-VNPXKF3G.cjs} +7 -7
  161. package/dist/chunk-VQDBNVOO.cjs +14 -0
  162. package/dist/chunk-VQGKD7RV.mjs +25 -0
  163. package/dist/{chunk-6HB6V3R7.mjs → chunk-WCWV25PG.mjs} +10 -27
  164. package/dist/{chunk-ZMSZZXOR.mjs → chunk-WDMIW6Q6.mjs} +0 -19
  165. package/dist/{chunk-4WVJLURN.mjs → chunk-WMHG64DA.mjs} +1 -1
  166. package/dist/{chunk-A657YSP4.cjs → chunk-WSOBCAYO.cjs} +37 -35
  167. package/dist/{chunk-ARC7I3O2.mjs → chunk-WW374SGU.mjs} +1 -1
  168. package/dist/{chunk-J63ZH5OQ.cjs → chunk-X3GMHKO3.cjs} +2 -2
  169. package/dist/{chunk-VT4WFRHA.mjs → chunk-XJAEZCT6.mjs} +1 -1
  170. package/dist/{chunk-ZUPXLIGB.mjs → chunk-XKIUHXHW.mjs} +618 -343
  171. package/dist/{chunk-6XWDE2P2.cjs → chunk-XVIEGKTT.cjs} +30 -5
  172. package/dist/{chunk-QG775BRV.cjs → chunk-Y2GNNXGV.cjs} +72 -54
  173. package/dist/{chunk-75HN5IZ3.mjs → chunk-Y4QVEU67.mjs} +21 -19
  174. package/dist/chunk-Y5RG6B7S.mjs +77 -0
  175. package/dist/{chunk-QRKIMN7T.mjs → chunk-Y6LRPO2K.mjs} +13 -1
  176. package/dist/{chunk-BZHXGVMA.mjs → chunk-YJBWB6GF.mjs} +5 -3
  177. package/dist/{chunk-WXJLNP33.cjs → chunk-YR2P74F7.cjs} +9 -7
  178. package/dist/chunk-YZAKIXRL.cjs +67 -0
  179. package/dist/chunk-ZKVJYQPO.mjs +6095 -0
  180. package/dist/{chunk-POSPE3IO.mjs → chunk-ZOABCQGT.mjs} +27 -2
  181. package/dist/chunk-ZQRCSUSB.cjs +25 -0
  182. package/dist/{chunk-ZMMBIVQM.mjs → chunk-ZZGQD7A4.mjs} +16 -86
  183. package/dist/{client-plugins-CsCuCLBz.d.mts → client-plugins-B_5QbNrp.d.mts} +2544 -2664
  184. package/dist/{client-plugins-D0ke-Hc8.d.ts → client-plugins-DgSfIWIF.d.ts} +2544 -2664
  185. package/dist/client-plugins.d.mts +5 -7
  186. package/dist/client-plugins.d.ts +5 -7
  187. package/dist/client.cjs +5 -5
  188. package/dist/client.d.mts +11 -12
  189. package/dist/client.d.ts +11 -12
  190. package/dist/client.mjs +4 -4
  191. package/dist/config.d.mts +5 -7
  192. package/dist/config.d.ts +5 -7
  193. package/dist/{devtools-LW4QQ5J3.cjs → devtools-ANJ7JAPQ.cjs} +21 -18
  194. package/dist/{devtools-5AFIPVUJ.mjs → devtools-VEQQDVHE.mjs} +20 -17
  195. package/dist/docs.cjs +23 -20
  196. package/dist/docs.d.mts +6 -8
  197. package/dist/docs.d.ts +6 -8
  198. package/dist/docs.mjs +22 -19
  199. package/dist/{endpoint-CA-TNX60.d.ts → endpoint-BOE0IAaG.d.ts} +6 -3
  200. package/dist/{endpoint-CCHFqyTE.d.mts → endpoint-DGZRZHux.d.mts} +6 -3
  201. package/dist/environment/vite.cjs +6 -2
  202. package/dist/environment/vite.d.mts +11 -2
  203. package/dist/environment/vite.d.ts +11 -2
  204. package/dist/environment/vite.mjs +5 -1
  205. package/dist/headers.cjs +4 -4
  206. package/dist/headers.mjs +3 -3
  207. package/dist/image/server.cjs +7 -3
  208. package/dist/image/server.d.mts +9 -1
  209. package/dist/image/server.d.ts +9 -1
  210. package/dist/image/server.mjs +6 -2
  211. package/dist/image/sharp.cjs +12 -10
  212. package/dist/image/sharp.mjs +4 -2
  213. package/dist/index.cjs +87 -67
  214. package/dist/index.d.mts +27 -24
  215. package/dist/index.d.ts +27 -24
  216. package/dist/index.mjs +100 -80
  217. package/dist/{integration-api-BPJo5oXb.d.ts → integration-api-BuPHMeKz.d.ts} +2 -2
  218. package/dist/{integration-api-0y4FXJpC.d.mts → integration-api-DWyMmvrR.d.mts} +2 -2
  219. package/dist/integration-orm-P2II2EBK.cjs +14 -0
  220. package/dist/{integration-orm-KV5B3BGZ.mjs → integration-orm-RBKCIQYZ.mjs} +4 -3
  221. package/dist/integrations.cjs +7 -5
  222. package/dist/integrations.d.mts +7 -9
  223. package/dist/integrations.d.ts +7 -9
  224. package/dist/integrations.mjs +6 -4
  225. package/dist/internal/app-markdown-runtime.cjs +6 -5
  226. package/dist/internal/app-markdown-runtime.d.mts +6 -8
  227. package/dist/internal/app-markdown-runtime.d.ts +6 -8
  228. package/dist/internal/app-markdown-runtime.mjs +5 -4
  229. package/dist/internal/build-runtime.cjs +56 -55
  230. package/dist/internal/build-runtime.d.mts +7 -9
  231. package/dist/internal/build-runtime.d.ts +7 -9
  232. package/dist/internal/build-runtime.mjs +55 -54
  233. package/dist/internal/cli-runtime.cjs +36 -30
  234. package/dist/internal/cli-runtime.mjs +36 -30
  235. package/dist/internal/client-error-overlay.cjs +4 -4
  236. package/dist/internal/client-error-overlay.mjs +1 -1
  237. package/dist/internal/compression-runtime.d.mts +5 -7
  238. package/dist/internal/compression-runtime.d.ts +5 -7
  239. package/dist/internal/config-runtime.cjs +21 -18
  240. package/dist/internal/config-runtime.d.mts +6 -8
  241. package/dist/internal/config-runtime.d.ts +6 -8
  242. package/dist/internal/config-runtime.mjs +20 -17
  243. package/dist/internal/docs-precompiled-runtime.cjs +3 -3
  244. package/dist/internal/docs-precompiled-runtime.mjs +2 -2
  245. package/dist/internal/infra-analytics-runtime.cjs +7 -7
  246. package/dist/internal/infra-analytics-runtime.mjs +5 -5
  247. package/dist/internal/metadata-image-runtime.cjs +4 -3
  248. package/dist/internal/metadata-image-runtime.mjs +3 -2
  249. package/dist/internal/product-telemetry-runtime.cjs +2 -2
  250. package/dist/internal/product-telemetry-runtime.mjs +1 -1
  251. package/dist/internal/production-node-env.cjs +2 -2
  252. package/dist/internal/production-node-env.mjs +1 -1
  253. package/dist/internal/production-runtime.cjs +44 -27
  254. package/dist/internal/production-runtime.d.mts +25 -14
  255. package/dist/internal/production-runtime.d.ts +25 -14
  256. package/dist/internal/production-runtime.mjs +47 -30
  257. package/dist/layers-CM5i6T7z.d.mts +55 -0
  258. package/dist/layers-CM5i6T7z.d.ts +55 -0
  259. package/dist/markdown.cjs +4 -4
  260. package/dist/markdown.d.mts +5 -7
  261. package/dist/markdown.d.ts +5 -7
  262. package/dist/markdown.mjs +3 -3
  263. package/dist/middleware.cjs +16 -10
  264. package/dist/middleware.d.mts +7 -9
  265. package/dist/middleware.d.ts +7 -9
  266. package/dist/middleware.mjs +19 -13
  267. package/dist/navigation.cjs +4 -4
  268. package/dist/navigation.d.mts +8 -9
  269. package/dist/navigation.d.ts +8 -9
  270. package/dist/navigation.mjs +3 -3
  271. package/dist/{nitro-MPZJGPXK.mjs → nitro-NFG2LBRC.mjs} +3 -2
  272. package/dist/{nitro-7F65EZZS.cjs → nitro-S2QABUFA.cjs} +4 -3
  273. package/dist/observability.cjs +2 -2
  274. package/dist/observability.mjs +1 -1
  275. package/dist/plugin-DBBZ4JI2.cjs +32 -0
  276. package/dist/plugin-SYMK7PQ2.mjs +32 -0
  277. package/dist/plugin.cjs +55 -42
  278. package/dist/plugin.d.mts +23 -7
  279. package/dist/plugin.d.ts +23 -7
  280. package/dist/plugin.mjs +56 -43
  281. package/dist/{production-runtime-BaI3WHnV.d.ts → production-runtime-DfknD3g_.d.ts} +17 -3
  282. package/dist/{production-runtime-DfRP0cV0.d.mts → production-runtime-j_WCfuwB.d.mts} +17 -3
  283. package/dist/programmatic-routes-client-DcoxEaLe.d.mts +55 -0
  284. package/dist/programmatic-routes-client-DcoxEaLe.d.ts +55 -0
  285. package/dist/query/client.cjs +2 -2
  286. package/dist/query/client.mjs +1 -1
  287. package/dist/{render-plan-CfIdJKAf.d.ts → render-plan-CFIhcYYS.d.ts} +1 -1
  288. package/dist/{render-plan-Dg8RBYFa.d.mts → render-plan-ChUtsymc.d.mts} +1 -1
  289. package/dist/renderer-client.d.mts +7 -8
  290. package/dist/renderer-client.d.ts +7 -8
  291. package/dist/{request-DfE02G_A.d.mts → request-F4HRwzSd.d.mts} +1 -1
  292. package/dist/{request-CEbHIIl4.d.ts → request-RJvelT8L.d.ts} +1 -1
  293. package/dist/request.cjs +3 -3
  294. package/dist/request.d.mts +6 -8
  295. package/dist/request.d.ts +6 -8
  296. package/dist/request.mjs +2 -2
  297. package/dist/{route-rendering-C4oHbv6C.d.ts → route-rendering-3a4fbNyC.d.mts} +1 -1
  298. package/dist/{route-rendering-BHyOfXjD.d.mts → route-rendering-D4coJ-kw.d.ts} +1 -1
  299. package/dist/{router-DwhA61SB.d.mts → router-DqIssGRO.d.mts} +1 -1
  300. package/dist/{router-uRN_29Em.d.ts → router-WLEW3Te1.d.ts} +1 -1
  301. package/dist/routes.cjs +6 -5
  302. package/dist/routes.d.mts +5 -7
  303. package/dist/routes.d.ts +5 -7
  304. package/dist/routes.mjs +5 -4
  305. package/dist/{runtime-COk03hmx.d.ts → runtime-BrNdLOq9.d.ts} +3 -3
  306. package/dist/{runtime-BEdHhN4C.d.mts → runtime-CmE_j-js.d.mts} +3 -3
  307. package/dist/{schema-dev-notice-Y7MQEFGN.cjs → schema-dev-notice-5JPE67AI.cjs} +6 -4
  308. package/dist/{schema-dev-notice-O67CPXJ6.mjs → schema-dev-notice-WLPZ6WKU.mjs} +4 -2
  309. package/dist/server-action-security.cjs +4 -3
  310. package/dist/server-action-security.mjs +3 -2
  311. package/dist/server-client-bridge-DKWDl5NB.d.mts +7 -0
  312. package/dist/server-client-bridge-DKWDl5NB.d.ts +7 -0
  313. package/dist/server-fn-client.d.mts +3 -3
  314. package/dist/server-fn-client.d.ts +3 -3
  315. package/dist/server-fn.cjs +8 -7
  316. package/dist/server-fn.d.mts +1 -1
  317. package/dist/server-fn.d.ts +1 -1
  318. package/dist/server-fn.mjs +7 -6
  319. package/dist/server-plugins.cjs +5 -5
  320. package/dist/server-plugins.d.mts +6 -8
  321. package/dist/server-plugins.d.ts +6 -8
  322. package/dist/server-plugins.mjs +4 -4
  323. package/dist/server-query-client.d.mts +1 -1
  324. package/dist/server-query-client.d.ts +1 -1
  325. package/dist/server-query.cjs +9 -8
  326. package/dist/server-query.d.mts +1 -1
  327. package/dist/server-query.d.ts +1 -1
  328. package/dist/server-query.mjs +8 -7
  329. package/dist/server.cjs +96 -72
  330. package/dist/server.d.mts +16 -12
  331. package/dist/server.d.ts +16 -12
  332. package/dist/server.mjs +81 -57
  333. package/dist/{spa-router-w4aFOuyn.d.mts → spa-router-C41zjnFl.d.mts} +2 -2
  334. package/dist/{spa-router-DrVOBVGg.d.ts → spa-router-D_0VXqPC.d.ts} +2 -2
  335. package/dist/storage.cjs +6 -2
  336. package/dist/storage.d.mts +9 -1
  337. package/dist/storage.d.ts +9 -1
  338. package/dist/storage.mjs +5 -1
  339. package/dist/testing.cjs +20 -18
  340. package/dist/testing.d.mts +6 -8
  341. package/dist/testing.d.ts +6 -8
  342. package/dist/testing.mjs +16 -14
  343. package/dist/theme/server.cjs +4 -4
  344. package/dist/theme/server.mjs +3 -3
  345. package/dist/{utils-Dhuqwmd2.d.ts → utils-BKWSe3S7.d.mts} +1 -1
  346. package/dist/{utils-BtYehqeU.d.mts → utils-YYcWsOJp.d.ts} +1 -1
  347. package/dist/version.cjs +2 -2
  348. package/dist/version.mjs +1 -1
  349. package/dist/vite.cjs +57 -44
  350. package/dist/vite.d.mts +92 -10
  351. package/dist/vite.d.ts +92 -10
  352. package/dist/vite.mjs +58 -45
  353. package/dist/{workflows-jZ4BcdoZ.d.ts → workflows-IWP1ddBm.d.mts} +5 -2
  354. package/dist/{workflows-jZ4BcdoZ.d.mts → workflows-IWP1ddBm.d.ts} +5 -2
  355. package/dist/workflows.cjs +4 -3
  356. package/dist/workflows.d.mts +1 -1
  357. package/dist/workflows.d.ts +1 -1
  358. package/dist/workflows.mjs +3 -2
  359. package/package.json +2 -1
  360. package/dist/chunk-3SDFA7UF.cjs +0 -701
  361. package/dist/chunk-E5GNDG5F.mjs +0 -701
  362. package/dist/integration-orm-55F7CII5.cjs +0 -13
@@ -6,18 +6,18 @@ var _chunkA6WIQH5Zcjs = require('./chunk-A6WIQH5Z.cjs');
6
6
 
7
7
 
8
8
 
9
- var _chunkWW46B6HAcjs = require('./chunk-WW46B6HA.cjs');
10
9
 
10
+ var _chunkCGR525MJcjs = require('./chunk-CGR525MJ.cjs');
11
11
 
12
12
 
13
- var _chunk5ULKUBIAcjs = require('./chunk-5ULKUBIA.cjs');
14
13
 
14
+ var _chunkPGW7HZE2cjs = require('./chunk-PGW7HZE2.cjs');
15
15
 
16
16
 
17
17
 
18
18
 
19
- var _chunkCIOT4HGTcjs = require('./chunk-CIOT4HGT.cjs');
20
19
 
20
+ var _chunkTAKG7ZCDcjs = require('./chunk-TAKG7ZCD.cjs');
21
21
 
22
22
 
23
23
 
@@ -27,7 +27,8 @@ var _chunkCIOT4HGTcjs = require('./chunk-CIOT4HGT.cjs');
27
27
 
28
28
 
29
29
 
30
- var _chunkPGZDEPTMcjs = require('./chunk-PGZDEPTM.cjs');
30
+
31
+ var _chunk5XS5NCVMcjs = require('./chunk-5XS5NCVM.cjs');
31
32
 
32
33
 
33
34
 
@@ -35,7 +36,7 @@ var _chunkPGZDEPTMcjs = require('./chunk-PGZDEPTM.cjs');
35
36
  var _chunkMWWVKDW3cjs = require('./chunk-MWWVKDW3.cjs');
36
37
 
37
38
 
38
- var _chunkWXJLNP33cjs = require('./chunk-WXJLNP33.cjs');
39
+ var _chunkYR2P74F7cjs = require('./chunk-YR2P74F7.cjs');
39
40
 
40
41
 
41
42
  var _chunkIK6LVLKCcjs = require('./chunk-IK6LVLKC.cjs');
@@ -44,7 +45,7 @@ var _chunkIK6LVLKCcjs = require('./chunk-IK6LVLKC.cjs');
44
45
 
45
46
 
46
47
 
47
- var _chunkHRETEZ2Zcjs = require('./chunk-HRETEZ2Z.cjs');
48
+ var _chunkFLZ4H25Acjs = require('./chunk-FLZ4H25A.cjs');
48
49
 
49
50
 
50
51
  var _chunkKCMTCM6Icjs = require('./chunk-KCMTCM6I.cjs');
@@ -80,16 +81,18 @@ var _chunk2SJ4RQ6Pcjs = require('./chunk-2SJ4RQ6P.cjs');
80
81
 
81
82
 
82
83
 
84
+
85
+ var _chunkEGCT3AHFcjs = require('./chunk-EGCT3AHF.cjs');
83
86
 
84
87
 
88
+ var _chunk45QJHGZMcjs = require('./chunk-45QJHGZM.cjs');
85
89
 
86
- var _chunkAS2VPMEEcjs = require('./chunk-AS2VPMEE.cjs');
87
90
 
88
91
 
89
92
 
90
93
 
94
+ var _chunkKK22JPQMcjs = require('./chunk-KK22JPQM.cjs');
91
95
 
92
- var _chunk5D2JIPLHcjs = require('./chunk-5D2JIPLH.cjs');
93
96
 
94
97
 
95
98
 
@@ -104,19 +107,21 @@ var _chunk5D2JIPLHcjs = require('./chunk-5D2JIPLH.cjs');
104
107
 
105
108
 
106
109
 
110
+ var _chunkEW4MEVLEcjs = require('./chunk-EW4MEVLE.cjs');
107
111
 
108
- var _chunkRVXFINNScjs = require('./chunk-RVXFINNS.cjs');
109
112
 
110
113
 
111
114
 
115
+ var _chunkBMOBTMDRcjs = require('./chunk-BMOBTMDR.cjs');
112
116
 
113
- var _chunkH5CLOUZScjs = require('./chunk-H5CLOUZS.cjs');
117
+
118
+ var _chunkTI7UANHIcjs = require('./chunk-TI7UANHI.cjs');
114
119
 
115
120
 
116
121
  var _chunkCXP5U3RWcjs = require('./chunk-CXP5U3RW.cjs');
117
122
 
118
123
 
119
- var _chunk3SDFA7UFcjs = require('./chunk-3SDFA7UF.cjs');
124
+ var _chunkVDRM36QBcjs = require('./chunk-VDRM36QB.cjs');
120
125
 
121
126
 
122
127
 
@@ -130,20 +135,20 @@ var _chunkHREOKQWTcjs = require('./chunk-HREOKQWT.cjs');
130
135
  var _chunkQ5B3KJBPcjs = require('./chunk-Q5B3KJBP.cjs');
131
136
 
132
137
 
133
- var _chunkWBKEZXWEcjs = require('./chunk-WBKEZXWE.cjs');
134
138
 
135
139
 
136
140
 
137
141
 
138
142
 
139
143
 
144
+ var _chunkPSV6XKPOcjs = require('./chunk-PSV6XKPO.cjs');
140
145
 
141
146
 
142
- var _chunkPSV6XKPOcjs = require('./chunk-PSV6XKPO.cjs');
143
147
 
148
+ var _chunkB6IMBBOScjs = require('./chunk-B6IMBBOS.cjs');
144
149
 
145
150
 
146
- var _chunk2ZYGC6SScjs = require('./chunk-2ZYGC6SS.cjs');
151
+ var _chunkWBKEZXWEcjs = require('./chunk-WBKEZXWE.cjs');
147
152
 
148
153
 
149
154
 
@@ -155,31 +160,34 @@ var _chunk6EXBPJ24cjs = require('./chunk-6EXBPJ24.cjs');
155
160
  var _chunkVEKFLAQMcjs = require('./chunk-VEKFLAQM.cjs');
156
161
 
157
162
 
158
- var _chunkEKN7NSZOcjs = require('./chunk-EKN7NSZO.cjs');
163
+ var _chunkSZLNU3GJcjs = require('./chunk-SZLNU3GJ.cjs');
159
164
 
160
165
 
161
166
 
162
167
  var _chunkOHY2ZWUGcjs = require('./chunk-OHY2ZWUG.cjs');
163
168
 
164
169
 
165
- var _chunkSGBJ247Qcjs = require('./chunk-SGBJ247Q.cjs');
170
+ var _chunkD4ROBNTKcjs = require('./chunk-D4ROBNTK.cjs');
171
+
166
172
 
167
173
 
174
+ var _chunkEORXKFLRcjs = require('./chunk-EORXKFLR.cjs');
168
175
 
169
- var _chunkSDOTRX3Vcjs = require('./chunk-SDOTRX3V.cjs');
170
176
 
177
+ var _chunkOILHPMFXcjs = require('./chunk-OILHPMFX.cjs');
171
178
 
172
179
 
173
180
 
174
- var _chunkBWIQR4DHcjs = require('./chunk-BWIQR4DH.cjs');
175
181
 
182
+ var _chunkRHGK2JENcjs = require('./chunk-RHGK2JEN.cjs');
176
183
 
177
184
 
178
185
 
179
- var _chunkLMPAPBUAcjs = require('./chunk-LMPAPBUA.cjs');
180
186
 
187
+ var _chunk6BWKJ6QScjs = require('./chunk-6BWKJ6QS.cjs');
181
188
 
182
- var _chunkRWFLWR5Jcjs = require('./chunk-RWFLWR5J.cjs');
189
+
190
+ var _chunkQJM7A4CRcjs = require('./chunk-QJM7A4CR.cjs');
183
191
 
184
192
 
185
193
  var _chunkUFDAAQFXcjs = require('./chunk-UFDAAQFX.cjs');
@@ -206,13 +214,13 @@ var _chunk5QIKR7RRcjs = require('./chunk-5QIKR7RR.cjs');
206
214
  var _chunkKNBBQHO2cjs = require('./chunk-KNBBQHO2.cjs');
207
215
 
208
216
 
209
- var _chunkQUCXCDE2cjs = require('./chunk-QUCXCDE2.cjs');
217
+ var _chunkDKU6NXRKcjs = require('./chunk-DKU6NXRK.cjs');
210
218
 
211
219
 
212
220
  var _chunkC5GUTBZKcjs = require('./chunk-C5GUTBZK.cjs');
213
221
 
214
222
 
215
- var _chunk6XWDE2P2cjs = require('./chunk-6XWDE2P2.cjs');
223
+ var _chunkXVIEGKTTcjs = require('./chunk-XVIEGKTT.cjs');
216
224
 
217
225
 
218
226
  var _chunkNO3WWW3Ncjs = require('./chunk-NO3WWW3N.cjs');
@@ -230,15 +238,15 @@ var _fs = require('fs');
230
238
  var FARM_CLIENT_CSS_HREF_PLACEHOLDER = "/__farm_client_css_href__";
231
239
  var FARM_CLIENT_JS_SRC_PLACEHOLDER = "/__farm_client_js_src__";
232
240
  async function hashAndCopy(sourcePath, destinationDir, hashedName) {
233
- const fs3 = await import("fs/promises");
241
+ const fs4 = await import("fs/promises");
234
242
  try {
235
- const bytes = await fs3.readFile(sourcePath);
243
+ const bytes = await fs4.readFile(sourcePath);
236
244
  if (bytes.length === 0) return null;
237
245
  const { createHash } = await import("crypto");
238
246
  const hash = createHash("sha256").update(bytes).digest("hex").slice(0, 8);
239
247
  const name = hashedName(hash);
240
- await fs3.mkdir(destinationDir, { recursive: true });
241
- await fs3.writeFile(_path2.default.join(destinationDir, name), bytes);
248
+ await fs4.mkdir(destinationDir, { recursive: true });
249
+ await fs4.writeFile(_path2.default.join(destinationDir, name), bytes);
242
250
  return name;
243
251
  } catch (e) {
244
252
  return null;
@@ -255,9 +263,9 @@ async function resolveHashedClientCssHref(clientOutputDir) {
255
263
  }
256
264
  _chunkS3JO3N4Hcjs.__name.call(void 0, resolveHashedClientCssHref, "resolveHashedClientCssHref");
257
265
  async function findFingerprintedClientEntry(clientOutputDir) {
258
- const fs3 = await import("fs/promises");
266
+ const fs4 = await import("fs/promises");
259
267
  try {
260
- const entries = await fs3.readdir(clientOutputDir);
268
+ const entries = await fs4.readdir(clientOutputDir);
261
269
  return _nullishCoalesce(entries.find((name) => /^farm-client-h[0-9a-f]+\.js$/.test(name)), () => ( null));
262
270
  } catch (e2) {
263
271
  return null;
@@ -267,10 +275,10 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, findFingerprintedClientEntry, "findFingerp
267
275
  async function resolveHashedClientJsSrc(clientOutputDir) {
268
276
  const entryName = await findFingerprintedClientEntry(clientOutputDir);
269
277
  if (!entryName) return "/farm-client.js";
270
- const fs3 = await import("fs/promises");
278
+ const fs4 = await import("fs/promises");
271
279
  const shim = `export * from "./${entryName}";
272
280
  `;
273
- await fs3.writeFile(_path2.default.join(clientOutputDir, "farm-client.js"), shim);
281
+ await fs4.writeFile(_path2.default.join(clientOutputDir, "farm-client.js"), shim);
274
282
  return `/${entryName}`;
275
283
  }
276
284
  _chunkS3JO3N4Hcjs.__name.call(void 0, resolveHashedClientJsSrc, "resolveHashedClientJsSrc");
@@ -319,7 +327,7 @@ function getDocsTitle(docs) {
319
327
  }
320
328
  _chunkS3JO3N4Hcjs.__name.call(void 0, getDocsTitle, "getDocsTitle");
321
329
  function loadPages(contentDir, docs) {
322
- return _chunkPGZDEPTMcjs.discoverFarmDocsPages.call(void 0, contentDir, docs).map((page) => _chunkPGZDEPTMcjs.loadFarmDocsPage.call(void 0, contentDir, docs, page.slug)).filter((page) => Boolean(page)).sort((a, b) => a.href.localeCompare(b.href));
330
+ return _chunk5XS5NCVMcjs.discoverFarmDocsPages.call(void 0, contentDir, docs).map((page) => _chunk5XS5NCVMcjs.loadFarmDocsPage.call(void 0, contentDir, docs, page.slug)).filter((page) => Boolean(page)).sort((a, b) => a.href.localeCompare(b.href));
323
331
  }
324
332
  _chunkS3JO3N4Hcjs.__name.call(void 0, loadPages, "loadPages");
325
333
  function findSocialImagePath(html) {
@@ -340,14 +348,14 @@ async function addHandlerRoute(routes, pathname, handler, absolutePaths) {
340
348
  }
341
349
  _chunkS3JO3N4Hcjs.__name.call(void 0, addHandlerRoute, "addHandlerRoute");
342
350
  async function compileFarmDocsManifest(docs, options) {
343
- const contentDir = _chunkPGZDEPTMcjs.resolveFarmDocsContentDir.call(void 0, docs, options);
351
+ const contentDir = _chunk5XS5NCVMcjs.resolveFarmDocsContentDir.call(void 0, docs, options);
344
352
  const pages = loadPages(contentDir, docs);
345
353
  const absolutePaths = [
346
354
  _path2.default.resolve(options.root),
347
355
  _path2.default.resolve(contentDir),
348
356
  docs.configPath || ""
349
357
  ];
350
- const handler = _chunkPGZDEPTMcjs.createFarmDocsHandler.call(void 0, docs, {
358
+ const handler = _chunk5XS5NCVMcjs.createFarmDocsHandler.call(void 0, docs, {
351
359
  root: options.root,
352
360
  srcDir: options.srcDir,
353
361
  clientEntry: options.clientEntry,
@@ -356,7 +364,7 @@ async function compileFarmDocsManifest(docs, options) {
356
364
  globalStylesheetHref: options.globalStylesheetHref,
357
365
  isPathGuarded: options.isPathGuarded
358
366
  });
359
- const apiHandler = _chunkCIOT4HGTcjs.createFarmDocsAPIHandler.call(void 0, {
367
+ const apiHandler = _chunkTAKG7ZCDcjs.createFarmDocsAPIHandler.call(void 0, {
360
368
  rootDir: options.root,
361
369
  srcDir: options.srcDir,
362
370
  docs,
@@ -367,7 +375,7 @@ async function compileFarmDocsManifest(docs, options) {
367
375
  const apiMarkdown = {};
368
376
  for (const page of pages) {
369
377
  const htmlResponse = await addHandlerRoute(routes, page.href, handler, absolutePaths);
370
- const markdownPath = _chunkPGZDEPTMcjs.getFarmDocsMarkdownPath.call(void 0, page.href);
378
+ const markdownPath = _chunk5XS5NCVMcjs.getFarmDocsMarkdownPath.call(void 0, page.href);
371
379
  await addHandlerRoute(routes, markdownPath, handler, absolutePaths);
372
380
  if (htmlResponse) {
373
381
  const socialImagePath = findSocialImagePath(await htmlResponse.text());
@@ -451,7 +459,7 @@ async function compileFarmDocsManifest(docs, options) {
451
459
  post: await compileResponse(postResponse, absolutePaths),
452
460
  search: {
453
461
  pages: publicPages.map((page) => ({
454
- ..._chunkPGZDEPTMcjs.toFarmDocsMarkdownPage.call(void 0, page),
462
+ ..._chunk5XS5NCVMcjs.toFarmDocsMarkdownPage.call(void 0, page),
455
463
  sourcePath: `farm-docs:${page.slug || "index"}`
456
464
  })),
457
465
  search: _nullishCoalesce(searchConfig, () => ( true)),
@@ -639,7 +647,7 @@ async function createFarmRouteRuntimeManifest(options) {
639
647
  const routes = [];
640
648
  for (const [pattern, entry] of options.routeManager.getRoutes()) {
641
649
  const routeModule = await options.routeManager.loadRouteModule(entry.modulePath);
642
- const rendering = await _chunk5D2JIPLHcjs.resolveRouteRenderingConfigFromFile.call(void 0, routeModule, entry.modulePath);
650
+ const rendering = await _chunkKK22JPQMcjs.resolveRouteRenderingConfigFromFile.call(void 0, routeModule, entry.modulePath);
643
651
  const runtimeConfig = await options.routeManager.resolveRouteRuntimeConfig(pattern);
644
652
  routes.push({
645
653
  kind: "page",
@@ -705,10 +713,10 @@ async function createFarmRouteRuntimeManifest(options) {
705
713
  }
706
714
  _chunkS3JO3N4Hcjs.__name.call(void 0, createFarmRouteRuntimeManifest, "createFarmRouteRuntimeManifest");
707
715
  async function writeFarmRouteRuntimeManifest(directory, manifest) {
708
- const fs3 = await import("fs/promises");
716
+ const fs4 = await import("fs/promises");
709
717
  const manifestPath = _path2.default.join(directory, FARM_ROUTE_RUNTIME_MANIFEST);
710
- await fs3.mkdir(directory, { recursive: true });
711
- await fs3.writeFile(manifestPath, `${JSON.stringify(manifest, null, 2)}
718
+ await fs4.mkdir(directory, { recursive: true });
719
+ await fs4.writeFile(manifestPath, `${JSON.stringify(manifest, null, 2)}
712
720
  `);
713
721
  return manifestPath;
714
722
  }
@@ -753,7 +761,7 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, normalizeManifestSource, "normalizeManifes
753
761
 
754
762
  // src/nitro/vercel-route-runtime.ts
755
763
 
756
- async function createFarmVercelRouteRuntimeFunctions(outputDir, manifest, fs3, basePath = "/") {
764
+ async function createFarmVercelRouteRuntimeFunctions(outputDir, manifest, fs4, basePath = "/") {
757
765
  const dynamicRoutes = manifest.routes.filter(
758
766
  (route) => route.rendering === "dynamic" && route.runtime !== "edge"
759
767
  );
@@ -784,8 +792,8 @@ async function createFarmVercelRouteRuntimeFunctions(outputDir, manifest, fs3, b
784
792
  groupIndex += 1;
785
793
  const functionName = `__farm_runtime_${groupIndex}`;
786
794
  const functionDir = _path2.default.join(functionsDir, `${functionName}.func`);
787
- await fs3.cp(baseFunctionDir, functionDir, { recursive: true, force: true });
788
- await configureVercelFunction(functionDir, group.config, fs3);
795
+ await fs4.cp(baseFunctionDir, functionDir, { recursive: true, force: true });
796
+ await configureVercelFunction(functionDir, group.config, fs4);
789
797
  destinations.set(key, `/${functionName}`);
790
798
  }
791
799
  const routes = [];
@@ -799,17 +807,7 @@ async function createFarmVercelRouteRuntimeFunctions(outputDir, manifest, fs3, b
799
807
  regions: route.regions,
800
808
  maxDuration: route.maxDuration
801
809
  });
802
- routes.push({
803
- src,
804
- dest: destinations.get(key) || "/__nitro",
805
- ...route.kind === "api" || route.pattern.startsWith("/api/") ? {
806
- headers: {
807
- "Access-Control-Allow-Origin": "*",
808
- "Access-Control-Allow-Methods": "*",
809
- "Access-Control-Allow-Headers": "*"
810
- }
811
- } : {}
812
- });
810
+ routes.push({ src, dest: destinations.get(key) || "/__nitro" });
813
811
  }
814
812
  return routes;
815
813
  }
@@ -834,15 +832,15 @@ function farmRoutePatternToVercelSource(pattern, basePath = "/") {
834
832
  return source === "/" ? normalizedBasePath : `${normalizedBasePath}${source}`;
835
833
  }
836
834
  _chunkS3JO3N4Hcjs.__name.call(void 0, farmRoutePatternToVercelSource, "farmRoutePatternToVercelSource");
837
- async function configureVercelFunction(functionDir, config, fs3) {
835
+ async function configureVercelFunction(functionDir, config, fs4) {
838
836
  const configPath = _path2.default.join(functionDir, ".vc-config.json");
839
- const current = JSON.parse(await fs3.readFile(configPath, "utf8"));
837
+ const current = JSON.parse(await fs4.readFile(configPath, "utf8"));
840
838
  const next = {
841
839
  ...current,
842
840
  ..._optionalChain([config, 'access', _11 => _11.regions, 'optionalAccess', _12 => _12.length]) ? { regions: config.regions } : {},
843
841
  ...config.maxDuration ? { maxDuration: config.maxDuration } : {}
844
842
  };
845
- await fs3.writeFile(configPath, `${JSON.stringify(next, null, 2)}
843
+ await fs4.writeFile(configPath, `${JSON.stringify(next, null, 2)}
846
844
  `);
847
845
  }
848
846
  _chunkS3JO3N4Hcjs.__name.call(void 0, configureVercelFunction, "configureVercelFunction");
@@ -975,6 +973,39 @@ export default async function farmNetlifyHandler(request, context) {
975
973
  }
976
974
  _chunkS3JO3N4Hcjs.__name.call(void 0, createFarmNetlifyEntry, "createFarmNetlifyEntry");
977
975
 
976
+ // src/nitro/client-sourcemaps.ts
977
+
978
+
979
+ var FARM_CLIENT_SOURCEMAPS_DIR = "client-sourcemaps";
980
+ function resolveFarmClientSourcemap(sourcemap) {
981
+ return sourcemap ? "hidden" : false;
982
+ }
983
+ _chunkS3JO3N4Hcjs.__name.call(void 0, resolveFarmClientSourcemap, "resolveFarmClientSourcemap");
984
+ function createFarmPrivateClientSourcemapsPlugin(options) {
985
+ let maps = [];
986
+ return {
987
+ name: "farm-private-client-sourcemaps",
988
+ enforce: "post",
989
+ generateBundle(_output, bundle) {
990
+ maps = [];
991
+ for (const [fileName, output] of Object.entries(bundle)) {
992
+ if (output.type !== "asset" || !fileName.endsWith(".map")) continue;
993
+ maps.push([fileName, _nullishCoalesce(output.source, () => ( ""))]);
994
+ delete bundle[fileName];
995
+ }
996
+ },
997
+ async writeBundle() {
998
+ await _promises2.default.rm(options.outDir, { recursive: true, force: true });
999
+ for (const [fileName, source] of maps) {
1000
+ const target = _path2.default.join(options.outDir, fileName);
1001
+ await _promises2.default.mkdir(_path2.default.dirname(target), { recursive: true });
1002
+ await _promises2.default.writeFile(target, source);
1003
+ }
1004
+ }
1005
+ };
1006
+ }
1007
+ _chunkS3JO3N4Hcjs.__name.call(void 0, createFarmPrivateClientSourcemapsPlugin, "createFarmPrivateClientSourcemapsPlugin");
1008
+
978
1009
  // src/nitro/universal-build.ts
979
1010
  function preloadFarmNitroBuilder() {
980
1011
  return import("nitro/builder").then(
@@ -1145,13 +1176,44 @@ function createPrerenderRuntimeResolverPlugin(root, resolveNitroEntry = resolveN
1145
1176
  };
1146
1177
  }
1147
1178
  _chunkS3JO3N4Hcjs.__name.call(void 0, createPrerenderRuntimeResolverPlugin, "createPrerenderRuntimeResolverPlugin");
1148
- function resolveNitroPackageEntry(root) {
1179
+ function createFarmStorageModuleRegistration(config) {
1180
+ const modules = _chunkOILHPMFXcjs._collectFarmStorageModules.call(void 0, config.storage);
1181
+ if (modules.length === 0) return "";
1182
+ const root = config.root || process.cwd();
1149
1183
  const projectRequire = _module.createRequire.call(void 0, _path2.default.join(root, "package.json"));
1150
1184
  let runtimeRequire = projectRequire;
1151
1185
  try {
1152
1186
  runtimeRequire = _module.createRequire.call(void 0, projectRequire.resolve("@farm.js/core"));
1153
1187
  } catch (e11) {
1154
1188
  }
1189
+ const loaders = [];
1190
+ for (const specifier of modules) {
1191
+ let resolved;
1192
+ for (const require2 of [runtimeRequire, projectRequire]) {
1193
+ try {
1194
+ resolved = require2.resolve(specifier);
1195
+ break;
1196
+ } catch (e12) {
1197
+ }
1198
+ }
1199
+ if (resolved) {
1200
+ loaders.push(
1201
+ ` ${JSON.stringify(specifier)}: () => import(${toVirtualEntryImportSpecifier(resolved)}),`
1202
+ );
1203
+ }
1204
+ }
1205
+ return loaders.length > 0 ? `_registerFarmStorageModules({
1206
+ ${loaders.join("\n")}
1207
+ });` : "";
1208
+ }
1209
+ _chunkS3JO3N4Hcjs.__name.call(void 0, createFarmStorageModuleRegistration, "createFarmStorageModuleRegistration");
1210
+ function resolveNitroPackageEntry(root) {
1211
+ const projectRequire = _module.createRequire.call(void 0, _path2.default.join(root, "package.json"));
1212
+ let runtimeRequire = projectRequire;
1213
+ try {
1214
+ runtimeRequire = _module.createRequire.call(void 0, projectRequire.resolve("@farm.js/core"));
1215
+ } catch (e13) {
1216
+ }
1155
1217
  return runtimeRequire.resolve("nitro");
1156
1218
  }
1157
1219
  _chunkS3JO3N4Hcjs.__name.call(void 0, resolveNitroPackageEntry, "resolveNitroPackageEntry");
@@ -1207,7 +1269,7 @@ async function canUseRolldownBuilder() {
1207
1269
  try {
1208
1270
  await import("rolldown");
1209
1271
  return true;
1210
- } catch (e12) {
1272
+ } catch (e14) {
1211
1273
  return false;
1212
1274
  }
1213
1275
  }
@@ -1223,7 +1285,7 @@ function hasReactDomEdgeServerBuild(root) {
1223
1285
  try {
1224
1286
  _module.createRequire.call(void 0, _path2.default.join(root, "package.json")).resolve("react-dom/server.edge");
1225
1287
  return true;
1226
- } catch (e13) {
1288
+ } catch (e15) {
1227
1289
  return false;
1228
1290
  }
1229
1291
  }
@@ -1271,6 +1333,45 @@ function createReactProductionModePlugin() {
1271
1333
  };
1272
1334
  }
1273
1335
  _chunkS3JO3N4Hcjs.__name.call(void 0, createReactProductionModePlugin, "createReactProductionModePlugin");
1336
+ var FARM_OMITTED_METADATA_IMAGE_RUNTIME_ID = "\0farm-omitted-metadata-image-runtime";
1337
+ function isFarmCoreModule(file) {
1338
+ let dir = _path2.default.dirname(file.split("?", 1)[0]);
1339
+ while (dir !== _path2.default.dirname(dir)) {
1340
+ const manifest = _path2.default.join(dir, "package.json");
1341
+ if (_fs.existsSync.call(void 0, manifest)) {
1342
+ try {
1343
+ return JSON.parse(_fs.readFileSync.call(void 0, manifest, "utf8")).name === "@farm.js/core";
1344
+ } catch (e16) {
1345
+ return false;
1346
+ }
1347
+ }
1348
+ dir = _path2.default.dirname(dir);
1349
+ }
1350
+ return false;
1351
+ }
1352
+ _chunkS3JO3N4Hcjs.__name.call(void 0, isFarmCoreModule, "isFarmCoreModule");
1353
+ function createOmittedMetadataImageRuntimePlugin(externalizeOtherImports) {
1354
+ return {
1355
+ name: "farm-omitted-metadata-image-runtime",
1356
+ resolveId(source, importer) {
1357
+ if (source !== "@vercel/og") return null;
1358
+ const fromCoreRuntime = importer !== void 0 && isFarmCoreModule(importer) && !/^og\.[cm]?[jt]sx?$/.test(_path2.default.basename(importer.split("?", 1)[0]));
1359
+ if (fromCoreRuntime) return FARM_OMITTED_METADATA_IMAGE_RUNTIME_ID;
1360
+ return externalizeOtherImports ? { id: source, external: true } : null;
1361
+ },
1362
+ load(id) {
1363
+ if (id !== FARM_OMITTED_METADATA_IMAGE_RUNTIME_ID) return null;
1364
+ return `
1365
+ export class ImageResponse {
1366
+ constructor() {
1367
+ throw new Error("@vercel/og is not in this server build because the app has no generated metadata image route.");
1368
+ }
1369
+ }
1370
+ `;
1371
+ }
1372
+ };
1373
+ }
1374
+ _chunkS3JO3N4Hcjs.__name.call(void 0, createOmittedMetadataImageRuntimePlugin, "createOmittedMetadataImageRuntimePlugin");
1274
1375
  function createMetadataImageWasmPlugin() {
1275
1376
  return {
1276
1377
  name: "farm-metadata-image-wasm",
@@ -1349,6 +1450,10 @@ function hasFarmServerCacheConfig(cache) {
1349
1450
  return cache.adapter !== void 0 || cache.namespace !== void 0 || cache.maxEntries !== void 0 || cache.lease !== void 0;
1350
1451
  }
1351
1452
  _chunkS3JO3N4Hcjs.__name.call(void 0, hasFarmServerCacheConfig, "hasFarmServerCacheConfig");
1453
+ function hasFarmServerStorageConfig(storage) {
1454
+ return !!storage && typeof storage === "object" && Reflect.ownKeys(storage).length > 0;
1455
+ }
1456
+ _chunkS3JO3N4Hcjs.__name.call(void 0, hasFarmServerStorageConfig, "hasFarmServerStorageConfig");
1352
1457
  function hasFarmRuntimeConfigModule(config, configModulePath) {
1353
1458
  return Boolean(configModulePath || (config.layers || []).some((layer) => layer.configFile));
1354
1459
  }
@@ -1487,14 +1592,14 @@ function hasProjectPostcssConfig(root) {
1487
1592
  try {
1488
1593
  projectRequire.resolve(`./${file}`);
1489
1594
  return true;
1490
- } catch (e14) {
1595
+ } catch (e17) {
1491
1596
  return false;
1492
1597
  }
1493
1598
  });
1494
1599
  }
1495
1600
  _chunkS3JO3N4Hcjs.__name.call(void 0, hasProjectPostcssConfig, "hasProjectPostcssConfig");
1496
1601
  async function findFarmConfigPath(root) {
1497
- const fs3 = await import("fs/promises");
1602
+ const fs4 = await import("fs/promises");
1498
1603
  const candidates = [
1499
1604
  "farm.config.ts",
1500
1605
  "farm.config.mts",
@@ -1508,9 +1613,9 @@ async function findFarmConfigPath(root) {
1508
1613
  for (const candidate of candidates) {
1509
1614
  const resolvedPath = _path2.default.join(root, candidate);
1510
1615
  try {
1511
- await fs3.access(resolvedPath);
1616
+ await fs4.access(resolvedPath);
1512
1617
  return resolvedPath;
1513
- } catch (e15) {
1618
+ } catch (e18) {
1514
1619
  }
1515
1620
  }
1516
1621
  return null;
@@ -1518,7 +1623,7 @@ async function findFarmConfigPath(root) {
1518
1623
  _chunkS3JO3N4Hcjs.__name.call(void 0, findFarmConfigPath, "findFarmConfigPath");
1519
1624
  function hasFarmServerRuntimePlugins(config) {
1520
1625
  return (config.plugins || []).some((plugin) => {
1521
- if (_chunkBWIQR4DHcjs.getFarmIntegrationPluginServerRuntime.call(void 0, plugin) === false) return false;
1626
+ if (_chunkRHGK2JENcjs.getFarmIntegrationPluginServerRuntime.call(void 0, plugin) === false) return false;
1522
1627
  return Boolean(
1523
1628
  plugin.setup || plugin.init || plugin.ready || plugin.shutdown || plugin.runtime || plugin.router || plugin.render || plugin.beforeRouteMatch || plugin.afterRouteMatch || plugin.beforeRender || plugin.afterRender || plugin.onError || plugin.transformHTML
1524
1629
  );
@@ -1531,19 +1636,19 @@ function hasFarmPluginRoutes(config) {
1531
1636
  _chunkS3JO3N4Hcjs.__name.call(void 0, hasFarmPluginRoutes, "hasFarmPluginRoutes");
1532
1637
  function farmServerRuntimePluginsMayHandlePath(config, pathname) {
1533
1638
  return (config.plugins || []).some(
1534
- (plugin) => _chunkBWIQR4DHcjs.getFarmIntegrationPluginServerRuntime.call(void 0, plugin) !== false && _chunkAS2VPMEEcjs.farmPluginMayAffectRuntimePath.call(void 0, plugin, pathname)
1639
+ (plugin) => _chunkRHGK2JENcjs.getFarmIntegrationPluginServerRuntime.call(void 0, plugin) !== false && _chunkTI7UANHIcjs.farmPluginMayAffectRuntimePath.call(void 0, plugin, pathname)
1535
1640
  );
1536
1641
  }
1537
1642
  _chunkS3JO3N4Hcjs.__name.call(void 0, farmServerRuntimePluginsMayHandlePath, "farmServerRuntimePluginsMayHandlePath");
1538
1643
  async function discoverMiddlewareRoutes(appDir) {
1539
- const fs3 = await import("fs/promises");
1644
+ const fs4 = await import("fs/promises");
1540
1645
  const appDirs = Array.isArray(appDir) ? [...appDir] : [appDir];
1541
1646
  const routes = /* @__PURE__ */ new Map();
1542
1647
  async function walk(dir, routePath, directory, discovered) {
1543
1648
  let entries;
1544
1649
  try {
1545
- entries = await fs3.readdir(dir, { withFileTypes: true });
1546
- } catch (e16) {
1650
+ entries = await fs4.readdir(dir, { withFileTypes: true });
1651
+ } catch (e19) {
1547
1652
  return;
1548
1653
  }
1549
1654
  const middlewareFile = entries.find(
@@ -1562,8 +1667,8 @@ async function discoverMiddlewareRoutes(appDir) {
1562
1667
  }
1563
1668
  await walk(
1564
1669
  _path2.default.join(dir, entry.name),
1565
- _chunkLMPAPBUAcjs.appendMiddlewareRoutePath.call(void 0, routePath, entry.name),
1566
- _chunkLMPAPBUAcjs.appendMiddlewareDirectory.call(void 0, directory, entry.name),
1670
+ _chunk6BWKJ6QScjs.appendMiddlewareRoutePath.call(void 0, routePath, entry.name),
1671
+ _chunk6BWKJ6QScjs.appendMiddlewareDirectory.call(void 0, directory, entry.name),
1567
1672
  discovered
1568
1673
  );
1569
1674
  }
@@ -1576,7 +1681,7 @@ async function discoverMiddlewareRoutes(appDir) {
1576
1681
  routes.set(route.directory, route);
1577
1682
  }
1578
1683
  }
1579
- return Array.from(routes.values()).sort(_chunkLMPAPBUAcjs.compareMiddlewareRouteLocations).map(({ path: routePath, filePath }) => ({ path: routePath, filePath }));
1684
+ return Array.from(routes.values()).sort(_chunk6BWKJ6QScjs.compareMiddlewareRouteLocations).map(({ path: routePath, filePath }) => ({ path: routePath, filePath }));
1580
1685
  }
1581
1686
  _chunkS3JO3N4Hcjs.__name.call(void 0, discoverMiddlewareRoutes, "discoverMiddlewareRoutes");
1582
1687
  function assertFarmDocsRuntimeSupported(config, preset) {
@@ -1594,7 +1699,7 @@ async function buildUniversal(config, routeManager, apiRouteManager, serverRende
1594
1699
  assertFarmDocsRuntimeSupported(config, preset);
1595
1700
  const srcDir = config.srcDir || "src";
1596
1701
  const distDir = config.distDir || ".farm";
1597
- const deployOutputDir = _chunkHRETEZ2Zcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
1702
+ const deployOutputDir = _chunkFLZ4H25Acjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
1598
1703
  const lifecyclePluginManager = options.pluginManager;
1599
1704
  const productionViteResultPromise = Promise.allSettled([
1600
1705
  Promise.resolve(_nullishCoalesce(options.productionVite, () => ( _chunkA6WIQH5Zcjs.loadFarmProductionVite.call(void 0, ))))
@@ -1613,7 +1718,7 @@ async function buildUniversal(config, routeManager, apiRouteManager, serverRende
1613
1718
  const routeRuntimeManifestResultPromise = Promise.allSettled([routeRuntimeManifestPromise]);
1614
1719
  const pageRoutes = [];
1615
1720
  for (const [pattern, entry] of routeManager.getRoutes()) {
1616
- const markdownSourcePath = entry.markdownSourcePath || (_chunkEKN7NSZOcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) ? entry.modulePath : void 0);
1721
+ const markdownSourcePath = entry.markdownSourcePath || (_chunkSZLNU3GJcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) ? entry.modulePath : void 0);
1617
1722
  pageRoutes.push({
1618
1723
  pattern,
1619
1724
  ...entry.directory ? { directory: entry.directory } : {},
@@ -1638,12 +1743,12 @@ async function buildUniversal(config, routeManager, apiRouteManager, serverRende
1638
1743
  })
1639
1744
  );
1640
1745
  _chunk5QIKR7RRcjs.logger.info(`\u{1F4CB} Found ${pageRoutes.length} page routes`);
1641
- const fs3 = await import("fs/promises");
1746
+ const fs4 = await import("fs/promises");
1642
1747
  const layoutRoutes = [];
1643
1748
  const appDir = _path2.default.join(root, srcDir, "app");
1644
1749
  async function findLayoutsForClient(dir, routePrefix = "/") {
1645
1750
  try {
1646
- const entries = await fs3.readdir(dir, { withFileTypes: true });
1751
+ const entries = await fs4.readdir(dir, { withFileTypes: true });
1647
1752
  for (const entry of entries) {
1648
1753
  if (entry.isFile() && entry.name.match(/^layout\.(tsx?|jsx?|vue|svelte)$/)) {
1649
1754
  layoutRoutes.push({
@@ -1655,7 +1760,7 @@ async function buildUniversal(config, routeManager, apiRouteManager, serverRende
1655
1760
  await findLayoutsForClient(_path2.default.join(dir, entry.name), childPrefix);
1656
1761
  }
1657
1762
  }
1658
- } catch (e17) {
1763
+ } catch (e20) {
1659
1764
  }
1660
1765
  }
1661
1766
  _chunkS3JO3N4Hcjs.__name.call(void 0, findLayoutsForClient, "findLayoutsForClient");
@@ -1688,7 +1793,8 @@ async function buildUniversal(config, routeManager, apiRouteManager, serverRende
1688
1793
  routeSlots,
1689
1794
  isolatedClientBoundaryModules,
1690
1795
  hydrationPlanCache,
1691
- rendererBuildLifetime
1796
+ rendererBuildLifetime,
1797
+ routeManager.getProgrammaticClientRoutes()
1692
1798
  ), "buildClientBundle");
1693
1799
  const buildSSRBundle = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => buildSSRInMemory(
1694
1800
  productionVite,
@@ -1740,7 +1846,8 @@ async function buildUniversal(config, routeManager, apiRouteManager, serverRende
1740
1846
  routeSlots,
1741
1847
  isolatedClientBoundaryModules,
1742
1848
  hydrationPlanCache,
1743
- rendererBuildLifetime
1849
+ rendererBuildLifetime,
1850
+ routeManager.getProgrammaticClientRoutes()
1744
1851
  );
1745
1852
  } catch (retryError) {
1746
1853
  if (!(retryError instanceof IncompleteClientBuildOutputError)) throw retryError;
@@ -1801,7 +1908,7 @@ async function buildUniversal(config, routeManager, apiRouteManager, serverRende
1801
1908
  }
1802
1909
  _chunkS3JO3N4Hcjs.__name.call(void 0, buildUniversal, "buildUniversal");
1803
1910
  async function writeSSRAssetsToClient(bundle, outputDir) {
1804
- const fs3 = await import("fs/promises");
1911
+ const fs4 = await import("fs/promises");
1805
1912
  for (const [fileName, output] of Object.entries(bundle)) {
1806
1913
  if (output.type !== "asset") continue;
1807
1914
  if (fileName === "farm-fonts.css") {
@@ -1809,42 +1916,42 @@ async function writeSSRAssetsToClient(bundle, outputDir) {
1809
1916
  continue;
1810
1917
  }
1811
1918
  const filePath = _path2.default.join(outputDir, fileName);
1812
- await fs3.mkdir(_path2.default.dirname(filePath), { recursive: true });
1813
- await fs3.writeFile(filePath, output.source);
1919
+ await fs4.mkdir(_path2.default.dirname(filePath), { recursive: true });
1920
+ await fs4.writeFile(filePath, output.source);
1814
1921
  }
1815
1922
  }
1816
1923
  _chunkS3JO3N4Hcjs.__name.call(void 0, writeSSRAssetsToClient, "writeSSRAssetsToClient");
1817
1924
  async function copyFarmDocsFontAssetsToClient(root, outputDir) {
1818
- const fs3 = await import("fs/promises");
1925
+ const fs4 = await import("fs/promises");
1819
1926
  await Promise.all(
1820
1927
  _chunkHREOKQWTcjs.resolveFarmDocsFontAssets.call(void 0, root).map(async ({ sourcePath, url }) => {
1821
1928
  const targetPath = _path2.default.join(outputDir, url.replace(/^\/+/, ""));
1822
- await fs3.mkdir(_path2.default.dirname(targetPath), { recursive: true });
1823
- await fs3.copyFile(sourcePath, targetPath);
1929
+ await fs4.mkdir(_path2.default.dirname(targetPath), { recursive: true });
1930
+ await fs4.copyFile(sourcePath, targetPath);
1824
1931
  })
1825
1932
  );
1826
1933
  }
1827
1934
  _chunkS3JO3N4Hcjs.__name.call(void 0, copyFarmDocsFontAssetsToClient, "copyFarmDocsFontAssetsToClient");
1828
1935
  async function mergeBuiltFontCss(outputDir, fontCssSource) {
1829
- const fs3 = await import("fs/promises");
1936
+ const fs4 = await import("fs/promises");
1830
1937
  const fontCssPath = _path2.default.join(outputDir, "farm-fonts.css");
1831
1938
  let fontCss = fontCssSource;
1832
1939
  if (fontCss === void 0) {
1833
1940
  try {
1834
- fontCss = await fs3.readFile(fontCssPath);
1835
- } catch (e18) {
1941
+ fontCss = await fs4.readFile(fontCssPath);
1942
+ } catch (e21) {
1836
1943
  return;
1837
1944
  }
1838
1945
  }
1839
1946
  const clientCssPath = _path2.default.join(outputDir, "farm-client.css");
1840
1947
  let clientCss = "";
1841
1948
  try {
1842
- clientCss = await fs3.readFile(clientCssPath, "utf8");
1843
- } catch (e19) {
1949
+ clientCss = await fs4.readFile(clientCssPath, "utf8");
1950
+ } catch (e22) {
1844
1951
  }
1845
1952
  const normalizedFontCss = typeof fontCss === "string" ? fontCss : Buffer.from(fontCss).toString("utf8");
1846
- await fs3.writeFile(fontCssPath, normalizedFontCss);
1847
- await fs3.writeFile(clientCssPath, _chunkAS2VPMEEcjs.mergeFarmFontCss.call(void 0, clientCss, normalizedFontCss));
1953
+ await fs4.writeFile(fontCssPath, normalizedFontCss);
1954
+ await fs4.writeFile(clientCssPath, _chunkEGCT3AHFcjs.mergeFarmFontCss.call(void 0, clientCss, normalizedFontCss));
1848
1955
  }
1849
1956
  _chunkS3JO3N4Hcjs.__name.call(void 0, mergeBuiltFontCss, "mergeBuiltFontCss");
1850
1957
  var _IncompleteClientBuildOutputError = class _IncompleteClientBuildOutputError extends Error {
@@ -1856,14 +1963,14 @@ var _IncompleteClientBuildOutputError = class _IncompleteClientBuildOutputError
1856
1963
  _chunkS3JO3N4Hcjs.__name.call(void 0, _IncompleteClientBuildOutputError, "IncompleteClientBuildOutputError");
1857
1964
  var IncompleteClientBuildOutputError = _IncompleteClientBuildOutputError;
1858
1965
  async function validateClientBuildOutput(root, srcDir, outputDir) {
1859
- const fs3 = await import("fs/promises");
1966
+ const fs4 = await import("fs/promises");
1860
1967
  const fingerprinted = await findFingerprintedClientEntry(outputDir);
1861
1968
  const clientEntryPath = _path2.default.join(outputDir, _nullishCoalesce(fingerprinted, () => ( "farm-client.js")));
1862
1969
  let clientEntrySize = 0;
1863
1970
  try {
1864
- const clientEntry = await fs3.stat(clientEntryPath);
1971
+ const clientEntry = await fs4.stat(clientEntryPath);
1865
1972
  if (clientEntry.isFile()) clientEntrySize = clientEntry.size;
1866
- } catch (e20) {
1973
+ } catch (e23) {
1867
1974
  }
1868
1975
  if (clientEntrySize === 0) {
1869
1976
  throw new IncompleteClientBuildOutputError("farm-client.js is missing or empty");
@@ -1872,12 +1979,12 @@ async function validateClientBuildOutput(root, srcDir, outputDir) {
1872
1979
  const globalsCssPath = _path2.default.join(root, srcDir, "app", "globals.css");
1873
1980
  let expectsCss = false;
1874
1981
  try {
1875
- const globalsCss = await fs3.readFile(globalsCssPath, "utf8");
1982
+ const globalsCss = await fs4.readFile(globalsCssPath, "utf8");
1876
1983
  expectsCss = globalsCss.replace(/\/\*[\s\S]*?\*\//g, "").trim().length > 0;
1877
- } catch (e21) {
1984
+ } catch (e24) {
1878
1985
  }
1879
1986
  try {
1880
- const clientCss = await fs3.stat(clientCssPath);
1987
+ const clientCss = await fs4.stat(clientCssPath);
1881
1988
  if (expectsCss && (!clientCss.isFile() || clientCss.size === 0)) {
1882
1989
  throw new IncompleteClientBuildOutputError("farm-client.css is empty");
1883
1990
  }
@@ -1886,7 +1993,7 @@ async function validateClientBuildOutput(root, srcDir, outputDir) {
1886
1993
  if (expectsCss) {
1887
1994
  throw new IncompleteClientBuildOutputError("farm-client.css is missing");
1888
1995
  }
1889
- await fs3.writeFile(clientCssPath, "");
1996
+ await fs4.writeFile(clientCssPath, "");
1890
1997
  }
1891
1998
  }
1892
1999
  _chunkS3JO3N4Hcjs.__name.call(void 0, validateClientBuildOutput, "validateClientBuildOutput");
@@ -1894,17 +2001,17 @@ function getCachedClientModuleHydrationPlan(modulePath, root, mode, cache, optio
1894
2001
  const key = `${_path2.default.resolve(root)}\0${mode}\0${options.asyncOwnerIslands === true}\0${_path2.default.resolve(modulePath)}`;
1895
2002
  let plan = cache.get(key);
1896
2003
  if (!plan) {
1897
- plan = _chunkAS2VPMEEcjs.getClientModuleHydrationPlan.call(void 0, modulePath, root, mode, options);
2004
+ plan = _chunkEGCT3AHFcjs.getClientModuleHydrationPlan.call(void 0, modulePath, root, mode, options);
1898
2005
  cache.set(key, plan);
1899
2006
  }
1900
2007
  return { ...plan, isolatedBoundaries: [...plan.isolatedBoundaries] };
1901
2008
  }
1902
2009
  _chunkS3JO3N4Hcjs.__name.call(void 0, getCachedClientModuleHydrationPlan, "getCachedClientModuleHydrationPlan");
1903
- async function buildClient(productionVite, config, root, srcDir, outputDir, pageRoutes, layoutRoutes = [], routeSlots = [], isolatedClientBoundaryModules = /* @__PURE__ */ new Set(), hydrationPlanCache = /* @__PURE__ */ new Map(), rendererBuildLifetime) {
2010
+ async function buildClient(productionVite, config, root, srcDir, outputDir, pageRoutes, layoutRoutes = [], routeSlots = [], isolatedClientBoundaryModules = /* @__PURE__ */ new Set(), hydrationPlanCache = /* @__PURE__ */ new Map(), rendererBuildLifetime, programmaticClientRoutes) {
1904
2011
  const viteBuild = productionVite.build;
1905
2012
  const { farmPlugin, farmServerOnlyEntriesPlugin } = await import("./vite.cjs");
1906
- const { PluginManager: PluginManager2 } = await import("./plugin.cjs");
1907
- const fs3 = await import("fs/promises");
2013
+ const { PluginManager: PluginManager2 } = await import("./plugin-DBBZ4JI2.cjs");
2014
+ const fs4 = await import("fs/promises");
1908
2015
  const pluginManager = new PluginManager2({
1909
2016
  config,
1910
2017
  isDev: false,
@@ -1912,7 +2019,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
1912
2019
  });
1913
2020
  pluginManager.addPlugins(config.plugins || []);
1914
2021
  const clientPages = [];
1915
- const integrationProviders = _chunkBWIQR4DHcjs.getIntegrationProviders.call(void 0, config.integrations).filter(
2022
+ const integrationProviders = _chunkRHGK2JENcjs.getIntegrationProviders.call(void 0, config.integrations).filter(
1916
2023
  (provider) => provider.component || provider.type === "clerk"
1917
2024
  );
1918
2025
  const unsupportedIntegrationProvider = integrationProviders.find(
@@ -1923,14 +2030,14 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
1923
2030
  `[Farm.js] isolated hydration kept route-wide because integration provider "${unsupportedIntegrationProvider.name}" does not declare supportsIsolatedHydration: true.`
1924
2031
  );
1925
2032
  }
1926
- const isolatedMode = _chunkAS2VPMEEcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
2033
+ const isolatedMode = _chunkEGCT3AHFcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
1927
2034
  _optionalChain([config, 'access', _39 => _39.experimental, 'optionalAccess', _40 => _40.isolatedClientHydration]),
1928
2035
  {
1929
2036
  serverComponents: _optionalChain([config, 'access', _41 => _41.experimental, 'optionalAccess', _42 => _42.serverComponents]) === true,
1930
2037
  hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
1931
2038
  }
1932
2039
  );
1933
- const planOptions = _chunkAS2VPMEEcjs.getFarmClientHydrationPlanOptions.call(void 0,
2040
+ const planOptions = _chunkEGCT3AHFcjs.getFarmClientHydrationPlanOptions.call(void 0,
1934
2041
  config.renderer,
1935
2042
  Boolean(unsupportedIntegrationProvider)
1936
2043
  );
@@ -1977,7 +2084,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
1977
2084
  };
1978
2085
  }
1979
2086
  });
1980
- const layoutAppliesToRoute = _chunkRVXFINNScjs.routeBoundaryCoversDirectory;
2087
+ const layoutAppliesToRoute = _chunkEW4MEVLEcjs.routeBoundaryCoversDirectory;
1981
2088
  const routeDirectory = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (route) => _nullishCoalesce(route.directory, () => ( route.pattern)), "routeDirectory");
1982
2089
  const adapterOwnsDocsRuntime = Boolean(
1983
2090
  _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, config.renderer) && _optionalChain([config, 'access', _43 => _43.docs, 'optionalAccess', _44 => _44.enabled]) && _optionalChain([config, 'access', _45 => _45.docs, 'access', _46 => _46.adapter, 'optionalAccess', _47 => _47.server]) && config.docs.adapter.react
@@ -1988,7 +2095,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
1988
2095
  ), "isAdapterDocsRoute");
1989
2096
  const syntheticDocsEntry = _optionalChain([config, 'access', _50 => _50.docs, 'optionalAccess', _51 => _51.enabled]) && !adapterOwnsDocsRuntime ? adapterDocsEntry : null;
1990
2097
  const syntheticDocsPatterns = syntheticDocsEntry ? syntheticDocsEntry === "/" ? ["/", "/[...slug]"] : [syntheticDocsEntry, `${syntheticDocsEntry}/[...slug]`] : [];
1991
- const markdownPagePlan = _chunkAS2VPMEEcjs.createMarkdownPageHydrationPlanner.call(void 0,
2098
+ const markdownPagePlan = _chunkEGCT3AHFcjs.createMarkdownPageHydrationPlanner.call(void 0,
1992
2099
  _chunkOHY2ZWUGcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunkOHY2ZWUGcjs.resolveMdxConfig.call(void 0, config.mdx), root),
1993
2100
  root,
1994
2101
  isolatedMode,
@@ -1996,7 +2103,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
1996
2103
  );
1997
2104
  const routePlans = pageRoutes.map((route) => ({
1998
2105
  route,
1999
- metadata: _chunkEKN7NSZOcjs.isFarmMarkdownPageFile.call(void 0, route.modulePath) ? markdownPagePlan() : getCachedClientModuleHydrationPlan(
2106
+ metadata: _chunkSZLNU3GJcjs.isFarmMarkdownPageFile.call(void 0, route.modulePath) ? markdownPagePlan() : getCachedClientModuleHydrationPlan(
2000
2107
  route.modulePath,
2001
2108
  root,
2002
2109
  isolatedMode,
@@ -2004,7 +2111,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2004
2111
  planOptions
2005
2112
  )
2006
2113
  }));
2007
- _chunkAS2VPMEEcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
2114
+ _chunkEGCT3AHFcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
2008
2115
  clientLayouts.map((layout) => ({
2009
2116
  pattern: layout.pattern,
2010
2117
  depth: layout.pattern.split("/").filter(Boolean).length,
@@ -2013,7 +2120,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2013
2120
  [
2014
2121
  ...routePlans.map(({ route, metadata }) => ({
2015
2122
  pattern: routeDirectory(route),
2016
- depth: _chunkRVXFINNScjs.getRouteDirectoryDepth.call(void 0, routeDirectory(route)),
2123
+ depth: _chunkEW4MEVLEcjs.getRouteDirectoryDepth.call(void 0, routeDirectory(route)),
2017
2124
  metadata
2018
2125
  })),
2019
2126
  ...syntheticDocsPatterns.map((pattern) => ({
@@ -2036,7 +2143,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2036
2143
  for (const layout of clientLayouts) {
2037
2144
  const matchesBuiltRoute = pageRoutes.some((route) => layoutAppliesToRoute(layout.pattern, routeDirectory(route))) || Boolean(adapterDocsEntry && layoutAppliesToRoute(layout.pattern, adapterDocsEntry));
2038
2145
  if (matchesBuiltRoute && layout.suppressedAsyncHydration) {
2039
- _chunk5QIKR7RRcjs.logger.warn(`\u26A0\uFE0F ${_chunkAS2VPMEEcjs.describeSuppressedAsyncHydration.call(void 0, layout.pattern, layout.fallbackReason)}`);
2146
+ _chunk5QIKR7RRcjs.logger.warn(`\u26A0\uFE0F ${_chunkEGCT3AHFcjs.describeSuppressedAsyncHydration.call(void 0, layout.pattern, layout.fallbackReason)}`);
2040
2147
  }
2041
2148
  }
2042
2149
  if (isolatedMode === "analyze") {
@@ -2060,7 +2167,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2060
2167
  );
2061
2168
  if (metadata.suppressedAsyncHydration) {
2062
2169
  _chunk5QIKR7RRcjs.logger.warn(
2063
- `\u26A0\uFE0F ${_chunkAS2VPMEEcjs.describeSuppressedAsyncHydration.call(void 0, route.pattern, metadata.fallbackReason)}`
2170
+ `\u26A0\uFE0F ${_chunkEGCT3AHFcjs.describeSuppressedAsyncHydration.call(void 0, route.pattern, metadata.fallbackReason)}`
2064
2171
  );
2065
2172
  }
2066
2173
  if (metadata.shouldHydrate || metadata.hasIsolatedClientBoundaries || applicableClientLayouts.length > 0) {
@@ -2085,7 +2192,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2085
2192
  ...applicableClientLayouts.filter((layout) => layout.hasIsolatedClientBoundaries).flatMap((layout) => layout.isolatedBoundaries)
2086
2193
  ],
2087
2194
  // The server renders a server tree only below a hydrating layout.
2088
- ..._chunkAS2VPMEEcjs.usesFarmServerTree.call(void 0, metadata) && applicableClientLayouts.some((layout) => layout.shouldHydrate) ? { serverTree: true } : {}
2195
+ ..._chunkEGCT3AHFcjs.usesFarmServerTree.call(void 0, metadata) && applicableClientLayouts.some((layout) => layout.shouldHydrate) ? { serverTree: true } : {}
2089
2196
  });
2090
2197
  _chunk5QIKR7RRcjs.logger.info(`\u{1F4F1} Found hydratable route: ${route.pattern} -> ${route.modulePath}`);
2091
2198
  }
@@ -2121,7 +2228,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2121
2228
  }
2122
2229
  const clientRouteSlots = routeSlots.filter((slot) => {
2123
2230
  try {
2124
- return _chunkAS2VPMEEcjs.getClientModuleMetadata.call(void 0, slot.modulePath, root).shouldHydrate;
2231
+ return _chunkEGCT3AHFcjs.getClientModuleMetadata.call(void 0, slot.modulePath, root).shouldHydrate;
2125
2232
  } catch (error) {
2126
2233
  _chunk5QIKR7RRcjs.logger.warn(`\u26A0\uFE0F Could not inspect route slot ${slot.modulePath}: ${error}`);
2127
2234
  return false;
@@ -2131,8 +2238,8 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2131
2238
  `\u{1F4F1} Total hydratable routes detected: ${clientPages.length} pages, ${clientLayouts.filter((layout) => layout.shouldHydrate || layout.hasIsolatedClientBoundaries).length} layouts, and ${clientRouteSlots.length} slots`
2132
2239
  );
2133
2240
  const clientEntryRoot = _path2.default.join(root, ".farm", "tmp");
2134
- await fs3.mkdir(clientEntryRoot, { recursive: true });
2135
- const clientEntryDir = await fs3.mkdtemp(_path2.default.join(clientEntryRoot, "client-entry-"));
2241
+ await fs4.mkdir(clientEntryRoot, { recursive: true });
2242
+ const clientEntryDir = await fs4.mkdtemp(_path2.default.join(clientEntryRoot, "client-entry-"));
2136
2243
  const clientEntryPath = _path2.default.join(clientEntryDir, "farm-client-entry.tsx");
2137
2244
  const clientHydrationCode = generateClientHydrationEntry(
2138
2245
  clientPages,
@@ -2149,12 +2256,12 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2149
2256
  config.renderer,
2150
2257
  config.publicRuntimeConfig,
2151
2258
  config.trailingSlash,
2152
- _chunkBWIQR4DHcjs.getIntegrationProviders.call(void 0, config.integrations),
2259
+ _chunkRHGK2JENcjs.getIntegrationProviders.call(void 0, config.integrations),
2153
2260
  config.basePath,
2154
- _chunkAS2VPMEEcjs.generateClientCachePersistenceCode.call(void 0, _chunkAS2VPMEEcjs.resolveFarmClientCacheAdapterEntry.call(void 0, root, config.cache)),
2261
+ _chunkEGCT3AHFcjs.generateClientCachePersistenceCode.call(void 0, _chunkEGCT3AHFcjs.resolveFarmClientCacheAdapterEntry.call(void 0, root, config.cache)),
2155
2262
  adapterOwnsDocsRuntime ? _chunkCY2ZQ5C6cjs.getFarmDocsAdapterConfigModule.call(void 0, config.docs) : void 0
2156
2263
  );
2157
- await fs3.writeFile(clientEntryPath, clientHydrationCode);
2264
+ await fs4.writeFile(clientEntryPath, clientHydrationCode);
2158
2265
  const hasScopedPostcssConfig = hasProjectPostcssConfig(root);
2159
2266
  let postcssSearchPath;
2160
2267
  let tailwindVitePlugin = void 0;
@@ -2166,9 +2273,9 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2166
2273
  _chunk5QIKR7RRcjs.logger.info("\u{1F4E6} Using project PostCSS/Tailwind configuration");
2167
2274
  } else {
2168
2275
  const postcssConfigPath = _path2.default.join(clientEntryDir, "postcss.config.cjs");
2169
- await fs3.writeFile(postcssConfigPath, "module.exports = { plugins: [] };\n");
2276
+ await fs4.writeFile(postcssConfigPath, "module.exports = { plugins: [] };\n");
2170
2277
  postcssSearchPath = clientEntryDir;
2171
- tailwindVitePlugin = await _chunkAS2VPMEEcjs.loadTailwindVitePlugin.call(void 0, {
2278
+ tailwindVitePlugin = await _chunkEGCT3AHFcjs.loadTailwindVitePlugin.call(void 0, {
2172
2279
  builder: productionVite.builder,
2173
2280
  announce: true
2174
2281
  });
@@ -2188,6 +2295,8 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2188
2295
  target: FARM_CLIENT_BUILD_TARGET,
2189
2296
  outDir: outputDir,
2190
2297
  emptyOutDir: true,
2298
+ // Never public: see resolveFarmClientSourcemap.
2299
+ sourcemap: resolveFarmClientSourcemap(_optionalChain([config, 'access', _57 => _57.vite, 'optionalAccess', _58 => _58.build, 'optionalAccess', _59 => _59.sourcemap])),
2191
2300
  assetsInlineLimit: 0,
2192
2301
  cssCodeSplit: false,
2193
2302
  // Bundle all CSS into one file
@@ -2201,7 +2310,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2201
2310
  hashCharacters: "hex",
2202
2311
  // Use predictable name for CSS so we can reference it in SSR HTML
2203
2312
  assetFileNames: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (assetInfo) => {
2204
- if (_optionalChain([assetInfo, 'access', _57 => _57.name, 'optionalAccess', _58 => _58.endsWith, 'call', _59 => _59(".css")])) {
2313
+ if (_optionalChain([assetInfo, 'access', _60 => _60.name, 'optionalAccess', _61 => _61.endsWith, 'call', _62 => _62(".css")])) {
2205
2314
  return "farm-client.css";
2206
2315
  }
2207
2316
  return "assets/[name]-h[hash][extname]";
@@ -2237,7 +2346,10 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2237
2346
  }
2238
2347
  },
2239
2348
  plugins: [
2240
- _chunkAS2VPMEEcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
2349
+ _chunkEGCT3AHFcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
2350
+ createFarmPrivateClientSourcemapsPlugin({
2351
+ outDir: _path2.default.join(_path2.default.dirname(outputDir), FARM_CLIENT_SOURCEMAPS_DIR)
2352
+ }),
2241
2353
  createFarmClientModulePreloadPlugin({
2242
2354
  root,
2243
2355
  buildDir: _path2.default.dirname(outputDir),
@@ -2259,7 +2371,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2259
2371
  ...rendererVitePlugins,
2260
2372
  ...config.vite.plugins || [],
2261
2373
  farmServerOnlyEntriesPlugin(),
2262
- _chunkAS2VPMEEcjs.farmDocsClientConfigPlugin.call(void 0,
2374
+ _chunkEGCT3AHFcjs.farmDocsClientConfigPlugin.call(void 0,
2263
2375
  adapterOwnsDocsRuntime ? _chunkCY2ZQ5C6cjs.getFarmDocsAdapterConfigModule.call(void 0, config.docs) : void 0
2264
2376
  ),
2265
2377
  // Plugin to redirect @farm.js/core imports to client-only exports
@@ -2309,8 +2421,11 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2309
2421
  return null;
2310
2422
  }
2311
2423
  },
2312
- farmPlugin({ ...config, isolatedClientBoundaryModules }, pluginManager),
2313
- _chunk3SDFA7UFcjs.farmEnvironmentFunctionsPlugin.call(void 0, )
2424
+ farmPlugin(
2425
+ { ...config, isolatedClientBoundaryModules, programmaticClientRoutes },
2426
+ pluginManager
2427
+ ),
2428
+ _chunkVDRM36QBcjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
2314
2429
  ],
2315
2430
  mode: "production",
2316
2431
  css: postcssSearchPath ? {
@@ -2318,7 +2433,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2318
2433
  } : void 0,
2319
2434
  // Ensure React is bundled for client
2320
2435
  resolve: {
2321
- alias: _chunkAS2VPMEEcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
2436
+ alias: _chunkEGCT3AHFcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
2322
2437
  dedupe: [...config.renderer.dedupe || []]
2323
2438
  },
2324
2439
  // Optimize dependencies - exclude server-side code from client bundle
@@ -2331,13 +2446,13 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2331
2446
  ]
2332
2447
  }
2333
2448
  };
2334
- await viteBuild(_chunkAS2VPMEEcjs.mergeFarmProductionViteConfig.call(void 0, clientViteConfig, config.vite));
2449
+ await viteBuild(_chunkEGCT3AHFcjs.mergeFarmProductionViteConfig.call(void 0, clientViteConfig, config.vite));
2335
2450
  await mergeBuiltFontCss(outputDir);
2336
2451
  await validateClientBuildOutput(root, srcDir, outputDir);
2337
2452
  } finally {
2338
2453
  try {
2339
- await fs3.rm(clientEntryDir, { recursive: true, force: true });
2340
- } catch (e22) {
2454
+ await fs4.rm(clientEntryDir, { recursive: true, force: true });
2455
+ } catch (e25) {
2341
2456
  }
2342
2457
  }
2343
2458
  }
@@ -3090,7 +3205,7 @@ function generateClientHydrationEntry(clientPages, layoutRoutes, clientRouteSlot
3090
3205
  direction: {}
3091
3206
  }, plugins = [], renderer = _chunkPSV6XKPOcjs.REACT_RENDERER, publicRuntimeConfig = void 0, trailingSlash = false, integrationProviders = [], basePath = "/", clientCachePersistence = { imports: "", init: "" }, docsConfigModule) {
3092
3207
  const toImportPath = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (targetPath) => targetPath.replace(/\\/g, "/"), "toImportPath");
3093
- const clientPluginEntry = _chunkAS2VPMEEcjs.generateFarmClientPluginEntryCode.call(void 0,
3208
+ const clientPluginEntry = _chunkEGCT3AHFcjs.generateFarmClientPluginEntryCode.call(void 0,
3094
3209
  plugins,
3095
3210
  root,
3096
3211
  srcDir,
@@ -3101,7 +3216,7 @@ function generateClientHydrationEntry(clientPages, layoutRoutes, clientRouteSlot
3101
3216
  import { createRoot, hydrateRoot } from "react-dom/client";` : appSetupPath ? `import React, { createRoot, hydrateRoot, configureApp as __farmConfigureApp } from ${JSON.stringify(renderer.client)};
3102
3217
  import __farmAppSetup from ${JSON.stringify(_chunk5QIKR7RRcjs.toPosixPath.call(void 0, appSetupPath))};
3103
3218
  __farmConfigureApp(__farmAppSetup);` : `import React, { createRoot, hydrateRoot } from ${JSON.stringify(renderer.client)};`;
3104
- const providerClientCode = _chunkAS2VPMEEcjs.generateFarmIntegrationProviderClientCode.call(void 0,
3219
+ const providerClientCode = _chunkEGCT3AHFcjs.generateFarmIntegrationProviderClientCode.call(void 0,
3105
3220
  integrationProviders,
3106
3221
  root,
3107
3222
  _nullishCoalesce(renderer.componentExtensions, () => ( []))
@@ -3113,12 +3228,12 @@ __farmConfigureApp(__farmAppSetup);` : `import React, { createRoot, hydrateRoot
3113
3228
  const hydratingLayoutPatterns = layoutRoutes.filter((layout) => layout.shouldHydrate).map((layout) => layout.pattern);
3114
3229
  layoutRoutes.forEach((layout, index) => {
3115
3230
  const relativePath = toImportPath(layout.modulePath);
3116
- const rendersOnClient = !layout.hasIsolatedClientBoundaries && hydratingLayoutPatterns.some((pattern) => _chunk5ULKUBIAcjs.layoutsCanCoverSamePage.call(void 0, layout.pattern, pattern));
3231
+ const rendersOnClient = !layout.hasIsolatedClientBoundaries && hydratingLayoutPatterns.some((pattern) => _chunkPGW7HZE2cjs.layoutsCanCoverSamePage.call(void 0, layout.pattern, pattern));
3117
3232
  if (rendersOnClient) {
3118
3233
  layoutImportStatements.push(`import Layout${index} from "${relativePath}";`);
3119
3234
  }
3120
- const groupScope = _chunkRVXFINNScjs.getRouteGroupScope.call(void 0, layout.pattern);
3121
- const groupFields = groupScope ? `, urlPattern: ${JSON.stringify(_chunkRVXFINNScjs.stripRouteGroups.call(void 0, layout.pattern))}, groupScope: ${JSON.stringify(groupScope)}` : "";
3235
+ const groupScope = _chunkEW4MEVLEcjs.getRouteGroupScope.call(void 0, layout.pattern);
3236
+ const groupFields = groupScope ? `, urlPattern: ${JSON.stringify(_chunkEW4MEVLEcjs.stripRouteGroups.call(void 0, layout.pattern))}, groupScope: ${JSON.stringify(groupScope)}` : "";
3122
3237
  layoutRegistrations.push(
3123
3238
  ` { pattern: ${JSON.stringify(layout.pattern)}${groupFields}, Component: ${rendersOnClient ? `Layout${index}` : "null"}, shouldHydrate: ${JSON.stringify(layout.shouldHydrate)}, islandStrategy: ${JSON.stringify(layout.islandStrategy)} }`
3124
3239
  );
@@ -3621,7 +3736,7 @@ function hasHydratableLayout(pathname) {
3621
3736
  });
3622
3737
  }
3623
3738
 
3624
- ${_chunkAS2VPMEEcjs.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE}
3739
+ ${_chunkEGCT3AHFcjs.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE}
3625
3740
  // Wrap a page element with applicable layouts
3626
3741
  function wrapWithLayouts(pageElement, pathname, params) {
3627
3742
  const layouts = getApplicableLayouts(pathname);
@@ -4579,8 +4694,8 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, generateClientHydrationEntry, "generateCli
4579
4694
  async function buildSSRInMemory(productionVite, config, root, routeManager, apiRouteManager, serverRenderer, preset, collectedPageRoutes, collectedLayoutRoutes, collectedRouteSlots, isolatedClientBoundaryModules, hydrationPlanCache, rendererBuildLifetime) {
4580
4695
  const viteBuild = productionVite.build;
4581
4696
  const { farmPlugin, farmServerOnlyEntriesPlugin } = await import("./vite.cjs");
4582
- const { PluginManager: PluginManager2 } = await import("./plugin.cjs");
4583
- const fs3 = await import("fs/promises");
4697
+ const { PluginManager: PluginManager2 } = await import("./plugin-DBBZ4JI2.cjs");
4698
+ const fs4 = await import("fs/promises");
4584
4699
  const pluginManager = new PluginManager2({
4585
4700
  config,
4586
4701
  isDev: false,
@@ -4595,12 +4710,12 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4595
4710
  buildLifetime: rendererBuildLifetime
4596
4711
  });
4597
4712
  if (!hasScopedPostcssConfig) {
4598
- postcssConfigDir = await fs3.mkdtemp(_path2.default.join(_os2.default.tmpdir(), "farm-postcss-"));
4599
- await fs3.writeFile(
4713
+ postcssConfigDir = await fs4.mkdtemp(_path2.default.join(_os2.default.tmpdir(), "farm-postcss-"));
4714
+ await fs4.writeFile(
4600
4715
  _path2.default.join(postcssConfigDir, "postcss.config.cjs"),
4601
4716
  "module.exports = { plugins: [] };\n"
4602
4717
  );
4603
- tailwindVitePlugin = await _chunkAS2VPMEEcjs.loadTailwindVitePlugin.call(void 0, {
4718
+ tailwindVitePlugin = await _chunkEGCT3AHFcjs.loadTailwindVitePlugin.call(void 0, {
4604
4719
  builder: productionVite.builder,
4605
4720
  label: "for SSR"
4606
4721
  });
@@ -4622,7 +4737,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4622
4737
  fileName: entry.fileName,
4623
4738
  sourceType: "static",
4624
4739
  staticInfo: entry.staticInfo,
4625
- data: (await fs3.readFile(entry.modulePath)).toString("base64")
4740
+ data: (await fs4.readFile(entry.modulePath)).toString("base64")
4626
4741
  });
4627
4742
  continue;
4628
4743
  }
@@ -4696,7 +4811,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4696
4811
  }
4697
4812
  const middlewareRoutes = await discoverMiddlewareRoutes(appDirs);
4698
4813
  const instrumentationPath = _chunkKCMTCM6Icjs.resolveFarmInstrumentationFile.call(void 0, root, config.srcDir || "src");
4699
- const notFoundPath = _chunkAS2VPMEEcjs.resolveFarmNotFoundComponentPath.call(void 0, config, appDirs);
4814
+ const notFoundPath = _chunkEGCT3AHFcjs.resolveFarmNotFoundComponentPath.call(void 0, config, appDirs);
4700
4815
  if (notFoundPath) _chunk5QIKR7RRcjs.logger.info(`\u{1F4CB} Found custom 404 page: ${notFoundPath}`);
4701
4816
  layoutRoutes.sort((a, b) => {
4702
4817
  const depthA = a.pattern.split("/").filter(Boolean).length;
@@ -4713,34 +4828,34 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4713
4828
  const hasServerRuntimeIntegrations = configuredIntegrationValues.some(
4714
4829
  (integration) => typeof integration === "object" && integration !== null && (!("serverRuntime" in integration) || integration.serverRuntime !== false)
4715
4830
  );
4716
- const hasIntegrationProviders = _chunkBWIQR4DHcjs.getIntegrationProviders.call(void 0, config.integrations).some(
4831
+ const hasIntegrationProviders = _chunkRHGK2JENcjs.getIntegrationProviders.call(void 0, config.integrations).some(
4717
4832
  (provider) => provider.component || provider.type === "clerk"
4718
4833
  );
4719
4834
  const hasObservabilityHandler = !!config.observability && typeof config.observability === "object" && "onEvent" in config.observability;
4720
- const hasMdxComponentConfig = Boolean(_optionalChain([config, 'access', _60 => _60.mdx, 'optionalAccess', _61 => _61.components]));
4721
- const hasMiddlewareConfig = _chunkRVXFINNScjs.hasFarmMiddlewareConfig.call(void 0, config.middleware);
4722
- const hasRouteContextConfig = _chunkHRETEZ2Zcjs.hasCustomFarmRouteContext.call(void 0, config);
4835
+ const hasMdxComponentConfig = Boolean(_optionalChain([config, 'access', _63 => _63.mdx, 'optionalAccess', _64 => _64.components]));
4836
+ const hasMiddlewareConfig = _chunkEW4MEVLEcjs.hasFarmMiddlewareConfig.call(void 0, config.middleware);
4837
+ const hasRouteContextConfig = _chunkFLZ4H25Acjs.hasCustomFarmRouteContext.call(void 0, config);
4723
4838
  const hasServerRuntimePlugins = hasFarmServerRuntimePlugins(config);
4724
4839
  const hasPluginRoutes = hasFarmPluginRoutes(config);
4725
4840
  const hasServerCacheConfig = hasFarmServerCacheConfig(config.cache);
4726
- const configModulePath = hasServerRuntimeIntegrations || hasObservabilityHandler || hasMdxComponentConfig || hasMiddlewareConfig || hasRouteContextConfig || hasServerRuntimePlugins || hasPluginRoutes || hasServerCacheConfig || hasIntegrationProviders ? await findFarmConfigPath(root) : null;
4841
+ const configModulePath = hasServerRuntimeIntegrations || hasObservabilityHandler || hasMdxComponentConfig || hasMiddlewareConfig || hasRouteContextConfig || hasServerRuntimePlugins || hasPluginRoutes || hasServerCacheConfig || hasFarmServerStorageConfig(config.storage) || hasIntegrationProviders ? await findFarmConfigPath(root) : null;
4727
4842
  const hasRuntimeConfigModule = hasFarmRuntimeConfigModule(config, configModulePath);
4728
4843
  const hasRuntimeIntegrationConfig = hasRuntimeConfigModule && hasAnyConfiguredIntegrations;
4729
4844
  const hasConfiguredRuntimePlugins = Boolean(
4730
4845
  hasRuntimeConfigModule && (config.plugins || []).length > 0
4731
4846
  );
4732
- if (_chunkCIOT4HGTcjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)) {
4847
+ if (_chunkTAKG7ZCDcjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)) {
4733
4848
  const adapterGuardedPaths = new Set(getFarmDocsGuardedPaths(config, middlewareRoutes));
4734
- _chunkCIOT4HGTcjs.assertFarmDocsAdapterServesNoGuardedPages.call(void 0,
4849
+ _chunkTAKG7ZCDcjs.assertFarmDocsAdapterServesNoGuardedPages.call(void 0,
4735
4850
  config.docs,
4736
4851
  { root, srcDir: config.srcDir },
4737
4852
  (pathname) => adapterGuardedPaths.has(pathname)
4738
4853
  );
4739
4854
  }
4740
- const farmDocsCspNonceMarker = _chunk2ZYGC6SScjs.createFarmCspNonce.call(void 0, config.security);
4741
- const farmDocsPrecompiledManifest = _optionalChain([config, 'access', _62 => _62.docs, 'optionalAccess', _63 => _63.enabled]) && _chunkC5GUTBZKcjs.getFarmPresetRuntime.call(void 0, preset) === "edge" ? await _chunk6XWDE2P2cjs._runWithFarmCspNonce.call(void 0,
4855
+ const farmDocsCspNonceMarker = _chunkB6IMBBOScjs.createFarmCspNonce.call(void 0, config.security);
4856
+ const farmDocsPrecompiledManifest = _optionalChain([config, 'access', _65 => _65.docs, 'optionalAccess', _66 => _66.enabled]) && _chunkC5GUTBZKcjs.getFarmPresetRuntime.call(void 0, preset) === "edge" ? await _chunkXVIEGKTTcjs._runWithFarmCspNonce.call(void 0,
4742
4857
  farmDocsCspNonceMarker,
4743
- async () => _optionalChain([config, 'access', _64 => _64.docs, 'access', _65 => _65.adapter, 'optionalAccess', _66 => _66.server]) ? await _chunkCIOT4HGTcjs.compileFarmDocsAdapterEdgeManifest.call(void 0, config.docs, {
4858
+ async () => _optionalChain([config, 'access', _67 => _67.docs, 'access', _68 => _68.adapter, 'optionalAccess', _69 => _69.server]) ? await _chunkTAKG7ZCDcjs.compileFarmDocsAdapterEdgeManifest.call(void 0, config.docs, {
4744
4859
  root,
4745
4860
  srcDir: config.srcDir,
4746
4861
  clientEntry: FARM_CLIENT_JS_SRC_PLACEHOLDER,
@@ -4791,6 +4906,10 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4791
4906
  );
4792
4907
  const virtualEntryId = "\0virtual:farm-ssr-entry";
4793
4908
  const useExternalMetadataImageRuntime = shouldUseExternalMetadataImageRuntime(preset, true);
4909
+ const omitCoreMetadataImageRuntime = !metadataImageRoutes.some(
4910
+ (image) => image.sourceType === "module"
4911
+ );
4912
+ const externalMetadataImageRuntime = useExternalMetadataImageRuntime && !omitCoreMetadataImageRuntime ? ["@vercel/og"] : [];
4794
4913
  const rendererOptionalExternals = _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, config.renderer) ? [] : [
4795
4914
  "react",
4796
4915
  "react/jsx-runtime",
@@ -4824,7 +4943,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4824
4943
  // startup; kept external, Nitro copies the package into the output.
4825
4944
  "better-sqlite3",
4826
4945
  ...rendererOptionalExternals,
4827
- ...useExternalMetadataImageRuntime ? ["@vercel/og"] : [],
4946
+ ...externalMetadataImageRuntime,
4828
4947
  "@prisma/client",
4829
4948
  "@prisma/client/default",
4830
4949
  "@prisma/client/default.js",
@@ -4845,7 +4964,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4845
4964
  // Adapters can render provider scripts by serializing function source.
4846
4965
  // keepNames injects helper calls into those functions; after Nitro
4847
4966
  // minifies the server chunk the helper is no longer in script scope.
4848
- keepNames: !(_optionalChain([config, 'access', _67 => _67.docs, 'optionalAccess', _68 => _68.enabled]) && _optionalChain([config, 'access', _69 => _69.docs, 'access', _70 => _70.adapter, 'optionalAccess', _71 => _71.server])),
4967
+ keepNames: !(_optionalChain([config, 'access', _70 => _70.docs, 'optionalAccess', _71 => _71.enabled]) && _optionalChain([config, 'access', _72 => _72.docs, 'access', _73 => _73.adapter, 'optionalAccess', _74 => _74.server])),
4849
4968
  jsxDev: false
4850
4969
  },
4851
4970
  // SSR configuration to externalize problematic modules
@@ -4856,7 +4975,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4856
4975
  "fsevents",
4857
4976
  "sharp",
4858
4977
  ...rendererOptionalExternals,
4859
- ...useExternalMetadataImageRuntime ? ["@vercel/og"] : [],
4978
+ ...externalMetadataImageRuntime,
4860
4979
  "esbuild",
4861
4980
  "lightningcss",
4862
4981
  "rolldown",
@@ -4895,18 +5014,24 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4895
5014
  define: {
4896
5015
  __FARM_API_BASE_URL__: JSON.stringify(config.api.baseURL),
4897
5016
  __FARM_ENV__: JSON.stringify(_chunkVEKFLAQMcjs.createBundledEnv.call(void 0, config.env)),
4898
- __FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _72 => _72.env, 'optionalAccess', _73 => _73.public]) || {})
5017
+ __FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _75 => _75.env, 'optionalAccess', _76 => _76.public]) || {})
4899
5018
  },
4900
5019
  plugins: [
4901
- _chunkAS2VPMEEcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
5020
+ _chunkEGCT3AHFcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
4902
5021
  ...tailwindVitePlugin ? [tailwindVitePlugin] : [],
4903
5022
  ...rendererVitePlugins,
4904
5023
  ...config.vite.plugins || [],
4905
5024
  ...!useExternalMetadataImageRuntime && metadataImageRoutes.some((image) => image.sourceType === "module") ? [createMetadataImageWasmPlugin()] : [],
5025
+ ...omitCoreMetadataImageRuntime ? [
5026
+ {
5027
+ ...createOmittedMetadataImageRuntimePlugin(useExternalMetadataImageRuntime),
5028
+ enforce: "pre"
5029
+ }
5030
+ ] : [],
4906
5031
  { ...createReactProductionModePlugin(), enforce: "pre" },
4907
5032
  farmServerOnlyEntriesPlugin(),
4908
5033
  farmPlugin({ ...config, isolatedClientBoundaryModules }, pluginManager),
4909
- _chunk3SDFA7UFcjs.farmEnvironmentFunctionsPlugin.call(void 0, ),
5034
+ _chunkVDRM36QBcjs.farmEnvironmentFunctionsPlugin.call(void 0, config),
4910
5035
  {
4911
5036
  name: "farm-virtual-ssr-entry",
4912
5037
  resolveId(id) {
@@ -4945,7 +5070,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4945
5070
  resolve: {
4946
5071
  alias: [
4947
5072
  ...shouldAliasReactServerToWebBuild(config.renderer, preset) ? [createFarmReactWebServerAlias(hasReactDomEdgeServerBuild(root))] : [],
4948
- ...Object.entries(_chunkAS2VPMEEcjs.createFarmSourceAlias.call(void 0, root, config.srcDir)).map(
5073
+ ...Object.entries(_chunkEGCT3AHFcjs.createFarmSourceAlias.call(void 0, root, config.srcDir)).map(
4949
5074
  ([find, replacement]) => ({ find, replacement })
4950
5075
  )
4951
5076
  ],
@@ -4953,12 +5078,12 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4953
5078
  dedupe: [...config.renderer.dedupe || []]
4954
5079
  }
4955
5080
  };
4956
- await viteBuild(_chunkAS2VPMEEcjs.mergeFarmProductionViteConfig.call(void 0, serverViteConfig, config.vite));
5081
+ await viteBuild(_chunkEGCT3AHFcjs.mergeFarmProductionViteConfig.call(void 0, serverViteConfig, config.vite));
4957
5082
  } finally {
4958
5083
  if (postcssConfigDir) {
4959
5084
  try {
4960
- await fs3.rm(postcssConfigDir, { recursive: true, force: true });
4961
- } catch (e23) {
5085
+ await fs4.rm(postcssConfigDir, { recursive: true, force: true });
5086
+ } catch (e26) {
4962
5087
  }
4963
5088
  }
4964
5089
  }
@@ -4972,7 +5097,7 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, buildSSRInMemory, "buildSSRInMemory");
4972
5097
  function readFarmAppPackageIdentity(root) {
4973
5098
  try {
4974
5099
  return JSON.parse(_fs.readFileSync.call(void 0, _path2.default.join(root, "package.json"), "utf8"));
4975
- } catch (e24) {
5100
+ } catch (e27) {
4976
5101
  return {};
4977
5102
  }
4978
5103
  }
@@ -4985,15 +5110,15 @@ function readFarmPageLastModified(pageRoutes) {
4985
5110
  lastModified[route.pattern] = _fs.statSync.call(void 0,
4986
5111
  _nullishCoalesce(route.markdownSourcePath, () => ( route.modulePath))
4987
5112
  ).mtime.toISOString();
4988
- } catch (e25) {
5113
+ } catch (e28) {
4989
5114
  }
4990
5115
  }
4991
5116
  return lastModified;
4992
5117
  }
4993
5118
  _chunkS3JO3N4Hcjs.__name.call(void 0, readFarmPageLastModified, "readFarmPageLastModified");
4994
5119
  function getFarmDocsGuardedPaths(config, middlewareRoutes) {
4995
- if (!_optionalChain([config, 'access', _74 => _74.docs, 'optionalAccess', _75 => _75.enabled])) return [];
4996
- const contentDir = _chunkPGZDEPTMcjs.resolveFarmDocsContentDir.call(void 0, config.docs, {
5120
+ if (!_optionalChain([config, 'access', _77 => _77.docs, 'optionalAccess', _78 => _78.enabled])) return [];
5121
+ const contentDir = _chunk5XS5NCVMcjs.resolveFarmDocsContentDir.call(void 0, config.docs, {
4997
5122
  root: config.root,
4998
5123
  srcDir: config.srcDir
4999
5124
  });
@@ -5001,19 +5126,19 @@ function getFarmDocsGuardedPaths(config, middlewareRoutes) {
5001
5126
  config: { middleware: config.middleware, integrations: config.integrations },
5002
5127
  middlewareRoutes
5003
5128
  };
5004
- return _chunkPGZDEPTMcjs.discoverFarmDocsPages.call(void 0, contentDir, config.docs).flatMap((page) => [page.href, _chunkPGZDEPTMcjs.getFarmDocsMarkdownPath.call(void 0, page.href)]).filter((pathname) => _chunkRVXFINNScjs.farmPathGuardCoversPage.call(void 0, guards, pathname));
5129
+ return _chunk5XS5NCVMcjs.discoverFarmDocsPages.call(void 0, contentDir, config.docs).flatMap((page) => [page.href, _chunk5XS5NCVMcjs.getFarmDocsMarkdownPath.call(void 0, page.href)]).filter((pathname) => _chunkEW4MEVLEcjs.farmPathGuardCoversPage.call(void 0, guards, pathname));
5005
5130
  }
5006
5131
  _chunkS3JO3N4Hcjs.__name.call(void 0, getFarmDocsGuardedPaths, "getFarmDocsGuardedPaths");
5007
5132
  function getFarmAppOwnedDocsEnginePaths(agent, applicationMetadataRoutes) {
5008
- const llmsTxt = _optionalChain([agent, 'optionalAccess', _76 => _76.llmsTxt]);
5133
+ const llmsTxt = _optionalChain([agent, 'optionalAccess', _79 => _79.llmsTxt]);
5009
5134
  const ownedByFile = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (kind) => applicationMetadataRoutes.some(
5010
5135
  (metadata) => metadata.kind === kind && metadata.pattern === "/"
5011
5136
  ), "ownedByFile");
5012
5137
  return [
5013
- ..._optionalChain([llmsTxt, 'optionalAccess', _77 => _77.enabled]) || ownedByFile("llms") ? ["/llms.txt"] : [],
5014
- ..._optionalChain([llmsTxt, 'optionalAccess', _78 => _78.enabled]) && llmsTxt.full || ownedByFile("llms-full") ? ["/llms-full.txt"] : [],
5015
- ..._optionalChain([agent, 'optionalAccess', _79 => _79.sitemap, 'optionalAccess', _80 => _80.enabled]) || ownedByFile("sitemap") ? ["/sitemap.xml"] : [],
5016
- ..._optionalChain([agent, 'optionalAccess', _81 => _81.crawlers, 'optionalAccess', _82 => _82.enabled]) || ownedByFile("robots") ? ["/robots.txt"] : []
5138
+ ..._optionalChain([llmsTxt, 'optionalAccess', _80 => _80.enabled]) || ownedByFile("llms") ? ["/llms.txt"] : [],
5139
+ ..._optionalChain([llmsTxt, 'optionalAccess', _81 => _81.enabled]) && llmsTxt.full || ownedByFile("llms-full") ? ["/llms-full.txt"] : [],
5140
+ ..._optionalChain([agent, 'optionalAccess', _82 => _82.sitemap, 'optionalAccess', _83 => _83.enabled]) || ownedByFile("sitemap") ? ["/sitemap.xml"] : [],
5141
+ ..._optionalChain([agent, 'optionalAccess', _84 => _84.crawlers, 'optionalAccess', _85 => _85.enabled]) || ownedByFile("robots") ? ["/robots.txt"] : []
5017
5142
  ];
5018
5143
  }
5019
5144
  _chunkS3JO3N4Hcjs.__name.call(void 0, getFarmAppOwnedDocsEnginePaths, "getFarmAppOwnedDocsEnginePaths");
@@ -5055,7 +5180,7 @@ function toVirtualEntryImportSpecifier(modulePath) {
5055
5180
  }
5056
5181
  _chunkS3JO3N4Hcjs.__name.call(void 0, toVirtualEntryImportSpecifier, "toVirtualEntryImportSpecifier");
5057
5182
  function generateNativeAuthIntegrationSource(auth) {
5058
- if (_optionalChain([auth, 'optionalAccess', _83 => _83.enabled]) !== true) {
5183
+ if (_optionalChain([auth, 'optionalAccess', _86 => _86.enabled]) !== true) {
5059
5184
  return { importSource: "", registerSource: "" };
5060
5185
  }
5061
5186
  return {
@@ -5078,7 +5203,7 @@ function matchLocalIntegrationRequest(request) {
5078
5203
  });` : "return null;"}
5079
5204
  }
5080
5205
 
5081
- async function handleIntegrationRequest(request, ranMiddleware) {
5206
+ async function handleIntegrationRequest(request, ranMiddleware, clientAddress) {
5082
5207
  ${options.hasServerRuntimeIntegrations ? `return dispatchIntegrationRequests(
5083
5208
  serverRuntimeIntegrations,
5084
5209
  {
@@ -5087,7 +5212,7 @@ async function handleIntegrationRequest(request, ranMiddleware) {
5087
5212
  isProd: true,
5088
5213
  },
5089
5214
  request,
5090
- { ranMiddleware },
5215
+ { ranMiddleware, clientAddress },
5091
5216
  );` : `return { response: null, setCookies: [] };`}
5092
5217
  }
5093
5218
 
@@ -5175,10 +5300,10 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, generateConfiguredResponseHeadersRuntimeSo
5175
5300
  function parseRouteRenderingDirectiveFromDisk(modulePath) {
5176
5301
  try {
5177
5302
  const source = _fs.readFileSync.call(void 0, modulePath, "utf8");
5178
- const directive = _chunk5D2JIPLHcjs.parseRouteRenderingDirective.call(void 0, source);
5179
- if (_chunk5D2JIPLHcjs.findRequestBoundSourceBlockers.call(void 0, source).length === 0) return directive;
5303
+ const directive = _chunkKK22JPQMcjs.parseRouteRenderingDirective.call(void 0, source);
5304
+ if (_chunkKK22JPQMcjs.findRequestBoundSourceBlockers.call(void 0, source).length === 0) return directive;
5180
5305
  return { ..._nullishCoalesce(directive, () => ( { ssg: false, ppr: false, directive: "" })), requestBound: true };
5181
- } catch (e26) {
5306
+ } catch (e29) {
5182
5307
  return void 0;
5183
5308
  }
5184
5309
  }
@@ -5365,19 +5490,19 @@ ReactDOMServer.configureApp(__farmAppSetup);`;
5365
5490
  _chunkS3JO3N4Hcjs.__name.call(void 0, generateFarmRendererAppSetupServerCode, "generateFarmRendererAppSetupServerCode");
5366
5491
  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) {
5367
5492
  const hasCompressionRuntime = config.compress && _chunk2SJ4RQ6Pcjs.resolveFarmInstrumentationRuntime.call(void 0, preset) === "nodejs";
5368
- const servesAgentRobotsTxt = Boolean(_optionalChain([config, 'access', _84 => _84.agent, 'optionalAccess', _85 => _85.crawlers, 'optionalAccess', _86 => _86.enabled])) && !applicationMetadataRoutes.some(
5493
+ const servesAgentRobotsTxt = Boolean(_optionalChain([config, 'access', _87 => _87.agent, 'optionalAccess', _88 => _88.crawlers, 'optionalAccess', _89 => _89.enabled])) && !applicationMetadataRoutes.some(
5369
5494
  (metadata) => metadata.kind === "robots" && metadata.pattern === "/"
5370
5495
  );
5371
- const servesAgentSitemap = Boolean(_optionalChain([config, 'access', _87 => _87.agent, 'optionalAccess', _88 => _88.sitemap, 'optionalAccess', _89 => _89.enabled])) && !applicationMetadataRoutes.some(
5496
+ const servesAgentSitemap = Boolean(_optionalChain([config, 'access', _90 => _90.agent, 'optionalAccess', _91 => _91.sitemap, 'optionalAccess', _92 => _92.enabled])) && !applicationMetadataRoutes.some(
5372
5497
  (metadata) => metadata.kind === "sitemap" && metadata.pattern === "/"
5373
5498
  );
5374
- const servesDefaultMCP = _optionalChain([config, 'access', _90 => _90.agent, 'optionalAccess', _91 => _91.mcp]) === true && !_chunkH5CLOUZScjs.farmConfigMountsMCP.call(void 0, config) && !apiRoutes.some((route) => route.path === "/api/mcp");
5375
- const servesAiCatalog = _optionalChain([config, 'access', _92 => _92.agent, 'optionalAccess', _93 => _93.aiCatalog]) !== false;
5499
+ const servesDefaultMCP = _optionalChain([config, 'access', _93 => _93.agent, 'optionalAccess', _94 => _94.mcp]) === true && !_chunkBMOBTMDRcjs.farmConfigMountsMCP.call(void 0, config) && !apiRoutes.some((route) => route.path === "/api/mcp");
5500
+ const servesAiCatalog = _optionalChain([config, 'access', _95 => _95.agent, 'optionalAccess', _96 => _96.aiCatalog]) !== false;
5376
5501
  const hasPluginRuntime = hasRuntimeIntegrationConfig || hasServerRuntimePlugins;
5377
5502
  const hasInfraAnalyticsRuntime = config.analytics !== false && _chunk2SJ4RQ6Pcjs.resolveFarmInstrumentationRuntime.call(void 0, preset) === "nodejs";
5378
5503
  const hasPrecompiledDocs = Boolean(farmDocsPrecompiledManifest);
5379
5504
  const adapterOwnsDocsRuntime = Boolean(
5380
- _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, config.renderer) && _optionalChain([config, 'access', _94 => _94.docs, 'optionalAccess', _95 => _95.enabled]) && _optionalChain([config, 'access', _96 => _96.docs, 'access', _97 => _97.adapter, 'optionalAccess', _98 => _98.server]) && config.docs.adapter.react
5505
+ _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, config.renderer) && _optionalChain([config, 'access', _97 => _97.docs, 'optionalAccess', _98 => _98.enabled]) && _optionalChain([config, 'access', _99 => _99.docs, 'access', _100 => _100.adapter, 'optionalAccess', _101 => _101.server]) && config.docs.adapter.react
5381
5506
  );
5382
5507
  const docsConfigModulePath = adapterOwnsDocsRuntime && !hasPrecompiledDocs && config.docs.configPath && !config.docs.configPath.endsWith(".json") ? config.docs.configPath : void 0;
5383
5508
  const hasIsolatedClientGraphRuntime = _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, config.renderer) && isolatedClientBoundaryModules.size > 0;
@@ -5410,9 +5535,9 @@ function renderFarmRouteServerTree(element) { return element; }`;
5410
5535
  const hasGeneratedMetadataImages = metadataImageRoutes.some(
5411
5536
  (image) => image.sourceType === "module"
5412
5537
  );
5413
- const hasMiddlewareRuntime = middlewareRoutes.length > 0 || _chunkRVXFINNScjs.hasFarmMiddlewareConfig.call(void 0, config.middleware);
5414
- const farmDocsFontAssets = _optionalChain([config, 'access', _99 => _99.docs, 'optionalAccess', _100 => _100.enabled]) ? _chunkHREOKQWTcjs.toFarmDocsPublicFontAssets.call(void 0, _chunkHREOKQWTcjs.resolveFarmDocsFontAssets.call(void 0, config.root)) : [];
5415
- const integrationProviders = _chunkBWIQR4DHcjs.getIntegrationProviders.call(void 0, config.integrations);
5538
+ const hasMiddlewareRuntime = middlewareRoutes.length > 0 || _chunkEW4MEVLEcjs.hasFarmMiddlewareConfig.call(void 0, config.middleware);
5539
+ const farmDocsFontAssets = _optionalChain([config, 'access', _102 => _102.docs, 'optionalAccess', _103 => _103.enabled]) ? _chunkHREOKQWTcjs.toFarmDocsPublicFontAssets.call(void 0, _chunkHREOKQWTcjs.resolveFarmDocsFontAssets.call(void 0, config.root)) : [];
5540
+ const integrationProviders = _chunkRHGK2JENcjs.getIntegrationProviders.call(void 0, config.integrations);
5416
5541
  const renderedIntegrationProviders = integrationProviders.filter(
5417
5542
  (provider) => provider.component || provider.type === "clerk"
5418
5543
  );
@@ -5421,16 +5546,16 @@ function renderFarmRouteServerTree(element) { return element; }`;
5421
5546
  `Integration provider components are not supported by the "${config.renderer.name}" renderer.`
5422
5547
  );
5423
5548
  }
5424
- const providerServerModules = _chunkAS2VPMEEcjs.generateFarmIntegrationProviderServerModules.call(void 0,
5549
+ const providerServerModules = _chunkEGCT3AHFcjs.generateFarmIntegrationProviderServerModules.call(void 0,
5425
5550
  renderedIntegrationProviders,
5426
5551
  config.root,
5427
5552
  _nullishCoalesce(config.renderer.componentExtensions, () => ( []))
5428
5553
  );
5429
5554
  const resolvedIntegrationProviderFallback = Object.fromEntries(
5430
5555
  Object.entries(config.integrations).flatMap(([name, integration]) => {
5431
- const configuredProviders = _optionalChain([integration, 'optionalAccess', _101 => _101.providers]);
5556
+ const configuredProviders = _optionalChain([integration, 'optionalAccess', _104 => _104.providers]);
5432
5557
  const providers = Array.isArray(configuredProviders) ? configuredProviders : [];
5433
- if (providers.some((provider) => typeof _optionalChain([provider, 'optionalAccess', _102 => _102.component]) === "function")) {
5558
+ if (providers.some((provider) => typeof _optionalChain([provider, 'optionalAccess', _105 => _105.component]) === "function")) {
5434
5559
  throw new Error(
5435
5560
  `Integration provider components in production must use an importable component reference, for example component: { module: "@/components/provider" }.`
5436
5561
  );
@@ -5441,14 +5566,14 @@ function renderFarmRouteServerTree(element) { return element; }`;
5441
5566
  const unsupportedIntegrationProvider = renderedIntegrationProviders.find(
5442
5567
  (provider) => provider.supportsIsolatedHydration !== true
5443
5568
  );
5444
- const isolatedHydrationMode = _chunkAS2VPMEEcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
5445
- _optionalChain([config, 'access', _103 => _103.experimental, 'optionalAccess', _104 => _104.isolatedClientHydration]),
5569
+ const isolatedHydrationMode = _chunkEGCT3AHFcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
5570
+ _optionalChain([config, 'access', _106 => _106.experimental, 'optionalAccess', _107 => _107.isolatedClientHydration]),
5446
5571
  {
5447
- serverComponents: _optionalChain([config, 'access', _105 => _105.experimental, 'optionalAccess', _106 => _106.serverComponents]) === true,
5572
+ serverComponents: _optionalChain([config, 'access', _108 => _108.experimental, 'optionalAccess', _109 => _109.serverComponents]) === true,
5448
5573
  hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
5449
5574
  }
5450
5575
  );
5451
- const hydrationPlanOptions = _chunkAS2VPMEEcjs.getFarmClientHydrationPlanOptions.call(void 0,
5576
+ const hydrationPlanOptions = _chunkEGCT3AHFcjs.getFarmClientHydrationPlanOptions.call(void 0,
5452
5577
  config.renderer,
5453
5578
  Boolean(unsupportedIntegrationProvider)
5454
5579
  );
@@ -5462,7 +5587,7 @@ function renderFarmRouteServerTree(element) { return element; }`;
5462
5587
  hydrationPlanOptions
5463
5588
  )
5464
5589
  }));
5465
- const markdownPagePlan = _chunkAS2VPMEEcjs.createMarkdownPageHydrationPlanner.call(void 0,
5590
+ const markdownPagePlan = _chunkEGCT3AHFcjs.createMarkdownPageHydrationPlanner.call(void 0,
5466
5591
  _chunkOHY2ZWUGcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunkOHY2ZWUGcjs.resolveMdxConfig.call(void 0, config.mdx), config.root),
5467
5592
  config.root,
5468
5593
  isolatedHydrationMode,
@@ -5471,7 +5596,7 @@ function renderFarmRouteServerTree(element) { return element; }`;
5471
5596
  const pageHydrationPlans = new Map(
5472
5597
  pageRoutes.map((route) => [
5473
5598
  route.modulePath,
5474
- _chunkEKN7NSZOcjs.isFarmMarkdownPageFile.call(void 0, route.modulePath) ? markdownPagePlan() : getCachedClientModuleHydrationPlan(
5599
+ _chunkSZLNU3GJcjs.isFarmMarkdownPageFile.call(void 0, route.modulePath) ? markdownPagePlan() : getCachedClientModuleHydrationPlan(
5475
5600
  route.modulePath,
5476
5601
  config.root,
5477
5602
  isolatedHydrationMode,
@@ -5480,7 +5605,7 @@ function renderFarmRouteServerTree(element) { return element; }`;
5480
5605
  )
5481
5606
  ])
5482
5607
  );
5483
- _chunkAS2VPMEEcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
5608
+ _chunkEGCT3AHFcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
5484
5609
  layoutHydrationPlans.map((layout) => ({
5485
5610
  pattern: layout.pattern,
5486
5611
  depth: layout.pattern.split("/").filter(Boolean).length,
@@ -5489,10 +5614,10 @@ function renderFarmRouteServerTree(element) { return element; }`;
5489
5614
  pageRoutes.map((route) => ({
5490
5615
  // Compared by directory so a grouped layout applies only inside its group.
5491
5616
  pattern: _nullishCoalesce(route.directory, () => ( route.pattern)),
5492
- depth: _chunkRVXFINNScjs.getRouteDirectoryDepth.call(void 0, _nullishCoalesce(route.directory, () => ( route.pattern))),
5617
+ depth: _chunkEW4MEVLEcjs.getRouteDirectoryDepth.call(void 0, _nullishCoalesce(route.directory, () => ( route.pattern))),
5493
5618
  metadata: pageHydrationPlans.get(route.modulePath)
5494
5619
  })),
5495
- _chunkRVXFINNScjs.routeBoundaryCoversDirectory
5620
+ _chunkEW4MEVLEcjs.routeBoundaryCoversDirectory
5496
5621
  );
5497
5622
  const providerServerImports = [
5498
5623
  providerServerModules.hasClerkProvider ? `import { ClerkProvider as FarmClerkProvider } from "@clerk/react";` : "",
@@ -5509,7 +5634,7 @@ function renderFarmRouteServerTree(element) { return element; }`;
5509
5634
  apiRegistrations.push(`
5510
5635
  {
5511
5636
  path: ${JSON.stringify(route.path)},
5512
- methods: ${JSON.stringify(route.methods.filter((method) => !_optionalChain([route, 'access', _107 => _107.pluginMethods, 'optionalAccess', _108 => _108.includes, 'call', _109 => _109(method)])))},
5637
+ methods: ${JSON.stringify(route.methods.filter((method) => !_optionalChain([route, 'access', _110 => _110.pluginMethods, 'optionalAccess', _111 => _111.includes, 'call', _112 => _112(method)])))},
5513
5638
  endpoints: ${varName},
5514
5639
  }`);
5515
5640
  });
@@ -5522,7 +5647,7 @@ function renderFarmRouteServerTree(element) { return element; }`;
5522
5647
  }).map(({ route }) => route);
5523
5648
  orderedPageRoutes.forEach((route, index) => {
5524
5649
  const varName = `pageRoute${index}`;
5525
- if (_chunkEKN7NSZOcjs.isFarmMarkdownPageFile.call(void 0, route.modulePath)) {
5650
+ if (_chunkSZLNU3GJcjs.isFarmMarkdownPageFile.call(void 0, route.modulePath)) {
5526
5651
  pageRegistrations.push(`
5527
5652
  {
5528
5653
  pattern: ${JSON.stringify(route.pattern)},${route.directory ? `
@@ -5554,7 +5679,7 @@ function renderFarmRouteServerTree(element) { return element; }`;
5554
5679
  module: ${varName},
5555
5680
  shouldHydrate: ${JSON.stringify(clientMetadata.shouldHydrate)},${clientMetadata.shouldHydrate ? `
5556
5681
  clientModule: ${JSON.stringify(_chunk5QIKR7RRcjs.toViteModuleId.call(void 0, route.modulePath, config.root))},` : ""}
5557
- islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${_chunkAS2VPMEEcjs.usesFarmServerTree.call(void 0, clientMetadata) ? "\n serverTree: true," : ""}${renderingDirective ? `
5682
+ islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${_chunkEGCT3AHFcjs.usesFarmServerTree.call(void 0, clientMetadata) ? "\n serverTree: true," : ""}${renderingDirective ? `
5558
5683
  rendering: ${JSON.stringify(renderingDirective)},` : ""}
5559
5684
  ${route.source !== void 0 ? `markdownSource: {
5560
5685
  source: ${JSON.stringify(route.source)},
@@ -5611,12 +5736,12 @@ function renderFarmRouteServerTree(element) { return element; }`;
5611
5736
  errorImports.push(
5612
5737
  `import * as ${varName} from ${toVirtualEntryImportSpecifier(errorRoute.modulePath)};`
5613
5738
  );
5614
- const groupScope = _chunkRVXFINNScjs.getRouteGroupScope.call(void 0, errorRoute.pattern);
5739
+ const groupScope = _chunkEW4MEVLEcjs.getRouteGroupScope.call(void 0, errorRoute.pattern);
5615
5740
  errorRegistrations.push(`
5616
5741
  {
5617
- pattern: ${JSON.stringify(_chunkRVXFINNScjs.stripRouteGroups.call(void 0, errorRoute.pattern))},${groupScope ? `
5742
+ pattern: ${JSON.stringify(_chunkEW4MEVLEcjs.stripRouteGroups.call(void 0, errorRoute.pattern))},${groupScope ? `
5618
5743
  groupScope: ${JSON.stringify(groupScope)},
5619
- directoryDepth: ${_chunkRVXFINNScjs.getRouteDirectoryDepth.call(void 0, errorRoute.pattern)},` : ""}
5744
+ directoryDepth: ${_chunkEW4MEVLEcjs.getRouteDirectoryDepth.call(void 0, errorRoute.pattern)},` : ""}
5620
5745
  module: ${varName},
5621
5746
  }`);
5622
5747
  });
@@ -5722,6 +5847,8 @@ function renderFarmRouteServerTree(element) { return element; }`;
5722
5847
  createFarmProductionLifecycle,
5723
5848
  createFarmNodeRequestAbortSignal,
5724
5849
  createProductionMiddlewareRunner,
5850
+ _withFarmGuardedResponseCache,
5851
+ _farmPluginsKeepResponsesPrivate,
5725
5852
  getTheme as getFarmTheme,
5726
5853
  emitFarmEvent,
5727
5854
  getFarmDataCache,
@@ -5759,7 +5886,7 @@ function renderFarmRouteServerTree(element) { return element; }`;
5759
5886
  stripFarmLocaleFromPathname,
5760
5887
  withFarmRouteContext,
5761
5888
  createLateNotFoundRecovery,
5762
- createLateRedirectRecovery,
5889
+ createLateRedirectRecovery,${hasFarmServerStorageConfig(config.storage) ? "\n _registerFarmStorageModules,\n disposeFarmStorage,\n initFarmStorage," : ""}
5763
5890
  } from "@farm.js/core/internal/production-runtime";`;
5764
5891
  const productionSiteTelemetryImport = config.telemetry ? `import { createFarmProductionSiteReporter } from "@farm.js/core/internal/product-telemetry-runtime";` : "";
5765
5892
  const metadataImageRuntimeImport = hasGeneratedMetadataImages ? `import { createFarmMetadataImageResponse } from "@farm.js/core/internal/metadata-image-runtime";` : "";
@@ -5767,25 +5894,25 @@ function renderFarmRouteServerTree(element) { return element; }`;
5767
5894
  const infraAnalyticsImport = hasInfraAnalyticsRuntime ? `import { ${hasPluginRuntime ? "createFarmInfraAnalyticsPlugin" : "createFarmInfraAnalyticsRecorder"} } from "@farm.js/core/internal/infra-analytics-runtime";` : "";
5768
5895
  const compressionRuntimeImport = hasCompressionRuntime ? `import { compressFarmResponse${hasPluginRuntime ? ", createCompressionPlugin" : ""} } from "@farm.js/core/internal/compression-runtime";` : "";
5769
5896
  const i18nServerImport = config.i18n.enabled ? `import { _runWithFarmI18nRequest, _setDefaultFarmI18nRuntime, createFarmI18nRuntime, getFarmI18nClientSnapshot } from "@farm.js/core/i18n/server";` : "";
5770
- const docsHandlerImport = _optionalChain([config, 'access', _110 => _110.docs, 'optionalAccess', _111 => _111.enabled]) ? hasPrecompiledDocs ? `import { createFarmDocsPrecompiledRuntime } from "@farm.js/core/internal/docs-precompiled-runtime";
5897
+ const docsHandlerImport = _optionalChain([config, 'access', _113 => _113.docs, 'optionalAccess', _114 => _114.enabled]) ? hasPrecompiledDocs ? `import { createFarmDocsPrecompiledRuntime } from "@farm.js/core/internal/docs-precompiled-runtime";
5771
5898
  const isFarmDocsAPIRequest = (requestOrPathname) => {
5772
5899
  const pathname = typeof requestOrPathname === "string"
5773
5900
  ? requestOrPathname
5774
5901
  : new URL(requestOrPathname.url).pathname;
5775
- const apiPath = ${JSON.stringify(_optionalChain([farmDocsPrecompiledManifest, 'optionalAccess', _112 => _112.apiPath]) || "/api/docs")};
5902
+ const apiPath = ${JSON.stringify(_optionalChain([farmDocsPrecompiledManifest, 'optionalAccess', _115 => _115.apiPath]) || "/api/docs")};
5776
5903
  return pathname === apiPath || pathname.startsWith(apiPath + "/");
5777
5904
  };` : adapterOwnsDocsRuntime ? `import { isFarmDocsAPIRequest } from "@farm.js/core/docs";
5778
5905
  import { createFarmDocsRuntimeHandler as createFarmDocsAdapterRuntimeHandler } from ${JSON.stringify(config.docs.adapter.server)};
5779
5906
  import * as FarmDocsAdapterReact from ${JSON.stringify(config.docs.adapter.react)};${docsConfigModulePath ? `
5780
5907
  import * as farmDocsConfigModule from ${toVirtualEntryImportSpecifier(docsConfigModulePath)};` : ""}` : `import { createFarmDocsAPIHandler, createFarmDocsHandler, isFarmDocsAPIRequest } from "@farm.js/core/docs";` : "";
5781
- const docsFontImport = _optionalChain([config, 'access', _113 => _113.docs, 'optionalAccess', _114 => _114.enabled]) && !hasPrecompiledDocs ? `import { resolveFarmLayoutFonts } from "@farm.js/core/font";` : "";
5782
- const docsRuntimeImport = _optionalChain([config, 'access', _115 => _115.docs, 'optionalAccess', _116 => _116.enabled]) && !hasPrecompiledDocs ? `import { existsSync as farmDocsExistsSync } from "node:fs";
5908
+ const docsFontImport = _optionalChain([config, 'access', _116 => _116.docs, 'optionalAccess', _117 => _117.enabled]) && !hasPrecompiledDocs ? `import { resolveFarmLayoutFonts } from "@farm.js/core/font";` : "";
5909
+ const docsRuntimeImport = _optionalChain([config, 'access', _118 => _118.docs, 'optionalAccess', _119 => _119.enabled]) && !hasPrecompiledDocs ? `import { existsSync as farmDocsExistsSync } from "node:fs";
5783
5910
  import { dirname as farmDocsDirname, join as farmDocsJoin } from "node:path";
5784
5911
  import { fileURLToPath as farmDocsFileURLToPath } from "node:url";` : "";
5785
- const markdownHandlerImport = _optionalChain([config, 'access', _117 => _117.md, 'optionalAccess', _118 => _118.enabled]) ? `import { applyMarkdownNegotiationHeaders, createMarkdownMirrorResponse, getFarmMarkdownAlternatePath } from "@farm.js/core/markdown";` : "";
5912
+ const markdownHandlerImport = _optionalChain([config, 'access', _120 => _120.md, 'optionalAccess', _121 => _121.enabled]) ? `import { applyMarkdownNegotiationHeaders, createMarkdownMirrorResponse, getFarmMarkdownAlternatePath } from "@farm.js/core/markdown";` : "";
5786
5913
  const appMarkdownImport = hasMarkdownPages ? `import { FARM_MARKDOWN_ANONYMOUS_CLIENT_ADDRESS, createFarmMarkdownRouteModule, createFarmMarkdownSourceResponse, isFarmMarkdownPublicSourceResponse } from "@farm.js/core/internal/app-markdown-runtime";` : "const createFarmMarkdownSourceResponse = null;\nconst isFarmMarkdownPublicSourceResponse = null;";
5787
5914
  const markdownErrorImport = `import { FARM_MARKDOWN_CONTENT_TYPE, FARM_MARKDOWN_PAGE_CHECK_HEADER, _isFarmMarkdownPageCheck, createFarmMarkdownErrorBody, farmRequestWantsMarkdown } from "@farm.js/core/markdown";`;
5788
- const mdxComponentsPath = typeof _optionalChain([config, 'access', _119 => _119.mdx, 'optionalAccess', _120 => _120.components]) === "string" ? _path2.default.isAbsolute(config.mdx.components) ? config.mdx.components : _path2.default.join(config.root, config.mdx.components) : null;
5915
+ const mdxComponentsPath = typeof _optionalChain([config, 'access', _122 => _122.mdx, 'optionalAccess', _123 => _123.components]) === "string" ? _path2.default.isAbsolute(config.mdx.components) ? config.mdx.components : _path2.default.join(config.root, config.mdx.components) : null;
5789
5916
  const mdxComponentsImport = mdxComponentsPath ? `import * as FarmMdxComponentsModule from ${toVirtualEntryImportSpecifier(mdxComponentsPath)};` : "";
5790
5917
  const layerConfigPaths = (config.layers || []).map((layer) => layer.configFile).filter((configFile) => Boolean(configFile)).filter((configFile) => configFile !== configModulePath);
5791
5918
  const layerConfigImports = layerConfigPaths.map(
@@ -5803,7 +5930,7 @@ import { fileURLToPath as farmDocsFileURLToPath } from "node:url";` : "";
5803
5930
  const integrationRuntimeImport = integrationRuntimeExports.length ? `import { ${integrationRuntimeExports.join(", ")} } from "@farm.js/core/integrations";` : "";
5804
5931
  const instrumentationImport = instrumentationPath ? `import * as FarmInstrumentationModule from ${toVirtualEntryImportSpecifier(instrumentationPath)};` : "";
5805
5932
  const nativeAuth = generateNativeAuthIntegrationSource(config.auth);
5806
- const nativeMCP = _chunk5ULKUBIAcjs.generateNativeMCPPluginSource.call(void 0, config.mcp);
5933
+ const nativeMCP = _chunkPGW7HZE2cjs.generateNativeMCPPluginSource.call(void 0, config.mcp);
5807
5934
  const integrationImports = `
5808
5935
  ${configModulePath ? `import * as FarmUserConfigModule from ${toVirtualEntryImportSpecifier(configModulePath)};` : ""}
5809
5936
  ${layerConfigImports}
@@ -5812,7 +5939,7 @@ ${nativeAuth.importSource}
5812
5939
  ${nativeMCP.importSource}
5813
5940
  `;
5814
5941
  const imageRuntime = resolveImageRuntime(config, preset);
5815
- const imageRuntimeImport = imageRuntime === "none" ? "" : `import { createCloudflareImageTransformer, createFarmImageHandler } from "@farm.js/core/image/server";`;
5942
+ const imageRuntimeImport = imageRuntime === "none" ? "" : `import { _withFarmImageSourceClientAddress, createCloudflareImageTransformer, createFarmImageHandler } from "@farm.js/core/image/server";`;
5816
5943
  const imageNodeRuntimeImport = imageRuntime === "node" ? `import { createNodeImageFetcher, createNodeImageUrlValidator, createSharpImageTransformer } from "@farm.js/core/image/sharp";` : "";
5817
5944
  const apiHandlerCode = apiRoutes.length > 0 ? `
5818
5945
  const matchBuiltAPIRoute = createStaticAPIRouteMatcherAtBasePath(apiRoutes, farmLocalAPIBasePath);
@@ -5990,7 +6117,7 @@ const farmResolvedRuntimeConfig = Object.assign({}, ...farmRuntimeConfigs);
5990
6117
 
5991
6118
  function FarmDefault404Page() {
5992
6119
  return React.createElement(React.Fragment, null,
5993
- React.createElement("style", null, ${JSON.stringify(_chunkAS2VPMEEcjs.DEFAULT_NOT_FOUND_STYLES)}),
6120
+ React.createElement("style", null, ${JSON.stringify(_chunkEGCT3AHFcjs.DEFAULT_NOT_FOUND_STYLES)}),
5994
6121
  React.createElement("main", {
5995
6122
  className: "farm-default-not-found",
5996
6123
  "aria-labelledby": "farm-default-not-found-title",
@@ -6083,7 +6210,7 @@ const serverRuntimeIntegrations = Object.fromEntries(
6083
6210
  );
6084
6211
  const integrationRuntimeConfig = Object.assign({}, ...farmRuntimeConfigs, {
6085
6212
  integrations: configuredIntegrations,
6086
- ${JSON.stringify(_chunkBWIQR4DHcjs.FARM_INTEGRATION_API_BASE_PATH_KEY)}: ${JSON.stringify(_chunkKNBBQHO2cjs.resolveFarmAPIServerBasePath.call(void 0, config.api))},
6213
+ ${JSON.stringify(_chunkRHGK2JENcjs.FARM_INTEGRATION_API_BASE_PATH_KEY)}: ${JSON.stringify(_chunkKNBBQHO2cjs.resolveFarmAPIServerBasePath.call(void 0, config.api))},
6087
6214
  });
6088
6215
  const farmInfraAnalytics = ${hasInfraAnalyticsRuntime ? hasPluginRuntime ? "createFarmInfraAnalyticsPlugin()" : "createFarmInfraAnalyticsRecorder()" : "null"};
6089
6216
  const configuredPlugins = [
@@ -6106,6 +6233,10 @@ const farmPluginRuntime = ${hasPluginRuntime ? `configuredPlugins.length > 0
6106
6233
  return manager;
6107
6234
  })()
6108
6235
  : null` : "null"};
6236
+ // A plugin's runtime.before runs for every request and may be a guard, like middleware.
6237
+ const farmPluginRuntimeKeepsResponsesPrivate = farmPluginRuntime
6238
+ ? _farmPluginsKeepResponsesPrivate(configuredPlugins)
6239
+ : false;
6109
6240
  const hasFarmPluginHTMLTransforms = configuredPlugins.some(
6110
6241
  (plugin) => plugin.render?.html || plugin.afterRender || plugin.transformHTML,
6111
6242
  );
@@ -6119,14 +6250,14 @@ const farmImageHandler = ${imageRuntime === "none" ? "null" : imageRuntime === "
6119
6250
  onError(error) { console.error("[Farm Image]", error); },
6120
6251
  })`};
6121
6252
  const farmMarkdownConfig = ${JSON.stringify(config.md)};
6122
- const farmLlmsTxtConfig = ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access', _121 => _121.agent, 'optionalAccess', _122 => _122.llmsTxt]), () => ( { enabled: false, include: [], exclude: [] })))};
6123
- ${_optionalChain([config, 'access', _123 => _123.agent, 'optionalAccess', _124 => _124.llmsTxt, 'optionalAccess', _125 => _125.enabled]) ? "const farmLlmsFullRenderer = createFarmLlmsFullRenderer({ revalidate: farmLlmsTxtConfig.revalidate });\n" : ""}${servesAgentRobotsTxt ? `const farmAgentCrawlers = ${JSON.stringify(config.agent.crawlers)};` : ""}
6253
+ const farmLlmsTxtConfig = ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access', _124 => _124.agent, 'optionalAccess', _125 => _125.llmsTxt]), () => ( { enabled: false, include: [], exclude: [] })))};
6254
+ ${_optionalChain([config, 'access', _126 => _126.agent, 'optionalAccess', _127 => _127.llmsTxt, 'optionalAccess', _128 => _128.enabled]) ? "const farmLlmsFullRenderer = createFarmLlmsFullRenderer({ revalidate: farmLlmsTxtConfig.revalidate });\n" : ""}${servesAgentRobotsTxt ? `const farmAgentCrawlers = ${JSON.stringify(config.agent.crawlers)};` : ""}
6124
6255
  const farmMdxConfig = ${JSON.stringify({
6125
6256
  ...config.mdx,
6126
- components: typeof _optionalChain([config, 'access', _126 => _126.mdx, 'optionalAccess', _127 => _127.components]) === "string" ? config.mdx.components : void 0
6257
+ components: typeof _optionalChain([config, 'access', _129 => _129.mdx, 'optionalAccess', _130 => _130.components]) === "string" ? config.mdx.components : void 0
6127
6258
  })};
6128
6259
  const configuredFarmMdxComponents = farmUserConfig?.mdx?.components;
6129
- ${_optionalChain([config, 'access', _128 => _128.agent, 'optionalAccess', _129 => _129.noindexPreviews]) ? `// agent.noindexPreviews: the runtime environment decides, falling back to the
6260
+ ${_optionalChain([config, 'access', _131 => _131.agent, 'optionalAccess', _132 => _132.noindexPreviews]) ? `// agent.noindexPreviews: the runtime environment decides, falling back to the
6130
6261
  // environment this was built in, since Netlify exposes its deploy context only
6131
6262
  // to the build.
6132
6263
  const farmNoindexPreview = resolveFarmPreviewDeployment(
@@ -6139,6 +6270,7 @@ const farmObservabilityConfig = farmUserConfig?.observability ?? ${JSON.stringif
6139
6270
  )};
6140
6271
  configureFarmObservability(farmObservabilityConfig);
6141
6272
  configureFarmCache(farmResolvedRuntimeConfig.cache);
6273
+ ${createFarmStorageModuleRegistration(config)}
6142
6274
  const farmI18nConfig = ${JSON.stringify(config.i18n)};
6143
6275
  const farmServerConfig = ${JSON.stringify(config.server)};
6144
6276
  const farmThemeConfig = ${JSON.stringify(config.theme)};
@@ -6157,9 +6289,11 @@ export const farmProductionLifecycle = createFarmProductionLifecycle({
6157
6289
  server: farmServerConfig,
6158
6290
  start: async () => {
6159
6291
  await farmInstrumentationLifecycle.start();
6160
- try {
6292
+ try {${hasFarmServerStorageConfig(config.storage) ? `
6293
+ // The configured drivers and mounts, as the development server applies them.
6294
+ await initFarmStorage(farmResolvedRuntimeConfig.storage);` : ""}
6161
6295
  await farmPluginRuntime?.startRuntime();
6162
- } catch (error) {
6296
+ } catch (error) {${hasFarmServerStorageConfig(config.storage) ? "\n await disposeFarmStorage();" : ""}
6163
6297
  await farmInstrumentationLifecycle.shutdown();
6164
6298
  throw error;
6165
6299
  }
@@ -6167,14 +6301,14 @@ export const farmProductionLifecycle = createFarmProductionLifecycle({
6167
6301
  close: async (reason) => {
6168
6302
  try {
6169
6303
  await farmPluginRuntime?.closeRuntime(reason);${hasInfraAnalyticsRuntime && !hasPluginRuntime ? "\n await farmInfraAnalytics?.close();" : ""}
6170
- } finally {
6304
+ } finally {${hasFarmServerStorageConfig(config.storage) ? "\n await disposeFarmStorage();" : ""}
6171
6305
  await farmInstrumentationLifecycle.shutdown();
6172
6306
  }
6173
6307
  },
6174
6308
  });
6175
6309
  const farmI18nRuntime = ${config.i18n.enabled ? `createFarmI18nRuntime(farmI18nConfig, ${JSON.stringify(i18nCatalogs)})` : "null"};
6176
6310
  ${config.i18n.enabled ? "_setDefaultFarmI18nRuntime(farmI18nRuntime);" : ""}
6177
- const farmDocsBundledContentDir = ${_optionalChain([config, 'access', _130 => _130.docs, 'optionalAccess', _131 => _131.enabled]) && !hasPrecompiledDocs ? `(() => {
6311
+ const farmDocsBundledContentDir = ${_optionalChain([config, 'access', _133 => _133.docs, 'optionalAccess', _134 => _134.enabled]) && !hasPrecompiledDocs ? `(() => {
6178
6312
  try {
6179
6313
  const currentDir = farmDocsDirname(farmDocsFileURLToPath(import.meta.url));
6180
6314
  const candidates = [
@@ -6224,7 +6358,7 @@ const farmDocsModulePreloadPaths = farmDocsModulePreloads
6224
6358
  ),
6225
6359
  }
6226
6360
  : undefined;
6227
- const farmDocsHandler = ${_optionalChain([config, 'access', _132 => _132.docs, 'optionalAccess', _133 => _133.enabled]) ? hasPrecompiledDocs ? "farmDocsPrecompiledRuntime.handleDocsRequest" : adapterOwnsDocsRuntime ? `createFarmDocsAdapterRuntimeHandler({
6361
+ const farmDocsHandler = ${_optionalChain([config, 'access', _135 => _135.docs, 'optionalAccess', _136 => _136.enabled]) ? hasPrecompiledDocs ? "farmDocsPrecompiledRuntime.handleDocsRequest" : adapterOwnsDocsRuntime ? `createFarmDocsAdapterRuntimeHandler({
6228
6362
  ${docsConfigModulePath ? "...(farmDocsConfigModule.default || farmDocsConfigModule),\n ...farmDocsResolvedConfig.configOverrides," : "...farmDocsResolvedConfig.config,"}
6229
6363
  entry: farmDocsResolvedConfig.config?.entry || String(farmDocsResolvedConfig.entry || "/docs").replace(/^\\/+|\\/+$/g, "") || "docs",
6230
6364
  docsPath: farmDocsResolvedConfig.entry,
@@ -6261,11 +6395,11 @@ const farmDocsHandler = ${_optionalChain([config, 'access', _132 => _132.docs, '
6261
6395
  globalStylesheetHref: "/assets/globals.css",
6262
6396
  isPathGuarded: isFarmDocsPathGuarded,
6263
6397
  })` : "null"};
6264
- const farmDocsAPIHandler = ${_optionalChain([config, 'access', _134 => _134.docs, 'optionalAccess', _135 => _135.enabled]) ? hasPrecompiledDocs ? "farmDocsPrecompiledRuntime.handleAPIRequest" : adapterOwnsDocsRuntime ? "null" : `createFarmDocsAPIHandler({ rootDir: farmDocsRuntimeRoot, srcDir: ${JSON.stringify(config.srcDir)}, docs: farmDocsResolvedConfig, isPathGuarded: isFarmDocsPathGuarded })` : "null"};
6398
+ const farmDocsAPIHandler = ${_optionalChain([config, 'access', _137 => _137.docs, 'optionalAccess', _138 => _138.enabled]) ? hasPrecompiledDocs ? "farmDocsPrecompiledRuntime.handleAPIRequest" : adapterOwnsDocsRuntime ? "null" : `createFarmDocsAPIHandler({ rootDir: farmDocsRuntimeRoot, srcDir: ${JSON.stringify(config.srcDir)}, docs: farmDocsResolvedConfig, isPathGuarded: isFarmDocsPathGuarded })` : "null"};
6265
6399
 
6266
6400
  // API routes bundled at build time
6267
6401
  const apiRoutes = ${apiRoutes.length > 0 ? "mergePluginAPIRoutes(" : ""}[${apiRegistrations.join(",")}
6268
- ]${apiRoutes.length > 0 ? `, configuredPlugins, ${JSON.stringify(apiRoutes.map(({ path: path10, methods }) => ({ path: path10, methods })))}, { bodySizeLimit: ${JSON.stringify(config.server.bodySizeLimit)}, dispatch: dispatchFarmPluginAPIRequest })` : ""};
6402
+ ]${apiRoutes.length > 0 ? `, configuredPlugins, ${JSON.stringify(apiRoutes.map(({ path: path11, methods }) => ({ path: path11, methods })))}, { bodySizeLimit: ${JSON.stringify(config.server.bodySizeLimit)}, dispatch: dispatchFarmPluginAPIRequest })` : ""};
6269
6403
  // A plugin calling an app endpoint (an MCP tool, say) goes through the whole
6270
6404
  // pipeline, so the endpoint's middleware and integration guards run for it.
6271
6405
  function dispatchFarmPluginAPIRequest(request) {
@@ -6286,12 +6420,12 @@ function fetchFarmInnerRequest(request, context) {
6286
6420
  }
6287
6421
  const farmLocalAPIBasePath = ${JSON.stringify(_chunkKNBBQHO2cjs.resolveFarmAPIServerBasePath.call(void 0, config.api))};
6288
6422
  const farmOpenAPIReference = ${JSON.stringify(openAPIReference)};
6289
- ${_optionalChain([config, 'access', _136 => _136.agent, 'optionalAccess', _137 => _137.apiCatalog]) ? `const farmApiCatalogInput = ${JSON.stringify(_chunkRVXFINNScjs.resolveFarmApiCatalogInput.call(void 0, config))};
6290
- ` : ""}${_optionalChain([config, 'access', _138 => _138.agent, 'optionalAccess', _139 => _139.manifest]) !== false ? `const farmAppManifestInput = ${JSON.stringify(
6291
- _chunkRVXFINNScjs.resolveFarmAppManifestInput.call(void 0, config, {
6423
+ ${_optionalChain([config, 'access', _139 => _139.agent, 'optionalAccess', _140 => _140.apiCatalog]) ? `const farmApiCatalogInput = ${JSON.stringify(_chunkEW4MEVLEcjs.resolveFarmApiCatalogInput.call(void 0, config))};
6424
+ ` : ""}${_optionalChain([config, 'access', _141 => _141.agent, 'optionalAccess', _142 => _142.manifest]) !== false ? `const farmAppManifestInput = ${JSON.stringify(
6425
+ _chunkEW4MEVLEcjs.resolveFarmAppManifestInput.call(void 0, config, {
6292
6426
  build: config.deploymentId,
6293
- packages: _chunkAS2VPMEEcjs.resolveFarmAppPackages.call(void 0, config.root),
6294
- webmcpTools: config.plugins.some(({ name }) => name === "farm:webmcp") ? _chunkAS2VPMEEcjs.collectFarmWebMCPTools.call(void 0, config.root, config.srcDir) : []
6427
+ packages: _chunkEGCT3AHFcjs.resolveFarmAppPackages.call(void 0, config.root),
6428
+ webmcpTools: config.plugins.some(({ name }) => name === "farm:webmcp") ? _chunkEGCT3AHFcjs.collectFarmWebMCPTools.call(void 0, config.root, config.srcDir) : []
6295
6429
  })
6296
6430
  )};
6297
6431
  ${servesDefaultMCP ? "farmAppManifestInput.defaultMCP = getFarmDefaultMCPServer;\n" : ""}// A guard written for an MCP server's path keeps its tools out of the public view.
@@ -6766,7 +6900,7 @@ function peelFarmDocumentPrefix(markup) {
6766
6900
  let inner = markup.replace(/^\\s+/, "");
6767
6901
  let hoisted = "";
6768
6902
  const wrapper = /^<div\\b[^>]*style=["']display\\s*:\\s*contents["'][^>]*>/i;
6769
- const hoistable = /${_chunkRVXFINNScjs.HOISTED_HEAD_ELEMENT.source}/i;
6903
+ const hoistable = /${_chunkEW4MEVLEcjs.HOISTED_HEAD_ELEMENT.source}/i;
6770
6904
  let match;
6771
6905
  while ((match = wrapper.exec(inner) || hoistable.exec(inner))) {
6772
6906
  if (!/^<div/i.test(match[0])) hoisted += match[0];
@@ -7297,7 +7431,7 @@ function createFarmAgentRobotsResponse(request) {
7297
7431
  // a route guard.
7298
7432
  const farmAgentGuardedPages = new Set(${JSON.stringify(
7299
7433
  pageRoutes.map((route) => route.pattern).filter(
7300
- (pattern) => !pattern.includes("[") && _chunkRVXFINNScjs.farmPathGuardCoversPage.call(void 0,
7434
+ (pattern) => !pattern.includes("[") && _chunkEW4MEVLEcjs.farmPathGuardCoversPage.call(void 0,
7301
7435
  {
7302
7436
  config: { middleware: config.middleware, integrations: config.integrations },
7303
7437
  middlewareRoutes
@@ -7344,12 +7478,12 @@ ${servesDefaultMCP ? `// agent.mcp: the default read-only MCP server at /mcp, as
7344
7478
  // aside for a page route that answers /mcp and for any MCP server published or
7345
7479
  // registered at runtime, such as the docs engine's.
7346
7480
  const farmDefaultMCPServer = ${JSON.stringify(
7347
- _chunkH5CLOUZScjs.createFarmDefaultMCPServer.call(void 0, readFarmAppPackageIdentity(config.root), _chunkQUCXCDE2cjs.FARM_VERSION)
7481
+ _chunkBMOBTMDRcjs.createFarmDefaultMCPServer.call(void 0, readFarmAppPackageIdentity(config.root), _chunkDKU6NXRKcjs.FARM_VERSION)
7348
7482
  )};
7349
7483
  let farmDefaultMCPRouteFree;
7350
7484
  function getFarmDefaultMCPServer() {
7351
7485
  if (farmDefaultMCPRouteFree === undefined) {
7352
- farmDefaultMCPRouteFree = !matchPageRoute(${JSON.stringify(_chunkH5CLOUZScjs.FARM_DEFAULT_MCP_PATH)});
7486
+ farmDefaultMCPRouteFree = !matchPageRoute(${JSON.stringify(_chunkBMOBTMDRcjs.FARM_DEFAULT_MCP_PATH)});
7353
7487
  }
7354
7488
  return farmDefaultMCPRouteFree ? resolveFarmDefaultMCPServer(farmDefaultMCPServer) : undefined;
7355
7489
  }
@@ -7644,7 +7778,7 @@ function hasLocalRequestRoute(request, routePathname) {
7644
7778
  if (${imageRuntime === "none" ? "false" : `pathname === ${JSON.stringify(config.images.path)}`}) {
7645
7779
  return true;
7646
7780
  }
7647
- ${_optionalChain([config, 'access', _140 => _140.docs, 'optionalAccess', _141 => _141.enabled]) ? `const docsPath = normalizeRuntimePath(farmDocsResolvedConfig?.entry || "/docs");
7781
+ ${_optionalChain([config, 'access', _143 => _143.docs, 'optionalAccess', _144 => _144.enabled]) ? `const docsPath = normalizeRuntimePath(farmDocsResolvedConfig?.entry || "/docs");
7648
7782
  if (
7649
7783
  isFarmDocsAPIRequest(pathname) ||
7650
7784
  docsPath === "/" ||
@@ -7670,7 +7804,7 @@ function getFarmPluginRequestOptions(request) {
7670
7804
  route: { ...route, pattern: normalizeRuntimePath(farmOpenAPIReference.route) },
7671
7805
  };
7672
7806
  }
7673
- const isDocsAPIRequest = ${_optionalChain([config, 'access', _142 => _142.docs, 'optionalAccess', _143 => _143.enabled]) ? "isFarmDocsAPIRequest(pathname)" : "false"};
7807
+ const isDocsAPIRequest = ${_optionalChain([config, 'access', _145 => _145.docs, 'optionalAccess', _146 => _146.enabled]) ? "isFarmDocsAPIRequest(pathname)" : "false"};
7674
7808
  const integrationMatch = ${hasServerRuntimeIntegrations ? `matchIntegrationRoute(serverRuntimeIntegrations, {
7675
7809
  pathname,
7676
7810
  method: request.method,
@@ -7767,7 +7901,7 @@ function getApplicableLayouts(pathname, directory) {
7767
7901
  return applicable;
7768
7902
  }
7769
7903
 
7770
- ${_optionalChain([config, 'access', _144 => _144.docs, 'optionalAccess', _145 => _145.enabled]) ? `async function wrapFarmDocsResponseWithLayouts(request, response) {
7904
+ ${_optionalChain([config, 'access', _147 => _147.docs, 'optionalAccess', _148 => _148.enabled]) ? `async function wrapFarmDocsResponseWithLayouts(request, response) {
7771
7905
  if (request.method === "HEAD") return response;
7772
7906
  if (response.headers.get("x-farm-docs-adapter")) return response;
7773
7907
 
@@ -7873,8 +8007,9 @@ ${_optionalChain([config, 'access', _144 => _144.docs, 'optionalAccess', _145 =>
7873
8007
  });
7874
8008
  }` : ""}
7875
8009
 
7876
- const pprShellCache = getFarmDataCache();
7877
- const experimentalPPREnabled = ${JSON.stringify(_optionalChain([config, 'access', _146 => _146.experimental, 'optionalAccess', _147 => _147.ppr]) === true)};
8010
+ // Shells keep their own LRU so query-string variants never evict app cache entries.
8011
+ const pprShellCache = getFarmDataCache().pprShellCache;
8012
+ const experimentalPPREnabled = ${JSON.stringify(_optionalChain([config, 'access', _149 => _149.experimental, 'optionalAccess', _150 => _150.ppr]) === true)};
7878
8013
 
7879
8014
  function resolveRouteRenderingView(route) {
7880
8015
  // The same merge development uses: baked directive config under the
@@ -8006,7 +8141,7 @@ async function handleFarmRequest(request, adapterContext) {
8006
8141
  },
8007
8142
  { redirect: !isFarmLocalAPIPathname(requestUrl.pathname) }
8008
8143
  )` : "handleFarmRequestInContext(request, null, false, Date.now(), adapterContext, requestUrl)"};
8009
- ${_optionalChain([config, 'access', _148 => _148.md, 'optionalAccess', _149 => _149.enabled]) ? `const pathname = getFarmRoutePathname(requestUrl.pathname);
8144
+ ${_optionalChain([config, 'access', _151 => _151.md, 'optionalAccess', _152 => _152.enabled]) ? `const pathname = getFarmRoutePathname(requestUrl.pathname);
8010
8145
  if (matchPageRoute(pathname)) {
8011
8146
  // The Link header advertises the public .md URL, like the head alternate.
8012
8147
  return applyMarkdownNegotiationHeaders(response, {
@@ -8017,6 +8152,10 @@ async function handleFarmRequest(request, adapterContext) {
8017
8152
  return response;
8018
8153
  }
8019
8154
 
8155
+ // Middleware that let a request through may have been a guard: an IP allowlist, an API key
8156
+ // header, a VPN header. A CDN keys its copy by URL and never runs the guard on a hit, so
8157
+ // whatever such a request answers stays out of shared caches. Only middleware declaring
8158
+ // cache: "public" (and plugins declaring runtime.cache: "public") leave the policy alone.
8020
8159
  async function handleFarmRequestInContext(
8021
8160
  request,
8022
8161
  farmLocaleResolution,
@@ -8024,6 +8163,31 @@ async function handleFarmRequestInContext(
8024
8163
  requestStartTime = Date.now(),
8025
8164
  adapterContext,
8026
8165
  requestUrl = new URL(request.url),
8166
+ ) {
8167
+ const farmCacheGuard = { guarded: farmPluginRuntimeKeepsResponsesPrivate };
8168
+ const response = await resolveFarmRequestInContext(
8169
+ farmCacheGuard,
8170
+ request,
8171
+ farmLocaleResolution,
8172
+ configuredRewriteApplied,
8173
+ requestStartTime,
8174
+ adapterContext,
8175
+ requestUrl,
8176
+ );
8177
+ if (!farmCacheGuard.guarded) return response;
8178
+ // Tells the Nitro entry, which keeps this policy over a swr rule's public one.
8179
+ adapterContext?.onGuardedResponse?.();
8180
+ return _withFarmGuardedResponseCache(response);
8181
+ }
8182
+
8183
+ async function resolveFarmRequestInContext(
8184
+ farmCacheGuard,
8185
+ request,
8186
+ farmLocaleResolution,
8187
+ configuredRewriteApplied,
8188
+ requestStartTime,
8189
+ adapterContext,
8190
+ requestUrl,
8027
8191
  ) {
8028
8192
  let url = requestUrl;
8029
8193
  let pathname = url.pathname;
@@ -8056,10 +8220,26 @@ async function handleFarmRequestInContext(
8056
8220
  farmLocaleResolution?.locale,
8057
8221
  );
8058
8222
  if (rewriteDestination) {
8059
- const rewrittenRequest = createRewrittenRequest(request, rewriteDestination);
8223
+ let rewrittenRequest = createRewrittenRequest(request, rewriteDestination);
8060
8224
  if (new URL(rewrittenRequest.url).origin !== url.origin) {
8061
8225
  return globalThis.fetch(rewrittenRequest);
8062
8226
  }
8227
+ if (farmPluginRuntime) {
8228
+ // Plugin guards ran on the requested URL. Re-run only runtime.before
8229
+ // so they also see the destination, like middleware does on re-entry.
8230
+ const guarded = await farmPluginRuntime.runRuntimeBeforeForRewrite(
8231
+ request,
8232
+ rewrittenRequest,
8233
+ {
8234
+ ...getFarmPluginRequestOptions(rewrittenRequest),
8235
+ waitUntil: typeof adapterContext?.waitUntil === "function"
8236
+ ? adapterContext.waitUntil.bind(adapterContext)
8237
+ : undefined,
8238
+ },
8239
+ );
8240
+ if (guarded instanceof Response) return guarded;
8241
+ rewrittenRequest = guarded;
8242
+ }
8063
8243
  return _runWithCurrentRequest(rewrittenRequest, () =>
8064
8244
  handleFarmRequestInContext(
8065
8245
  rewrittenRequest,
@@ -8087,6 +8267,7 @@ async function handleFarmRequestInContext(
8087
8267
  const integrationDispatch = await handleIntegrationRequest(
8088
8268
  cloneFarmRequestWithContext(request),
8089
8269
  farmIntegrationRanMiddleware,
8270
+ adapterContext?.clientAddress,
8090
8271
  );
8091
8272
  if (integrationDispatch.response) {
8092
8273
  return integrationDispatch.response;
@@ -8106,6 +8287,7 @@ async function handleFarmRequestInContext(
8106
8287
  if (middlewareResult.response) {
8107
8288
  return middlewareResult.response;
8108
8289
  }
8290
+ if (middlewareResult.guarded) farmCacheGuard.guarded = true;
8109
8291
  request = middlewareResult.request;${hasServerRuntimeIntegrations ? `
8110
8292
  // A ctx.rewrite() target is guarded as a direct request for it is: integration
8111
8293
  // guards (protectedRoutes) and routes see the rewritten URL, as in dev. Guards
@@ -8114,6 +8296,7 @@ async function handleFarmRequestInContext(
8114
8296
  const rewrittenDispatch = await handleIntegrationRequest(
8115
8297
  cloneFarmRequestWithContext(request),
8116
8298
  farmIntegrationRanMiddleware,
8299
+ adapterContext?.clientAddress,
8117
8300
  );
8118
8301
  farmIntegrationSetCookies = [...farmIntegrationSetCookies, ...rewrittenDispatch.setCookies];
8119
8302
  if (rewrittenDispatch.response) {
@@ -8123,6 +8306,9 @@ async function handleFarmRequestInContext(
8123
8306
  );
8124
8307
  }
8125
8308
  }` : ""}
8309
+ ${hasServerRuntimeIntegrations ? `
8310
+ // An integration guard (protectedRoutes) that let the request through.
8311
+ if (farmIntegrationRanMiddleware.size > 0) farmCacheGuard.guarded = true;` : ""}
8126
8312
  const middlewareData = middlewareResult.data;
8127
8313
  const middlewareContext = middlewareResult.context;
8128
8314
  const middlewareHeaders = ${hasServerRuntimeIntegrations ? "withFarmIntegrationSetCookies(middlewareResult.headers, farmIntegrationSetCookies)" : "middlewareResult.headers"};
@@ -8140,6 +8326,9 @@ async function handleFarmRequestInContext(
8140
8326
  const runResolvedRequest = async () => {
8141
8327
  if (middlewareResult.notFound) return renderFarmNotFoundResponse();
8142
8328
  ` : `
8329
+ ${hasServerRuntimeIntegrations ? `
8330
+ // An integration guard (protectedRoutes) that let the request through.
8331
+ if (farmIntegrationRanMiddleware.size > 0) farmCacheGuard.guarded = true;` : ""}
8143
8332
  const middlewareData = undefined;
8144
8333
  const middlewareContext = undefined;
8145
8334
  const middlewareHeaders = ${hasServerRuntimeIntegrations ? "withFarmIntegrationSetCookies(undefined, farmIntegrationSetCookies)" : "undefined"};
@@ -8162,7 +8351,7 @@ async function handleFarmRequestInContext(
8162
8351
  }
8163
8352
  ` : ""}
8164
8353
 
8165
- ${_optionalChain([config, 'access', _150 => _150.docs, 'optionalAccess', _151 => _151.enabled]) ? `
8354
+ ${_optionalChain([config, 'access', _153 => _153.docs, 'optionalAccess', _154 => _154.enabled]) ? `
8166
8355
  // Docs responses are served after app middleware so route guards and
8167
8356
  // middleware headers apply to the docs engine like any other page content.
8168
8357
  // An app's own llms.txt, llms-full.txt, sitemap.xml, and robots.txt take
@@ -8223,7 +8412,7 @@ async function handleFarmRequestInContext(
8223
8412
  }
8224
8413
  ` : ""}
8225
8414
 
8226
- ${_optionalChain([config, 'access', _152 => _152.md, 'optionalAccess', _153 => _153.enabled]) ? `
8415
+ ${_optionalChain([config, 'access', _155 => _155.md, 'optionalAccess', _156 => _156.enabled]) ? `
8227
8416
  if (farmMarkdownConfig?.enabled) {
8228
8417
  const markdownResponse = await createMarkdownMirrorResponse({
8229
8418
  // The mirror helper only reads metadata and creates its own GET request.
@@ -8322,11 +8511,11 @@ async function handleFarmRequestInContext(
8322
8511
  return applyProductionMiddlewareHeaders(applicationMetadataResponse, middlewareHeaders);
8323
8512
  }
8324
8513
  ` : ""}
8325
- ${_optionalChain([config, 'access', _154 => _154.agent, 'optionalAccess', _155 => _155.manifest]) !== false ? `
8514
+ ${_optionalChain([config, 'access', _157 => _157.agent, 'optionalAccess', _158 => _158.manifest]) !== false ? `
8326
8515
  // agent.manifest: /.well-known/farmjs.json (and 0.1.34's /.well-known/farmjs), the app's
8327
8516
  // public manifest; Farm Infra's signed request gets the full view.
8328
8517
  if (
8329
- [${JSON.stringify(_chunkRVXFINNScjs.FARM_APP_MANIFEST_PATH)}, ${JSON.stringify(_chunkRVXFINNScjs.FARM_APP_MANIFEST_LEGACY_PATH)}].includes(
8518
+ [${JSON.stringify(_chunkEW4MEVLEcjs.FARM_APP_MANIFEST_PATH)}, ${JSON.stringify(_chunkEW4MEVLEcjs.FARM_APP_MANIFEST_LEGACY_PATH)}].includes(
8330
8519
  normalizeRuntimePath(routePathname),
8331
8520
  )
8332
8521
  ) {
@@ -8336,9 +8525,9 @@ async function handleFarmRequestInContext(
8336
8525
  );
8337
8526
  }
8338
8527
  ` : ""}
8339
- ${_optionalChain([config, 'access', _156 => _156.agent, 'optionalAccess', _157 => _157.apiCatalog]) ? `
8528
+ ${_optionalChain([config, 'access', _159 => _159.agent, 'optionalAccess', _160 => _160.apiCatalog]) ? `
8340
8529
  // agent.apiCatalog: list the OpenAPI and MCP surfaces at the RFC 9727 path.
8341
- if (normalizeRuntimePath(routePathname) === ${JSON.stringify(_chunkRVXFINNScjs.FARM_API_CATALOG_PATH)}) {
8530
+ if (normalizeRuntimePath(routePathname) === ${JSON.stringify(_chunkEW4MEVLEcjs.FARM_API_CATALOG_PATH)}) {
8342
8531
  return applyProductionMiddlewareHeaders(
8343
8532
  createFarmApiCatalogResponse(request.method, farmApiCatalogInput, request),
8344
8533
  middlewareHeaders,
@@ -8363,11 +8552,11 @@ async function handleFarmRequestInContext(
8363
8552
  );
8364
8553
  }
8365
8554
  ` : ""}
8366
- ${_optionalChain([config, 'access', _158 => _158.agent, 'optionalAccess', _159 => _159.llmsTxt, 'optionalAccess', _160 => _160.enabled]) ? `
8555
+ ${_optionalChain([config, 'access', _161 => _161.agent, 'optionalAccess', _162 => _162.llmsTxt, 'optionalAccess', _163 => _163.enabled]) ? `
8367
8556
  // agent.llmsTxt with no llms.ts or llms-full.ts: serve the generated files.
8368
8557
  const farmGeneratedLlmsKind = normalizeRuntimePath(routePathname) === "/llms.txt"
8369
8558
  ? "llms"
8370
- : ${_optionalChain([config, 'access', _161 => _161.agent, 'optionalAccess', _162 => _162.llmsTxt, 'optionalAccess', _163 => _163.full]) ? `normalizeRuntimePath(routePathname) === "/llms-full.txt" ? "llms-full" : ` : ""}null;
8559
+ : ${_optionalChain([config, 'access', _164 => _164.agent, 'optionalAccess', _165 => _165.llmsTxt, 'optionalAccess', _166 => _166.full]) ? `normalizeRuntimePath(routePathname) === "/llms-full.txt" ? "llms-full" : ` : ""}null;
8371
8560
  if (farmGeneratedLlmsKind) {
8372
8561
  const llmsContext = createFarmLlmsTxtContext(request, farmGeneratedLlmsKind === "llms-full");
8373
8562
  const llmsOrigin = new URL(request.url).origin;
@@ -8402,7 +8591,7 @@ async function handleFarmRequestInContext(
8402
8591
  }
8403
8592
  ` : ""}
8404
8593
 
8405
- ${_optionalChain([config, 'access', _164 => _164.docs, 'optionalAccess', _165 => _165.enabled]) ? `if (farmDocsAPIHandler && isFarmDocsAPIRequest(pathname)) {
8594
+ ${_optionalChain([config, 'access', _167 => _167.docs, 'optionalAccess', _168 => _168.enabled]) ? `if (farmDocsAPIHandler && isFarmDocsAPIRequest(pathname)) {
8406
8595
  const docsAPIResponse = await farmDocsAPIHandler(cloneFarmRequestWithContext(request));
8407
8596
  if (docsAPIResponse) {
8408
8597
  return applyProductionMiddlewareHeaders(
@@ -8863,7 +9052,7 @@ async function handleFarmRequestInContext(
8863
9052
  );
8864
9053
  }
8865
9054
  }
8866
- ${_optionalChain([config, 'access', _166 => _166.md, 'optionalAccess', _167 => _167.enabled]) ? `
9055
+ ${_optionalChain([config, 'access', _169 => _169.md, 'optionalAccess', _170 => _170.enabled]) ? `
8867
9056
  // Advertise the Markdown mirror in the head as well as the Link header,
8868
9057
  // using the public path the .md request will be resolved against.
8869
9058
  mergedMetadata = addMetadataMarkdownAlternate(
@@ -8882,7 +9071,7 @@ async function handleFarmRequestInContext(
8882
9071
  emitFarmEvent({ type: "cache.bypass", route: pathname, reason: "request-read" });
8883
9072
  }
8884
9073
 
8885
- const renderedMetadata = renderMetadataHead(mergedMetadata, { pathname, jsonLd: ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access', _168 => _168.agent, 'optionalAccess', _169 => _169.jsonLd]), () => ( false)))} });
9074
+ const renderedMetadata = renderMetadataHead(mergedMetadata, { pathname, jsonLd: ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access', _171 => _171.agent, 'optionalAccess', _172 => _172.jsonLd]), () => ( false)))} });
8886
9075
  const title = renderedMetadata.title;
8887
9076
  const metaTags = renderedMetadata.tags;
8888
9077
  const hasFavicon = renderedMetadata.hasFavicon;
@@ -9309,7 +9498,7 @@ async function handleFarmRequestInContext(
9309
9498
  ${servesDefaultMCP ? `
9310
9499
  // agent.mcp: no app route answered /mcp, so the default read-only server may.
9311
9500
  if (
9312
- normalizeRuntimePath(routePathname) === ${JSON.stringify(_chunkH5CLOUZScjs.FARM_DEFAULT_MCP_PATH)} &&
9501
+ normalizeRuntimePath(routePathname) === ${JSON.stringify(_chunkBMOBTMDRcjs.FARM_DEFAULT_MCP_PATH)} &&
9313
9502
  getFarmDefaultMCPServer()
9314
9503
  ) {
9315
9504
  return applyProductionMiddlewareHeaders(
@@ -9522,12 +9711,14 @@ async function handleFarmPluginRequest(request, runtimeOptions, adapterContext)
9522
9711
  ${generatePreloadResponseRuntimeSource()}
9523
9712
 
9524
9713
  // Export as Web Standard fetch API
9525
- export async function fetch(request, context) {
9526
- ${_optionalChain([config, 'access', _170 => _170.agent, 'optionalAccess', _171 => _171.noindexPreviews]) ? "const response = await" : "return"} _runWithAPIRequestRuntime({
9714
+ export async function fetch(request, context) {${imageRuntime === "none" ? "" : `
9715
+ // The image optimizer's fetch of a local source is not a loopback visitor.
9716
+ context = _withFarmImageSourceClientAddress(request, context);`}
9717
+ ${_optionalChain([config, 'access', _173 => _173.agent, 'optionalAccess', _174 => _174.noindexPreviews]) ? "const response = await" : "return"} _runWithAPIRequestRuntime({
9527
9718
  basePath: farmLocalAPIBasePath,
9528
9719
  dispatch: async (localRequest) =>
9529
9720
  (await handleAPIRequest(localRequest)) ?? Response.json({ error: "Not Found" }, { status: 404 }),
9530
- }, () => handleFarmFetch(request, context));${_optionalChain([config, 'access', _172 => _172.agent, 'optionalAccess', _173 => _173.noindexPreviews]) ? `
9721
+ }, () => handleFarmFetch(request, context));${_optionalChain([config, 'access', _175 => _175.agent, 'optionalAccess', _176 => _176.noindexPreviews]) ? `
9531
9722
  // Keep every response of a preview deployment out of search indexes.
9532
9723
  return farmNoindexPreview ? applyFarmPreviewRobotsTag(response) : response;` : ""}
9533
9724
  }
@@ -9544,6 +9735,20 @@ async function handleFarmFetch(request, context) {
9544
9735
  typeof context?.waitUntil === "function" ? context.waitUntil.bind(context) : undefined,
9545
9736
  );
9546
9737
 
9738
+ // headers() config applies after middleware let the request through, so it learns
9739
+ // whether the response was guarded and can't make that response shareable again.
9740
+ let farmGuardedResponse = false;
9741
+ if (configuredHeaderRoutes.length > 0) {
9742
+ const adapterContext = context;
9743
+ context = {
9744
+ ...adapterContext,
9745
+ onGuardedResponse() {
9746
+ farmGuardedResponse = true;
9747
+ adapterContext?.onGuardedResponse?.();
9748
+ },
9749
+ };
9750
+ }
9751
+
9547
9752
  return farmProductionLifecycle.runRequest(
9548
9753
  () =>
9549
9754
  runWithFarmRequestSpan(request, async () => {
@@ -9558,9 +9763,11 @@ async function handleFarmFetch(request, context) {
9558
9763
  const routePathname = configuredHeaderRoutes.length > 0
9559
9764
  ? getFarmRoutePathname(new URL(runtimeRequest.url).pathname)
9560
9765
  : undefined;
9766
+ const configured = applyConfiguredResponseHeaders(response, routePathname);
9561
9767
  return applyFarmPreloadBudget(
9562
9768
  applyFarmCspNonceToResponse(
9563
- applyConfiguredResponseHeaders(response, routePathname),
9769
+ // Configured headers may edit the response in place, so check it either way.
9770
+ farmGuardedResponse ? _withFarmGuardedResponseCache(configured) : configured,
9564
9771
  farmSecurityConfig,
9565
9772
  cspNonce,
9566
9773
  ),
@@ -9705,13 +9912,13 @@ function getPhysicalPrerenderBypassReason(options) {
9705
9912
  if (rewriteSources.some((source) => middlewarePatternMatches(source, pathname))) {
9706
9913
  return "rewrite";
9707
9914
  }
9708
- if (_chunkRVXFINNScjs.appMiddlewareMayHandlePath.call(void 0, middlewareRoutes, pathname)) return "app middleware";
9709
- if (_chunkRVXFINNScjs.configMiddlewareMayHandlePath.call(void 0, config.middleware, pathname)) return "configured middleware";
9710
- if (_chunkHRETEZ2Zcjs.hasCustomFarmRouteContext.call(void 0, config)) return "request context";
9915
+ if (_chunkEW4MEVLEcjs.appMiddlewareMayHandlePath.call(void 0, middlewareRoutes, pathname)) return "app middleware";
9916
+ if (_chunkEW4MEVLEcjs.configMiddlewareMayHandlePath.call(void 0, config.middleware, pathname)) return "configured middleware";
9917
+ if (_chunkFLZ4H25Acjs.hasCustomFarmRouteContext.call(void 0, config)) return "request context";
9711
9918
  if (farmServerRuntimePluginsMayHandlePath(config, pathname)) return "server runtime plugin";
9712
9919
  const manifestEntry = getManifestPageEntry(routeRuntimeManifest, pathname);
9713
- if (_optionalChain([manifestEntry, 'optionalAccess', _174 => _174.rendering]) === "dynamic") return "dynamic runtime manifest";
9714
- if (manifestEntry && (manifestEntry.runtime !== "auto" || Boolean(_optionalChain([manifestEntry, 'access', _175 => _175.regions, 'optionalAccess', _176 => _176.length])) || manifestEntry.maxDuration !== void 0)) {
9920
+ if (_optionalChain([manifestEntry, 'optionalAccess', _177 => _177.rendering]) === "dynamic") return "dynamic runtime manifest";
9921
+ if (manifestEntry && (manifestEntry.runtime !== "auto" || Boolean(_optionalChain([manifestEntry, 'access', _178 => _178.regions, 'optionalAccess', _179 => _179.length])) || manifestEntry.maxDuration !== void 0)) {
9715
9922
  return "route runtime controls";
9716
9923
  }
9717
9924
  const routeRule = getEffectiveRouteRule(config, pathname);
@@ -9724,8 +9931,17 @@ function getPhysicalPrerenderBypassReason(options) {
9724
9931
  return void 0;
9725
9932
  }
9726
9933
  _chunkS3JO3N4Hcjs.__name.call(void 0, getPhysicalPrerenderBypassReason, "getPhysicalPrerenderBypassReason");
9934
+ function hasFarmNitroCacheRouteRule(routeRules) {
9935
+ return Object.values(routeRules || {}).some((rule) => {
9936
+ const swr = _optionalChain([rule, 'optionalAccess', _180 => _180.swr]);
9937
+ const cache = _optionalChain([rule, 'optionalAccess', _181 => _181.cache]);
9938
+ const headers = _optionalChain([rule, 'optionalAccess', _182 => _182.headers]);
9939
+ return swr !== void 0 && swr !== false || cache !== void 0 && cache !== false || !!headers && typeof headers === "object" && Object.keys(headers).length > 0;
9940
+ });
9941
+ }
9942
+ _chunkS3JO3N4Hcjs.__name.call(void 0, hasFarmNitroCacheRouteRule, "hasFarmNitroCacheRouteRule");
9727
9943
  async function buildNitroUniversal(config, routeManager, apiRouteManager, serverRenderer, preset, root, distDir, ssrBundle, ssrEntryFile, clientOutputDir, routeRuntimeManifest, configuredHeaderRoutes, nitroBuilderResultPromise, pluginManager) {
9728
- const [fs3, nitroBuilderResult] = await Promise.all([
9944
+ const [fs4, nitroBuilderResult] = await Promise.all([
9729
9945
  import("fs/promises"),
9730
9946
  nitroBuilderResultPromise
9731
9947
  ]);
@@ -9733,7 +9949,7 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
9733
9949
  const nitroBuilder = nitroBuilderResult.value;
9734
9950
  const isVercel = preset === "vercel" || preset === "vercel-edge";
9735
9951
  const isCloudflareWorker = preset === "cloudflare-module";
9736
- const outputDir = _chunkHRETEZ2Zcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
9952
+ const outputDir = _chunkFLZ4H25Acjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
9737
9953
  const runtimeServerOutputDir = isVercel ? _path2.default.join(outputDir, "functions", "__nitro.func") : _path2.default.join(outputDir, "server");
9738
9954
  const ssrOutputDir = _path2.default.join(root, distDir, "ssr");
9739
9955
  const imageRuntime = resolveImageRuntime(config, preset);
@@ -9757,7 +9973,7 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
9757
9973
  const ssgCollectionPromise = routeManager.collectSSGPages();
9758
9974
  const middlewareRoutesPromise = discoverMiddlewareRoutes(_chunkWBKEZXWEcjs.getFarmAppDirectories.call(void 0, config));
9759
9975
  const configuredResponseRoutesPromise = Promise.all([config.redirects(), config.rewrites()]);
9760
- const farmWorkflows = await _chunkSDOTRX3Vcjs.prepareFarmWorkflowsForNitro.call(void 0, config);
9976
+ const farmWorkflows = await _chunkEORXKFLRcjs.prepareFarmWorkflowsForNitro.call(void 0, config);
9761
9977
  const farmCron = await _chunk6EXBPJ24cjs.prepareFarmCronForNitro.call(void 0, config);
9762
9978
  const [{ ssg: ssgPages }, middlewareRoutes, [configuredRedirects, configuredRewrites]] = await Promise.all([
9763
9979
  ssgCollectionPromise,
@@ -9827,14 +10043,15 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
9827
10043
  output.code = output.code.split(FARM_CLIENT_JS_SRC_PLACEHOLDER).join(clientJsSrc);
9828
10044
  }
9829
10045
  }
9830
- await fs3.mkdir(ssrOutputDir, { recursive: true });
10046
+ await fs4.mkdir(ssrOutputDir, { recursive: true });
9831
10047
  for (const [fileName, output] of Object.entries(ssrBundle)) {
9832
10048
  const filePath = _path2.default.join(ssrOutputDir, fileName);
9833
- await fs3.mkdir(_path2.default.dirname(filePath), { recursive: true });
9834
- await fs3.writeFile(filePath, output.type === "chunk" ? output.code : output.source);
10049
+ await fs4.mkdir(_path2.default.dirname(filePath), { recursive: true });
10050
+ await fs4.writeFile(filePath, output.type === "chunk" ? output.code : output.source);
9835
10051
  }
9836
10052
  const nitroEntryPath = _path2.default.join(ssrOutputDir, "nitro-entry.mjs");
9837
10053
  const nodeAdapterModule = preset === "node-server" ? resolveNitroRuntimeDependency(root, "srvx/node") : null;
10054
+ const hasNitroCacheRouteRules = hasFarmNitroCacheRouteRule(config.routeRules);
9838
10055
  const nitroEntryCode = `
9839
10056
  // Farm.js Nitro Entry
9840
10057
  // This file adapts Farm's Web fetch handler to Nitro's event handler contract.
@@ -9855,7 +10072,39 @@ function registerFarmCloseHook() {
9855
10072
  farmProductionLifecycle.close('production-server-closed')
9856
10073
  )
9857
10074
  }
9858
-
10075
+ ${hasNitroCacheRouteRules ? `
10076
+ // A swr route rule caches through Nitro, which writes its own public Cache-Control on
10077
+ // the event after Farm answered, and a headers route rule sets its headers there too. H3
10078
+ // lets those replace the response's. A response middleware let through keeps Farm's
10079
+ // private policy and no CDN cache header, so no CDN serves it to others.
10080
+ const FARM_PRIVATE_CACHE_DIRECTIVE = /(?:^|,)\\s*(?:private|no-store)\\s*(?:[,=]|$)/i
10081
+ const FARM_CDN_CACHE_CONTROL_HEADERS = [
10082
+ 'cdn-cache-control',
10083
+ 'vercel-cdn-cache-control',
10084
+ 'netlify-cdn-cache-control',
10085
+ 'cloudflare-cdn-cache-control',
10086
+ ]
10087
+ const farmPrivateCacheControlKey = Symbol.for('farm.privateCacheControl')
10088
+ let farmPrivateCacheHookRegistered = false
10089
+ function keepFarmPrivateCacheControl(event, cacheControl) {
10090
+ if (!farmPrivateCacheHookRegistered) {
10091
+ farmPrivateCacheHookRegistered = true
10092
+ useNitroHooks().hook('response', (response, responseEvent) => {
10093
+ const value = responseEvent.context?.[farmPrivateCacheControlKey]
10094
+ if (!value) return
10095
+ try {
10096
+ if (response.headers.get('cache-control') !== value) {
10097
+ response.headers.set('cache-control', value)
10098
+ }
10099
+ for (const name of FARM_CDN_CACHE_CONTROL_HEADERS) response.headers.delete(name)
10100
+ } catch {
10101
+ // Immutable headers belong to a response Nitro passed through untouched.
10102
+ }
10103
+ })
10104
+ }
10105
+ if (event.context) event.context[farmPrivateCacheControlKey] = cacheControl
10106
+ }
10107
+ ` : ""}
9859
10108
  function mergeVaryHeaders(target, source) {
9860
10109
  const values = new Set(
9861
10110
  [target.get('Vary'), source]
@@ -9949,11 +10198,14 @@ export default async function farmNitroEventHandler(event) {
9949
10198
  const request = !srvxRequest && node?.req && node?.res
9950
10199
  ? new Request(webRequest, { signal: createFarmNodeRequestAbortSignal(node.req, node.res) })
9951
10200
  : webRequest
9952
- const response = await handler.fetch(request, {
10201
+ ${hasNitroCacheRouteRules ? " let farmGuardedResponse = false\n" : ""} const response = await handler.fetch(request, {
9953
10202
  waitUntil: (promise) => event.waitUntil(promise),
9954
10203
  onResponseFinished: createResponseFinishedHook(event),
9955
10204
  trustedLocalOrigin: resolveTrustedLocalOrigin(event, request),
9956
- clientAddress: resolveFarmClientAddress(event),
10205
+ clientAddress: resolveFarmClientAddress(event),${hasNitroCacheRouteRules ? `
10206
+ onGuardedResponse: () => {
10207
+ farmGuardedResponse = true
10208
+ },` : ""}
9957
10209
  })
9958
10210
 
9959
10211
  // Nitro records asset compression negotiation on the event response. Merge
@@ -9964,7 +10216,15 @@ export default async function farmNitroEventHandler(event) {
9964
10216
  if (farmVary) {
9965
10217
  const nitroHeaders = event.res.headers
9966
10218
  if (nitroHeaders.has('Vary')) mergeVaryHeaders(nitroHeaders, farmVary)
9967
- }
10219
+ }${hasNitroCacheRouteRules ? `
10220
+ const farmCacheControl = response.headers.get('cache-control')
10221
+ if (
10222
+ farmGuardedResponse &&
10223
+ farmCacheControl &&
10224
+ FARM_PRIVATE_CACHE_DIRECTIVE.test(farmCacheControl)
10225
+ ) {
10226
+ keepFarmPrivateCacheControl(event, farmCacheControl)
10227
+ }` : ""}
9968
10228
  return ${nodeAdapterModule ? "toFarmNodeResponse(request, response)" : "response"}
9969
10229
  }${nodeAdapterModule ? `
9970
10230
 
@@ -9985,16 +10245,16 @@ function toFarmNodeResponse(request, response) {
9985
10245
  })
9986
10246
  }` : ""}
9987
10247
  `.trim();
9988
- await fs3.writeFile(nitroEntryPath, nitroEntryCode);
10248
+ await fs4.writeFile(nitroEntryPath, nitroEntryCode);
9989
10249
  const farmNodeServerEntryPath = preset === "node-server" ? _path2.default.join(ssrOutputDir, "farm-node-server-entry.mjs") : null;
9990
10250
  if (farmNodeServerEntryPath && nodeAdapterModule) {
9991
- await fs3.writeFile(
9992
- _path2.default.join(ssrOutputDir, _chunkWW46B6HAcjs.FARM_NODE_ENV_MODULE_FILE),
9993
- _chunkWW46B6HAcjs.FARM_NODE_ENV_MODULE_SOURCE
10251
+ await fs4.writeFile(
10252
+ _path2.default.join(ssrOutputDir, _chunkCGR525MJcjs.FARM_NODE_ENV_MODULE_FILE),
10253
+ _chunkCGR525MJcjs.FARM_NODE_ENV_MODULE_SOURCE
9994
10254
  );
9995
- await fs3.writeFile(
10255
+ await fs4.writeFile(
9996
10256
  farmNodeServerEntryPath,
9997
- _chunkWW46B6HAcjs.createFarmNodeServerEntry.call(void 0, {
10257
+ _chunkCGR525MJcjs.createFarmNodeServerEntry.call(void 0, {
9998
10258
  nitroEntryFile: _path2.default.basename(nitroEntryPath),
9999
10259
  nodeAdapterModule,
10000
10260
  server: config.server,
@@ -10002,9 +10262,21 @@ function toFarmNodeResponse(request, response) {
10002
10262
  })
10003
10263
  );
10004
10264
  }
10265
+ const farmBunServerEntryPath = preset === "bun" ? _path2.default.join(ssrOutputDir, "farm-bun-server-entry.mjs") : null;
10266
+ if (farmBunServerEntryPath) {
10267
+ await fs4.writeFile(
10268
+ farmBunServerEntryPath,
10269
+ _chunkCGR525MJcjs.createFarmBunServerEntry.call(void 0, {
10270
+ nitroEntryFile: _path2.default.basename(nitroEntryPath),
10271
+ bunAdapterModule: resolveNitroRuntimeDependency(root, "srvx/bun"),
10272
+ server: config.server,
10273
+ websocketAdapterModule: resolveNitroRuntimeDependency(root, "crossws/adapters/bun")
10274
+ })
10275
+ );
10276
+ }
10005
10277
  const farmNetlifyEntryPath = preset === "netlify" ? _path2.default.join(ssrOutputDir, "farm-netlify-entry.mjs") : null;
10006
10278
  if (farmNetlifyEntryPath) {
10007
- await fs3.writeFile(
10279
+ await fs4.writeFile(
10008
10280
  farmNetlifyEntryPath,
10009
10281
  createFarmNetlifyEntry({
10010
10282
  nitroNetlifyEntry: resolveNitroNetlifyEntry(resolveNitroPackageEntry(root))
@@ -10036,7 +10308,10 @@ function toFarmNodeResponse(request, response) {
10036
10308
  let nitroConfig = {
10037
10309
  preset,
10038
10310
  ...farmNodeServerEntryPath ? { entry: farmNodeServerEntryPath } : {},
10311
+ ...farmBunServerEntryPath ? { entry: farmBunServerEntryPath } : {},
10039
10312
  ...farmNetlifyEntryPath ? { entry: farmNetlifyEntryPath } : {},
10313
+ // The response hook that keeps a private Cache-Control under a swr or headers rule (nitro-entry).
10314
+ ...hasNitroCacheRouteRules ? { features: { runtimeHooks: true } } : {},
10040
10315
  rootDir: root,
10041
10316
  // Farm registers every handler, task, and plugin explicitly. Scanning the
10042
10317
  // project root would bundle an app's own `middleware/`, `api/`, `routes/`,
@@ -10133,20 +10408,20 @@ function toFarmNodeResponse(request, response) {
10133
10408
  snapshotSSRRebundleOptions(nitroConfig)
10134
10409
  );
10135
10410
  const requestedBuilder = _nullishCoalesce(nitroConfig.builder, () => ( process.env.NITRO_BUILDER));
10136
- const canReusePrebuiltSSR = isPrebuiltSSRCandidate && nitroConfig.preset === "node-server" && (requestedBuilder === void 0 || requestedBuilder === "rollup" || requestedBuilder === "rolldown") && nitroConfig.sourcemap === false && !hasCustomOxcOptions && !hasLateBuildMutationConfig && !hasUnsupportedSSRRebundleOverrides && _optionalChain([nitroConfig, 'access', _177 => _177.rollupConfig, 'optionalAccess', _178 => _178.external]) === nitroRollupExternal && !hasRollupPlugins(_optionalChain([nitroConfig, 'access', _179 => _179.rollupConfig, 'optionalAccess', _180 => _180.plugins])) && customRollupKeys.length === 0 && _path2.default.resolve(_optionalChain([nitroConfig, 'access', _181 => _181.output, 'optionalAccess', _182 => _182.serverDir]) || "") === _path2.default.resolve(expectedServerDir) && Boolean(
10137
- _optionalChain([nitroConfig, 'access', _183 => _183.handlers, 'optionalAccess', _184 => _184.some, 'call', _185 => _185(
10138
- (handler) => _path2.default.resolve(_optionalChain([handler, 'optionalAccess', _186 => _186.handler]) || "") === nitroEntryPath
10411
+ const canReusePrebuiltSSR = isPrebuiltSSRCandidate && nitroConfig.preset === "node-server" && (requestedBuilder === void 0 || requestedBuilder === "rollup" || requestedBuilder === "rolldown") && nitroConfig.sourcemap === false && !hasCustomOxcOptions && !hasLateBuildMutationConfig && !hasUnsupportedSSRRebundleOverrides && _optionalChain([nitroConfig, 'access', _183 => _183.rollupConfig, 'optionalAccess', _184 => _184.external]) === nitroRollupExternal && !hasRollupPlugins(_optionalChain([nitroConfig, 'access', _185 => _185.rollupConfig, 'optionalAccess', _186 => _186.plugins])) && customRollupKeys.length === 0 && _path2.default.resolve(_optionalChain([nitroConfig, 'access', _187 => _187.output, 'optionalAccess', _188 => _188.serverDir]) || "") === _path2.default.resolve(expectedServerDir) && Boolean(
10412
+ _optionalChain([nitroConfig, 'access', _189 => _189.handlers, 'optionalAccess', _190 => _190.some, 'call', _191 => _191(
10413
+ (handler) => _path2.default.resolve(_optionalChain([handler, 'optionalAccess', _192 => _192.handler]) || "") === nitroEntryPath
10139
10414
  )])
10140
10415
  );
10141
10416
  const selectRolldownBuilder = canReusePrebuiltSSR && requestedBuilder === void 0 && await canUseRolldownBuilder();
10142
10417
  if (selectRolldownBuilder) nitroConfig.builder = "rolldown";
10143
10418
  const useRolldownBuilder = canReusePrebuiltSSR && (_nullishCoalesce(nitroConfig.builder, () => ( process.env.NITRO_BUILDER))) === "rolldown";
10144
10419
  const shouldMinify = nitroConfig.minify !== false;
10145
- const keepServerNames = !(_optionalChain([config, 'access', _187 => _187.docs, 'optionalAccess', _188 => _188.enabled]) && _optionalChain([config, 'access', _189 => _189.docs, 'access', _190 => _190.adapter, 'optionalAccess', _191 => _191.server]));
10420
+ const keepServerNames = !(_optionalChain([config, 'access', _193 => _193.docs, 'optionalAccess', _194 => _194.enabled]) && _optionalChain([config, 'access', _195 => _195.docs, 'access', _196 => _196.adapter, 'optionalAccess', _197 => _197.server]));
10146
10421
  const useFarmServerMinifier = shouldMinify && nitroConfig.sourcemap === false && !hasCustomOxcOptions && !hasLateBuildMutationConfig;
10147
10422
  const serverChunkMinifier = useFarmServerMinifier ? createServerChunkMinifyPlugin({ keepNames: keepServerNames, target: "esnext" }) : null;
10148
10423
  if (canReusePrebuiltSSR) {
10149
- const configuredRollupPlugins = _optionalChain([nitroConfig, 'access', _192 => _192.rollupConfig, 'optionalAccess', _193 => _193.plugins]);
10424
+ const configuredRollupPlugins = _optionalChain([nitroConfig, 'access', _198 => _198.rollupConfig, 'optionalAccess', _199 => _199.plugins]);
10150
10425
  nitroConfig.rollupConfig = {
10151
10426
  ...nitroConfig.rollupConfig,
10152
10427
  plugins: [
@@ -10157,10 +10432,10 @@ function toFarmNodeResponse(request, response) {
10157
10432
  }
10158
10433
  nitroConfig.minify = useFarmServerMinifier ? false : shouldMinify;
10159
10434
  const nitroInstance = await nitroBuilder.createNitro(nitroConfig);
10160
- if (_optionalChain([config, 'access', _194 => _194.md, 'optionalAccess', _195 => _195.enabled])) {
10435
+ if (_optionalChain([config, 'access', _200 => _200.md, 'optionalAccess', _201 => _201.enabled])) {
10161
10436
  nitroInstance.hooks.hook("prerender:generate", (route) => {
10162
- if (!route.contents || !_optionalChain([route, 'access', _196 => _196.contentType, 'optionalAccess', _197 => _197.toLowerCase, 'call', _198 => _198(), 'access', _199 => _199.includes, 'call', _200 => _200("html")])) return;
10163
- const alternatePath = _chunkSGBJ247Qcjs.getFarmMarkdownAlternatePath.call(void 0, config.md, route.route);
10437
+ if (!route.contents || !_optionalChain([route, 'access', _202 => _202.contentType, 'optionalAccess', _203 => _203.toLowerCase, 'call', _204 => _204(), 'access', _205 => _205.includes, 'call', _206 => _206("html")])) return;
10438
+ const alternatePath = _chunkD4ROBNTKcjs.getFarmMarkdownAlternatePath.call(void 0, config.md, route.route);
10164
10439
  if (!alternatePath) return;
10165
10440
  const routeRule = nitroInstance.options.routeRules[route.route] || {};
10166
10441
  const alternate = `<${alternatePath}>; rel="alternate"; type="text/markdown"`;
@@ -10180,8 +10455,8 @@ function toFarmNodeResponse(request, response) {
10180
10455
  }
10181
10456
  if (config.security.csp && config.security.csp.nonce) {
10182
10457
  nitroInstance.hooks.hook("prerender:generate", async (route) => {
10183
- if (!route.contents || !_optionalChain([route, 'access', _201 => _201.contentType, 'optionalAccess', _202 => _202.toLowerCase, 'call', _203 => _203(), 'access', _204 => _204.includes, 'call', _205 => _205("html")])) return;
10184
- const staticCsp = await _chunk2ZYGC6SScjs.applyFarmCspHashesToHtml.call(void 0, route.contents, config.security);
10458
+ if (!route.contents || !_optionalChain([route, 'access', _207 => _207.contentType, 'optionalAccess', _208 => _208.toLowerCase, 'call', _209 => _209(), 'access', _210 => _210.includes, 'call', _211 => _211("html")])) return;
10459
+ const staticCsp = await _chunkB6IMBBOScjs.applyFarmCspHashesToHtml.call(void 0, route.contents, config.security);
10185
10460
  if (!staticCsp) return;
10186
10461
  route.contents = staticCsp.html;
10187
10462
  const routeRule = nitroInstance.options.routeRules[route.route] || {};
@@ -10196,7 +10471,7 @@ function toFarmNodeResponse(request, response) {
10196
10471
  nitroInstance.routing.sync();
10197
10472
  });
10198
10473
  }
10199
- if (farmNodeServerEntryPath || farmNetlifyEntryPath) {
10474
+ if (farmNodeServerEntryPath || farmBunServerEntryPath || farmNetlifyEntryPath) {
10200
10475
  nitroInstance.hooks.hook("prerender:config", (prerendererConfig) => {
10201
10476
  delete prerendererConfig.entry;
10202
10477
  });
@@ -10227,9 +10502,9 @@ function toFarmNodeResponse(request, response) {
10227
10502
  ssrBundle,
10228
10503
  _path2.default.join(prerenderServerDir, FARM_SSR_OUTPUT_DIR),
10229
10504
  null,
10230
- fs3
10505
+ fs4
10231
10506
  );
10232
- await registerPrebuiltSSRPackageImport(prerenderServerDir, ssrEntryFile, fs3);
10507
+ await registerPrebuiltSSRPackageImport(prerenderServerDir, ssrEntryFile, fs4);
10233
10508
  });
10234
10509
  });
10235
10510
  }
@@ -10251,16 +10526,16 @@ function toFarmNodeResponse(request, response) {
10251
10526
  }
10252
10527
  if (prerenderRoutes.length > 0) {
10253
10528
  _chunk5QIKR7RRcjs.logger.info(`\u{1F4C4} Pre-rendering ${prerenderRoutes.length} SSG page(s)`);
10254
- const previousPrerender = process.env[_chunkWXJLNP33cjs.FARM_PRERENDER_ENV];
10255
- process.env[_chunkWXJLNP33cjs.FARM_PRERENDER_ENV] = "1";
10529
+ const previousPrerender = process.env[_chunkYR2P74F7cjs.FARM_PRERENDER_ENV];
10530
+ process.env[_chunkYR2P74F7cjs.FARM_PRERENDER_ENV] = "1";
10256
10531
  try {
10257
10532
  await nitroBuilder.prerender(nitroInstance);
10258
10533
  } finally {
10259
- if (previousPrerender === void 0) delete process.env[_chunkWXJLNP33cjs.FARM_PRERENDER_ENV];
10260
- else process.env[_chunkWXJLNP33cjs.FARM_PRERENDER_ENV] = previousPrerender;
10534
+ if (previousPrerender === void 0) delete process.env[_chunkYR2P74F7cjs.FARM_PRERENDER_ENV];
10535
+ else process.env[_chunkYR2P74F7cjs.FARM_PRERENDER_ENV] = previousPrerender;
10261
10536
  }
10262
10537
  }
10263
- const sharpRuntimeStagePromise = imageRuntime === "node" ? stageSharpRuntime(config, root, distDir, fs3, preset) : Promise.resolve(null);
10538
+ const sharpRuntimeStagePromise = imageRuntime === "node" ? stageSharpRuntime(config, root, distDir, fs4, preset) : Promise.resolve(null);
10264
10539
  const prebuiltSSRFilesPromise = canReusePrebuiltSSR ? prepareSSRBundleFiles(
10265
10540
  ssrBundle,
10266
10541
  shouldMinify ? { keepNames: keepServerNames, target: "node18" } : null
@@ -10273,7 +10548,7 @@ function toFarmNodeResponse(request, response) {
10273
10548
  await nitroInstance.close();
10274
10549
  if (nitroBuildResult.status === "rejected") {
10275
10550
  if (sharpRuntimeStageResult.status === "fulfilled" && sharpRuntimeStageResult.value) {
10276
- await fs3.rm(sharpRuntimeStageResult.value.stageDir, {
10551
+ await fs4.rm(sharpRuntimeStageResult.value.stageDir, {
10277
10552
  recursive: true,
10278
10553
  force: true
10279
10554
  });
@@ -10286,20 +10561,20 @@ function toFarmNodeResponse(request, response) {
10286
10561
  if (prebuiltSSRFilesResult.status === "rejected") {
10287
10562
  throw prebuiltSSRFilesResult.reason;
10288
10563
  }
10289
- const stagedSharpRuntime = await _asyncNullishCoalesce(sharpRuntimeStageResult.value, async () => ( (imageRuntime === "node" ? await stageSharpRuntime(config, root, distDir, fs3, preset) : null)));
10564
+ const stagedSharpRuntime = await _asyncNullishCoalesce(sharpRuntimeStageResult.value, async () => ( (imageRuntime === "node" ? await stageSharpRuntime(config, root, distDir, fs4, preset) : null)));
10290
10565
  const runtimeCopyPromise = (async () => {
10291
10566
  if (stagedSharpRuntime) {
10292
- await installStagedSharpRuntime(stagedSharpRuntime, runtimeServerOutputDir, fs3);
10567
+ await installStagedSharpRuntime(stagedSharpRuntime, runtimeServerOutputDir, fs4);
10293
10568
  }
10294
10569
  if (useExternalMetadataImageRuntime) {
10295
- await copyMetadataImageRuntime(root, runtimeServerOutputDir, fs3);
10570
+ await copyMetadataImageRuntime(root, runtimeServerOutputDir, fs4);
10296
10571
  }
10297
10572
  })();
10298
10573
  const copyResults = await Promise.allSettled([
10299
10574
  prebuiltSSRFilesResult.value ? writeSSRBundleFiles(
10300
10575
  prebuiltSSRFilesResult.value,
10301
10576
  _path2.default.join(outputDir, "server", FARM_SSR_OUTPUT_DIR),
10302
- fs3
10577
+ fs4
10303
10578
  ) : Promise.resolve(),
10304
10579
  runtimeCopyPromise
10305
10580
  ]);
@@ -10308,7 +10583,7 @@ function toFarmNodeResponse(request, response) {
10308
10583
  );
10309
10584
  if (failedCopy) throw failedCopy.reason;
10310
10585
  if (canReusePrebuiltSSR) {
10311
- await registerPrebuiltSSRPackageImport(_path2.default.join(outputDir, "server"), ssrEntryFile, fs3);
10586
+ await registerPrebuiltSSRPackageImport(_path2.default.join(outputDir, "server"), ssrEntryFile, fs4);
10312
10587
  _chunk5QIKR7RRcjs.logger.info("\u26A1 Reused Farm's prebuilt SSR bundle for the Node output");
10313
10588
  }
10314
10589
  if (useRolldownBuilder) {
@@ -10323,7 +10598,7 @@ function toFarmNodeResponse(request, response) {
10323
10598
  });
10324
10599
  }
10325
10600
  if (isVercel) {
10326
- await postProcessVercelOutput(root, outputDir, fs3, config, farmWorkflows, routeRuntimeManifest);
10601
+ await postProcessVercelOutput(root, outputDir, fs4, config, farmWorkflows, routeRuntimeManifest);
10327
10602
  }
10328
10603
  _chunk5QIKR7RRcjs.logger.success(`\u2705 Nitro build completed with preset: ${preset}`);
10329
10604
  }
@@ -10351,24 +10626,24 @@ function prepareSSRBundleFiles(ssrBundle, minifyOptions) {
10351
10626
  );
10352
10627
  }
10353
10628
  _chunkS3JO3N4Hcjs.__name.call(void 0, prepareSSRBundleFiles, "prepareSSRBundleFiles");
10354
- async function writeSSRBundleFiles(files, targetDir, fs3) {
10355
- await fs3.rm(targetDir, { recursive: true, force: true });
10629
+ async function writeSSRBundleFiles(files, targetDir, fs4) {
10630
+ await fs4.rm(targetDir, { recursive: true, force: true });
10356
10631
  await Promise.all(
10357
10632
  files.map(async ({ fileName, contents }) => {
10358
10633
  const targetPath = _path2.default.join(targetDir, fileName);
10359
- await fs3.mkdir(_path2.default.dirname(targetPath), { recursive: true });
10360
- await fs3.writeFile(targetPath, contents);
10634
+ await fs4.mkdir(_path2.default.dirname(targetPath), { recursive: true });
10635
+ await fs4.writeFile(targetPath, contents);
10361
10636
  })
10362
10637
  );
10363
10638
  }
10364
10639
  _chunkS3JO3N4Hcjs.__name.call(void 0, writeSSRBundleFiles, "writeSSRBundleFiles");
10365
- async function copyPrebuiltSSRBundle(ssrBundle, targetDir, minifyOptions, fs3) {
10366
- await writeSSRBundleFiles(await prepareSSRBundleFiles(ssrBundle, minifyOptions), targetDir, fs3);
10640
+ async function copyPrebuiltSSRBundle(ssrBundle, targetDir, minifyOptions, fs4) {
10641
+ await writeSSRBundleFiles(await prepareSSRBundleFiles(ssrBundle, minifyOptions), targetDir, fs4);
10367
10642
  }
10368
10643
  _chunkS3JO3N4Hcjs.__name.call(void 0, copyPrebuiltSSRBundle, "copyPrebuiltSSRBundle");
10369
- async function registerPrebuiltSSRPackageImport(serverDir, ssrEntryFile, fs3) {
10644
+ async function registerPrebuiltSSRPackageImport(serverDir, ssrEntryFile, fs4) {
10370
10645
  const packagePath = _path2.default.join(serverDir, "package.json");
10371
- const packageJSON = await fs3.readFile(packagePath, "utf8").then((contents) => JSON.parse(contents)).catch((error) => {
10646
+ const packageJSON = await fs4.readFile(packagePath, "utf8").then((contents) => JSON.parse(contents)).catch((error) => {
10372
10647
  if (error.code === "ENOENT") return { type: "module" };
10373
10648
  throw error;
10374
10649
  });
@@ -10378,61 +10653,61 @@ async function registerPrebuiltSSRPackageImport(serverDir, ssrEntryFile, fs3) {
10378
10653
  ...existingImports,
10379
10654
  [FARM_SSR_PACKAGE_IMPORT]: `./${outputEntry}`
10380
10655
  };
10381
- await fs3.mkdir(serverDir, { recursive: true });
10382
- await fs3.writeFile(packagePath, `${JSON.stringify(packageJSON, null, 2)}
10656
+ await fs4.mkdir(serverDir, { recursive: true });
10657
+ await fs4.writeFile(packagePath, `${JSON.stringify(packageJSON, null, 2)}
10383
10658
  `);
10384
10659
  }
10385
10660
  _chunkS3JO3N4Hcjs.__name.call(void 0, registerPrebuiltSSRPackageImport, "registerPrebuiltSSRPackageImport");
10386
- async function moveVercelOutputPath(src, dest, fs3) {
10661
+ async function moveVercelOutputPath(src, dest, fs4) {
10387
10662
  try {
10388
- await fs3.rename(src, dest);
10663
+ await fs4.rename(src, dest);
10389
10664
  return;
10390
10665
  } catch (error) {
10391
- const code = _optionalChain([error, 'optionalAccess', _206 => _206.code]);
10666
+ const code = _optionalChain([error, 'optionalAccess', _212 => _212.code]);
10392
10667
  if (code !== "EPERM" && code !== "EACCES" && code !== "EXDEV" && code !== "ENOTEMPTY") {
10393
10668
  throw error;
10394
10669
  }
10395
10670
  }
10396
- await fs3.cp(src, dest, { recursive: true, force: true });
10397
- await fs3.rm(src, { recursive: true, force: true });
10671
+ await fs4.cp(src, dest, { recursive: true, force: true });
10672
+ await fs4.rm(src, { recursive: true, force: true });
10398
10673
  }
10399
10674
  _chunkS3JO3N4Hcjs.__name.call(void 0, moveVercelOutputPath, "moveVercelOutputPath");
10400
- async function postProcessVercelOutput(root, outputDir, fs3, config, farmWorkflows, routeRuntimeManifest) {
10675
+ async function postProcessVercelOutput(root, outputDir, fs4, config, farmWorkflows, routeRuntimeManifest) {
10401
10676
  const serverDir = _path2.default.join(outputDir, "server");
10402
10677
  const functionsDir = _path2.default.join(outputDir, "functions");
10403
10678
  const nitroFuncDir = _path2.default.join(functionsDir, "__nitro.func");
10404
10679
  const staticDir = _path2.default.join(outputDir, "static");
10405
10680
  const publicDir = _path2.default.join(outputDir, "public");
10406
- await fs3.mkdir(nitroFuncDir, { recursive: true });
10407
- const serverContents = await fs3.readdir(serverDir).catch((error) => {
10681
+ await fs4.mkdir(nitroFuncDir, { recursive: true });
10682
+ const serverContents = await fs4.readdir(serverDir).catch((error) => {
10408
10683
  if (error.code === "ENOENT") return [];
10409
10684
  throw error;
10410
10685
  });
10411
10686
  for (const file of serverContents) {
10412
- await moveVercelOutputPath(_path2.default.join(serverDir, file), _path2.default.join(nitroFuncDir, file), fs3);
10687
+ await moveVercelOutputPath(_path2.default.join(serverDir, file), _path2.default.join(nitroFuncDir, file), fs4);
10413
10688
  }
10414
- if (serverContents.length > 0) await fs3.rm(serverDir, { recursive: true, force: true });
10689
+ if (serverContents.length > 0) await fs4.rm(serverDir, { recursive: true, force: true });
10415
10690
  try {
10416
- await moveVercelOutputPath(publicDir, staticDir, fs3);
10691
+ await moveVercelOutputPath(publicDir, staticDir, fs4);
10417
10692
  } catch (error) {
10418
- if (_optionalChain([error, 'optionalAccess', _207 => _207.code]) !== "ENOENT") throw error;
10693
+ if (_optionalChain([error, 'optionalAccess', _213 => _213.code]) !== "ENOENT") throw error;
10419
10694
  }
10420
- await copyFarmDocsContentForVercel(config, root, nitroFuncDir, fs3);
10421
- await copyPrismaClientForVercel(root, nitroFuncDir, fs3);
10695
+ await copyFarmDocsContentForVercel(config, root, nitroFuncDir, fs4);
10696
+ await copyPrismaClientForVercel(root, nitroFuncDir, fs4);
10422
10697
  const configPath = _path2.default.join(outputDir, "config.json");
10423
- const configContent = await fs3.readFile(configPath, "utf-8");
10698
+ const configContent = await fs4.readFile(configPath, "utf-8");
10424
10699
  const vercelConfig = JSON.parse(configContent);
10425
10700
  const runtimeRoutes = await createFarmVercelRouteRuntimeFunctions(
10426
10701
  outputDir,
10427
10702
  routeRuntimeManifest,
10428
- fs3,
10703
+ fs4,
10429
10704
  config.basePath
10430
10705
  );
10431
10706
  vercelConfig.routes = buildFarmVercelRoutes({
10432
10707
  presetRoutes: Array.isArray(vercelConfig.routes) ? vercelConfig.routes : [],
10433
10708
  runtimeRoutes
10434
10709
  });
10435
- const vercelConfigWithWorkflowCrons = _chunkSDOTRX3Vcjs.applyFarmWorkflowVercelCrons.call(void 0,
10710
+ const vercelConfigWithWorkflowCrons = _chunkEORXKFLRcjs.applyFarmWorkflowVercelCrons.call(void 0,
10436
10711
  vercelConfig,
10437
10712
  farmWorkflows.workflows
10438
10713
  );
@@ -10440,25 +10715,25 @@ async function postProcessVercelOutput(root, outputDir, fs3, config, farmWorkflo
10440
10715
  vercelConfigWithWorkflowCrons,
10441
10716
  config.cron.jobs
10442
10717
  );
10443
- await fs3.writeFile(configPath, JSON.stringify(vercelConfigWithCrons, null, 2));
10718
+ await fs4.writeFile(configPath, JSON.stringify(vercelConfigWithCrons, null, 2));
10444
10719
  _chunk5QIKR7RRcjs.logger.info("\u2705 Post-processed Vercel output for Build Output API v3");
10445
10720
  }
10446
10721
  _chunkS3JO3N4Hcjs.__name.call(void 0, postProcessVercelOutput, "postProcessVercelOutput");
10447
- async function copyFarmDocsContentForVercel(config, root, nitroFuncDir, fs3) {
10722
+ async function copyFarmDocsContentForVercel(config, root, nitroFuncDir, fs4) {
10448
10723
  const docsContentDir = resolveBuildDocsContentDir(config, root);
10449
10724
  if (!docsContentDir) return;
10450
10725
  const bundledContentDir = _path2.default.join(nitroFuncDir, "farm-docs-content");
10451
- const lastModifiedManifest = _chunkPGZDEPTMcjs.createFarmDocsLastModifiedManifest.call(void 0, docsContentDir, {
10726
+ const lastModifiedManifest = _chunk5XS5NCVMcjs.createFarmDocsLastModifiedManifest.call(void 0, docsContentDir, {
10452
10727
  fallback: "now"
10453
10728
  });
10454
- await fs3.rm(bundledContentDir, { recursive: true, force: true });
10455
- await fs3.mkdir(_path2.default.dirname(bundledContentDir), { recursive: true });
10456
- await fs3.cp(docsContentDir, bundledContentDir, {
10729
+ await fs4.rm(bundledContentDir, { recursive: true, force: true });
10730
+ await fs4.mkdir(_path2.default.dirname(bundledContentDir), { recursive: true });
10731
+ await fs4.cp(docsContentDir, bundledContentDir, {
10457
10732
  recursive: true,
10458
10733
  force: true
10459
10734
  });
10460
- await fs3.writeFile(
10461
- _path2.default.join(bundledContentDir, _chunkPGZDEPTMcjs.FARM_DOCS_LAST_MODIFIED_MANIFEST),
10735
+ await fs4.writeFile(
10736
+ _path2.default.join(bundledContentDir, _chunk5XS5NCVMcjs.FARM_DOCS_LAST_MODIFIED_MANIFEST),
10462
10737
  `${JSON.stringify(lastModifiedManifest, null, 2)}
10463
10738
  `
10464
10739
  );
@@ -10481,21 +10756,21 @@ function platformFieldAllows(field, value) {
10481
10756
  return allowed.length === 0 || allowed.includes(value);
10482
10757
  }
10483
10758
  _chunkS3JO3N4Hcjs.__name.call(void 0, platformFieldAllows, "platformFieldAllows");
10484
- async function stageSharpRuntime(config, root, distDir, fs3, preset) {
10759
+ async function stageSharpRuntime(config, root, distDir, fs4, preset) {
10485
10760
  const functionPlatform = resolveServerFunctionPlatform(preset);
10486
10761
  const projectRequire = _module.createRequire.call(void 0, _path2.default.join(root, "package.json"));
10487
10762
  let sharpRequire = projectRequire;
10488
10763
  if (!resolvePackageJson(projectRequire, "sharp")) {
10489
10764
  try {
10490
10765
  sharpRequire = _module.createRequire.call(void 0, projectRequire.resolve("@farm.js/core"));
10491
- } catch (e27) {
10766
+ } catch (e30) {
10492
10767
  }
10493
10768
  }
10494
10769
  const copiedPackages = /* @__PURE__ */ new Map();
10495
10770
  const packageCopies = /* @__PURE__ */ new Map();
10496
10771
  const stageRoot = _path2.default.join(root, distDir, "tmp");
10497
- await fs3.mkdir(stageRoot, { recursive: true });
10498
- const stageDir = await fs3.mkdtemp(_path2.default.join(stageRoot, "sharp-runtime-"));
10772
+ await fs4.mkdir(stageRoot, { recursive: true });
10773
+ const stageDir = await fs4.mkdtemp(_path2.default.join(stageRoot, "sharp-runtime-"));
10499
10774
  const targetNodeModules = _path2.default.join(stageDir, "node_modules");
10500
10775
  function copyPackage(packageName, parentRequire) {
10501
10776
  const activeCopy = packageCopies.get(packageName);
@@ -10508,19 +10783,19 @@ async function stageSharpRuntime(config, root, distDir, fs3, preset) {
10508
10783
  async function copyPackageOnce(packageName, parentRequire) {
10509
10784
  const packageJsonPath = resolvePackageJson(parentRequire, packageName);
10510
10785
  if (!packageJsonPath) return;
10511
- const packageJson = JSON.parse(await fs3.readFile(packageJsonPath, "utf8"));
10786
+ const packageJson = JSON.parse(await fs4.readFile(packageJsonPath, "utf8"));
10512
10787
  if (functionPlatform && !packageSupportsPlatform(packageJson, functionPlatform)) return;
10513
10788
  const packageDir = _path2.default.dirname(packageJsonPath);
10514
10789
  const targetDir = _path2.default.join(targetNodeModules, ...packageName.split("/"));
10515
10790
  copiedPackages.set(packageName, String(packageJson.version || "*"));
10516
- await fs3.mkdir(_path2.default.dirname(targetDir), { recursive: true });
10791
+ await fs4.mkdir(_path2.default.dirname(targetDir), { recursive: true });
10517
10792
  const packageRequire = _module.createRequire.call(void 0, packageJsonPath);
10518
10793
  const dependencies = {
10519
10794
  ...packageJson.dependencies,
10520
10795
  ...packageJson.optionalDependencies
10521
10796
  };
10522
10797
  await settleAllOrThrow([
10523
- fs3.cp(packageDir, targetDir, {
10798
+ fs4.cp(packageDir, targetDir, {
10524
10799
  recursive: true,
10525
10800
  force: true,
10526
10801
  dereference: true,
@@ -10535,10 +10810,10 @@ async function stageSharpRuntime(config, root, distDir, fs3, preset) {
10535
10810
  try {
10536
10811
  await copyPackage("sharp", sharpRequire);
10537
10812
  if (!copiedPackages.has("sharp")) {
10538
- throw new Error(`Farm image optimization requires sharp. ${_chunkAS2VPMEEcjs.SHARP_INSTALL_HINT}`);
10813
+ throw new Error(`Farm image optimization requires sharp. ${_chunkEGCT3AHFcjs.SHARP_INSTALL_HINT}`);
10539
10814
  }
10540
10815
  } catch (error) {
10541
- await fs3.rm(stageDir, { recursive: true, force: true });
10816
+ await fs4.rm(stageDir, { recursive: true, force: true });
10542
10817
  throw error;
10543
10818
  }
10544
10819
  return {
@@ -10549,19 +10824,19 @@ async function stageSharpRuntime(config, root, distDir, fs3, preset) {
10549
10824
  };
10550
10825
  }
10551
10826
  _chunkS3JO3N4Hcjs.__name.call(void 0, stageSharpRuntime, "stageSharpRuntime");
10552
- async function installStagedSharpRuntime(staged, nitroFuncDir, fs3) {
10827
+ async function installStagedSharpRuntime(staged, nitroFuncDir, fs4) {
10553
10828
  const stagedNodeModules = _path2.default.join(staged.stageDir, "node_modules");
10554
10829
  const targetNodeModules = _path2.default.join(nitroFuncDir, "node_modules");
10555
10830
  try {
10556
- await mergeStagedDirectory(stagedNodeModules, targetNodeModules, fs3);
10557
- const functionPackage = await readNitroOutputPackage(nitroFuncDir, fs3);
10831
+ await mergeStagedDirectory(stagedNodeModules, targetNodeModules, fs4);
10832
+ const functionPackage = await readNitroOutputPackage(nitroFuncDir, fs4);
10558
10833
  functionPackage.dependencies = {
10559
10834
  ...functionPackage.dependencies,
10560
10835
  ...staged.dependencies
10561
10836
  };
10562
- await writeNitroOutputPackage(nitroFuncDir, functionPackage, fs3);
10837
+ await writeNitroOutputPackage(nitroFuncDir, functionPackage, fs4);
10563
10838
  } finally {
10564
- await fs3.rm(staged.stageDir, { recursive: true, force: true });
10839
+ await fs4.rm(staged.stageDir, { recursive: true, force: true });
10565
10840
  }
10566
10841
  _chunk5QIKR7RRcjs.logger.info(
10567
10842
  `\u{1F5BC}\uFE0F Bundled Sharp image runtime (${Object.keys(staged.dependencies).length} packages)`
@@ -10576,15 +10851,15 @@ async function settleAllOrThrow(operations) {
10576
10851
  if (failure) throw failure.reason;
10577
10852
  }
10578
10853
  _chunkS3JO3N4Hcjs.__name.call(void 0, settleAllOrThrow, "settleAllOrThrow");
10579
- async function mergeStagedDirectory(sourceDir, targetDir, fs3) {
10580
- await fs3.mkdir(targetDir, { recursive: true });
10581
- const entries = await fs3.readdir(sourceDir, { withFileTypes: true });
10854
+ async function mergeStagedDirectory(sourceDir, targetDir, fs4) {
10855
+ await fs4.mkdir(targetDir, { recursive: true });
10856
+ const entries = await fs4.readdir(sourceDir, { withFileTypes: true });
10582
10857
  await settleAllOrThrow(
10583
10858
  entries.map(async (entry) => {
10584
10859
  const sourcePath = _path2.default.join(sourceDir, entry.name);
10585
10860
  const targetPath = _path2.default.join(targetDir, entry.name);
10586
10861
  try {
10587
- await fs3.rename(sourcePath, targetPath);
10862
+ await fs4.rename(sourcePath, targetPath);
10588
10863
  return;
10589
10864
  } catch (error) {
10590
10865
  const code = error.code;
@@ -10593,16 +10868,16 @@ async function mergeStagedDirectory(sourceDir, targetDir, fs3) {
10593
10868
  }
10594
10869
  }
10595
10870
  if (entry.isDirectory()) {
10596
- await mergeStagedDirectory(sourcePath, targetPath, fs3);
10597
- await fs3.rm(sourcePath, { recursive: true, force: true });
10871
+ await mergeStagedDirectory(sourcePath, targetPath, fs4);
10872
+ await fs4.rm(sourcePath, { recursive: true, force: true });
10598
10873
  return;
10599
10874
  }
10600
- await fs3.cp(sourcePath, targetPath, {
10875
+ await fs4.cp(sourcePath, targetPath, {
10601
10876
  force: true,
10602
10877
  dereference: true,
10603
10878
  mode: _fs.constants.COPYFILE_FICLONE
10604
10879
  });
10605
- await fs3.rm(sourcePath, { force: true });
10880
+ await fs4.rm(sourcePath, { force: true });
10606
10881
  })
10607
10882
  );
10608
10883
  }
@@ -10622,44 +10897,44 @@ function resolveMetadataImageRuntimePackageJson(root) {
10622
10897
  if (packageJsonPath) return packageJsonPath;
10623
10898
  try {
10624
10899
  return resolvePackageJson(_module.createRequire.call(void 0, projectRequire.resolve("@farm.js/core")), "@vercel/og");
10625
- } catch (e28) {
10900
+ } catch (e31) {
10626
10901
  return null;
10627
10902
  }
10628
10903
  }
10629
10904
  _chunkS3JO3N4Hcjs.__name.call(void 0, resolveMetadataImageRuntimePackageJson, "resolveMetadataImageRuntimePackageJson");
10630
- async function copyMetadataImageRuntime(root, nitroFuncDir, fs3) {
10905
+ async function copyMetadataImageRuntime(root, nitroFuncDir, fs4) {
10631
10906
  const packageJsonPath = resolveMetadataImageRuntimePackageJson(root);
10632
10907
  if (!packageJsonPath) return;
10633
- const packageJson = JSON.parse(await fs3.readFile(packageJsonPath, "utf8"));
10908
+ const packageJson = JSON.parse(await fs4.readFile(packageJsonPath, "utf8"));
10634
10909
  const packageDir = _path2.default.dirname(packageJsonPath);
10635
10910
  const targetDir = _path2.default.join(nitroFuncDir, "node_modules", "@vercel", "og");
10636
- await fs3.mkdir(_path2.default.dirname(targetDir), { recursive: true });
10637
- await fs3.cp(packageDir, targetDir, {
10911
+ await fs4.mkdir(_path2.default.dirname(targetDir), { recursive: true });
10912
+ await fs4.cp(packageDir, targetDir, {
10638
10913
  recursive: true,
10639
10914
  force: true,
10640
10915
  dereference: true,
10641
10916
  mode: _fs.constants.COPYFILE_FICLONE
10642
10917
  });
10643
- const functionPackage = await readNitroOutputPackage(nitroFuncDir, fs3);
10918
+ const functionPackage = await readNitroOutputPackage(nitroFuncDir, fs4);
10644
10919
  functionPackage.dependencies = {
10645
10920
  ...functionPackage.dependencies,
10646
10921
  "@vercel/og": String(packageJson.version || "0.11.1")
10647
10922
  };
10648
- await writeNitroOutputPackage(nitroFuncDir, functionPackage, fs3);
10923
+ await writeNitroOutputPackage(nitroFuncDir, functionPackage, fs4);
10649
10924
  _chunk5QIKR7RRcjs.logger.info("\u{1F5BC}\uFE0F Bundled generated metadata image runtime");
10650
10925
  }
10651
10926
  _chunkS3JO3N4Hcjs.__name.call(void 0, copyMetadataImageRuntime, "copyMetadataImageRuntime");
10652
- async function readNitroOutputPackage(outputDir, fs3) {
10927
+ async function readNitroOutputPackage(outputDir, fs4) {
10653
10928
  const packagePath = _path2.default.join(outputDir, "package.json");
10654
- return fs3.readFile(packagePath, "utf8").then((contents) => JSON.parse(contents)).catch((error) => {
10929
+ return fs4.readFile(packagePath, "utf8").then((contents) => JSON.parse(contents)).catch((error) => {
10655
10930
  if (error.code === "ENOENT") return {};
10656
10931
  throw error;
10657
10932
  });
10658
10933
  }
10659
10934
  _chunkS3JO3N4Hcjs.__name.call(void 0, readNitroOutputPackage, "readNitroOutputPackage");
10660
- async function writeNitroOutputPackage(outputDir, packageJson, fs3) {
10661
- await fs3.mkdir(outputDir, { recursive: true });
10662
- await fs3.writeFile(
10935
+ async function writeNitroOutputPackage(outputDir, packageJson, fs4) {
10936
+ await fs4.mkdir(outputDir, { recursive: true });
10937
+ await fs4.writeFile(
10663
10938
  _path2.default.join(outputDir, "package.json"),
10664
10939
  `${JSON.stringify(packageJson, null, 2)}
10665
10940
  `
@@ -10673,7 +10948,7 @@ function resolvePackageJson(parentRequire, packageName) {
10673
10948
  const resolved = parentRequire.resolve(request);
10674
10949
  if (resolved.endsWith(".json")) return resolved;
10675
10950
  _nullishCoalesce(metadataModule, () => ( (metadataModule = resolved)));
10676
- } catch (e29) {
10951
+ } catch (e32) {
10677
10952
  }
10678
10953
  }
10679
10954
  try {
@@ -10684,55 +10959,55 @@ function resolvePackageJson(parentRequire, packageName) {
10684
10959
  try {
10685
10960
  const manifest = JSON.parse(_fs.readFileSync.call(void 0, candidate, "utf8"));
10686
10961
  if (manifest.name === packageName) return candidate;
10687
- } catch (e30) {
10962
+ } catch (e33) {
10688
10963
  }
10689
10964
  }
10690
10965
  if (_path2.default.basename(directory) === "node_modules") break;
10691
10966
  directory = _path2.default.dirname(directory);
10692
10967
  }
10693
- } catch (e31) {
10968
+ } catch (e34) {
10694
10969
  }
10695
10970
  return null;
10696
10971
  }
10697
10972
  _chunkS3JO3N4Hcjs.__name.call(void 0, resolvePackageJson, "resolvePackageJson");
10698
- async function copyPrismaClientForVercel(root, nitroFuncDir, fs3) {
10973
+ async function copyPrismaClientForVercel(root, nitroFuncDir, fs4) {
10699
10974
  const projectRequire = _module.createRequire.call(void 0, _path2.default.join(root, "package.json"));
10700
10975
  let prismaClientDir;
10701
10976
  try {
10702
10977
  prismaClientDir = _path2.default.dirname(projectRequire.resolve("@prisma/client/default.js"));
10703
- } catch (e32) {
10978
+ } catch (e35) {
10704
10979
  return;
10705
10980
  }
10706
10981
  const generatedClientDir = _path2.default.join(prismaClientDir, "..", "..", ".prisma", "client");
10707
10982
  try {
10708
- await fs3.access(generatedClientDir);
10709
- } catch (e33) {
10983
+ await fs4.access(generatedClientDir);
10984
+ } catch (e36) {
10710
10985
  return;
10711
10986
  }
10712
10987
  const targetNodeModules = _path2.default.join(nitroFuncDir, "node_modules");
10713
10988
  const targetPrismaScopeDir = _path2.default.join(targetNodeModules, "@prisma");
10714
10989
  const targetGeneratedDir = _path2.default.join(targetNodeModules, ".prisma", "client");
10715
10990
  const targetClientDir = _path2.default.join(targetPrismaScopeDir, "client");
10716
- await fs3.mkdir(targetPrismaScopeDir, { recursive: true });
10717
- await fs3.cp(prismaClientDir, targetClientDir, {
10991
+ await fs4.mkdir(targetPrismaScopeDir, { recursive: true });
10992
+ await fs4.cp(prismaClientDir, targetClientDir, {
10718
10993
  recursive: true,
10719
10994
  force: true
10720
10995
  });
10721
- await fs3.cp(generatedClientDir, targetGeneratedDir, {
10996
+ await fs4.cp(generatedClientDir, targetGeneratedDir, {
10722
10997
  recursive: true,
10723
10998
  force: true
10724
10999
  });
10725
11000
  const clientPackagePath = _path2.default.join(prismaClientDir, "package.json");
10726
11001
  const [functionPackage, clientPackageContent] = await Promise.all([
10727
- readNitroOutputPackage(nitroFuncDir, fs3),
10728
- fs3.readFile(clientPackagePath, "utf-8")
11002
+ readNitroOutputPackage(nitroFuncDir, fs4),
11003
+ fs4.readFile(clientPackagePath, "utf-8")
10729
11004
  ]);
10730
11005
  const clientPackage = JSON.parse(clientPackageContent);
10731
11006
  functionPackage.dependencies = {
10732
11007
  ...functionPackage.dependencies,
10733
11008
  "@prisma/client": clientPackage.version
10734
11009
  };
10735
- await writeNitroOutputPackage(nitroFuncDir, functionPackage, fs3);
11010
+ await writeNitroOutputPackage(nitroFuncDir, functionPackage, fs4);
10736
11011
  }
10737
11012
  _chunkS3JO3N4Hcjs.__name.call(void 0, copyPrismaClientForVercel, "copyPrismaClientForVercel");
10738
11013
 
@@ -10762,7 +11037,7 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, createFarmProjectModuleSsrEnvironment, "cr
10762
11037
 
10763
11038
  // src/build/index.ts
10764
11039
  async function build(config, options = {}) {
10765
- return _chunkWW46B6HAcjs.withProductionNodeEnv.call(void 0, () => buildWithProductionNodeEnv(config, options));
11040
+ return _chunkCGR525MJcjs.withProductionNodeEnv.call(void 0, () => buildWithProductionNodeEnv(config, options));
10766
11041
  }
10767
11042
  _chunkS3JO3N4Hcjs.__name.call(void 0, build, "build");
10768
11043
  function createBuildTargetBaseline(config) {
@@ -10773,7 +11048,7 @@ function createBuildTargetBaseline(config) {
10773
11048
  preset,
10774
11049
  distDir,
10775
11050
  outputDir,
10776
- outputWasDerived: outputDir === _chunkHRETEZ2Zcjs.getDefaultDeployOutputDir.call(void 0, config.deploy.target, preset, distDir)
11051
+ outputWasDerived: outputDir === _chunkFLZ4H25Acjs.getDefaultDeployOutputDir.call(void 0, config.deploy.target, preset, distDir)
10777
11052
  };
10778
11053
  }
10779
11054
  _chunkS3JO3N4Hcjs.__name.call(void 0, createBuildTargetBaseline, "createBuildTargetBaseline");
@@ -10783,8 +11058,8 @@ function resolveBuildTargets(config, options, baseline) {
10783
11058
  const distDir = config.distDir || ".farm";
10784
11059
  const outputWasReplaced = config.deploy.outputDir !== baseline.outputDir;
10785
11060
  const shouldRefreshDerivedOutput = baseline.outputWasDerived && !outputWasReplaced && (preset !== baseline.preset || distDir !== baseline.distDir);
10786
- const deployTarget = preset === config.deploy.preset ? config.deploy.target : _chunkHRETEZ2Zcjs.getDeployTargetForPreset.call(void 0, preset);
10787
- const outputDir = shouldRefreshDerivedOutput ? _chunkHRETEZ2Zcjs.getDefaultDeployOutputDir.call(void 0, deployTarget, preset, distDir) : config.deploy.outputDir;
11061
+ const deployTarget = preset === config.deploy.preset ? config.deploy.target : _chunkFLZ4H25Acjs.getDeployTargetForPreset.call(void 0, preset);
11062
+ const outputDir = shouldRefreshDerivedOutput ? _chunkFLZ4H25Acjs.getDefaultDeployOutputDir.call(void 0, deployTarget, preset, distDir) : config.deploy.outputDir;
10788
11063
  return {
10789
11064
  root,
10790
11065
  preset,
@@ -10792,7 +11067,7 @@ function resolveBuildTargets(config, options, baseline) {
10792
11067
  distDir,
10793
11068
  deployTarget,
10794
11069
  outputDir,
10795
- deployOutputDir: _chunkHRETEZ2Zcjs.resolveDeployOutputPath.call(void 0, root, outputDir)
11070
+ deployOutputDir: _chunkFLZ4H25Acjs.resolveDeployOutputPath.call(void 0, root, outputDir)
10796
11071
  };
10797
11072
  }
10798
11073
  _chunkS3JO3N4Hcjs.__name.call(void 0, resolveBuildTargets, "resolveBuildTargets");
@@ -10801,7 +11076,7 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
10801
11076
  const targetBaseline = createBuildTargetBaseline(config);
10802
11077
  let targets;
10803
11078
  const productionViteResultPromise = options.universal === false ? void 0 : Promise.allSettled([Promise.resolve(_nullishCoalesce(options.productionVite, () => ( _chunkA6WIQH5Zcjs.loadFarmProductionVite.call(void 0, ))))]);
10804
- const pluginManager = new (0, _chunkAS2VPMEEcjs.PluginManager)({
11079
+ const pluginManager = new (0, _chunk45QJHGZMcjs.PluginManager)({
10805
11080
  config,
10806
11081
  isDev: false,
10807
11082
  isProd: true
@@ -10830,12 +11105,12 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
10830
11105
  };
10831
11106
  config = {
10832
11107
  ...config,
10833
- images: _chunkAS2VPMEEcjs.resolveFarmImageProviderForRuntime.call(void 0, config.images, {
11108
+ images: _chunkEGCT3AHFcjs.resolveFarmImageProviderForRuntime.call(void 0, config.images, {
10834
11109
  root: targets.root,
10835
11110
  preset: targets.preset
10836
11111
  })
10837
11112
  };
10838
- if (_optionalChain([config, 'access', _208 => _208.docs, 'optionalAccess', _209 => _209.enabled])) await _chunkIK6LVLKCcjs.loadFarmDocsEngine.call(void 0, );
11113
+ if (_optionalChain([config, 'access', _214 => _214.docs, 'optionalAccess', _215 => _215.enabled])) await _chunkIK6LVLKCcjs.loadFarmDocsEngine.call(void 0, );
10839
11114
  pluginManager.updateContext({ config });
10840
11115
  const { root, preset, srcDir, distDir, deployOutputDir } = targets;
10841
11116
  _chunk5QIKR7RRcjs.logger.info(`\u{1F69C} Building Farm.js application with preset: ${preset}...`);
@@ -10849,8 +11124,8 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
10849
11124
  });
10850
11125
  _chunk5QIKR7RRcjs.logger.info("\u{1F50D} Discovering routes and API endpoints...");
10851
11126
  const productionViteResult = productionViteResultPromise ? (await productionViteResultPromise)[0] : void 0;
10852
- if (_optionalChain([productionViteResult, 'optionalAccess', _210 => _210.status]) === "rejected") throw productionViteResult.reason;
10853
- const productionVite = _optionalChain([productionViteResult, 'optionalAccess', _211 => _211.value]);
11127
+ if (_optionalChain([productionViteResult, 'optionalAccess', _216 => _216.status]) === "rejected") throw productionViteResult.reason;
11128
+ const productionVite = _optionalChain([productionViteResult, 'optionalAccess', _217 => _217.value]);
10854
11129
  const createViteServer = productionVite ? productionVite.createServer : (await import("vite")).createServer;
10855
11130
  projectModuleServer = await createProjectModuleServer(
10856
11131
  createViteServer,
@@ -10858,18 +11133,18 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
10858
11133
  root,
10859
11134
  rendererBuild.signal
10860
11135
  );
10861
- const farmApp = _chunkAS2VPMEEcjs.createFarmApp.call(void 0, config, projectModuleServer);
11136
+ const farmApp = _chunkEGCT3AHFcjs.createFarmApp.call(void 0, config, projectModuleServer);
10862
11137
  await farmApp.initialize();
10863
11138
  const routeManager = farmApp.getRouteManager();
10864
11139
  const serverRenderer = farmApp.getServerRenderer();
10865
- const typeArtifacts = _chunk5D2JIPLHcjs.generateFarmTypeArtifacts.call(void 0, {
11140
+ const typeArtifacts = _chunkKK22JPQMcjs.generateFarmTypeArtifacts.call(void 0, {
10866
11141
  root,
10867
11142
  srcDir,
10868
11143
  layers: config.layers,
10869
11144
  plugins: config.plugins,
10870
11145
  extraRoutes: [
10871
- ..._optionalChain([config, 'access', _212 => _212.openapi, 'optionalAccess', _213 => _213.enabled]) && config.openapi.route ? [config.openapi.route] : [],
10872
- ..._chunkPGZDEPTMcjs.getFarmDocsRouteTypeEntries.call(void 0, config.docs)
11146
+ ..._optionalChain([config, 'access', _218 => _218.openapi, 'optionalAccess', _219 => _219.enabled]) && config.openapi.route ? [config.openapi.route] : [],
11147
+ ..._chunk5XS5NCVMcjs.getFarmDocsRouteTypeEntries.call(void 0, config.docs)
10873
11148
  ],
10874
11149
  suppressLintOnLink: config.suppressLintOnLink,
10875
11150
  componentExtensions: config.renderer.componentExtensions,
@@ -10878,7 +11153,7 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
10878
11153
  const message = error instanceof Error ? error.message : String(error);
10879
11154
  _chunk5QIKR7RRcjs.logger.warn(`Route type generation failed (farm.d.ts may be stale): ${message}`);
10880
11155
  });
10881
- const apiRouteManager = new (0, _chunkRWFLWR5Jcjs.APIRouteManager)(
11156
+ const apiRouteManager = new (0, _chunkQJM7A4CRcjs.APIRouteManager)(
10882
11157
  _chunkWBKEZXWEcjs.getFarmAppDirectories.call(void 0, config),
10883
11158
  projectModuleServer,
10884
11159
  {
@@ -10953,7 +11228,7 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
10953
11228
  throw error;
10954
11229
  } finally {
10955
11230
  try {
10956
- await _optionalChain([projectModuleServer, 'optionalAccess', _214 => _214.close, 'call', _215 => _215()]);
11231
+ await _optionalChain([projectModuleServer, 'optionalAccess', _220 => _220.close, 'call', _221 => _221()]);
10957
11232
  } finally {
10958
11233
  rendererBuild.abort();
10959
11234
  }
@@ -10965,7 +11240,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
10965
11240
  ssr: true,
10966
11241
  buildLifetime
10967
11242
  });
10968
- const viteConfig = _chunkAS2VPMEEcjs.mergeFarmViteConfig.call(void 0,
11243
+ const viteConfig = _chunkEGCT3AHFcjs.mergeFarmViteConfig.call(void 0,
10969
11244
  {
10970
11245
  root,
10971
11246
  appType: "custom",
@@ -10977,19 +11252,19 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
10977
11252
  },
10978
11253
  plugins: [
10979
11254
  ...rendererVitePlugins,
10980
- _chunkAS2VPMEEcjs.farmFontImportsPlugin.call(void 0, {
11255
+ _chunkEGCT3AHFcjs.farmFontImportsPlugin.call(void 0, {
10981
11256
  root,
10982
11257
  basePath: config.basePath,
10983
11258
  publicDir: config.publicDir
10984
11259
  }),
10985
- _chunk3SDFA7UFcjs.farmEnvironmentFunctionsPlugin.call(void 0, )
11260
+ _chunkVDRM36QBcjs.farmEnvironmentFunctionsPlugin.call(void 0, )
10986
11261
  ],
10987
11262
  server: {
10988
11263
  middlewareMode: true,
10989
11264
  hmr: false
10990
11265
  },
10991
11266
  resolve: {
10992
- alias: _chunkAS2VPMEEcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
11267
+ alias: _chunkEGCT3AHFcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
10993
11268
  dedupe: [...config.renderer.dedupe || []]
10994
11269
  },
10995
11270
  optimizeDeps: {
@@ -11022,10 +11297,10 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
11022
11297
  noDiscovery: true
11023
11298
  },
11024
11299
  // An app or plugin that brings its own SSR environment keeps it.
11025
- environments: _optionalChain([viteConfig, 'access', _216 => _216.environments, 'optionalAccess', _217 => _217.ssr, 'optionalAccess', _218 => _218.dev, 'optionalAccess', _219 => _219.createEnvironment]) ? viteConfig.environments : {
11300
+ environments: _optionalChain([viteConfig, 'access', _222 => _222.environments, 'optionalAccess', _223 => _223.ssr, 'optionalAccess', _224 => _224.dev, 'optionalAccess', _225 => _225.createEnvironment]) ? viteConfig.environments : {
11026
11301
  ...viteConfig.environments,
11027
11302
  ssr: {
11028
- ..._optionalChain([viteConfig, 'access', _220 => _220.environments, 'optionalAccess', _221 => _221.ssr]),
11303
+ ..._optionalChain([viteConfig, 'access', _226 => _226.environments, 'optionalAccess', _227 => _227.ssr]),
11029
11304
  ...await createFarmProjectModuleSsrEnvironment()
11030
11305
  }
11031
11306
  }
@@ -11034,7 +11309,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
11034
11309
  _chunkS3JO3N4Hcjs.__name.call(void 0, createProjectModuleServer, "createProjectModuleServer");
11035
11310
  async function buildClient2(viteBuild, config, root, srcDir, outputDir) {
11036
11311
  const { farmI18nClientBridgePlugin, farmPlugin, farmServerOnlyEntriesPlugin } = await import("./vite.cjs");
11037
- const { PluginManager: PluginManager2 } = await import("./plugin.cjs");
11312
+ const { PluginManager: PluginManager2 } = await import("./plugin-DBBZ4JI2.cjs");
11038
11313
  const pluginManager = new PluginManager2({
11039
11314
  config,
11040
11315
  isDev: false,
@@ -11054,7 +11329,7 @@ async function buildClient2(viteBuild, config, root, srcDir, outputDir) {
11054
11329
  farmI18nClientBridgePlugin(),
11055
11330
  farmServerOnlyEntriesPlugin(),
11056
11331
  farmPlugin(config, pluginManager),
11057
- _chunk3SDFA7UFcjs.farmEnvironmentFunctionsPlugin.call(void 0, )
11332
+ _chunkVDRM36QBcjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
11058
11333
  ],
11059
11334
  mode: "production"
11060
11335
  });
@@ -11062,7 +11337,7 @@ async function buildClient2(viteBuild, config, root, srcDir, outputDir) {
11062
11337
  _chunkS3JO3N4Hcjs.__name.call(void 0, buildClient2, "buildClient");
11063
11338
  async function buildSSR(viteBuild, config, root, srcDir, outputDir) {
11064
11339
  const { farmI18nClientBridgePlugin, farmPlugin } = await import("./vite.cjs");
11065
- const { PluginManager: PluginManager2 } = await import("./plugin.cjs");
11340
+ const { PluginManager: PluginManager2 } = await import("./plugin-DBBZ4JI2.cjs");
11066
11341
  const pluginManager = new PluginManager2({
11067
11342
  config,
11068
11343
  isDev: false,
@@ -11083,12 +11358,12 @@ async function buildSSR(viteBuild, config, root, srcDir, outputDir) {
11083
11358
  define: {
11084
11359
  __FARM_API_BASE_URL__: JSON.stringify(config.api.baseURL),
11085
11360
  __FARM_ENV__: JSON.stringify(_chunkVEKFLAQMcjs.createBundledEnv.call(void 0, config.env)),
11086
- __FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _222 => _222.env, 'optionalAccess', _223 => _223.public]) || {})
11361
+ __FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _228 => _228.env, 'optionalAccess', _229 => _229.public]) || {})
11087
11362
  },
11088
11363
  plugins: [
11089
11364
  farmI18nClientBridgePlugin(),
11090
11365
  farmPlugin(config, pluginManager),
11091
- _chunk3SDFA7UFcjs.farmEnvironmentFunctionsPlugin.call(void 0, )
11366
+ _chunkVDRM36QBcjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
11092
11367
  ],
11093
11368
  mode: "production"
11094
11369
  });
@@ -11105,7 +11380,7 @@ function resolveLegacyPageEntry(config, root, srcDir) {
11105
11380
  _chunkS3JO3N4Hcjs.__name.call(void 0, resolveLegacyPageEntry, "resolveLegacyPageEntry");
11106
11381
  async function buildNitro(config, routeManager, apiRouteManager, serverRenderer, preset, root, distDir, pluginManager) {
11107
11382
  const [{ createNitroConfig }, { createNitro, build: nitroBuild }] = await Promise.all([
11108
- import("./nitro-7F65EZZS.cjs"),
11383
+ import("./nitro-S2QABUFA.cjs"),
11109
11384
  import("nitro/builder")
11110
11385
  ]);
11111
11386
  let nitroConfig = await createNitroConfig(
@@ -11118,7 +11393,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
11118
11393
  if (pluginManager) {
11119
11394
  nitroConfig = await pluginManager.runHookSerial("beforeNitroBuild", nitroConfig);
11120
11395
  }
11121
- const outputDir = _chunkHRETEZ2Zcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
11396
+ const outputDir = _chunkFLZ4H25Acjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
11122
11397
  const serverOutputDir = _path2.default.join(outputDir, "server");
11123
11398
  const publicOutputDir = _path2.default.join(outputDir, "public");
11124
11399
  const { mkdir, cp } = await import("fs/promises");
@@ -11132,10 +11407,10 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
11132
11407
  const manifestPath = _path2.default.join(publicOutputDir, "farm-client-manifest.json");
11133
11408
  const assetsDir = _path2.default.join(publicOutputDir, "assets");
11134
11409
  const manifestExists = await import("fs/promises").then(
11135
- (fs3) => fs3.access(manifestPath).then(() => true).catch(() => false)
11410
+ (fs4) => fs4.access(manifestPath).then(() => true).catch(() => false)
11136
11411
  );
11137
11412
  const assetsExist = await import("fs/promises").then(
11138
- (fs3) => fs3.access(assetsDir).then(() => true).catch(() => false)
11413
+ (fs4) => fs4.access(assetsDir).then(() => true).catch(() => false)
11139
11414
  );
11140
11415
  if (manifestExists && assetsExist) {
11141
11416
  _chunk5QIKR7RRcjs.logger.info("\u2705 Verified client assets are present");
@@ -11177,7 +11452,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
11177
11452
  const { readFile } = await import("fs/promises");
11178
11453
  const manifestContent = await readFile(clientManifestPath, "utf-8");
11179
11454
  farmRegistry.clientManifest = JSON.parse(manifestContent);
11180
- } catch (e34) {
11455
+ } catch (e37) {
11181
11456
  farmRegistry.clientManifest = {};
11182
11457
  }
11183
11458
  } catch (error) {
@@ -11189,7 +11464,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
11189
11464
  root,
11190
11465
  preset,
11191
11466
  distDir,
11192
- outputDir: _chunkHRETEZ2Zcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir)
11467
+ outputDir: _chunkFLZ4H25Acjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir)
11193
11468
  });
11194
11469
  }
11195
11470
  }