@farm.js/core 0.1.72 → 0.1.74

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 (370) hide show
  1. package/dist/{agent-mcp-handler-VIT4GOSR.mjs → agent-mcp-handler-HX4F4VKN.mjs} +4 -4
  2. package/dist/{agent-mcp-handler-KE4J3W7S.cjs → agent-mcp-handler-NRIL4JBC.cjs} +5 -5
  3. package/dist/{agent-mcp.d-Cwff7lcA.d.mts → agent-mcp.d-BEhDfdWc.d.mts} +1 -1
  4. package/dist/{agent-mcp.d-BO3rZXEM.d.ts → agent-mcp.d-CX8_oOT_.d.ts} +1 -1
  5. package/dist/agent-runtime.cjs +4 -4
  6. package/dist/agent-runtime.d.mts +5 -5
  7. package/dist/agent-runtime.d.ts +5 -5
  8. package/dist/agent-runtime.mjs +3 -3
  9. package/dist/{analyzer-5Q75LTIL.mjs → analyzer-2K35LIQZ.mjs} +2 -2
  10. package/dist/analyzer-6EOYURMV.cjs +16 -0
  11. package/dist/api/client.d.mts +3 -3
  12. package/dist/api/client.d.ts +3 -3
  13. package/dist/api/client.native.d.mts +4 -4
  14. package/dist/api/client.native.d.ts +4 -4
  15. package/dist/api/node.cjs +9 -8
  16. package/dist/api/node.d.mts +7 -7
  17. package/dist/api/node.d.ts +7 -7
  18. package/dist/api/node.mjs +8 -7
  19. package/dist/api/route-manager.cjs +11 -9
  20. package/dist/api/route-manager.d.mts +10 -8
  21. package/dist/api/route-manager.d.ts +10 -8
  22. package/dist/api/route-manager.mjs +10 -8
  23. package/dist/api/runtime.cjs +8 -7
  24. package/dist/api/runtime.d.mts +6 -6
  25. package/dist/api/runtime.d.ts +6 -6
  26. package/dist/api/runtime.mjs +7 -6
  27. package/dist/{api-client.d-Bp35zMqR.d.mts → api-client.d-CyVmI4Di.d.mts} +2 -2
  28. package/dist/{api-client.d-CFI_xL0V.d.ts → api-client.d-DrTM7BdH.d.ts} +2 -2
  29. package/dist/api.cjs +13 -11
  30. package/dist/api.d.mts +10 -10
  31. package/dist/api.d.ts +10 -10
  32. package/dist/api.mjs +12 -10
  33. package/dist/{app-manifest.d-USD_IbFd.d.mts → app-manifest.d-BcXt2yCx.d.mts} +10 -1
  34. package/dist/{app-manifest.d-DwjGkYlP.d.ts → app-manifest.d-CVEx1CFB.d.ts} +10 -1
  35. package/dist/app-markdown.cjs +8 -4
  36. package/dist/app-markdown.d.mts +7 -7
  37. package/dist/app-markdown.d.ts +7 -7
  38. package/dist/app-markdown.mjs +7 -3
  39. package/dist/{app.d-DAmF2MAk.d.ts → app.d-B6i8CSrx.d.ts} +36 -4
  40. package/dist/{app.d-fW06_h8h.d.mts → app.d-DowzSmT5.d.mts} +36 -4
  41. package/dist/cache.cjs +2 -2
  42. package/dist/cache.d.mts +8 -0
  43. package/dist/cache.d.ts +8 -0
  44. package/dist/cache.mjs +1 -1
  45. package/dist/chunk-2DOI6HLJ.cjs +284 -0
  46. package/dist/chunk-2GQBBOFH.mjs +76 -0
  47. package/dist/{chunk-5LOARKDP.cjs → chunk-2TZ3F6TN.cjs} +29 -17
  48. package/dist/{chunk-IWCYRDRQ.cjs → chunk-35GBGSQZ.cjs} +3 -3
  49. package/dist/{chunk-GF22VGMS.cjs → chunk-3BUJIPKE.cjs} +2 -2
  50. package/dist/{chunk-Y5LEPEVH.mjs → chunk-3ODLJRA6.mjs} +1 -1
  51. package/dist/{chunk-DMAP4RND.cjs → chunk-3OMLZLDE.cjs} +54 -16
  52. package/dist/{chunk-VNBDN5W2.cjs → chunk-47ZDUDN5.cjs} +64 -27
  53. package/dist/{chunk-2W4GNXGX.cjs → chunk-4AB62NMW.cjs} +2 -2
  54. package/dist/{chunk-HDPT6OYE.cjs → chunk-4M5ESTJ2.cjs} +10 -2
  55. package/dist/{chunk-CBLRSZQL.cjs → chunk-56HHUSR5.cjs} +502 -430
  56. package/dist/chunk-5XD2ULJG.mjs +114 -0
  57. package/dist/{chunk-JX5VOLAV.cjs → chunk-65OS2TOT.cjs} +4 -4
  58. package/dist/{chunk-WIJF3PBM.mjs → chunk-6JEXH7N6.mjs} +1 -1
  59. package/dist/{chunk-TY5KCYDE.mjs → chunk-72NTEYCX.mjs} +10 -3
  60. package/dist/{chunk-5R4Q5FN7.cjs → chunk-737MIVX3.cjs} +52 -41
  61. package/dist/{chunk-5X6OHJEE.cjs → chunk-77SVUQM5.cjs} +74 -20
  62. package/dist/{chunk-CKQAQFF6.mjs → chunk-7RKHXF4P.mjs} +2 -2
  63. package/dist/{chunk-GJEC5S4V.mjs → chunk-7VCLTNED.mjs} +1 -1
  64. package/dist/{chunk-E3LE6EZH.cjs → chunk-ACAEFEOH.cjs} +38 -41
  65. package/dist/{chunk-REP6HWJN.mjs → chunk-AL6E63FZ.mjs} +2 -2
  66. package/dist/{chunk-DQ2DI3Y7.mjs → chunk-AO5IRA2N.mjs} +2 -2
  67. package/dist/{chunk-VAWDGGW3.mjs → chunk-AU5UPNOD.mjs} +26 -15
  68. package/dist/{chunk-DS7JGFW5.mjs → chunk-B3XY6FMC.mjs} +71 -17
  69. package/dist/{chunk-U7VH3Q5E.cjs → chunk-B5WZP3T3.cjs} +15 -2
  70. package/dist/{chunk-3JN5M3T5.mjs → chunk-BFOMCSZ2.mjs} +476 -138
  71. package/dist/{chunk-I4KPA2C6.mjs → chunk-BIX46FTI.mjs} +1 -1
  72. package/dist/{chunk-YZLEOMMA.mjs → chunk-BNXV3PRM.mjs} +4 -4
  73. package/dist/{chunk-3GNVIYPO.cjs → chunk-BSJMWCWM.cjs} +7 -7
  74. package/dist/{chunk-WVQNXXNE.cjs → chunk-BWFBTTJ5.cjs} +2 -2
  75. package/dist/{chunk-FEFCISOX.cjs → chunk-CEVXKJKF.cjs} +2 -2
  76. package/dist/{chunk-DGNMXL2O.mjs → chunk-CF77L6RL.mjs} +33 -36
  77. package/dist/{chunk-OB45EAQL.mjs → chunk-CXQZQK6R.mjs} +3 -2
  78. package/dist/{chunk-255J7K4X.mjs → chunk-D2IAYGYA.mjs} +1 -1
  79. package/dist/{chunk-OSEQL34Q.cjs → chunk-D4TYE6MY.cjs} +2 -2
  80. package/dist/{chunk-FSSONJRV.cjs → chunk-DM2YGTRH.cjs} +24 -17
  81. package/dist/{chunk-ICFPTHXM.mjs → chunk-DRBXYJZ6.mjs} +7 -3
  82. package/dist/{chunk-E3HDJCWF.mjs → chunk-DRHHTHA3.mjs} +1 -1
  83. package/dist/{chunk-YXIQYWOK.cjs → chunk-DTBRSRTR.cjs} +23 -5
  84. package/dist/{chunk-JZQS3ZOI.mjs → chunk-E4T7WJJN.mjs} +10 -2
  85. package/dist/{chunk-YAEN3L2F.cjs → chunk-EF5AP4CV.cjs} +21 -2
  86. package/dist/{chunk-SPP3EZTJ.cjs → chunk-EHJOSIXM.cjs} +137 -67
  87. package/dist/{chunk-JZBU7V4D.mjs → chunk-ELJQWUAR.mjs} +125 -55
  88. package/dist/{chunk-DMXMIE2C.cjs → chunk-ENYBDM4U.cjs} +2 -2
  89. package/dist/{chunk-ZFEJ2SF2.cjs → chunk-EWIEJQP6.cjs} +28 -28
  90. package/dist/{chunk-ZUVAGMQ5.cjs → chunk-F244KE2D.cjs} +7 -7
  91. package/dist/{chunk-WW3LRNQV.mjs → chunk-FCBUNILW.mjs} +1 -1
  92. package/dist/{chunk-645ENY7W.mjs → chunk-FEQ72ZHD.mjs} +16 -9
  93. package/dist/{chunk-ME7RVELR.mjs → chunk-FGXSWRWA.mjs} +20 -1
  94. package/dist/{chunk-2AFW7673.cjs → chunk-FNWL5DMG.cjs} +4 -3
  95. package/dist/{chunk-HLMUWKAP.cjs → chunk-FYV6DTAG.cjs} +826 -531
  96. package/dist/{chunk-7PPLTD3P.cjs → chunk-G7S6XG6X.cjs} +6 -6
  97. package/dist/{chunk-AQIO3RNL.mjs → chunk-GK2GBIXD.mjs} +3 -3
  98. package/dist/{chunk-IHTDLCDJ.cjs → chunk-GRHSQYD4.cjs} +17 -4
  99. package/dist/{chunk-W44X6IC2.cjs → chunk-HBLYSWIJ.cjs} +13 -9
  100. package/dist/chunk-HK4VJI27.cjs +76 -0
  101. package/dist/{chunk-EGIY4A7V.cjs → chunk-HKZVC5GP.cjs} +2 -2
  102. package/dist/{chunk-EYPSKXO4.mjs → chunk-HRQV5Q3J.mjs} +1 -1
  103. package/dist/{chunk-S7MWSFFP.cjs → chunk-IBEHVSU4.cjs} +2 -2
  104. package/dist/{chunk-77VNYVVX.mjs → chunk-IG4IQMIW.mjs} +1 -1
  105. package/dist/{chunk-N3XO5AL5.cjs → chunk-IJFNXP3D.cjs} +2 -2
  106. package/dist/{chunk-RFWWXEIF.mjs → chunk-IP2R2TAE.mjs} +1 -1
  107. package/dist/{chunk-FETMUBIA.mjs → chunk-IZ5WOTQP.mjs} +1 -1
  108. package/dist/{chunk-CSLHNBPS.cjs → chunk-J42QN7OC.cjs} +6 -6
  109. package/dist/{chunk-NDDRTFN4.mjs → chunk-J7EUGGTY.mjs} +2 -2
  110. package/dist/{chunk-5XFKWHZD.mjs → chunk-JI6N4W2I.mjs} +208 -136
  111. package/dist/{chunk-GJ7QVFAG.mjs → chunk-JOECBGY7.mjs} +1 -1
  112. package/dist/{chunk-CL52PD6D.cjs → chunk-JSUVQ5HG.cjs} +8 -8
  113. package/dist/{chunk-DZHTNSQ5.cjs → chunk-JWHRVBCZ.cjs} +14 -14
  114. package/dist/{chunk-OSMUE5ST.mjs → chunk-JZ43UD6S.mjs} +7 -7
  115. package/dist/{chunk-RLEALQEN.mjs → chunk-KIRIFO6T.mjs} +43 -5
  116. package/dist/{chunk-XGTFLG73.cjs → chunk-KMYOKQPP.cjs} +18 -11
  117. package/dist/{chunk-WX63N6C5.mjs → chunk-KNEYWPZV.mjs} +64 -27
  118. package/dist/{chunk-AYVGD3PK.mjs → chunk-KUMKBBYP.mjs} +1 -1
  119. package/dist/{chunk-VT25ERQK.mjs → chunk-KWUZJZ23.mjs} +21 -3
  120. package/dist/{chunk-NV26EGMC.mjs → chunk-LHFGTR7F.mjs} +2 -2
  121. package/dist/{chunk-4P5634G6.cjs → chunk-LIQJYEQP.cjs} +14 -9
  122. package/dist/chunk-LRPPXKCX.mjs +58 -0
  123. package/dist/chunk-LXTYJ2HW.mjs +139 -0
  124. package/dist/{chunk-O32QPFVV.cjs → chunk-MKQ27TGW.cjs} +5 -5
  125. package/dist/{chunk-KQAB5LML.mjs → chunk-MQ5HA7H2.mjs} +2 -2
  126. package/dist/{chunk-Z3GPAFIA.mjs → chunk-MUITBU5Z.mjs} +1 -1
  127. package/dist/chunk-NDOE76QC.cjs +58 -0
  128. package/dist/{chunk-EXN4DTVF.cjs → chunk-NET6PBUH.cjs} +2 -2
  129. package/dist/{chunk-YBY34UHB.mjs → chunk-NKETXVKP.mjs} +15 -2
  130. package/dist/chunk-NRWEY2CM.mjs +25 -0
  131. package/dist/chunk-NU5XLYRN.cjs +139 -0
  132. package/dist/{chunk-BE7AQXJB.cjs → chunk-NXGQIXR7.cjs} +507 -169
  133. package/dist/{chunk-C5AM2XDN.cjs → chunk-O2A6HE76.cjs} +4 -4
  134. package/dist/{chunk-OAEDVXVE.mjs → chunk-O6K4G7YA.mjs} +5 -2
  135. package/dist/{chunk-LXEJNWF5.mjs → chunk-OSKIG4OP.mjs} +2 -2
  136. package/dist/{chunk-3WG7GJQL.cjs → chunk-P3EZKU6L.cjs} +18 -18
  137. package/dist/{chunk-C2JOS77Z.cjs → chunk-PG6ZIHKE.cjs} +250 -51
  138. package/dist/{chunk-ET6WW3FY.cjs → chunk-Q3MVNRAO.cjs} +1305 -848
  139. package/dist/{chunk-AZ6IW6SF.mjs → chunk-Q4G52OSW.mjs} +1 -1
  140. package/dist/{chunk-TPYAYFMF.cjs → chunk-QL3YZTGZ.cjs} +2 -2
  141. package/dist/{chunk-JMFTKNBA.mjs → chunk-R4BWNP73.mjs} +2 -2
  142. package/dist/{chunk-J5ASGNKF.mjs → chunk-R6Q6VSGU.mjs} +24 -9
  143. package/dist/{chunk-B6RBJJ5G.mjs → chunk-RBRIKT6B.mjs} +15 -2
  144. package/dist/{chunk-C6CUUBY5.cjs → chunk-RHI67C2V.cjs} +5 -5
  145. package/dist/chunk-RK3YYUX6.cjs +114 -0
  146. package/dist/{chunk-Y2LU4LE5.mjs → chunk-ROPMQNCG.mjs} +2 -2
  147. package/dist/{chunk-QIXEU2WV.cjs → chunk-RQ4UZJPR.cjs} +3 -3
  148. package/dist/{chunk-ZDZUFD67.cjs → chunk-RSL3YFJG.cjs} +1 -1
  149. package/dist/{chunk-JWY66PID.cjs → chunk-S3D6SL2V.cjs} +9 -6
  150. package/dist/{chunk-4HGLJOXZ.cjs → chunk-TPDKFRQX.cjs} +11 -11
  151. package/dist/{chunk-E2V7RRFL.mjs → chunk-UHAARKF3.mjs} +2 -2
  152. package/dist/{chunk-QSTRBKHZ.mjs → chunk-UJWRXBVP.mjs} +2 -2
  153. package/dist/{chunk-7QCJDYZQ.cjs → chunk-V6T3UJAH.cjs} +7 -7
  154. package/dist/{chunk-AUAMXI6N.mjs → chunk-VFPFXMTF.mjs} +1 -1
  155. package/dist/{chunk-KPJYBSHL.mjs → chunk-VKLV7GF4.mjs} +221 -22
  156. package/dist/{chunk-TP4RAV7Y.cjs → chunk-VKRMO3EZ.cjs} +8 -8
  157. package/dist/chunk-VWIW47FW.cjs +25 -0
  158. package/dist/{chunk-L6E4SHUB.cjs → chunk-VZKCGHWC.cjs} +39 -24
  159. package/dist/{chunk-JWLRBDDC.cjs → chunk-WH3PBJS7.cjs} +2 -2
  160. package/dist/{chunk-BSXKZPFE.mjs → chunk-WS4SLJW5.mjs} +501 -206
  161. package/dist/{chunk-5OFNUETM.mjs → chunk-WTTJ2YS2.mjs} +9 -1
  162. package/dist/{chunk-RLFGKJQ6.mjs → chunk-X2KNHD4B.mjs} +14 -2
  163. package/dist/{chunk-5CFHQ7HM.mjs → chunk-XXKMAHYE.mjs} +1 -1
  164. package/dist/{chunk-MBCRWU3P.cjs → chunk-XZPI44Q7.cjs} +4 -4
  165. package/dist/{chunk-ACGBXN3U.cjs → chunk-Y4FEQBKY.cjs} +17 -9
  166. package/dist/{chunk-MWUDEYBI.mjs → chunk-YH33PZ3K.mjs} +1 -1
  167. package/dist/chunk-YQWRBBAA.mjs +284 -0
  168. package/dist/{chunk-QUYAGU65.mjs → chunk-YWDRWG4L.mjs} +1210 -753
  169. package/dist/{chunk-E46NXBNJ.mjs → chunk-ZD7JUTBY.mjs} +11 -6
  170. package/dist/{chunk-JDO346NV.mjs → chunk-ZLRWO5GK.mjs} +1 -1
  171. package/dist/{chunk-NAXKOTPP.cjs → chunk-ZRCGPSUM.cjs} +21 -21
  172. package/dist/{chunk-YCNHUIPR.cjs → chunk-ZZGANFQH.cjs} +10 -10
  173. package/dist/client/lifecycle.d.mts +1 -1
  174. package/dist/client/lifecycle.d.ts +1 -1
  175. package/dist/{client-component.d-9J7CkTWW.d.ts → client-component.d-DYOwmq0c.d.ts} +80 -3
  176. package/dist/{client-component.d-ciHeCxr-.d.mts → client-component.d-edV76QvU.d.mts} +80 -3
  177. package/dist/{client-plugins.d-CUOhfapO.d.ts → client-plugins.d-BmJYW2FY.d.ts} +20 -7
  178. package/dist/{client-plugins.d-JnRz5a1o.d.mts → client-plugins.d-DwvqqGsU.d.mts} +20 -7
  179. package/dist/client-plugins.d.mts +5 -5
  180. package/dist/client-plugins.d.ts +5 -5
  181. package/dist/client.cjs +6 -5
  182. package/dist/client.d.mts +12 -12
  183. package/dist/client.d.ts +12 -12
  184. package/dist/client.mjs +5 -4
  185. package/dist/config.d.mts +5 -5
  186. package/dist/config.d.ts +5 -5
  187. package/dist/cron.cjs +6 -2
  188. package/dist/cron.d.mts +11 -2
  189. package/dist/cron.d.ts +11 -2
  190. package/dist/cron.mjs +7 -3
  191. package/dist/desktop.d.mts +6 -6
  192. package/dist/desktop.d.ts +6 -6
  193. package/dist/{devtools-7JPQMSTQ.mjs → devtools-WPX62NG2.mjs} +10 -9
  194. package/dist/{devtools-IZFUYWPG.cjs → devtools-YMDS7PUA.cjs} +12 -11
  195. package/dist/docs.cjs +14 -13
  196. package/dist/docs.d.mts +6 -6
  197. package/dist/docs.d.ts +6 -6
  198. package/dist/docs.mjs +13 -12
  199. package/dist/{endpoint.d-BkMSCRf6.d.mts → endpoint.d-BXbBpKoh.d.mts} +42 -1
  200. package/dist/{endpoint.d-BgHn0lhl.d.ts → endpoint.d-Dx_1k6Du.d.ts} +42 -1
  201. package/dist/environment/vite.cjs +3 -3
  202. package/dist/environment/vite.mjs +2 -2
  203. package/dist/headers.cjs +3 -3
  204. package/dist/{headers.d-CqpTL_fZ.d.ts → headers.d-BIbQyAxJ.d.ts} +1 -1
  205. package/dist/{headers.d-rbbTKGaN.d.mts → headers.d-BtNxFc2s.d.mts} +1 -1
  206. package/dist/headers.mjs +2 -2
  207. package/dist/index.cjs +73 -60
  208. package/dist/{index.d-CMKvzHLW.d.ts → index.d-CQ_wUzOV.d.ts} +1 -1
  209. package/dist/{index.d-D_B2D9Il.d.mts → index.d-CQdDRXd1.d.mts} +1 -1
  210. package/dist/index.d.mts +63 -29
  211. package/dist/index.d.ts +63 -29
  212. package/dist/index.mjs +69 -56
  213. package/dist/integrations/orm.d.mts +5 -5
  214. package/dist/integrations/orm.d.ts +5 -5
  215. package/dist/integrations.cjs +4 -4
  216. package/dist/integrations.d.mts +5 -5
  217. package/dist/integrations.d.ts +5 -5
  218. package/dist/integrations.mjs +3 -3
  219. package/dist/internal/app-markdown-runtime.cjs +7 -3
  220. package/dist/internal/app-markdown-runtime.d.mts +18 -7
  221. package/dist/internal/app-markdown-runtime.d.ts +18 -7
  222. package/dist/internal/app-markdown-runtime.mjs +6 -2
  223. package/dist/internal/build-runtime.cjs +42 -40
  224. package/dist/internal/build-runtime.d.mts +7 -7
  225. package/dist/internal/build-runtime.d.ts +7 -7
  226. package/dist/internal/build-runtime.mjs +41 -39
  227. package/dist/internal/cli-runtime.cjs +21 -20
  228. package/dist/internal/cli-runtime.mjs +20 -19
  229. package/dist/internal/client-error-overlay.cjs +6 -6
  230. package/dist/internal/client-error-overlay.mjs +2 -2
  231. package/dist/internal/client-runtime.cjs +6 -2
  232. package/dist/internal/client-runtime.d.mts +22 -10
  233. package/dist/internal/client-runtime.d.ts +22 -10
  234. package/dist/internal/client-runtime.mjs +5 -1
  235. package/dist/internal/compression-runtime.d.mts +5 -5
  236. package/dist/internal/compression-runtime.d.ts +5 -5
  237. package/dist/internal/config-runtime.cjs +12 -11
  238. package/dist/internal/config-runtime.d.mts +7 -7
  239. package/dist/internal/config-runtime.d.ts +7 -7
  240. package/dist/internal/config-runtime.mjs +11 -10
  241. package/dist/internal/form-actions.cjs +5 -4
  242. package/dist/internal/form-actions.d.mts +2 -2
  243. package/dist/internal/form-actions.d.ts +2 -2
  244. package/dist/internal/form-actions.mjs +4 -3
  245. package/dist/internal/infra-analytics-runtime.cjs +10 -10
  246. package/dist/internal/infra-analytics-runtime.mjs +8 -8
  247. package/dist/internal/native-server-fns.cjs +4 -4
  248. package/dist/internal/native-server-fns.mjs +3 -3
  249. package/dist/internal/product-telemetry-runtime.cjs +3 -3
  250. package/dist/internal/product-telemetry-runtime.mjs +2 -2
  251. package/dist/internal/production-runtime.cjs +32 -22
  252. package/dist/internal/production-runtime.d.mts +65 -14
  253. package/dist/internal/production-runtime.d.ts +65 -14
  254. package/dist/internal/production-runtime.mjs +31 -21
  255. package/dist/internal/react-cache.cjs +3 -3
  256. package/dist/internal/react-cache.mjs +1 -1
  257. package/dist/internal/vercel-edge-middleware.cjs +4 -4
  258. package/dist/internal/vercel-edge-middleware.mjs +3 -3
  259. package/dist/{lifecycle.d-keQs5Swc.d.mts → lifecycle.d-OtGWAvJT.d.mts} +4 -0
  260. package/dist/{lifecycle.d-keQs5Swc.d.ts → lifecycle.d-OtGWAvJT.d.ts} +4 -0
  261. package/dist/{manager-JIA66YJ2.mjs → manager-RHB2P35B.mjs} +4 -1
  262. package/dist/{manager-JOHU6BQI.cjs → manager-S77ZARTC.cjs} +5 -2
  263. package/dist/markdown.cjs +2 -2
  264. package/dist/markdown.d.mts +5 -5
  265. package/dist/markdown.d.ts +5 -5
  266. package/dist/markdown.mjs +1 -1
  267. package/dist/middleware.cjs +6 -6
  268. package/dist/middleware.d.mts +5 -5
  269. package/dist/middleware.d.ts +5 -5
  270. package/dist/middleware.mjs +5 -5
  271. package/dist/{mount.d-ImEO7q8a.d.mts → mount.d-6bhpBQQB.d.mts} +1 -1
  272. package/dist/{mount.d-B0XMxDRh.d.ts → mount.d-C-u7rFkM.d.ts} +1 -1
  273. package/dist/{native-server-fn-handler-EP5AFJYE.mjs → native-server-fn-handler-I66X4E5S.mjs} +6 -5
  274. package/dist/{native-server-fn-handler-QRTXGZA4.cjs → native-server-fn-handler-W4FSD76W.cjs} +7 -6
  275. package/dist/{native-tree-L2IIEBXH.mjs → native-tree-3X23BT3N.mjs} +2 -2
  276. package/dist/{native-tree-GF4BH33L.cjs → native-tree-TAPKR7QJ.cjs} +3 -3
  277. package/dist/{navigation-delegate.d-83Q7ksf7.d.mts → navigation-delegate.d-nx6gtsY4.d.mts} +1 -1
  278. package/dist/{navigation-delegate.d-RRx1CSlb.d.ts → navigation-delegate.d-xsG4T1x-.d.ts} +1 -1
  279. package/dist/navigation.cjs +4 -4
  280. package/dist/navigation.d.mts +8 -8
  281. package/dist/navigation.d.ts +8 -8
  282. package/dist/navigation.mjs +3 -3
  283. package/dist/{nitro-2LMOMIST.cjs → nitro-SSFTPZMW.cjs} +4 -4
  284. package/dist/{nitro-72TFIGGO.mjs → nitro-XTQ2HKDL.mjs} +1 -1
  285. package/dist/{observability.d-B2363jB6.d.ts → observability.d-DdJRiaIX.d.mts} +27 -3
  286. package/dist/{observability.d-B2363jB6.d.mts → observability.d-DdJRiaIX.d.ts} +27 -3
  287. package/dist/observability.d.mts +1 -1
  288. package/dist/observability.d.ts +1 -1
  289. package/dist/plugin.cjs +36 -33
  290. package/dist/plugin.d.mts +8 -8
  291. package/dist/plugin.d.ts +8 -8
  292. package/dist/plugin.mjs +35 -32
  293. package/dist/query/client.cjs +5 -5
  294. package/dist/query/client.mjs +1 -1
  295. package/dist/{render-plan.d-wP8nTeRV.d.mts → render-plan.d-B5y3h97B.d.mts} +1 -1
  296. package/dist/{render-plan.d-Ds2sXJ5m.d.ts → render-plan.d-gW0fwKz2.d.ts} +1 -1
  297. package/dist/renderer-client.cjs +4 -4
  298. package/dist/renderer-client.d.mts +8 -8
  299. package/dist/renderer-client.d.ts +8 -8
  300. package/dist/renderer-client.mjs +1 -1
  301. package/dist/request.cjs +2 -2
  302. package/dist/{request.d-zpSn6pu_.d.ts → request.d-B0ugAadD.d.ts} +9 -2
  303. package/dist/{request.d-F3h7K37m.d.mts → request.d-DLq33nYo.d.mts} +9 -2
  304. package/dist/request.d.mts +6 -6
  305. package/dist/request.d.ts +6 -6
  306. package/dist/request.mjs +1 -1
  307. package/dist/{route-rendering.d-Mw0ZKG2e.d.mts → route-rendering.d-DSeIV7yV.d.mts} +1 -1
  308. package/dist/{route-rendering.d-BL0_AdKj.d.ts → route-rendering.d-ytaqDQD6.d.ts} +1 -1
  309. package/dist/{route.d-DrXkpvcg.d.mts → route.d-Cd4Fi6BA.d.ts} +3 -1
  310. package/dist/{route.d-hs-_cyHn.d.ts → route.d-ShmtqqVQ.d.mts} +3 -1
  311. package/dist/{router.d-BwXigemZ.d.ts → router.d-BaEAEGPg.d.ts} +1 -1
  312. package/dist/{router.d-NGVsU11T.d.mts → router.d-Chd5cpe3.d.mts} +1 -1
  313. package/dist/routes.cjs +5 -3
  314. package/dist/routes.d.mts +5 -5
  315. package/dist/routes.d.ts +5 -5
  316. package/dist/routes.mjs +4 -2
  317. package/dist/{rsc-pipeline-DHYZLWSF.mjs → rsc-pipeline-DPMYONEV.mjs} +12 -11
  318. package/dist/{rsc-pipeline-BNXYMG4G.cjs → rsc-pipeline-XIUUMMG5.cjs} +13 -12
  319. package/dist/{runtime-IWOT6ZVC.cjs → runtime-WD77S3C5.cjs} +25 -25
  320. package/dist/{runtime-XPYKUNL3.mjs → runtime-XIUJZTZ3.mjs} +16 -16
  321. package/dist/{runtime.d-BA3MzhXz.d.mts → runtime.d-DpCs0eAO.d.mts} +3 -3
  322. package/dist/{runtime.d-OBIZWpx1.d.ts → runtime.d-h2USyQsz.d.ts} +3 -3
  323. package/dist/server-action-security.cjs +5 -3
  324. package/dist/server-action-security.d.mts +11 -3
  325. package/dist/server-action-security.d.ts +11 -3
  326. package/dist/server-action-security.mjs +4 -2
  327. package/dist/server-fn-client.d.mts +3 -3
  328. package/dist/server-fn-client.d.ts +3 -3
  329. package/dist/server-fn.cjs +6 -5
  330. package/dist/server-fn.d.mts +1 -1
  331. package/dist/server-fn.d.ts +1 -1
  332. package/dist/server-fn.mjs +5 -4
  333. package/dist/server-plugins.cjs +4 -4
  334. package/dist/server-plugins.d.mts +54 -10
  335. package/dist/server-plugins.d.ts +54 -10
  336. package/dist/server-plugins.mjs +3 -3
  337. package/dist/server-query-client.d.mts +1 -1
  338. package/dist/server-query-client.d.ts +1 -1
  339. package/dist/server-query.cjs +7 -6
  340. package/dist/server-query.d.mts +1 -1
  341. package/dist/server-query.d.ts +1 -1
  342. package/dist/server-query.mjs +6 -5
  343. package/dist/server.cjs +65 -68
  344. package/dist/server.d.mts +15 -15
  345. package/dist/server.d.ts +15 -15
  346. package/dist/server.mjs +44 -47
  347. package/dist/{spa-router.d-BG2XzE5p.d.mts → spa-router.d-DCQVtEaE.d.mts} +11 -5
  348. package/dist/{spa-router.d-DrYT944-.d.ts → spa-router.d-DpdJHs1q.d.ts} +11 -5
  349. package/dist/testing.cjs +16 -14
  350. package/dist/testing.d.mts +5 -5
  351. package/dist/testing.d.ts +5 -5
  352. package/dist/testing.mjs +12 -10
  353. package/dist/theme/server.cjs +3 -3
  354. package/dist/theme/server.mjs +2 -2
  355. package/dist/{utils.d-C1k9BJeD.d.mts → utils.d-DKDZtAY5.d.mts} +1 -1
  356. package/dist/{utils.d-DcF4wxey.d.ts → utils.d-DmicwMvS.d.ts} +1 -1
  357. package/dist/version.cjs +2 -2
  358. package/dist/version.mjs +1 -1
  359. package/dist/vite.cjs +38 -33
  360. package/dist/vite.d.mts +24 -10
  361. package/dist/vite.d.ts +24 -10
  362. package/dist/vite.mjs +37 -32
  363. package/package.json +1 -1
  364. package/dist/analyzer-UJG4MIZW.cjs +0 -16
  365. package/dist/chunk-6I4BFRE7.cjs +0 -51
  366. package/dist/chunk-EIVGPQN5.mjs +0 -51
  367. package/dist/chunk-V3UOEWCB.cjs +0 -46
  368. package/dist/chunk-VE3FWJBO.mjs +0 -46
  369. /package/dist/{chunk-QEJWNXRI.cjs → chunk-EMRYJG4U.cjs} +0 -0
  370. /package/dist/{chunk-TXE4SAMV.mjs → chunk-H2ZJ35NW.mjs} +0 -0
@@ -5,6 +5,11 @@
5
5
  var _chunk3QM74STYcjs = require('./chunk-3QM74STY.cjs');
6
6
 
7
7
 
8
+
9
+
10
+ var _chunk2DOI6HLJcjs = require('./chunk-2DOI6HLJ.cjs');
11
+
12
+
8
13
  var _chunkO47W53D3cjs = require('./chunk-O47W53D3.cjs');
9
14
 
10
15
 
@@ -32,12 +37,13 @@ var _chunkO47W53D3cjs = require('./chunk-O47W53D3.cjs');
32
37
 
33
38
 
34
39
 
35
- var _chunkCBLRSZQLcjs = require('./chunk-CBLRSZQL.cjs');
40
+
41
+ var _chunk56HHUSR5cjs = require('./chunk-56HHUSR5.cjs');
36
42
 
37
43
 
38
44
 
39
45
 
40
- var _chunkDMXMIE2Ccjs = require('./chunk-DMXMIE2C.cjs');
46
+ var _chunkENYBDM4Ucjs = require('./chunk-ENYBDM4U.cjs');
41
47
 
42
48
 
43
49
  var _chunkPMU4U2W2cjs = require('./chunk-PMU4U2W2.cjs');
@@ -47,7 +53,7 @@ var _chunkAQLHD6HZcjs = require('./chunk-AQLHD6HZ.cjs');
47
53
 
48
54
 
49
55
 
50
- var _chunkE3LE6EZHcjs = require('./chunk-E3LE6EZH.cjs');
56
+ var _chunkACAEFEOHcjs = require('./chunk-ACAEFEOH.cjs');
51
57
 
52
58
 
53
59
 
@@ -61,9 +67,7 @@ var _chunkPIUTGRDIcjs = require('./chunk-PIUTGRDI.cjs');
61
67
 
62
68
 
63
69
 
64
-
65
-
66
- var _chunkC5AM2XDNcjs = require('./chunk-C5AM2XDN.cjs');
70
+ var _chunkO2A6HE76cjs = require('./chunk-O2A6HE76.cjs');
67
71
 
68
72
 
69
73
  var _chunk3HLQTOVUcjs = require('./chunk-3HLQTOVU.cjs');
@@ -81,13 +85,13 @@ var _chunk3HLQTOVUcjs = require('./chunk-3HLQTOVU.cjs');
81
85
 
82
86
 
83
87
 
84
- var _chunkFSSONJRVcjs = require('./chunk-FSSONJRV.cjs');
88
+ var _chunkDM2YGTRHcjs = require('./chunk-DM2YGTRH.cjs');
85
89
 
86
90
 
87
- var _chunkTP4RAV7Ycjs = require('./chunk-TP4RAV7Y.cjs');
91
+ var _chunkVKRMO3EZcjs = require('./chunk-VKRMO3EZ.cjs');
88
92
 
89
93
 
90
- var _chunkOSEQL34Qcjs = require('./chunk-OSEQL34Q.cjs');
94
+ var _chunkD4TYE6MYcjs = require('./chunk-D4TYE6MY.cjs');
91
95
 
92
96
 
93
97
  var _chunk7EPYN7GWcjs = require('./chunk-7EPYN7GW.cjs');
@@ -123,7 +127,15 @@ var _chunk7EPYN7GWcjs = require('./chunk-7EPYN7GW.cjs');
123
127
 
124
128
 
125
129
 
126
- var _chunkBE7AQXJBcjs = require('./chunk-BE7AQXJB.cjs');
130
+
131
+
132
+
133
+
134
+
135
+
136
+
137
+
138
+ var _chunkNXGQIXR7cjs = require('./chunk-NXGQIXR7.cjs');
127
139
 
128
140
 
129
141
 
@@ -147,10 +159,10 @@ var _chunkSTF6VDYQcjs = require('./chunk-STF6VDYQ.cjs');
147
159
 
148
160
 
149
161
 
150
- var _chunkZUVAGMQ5cjs = require('./chunk-ZUVAGMQ5.cjs');
162
+ var _chunkF244KE2Dcjs = require('./chunk-F244KE2D.cjs');
151
163
 
152
164
 
153
- var _chunkO32QPFVVcjs = require('./chunk-O32QPFVV.cjs');
165
+ var _chunkMKQ27TGWcjs = require('./chunk-MKQ27TGW.cjs');
154
166
 
155
167
 
156
168
  var _chunkRE5E2G5Scjs = require('./chunk-RE5E2G5S.cjs');
@@ -180,7 +192,7 @@ var _chunk3EIPOTZVcjs = require('./chunk-3EIPOTZV.cjs');
180
192
 
181
193
 
182
194
 
183
- var _chunkL6E4SHUBcjs = require('./chunk-L6E4SHUB.cjs');
195
+ var _chunkVZKCGHWCcjs = require('./chunk-VZKCGHWC.cjs');
184
196
 
185
197
 
186
198
 
@@ -192,21 +204,21 @@ var _chunk2HW5LWAHcjs = require('./chunk-2HW5LWAH.cjs');
192
204
 
193
205
 
194
206
 
195
- var _chunkC2JOS77Zcjs = require('./chunk-C2JOS77Z.cjs');
207
+ var _chunkPG6ZIHKEcjs = require('./chunk-PG6ZIHKE.cjs');
196
208
 
197
209
 
198
210
 
199
211
 
200
212
 
201
213
 
202
- var _chunkJX5VOLAVcjs = require('./chunk-JX5VOLAV.cjs');
214
+ var _chunk65OS2TOTcjs = require('./chunk-65OS2TOT.cjs');
203
215
 
204
216
 
205
217
 
206
218
  var _chunkX333W5KVcjs = require('./chunk-X333W5KV.cjs');
207
219
 
208
220
 
209
- var _chunkACGBXN3Ucjs = require('./chunk-ACGBXN3U.cjs');
221
+ var _chunkY4FEQBKYcjs = require('./chunk-Y4FEQBKY.cjs');
210
222
 
211
223
 
212
224
 
@@ -222,7 +234,7 @@ var _chunkKBGZ5FD6cjs = require('./chunk-KBGZ5FD6.cjs');
222
234
  var _chunkP2355C6Ecjs = require('./chunk-P2355C6E.cjs');
223
235
 
224
236
 
225
- var _chunk5LOARKDPcjs = require('./chunk-5LOARKDP.cjs');
237
+ var _chunk2TZ3F6TNcjs = require('./chunk-2TZ3F6TN.cjs');
226
238
 
227
239
 
228
240
  var _chunkNLBK37HIcjs = require('./chunk-NLBK37HI.cjs');
@@ -234,7 +246,7 @@ var _chunkKORZ6PREcjs = require('./chunk-KORZ6PRE.cjs');
234
246
 
235
247
 
236
248
 
237
- var _chunkXGTFLG73cjs = require('./chunk-XGTFLG73.cjs');
249
+ var _chunkKMYOKQPPcjs = require('./chunk-KMYOKQPP.cjs');
238
250
 
239
251
 
240
252
  var _chunkLRB5OVRTcjs = require('./chunk-LRB5OVRT.cjs');
@@ -285,7 +297,7 @@ var _chunkSUCDVKUBcjs = require('./chunk-SUCDVKUB.cjs');
285
297
  var _chunkEVIWKPJVcjs = require('./chunk-EVIWKPJV.cjs');
286
298
 
287
299
 
288
- var _chunkZDZUFD67cjs = require('./chunk-ZDZUFD67.cjs');
300
+ var _chunkRSL3YFJGcjs = require('./chunk-RSL3YFJG.cjs');
289
301
 
290
302
 
291
303
  var _chunkPMJSG4JScjs = require('./chunk-PMJSG4JS.cjs');
@@ -315,11 +327,12 @@ var _chunkDVJM55D2cjs = require('./chunk-DVJM55D2.cjs');
315
327
 
316
328
 
317
329
 
318
- var _chunkMBCRWU3Pcjs = require('./chunk-MBCRWU3P.cjs');
330
+ var _chunkXZPI44Q7cjs = require('./chunk-XZPI44Q7.cjs');
331
+
319
332
 
320
333
 
321
334
 
322
- var _chunkHDPT6OYEcjs = require('./chunk-HDPT6OYE.cjs');
335
+ var _chunk4M5ESTJ2cjs = require('./chunk-4M5ESTJ2.cjs');
323
336
 
324
337
 
325
338
  var _chunk7JUIK547cjs = require('./chunk-7JUIK547.cjs');
@@ -673,36 +686,197 @@ function findClientServerFnViolation(code, id) {
673
686
  const specifiers = match[1];
674
687
  for (const factory of SERVER_FN_FACTORIES) {
675
688
  if (!new RegExp(`(?:^|[\\s{,])${factory}(?:[\\s},]|$)`).test(specifiers)) continue;
676
- if (new RegExp(`(?<![\\w$.])${factory}\\s*(?:<[^>]*>)?\\s*\\(`).test(code)) {
677
- return { factory };
678
- }
689
+ const call = new RegExp(`(?<![\\w$.])${factory}\\s*(?:<[^>]*>)?\\s*\\(`).exec(code);
690
+ if (call) return { factory, start: call.index };
679
691
  }
680
692
  }
681
693
  return null;
682
694
  }
683
- function formatServerFnBoundaryError(violation, id) {
684
- return [
685
- `${violation.factory} handlers run only on the server, but ${id} is being bundled into the client.`,
686
- `Importing a ${violation.factory} module from client code executes the server handler (and its Node-only imports) in the browser.`,
687
- `Either enable the server-function transform (add @farm.js/plugin/rsc and set experimental.serverActions: true in farm.config.ts) so client imports become server references,`,
688
- `or keep the query on the server: call it from server components, or expose an API route and use createAPIClient from the client.`
689
- ].join("\n");
695
+ function createServerFnBoundaryDiagnostic(violation, id, location) {
696
+ return _chunkNXGQIXR7cjs.createFarmDiagnostic.call(void 0,
697
+ "CLIENT_SERVER_FUNCTION",
698
+ id,
699
+ `${violation.factory} handlers run only on the server, but this module is bundled into the client, so the handler and its Node-only imports would run in the browser.`,
700
+ location
701
+ );
690
702
  }
691
703
 
692
704
  // src/client-boundary-env.ts
705
+
693
706
  var FUNCTION_BODY_TYPES = /* @__PURE__ */ new Set([
694
707
  "FunctionDeclaration",
695
708
  "FunctionExpression",
696
709
  "ArrowFunctionExpression"
697
710
  ]);
711
+ var BARE_BUILTIN_NAMES = new Set(
712
+ _module.builtinModules.filter((name) => !name.startsWith("_") && !name.includes(":")).map((name) => name.split("/", 1)[0])
713
+ );
714
+ var BARE_BUILTIN_SPECIFIER_RE = new RegExp(
715
+ String.raw`(?:\bfrom|\bimport|\brequire)\s*\(?\s*["'](?:` + [...BARE_BUILTIN_NAMES].join("|") + String.raw`)(?:/[^"']*)?["']`
716
+ );
717
+ var SPECIFIER_POSITION_RE = /(?:\bfrom|\bimport|\brequire)\s*\(?\s*$/;
698
718
  function shouldInspectClientBoundary(id, code) {
699
719
  if (id.startsWith("\0") || id.startsWith("virtual:") || id.includes("node_modules")) return false;
700
- return code.includes("process.env") || code.includes("node:");
720
+ return mayUseServerOnlyApis(code);
721
+ }
722
+ var KEYWORDS_BEFORE_EXPRESSION = /* @__PURE__ */ new Set([
723
+ "await",
724
+ "case",
725
+ "delete",
726
+ "do",
727
+ "else",
728
+ "in",
729
+ "instanceof",
730
+ "new",
731
+ "of",
732
+ "return",
733
+ "throw",
734
+ "typeof",
735
+ "void",
736
+ "yield"
737
+ ]);
738
+ function isBuiltinNameCode(code) {
739
+ return code >= 97 && code <= 122 || code >= 48 && code <= 57 || code === 95;
740
+ }
741
+ function isIdentifierCode(code) {
742
+ return code >= 97 && code <= 122 || code >= 65 && code <= 90 || code >= 48 && code <= 57 || code === 95 || code === 36 || code > 127;
743
+ }
744
+ function mayUseServerOnlyApis(code) {
745
+ if (!code.includes("process.env") && !code.includes("node:") && !BARE_BUILTIN_SPECIFIER_RE.test(code)) {
746
+ return false;
747
+ }
748
+ const templateBraces = [];
749
+ let index = 0;
750
+ let previous = 0;
751
+ let previousWordStart = -1;
752
+ const startsBuiltinSpecifier = (quote) => {
753
+ const start = quote + 1;
754
+ if (code.startsWith("node:", start)) return true;
755
+ let end = start;
756
+ while (end < code.length && isBuiltinNameCode(code.charCodeAt(end))) end += 1;
757
+ const after = code.charCodeAt(end);
758
+ return end > start && (after === code.charCodeAt(quote) || after === 47) && BARE_BUILTIN_NAMES.has(code.slice(start, end)) && SPECIFIER_POSITION_RE.test(code.slice(Math.max(0, quote - 16), quote));
759
+ };
760
+ const skipTemplateText = () => {
761
+ while (index < code.length) {
762
+ const character = code.charCodeAt(index);
763
+ if (character === 92) {
764
+ index += 2;
765
+ } else if (character === 96) {
766
+ index += 1;
767
+ previous = 96;
768
+ return false;
769
+ } else if (character === 36 && code.charCodeAt(index + 1) === 123) {
770
+ index += 2;
771
+ templateBraces.push(0);
772
+ previous = 123;
773
+ return true;
774
+ } else {
775
+ index += 1;
776
+ }
777
+ }
778
+ return false;
779
+ };
780
+ while (index < code.length) {
781
+ const character = code.charCodeAt(index);
782
+ const next = code.charCodeAt(index + 1);
783
+ if (character === 47 && next === 47) {
784
+ const end = code.indexOf("\n", index);
785
+ index = end === -1 ? code.length : end;
786
+ continue;
787
+ }
788
+ if (character === 47 && next === 42) {
789
+ const end = code.indexOf("*/", index + 2);
790
+ index = end === -1 ? code.length : end + 2;
791
+ continue;
792
+ }
793
+ if (character === 39 || character === 34) {
794
+ if (startsBuiltinSpecifier(index)) return true;
795
+ index += 1;
796
+ while (index < code.length) {
797
+ const inner = code.charCodeAt(index);
798
+ if (inner === 92) {
799
+ index += 2;
800
+ continue;
801
+ }
802
+ index += 1;
803
+ if (inner === character || inner === 10) break;
804
+ }
805
+ previous = character;
806
+ continue;
807
+ }
808
+ if (character === 96) {
809
+ if (startsBuiltinSpecifier(index)) return true;
810
+ index += 1;
811
+ skipTemplateText();
812
+ continue;
813
+ }
814
+ if (character === 47) {
815
+ const word = previousWordStart === -1 ? "" : code.slice(previousWordStart, index).trim();
816
+ const startsExpression = !(isIdentifierCode(previous) || previous === 41 || previous === 93) || KEYWORDS_BEFORE_EXPRESSION.has(word);
817
+ index += 1;
818
+ if (startsExpression) {
819
+ let inClass = false;
820
+ while (index < code.length) {
821
+ const inner = code.charCodeAt(index);
822
+ if (inner === 10) break;
823
+ index += 1;
824
+ if (inner === 92) index += 1;
825
+ else if (inner === 91) inClass = true;
826
+ else if (inner === 93) inClass = false;
827
+ else if (inner === 47 && !inClass) break;
828
+ }
829
+ previous = 41;
830
+ previousWordStart = -1;
831
+ } else {
832
+ previous = 47;
833
+ previousWordStart = -1;
834
+ }
835
+ continue;
836
+ }
837
+ if (templateBraces.length > 0 && (character === 123 || character === 125)) {
838
+ const depth = templateBraces.length - 1;
839
+ if (character === 123) {
840
+ templateBraces[depth] += 1;
841
+ } else if (templateBraces[depth] === 0) {
842
+ templateBraces.pop();
843
+ index += 1;
844
+ skipTemplateText();
845
+ continue;
846
+ } else {
847
+ templateBraces[depth] -= 1;
848
+ }
849
+ }
850
+ if (isIdentifierCode(character)) {
851
+ const start = index;
852
+ if (character === 112 && code.startsWith("process.env", index) && !isIdentifierCode(previous === 0 ? 32 : code.charCodeAt(index - 1))) {
853
+ return true;
854
+ }
855
+ while (index < code.length && isIdentifierCode(code.charCodeAt(index))) index += 1;
856
+ previous = code.charCodeAt(index - 1);
857
+ previousWordStart = start;
858
+ continue;
859
+ }
860
+ if (character > 32) {
861
+ previous = character;
862
+ previousWordStart = -1;
863
+ }
864
+ index += 1;
865
+ }
866
+ return false;
701
867
  }
702
868
  function analyzeClientBoundary(program, publicKeys) {
703
- const envKeys = /* @__PURE__ */ new Set();
704
- const publicEnvKeys = /* @__PURE__ */ new Set();
705
- const builtinImports = /* @__PURE__ */ new Set();
869
+ const findings = [];
870
+ const seen = /* @__PURE__ */ new Set();
871
+ const add = (kind, name, node) => {
872
+ const key = `${kind}\0${name}`;
873
+ if (seen.has(key)) return;
874
+ seen.add(key);
875
+ findings.push({ kind, name, start: _nullishCoalesce(node.start, () => ( 0)) });
876
+ };
877
+ const addEnvKey = (key, node) => {
878
+ if (key !== "NODE_ENV") add(publicKeys.has(key) ? "public-env" : "server-env", key, node);
879
+ };
706
880
  const visit = (node, inFunction) => {
707
881
  if (!node || typeof node !== "object") return;
708
882
  if (Array.isArray(node)) {
@@ -712,13 +886,20 @@ function analyzeClientBoundary(program, publicKeys) {
712
886
  const estree = node;
713
887
  if (typeof estree.type !== "string") return;
714
888
  if (!inFunction) {
715
- const builtin = readNodeBuiltinSource(estree);
716
- if (builtin !== void 0) builtinImports.add(builtin);
889
+ const builtin = readBuiltinSource(estree);
890
+ if (builtin !== void 0) add("builtin", builtin, estree);
717
891
  const key = readProcessEnvKey(estree);
718
892
  if (key !== void 0) {
719
- if (key !== "NODE_ENV") {
720
- (publicKeys.has(key) ? publicEnvKeys : envKeys).add(key);
893
+ addEnvKey(key, estree);
894
+ return;
895
+ }
896
+ if (estree.type === "VariableDeclarator" && isProcessEnv(estree.init) && _optionalChain([estree, 'access', _30 => _30.id, 'optionalAccess', _31 => _31.type]) === "ObjectPattern") {
897
+ for (const property of _nullishCoalesce(estree.id.properties, () => ( []))) {
898
+ if (property.type !== "Property") continue;
899
+ const name = readPropertyKey(property);
900
+ if (name !== void 0) addEnvKey(name, property);
721
901
  }
902
+ visit(estree.id.properties, inFunction);
722
903
  return;
723
904
  }
724
905
  }
@@ -729,31 +910,26 @@ function analyzeClientBoundary(program, publicKeys) {
729
910
  }
730
911
  };
731
912
  visit(program.body, false);
732
- return {
733
- envKeys: [...envKeys],
734
- publicEnvKeys: [...publicEnvKeys],
735
- builtinImports: [...builtinImports]
736
- };
913
+ return findings;
737
914
  }
738
- function readNodeBuiltinSource(node) {
915
+ function readBuiltinSource(node) {
916
+ let value;
739
917
  if (node.type === "ImportDeclaration" || node.type === "ExportNamedDeclaration" || node.type === "ExportAllDeclaration" || node.type === "ImportExpression") {
740
- const value = _optionalChain([node, 'access', _30 => _30.source, 'optionalAccess', _31 => _31.value]);
741
- return typeof value === "string" && value.startsWith("node:") ? value : void 0;
742
- }
743
- if (node.type === "CallExpression") {
918
+ value = _optionalChain([node, 'access', _32 => _32.source, 'optionalAccess', _33 => _33.value]);
919
+ } else if (node.type === "CallExpression") {
744
920
  const callee = node.callee;
745
- if (_optionalChain([callee, 'optionalAccess', _32 => _32.type]) === "Identifier" && callee.name === "require") {
746
- const arg = _optionalChain([node, 'access', _33 => _33.arguments, 'optionalAccess', _34 => _34[0]]);
747
- const value = _optionalChain([arg, 'optionalAccess', _35 => _35.type]) === "Literal" ? arg.value : void 0;
748
- return typeof value === "string" && value.startsWith("node:") ? value : void 0;
921
+ if (_optionalChain([callee, 'optionalAccess', _34 => _34.type]) === "Identifier" && callee.name === "require") {
922
+ const arg = _optionalChain([node, 'access', _35 => _35.arguments, 'optionalAccess', _36 => _36[0]]);
923
+ value = _optionalChain([arg, 'optionalAccess', _37 => _37.type]) === "Literal" ? arg.value : void 0;
749
924
  }
750
925
  }
751
- return void 0;
926
+ return typeof value === "string" && _module.isBuiltin.call(void 0, value) ? value : void 0;
927
+ }
928
+ function isProcessEnv(node) {
929
+ return _optionalChain([node, 'optionalAccess', _38 => _38.type]) === "MemberExpression" && !node.computed && _optionalChain([node, 'access', _39 => _39.object, 'optionalAccess', _40 => _40.type]) === "Identifier" && node.object.name === "process" && _optionalChain([node, 'access', _41 => _41.property, 'optionalAccess', _42 => _42.name]) === "env";
752
930
  }
753
931
  function readProcessEnvKey(node) {
754
- if (node.type !== "MemberExpression") return void 0;
755
- const object = node.object;
756
- if (!object || object.type !== "MemberExpression" || _optionalChain([object, 'access', _36 => _36.object, 'optionalAccess', _37 => _37.type]) !== "Identifier" || object.object.name !== "process" || _optionalChain([object, 'access', _38 => _38.property, 'optionalAccess', _39 => _39.name]) !== "env") {
932
+ if (node.type !== "MemberExpression" || !isProcessEnv(node.object)) {
757
933
  return void 0;
758
934
  }
759
935
  const property = node.property;
@@ -767,25 +943,36 @@ function readProcessEnvKey(node) {
767
943
  }
768
944
  return void 0;
769
945
  }
770
- function formatClientBoundaryWarning(id, findings) {
771
- const { envKeys, publicEnvKeys, builtinImports } = findings;
772
- const lines = [`${id} is compiled for the client but uses server-only APIs:`];
773
- if (envKeys.length > 0) {
774
- lines.push(
775
- `- module-scope read of process.env.${envKeys.join(", process.env.")} \u2014 undefined in the browser. Move the read behind a server boundary, or expose it through env.public in farm.config.ts.`
776
- );
777
- }
778
- if (publicEnvKeys.length > 0) {
779
- lines.push(
780
- `- module-scope read of process.env.${publicEnvKeys.join(", process.env.")} \u2014 process.env is not populated in the browser even for public keys. Read it through publicEnv from "@farm.js/core/env".`
781
- );
782
- }
783
- if (builtinImports.length > 0) {
784
- lines.push(
785
- `- import of ${builtinImports.join(", ")} \u2014 stubbed in the browser, where exports without a Web API equivalent are undefined. Move the import into server-only code.`
786
- );
946
+ function readPropertyKey(property) {
947
+ const key = property.key;
948
+ if (!property.computed && _optionalChain([key, 'optionalAccess', _43 => _43.type]) === "Identifier") return key.name;
949
+ const value = _optionalChain([key, 'optionalAccess', _44 => _44.type]) === "Literal" ? key.value : void 0;
950
+ return typeof value === "string" ? value : void 0;
951
+ }
952
+ function createClientBoundaryDiagnostic(file, finding, location) {
953
+ switch (finding.kind) {
954
+ case "server-env":
955
+ return _chunkNXGQIXR7cjs.createFarmDiagnostic.call(void 0,
956
+ "CLIENT_SERVER_ENV",
957
+ file,
958
+ `process.env.${finding.name} is read at module scope in a module compiled for the browser, where it is undefined.`,
959
+ location
960
+ );
961
+ case "public-env":
962
+ return _chunkNXGQIXR7cjs.createFarmDiagnostic.call(void 0,
963
+ "CLIENT_PROCESS_ENV_PUBLIC",
964
+ file,
965
+ `process.env.${finding.name} is declared public, but process.env is not populated in the browser, so this module-scope read is undefined there.`,
966
+ location
967
+ );
968
+ case "builtin":
969
+ return _chunkNXGQIXR7cjs.createFarmDiagnostic.call(void 0,
970
+ "CLIENT_NODE_BUILTIN",
971
+ file,
972
+ `"${finding.name}" is imported into a module compiled for the browser, which gets a stub whose exports without a Web API equivalent are undefined.`,
973
+ location
974
+ );
787
975
  }
788
- return lines.join("\n");
789
976
  }
790
977
 
791
978
  // src/image-vite.ts
@@ -816,7 +1003,7 @@ function farmImageImportsPlugin() {
816
1003
  async transform(code, id) {
817
1004
  const filePath = id.split("?", 1)[0];
818
1005
  if (id.includes("?") || !STATIC_IMAGE_RE.test(filePath)) return null;
819
- const defaultExport = _optionalChain([code, 'access', _40 => _40.match, 'call', _41 => _41(/^\s*export\s+default\s+(.+?);?\s*$/s), 'optionalAccess', _42 => _42[1]]);
1006
+ const defaultExport = _optionalChain([code, 'access', _45 => _45.match, 'call', _46 => _46(/^\s*export\s+default\s+(.+?);?\s*$/s), 'optionalAccess', _47 => _47[1]]);
820
1007
  if (!defaultExport) return null;
821
1008
  return createStaticImageModule(filePath, `const src = ${defaultExport};`);
822
1009
  }
@@ -914,7 +1101,7 @@ function rewriteFarmReactCacheImport(code, file, cacheModule = FARM_REACT_CACHE_
914
1101
  }
915
1102
  const edits = [];
916
1103
  const declarations = (_nullishCoalesce(program.body, () => ( []))).filter(
917
- (node) => node.type === "ImportDeclaration" && _optionalChain([node, 'access', _43 => _43.source, 'optionalAccess', _44 => _44.value]) === "react" && node.importKind !== "type"
1104
+ (node) => node.type === "ImportDeclaration" && _optionalChain([node, 'access', _48 => _48.source, 'optionalAccess', _49 => _49.value]) === "react" && node.importKind !== "type"
918
1105
  );
919
1106
  const namespaces = /* @__PURE__ */ new Set();
920
1107
  let memberImportAt = null;
@@ -929,7 +1116,7 @@ function rewriteFarmReactCacheImport(code, file, cacheModule = FARM_REACT_CACHE_
929
1116
  const caches = specifiers.filter(
930
1117
  (specifier) => specifier.type === "ImportSpecifier" && specifier.importKind !== "type" && Object.prototype.hasOwnProperty.call(
931
1118
  REACT_CACHE_APIS,
932
- _nullishCoalesce(_nullishCoalesce(_optionalChain([specifier, 'access', _45 => _45.imported, 'optionalAccess', _46 => _46.name]), () => ( _optionalChain([specifier, 'access', _47 => _47.imported, 'optionalAccess', _48 => _48.value]))), () => ( ""))
1119
+ _nullishCoalesce(_nullishCoalesce(_optionalChain([specifier, 'access', _50 => _50.imported, 'optionalAccess', _51 => _51.name]), () => ( _optionalChain([specifier, 'access', _52 => _52.imported, 'optionalAccess', _53 => _53.value]))), () => ( ""))
933
1120
  )
934
1121
  );
935
1122
  if (caches.length === 0) continue;
@@ -943,7 +1130,7 @@ function rewriteFarmReactCacheImport(code, file, cacheModule = FARM_REACT_CACHE_
943
1130
  ].join(", ");
944
1131
  const lines = [
945
1132
  ...clause ? [`import ${clause} from "react";`] : [],
946
- `import { ${caches.map((specifier) => `${_nullishCoalesce(_optionalChain([specifier, 'access', _49 => _49.imported, 'optionalAccess', _50 => _50.name]), () => ( _optionalChain([specifier, 'access', _51 => _51.imported, 'optionalAccess', _52 => _52.value])))} as ${specifier.local.name}`).join(", ")} } from ${JSON.stringify(cacheModule)};`
1133
+ `import { ${caches.map((specifier) => `${_nullishCoalesce(_optionalChain([specifier, 'access', _54 => _54.imported, 'optionalAccess', _55 => _55.name]), () => ( _optionalChain([specifier, 'access', _56 => _56.imported, 'optionalAccess', _57 => _57.value])))} as ${specifier.local.name}`).join(", ")} } from ${JSON.stringify(cacheModule)};`
947
1134
  ];
948
1135
  edits.push({ start: node.start, end: node.end, text: lines.join("\n") });
949
1136
  }
@@ -958,7 +1145,7 @@ function rewriteFarmReactCacheImport(code, file, cacheModule = FARM_REACT_CACHE_
958
1145
  const current = node;
959
1146
  if (typeof current.type !== "string") return;
960
1147
  if (current.type === "ImportDeclaration") return;
961
- if (current.type === "MemberExpression" && !current.computed && _optionalChain([current, 'access', _53 => _53.object, 'optionalAccess', _54 => _54.type]) === "Identifier" && namespaces.has(current.object.name) && Object.prototype.hasOwnProperty.call(REACT_CACHE_APIS, _nullishCoalesce(_optionalChain([current, 'access', _55 => _55.property, 'optionalAccess', _56 => _56.name]), () => ( "")))) {
1148
+ if (current.type === "MemberExpression" && !current.computed && _optionalChain([current, 'access', _58 => _58.object, 'optionalAccess', _59 => _59.type]) === "Identifier" && namespaces.has(current.object.name) && Object.prototype.hasOwnProperty.call(REACT_CACHE_APIS, _nullishCoalesce(_optionalChain([current, 'access', _60 => _60.property, 'optionalAccess', _61 => _61.name]), () => ( "")))) {
962
1149
  const name = current.property.name;
963
1150
  edits.push({ start: current.start, end: current.end, text: REACT_CACHE_APIS[name] });
964
1151
  used.add(name);
@@ -1029,13 +1216,13 @@ function reportOpenAPIDevGenerationResult(spec, output = _chunkQMNWKQL4cjs.logge
1029
1216
  // src/vite.ts
1030
1217
  var SERVER_FN_TRANSFORM_PLUGIN = "@farm.js/plugin/rsc:server-fn-actions";
1031
1218
  function farmLlmsTxtGeneratedPaths(config) {
1032
- const llms = _chunkO32QPFVVcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([config, 'access', _57 => _57.agent, 'optionalAccess', _58 => _58.llmsTxt]));
1219
+ const llms = _chunkMKQ27TGWcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([config, 'access', _62 => _62.agent, 'optionalAccess', _63 => _63.llmsTxt]));
1033
1220
  if (!llms.enabled) return [];
1034
1221
  return llms.full ? ["/llms.txt", "/llms-full.txt"] : ["/llms.txt"];
1035
1222
  }
1036
1223
  function farmAgentGeneratedPaths(config) {
1037
- const crawlers = _chunkZUVAGMQ5cjs.resolveFarmAgentCrawlers.call(void 0, _optionalChain([config, 'access', _59 => _59.agent, 'optionalAccess', _60 => _60.crawlers]));
1038
- const sitemap = _chunkZUVAGMQ5cjs.resolveFarmAgentSitemap.call(void 0, _optionalChain([config, 'access', _61 => _61.agent, 'optionalAccess', _62 => _62.sitemap]));
1224
+ const crawlers = _chunkF244KE2Dcjs.resolveFarmAgentCrawlers.call(void 0, _optionalChain([config, 'access', _64 => _64.agent, 'optionalAccess', _65 => _65.crawlers]));
1225
+ const sitemap = _chunkF244KE2Dcjs.resolveFarmAgentSitemap.call(void 0, _optionalChain([config, 'access', _66 => _66.agent, 'optionalAccess', _67 => _67.sitemap]));
1039
1226
  return [
1040
1227
  ...farmLlmsTxtGeneratedPaths(config),
1041
1228
  ...sitemap.enabled ? ["/sitemap.xml"] : [],
@@ -1074,13 +1261,13 @@ function loadFarmDocsSearchDevRuntime() {
1074
1261
  return import("./search-client-ZZLKVO5R.cjs");
1075
1262
  }
1076
1263
  function loadFarmOpenAPIDevRuntime() {
1077
- return import("./manager-JOHU6BQI.cjs");
1264
+ return import("./manager-S77ZARTC.cjs");
1078
1265
  }
1079
1266
  function loadFarmWorkflowsDevRuntime() {
1080
1267
  return import("./workflows.cjs");
1081
1268
  }
1082
1269
  function loadFarmDevtoolsSnapshotRuntime() {
1083
- return import("./devtools-IZFUYWPG.cjs");
1270
+ return import("./devtools-YMDS7PUA.cjs");
1084
1271
  }
1085
1272
  function loadFarmDevtoolsUIRuntime() {
1086
1273
  return import("./devtools-ui-SYRUXUA7.cjs");
@@ -1093,7 +1280,7 @@ function farmI18nClientBridgePlugin() {
1093
1280
  name: "farm:i18n-client-bridge",
1094
1281
  enforce: "pre",
1095
1282
  resolveId(id, _importer, options) {
1096
- if (id === "@farm.js/core/i18n/server" && !_optionalChain([options, 'optionalAccess', _63 => _63.ssr])) {
1283
+ if (id === "@farm.js/core/i18n/server" && !_optionalChain([options, 'optionalAccess', _68 => _68.ssr])) {
1097
1284
  return FARM_I18N_CLIENT_BRIDGE_ID;
1098
1285
  }
1099
1286
  return null;
@@ -1111,16 +1298,16 @@ var FARM_SERVER_ONLY_PACKAGE_ID = "\0farm:server-only";
1111
1298
  var FARM_PLATFORM_ENTRY = "@farm.js/core/platform";
1112
1299
  var FARM_PLATFORM_CLIENT_ID = "\0farm:platform-client";
1113
1300
  var FARM_SERVER_ONLY_ENTRIES_RESOLVE_FILTER = [
1114
- _chunkCBLRSZQLcjs.exactIdPattern.call(void 0, [FARM_PLATFORM_ENTRY, SERVER_ONLY_PACKAGE, ...FARM_SERVER_ONLY_ENTRIES]),
1115
- new RegExp(`^${_chunkBE7AQXJBcjs.FARM_RESOLVE_FROM_PREFIX}`),
1301
+ _chunk56HHUSR5cjs.exactIdPattern.call(void 0, [FARM_PLATFORM_ENTRY, SERVER_ONLY_PACKAGE, ...FARM_SERVER_ONLY_ENTRIES]),
1302
+ new RegExp(`^${_chunkNXGQIXR7cjs.FARM_RESOLVE_FROM_PREFIX}`),
1116
1303
  // What isBuiltin() accepts: `node:` ids and the builtin names, subpaths such as fs/promises
1117
1304
  // included.
1118
1305
  /^node:/,
1119
- _chunkCBLRSZQLcjs.exactIdPattern.call(void 0, _module.builtinModules)
1306
+ _chunk56HHUSR5cjs.exactIdPattern.call(void 0, _module.builtinModules)
1120
1307
  ];
1121
1308
  var FARM_SERVER_ONLY_ENTRIES_LOAD_FILTER = [
1122
- _chunkCBLRSZQLcjs.exactIdPattern.call(void 0, [FARM_SERVER_ONLY_PACKAGE_ID, FARM_PLATFORM_CLIENT_ID]),
1123
- new RegExp(`^${_chunkBE7AQXJBcjs.FARM_BROWSER_BUILTIN_PREFIX}`)
1309
+ _chunk56HHUSR5cjs.exactIdPattern.call(void 0, [FARM_SERVER_ONLY_PACKAGE_ID, FARM_PLATFORM_CLIENT_ID]),
1310
+ new RegExp(`^${_chunkNXGQIXR7cjs.FARM_BROWSER_BUILTIN_PREFIX}`)
1124
1311
  ];
1125
1312
  function createFarmPlatformClientModule(platform) {
1126
1313
  return `export function platform() { return ${JSON.stringify(platform)}; }
@@ -1141,6 +1328,37 @@ function createFarmServerPrebundleConfig(bundledPackages) {
1141
1328
  }
1142
1329
  };
1143
1330
  }
1331
+ function farmIslandContainersPlugin(config) {
1332
+ let root = _nullishCoalesce(config.root, () => ( process.cwd()));
1333
+ return {
1334
+ name: "farm:island-containers",
1335
+ enforce: "pre",
1336
+ configResolved(resolved) {
1337
+ root = config.root || resolved.root;
1338
+ },
1339
+ transform(code, id) {
1340
+ if (_chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _69 => _69.experimental, 'optionalAccess', _70 => _70.serverComponents])) !== "islands") {
1341
+ return null;
1342
+ }
1343
+ if (id.startsWith("\0") || id.includes("/node_modules/") || !/\.[jt]sx(?:$|\?)/.test(id)) {
1344
+ return null;
1345
+ }
1346
+ if (_chunkNXGQIXR7cjs.hasUseClientDirective.call(void 0, code)) return null;
1347
+ const file = id.split("?", 1)[0];
1348
+ const bindings = _chunkNXGQIXR7cjs.getFarmClientRenderingBindings.call(void 0, code, file, root);
1349
+ if (bindings.length === 0) return null;
1350
+ const grown = _chunkNXGQIXR7cjs.wrapFarmIslandContainers.call(void 0, {
1351
+ code,
1352
+ file,
1353
+ bindings,
1354
+ reference: _chunkNXGQIXR7cjs.farmIslandContainerReferencePath.call(void 0, root)
1355
+ });
1356
+ if (grown === null) return null;
1357
+ _chunkNXGQIXR7cjs.ensureFarmIslandContainerReference.call(void 0, root);
1358
+ return { code: grown, map: null };
1359
+ }
1360
+ };
1361
+ }
1144
1362
  function farmServerOnlyEntriesPlugin(options = {}) {
1145
1363
  let root = process.cwd();
1146
1364
  let vercelOgInstalled = false;
@@ -1148,11 +1366,11 @@ function farmServerOnlyEntriesPlugin(options = {}) {
1148
1366
  name: "farm:server-only-entries",
1149
1367
  enforce: "pre",
1150
1368
  config(config) {
1151
- const bundledPackages = _chunkBE7AQXJBcjs.collectFarmServerBundledPackageInfo.call(void 0,
1369
+ const bundledPackages = _chunkNXGQIXR7cjs.collectFarmServerBundledPackageInfo.call(void 0,
1152
1370
  path6.resolve(_nullishCoalesce(config.root, () => ( process.cwd())))
1153
1371
  );
1154
1372
  return {
1155
- optimizeDeps: { rolldownOptions: { plugins: [_chunkBE7AQXJBcjs.farmBrowserBuiltinsOptimizerPlugin.call(void 0, )] } },
1373
+ optimizeDeps: { rolldownOptions: { plugins: [_chunkNXGQIXR7cjs.farmBrowserBuiltinsOptimizerPlugin.call(void 0, )] } },
1156
1374
  ssr: {
1157
1375
  noExternal: [
1158
1376
  // Resolve `server-only` here rather than in Node, which would load its throwing build.
@@ -1170,19 +1388,26 @@ function farmServerOnlyEntriesPlugin(options = {}) {
1170
1388
  resolveId: {
1171
1389
  filter: { id: FARM_SERVER_ONLY_ENTRIES_RESOLVE_FILTER },
1172
1390
  handler(id, importer, options2) {
1173
- if (id === FARM_PLATFORM_ENTRY) return _optionalChain([options2, 'optionalAccess', _64 => _64.ssr]) ? null : FARM_PLATFORM_CLIENT_ID;
1391
+ if (id === FARM_PLATFORM_ENTRY) return _optionalChain([options2, 'optionalAccess', _71 => _71.ssr]) ? null : FARM_PLATFORM_CLIENT_ID;
1174
1392
  if (id === SERVER_ONLY_PACKAGE) {
1175
- if (_optionalChain([options2, 'optionalAccess', _65 => _65.ssr]) || _optionalChain([options2, 'optionalAccess', _66 => _66.scan])) {
1393
+ if (_optionalChain([options2, 'optionalAccess', _72 => _72.ssr]) || _optionalChain([options2, 'optionalAccess', _73 => _73.scan])) {
1176
1394
  return FARM_SERVER_ONLY_PACKAGE_ID;
1177
1395
  }
1178
1396
  this.error(
1179
- `${_nullishCoalesce(importer, () => ( "A module"))} imports "server-only", so it must not reach the browser, but client code imports it. Move what the client needs out of that module, or call it from a server component, server function or API route.`
1397
+ _chunkNXGQIXR7cjs.formatFarmDiagnostic.call(void 0,
1398
+ _chunkNXGQIXR7cjs.createFarmDiagnostic.call(void 0,
1399
+ "CLIENT_SERVER_ONLY_IMPORT",
1400
+ _nullishCoalesce(importer, () => ( "<unknown module>")),
1401
+ `${importer ? "This module" : "A module"} imports "server-only", so it must not reach the browser, but client code imports it.`
1402
+ ),
1403
+ root
1404
+ )
1180
1405
  );
1181
1406
  }
1182
- if (!_optionalChain([options2, 'optionalAccess', _67 => _67.ssr]) && _module.isBuiltin.call(void 0, id)) {
1183
- return _chunkBE7AQXJBcjs.resolveFarmBrowserBuiltin.call(void 0, this, id, importer, options2);
1407
+ if (!_optionalChain([options2, 'optionalAccess', _74 => _74.ssr]) && _module.isBuiltin.call(void 0, id)) {
1408
+ return _chunkNXGQIXR7cjs.resolveFarmBrowserBuiltin.call(void 0, this, id, importer, options2);
1184
1409
  }
1185
- const resolveFrom = importer ? _chunkBE7AQXJBcjs.parseFarmResolveFrom.call(void 0, id, importer.split("?", 1)[0]) : null;
1410
+ const resolveFrom = importer ? _chunkNXGQIXR7cjs.parseFarmResolveFrom.call(void 0, id, importer.split("?", 1)[0]) : null;
1186
1411
  if (resolveFrom) {
1187
1412
  const directory = path6.dirname(resolveFrom.importer);
1188
1413
  return this.resolve(resolveFrom.specifier, resolveFrom.importer, {
@@ -1197,9 +1422,16 @@ function farmServerOnlyEntriesPlugin(options = {}) {
1197
1422
  }
1198
1423
  if (!FARM_SERVER_ONLY_ENTRIES.has(id)) return null;
1199
1424
  const importedBy = importer ? ` (imported by ${importer})` : "";
1200
- if (!_optionalChain([options2, 'optionalAccess', _68 => _68.ssr])) {
1425
+ if (!_optionalChain([options2, 'optionalAccess', _75 => _75.ssr])) {
1201
1426
  this.error(
1202
- `${id} is server-only and cannot be imported into client code${importedBy}. Use it from an API route or another server module.`
1427
+ _chunkNXGQIXR7cjs.formatFarmDiagnostic.call(void 0,
1428
+ _chunkNXGQIXR7cjs.createFarmDiagnostic.call(void 0,
1429
+ "CLIENT_SERVER_ONLY_ENTRY",
1430
+ _nullishCoalesce(importer, () => ( id)),
1431
+ `${id} is server-only and cannot be imported into client code.`
1432
+ ),
1433
+ root
1434
+ )
1203
1435
  );
1204
1436
  }
1205
1437
  vercelOgInstalled || (vercelOgInstalled = _chunkKORZ6PREcjs.isOptionalPeerInstalled.call(void 0, root, "@vercel/og"));
@@ -1218,7 +1450,7 @@ function farmServerOnlyEntriesPlugin(options = {}) {
1218
1450
  if (id === FARM_PLATFORM_CLIENT_ID) {
1219
1451
  return createFarmPlatformClientModule(_nullishCoalesce(options.platform, () => ( _chunkAQLHD6HZcjs.resolveFarmPlatform.call(void 0, ))));
1220
1452
  }
1221
- return _nullishCoalesce(_chunkBE7AQXJBcjs.loadFarmBrowserBuiltin.call(void 0, id), () => ( null));
1453
+ return _nullishCoalesce(_chunkNXGQIXR7cjs.loadFarmBrowserBuiltin.call(void 0, id), () => ( null));
1222
1454
  }
1223
1455
  }
1224
1456
  };
@@ -1251,10 +1483,10 @@ function renderFarmI18nStaticHead(requestPath, snapshot) {
1251
1483
  if (!snapshot) return "";
1252
1484
  const runtime = `<script>window.__FARM_I18N__ = ${serializeFarmInlineValue(snapshot)};</script>`;
1253
1485
  if (snapshot.routing === "none") return runtime;
1254
- return `${_chunkC5AM2XDNcjs.renderFarmLocaleAlternateLinks.call(void 0, requestPath, snapshot)}${runtime}`;
1486
+ return `${_chunkO2A6HE76cjs.renderFarmLocaleAlternateLinks.call(void 0, requestPath, snapshot)}${runtime}`;
1255
1487
  }
1256
1488
  function getPublicEnvDefine(config) {
1257
- const publicEnv = _optionalChain([config, 'access', _69 => _69.env, 'optionalAccess', _70 => _70.public]);
1489
+ const publicEnv = _optionalChain([config, 'access', _76 => _76.env, 'optionalAccess', _77 => _77.public]);
1258
1490
  if (!isResolvedEnvScope(publicEnv)) {
1259
1491
  return {};
1260
1492
  }
@@ -1275,7 +1507,7 @@ function createRequestFromNodeRequest(req, url, signal) {
1275
1507
  signal
1276
1508
  });
1277
1509
  }
1278
- function withFarmRequestTracing(handler, apiRuntime, resolveTraceUrl = (request) => _chunkHDPT6OYEcjs.resolveFarmRequestURL.call(void 0, request)) {
1510
+ function withFarmRequestTracing(handler, apiRuntime, resolveTraceUrl = (request) => _chunk4M5ESTJ2cjs.resolveFarmRequestURL.call(void 0, request)) {
1279
1511
  const middleware = _chunkP2355C6Ecjs._withAfterNodeMiddleware.call(void 0, handler);
1280
1512
  return (req, res, next) => {
1281
1513
  const traceUrl = resolveTraceUrl(req);
@@ -1293,12 +1525,12 @@ function withFarmRequestTracing(handler, apiRuntime, resolveTraceUrl = (request)
1293
1525
  return;
1294
1526
  }
1295
1527
  if (res.headersSent) {
1296
- _optionalChain([res, 'access', _71 => _71.destroy, 'optionalCall', _72 => _72(error instanceof Error ? error : new Error(String(error)))]);
1528
+ _optionalChain([res, 'access', _78 => _78.destroy, 'optionalCall', _79 => _79(error instanceof Error ? error : new Error(String(error)))]);
1297
1529
  return;
1298
1530
  }
1299
1531
  res.statusCode = 500;
1300
1532
  res.setHeader("Content-Type", "application/json");
1301
- res.end(_chunkXGTFLG73cjs.FARM_INTERNAL_SERVER_ERROR_BODY);
1533
+ res.end(_chunkKMYOKQPPcjs.FARM_INTERNAL_SERVER_ERROR_BODY);
1302
1534
  });
1303
1535
  };
1304
1536
  }
@@ -1306,10 +1538,10 @@ function sendFarmDevErrorJSON(res) {
1306
1538
  res.statusCode = 500;
1307
1539
  res.setHeader("Content-Type", "application/json");
1308
1540
  res.setHeader("Cache-Control", "private, no-store");
1309
- res.end(_chunkXGTFLG73cjs.FARM_INTERNAL_SERVER_ERROR_BODY);
1541
+ res.end(_chunkKMYOKQPPcjs.FARM_INTERNAL_SERVER_ERROR_BODY);
1310
1542
  }
1311
1543
  function createFarmDevMiddlewareErrorResponse() {
1312
- return new Response(_chunkXGTFLG73cjs.FARM_INTERNAL_SERVER_ERROR_BODY, {
1544
+ return new Response(_chunkKMYOKQPPcjs.FARM_INTERNAL_SERVER_ERROR_BODY, {
1313
1545
  status: 500,
1314
1546
  headers: { "Content-Type": "application/json", "Cache-Control": "private, no-store" }
1315
1547
  });
@@ -1321,15 +1553,15 @@ function setFarmDevRuntimeHookErrorHead(res, json) {
1321
1553
  }
1322
1554
  function sendFarmDevRuntimeHookError(res, json) {
1323
1555
  setFarmDevRuntimeHookErrorHead(res, json);
1324
- res.end(json ? _chunkXGTFLG73cjs.FARM_INTERNAL_SERVER_ERROR_BODY : "Internal Server Error");
1556
+ res.end(json ? _chunkKMYOKQPPcjs.FARM_INTERNAL_SERVER_ERROR_BODY : "Internal Server Error");
1325
1557
  }
1326
1558
  function opensFarmDevRuntimeSession(pm) {
1327
- return pm.hasRuntimeRequestHooks() || _chunkDMXMIE2Ccjs.hasFarmServerRuntimePlugins.call(void 0, pm.getPlugins());
1559
+ return pm.hasRuntimeRequestHooks() || _chunkENYBDM4Ucjs.hasFarmServerRuntimePlugins.call(void 0, pm.getPlugins());
1328
1560
  }
1329
1561
  var FARM_CONFIG_ROUTE_PLUGIN_NAMES = /* @__PURE__ */ new Set([
1330
- _chunkMBCRWU3Pcjs.FARM_CONFIG_HEADERS_PLUGIN_NAME,
1331
- _chunkMBCRWU3Pcjs.FARM_CONFIG_REDIRECTS_PLUGIN_NAME,
1332
- _chunkMBCRWU3Pcjs.FARM_CONFIG_REWRITES_PLUGIN_NAME
1562
+ _chunkXZPI44Q7cjs.FARM_CONFIG_HEADERS_PLUGIN_NAME,
1563
+ _chunkXZPI44Q7cjs.FARM_CONFIG_REDIRECTS_PLUGIN_NAME,
1564
+ _chunkXZPI44Q7cjs.FARM_CONFIG_REWRITES_PLUGIN_NAME
1333
1565
  ]);
1334
1566
  function isFarmConfigRoutePlugin(plugin) {
1335
1567
  return FARM_CONFIG_ROUTE_PLUGIN_NAMES.has(plugin.name);
@@ -1429,7 +1661,7 @@ function interceptFarmDevPageResponse(options) {
1429
1661
  const originalWrite = res.write.bind(res);
1430
1662
  const originalEnd = res.end.bind(res);
1431
1663
  const originalWriteHead = res.writeHead.bind(res);
1432
- const originalFlushHeaders = _optionalChain([res, 'access', _73 => _73.flushHeaders, 'optionalAccess', _74 => _74.bind, 'call', _75 => _75(res)]);
1664
+ const originalFlushHeaders = _optionalChain([res, 'access', _80 => _80.flushHeaders, 'optionalAccess', _81 => _81.bind, 'call', _82 => _82(res)]);
1433
1665
  let afterResponseCalled = false;
1434
1666
  let interceptedEnd = false;
1435
1667
  const restore = () => {
@@ -1451,7 +1683,7 @@ function interceptFarmDevPageResponse(options) {
1451
1683
  const writeRuntimeHookFailure = () => {
1452
1684
  setFarmDevRuntimeHookErrorHead(res, Boolean(options.jsonError));
1453
1685
  originalWriteHead(500);
1454
- originalWrite(options.jsonError ? _chunkXGTFLG73cjs.FARM_INTERNAL_SERVER_ERROR_BODY : "Internal Server Error");
1686
+ originalWrite(options.jsonError ? _chunkKMYOKQPPcjs.FARM_INTERNAL_SERVER_ERROR_BODY : "Internal Server Error");
1455
1687
  };
1456
1688
  const htmlChunks = [];
1457
1689
  const responseChunks = [];
@@ -1491,7 +1723,7 @@ function interceptFarmDevPageResponse(options) {
1491
1723
  ).then(async (runtimeResponse) => {
1492
1724
  applyWebResponseToNodeResponse(runtimeResponse, res);
1493
1725
  if (!res.headersSent) originalWriteHead(res.statusCode);
1494
- _optionalChain([originalFlushHeaders, 'optionalCall', _76 => _76()]);
1726
+ _optionalChain([originalFlushHeaders, 'optionalCall', _83 => _83()]);
1495
1727
  if (!runtimeResponse.body) return;
1496
1728
  const reader = runtimeResponse.body.getReader();
1497
1729
  for (; ; ) {
@@ -1540,7 +1772,7 @@ function interceptFarmDevPageResponse(options) {
1540
1772
  if (streamsThroughRuntime()) {
1541
1773
  streamRuntimeChunk(bufferChunk);
1542
1774
  const callback = args.find((arg) => typeof arg === "function");
1543
- _optionalChain([callback, 'optionalCall', _77 => _77()]);
1775
+ _optionalChain([callback, 'optionalCall', _84 => _84()]);
1544
1776
  return true;
1545
1777
  }
1546
1778
  if (isHtmlResponse && bufferChunk) {
@@ -1552,7 +1784,7 @@ function interceptFarmDevPageResponse(options) {
1552
1784
  const shouldBufferResponse = isHtmlResponse ? bufferPluginResponse : Boolean(runtimeSession && hasRuntimeAfterHook);
1553
1785
  if (shouldBufferResponse) {
1554
1786
  const callback = args.find((arg) => typeof arg === "function");
1555
- _optionalChain([callback, 'optionalCall', _78 => _78()]);
1787
+ _optionalChain([callback, 'optionalCall', _85 => _85()]);
1556
1788
  return true;
1557
1789
  }
1558
1790
  const writeResult = originalWrite(chunk, ...args);
@@ -1704,13 +1936,13 @@ function getEnvDefines(config, configEnv) {
1704
1936
  )
1705
1937
  )
1706
1938
  };
1707
- if (_optionalChain([configEnv, 'optionalAccess', _79 => _79.isSsrBuild])) {
1939
+ if (_optionalChain([configEnv, 'optionalAccess', _86 => _86.isSsrBuild])) {
1708
1940
  defines.__FARM_ENV__ = JSON.stringify(_chunk3EIPOTZVcjs.createBundledEnv.call(void 0, getFullEnvDefine(config)));
1709
1941
  }
1710
1942
  return defines;
1711
1943
  }
1712
1944
  function getFarmAPIBaseURLDefine(config) {
1713
- const baseURL = _optionalChain([config, 'access', _80 => _80.api, 'optionalAccess', _81 => _81.baseURL]);
1945
+ const baseURL = _optionalChain([config, 'access', _87 => _87.api, 'optionalAccess', _88 => _88.baseURL]);
1714
1946
  return typeof baseURL === "string" && baseURL ? baseURL : _chunkPMJSG4JScjs.DEFAULT_FARM_API_BASE_PATH;
1715
1947
  }
1716
1948
  function isResolvedEnvScope(value) {
@@ -1832,7 +2064,7 @@ function transformIsolatedClientBoundaryModule(options) {
1832
2064
  return null;
1833
2065
  }
1834
2066
  const body = Array.isArray(ast.body) ? ast.body : [];
1835
- const everyExportIsComponent = options.code.includes(_chunkBE7AQXJBcjs.FARM_CLIENT_REFERENCE_PRAGMA) || options.moduleReference.includes(_chunkBE7AQXJBcjs.FARM_CLIENT_REFERENCE_DIRECTORY);
2067
+ const everyExportIsComponent = options.code.includes(_chunkNXGQIXR7cjs.FARM_CLIENT_REFERENCE_PRAGMA) || options.moduleReference.includes(_chunkNXGQIXR7cjs.FARM_CLIENT_REFERENCE_DIRECTORY);
1836
2068
  const replacements = [];
1837
2069
  const wrapperStatements = [];
1838
2070
  const originalEntries = [];
@@ -1851,9 +2083,9 @@ function transformIsolatedClientBoundaryModule(options) {
1851
2083
  transformedExports++;
1852
2084
  };
1853
2085
  for (const node of body) {
1854
- if (_optionalChain([node, 'optionalAccess', _82 => _82.type]) === "ExportDefaultDeclaration" && node.declaration) {
2086
+ if (_optionalChain([node, 'optionalAccess', _89 => _89.type]) === "ExportDefaultDeclaration" && node.declaration) {
1855
2087
  const declaration2 = node.declaration;
1856
- if ((declaration2.type === "FunctionDeclaration" || declaration2.type === "ClassDeclaration") && _optionalChain([declaration2, 'access', _83 => _83.id, 'optionalAccess', _84 => _84.name])) {
2088
+ if ((declaration2.type === "FunctionDeclaration" || declaration2.type === "ClassDeclaration") && _optionalChain([declaration2, 'access', _90 => _90.id, 'optionalAccess', _91 => _91.name])) {
1857
2089
  replacements.push({
1858
2090
  start: node.start,
1859
2091
  end: node.end,
@@ -1871,11 +2103,11 @@ function transformIsolatedClientBoundaryModule(options) {
1871
2103
  }
1872
2104
  continue;
1873
2105
  }
1874
- if (_optionalChain([node, 'optionalAccess', _85 => _85.type]) === "ExportNamedDeclaration" && !node.declaration && node.exportKind !== "type") {
2106
+ if (_optionalChain([node, 'optionalAccess', _92 => _92.type]) === "ExportNamedDeclaration" && !node.declaration && node.exportKind !== "type") {
1875
2107
  const specifiers = (node.specifiers || []).filter(
1876
2108
  (specifier) => specifier.type === "ExportSpecifier" && specifier.exportKind !== "type"
1877
2109
  );
1878
- const specifierName = (name) => _nullishCoalesce(_optionalChain([name, 'optionalAccess', _86 => _86.name]), () => ( String(_nullishCoalesce(_optionalChain([name, 'optionalAccess', _87 => _87.value]), () => ( "")))));
2110
+ const specifierName = (name) => _nullishCoalesce(_optionalChain([name, 'optionalAccess', _93 => _93.name]), () => ( String(_nullishCoalesce(_optionalChain([name, 'optionalAccess', _94 => _94.value]), () => ( "")))));
1879
2111
  const isComponentExport = (specifier) => {
1880
2112
  const exported = specifierName(specifier.exported);
1881
2113
  return everyExportIsComponent || exported === "default" || /^[A-Z]/.test(exported);
@@ -1902,14 +2134,14 @@ function transformIsolatedClientBoundaryModule(options) {
1902
2134
  if (kept.length > 0) wrapperStatements.push(`export { ${kept.join(", ")} };`);
1903
2135
  continue;
1904
2136
  }
1905
- if (_optionalChain([node, 'optionalAccess', _88 => _88.type]) !== "ExportNamedDeclaration" || !node.declaration) continue;
2137
+ if (_optionalChain([node, 'optionalAccess', _95 => _95.type]) !== "ExportNamedDeclaration" || !node.declaration) continue;
1906
2138
  const declaration = node.declaration;
1907
2139
  const declaredNames = [];
1908
- if ((declaration.type === "FunctionDeclaration" || declaration.type === "ClassDeclaration") && _optionalChain([declaration, 'access', _89 => _89.id, 'optionalAccess', _90 => _90.name])) {
2140
+ if ((declaration.type === "FunctionDeclaration" || declaration.type === "ClassDeclaration") && _optionalChain([declaration, 'access', _96 => _96.id, 'optionalAccess', _97 => _97.name])) {
1909
2141
  declaredNames.push(declaration.id.name);
1910
2142
  } else if (declaration.type === "VariableDeclaration") {
1911
2143
  for (const declarator of declaration.declarations || []) {
1912
- if (_optionalChain([declarator, 'access', _91 => _91.id, 'optionalAccess', _92 => _92.type]) === "Identifier") declaredNames.push(declarator.id.name);
2144
+ if (_optionalChain([declarator, 'access', _98 => _98.id, 'optionalAccess', _99 => _99.type]) === "Identifier") declaredNames.push(declarator.id.name);
1913
2145
  }
1914
2146
  }
1915
2147
  const componentNames = declaredNames.filter((name) => /^[A-Z]/.test(name));
@@ -1970,7 +2202,7 @@ function isFarmConfigFile(file, root) {
1970
2202
  return FARM_CONFIG_FILENAMES.has(relative4);
1971
2203
  }
1972
2204
  var warnedClientBoundaryIds = /* @__PURE__ */ new Set();
1973
- function warnClientBoundaryOnce(context, id, code, config) {
2205
+ async function warnClientBoundaryOnce(context, id, code, config) {
1974
2206
  if (warnedClientBoundaryIds.has(id)) return;
1975
2207
  let program;
1976
2208
  try {
@@ -1978,13 +2210,26 @@ function warnClientBoundaryOnce(context, id, code, config) {
1978
2210
  } catch (e20) {
1979
2211
  return;
1980
2212
  }
1981
- const publicKeys = new Set(Object.keys(_nullishCoalesce(_optionalChain([config, 'access', _93 => _93.env, 'optionalAccess', _94 => _94.public]), () => ( {}))));
1982
- const findings = analyzeClientBoundary(program, publicKeys);
1983
- if (findings.envKeys.length === 0 && findings.publicEnvKeys.length === 0 && findings.builtinImports.length === 0) {
1984
- return;
2213
+ const publicKeys = new Set(Object.keys(_nullishCoalesce(_optionalChain([config, 'access', _100 => _100.env, 'optionalAccess', _101 => _101.public]), () => ( {}))));
2214
+ const findings = [];
2215
+ for (const finding of analyzeClientBoundary(program, publicKeys)) {
2216
+ if (finding.kind === "builtin" && !finding.name.startsWith("node:")) {
2217
+ const resolved = await context.resolve(finding.name, id).catch(() => null);
2218
+ if (!_optionalChain([resolved, 'optionalAccess', _102 => _102.id, 'access', _103 => _103.startsWith, 'call', _104 => _104(_chunkNXGQIXR7cjs.FARM_BROWSER_BUILTIN_PREFIX)])) continue;
2219
+ }
2220
+ findings.push(finding);
1985
2221
  }
2222
+ if (findings.length === 0) return;
1986
2223
  warnedClientBoundaryIds.add(id);
1987
- _chunkQMNWKQL4cjs.logger.warn(formatClientBoundaryWarning(id, findings));
2224
+ const locate = _chunkNXGQIXR7cjs.createFarmSourceLocator.call(void 0, code, () => context.getCombinedSourcemap());
2225
+ _chunkQMNWKQL4cjs.logger.warn(
2226
+ findings.map(
2227
+ (finding) => _chunkNXGQIXR7cjs.formatFarmDiagnostic.call(void 0,
2228
+ createClientBoundaryDiagnostic(id, finding, locate(finding.start)),
2229
+ config.root
2230
+ )
2231
+ ).join("\n")
2232
+ );
1988
2233
  }
1989
2234
  function shouldEmitFarmClientRootHmr(renderer) {
1990
2235
  return _chunk67MZTLTFcjs.getFarmRendererCapabilities.call(void 0, _chunk67MZTLTFcjs.resolveFarmRenderer.call(void 0, renderer)).reconcilesRerenders;
@@ -2020,21 +2265,21 @@ function hasFarmSourceAliasOverride(alias) {
2020
2265
  function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
2021
2266
  const rendererDisabled = _chunk67MZTLTFcjs.isFarmRendererDisabled.call(void 0, options.renderer);
2022
2267
  const imageImports = farmImageImportsPlugin();
2023
- const fontImports = _chunkCBLRSZQLcjs.farmFontImportsPlugin.call(void 0, {
2268
+ const fontImports = _chunk56HHUSR5cjs.farmFontImportsPlugin.call(void 0, {
2024
2269
  root: options.root,
2025
2270
  basePath: options.basePath,
2026
2271
  publicDir: options.publicDir
2027
2272
  });
2028
2273
  let farmApp;
2029
2274
  const isFarmGeneratedOutput = (file) => {
2030
- const root = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _95 => _95.getConfig, 'call', _96 => _96(), 'access', _97 => _97.root]), () => ( options.root));
2275
+ const root = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _105 => _105.getConfig, 'call', _106 => _106(), 'access', _107 => _107.root]), () => ( options.root));
2031
2276
  if (!root) return file.includes("/.farm/");
2032
2277
  const output = _chunkQMNWKQL4cjs.toPosixPath.call(void 0, path6.resolve(root, options.distDir || ".farm"));
2033
2278
  return file === output || file.startsWith(`${output}/`);
2034
2279
  };
2035
2280
  let serverFnTransformActive = false;
2036
2281
  const getFarmRenderedServerModules = () => {
2037
- const routeManager = _optionalChain([farmApp, 'optionalAccess', _98 => _98.getRouteManager, 'call', _99 => _99()]);
2282
+ const routeManager = _optionalChain([farmApp, 'optionalAccess', _108 => _108.getRouteManager, 'call', _109 => _109()]);
2038
2283
  if (!routeManager) return /* @__PURE__ */ new Set();
2039
2284
  const files = /* @__PURE__ */ new Set();
2040
2285
  for (const entries of [
@@ -2055,8 +2300,8 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
2055
2300
  return files;
2056
2301
  };
2057
2302
  const islandsServerFns = () => {
2058
- const config = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _100 => _100.getConfig, 'call', _101 => _101()]), () => ( options));
2059
- return _optionalChain([config, 'access', _102 => _102.experimental, 'optionalAccess', _103 => _103.serverActions]) === true && _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _104 => _104.experimental, 'optionalAccess', _105 => _105.serverComponents])) === "islands";
2303
+ const config = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _110 => _110.getConfig, 'call', _111 => _111()]), () => ( options));
2304
+ return _optionalChain([config, 'access', _112 => _112.experimental, 'optionalAccess', _113 => _113.serverActions]) === true && _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _114 => _114.experimental, 'optionalAccess', _115 => _115.serverComponents])) === "islands";
2060
2305
  };
2061
2306
  let reactRefreshActive = false;
2062
2307
  let server;
@@ -2085,9 +2330,9 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
2085
2330
  ].join(" ");
2086
2331
  console.log(log);
2087
2332
  };
2088
- const getProgrammaticClientRoutes = () => _nullishCoalesce(options.programmaticClientRoutes, () => ( _optionalChain([farmApp, 'optionalAccess', _106 => _106.getRouteManager, 'call', _107 => _107(), 'access', _108 => _108.getProgrammaticClientRoutes, 'call', _109 => _109()])));
2333
+ const getProgrammaticClientRoutes = () => _nullishCoalesce(options.programmaticClientRoutes, () => ( _optionalChain([farmApp, 'optionalAccess', _116 => _116.getRouteManager, 'call', _117 => _117(), 'access', _118 => _118.getProgrammaticClientRoutes, 'call', _119 => _119()])));
2089
2334
  const isOutsideAppRoot = (file) => {
2090
- const root = _optionalChain([farmApp, 'optionalAccess', _110 => _110.getConfig, 'call', _111 => _111(), 'access', _112 => _112.root]) || _optionalChain([server, 'optionalAccess', _113 => _113.config, 'access', _114 => _114.root]) || options.root;
2335
+ const root = _optionalChain([farmApp, 'optionalAccess', _120 => _120.getConfig, 'call', _121 => _121(), 'access', _122 => _122.root]) || _optionalChain([server, 'optionalAccess', _123 => _123.config, 'access', _124 => _124.root]) || options.root;
2091
2336
  if (!root) return false;
2092
2337
  const relative4 = path6.relative(root, file.split("?", 1)[0]);
2093
2338
  return relative4.startsWith("..") || path6.isAbsolute(relative4);
@@ -2099,14 +2344,14 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
2099
2344
  isBuild = configEnv.command === "build";
2100
2345
  const farmAliases = {
2101
2346
  ..._chunkMTBDJ326cjs.getFarmLayerAliases.call(void 0, options.layers),
2102
- ...hasFarmSourceAliasOverride(_optionalChain([userConfig, 'access', _115 => _115.resolve, 'optionalAccess', _116 => _116.alias])) ? {} : _chunkCBLRSZQLcjs.createFarmSourceAlias.call(void 0, options.root || process.cwd(), options.srcDir)
2347
+ ...hasFarmSourceAliasOverride(_optionalChain([userConfig, 'access', _125 => _125.resolve, 'optionalAccess', _126 => _126.alias])) ? {} : _chunk56HHUSR5cjs.createFarmSourceAlias.call(void 0, options.root || process.cwd(), options.srcDir)
2103
2348
  };
2104
2349
  if (Object.keys(farmAliases).length > 0) {
2105
2350
  _nullishCoalesce(userConfig.resolve, () => ( (userConfig.resolve = {})));
2106
- userConfig.resolve.alias = _chunkCBLRSZQLcjs.mergeFarmViteAlias.call(void 0, farmAliases, userConfig.resolve.alias);
2351
+ userConfig.resolve.alias = _chunk56HHUSR5cjs.mergeFarmViteAlias.call(void 0, farmAliases, userConfig.resolve.alias);
2107
2352
  }
2108
2353
  const layerRoots = (_nullishCoalesce(options.layers, () => ( []))).map((layer) => layer.root);
2109
- farmOwnsDevCors = !isBuild && _optionalChain([userConfig, 'access', _117 => _117.server, 'optionalAccess', _118 => _118.cors]) === void 0;
2354
+ farmOwnsDevCors = !isBuild && _optionalChain([userConfig, 'access', _127 => _127.server, 'optionalAccess', _128 => _128.cors]) === void 0;
2110
2355
  return {
2111
2356
  // Honor Farm's publicDir so the dev server serves the same static
2112
2357
  // directory the production client build emits.
@@ -2119,11 +2364,23 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
2119
2364
  ...farmOwnsDevCors ? { cors: false } : {},
2120
2365
  fs: {
2121
2366
  ...layerRoots.length ? { allow: [path6.resolve(options.root || process.cwd()), ...layerRoots] } : {},
2122
- deny: getFarmDevFsDeny(_optionalChain([userConfig, 'access', _119 => _119.server, 'optionalAccess', _120 => _120.fs, 'optionalAccess', _121 => _121.deny]), options)
2367
+ deny: getFarmDevFsDeny(_optionalChain([userConfig, 'access', _129 => _129.server, 'optionalAccess', _130 => _130.fs, 'optionalAccess', _131 => _131.deny]), options)
2123
2368
  }
2124
2369
  }
2125
2370
  };
2126
2371
  },
2372
+ configEnvironment(name, environmentConfig, env) {
2373
+ if (env.command !== "serve" || name !== "ssr" && name !== "rsc" || _optionalChain([environmentConfig, 'access', _132 => _132.dev, 'optionalAccess', _133 => _133.createEnvironment])) {
2374
+ return;
2375
+ }
2376
+ return {
2377
+ dev: {
2378
+ createEnvironment: (environmentName, config) => _vite.createRunnableDevEnvironment.call(void 0, environmentName, config, {
2379
+ runnerOptions: { sourcemapInterceptor: "prepareStackTrace" }
2380
+ })
2381
+ }
2382
+ };
2383
+ },
2127
2384
  async configResolved(config) {
2128
2385
  if (typeof fontImports.configResolved === "function") {
2129
2386
  await fontImports.configResolved.call(this, config);
@@ -2132,7 +2389,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
2132
2389
  (plugin2) => plugin2.name === SERVER_FN_TRANSFORM_PLUGIN
2133
2390
  );
2134
2391
  reactRefreshActive = _chunk3QM74STYcjs.isFarmReactRefreshActive.call(void 0, config);
2135
- if (_optionalChain([options, 'access', _122 => _122.experimental, 'optionalAccess', _123 => _123.serverActions]) === true && !serverFnTransformActive && !islandsServerFns()) {
2392
+ if (_optionalChain([options, 'access', _134 => _134.experimental, 'optionalAccess', _135 => _135.serverActions]) === true && !serverFnTransformActive && !islandsServerFns()) {
2136
2393
  _chunkQMNWKQL4cjs.logger.warn(
2137
2394
  "experimental.serverActions has no effect without @farm.js/plugin/rsc in the Vite plugins. Server functions stay server-only, and importing one from client code is a build error."
2138
2395
  );
@@ -2141,21 +2398,21 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
2141
2398
  async configureServer(viteServer) {
2142
2399
  viteServer.middlewares.use(
2143
2400
  createFarmDevPreviewGuard(viteServer, {
2144
- getSourceRoots: () => _chunkMTBDJ326cjs.getFarmSourceRoots.call(void 0, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _124 => _124.getConfig, 'call', _125 => _125()]), () => ( options)))
2401
+ getSourceRoots: () => _chunkMTBDJ326cjs.getFarmSourceRoots.call(void 0, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _136 => _136.getConfig, 'call', _137 => _137()]), () => ( options)))
2145
2402
  })
2146
2403
  );
2147
2404
  if (typeof fontImports.configureServer === "function") {
2148
2405
  await fontImports.configureServer.call(this, viteServer);
2149
2406
  }
2150
2407
  server = viteServer;
2151
- const farmMiddlewares = _nullishCoalesce(_optionalChain([deferredGates, 'optionalAccess', _126 => _126.pre, 'access', _127 => _127.target]), () => ( viteServer.middlewares));
2152
- const farmPostMiddlewares = _nullishCoalesce(_optionalChain([deferredGates, 'optionalAccess', _128 => _128.post, 'access', _129 => _129.target]), () => ( viteServer.middlewares));
2408
+ const farmMiddlewares = _nullishCoalesce(_optionalChain([deferredGates, 'optionalAccess', _138 => _138.pre, 'access', _139 => _139.target]), () => ( viteServer.middlewares));
2409
+ const farmPostMiddlewares = _nullishCoalesce(_optionalChain([deferredGates, 'optionalAccess', _140 => _140.post, 'access', _141 => _141.target]), () => ( viteServer.middlewares));
2153
2410
  const pm = initialPluginManager;
2154
2411
  const configRoutePlugins = new Set(
2155
- _optionalChain([pm, 'optionalAccess', _130 => _130.getPlugins, 'call', _131 => _131(), 'access', _132 => _132.filter, 'call', _133 => _133(isFarmConfigRoutePlugin), 'access', _134 => _134.map, 'call', _135 => _135((plugin2) => plugin2.name)])
2412
+ _optionalChain([pm, 'optionalAccess', _142 => _142.getPlugins, 'call', _143 => _143(), 'access', _144 => _144.filter, 'call', _145 => _145(isFarmConfigRoutePlugin), 'access', _146 => _146.map, 'call', _147 => _147((plugin2) => plugin2.name)])
2156
2413
  );
2157
- const configRedirectMatchers = (_nullishCoalesce(_optionalChain([pm, 'optionalAccess', _136 => _136.getPlugins, 'call', _137 => _137()]), () => ( []))).flatMap((plugin2) => {
2158
- const matcher = _chunkMBCRWU3Pcjs.getConfigRedirectMatcher.call(void 0, plugin2);
2414
+ const configRedirectMatchers = (_nullishCoalesce(_optionalChain([pm, 'optionalAccess', _148 => _148.getPlugins, 'call', _149 => _149()]), () => ( []))).flatMap((plugin2) => {
2415
+ const matcher = _chunkXZPI44Q7cjs.getConfigRedirectMatcher.call(void 0, plugin2);
2159
2416
  return matcher ? [matcher] : [];
2160
2417
  });
2161
2418
  const emitPluginError = async (phase, error, meta) => {
@@ -2165,7 +2422,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
2165
2422
  } catch (e21) {
2166
2423
  }
2167
2424
  };
2168
- farmApp = new (0, _chunkCBLRSZQLcjs.FarmApp)(
2425
+ farmApp = new (0, _chunk56HHUSR5cjs.FarmApp)(
2169
2426
  {
2170
2427
  ...options,
2171
2428
  root: resolveDevelopmentRoot(options.root, server.config.root)
@@ -2173,7 +2430,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
2173
2430
  server
2174
2431
  );
2175
2432
  farmApp.getRouteManager().usePackageClientBoundaryCacheFile(
2176
- _chunkBE7AQXJBcjs.resolvePackageClientBoundaryCacheFile.call(void 0,
2433
+ _chunkNXGQIXR7cjs.resolvePackageClientBoundaryCacheFile.call(void 0,
2177
2434
  farmApp.getConfig().root,
2178
2435
  options.distDir || ".farm"
2179
2436
  )
@@ -2182,17 +2439,17 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
2182
2439
  await farmApp.initialize();
2183
2440
  const farmConfig = farmApp.getConfig();
2184
2441
  let farmAppPackages;
2185
- if (_optionalChain([farmConfig, 'access', _138 => _138.agent, 'optionalAccess', _139 => _139.noindexPreviews])) {
2442
+ if (_optionalChain([farmConfig, 'access', _150 => _150.agent, 'optionalAccess', _151 => _151.noindexPreviews])) {
2186
2443
  farmMiddlewares.use((_req, res, next) => {
2187
- if (_chunkOSEQL34Qcjs.isFarmPreviewDeploymentEnvironment.call(void 0, process.env)) {
2188
- res.setHeader("X-Robots-Tag", _chunkZUVAGMQ5cjs.FARM_PREVIEW_ROBOTS_TAG);
2444
+ if (_chunkD4TYE6MYcjs.isFarmPreviewDeploymentEnvironment.call(void 0, process.env)) {
2445
+ res.setHeader("X-Robots-Tag", _chunkF244KE2Dcjs.FARM_PREVIEW_ROBOTS_TAG);
2189
2446
  }
2190
2447
  next();
2191
2448
  });
2192
2449
  }
2193
2450
  const apiServerBasePath = _chunk2OF5RPVUcjs.resolveFarmAPIServerBasePath.call(void 0, farmConfig.api);
2194
2451
  const devBuiltInRoutePaths = new Set(
2195
- _chunkFSSONJRVcjs.listFarmBuiltInRoutePaths.call(void 0, {
2452
+ _chunkDM2YGTRHcjs.listFarmBuiltInRoutePaths.call(void 0, {
2196
2453
  agent: {
2197
2454
  apiCatalog: true,
2198
2455
  mcp: true,
@@ -2214,7 +2471,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
2214
2471
  validateRemoteUrl: createNodeImageUrlValidator(farmConfig.images),
2215
2472
  // Vite owns this address. Unlike request.url, it cannot be replaced by
2216
2473
  // a caller-controlled Host header.
2217
- trustedLocalOrigin: () => _optionalChain([server, 'access', _140 => _140.resolvedUrls, 'optionalAccess', _141 => _141.local, 'access', _142 => _142[0]]),
2474
+ trustedLocalOrigin: () => _optionalChain([server, 'access', _152 => _152.resolvedUrls, 'optionalAccess', _153 => _153.local, 'access', _154 => _154[0]]),
2218
2475
  onError(error) {
2219
2476
  _chunkQMNWKQL4cjs.logger.error(
2220
2477
  `Image optimization failed: ${error instanceof Error ? error.message : String(error)}`
@@ -2234,15 +2491,15 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
2234
2491
  const workflowConfig = farmConfig.workflows;
2235
2492
  const farmDocsDevRuntime = farmConfig.docs.enabled ? await loadFarmDocsDevRuntime() : null;
2236
2493
  const getExtraRouteTypes = () => [
2237
- ..._optionalChain([options, 'access', _143 => _143.openapi, 'optionalAccess', _144 => _144.enabled]) && options.openapi.route ? [options.openapi.route] : [],
2238
- ..._nullishCoalesce(_optionalChain([farmDocsDevRuntime, 'optionalAccess', _145 => _145.getFarmDocsRouteTypeEntries, 'call', _146 => _146(farmConfig.docs)]), () => ( []))
2494
+ ..._optionalChain([options, 'access', _155 => _155.openapi, 'optionalAccess', _156 => _156.enabled]) && options.openapi.route ? [options.openapi.route] : [],
2495
+ ..._nullishCoalesce(_optionalChain([farmDocsDevRuntime, 'optionalAccess', _157 => _157.getFarmDocsRouteTypeEntries, 'call', _158 => _158(farmConfig.docs)]), () => ( []))
2239
2496
  ];
2240
2497
  const appDirSlugs = sourceRoots.map(
2241
2498
  (source) => path6.join(source.root, source.srcDir, "app").replace(/\\/g, "/")
2242
2499
  );
2243
2500
  const generateTypeArtifacts = async (reason, selection = ALL_TYPE_ARTIFACTS, log = false) => {
2244
2501
  try {
2245
- const result = await _chunkE3LE6EZHcjs.generateFarmTypeArtifacts.call(void 0, {
2502
+ const result = await _chunkACAEFEOHcjs.generateFarmTypeArtifacts.call(void 0, {
2246
2503
  root: farmConfig.root,
2247
2504
  srcDir: farmConfig.srcDir,
2248
2505
  layers: farmConfig.layers,
@@ -2282,7 +2539,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
2282
2539
  (source) => path6.join(source.root, source.srcDir).replace(/\\/g, "/")
2283
2540
  );
2284
2541
  const layerConfigFiles = new Set(
2285
- farmConfig.layers.map((layer) => _optionalChain([layer, 'access', _147 => _147.configFile, 'optionalAccess', _148 => _148.replace, 'call', _149 => _149(/\\/g, "/")])).filter((file) => Boolean(file))
2542
+ farmConfig.layers.map((layer) => _optionalChain([layer, 'access', _159 => _159.configFile, 'optionalAccess', _160 => _160.replace, 'call', _161 => _161(/\\/g, "/")])).filter((file) => Boolean(file))
2286
2543
  );
2287
2544
  const routeModuleExtensions = /* @__PURE__ */ new Set([
2288
2545
  ..._chunk67MZTLTFcjs.resolveFarmComponentExtensions.call(void 0, farmConfig.renderer.componentExtensions),
@@ -2361,7 +2618,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
2361
2618
  scheduleTypeArtifactGen(file, ev, typeArtifacts);
2362
2619
  }
2363
2620
  if (isI18nCatalogFile(file)) {
2364
- _optionalChain([farmApp, 'optionalAccess', _150 => _150.getI18nRuntime, 'call', _151 => _151(), 'access', _152 => _152.reload, 'call', _153 => _153(), 'access', _154 => _154.then, 'call', _155 => _155(() => server.ws.send({ type: "full-reload", path: "*" })), 'access', _156 => _156.catch, 'call', _157 => _157((error) => _chunkQMNWKQL4cjs.logger.warn(`i18n catalog reload failed: ${error.message}`))]);
2621
+ _optionalChain([farmApp, 'optionalAccess', _162 => _162.getI18nRuntime, 'call', _163 => _163(), 'access', _164 => _164.reload, 'call', _165 => _165(), 'access', _166 => _166.then, 'call', _167 => _167(() => server.ws.send({ type: "full-reload", path: "*" })), 'access', _168 => _168.catch, 'call', _169 => _169((error) => _chunkQMNWKQL4cjs.logger.warn(`i18n catalog reload failed: ${error.message}`))]);
2365
2622
  }
2366
2623
  const isRouteRefreshEvent = (ev !== "change" || isStaticMetadataImageFile(file)) && (isAppRuntimeFile(file) || isProgrammaticRouteFile(file) || isProgrammaticRouteSourceFile(file) && (ev === "unlink" || fileContainsProgrammaticPageRoute(file)));
2367
2624
  if (isRouteRefreshEvent) {
@@ -2374,8 +2631,8 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
2374
2631
  const reloadsMiddleware = pendingRouteRefreshIncludesMiddleware;
2375
2632
  pendingRouteRefreshIncludesMiddleware = false;
2376
2633
  Promise.all([
2377
- _optionalChain([refreshRouteDiscovery, 'optionalCall', _158 => _158(`${ev} ${file}`)]),
2378
- reloadsMiddleware ? _optionalChain([middlewareManager, 'optionalAccess', _159 => _159.reload, 'call', _160 => _160()]) : void 0
2634
+ _optionalChain([refreshRouteDiscovery, 'optionalCall', _170 => _170(`${ev} ${file}`)]),
2635
+ reloadsMiddleware ? _optionalChain([middlewareManager, 'optionalAccess', _171 => _171.reload, 'call', _172 => _172()]) : void 0
2379
2636
  ]).then(() => server.ws.send({ type: "full-reload", path: "*" })).catch((error) => _chunkQMNWKQL4cjs.logger.warn(`Route refresh failed: ${error.message}`));
2380
2637
  }, 50);
2381
2638
  }
@@ -2414,14 +2671,14 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
2414
2671
  const { FARM_DEV_SERVER_MODULE_LOADER } = await import("./internal/native-server-fns.cjs");
2415
2672
  const load = (file) => _chunkJYNNIGQOcjs.loadFarmDevModule.call(void 0, server, file);
2416
2673
  globalThis[FARM_DEV_SERVER_MODULE_LOADER] = load;
2417
- _optionalChain([server, 'access', _161 => _161.httpServer, 'optionalAccess', _162 => _162.once, 'call', _163 => _163("close", () => {
2674
+ _optionalChain([server, 'access', _173 => _173.httpServer, 'optionalAccess', _174 => _174.once, 'call', _175 => _175("close", () => {
2418
2675
  const globals = globalThis;
2419
2676
  if (globals[FARM_DEV_SERVER_MODULE_LOADER] === load) {
2420
2677
  delete globals[FARM_DEV_SERVER_MODULE_LOADER];
2421
2678
  }
2422
2679
  })]);
2423
2680
  }
2424
- apiRouteManager = new (0, _chunk5LOARKDPcjs.APIRouteManager)(appDirs, server, {
2681
+ apiRouteManager = new (0, _chunk2TZ3F6TNcjs.APIRouteManager)(appDirs, server, {
2425
2682
  plugins: farmConfig.plugins,
2426
2683
  i18n: farmApp.getI18nRuntime(),
2427
2684
  bodySizeLimit: serverConfig.bodySizeLimit,
@@ -2467,7 +2724,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
2467
2724
  });
2468
2725
  }
2469
2726
  }
2470
- middlewareManager = new (0, _chunkACGBXN3Ucjs.MiddlewareManager)(
2727
+ middlewareManager = new (0, _chunkY4FEQBKYcjs.MiddlewareManager)(
2471
2728
  appDirs,
2472
2729
  server,
2473
2730
  farmConfig.middleware,
@@ -2488,11 +2745,12 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
2488
2745
  });
2489
2746
  }
2490
2747
  }
2491
- if (_optionalChain([options, 'access', _164 => _164.openapi, 'optionalAccess', _165 => _165.enabled])) {
2748
+ if (_optionalChain([options, 'access', _176 => _176.openapi, 'optionalAccess', _177 => _177.enabled])) {
2492
2749
  const { OpenAPIManager } = await loadFarmOpenAPIDevRuntime();
2493
2750
  openAPIManager = new OpenAPIManager(appDirs, options.openapi, {
2494
2751
  mode: "development",
2495
- apiBaseURL: typeof _optionalChain([options, 'access', _166 => _166.api, 'optionalAccess', _167 => _167.baseURL]) === "string" ? options.api.baseURL : void 0,
2752
+ apiBaseURL: typeof _optionalChain([options, 'access', _178 => _178.api, 'optionalAccess', _179 => _179.baseURL]) === "string" ? options.api.baseURL : void 0,
2753
+ routes: () => apiRouteManager.getRoutes().values(),
2496
2754
  loadModule: (filePath) => apiRouteManager.loadModule(filePath)
2497
2755
  });
2498
2756
  const spec = await openAPIManager.generateSpec();
@@ -2522,7 +2780,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
2522
2780
  return _chunk7EPYN7GWcjs.resolveFarmLayoutFonts.call(void 0, layoutModules);
2523
2781
  };
2524
2782
  releaseDocsMCPServers();
2525
- const isFarmDocsPathGuarded = (href) => _chunkC5AM2XDNcjs.farmPathGuardCoversPage.call(void 0,
2783
+ const isFarmDocsPathGuarded = (href) => _chunkO2A6HE76cjs.farmPathGuardCoversPage.call(void 0,
2526
2784
  {
2527
2785
  config: farmConfig,
2528
2786
  middlewareRoutes: middlewareManager.getMiddlewares().filter((entry) => entry.source !== "config")
@@ -2535,20 +2793,20 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
2535
2793
  clientEntry: "/@farm/client.js",
2536
2794
  resolveLayoutFonts: resolveDocsLayoutFonts,
2537
2795
  fontStylesheetHref: "/@farm/fonts.css",
2538
- globalStylesheetHref: _chunkCBLRSZQLcjs.resolveDevGlobalStylesheetHref.call(void 0,
2796
+ globalStylesheetHref: _chunk56HHUSR5cjs.resolveDevGlobalStylesheetHref.call(void 0,
2539
2797
  farmConfig.root,
2540
2798
  farmConfig.srcDir
2541
2799
  ),
2542
2800
  loadModule: async (specifier) => {
2543
2801
  const resolved = await server.environments.ssr.pluginContainer.resolveId(specifier);
2544
- if (specifier === _optionalChain([farmConfig, 'access', _168 => _168.docs, 'access', _169 => _169.adapter, 'optionalAccess', _170 => _170.server]) && _optionalChain([resolved, 'optionalAccess', _171 => _171.id])) {
2802
+ if (specifier === _optionalChain([farmConfig, 'access', _180 => _180.docs, 'access', _181 => _181.adapter, 'optionalAccess', _182 => _182.server]) && _optionalChain([resolved, 'optionalAccess', _183 => _183.id])) {
2545
2803
  const file = resolved.id.split("?", 1)[0];
2546
2804
  return import(
2547
2805
  /* @vite-ignore */
2548
2806
  _url.pathToFileURL.call(void 0, file).href
2549
2807
  );
2550
2808
  }
2551
- return _chunkJYNNIGQOcjs.loadFarmDevModule.call(void 0, server, _nullishCoalesce(_optionalChain([resolved, 'optionalAccess', _172 => _172.id]), () => ( specifier)));
2809
+ return _chunkJYNNIGQOcjs.loadFarmDevModule.call(void 0, server, _nullishCoalesce(_optionalChain([resolved, 'optionalAccess', _184 => _184.id]), () => ( specifier)));
2552
2810
  },
2553
2811
  registerMCPServer: (mcpServer) => {
2554
2812
  const dispose = _chunkLRB5OVRTcjs.registerFarmMCPServer.call(void 0, mcpServer);
@@ -2566,7 +2824,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
2566
2824
  fontAssets: _chunkERMUL73Lcjs.toFarmDocsPublicFontAssets.call(void 0, farmDocsFontAssetList),
2567
2825
  resolveLayoutFonts: resolveDocsLayoutFonts,
2568
2826
  fontStylesheetHref: "/@farm/fonts.css",
2569
- globalStylesheetHref: _chunkCBLRSZQLcjs.resolveDevGlobalStylesheetHref.call(void 0,
2827
+ globalStylesheetHref: _chunk56HHUSR5cjs.resolveDevGlobalStylesheetHref.call(void 0,
2570
2828
  farmConfig.root,
2571
2829
  farmConfig.srcDir
2572
2830
  ),
@@ -2574,7 +2832,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
2574
2832
  basePath: farmConfig.basePath
2575
2833
  }) : null;
2576
2834
  const farmDocsListsPages = Boolean(
2577
- farmDocsDevRuntime && _optionalChain([pm, 'optionalAccess', _173 => _173.getPlugins, 'call', _174 => _174(), 'access', _175 => _175.some, 'call', _176 => _176((plugin2) => plugin2.name === "farm:infra-analytics")])
2835
+ farmDocsDevRuntime && _optionalChain([pm, 'optionalAccess', _185 => _185.getPlugins, 'call', _186 => _186(), 'access', _187 => _187.some, 'call', _188 => _188((plugin2) => plugin2.name === "farm:infra-analytics")])
2578
2836
  );
2579
2837
  let farmDocsPagePaths;
2580
2838
  const getFarmDocsPagePaths = () => {
@@ -2602,14 +2860,14 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
2602
2860
  }
2603
2861
  }
2604
2862
  const wrapFarmDocsResponseWithLayouts = async (request, response) => {
2605
- if (request.method === "HEAD" || response.headers.has("x-farm-docs-adapter") || !_optionalChain([response, 'access', _177 => _177.headers, 'access', _178 => _178.get, 'call', _179 => _179("content-type"), 'optionalAccess', _180 => _180.toLowerCase, 'call', _181 => _181(), 'access', _182 => _182.includes, 'call', _183 => _183("text/html")])) {
2863
+ if (request.method === "HEAD" || response.headers.has("x-farm-docs-adapter") || !_optionalChain([response, 'access', _189 => _189.headers, 'access', _190 => _190.get, 'call', _191 => _191("content-type"), 'optionalAccess', _192 => _192.toLowerCase, 'call', _193 => _193(), 'access', _194 => _194.includes, 'call', _195 => _195("text/html")])) {
2606
2864
  return response;
2607
2865
  }
2608
2866
  const pathname = new URL(request.url).pathname;
2609
2867
  const matchedRoute = routeManager.matchRoute(pathname);
2610
2868
  const layoutEntries = matchedRoute.layouts.map((layout) => ({
2611
2869
  ...layout,
2612
- metadata: _chunkBE7AQXJBcjs.getClientModuleMetadata.call(void 0, layout.modulePath, farmConfig.root)
2870
+ metadata: _chunkNXGQIXR7cjs.getClientModuleMetadata.call(void 0, layout.modulePath, farmConfig.root)
2613
2871
  }));
2614
2872
  if (!layoutEntries.some((layout) => layout.metadata.shouldHydrate)) {
2615
2873
  return response;
@@ -2623,7 +2881,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
2623
2881
  headers: response.headers
2624
2882
  });
2625
2883
  }
2626
- const docsRenderer = _chunk67MZTLTFcjs.resolveFarmRenderer.call(void 0, (_nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _184 => _184.getConfig, 'call', _185 => _185()]), () => ( options))).renderer);
2884
+ const docsRenderer = _chunk67MZTLTFcjs.resolveFarmRenderer.call(void 0, (_nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _196 => _196.getConfig, 'call', _197 => _197()]), () => ( options))).renderer);
2627
2885
  const [rendererRuntime, layoutModules] = await Promise.all([
2628
2886
  _chunk67MZTLTFcjs.isReactRenderer.call(void 0, docsRenderer) ? import("./renderer/react/server.cjs") : _chunkJYNNIGQOcjs.loadFarmDevModule.call(void 0, server, docsRenderer.server),
2629
2887
  Promise.all(
@@ -2652,7 +2910,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
2652
2910
  ])
2653
2911
  );
2654
2912
  const inlineValue = (value) => JSON.stringify(value).replace(/</g, "\\u003c").replace(/>/g, "\\u003e");
2655
- const pageModulePath = _optionalChain([matchedRoute, 'access', _186 => _186.route, 'optionalAccess', _187 => _187.modulePath]) ? toUrlPath(matchedRoute.route.modulePath) : "";
2913
+ const pageModulePath = _optionalChain([matchedRoute, 'access', _198 => _198.route, 'optionalAccess', _199 => _199.modulePath]) ? toUrlPath(matchedRoute.route.modulePath) : "";
2656
2914
  const bootstrapScript = `<script>
2657
2915
  window.__FARM_PROPS__ = ${inlineValue({ params })};
2658
2916
  window.__FARM_ROUTE_SLOTS__ = [];
@@ -2749,9 +3007,9 @@ window.__FARM_MANIFEST__ = ${inlineValue({
2749
3007
  }
2750
3008
  },
2751
3009
  (request) => {
2752
- const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _188 => _188.getConfig, 'call', _189 => _189()]), () => ( options));
3010
+ const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _200 => _200.getConfig, 'call', _201 => _201()]), () => ( options));
2753
3011
  const currentServerConfig = _chunkCFG4QERRcjs.resolveFarmServerConfig.call(void 0, currentConfig.server);
2754
- return _chunkHDPT6OYEcjs.resolveFarmRequestURL.call(void 0, request, {
3012
+ return _chunk4M5ESTJ2cjs.resolveFarmRequestURL.call(void 0, request, {
2755
3013
  trustProxy: currentServerConfig.trustProxy
2756
3014
  });
2757
3015
  }
@@ -2765,9 +3023,9 @@ window.__FARM_MANIFEST__ = ${inlineValue({
2765
3023
  withAPIRequestTracing(async function handleFarmDevRequest(req, res, next) {
2766
3024
  const requestUrl = req.url || "/";
2767
3025
  const requestMethod = req.method || "GET";
2768
- const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _190 => _190.getConfig, 'call', _191 => _191()]), () => ( options));
3026
+ const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _202 => _202.getConfig, 'call', _203 => _203()]), () => ( options));
2769
3027
  const currentServerConfig = _chunkCFG4QERRcjs.resolveFarmServerConfig.call(void 0, currentConfig.server);
2770
- const parsedRequestUrl = _chunkHDPT6OYEcjs.resolveFarmRequestURL.call(void 0, req, {
3028
+ const parsedRequestUrl = _chunk4M5ESTJ2cjs.resolveFarmRequestURL.call(void 0, req, {
2771
3029
  trustProxy: currentServerConfig.trustProxy
2772
3030
  });
2773
3031
  const fullUrl = parsedRequestUrl.toString();
@@ -2859,7 +3117,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
2859
3117
  openapi: options.openapi
2860
3118
  },
2861
3119
  workflows: discoveredWorkflows,
2862
- plugins: _optionalChain([pm, 'optionalAccess', _192 => _192.getSortedPlugins, 'call', _193 => _193()])
3120
+ plugins: _optionalChain([pm, 'optionalAccess', _204 => _204.getSortedPlugins, 'call', _205 => _205()])
2863
3121
  });
2864
3122
  res.statusCode = 200;
2865
3123
  res.setHeader(
@@ -2883,7 +3141,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
2883
3141
  }
2884
3142
  const isViteOwnedRequest = () => requestUrl.startsWith("/@") || requestUrl.startsWith("/node_modules/") || requestUrl.startsWith("/__farm/") || isViteModuleRequest(parsedRequestUrl, req.headers) || (requestMethod === "GET" || requestMethod === "HEAD") && requestPathname.includes(".") && (devServableFileExists(requestPathname, [server.config.publicDir]) || isViteDevClientRequest(parsedRequestUrl, req.headers) && devServableFileExists(requestPathname, [server.config.root]));
2885
3143
  const configRewriteSource = req[FARM_DEV_CONFIG_REWRITE_SOURCE];
2886
- const runtimeHookErrorAnswersJSON = rendererDisabled || _chunkXGTFLG73cjs.isFarmAPIPathname.call(void 0, requestPathname, apiServerBasePath);
3144
+ const runtimeHookErrorAnswersJSON = rendererDisabled || _chunkKMYOKQPPcjs.isFarmAPIPathname.call(void 0, requestPathname, apiServerBasePath);
2887
3145
  const requestedPagePathname = configRewriteSource === void 0 ? requestPathname : new URL(configRewriteSource).pathname;
2888
3146
  let pageHookRouteMatch;
2889
3147
  const pageHookRoute = () => {
@@ -2894,10 +3152,10 @@ window.__FARM_MANIFEST__ = ${inlineValue({
2894
3152
  render: {
2895
3153
  pathname: pathname2,
2896
3154
  method: requestMethod,
2897
- routePattern: _optionalChain([match, 'optionalAccess', _194 => _194.route, 'optionalAccess', _195 => _195.pattern]) || null,
2898
- params: _optionalChain([match, 'optionalAccess', _196 => _196.params]) || {}
3155
+ routePattern: _optionalChain([match, 'optionalAccess', _206 => _206.route, 'optionalAccess', _207 => _207.pattern]) || null,
3156
+ params: _optionalChain([match, 'optionalAccess', _208 => _208.params]) || {}
2899
3157
  },
2900
- layoutPatterns: (_optionalChain([match, 'optionalAccess', _197 => _197.layouts]) || []).map((layout) => layout.pattern)
3158
+ layoutPatterns: (_optionalChain([match, 'optionalAccess', _209 => _209.layouts]) || []).map((layout) => layout.pattern)
2901
3159
  };
2902
3160
  return pageHookRouteMatch;
2903
3161
  };
@@ -2932,13 +3190,13 @@ window.__FARM_MANIFEST__ = ${inlineValue({
2932
3190
  };
2933
3191
  const meetsRequestedURLRoutes = configRewriteSource === void 0 && !deferredDottedRequests.has(req);
2934
3192
  const routeRedirect = meetsRequestedURLRoutes ? farmApp.getRouteManager().matchRedirect(requestPathname, parsedRequestUrl.search) : null;
2935
- if (meetsRequestedURLRoutes && (routeRedirect || pm && (configRoutePlugins.has(_chunkMBCRWU3Pcjs.FARM_CONFIG_HEADERS_PLUGIN_NAME) || configRedirectMatchers.length > 0)) && !isViteOwnedRequest()) {
3193
+ if (meetsRequestedURLRoutes && (routeRedirect || pm && (configRoutePlugins.has(_chunkXZPI44Q7cjs.FARM_CONFIG_HEADERS_PLUGIN_NAME) || configRedirectMatchers.length > 0)) && !isViteOwnedRequest()) {
2936
3194
  let redirect = routeRedirect;
2937
3195
  try {
2938
3196
  if (pm) {
2939
3197
  await pm.runHookParallelFiltered(
2940
3198
  "beforeRequest",
2941
- (plugin2) => plugin2.name === _chunkMBCRWU3Pcjs.FARM_CONFIG_HEADERS_PLUGIN_NAME,
3199
+ (plugin2) => plugin2.name === _chunkXZPI44Q7cjs.FARM_CONFIG_HEADERS_PLUGIN_NAME,
2942
3200
  req,
2943
3201
  res
2944
3202
  );
@@ -2964,7 +3222,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
2964
3222
  const redirectResponse = response;
2965
3223
  try {
2966
3224
  const metadataRoute = matchAppMetadataRoute(requestPathname);
2967
- const kind = metadataRoute ? "asset" : _chunkXGTFLG73cjs.isFarmAPIPathname.call(void 0, requestPathname, apiServerBasePath) ? "api" : requestMethod === "GET" || requestMethod === "HEAD" ? "page" : "request";
3225
+ const kind = metadataRoute ? "asset" : _chunkKMYOKQPPcjs.isFarmAPIPathname.call(void 0, requestPathname, apiServerBasePath) ? "api" : requestMethod === "GET" || requestMethod === "HEAD" ? "page" : "request";
2968
3226
  response = await pm.runRuntimeRequest(
2969
3227
  createRequestFromNodeRequest(req, parsedRequestUrl),
2970
3228
  async () => {
@@ -2985,7 +3243,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
2985
3243
  }
2986
3244
  }
2987
3245
  const runAppMiddlewareForContentRoute = async () => {
2988
- if (!_optionalChain([middlewareManager, 'optionalAccess', _198 => _198.hasMiddleware, 'call', _199 => _199()])) return false;
3246
+ if (!_optionalChain([middlewareManager, 'optionalAccess', _210 => _210.hasMiddleware, 'call', _211 => _211()])) return false;
2989
3247
  const middlewareRequest = createRequestFromNodeRequest(req, new URL(fullUrl));
2990
3248
  return runFarmMiddlewareWithNavigation(
2991
3249
  farmApp.getServerRenderer(),
@@ -3023,7 +3281,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
3023
3281
  return response.status;
3024
3282
  };
3025
3283
  const runAppMiddlewareInRuntimeSession = async (runtimeSession2, logResponse2) => {
3026
- const interceptor = runtimeSession2 && _optionalChain([pm, 'optionalAccess', _200 => _200.hasRuntimeHook, 'call', _201 => _201("after")]) && _optionalChain([middlewareManager, 'optionalAccess', _202 => _202.hasMiddleware, 'call', _203 => _203()]) ? interceptFarmDevPageResponse({
3284
+ const interceptor = runtimeSession2 && _optionalChain([pm, 'optionalAccess', _212 => _212.hasRuntimeHook, 'call', _213 => _213("after")]) && _optionalChain([middlewareManager, 'optionalAccess', _214 => _214.hasMiddleware, 'call', _215 => _215()]) ? interceptFarmDevPageResponse({
3027
3285
  req,
3028
3286
  res,
3029
3287
  pm,
@@ -3036,7 +3294,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
3036
3294
  urlPath: requestUrl,
3037
3295
  pathname: requestPathname,
3038
3296
  startTime: Date.now(),
3039
- logResponse: (_method, _path, status) => _optionalChain([logResponse2, 'optionalCall', _204 => _204(status)]),
3297
+ logResponse: (_method, _path, status) => _optionalChain([logResponse2, 'optionalCall', _216 => _216(status)]),
3040
3298
  // The runtime reports a runtime.after failure itself.
3041
3299
  emitError: async () => {
3042
3300
  },
@@ -3047,7 +3305,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
3047
3305
  handled = await runAppMiddlewareForContentRoute();
3048
3306
  } catch (error) {
3049
3307
  if (runtimeHookErrorAnswersJSON || res.headersSent) {
3050
- _optionalChain([interceptor, 'optionalAccess', _205 => _205.release, 'call', _206 => _206()]);
3308
+ _optionalChain([interceptor, 'optionalAccess', _217 => _217.release, 'call', _218 => _218()]);
3051
3309
  throw error;
3052
3310
  }
3053
3311
  if (runtimeSession2) await pm.reportRuntimeRequestError(runtimeSession2, error);
@@ -3055,10 +3313,10 @@ window.__FARM_MANIFEST__ = ${inlineValue({
3055
3313
  return true;
3056
3314
  }
3057
3315
  if (!handled) {
3058
- _optionalChain([interceptor, 'optionalAccess', _207 => _207.release, 'call', _208 => _208()]);
3316
+ _optionalChain([interceptor, 'optionalAccess', _219 => _219.release, 'call', _220 => _220()]);
3059
3317
  return false;
3060
3318
  }
3061
- if (!_optionalChain([interceptor, 'optionalAccess', _209 => _209.isEnded, 'call', _210 => _210()])) _optionalChain([logResponse2, 'optionalCall', _211 => _211(res.statusCode || 200)]);
3319
+ if (!_optionalChain([interceptor, 'optionalAccess', _221 => _221.isEnded, 'call', _222 => _222()])) _optionalChain([logResponse2, 'optionalCall', _223 => _223(res.statusCode || 200)]);
3062
3320
  return true;
3063
3321
  };
3064
3322
  const serveBuiltInRoute = async (respond, {
@@ -3067,7 +3325,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
3067
3325
  label
3068
3326
  } = {}) => {
3069
3327
  const discard = async () => {
3070
- await _optionalChain([computed, 'optionalAccess', _212 => _212.body, 'optionalAccess', _213 => _213.cancel, 'call', _214 => _214(), 'access', _215 => _215.catch, 'call', _216 => _216(() => {
3328
+ await _optionalChain([computed, 'optionalAccess', _224 => _224.body, 'optionalAccess', _225 => _225.cancel, 'call', _226 => _226(), 'access', _227 => _227.catch, 'call', _228 => _228(() => {
3071
3329
  })]);
3072
3330
  };
3073
3331
  const sendRuntimeResponse = async (runtimeSession3, response2) => {
@@ -3084,9 +3342,9 @@ window.__FARM_MANIFEST__ = ${inlineValue({
3084
3342
  if (pm && opensFarmDevRuntimeSession(pm)) {
3085
3343
  try {
3086
3344
  const routePathname = _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath);
3087
- const route = _chunkFSSONJRVcjs.setFarmRouteLabel.call(void 0,
3345
+ const route = _chunkDM2YGTRHcjs.setFarmRouteLabel.call(void 0,
3088
3346
  { pathname: requestPathname },
3089
- label !== void 0 ? label : devBuiltInRoutePaths.has(routePathname) ? routePathname : _chunkFSSONJRVcjs.resolveFarmMCPRouteLabel.call(void 0, routePathname, apiServerBasePath)
3347
+ label !== void 0 ? label : devBuiltInRoutePaths.has(routePathname) ? routePathname : _chunkDM2YGTRHcjs.resolveFarmMCPRouteLabel.call(void 0, routePathname, apiServerBasePath)
3090
3348
  );
3091
3349
  runtimeSession2 = await pm.beginRuntimeRequest(
3092
3350
  createRequestFromNodeRequest(req, new URL(fullUrl)),
@@ -3124,7 +3382,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
3124
3382
  }
3125
3383
  responding = true;
3126
3384
  response = await respond(
3127
- _nullishCoalesce(_optionalChain([runtimeSession2, 'optionalAccess', _217 => _217.request]), () => ( createRequestFromNodeRequest(req, new URL(fullUrl))))
3385
+ _nullishCoalesce(_optionalChain([runtimeSession2, 'optionalAccess', _229 => _229.request]), () => ( createRequestFromNodeRequest(req, new URL(fullUrl))))
3128
3386
  );
3129
3387
  } catch (error) {
3130
3388
  if (!responding && !res.headersSent) {
@@ -3144,7 +3402,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
3144
3402
  else await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0, res, response);
3145
3403
  };
3146
3404
  const openAPIRequestPathname = openAPIManager ? _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath) : requestPathname;
3147
- if (openAPIManager && _optionalChain([options, 'access', _218 => _218.openapi, 'optionalAccess', _219 => _219.specRoute]) && openAPIRequestPathname === options.openapi.specRoute) {
3405
+ if (openAPIManager && _optionalChain([options, 'access', _230 => _230.openapi, 'optionalAccess', _231 => _231.specRoute]) && openAPIRequestPathname === options.openapi.specRoute) {
3148
3406
  const specManager = openAPIManager;
3149
3407
  await serveBuiltInRoute(async () => {
3150
3408
  if (requestMethod !== "GET" && requestMethod !== "HEAD") {
@@ -3164,7 +3422,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
3164
3422
  });
3165
3423
  return;
3166
3424
  }
3167
- if (openAPIManager && openAPIRequestPathname === _optionalChain([options, 'access', _220 => _220.openapi, 'optionalAccess', _221 => _221.route])) {
3425
+ if (openAPIManager && openAPIRequestPathname === _optionalChain([options, 'access', _232 => _232.openapi, 'optionalAccess', _233 => _233.route])) {
3168
3426
  const docsManager = openAPIManager;
3169
3427
  await serveBuiltInRoute(
3170
3428
  async () => {
@@ -3175,42 +3433,50 @@ window.__FARM_MANIFEST__ = ${inlineValue({
3175
3433
  );
3176
3434
  return;
3177
3435
  }
3178
- if (_optionalChain([options, 'access', _222 => _222.agent, 'optionalAccess', _223 => _223.manifest]) !== false && _chunkFSSONJRVcjs.isFarmAppManifestPath.call(void 0, _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath))) {
3436
+ if (_optionalChain([options, 'access', _234 => _234.agent, 'optionalAccess', _235 => _235.manifest]) !== false && _chunkDM2YGTRHcjs.isFarmAppManifestPath.call(void 0, _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath))) {
3437
+ const manifestGuardCoversPath = (path7) => _chunkO2A6HE76cjs.farmPathGuardCoversEndpoint.call(void 0,
3438
+ {
3439
+ config: farmConfig,
3440
+ middlewareRoutes: middlewareManager.getMiddlewares().filter((entry) => entry.source !== "config")
3441
+ },
3442
+ path7,
3443
+ apiServerBasePath
3444
+ );
3179
3445
  await serveBuiltInRoute(async () => {
3180
- _nullishCoalesce(farmAppPackages, () => ( (farmAppPackages = _chunkCBLRSZQLcjs.resolveFarmAppPackages.call(void 0, _nullishCoalesce(farmConfig.root, () => ( process.cwd()))))));
3181
- const manifest = await _chunkFSSONJRVcjs.createFarmAppManifestResponse.call(void 0,
3446
+ _nullishCoalesce(farmAppPackages, () => ( (farmAppPackages = _chunk56HHUSR5cjs.resolveFarmAppPackages.call(void 0, _nullishCoalesce(farmConfig.root, () => ( process.cwd()))))));
3447
+ const manifest = await _chunkDM2YGTRHcjs.createFarmAppManifestResponse.call(void 0,
3182
3448
  new Request(parsedRequestUrl, {
3183
3449
  method: requestMethod,
3184
3450
  headers: { "if-none-match": String(_nullishCoalesce(req.headers["if-none-match"], () => ( ""))) }
3185
3451
  }),
3186
3452
  {
3187
- ..._chunkFSSONJRVcjs.resolveFarmAppManifestInput.call(void 0, farmConfig, {
3453
+ ..._chunkDM2YGTRHcjs.resolveFarmAppManifestInput.call(void 0, farmConfig, {
3188
3454
  build: "development",
3189
3455
  packages: farmAppPackages,
3190
3456
  // Read again on each request; unchanged files come from a cache.
3191
- webmcpTools: _optionalChain([farmConfig, 'access', _224 => _224.plugins, 'optionalAccess', _225 => _225.some, 'call', _226 => _226(({ name }) => name === "farm:webmcp")]) ? _chunkCBLRSZQLcjs.collectFarmWebMCPTools.call(void 0, _nullishCoalesce(farmConfig.root, () => ( process.cwd())), farmConfig.srcDir) : []
3457
+ webmcpTools: _optionalChain([farmConfig, 'access', _236 => _236.plugins, 'optionalAccess', _237 => _237.some, 'call', _238 => _238(({ name }) => name === "farm:webmcp")]) ? _chunk56HHUSR5cjs.collectFarmWebMCPTools.call(void 0, _nullishCoalesce(farmConfig.root, () => ( process.cwd())), farmConfig.srcDir) : []
3192
3458
  }),
3193
3459
  defaultMCP: () => farmApp.getServerRenderer().getDefaultMCPServer(),
3194
3460
  // A guard written for an MCP server's path keeps its tools out of the public view.
3195
- guardCoversPath: (path7) => _chunkC5AM2XDNcjs.farmPathGuardCoversEndpoint.call(void 0,
3196
- {
3197
- config: farmConfig,
3198
- middlewareRoutes: middlewareManager.getMiddlewares().filter((entry) => entry.source !== "config")
3199
- },
3200
- path7,
3201
- apiServerBasePath
3202
- )
3461
+ guardCoversPath: manifestGuardCoversPath,
3462
+ // A docs runtime's MCP server lists its tools when asked, read on each request.
3463
+ ...farmDocsHandler ? {
3464
+ registeredMCP: (request) => _chunk2DOI6HLJcjs._listFarmRegisteredMCPServerTools.call(void 0, farmDocsHandler, request, {
3465
+ basePath: farmConfig.basePath,
3466
+ guardCoversPath: manifestGuardCoversPath
3467
+ })
3468
+ } : {}
3203
3469
  }
3204
3470
  );
3205
3471
  return manifest;
3206
3472
  });
3207
3473
  return;
3208
3474
  }
3209
- if (_optionalChain([options, 'access', _227 => _227.agent, 'optionalAccess', _228 => _228.apiCatalog]) && _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath) === _chunkFSSONJRVcjs.FARM_API_CATALOG_PATH) {
3475
+ if (_optionalChain([options, 'access', _239 => _239.agent, 'optionalAccess', _240 => _240.apiCatalog]) && _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath) === _chunkDM2YGTRHcjs.FARM_API_CATALOG_PATH) {
3210
3476
  await serveBuiltInRoute(
3211
- () => _chunkFSSONJRVcjs.createFarmApiCatalogResponse.call(void 0,
3477
+ () => _chunkDM2YGTRHcjs.createFarmApiCatalogResponse.call(void 0,
3212
3478
  requestMethod,
3213
- _chunkFSSONJRVcjs.resolveFarmApiCatalogInput.call(void 0, { ...options, api: farmConfig.api }),
3479
+ _chunkDM2YGTRHcjs.resolveFarmApiCatalogInput.call(void 0, { ...options, api: farmConfig.api }),
3214
3480
  new Request(parsedRequestUrl, {
3215
3481
  headers: { "user-agent": String(_nullishCoalesce(req.headers["user-agent"], () => ( ""))) }
3216
3482
  })
@@ -3218,8 +3484,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
3218
3484
  );
3219
3485
  return;
3220
3486
  }
3221
- if (_optionalChain([options, 'access', _229 => _229.agent, 'optionalAccess', _230 => _230.aiCatalog]) !== false) {
3222
- const aiCatalog = _chunkFSSONJRVcjs.createFarmAiCatalogResponse.call(void 0,
3487
+ if (_optionalChain([options, 'access', _241 => _241.agent, 'optionalAccess', _242 => _242.aiCatalog]) !== false) {
3488
+ const aiCatalog = _chunkDM2YGTRHcjs.createFarmAiCatalogResponse.call(void 0,
3223
3489
  new Request(parsedRequestUrl, {
3224
3490
  method: requestMethod,
3225
3491
  headers: {
@@ -3260,18 +3526,32 @@ window.__FARM_MANIFEST__ = ${inlineValue({
3260
3526
  headers: docsHeaders
3261
3527
  });
3262
3528
  const docsBodyInit = requestMethod === "GET" || requestMethod === "HEAD" ? {} : { body: _chunkCFG4QERRcjs.createFarmNodeRequestBodyStream.call(void 0, req), duplex: "half" };
3263
- const docsResponse = await farmDocsHandler(new Request(docsRequest, docsBodyInit));
3529
+ const docsHandlerRequest = new Request(docsRequest, docsBodyInit);
3530
+ const registeredMCPCalls = await _chunk2DOI6HLJcjs._readFarmRegisteredMCPCalls.call(void 0,
3531
+ docsHandlerRequest,
3532
+ farmConfig.basePath
3533
+ );
3534
+ const docsResponse = await farmDocsHandler(docsHandlerRequest);
3264
3535
  if (docsResponse) {
3265
- const docsPage = _optionalChain([docsResponse, 'access', _231 => _231.headers, 'access', _232 => _232.get, 'call', _233 => _233("content-type"), 'optionalAccess', _234 => _234.toLowerCase, 'call', _235 => _235(), 'access', _236 => _236.includes, 'call', _237 => _237("text/html")]);
3536
+ const docsPage = _optionalChain([docsResponse, 'access', _243 => _243.headers, 'access', _244 => _244.get, 'call', _245 => _245("content-type"), 'optionalAccess', _246 => _246.toLowerCase, 'call', _247 => _247(), 'access', _248 => _248.includes, 'call', _249 => _249("text/html")]);
3266
3537
  await serveBuiltInRoute(
3267
3538
  async (request) => {
3268
- if (!docsPage) return wrapFarmDocsResponseWithLayouts(docsRequest, docsResponse);
3539
+ if (!docsPage) {
3540
+ const response = await wrapFarmDocsResponseWithLayouts(
3541
+ docsRequest,
3542
+ docsResponse
3543
+ );
3544
+ return _chunk4M5ESTJ2cjs._runWithCurrentRequest.call(void 0,
3545
+ request,
3546
+ () => _chunk2DOI6HLJcjs._observeFarmRegisteredMCPResponse.call(void 0, response, registeredMCPCalls)
3547
+ );
3548
+ }
3269
3549
  const deploymentMismatch = _chunkNLBHLPEOcjs.getFarmDeploymentMismatch.call(void 0,
3270
3550
  request,
3271
3551
  farmConfig.deploymentId
3272
3552
  );
3273
3553
  if (deploymentMismatch) {
3274
- await _optionalChain([docsResponse, 'access', _238 => _238.body, 'optionalAccess', _239 => _239.cancel, 'call', _240 => _240()]);
3554
+ await _optionalChain([docsResponse, 'access', _250 => _250.body, 'optionalAccess', _251 => _251.cancel, 'call', _252 => _252()]);
3275
3555
  return _chunkNLBHLPEOcjs.createFarmDeploymentMismatchResponse.call(void 0, deploymentMismatch);
3276
3556
  }
3277
3557
  return _chunkNLBHLPEOcjs.withFarmDeploymentResponse.call(void 0,
@@ -3287,11 +3567,11 @@ window.__FARM_MANIFEST__ = ${inlineValue({
3287
3567
  {
3288
3568
  kind: "docs",
3289
3569
  computed: docsResponse,
3290
- label: _chunkFSSONJRVcjs.resolveFarmDocsEngineRouteLabel.call(void 0,
3570
+ label: _chunkDM2YGTRHcjs.resolveFarmDocsEngineRouteLabel.call(void 0,
3291
3571
  _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath),
3292
3572
  {
3293
- path: _optionalChain([farmConfig, 'access', _241 => _241.docs, 'optionalAccess', _242 => _242.entry]) || "/docs",
3294
- roots: _optionalChain([farmConfig, 'access', _243 => _243.docs, 'optionalAccess', _244 => _244.roots, 'optionalAccess', _245 => _245.map, 'call', _246 => _246((root) => root.entry)]),
3573
+ path: _optionalChain([farmConfig, 'access', _253 => _253.docs, 'optionalAccess', _254 => _254.entry]) || "/docs",
3574
+ roots: _optionalChain([farmConfig, 'access', _255 => _255.docs, 'optionalAccess', _256 => _256.roots, 'optionalAccess', _257 => _257.map, 'call', _258 => _258((root) => root.entry)]),
3295
3575
  pages: await getFarmDocsPagePaths()
3296
3576
  }
3297
3577
  )
@@ -3300,8 +3580,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
3300
3580
  return;
3301
3581
  }
3302
3582
  }
3303
- if (options.mobileClient && !viteModuleRequest && (requestMethod === "GET" || requestMethod === "HEAD" || requestMethod === "POST") && _optionalChain([req, 'access', _247 => _247.headers, 'access', _248 => _248.accept, 'optionalAccess', _249 => _249.includes, 'call', _250 => _250(_chunk3HLQTOVUcjs.FARM_NATIVE_TREE_CONTENT_TYPE)])) {
3304
- const { createFarmNativeTreeResponse } = await import("./native-tree-GF4BH33L.cjs");
3583
+ if (options.mobileClient && !viteModuleRequest && (requestMethod === "GET" || requestMethod === "HEAD" || requestMethod === "POST") && _optionalChain([req, 'access', _259 => _259.headers, 'access', _260 => _260.accept, 'optionalAccess', _261 => _261.includes, 'call', _262 => _262(_chunk3HLQTOVUcjs.FARM_NATIVE_TREE_CONTENT_TYPE)])) {
3584
+ const { createFarmNativeTreeResponse } = await import("./native-tree-TAPKR7QJ.cjs");
3305
3585
  const treeBodyInit = requestMethod === "POST" ? { body: _chunkCFG4QERRcjs.createFarmNodeRequestBodyStream.call(void 0, req), duplex: "half" } : {};
3306
3586
  const treeResponse = await createFarmNativeTreeResponse({
3307
3587
  request: new Request(fullUrl, {
@@ -3318,18 +3598,18 @@ window.__FARM_MANIFEST__ = ${inlineValue({
3318
3598
  });
3319
3599
  await serveBuiltInRoute(() => treeResponse, {
3320
3600
  computed: treeResponse,
3321
- label: _nullishCoalesce(_optionalChain([farmApp, 'access', _251 => _251.getRouteManager, 'call', _252 => _252(), 'access', _253 => _253.matchRoute, 'call', _254 => _254(_chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath)), 'access', _255 => _255.route, 'optionalAccess', _256 => _256.pattern]), () => ( null))
3601
+ label: _nullishCoalesce(_optionalChain([farmApp, 'access', _263 => _263.getRouteManager, 'call', _264 => _264(), 'access', _265 => _265.matchRoute, 'call', _266 => _266(_chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath)), 'access', _267 => _267.route, 'optionalAccess', _268 => _268.pattern]), () => ( null))
3322
3602
  });
3323
3603
  return;
3324
3604
  }
3325
3605
  const markdownRouteLabel = () => (
3326
3606
  // On the route path, as production labels it: /fr/index.md is /index.md.
3327
- _chunkFSSONJRVcjs.resolveFarmMarkdownRouteLabel.call(void 0,
3607
+ _chunkDM2YGTRHcjs.resolveFarmMarkdownRouteLabel.call(void 0,
3328
3608
  toRoutePathname(requestPathname),
3329
- (page) => _optionalChain([farmApp, 'access', _257 => _257.getRouteManager, 'call', _258 => _258(), 'access', _259 => _259.matchRoute, 'call', _260 => _260(page), 'access', _261 => _261.route, 'optionalAccess', _262 => _262.pattern])
3609
+ (page) => _optionalChain([farmApp, 'access', _269 => _269.getRouteManager, 'call', _270 => _270(), 'access', _271 => _271.matchRoute, 'call', _272 => _272(page), 'access', _273 => _273.route, 'optionalAccess', _274 => _274.pattern])
3330
3610
  )
3331
3611
  );
3332
- const markdownSourceResponse = viteModuleRequest ? null : await _chunkL6E4SHUBcjs.createFarmMarkdownSourceResponse.call(void 0, {
3612
+ const markdownSourceResponse = viteModuleRequest ? null : await _chunkVZKCGHWCcjs.createFarmMarkdownSourceResponse.call(void 0, {
3333
3613
  request: new Request(fullUrl, {
3334
3614
  method: requestMethod,
3335
3615
  headers: docsHeaders
@@ -3338,7 +3618,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
3338
3618
  routePathname: toRoutePathname,
3339
3619
  resolveSource: async (pathname2) => {
3340
3620
  const match = farmApp.getRouteManager().matchRoute(pathname2);
3341
- const sourcePath = _optionalChain([match, 'access', _263 => _263.route, 'optionalAccess', _264 => _264.markdownSourcePath]) || (match.route && _chunkL6E4SHUBcjs.isFarmMarkdownPageFile.call(void 0, match.route.modulePath) ? match.route.modulePath : null);
3621
+ const sourcePath = _optionalChain([match, 'access', _275 => _275.route, 'optionalAccess', _276 => _276.markdownSourcePath]) || (match.route && _chunkVZKCGHWCcjs.isFarmMarkdownPageFile.call(void 0, match.route.modulePath) ? match.route.modulePath : null);
3342
3622
  if (!sourcePath) {
3343
3623
  return null;
3344
3624
  }
@@ -3370,7 +3650,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
3370
3650
  });
3371
3651
  return;
3372
3652
  }
3373
- const markdownResponse = viteModuleRequest ? null : await _chunkC2JOS77Zcjs.createMarkdownMirrorResponse.call(void 0, {
3653
+ const markdownResponse = viteModuleRequest ? null : await _chunkPG6ZIHKEcjs.createMarkdownMirrorResponse.call(void 0, {
3374
3654
  request: new Request(fullUrl, {
3375
3655
  method: requestMethod,
3376
3656
  headers: docsHeaders
@@ -3409,16 +3689,16 @@ window.__FARM_MANIFEST__ = ${inlineValue({
3409
3689
  });
3410
3690
  return;
3411
3691
  }
3412
- if (!viteModuleRequest && _chunkC2JOS77Zcjs.farmRequestWantsMarkdown.call(void 0, requestPathname, req.headers.accept)) {
3413
- const markdownRoute = farmApp.getRouteManager().matchRoute(_chunkL6E4SHUBcjs.normalizeFarmMarkdownRoutePath.call(void 0, requestPathname, toRoutePathname));
3692
+ if (!viteModuleRequest && _chunkPG6ZIHKEcjs.farmRequestWantsMarkdown.call(void 0, requestPathname, req.headers.accept)) {
3693
+ const markdownRoute = farmApp.getRouteManager().matchRoute(_chunkVZKCGHWCcjs.normalizeFarmMarkdownRoutePath.call(void 0, requestPathname, toRoutePathname));
3414
3694
  if (!markdownRoute.route) {
3415
3695
  await serveBuiltInRoute(
3416
3696
  () => new Response(
3417
- _chunkC2JOS77Zcjs.createFarmMarkdownErrorBody.call(void 0, 404, requestPathname, farmConfig.basePath || "/"),
3697
+ _chunkPG6ZIHKEcjs.createFarmMarkdownErrorBody.call(void 0, 404, requestPathname, farmConfig.basePath || "/"),
3418
3698
  {
3419
3699
  status: 404,
3420
3700
  headers: {
3421
- "Content-Type": _chunkC2JOS77Zcjs.FARM_MARKDOWN_CONTENT_TYPE,
3701
+ "Content-Type": _chunkPG6ZIHKEcjs.FARM_MARKDOWN_CONTENT_TYPE,
3422
3702
  "X-Farm-Markdown-Error": "404",
3423
3703
  "Cache-Control": "no-store"
3424
3704
  }
@@ -3428,7 +3708,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
3428
3708
  return;
3429
3709
  }
3430
3710
  }
3431
- const markdownPageTarget = _chunkC2JOS77Zcjs.resolveMarkdownMirrorTarget.call(void 0,
3711
+ const markdownPageTarget = _chunkPG6ZIHKEcjs.resolveMarkdownMirrorTarget.call(void 0,
3432
3712
  farmApp.getConfig().md,
3433
3713
  requestPathname,
3434
3714
  {
@@ -3479,7 +3759,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
3479
3759
  }
3480
3760
  const configuredIntegrations = currentConfig.integrations;
3481
3761
  const tryConfiguredIntegrationRoute = async () => {
3482
- const matchedRoute = _chunkJX5VOLAVcjs.matchIntegrationRoute.call(void 0, configuredIntegrations, {
3762
+ const matchedRoute = _chunk65OS2TOTcjs.matchIntegrationRoute.call(void 0, configuredIntegrations, {
3483
3763
  pathname: requestPathname,
3484
3764
  method: requestMethod
3485
3765
  });
@@ -3493,8 +3773,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
3493
3773
  await pm.runHookParallelFiltered(
3494
3774
  "beforeRequest",
3495
3775
  (plugin2) => {
3496
- const owner = _chunkJX5VOLAVcjs.getFarmIntegrationPluginOwner.call(void 0, plugin2);
3497
- return !isFarmConfigRoutePlugin(plugin2) && (_optionalChain([owner, 'optionalAccess', _265 => _265.source]) !== "lifecycle" || owner.key !== matchedRoute.key);
3776
+ const owner = _chunk65OS2TOTcjs.getFarmIntegrationPluginOwner.call(void 0, plugin2);
3777
+ return !isFarmConfigRoutePlugin(plugin2) && (_optionalChain([owner, 'optionalAccess', _277 => _277.source]) !== "lifecycle" || owner.key !== matchedRoute.key);
3498
3778
  },
3499
3779
  req,
3500
3780
  res
@@ -3523,7 +3803,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
3523
3803
  });
3524
3804
  const dispatchIntegration = async (request, runtime) => {
3525
3805
  try {
3526
- const result = await _chunkJX5VOLAVcjs.dispatchIntegrationRequest.call(void 0,
3806
+ const result = await _chunk65OS2TOTcjs.dispatchIntegrationRequest.call(void 0,
3527
3807
  {
3528
3808
  integration: matchedRoute.integration,
3529
3809
  config: currentConfig,
@@ -3531,7 +3811,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
3531
3811
  isProd: false
3532
3812
  },
3533
3813
  request,
3534
- { clientAddress: _optionalChain([req, 'access', _266 => _266.socket, 'optionalAccess', _267 => _267.remoteAddress]) }
3814
+ { clientAddress: _optionalChain([req, 'access', _278 => _278.socket, 'optionalAccess', _279 => _279.remoteAddress]) }
3535
3815
  );
3536
3816
  if (!result) {
3537
3817
  throw new Error(`Matched integration route did not return a response`);
@@ -3539,8 +3819,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
3539
3819
  return result;
3540
3820
  } catch (error) {
3541
3821
  _chunkQMNWKQL4cjs.logger.error(`Integration route error: ${error}`);
3542
- await _optionalChain([runtime, 'optionalAccess', _268 => _268.reportError, 'call', _269 => _269(error)]);
3543
- return _chunkXGTFLG73cjs.createFarmInternalServerErrorResponse.call(void 0, );
3822
+ await _optionalChain([runtime, 'optionalAccess', _280 => _280.reportError, 'call', _281 => _281(error)]);
3823
+ return _chunkKMYOKQPPcjs.createFarmInternalServerErrorResponse.call(void 0, );
3544
3824
  }
3545
3825
  };
3546
3826
  runtimeReportsErrors = Boolean(pm);
@@ -3581,25 +3861,25 @@ window.__FARM_MANIFEST__ = ${inlineValue({
3581
3861
  } else if (!res.writableEnded) {
3582
3862
  res.statusCode = 500;
3583
3863
  res.setHeader("Content-Type", "application/json");
3584
- res.end(_chunkXGTFLG73cjs.FARM_INTERNAL_SERVER_ERROR_BODY);
3864
+ res.end(_chunkKMYOKQPPcjs.FARM_INTERNAL_SERVER_ERROR_BODY);
3585
3865
  }
3586
3866
  return true;
3587
3867
  }
3588
3868
  };
3589
- if (pm && configRewriteSource === void 0 && configRoutePlugins.has(_chunkMBCRWU3Pcjs.FARM_CONFIG_REWRITES_PLUGIN_NAME)) {
3869
+ if (pm && configRewriteSource === void 0 && configRoutePlugins.has(_chunkXZPI44Q7cjs.FARM_CONFIG_REWRITES_PLUGIN_NAME)) {
3590
3870
  const hasLocalDevRoute = () => {
3591
3871
  const routeManager3 = farmApp.getRouteManager();
3592
3872
  return Boolean(
3593
- _chunkJX5VOLAVcjs.matchIntegrationRoute.call(void 0, configuredIntegrations, {
3873
+ _chunk65OS2TOTcjs.matchIntegrationRoute.call(void 0, configuredIntegrations, {
3594
3874
  pathname: requestPathname,
3595
3875
  method: requestMethod
3596
- }) || routeManager3.matchRedirect(requestPathname) || apiRouteManager.matchRoute(requestPathname) || farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess', _270 => _270.isFarmDocsAPIRequest, 'call', _271 => _271(requestPathname)]) || routeManager3.matchRoute(requestPathname).route || routeManager3.matchMetadataRoute(requestPathname) || routeManager3.matchMetadataImage(requestPathname)
3876
+ }) || routeManager3.matchRedirect(requestPathname) || apiRouteManager.matchRoute(requestPathname) || farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess', _282 => _282.isFarmDocsAPIRequest, 'call', _283 => _283(requestPathname)]) || routeManager3.matchRoute(requestPathname).route || routeManager3.matchMetadataRoute(requestPathname) || routeManager3.matchMetadataImage(requestPathname)
3597
3877
  );
3598
3878
  };
3599
3879
  try {
3600
3880
  await pm.runHookParallelFiltered(
3601
3881
  "beforeRequest",
3602
- (plugin2) => plugin2.name === _chunkMBCRWU3Pcjs.FARM_CONFIG_REWRITES_PLUGIN_NAME,
3882
+ (plugin2) => plugin2.name === _chunkXZPI44Q7cjs.FARM_CONFIG_REWRITES_PLUGIN_NAME,
3603
3883
  req,
3604
3884
  res
3605
3885
  );
@@ -3627,11 +3907,11 @@ window.__FARM_MANIFEST__ = ${inlineValue({
3627
3907
  }
3628
3908
  const matchedApiRoute = apiRouteManager.matchRoute(requestPathname);
3629
3909
  const hasMatchedApiRoute = Boolean(matchedApiRoute);
3630
- if (hasMatchedApiRoute || _chunkXGTFLG73cjs.isFarmAPIPathname.call(void 0, requestPathname, apiServerBasePath)) {
3910
+ if (hasMatchedApiRoute || _chunkKMYOKQPPcjs.isFarmAPIPathname.call(void 0, requestPathname, apiServerBasePath)) {
3631
3911
  const startTime2 = Date.now();
3632
3912
  const method2 = req.method || "GET";
3633
3913
  const urlPath2 = req.url || "/";
3634
- const pathname2 = _chunkHDPT6OYEcjs.resolveFarmRequestURL.call(void 0, req, {
3914
+ const pathname2 = _chunk4M5ESTJ2cjs.resolveFarmRequestURL.call(void 0, req, {
3635
3915
  trustProxy: currentServerConfig.trustProxy
3636
3916
  }).pathname;
3637
3917
  try {
@@ -3656,7 +3936,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
3656
3936
  _chunkQMNWKQL4cjs.logger.error(`Request hook error: ${error}`);
3657
3937
  res.statusCode = 500;
3658
3938
  res.setHeader("Content-Type", "application/json");
3659
- res.end(_chunkXGTFLG73cjs.FARM_INTERNAL_SERVER_ERROR_BODY);
3939
+ res.end(_chunkKMYOKQPPcjs.FARM_INTERNAL_SERVER_ERROR_BODY);
3660
3940
  return;
3661
3941
  }
3662
3942
  const createAPIRequest = async () => {
@@ -3670,23 +3950,28 @@ window.__FARM_MANIFEST__ = ${inlineValue({
3670
3950
  if (req.method !== "GET" && req.method !== "HEAD") {
3671
3951
  body = await _chunkCFG4QERRcjs.readNodeRequestBody.call(void 0, req, currentServerConfig.bodySizeLimit);
3672
3952
  }
3673
- return new Request(`http://${req.headers.host || "localhost:3000"}${req.url}`, {
3674
- method: req.method,
3675
- headers,
3676
- body: toRequestBody(body),
3677
- signal: _chunkCFG4QERRcjs.createFarmNodeRequestAbortSignal.call(void 0, req, res)
3678
- });
3953
+ return new Request(
3954
+ _chunk4M5ESTJ2cjs.resolveFarmRequestURL.call(void 0, req, {
3955
+ trustProxy: currentServerConfig.trustProxy
3956
+ }),
3957
+ {
3958
+ method: req.method,
3959
+ headers,
3960
+ body: toRequestBody(body),
3961
+ signal: _chunkCFG4QERRcjs.createFarmNodeRequestAbortSignal.call(void 0, req, res)
3962
+ }
3963
+ );
3679
3964
  };
3680
3965
  const isDocsAPIRequest = Boolean(
3681
- farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess', _272 => _272.isFarmDocsAPIRequest, 'call', _273 => _273(pathname2)])
3966
+ farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess', _284 => _284.isFarmDocsAPIRequest, 'call', _285 => _285(pathname2)])
3682
3967
  );
3683
3968
  const docsRuntimeOptions = () => ({
3684
3969
  kind: "docs",
3685
- route: _chunkFSSONJRVcjs.setFarmRouteLabel.call(void 0,
3970
+ route: _chunkDM2YGTRHcjs.setFarmRouteLabel.call(void 0,
3686
3971
  { pathname: pathname2, pattern: urlPath2 },
3687
- _chunkFSSONJRVcjs.resolveFarmDocsRouteLabel.call(void 0, pathname2, {
3688
- path: _optionalChain([farmConfig, 'access', _274 => _274.docs, 'optionalAccess', _275 => _275.entry]) || "/docs",
3689
- roots: _optionalChain([farmConfig, 'access', _276 => _276.docs, 'optionalAccess', _277 => _277.roots, 'optionalAccess', _278 => _278.map, 'call', _279 => _279((root) => root.entry)])
3972
+ _chunkDM2YGTRHcjs.resolveFarmDocsRouteLabel.call(void 0, pathname2, {
3973
+ path: _optionalChain([farmConfig, 'access', _286 => _286.docs, 'optionalAccess', _287 => _287.entry]) || "/docs",
3974
+ roots: _optionalChain([farmConfig, 'access', _288 => _288.docs, 'optionalAccess', _289 => _289.roots, 'optionalAccess', _290 => _290.map, 'call', _291 => _291((root) => root.entry)])
3690
3975
  })
3691
3976
  )
3692
3977
  });
@@ -3761,14 +4046,14 @@ window.__FARM_MANIFEST__ = ${inlineValue({
3761
4046
  (_request, runtime) => handler(request, runtime)
3762
4047
  ) : pm ? pm.runRuntimeRequest(request, handler, options2) : handler(request);
3763
4048
  const apiHandler = apiRouteManager.getHandler({ throwOnError: true });
3764
- const routedPathname = _chunkHDPT6OYEcjs.resolveFarmRequestURL.call(void 0, req, {
4049
+ const routedPathname = _chunk4M5ESTJ2cjs.resolveFarmRequestURL.call(void 0, req, {
3765
4050
  trustProxy: currentServerConfig.trustProxy
3766
4051
  }).pathname;
3767
4052
  const rewritten = routedPathname !== pathname2;
3768
4053
  const routedApiRoute = rewritten ? apiRouteManager.matchRoute(routedPathname) : matchedApiRoute || apiRouteManager.matchRoute(pathname2);
3769
4054
  const hasExplicitAPIRoute = Boolean(routedApiRoute);
3770
4055
  if (apiHandler && hasExplicitAPIRoute) {
3771
- const apiRoutePattern = _optionalChain([routedApiRoute, 'optionalAccess', _280 => _280.route, 'access', _281 => _281.path]) || urlPath2;
4056
+ const apiRoutePattern = _optionalChain([routedApiRoute, 'optionalAccess', _292 => _292.route, 'access', _293 => _293.path]) || urlPath2;
3772
4057
  _chunkEVIWKPJVcjs.emitFarmEvent.call(void 0, {
3773
4058
  type: "route.matched",
3774
4059
  pathname: pathname2,
@@ -3818,8 +4103,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
3818
4103
  error
3819
4104
  });
3820
4105
  _chunkQMNWKQL4cjs.logger.error(`API route error: ${error}`);
3821
- await _optionalChain([runtime, 'optionalAccess', _282 => _282.reportError, 'call', _283 => _283(error)]);
3822
- response = _chunkXGTFLG73cjs.createFarmInternalServerErrorResponse.call(void 0, );
4106
+ await _optionalChain([runtime, 'optionalAccess', _294 => _294.reportError, 'call', _295 => _295(error)]);
4107
+ response = _chunkKMYOKQPPcjs.createFarmInternalServerErrorResponse.call(void 0, );
3823
4108
  }
3824
4109
  return pm ? await pm.runHookSerial("afterApiHandler", response, apiLifecyclePayload) : response;
3825
4110
  };
@@ -3923,12 +4208,12 @@ window.__FARM_MANIFEST__ = ${inlineValue({
3923
4208
  }
3924
4209
  return;
3925
4210
  }
3926
- if (_optionalChain([req, 'access', _284 => _284.url, 'optionalAccess', _285 => _285.startsWith, 'call', _286 => _286("/@")]) || _optionalChain([req, 'access', _287 => _287.url, 'optionalAccess', _288 => _288.startsWith, 'call', _289 => _289("/node_modules")])) {
4211
+ if (_optionalChain([req, 'access', _296 => _296.url, 'optionalAccess', _297 => _297.startsWith, 'call', _298 => _298("/@")]) || _optionalChain([req, 'access', _299 => _299.url, 'optionalAccess', _300 => _300.startsWith, 'call', _301 => _301("/node_modules")])) {
3927
4212
  return next();
3928
4213
  }
3929
4214
  if (!deferredDottedRequests.has(req) && shouldBypassFarmRouterForDottedPath(
3930
4215
  requestPathname,
3931
- _optionalChain([farmApp, 'optionalAccess', _290 => _290.getRouteManager, 'call', _291 => _291()]),
4216
+ _optionalChain([farmApp, 'optionalAccess', _302 => _302.getRouteManager, 'call', _303 => _303()]),
3932
4217
  [server.config.publicDir, server.config.root],
3933
4218
  farmAgentGeneratedPaths(farmConfig),
3934
4219
  requestMethod
@@ -3936,7 +4221,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
3936
4221
  if (!viteModuleRequest) deferredDottedRequests.set(req, requestUrl);
3937
4222
  return next();
3938
4223
  }
3939
- if (_optionalChain([req, 'access', _292 => _292.url, 'optionalAccess', _293 => _293.startsWith, 'call', _294 => _294("/__farm/page-data")])) {
4224
+ if (_optionalChain([req, 'access', _304 => _304.url, 'optionalAccess', _305 => _305.startsWith, 'call', _306 => _306("/__farm/page-data")])) {
3940
4225
  const urlObj = parsedRequestUrl;
3941
4226
  const targetPath = urlObj.searchParams.get("path") || "/";
3942
4227
  let renderedRequest;
@@ -3966,7 +4251,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
3966
4251
  renderedRequest = targetRequest;
3967
4252
  let middlewareMap = /* @__PURE__ */ new Map();
3968
4253
  let middlewareContext = /* @__PURE__ */ new Map();
3969
- if (_optionalChain([middlewareManager, 'optionalAccess', _295 => _295.hasMiddleware, 'call', _296 => _296()])) {
4254
+ if (_optionalChain([middlewareManager, 'optionalAccess', _307 => _307.hasMiddleware, 'call', _308 => _308()])) {
3970
4255
  const targetNodeRequest = createPageDataMiddlewareRequest(req, targetRequestUrl);
3971
4256
  const targetNodeResponse = createPageDataMiddlewareResponse(res);
3972
4257
  const handled = await runFarmMiddlewareWithNavigation(
@@ -4000,10 +4285,10 @@ window.__FARM_MANIFEST__ = ${inlineValue({
4000
4285
  if (pm) {
4001
4286
  await pm.runHookParallel("afterRouteMatch", {
4002
4287
  pathname: targetPath,
4003
- matched: !!_optionalChain([match, 'optionalAccess', _297 => _297.route]),
4004
- routePattern: _optionalChain([match, 'optionalAccess', _298 => _298.route, 'optionalAccess', _299 => _299.pattern]) || null,
4005
- params: _optionalChain([match, 'optionalAccess', _300 => _300.params]) || {},
4006
- layoutPatterns: (_optionalChain([match, 'optionalAccess', _301 => _301.layouts]) || []).map((l) => l.pattern)
4288
+ matched: !!_optionalChain([match, 'optionalAccess', _309 => _309.route]),
4289
+ routePattern: _optionalChain([match, 'optionalAccess', _310 => _310.route, 'optionalAccess', _311 => _311.pattern]) || null,
4290
+ params: _optionalChain([match, 'optionalAccess', _312 => _312.params]) || {},
4291
+ layoutPatterns: (_optionalChain([match, 'optionalAccess', _313 => _313.layouts]) || []).map((l) => l.pattern)
4007
4292
  });
4008
4293
  }
4009
4294
  if (!match) {
@@ -4026,7 +4311,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
4026
4311
  );
4027
4312
  const loadingModule = loadingBoundary ? await routeManager3.loadRouteModule(loadingBoundary.modulePath) : null;
4028
4313
  const navigationManifest = routeManager3.generateClientManifest(server.config.root);
4029
- const moduleMetadata = _nullishCoalesce(navigationManifest.routes.find((entry) => entry.pattern === route.pattern), () => ( _chunkBE7AQXJBcjs.getClientModuleMetadata.call(void 0, route.modulePath, server.config.root)));
4314
+ const moduleMetadata = _nullishCoalesce(navigationManifest.routes.find((entry) => entry.pattern === route.pattern), () => ( _chunkNXGQIXR7cjs.getClientModuleMetadata.call(void 0, route.modulePath, server.config.root)));
4030
4315
  const isClientComponent = moduleMetadata.isClientComponent;
4031
4316
  const shouldHydrate = moduleMetadata.shouldHydrate;
4032
4317
  let mergedMetadata = {};
@@ -4034,7 +4319,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
4034
4319
  layouts.map((layout) => routeManager3.loadLayoutModule(layout.modulePath))
4035
4320
  );
4036
4321
  const layoutHydrationMetadata = layouts.map(
4037
- (layout) => _nullishCoalesce(navigationManifest.layouts.find((entry) => entry.pattern === layout.pattern), () => ( _chunkBE7AQXJBcjs.getClientModuleMetadata.call(void 0, layout.modulePath, server.config.root)))
4322
+ (layout) => _nullishCoalesce(navigationManifest.layouts.find((entry) => entry.pattern === layout.pattern), () => ( _chunkNXGQIXR7cjs.getClientModuleMetadata.call(void 0, layout.modulePath, server.config.root)))
4038
4323
  );
4039
4324
  const shouldHydrateLayout = layoutHydrationMetadata.some(
4040
4325
  (metadata) => metadata.shouldHydrate
@@ -4046,17 +4331,17 @@ window.__FARM_MANIFEST__ = ${inlineValue({
4046
4331
  )
4047
4332
  ];
4048
4333
  const hydrationIslandStrategy = _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0,
4049
- _optionalChain([(_nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _302 => _302.getConfig, 'call', _303 => _303()]), () => ( options))), 'access', _304 => _304.experimental, 'optionalAccess', _305 => _305.serverComponents])
4050
- ) === "islands" ? _chunkCBLRSZQLcjs.resolveFarmRouteRootStrategy.call(void 0,
4334
+ _optionalChain([(_nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _314 => _314.getConfig, 'call', _315 => _315()]), () => ( options))), 'access', _316 => _316.experimental, 'optionalAccess', _317 => _317.serverComponents])
4335
+ ) === "islands" ? _chunk56HHUSR5cjs.resolveFarmRouteRootStrategy.call(void 0,
4051
4336
  route,
4052
4337
  { shouldHydrate, islandStrategy: _nullishCoalesce(moduleMetadata.islandStrategy, () => ( null)) },
4053
4338
  layouts.map((layout, index) => ({
4054
4339
  pattern: layout.pattern,
4055
4340
  modulePath: layout.modulePath,
4056
- shouldHydrate: _optionalChain([layoutHydrationMetadata, 'access', _306 => _306[index], 'optionalAccess', _307 => _307.shouldHydrate]) === true,
4341
+ shouldHydrate: _optionalChain([layoutHydrationMetadata, 'access', _318 => _318[index], 'optionalAccess', _319 => _319.shouldHydrate]) === true,
4057
4342
  // Manifest entries carry it; metadata read from source does not.
4058
- hasIsolatedClientBoundaries: _optionalChain([layoutHydrationMetadata, 'access', _308 => _308[index], 'optionalAccess', _309 => _309.hasIsolatedClientBoundaries]) === true,
4059
- islandStrategy: _nullishCoalesce(_optionalChain([layoutHydrationMetadata, 'access', _310 => _310[index], 'optionalAccess', _311 => _311.islandStrategy]), () => ( null))
4343
+ hasIsolatedClientBoundaries: _optionalChain([layoutHydrationMetadata, 'access', _320 => _320[index], 'optionalAccess', _321 => _321.hasIsolatedClientBoundaries]) === true,
4344
+ islandStrategy: _nullishCoalesce(_optionalChain([layoutHydrationMetadata, 'access', _322 => _322[index], 'optionalAccess', _323 => _323.islandStrategy]), () => ( null))
4060
4345
  })),
4061
4346
  server.config.root,
4062
4347
  true
@@ -4104,7 +4389,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
4104
4389
  mergedMetadata = await _chunk6IOZPJ3Icjs.mergeModuleViewport.call(void 0, mergedMetadata, routeModule, routeProps);
4105
4390
  mergedMetadata = _chunk6IOZPJ3Icjs.addMetadataMarkdownAlternate.call(void 0,
4106
4391
  mergedMetadata,
4107
- _chunkC2JOS77Zcjs.getFarmMarkdownAlternatePath.call(void 0, farmApp.getConfig().md, targetRequestUrl.pathname, {
4392
+ _chunkPG6ZIHKEcjs.getFarmMarkdownAlternatePath.call(void 0, farmApp.getConfig().md, targetRequestUrl.pathname, {
4108
4393
  routePathname: (pathname2) => routeManager3.toRoutePathname(pathname2)
4109
4394
  })
4110
4395
  );
@@ -4113,7 +4398,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
4113
4398
  const slotModule = await routeManager3.loadRouteModule(slot.route.modulePath);
4114
4399
  const slotMetadata = _nullishCoalesce(navigationManifest.slots.find(
4115
4400
  (entry) => entry.name === slot.name && entry.ownerPattern === slot.ownerPattern && entry.pattern === slot.route.pattern
4116
- ), () => ( _chunkBE7AQXJBcjs.getClientModuleMetadata.call(void 0, slot.route.modulePath, server.config.root)));
4401
+ ), () => ( _chunkNXGQIXR7cjs.getClientModuleMetadata.call(void 0, slot.route.modulePath, server.config.root)));
4117
4402
  const slotContext = await _chunkX333W5KVcjs.resolveFarmRouteContext.call(void 0, farmApp.getConfig(), {
4118
4403
  request: targetRequest,
4119
4404
  params: slot.params,
@@ -4159,15 +4444,15 @@ window.__FARM_MANIFEST__ = ${inlineValue({
4159
4444
  );
4160
4445
  const projectRoot = server.config.root;
4161
4446
  const toUrlPath = (absolutePath) => _chunkQMNWKQL4cjs.toViteModuleId.call(void 0, absolutePath, projectRoot);
4162
- const renderPlan = _chunkC5AM2XDNcjs.createFarmRouteRenderPlan.call(void 0, {
4447
+ const renderPlan = _chunkO2A6HE76cjs.createFarmRouteRenderPlan.call(void 0, {
4163
4448
  pageShouldHydrate: shouldHydrate,
4164
4449
  layoutShouldHydrate: shouldHydrateLayout,
4165
4450
  islandStrategy: hydrationIslandStrategy,
4166
- rendering: _chunkE3LE6EZHcjs.resolveRouteRenderingConfig.call(void 0, routeModule)
4451
+ rendering: _chunkACAEFEOHcjs.resolveRouteRenderingConfig.call(void 0, routeModule)
4167
4452
  });
4168
4453
  const destinationLayoutPatterns = layouts.map((layout) => layout.pattern);
4169
- const layoutStartIndex = _chunkC5AM2XDNcjs.getSharedLayoutPrefixLength.call(void 0,
4170
- _chunkC5AM2XDNcjs.parseFarmLayoutChainHeader.call(void 0, request.headers.get("x-farm-layout-chain")),
4454
+ const layoutStartIndex = _chunkO2A6HE76cjs.getSharedLayoutPrefixLength.call(void 0,
4455
+ _chunkO2A6HE76cjs.parseFarmLayoutChainHeader.call(void 0, request.headers.get("x-farm-layout-chain")),
4171
4456
  destinationLayoutPatterns
4172
4457
  );
4173
4458
  const renderer = farmApp.getServerRenderer();
@@ -4177,7 +4462,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
4177
4462
  middlewareContext,
4178
4463
  () => renderer.renderNavigationFragment({
4179
4464
  PageComponent: routeModule.default,
4180
- LoadingComponent: _optionalChain([loadingModule, 'optionalAccess', _312 => _312.default]),
4465
+ LoadingComponent: _optionalChain([loadingModule, 'optionalAccess', _324 => _324.default]),
4181
4466
  pageProps: routeProps,
4182
4467
  params,
4183
4468
  layouts: layouts.map((layout, index) => ({
@@ -4248,7 +4533,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
4248
4533
  {
4249
4534
  status: 200,
4250
4535
  headers: {
4251
- "Cache-Control": _chunkC5AM2XDNcjs.getFarmFragmentCacheControl.call(void 0, renderPlan),
4536
+ "Cache-Control": _chunkO2A6HE76cjs.getFarmFragmentCacheControl.call(void 0, renderPlan),
4252
4537
  "X-Farm-Navigation": "html-fragment",
4253
4538
  Vary: "X-Farm-Layout-Chain",
4254
4539
  [_chunkNLBHLPEOcjs.FARM_DEPLOYMENT_ID_HEADER]: farmConfig.deploymentId
@@ -4286,33 +4571,33 @@ window.__FARM_MANIFEST__ = ${inlineValue({
4286
4571
  const startTime = Date.now();
4287
4572
  const method = req.method || "GET";
4288
4573
  const urlPath = req.url || "/";
4289
- const requestedPathname = _chunkHDPT6OYEcjs.resolveFarmRequestURL.call(void 0, req, {
4574
+ const requestedPathname = _chunk4M5ESTJ2cjs.resolveFarmRequestURL.call(void 0, req, {
4290
4575
  trustProxy: currentServerConfig.trustProxy
4291
4576
  }).pathname;
4292
4577
  const routeManager2 = farmApp.getRouteManager();
4293
- const hasBeforeRequestHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _313 => _313.hasHook, 'call', _314 => _314("beforeRequest")]), () => ( false));
4294
- const hasAfterResponseHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _315 => _315.hasHook, 'call', _316 => _316("afterResponse")]), () => ( false));
4295
- const hasHTMLTransformHook = (_nullishCoalesce(_optionalChain([pm, 'optionalAccess', _317 => _317.hasHook, 'call', _318 => _318("transformHTML")]), () => ( false))) || (_nullishCoalesce(_optionalChain([pm, 'optionalAccess', _319 => _319.hasHook, 'call', _320 => _320("afterRender")]), () => ( false)));
4578
+ const hasBeforeRequestHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _325 => _325.hasHook, 'call', _326 => _326("beforeRequest")]), () => ( false));
4579
+ const hasAfterResponseHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _327 => _327.hasHook, 'call', _328 => _328("afterResponse")]), () => ( false));
4580
+ const hasHTMLTransformHook = (_nullishCoalesce(_optionalChain([pm, 'optionalAccess', _329 => _329.hasHook, 'call', _330 => _330("transformHTML")]), () => ( false))) || (_nullishCoalesce(_optionalChain([pm, 'optionalAccess', _331 => _331.hasHook, 'call', _332 => _332("afterRender")]), () => ( false)));
4296
4581
  const opensRuntimeSession = pm ? opensFarmDevRuntimeSession(pm) : false;
4297
- const hasRuntimeAfterHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _321 => _321.hasRuntimeHook, 'call', _322 => _322("after")]), () => ( false));
4582
+ const hasRuntimeAfterHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _333 => _333.hasRuntimeHook, 'call', _334 => _334("after")]), () => ( false));
4298
4583
  const pageBuiltInRouteLabel = (pathname2) => {
4299
4584
  const routePathname = _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, pathname2, farmConfig.basePath);
4300
- const mcpLabel = _chunkFSSONJRVcjs.resolveFarmMCPRouteLabel.call(void 0, routePathname, apiServerBasePath);
4585
+ const mcpLabel = _chunkDM2YGTRHcjs.resolveFarmMCPRouteLabel.call(void 0, routePathname, apiServerBasePath);
4301
4586
  if (mcpLabel) return mcpLabel;
4302
4587
  if (farmAgentGeneratedPaths(farmConfig).includes(routePathname)) return routePathname;
4303
- return routePathname === _chunkTP4RAV7Ycjs.FARM_DEFAULT_MCP_PATH && farmApp.getServerRenderer().getDefaultMCPServer() ? _chunkTP4RAV7Ycjs.FARM_DEFAULT_MCP_PATH : null;
4588
+ return routePathname === _chunkVKRMO3EZcjs.FARM_DEFAULT_MCP_PATH && farmApp.getServerRenderer().getDefaultMCPServer() ? _chunkVKRMO3EZcjs.FARM_DEFAULT_MCP_PATH : null;
4304
4589
  };
4305
4590
  const pageRuntimeOptions = (pathname2) => {
4306
4591
  const match = routeManager2.matchRoute(pathname2);
4307
4592
  return {
4308
4593
  kind: "page",
4309
- route: _chunkFSSONJRVcjs.setFarmRouteLabel.call(void 0,
4594
+ route: _chunkDM2YGTRHcjs.setFarmRouteLabel.call(void 0,
4310
4595
  {
4311
4596
  pathname: pathname2,
4312
- pattern: _optionalChain([match, 'optionalAccess', _323 => _323.route, 'optionalAccess', _324 => _324.pattern]) || null,
4313
- params: _optionalChain([match, 'optionalAccess', _325 => _325.params]) || {}
4597
+ pattern: _optionalChain([match, 'optionalAccess', _335 => _335.route, 'optionalAccess', _336 => _336.pattern]) || null,
4598
+ params: _optionalChain([match, 'optionalAccess', _337 => _337.params]) || {}
4314
4599
  },
4315
- _optionalChain([match, 'optionalAccess', _326 => _326.route]) ? null : pageBuiltInRouteLabel(pathname2)
4600
+ _optionalChain([match, 'optionalAccess', _338 => _338.route]) ? null : pageBuiltInRouteLabel(pathname2)
4316
4601
  )
4317
4602
  };
4318
4603
  };
@@ -4392,7 +4677,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
4392
4677
  }) : void 0;
4393
4678
  let middlewareFailed = false;
4394
4679
  try {
4395
- if (_optionalChain([middlewareManager, 'optionalAccess', _327 => _327.hasMiddleware, 'call', _328 => _328()])) {
4680
+ if (_optionalChain([middlewareManager, 'optionalAccess', _339 => _339.hasMiddleware, 'call', _340 => _340()])) {
4396
4681
  const middlewareRequest = createRequestFromNodeRequest(req, new URL(fullUrl));
4397
4682
  const handled = await runFarmMiddlewareWithNavigation(
4398
4683
  farmApp.getServerRenderer(),
@@ -4405,7 +4690,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
4405
4690
  throw error;
4406
4691
  });
4407
4692
  if (handled) {
4408
- if (!_optionalChain([responseInterceptor, 'optionalAccess', _329 => _329.isEnded, 'call', _330 => _330()])) {
4693
+ if (!_optionalChain([responseInterceptor, 'optionalAccess', _341 => _341.isEnded, 'call', _342 => _342()])) {
4409
4694
  const duration = Date.now() - startTime;
4410
4695
  logResponse(method, urlPath, res.statusCode || 200, duration, "PAGE");
4411
4696
  }
@@ -4420,8 +4705,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
4420
4705
  res
4421
4706
  );
4422
4707
  }
4423
- if (res.writableEnded || _optionalChain([responseInterceptor, 'optionalAccess', _331 => _331.isEnded, 'call', _332 => _332()])) {
4424
- if (!_optionalChain([responseInterceptor, 'optionalAccess', _333 => _333.isEnded, 'call', _334 => _334()])) {
4708
+ if (res.writableEnded || _optionalChain([responseInterceptor, 'optionalAccess', _343 => _343.isEnded, 'call', _344 => _344()])) {
4709
+ if (!_optionalChain([responseInterceptor, 'optionalAccess', _345 => _345.isEnded, 'call', _346 => _346()])) {
4425
4710
  const duration = Date.now() - startTime;
4426
4711
  logResponse(method, urlPath, res.statusCode || 200, duration, "PAGE");
4427
4712
  }
@@ -4440,8 +4725,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
4440
4725
  await pm.reportRuntimeRequestError(runtimeSession, error);
4441
4726
  } else {
4442
4727
  await pm.failRuntimeRequest(runtimeSession, error);
4443
- if (!res.headersSent && !_optionalChain([responseInterceptor, 'optionalAccess', _335 => _335.isEnded, 'call', _336 => _336()])) {
4444
- _optionalChain([responseInterceptor, 'optionalAccess', _337 => _337.release, 'call', _338 => _338()]);
4728
+ if (!res.headersSent && !_optionalChain([responseInterceptor, 'optionalAccess', _347 => _347.isEnded, 'call', _348 => _348()])) {
4729
+ _optionalChain([responseInterceptor, 'optionalAccess', _349 => _349.release, 'call', _350 => _350()]);
4445
4730
  console.error("[FARM] Page error:", error);
4446
4731
  sendFarmDevRuntimeHookError(res, runtimeHookErrorAnswersJSON);
4447
4732
  return;
@@ -4458,7 +4743,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
4458
4743
  }
4459
4744
  })
4460
4745
  );
4461
- const farmRequestMiddleware = _optionalChain([farmMiddlewares, 'access', _339 => _339.stack, 'access', _340 => _340.at, 'call', _341 => _341(-1), 'optionalAccess', _342 => _342.handle]);
4746
+ const farmRequestMiddleware = _optionalChain([farmMiddlewares, 'access', _351 => _351.stack, 'access', _352 => _352.at, 'call', _353 => _353(-1), 'optionalAccess', _354 => _354.handle]);
4462
4747
  if (farmOwnsDevCors && viteServer.config.server.cors === false) {
4463
4748
  farmMiddlewares.use(createFarmDevViteCorsMiddleware());
4464
4749
  }
@@ -4472,7 +4757,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
4472
4757
  }
4473
4758
  if (!rendererDisabled) return next();
4474
4759
  const requested = _nullishCoalesce(_nullishCoalesce(req.originalUrl, () => ( req.url)), () => ( "/"));
4475
- const pathname = _chunkHDPT6OYEcjs.parseFarmRequestTarget.call(void 0, requested, "http://localhost").pathname;
4760
+ const pathname = _chunk4M5ESTJ2cjs.parseFarmRequestTarget.call(void 0, requested, "http://localhost").pathname;
4476
4761
  res.statusCode = 404;
4477
4762
  res.setHeader("Content-Type", "application/json");
4478
4763
  res.end(JSON.stringify({ error: "Not found", pathname }));
@@ -4487,7 +4772,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
4487
4772
  });
4488
4773
  }
4489
4774
  if (id.startsWith("@farm.js/core/internal/") && importer && isOutsideAppRoot(importer)) {
4490
- const root = _optionalChain([farmApp, 'optionalAccess', _343 => _343.getConfig, 'call', _344 => _344(), 'access', _345 => _345.root]) || _optionalChain([server, 'optionalAccess', _346 => _346.config, 'access', _347 => _347.root]) || options.root;
4775
+ const root = _optionalChain([farmApp, 'optionalAccess', _355 => _355.getConfig, 'call', _356 => _356(), 'access', _357 => _357.root]) || _optionalChain([server, 'optionalAccess', _358 => _358.config, 'access', _359 => _359.root]) || options.root;
4491
4776
  return this.resolve(id, path6.join(root, "package.json"), {
4492
4777
  ...resolveOptions,
4493
4778
  skipSelf: true
@@ -4515,7 +4800,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
4515
4800
  }
4516
4801
  },
4517
4802
  async load(id, loadOptions) {
4518
- if (pendingClientSetup && !_optionalChain([loadOptions, 'optionalAccess', _348 => _348.ssr]) && !farmSetupContext.getStore()) {
4803
+ if (pendingClientSetup && !_optionalChain([loadOptions, 'optionalAccess', _360 => _360.ssr]) && !farmSetupContext.getStore()) {
4519
4804
  await pendingClientSetup;
4520
4805
  }
4521
4806
  if (_chunkPIUTGRDIcjs.isFarmServerFnBoundaryId.call(void 0, id) && islandsServerFns()) {
@@ -4533,8 +4818,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
4533
4818
  if (imageModule) return imageModule;
4534
4819
  }
4535
4820
  if (_chunkE7QOEV5Zcjs.parseProgrammaticRouteModuleId.call(void 0, id)) {
4536
- const renderer = _optionalChain([farmApp, 'optionalAccess', _349 => _349.getConfig, 'call', _350 => _350(), 'access', _351 => _351.renderer]) || _chunk67MZTLTFcjs.resolveFarmRenderer.call(void 0, options.renderer);
4537
- const root = _optionalChain([server, 'optionalAccess', _352 => _352.config, 'access', _353 => _353.root]) || options.root;
4821
+ const renderer = _optionalChain([farmApp, 'optionalAccess', _361 => _361.getConfig, 'call', _362 => _362(), 'access', _363 => _363.renderer]) || _chunk67MZTLTFcjs.resolveFarmRenderer.call(void 0, options.renderer);
4822
+ const root = _optionalChain([server, 'optionalAccess', _364 => _364.config, 'access', _365 => _365.root]) || options.root;
4538
4823
  if (isClientEnvironment(this, loadOptions)) {
4539
4824
  return generateProgrammaticClientRouteModuleForId(
4540
4825
  id,
@@ -4550,65 +4835,65 @@ window.__FARM_MANIFEST__ = ${inlineValue({
4550
4835
  return FARM_DEV_CLIENT_BOOT_MODULE;
4551
4836
  }
4552
4837
  if (isFarmClientVirtualId(id)) {
4553
- const resolvedConfig = _optionalChain([farmApp, 'optionalAccess', _354 => _354.getConfig, 'call', _355 => _355()]);
4554
- const renderer = _optionalChain([resolvedConfig, 'optionalAccess', _356 => _356.renderer]) || _chunk67MZTLTFcjs.resolveFarmRenderer.call(void 0, options.renderer);
4555
- const integrations = _optionalChain([resolvedConfig, 'optionalAccess', _357 => _357.integrations]) || options.integrations;
4556
- const root = _optionalChain([resolvedConfig, 'optionalAccess', _358 => _358.root]) || _optionalChain([server, 'optionalAccess', _359 => _359.config, 'access', _360 => _360.root]) || process.cwd();
4557
- const docs = _optionalChain([resolvedConfig, 'optionalAccess', _361 => _361.docs]);
4838
+ const resolvedConfig = _optionalChain([farmApp, 'optionalAccess', _366 => _366.getConfig, 'call', _367 => _367()]);
4839
+ const renderer = _optionalChain([resolvedConfig, 'optionalAccess', _368 => _368.renderer]) || _chunk67MZTLTFcjs.resolveFarmRenderer.call(void 0, options.renderer);
4840
+ const integrations = _optionalChain([resolvedConfig, 'optionalAccess', _369 => _369.integrations]) || options.integrations;
4841
+ const root = _optionalChain([resolvedConfig, 'optionalAccess', _370 => _370.root]) || _optionalChain([server, 'optionalAccess', _371 => _371.config, 'access', _372 => _372.root]) || process.cwd();
4842
+ const docs = _optionalChain([resolvedConfig, 'optionalAccess', _373 => _373.docs]);
4558
4843
  const adapterOwnsDocsRuntime = Boolean(
4559
- _chunk67MZTLTFcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([docs, 'optionalAccess', _362 => _362.adapter, 'optionalAccess', _363 => _363.server]) && docs.adapter.react
4844
+ _chunk67MZTLTFcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([docs, 'optionalAccess', _374 => _374.adapter, 'optionalAccess', _375 => _375.server]) && docs.adapter.react
4560
4845
  );
4561
- const devtools = _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _364 => _364.devtools]), () => ( _chunkSTF6VDYQcjs.resolveFarmDevtoolsConfig.call(void 0, false, "production")));
4846
+ const devtools = _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _376 => _376.devtools]), () => ( _chunkSTF6VDYQcjs.resolveFarmDevtoolsConfig.call(void 0, false, "production")));
4562
4847
  const [docsRuntime, docsSearchRuntime, devtoolsClientRuntime] = await Promise.all([
4563
- _optionalChain([docs, 'optionalAccess', _365 => _365.enabled]) ? loadFarmDocsDevRuntime() : null,
4564
- _optionalChain([docs, 'optionalAccess', _366 => _366.enabled]) && !adapterOwnsDocsRuntime ? loadFarmDocsSearchDevRuntime() : null,
4848
+ _optionalChain([docs, 'optionalAccess', _377 => _377.enabled]) ? loadFarmDocsDevRuntime() : null,
4849
+ _optionalChain([docs, 'optionalAccess', _378 => _378.enabled]) && !adapterOwnsDocsRuntime ? loadFarmDocsSearchDevRuntime() : null,
4565
4850
  devtools.enabled ? loadFarmDevtoolsClientRuntime() : null
4566
4851
  ]);
4567
- const docsSearchEnabled = _nullishCoalesce(_optionalChain([docsSearchRuntime, 'optionalAccess', _367 => _367.isFarmDocsSearchEnabled, 'call', _368 => _368(docs)]), () => ( false));
4852
+ const docsSearchEnabled = _nullishCoalesce(_optionalChain([docsSearchRuntime, 'optionalAccess', _379 => _379.isFarmDocsSearchEnabled, 'call', _380 => _380(docs)]), () => ( false));
4568
4853
  const generatedDocsSearchRuntime = docsSearchRuntime ? docsSearchRuntime.generateFarmDocsSearchClientRuntime(
4569
4854
  docsSearchEnabled,
4570
4855
  docsSearchEnabled ? docsSearchRuntime.resolveFarmDocsSearchClientModule(root) : void 0
4571
4856
  ) : EMPTY_FARM_DOCS_SEARCH_CLIENT_RUNTIME;
4572
4857
  const generatedDevtoolsClientRuntime = devtoolsClientRuntime ? devtoolsClientRuntime.generateFarmDevtoolsClientRuntime(devtools) : "";
4573
4858
  const generatedDevIndicatorsClientRuntime = farmApp ? _chunkUVV3I5QAcjs.generateFarmDevIndicatorsClientRuntime.call(void 0, farmApp.getConfig().devIndicators) : "";
4574
- const integrationProviders = _chunk67MZTLTFcjs.isReactRenderer.call(void 0, renderer) ? _chunkJX5VOLAVcjs.getIntegrationProviders.call(void 0, integrations) : [];
4575
- const isolatedHydrationMode = _chunkBE7AQXJBcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
4576
- _optionalChain([resolvedConfig, 'optionalAccess', _369 => _369.experimental, 'optionalAccess', _370 => _370.isolatedClientHydration]),
4859
+ const integrationProviders = _chunk67MZTLTFcjs.isReactRenderer.call(void 0, renderer) ? _chunk65OS2TOTcjs.getIntegrationProviders.call(void 0, integrations) : [];
4860
+ const isolatedHydrationMode = _chunkNXGQIXR7cjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
4861
+ _optionalChain([resolvedConfig, 'optionalAccess', _381 => _381.experimental, 'optionalAccess', _382 => _382.isolatedClientHydration]),
4577
4862
  {
4578
- serverComponents: _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([resolvedConfig, 'optionalAccess', _371 => _371.experimental, 'optionalAccess', _372 => _372.serverComponents])) === "rsc",
4863
+ serverComponents: _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([resolvedConfig, 'optionalAccess', _383 => _383.experimental, 'optionalAccess', _384 => _384.serverComponents])) === "rsc",
4579
4864
  hasUnsupportedIntegrationProvider: integrationProviders.filter((provider) => provider.component || provider.type === "clerk").some((provider) => provider.supportsIsolatedHydration !== true)
4580
4865
  }
4581
4866
  );
4582
4867
  return generateClientCode(
4583
4868
  integrationProviders,
4584
4869
  [
4585
- ..._chunkJX5VOLAVcjs.getIntegrationDocumentNavigationMatchers.call(void 0, integrations),
4586
- ..._nullishCoalesce(_optionalChain([docsRuntime, 'optionalAccess', _373 => _373.getFarmDocsDocumentNavigationMatchers, 'call', _374 => _374(docs)]), () => ( []))
4870
+ ..._chunk65OS2TOTcjs.getIntegrationDocumentNavigationMatchers.call(void 0, integrations),
4871
+ ..._nullishCoalesce(_optionalChain([docsRuntime, 'optionalAccess', _385 => _385.getFarmDocsDocumentNavigationMatchers, 'call', _386 => _386(docs)]), () => ( []))
4587
4872
  ],
4588
4873
  generatedDocsSearchRuntime,
4589
4874
  `${generatedDevtoolsClientRuntime}
4590
4875
  ${generatedDevIndicatorsClientRuntime}`,
4591
- _optionalChain([resolvedConfig, 'optionalAccess', _375 => _375.plugins]) || [],
4876
+ _optionalChain([resolvedConfig, 'optionalAccess', _387 => _387.plugins]) || [],
4592
4877
  root,
4593
- _optionalChain([resolvedConfig, 'optionalAccess', _376 => _376.srcDir]) || options.srcDir || "src",
4594
- _optionalChain([resolvedConfig, 'optionalAccess', _377 => _377.publicRuntimeConfig]) || options.publicRuntimeConfig,
4595
- _chunk67MZTLTFcjs.isReactRenderer.call(void 0, renderer) ? _optionalChain([docs, 'optionalAccess', _378 => _378.adapter, 'optionalAccess', _379 => _379.react]) : void 0,
4878
+ _optionalChain([resolvedConfig, 'optionalAccess', _388 => _388.srcDir]) || options.srcDir || "src",
4879
+ _optionalChain([resolvedConfig, 'optionalAccess', _389 => _389.publicRuntimeConfig]) || options.publicRuntimeConfig,
4880
+ _chunk67MZTLTFcjs.isReactRenderer.call(void 0, renderer) ? _optionalChain([docs, 'optionalAccess', _390 => _390.adapter, 'optionalAccess', _391 => _391.react]) : void 0,
4596
4881
  renderer,
4597
- isolatedHydrationMode === "enabled" || _chunk67MZTLTFcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([(_nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess', _380 => _380.getRouteManager, 'call', _381 => _381(), 'access', _382 => _382.getIsolatedClientBoundaryModules, 'call', _383 => _383(root)])))), 'optionalAccess', _384 => _384.size]) > 0,
4598
- _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _385 => _385.trailingSlash]), () => ( false)),
4599
- _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _386 => _386.basePath]), () => ( "/")),
4600
- _chunkCBLRSZQLcjs.generateClientCachePersistenceCode.call(void 0,
4601
- _chunkCBLRSZQLcjs.resolveFarmClientCacheAdapterEntry.call(void 0, root, _optionalChain([resolvedConfig, 'optionalAccess', _387 => _387.cache]))
4882
+ isolatedHydrationMode === "enabled" || _chunk67MZTLTFcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([(_nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess', _392 => _392.getRouteManager, 'call', _393 => _393(), 'access', _394 => _394.getIsolatedClientBoundaryModules, 'call', _395 => _395(root)])))), 'optionalAccess', _396 => _396.size]) > 0,
4883
+ _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _397 => _397.trailingSlash]), () => ( false)),
4884
+ _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _398 => _398.basePath]), () => ( "/")),
4885
+ _chunk56HHUSR5cjs.generateClientCachePersistenceCode.call(void 0,
4886
+ _chunk56HHUSR5cjs.resolveFarmClientCacheAdapterEntry.call(void 0, root, _optionalChain([resolvedConfig, 'optionalAccess', _399 => _399.cache]))
4602
4887
  ),
4603
4888
  _chunk67MZTLTFcjs.isReactRenderer.call(void 0, renderer) ? _chunkSM2SYWARcjs.getFarmDocsAdapterConfigModule.call(void 0, docs) : void 0,
4604
- _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([resolvedConfig, 'optionalAccess', _388 => _388.experimental, 'optionalAccess', _389 => _389.serverComponents])) === "islands"
4889
+ _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([resolvedConfig, 'optionalAccess', _400 => _400.experimental, 'optionalAccess', _401 => _401.serverComponents])) === "islands"
4605
4890
  );
4606
4891
  }
4607
4892
  if (id === "/@farm/server") {
4608
4893
  return generateServerCode();
4609
4894
  }
4610
4895
  if (id === "/@farm/manifest") {
4611
- const routeManager = _optionalChain([farmApp, 'optionalAccess', _390 => _390.getRouteManager, 'call', _391 => _391()]);
4896
+ const routeManager = _optionalChain([farmApp, 'optionalAccess', _402 => _402.getRouteManager, 'call', _403 => _403()]);
4612
4897
  if (!routeManager) {
4613
4898
  return `
4614
4899
  export const getManifest = () => ({
@@ -4620,168 +4905,140 @@ export const getManifest = () => ({
4620
4905
  });
4621
4906
  `;
4622
4907
  }
4623
- const manifest = routeManager.generateClientManifest(server.config.root);
4624
- const globalStylesheetHref = _chunkCBLRSZQLcjs.resolveDevGlobalStylesheetHref.call(void 0,
4908
+ const globalStylesheetHref = _chunk56HHUSR5cjs.resolveDevGlobalStylesheetHref.call(void 0,
4625
4909
  server.config.root,
4626
- _optionalChain([farmApp, 'optionalAccess', _392 => _392.getConfig, 'call', _393 => _393(), 'access', _394 => _394.srcDir])
4910
+ _optionalChain([farmApp, 'optionalAccess', _404 => _404.getConfig, 'call', _405 => _405(), 'access', _406 => _406.srcDir])
4627
4911
  );
4628
- const fullManifest = {
4629
- clientEntry: "/@farm/client.js",
4630
- routes: {},
4631
- layouts: {},
4632
- slots: [],
4633
- sharedAssets: globalStylesheetHref ? [{ tag: "link", attrs: { rel: "stylesheet", href: globalStylesheetHref } }] : []
4912
+ const fullManifest = _chunk56HHUSR5cjs.createFarmDevClientManifest.call(void 0,
4913
+ routeManager.generateClientManifest(server.config.root),
4914
+ {
4915
+ sharedAssets: globalStylesheetHref ? [{ tag: "link", attrs: { rel: "stylesheet", href: globalStylesheetHref } }] : []
4916
+ }
4917
+ );
4918
+ return {
4919
+ code: `const manifest = JSON.parse(${JSON.stringify(JSON.stringify(fullManifest))});
4920
+ export const getManifest = () => manifest;
4921
+ export { manifest };
4922
+ `,
4923
+ map: { mappings: "" }
4634
4924
  };
4635
- for (const route of manifest.routes) {
4636
- fullManifest.routes[route.pattern] = {
4637
- modulePath: route.modulePath,
4638
- pattern: route.pattern,
4639
- ...route.directory ? { directory: route.directory } : {},
4640
- segments: route.segments,
4641
- search: route.search,
4642
- isClientComponent: route.isClientComponent,
4643
- shouldHydrate: route.shouldHydrate,
4644
- islandStrategy: route.islandStrategy,
4645
- renderPlan: route.renderPlan,
4646
- preloads: [route.modulePath],
4647
- // In dev, preload is just the module
4648
- assets: []
4649
- };
4650
- }
4651
- for (const layout of manifest.layouts) {
4652
- const groupScope = _chunkC5AM2XDNcjs.getRouteGroupScope.call(void 0, layout.pattern);
4653
- fullManifest.layouts[layout.pattern] = {
4654
- modulePath: layout.modulePath,
4655
- pattern: layout.pattern,
4656
- ...groupScope ? { urlPattern: _chunkC5AM2XDNcjs.stripRouteGroups.call(void 0, layout.pattern), groupScope } : {},
4657
- shouldHydrate: layout.shouldHydrate,
4658
- islandStrategy: layout.islandStrategy,
4659
- // Islands mode: rebuilt from its server tree, so its module is never preloaded.
4660
- ...layout.serverTree ? { serverTree: true } : {},
4661
- preloads: layout.serverTree ? [] : [layout.modulePath],
4662
- assets: []
4663
- };
4664
- }
4665
- for (const slot of manifest.slots) {
4666
- fullManifest.slots.push({
4667
- ...slot,
4668
- preloads: [slot.modulePath],
4669
- assets: []
4670
- });
4671
- }
4672
- return `
4673
- // Auto-generated manifest for SPA navigation (TanStack Start pattern)
4674
- // This manifest is inlined in the server bundle - no file on disk
4675
- // Client receives this via window.__FARM_MANIFEST__ in HTML
4676
- export const getManifest = () => (${JSON.stringify(fullManifest, null, 2)});
4677
- export const manifest = getManifest();
4678
- `;
4679
4925
  }
4680
4926
  },
4681
4927
  async transform(code, id, transformOptions) {
4682
- if (pendingClientSetup && !_optionalChain([transformOptions, 'optionalAccess', _395 => _395.ssr]) && !farmSetupContext.getStore()) {
4928
+ if (pendingClientSetup && !_optionalChain([transformOptions, 'optionalAccess', _407 => _407.ssr]) && !farmSetupContext.getStore()) {
4683
4929
  await pendingClientSetup;
4684
4930
  }
4685
- const runtimeModule = !isBuild && _optionalChain([transformOptions, 'optionalAccess', _396 => _396.ssr]) === true && isOutsideAppRoot(id) ? toFarmRuntimeModuleId : void 0;
4686
- const actionConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _397 => _397.getConfig, 'call', _398 => _398()]), () => ( options));
4931
+ const runtimeModule = !isBuild && _optionalChain([transformOptions, 'optionalAccess', _408 => _408.ssr]) === true && isOutsideAppRoot(id) ? toFarmRuntimeModuleId : void 0;
4932
+ const actionConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _409 => _409.getConfig, 'call', _410 => _410()]), () => ( options));
4687
4933
  let rewrotePackageImports = false;
4688
- if (_chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([actionConfig, 'access', _399 => _399.experimental, 'optionalAccess', _400 => _400.serverComponents])) === "islands" && (!id.includes("/node_modules/") || _optionalChain([transformOptions, 'optionalAccess', _401 => _401.ssr]) === true && farmReactServerFiles.has(id.split("?", 1)[0])) && !id.startsWith("\0") && /\.[cm]?[jt]sx?(?:$|\?)/.test(id) && !_chunkBE7AQXJBcjs.hasUseClientDirective.call(void 0, code)) {
4934
+ if (_chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([actionConfig, 'access', _411 => _411.experimental, 'optionalAccess', _412 => _412.serverComponents])) === "islands" && (!id.includes("/node_modules/") || _optionalChain([transformOptions, 'optionalAccess', _413 => _413.ssr]) === true && farmReactServerFiles.has(id.split("?", 1)[0])) && !id.startsWith("\0") && /\.[cm]?[jt]sx?(?:$|\?)/.test(id) && !_chunkNXGQIXR7cjs.hasUseClientDirective.call(void 0, code)) {
4689
4935
  const file = id.split("?", 1)[0];
4690
- const projectRoot = actionConfig.root || _optionalChain([server, 'optionalAccess', _402 => _402.config, 'access', _403 => _403.root]) || process.cwd();
4691
- if (_optionalChain([transformOptions, 'optionalAccess', _404 => _404.ssr]) === true) {
4692
- if (farmReactServerFiles.has(file)) {
4693
- for (const child of _chunkBE7AQXJBcjs.farmRelativeImportFiles.call(void 0, code, file))
4694
- farmReactServerFiles.add(child);
4936
+ const projectRoot = actionConfig.root || _optionalChain([server, 'optionalAccess', _414 => _414.config, 'access', _415 => _415.root]) || process.cwd();
4937
+ const buildSnapshot = isBuild ? options.sourceSnapshot : void 0;
4938
+ const rewrite = () => {
4939
+ if (_optionalChain([transformOptions, 'optionalAccess', _416 => _416.ssr]) === true) {
4940
+ if (farmReactServerFiles.has(file)) {
4941
+ for (const child of _chunkNXGQIXR7cjs.farmRelativeImportFiles.call(void 0, code, file))
4942
+ farmReactServerFiles.add(child);
4943
+ }
4944
+ const serverModule = farmReactServerFiles.has(file) || !_chunkNXGQIXR7cjs.getFarmClientReachableModules.call(void 0,
4945
+ path6.resolve(projectRoot, actionConfig.srcDir || "src"),
4946
+ projectRoot
4947
+ ).has(path6.resolve(file));
4948
+ const reactServer = !serverModule ? null : _chunkNXGQIXR7cjs.rewriteFarmReactServerImports.call(void 0, {
4949
+ code,
4950
+ file,
4951
+ reference: (specifier, exportName) => _chunkNXGQIXR7cjs.ensureFarmPackageClientReference.call(void 0, projectRoot, specifier, exportName, file),
4952
+ onServerFile: (serverFile) => farmReactServerFiles.add(serverFile)
4953
+ });
4954
+ if (reactServer !== null) {
4955
+ code = reactServer;
4956
+ rewrotePackageImports = true;
4957
+ }
4958
+ const internal = farmReactServerFiles.has(file) ? _chunkNXGQIXR7cjs.rewriteFarmReactServerClientModuleImports.call(void 0, {
4959
+ code,
4960
+ file,
4961
+ reference: (clientFile) => _chunkNXGQIXR7cjs.ensureFarmInternalClientReference.call(void 0, projectRoot, clientFile)
4962
+ }) : null;
4963
+ if (internal !== null) {
4964
+ code = internal;
4965
+ rewrotePackageImports = true;
4966
+ }
4695
4967
  }
4696
- const serverModule = farmReactServerFiles.has(file) || !_chunkBE7AQXJBcjs.getFarmClientReachableModules.call(void 0,
4697
- path6.resolve(projectRoot, actionConfig.srcDir || "src"),
4698
- projectRoot
4699
- ).has(path6.resolve(file));
4700
- const reactServer = !serverModule ? null : _chunkBE7AQXJBcjs.rewriteFarmReactServerImports.call(void 0, {
4701
- code,
4968
+ const rewritePackageImports = (source2) => _chunkNXGQIXR7cjs.rewriteFarmPackageClientImports.call(void 0, {
4969
+ code: source2,
4702
4970
  file,
4703
- reference: (specifier, exportName) => _chunkBE7AQXJBcjs.ensureFarmPackageClientReference.call(void 0, projectRoot, specifier, exportName, file),
4704
- onServerFile: (serverFile) => farmReactServerFiles.add(serverFile)
4971
+ root: projectRoot,
4972
+ isClientPackage: (specifier) => _chunkNXGQIXR7cjs.isFarmPackageClientBoundary.call(void 0, file, specifier, projectRoot)
4705
4973
  });
4706
- if (reactServer !== null) {
4707
- code = reactServer;
4974
+ const routeManager = _optionalChain([farmApp, 'optionalAccess', _417 => _417.getRouteManager, 'call', _418 => _418()]);
4975
+ const source = code;
4976
+ const referenced = routeManager ? routeManager.inspectPackages(() => rewritePackageImports(source)) : rewritePackageImports(source);
4977
+ if (referenced !== null) {
4978
+ code = referenced;
4708
4979
  rewrotePackageImports = true;
4709
4980
  }
4710
- const internal = farmReactServerFiles.has(file) ? _chunkBE7AQXJBcjs.rewriteFarmReactServerClientModuleImports.call(void 0, {
4711
- code,
4712
- file,
4713
- reference: (clientFile) => _chunkBE7AQXJBcjs.ensureFarmInternalClientReference.call(void 0, projectRoot, clientFile)
4714
- }) : null;
4715
- if (internal !== null) {
4716
- code = internal;
4717
- rewrotePackageImports = true;
4718
- }
4719
- }
4720
- const rewritePackageImports = (source2) => _chunkBE7AQXJBcjs.rewriteFarmPackageClientImports.call(void 0, {
4721
- code: source2,
4722
- file,
4723
- root: projectRoot,
4724
- isClientPackage: (specifier) => _chunkBE7AQXJBcjs.isFarmPackageClientBoundary.call(void 0, file, specifier, projectRoot)
4725
- });
4726
- const routeManager = _optionalChain([farmApp, 'optionalAccess', _405 => _405.getRouteManager, 'call', _406 => _406()]);
4727
- const source = code;
4728
- const referenced = routeManager ? routeManager.inspectPackages(() => rewritePackageImports(source)) : rewritePackageImports(source);
4729
- if (referenced !== null) {
4730
- code = referenced;
4731
- rewrotePackageImports = true;
4732
- }
4733
- if (_optionalChain([transformOptions, 'optionalAccess', _407 => _407.ssr]) === true) {
4734
- const cached = rewriteFarmReactCacheImport(
4735
- code,
4736
- file,
4737
- _optionalChain([runtimeModule, 'optionalCall', _408 => _408(FARM_REACT_CACHE_MODULE)])
4738
- );
4739
- if (cached !== null) {
4740
- code = cached;
4741
- rewrotePackageImports = true;
4981
+ if (_optionalChain([transformOptions, 'optionalAccess', _419 => _419.ssr]) === true) {
4982
+ const cached = rewriteFarmReactCacheImport(
4983
+ code,
4984
+ file,
4985
+ _optionalChain([runtimeModule, 'optionalCall', _420 => _420(FARM_REACT_CACHE_MODULE)])
4986
+ );
4987
+ if (cached !== null) {
4988
+ code = cached;
4989
+ rewrotePackageImports = true;
4990
+ }
4742
4991
  }
4743
- }
4992
+ };
4993
+ if (buildSnapshot) _chunkNXGQIXR7cjs.withFarmSourceSnapshotOf.call(void 0, buildSnapshot, rewrite);
4994
+ else rewrite();
4744
4995
  }
4745
4996
  if (islandsServerFns() && !_chunkPIUTGRDIcjs.isFarmServerFnBoundaryId.call(void 0, id) && !id.includes("/node_modules/") && /\.[cm]?[jt]sx?(?:$|\?)/.test(id)) {
4746
4997
  const serverFns = _chunkPIUTGRDIcjs.transformFarmServerFns.call(void 0, code, id, {
4747
- environment: _optionalChain([transformOptions, 'optionalAccess', _409 => _409.ssr]) === true ? "rsc" : "client"
4998
+ environment: _optionalChain([transformOptions, 'optionalAccess', _421 => _421.ssr]) === true ? "rsc" : "client"
4748
4999
  });
4749
5000
  if (serverFns) {
4750
5001
  if (!serverFns.code.includes("use server")) return { code: serverFns.code, map: null };
4751
5002
  code = serverFns.code;
4752
5003
  }
4753
5004
  }
4754
- if (_chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([actionConfig, 'access', _410 => _410.experimental, 'optionalAccess', _411 => _411.serverComponents])) === "islands" && code.includes("use server") && !id.includes("/node_modules/") && /\.[cm]?[jt]sx?(?:$|\?)/.test(id)) {
5005
+ if (_chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([actionConfig, 'access', _422 => _422.experimental, 'optionalAccess', _423 => _423.serverComponents])) === "islands" && code.includes("use server") && !id.includes("/node_modules/") && /\.[cm]?[jt]sx?(?:$|\?)/.test(id)) {
4755
5006
  const file = id.split("?", 1)[0];
4756
5007
  const actionModule = transformFarmFormActionModule({
4757
5008
  code,
4758
5009
  id,
4759
- root: actionConfig.root || _optionalChain([server, 'optionalAccess', _412 => _412.config, 'access', _413 => _413.root]) || process.cwd(),
4760
- ssr: _optionalChain([transformOptions, 'optionalAccess', _414 => _414.ssr]) === true,
5010
+ root: actionConfig.root || _optionalChain([server, 'optionalAccess', _424 => _424.config, 'access', _425 => _425.root]) || process.cwd(),
5011
+ ssr: _optionalChain([transformOptions, 'optionalAccess', _426 => _426.ssr]) === true,
4761
5012
  // Parsed by file type: page components are TSX.
4762
5013
  parse: (source) => _vite.parseSync.call(void 0, file, source).program,
4763
5014
  runtimeModule
4764
5015
  });
4765
5016
  if (actionModule) return { code: actionModule, map: null };
4766
5017
  }
4767
- if (!_optionalChain([transformOptions, 'optionalAccess', _415 => _415.ssr])) {
4768
- const docsConfigModule = _chunkSM2SYWARcjs.getFarmDocsAdapterConfigModule.call(void 0, _optionalChain([farmApp, 'optionalAccess', _416 => _416.getConfig, 'call', _417 => _417(), 'optionalAccess', _418 => _418.docs]));
4769
- if (_chunkCBLRSZQLcjs.isFarmDocsClientConfigModule.call(void 0, id, docsConfigModule)) {
4770
- const redacted = _chunkCBLRSZQLcjs.redactFarmDocsClientConfig.call(void 0, code, id.split("?")[0]);
5018
+ if (!_optionalChain([transformOptions, 'optionalAccess', _427 => _427.ssr])) {
5019
+ const docsConfigModule = _chunkSM2SYWARcjs.getFarmDocsAdapterConfigModule.call(void 0, _optionalChain([farmApp, 'optionalAccess', _428 => _428.getConfig, 'call', _429 => _429(), 'optionalAccess', _430 => _430.docs]));
5020
+ if (_chunk56HHUSR5cjs.isFarmDocsClientConfigModule.call(void 0, id, docsConfigModule)) {
5021
+ const redacted = _chunk56HHUSR5cjs.redactFarmDocsClientConfig.call(void 0, code, id.split("?")[0]);
4771
5022
  if (redacted !== null) return { code: redacted, map: null };
4772
5023
  }
4773
5024
  }
4774
- if (!_optionalChain([transformOptions, 'optionalAccess', _419 => _419.ssr])) {
4775
- const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _420 => _420.getConfig, 'call', _421 => _421()]), () => ( options));
4776
- if ((_optionalChain([currentConfig, 'access', _422 => _422.experimental, 'optionalAccess', _423 => _423.serverActions]) !== true || !serverFnTransformActive) && !islandsServerFns()) {
5025
+ if (!_optionalChain([transformOptions, 'optionalAccess', _431 => _431.ssr])) {
5026
+ const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _432 => _432.getConfig, 'call', _433 => _433()]), () => ( options));
5027
+ if ((_optionalChain([currentConfig, 'access', _434 => _434.experimental, 'optionalAccess', _435 => _435.serverActions]) !== true || !serverFnTransformActive) && !islandsServerFns()) {
4777
5028
  const violation = findClientServerFnViolation(code, id);
4778
5029
  if (violation) {
4779
- this.error(formatServerFnBoundaryError(violation, id));
5030
+ const locate = _chunkNXGQIXR7cjs.createFarmSourceLocator.call(void 0, code, () => this.getCombinedSourcemap());
5031
+ this.error(
5032
+ _chunkNXGQIXR7cjs.formatFarmDiagnostic.call(void 0,
5033
+ createServerFnBoundaryDiagnostic(violation, id, locate(violation.start)),
5034
+ currentConfig.root
5035
+ )
5036
+ );
4780
5037
  }
4781
5038
  }
4782
5039
  }
4783
- if (!_optionalChain([transformOptions, 'optionalAccess', _424 => _424.ssr]) && shouldInspectClientBoundary(id, code)) {
4784
- warnClientBoundaryOnce(this, id, code, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _425 => _425.getConfig, 'call', _426 => _426()]), () => ( options)));
5040
+ if (!_optionalChain([transformOptions, 'optionalAccess', _436 => _436.ssr]) && shouldInspectClientBoundary(id, code)) {
5041
+ await warnClientBoundaryOnce(this, id, code, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _437 => _437.getConfig, 'call', _438 => _438()]), () => ( options)));
4785
5042
  }
4786
5043
  if (typeof imageImports.transform === "function") {
4787
5044
  const imageModule = await imageImports.transform.call(this, code, id, transformOptions);
@@ -4796,13 +5053,13 @@ export const manifest = getManifest();
4796
5053
  id,
4797
5054
  transformOptions
4798
5055
  );
4799
- const fontCode = typeof fontResult === "string" ? fontResult : _optionalChain([fontResult, 'optionalAccess', _427 => _427.code, 'optionalAccess', _428 => _428.toString, 'call', _429 => _429()]);
5056
+ const fontCode = typeof fontResult === "string" ? fontResult : _optionalChain([fontResult, 'optionalAccess', _439 => _439.code, 'optionalAccess', _440 => _440.toString, 'call', _441 => _441()]);
4800
5057
  if (fontCode) {
4801
5058
  transformedCode = fontCode;
4802
5059
  transformed = true;
4803
5060
  }
4804
5061
  }
4805
- if (_optionalChain([transformOptions, 'optionalAccess', _430 => _430.ssr]) && server) {
5062
+ if (_optionalChain([transformOptions, 'optionalAccess', _442 => _442.ssr]) && server) {
4806
5063
  const rewrittenImports = rewriteEarlySsrRelativeImports({
4807
5064
  code: transformedCode,
4808
5065
  id,
@@ -4814,26 +5071,26 @@ export const manifest = getManifest();
4814
5071
  transformed = true;
4815
5072
  }
4816
5073
  }
4817
- if (_chunkBE7AQXJBcjs.hasUseClientDirective.call(void 0, transformedCode)) {
5074
+ if (_chunkNXGQIXR7cjs.hasUseClientDirective.call(void 0, transformedCode)) {
4818
5075
  const clientBoundarySource = transformedCode;
4819
5076
  const moduleInfo = this.getModuleInfo(id);
4820
5077
  if (moduleInfo) {
4821
5078
  moduleInfo.isClientComponent = true;
4822
5079
  }
4823
- transformedCode = _chunkBE7AQXJBcjs.stripUseClientDirective.call(void 0, transformedCode);
5080
+ transformedCode = _chunkNXGQIXR7cjs.stripUseClientDirective.call(void 0, transformedCode);
4824
5081
  transformed = true;
4825
- const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _431 => _431.getConfig, 'call', _432 => _432()]), () => ( options));
5082
+ const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _443 => _443.getConfig, 'call', _444 => _444()]), () => ( options));
4826
5083
  let isolatedModuleReference = null;
4827
- const root = currentConfig.root || _optionalChain([server, 'optionalAccess', _433 => _433.config, 'access', _434 => _434.root]) || process.cwd();
5084
+ const root = currentConfig.root || _optionalChain([server, 'optionalAccess', _445 => _445.config, 'access', _446 => _446.root]) || process.cwd();
4828
5085
  const cleanId = id.split("?", 1)[0];
4829
- const selectedIsolatedModules = _nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess', _435 => _435.getRouteManager, 'call', _436 => _436(), 'access', _437 => _437.getIsolatedClientBoundaryModules, 'call', _438 => _438(root)])));
4830
- const selectedForIsolatedHydration = _optionalChain([selectedIsolatedModules, 'optionalAccess', _439 => _439.has, 'call', _440 => _440(path6.resolve(cleanId))]) === true;
4831
- if (_chunk67MZTLTFcjs.isReactRenderer.call(void 0, _chunk67MZTLTFcjs.resolveFarmRenderer.call(void 0, currentConfig.renderer)) && selectedForIsolatedHydration && (_chunkBE7AQXJBcjs.isIsolatableClientBoundarySource.call(void 0, clientBoundarySource) || // A generated client reference, whose marker comment compiled TSX no longer has.
4832
- cleanId.replace(/\\/g, "/").includes(_chunkBE7AQXJBcjs.FARM_CLIENT_REFERENCE_DIRECTORY))) {
5086
+ const selectedIsolatedModules = _nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess', _447 => _447.getRouteManager, 'call', _448 => _448(), 'access', _449 => _449.getIsolatedClientBoundaryModules, 'call', _450 => _450(root)])));
5087
+ const selectedForIsolatedHydration = _optionalChain([selectedIsolatedModules, 'optionalAccess', _451 => _451.has, 'call', _452 => _452(path6.resolve(cleanId))]) === true;
5088
+ if (_chunk67MZTLTFcjs.isReactRenderer.call(void 0, _chunk67MZTLTFcjs.resolveFarmRenderer.call(void 0, currentConfig.renderer)) && selectedForIsolatedHydration && (_chunkNXGQIXR7cjs.isIsolatableClientBoundarySource.call(void 0, clientBoundarySource) || // A generated client reference, whose marker comment compiled TSX no longer has.
5089
+ cleanId.replace(/\\/g, "/").includes(_chunkNXGQIXR7cjs.FARM_CLIENT_REFERENCE_DIRECTORY))) {
4833
5090
  isolatedModuleReference = _chunkQMNWKQL4cjs.toViteModuleId.call(void 0, cleanId, root);
4834
- const islandsMode = _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([currentConfig, 'access', _441 => _441.experimental, 'optionalAccess', _442 => _442.serverComponents])) === "islands";
4835
- const explicitStrategy = _chunkBE7AQXJBcjs.getIslandStrategyExport.call(void 0, clientBoundarySource);
4836
- const inference = islandsMode && explicitStrategy === null ? _chunkCBLRSZQLcjs.inferFarmIslandStrategy.call(void 0, cleanId, root) : null;
5091
+ const islandsMode = _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([currentConfig, 'access', _453 => _453.experimental, 'optionalAccess', _454 => _454.serverComponents])) === "islands";
5092
+ const explicitStrategy = _chunkNXGQIXR7cjs.getIslandStrategyExport.call(void 0, clientBoundarySource);
5093
+ const inference = islandsMode && explicitStrategy === null ? _chunk56HHUSR5cjs.inferFarmIslandStrategy.call(void 0, cleanId, root) : null;
4837
5094
  if (inference) {
4838
5095
  for (const file of inference.files) {
4839
5096
  if (file !== path6.resolve(cleanId)) this.addWatchFile(file);
@@ -4846,8 +5103,8 @@ export const manifest = getManifest();
4846
5103
  islandStrategy: _nullishCoalesce(explicitStrategy, () => ( "load")),
4847
5104
  parse: (source) => this.parse(source),
4848
5105
  slots: islandsMode,
4849
- browser: _optionalChain([transformOptions, 'optionalAccess', _443 => _443.ssr]) !== true,
4850
- inferredInteraction: _optionalChain([inference, 'optionalAccess', _444 => _444.strategy]) === "interaction",
5106
+ browser: _optionalChain([transformOptions, 'optionalAccess', _455 => _455.ssr]) !== true,
5107
+ inferredInteraction: _optionalChain([inference, 'optionalAccess', _456 => _456.strategy]) === "interaction",
4851
5108
  runtimeModule
4852
5109
  });
4853
5110
  if (!transformedBoundary) {
@@ -4878,7 +5135,7 @@ export const manifest = getManifest();
4878
5135
  );
4879
5136
  return;
4880
5137
  }` : "";
4881
- const hmrCode = _optionalChain([transformOptions, 'optionalAccess', _445 => _445.ssr]) || reactRefreshActive || !shouldEmitFarmClientRootHmr(currentConfig.renderer) ? "" : `
5138
+ const hmrCode = _optionalChain([transformOptions, 'optionalAccess', _457 => _457.ssr]) || reactRefreshActive || !shouldEmitFarmClientRootHmr(currentConfig.renderer) ? "" : `
4882
5139
  if (import.meta.hot) {
4883
5140
  import.meta.hot.accept((newModule) => {
4884
5141
  ${isolatedHmrUpdate}
@@ -4934,14 +5191,14 @@ if (import.meta.hot) {
4934
5191
  }
4935
5192
  _chunkQMNWKQL4cjs.logger.info(`Found ${ssgPages.length} SSG pages, ${ssrRoutes.length} SSR routes`);
4936
5193
  _chunkQMNWKQL4cjs.logger.info("Pre-rendering SSG pages...");
4937
- const outDir = path6.join(_optionalChain([server, 'optionalAccess', _446 => _446.config, 'access', _447 => _447.root]) || process.cwd(), options.outDir || "dist");
5194
+ const outDir = path6.join(_optionalChain([server, 'optionalAccess', _458 => _458.config, 'access', _459 => _459.root]) || process.cwd(), options.outDir || "dist");
4938
5195
  const clientDir = path6.join(outDir, "client");
4939
5196
  for (const page of ssgPages) {
4940
5197
  try {
4941
5198
  const staticRequest = new Request(new URL(page.urlPath, "http://farm.static"));
4942
5199
  await farmApp.getServerRenderer().runWithRequestContext(staticRequest, async () => {
4943
5200
  const mod = await routeManager.loadRouteModule(page.filePath);
4944
- if (!_optionalChain([mod, 'optionalAccess', _448 => _448.default])) return;
5201
+ if (!_optionalChain([mod, 'optionalAccess', _460 => _460.default])) return;
4945
5202
  const { layouts } = routeManager.matchRoute(page.urlPath);
4946
5203
  const layoutModules = await Promise.all(
4947
5204
  layouts.map((l) => routeManager.loadLayoutModule(l.modulePath))
@@ -4973,7 +5230,7 @@ if (import.meta.hot) {
4973
5230
  const i18nSnapshot = _chunkNLBK37HIcjs.getFarmI18nClientSnapshot.call(void 0, );
4974
5231
  const i18nHead = renderFarmI18nStaticHead(page.urlPath, i18nSnapshot);
4975
5232
  const fullHtml = `<!DOCTYPE html>
4976
- <html lang="${escapeFarmHtmlAttribute(_optionalChain([i18nSnapshot, 'optionalAccess', _449 => _449.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}>
5233
+ <html lang="${escapeFarmHtmlAttribute(_optionalChain([i18nSnapshot, 'optionalAccess', _461 => _461.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}>
4977
5234
  <head>
4978
5235
  <meta charset="utf-8">
4979
5236
  <meta name="viewport" content="width=device-width, initial-scale=1">
@@ -5018,12 +5275,12 @@ if (import.meta.hot) {
5018
5275
  watchChange(id, change) {
5019
5276
  const watched = _chunkQMNWKQL4cjs.toPosixPath.call(void 0, id);
5020
5277
  if (!watched.includes("/node_modules/") && !isFarmGeneratedOutput(watched)) {
5021
- _optionalChain([farmApp, 'optionalAccess', _450 => _450.getRouteManager, 'call', _451 => _451(), 'access', _452 => _452.noteSourceChange, 'call', _453 => _453(id, change.event)]);
5278
+ _optionalChain([farmApp, 'optionalAccess', _462 => _462.getRouteManager, 'call', _463 => _463(), 'access', _464 => _464.noteSourceChange, 'call', _465 => _465(id, change.event)]);
5022
5279
  }
5023
- _chunkBE7AQXJBcjs.invalidateFarmClientReachableModules.call(void 0, );
5024
- _chunkBE7AQXJBcjs.invalidateFarmClientOnlyScan.call(void 0, );
5025
- _chunkCBLRSZQLcjs.invalidateFarmRouteRootInferences.call(void 0, );
5026
- _chunkBE7AQXJBcjs.dropLatestPackageClientBoundaryCache.call(void 0, );
5280
+ _chunkNXGQIXR7cjs.invalidateFarmClientReachableModules.call(void 0, );
5281
+ _chunkNXGQIXR7cjs.invalidateFarmClientOnlyScan.call(void 0, );
5282
+ _chunk56HHUSR5cjs.invalidateFarmRouteRootInferences.call(void 0, );
5283
+ _chunkNXGQIXR7cjs.dropLatestPackageClientBoundaryCache.call(void 0, );
5027
5284
  },
5028
5285
  async handleHotUpdate(ctx) {
5029
5286
  if (pendingClientSetup && !farmSetupContext.getStore()) await pendingClientSetup;
@@ -5048,13 +5305,13 @@ if (import.meta.hot) {
5048
5305
  server2.moduleGraph.invalidateModule(mod);
5049
5306
  }
5050
5307
  }
5051
- const currentFarmConfig = _optionalChain([farmApp, 'optionalAccess', _454 => _454.getConfig, 'call', _455 => _455()]);
5308
+ const currentFarmConfig = _optionalChain([farmApp, 'optionalAccess', _466 => _466.getConfig, 'call', _467 => _467()]);
5052
5309
  const normalizedFile = file.replace(/\\/g, "/");
5053
5310
  if (currentFarmConfig && /\/route\.(?:ts|tsx|js|jsx)$/.test(normalizedFile) && _chunkMTBDJ326cjs.getFarmAppDirectories.call(void 0, currentFarmConfig).some(
5054
5311
  (appDir) => normalizedFile.startsWith(`${_chunkQMNWKQL4cjs.toPosixPath.call(void 0, appDir)}/api/`)
5055
5312
  )) {
5056
5313
  for (const mod of modules) server2.moduleGraph.invalidateModule(mod);
5057
- await _optionalChain([refreshRouteDiscovery, 'optionalCall', _456 => _456(`updated ${file}`)]);
5314
+ await _optionalChain([refreshRouteDiscovery, 'optionalCall', _468 => _468(`updated ${file}`)]);
5058
5315
  server2.ws.send({ type: "full-reload", path: "*" });
5059
5316
  return [];
5060
5317
  }
@@ -5064,7 +5321,7 @@ if (import.meta.hot) {
5064
5321
  for (const mod of modules) {
5065
5322
  server2.moduleGraph.invalidateModule(mod);
5066
5323
  }
5067
- await _optionalChain([refreshRouteDiscovery, 'optionalCall', _457 => _457(`updated ${file}`)]);
5324
+ await _optionalChain([refreshRouteDiscovery, 'optionalCall', _469 => _469(`updated ${file}`)]);
5068
5325
  server2.ws.send({
5069
5326
  type: "full-reload",
5070
5327
  path: "*"
@@ -5077,7 +5334,7 @@ if (import.meta.hot) {
5077
5334
  for (const mod of modules) {
5078
5335
  server2.moduleGraph.invalidateModule(mod);
5079
5336
  }
5080
- await _optionalChain([refreshRouteDiscovery, 'optionalCall', _458 => _458(`updated ${file}`)]);
5337
+ await _optionalChain([refreshRouteDiscovery, 'optionalCall', _470 => _470(`updated ${file}`)]);
5081
5338
  server2.ws.send({
5082
5339
  type: "full-reload",
5083
5340
  path: "*"
@@ -5085,16 +5342,16 @@ if (import.meta.hot) {
5085
5342
  return [];
5086
5343
  }
5087
5344
  if (apiRouteManager && _chunkJYNNIGQOcjs.invalidateFarmDevDependents.call(void 0, server2, file, apiRouteManager.getSourceFiles()).length > 0) {
5088
- await _optionalChain([refreshRouteDiscovery, 'optionalCall', _459 => _459(`updated ${file}`)]);
5345
+ await _optionalChain([refreshRouteDiscovery, 'optionalCall', _471 => _471(`updated ${file}`)]);
5089
5346
  }
5090
- const isolatedHydrationMode = _optionalChain([currentFarmConfig, 'optionalAccess', _460 => _460.experimental, 'optionalAccess', _461 => _461.isolatedClientHydration]);
5091
- const planRouteManager = _optionalChain([farmApp, 'optionalAccess', _462 => _462.getRouteManager, 'call', _463 => _463()]);
5347
+ const isolatedHydrationMode = _optionalChain([currentFarmConfig, 'optionalAccess', _472 => _472.experimental, 'optionalAccess', _473 => _473.isolatedClientHydration]);
5348
+ const planRouteManager = _optionalChain([farmApp, 'optionalAccess', _474 => _474.getRouteManager, 'call', _475 => _475()]);
5092
5349
  const isHydrationPlanSource = /\.[cm]?[jt]sx?$/.test(normalizedFile) && !normalizedFile.includes("/node_modules/") && !isFarmGeneratedOutput(normalizedFile);
5093
- const tracksAsyncOwnerIslands = _chunk67MZTLTFcjs.isReactRenderer.call(void 0, _optionalChain([currentFarmConfig, 'optionalAccess', _464 => _464.renderer])) && planRouteManager !== void 0;
5350
+ const tracksAsyncOwnerIslands = _chunk67MZTLTFcjs.isReactRenderer.call(void 0, _optionalChain([currentFarmConfig, 'optionalAccess', _476 => _476.renderer])) && planRouteManager !== void 0;
5094
5351
  let clientPlanCurrent = false;
5095
5352
  if (isHydrationPlanSource && (isolatedHydrationMode === "enabled" || isolatedHydrationMode === "analyze" || tracksAsyncOwnerIslands)) {
5096
5353
  const routeManager = planRouteManager;
5097
- if (_optionalChain([routeManager, 'optionalAccess', _465 => _465.isEditPlanNeutral, 'call', _466 => _466(file)])) {
5354
+ if (_optionalChain([routeManager, 'optionalAccess', _477 => _477.isEditPlanNeutral, 'call', _478 => _478(file)])) {
5098
5355
  clientPlanCurrent = true;
5099
5356
  } else if (routeManager) {
5100
5357
  routeManager.noteSourceChange(file, "update");
@@ -5155,7 +5412,7 @@ if (import.meta.hot) {
5155
5412
  }
5156
5413
  return [];
5157
5414
  }
5158
- if (!clientPlanCurrent) _optionalChain([farmApp, 'optionalAccess', _467 => _467.getRouteManager, 'call', _468 => _468(), 'access', _469 => _469.invalidateClientManifest, 'call', _470 => _470()]);
5415
+ if (!clientPlanCurrent) _optionalChain([farmApp, 'optionalAccess', _479 => _479.getRouteManager, 'call', _480 => _480(), 'access', _481 => _481.invalidateClientManifest, 'call', _482 => _482()]);
5159
5416
  const manifestModule = server2.moduleGraph.getModuleById("/@farm/manifest");
5160
5417
  if (manifestModule) {
5161
5418
  server2.moduleGraph.invalidateModule(manifestModule);
@@ -5173,7 +5430,7 @@ if (import.meta.hot) {
5173
5430
  return [];
5174
5431
  }
5175
5432
  }
5176
- if (/\.[cm]?[jt]sx?$/.test(normalizedFile) && !_optionalChain([server2, 'access', _471 => _471.environments, 'access', _472 => _472.client, 'optionalAccess', _473 => _473.moduleGraph, 'access', _474 => _474.getModulesByFile, 'call', _475 => _475(normalizedFile), 'optionalAccess', _476 => _476.size]) && _chunkJYNNIGQOcjs.invalidateFarmDevDependents.call(void 0, server2, file, getFarmRenderedServerModules()).length > 0) {
5433
+ if (/\.[cm]?[jt]sx?$/.test(normalizedFile) && !_optionalChain([server2, 'access', _483 => _483.environments, 'access', _484 => _484.client, 'optionalAccess', _485 => _485.moduleGraph, 'access', _486 => _486.getModulesByFile, 'call', _487 => _487(normalizedFile), 'optionalAccess', _488 => _488.size]) && _chunkJYNNIGQOcjs.invalidateFarmDevDependents.call(void 0, server2, file, getFarmRenderedServerModules()).length > 0) {
5177
5434
  logUpdate("PAGE", `updated ${path6.basename(file)}`);
5178
5435
  server2.ws.send({ type: "full-reload", path: "*" });
5179
5436
  return [];
@@ -5271,7 +5528,7 @@ function createPageDataMiddlewareResponse(res) {
5271
5528
  return (...args) => {
5272
5529
  if (captures(target.statusCode, target.getHeader("location"))) {
5273
5530
  const callback = args.find((arg) => typeof arg === "function");
5274
- _optionalChain([callback, 'optionalCall', _477 => _477()]);
5531
+ _optionalChain([callback, 'optionalCall', _489 => _489()]);
5275
5532
  return property === "write" ? true : response;
5276
5533
  }
5277
5534
  return target[property](...args);
@@ -5335,12 +5592,12 @@ function isFarmClientVirtualId(id) {
5335
5592
  }
5336
5593
  function isClientEnvironment(context, loadOptions) {
5337
5594
  const environment = context.environment;
5338
- if (_optionalChain([environment, 'optionalAccess', _478 => _478.config, 'optionalAccess', _479 => _479.consumer])) return environment.config.consumer === "client";
5339
- if (_optionalChain([environment, 'optionalAccess', _480 => _480.name])) return environment.name === "client";
5340
- return _optionalChain([loadOptions, 'optionalAccess', _481 => _481.ssr]) !== true;
5595
+ if (_optionalChain([environment, 'optionalAccess', _490 => _490.config, 'optionalAccess', _491 => _491.consumer])) return environment.config.consumer === "client";
5596
+ if (_optionalChain([environment, 'optionalAccess', _492 => _492.name])) return environment.name === "client";
5597
+ return _optionalChain([loadOptions, 'optionalAccess', _493 => _493.ssr]) !== true;
5341
5598
  }
5342
5599
  function invalidateProgrammaticClientRouteModules(server) {
5343
- const graph = _optionalChain([server, 'access', _482 => _482.environments, 'optionalAccess', _483 => _483.client, 'optionalAccess', _484 => _484.moduleGraph]);
5600
+ const graph = _optionalChain([server, 'access', _494 => _494.environments, 'optionalAccess', _495 => _495.client, 'optionalAccess', _496 => _496.moduleGraph]);
5344
5601
  if (!graph) return;
5345
5602
  for (const [id, module] of graph.idToModuleMap) {
5346
5603
  if (_chunkE7QOEV5Zcjs.parseProgrammaticRouteModuleId.call(void 0, id)) graph.invalidateModule(module);
@@ -5350,19 +5607,19 @@ function generateProgrammaticClientRouteModuleForId(moduleId, root, renderer, cl
5350
5607
  const parsed = _chunkE7QOEV5Zcjs.parseProgrammaticRouteModuleId.call(void 0, moduleId);
5351
5608
  const routesFile = resolveRealModuleFile(parsed.filePath, root);
5352
5609
  watchFile(routesFile);
5353
- return _chunkBE7AQXJBcjs.generateProgrammaticClientRouteModule.call(void 0, {
5610
+ return _chunkNXGQIXR7cjs.generateProgrammaticClientRouteModule.call(void 0, {
5354
5611
  kind: parsed.kind,
5355
5612
  routePath: parsed.routePath,
5356
5613
  routesFile,
5357
- route: parsed.kind === "api" ? void 0 : _optionalChain([clientRoutes, 'optionalAccess', _485 => _485.routes, 'access', _486 => _486.get, 'call', _487 => _487(
5358
- _chunkBE7AQXJBcjs.programmaticClientRouteKey.call(void 0, routesFile, parsed.kind, parsed.routePath)
5614
+ route: parsed.kind === "api" ? void 0 : _optionalChain([clientRoutes, 'optionalAccess', _497 => _497.routes, 'access', _498 => _498.get, 'call', _499 => _499(
5615
+ _chunkNXGQIXR7cjs.programmaticClientRouteKey.call(void 0, routesFile, parsed.kind, parsed.routePath)
5359
5616
  )]),
5360
5617
  rendererServer: renderer.server,
5361
5618
  toImportSpecifier: (file) => toProgrammaticRouteImportSpecifier(file, root)
5362
5619
  });
5363
5620
  }
5364
5621
  function resolveRealModuleFile(filePath, root) {
5365
- const resolved = _nullishCoalesce(_chunkBE7AQXJBcjs.resolveModuleSourcePath.call(void 0, filePath, root), () => ( filePath));
5622
+ const resolved = _nullishCoalesce(_chunkNXGQIXR7cjs.resolveModuleSourcePath.call(void 0, filePath, root), () => ( filePath));
5366
5623
  try {
5367
5624
  return _chunkQMNWKQL4cjs.toPosixPath.call(void 0, fs2.realpathSync(resolved));
5368
5625
  } catch (e28) {
@@ -5676,12 +5933,12 @@ async function parseRouteModuleProps(routeModule, input) {
5676
5933
  }
5677
5934
  const schemas = routeModule.__farmRouteSchemas;
5678
5935
  const params = parseRouteModuleSchema(
5679
- _optionalChain([schemas, 'optionalAccess', _488 => _488.params]),
5936
+ _optionalChain([schemas, 'optionalAccess', _500 => _500.params]),
5680
5937
  input.props.params,
5681
5938
  "params",
5682
5939
  input.routePath
5683
5940
  );
5684
- const search = parseRouteModuleSchema(_optionalChain([schemas, 'optionalAccess', _489 => _489.search]), input.search, "search", input.routePath);
5941
+ const search = parseRouteModuleSchema(_optionalChain([schemas, 'optionalAccess', _501 => _501.search]), input.search, "search", input.routePath);
5685
5942
  return {
5686
5943
  ...input.props,
5687
5944
  params,
@@ -5701,12 +5958,12 @@ function parseRouteModuleSchema(schema, value, label, routePath) {
5701
5958
  }
5702
5959
  }
5703
5960
  function generateClientCode(integrationProviders = [], documentNavigationMatchers = [], docsSearchClientRuntime = EMPTY_FARM_DOCS_SEARCH_CLIENT_RUNTIME, devtoolsClientRuntime = "", plugins = [], root = process.cwd(), srcDir = "src", publicRuntimeConfig = void 0, docsAdapterReact, renderer = _chunk67MZTLTFcjs.REACT_RENDERER, isolatedHydrationEnabled = false, trailingSlash = false, basePath = "/", clientCachePersistence = { imports: "", init: "" }, docsConfigModule, islandValues = false) {
5704
- const providerClientCode = _chunkCBLRSZQLcjs.generateFarmIntegrationProviderClientCode.call(void 0,
5961
+ const providerClientCode = _chunk56HHUSR5cjs.generateFarmIntegrationProviderClientCode.call(void 0,
5705
5962
  integrationProviders,
5706
5963
  root,
5707
5964
  _nullishCoalesce(renderer.componentExtensions, () => ( []))
5708
5965
  );
5709
- const clientPluginEntry = _chunkDMXMIE2Ccjs.generateFarmClientPluginEntryCode.call(void 0,
5966
+ const clientPluginEntry = _chunkENYBDM4Ucjs.generateFarmClientPluginEntryCode.call(void 0,
5710
5967
  plugins,
5711
5968
  root,
5712
5969
  srcDir,
@@ -5755,7 +6012,7 @@ async function createFarmServerTreePageElement(source, pathname) {
5755
6012
  return null;
5756
6013
  }
5757
6014
  }
5758
- ${islandValues ? `${_chunkCBLRSZQLcjs.FARM_SERVER_TREE_LAYOUT_CLIENT_SOURCE}
6015
+ ${islandValues ? `${_chunk56HHUSR5cjs.FARM_SERVER_TREE_LAYOUT_CLIENT_SOURCE}
5759
6016
  let farmLastRouteState = null;
5760
6017
 
5761
6018
  // A hot update to a layout tree's client module renders the route again.
@@ -5775,7 +6032,7 @@ ${isolatedHydrationImport}
5775
6032
  import { installChunkErrorRecovery, SPARouter } from '@farm.js/core/client'
5776
6033
  import { createClientPluginManager } from '@farm.js/core/plugin/client'
5777
6034
  import { isFarmRouteActive } from '@farm.js/core/router'
5778
- import { isFarmBlockedNavigationURL, replayFarmQueuedInteraction, scheduleFarmIslandHydration, createFarmSearchParams, searchParamsToObject, setFarmBasePath, setFarmTrailingSlashPreference, stripFarmBasePath } from '@farm.js/core/internal/client-runtime'
6035
+ import { installFarmLinkPrefetch, isFarmBlockedNavigationURL, replayFarmQueuedInteraction, scheduleFarmIslandHydration, createFarmSearchParams, searchParamsToObject, setFarmBasePath, setFarmTrailingSlashPreference, stripFarmBasePath } from '@farm.js/core/internal/client-runtime'
5779
6036
  import { reviveDeferredData } from '@farm.js/core/deferred'
5780
6037
  import {
5781
6038
  createFarmDeploymentMismatchError,
@@ -5846,6 +6103,35 @@ function wrapFarmClientRouteGraph(element) {
5846
6103
  // Fallback to empty manifest if not available yet
5847
6104
  const getManifest = () => window.__FARM_MANIFEST__ || { routes: {}, layouts: {}, slots: [], clientEntry: '', sharedAssets: [] };
5848
6105
 
6106
+ // A document inlines only the entries its page boots with and names the module that has the
6107
+ // whole manifest (manifest.module), as production keeps its route table out of the HTML. Code
6108
+ // that matches another route awaits this first; it imports the module once. A failed import
6109
+ // keeps the inlined entries, so the router treats other routes as it treats an unknown one.
6110
+ let farmManifestLoad = null;
6111
+ function ensureFarmManifest() {
6112
+ const inlined = window.__FARM_MANIFEST__;
6113
+ if (!inlined || typeof inlined.module !== 'string') return Promise.resolve();
6114
+ if (!farmManifestLoad) {
6115
+ farmManifestLoad = import(/* @vite-ignore */ new URL(inlined.module, location.origin).href)
6116
+ .then((loaded) => {
6117
+ const manifest = loaded.getManifest();
6118
+ if (window.__FARM_MANIFEST__ !== inlined) return;
6119
+ const { module: _module, ...boot } = inlined;
6120
+ window.__FARM_MANIFEST__ = {
6121
+ ...boot,
6122
+ routes: manifest.routes,
6123
+ layouts: manifest.layouts,
6124
+ slots: manifest.slots,
6125
+ };
6126
+ })
6127
+ .catch((error) => {
6128
+ farmManifestLoad = null;
6129
+ console.warn('[Farm.js] Could not load the route manifest: ' + inlined.module, error);
6130
+ });
6131
+ }
6132
+ return farmManifestLoad;
6133
+ }
6134
+
5849
6135
  // ====== CLIENT-SIDE ROUTE MATCHING ======
5850
6136
  // Matches URL to route using manifest (no server request!)
5851
6137
 
@@ -6566,7 +6852,7 @@ async function loadLayoutComponents(layouts = [], params = {}, source) {
6566
6852
  return loadedLayouts;
6567
6853
  }
6568
6854
 
6569
- ${_chunkCBLRSZQLcjs.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE}
6855
+ ${_chunk56HHUSR5cjs.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE}
6570
6856
  function wrapWithLoadedLayouts(element, loadedLayouts, params) {
6571
6857
  let wrapped = element;
6572
6858
  for (let index = loadedLayouts.length - 1; index >= 0; index--) {
@@ -6851,7 +7137,7 @@ function readActiveLayoutPatterns() {
6851
7137
  .filter(Boolean);
6852
7138
  }
6853
7139
 
6854
- ${_chunkCBLRSZQLcjs.FARM_NAVIGATION_SCRIPT_SOURCE}
7140
+ ${_chunk56HHUSR5cjs.FARM_NAVIGATION_SCRIPT_SOURCE}
6855
7141
 
6856
7142
  function activateFragmentScripts(root) {
6857
7143
  for (const script of Array.from(root.querySelectorAll?.('script') || [])) {
@@ -6910,7 +7196,7 @@ function getLayoutShell(root, patterns, index, find) {
6910
7196
  return shell.innerHTML;
6911
7197
  }
6912
7198
 
6913
- ${islandValues ? _chunkCBLRSZQLcjs.FARM_REFRESH_FIELDS_SOURCE : ""}function replaceNavigationBoundary(
7199
+ ${islandValues ? _chunk56HHUSR5cjs.FARM_REFRESH_FIELDS_SOURCE : ""}function replaceNavigationBoundary(
6914
7200
  container,
6915
7201
  fragment,
6916
7202
  currentPatterns,
@@ -6983,7 +7269,7 @@ ${islandValues ? `
6983
7269
  return nextTarget;
6984
7270
  }
6985
7271
 
6986
- ${islandValues ? `${_chunkCBLRSZQLcjs.FARM_NAVIGATION_STREAM_READER_SOURCE}
7272
+ ${islandValues ? `${_chunk56HHUSR5cjs.FARM_NAVIGATION_STREAM_READER_SOURCE}
6987
7273
 
6988
7274
  // Islands mode navigates as the production client does: it fetches the page itself, names the
6989
7275
  // layouts it shows by key (F-Layouts), and asks for flush markers (F-Stream), so the shell arrives
@@ -7044,6 +7330,7 @@ async function fetchFarmNavigationDocument(path, context) {
7044
7330
  // A prefetch reads the page whole for the router's cache, and leaves a page that streams alone.
7045
7331
  if (!context.prefetch) farmNavigationStreamGeneration++;
7046
7332
  const url = new URL(path, window.location.href);
7333
+ await ensureFarmManifest();
7047
7334
  const match = farmDocumentNavigationRoute(url.pathname);
7048
7335
  const container = document.getElementById('root');
7049
7336
  if (!match || !container) return null;
@@ -7190,6 +7477,9 @@ async function renderPage(pageData, info) {
7190
7477
  return;
7191
7478
  }
7192
7479
 
7480
+ // Page data carries the route's render plan, which the manifest entry only backs up. Islands
7481
+ // mode also reads which layouts render as server trees (loadLayoutComponents).
7482
+ if (${islandValues ? "true" : "!pageData.renderPlan"}) await ensureFarmManifest();
7193
7483
  const manifestRoute = findRoute(window.location.pathname)?.route;
7194
7484
  const renderPlan = pageData.renderPlan || manifestRoute?.renderPlan;
7195
7485
  const hydrationMode = renderPlan?.hydration;
@@ -7648,6 +7938,9 @@ document.addEventListener('click', function(event) {
7648
7938
  spaRouter.navigate(href, { replace, scroll, viewTransition });
7649
7939
  });
7650
7940
 
7941
+ // Link anchors on a page that does not hydrate prefetch through the router as Link would.
7942
+ installFarmLinkPrefetch();
7943
+
7651
7944
  if (import.meta.hot) {
7652
7945
  import.meta.hot.on('vite:beforeUpdate', () => {
7653
7946
  // Clear module cache on HMR to pick up changes
@@ -7678,9 +7971,9 @@ function generateClientManifest(bundle) {
7678
7971
  return manifest;
7679
7972
  }
7680
7973
  async function defineConfig(config = {}) {
7681
- const tailwindVitePlugin = await _chunkDMXMIE2Ccjs.loadTailwindVitePlugin.call(void 0, );
7974
+ const tailwindVitePlugin = await _chunkENYBDM4Ucjs.loadTailwindVitePlugin.call(void 0, );
7682
7975
  const appRoot = path6.resolve(config.root || process.cwd());
7683
- if (_optionalChain([config, 'access', _490 => _490.extends, 'optionalAccess', _491 => _491.length])) {
7976
+ if (_optionalChain([config, 'access', _502 => _502.extends, 'optionalAccess', _503 => _503.length])) {
7684
7977
  const { config: layeredConfig } = await import("./layers-7P4RLKVX.cjs").then(
7685
7978
  ({ resolveFarmLayers }) => resolveFarmLayers(config, {
7686
7979
  root: appRoot,
@@ -7690,7 +7983,7 @@ async function defineConfig(config = {}) {
7690
7983
  config = layeredConfig;
7691
7984
  }
7692
7985
  config.renderer = _chunk67MZTLTFcjs.resolveFarmRenderer.call(void 0, config.renderer);
7693
- config.images = _chunkCBLRSZQLcjs.resolveFarmImageProviderForRuntime.call(void 0, config.images, { root: appRoot, dev: true });
7986
+ config.images = _chunk56HHUSR5cjs.resolveFarmImageProviderForRuntime.call(void 0, config.images, { root: appRoot, dev: true });
7694
7987
  const rendererVitePlugins = await _chunk67MZTLTFcjs.loadFarmRendererVitePlugins.call(void 0, config.renderer, appRoot, {
7695
7988
  ssr: true
7696
7989
  });
@@ -7782,13 +8075,13 @@ async function defineConfig(config = {}) {
7782
8075
  if (!serverStarted) {
7783
8076
  serverStarted = true;
7784
8077
  const elapsed = Date.now() - startTime;
7785
- const address = _optionalChain([server, 'access', _492 => _492.httpServer, 'optionalAccess', _493 => _493.address, 'call', _494 => _494()]);
8078
+ const address = _optionalChain([server, 'access', _504 => _504.httpServer, 'optionalAccess', _505 => _505.address, 'call', _506 => _506()]);
7786
8079
  const resolvedPort = typeof address === "object" && address ? address.port : server.config.server.port || port || 3e3;
7787
8080
  const hostConfig = server.config.server.host;
7788
8081
  const isExposed = hostConfig === true || hostConfig === "0.0.0.0";
7789
8082
  console.log("");
7790
8083
  console.log(
7791
- ` ${pc.bold(pc.green("Farm.js"))} ${pc.dim(`v${_chunkZDZUFD67cjs.FARM_VERSION}`)} ${pc.dim(`ready in ${elapsed}ms`)}`
8084
+ ` ${pc.bold(pc.green("Farm.js"))} ${pc.dim(`v${_chunkRSL3YFJGcjs.FARM_VERSION}`)} ${pc.dim(`ready in ${elapsed}ms`)}`
7792
8085
  );
7793
8086
  console.log("");
7794
8087
  console.log(
@@ -7822,22 +8115,23 @@ async function defineConfig(config = {}) {
7822
8115
  plugins: [
7823
8116
  // `farm dev --desktop`: only the desktop window gets an answer, as in the packaged app.
7824
8117
  _chunk3QM74STYcjs.farmDesktopDevGuardPlugin.call(void 0, config.basePath),
7825
- _chunkCBLRSZQLcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
8118
+ _chunk56HHUSR5cjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
7826
8119
  tailwindVitePlugin,
7827
8120
  ...rendererVitePlugins,
7828
8121
  ...reactRefreshPlugins,
7829
8122
  viteBrowserExternalPlugin,
7830
8123
  farmI18nClientBridgePlugin(),
7831
8124
  farmServerOnlyEntriesPlugin(),
8125
+ farmIslandContainersPlugin(config),
7832
8126
  farmPlugin(config),
7833
- _chunkBE7AQXJBcjs.farmEnvironmentFunctionsPlugin.call(void 0, config),
8127
+ _chunkNXGQIXR7cjs.farmEnvironmentFunctionsPlugin.call(void 0, config),
7834
8128
  farmBrandingPlugin
7835
8129
  ],
7836
8130
  customLogger: farmLogger,
7837
8131
  clearScreen: false,
7838
8132
  optimizeDeps: {
7839
- ..._chunkCBLRSZQLcjs.createFarmClientOptimizeDepsConfig.call(void 0,
7840
- _chunkCBLRSZQLcjs.createFarmClientOptimizeDepsEntries.call(void 0,
8133
+ ..._chunk56HHUSR5cjs.createFarmClientOptimizeDepsConfig.call(void 0,
8134
+ _chunk56HHUSR5cjs.createFarmClientOptimizeDepsEntries.call(void 0,
7841
8135
  appRoot,
7842
8136
  _chunkMTBDJ326cjs.getFarmAppDirectories.call(void 0, { ...config, root: appRoot })
7843
8137
  ),
@@ -7880,7 +8174,7 @@ async function defineConfig(config = {}) {
7880
8174
  // Stub out problematic server-only modules during dev mode
7881
8175
  alias: {
7882
8176
  ..._chunkMTBDJ326cjs.getFarmLayerAliases.call(void 0, config.layers),
7883
- ..._chunkCBLRSZQLcjs.createFarmSourceAlias.call(void 0, appRoot, config.srcDir),
8177
+ ..._chunk56HHUSR5cjs.createFarmSourceAlias.call(void 0, appRoot, config.srcDir),
7884
8178
  // Nitro internals that should not be resolved in browser
7885
8179
  "supports-color": "data:text/javascript,export default false; export const supportsColor = false; export const stdout = false; export const stderr = false;",
7886
8180
  "@poppinss/dumper": "data:text/javascript,export default {};",
@@ -7911,4 +8205,5 @@ async function defineConfig(config = {}) {
7911
8205
 
7912
8206
 
7913
8207
 
7914
- exports.isViteModuleRequest = isViteModuleRequest; exports.isViteDevClientRequest = isViteDevClientRequest; exports.farmImageImportsPlugin = farmImageImportsPlugin; exports.farmI18nClientBridgePlugin = farmI18nClientBridgePlugin; exports.farmServerOnlyEntriesPlugin = farmServerOnlyEntriesPlugin; exports.withFarmRequestTracing = withFarmRequestTracing; exports.rewriteEarlySsrRelativeImports = rewriteEarlySsrRelativeImports; exports.transformIsolatedClientBoundaryModule = transformIsolatedClientBoundaryModule; exports.shouldEmitFarmClientRootHmr = shouldEmitFarmClientRootHmr; exports.farmPlugin = farmPlugin; exports.defineConfig = defineConfig;
8208
+
8209
+ exports.isViteModuleRequest = isViteModuleRequest; exports.isViteDevClientRequest = isViteDevClientRequest; exports.farmImageImportsPlugin = farmImageImportsPlugin; exports.farmI18nClientBridgePlugin = farmI18nClientBridgePlugin; exports.farmIslandContainersPlugin = farmIslandContainersPlugin; exports.farmServerOnlyEntriesPlugin = farmServerOnlyEntriesPlugin; exports.withFarmRequestTracing = withFarmRequestTracing; exports.rewriteEarlySsrRelativeImports = rewriteEarlySsrRelativeImports; exports.transformIsolatedClientBoundaryModule = transformIsolatedClientBoundaryModule; exports.shouldEmitFarmClientRootHmr = shouldEmitFarmClientRootHmr; exports.farmPlugin = farmPlugin; exports.defineConfig = defineConfig;