@farm.js/core 0.1.39 → 0.1.41

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 (374) hide show
  1. package/dist/{agent-mcp-HcTYQmNX.d.ts → agent-mcp-BOqIxJLI.d.mts} +8 -2
  2. package/dist/{agent-mcp-BhneNPb4.d.mts → agent-mcp-D0eZKfci.d.ts} +8 -2
  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 +6 -8
  7. package/dist/agent-runtime.d.ts +6 -8
  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 +8 -10
  15. package/dist/api/route-manager.d.ts +8 -10
  16. package/dist/api/route-manager.mjs +14 -12
  17. package/dist/api/runtime.cjs +12 -10
  18. package/dist/api/runtime.d.mts +7 -9
  19. package/dist/api/runtime.d.ts +7 -9
  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 +10 -12
  25. package/dist/api.d.ts +10 -12
  26. package/dist/api.mjs +16 -14
  27. package/dist/{app-DVzmmbNO.d.mts → app-CzTSMJaf.d.mts} +12 -5
  28. package/dist/{app-CMkoghtp.d.ts → app-DM8e1z3G.d.ts} +12 -5
  29. package/dist/app-markdown.cjs +7 -6
  30. package/dist/app-markdown.d.mts +7 -9
  31. package/dist/app-markdown.d.ts +7 -9
  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-EGCTIS5F.mjs → chunk-24SP5TGU.mjs} +1 -1
  38. package/dist/{chunk-2ZYGC6SS.cjs → chunk-25LPIZSX.cjs} +3 -3
  39. package/dist/{chunk-ARC7I3O2.mjs → chunk-26RUNDIR.mjs} +1 -1
  40. package/dist/{chunk-472NCAZ7.cjs → chunk-2FUIT2G2.cjs} +3 -3
  41. package/dist/{chunk-YFYUYWL7.cjs → chunk-32TZ3QTP.cjs} +723 -454
  42. package/dist/{chunk-CQMVIOYP.mjs → chunk-35WS7P2V.mjs} +29 -131
  43. package/dist/{chunk-QTXBII4Z.cjs → chunk-3TB5QGUW.cjs} +5 -5
  44. package/dist/chunk-45QJHGZM.cjs +1063 -0
  45. package/dist/{chunk-677THUVP.mjs → chunk-4C7KTKX7.mjs} +1 -1
  46. package/dist/{chunk-FUZEBRP3.mjs → chunk-4GP3XZ4Z.mjs} +5 -3
  47. package/dist/{chunk-KTSUBU2E.mjs → chunk-4KQDHTWX.mjs} +2 -2
  48. package/dist/chunk-4TLUFAIP.cjs +92 -0
  49. package/dist/chunk-4U5XZDLG.cjs +80 -0
  50. package/dist/{chunk-P664ZVTV.mjs → chunk-4ZZNPK25.mjs} +2 -2
  51. package/dist/{chunk-KIIMAWOJ.cjs → chunk-5NAVKJCZ.cjs} +35 -105
  52. package/dist/{chunk-LSKZMJMP.cjs → chunk-64SBBZDU.cjs} +38 -1
  53. package/dist/chunk-6BWKJ6QS.cjs +43 -0
  54. package/dist/{chunk-JSROZYYO.cjs → chunk-6D24SDKO.cjs} +1 -20
  55. package/dist/chunk-6IZWX6ES.cjs +74 -0
  56. package/dist/{chunk-QRKIMN7T.mjs → chunk-6LVRDOAW.mjs} +32 -6
  57. package/dist/{chunk-YWN746US.cjs → chunk-6MVFHNYZ.cjs} +85 -54
  58. package/dist/{chunk-VWBHM3F6.mjs → chunk-6PKXK4TY.mjs} +3 -3
  59. package/dist/chunk-6QOLZITB.cjs +22 -0
  60. package/dist/{chunk-OAHTRMIC.mjs → chunk-724JLMS4.mjs} +11 -11
  61. package/dist/chunk-7GNWGLWB.mjs +14 -0
  62. package/dist/{chunk-34UCJRQO.cjs → chunk-7RNAKBWF.cjs} +2 -2
  63. package/dist/{chunk-U6QLDL3G.mjs → chunk-7UEEHAW7.mjs} +1 -1
  64. package/dist/{chunk-UPJLHLJU.cjs → chunk-ALPWLT27.cjs} +4 -4
  65. package/dist/{chunk-ATSDUUFK.mjs → chunk-AX7S67YV.mjs} +33 -40
  66. package/dist/{chunk-MSSFIQGM.mjs → chunk-B2GSRB3P.mjs} +41 -10
  67. package/dist/chunk-BGGWKZ2V.mjs +6096 -0
  68. package/dist/{chunk-H5CLOUZS.cjs → chunk-BMOBTMDR.cjs} +5 -5
  69. package/dist/{chunk-Q2KB32T4.mjs → chunk-BPNRQ5BA.mjs} +6 -6
  70. package/dist/{chunk-E2ROOWQC.cjs → chunk-BPOTSHDO.cjs} +24 -87
  71. package/dist/chunk-BRYPZIMB.mjs +6 -0
  72. package/dist/{chunk-WFRT7JPX.mjs → chunk-BYQVROIP.mjs} +2 -2
  73. package/dist/{chunk-HALDNTIV.mjs → chunk-BYR3RQPB.mjs} +10 -73
  74. package/dist/{chunk-5PWXMJOH.cjs → chunk-C5KVWHIH.cjs} +36 -36
  75. package/dist/chunk-CALY6QG6.mjs +963 -0
  76. package/dist/{chunk-WC5UV2HQ.cjs → chunk-CBXBGM72.cjs} +2 -2
  77. package/dist/{chunk-WW46B6HA.cjs → chunk-CGR525MJ.cjs} +84 -45
  78. package/dist/{chunk-6V4TDWEC.cjs → chunk-CGVPXIRN.cjs} +18 -1
  79. package/dist/chunk-COABSY3U.mjs +196 -0
  80. package/dist/chunk-CZS6OACQ.mjs +63 -0
  81. package/dist/{chunk-SGBJ247Q.cjs → chunk-D4ROBNTK.cjs} +2 -2
  82. package/dist/{chunk-WEW2JVA4.cjs → chunk-D5IHNDHI.cjs} +6 -6
  83. package/dist/{chunk-QG775BRV.cjs → chunk-D64OPY6A.cjs} +72 -54
  84. package/dist/{chunk-QUCXCDE2.cjs → chunk-EH3464KF.cjs} +1 -1
  85. package/dist/{chunk-75HN5IZ3.mjs → chunk-ENOBPDKZ.mjs} +21 -19
  86. package/dist/{chunk-HD5CF3OE.mjs → chunk-ETPEZLS3.mjs} +2 -2
  87. package/dist/{chunk-HRETEZ2Z.cjs → chunk-EX4MKHXN.cjs} +37 -35
  88. package/dist/{chunk-TO4GJ56K.cjs → chunk-FEYQCYT7.cjs} +58 -18
  89. package/dist/chunk-FGH3ZXTP.mjs +1063 -0
  90. package/dist/{chunk-CUM5NYL5.mjs → chunk-FIAPD365.mjs} +1 -1
  91. package/dist/{chunk-HYTZYOW2.mjs → chunk-FJGIVDA5.mjs} +1197 -7906
  92. package/dist/chunk-FVPXT2JR.cjs +63 -0
  93. package/dist/{chunk-MYIZXDZA.mjs → chunk-FWCGUVVL.mjs} +1 -1
  94. package/dist/{chunk-D2ULAULS.cjs → chunk-FXFKIJDA.cjs} +9 -7
  95. package/dist/{chunk-RW63BOV7.cjs → chunk-GB7LDGY5.cjs} +2 -2
  96. package/dist/chunk-GC3EM6H4.mjs +80 -0
  97. package/dist/{chunk-E3UK5IIB.cjs → chunk-GS3WR5HX.cjs} +5 -3
  98. package/dist/{chunk-QFW2IH5E.mjs → chunk-GZTUT75U.mjs} +5 -2
  99. package/dist/chunk-H3EGVQE5.mjs +22 -0
  100. package/dist/chunk-HANGSYMB.mjs +67 -0
  101. package/dist/{chunk-RSOJ7DRT.mjs → chunk-HCSVR4YZ.mjs} +1 -58
  102. package/dist/{chunk-QYMZOOC5.mjs → chunk-HJ64F4GS.mjs} +12 -44
  103. package/dist/{chunk-P3PLW4FR.mjs → chunk-HKFBMHCD.mjs} +4 -4
  104. package/dist/{chunk-BXDJXFQG.cjs → chunk-I5MG3TKE.cjs} +4 -4
  105. package/dist/{chunk-VNGH5MLF.mjs → chunk-I6UVKUYK.mjs} +1 -1
  106. package/dist/{chunk-EPYU2EBL.mjs → chunk-IF4NU2NG.mjs} +1 -1
  107. package/dist/{chunk-WXJLNP33.cjs → chunk-IFWSR7YZ.cjs} +9 -7
  108. package/dist/{chunk-IVLZZZEI.mjs → chunk-IM7DY3ED.mjs} +1 -1
  109. package/dist/{chunk-W36M2BQ4.mjs → chunk-IN6RCKLL.mjs} +6 -5
  110. package/dist/{chunk-F5QO4FNE.mjs → chunk-INQ64HTJ.mjs} +43 -11
  111. package/dist/{chunk-SDOTRX3V.cjs → chunk-JEIG3EWE.cjs} +8 -8
  112. package/dist/{chunk-UWPLULNK.mjs → chunk-JGHCKIRI.mjs} +84 -24
  113. package/dist/{chunk-BFJTHYTN.mjs → chunk-JIYYX7WU.mjs} +10 -8
  114. package/dist/{chunk-CIOT4HGT.cjs → chunk-JOTUZIM4.cjs} +14 -14
  115. package/dist/{chunk-SKVTP5PR.mjs → chunk-JOW4HDJO.mjs} +1 -62
  116. package/dist/{chunk-6MVFL3R5.cjs → chunk-JR4QCLJY.cjs} +1 -58
  117. package/dist/{chunk-CGBDNNSM.cjs → chunk-KEXK442I.cjs} +44 -12
  118. package/dist/{chunk-FUCSUGDM.cjs → chunk-KF6VDJH7.cjs} +3 -3
  119. package/dist/{chunk-EA5K5BKU.mjs → chunk-KNHBTJP6.mjs} +18 -1
  120. package/dist/{chunk-MVL2RAJW.mjs → chunk-KYN5ODF6.mjs} +1 -1
  121. package/dist/{chunk-LMPAPBUA.cjs → chunk-L6A26QT5.cjs} +36 -68
  122. package/dist/{chunk-RVXFINNS.cjs → chunk-L6HYACBE.cjs} +31 -31
  123. package/dist/chunk-LFHCG2DU.mjs +43 -0
  124. package/dist/{chunk-5OKBARDN.cjs → chunk-LIZTLA5F.cjs} +12 -11
  125. package/dist/{chunk-HXRYZWTA.mjs → chunk-LLUA2LSC.mjs} +3 -3
  126. package/dist/{chunk-B5J2YVG7.cjs → chunk-LYIZHJTK.cjs} +2 -2
  127. package/dist/{chunk-3UEVPCGW.mjs → chunk-MEASUNVY.mjs} +6 -1
  128. package/dist/{chunk-FZ6YYU2W.mjs → chunk-MGMF4VP7.mjs} +38 -1
  129. package/dist/{chunk-CNNOLE4O.mjs → chunk-MHHCLYXU.mjs} +1 -1
  130. package/dist/{chunk-HRSAQ23K.cjs → chunk-MHN4UR5U.cjs} +4 -4
  131. package/dist/{chunk-3LOLJTFV.cjs → chunk-MN4TQJ3W.cjs} +11 -11
  132. package/dist/{chunk-PGZDEPTM.cjs → chunk-MY5PZYAD.cjs} +10 -10
  133. package/dist/{chunk-ZXH4TS3F.cjs → chunk-NBPNUQYO.cjs} +3 -64
  134. package/dist/{chunk-VXEEATVD.cjs → chunk-NFG4PUPI.cjs} +2 -2
  135. package/dist/{chunk-INL3THCU.mjs → chunk-O7USYJ4U.mjs} +1 -1
  136. package/dist/{chunk-4ZFL5GFN.cjs → chunk-OILHPMFX.cjs} +86 -26
  137. package/dist/{chunk-AJQTP4OO.mjs → chunk-OJ7JP7RJ.mjs} +1 -1
  138. package/dist/chunk-OQ4YXWH4.cjs +6097 -0
  139. package/dist/{chunk-DMEPTZTI.mjs → chunk-P2UJF4SS.mjs} +47 -7
  140. package/dist/{chunk-T5OJPTVN.cjs → chunk-P4TYB4SF.cjs} +2 -2
  141. package/dist/chunk-P7XDC7UJ.mjs +92 -0
  142. package/dist/{chunk-SHLXACIO.cjs → chunk-PJ42JESY.cjs} +1 -9
  143. package/dist/{chunk-5ULKUBIA.cjs → chunk-PN676AZF.cjs} +6 -6
  144. package/dist/{chunk-YKZRDB5Z.mjs → chunk-PYHPXPSW.mjs} +2 -2
  145. package/dist/{chunk-KMTGADN3.mjs → chunk-QCVIRVHE.mjs} +1 -9
  146. package/dist/{chunk-5D2JIPLH.cjs → chunk-QEILRWVV.cjs} +36 -138
  147. package/dist/{chunk-XKG2BLFN.cjs → chunk-QIBP5EFA.cjs} +18 -35
  148. package/dist/{chunk-ZUPXLIGB.mjs → chunk-R65GCA6A.mjs} +647 -378
  149. package/dist/{chunk-BWIQR4DH.cjs → chunk-RHGK2JEN.cjs} +56 -63
  150. package/dist/{chunk-AS2VPMEE.cjs → chunk-ROQ4C4LJ.cjs} +1465 -8174
  151. package/dist/{chunk-QV4VE2OW.mjs → chunk-S6ENKNNG.mjs} +5 -3
  152. package/dist/{chunk-RWFLWR5J.cjs → chunk-S7MTDRYA.cjs} +17 -15
  153. package/dist/{chunk-PVZE2JGJ.mjs → chunk-SGB4IW7K.mjs} +43 -25
  154. package/dist/{chunk-GKBWWRBG.mjs → chunk-SVPGWJZF.mjs} +12 -12
  155. package/dist/{chunk-EKN7NSZO.cjs → chunk-SZLNU3GJ.cjs} +8 -5
  156. package/dist/chunk-TI7UANHI.cjs +77 -0
  157. package/dist/{chunk-6BK3K2GB.mjs → chunk-UIDWEU7M.mjs} +83 -44
  158. package/dist/{chunk-MLY2RP5R.mjs → chunk-ULQOP5UI.mjs} +6 -2
  159. package/dist/chunk-UNJZGVPU.cjs +6 -0
  160. package/dist/{chunk-5BWWFHR2.mjs → chunk-UQUEANTY.mjs} +3 -3
  161. package/dist/chunk-VDRM36QB.cjs +963 -0
  162. package/dist/chunk-VHRS3MCW.cjs +196 -0
  163. package/dist/{chunk-SOP2EAA6.mjs → chunk-VLPII2JJ.mjs} +1 -1
  164. package/dist/{chunk-RG4A6LB2.cjs → chunk-VNPXKF3G.cjs} +7 -7
  165. package/dist/chunk-VQDBNVOO.cjs +14 -0
  166. package/dist/chunk-VQGKD7RV.mjs +25 -0
  167. package/dist/{chunk-6HB6V3R7.mjs → chunk-VTBXE6QG.mjs} +10 -27
  168. package/dist/{chunk-ZMSZZXOR.mjs → chunk-WDMIW6Q6.mjs} +0 -19
  169. package/dist/{chunk-NBBEQLOK.cjs → chunk-WLHA5USH.cjs} +9 -9
  170. package/dist/{chunk-BZHXGVMA.mjs → chunk-WMBRZI5V.mjs} +5 -3
  171. package/dist/{chunk-4WVJLURN.mjs → chunk-WMHG64DA.mjs} +1 -1
  172. package/dist/{chunk-JCYYXBAJ.cjs → chunk-WROEFVNO.cjs} +3 -3
  173. package/dist/{chunk-A657YSP4.cjs → chunk-WSOBCAYO.cjs} +37 -35
  174. package/dist/{chunk-IWZKTWHZ.cjs → chunk-WU7ZS3EM.cjs} +7 -2
  175. package/dist/{chunk-J63ZH5OQ.cjs → chunk-X3GMHKO3.cjs} +2 -2
  176. package/dist/{chunk-POSPE3IO.mjs → chunk-X3NGFVRF.mjs} +61 -21
  177. package/dist/{chunk-VT4WFRHA.mjs → chunk-XUC6CFLE.mjs} +1 -1
  178. package/dist/chunk-Y5RG6B7S.mjs +77 -0
  179. package/dist/{chunk-EIPC3FDA.cjs → chunk-YWCYV7QC.cjs} +9 -5
  180. package/dist/{chunk-WLL43JMO.mjs → chunk-YYQVGKO5.mjs} +7 -5
  181. package/dist/chunk-YZAKIXRL.cjs +67 -0
  182. package/dist/chunk-ZQRCSUSB.cjs +25 -0
  183. package/dist/{chunk-6XWDE2P2.cjs → chunk-ZTP3BJG6.cjs} +64 -24
  184. package/dist/{chunk-ZMMBIVQM.mjs → chunk-ZZGQD7A4.mjs} +16 -86
  185. package/dist/{client-plugins-CsCuCLBz.d.mts → client-plugins-CkYwvDJ0.d.mts} +2545 -2665
  186. package/dist/{client-plugins-D0ke-Hc8.d.ts → client-plugins-DfeKd0sD.d.ts} +2545 -2665
  187. package/dist/client-plugins.d.mts +6 -8
  188. package/dist/client-plugins.d.ts +6 -8
  189. package/dist/client.cjs +5 -5
  190. package/dist/client.d.mts +12 -13
  191. package/dist/client.d.ts +12 -13
  192. package/dist/client.mjs +4 -4
  193. package/dist/client.react-server.mjs +2 -0
  194. package/dist/config.d.mts +6 -8
  195. package/dist/config.d.ts +6 -8
  196. package/dist/{devtools-LW4QQ5J3.cjs → devtools-2YHAJYH6.cjs} +21 -18
  197. package/dist/{devtools-5AFIPVUJ.mjs → devtools-N3QLRIQU.mjs} +20 -17
  198. package/dist/docs.cjs +23 -20
  199. package/dist/docs.d.mts +7 -9
  200. package/dist/docs.d.ts +7 -9
  201. package/dist/docs.mjs +22 -19
  202. package/dist/{endpoint-CA-TNX60.d.ts → endpoint-BOE0IAaG.d.ts} +6 -3
  203. package/dist/{endpoint-CCHFqyTE.d.mts → endpoint-DGZRZHux.d.mts} +6 -3
  204. package/dist/environment/vite.cjs +6 -2
  205. package/dist/environment/vite.d.mts +11 -2
  206. package/dist/environment/vite.d.ts +11 -2
  207. package/dist/environment/vite.mjs +5 -1
  208. package/dist/headers.cjs +4 -4
  209. package/dist/headers.mjs +3 -3
  210. package/dist/image/server.cjs +7 -3
  211. package/dist/image/server.d.mts +10 -2
  212. package/dist/image/server.d.ts +10 -2
  213. package/dist/image/server.mjs +6 -2
  214. package/dist/image/sharp.cjs +12 -10
  215. package/dist/image/sharp.d.mts +1 -1
  216. package/dist/image/sharp.d.ts +1 -1
  217. package/dist/image/sharp.mjs +4 -2
  218. package/dist/{image-config-Duob7wER.d.ts → image-config-BpH1q5R8.d.mts} +4 -1
  219. package/dist/{image-config-Duob7wER.d.mts → image-config-BpH1q5R8.d.ts} +4 -1
  220. package/dist/image.d.mts +1 -1
  221. package/dist/image.d.ts +1 -1
  222. package/dist/index.cjs +90 -68
  223. package/dist/index.d.mts +28 -145
  224. package/dist/index.d.ts +28 -145
  225. package/dist/index.mjs +103 -81
  226. package/dist/{integration-api-BPJo5oXb.d.ts → integration-api-BuPHMeKz.d.ts} +2 -2
  227. package/dist/{integration-api-0y4FXJpC.d.mts → integration-api-DWyMmvrR.d.mts} +2 -2
  228. package/dist/integration-orm-P2II2EBK.cjs +14 -0
  229. package/dist/{integration-orm-KV5B3BGZ.mjs → integration-orm-RBKCIQYZ.mjs} +4 -3
  230. package/dist/integrations.cjs +7 -5
  231. package/dist/integrations.d.mts +8 -10
  232. package/dist/integrations.d.ts +8 -10
  233. package/dist/integrations.mjs +6 -4
  234. package/dist/internal/app-markdown-runtime.cjs +6 -5
  235. package/dist/internal/app-markdown-runtime.d.mts +7 -9
  236. package/dist/internal/app-markdown-runtime.d.ts +7 -9
  237. package/dist/internal/app-markdown-runtime.mjs +5 -4
  238. package/dist/internal/build-runtime.cjs +57 -56
  239. package/dist/internal/build-runtime.d.mts +8 -10
  240. package/dist/internal/build-runtime.d.ts +8 -10
  241. package/dist/internal/build-runtime.mjs +56 -55
  242. package/dist/internal/cli-runtime.cjs +37 -31
  243. package/dist/internal/cli-runtime.mjs +37 -31
  244. package/dist/internal/client-error-overlay.cjs +4 -4
  245. package/dist/internal/client-error-overlay.mjs +1 -1
  246. package/dist/internal/compression-runtime.d.mts +6 -8
  247. package/dist/internal/compression-runtime.d.ts +6 -8
  248. package/dist/internal/config-runtime.cjs +21 -18
  249. package/dist/internal/config-runtime.d.mts +7 -9
  250. package/dist/internal/config-runtime.d.ts +7 -9
  251. package/dist/internal/config-runtime.mjs +20 -17
  252. package/dist/internal/docs-precompiled-runtime.cjs +3 -3
  253. package/dist/internal/docs-precompiled-runtime.mjs +2 -2
  254. package/dist/internal/infra-analytics-runtime.cjs +7 -7
  255. package/dist/internal/infra-analytics-runtime.mjs +5 -5
  256. package/dist/internal/metadata-image-runtime.cjs +4 -3
  257. package/dist/internal/metadata-image-runtime.mjs +3 -2
  258. package/dist/internal/product-telemetry-runtime.cjs +2 -2
  259. package/dist/internal/product-telemetry-runtime.mjs +1 -1
  260. package/dist/internal/production-node-env.cjs +2 -2
  261. package/dist/internal/production-node-env.mjs +1 -1
  262. package/dist/internal/production-runtime.cjs +53 -28
  263. package/dist/internal/production-runtime.d.mts +46 -15
  264. package/dist/internal/production-runtime.d.ts +46 -15
  265. package/dist/internal/production-runtime.mjs +57 -32
  266. package/dist/layers-CM5i6T7z.d.mts +55 -0
  267. package/dist/layers-CM5i6T7z.d.ts +55 -0
  268. package/dist/markdown.cjs +4 -4
  269. package/dist/markdown.d.mts +6 -8
  270. package/dist/markdown.d.ts +6 -8
  271. package/dist/markdown.mjs +3 -3
  272. package/dist/middleware.cjs +16 -10
  273. package/dist/middleware.d.mts +8 -10
  274. package/dist/middleware.d.ts +8 -10
  275. package/dist/middleware.mjs +19 -13
  276. package/dist/navigation.cjs +4 -4
  277. package/dist/navigation.d.mts +9 -10
  278. package/dist/navigation.d.ts +9 -10
  279. package/dist/navigation.mjs +3 -3
  280. package/dist/{nitro-MPZJGPXK.mjs → nitro-KDACKNHU.mjs} +3 -2
  281. package/dist/{nitro-7F65EZZS.cjs → nitro-NPGU6VBT.cjs} +4 -3
  282. package/dist/observability.cjs +2 -2
  283. package/dist/observability.mjs +1 -1
  284. package/dist/plugin-DBBZ4JI2.cjs +32 -0
  285. package/dist/plugin-SYMK7PQ2.mjs +32 -0
  286. package/dist/plugin.cjs +56 -43
  287. package/dist/plugin.d.mts +25 -8
  288. package/dist/plugin.d.ts +25 -8
  289. package/dist/plugin.mjs +57 -44
  290. package/dist/{production-runtime-DfRP0cV0.d.mts → production-runtime-BTkXQdYy.d.mts} +17 -3
  291. package/dist/{production-runtime-BaI3WHnV.d.ts → production-runtime-DFC7pgbp.d.ts} +17 -3
  292. package/dist/query/client.cjs +2 -2
  293. package/dist/query/client.mjs +3 -3
  294. package/dist/{render-plan-Dg8RBYFa.d.mts → render-plan-5rFeWmk7.d.mts} +1 -1
  295. package/dist/{render-plan-CfIdJKAf.d.ts → render-plan-BoAK9xFC.d.ts} +1 -1
  296. package/dist/renderer-client.d.mts +8 -9
  297. package/dist/renderer-client.d.ts +8 -9
  298. package/dist/{request-DfE02G_A.d.mts → request-BxBWigtl.d.mts} +1 -1
  299. package/dist/{request-CEbHIIl4.d.ts → request-fciwmd3n.d.ts} +1 -1
  300. package/dist/request.cjs +3 -3
  301. package/dist/request.d.mts +7 -9
  302. package/dist/request.d.ts +7 -9
  303. package/dist/request.mjs +2 -2
  304. package/dist/{route-rendering-C4oHbv6C.d.ts → route-rendering-BCM1QzEf.d.mts} +1 -1
  305. package/dist/{route-rendering-BHyOfXjD.d.mts → route-rendering-BLZT0IP0.d.ts} +1 -1
  306. package/dist/{router-uRN_29Em.d.ts → router-CkheNX3-.d.ts} +1 -1
  307. package/dist/{router-DwhA61SB.d.mts → router-DyZJWc1_.d.mts} +1 -1
  308. package/dist/routes.cjs +6 -5
  309. package/dist/routes.d.mts +6 -8
  310. package/dist/routes.d.ts +6 -8
  311. package/dist/routes.mjs +5 -4
  312. package/dist/{runtime-COk03hmx.d.ts → runtime-DfU4sKa5.d.ts} +3 -3
  313. package/dist/{runtime-BEdHhN4C.d.mts → runtime-wexvUN5J.d.mts} +3 -3
  314. package/dist/{schema-dev-notice-Y7MQEFGN.cjs → schema-dev-notice-5JPE67AI.cjs} +6 -4
  315. package/dist/{schema-dev-notice-O67CPXJ6.mjs → schema-dev-notice-WLPZ6WKU.mjs} +4 -2
  316. package/dist/server-action-security.cjs +4 -3
  317. package/dist/server-action-security.mjs +3 -2
  318. package/dist/server-client-bridge-DKWDl5NB.d.mts +7 -0
  319. package/dist/server-client-bridge-DKWDl5NB.d.ts +7 -0
  320. package/dist/server-fn-client.d.mts +3 -3
  321. package/dist/server-fn-client.d.ts +3 -3
  322. package/dist/server-fn.cjs +8 -7
  323. package/dist/server-fn.d.mts +1 -1
  324. package/dist/server-fn.d.ts +1 -1
  325. package/dist/server-fn.mjs +7 -6
  326. package/dist/server-plugins.cjs +5 -5
  327. package/dist/server-plugins.d.mts +7 -9
  328. package/dist/server-plugins.d.ts +7 -9
  329. package/dist/server-plugins.mjs +4 -4
  330. package/dist/server-query-client.d.mts +1 -1
  331. package/dist/server-query-client.d.ts +1 -1
  332. package/dist/server-query.cjs +9 -8
  333. package/dist/server-query.d.mts +1 -1
  334. package/dist/server-query.d.ts +1 -1
  335. package/dist/server-query.mjs +8 -7
  336. package/dist/server.cjs +97 -73
  337. package/dist/server.d.mts +18 -13
  338. package/dist/server.d.ts +18 -13
  339. package/dist/server.mjs +82 -58
  340. package/dist/{spa-router-DrVOBVGg.d.ts → spa-router-CcejECnG.d.ts} +2 -2
  341. package/dist/{spa-router-w4aFOuyn.d.mts → spa-router-DgsMXqfX.d.mts} +2 -2
  342. package/dist/ssg-1FGaFISl.d.ts +184 -0
  343. package/dist/ssg-Bg4bMMhM.d.mts +184 -0
  344. package/dist/storage.cjs +6 -2
  345. package/dist/storage.d.mts +9 -1
  346. package/dist/storage.d.ts +9 -1
  347. package/dist/storage.mjs +5 -1
  348. package/dist/testing.cjs +20 -18
  349. package/dist/testing.d.mts +7 -9
  350. package/dist/testing.d.ts +7 -9
  351. package/dist/testing.mjs +16 -14
  352. package/dist/theme/server.cjs +4 -4
  353. package/dist/theme/server.mjs +3 -3
  354. package/dist/{utils-Dhuqwmd2.d.ts → utils-8wtTYiH4.d.mts} +1 -1
  355. package/dist/{utils-BtYehqeU.d.mts → utils-Dxbh6Hgj.d.ts} +1 -1
  356. package/dist/version.cjs +2 -2
  357. package/dist/version.mjs +1 -1
  358. package/dist/vite.cjs +75 -46
  359. package/dist/vite.d.mts +130 -11
  360. package/dist/vite.d.ts +130 -11
  361. package/dist/vite.mjs +76 -47
  362. package/dist/{workflows-jZ4BcdoZ.d.ts → workflows-IWP1ddBm.d.mts} +5 -2
  363. package/dist/{workflows-jZ4BcdoZ.d.mts → workflows-IWP1ddBm.d.ts} +5 -2
  364. package/dist/workflows.cjs +4 -3
  365. package/dist/workflows.d.mts +1 -1
  366. package/dist/workflows.d.ts +1 -1
  367. package/dist/workflows.mjs +3 -2
  368. package/package.json +3 -1
  369. package/dist/chunk-3SDFA7UF.cjs +0 -701
  370. package/dist/chunk-DAO7JGTS.mjs +0 -73
  371. package/dist/chunk-E5GNDG5F.mjs +0 -701
  372. package/dist/chunk-SYQ3MOWW.cjs +0 -73
  373. package/dist/chunk-ULASELLA.cjs +0 -48
  374. 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 _chunkPN676AZFcjs = require('./chunk-PN676AZF.cjs');
15
15
 
16
16
 
17
17
 
18
18
 
19
- var _chunkCIOT4HGTcjs = require('./chunk-CIOT4HGT.cjs');
20
19
 
20
+ var _chunkJOTUZIM4cjs = require('./chunk-JOTUZIM4.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 _chunkMY5PZYADcjs = require('./chunk-MY5PZYAD.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 _chunkIFWSR7YZcjs = require('./chunk-IFWSR7YZ.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 _chunkEX4MKHXNcjs = require('./chunk-EX4MKHXN.cjs');
48
49
 
49
50
 
50
51
  var _chunkKCMTCM6Icjs = require('./chunk-KCMTCM6I.cjs');
@@ -82,14 +83,17 @@ var _chunk2SJ4RQ6Pcjs = require('./chunk-2SJ4RQ6P.cjs');
82
83
 
83
84
 
84
85
 
86
+ var _chunkROQ4C4LJcjs = require('./chunk-ROQ4C4LJ.cjs');
87
+
88
+
89
+ var _chunk45QJHGZMcjs = require('./chunk-45QJHGZM.cjs');
85
90
 
86
- var _chunkAS2VPMEEcjs = require('./chunk-AS2VPMEE.cjs');
87
91
 
88
92
 
89
93
 
94
+ var _chunkQEILRWVVcjs = require('./chunk-QEILRWVV.cjs');
90
95
 
91
96
 
92
- var _chunk5D2JIPLHcjs = require('./chunk-5D2JIPLH.cjs');
93
97
 
94
98
 
95
99
 
@@ -103,20 +107,21 @@ var _chunk5D2JIPLHcjs = require('./chunk-5D2JIPLH.cjs');
103
107
 
104
108
 
105
109
 
110
+ var _chunkL6HYACBEcjs = require('./chunk-L6HYACBE.cjs');
106
111
 
107
112
 
108
- var _chunkRVXFINNScjs = require('./chunk-RVXFINNS.cjs');
109
113
 
110
114
 
115
+ var _chunkBMOBTMDRcjs = require('./chunk-BMOBTMDR.cjs');
111
116
 
112
117
 
113
- var _chunkH5CLOUZScjs = require('./chunk-H5CLOUZS.cjs');
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 _chunk25LPIZSXcjs = require('./chunk-25LPIZSX.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
+
172
+
166
173
 
174
+ var _chunkJEIG3EWEcjs = require('./chunk-JEIG3EWE.cjs');
167
175
 
168
176
 
169
- var _chunkSDOTRX3Vcjs = require('./chunk-SDOTRX3V.cjs');
177
+ var _chunkOILHPMFXcjs = require('./chunk-OILHPMFX.cjs');
170
178
 
171
179
 
172
180
 
173
181
 
174
- var _chunkBWIQR4DHcjs = require('./chunk-BWIQR4DH.cjs');
182
+ var _chunkRHGK2JENcjs = require('./chunk-RHGK2JEN.cjs');
175
183
 
176
184
 
177
185
 
178
186
 
179
- var _chunkLMPAPBUAcjs = require('./chunk-LMPAPBUA.cjs');
187
+ var _chunk6BWKJ6QScjs = require('./chunk-6BWKJ6QS.cjs');
180
188
 
181
189
 
182
- var _chunkRWFLWR5Jcjs = require('./chunk-RWFLWR5J.cjs');
190
+ var _chunkS7MTDRYAcjs = require('./chunk-S7MTDRYA.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 _chunkEH3464KFcjs = require('./chunk-EH3464KF.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 _chunkZTP3BJG6cjs = require('./chunk-ZTP3BJG6.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 _chunkMY5PZYADcjs.discoverFarmDocsPages.call(void 0, contentDir, docs).map((page) => _chunkMY5PZYADcjs.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 = _chunkMY5PZYADcjs.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 = _chunkMY5PZYADcjs.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 = _chunkJOTUZIM4cjs.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 = _chunkMY5PZYADcjs.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
+ ..._chunkMY5PZYADcjs.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 _chunkQEILRWVVcjs.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(
@@ -1110,13 +1141,26 @@ function resolveNitroRuntimeDependency(root, specifier) {
1110
1141
  }
1111
1142
  _chunkS3JO3N4Hcjs.__name.call(void 0, resolveNitroRuntimeDependency, "resolveNitroRuntimeDependency");
1112
1143
  function resolveNitroInternalRuntimeAliases(root) {
1113
- const runtimeDir = _path2.default.dirname(resolveNitroPackageEntry(root));
1114
- return Object.fromEntries(
1115
- ["app", "error/hooks", "runtime-config", "shutdown", "task"].map((moduleName) => [
1116
- `#nitro/runtime/${moduleName}`,
1117
- _path2.default.join(runtimeDir, "internal", `${moduleName}.mjs`).split(_path2.default.sep).join("/")
1118
- ])
1119
- );
1144
+ const nitroEntry = resolveNitroPackageEntry(root);
1145
+ const runtimeDir = _path2.default.dirname(nitroEntry);
1146
+ const nitroRequire = _module.createRequire.call(void 0, nitroEntry);
1147
+ return {
1148
+ ...Object.fromEntries(
1149
+ ["app", "error/hooks", "runtime-config", "shutdown", "task"].map((moduleName) => [
1150
+ `#nitro/runtime/${moduleName}`,
1151
+ _path2.default.join(runtimeDir, "internal", `${moduleName}.mjs`).split(_path2.default.sep).join("/")
1152
+ ])
1153
+ ),
1154
+ // Farm's generated workflow and cron wrappers live under `.farm/` and
1155
+ // import these. An app that only depends on @farm.js/core (pnpm) cannot
1156
+ // resolve them from there, and an unresolved id ships as a bare import.
1157
+ ...Object.fromEntries(
1158
+ ["nitro/app", "nitro/h3", "nitro/task"].map((specifier) => [
1159
+ specifier,
1160
+ nitroRequire.resolve(specifier).split(_path2.default.sep).join("/")
1161
+ ])
1162
+ )
1163
+ };
1120
1164
  }
1121
1165
  _chunkS3JO3N4Hcjs.__name.call(void 0, resolveNitroInternalRuntimeAliases, "resolveNitroInternalRuntimeAliases");
1122
1166
  function createPrerenderRuntimeResolverPlugin(root, resolveNitroEntry = resolveNitroPackageEntry) {
@@ -1145,13 +1189,44 @@ function createPrerenderRuntimeResolverPlugin(root, resolveNitroEntry = resolveN
1145
1189
  };
1146
1190
  }
1147
1191
  _chunkS3JO3N4Hcjs.__name.call(void 0, createPrerenderRuntimeResolverPlugin, "createPrerenderRuntimeResolverPlugin");
1148
- function resolveNitroPackageEntry(root) {
1192
+ function createFarmStorageModuleRegistration(config) {
1193
+ const modules = _chunkOILHPMFXcjs._collectFarmStorageModules.call(void 0, config.storage);
1194
+ if (modules.length === 0) return "";
1195
+ const root = config.root || process.cwd();
1149
1196
  const projectRequire = _module.createRequire.call(void 0, _path2.default.join(root, "package.json"));
1150
1197
  let runtimeRequire = projectRequire;
1151
1198
  try {
1152
1199
  runtimeRequire = _module.createRequire.call(void 0, projectRequire.resolve("@farm.js/core"));
1153
1200
  } catch (e11) {
1154
1201
  }
1202
+ const loaders = [];
1203
+ for (const specifier of modules) {
1204
+ let resolved;
1205
+ for (const require2 of [runtimeRequire, projectRequire]) {
1206
+ try {
1207
+ resolved = require2.resolve(specifier);
1208
+ break;
1209
+ } catch (e12) {
1210
+ }
1211
+ }
1212
+ if (resolved) {
1213
+ loaders.push(
1214
+ ` ${JSON.stringify(specifier)}: () => import(${toVirtualEntryImportSpecifier(resolved)}),`
1215
+ );
1216
+ }
1217
+ }
1218
+ return loaders.length > 0 ? `_registerFarmStorageModules({
1219
+ ${loaders.join("\n")}
1220
+ });` : "";
1221
+ }
1222
+ _chunkS3JO3N4Hcjs.__name.call(void 0, createFarmStorageModuleRegistration, "createFarmStorageModuleRegistration");
1223
+ function resolveNitroPackageEntry(root) {
1224
+ const projectRequire = _module.createRequire.call(void 0, _path2.default.join(root, "package.json"));
1225
+ let runtimeRequire = projectRequire;
1226
+ try {
1227
+ runtimeRequire = _module.createRequire.call(void 0, projectRequire.resolve("@farm.js/core"));
1228
+ } catch (e13) {
1229
+ }
1155
1230
  return runtimeRequire.resolve("nitro");
1156
1231
  }
1157
1232
  _chunkS3JO3N4Hcjs.__name.call(void 0, resolveNitroPackageEntry, "resolveNitroPackageEntry");
@@ -1207,7 +1282,7 @@ async function canUseRolldownBuilder() {
1207
1282
  try {
1208
1283
  await import("rolldown");
1209
1284
  return true;
1210
- } catch (e12) {
1285
+ } catch (e14) {
1211
1286
  return false;
1212
1287
  }
1213
1288
  }
@@ -1223,7 +1298,7 @@ function hasReactDomEdgeServerBuild(root) {
1223
1298
  try {
1224
1299
  _module.createRequire.call(void 0, _path2.default.join(root, "package.json")).resolve("react-dom/server.edge");
1225
1300
  return true;
1226
- } catch (e13) {
1301
+ } catch (e15) {
1227
1302
  return false;
1228
1303
  }
1229
1304
  }
@@ -1240,18 +1315,6 @@ function shouldUseExternalMetadataImageRuntime(preset, usesImageRuntime) {
1240
1315
  return usesImageRuntime && preset !== "vercel-edge" && !isCloudflareImagePreset(preset);
1241
1316
  }
1242
1317
  _chunkS3JO3N4Hcjs.__name.call(void 0, shouldUseExternalMetadataImageRuntime, "shouldUseExternalMetadataImageRuntime");
1243
- function resolveImageRuntime(config, preset) {
1244
- if (config.images.provider === "none") return "none";
1245
- const cloudflarePreset = isCloudflareImagePreset(preset);
1246
- if (config.images.provider === "node" && cloudflarePreset) {
1247
- throw new Error('images.provider "node" cannot run in a Cloudflare deployment');
1248
- }
1249
- if (config.images.provider === "cloudflare" && !cloudflarePreset) {
1250
- throw new Error('images.provider "cloudflare" requires a Cloudflare deployment preset');
1251
- }
1252
- return config.images.provider === "cloudflare" || config.images.provider === "auto" && cloudflarePreset ? "cloudflare" : "node";
1253
- }
1254
- _chunkS3JO3N4Hcjs.__name.call(void 0, resolveImageRuntime, "resolveImageRuntime");
1255
1318
  function isNitroRollupExternal(id) {
1256
1319
  const normalizedId = id.replace(/\\/g, "/");
1257
1320
  return NODE_BUILTIN_MODULES.has(id) || NITRO_EXTERNAL_MODULES.has(id) || normalizedId.startsWith(".prisma/") || normalizedId.includes("/node_modules/@prisma/client/") || normalizedId.includes("/node_modules/.prisma/client/");
@@ -1271,6 +1334,45 @@ function createReactProductionModePlugin() {
1271
1334
  };
1272
1335
  }
1273
1336
  _chunkS3JO3N4Hcjs.__name.call(void 0, createReactProductionModePlugin, "createReactProductionModePlugin");
1337
+ var FARM_OMITTED_METADATA_IMAGE_RUNTIME_ID = "\0farm-omitted-metadata-image-runtime";
1338
+ function isFarmCoreModule(file) {
1339
+ let dir = _path2.default.dirname(file.split("?", 1)[0]);
1340
+ while (dir !== _path2.default.dirname(dir)) {
1341
+ const manifest = _path2.default.join(dir, "package.json");
1342
+ if (_fs.existsSync.call(void 0, manifest)) {
1343
+ try {
1344
+ return JSON.parse(_fs.readFileSync.call(void 0, manifest, "utf8")).name === "@farm.js/core";
1345
+ } catch (e16) {
1346
+ return false;
1347
+ }
1348
+ }
1349
+ dir = _path2.default.dirname(dir);
1350
+ }
1351
+ return false;
1352
+ }
1353
+ _chunkS3JO3N4Hcjs.__name.call(void 0, isFarmCoreModule, "isFarmCoreModule");
1354
+ function createOmittedMetadataImageRuntimePlugin(externalizeOtherImports) {
1355
+ return {
1356
+ name: "farm-omitted-metadata-image-runtime",
1357
+ resolveId(source, importer) {
1358
+ if (source !== "@vercel/og") return null;
1359
+ const fromCoreRuntime = importer !== void 0 && isFarmCoreModule(importer) && !/^og\.[cm]?[jt]sx?$/.test(_path2.default.basename(importer.split("?", 1)[0]));
1360
+ if (fromCoreRuntime) return FARM_OMITTED_METADATA_IMAGE_RUNTIME_ID;
1361
+ return externalizeOtherImports ? { id: source, external: true } : null;
1362
+ },
1363
+ load(id) {
1364
+ if (id !== FARM_OMITTED_METADATA_IMAGE_RUNTIME_ID) return null;
1365
+ return `
1366
+ export class ImageResponse {
1367
+ constructor() {
1368
+ throw new Error("@vercel/og is not in this server build because the app has no generated metadata image route.");
1369
+ }
1370
+ }
1371
+ `;
1372
+ }
1373
+ };
1374
+ }
1375
+ _chunkS3JO3N4Hcjs.__name.call(void 0, createOmittedMetadataImageRuntimePlugin, "createOmittedMetadataImageRuntimePlugin");
1274
1376
  function createMetadataImageWasmPlugin() {
1275
1377
  return {
1276
1378
  name: "farm-metadata-image-wasm",
@@ -1349,6 +1451,10 @@ function hasFarmServerCacheConfig(cache) {
1349
1451
  return cache.adapter !== void 0 || cache.namespace !== void 0 || cache.maxEntries !== void 0 || cache.lease !== void 0;
1350
1452
  }
1351
1453
  _chunkS3JO3N4Hcjs.__name.call(void 0, hasFarmServerCacheConfig, "hasFarmServerCacheConfig");
1454
+ function hasFarmServerStorageConfig(storage) {
1455
+ return !!storage && typeof storage === "object" && Reflect.ownKeys(storage).length > 0;
1456
+ }
1457
+ _chunkS3JO3N4Hcjs.__name.call(void 0, hasFarmServerStorageConfig, "hasFarmServerStorageConfig");
1352
1458
  function hasFarmRuntimeConfigModule(config, configModulePath) {
1353
1459
  return Boolean(configModulePath || (config.layers || []).some((layer) => layer.configFile));
1354
1460
  }
@@ -1487,14 +1593,14 @@ function hasProjectPostcssConfig(root) {
1487
1593
  try {
1488
1594
  projectRequire.resolve(`./${file}`);
1489
1595
  return true;
1490
- } catch (e14) {
1596
+ } catch (e17) {
1491
1597
  return false;
1492
1598
  }
1493
1599
  });
1494
1600
  }
1495
1601
  _chunkS3JO3N4Hcjs.__name.call(void 0, hasProjectPostcssConfig, "hasProjectPostcssConfig");
1496
1602
  async function findFarmConfigPath(root) {
1497
- const fs3 = await import("fs/promises");
1603
+ const fs4 = await import("fs/promises");
1498
1604
  const candidates = [
1499
1605
  "farm.config.ts",
1500
1606
  "farm.config.mts",
@@ -1508,9 +1614,9 @@ async function findFarmConfigPath(root) {
1508
1614
  for (const candidate of candidates) {
1509
1615
  const resolvedPath = _path2.default.join(root, candidate);
1510
1616
  try {
1511
- await fs3.access(resolvedPath);
1617
+ await fs4.access(resolvedPath);
1512
1618
  return resolvedPath;
1513
- } catch (e15) {
1619
+ } catch (e18) {
1514
1620
  }
1515
1621
  }
1516
1622
  return null;
@@ -1518,7 +1624,7 @@ async function findFarmConfigPath(root) {
1518
1624
  _chunkS3JO3N4Hcjs.__name.call(void 0, findFarmConfigPath, "findFarmConfigPath");
1519
1625
  function hasFarmServerRuntimePlugins(config) {
1520
1626
  return (config.plugins || []).some((plugin) => {
1521
- if (_chunkBWIQR4DHcjs.getFarmIntegrationPluginServerRuntime.call(void 0, plugin) === false) return false;
1627
+ if (_chunkRHGK2JENcjs.getFarmIntegrationPluginServerRuntime.call(void 0, plugin) === false) return false;
1522
1628
  return Boolean(
1523
1629
  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
1630
  );
@@ -1531,19 +1637,19 @@ function hasFarmPluginRoutes(config) {
1531
1637
  _chunkS3JO3N4Hcjs.__name.call(void 0, hasFarmPluginRoutes, "hasFarmPluginRoutes");
1532
1638
  function farmServerRuntimePluginsMayHandlePath(config, pathname) {
1533
1639
  return (config.plugins || []).some(
1534
- (plugin) => _chunkBWIQR4DHcjs.getFarmIntegrationPluginServerRuntime.call(void 0, plugin) !== false && _chunkAS2VPMEEcjs.farmPluginMayAffectRuntimePath.call(void 0, plugin, pathname)
1640
+ (plugin) => _chunkRHGK2JENcjs.getFarmIntegrationPluginServerRuntime.call(void 0, plugin) !== false && _chunkTI7UANHIcjs.farmPluginMayAffectRuntimePath.call(void 0, plugin, pathname)
1535
1641
  );
1536
1642
  }
1537
1643
  _chunkS3JO3N4Hcjs.__name.call(void 0, farmServerRuntimePluginsMayHandlePath, "farmServerRuntimePluginsMayHandlePath");
1538
1644
  async function discoverMiddlewareRoutes(appDir) {
1539
- const fs3 = await import("fs/promises");
1645
+ const fs4 = await import("fs/promises");
1540
1646
  const appDirs = Array.isArray(appDir) ? [...appDir] : [appDir];
1541
1647
  const routes = /* @__PURE__ */ new Map();
1542
1648
  async function walk(dir, routePath, directory, discovered) {
1543
1649
  let entries;
1544
1650
  try {
1545
- entries = await fs3.readdir(dir, { withFileTypes: true });
1546
- } catch (e16) {
1651
+ entries = await fs4.readdir(dir, { withFileTypes: true });
1652
+ } catch (e19) {
1547
1653
  return;
1548
1654
  }
1549
1655
  const middlewareFile = entries.find(
@@ -1562,8 +1668,8 @@ async function discoverMiddlewareRoutes(appDir) {
1562
1668
  }
1563
1669
  await walk(
1564
1670
  _path2.default.join(dir, entry.name),
1565
- _chunkLMPAPBUAcjs.appendMiddlewareRoutePath.call(void 0, routePath, entry.name),
1566
- _chunkLMPAPBUAcjs.appendMiddlewareDirectory.call(void 0, directory, entry.name),
1671
+ _chunk6BWKJ6QScjs.appendMiddlewareRoutePath.call(void 0, routePath, entry.name),
1672
+ _chunk6BWKJ6QScjs.appendMiddlewareDirectory.call(void 0, directory, entry.name),
1567
1673
  discovered
1568
1674
  );
1569
1675
  }
@@ -1576,7 +1682,7 @@ async function discoverMiddlewareRoutes(appDir) {
1576
1682
  routes.set(route.directory, route);
1577
1683
  }
1578
1684
  }
1579
- return Array.from(routes.values()).sort(_chunkLMPAPBUAcjs.compareMiddlewareRouteLocations).map(({ path: routePath, filePath }) => ({ path: routePath, filePath }));
1685
+ return Array.from(routes.values()).sort(_chunk6BWKJ6QScjs.compareMiddlewareRouteLocations).map(({ path: routePath, filePath }) => ({ path: routePath, filePath }));
1580
1686
  }
1581
1687
  _chunkS3JO3N4Hcjs.__name.call(void 0, discoverMiddlewareRoutes, "discoverMiddlewareRoutes");
1582
1688
  function assertFarmDocsRuntimeSupported(config, preset) {
@@ -1594,7 +1700,7 @@ async function buildUniversal(config, routeManager, apiRouteManager, serverRende
1594
1700
  assertFarmDocsRuntimeSupported(config, preset);
1595
1701
  const srcDir = config.srcDir || "src";
1596
1702
  const distDir = config.distDir || ".farm";
1597
- const deployOutputDir = _chunkHRETEZ2Zcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
1703
+ const deployOutputDir = _chunkEX4MKHXNcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
1598
1704
  const lifecyclePluginManager = options.pluginManager;
1599
1705
  const productionViteResultPromise = Promise.allSettled([
1600
1706
  Promise.resolve(_nullishCoalesce(options.productionVite, () => ( _chunkA6WIQH5Zcjs.loadFarmProductionVite.call(void 0, ))))
@@ -1613,7 +1719,7 @@ async function buildUniversal(config, routeManager, apiRouteManager, serverRende
1613
1719
  const routeRuntimeManifestResultPromise = Promise.allSettled([routeRuntimeManifestPromise]);
1614
1720
  const pageRoutes = [];
1615
1721
  for (const [pattern, entry] of routeManager.getRoutes()) {
1616
- const markdownSourcePath = entry.markdownSourcePath || (_chunkEKN7NSZOcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) ? entry.modulePath : void 0);
1722
+ const markdownSourcePath = entry.markdownSourcePath || (_chunkSZLNU3GJcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) ? entry.modulePath : void 0);
1617
1723
  pageRoutes.push({
1618
1724
  pattern,
1619
1725
  ...entry.directory ? { directory: entry.directory } : {},
@@ -1638,12 +1744,12 @@ async function buildUniversal(config, routeManager, apiRouteManager, serverRende
1638
1744
  })
1639
1745
  );
1640
1746
  _chunk5QIKR7RRcjs.logger.info(`\u{1F4CB} Found ${pageRoutes.length} page routes`);
1641
- const fs3 = await import("fs/promises");
1747
+ const fs4 = await import("fs/promises");
1642
1748
  const layoutRoutes = [];
1643
1749
  const appDir = _path2.default.join(root, srcDir, "app");
1644
1750
  async function findLayoutsForClient(dir, routePrefix = "/") {
1645
1751
  try {
1646
- const entries = await fs3.readdir(dir, { withFileTypes: true });
1752
+ const entries = await fs4.readdir(dir, { withFileTypes: true });
1647
1753
  for (const entry of entries) {
1648
1754
  if (entry.isFile() && entry.name.match(/^layout\.(tsx?|jsx?|vue|svelte)$/)) {
1649
1755
  layoutRoutes.push({
@@ -1655,7 +1761,7 @@ async function buildUniversal(config, routeManager, apiRouteManager, serverRende
1655
1761
  await findLayoutsForClient(_path2.default.join(dir, entry.name), childPrefix);
1656
1762
  }
1657
1763
  }
1658
- } catch (e17) {
1764
+ } catch (e20) {
1659
1765
  }
1660
1766
  }
1661
1767
  _chunkS3JO3N4Hcjs.__name.call(void 0, findLayoutsForClient, "findLayoutsForClient");
@@ -1688,7 +1794,8 @@ async function buildUniversal(config, routeManager, apiRouteManager, serverRende
1688
1794
  routeSlots,
1689
1795
  isolatedClientBoundaryModules,
1690
1796
  hydrationPlanCache,
1691
- rendererBuildLifetime
1797
+ rendererBuildLifetime,
1798
+ routeManager.getProgrammaticClientRoutes()
1692
1799
  ), "buildClientBundle");
1693
1800
  const buildSSRBundle = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => buildSSRInMemory(
1694
1801
  productionVite,
@@ -1740,7 +1847,8 @@ async function buildUniversal(config, routeManager, apiRouteManager, serverRende
1740
1847
  routeSlots,
1741
1848
  isolatedClientBoundaryModules,
1742
1849
  hydrationPlanCache,
1743
- rendererBuildLifetime
1850
+ rendererBuildLifetime,
1851
+ routeManager.getProgrammaticClientRoutes()
1744
1852
  );
1745
1853
  } catch (retryError) {
1746
1854
  if (!(retryError instanceof IncompleteClientBuildOutputError)) throw retryError;
@@ -1801,7 +1909,7 @@ async function buildUniversal(config, routeManager, apiRouteManager, serverRende
1801
1909
  }
1802
1910
  _chunkS3JO3N4Hcjs.__name.call(void 0, buildUniversal, "buildUniversal");
1803
1911
  async function writeSSRAssetsToClient(bundle, outputDir) {
1804
- const fs3 = await import("fs/promises");
1912
+ const fs4 = await import("fs/promises");
1805
1913
  for (const [fileName, output] of Object.entries(bundle)) {
1806
1914
  if (output.type !== "asset") continue;
1807
1915
  if (fileName === "farm-fonts.css") {
@@ -1809,42 +1917,42 @@ async function writeSSRAssetsToClient(bundle, outputDir) {
1809
1917
  continue;
1810
1918
  }
1811
1919
  const filePath = _path2.default.join(outputDir, fileName);
1812
- await fs3.mkdir(_path2.default.dirname(filePath), { recursive: true });
1813
- await fs3.writeFile(filePath, output.source);
1920
+ await fs4.mkdir(_path2.default.dirname(filePath), { recursive: true });
1921
+ await fs4.writeFile(filePath, output.source);
1814
1922
  }
1815
1923
  }
1816
1924
  _chunkS3JO3N4Hcjs.__name.call(void 0, writeSSRAssetsToClient, "writeSSRAssetsToClient");
1817
1925
  async function copyFarmDocsFontAssetsToClient(root, outputDir) {
1818
- const fs3 = await import("fs/promises");
1926
+ const fs4 = await import("fs/promises");
1819
1927
  await Promise.all(
1820
1928
  _chunkHREOKQWTcjs.resolveFarmDocsFontAssets.call(void 0, root).map(async ({ sourcePath, url }) => {
1821
1929
  const targetPath = _path2.default.join(outputDir, url.replace(/^\/+/, ""));
1822
- await fs3.mkdir(_path2.default.dirname(targetPath), { recursive: true });
1823
- await fs3.copyFile(sourcePath, targetPath);
1930
+ await fs4.mkdir(_path2.default.dirname(targetPath), { recursive: true });
1931
+ await fs4.copyFile(sourcePath, targetPath);
1824
1932
  })
1825
1933
  );
1826
1934
  }
1827
1935
  _chunkS3JO3N4Hcjs.__name.call(void 0, copyFarmDocsFontAssetsToClient, "copyFarmDocsFontAssetsToClient");
1828
1936
  async function mergeBuiltFontCss(outputDir, fontCssSource) {
1829
- const fs3 = await import("fs/promises");
1937
+ const fs4 = await import("fs/promises");
1830
1938
  const fontCssPath = _path2.default.join(outputDir, "farm-fonts.css");
1831
1939
  let fontCss = fontCssSource;
1832
1940
  if (fontCss === void 0) {
1833
1941
  try {
1834
- fontCss = await fs3.readFile(fontCssPath);
1835
- } catch (e18) {
1942
+ fontCss = await fs4.readFile(fontCssPath);
1943
+ } catch (e21) {
1836
1944
  return;
1837
1945
  }
1838
1946
  }
1839
1947
  const clientCssPath = _path2.default.join(outputDir, "farm-client.css");
1840
1948
  let clientCss = "";
1841
1949
  try {
1842
- clientCss = await fs3.readFile(clientCssPath, "utf8");
1843
- } catch (e19) {
1950
+ clientCss = await fs4.readFile(clientCssPath, "utf8");
1951
+ } catch (e22) {
1844
1952
  }
1845
1953
  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));
1954
+ await fs4.writeFile(fontCssPath, normalizedFontCss);
1955
+ await fs4.writeFile(clientCssPath, _chunkROQ4C4LJcjs.mergeFarmFontCss.call(void 0, clientCss, normalizedFontCss));
1848
1956
  }
1849
1957
  _chunkS3JO3N4Hcjs.__name.call(void 0, mergeBuiltFontCss, "mergeBuiltFontCss");
1850
1958
  var _IncompleteClientBuildOutputError = class _IncompleteClientBuildOutputError extends Error {
@@ -1856,14 +1964,14 @@ var _IncompleteClientBuildOutputError = class _IncompleteClientBuildOutputError
1856
1964
  _chunkS3JO3N4Hcjs.__name.call(void 0, _IncompleteClientBuildOutputError, "IncompleteClientBuildOutputError");
1857
1965
  var IncompleteClientBuildOutputError = _IncompleteClientBuildOutputError;
1858
1966
  async function validateClientBuildOutput(root, srcDir, outputDir) {
1859
- const fs3 = await import("fs/promises");
1967
+ const fs4 = await import("fs/promises");
1860
1968
  const fingerprinted = await findFingerprintedClientEntry(outputDir);
1861
1969
  const clientEntryPath = _path2.default.join(outputDir, _nullishCoalesce(fingerprinted, () => ( "farm-client.js")));
1862
1970
  let clientEntrySize = 0;
1863
1971
  try {
1864
- const clientEntry = await fs3.stat(clientEntryPath);
1972
+ const clientEntry = await fs4.stat(clientEntryPath);
1865
1973
  if (clientEntry.isFile()) clientEntrySize = clientEntry.size;
1866
- } catch (e20) {
1974
+ } catch (e23) {
1867
1975
  }
1868
1976
  if (clientEntrySize === 0) {
1869
1977
  throw new IncompleteClientBuildOutputError("farm-client.js is missing or empty");
@@ -1872,12 +1980,12 @@ async function validateClientBuildOutput(root, srcDir, outputDir) {
1872
1980
  const globalsCssPath = _path2.default.join(root, srcDir, "app", "globals.css");
1873
1981
  let expectsCss = false;
1874
1982
  try {
1875
- const globalsCss = await fs3.readFile(globalsCssPath, "utf8");
1983
+ const globalsCss = await fs4.readFile(globalsCssPath, "utf8");
1876
1984
  expectsCss = globalsCss.replace(/\/\*[\s\S]*?\*\//g, "").trim().length > 0;
1877
- } catch (e21) {
1985
+ } catch (e24) {
1878
1986
  }
1879
1987
  try {
1880
- const clientCss = await fs3.stat(clientCssPath);
1988
+ const clientCss = await fs4.stat(clientCssPath);
1881
1989
  if (expectsCss && (!clientCss.isFile() || clientCss.size === 0)) {
1882
1990
  throw new IncompleteClientBuildOutputError("farm-client.css is empty");
1883
1991
  }
@@ -1886,7 +1994,7 @@ async function validateClientBuildOutput(root, srcDir, outputDir) {
1886
1994
  if (expectsCss) {
1887
1995
  throw new IncompleteClientBuildOutputError("farm-client.css is missing");
1888
1996
  }
1889
- await fs3.writeFile(clientCssPath, "");
1997
+ await fs4.writeFile(clientCssPath, "");
1890
1998
  }
1891
1999
  }
1892
2000
  _chunkS3JO3N4Hcjs.__name.call(void 0, validateClientBuildOutput, "validateClientBuildOutput");
@@ -1894,17 +2002,17 @@ function getCachedClientModuleHydrationPlan(modulePath, root, mode, cache, optio
1894
2002
  const key = `${_path2.default.resolve(root)}\0${mode}\0${options.asyncOwnerIslands === true}\0${_path2.default.resolve(modulePath)}`;
1895
2003
  let plan = cache.get(key);
1896
2004
  if (!plan) {
1897
- plan = _chunkAS2VPMEEcjs.getClientModuleHydrationPlan.call(void 0, modulePath, root, mode, options);
2005
+ plan = _chunkROQ4C4LJcjs.getClientModuleHydrationPlan.call(void 0, modulePath, root, mode, options);
1898
2006
  cache.set(key, plan);
1899
2007
  }
1900
2008
  return { ...plan, isolatedBoundaries: [...plan.isolatedBoundaries] };
1901
2009
  }
1902
2010
  _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) {
2011
+ async function buildClient(productionVite, config, root, srcDir, outputDir, pageRoutes, layoutRoutes = [], routeSlots = [], isolatedClientBoundaryModules = /* @__PURE__ */ new Set(), hydrationPlanCache = /* @__PURE__ */ new Map(), rendererBuildLifetime, programmaticClientRoutes) {
1904
2012
  const viteBuild = productionVite.build;
1905
2013
  const { farmPlugin, farmServerOnlyEntriesPlugin } = await import("./vite.cjs");
1906
- const { PluginManager: PluginManager2 } = await import("./plugin.cjs");
1907
- const fs3 = await import("fs/promises");
2014
+ const { PluginManager: PluginManager2 } = await import("./plugin-DBBZ4JI2.cjs");
2015
+ const fs4 = await import("fs/promises");
1908
2016
  const pluginManager = new PluginManager2({
1909
2017
  config,
1910
2018
  isDev: false,
@@ -1912,7 +2020,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
1912
2020
  });
1913
2021
  pluginManager.addPlugins(config.plugins || []);
1914
2022
  const clientPages = [];
1915
- const integrationProviders = _chunkBWIQR4DHcjs.getIntegrationProviders.call(void 0, config.integrations).filter(
2023
+ const integrationProviders = _chunkRHGK2JENcjs.getIntegrationProviders.call(void 0, config.integrations).filter(
1916
2024
  (provider) => provider.component || provider.type === "clerk"
1917
2025
  );
1918
2026
  const unsupportedIntegrationProvider = integrationProviders.find(
@@ -1923,14 +2031,14 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
1923
2031
  `[Farm.js] isolated hydration kept route-wide because integration provider "${unsupportedIntegrationProvider.name}" does not declare supportsIsolatedHydration: true.`
1924
2032
  );
1925
2033
  }
1926
- const isolatedMode = _chunkAS2VPMEEcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
2034
+ const isolatedMode = _chunkROQ4C4LJcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
1927
2035
  _optionalChain([config, 'access', _39 => _39.experimental, 'optionalAccess', _40 => _40.isolatedClientHydration]),
1928
2036
  {
1929
2037
  serverComponents: _optionalChain([config, 'access', _41 => _41.experimental, 'optionalAccess', _42 => _42.serverComponents]) === true,
1930
2038
  hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
1931
2039
  }
1932
2040
  );
1933
- const planOptions = _chunkAS2VPMEEcjs.getFarmClientHydrationPlanOptions.call(void 0,
2041
+ const planOptions = _chunkROQ4C4LJcjs.getFarmClientHydrationPlanOptions.call(void 0,
1934
2042
  config.renderer,
1935
2043
  Boolean(unsupportedIntegrationProvider)
1936
2044
  );
@@ -1977,7 +2085,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
1977
2085
  };
1978
2086
  }
1979
2087
  });
1980
- const layoutAppliesToRoute = _chunkRVXFINNScjs.routeBoundaryCoversDirectory;
2088
+ const layoutAppliesToRoute = _chunkL6HYACBEcjs.routeBoundaryCoversDirectory;
1981
2089
  const routeDirectory = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (route) => _nullishCoalesce(route.directory, () => ( route.pattern)), "routeDirectory");
1982
2090
  const adapterOwnsDocsRuntime = Boolean(
1983
2091
  _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 +2096,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
1988
2096
  ), "isAdapterDocsRoute");
1989
2097
  const syntheticDocsEntry = _optionalChain([config, 'access', _50 => _50.docs, 'optionalAccess', _51 => _51.enabled]) && !adapterOwnsDocsRuntime ? adapterDocsEntry : null;
1990
2098
  const syntheticDocsPatterns = syntheticDocsEntry ? syntheticDocsEntry === "/" ? ["/", "/[...slug]"] : [syntheticDocsEntry, `${syntheticDocsEntry}/[...slug]`] : [];
1991
- const markdownPagePlan = _chunkAS2VPMEEcjs.createMarkdownPageHydrationPlanner.call(void 0,
2099
+ const markdownPagePlan = _chunkROQ4C4LJcjs.createMarkdownPageHydrationPlanner.call(void 0,
1992
2100
  _chunkOHY2ZWUGcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunkOHY2ZWUGcjs.resolveMdxConfig.call(void 0, config.mdx), root),
1993
2101
  root,
1994
2102
  isolatedMode,
@@ -1996,7 +2104,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
1996
2104
  );
1997
2105
  const routePlans = pageRoutes.map((route) => ({
1998
2106
  route,
1999
- metadata: _chunkEKN7NSZOcjs.isFarmMarkdownPageFile.call(void 0, route.modulePath) ? markdownPagePlan() : getCachedClientModuleHydrationPlan(
2107
+ metadata: _chunkSZLNU3GJcjs.isFarmMarkdownPageFile.call(void 0, route.modulePath) ? markdownPagePlan() : getCachedClientModuleHydrationPlan(
2000
2108
  route.modulePath,
2001
2109
  root,
2002
2110
  isolatedMode,
@@ -2004,7 +2112,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2004
2112
  planOptions
2005
2113
  )
2006
2114
  }));
2007
- _chunkAS2VPMEEcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
2115
+ _chunkROQ4C4LJcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
2008
2116
  clientLayouts.map((layout) => ({
2009
2117
  pattern: layout.pattern,
2010
2118
  depth: layout.pattern.split("/").filter(Boolean).length,
@@ -2013,7 +2121,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2013
2121
  [
2014
2122
  ...routePlans.map(({ route, metadata }) => ({
2015
2123
  pattern: routeDirectory(route),
2016
- depth: _chunkRVXFINNScjs.getRouteDirectoryDepth.call(void 0, routeDirectory(route)),
2124
+ depth: _chunkL6HYACBEcjs.getRouteDirectoryDepth.call(void 0, routeDirectory(route)),
2017
2125
  metadata
2018
2126
  })),
2019
2127
  ...syntheticDocsPatterns.map((pattern) => ({
@@ -2036,7 +2144,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2036
2144
  for (const layout of clientLayouts) {
2037
2145
  const matchesBuiltRoute = pageRoutes.some((route) => layoutAppliesToRoute(layout.pattern, routeDirectory(route))) || Boolean(adapterDocsEntry && layoutAppliesToRoute(layout.pattern, adapterDocsEntry));
2038
2146
  if (matchesBuiltRoute && layout.suppressedAsyncHydration) {
2039
- _chunk5QIKR7RRcjs.logger.warn(`\u26A0\uFE0F ${_chunkAS2VPMEEcjs.describeSuppressedAsyncHydration.call(void 0, layout.pattern, layout.fallbackReason)}`);
2147
+ _chunk5QIKR7RRcjs.logger.warn(`\u26A0\uFE0F ${_chunkROQ4C4LJcjs.describeSuppressedAsyncHydration.call(void 0, layout.pattern, layout.fallbackReason)}`);
2040
2148
  }
2041
2149
  }
2042
2150
  if (isolatedMode === "analyze") {
@@ -2060,7 +2168,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2060
2168
  );
2061
2169
  if (metadata.suppressedAsyncHydration) {
2062
2170
  _chunk5QIKR7RRcjs.logger.warn(
2063
- `\u26A0\uFE0F ${_chunkAS2VPMEEcjs.describeSuppressedAsyncHydration.call(void 0, route.pattern, metadata.fallbackReason)}`
2171
+ `\u26A0\uFE0F ${_chunkROQ4C4LJcjs.describeSuppressedAsyncHydration.call(void 0, route.pattern, metadata.fallbackReason)}`
2064
2172
  );
2065
2173
  }
2066
2174
  if (metadata.shouldHydrate || metadata.hasIsolatedClientBoundaries || applicableClientLayouts.length > 0) {
@@ -2085,7 +2193,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2085
2193
  ...applicableClientLayouts.filter((layout) => layout.hasIsolatedClientBoundaries).flatMap((layout) => layout.isolatedBoundaries)
2086
2194
  ],
2087
2195
  // 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 } : {}
2196
+ ..._chunkROQ4C4LJcjs.usesFarmServerTree.call(void 0, metadata) && applicableClientLayouts.some((layout) => layout.shouldHydrate) ? { serverTree: true } : {}
2089
2197
  });
2090
2198
  _chunk5QIKR7RRcjs.logger.info(`\u{1F4F1} Found hydratable route: ${route.pattern} -> ${route.modulePath}`);
2091
2199
  }
@@ -2121,7 +2229,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2121
2229
  }
2122
2230
  const clientRouteSlots = routeSlots.filter((slot) => {
2123
2231
  try {
2124
- return _chunkAS2VPMEEcjs.getClientModuleMetadata.call(void 0, slot.modulePath, root).shouldHydrate;
2232
+ return _chunkROQ4C4LJcjs.getClientModuleMetadata.call(void 0, slot.modulePath, root).shouldHydrate;
2125
2233
  } catch (error) {
2126
2234
  _chunk5QIKR7RRcjs.logger.warn(`\u26A0\uFE0F Could not inspect route slot ${slot.modulePath}: ${error}`);
2127
2235
  return false;
@@ -2131,8 +2239,8 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2131
2239
  `\u{1F4F1} Total hydratable routes detected: ${clientPages.length} pages, ${clientLayouts.filter((layout) => layout.shouldHydrate || layout.hasIsolatedClientBoundaries).length} layouts, and ${clientRouteSlots.length} slots`
2132
2240
  );
2133
2241
  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-"));
2242
+ await fs4.mkdir(clientEntryRoot, { recursive: true });
2243
+ const clientEntryDir = await fs4.mkdtemp(_path2.default.join(clientEntryRoot, "client-entry-"));
2136
2244
  const clientEntryPath = _path2.default.join(clientEntryDir, "farm-client-entry.tsx");
2137
2245
  const clientHydrationCode = generateClientHydrationEntry(
2138
2246
  clientPages,
@@ -2149,12 +2257,12 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2149
2257
  config.renderer,
2150
2258
  config.publicRuntimeConfig,
2151
2259
  config.trailingSlash,
2152
- _chunkBWIQR4DHcjs.getIntegrationProviders.call(void 0, config.integrations),
2260
+ _chunkRHGK2JENcjs.getIntegrationProviders.call(void 0, config.integrations),
2153
2261
  config.basePath,
2154
- _chunkAS2VPMEEcjs.generateClientCachePersistenceCode.call(void 0, _chunkAS2VPMEEcjs.resolveFarmClientCacheAdapterEntry.call(void 0, root, config.cache)),
2262
+ _chunkROQ4C4LJcjs.generateClientCachePersistenceCode.call(void 0, _chunkROQ4C4LJcjs.resolveFarmClientCacheAdapterEntry.call(void 0, root, config.cache)),
2155
2263
  adapterOwnsDocsRuntime ? _chunkCY2ZQ5C6cjs.getFarmDocsAdapterConfigModule.call(void 0, config.docs) : void 0
2156
2264
  );
2157
- await fs3.writeFile(clientEntryPath, clientHydrationCode);
2265
+ await fs4.writeFile(clientEntryPath, clientHydrationCode);
2158
2266
  const hasScopedPostcssConfig = hasProjectPostcssConfig(root);
2159
2267
  let postcssSearchPath;
2160
2268
  let tailwindVitePlugin = void 0;
@@ -2166,9 +2274,9 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2166
2274
  _chunk5QIKR7RRcjs.logger.info("\u{1F4E6} Using project PostCSS/Tailwind configuration");
2167
2275
  } else {
2168
2276
  const postcssConfigPath = _path2.default.join(clientEntryDir, "postcss.config.cjs");
2169
- await fs3.writeFile(postcssConfigPath, "module.exports = { plugins: [] };\n");
2277
+ await fs4.writeFile(postcssConfigPath, "module.exports = { plugins: [] };\n");
2170
2278
  postcssSearchPath = clientEntryDir;
2171
- tailwindVitePlugin = await _chunkAS2VPMEEcjs.loadTailwindVitePlugin.call(void 0, {
2279
+ tailwindVitePlugin = await _chunkROQ4C4LJcjs.loadTailwindVitePlugin.call(void 0, {
2172
2280
  builder: productionVite.builder,
2173
2281
  announce: true
2174
2282
  });
@@ -2188,6 +2296,8 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2188
2296
  target: FARM_CLIENT_BUILD_TARGET,
2189
2297
  outDir: outputDir,
2190
2298
  emptyOutDir: true,
2299
+ // Never public: see resolveFarmClientSourcemap.
2300
+ sourcemap: resolveFarmClientSourcemap(_optionalChain([config, 'access', _57 => _57.vite, 'optionalAccess', _58 => _58.build, 'optionalAccess', _59 => _59.sourcemap])),
2191
2301
  assetsInlineLimit: 0,
2192
2302
  cssCodeSplit: false,
2193
2303
  // Bundle all CSS into one file
@@ -2201,7 +2311,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2201
2311
  hashCharacters: "hex",
2202
2312
  // Use predictable name for CSS so we can reference it in SSR HTML
2203
2313
  assetFileNames: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (assetInfo) => {
2204
- if (_optionalChain([assetInfo, 'access', _57 => _57.name, 'optionalAccess', _58 => _58.endsWith, 'call', _59 => _59(".css")])) {
2314
+ if (_optionalChain([assetInfo, 'access', _60 => _60.name, 'optionalAccess', _61 => _61.endsWith, 'call', _62 => _62(".css")])) {
2205
2315
  return "farm-client.css";
2206
2316
  }
2207
2317
  return "assets/[name]-h[hash][extname]";
@@ -2237,7 +2347,10 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2237
2347
  }
2238
2348
  },
2239
2349
  plugins: [
2240
- _chunkAS2VPMEEcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
2350
+ _chunkROQ4C4LJcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
2351
+ createFarmPrivateClientSourcemapsPlugin({
2352
+ outDir: _path2.default.join(_path2.default.dirname(outputDir), FARM_CLIENT_SOURCEMAPS_DIR)
2353
+ }),
2241
2354
  createFarmClientModulePreloadPlugin({
2242
2355
  root,
2243
2356
  buildDir: _path2.default.dirname(outputDir),
@@ -2259,7 +2372,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2259
2372
  ...rendererVitePlugins,
2260
2373
  ...config.vite.plugins || [],
2261
2374
  farmServerOnlyEntriesPlugin(),
2262
- _chunkAS2VPMEEcjs.farmDocsClientConfigPlugin.call(void 0,
2375
+ _chunkROQ4C4LJcjs.farmDocsClientConfigPlugin.call(void 0,
2263
2376
  adapterOwnsDocsRuntime ? _chunkCY2ZQ5C6cjs.getFarmDocsAdapterConfigModule.call(void 0, config.docs) : void 0
2264
2377
  ),
2265
2378
  // Plugin to redirect @farm.js/core imports to client-only exports
@@ -2309,8 +2422,11 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2309
2422
  return null;
2310
2423
  }
2311
2424
  },
2312
- farmPlugin({ ...config, isolatedClientBoundaryModules }, pluginManager),
2313
- _chunk3SDFA7UFcjs.farmEnvironmentFunctionsPlugin.call(void 0, )
2425
+ farmPlugin(
2426
+ { ...config, isolatedClientBoundaryModules, programmaticClientRoutes },
2427
+ pluginManager
2428
+ ),
2429
+ _chunkVDRM36QBcjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
2314
2430
  ],
2315
2431
  mode: "production",
2316
2432
  css: postcssSearchPath ? {
@@ -2318,7 +2434,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2318
2434
  } : void 0,
2319
2435
  // Ensure React is bundled for client
2320
2436
  resolve: {
2321
- alias: _chunkAS2VPMEEcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
2437
+ alias: _chunkROQ4C4LJcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
2322
2438
  dedupe: [...config.renderer.dedupe || []]
2323
2439
  },
2324
2440
  // Optimize dependencies - exclude server-side code from client bundle
@@ -2331,13 +2447,13 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2331
2447
  ]
2332
2448
  }
2333
2449
  };
2334
- await viteBuild(_chunkAS2VPMEEcjs.mergeFarmProductionViteConfig.call(void 0, clientViteConfig, config.vite));
2450
+ await viteBuild(_chunkROQ4C4LJcjs.mergeFarmProductionViteConfig.call(void 0, clientViteConfig, config.vite));
2335
2451
  await mergeBuiltFontCss(outputDir);
2336
2452
  await validateClientBuildOutput(root, srcDir, outputDir);
2337
2453
  } finally {
2338
2454
  try {
2339
- await fs3.rm(clientEntryDir, { recursive: true, force: true });
2340
- } catch (e22) {
2455
+ await fs4.rm(clientEntryDir, { recursive: true, force: true });
2456
+ } catch (e25) {
2341
2457
  }
2342
2458
  }
2343
2459
  }
@@ -3090,7 +3206,7 @@ function generateClientHydrationEntry(clientPages, layoutRoutes, clientRouteSlot
3090
3206
  direction: {}
3091
3207
  }, plugins = [], renderer = _chunkPSV6XKPOcjs.REACT_RENDERER, publicRuntimeConfig = void 0, trailingSlash = false, integrationProviders = [], basePath = "/", clientCachePersistence = { imports: "", init: "" }, docsConfigModule) {
3092
3208
  const toImportPath = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (targetPath) => targetPath.replace(/\\/g, "/"), "toImportPath");
3093
- const clientPluginEntry = _chunkAS2VPMEEcjs.generateFarmClientPluginEntryCode.call(void 0,
3209
+ const clientPluginEntry = _chunkROQ4C4LJcjs.generateFarmClientPluginEntryCode.call(void 0,
3094
3210
  plugins,
3095
3211
  root,
3096
3212
  srcDir,
@@ -3101,7 +3217,7 @@ function generateClientHydrationEntry(clientPages, layoutRoutes, clientRouteSlot
3101
3217
  import { createRoot, hydrateRoot } from "react-dom/client";` : appSetupPath ? `import React, { createRoot, hydrateRoot, configureApp as __farmConfigureApp } from ${JSON.stringify(renderer.client)};
3102
3218
  import __farmAppSetup from ${JSON.stringify(_chunk5QIKR7RRcjs.toPosixPath.call(void 0, appSetupPath))};
3103
3219
  __farmConfigureApp(__farmAppSetup);` : `import React, { createRoot, hydrateRoot } from ${JSON.stringify(renderer.client)};`;
3104
- const providerClientCode = _chunkAS2VPMEEcjs.generateFarmIntegrationProviderClientCode.call(void 0,
3220
+ const providerClientCode = _chunkROQ4C4LJcjs.generateFarmIntegrationProviderClientCode.call(void 0,
3105
3221
  integrationProviders,
3106
3222
  root,
3107
3223
  _nullishCoalesce(renderer.componentExtensions, () => ( []))
@@ -3113,12 +3229,12 @@ __farmConfigureApp(__farmAppSetup);` : `import React, { createRoot, hydrateRoot
3113
3229
  const hydratingLayoutPatterns = layoutRoutes.filter((layout) => layout.shouldHydrate).map((layout) => layout.pattern);
3114
3230
  layoutRoutes.forEach((layout, index) => {
3115
3231
  const relativePath = toImportPath(layout.modulePath);
3116
- const rendersOnClient = !layout.hasIsolatedClientBoundaries && hydratingLayoutPatterns.some((pattern) => _chunk5ULKUBIAcjs.layoutsCanCoverSamePage.call(void 0, layout.pattern, pattern));
3232
+ const rendersOnClient = !layout.hasIsolatedClientBoundaries && hydratingLayoutPatterns.some((pattern) => _chunkPN676AZFcjs.layoutsCanCoverSamePage.call(void 0, layout.pattern, pattern));
3117
3233
  if (rendersOnClient) {
3118
3234
  layoutImportStatements.push(`import Layout${index} from "${relativePath}";`);
3119
3235
  }
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)}` : "";
3236
+ const groupScope = _chunkL6HYACBEcjs.getRouteGroupScope.call(void 0, layout.pattern);
3237
+ const groupFields = groupScope ? `, urlPattern: ${JSON.stringify(_chunkL6HYACBEcjs.stripRouteGroups.call(void 0, layout.pattern))}, groupScope: ${JSON.stringify(groupScope)}` : "";
3122
3238
  layoutRegistrations.push(
3123
3239
  ` { pattern: ${JSON.stringify(layout.pattern)}${groupFields}, Component: ${rendersOnClient ? `Layout${index}` : "null"}, shouldHydrate: ${JSON.stringify(layout.shouldHydrate)}, islandStrategy: ${JSON.stringify(layout.islandStrategy)} }`
3124
3240
  );
@@ -3621,7 +3737,7 @@ function hasHydratableLayout(pathname) {
3621
3737
  });
3622
3738
  }
3623
3739
 
3624
- ${_chunkAS2VPMEEcjs.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE}
3740
+ ${_chunkROQ4C4LJcjs.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE}
3625
3741
  // Wrap a page element with applicable layouts
3626
3742
  function wrapWithLayouts(pageElement, pathname, params) {
3627
3743
  const layouts = getApplicableLayouts(pathname);
@@ -4579,8 +4695,8 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, generateClientHydrationEntry, "generateCli
4579
4695
  async function buildSSRInMemory(productionVite, config, root, routeManager, apiRouteManager, serverRenderer, preset, collectedPageRoutes, collectedLayoutRoutes, collectedRouteSlots, isolatedClientBoundaryModules, hydrationPlanCache, rendererBuildLifetime) {
4580
4696
  const viteBuild = productionVite.build;
4581
4697
  const { farmPlugin, farmServerOnlyEntriesPlugin } = await import("./vite.cjs");
4582
- const { PluginManager: PluginManager2 } = await import("./plugin.cjs");
4583
- const fs3 = await import("fs/promises");
4698
+ const { PluginManager: PluginManager2 } = await import("./plugin-DBBZ4JI2.cjs");
4699
+ const fs4 = await import("fs/promises");
4584
4700
  const pluginManager = new PluginManager2({
4585
4701
  config,
4586
4702
  isDev: false,
@@ -4595,12 +4711,12 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4595
4711
  buildLifetime: rendererBuildLifetime
4596
4712
  });
4597
4713
  if (!hasScopedPostcssConfig) {
4598
- postcssConfigDir = await fs3.mkdtemp(_path2.default.join(_os2.default.tmpdir(), "farm-postcss-"));
4599
- await fs3.writeFile(
4714
+ postcssConfigDir = await fs4.mkdtemp(_path2.default.join(_os2.default.tmpdir(), "farm-postcss-"));
4715
+ await fs4.writeFile(
4600
4716
  _path2.default.join(postcssConfigDir, "postcss.config.cjs"),
4601
4717
  "module.exports = { plugins: [] };\n"
4602
4718
  );
4603
- tailwindVitePlugin = await _chunkAS2VPMEEcjs.loadTailwindVitePlugin.call(void 0, {
4719
+ tailwindVitePlugin = await _chunkROQ4C4LJcjs.loadTailwindVitePlugin.call(void 0, {
4604
4720
  builder: productionVite.builder,
4605
4721
  label: "for SSR"
4606
4722
  });
@@ -4622,7 +4738,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4622
4738
  fileName: entry.fileName,
4623
4739
  sourceType: "static",
4624
4740
  staticInfo: entry.staticInfo,
4625
- data: (await fs3.readFile(entry.modulePath)).toString("base64")
4741
+ data: (await fs4.readFile(entry.modulePath)).toString("base64")
4626
4742
  });
4627
4743
  continue;
4628
4744
  }
@@ -4696,7 +4812,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4696
4812
  }
4697
4813
  const middlewareRoutes = await discoverMiddlewareRoutes(appDirs);
4698
4814
  const instrumentationPath = _chunkKCMTCM6Icjs.resolveFarmInstrumentationFile.call(void 0, root, config.srcDir || "src");
4699
- const notFoundPath = _chunkAS2VPMEEcjs.resolveFarmNotFoundComponentPath.call(void 0, config, appDirs);
4815
+ const notFoundPath = _chunkROQ4C4LJcjs.resolveFarmNotFoundComponentPath.call(void 0, config, appDirs);
4700
4816
  if (notFoundPath) _chunk5QIKR7RRcjs.logger.info(`\u{1F4CB} Found custom 404 page: ${notFoundPath}`);
4701
4817
  layoutRoutes.sort((a, b) => {
4702
4818
  const depthA = a.pattern.split("/").filter(Boolean).length;
@@ -4713,34 +4829,34 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4713
4829
  const hasServerRuntimeIntegrations = configuredIntegrationValues.some(
4714
4830
  (integration) => typeof integration === "object" && integration !== null && (!("serverRuntime" in integration) || integration.serverRuntime !== false)
4715
4831
  );
4716
- const hasIntegrationProviders = _chunkBWIQR4DHcjs.getIntegrationProviders.call(void 0, config.integrations).some(
4832
+ const hasIntegrationProviders = _chunkRHGK2JENcjs.getIntegrationProviders.call(void 0, config.integrations).some(
4717
4833
  (provider) => provider.component || provider.type === "clerk"
4718
4834
  );
4719
4835
  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);
4836
+ const hasMdxComponentConfig = Boolean(_optionalChain([config, 'access', _63 => _63.mdx, 'optionalAccess', _64 => _64.components]));
4837
+ const hasMiddlewareConfig = _chunkL6HYACBEcjs.hasFarmMiddlewareConfig.call(void 0, config.middleware);
4838
+ const hasRouteContextConfig = _chunkEX4MKHXNcjs.hasCustomFarmRouteContext.call(void 0, config);
4723
4839
  const hasServerRuntimePlugins = hasFarmServerRuntimePlugins(config);
4724
4840
  const hasPluginRoutes = hasFarmPluginRoutes(config);
4725
4841
  const hasServerCacheConfig = hasFarmServerCacheConfig(config.cache);
4726
- const configModulePath = hasServerRuntimeIntegrations || hasObservabilityHandler || hasMdxComponentConfig || hasMiddlewareConfig || hasRouteContextConfig || hasServerRuntimePlugins || hasPluginRoutes || hasServerCacheConfig || hasIntegrationProviders ? await findFarmConfigPath(root) : null;
4842
+ const configModulePath = hasServerRuntimeIntegrations || hasObservabilityHandler || hasMdxComponentConfig || hasMiddlewareConfig || hasRouteContextConfig || hasServerRuntimePlugins || hasPluginRoutes || hasServerCacheConfig || hasFarmServerStorageConfig(config.storage) || hasIntegrationProviders ? await findFarmConfigPath(root) : null;
4727
4843
  const hasRuntimeConfigModule = hasFarmRuntimeConfigModule(config, configModulePath);
4728
4844
  const hasRuntimeIntegrationConfig = hasRuntimeConfigModule && hasAnyConfiguredIntegrations;
4729
4845
  const hasConfiguredRuntimePlugins = Boolean(
4730
4846
  hasRuntimeConfigModule && (config.plugins || []).length > 0
4731
4847
  );
4732
- if (_chunkCIOT4HGTcjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)) {
4848
+ if (_chunkJOTUZIM4cjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)) {
4733
4849
  const adapterGuardedPaths = new Set(getFarmDocsGuardedPaths(config, middlewareRoutes));
4734
- _chunkCIOT4HGTcjs.assertFarmDocsAdapterServesNoGuardedPages.call(void 0,
4850
+ _chunkJOTUZIM4cjs.assertFarmDocsAdapterServesNoGuardedPages.call(void 0,
4735
4851
  config.docs,
4736
4852
  { root, srcDir: config.srcDir },
4737
4853
  (pathname) => adapterGuardedPaths.has(pathname)
4738
4854
  );
4739
4855
  }
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,
4856
+ const farmDocsCspNonceMarker = _chunk25LPIZSXcjs.createFarmCspNonce.call(void 0, config.security);
4857
+ const farmDocsPrecompiledManifest = _optionalChain([config, 'access', _65 => _65.docs, 'optionalAccess', _66 => _66.enabled]) && _chunkC5GUTBZKcjs.getFarmPresetRuntime.call(void 0, preset) === "edge" ? await _chunkZTP3BJG6cjs._runWithFarmCspNonce.call(void 0,
4742
4858
  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, {
4859
+ async () => _optionalChain([config, 'access', _67 => _67.docs, 'access', _68 => _68.adapter, 'optionalAccess', _69 => _69.server]) ? await _chunkJOTUZIM4cjs.compileFarmDocsAdapterEdgeManifest.call(void 0, config.docs, {
4744
4860
  root,
4745
4861
  srcDir: config.srcDir,
4746
4862
  clientEntry: FARM_CLIENT_JS_SRC_PLACEHOLDER,
@@ -4791,6 +4907,10 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4791
4907
  );
4792
4908
  const virtualEntryId = "\0virtual:farm-ssr-entry";
4793
4909
  const useExternalMetadataImageRuntime = shouldUseExternalMetadataImageRuntime(preset, true);
4910
+ const omitCoreMetadataImageRuntime = !metadataImageRoutes.some(
4911
+ (image) => image.sourceType === "module"
4912
+ );
4913
+ const externalMetadataImageRuntime = useExternalMetadataImageRuntime && !omitCoreMetadataImageRuntime ? ["@vercel/og"] : [];
4794
4914
  const rendererOptionalExternals = _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, config.renderer) ? [] : [
4795
4915
  "react",
4796
4916
  "react/jsx-runtime",
@@ -4824,7 +4944,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4824
4944
  // startup; kept external, Nitro copies the package into the output.
4825
4945
  "better-sqlite3",
4826
4946
  ...rendererOptionalExternals,
4827
- ...useExternalMetadataImageRuntime ? ["@vercel/og"] : [],
4947
+ ...externalMetadataImageRuntime,
4828
4948
  "@prisma/client",
4829
4949
  "@prisma/client/default",
4830
4950
  "@prisma/client/default.js",
@@ -4845,7 +4965,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4845
4965
  // Adapters can render provider scripts by serializing function source.
4846
4966
  // keepNames injects helper calls into those functions; after Nitro
4847
4967
  // 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])),
4968
+ 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
4969
  jsxDev: false
4850
4970
  },
4851
4971
  // SSR configuration to externalize problematic modules
@@ -4856,7 +4976,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4856
4976
  "fsevents",
4857
4977
  "sharp",
4858
4978
  ...rendererOptionalExternals,
4859
- ...useExternalMetadataImageRuntime ? ["@vercel/og"] : [],
4979
+ ...externalMetadataImageRuntime,
4860
4980
  "esbuild",
4861
4981
  "lightningcss",
4862
4982
  "rolldown",
@@ -4895,18 +5015,24 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4895
5015
  define: {
4896
5016
  __FARM_API_BASE_URL__: JSON.stringify(config.api.baseURL),
4897
5017
  __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]) || {})
5018
+ __FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _75 => _75.env, 'optionalAccess', _76 => _76.public]) || {})
4899
5019
  },
4900
5020
  plugins: [
4901
- _chunkAS2VPMEEcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
5021
+ _chunkROQ4C4LJcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
4902
5022
  ...tailwindVitePlugin ? [tailwindVitePlugin] : [],
4903
5023
  ...rendererVitePlugins,
4904
5024
  ...config.vite.plugins || [],
4905
5025
  ...!useExternalMetadataImageRuntime && metadataImageRoutes.some((image) => image.sourceType === "module") ? [createMetadataImageWasmPlugin()] : [],
5026
+ ...omitCoreMetadataImageRuntime ? [
5027
+ {
5028
+ ...createOmittedMetadataImageRuntimePlugin(useExternalMetadataImageRuntime),
5029
+ enforce: "pre"
5030
+ }
5031
+ ] : [],
4906
5032
  { ...createReactProductionModePlugin(), enforce: "pre" },
4907
5033
  farmServerOnlyEntriesPlugin(),
4908
5034
  farmPlugin({ ...config, isolatedClientBoundaryModules }, pluginManager),
4909
- _chunk3SDFA7UFcjs.farmEnvironmentFunctionsPlugin.call(void 0, ),
5035
+ _chunkVDRM36QBcjs.farmEnvironmentFunctionsPlugin.call(void 0, config),
4910
5036
  {
4911
5037
  name: "farm-virtual-ssr-entry",
4912
5038
  resolveId(id) {
@@ -4945,7 +5071,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4945
5071
  resolve: {
4946
5072
  alias: [
4947
5073
  ...shouldAliasReactServerToWebBuild(config.renderer, preset) ? [createFarmReactWebServerAlias(hasReactDomEdgeServerBuild(root))] : [],
4948
- ...Object.entries(_chunkAS2VPMEEcjs.createFarmSourceAlias.call(void 0, root, config.srcDir)).map(
5074
+ ...Object.entries(_chunkROQ4C4LJcjs.createFarmSourceAlias.call(void 0, root, config.srcDir)).map(
4949
5075
  ([find, replacement]) => ({ find, replacement })
4950
5076
  )
4951
5077
  ],
@@ -4953,12 +5079,12 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4953
5079
  dedupe: [...config.renderer.dedupe || []]
4954
5080
  }
4955
5081
  };
4956
- await viteBuild(_chunkAS2VPMEEcjs.mergeFarmProductionViteConfig.call(void 0, serverViteConfig, config.vite));
5082
+ await viteBuild(_chunkROQ4C4LJcjs.mergeFarmProductionViteConfig.call(void 0, serverViteConfig, config.vite));
4957
5083
  } finally {
4958
5084
  if (postcssConfigDir) {
4959
5085
  try {
4960
- await fs3.rm(postcssConfigDir, { recursive: true, force: true });
4961
- } catch (e23) {
5086
+ await fs4.rm(postcssConfigDir, { recursive: true, force: true });
5087
+ } catch (e26) {
4962
5088
  }
4963
5089
  }
4964
5090
  }
@@ -4972,7 +5098,7 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, buildSSRInMemory, "buildSSRInMemory");
4972
5098
  function readFarmAppPackageIdentity(root) {
4973
5099
  try {
4974
5100
  return JSON.parse(_fs.readFileSync.call(void 0, _path2.default.join(root, "package.json"), "utf8"));
4975
- } catch (e24) {
5101
+ } catch (e27) {
4976
5102
  return {};
4977
5103
  }
4978
5104
  }
@@ -4985,15 +5111,15 @@ function readFarmPageLastModified(pageRoutes) {
4985
5111
  lastModified[route.pattern] = _fs.statSync.call(void 0,
4986
5112
  _nullishCoalesce(route.markdownSourcePath, () => ( route.modulePath))
4987
5113
  ).mtime.toISOString();
4988
- } catch (e25) {
5114
+ } catch (e28) {
4989
5115
  }
4990
5116
  }
4991
5117
  return lastModified;
4992
5118
  }
4993
5119
  _chunkS3JO3N4Hcjs.__name.call(void 0, readFarmPageLastModified, "readFarmPageLastModified");
4994
5120
  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, {
5121
+ if (!_optionalChain([config, 'access', _77 => _77.docs, 'optionalAccess', _78 => _78.enabled])) return [];
5122
+ const contentDir = _chunkMY5PZYADcjs.resolveFarmDocsContentDir.call(void 0, config.docs, {
4997
5123
  root: config.root,
4998
5124
  srcDir: config.srcDir
4999
5125
  });
@@ -5001,19 +5127,19 @@ function getFarmDocsGuardedPaths(config, middlewareRoutes) {
5001
5127
  config: { middleware: config.middleware, integrations: config.integrations },
5002
5128
  middlewareRoutes
5003
5129
  };
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));
5130
+ return _chunkMY5PZYADcjs.discoverFarmDocsPages.call(void 0, contentDir, config.docs).flatMap((page) => [page.href, _chunkMY5PZYADcjs.getFarmDocsMarkdownPath.call(void 0, page.href)]).filter((pathname) => _chunkL6HYACBEcjs.farmPathGuardCoversPage.call(void 0, guards, pathname));
5005
5131
  }
5006
5132
  _chunkS3JO3N4Hcjs.__name.call(void 0, getFarmDocsGuardedPaths, "getFarmDocsGuardedPaths");
5007
5133
  function getFarmAppOwnedDocsEnginePaths(agent, applicationMetadataRoutes) {
5008
- const llmsTxt = _optionalChain([agent, 'optionalAccess', _76 => _76.llmsTxt]);
5134
+ const llmsTxt = _optionalChain([agent, 'optionalAccess', _79 => _79.llmsTxt]);
5009
5135
  const ownedByFile = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (kind) => applicationMetadataRoutes.some(
5010
5136
  (metadata) => metadata.kind === kind && metadata.pattern === "/"
5011
5137
  ), "ownedByFile");
5012
5138
  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"] : []
5139
+ ..._optionalChain([llmsTxt, 'optionalAccess', _80 => _80.enabled]) || ownedByFile("llms") ? ["/llms.txt"] : [],
5140
+ ..._optionalChain([llmsTxt, 'optionalAccess', _81 => _81.enabled]) && llmsTxt.full || ownedByFile("llms-full") ? ["/llms-full.txt"] : [],
5141
+ ..._optionalChain([agent, 'optionalAccess', _82 => _82.sitemap, 'optionalAccess', _83 => _83.enabled]) || ownedByFile("sitemap") ? ["/sitemap.xml"] : [],
5142
+ ..._optionalChain([agent, 'optionalAccess', _84 => _84.crawlers, 'optionalAccess', _85 => _85.enabled]) || ownedByFile("robots") ? ["/robots.txt"] : []
5017
5143
  ];
5018
5144
  }
5019
5145
  _chunkS3JO3N4Hcjs.__name.call(void 0, getFarmAppOwnedDocsEnginePaths, "getFarmAppOwnedDocsEnginePaths");
@@ -5055,7 +5181,7 @@ function toVirtualEntryImportSpecifier(modulePath) {
5055
5181
  }
5056
5182
  _chunkS3JO3N4Hcjs.__name.call(void 0, toVirtualEntryImportSpecifier, "toVirtualEntryImportSpecifier");
5057
5183
  function generateNativeAuthIntegrationSource(auth) {
5058
- if (_optionalChain([auth, 'optionalAccess', _83 => _83.enabled]) !== true) {
5184
+ if (_optionalChain([auth, 'optionalAccess', _86 => _86.enabled]) !== true) {
5059
5185
  return { importSource: "", registerSource: "" };
5060
5186
  }
5061
5187
  return {
@@ -5078,7 +5204,7 @@ function matchLocalIntegrationRequest(request) {
5078
5204
  });` : "return null;"}
5079
5205
  }
5080
5206
 
5081
- async function handleIntegrationRequest(request, ranMiddleware) {
5207
+ async function handleIntegrationRequest(request, ranMiddleware, clientAddress) {
5082
5208
  ${options.hasServerRuntimeIntegrations ? `return dispatchIntegrationRequests(
5083
5209
  serverRuntimeIntegrations,
5084
5210
  {
@@ -5087,7 +5213,7 @@ async function handleIntegrationRequest(request, ranMiddleware) {
5087
5213
  isProd: true,
5088
5214
  },
5089
5215
  request,
5090
- { ranMiddleware },
5216
+ { ranMiddleware, clientAddress },
5091
5217
  );` : `return { response: null, setCookies: [] };`}
5092
5218
  }
5093
5219
 
@@ -5172,17 +5298,6 @@ function applyConfiguredResponseHeaders(response, pathname) {
5172
5298
  `.trim();
5173
5299
  }
5174
5300
  _chunkS3JO3N4Hcjs.__name.call(void 0, generateConfiguredResponseHeadersRuntimeSource, "generateConfiguredResponseHeadersRuntimeSource");
5175
- function parseRouteRenderingDirectiveFromDisk(modulePath) {
5176
- try {
5177
- 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;
5180
- return { ..._nullishCoalesce(directive, () => ( { ssg: false, ppr: false, directive: "" })), requestBound: true };
5181
- } catch (e26) {
5182
- return void 0;
5183
- }
5184
- }
5185
- _chunkS3JO3N4Hcjs.__name.call(void 0, parseRouteRenderingDirectiveFromDisk, "parseRouteRenderingDirectiveFromDisk");
5186
5301
  function generatePreloadResponseRuntimeSource() {
5187
5302
  return `
5188
5303
  // Farm builds buffered HTML responses from strings it already holds. Remember
@@ -5365,19 +5480,19 @@ ReactDOMServer.configureApp(__farmAppSetup);`;
5365
5480
  _chunkS3JO3N4Hcjs.__name.call(void 0, generateFarmRendererAppSetupServerCode, "generateFarmRendererAppSetupServerCode");
5366
5481
  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
5482
  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(
5483
+ const servesAgentRobotsTxt = Boolean(_optionalChain([config, 'access', _87 => _87.agent, 'optionalAccess', _88 => _88.crawlers, 'optionalAccess', _89 => _89.enabled])) && !applicationMetadataRoutes.some(
5369
5484
  (metadata) => metadata.kind === "robots" && metadata.pattern === "/"
5370
5485
  );
5371
- const servesAgentSitemap = Boolean(_optionalChain([config, 'access', _87 => _87.agent, 'optionalAccess', _88 => _88.sitemap, 'optionalAccess', _89 => _89.enabled])) && !applicationMetadataRoutes.some(
5486
+ const servesAgentSitemap = Boolean(_optionalChain([config, 'access', _90 => _90.agent, 'optionalAccess', _91 => _91.sitemap, 'optionalAccess', _92 => _92.enabled])) && !applicationMetadataRoutes.some(
5372
5487
  (metadata) => metadata.kind === "sitemap" && metadata.pattern === "/"
5373
5488
  );
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;
5489
+ 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");
5490
+ const servesAiCatalog = _optionalChain([config, 'access', _95 => _95.agent, 'optionalAccess', _96 => _96.aiCatalog]) !== false;
5376
5491
  const hasPluginRuntime = hasRuntimeIntegrationConfig || hasServerRuntimePlugins;
5377
5492
  const hasInfraAnalyticsRuntime = config.analytics !== false && _chunk2SJ4RQ6Pcjs.resolveFarmInstrumentationRuntime.call(void 0, preset) === "nodejs";
5378
5493
  const hasPrecompiledDocs = Boolean(farmDocsPrecompiledManifest);
5379
5494
  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
5495
+ _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
5496
  );
5382
5497
  const docsConfigModulePath = adapterOwnsDocsRuntime && !hasPrecompiledDocs && config.docs.configPath && !config.docs.configPath.endsWith(".json") ? config.docs.configPath : void 0;
5383
5498
  const hasIsolatedClientGraphRuntime = _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, config.renderer) && isolatedClientBoundaryModules.size > 0;
@@ -5410,9 +5525,9 @@ function renderFarmRouteServerTree(element) { return element; }`;
5410
5525
  const hasGeneratedMetadataImages = metadataImageRoutes.some(
5411
5526
  (image) => image.sourceType === "module"
5412
5527
  );
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);
5528
+ const hasMiddlewareRuntime = middlewareRoutes.length > 0 || _chunkL6HYACBEcjs.hasFarmMiddlewareConfig.call(void 0, config.middleware);
5529
+ const farmDocsFontAssets = _optionalChain([config, 'access', _102 => _102.docs, 'optionalAccess', _103 => _103.enabled]) ? _chunkHREOKQWTcjs.toFarmDocsPublicFontAssets.call(void 0, _chunkHREOKQWTcjs.resolveFarmDocsFontAssets.call(void 0, config.root)) : [];
5530
+ const integrationProviders = _chunkRHGK2JENcjs.getIntegrationProviders.call(void 0, config.integrations);
5416
5531
  const renderedIntegrationProviders = integrationProviders.filter(
5417
5532
  (provider) => provider.component || provider.type === "clerk"
5418
5533
  );
@@ -5421,16 +5536,16 @@ function renderFarmRouteServerTree(element) { return element; }`;
5421
5536
  `Integration provider components are not supported by the "${config.renderer.name}" renderer.`
5422
5537
  );
5423
5538
  }
5424
- const providerServerModules = _chunkAS2VPMEEcjs.generateFarmIntegrationProviderServerModules.call(void 0,
5539
+ const providerServerModules = _chunkROQ4C4LJcjs.generateFarmIntegrationProviderServerModules.call(void 0,
5425
5540
  renderedIntegrationProviders,
5426
5541
  config.root,
5427
5542
  _nullishCoalesce(config.renderer.componentExtensions, () => ( []))
5428
5543
  );
5429
5544
  const resolvedIntegrationProviderFallback = Object.fromEntries(
5430
5545
  Object.entries(config.integrations).flatMap(([name, integration]) => {
5431
- const configuredProviders = _optionalChain([integration, 'optionalAccess', _101 => _101.providers]);
5546
+ const configuredProviders = _optionalChain([integration, 'optionalAccess', _104 => _104.providers]);
5432
5547
  const providers = Array.isArray(configuredProviders) ? configuredProviders : [];
5433
- if (providers.some((provider) => typeof _optionalChain([provider, 'optionalAccess', _102 => _102.component]) === "function")) {
5548
+ if (providers.some((provider) => typeof _optionalChain([provider, 'optionalAccess', _105 => _105.component]) === "function")) {
5434
5549
  throw new Error(
5435
5550
  `Integration provider components in production must use an importable component reference, for example component: { module: "@/components/provider" }.`
5436
5551
  );
@@ -5441,14 +5556,14 @@ function renderFarmRouteServerTree(element) { return element; }`;
5441
5556
  const unsupportedIntegrationProvider = renderedIntegrationProviders.find(
5442
5557
  (provider) => provider.supportsIsolatedHydration !== true
5443
5558
  );
5444
- const isolatedHydrationMode = _chunkAS2VPMEEcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
5445
- _optionalChain([config, 'access', _103 => _103.experimental, 'optionalAccess', _104 => _104.isolatedClientHydration]),
5559
+ const isolatedHydrationMode = _chunkROQ4C4LJcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
5560
+ _optionalChain([config, 'access', _106 => _106.experimental, 'optionalAccess', _107 => _107.isolatedClientHydration]),
5446
5561
  {
5447
- serverComponents: _optionalChain([config, 'access', _105 => _105.experimental, 'optionalAccess', _106 => _106.serverComponents]) === true,
5562
+ serverComponents: _optionalChain([config, 'access', _108 => _108.experimental, 'optionalAccess', _109 => _109.serverComponents]) === true,
5448
5563
  hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
5449
5564
  }
5450
5565
  );
5451
- const hydrationPlanOptions = _chunkAS2VPMEEcjs.getFarmClientHydrationPlanOptions.call(void 0,
5566
+ const hydrationPlanOptions = _chunkROQ4C4LJcjs.getFarmClientHydrationPlanOptions.call(void 0,
5452
5567
  config.renderer,
5453
5568
  Boolean(unsupportedIntegrationProvider)
5454
5569
  );
@@ -5462,7 +5577,7 @@ function renderFarmRouteServerTree(element) { return element; }`;
5462
5577
  hydrationPlanOptions
5463
5578
  )
5464
5579
  }));
5465
- const markdownPagePlan = _chunkAS2VPMEEcjs.createMarkdownPageHydrationPlanner.call(void 0,
5580
+ const markdownPagePlan = _chunkROQ4C4LJcjs.createMarkdownPageHydrationPlanner.call(void 0,
5466
5581
  _chunkOHY2ZWUGcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunkOHY2ZWUGcjs.resolveMdxConfig.call(void 0, config.mdx), config.root),
5467
5582
  config.root,
5468
5583
  isolatedHydrationMode,
@@ -5471,7 +5586,7 @@ function renderFarmRouteServerTree(element) { return element; }`;
5471
5586
  const pageHydrationPlans = new Map(
5472
5587
  pageRoutes.map((route) => [
5473
5588
  route.modulePath,
5474
- _chunkEKN7NSZOcjs.isFarmMarkdownPageFile.call(void 0, route.modulePath) ? markdownPagePlan() : getCachedClientModuleHydrationPlan(
5589
+ _chunkSZLNU3GJcjs.isFarmMarkdownPageFile.call(void 0, route.modulePath) ? markdownPagePlan() : getCachedClientModuleHydrationPlan(
5475
5590
  route.modulePath,
5476
5591
  config.root,
5477
5592
  isolatedHydrationMode,
@@ -5480,7 +5595,7 @@ function renderFarmRouteServerTree(element) { return element; }`;
5480
5595
  )
5481
5596
  ])
5482
5597
  );
5483
- _chunkAS2VPMEEcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
5598
+ _chunkROQ4C4LJcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
5484
5599
  layoutHydrationPlans.map((layout) => ({
5485
5600
  pattern: layout.pattern,
5486
5601
  depth: layout.pattern.split("/").filter(Boolean).length,
@@ -5489,10 +5604,10 @@ function renderFarmRouteServerTree(element) { return element; }`;
5489
5604
  pageRoutes.map((route) => ({
5490
5605
  // Compared by directory so a grouped layout applies only inside its group.
5491
5606
  pattern: _nullishCoalesce(route.directory, () => ( route.pattern)),
5492
- depth: _chunkRVXFINNScjs.getRouteDirectoryDepth.call(void 0, _nullishCoalesce(route.directory, () => ( route.pattern))),
5607
+ depth: _chunkL6HYACBEcjs.getRouteDirectoryDepth.call(void 0, _nullishCoalesce(route.directory, () => ( route.pattern))),
5493
5608
  metadata: pageHydrationPlans.get(route.modulePath)
5494
5609
  })),
5495
- _chunkRVXFINNScjs.routeBoundaryCoversDirectory
5610
+ _chunkL6HYACBEcjs.routeBoundaryCoversDirectory
5496
5611
  );
5497
5612
  const providerServerImports = [
5498
5613
  providerServerModules.hasClerkProvider ? `import { ClerkProvider as FarmClerkProvider } from "@clerk/react";` : "",
@@ -5509,7 +5624,7 @@ function renderFarmRouteServerTree(element) { return element; }`;
5509
5624
  apiRegistrations.push(`
5510
5625
  {
5511
5626
  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)])))},
5627
+ methods: ${JSON.stringify(route.methods.filter((method) => !_optionalChain([route, 'access', _110 => _110.pluginMethods, 'optionalAccess', _111 => _111.includes, 'call', _112 => _112(method)])))},
5513
5628
  endpoints: ${varName},
5514
5629
  }`);
5515
5630
  });
@@ -5522,7 +5637,7 @@ function renderFarmRouteServerTree(element) { return element; }`;
5522
5637
  }).map(({ route }) => route);
5523
5638
  orderedPageRoutes.forEach((route, index) => {
5524
5639
  const varName = `pageRoute${index}`;
5525
- if (_chunkEKN7NSZOcjs.isFarmMarkdownPageFile.call(void 0, route.modulePath)) {
5640
+ if (_chunkSZLNU3GJcjs.isFarmMarkdownPageFile.call(void 0, route.modulePath)) {
5526
5641
  pageRegistrations.push(`
5527
5642
  {
5528
5643
  pattern: ${JSON.stringify(route.pattern)},${route.directory ? `
@@ -5546,7 +5661,7 @@ function renderFarmRouteServerTree(element) { return element; }`;
5546
5661
  `import * as ${varName} from ${toVirtualEntryImportSpecifier(route.modulePath)};`
5547
5662
  );
5548
5663
  const clientMetadata = pageHydrationPlans.get(route.modulePath);
5549
- const renderingDirective = parseRouteRenderingDirectiveFromDisk(route.modulePath);
5664
+ const renderingDirective = _chunkQEILRWVVcjs.readRouteRenderingDirectiveFromFile.call(void 0, route.modulePath);
5550
5665
  pageRegistrations.push(`
5551
5666
  {
5552
5667
  pattern: ${JSON.stringify(route.pattern)},${route.directory ? `
@@ -5554,7 +5669,7 @@ function renderFarmRouteServerTree(element) { return element; }`;
5554
5669
  module: ${varName},
5555
5670
  shouldHydrate: ${JSON.stringify(clientMetadata.shouldHydrate)},${clientMetadata.shouldHydrate ? `
5556
5671
  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 ? `
5672
+ islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${_chunkROQ4C4LJcjs.usesFarmServerTree.call(void 0, clientMetadata) ? "\n serverTree: true," : ""}${renderingDirective ? `
5558
5673
  rendering: ${JSON.stringify(renderingDirective)},` : ""}
5559
5674
  ${route.source !== void 0 ? `markdownSource: {
5560
5675
  source: ${JSON.stringify(route.source)},
@@ -5611,12 +5726,12 @@ function renderFarmRouteServerTree(element) { return element; }`;
5611
5726
  errorImports.push(
5612
5727
  `import * as ${varName} from ${toVirtualEntryImportSpecifier(errorRoute.modulePath)};`
5613
5728
  );
5614
- const groupScope = _chunkRVXFINNScjs.getRouteGroupScope.call(void 0, errorRoute.pattern);
5729
+ const groupScope = _chunkL6HYACBEcjs.getRouteGroupScope.call(void 0, errorRoute.pattern);
5615
5730
  errorRegistrations.push(`
5616
5731
  {
5617
- pattern: ${JSON.stringify(_chunkRVXFINNScjs.stripRouteGroups.call(void 0, errorRoute.pattern))},${groupScope ? `
5732
+ pattern: ${JSON.stringify(_chunkL6HYACBEcjs.stripRouteGroups.call(void 0, errorRoute.pattern))},${groupScope ? `
5618
5733
  groupScope: ${JSON.stringify(groupScope)},
5619
- directoryDepth: ${_chunkRVXFINNScjs.getRouteDirectoryDepth.call(void 0, errorRoute.pattern)},` : ""}
5734
+ directoryDepth: ${_chunkL6HYACBEcjs.getRouteDirectoryDepth.call(void 0, errorRoute.pattern)},` : ""}
5620
5735
  module: ${varName},
5621
5736
  }`);
5622
5737
  });
@@ -5722,6 +5837,8 @@ function renderFarmRouteServerTree(element) { return element; }`;
5722
5837
  createFarmProductionLifecycle,
5723
5838
  createFarmNodeRequestAbortSignal,
5724
5839
  createProductionMiddlewareRunner,
5840
+ _withFarmGuardedResponseCache,
5841
+ _farmPluginsKeepResponsesPrivate,
5725
5842
  getTheme as getFarmTheme,
5726
5843
  emitFarmEvent,
5727
5844
  getFarmDataCache,
@@ -5759,7 +5876,7 @@ function renderFarmRouteServerTree(element) { return element; }`;
5759
5876
  stripFarmLocaleFromPathname,
5760
5877
  withFarmRouteContext,
5761
5878
  createLateNotFoundRecovery,
5762
- createLateRedirectRecovery,
5879
+ createLateRedirectRecovery,${hasFarmServerStorageConfig(config.storage) ? "\n _registerFarmStorageModules,\n disposeFarmStorage,\n initFarmStorage," : ""}
5763
5880
  } from "@farm.js/core/internal/production-runtime";`;
5764
5881
  const productionSiteTelemetryImport = config.telemetry ? `import { createFarmProductionSiteReporter } from "@farm.js/core/internal/product-telemetry-runtime";` : "";
5765
5882
  const metadataImageRuntimeImport = hasGeneratedMetadataImages ? `import { createFarmMetadataImageResponse } from "@farm.js/core/internal/metadata-image-runtime";` : "";
@@ -5767,25 +5884,25 @@ function renderFarmRouteServerTree(element) { return element; }`;
5767
5884
  const infraAnalyticsImport = hasInfraAnalyticsRuntime ? `import { ${hasPluginRuntime ? "createFarmInfraAnalyticsPlugin" : "createFarmInfraAnalyticsRecorder"} } from "@farm.js/core/internal/infra-analytics-runtime";` : "";
5768
5885
  const compressionRuntimeImport = hasCompressionRuntime ? `import { compressFarmResponse${hasPluginRuntime ? ", createCompressionPlugin" : ""} } from "@farm.js/core/internal/compression-runtime";` : "";
5769
5886
  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";
5887
+ const docsHandlerImport = _optionalChain([config, 'access', _113 => _113.docs, 'optionalAccess', _114 => _114.enabled]) ? hasPrecompiledDocs ? `import { createFarmDocsPrecompiledRuntime } from "@farm.js/core/internal/docs-precompiled-runtime";
5771
5888
  const isFarmDocsAPIRequest = (requestOrPathname) => {
5772
5889
  const pathname = typeof requestOrPathname === "string"
5773
5890
  ? requestOrPathname
5774
5891
  : new URL(requestOrPathname.url).pathname;
5775
- const apiPath = ${JSON.stringify(_optionalChain([farmDocsPrecompiledManifest, 'optionalAccess', _112 => _112.apiPath]) || "/api/docs")};
5892
+ const apiPath = ${JSON.stringify(_optionalChain([farmDocsPrecompiledManifest, 'optionalAccess', _115 => _115.apiPath]) || "/api/docs")};
5776
5893
  return pathname === apiPath || pathname.startsWith(apiPath + "/");
5777
5894
  };` : adapterOwnsDocsRuntime ? `import { isFarmDocsAPIRequest } from "@farm.js/core/docs";
5778
5895
  import { createFarmDocsRuntimeHandler as createFarmDocsAdapterRuntimeHandler } from ${JSON.stringify(config.docs.adapter.server)};
5779
5896
  import * as FarmDocsAdapterReact from ${JSON.stringify(config.docs.adapter.react)};${docsConfigModulePath ? `
5780
5897
  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";
5898
+ const docsFontImport = _optionalChain([config, 'access', _116 => _116.docs, 'optionalAccess', _117 => _117.enabled]) && !hasPrecompiledDocs ? `import { resolveFarmLayoutFonts } from "@farm.js/core/font";` : "";
5899
+ const docsRuntimeImport = _optionalChain([config, 'access', _118 => _118.docs, 'optionalAccess', _119 => _119.enabled]) && !hasPrecompiledDocs ? `import { existsSync as farmDocsExistsSync } from "node:fs";
5783
5900
  import { dirname as farmDocsDirname, join as farmDocsJoin } from "node:path";
5784
5901
  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";` : "";
5902
+ const markdownHandlerImport = _optionalChain([config, 'access', _120 => _120.md, 'optionalAccess', _121 => _121.enabled]) ? `import { applyMarkdownNegotiationHeaders, createMarkdownMirrorResponse, getFarmMarkdownAlternatePath } from "@farm.js/core/markdown";` : "";
5786
5903
  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
5904
  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;
5905
+ 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
5906
  const mdxComponentsImport = mdxComponentsPath ? `import * as FarmMdxComponentsModule from ${toVirtualEntryImportSpecifier(mdxComponentsPath)};` : "";
5790
5907
  const layerConfigPaths = (config.layers || []).map((layer) => layer.configFile).filter((configFile) => Boolean(configFile)).filter((configFile) => configFile !== configModulePath);
5791
5908
  const layerConfigImports = layerConfigPaths.map(
@@ -5803,7 +5920,7 @@ import { fileURLToPath as farmDocsFileURLToPath } from "node:url";` : "";
5803
5920
  const integrationRuntimeImport = integrationRuntimeExports.length ? `import { ${integrationRuntimeExports.join(", ")} } from "@farm.js/core/integrations";` : "";
5804
5921
  const instrumentationImport = instrumentationPath ? `import * as FarmInstrumentationModule from ${toVirtualEntryImportSpecifier(instrumentationPath)};` : "";
5805
5922
  const nativeAuth = generateNativeAuthIntegrationSource(config.auth);
5806
- const nativeMCP = _chunk5ULKUBIAcjs.generateNativeMCPPluginSource.call(void 0, config.mcp);
5923
+ const nativeMCP = _chunkPN676AZFcjs.generateNativeMCPPluginSource.call(void 0, config.mcp);
5807
5924
  const integrationImports = `
5808
5925
  ${configModulePath ? `import * as FarmUserConfigModule from ${toVirtualEntryImportSpecifier(configModulePath)};` : ""}
5809
5926
  ${layerConfigImports}
@@ -5811,8 +5928,8 @@ ${integrationRuntimeImport}
5811
5928
  ${nativeAuth.importSource}
5812
5929
  ${nativeMCP.importSource}
5813
5930
  `;
5814
- const imageRuntime = resolveImageRuntime(config, preset);
5815
- const imageRuntimeImport = imageRuntime === "none" ? "" : `import { createCloudflareImageTransformer, createFarmImageHandler } from "@farm.js/core/image/server";`;
5931
+ const imageRuntime = _chunkROQ4C4LJcjs.resolveFarmImageServerRuntime.call(void 0, config.images, preset);
5932
+ const imageRuntimeImport = imageRuntime === "none" ? "" : `import { _withFarmImageSourceClientAddress, createCloudflareImageTransformer, createFarmImageHandler } from "@farm.js/core/image/server";`;
5816
5933
  const imageNodeRuntimeImport = imageRuntime === "node" ? `import { createNodeImageFetcher, createNodeImageUrlValidator, createSharpImageTransformer } from "@farm.js/core/image/sharp";` : "";
5817
5934
  const apiHandlerCode = apiRoutes.length > 0 ? `
5818
5935
  const matchBuiltAPIRoute = createStaticAPIRouteMatcherAtBasePath(apiRoutes, farmLocalAPIBasePath);
@@ -5990,7 +6107,7 @@ const farmResolvedRuntimeConfig = Object.assign({}, ...farmRuntimeConfigs);
5990
6107
 
5991
6108
  function FarmDefault404Page() {
5992
6109
  return React.createElement(React.Fragment, null,
5993
- React.createElement("style", null, ${JSON.stringify(_chunkAS2VPMEEcjs.DEFAULT_NOT_FOUND_STYLES)}),
6110
+ React.createElement("style", null, ${JSON.stringify(_chunkROQ4C4LJcjs.DEFAULT_NOT_FOUND_STYLES)}),
5994
6111
  React.createElement("main", {
5995
6112
  className: "farm-default-not-found",
5996
6113
  "aria-labelledby": "farm-default-not-found-title",
@@ -6083,7 +6200,7 @@ const serverRuntimeIntegrations = Object.fromEntries(
6083
6200
  );
6084
6201
  const integrationRuntimeConfig = Object.assign({}, ...farmRuntimeConfigs, {
6085
6202
  integrations: configuredIntegrations,
6086
- ${JSON.stringify(_chunkBWIQR4DHcjs.FARM_INTEGRATION_API_BASE_PATH_KEY)}: ${JSON.stringify(_chunkKNBBQHO2cjs.resolveFarmAPIServerBasePath.call(void 0, config.api))},
6203
+ ${JSON.stringify(_chunkRHGK2JENcjs.FARM_INTEGRATION_API_BASE_PATH_KEY)}: ${JSON.stringify(_chunkKNBBQHO2cjs.resolveFarmAPIServerBasePath.call(void 0, config.api))},
6087
6204
  });
6088
6205
  const farmInfraAnalytics = ${hasInfraAnalyticsRuntime ? hasPluginRuntime ? "createFarmInfraAnalyticsPlugin()" : "createFarmInfraAnalyticsRecorder()" : "null"};
6089
6206
  const configuredPlugins = [
@@ -6106,6 +6223,10 @@ const farmPluginRuntime = ${hasPluginRuntime ? `configuredPlugins.length > 0
6106
6223
  return manager;
6107
6224
  })()
6108
6225
  : null` : "null"};
6226
+ // A plugin's runtime.before runs for every request and may be a guard, like middleware.
6227
+ const farmPluginRuntimeKeepsResponsesPrivate = farmPluginRuntime
6228
+ ? _farmPluginsKeepResponsesPrivate(configuredPlugins)
6229
+ : false;
6109
6230
  const hasFarmPluginHTMLTransforms = configuredPlugins.some(
6110
6231
  (plugin) => plugin.render?.html || plugin.afterRender || plugin.transformHTML,
6111
6232
  );
@@ -6119,14 +6240,14 @@ const farmImageHandler = ${imageRuntime === "none" ? "null" : imageRuntime === "
6119
6240
  onError(error) { console.error("[Farm Image]", error); },
6120
6241
  })`};
6121
6242
  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)};` : ""}
6243
+ const farmLlmsTxtConfig = ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access', _124 => _124.agent, 'optionalAccess', _125 => _125.llmsTxt]), () => ( { enabled: false, include: [], exclude: [] })))};
6244
+ ${_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
6245
  const farmMdxConfig = ${JSON.stringify({
6125
6246
  ...config.mdx,
6126
- components: typeof _optionalChain([config, 'access', _126 => _126.mdx, 'optionalAccess', _127 => _127.components]) === "string" ? config.mdx.components : void 0
6247
+ components: typeof _optionalChain([config, 'access', _129 => _129.mdx, 'optionalAccess', _130 => _130.components]) === "string" ? config.mdx.components : void 0
6127
6248
  })};
6128
6249
  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
6250
+ ${_optionalChain([config, 'access', _131 => _131.agent, 'optionalAccess', _132 => _132.noindexPreviews]) ? `// agent.noindexPreviews: the runtime environment decides, falling back to the
6130
6251
  // environment this was built in, since Netlify exposes its deploy context only
6131
6252
  // to the build.
6132
6253
  const farmNoindexPreview = resolveFarmPreviewDeployment(
@@ -6139,6 +6260,7 @@ const farmObservabilityConfig = farmUserConfig?.observability ?? ${JSON.stringif
6139
6260
  )};
6140
6261
  configureFarmObservability(farmObservabilityConfig);
6141
6262
  configureFarmCache(farmResolvedRuntimeConfig.cache);
6263
+ ${createFarmStorageModuleRegistration(config)}
6142
6264
  const farmI18nConfig = ${JSON.stringify(config.i18n)};
6143
6265
  const farmServerConfig = ${JSON.stringify(config.server)};
6144
6266
  const farmThemeConfig = ${JSON.stringify(config.theme)};
@@ -6157,9 +6279,11 @@ export const farmProductionLifecycle = createFarmProductionLifecycle({
6157
6279
  server: farmServerConfig,
6158
6280
  start: async () => {
6159
6281
  await farmInstrumentationLifecycle.start();
6160
- try {
6282
+ try {${hasFarmServerStorageConfig(config.storage) ? `
6283
+ // The configured drivers and mounts, as the development server applies them.
6284
+ await initFarmStorage(farmResolvedRuntimeConfig.storage);` : ""}
6161
6285
  await farmPluginRuntime?.startRuntime();
6162
- } catch (error) {
6286
+ } catch (error) {${hasFarmServerStorageConfig(config.storage) ? "\n await disposeFarmStorage();" : ""}
6163
6287
  await farmInstrumentationLifecycle.shutdown();
6164
6288
  throw error;
6165
6289
  }
@@ -6167,14 +6291,14 @@ export const farmProductionLifecycle = createFarmProductionLifecycle({
6167
6291
  close: async (reason) => {
6168
6292
  try {
6169
6293
  await farmPluginRuntime?.closeRuntime(reason);${hasInfraAnalyticsRuntime && !hasPluginRuntime ? "\n await farmInfraAnalytics?.close();" : ""}
6170
- } finally {
6294
+ } finally {${hasFarmServerStorageConfig(config.storage) ? "\n await disposeFarmStorage();" : ""}
6171
6295
  await farmInstrumentationLifecycle.shutdown();
6172
6296
  }
6173
6297
  },
6174
6298
  });
6175
6299
  const farmI18nRuntime = ${config.i18n.enabled ? `createFarmI18nRuntime(farmI18nConfig, ${JSON.stringify(i18nCatalogs)})` : "null"};
6176
6300
  ${config.i18n.enabled ? "_setDefaultFarmI18nRuntime(farmI18nRuntime);" : ""}
6177
- const farmDocsBundledContentDir = ${_optionalChain([config, 'access', _130 => _130.docs, 'optionalAccess', _131 => _131.enabled]) && !hasPrecompiledDocs ? `(() => {
6301
+ const farmDocsBundledContentDir = ${_optionalChain([config, 'access', _133 => _133.docs, 'optionalAccess', _134 => _134.enabled]) && !hasPrecompiledDocs ? `(() => {
6178
6302
  try {
6179
6303
  const currentDir = farmDocsDirname(farmDocsFileURLToPath(import.meta.url));
6180
6304
  const candidates = [
@@ -6224,7 +6348,7 @@ const farmDocsModulePreloadPaths = farmDocsModulePreloads
6224
6348
  ),
6225
6349
  }
6226
6350
  : undefined;
6227
- const farmDocsHandler = ${_optionalChain([config, 'access', _132 => _132.docs, 'optionalAccess', _133 => _133.enabled]) ? hasPrecompiledDocs ? "farmDocsPrecompiledRuntime.handleDocsRequest" : adapterOwnsDocsRuntime ? `createFarmDocsAdapterRuntimeHandler({
6351
+ const farmDocsHandler = ${_optionalChain([config, 'access', _135 => _135.docs, 'optionalAccess', _136 => _136.enabled]) ? hasPrecompiledDocs ? "farmDocsPrecompiledRuntime.handleDocsRequest" : adapterOwnsDocsRuntime ? `createFarmDocsAdapterRuntimeHandler({
6228
6352
  ${docsConfigModulePath ? "...(farmDocsConfigModule.default || farmDocsConfigModule),\n ...farmDocsResolvedConfig.configOverrides," : "...farmDocsResolvedConfig.config,"}
6229
6353
  entry: farmDocsResolvedConfig.config?.entry || String(farmDocsResolvedConfig.entry || "/docs").replace(/^\\/+|\\/+$/g, "") || "docs",
6230
6354
  docsPath: farmDocsResolvedConfig.entry,
@@ -6261,11 +6385,11 @@ const farmDocsHandler = ${_optionalChain([config, 'access', _132 => _132.docs, '
6261
6385
  globalStylesheetHref: "/assets/globals.css",
6262
6386
  isPathGuarded: isFarmDocsPathGuarded,
6263
6387
  })` : "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"};
6388
+ 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
6389
 
6266
6390
  // API routes bundled at build time
6267
6391
  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 })` : ""};
6392
+ ]${apiRoutes.length > 0 ? `, configuredPlugins, ${JSON.stringify(apiRoutes.map(({ path: path11, methods }) => ({ path: path11, methods })))}, { bodySizeLimit: ${JSON.stringify(config.server.bodySizeLimit)}, dispatch: dispatchFarmPluginAPIRequest })` : ""};
6269
6393
  // A plugin calling an app endpoint (an MCP tool, say) goes through the whole
6270
6394
  // pipeline, so the endpoint's middleware and integration guards run for it.
6271
6395
  function dispatchFarmPluginAPIRequest(request) {
@@ -6286,12 +6410,12 @@ function fetchFarmInnerRequest(request, context) {
6286
6410
  }
6287
6411
  const farmLocalAPIBasePath = ${JSON.stringify(_chunkKNBBQHO2cjs.resolveFarmAPIServerBasePath.call(void 0, config.api))};
6288
6412
  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, {
6413
+ ${_optionalChain([config, 'access', _139 => _139.agent, 'optionalAccess', _140 => _140.apiCatalog]) ? `const farmApiCatalogInput = ${JSON.stringify(_chunkL6HYACBEcjs.resolveFarmApiCatalogInput.call(void 0, config))};
6414
+ ` : ""}${_optionalChain([config, 'access', _141 => _141.agent, 'optionalAccess', _142 => _142.manifest]) !== false ? `const farmAppManifestInput = ${JSON.stringify(
6415
+ _chunkL6HYACBEcjs.resolveFarmAppManifestInput.call(void 0, config, {
6292
6416
  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) : []
6417
+ packages: _chunkROQ4C4LJcjs.resolveFarmAppPackages.call(void 0, config.root),
6418
+ webmcpTools: config.plugins.some(({ name }) => name === "farm:webmcp") ? _chunkROQ4C4LJcjs.collectFarmWebMCPTools.call(void 0, config.root, config.srcDir) : []
6295
6419
  })
6296
6420
  )};
6297
6421
  ${servesDefaultMCP ? "farmAppManifestInput.defaultMCP = getFarmDefaultMCPServer;\n" : ""}// A guard written for an MCP server's path keeps its tools out of the public view.
@@ -6765,8 +6889,8 @@ function stripFarmDocumentWrappers(markup) {
6765
6889
  function peelFarmDocumentPrefix(markup) {
6766
6890
  let inner = markup.replace(/^\\s+/, "");
6767
6891
  let hoisted = "";
6768
- const wrapper = /^<div\\b[^>]*style=["']display\\s*:\\s*contents["'][^>]*>/i;
6769
- const hoistable = /${_chunkRVXFINNScjs.HOISTED_HEAD_ELEMENT.source}/i;
6892
+ const wrapper = /^<div\\b[^>]*style=["']display\\s*:\\s*contents;?\\s*["'][^>]*>/i;
6893
+ const hoistable = /${_chunkL6HYACBEcjs.HOISTED_HEAD_ELEMENT.source}/i;
6770
6894
  let match;
6771
6895
  while ((match = wrapper.exec(inner) || hoistable.exec(inner))) {
6772
6896
  if (!/^<div/i.test(match[0])) hoisted += match[0];
@@ -7297,7 +7421,7 @@ function createFarmAgentRobotsResponse(request) {
7297
7421
  // a route guard.
7298
7422
  const farmAgentGuardedPages = new Set(${JSON.stringify(
7299
7423
  pageRoutes.map((route) => route.pattern).filter(
7300
- (pattern) => !pattern.includes("[") && _chunkRVXFINNScjs.farmPathGuardCoversPage.call(void 0,
7424
+ (pattern) => !pattern.includes("[") && _chunkL6HYACBEcjs.farmPathGuardCoversPage.call(void 0,
7301
7425
  {
7302
7426
  config: { middleware: config.middleware, integrations: config.integrations },
7303
7427
  middlewareRoutes
@@ -7344,12 +7468,12 @@ ${servesDefaultMCP ? `// agent.mcp: the default read-only MCP server at /mcp, as
7344
7468
  // aside for a page route that answers /mcp and for any MCP server published or
7345
7469
  // registered at runtime, such as the docs engine's.
7346
7470
  const farmDefaultMCPServer = ${JSON.stringify(
7347
- _chunkH5CLOUZScjs.createFarmDefaultMCPServer.call(void 0, readFarmAppPackageIdentity(config.root), _chunkQUCXCDE2cjs.FARM_VERSION)
7471
+ _chunkBMOBTMDRcjs.createFarmDefaultMCPServer.call(void 0, readFarmAppPackageIdentity(config.root), _chunkEH3464KFcjs.FARM_VERSION)
7348
7472
  )};
7349
7473
  let farmDefaultMCPRouteFree;
7350
7474
  function getFarmDefaultMCPServer() {
7351
7475
  if (farmDefaultMCPRouteFree === undefined) {
7352
- farmDefaultMCPRouteFree = !matchPageRoute(${JSON.stringify(_chunkH5CLOUZScjs.FARM_DEFAULT_MCP_PATH)});
7476
+ farmDefaultMCPRouteFree = !matchPageRoute(${JSON.stringify(_chunkBMOBTMDRcjs.FARM_DEFAULT_MCP_PATH)});
7353
7477
  }
7354
7478
  return farmDefaultMCPRouteFree ? resolveFarmDefaultMCPServer(farmDefaultMCPServer) : undefined;
7355
7479
  }
@@ -7644,7 +7768,7 @@ function hasLocalRequestRoute(request, routePathname) {
7644
7768
  if (${imageRuntime === "none" ? "false" : `pathname === ${JSON.stringify(config.images.path)}`}) {
7645
7769
  return true;
7646
7770
  }
7647
- ${_optionalChain([config, 'access', _140 => _140.docs, 'optionalAccess', _141 => _141.enabled]) ? `const docsPath = normalizeRuntimePath(farmDocsResolvedConfig?.entry || "/docs");
7771
+ ${_optionalChain([config, 'access', _143 => _143.docs, 'optionalAccess', _144 => _144.enabled]) ? `const docsPath = normalizeRuntimePath(farmDocsResolvedConfig?.entry || "/docs");
7648
7772
  if (
7649
7773
  isFarmDocsAPIRequest(pathname) ||
7650
7774
  docsPath === "/" ||
@@ -7670,7 +7794,7 @@ function getFarmPluginRequestOptions(request) {
7670
7794
  route: { ...route, pattern: normalizeRuntimePath(farmOpenAPIReference.route) },
7671
7795
  };
7672
7796
  }
7673
- const isDocsAPIRequest = ${_optionalChain([config, 'access', _142 => _142.docs, 'optionalAccess', _143 => _143.enabled]) ? "isFarmDocsAPIRequest(pathname)" : "false"};
7797
+ const isDocsAPIRequest = ${_optionalChain([config, 'access', _145 => _145.docs, 'optionalAccess', _146 => _146.enabled]) ? "isFarmDocsAPIRequest(pathname)" : "false"};
7674
7798
  const integrationMatch = ${hasServerRuntimeIntegrations ? `matchIntegrationRoute(serverRuntimeIntegrations, {
7675
7799
  pathname,
7676
7800
  method: request.method,
@@ -7767,7 +7891,7 @@ function getApplicableLayouts(pathname, directory) {
7767
7891
  return applicable;
7768
7892
  }
7769
7893
 
7770
- ${_optionalChain([config, 'access', _144 => _144.docs, 'optionalAccess', _145 => _145.enabled]) ? `async function wrapFarmDocsResponseWithLayouts(request, response) {
7894
+ ${_optionalChain([config, 'access', _147 => _147.docs, 'optionalAccess', _148 => _148.enabled]) ? `async function wrapFarmDocsResponseWithLayouts(request, response) {
7771
7895
  if (request.method === "HEAD") return response;
7772
7896
  if (response.headers.get("x-farm-docs-adapter")) return response;
7773
7897
 
@@ -7873,8 +7997,9 @@ ${_optionalChain([config, 'access', _144 => _144.docs, 'optionalAccess', _145 =>
7873
7997
  });
7874
7998
  }` : ""}
7875
7999
 
7876
- const pprShellCache = getFarmDataCache();
7877
- const experimentalPPREnabled = ${JSON.stringify(_optionalChain([config, 'access', _146 => _146.experimental, 'optionalAccess', _147 => _147.ppr]) === true)};
8000
+ // Shells keep their own LRU so query-string variants never evict app cache entries.
8001
+ const pprShellCache = getFarmDataCache().pprShellCache;
8002
+ const experimentalPPREnabled = ${JSON.stringify(_optionalChain([config, 'access', _149 => _149.experimental, 'optionalAccess', _150 => _150.ppr]) === true)};
7878
8003
 
7879
8004
  function resolveRouteRenderingView(route) {
7880
8005
  // The same merge development uses: baked directive config under the
@@ -8006,7 +8131,7 @@ async function handleFarmRequest(request, adapterContext) {
8006
8131
  },
8007
8132
  { redirect: !isFarmLocalAPIPathname(requestUrl.pathname) }
8008
8133
  )` : "handleFarmRequestInContext(request, null, false, Date.now(), adapterContext, requestUrl)"};
8009
- ${_optionalChain([config, 'access', _148 => _148.md, 'optionalAccess', _149 => _149.enabled]) ? `const pathname = getFarmRoutePathname(requestUrl.pathname);
8134
+ ${_optionalChain([config, 'access', _151 => _151.md, 'optionalAccess', _152 => _152.enabled]) ? `const pathname = getFarmRoutePathname(requestUrl.pathname);
8010
8135
  if (matchPageRoute(pathname)) {
8011
8136
  // The Link header advertises the public .md URL, like the head alternate.
8012
8137
  return applyMarkdownNegotiationHeaders(response, {
@@ -8017,6 +8142,10 @@ async function handleFarmRequest(request, adapterContext) {
8017
8142
  return response;
8018
8143
  }
8019
8144
 
8145
+ // Middleware that let a request through may have been a guard: an IP allowlist, an API key
8146
+ // header, a VPN header. A CDN keys its copy by URL and never runs the guard on a hit, so
8147
+ // whatever such a request answers stays out of shared caches. Only middleware declaring
8148
+ // cache: "public" (and plugins declaring runtime.cache: "public") leave the policy alone.
8020
8149
  async function handleFarmRequestInContext(
8021
8150
  request,
8022
8151
  farmLocaleResolution,
@@ -8024,6 +8153,31 @@ async function handleFarmRequestInContext(
8024
8153
  requestStartTime = Date.now(),
8025
8154
  adapterContext,
8026
8155
  requestUrl = new URL(request.url),
8156
+ ) {
8157
+ const farmCacheGuard = { guarded: farmPluginRuntimeKeepsResponsesPrivate };
8158
+ const response = await resolveFarmRequestInContext(
8159
+ farmCacheGuard,
8160
+ request,
8161
+ farmLocaleResolution,
8162
+ configuredRewriteApplied,
8163
+ requestStartTime,
8164
+ adapterContext,
8165
+ requestUrl,
8166
+ );
8167
+ if (!farmCacheGuard.guarded) return response;
8168
+ // Tells the Nitro entry, which keeps this policy over a swr rule's public one.
8169
+ adapterContext?.onGuardedResponse?.();
8170
+ return _withFarmGuardedResponseCache(response);
8171
+ }
8172
+
8173
+ async function resolveFarmRequestInContext(
8174
+ farmCacheGuard,
8175
+ request,
8176
+ farmLocaleResolution,
8177
+ configuredRewriteApplied,
8178
+ requestStartTime,
8179
+ adapterContext,
8180
+ requestUrl,
8027
8181
  ) {
8028
8182
  let url = requestUrl;
8029
8183
  let pathname = url.pathname;
@@ -8056,10 +8210,26 @@ async function handleFarmRequestInContext(
8056
8210
  farmLocaleResolution?.locale,
8057
8211
  );
8058
8212
  if (rewriteDestination) {
8059
- const rewrittenRequest = createRewrittenRequest(request, rewriteDestination);
8213
+ let rewrittenRequest = createRewrittenRequest(request, rewriteDestination);
8060
8214
  if (new URL(rewrittenRequest.url).origin !== url.origin) {
8061
8215
  return globalThis.fetch(rewrittenRequest);
8062
8216
  }
8217
+ if (farmPluginRuntime) {
8218
+ // Plugin guards ran on the requested URL. Re-run only runtime.before
8219
+ // so they also see the destination, like middleware does on re-entry.
8220
+ const guarded = await farmPluginRuntime.runRuntimeBeforeForRewrite(
8221
+ request,
8222
+ rewrittenRequest,
8223
+ {
8224
+ ...getFarmPluginRequestOptions(rewrittenRequest),
8225
+ waitUntil: typeof adapterContext?.waitUntil === "function"
8226
+ ? adapterContext.waitUntil.bind(adapterContext)
8227
+ : undefined,
8228
+ },
8229
+ );
8230
+ if (guarded instanceof Response) return guarded;
8231
+ rewrittenRequest = guarded;
8232
+ }
8063
8233
  return _runWithCurrentRequest(rewrittenRequest, () =>
8064
8234
  handleFarmRequestInContext(
8065
8235
  rewrittenRequest,
@@ -8087,6 +8257,7 @@ async function handleFarmRequestInContext(
8087
8257
  const integrationDispatch = await handleIntegrationRequest(
8088
8258
  cloneFarmRequestWithContext(request),
8089
8259
  farmIntegrationRanMiddleware,
8260
+ adapterContext?.clientAddress,
8090
8261
  );
8091
8262
  if (integrationDispatch.response) {
8092
8263
  return integrationDispatch.response;
@@ -8106,6 +8277,7 @@ async function handleFarmRequestInContext(
8106
8277
  if (middlewareResult.response) {
8107
8278
  return middlewareResult.response;
8108
8279
  }
8280
+ if (middlewareResult.guarded) farmCacheGuard.guarded = true;
8109
8281
  request = middlewareResult.request;${hasServerRuntimeIntegrations ? `
8110
8282
  // A ctx.rewrite() target is guarded as a direct request for it is: integration
8111
8283
  // guards (protectedRoutes) and routes see the rewritten URL, as in dev. Guards
@@ -8114,6 +8286,7 @@ async function handleFarmRequestInContext(
8114
8286
  const rewrittenDispatch = await handleIntegrationRequest(
8115
8287
  cloneFarmRequestWithContext(request),
8116
8288
  farmIntegrationRanMiddleware,
8289
+ adapterContext?.clientAddress,
8117
8290
  );
8118
8291
  farmIntegrationSetCookies = [...farmIntegrationSetCookies, ...rewrittenDispatch.setCookies];
8119
8292
  if (rewrittenDispatch.response) {
@@ -8123,6 +8296,9 @@ async function handleFarmRequestInContext(
8123
8296
  );
8124
8297
  }
8125
8298
  }` : ""}
8299
+ ${hasServerRuntimeIntegrations ? `
8300
+ // An integration guard (protectedRoutes) that let the request through.
8301
+ if (farmIntegrationRanMiddleware.size > 0) farmCacheGuard.guarded = true;` : ""}
8126
8302
  const middlewareData = middlewareResult.data;
8127
8303
  const middlewareContext = middlewareResult.context;
8128
8304
  const middlewareHeaders = ${hasServerRuntimeIntegrations ? "withFarmIntegrationSetCookies(middlewareResult.headers, farmIntegrationSetCookies)" : "middlewareResult.headers"};
@@ -8140,6 +8316,9 @@ async function handleFarmRequestInContext(
8140
8316
  const runResolvedRequest = async () => {
8141
8317
  if (middlewareResult.notFound) return renderFarmNotFoundResponse();
8142
8318
  ` : `
8319
+ ${hasServerRuntimeIntegrations ? `
8320
+ // An integration guard (protectedRoutes) that let the request through.
8321
+ if (farmIntegrationRanMiddleware.size > 0) farmCacheGuard.guarded = true;` : ""}
8143
8322
  const middlewareData = undefined;
8144
8323
  const middlewareContext = undefined;
8145
8324
  const middlewareHeaders = ${hasServerRuntimeIntegrations ? "withFarmIntegrationSetCookies(undefined, farmIntegrationSetCookies)" : "undefined"};
@@ -8162,7 +8341,7 @@ async function handleFarmRequestInContext(
8162
8341
  }
8163
8342
  ` : ""}
8164
8343
 
8165
- ${_optionalChain([config, 'access', _150 => _150.docs, 'optionalAccess', _151 => _151.enabled]) ? `
8344
+ ${_optionalChain([config, 'access', _153 => _153.docs, 'optionalAccess', _154 => _154.enabled]) ? `
8166
8345
  // Docs responses are served after app middleware so route guards and
8167
8346
  // middleware headers apply to the docs engine like any other page content.
8168
8347
  // An app's own llms.txt, llms-full.txt, sitemap.xml, and robots.txt take
@@ -8223,7 +8402,7 @@ async function handleFarmRequestInContext(
8223
8402
  }
8224
8403
  ` : ""}
8225
8404
 
8226
- ${_optionalChain([config, 'access', _152 => _152.md, 'optionalAccess', _153 => _153.enabled]) ? `
8405
+ ${_optionalChain([config, 'access', _155 => _155.md, 'optionalAccess', _156 => _156.enabled]) ? `
8227
8406
  if (farmMarkdownConfig?.enabled) {
8228
8407
  const markdownResponse = await createMarkdownMirrorResponse({
8229
8408
  // The mirror helper only reads metadata and creates its own GET request.
@@ -8322,11 +8501,11 @@ async function handleFarmRequestInContext(
8322
8501
  return applyProductionMiddlewareHeaders(applicationMetadataResponse, middlewareHeaders);
8323
8502
  }
8324
8503
  ` : ""}
8325
- ${_optionalChain([config, 'access', _154 => _154.agent, 'optionalAccess', _155 => _155.manifest]) !== false ? `
8504
+ ${_optionalChain([config, 'access', _157 => _157.agent, 'optionalAccess', _158 => _158.manifest]) !== false ? `
8326
8505
  // agent.manifest: /.well-known/farmjs.json (and 0.1.34's /.well-known/farmjs), the app's
8327
8506
  // public manifest; Farm Infra's signed request gets the full view.
8328
8507
  if (
8329
- [${JSON.stringify(_chunkRVXFINNScjs.FARM_APP_MANIFEST_PATH)}, ${JSON.stringify(_chunkRVXFINNScjs.FARM_APP_MANIFEST_LEGACY_PATH)}].includes(
8508
+ [${JSON.stringify(_chunkL6HYACBEcjs.FARM_APP_MANIFEST_PATH)}, ${JSON.stringify(_chunkL6HYACBEcjs.FARM_APP_MANIFEST_LEGACY_PATH)}].includes(
8330
8509
  normalizeRuntimePath(routePathname),
8331
8510
  )
8332
8511
  ) {
@@ -8336,9 +8515,9 @@ async function handleFarmRequestInContext(
8336
8515
  );
8337
8516
  }
8338
8517
  ` : ""}
8339
- ${_optionalChain([config, 'access', _156 => _156.agent, 'optionalAccess', _157 => _157.apiCatalog]) ? `
8518
+ ${_optionalChain([config, 'access', _159 => _159.agent, 'optionalAccess', _160 => _160.apiCatalog]) ? `
8340
8519
  // agent.apiCatalog: list the OpenAPI and MCP surfaces at the RFC 9727 path.
8341
- if (normalizeRuntimePath(routePathname) === ${JSON.stringify(_chunkRVXFINNScjs.FARM_API_CATALOG_PATH)}) {
8520
+ if (normalizeRuntimePath(routePathname) === ${JSON.stringify(_chunkL6HYACBEcjs.FARM_API_CATALOG_PATH)}) {
8342
8521
  return applyProductionMiddlewareHeaders(
8343
8522
  createFarmApiCatalogResponse(request.method, farmApiCatalogInput, request),
8344
8523
  middlewareHeaders,
@@ -8363,11 +8542,11 @@ async function handleFarmRequestInContext(
8363
8542
  );
8364
8543
  }
8365
8544
  ` : ""}
8366
- ${_optionalChain([config, 'access', _158 => _158.agent, 'optionalAccess', _159 => _159.llmsTxt, 'optionalAccess', _160 => _160.enabled]) ? `
8545
+ ${_optionalChain([config, 'access', _161 => _161.agent, 'optionalAccess', _162 => _162.llmsTxt, 'optionalAccess', _163 => _163.enabled]) ? `
8367
8546
  // agent.llmsTxt with no llms.ts or llms-full.ts: serve the generated files.
8368
8547
  const farmGeneratedLlmsKind = normalizeRuntimePath(routePathname) === "/llms.txt"
8369
8548
  ? "llms"
8370
- : ${_optionalChain([config, 'access', _161 => _161.agent, 'optionalAccess', _162 => _162.llmsTxt, 'optionalAccess', _163 => _163.full]) ? `normalizeRuntimePath(routePathname) === "/llms-full.txt" ? "llms-full" : ` : ""}null;
8549
+ : ${_optionalChain([config, 'access', _164 => _164.agent, 'optionalAccess', _165 => _165.llmsTxt, 'optionalAccess', _166 => _166.full]) ? `normalizeRuntimePath(routePathname) === "/llms-full.txt" ? "llms-full" : ` : ""}null;
8371
8550
  if (farmGeneratedLlmsKind) {
8372
8551
  const llmsContext = createFarmLlmsTxtContext(request, farmGeneratedLlmsKind === "llms-full");
8373
8552
  const llmsOrigin = new URL(request.url).origin;
@@ -8402,7 +8581,7 @@ async function handleFarmRequestInContext(
8402
8581
  }
8403
8582
  ` : ""}
8404
8583
 
8405
- ${_optionalChain([config, 'access', _164 => _164.docs, 'optionalAccess', _165 => _165.enabled]) ? `if (farmDocsAPIHandler && isFarmDocsAPIRequest(pathname)) {
8584
+ ${_optionalChain([config, 'access', _167 => _167.docs, 'optionalAccess', _168 => _168.enabled]) ? `if (farmDocsAPIHandler && isFarmDocsAPIRequest(pathname)) {
8406
8585
  const docsAPIResponse = await farmDocsAPIHandler(cloneFarmRequestWithContext(request));
8407
8586
  if (docsAPIResponse) {
8408
8587
  return applyProductionMiddlewareHeaders(
@@ -8863,7 +9042,7 @@ async function handleFarmRequestInContext(
8863
9042
  );
8864
9043
  }
8865
9044
  }
8866
- ${_optionalChain([config, 'access', _166 => _166.md, 'optionalAccess', _167 => _167.enabled]) ? `
9045
+ ${_optionalChain([config, 'access', _169 => _169.md, 'optionalAccess', _170 => _170.enabled]) ? `
8867
9046
  // Advertise the Markdown mirror in the head as well as the Link header,
8868
9047
  // using the public path the .md request will be resolved against.
8869
9048
  mergedMetadata = addMetadataMarkdownAlternate(
@@ -8882,7 +9061,7 @@ async function handleFarmRequestInContext(
8882
9061
  emitFarmEvent({ type: "cache.bypass", route: pathname, reason: "request-read" });
8883
9062
  }
8884
9063
 
8885
- const renderedMetadata = renderMetadataHead(mergedMetadata, { pathname, jsonLd: ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access', _168 => _168.agent, 'optionalAccess', _169 => _169.jsonLd]), () => ( false)))} });
9064
+ const renderedMetadata = renderMetadataHead(mergedMetadata, { pathname, jsonLd: ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access', _171 => _171.agent, 'optionalAccess', _172 => _172.jsonLd]), () => ( false)))} });
8886
9065
  const title = renderedMetadata.title;
8887
9066
  const metaTags = renderedMetadata.tags;
8888
9067
  const hasFavicon = renderedMetadata.hasFavicon;
@@ -9309,7 +9488,7 @@ async function handleFarmRequestInContext(
9309
9488
  ${servesDefaultMCP ? `
9310
9489
  // agent.mcp: no app route answered /mcp, so the default read-only server may.
9311
9490
  if (
9312
- normalizeRuntimePath(routePathname) === ${JSON.stringify(_chunkH5CLOUZScjs.FARM_DEFAULT_MCP_PATH)} &&
9491
+ normalizeRuntimePath(routePathname) === ${JSON.stringify(_chunkBMOBTMDRcjs.FARM_DEFAULT_MCP_PATH)} &&
9313
9492
  getFarmDefaultMCPServer()
9314
9493
  ) {
9315
9494
  return applyProductionMiddlewareHeaders(
@@ -9522,12 +9701,14 @@ async function handleFarmPluginRequest(request, runtimeOptions, adapterContext)
9522
9701
  ${generatePreloadResponseRuntimeSource()}
9523
9702
 
9524
9703
  // 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({
9704
+ export async function fetch(request, context) {${imageRuntime === "none" ? "" : `
9705
+ // The image optimizer's fetch of a local source is not a loopback visitor.
9706
+ context = _withFarmImageSourceClientAddress(request, context);`}
9707
+ ${_optionalChain([config, 'access', _173 => _173.agent, 'optionalAccess', _174 => _174.noindexPreviews]) ? "const response = await" : "return"} _runWithAPIRequestRuntime({
9527
9708
  basePath: farmLocalAPIBasePath,
9528
9709
  dispatch: async (localRequest) =>
9529
9710
  (await handleAPIRequest(localRequest)) ?? Response.json({ error: "Not Found" }, { status: 404 }),
9530
- }, () => handleFarmFetch(request, context));${_optionalChain([config, 'access', _172 => _172.agent, 'optionalAccess', _173 => _173.noindexPreviews]) ? `
9711
+ }, () => handleFarmFetch(request, context));${_optionalChain([config, 'access', _175 => _175.agent, 'optionalAccess', _176 => _176.noindexPreviews]) ? `
9531
9712
  // Keep every response of a preview deployment out of search indexes.
9532
9713
  return farmNoindexPreview ? applyFarmPreviewRobotsTag(response) : response;` : ""}
9533
9714
  }
@@ -9544,6 +9725,20 @@ async function handleFarmFetch(request, context) {
9544
9725
  typeof context?.waitUntil === "function" ? context.waitUntil.bind(context) : undefined,
9545
9726
  );
9546
9727
 
9728
+ // headers() config applies after middleware let the request through, so it learns
9729
+ // whether the response was guarded and can't make that response shareable again.
9730
+ let farmGuardedResponse = false;
9731
+ if (configuredHeaderRoutes.length > 0) {
9732
+ const adapterContext = context;
9733
+ context = {
9734
+ ...adapterContext,
9735
+ onGuardedResponse() {
9736
+ farmGuardedResponse = true;
9737
+ adapterContext?.onGuardedResponse?.();
9738
+ },
9739
+ };
9740
+ }
9741
+
9547
9742
  return farmProductionLifecycle.runRequest(
9548
9743
  () =>
9549
9744
  runWithFarmRequestSpan(request, async () => {
@@ -9558,9 +9753,11 @@ async function handleFarmFetch(request, context) {
9558
9753
  const routePathname = configuredHeaderRoutes.length > 0
9559
9754
  ? getFarmRoutePathname(new URL(runtimeRequest.url).pathname)
9560
9755
  : undefined;
9756
+ const configured = applyConfiguredResponseHeaders(response, routePathname);
9561
9757
  return applyFarmPreloadBudget(
9562
9758
  applyFarmCspNonceToResponse(
9563
- applyConfiguredResponseHeaders(response, routePathname),
9759
+ // Configured headers may edit the response in place, so check it either way.
9760
+ farmGuardedResponse ? _withFarmGuardedResponseCache(configured) : configured,
9564
9761
  farmSecurityConfig,
9565
9762
  cspNonce,
9566
9763
  ),
@@ -9705,13 +9902,13 @@ function getPhysicalPrerenderBypassReason(options) {
9705
9902
  if (rewriteSources.some((source) => middlewarePatternMatches(source, pathname))) {
9706
9903
  return "rewrite";
9707
9904
  }
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";
9905
+ if (_chunkL6HYACBEcjs.appMiddlewareMayHandlePath.call(void 0, middlewareRoutes, pathname)) return "app middleware";
9906
+ if (_chunkL6HYACBEcjs.configMiddlewareMayHandlePath.call(void 0, config.middleware, pathname)) return "configured middleware";
9907
+ if (_chunkEX4MKHXNcjs.hasCustomFarmRouteContext.call(void 0, config)) return "request context";
9711
9908
  if (farmServerRuntimePluginsMayHandlePath(config, pathname)) return "server runtime plugin";
9712
9909
  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)) {
9910
+ if (_optionalChain([manifestEntry, 'optionalAccess', _177 => _177.rendering]) === "dynamic") return "dynamic runtime manifest";
9911
+ if (manifestEntry && (manifestEntry.runtime !== "auto" || Boolean(_optionalChain([manifestEntry, 'access', _178 => _178.regions, 'optionalAccess', _179 => _179.length])) || manifestEntry.maxDuration !== void 0)) {
9715
9912
  return "route runtime controls";
9716
9913
  }
9717
9914
  const routeRule = getEffectiveRouteRule(config, pathname);
@@ -9724,8 +9921,17 @@ function getPhysicalPrerenderBypassReason(options) {
9724
9921
  return void 0;
9725
9922
  }
9726
9923
  _chunkS3JO3N4Hcjs.__name.call(void 0, getPhysicalPrerenderBypassReason, "getPhysicalPrerenderBypassReason");
9924
+ function hasFarmNitroCacheRouteRule(routeRules) {
9925
+ return Object.values(routeRules || {}).some((rule) => {
9926
+ const swr = _optionalChain([rule, 'optionalAccess', _180 => _180.swr]);
9927
+ const cache = _optionalChain([rule, 'optionalAccess', _181 => _181.cache]);
9928
+ const headers = _optionalChain([rule, 'optionalAccess', _182 => _182.headers]);
9929
+ return swr !== void 0 && swr !== false || cache !== void 0 && cache !== false || !!headers && typeof headers === "object" && Object.keys(headers).length > 0;
9930
+ });
9931
+ }
9932
+ _chunkS3JO3N4Hcjs.__name.call(void 0, hasFarmNitroCacheRouteRule, "hasFarmNitroCacheRouteRule");
9727
9933
  async function buildNitroUniversal(config, routeManager, apiRouteManager, serverRenderer, preset, root, distDir, ssrBundle, ssrEntryFile, clientOutputDir, routeRuntimeManifest, configuredHeaderRoutes, nitroBuilderResultPromise, pluginManager) {
9728
- const [fs3, nitroBuilderResult] = await Promise.all([
9934
+ const [fs4, nitroBuilderResult] = await Promise.all([
9729
9935
  import("fs/promises"),
9730
9936
  nitroBuilderResultPromise
9731
9937
  ]);
@@ -9733,10 +9939,10 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
9733
9939
  const nitroBuilder = nitroBuilderResult.value;
9734
9940
  const isVercel = preset === "vercel" || preset === "vercel-edge";
9735
9941
  const isCloudflareWorker = preset === "cloudflare-module";
9736
- const outputDir = _chunkHRETEZ2Zcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
9942
+ const outputDir = _chunkEX4MKHXNcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
9737
9943
  const runtimeServerOutputDir = isVercel ? _path2.default.join(outputDir, "functions", "__nitro.func") : _path2.default.join(outputDir, "server");
9738
9944
  const ssrOutputDir = _path2.default.join(root, distDir, "ssr");
9739
- const imageRuntime = resolveImageRuntime(config, preset);
9945
+ const imageRuntime = _chunkROQ4C4LJcjs.resolveFarmImageServerRuntime.call(void 0, config.images, preset);
9740
9946
  const hasGeneratedMetadataImages = Array.from(routeManager.getMetadataImages().values()).some(
9741
9947
  (image) => image.sourceType === "module"
9742
9948
  );
@@ -9757,7 +9963,7 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
9757
9963
  const ssgCollectionPromise = routeManager.collectSSGPages();
9758
9964
  const middlewareRoutesPromise = discoverMiddlewareRoutes(_chunkWBKEZXWEcjs.getFarmAppDirectories.call(void 0, config));
9759
9965
  const configuredResponseRoutesPromise = Promise.all([config.redirects(), config.rewrites()]);
9760
- const farmWorkflows = await _chunkSDOTRX3Vcjs.prepareFarmWorkflowsForNitro.call(void 0, config);
9966
+ const farmWorkflows = await _chunkJEIG3EWEcjs.prepareFarmWorkflowsForNitro.call(void 0, config);
9761
9967
  const farmCron = await _chunk6EXBPJ24cjs.prepareFarmCronForNitro.call(void 0, config);
9762
9968
  const [{ ssg: ssgPages }, middlewareRoutes, [configuredRedirects, configuredRewrites]] = await Promise.all([
9763
9969
  ssgCollectionPromise,
@@ -9827,14 +10033,15 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
9827
10033
  output.code = output.code.split(FARM_CLIENT_JS_SRC_PLACEHOLDER).join(clientJsSrc);
9828
10034
  }
9829
10035
  }
9830
- await fs3.mkdir(ssrOutputDir, { recursive: true });
10036
+ await fs4.mkdir(ssrOutputDir, { recursive: true });
9831
10037
  for (const [fileName, output] of Object.entries(ssrBundle)) {
9832
10038
  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);
10039
+ await fs4.mkdir(_path2.default.dirname(filePath), { recursive: true });
10040
+ await fs4.writeFile(filePath, output.type === "chunk" ? output.code : output.source);
9835
10041
  }
9836
10042
  const nitroEntryPath = _path2.default.join(ssrOutputDir, "nitro-entry.mjs");
9837
10043
  const nodeAdapterModule = preset === "node-server" ? resolveNitroRuntimeDependency(root, "srvx/node") : null;
10044
+ const hasNitroCacheRouteRules = hasFarmNitroCacheRouteRule(config.routeRules);
9838
10045
  const nitroEntryCode = `
9839
10046
  // Farm.js Nitro Entry
9840
10047
  // This file adapts Farm's Web fetch handler to Nitro's event handler contract.
@@ -9855,7 +10062,39 @@ function registerFarmCloseHook() {
9855
10062
  farmProductionLifecycle.close('production-server-closed')
9856
10063
  )
9857
10064
  }
9858
-
10065
+ ${hasNitroCacheRouteRules ? `
10066
+ // A swr route rule caches through Nitro, which writes its own public Cache-Control on
10067
+ // the event after Farm answered, and a headers route rule sets its headers there too. H3
10068
+ // lets those replace the response's. A response middleware let through keeps Farm's
10069
+ // private policy and no CDN cache header, so no CDN serves it to others.
10070
+ const FARM_PRIVATE_CACHE_DIRECTIVE = /(?:^|,)\\s*(?:private|no-store)\\s*(?:[,=]|$)/i
10071
+ const FARM_CDN_CACHE_CONTROL_HEADERS = [
10072
+ 'cdn-cache-control',
10073
+ 'vercel-cdn-cache-control',
10074
+ 'netlify-cdn-cache-control',
10075
+ 'cloudflare-cdn-cache-control',
10076
+ ]
10077
+ const farmPrivateCacheControlKey = Symbol.for('farm.privateCacheControl')
10078
+ let farmPrivateCacheHookRegistered = false
10079
+ function keepFarmPrivateCacheControl(event, cacheControl) {
10080
+ if (!farmPrivateCacheHookRegistered) {
10081
+ farmPrivateCacheHookRegistered = true
10082
+ useNitroHooks().hook('response', (response, responseEvent) => {
10083
+ const value = responseEvent.context?.[farmPrivateCacheControlKey]
10084
+ if (!value) return
10085
+ try {
10086
+ if (response.headers.get('cache-control') !== value) {
10087
+ response.headers.set('cache-control', value)
10088
+ }
10089
+ for (const name of FARM_CDN_CACHE_CONTROL_HEADERS) response.headers.delete(name)
10090
+ } catch {
10091
+ // Immutable headers belong to a response Nitro passed through untouched.
10092
+ }
10093
+ })
10094
+ }
10095
+ if (event.context) event.context[farmPrivateCacheControlKey] = cacheControl
10096
+ }
10097
+ ` : ""}
9859
10098
  function mergeVaryHeaders(target, source) {
9860
10099
  const values = new Set(
9861
10100
  [target.get('Vary'), source]
@@ -9949,11 +10188,14 @@ export default async function farmNitroEventHandler(event) {
9949
10188
  const request = !srvxRequest && node?.req && node?.res
9950
10189
  ? new Request(webRequest, { signal: createFarmNodeRequestAbortSignal(node.req, node.res) })
9951
10190
  : webRequest
9952
- const response = await handler.fetch(request, {
10191
+ ${hasNitroCacheRouteRules ? " let farmGuardedResponse = false\n" : ""} const response = await handler.fetch(request, {
9953
10192
  waitUntil: (promise) => event.waitUntil(promise),
9954
10193
  onResponseFinished: createResponseFinishedHook(event),
9955
10194
  trustedLocalOrigin: resolveTrustedLocalOrigin(event, request),
9956
- clientAddress: resolveFarmClientAddress(event),
10195
+ clientAddress: resolveFarmClientAddress(event),${hasNitroCacheRouteRules ? `
10196
+ onGuardedResponse: () => {
10197
+ farmGuardedResponse = true
10198
+ },` : ""}
9957
10199
  })
9958
10200
 
9959
10201
  // Nitro records asset compression negotiation on the event response. Merge
@@ -9964,7 +10206,15 @@ export default async function farmNitroEventHandler(event) {
9964
10206
  if (farmVary) {
9965
10207
  const nitroHeaders = event.res.headers
9966
10208
  if (nitroHeaders.has('Vary')) mergeVaryHeaders(nitroHeaders, farmVary)
9967
- }
10209
+ }${hasNitroCacheRouteRules ? `
10210
+ const farmCacheControl = response.headers.get('cache-control')
10211
+ if (
10212
+ farmGuardedResponse &&
10213
+ farmCacheControl &&
10214
+ FARM_PRIVATE_CACHE_DIRECTIVE.test(farmCacheControl)
10215
+ ) {
10216
+ keepFarmPrivateCacheControl(event, farmCacheControl)
10217
+ }` : ""}
9968
10218
  return ${nodeAdapterModule ? "toFarmNodeResponse(request, response)" : "response"}
9969
10219
  }${nodeAdapterModule ? `
9970
10220
 
@@ -9985,16 +10235,16 @@ function toFarmNodeResponse(request, response) {
9985
10235
  })
9986
10236
  }` : ""}
9987
10237
  `.trim();
9988
- await fs3.writeFile(nitroEntryPath, nitroEntryCode);
10238
+ await fs4.writeFile(nitroEntryPath, nitroEntryCode);
9989
10239
  const farmNodeServerEntryPath = preset === "node-server" ? _path2.default.join(ssrOutputDir, "farm-node-server-entry.mjs") : null;
9990
10240
  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
10241
+ await fs4.writeFile(
10242
+ _path2.default.join(ssrOutputDir, _chunkCGR525MJcjs.FARM_NODE_ENV_MODULE_FILE),
10243
+ _chunkCGR525MJcjs.FARM_NODE_ENV_MODULE_SOURCE
9994
10244
  );
9995
- await fs3.writeFile(
10245
+ await fs4.writeFile(
9996
10246
  farmNodeServerEntryPath,
9997
- _chunkWW46B6HAcjs.createFarmNodeServerEntry.call(void 0, {
10247
+ _chunkCGR525MJcjs.createFarmNodeServerEntry.call(void 0, {
9998
10248
  nitroEntryFile: _path2.default.basename(nitroEntryPath),
9999
10249
  nodeAdapterModule,
10000
10250
  server: config.server,
@@ -10002,9 +10252,21 @@ function toFarmNodeResponse(request, response) {
10002
10252
  })
10003
10253
  );
10004
10254
  }
10255
+ const farmBunServerEntryPath = preset === "bun" ? _path2.default.join(ssrOutputDir, "farm-bun-server-entry.mjs") : null;
10256
+ if (farmBunServerEntryPath) {
10257
+ await fs4.writeFile(
10258
+ farmBunServerEntryPath,
10259
+ _chunkCGR525MJcjs.createFarmBunServerEntry.call(void 0, {
10260
+ nitroEntryFile: _path2.default.basename(nitroEntryPath),
10261
+ bunAdapterModule: resolveNitroRuntimeDependency(root, "srvx/bun"),
10262
+ server: config.server,
10263
+ websocketAdapterModule: resolveNitroRuntimeDependency(root, "crossws/adapters/bun")
10264
+ })
10265
+ );
10266
+ }
10005
10267
  const farmNetlifyEntryPath = preset === "netlify" ? _path2.default.join(ssrOutputDir, "farm-netlify-entry.mjs") : null;
10006
10268
  if (farmNetlifyEntryPath) {
10007
- await fs3.writeFile(
10269
+ await fs4.writeFile(
10008
10270
  farmNetlifyEntryPath,
10009
10271
  createFarmNetlifyEntry({
10010
10272
  nitroNetlifyEntry: resolveNitroNetlifyEntry(resolveNitroPackageEntry(root))
@@ -10036,7 +10298,10 @@ function toFarmNodeResponse(request, response) {
10036
10298
  let nitroConfig = {
10037
10299
  preset,
10038
10300
  ...farmNodeServerEntryPath ? { entry: farmNodeServerEntryPath } : {},
10301
+ ...farmBunServerEntryPath ? { entry: farmBunServerEntryPath } : {},
10039
10302
  ...farmNetlifyEntryPath ? { entry: farmNetlifyEntryPath } : {},
10303
+ // The response hook that keeps a private Cache-Control under a swr or headers rule (nitro-entry).
10304
+ ...hasNitroCacheRouteRules ? { features: { runtimeHooks: true } } : {},
10040
10305
  rootDir: root,
10041
10306
  // Farm registers every handler, task, and plugin explicitly. Scanning the
10042
10307
  // project root would bundle an app's own `middleware/`, `api/`, `routes/`,
@@ -10074,7 +10339,11 @@ function toFarmNodeResponse(request, response) {
10074
10339
  ...farmWorkflows.tasks,
10075
10340
  ...farmCron.tasks
10076
10341
  },
10077
- scheduledTasks: isVercel ? farmWorkflows.scheduledTasks : scheduledTasks,
10342
+ // Vercel crons call Farm's own secret-checked workflow and cron routes
10343
+ // (postProcessVercelOutput). Nitro's Vercel preset would also turn
10344
+ // scheduledTasks into a `/_vercel/cron` route that runs tasks without a
10345
+ // secret check unless CRON_SECRET is set, and double-schedules them when it is.
10346
+ scheduledTasks: isVercel ? {} : scheduledTasks,
10078
10347
  ...isCloudflareWorker && cloudflareCronConfig ? {
10079
10348
  cloudflare: cloudflareCronConfig
10080
10349
  } : {},
@@ -10133,20 +10402,20 @@ function toFarmNodeResponse(request, response) {
10133
10402
  snapshotSSRRebundleOptions(nitroConfig)
10134
10403
  );
10135
10404
  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
10405
+ 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(
10406
+ _optionalChain([nitroConfig, 'access', _189 => _189.handlers, 'optionalAccess', _190 => _190.some, 'call', _191 => _191(
10407
+ (handler) => _path2.default.resolve(_optionalChain([handler, 'optionalAccess', _192 => _192.handler]) || "") === nitroEntryPath
10139
10408
  )])
10140
10409
  );
10141
10410
  const selectRolldownBuilder = canReusePrebuiltSSR && requestedBuilder === void 0 && await canUseRolldownBuilder();
10142
10411
  if (selectRolldownBuilder) nitroConfig.builder = "rolldown";
10143
10412
  const useRolldownBuilder = canReusePrebuiltSSR && (_nullishCoalesce(nitroConfig.builder, () => ( process.env.NITRO_BUILDER))) === "rolldown";
10144
10413
  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]));
10414
+ 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
10415
  const useFarmServerMinifier = shouldMinify && nitroConfig.sourcemap === false && !hasCustomOxcOptions && !hasLateBuildMutationConfig;
10147
10416
  const serverChunkMinifier = useFarmServerMinifier ? createServerChunkMinifyPlugin({ keepNames: keepServerNames, target: "esnext" }) : null;
10148
10417
  if (canReusePrebuiltSSR) {
10149
- const configuredRollupPlugins = _optionalChain([nitroConfig, 'access', _192 => _192.rollupConfig, 'optionalAccess', _193 => _193.plugins]);
10418
+ const configuredRollupPlugins = _optionalChain([nitroConfig, 'access', _198 => _198.rollupConfig, 'optionalAccess', _199 => _199.plugins]);
10150
10419
  nitroConfig.rollupConfig = {
10151
10420
  ...nitroConfig.rollupConfig,
10152
10421
  plugins: [
@@ -10157,10 +10426,10 @@ function toFarmNodeResponse(request, response) {
10157
10426
  }
10158
10427
  nitroConfig.minify = useFarmServerMinifier ? false : shouldMinify;
10159
10428
  const nitroInstance = await nitroBuilder.createNitro(nitroConfig);
10160
- if (_optionalChain([config, 'access', _194 => _194.md, 'optionalAccess', _195 => _195.enabled])) {
10429
+ if (_optionalChain([config, 'access', _200 => _200.md, 'optionalAccess', _201 => _201.enabled])) {
10161
10430
  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);
10431
+ 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;
10432
+ const alternatePath = _chunkD4ROBNTKcjs.getFarmMarkdownAlternatePath.call(void 0, config.md, route.route);
10164
10433
  if (!alternatePath) return;
10165
10434
  const routeRule = nitroInstance.options.routeRules[route.route] || {};
10166
10435
  const alternate = `<${alternatePath}>; rel="alternate"; type="text/markdown"`;
@@ -10180,8 +10449,8 @@ function toFarmNodeResponse(request, response) {
10180
10449
  }
10181
10450
  if (config.security.csp && config.security.csp.nonce) {
10182
10451
  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);
10452
+ 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;
10453
+ const staticCsp = await _chunk25LPIZSXcjs.applyFarmCspHashesToHtml.call(void 0, route.contents, config.security);
10185
10454
  if (!staticCsp) return;
10186
10455
  route.contents = staticCsp.html;
10187
10456
  const routeRule = nitroInstance.options.routeRules[route.route] || {};
@@ -10196,7 +10465,7 @@ function toFarmNodeResponse(request, response) {
10196
10465
  nitroInstance.routing.sync();
10197
10466
  });
10198
10467
  }
10199
- if (farmNodeServerEntryPath || farmNetlifyEntryPath) {
10468
+ if (farmNodeServerEntryPath || farmBunServerEntryPath || farmNetlifyEntryPath) {
10200
10469
  nitroInstance.hooks.hook("prerender:config", (prerendererConfig) => {
10201
10470
  delete prerendererConfig.entry;
10202
10471
  });
@@ -10227,9 +10496,9 @@ function toFarmNodeResponse(request, response) {
10227
10496
  ssrBundle,
10228
10497
  _path2.default.join(prerenderServerDir, FARM_SSR_OUTPUT_DIR),
10229
10498
  null,
10230
- fs3
10499
+ fs4
10231
10500
  );
10232
- await registerPrebuiltSSRPackageImport(prerenderServerDir, ssrEntryFile, fs3);
10501
+ await registerPrebuiltSSRPackageImport(prerenderServerDir, ssrEntryFile, fs4);
10233
10502
  });
10234
10503
  });
10235
10504
  }
@@ -10251,16 +10520,16 @@ function toFarmNodeResponse(request, response) {
10251
10520
  }
10252
10521
  if (prerenderRoutes.length > 0) {
10253
10522
  _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";
10523
+ const previousPrerender = process.env[_chunkIFWSR7YZcjs.FARM_PRERENDER_ENV];
10524
+ process.env[_chunkIFWSR7YZcjs.FARM_PRERENDER_ENV] = "1";
10256
10525
  try {
10257
10526
  await nitroBuilder.prerender(nitroInstance);
10258
10527
  } finally {
10259
- if (previousPrerender === void 0) delete process.env[_chunkWXJLNP33cjs.FARM_PRERENDER_ENV];
10260
- else process.env[_chunkWXJLNP33cjs.FARM_PRERENDER_ENV] = previousPrerender;
10528
+ if (previousPrerender === void 0) delete process.env[_chunkIFWSR7YZcjs.FARM_PRERENDER_ENV];
10529
+ else process.env[_chunkIFWSR7YZcjs.FARM_PRERENDER_ENV] = previousPrerender;
10261
10530
  }
10262
10531
  }
10263
- const sharpRuntimeStagePromise = imageRuntime === "node" ? stageSharpRuntime(config, root, distDir, fs3, preset) : Promise.resolve(null);
10532
+ const sharpRuntimeStagePromise = imageRuntime === "node" ? stageSharpRuntime(config, root, distDir, fs4, preset) : Promise.resolve(null);
10264
10533
  const prebuiltSSRFilesPromise = canReusePrebuiltSSR ? prepareSSRBundleFiles(
10265
10534
  ssrBundle,
10266
10535
  shouldMinify ? { keepNames: keepServerNames, target: "node18" } : null
@@ -10273,7 +10542,7 @@ function toFarmNodeResponse(request, response) {
10273
10542
  await nitroInstance.close();
10274
10543
  if (nitroBuildResult.status === "rejected") {
10275
10544
  if (sharpRuntimeStageResult.status === "fulfilled" && sharpRuntimeStageResult.value) {
10276
- await fs3.rm(sharpRuntimeStageResult.value.stageDir, {
10545
+ await fs4.rm(sharpRuntimeStageResult.value.stageDir, {
10277
10546
  recursive: true,
10278
10547
  force: true
10279
10548
  });
@@ -10286,20 +10555,20 @@ function toFarmNodeResponse(request, response) {
10286
10555
  if (prebuiltSSRFilesResult.status === "rejected") {
10287
10556
  throw prebuiltSSRFilesResult.reason;
10288
10557
  }
10289
- const stagedSharpRuntime = await _asyncNullishCoalesce(sharpRuntimeStageResult.value, async () => ( (imageRuntime === "node" ? await stageSharpRuntime(config, root, distDir, fs3, preset) : null)));
10558
+ const stagedSharpRuntime = await _asyncNullishCoalesce(sharpRuntimeStageResult.value, async () => ( (imageRuntime === "node" ? await stageSharpRuntime(config, root, distDir, fs4, preset) : null)));
10290
10559
  const runtimeCopyPromise = (async () => {
10291
10560
  if (stagedSharpRuntime) {
10292
- await installStagedSharpRuntime(stagedSharpRuntime, runtimeServerOutputDir, fs3);
10561
+ await installStagedSharpRuntime(stagedSharpRuntime, runtimeServerOutputDir, fs4);
10293
10562
  }
10294
10563
  if (useExternalMetadataImageRuntime) {
10295
- await copyMetadataImageRuntime(root, runtimeServerOutputDir, fs3);
10564
+ await copyMetadataImageRuntime(root, runtimeServerOutputDir, fs4);
10296
10565
  }
10297
10566
  })();
10298
10567
  const copyResults = await Promise.allSettled([
10299
10568
  prebuiltSSRFilesResult.value ? writeSSRBundleFiles(
10300
10569
  prebuiltSSRFilesResult.value,
10301
10570
  _path2.default.join(outputDir, "server", FARM_SSR_OUTPUT_DIR),
10302
- fs3
10571
+ fs4
10303
10572
  ) : Promise.resolve(),
10304
10573
  runtimeCopyPromise
10305
10574
  ]);
@@ -10308,7 +10577,7 @@ function toFarmNodeResponse(request, response) {
10308
10577
  );
10309
10578
  if (failedCopy) throw failedCopy.reason;
10310
10579
  if (canReusePrebuiltSSR) {
10311
- await registerPrebuiltSSRPackageImport(_path2.default.join(outputDir, "server"), ssrEntryFile, fs3);
10580
+ await registerPrebuiltSSRPackageImport(_path2.default.join(outputDir, "server"), ssrEntryFile, fs4);
10312
10581
  _chunk5QIKR7RRcjs.logger.info("\u26A1 Reused Farm's prebuilt SSR bundle for the Node output");
10313
10582
  }
10314
10583
  if (useRolldownBuilder) {
@@ -10323,7 +10592,7 @@ function toFarmNodeResponse(request, response) {
10323
10592
  });
10324
10593
  }
10325
10594
  if (isVercel) {
10326
- await postProcessVercelOutput(root, outputDir, fs3, config, farmWorkflows, routeRuntimeManifest);
10595
+ await postProcessVercelOutput(root, outputDir, fs4, config, farmWorkflows, routeRuntimeManifest);
10327
10596
  }
10328
10597
  _chunk5QIKR7RRcjs.logger.success(`\u2705 Nitro build completed with preset: ${preset}`);
10329
10598
  }
@@ -10351,24 +10620,24 @@ function prepareSSRBundleFiles(ssrBundle, minifyOptions) {
10351
10620
  );
10352
10621
  }
10353
10622
  _chunkS3JO3N4Hcjs.__name.call(void 0, prepareSSRBundleFiles, "prepareSSRBundleFiles");
10354
- async function writeSSRBundleFiles(files, targetDir, fs3) {
10355
- await fs3.rm(targetDir, { recursive: true, force: true });
10623
+ async function writeSSRBundleFiles(files, targetDir, fs4) {
10624
+ await fs4.rm(targetDir, { recursive: true, force: true });
10356
10625
  await Promise.all(
10357
10626
  files.map(async ({ fileName, contents }) => {
10358
10627
  const targetPath = _path2.default.join(targetDir, fileName);
10359
- await fs3.mkdir(_path2.default.dirname(targetPath), { recursive: true });
10360
- await fs3.writeFile(targetPath, contents);
10628
+ await fs4.mkdir(_path2.default.dirname(targetPath), { recursive: true });
10629
+ await fs4.writeFile(targetPath, contents);
10361
10630
  })
10362
10631
  );
10363
10632
  }
10364
10633
  _chunkS3JO3N4Hcjs.__name.call(void 0, writeSSRBundleFiles, "writeSSRBundleFiles");
10365
- async function copyPrebuiltSSRBundle(ssrBundle, targetDir, minifyOptions, fs3) {
10366
- await writeSSRBundleFiles(await prepareSSRBundleFiles(ssrBundle, minifyOptions), targetDir, fs3);
10634
+ async function copyPrebuiltSSRBundle(ssrBundle, targetDir, minifyOptions, fs4) {
10635
+ await writeSSRBundleFiles(await prepareSSRBundleFiles(ssrBundle, minifyOptions), targetDir, fs4);
10367
10636
  }
10368
10637
  _chunkS3JO3N4Hcjs.__name.call(void 0, copyPrebuiltSSRBundle, "copyPrebuiltSSRBundle");
10369
- async function registerPrebuiltSSRPackageImport(serverDir, ssrEntryFile, fs3) {
10638
+ async function registerPrebuiltSSRPackageImport(serverDir, ssrEntryFile, fs4) {
10370
10639
  const packagePath = _path2.default.join(serverDir, "package.json");
10371
- const packageJSON = await fs3.readFile(packagePath, "utf8").then((contents) => JSON.parse(contents)).catch((error) => {
10640
+ const packageJSON = await fs4.readFile(packagePath, "utf8").then((contents) => JSON.parse(contents)).catch((error) => {
10372
10641
  if (error.code === "ENOENT") return { type: "module" };
10373
10642
  throw error;
10374
10643
  });
@@ -10378,61 +10647,61 @@ async function registerPrebuiltSSRPackageImport(serverDir, ssrEntryFile, fs3) {
10378
10647
  ...existingImports,
10379
10648
  [FARM_SSR_PACKAGE_IMPORT]: `./${outputEntry}`
10380
10649
  };
10381
- await fs3.mkdir(serverDir, { recursive: true });
10382
- await fs3.writeFile(packagePath, `${JSON.stringify(packageJSON, null, 2)}
10650
+ await fs4.mkdir(serverDir, { recursive: true });
10651
+ await fs4.writeFile(packagePath, `${JSON.stringify(packageJSON, null, 2)}
10383
10652
  `);
10384
10653
  }
10385
10654
  _chunkS3JO3N4Hcjs.__name.call(void 0, registerPrebuiltSSRPackageImport, "registerPrebuiltSSRPackageImport");
10386
- async function moveVercelOutputPath(src, dest, fs3) {
10655
+ async function moveVercelOutputPath(src, dest, fs4) {
10387
10656
  try {
10388
- await fs3.rename(src, dest);
10657
+ await fs4.rename(src, dest);
10389
10658
  return;
10390
10659
  } catch (error) {
10391
- const code = _optionalChain([error, 'optionalAccess', _206 => _206.code]);
10660
+ const code = _optionalChain([error, 'optionalAccess', _212 => _212.code]);
10392
10661
  if (code !== "EPERM" && code !== "EACCES" && code !== "EXDEV" && code !== "ENOTEMPTY") {
10393
10662
  throw error;
10394
10663
  }
10395
10664
  }
10396
- await fs3.cp(src, dest, { recursive: true, force: true });
10397
- await fs3.rm(src, { recursive: true, force: true });
10665
+ await fs4.cp(src, dest, { recursive: true, force: true });
10666
+ await fs4.rm(src, { recursive: true, force: true });
10398
10667
  }
10399
10668
  _chunkS3JO3N4Hcjs.__name.call(void 0, moveVercelOutputPath, "moveVercelOutputPath");
10400
- async function postProcessVercelOutput(root, outputDir, fs3, config, farmWorkflows, routeRuntimeManifest) {
10669
+ async function postProcessVercelOutput(root, outputDir, fs4, config, farmWorkflows, routeRuntimeManifest) {
10401
10670
  const serverDir = _path2.default.join(outputDir, "server");
10402
10671
  const functionsDir = _path2.default.join(outputDir, "functions");
10403
10672
  const nitroFuncDir = _path2.default.join(functionsDir, "__nitro.func");
10404
10673
  const staticDir = _path2.default.join(outputDir, "static");
10405
10674
  const publicDir = _path2.default.join(outputDir, "public");
10406
- await fs3.mkdir(nitroFuncDir, { recursive: true });
10407
- const serverContents = await fs3.readdir(serverDir).catch((error) => {
10675
+ await fs4.mkdir(nitroFuncDir, { recursive: true });
10676
+ const serverContents = await fs4.readdir(serverDir).catch((error) => {
10408
10677
  if (error.code === "ENOENT") return [];
10409
10678
  throw error;
10410
10679
  });
10411
10680
  for (const file of serverContents) {
10412
- await moveVercelOutputPath(_path2.default.join(serverDir, file), _path2.default.join(nitroFuncDir, file), fs3);
10681
+ await moveVercelOutputPath(_path2.default.join(serverDir, file), _path2.default.join(nitroFuncDir, file), fs4);
10413
10682
  }
10414
- if (serverContents.length > 0) await fs3.rm(serverDir, { recursive: true, force: true });
10683
+ if (serverContents.length > 0) await fs4.rm(serverDir, { recursive: true, force: true });
10415
10684
  try {
10416
- await moveVercelOutputPath(publicDir, staticDir, fs3);
10685
+ await moveVercelOutputPath(publicDir, staticDir, fs4);
10417
10686
  } catch (error) {
10418
- if (_optionalChain([error, 'optionalAccess', _207 => _207.code]) !== "ENOENT") throw error;
10687
+ if (_optionalChain([error, 'optionalAccess', _213 => _213.code]) !== "ENOENT") throw error;
10419
10688
  }
10420
- await copyFarmDocsContentForVercel(config, root, nitroFuncDir, fs3);
10421
- await copyPrismaClientForVercel(root, nitroFuncDir, fs3);
10689
+ await copyFarmDocsContentForVercel(config, root, nitroFuncDir, fs4);
10690
+ await copyPrismaClientForVercel(root, nitroFuncDir, fs4);
10422
10691
  const configPath = _path2.default.join(outputDir, "config.json");
10423
- const configContent = await fs3.readFile(configPath, "utf-8");
10692
+ const configContent = await fs4.readFile(configPath, "utf-8");
10424
10693
  const vercelConfig = JSON.parse(configContent);
10425
10694
  const runtimeRoutes = await createFarmVercelRouteRuntimeFunctions(
10426
10695
  outputDir,
10427
10696
  routeRuntimeManifest,
10428
- fs3,
10697
+ fs4,
10429
10698
  config.basePath
10430
10699
  );
10431
10700
  vercelConfig.routes = buildFarmVercelRoutes({
10432
10701
  presetRoutes: Array.isArray(vercelConfig.routes) ? vercelConfig.routes : [],
10433
10702
  runtimeRoutes
10434
10703
  });
10435
- const vercelConfigWithWorkflowCrons = _chunkSDOTRX3Vcjs.applyFarmWorkflowVercelCrons.call(void 0,
10704
+ const vercelConfigWithWorkflowCrons = _chunkJEIG3EWEcjs.applyFarmWorkflowVercelCrons.call(void 0,
10436
10705
  vercelConfig,
10437
10706
  farmWorkflows.workflows
10438
10707
  );
@@ -10440,25 +10709,25 @@ async function postProcessVercelOutput(root, outputDir, fs3, config, farmWorkflo
10440
10709
  vercelConfigWithWorkflowCrons,
10441
10710
  config.cron.jobs
10442
10711
  );
10443
- await fs3.writeFile(configPath, JSON.stringify(vercelConfigWithCrons, null, 2));
10712
+ await fs4.writeFile(configPath, JSON.stringify(vercelConfigWithCrons, null, 2));
10444
10713
  _chunk5QIKR7RRcjs.logger.info("\u2705 Post-processed Vercel output for Build Output API v3");
10445
10714
  }
10446
10715
  _chunkS3JO3N4Hcjs.__name.call(void 0, postProcessVercelOutput, "postProcessVercelOutput");
10447
- async function copyFarmDocsContentForVercel(config, root, nitroFuncDir, fs3) {
10716
+ async function copyFarmDocsContentForVercel(config, root, nitroFuncDir, fs4) {
10448
10717
  const docsContentDir = resolveBuildDocsContentDir(config, root);
10449
10718
  if (!docsContentDir) return;
10450
10719
  const bundledContentDir = _path2.default.join(nitroFuncDir, "farm-docs-content");
10451
- const lastModifiedManifest = _chunkPGZDEPTMcjs.createFarmDocsLastModifiedManifest.call(void 0, docsContentDir, {
10720
+ const lastModifiedManifest = _chunkMY5PZYADcjs.createFarmDocsLastModifiedManifest.call(void 0, docsContentDir, {
10452
10721
  fallback: "now"
10453
10722
  });
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, {
10723
+ await fs4.rm(bundledContentDir, { recursive: true, force: true });
10724
+ await fs4.mkdir(_path2.default.dirname(bundledContentDir), { recursive: true });
10725
+ await fs4.cp(docsContentDir, bundledContentDir, {
10457
10726
  recursive: true,
10458
10727
  force: true
10459
10728
  });
10460
- await fs3.writeFile(
10461
- _path2.default.join(bundledContentDir, _chunkPGZDEPTMcjs.FARM_DOCS_LAST_MODIFIED_MANIFEST),
10729
+ await fs4.writeFile(
10730
+ _path2.default.join(bundledContentDir, _chunkMY5PZYADcjs.FARM_DOCS_LAST_MODIFIED_MANIFEST),
10462
10731
  `${JSON.stringify(lastModifiedManifest, null, 2)}
10463
10732
  `
10464
10733
  );
@@ -10481,21 +10750,21 @@ function platformFieldAllows(field, value) {
10481
10750
  return allowed.length === 0 || allowed.includes(value);
10482
10751
  }
10483
10752
  _chunkS3JO3N4Hcjs.__name.call(void 0, platformFieldAllows, "platformFieldAllows");
10484
- async function stageSharpRuntime(config, root, distDir, fs3, preset) {
10753
+ async function stageSharpRuntime(config, root, distDir, fs4, preset) {
10485
10754
  const functionPlatform = resolveServerFunctionPlatform(preset);
10486
10755
  const projectRequire = _module.createRequire.call(void 0, _path2.default.join(root, "package.json"));
10487
10756
  let sharpRequire = projectRequire;
10488
10757
  if (!resolvePackageJson(projectRequire, "sharp")) {
10489
10758
  try {
10490
10759
  sharpRequire = _module.createRequire.call(void 0, projectRequire.resolve("@farm.js/core"));
10491
- } catch (e27) {
10760
+ } catch (e29) {
10492
10761
  }
10493
10762
  }
10494
10763
  const copiedPackages = /* @__PURE__ */ new Map();
10495
10764
  const packageCopies = /* @__PURE__ */ new Map();
10496
10765
  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-"));
10766
+ await fs4.mkdir(stageRoot, { recursive: true });
10767
+ const stageDir = await fs4.mkdtemp(_path2.default.join(stageRoot, "sharp-runtime-"));
10499
10768
  const targetNodeModules = _path2.default.join(stageDir, "node_modules");
10500
10769
  function copyPackage(packageName, parentRequire) {
10501
10770
  const activeCopy = packageCopies.get(packageName);
@@ -10508,19 +10777,19 @@ async function stageSharpRuntime(config, root, distDir, fs3, preset) {
10508
10777
  async function copyPackageOnce(packageName, parentRequire) {
10509
10778
  const packageJsonPath = resolvePackageJson(parentRequire, packageName);
10510
10779
  if (!packageJsonPath) return;
10511
- const packageJson = JSON.parse(await fs3.readFile(packageJsonPath, "utf8"));
10780
+ const packageJson = JSON.parse(await fs4.readFile(packageJsonPath, "utf8"));
10512
10781
  if (functionPlatform && !packageSupportsPlatform(packageJson, functionPlatform)) return;
10513
10782
  const packageDir = _path2.default.dirname(packageJsonPath);
10514
10783
  const targetDir = _path2.default.join(targetNodeModules, ...packageName.split("/"));
10515
10784
  copiedPackages.set(packageName, String(packageJson.version || "*"));
10516
- await fs3.mkdir(_path2.default.dirname(targetDir), { recursive: true });
10785
+ await fs4.mkdir(_path2.default.dirname(targetDir), { recursive: true });
10517
10786
  const packageRequire = _module.createRequire.call(void 0, packageJsonPath);
10518
10787
  const dependencies = {
10519
10788
  ...packageJson.dependencies,
10520
10789
  ...packageJson.optionalDependencies
10521
10790
  };
10522
10791
  await settleAllOrThrow([
10523
- fs3.cp(packageDir, targetDir, {
10792
+ fs4.cp(packageDir, targetDir, {
10524
10793
  recursive: true,
10525
10794
  force: true,
10526
10795
  dereference: true,
@@ -10535,10 +10804,10 @@ async function stageSharpRuntime(config, root, distDir, fs3, preset) {
10535
10804
  try {
10536
10805
  await copyPackage("sharp", sharpRequire);
10537
10806
  if (!copiedPackages.has("sharp")) {
10538
- throw new Error(`Farm image optimization requires sharp. ${_chunkAS2VPMEEcjs.SHARP_INSTALL_HINT}`);
10807
+ throw new Error(`Farm image optimization requires sharp. ${_chunkROQ4C4LJcjs.SHARP_INSTALL_HINT}`);
10539
10808
  }
10540
10809
  } catch (error) {
10541
- await fs3.rm(stageDir, { recursive: true, force: true });
10810
+ await fs4.rm(stageDir, { recursive: true, force: true });
10542
10811
  throw error;
10543
10812
  }
10544
10813
  return {
@@ -10549,19 +10818,19 @@ async function stageSharpRuntime(config, root, distDir, fs3, preset) {
10549
10818
  };
10550
10819
  }
10551
10820
  _chunkS3JO3N4Hcjs.__name.call(void 0, stageSharpRuntime, "stageSharpRuntime");
10552
- async function installStagedSharpRuntime(staged, nitroFuncDir, fs3) {
10821
+ async function installStagedSharpRuntime(staged, nitroFuncDir, fs4) {
10553
10822
  const stagedNodeModules = _path2.default.join(staged.stageDir, "node_modules");
10554
10823
  const targetNodeModules = _path2.default.join(nitroFuncDir, "node_modules");
10555
10824
  try {
10556
- await mergeStagedDirectory(stagedNodeModules, targetNodeModules, fs3);
10557
- const functionPackage = await readNitroOutputPackage(nitroFuncDir, fs3);
10825
+ await mergeStagedDirectory(stagedNodeModules, targetNodeModules, fs4);
10826
+ const functionPackage = await readNitroOutputPackage(nitroFuncDir, fs4);
10558
10827
  functionPackage.dependencies = {
10559
10828
  ...functionPackage.dependencies,
10560
10829
  ...staged.dependencies
10561
10830
  };
10562
- await writeNitroOutputPackage(nitroFuncDir, functionPackage, fs3);
10831
+ await writeNitroOutputPackage(nitroFuncDir, functionPackage, fs4);
10563
10832
  } finally {
10564
- await fs3.rm(staged.stageDir, { recursive: true, force: true });
10833
+ await fs4.rm(staged.stageDir, { recursive: true, force: true });
10565
10834
  }
10566
10835
  _chunk5QIKR7RRcjs.logger.info(
10567
10836
  `\u{1F5BC}\uFE0F Bundled Sharp image runtime (${Object.keys(staged.dependencies).length} packages)`
@@ -10576,15 +10845,15 @@ async function settleAllOrThrow(operations) {
10576
10845
  if (failure) throw failure.reason;
10577
10846
  }
10578
10847
  _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 });
10848
+ async function mergeStagedDirectory(sourceDir, targetDir, fs4) {
10849
+ await fs4.mkdir(targetDir, { recursive: true });
10850
+ const entries = await fs4.readdir(sourceDir, { withFileTypes: true });
10582
10851
  await settleAllOrThrow(
10583
10852
  entries.map(async (entry) => {
10584
10853
  const sourcePath = _path2.default.join(sourceDir, entry.name);
10585
10854
  const targetPath = _path2.default.join(targetDir, entry.name);
10586
10855
  try {
10587
- await fs3.rename(sourcePath, targetPath);
10856
+ await fs4.rename(sourcePath, targetPath);
10588
10857
  return;
10589
10858
  } catch (error) {
10590
10859
  const code = error.code;
@@ -10593,16 +10862,16 @@ async function mergeStagedDirectory(sourceDir, targetDir, fs3) {
10593
10862
  }
10594
10863
  }
10595
10864
  if (entry.isDirectory()) {
10596
- await mergeStagedDirectory(sourcePath, targetPath, fs3);
10597
- await fs3.rm(sourcePath, { recursive: true, force: true });
10865
+ await mergeStagedDirectory(sourcePath, targetPath, fs4);
10866
+ await fs4.rm(sourcePath, { recursive: true, force: true });
10598
10867
  return;
10599
10868
  }
10600
- await fs3.cp(sourcePath, targetPath, {
10869
+ await fs4.cp(sourcePath, targetPath, {
10601
10870
  force: true,
10602
10871
  dereference: true,
10603
10872
  mode: _fs.constants.COPYFILE_FICLONE
10604
10873
  });
10605
- await fs3.rm(sourcePath, { force: true });
10874
+ await fs4.rm(sourcePath, { force: true });
10606
10875
  })
10607
10876
  );
10608
10877
  }
@@ -10622,44 +10891,44 @@ function resolveMetadataImageRuntimePackageJson(root) {
10622
10891
  if (packageJsonPath) return packageJsonPath;
10623
10892
  try {
10624
10893
  return resolvePackageJson(_module.createRequire.call(void 0, projectRequire.resolve("@farm.js/core")), "@vercel/og");
10625
- } catch (e28) {
10894
+ } catch (e30) {
10626
10895
  return null;
10627
10896
  }
10628
10897
  }
10629
10898
  _chunkS3JO3N4Hcjs.__name.call(void 0, resolveMetadataImageRuntimePackageJson, "resolveMetadataImageRuntimePackageJson");
10630
- async function copyMetadataImageRuntime(root, nitroFuncDir, fs3) {
10899
+ async function copyMetadataImageRuntime(root, nitroFuncDir, fs4) {
10631
10900
  const packageJsonPath = resolveMetadataImageRuntimePackageJson(root);
10632
10901
  if (!packageJsonPath) return;
10633
- const packageJson = JSON.parse(await fs3.readFile(packageJsonPath, "utf8"));
10902
+ const packageJson = JSON.parse(await fs4.readFile(packageJsonPath, "utf8"));
10634
10903
  const packageDir = _path2.default.dirname(packageJsonPath);
10635
10904
  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, {
10905
+ await fs4.mkdir(_path2.default.dirname(targetDir), { recursive: true });
10906
+ await fs4.cp(packageDir, targetDir, {
10638
10907
  recursive: true,
10639
10908
  force: true,
10640
10909
  dereference: true,
10641
10910
  mode: _fs.constants.COPYFILE_FICLONE
10642
10911
  });
10643
- const functionPackage = await readNitroOutputPackage(nitroFuncDir, fs3);
10912
+ const functionPackage = await readNitroOutputPackage(nitroFuncDir, fs4);
10644
10913
  functionPackage.dependencies = {
10645
10914
  ...functionPackage.dependencies,
10646
10915
  "@vercel/og": String(packageJson.version || "0.11.1")
10647
10916
  };
10648
- await writeNitroOutputPackage(nitroFuncDir, functionPackage, fs3);
10917
+ await writeNitroOutputPackage(nitroFuncDir, functionPackage, fs4);
10649
10918
  _chunk5QIKR7RRcjs.logger.info("\u{1F5BC}\uFE0F Bundled generated metadata image runtime");
10650
10919
  }
10651
10920
  _chunkS3JO3N4Hcjs.__name.call(void 0, copyMetadataImageRuntime, "copyMetadataImageRuntime");
10652
- async function readNitroOutputPackage(outputDir, fs3) {
10921
+ async function readNitroOutputPackage(outputDir, fs4) {
10653
10922
  const packagePath = _path2.default.join(outputDir, "package.json");
10654
- return fs3.readFile(packagePath, "utf8").then((contents) => JSON.parse(contents)).catch((error) => {
10923
+ return fs4.readFile(packagePath, "utf8").then((contents) => JSON.parse(contents)).catch((error) => {
10655
10924
  if (error.code === "ENOENT") return {};
10656
10925
  throw error;
10657
10926
  });
10658
10927
  }
10659
10928
  _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(
10929
+ async function writeNitroOutputPackage(outputDir, packageJson, fs4) {
10930
+ await fs4.mkdir(outputDir, { recursive: true });
10931
+ await fs4.writeFile(
10663
10932
  _path2.default.join(outputDir, "package.json"),
10664
10933
  `${JSON.stringify(packageJson, null, 2)}
10665
10934
  `
@@ -10673,7 +10942,7 @@ function resolvePackageJson(parentRequire, packageName) {
10673
10942
  const resolved = parentRequire.resolve(request);
10674
10943
  if (resolved.endsWith(".json")) return resolved;
10675
10944
  _nullishCoalesce(metadataModule, () => ( (metadataModule = resolved)));
10676
- } catch (e29) {
10945
+ } catch (e31) {
10677
10946
  }
10678
10947
  }
10679
10948
  try {
@@ -10684,55 +10953,55 @@ function resolvePackageJson(parentRequire, packageName) {
10684
10953
  try {
10685
10954
  const manifest = JSON.parse(_fs.readFileSync.call(void 0, candidate, "utf8"));
10686
10955
  if (manifest.name === packageName) return candidate;
10687
- } catch (e30) {
10956
+ } catch (e32) {
10688
10957
  }
10689
10958
  }
10690
10959
  if (_path2.default.basename(directory) === "node_modules") break;
10691
10960
  directory = _path2.default.dirname(directory);
10692
10961
  }
10693
- } catch (e31) {
10962
+ } catch (e33) {
10694
10963
  }
10695
10964
  return null;
10696
10965
  }
10697
10966
  _chunkS3JO3N4Hcjs.__name.call(void 0, resolvePackageJson, "resolvePackageJson");
10698
- async function copyPrismaClientForVercel(root, nitroFuncDir, fs3) {
10967
+ async function copyPrismaClientForVercel(root, nitroFuncDir, fs4) {
10699
10968
  const projectRequire = _module.createRequire.call(void 0, _path2.default.join(root, "package.json"));
10700
10969
  let prismaClientDir;
10701
10970
  try {
10702
10971
  prismaClientDir = _path2.default.dirname(projectRequire.resolve("@prisma/client/default.js"));
10703
- } catch (e32) {
10972
+ } catch (e34) {
10704
10973
  return;
10705
10974
  }
10706
10975
  const generatedClientDir = _path2.default.join(prismaClientDir, "..", "..", ".prisma", "client");
10707
10976
  try {
10708
- await fs3.access(generatedClientDir);
10709
- } catch (e33) {
10977
+ await fs4.access(generatedClientDir);
10978
+ } catch (e35) {
10710
10979
  return;
10711
10980
  }
10712
10981
  const targetNodeModules = _path2.default.join(nitroFuncDir, "node_modules");
10713
10982
  const targetPrismaScopeDir = _path2.default.join(targetNodeModules, "@prisma");
10714
10983
  const targetGeneratedDir = _path2.default.join(targetNodeModules, ".prisma", "client");
10715
10984
  const targetClientDir = _path2.default.join(targetPrismaScopeDir, "client");
10716
- await fs3.mkdir(targetPrismaScopeDir, { recursive: true });
10717
- await fs3.cp(prismaClientDir, targetClientDir, {
10985
+ await fs4.mkdir(targetPrismaScopeDir, { recursive: true });
10986
+ await fs4.cp(prismaClientDir, targetClientDir, {
10718
10987
  recursive: true,
10719
10988
  force: true
10720
10989
  });
10721
- await fs3.cp(generatedClientDir, targetGeneratedDir, {
10990
+ await fs4.cp(generatedClientDir, targetGeneratedDir, {
10722
10991
  recursive: true,
10723
10992
  force: true
10724
10993
  });
10725
10994
  const clientPackagePath = _path2.default.join(prismaClientDir, "package.json");
10726
10995
  const [functionPackage, clientPackageContent] = await Promise.all([
10727
- readNitroOutputPackage(nitroFuncDir, fs3),
10728
- fs3.readFile(clientPackagePath, "utf-8")
10996
+ readNitroOutputPackage(nitroFuncDir, fs4),
10997
+ fs4.readFile(clientPackagePath, "utf-8")
10729
10998
  ]);
10730
10999
  const clientPackage = JSON.parse(clientPackageContent);
10731
11000
  functionPackage.dependencies = {
10732
11001
  ...functionPackage.dependencies,
10733
11002
  "@prisma/client": clientPackage.version
10734
11003
  };
10735
- await writeNitroOutputPackage(nitroFuncDir, functionPackage, fs3);
11004
+ await writeNitroOutputPackage(nitroFuncDir, functionPackage, fs4);
10736
11005
  }
10737
11006
  _chunkS3JO3N4Hcjs.__name.call(void 0, copyPrismaClientForVercel, "copyPrismaClientForVercel");
10738
11007
 
@@ -10762,7 +11031,7 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, createFarmProjectModuleSsrEnvironment, "cr
10762
11031
 
10763
11032
  // src/build/index.ts
10764
11033
  async function build(config, options = {}) {
10765
- return _chunkWW46B6HAcjs.withProductionNodeEnv.call(void 0, () => buildWithProductionNodeEnv(config, options));
11034
+ return _chunkCGR525MJcjs.withProductionNodeEnv.call(void 0, () => buildWithProductionNodeEnv(config, options));
10766
11035
  }
10767
11036
  _chunkS3JO3N4Hcjs.__name.call(void 0, build, "build");
10768
11037
  function createBuildTargetBaseline(config) {
@@ -10773,7 +11042,7 @@ function createBuildTargetBaseline(config) {
10773
11042
  preset,
10774
11043
  distDir,
10775
11044
  outputDir,
10776
- outputWasDerived: outputDir === _chunkHRETEZ2Zcjs.getDefaultDeployOutputDir.call(void 0, config.deploy.target, preset, distDir)
11045
+ outputWasDerived: outputDir === _chunkEX4MKHXNcjs.getDefaultDeployOutputDir.call(void 0, config.deploy.target, preset, distDir)
10777
11046
  };
10778
11047
  }
10779
11048
  _chunkS3JO3N4Hcjs.__name.call(void 0, createBuildTargetBaseline, "createBuildTargetBaseline");
@@ -10783,8 +11052,8 @@ function resolveBuildTargets(config, options, baseline) {
10783
11052
  const distDir = config.distDir || ".farm";
10784
11053
  const outputWasReplaced = config.deploy.outputDir !== baseline.outputDir;
10785
11054
  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;
11055
+ const deployTarget = preset === config.deploy.preset ? config.deploy.target : _chunkEX4MKHXNcjs.getDeployTargetForPreset.call(void 0, preset);
11056
+ const outputDir = shouldRefreshDerivedOutput ? _chunkEX4MKHXNcjs.getDefaultDeployOutputDir.call(void 0, deployTarget, preset, distDir) : config.deploy.outputDir;
10788
11057
  return {
10789
11058
  root,
10790
11059
  preset,
@@ -10792,7 +11061,7 @@ function resolveBuildTargets(config, options, baseline) {
10792
11061
  distDir,
10793
11062
  deployTarget,
10794
11063
  outputDir,
10795
- deployOutputDir: _chunkHRETEZ2Zcjs.resolveDeployOutputPath.call(void 0, root, outputDir)
11064
+ deployOutputDir: _chunkEX4MKHXNcjs.resolveDeployOutputPath.call(void 0, root, outputDir)
10796
11065
  };
10797
11066
  }
10798
11067
  _chunkS3JO3N4Hcjs.__name.call(void 0, resolveBuildTargets, "resolveBuildTargets");
@@ -10801,7 +11070,7 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
10801
11070
  const targetBaseline = createBuildTargetBaseline(config);
10802
11071
  let targets;
10803
11072
  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)({
11073
+ const pluginManager = new (0, _chunk45QJHGZMcjs.PluginManager)({
10805
11074
  config,
10806
11075
  isDev: false,
10807
11076
  isProd: true
@@ -10830,12 +11099,12 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
10830
11099
  };
10831
11100
  config = {
10832
11101
  ...config,
10833
- images: _chunkAS2VPMEEcjs.resolveFarmImageProviderForRuntime.call(void 0, config.images, {
11102
+ images: _chunkROQ4C4LJcjs.resolveFarmImageProviderForRuntime.call(void 0, config.images, {
10834
11103
  root: targets.root,
10835
11104
  preset: targets.preset
10836
11105
  })
10837
11106
  };
10838
- if (_optionalChain([config, 'access', _208 => _208.docs, 'optionalAccess', _209 => _209.enabled])) await _chunkIK6LVLKCcjs.loadFarmDocsEngine.call(void 0, );
11107
+ if (_optionalChain([config, 'access', _214 => _214.docs, 'optionalAccess', _215 => _215.enabled])) await _chunkIK6LVLKCcjs.loadFarmDocsEngine.call(void 0, );
10839
11108
  pluginManager.updateContext({ config });
10840
11109
  const { root, preset, srcDir, distDir, deployOutputDir } = targets;
10841
11110
  _chunk5QIKR7RRcjs.logger.info(`\u{1F69C} Building Farm.js application with preset: ${preset}...`);
@@ -10849,8 +11118,8 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
10849
11118
  });
10850
11119
  _chunk5QIKR7RRcjs.logger.info("\u{1F50D} Discovering routes and API endpoints...");
10851
11120
  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]);
11121
+ if (_optionalChain([productionViteResult, 'optionalAccess', _216 => _216.status]) === "rejected") throw productionViteResult.reason;
11122
+ const productionVite = _optionalChain([productionViteResult, 'optionalAccess', _217 => _217.value]);
10854
11123
  const createViteServer = productionVite ? productionVite.createServer : (await import("vite")).createServer;
10855
11124
  projectModuleServer = await createProjectModuleServer(
10856
11125
  createViteServer,
@@ -10858,18 +11127,18 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
10858
11127
  root,
10859
11128
  rendererBuild.signal
10860
11129
  );
10861
- const farmApp = _chunkAS2VPMEEcjs.createFarmApp.call(void 0, config, projectModuleServer);
11130
+ const farmApp = _chunkROQ4C4LJcjs.createFarmApp.call(void 0, config, projectModuleServer);
10862
11131
  await farmApp.initialize();
10863
11132
  const routeManager = farmApp.getRouteManager();
10864
11133
  const serverRenderer = farmApp.getServerRenderer();
10865
- const typeArtifacts = _chunk5D2JIPLHcjs.generateFarmTypeArtifacts.call(void 0, {
11134
+ const typeArtifacts = _chunkQEILRWVVcjs.generateFarmTypeArtifacts.call(void 0, {
10866
11135
  root,
10867
11136
  srcDir,
10868
11137
  layers: config.layers,
10869
11138
  plugins: config.plugins,
10870
11139
  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)
11140
+ ..._optionalChain([config, 'access', _218 => _218.openapi, 'optionalAccess', _219 => _219.enabled]) && config.openapi.route ? [config.openapi.route] : [],
11141
+ ..._chunkMY5PZYADcjs.getFarmDocsRouteTypeEntries.call(void 0, config.docs)
10873
11142
  ],
10874
11143
  suppressLintOnLink: config.suppressLintOnLink,
10875
11144
  componentExtensions: config.renderer.componentExtensions,
@@ -10878,7 +11147,7 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
10878
11147
  const message = error instanceof Error ? error.message : String(error);
10879
11148
  _chunk5QIKR7RRcjs.logger.warn(`Route type generation failed (farm.d.ts may be stale): ${message}`);
10880
11149
  });
10881
- const apiRouteManager = new (0, _chunkRWFLWR5Jcjs.APIRouteManager)(
11150
+ const apiRouteManager = new (0, _chunkS7MTDRYAcjs.APIRouteManager)(
10882
11151
  _chunkWBKEZXWEcjs.getFarmAppDirectories.call(void 0, config),
10883
11152
  projectModuleServer,
10884
11153
  {
@@ -10953,7 +11222,7 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
10953
11222
  throw error;
10954
11223
  } finally {
10955
11224
  try {
10956
- await _optionalChain([projectModuleServer, 'optionalAccess', _214 => _214.close, 'call', _215 => _215()]);
11225
+ await _optionalChain([projectModuleServer, 'optionalAccess', _220 => _220.close, 'call', _221 => _221()]);
10957
11226
  } finally {
10958
11227
  rendererBuild.abort();
10959
11228
  }
@@ -10965,7 +11234,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
10965
11234
  ssr: true,
10966
11235
  buildLifetime
10967
11236
  });
10968
- const viteConfig = _chunkAS2VPMEEcjs.mergeFarmViteConfig.call(void 0,
11237
+ const viteConfig = _chunkROQ4C4LJcjs.mergeFarmViteConfig.call(void 0,
10969
11238
  {
10970
11239
  root,
10971
11240
  appType: "custom",
@@ -10977,19 +11246,19 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
10977
11246
  },
10978
11247
  plugins: [
10979
11248
  ...rendererVitePlugins,
10980
- _chunkAS2VPMEEcjs.farmFontImportsPlugin.call(void 0, {
11249
+ _chunkROQ4C4LJcjs.farmFontImportsPlugin.call(void 0, {
10981
11250
  root,
10982
11251
  basePath: config.basePath,
10983
11252
  publicDir: config.publicDir
10984
11253
  }),
10985
- _chunk3SDFA7UFcjs.farmEnvironmentFunctionsPlugin.call(void 0, )
11254
+ _chunkVDRM36QBcjs.farmEnvironmentFunctionsPlugin.call(void 0, )
10986
11255
  ],
10987
11256
  server: {
10988
11257
  middlewareMode: true,
10989
11258
  hmr: false
10990
11259
  },
10991
11260
  resolve: {
10992
- alias: _chunkAS2VPMEEcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
11261
+ alias: _chunkROQ4C4LJcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
10993
11262
  dedupe: [...config.renderer.dedupe || []]
10994
11263
  },
10995
11264
  optimizeDeps: {
@@ -11022,10 +11291,10 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
11022
11291
  noDiscovery: true
11023
11292
  },
11024
11293
  // 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 : {
11294
+ environments: _optionalChain([viteConfig, 'access', _222 => _222.environments, 'optionalAccess', _223 => _223.ssr, 'optionalAccess', _224 => _224.dev, 'optionalAccess', _225 => _225.createEnvironment]) ? viteConfig.environments : {
11026
11295
  ...viteConfig.environments,
11027
11296
  ssr: {
11028
- ..._optionalChain([viteConfig, 'access', _220 => _220.environments, 'optionalAccess', _221 => _221.ssr]),
11297
+ ..._optionalChain([viteConfig, 'access', _226 => _226.environments, 'optionalAccess', _227 => _227.ssr]),
11029
11298
  ...await createFarmProjectModuleSsrEnvironment()
11030
11299
  }
11031
11300
  }
@@ -11034,7 +11303,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
11034
11303
  _chunkS3JO3N4Hcjs.__name.call(void 0, createProjectModuleServer, "createProjectModuleServer");
11035
11304
  async function buildClient2(viteBuild, config, root, srcDir, outputDir) {
11036
11305
  const { farmI18nClientBridgePlugin, farmPlugin, farmServerOnlyEntriesPlugin } = await import("./vite.cjs");
11037
- const { PluginManager: PluginManager2 } = await import("./plugin.cjs");
11306
+ const { PluginManager: PluginManager2 } = await import("./plugin-DBBZ4JI2.cjs");
11038
11307
  const pluginManager = new PluginManager2({
11039
11308
  config,
11040
11309
  isDev: false,
@@ -11054,7 +11323,7 @@ async function buildClient2(viteBuild, config, root, srcDir, outputDir) {
11054
11323
  farmI18nClientBridgePlugin(),
11055
11324
  farmServerOnlyEntriesPlugin(),
11056
11325
  farmPlugin(config, pluginManager),
11057
- _chunk3SDFA7UFcjs.farmEnvironmentFunctionsPlugin.call(void 0, )
11326
+ _chunkVDRM36QBcjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
11058
11327
  ],
11059
11328
  mode: "production"
11060
11329
  });
@@ -11062,7 +11331,7 @@ async function buildClient2(viteBuild, config, root, srcDir, outputDir) {
11062
11331
  _chunkS3JO3N4Hcjs.__name.call(void 0, buildClient2, "buildClient");
11063
11332
  async function buildSSR(viteBuild, config, root, srcDir, outputDir) {
11064
11333
  const { farmI18nClientBridgePlugin, farmPlugin } = await import("./vite.cjs");
11065
- const { PluginManager: PluginManager2 } = await import("./plugin.cjs");
11334
+ const { PluginManager: PluginManager2 } = await import("./plugin-DBBZ4JI2.cjs");
11066
11335
  const pluginManager = new PluginManager2({
11067
11336
  config,
11068
11337
  isDev: false,
@@ -11083,12 +11352,12 @@ async function buildSSR(viteBuild, config, root, srcDir, outputDir) {
11083
11352
  define: {
11084
11353
  __FARM_API_BASE_URL__: JSON.stringify(config.api.baseURL),
11085
11354
  __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]) || {})
11355
+ __FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _228 => _228.env, 'optionalAccess', _229 => _229.public]) || {})
11087
11356
  },
11088
11357
  plugins: [
11089
11358
  farmI18nClientBridgePlugin(),
11090
11359
  farmPlugin(config, pluginManager),
11091
- _chunk3SDFA7UFcjs.farmEnvironmentFunctionsPlugin.call(void 0, )
11360
+ _chunkVDRM36QBcjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
11092
11361
  ],
11093
11362
  mode: "production"
11094
11363
  });
@@ -11105,7 +11374,7 @@ function resolveLegacyPageEntry(config, root, srcDir) {
11105
11374
  _chunkS3JO3N4Hcjs.__name.call(void 0, resolveLegacyPageEntry, "resolveLegacyPageEntry");
11106
11375
  async function buildNitro(config, routeManager, apiRouteManager, serverRenderer, preset, root, distDir, pluginManager) {
11107
11376
  const [{ createNitroConfig }, { createNitro, build: nitroBuild }] = await Promise.all([
11108
- import("./nitro-7F65EZZS.cjs"),
11377
+ import("./nitro-NPGU6VBT.cjs"),
11109
11378
  import("nitro/builder")
11110
11379
  ]);
11111
11380
  let nitroConfig = await createNitroConfig(
@@ -11118,7 +11387,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
11118
11387
  if (pluginManager) {
11119
11388
  nitroConfig = await pluginManager.runHookSerial("beforeNitroBuild", nitroConfig);
11120
11389
  }
11121
- const outputDir = _chunkHRETEZ2Zcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
11390
+ const outputDir = _chunkEX4MKHXNcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
11122
11391
  const serverOutputDir = _path2.default.join(outputDir, "server");
11123
11392
  const publicOutputDir = _path2.default.join(outputDir, "public");
11124
11393
  const { mkdir, cp } = await import("fs/promises");
@@ -11132,10 +11401,10 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
11132
11401
  const manifestPath = _path2.default.join(publicOutputDir, "farm-client-manifest.json");
11133
11402
  const assetsDir = _path2.default.join(publicOutputDir, "assets");
11134
11403
  const manifestExists = await import("fs/promises").then(
11135
- (fs3) => fs3.access(manifestPath).then(() => true).catch(() => false)
11404
+ (fs4) => fs4.access(manifestPath).then(() => true).catch(() => false)
11136
11405
  );
11137
11406
  const assetsExist = await import("fs/promises").then(
11138
- (fs3) => fs3.access(assetsDir).then(() => true).catch(() => false)
11407
+ (fs4) => fs4.access(assetsDir).then(() => true).catch(() => false)
11139
11408
  );
11140
11409
  if (manifestExists && assetsExist) {
11141
11410
  _chunk5QIKR7RRcjs.logger.info("\u2705 Verified client assets are present");
@@ -11177,7 +11446,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
11177
11446
  const { readFile } = await import("fs/promises");
11178
11447
  const manifestContent = await readFile(clientManifestPath, "utf-8");
11179
11448
  farmRegistry.clientManifest = JSON.parse(manifestContent);
11180
- } catch (e34) {
11449
+ } catch (e36) {
11181
11450
  farmRegistry.clientManifest = {};
11182
11451
  }
11183
11452
  } catch (error) {
@@ -11189,7 +11458,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
11189
11458
  root,
11190
11459
  preset,
11191
11460
  distDir,
11192
- outputDir: _chunkHRETEZ2Zcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir)
11461
+ outputDir: _chunkEX4MKHXNcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir)
11193
11462
  });
11194
11463
  }
11195
11464
  }