@farm.js/core 0.1.49 → 0.1.51-beta.0

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 (363) hide show
  1. package/README.md +163 -3
  2. package/dist/{agent-mcp-Bb8hnnqd.d.ts → agent-mcp-BBMfNpsC.d.ts} +1 -1
  3. package/dist/{agent-mcp-ir3v4fHf.d.mts → agent-mcp-D44ip11f.d.mts} +1 -1
  4. package/dist/agent-runtime.cjs +3 -3
  5. package/dist/agent-runtime.d.mts +6 -6
  6. package/dist/agent-runtime.d.ts +6 -6
  7. package/dist/agent-runtime.mjs +2 -2
  8. package/dist/analyzer-HOUCQR3K.mjs +1066 -0
  9. package/dist/analyzer-VKUDHNDF.cjs +1066 -0
  10. package/dist/api/client.d.mts +0 -1
  11. package/dist/api/client.d.ts +0 -1
  12. package/dist/api/route-manager.cjs +8 -8
  13. package/dist/api/route-manager.d.mts +10 -10
  14. package/dist/api/route-manager.d.ts +10 -10
  15. package/dist/api/route-manager.mjs +7 -7
  16. package/dist/api/runtime.cjs +3 -3
  17. package/dist/api/runtime.d.mts +7 -7
  18. package/dist/api/runtime.d.ts +7 -7
  19. package/dist/api/runtime.mjs +2 -2
  20. package/dist/api.cjs +9 -9
  21. package/dist/api.d.mts +10 -10
  22. package/dist/api.d.ts +10 -10
  23. package/dist/api.mjs +8 -8
  24. package/dist/{app-y649szYm.d.ts → app-CourU3rQ.d.ts} +7 -7
  25. package/dist/{app-DLzz02du.d.mts → app-aeD4s_mg.d.mts} +7 -7
  26. package/dist/{app-manifest-Crn8Qd3U.d.mts → app-manifest-BC6mFn5A.d.mts} +1 -1
  27. package/dist/{app-manifest-DNeTKMRL.d.ts → app-manifest-LzjoNPeq.d.ts} +1 -1
  28. package/dist/app-markdown.d.mts +7 -7
  29. package/dist/app-markdown.d.ts +7 -7
  30. package/dist/base-path-BOUV5ozD.d.mts +10 -0
  31. package/dist/base-path-BOUV5ozD.d.ts +10 -0
  32. package/dist/cache.d.mts +4 -3
  33. package/dist/cache.d.ts +4 -3
  34. package/dist/{chunk-YQGZLCT4.cjs → chunk-2IAPKPEB.cjs} +6 -6
  35. package/dist/chunk-2KVDHNQS.mjs +224 -0
  36. package/dist/{chunk-QFQDRJKJ.mjs → chunk-3HA7PP72.mjs} +2 -2
  37. package/dist/{chunk-6LH33DLL.cjs → chunk-3OWVWZ6R.cjs} +28 -2
  38. package/dist/{chunk-GXSMF7UR.mjs → chunk-4GJJ65RB.mjs} +10 -2
  39. package/dist/{chunk-GERUXONA.cjs → chunk-5A77OEIG.cjs} +4 -1
  40. package/dist/{chunk-4HBKBHVP.mjs → chunk-5ENW27SL.mjs} +1 -1
  41. package/dist/{chunk-MTB57GOK.mjs → chunk-724WT3NI.mjs} +4 -2
  42. package/dist/{chunk-XLYXG73A.mjs → chunk-75WWOZ5C.mjs} +22 -0
  43. package/dist/{chunk-VCKGOXFI.cjs → chunk-76GHW3WI.cjs} +7 -1
  44. package/dist/{chunk-ZIBIE7AH.mjs → chunk-7UPCJDB5.mjs} +7 -1
  45. package/dist/{chunk-4IICUBQX.cjs → chunk-A5BJKSZE.cjs} +2 -2
  46. package/dist/{chunk-UYQOIPXE.mjs → chunk-AER5I65K.mjs} +1 -1
  47. package/dist/{chunk-WB6XES4V.mjs → chunk-ALEUMLJN.mjs} +34 -5
  48. package/dist/{chunk-Z4LTSH7D.mjs → chunk-AMRK3P6W.mjs} +175 -71
  49. package/dist/{chunk-TTYXOAB7.mjs → chunk-ANHZ6SUL.mjs} +1 -1
  50. package/dist/{chunk-ZBS3GOQZ.cjs → chunk-AQLHD6HZ.cjs} +35 -61
  51. package/dist/{chunk-L6QDME5Z.cjs → chunk-B3GZAQSC.cjs} +3 -3
  52. package/dist/chunk-CKPTIEDX.cjs +12 -0
  53. package/dist/{chunk-JPAVNDZH.cjs → chunk-CY7H5KS4.cjs} +25 -25
  54. package/dist/{chunk-4S7M63WX.cjs → chunk-DGOLAZLV.cjs} +22 -1
  55. package/dist/{chunk-4HM5B5RR.cjs → chunk-DWW3AMJX.cjs} +343 -308
  56. package/dist/{chunk-EQMTJBB7.cjs → chunk-DZZHTMWM.cjs} +35 -6
  57. package/dist/chunk-E36C43IX.cjs +224 -0
  58. package/dist/{chunk-J2ZEVDEK.cjs → chunk-EHB77D5U.cjs} +3 -3
  59. package/dist/{chunk-WQGRD5BJ.cjs → chunk-EX6ZSN5P.cjs} +1 -16
  60. package/dist/{chunk-C5S457CK.cjs → chunk-F42U3R4F.cjs} +214 -193
  61. package/dist/{chunk-FGJQS4EC.cjs → chunk-FK25QSVC.cjs} +4 -3
  62. package/dist/{chunk-JOHXK4BB.mjs → chunk-FSQMN2MQ.mjs} +2 -1
  63. package/dist/{chunk-2H3FJYY6.mjs → chunk-FSXSQQTV.mjs} +3 -2
  64. package/dist/chunk-G2KTRMWA.mjs +40 -0
  65. package/dist/{chunk-C6U66WWF.mjs → chunk-GFT5AHAT.mjs} +13 -0
  66. package/dist/chunk-GNZIAJGB.mjs +358 -0
  67. package/dist/{chunk-TXK4D46O.mjs → chunk-H3ASZDT7.mjs} +21 -1
  68. package/dist/{chunk-AXRNEVCS.cjs → chunk-HASX6DC7.cjs} +8 -8
  69. package/dist/{chunk-NW2BKDVT.mjs → chunk-HHFMECFO.mjs} +1 -1
  70. package/dist/{chunk-HELQXYVI.cjs → chunk-I2DQGS56.cjs} +11 -9
  71. package/dist/{chunk-IVHPRF4W.mjs → chunk-I2ZA5SXS.mjs} +81 -46
  72. package/dist/{chunk-EVCQX243.cjs → chunk-IOUOGRDX.cjs} +13 -5
  73. package/dist/{chunk-CBJKDB6F.mjs → chunk-IRSS4HS4.mjs} +1 -1
  74. package/dist/{chunk-NPPT4RWF.cjs → chunk-J22JD5YJ.cjs} +7 -7
  75. package/dist/{chunk-VJXLUTBM.mjs → chunk-JF5CNHHF.mjs} +9 -9
  76. package/dist/{chunk-VR4SEDEM.mjs → chunk-JWI5PUO2.mjs} +6 -2
  77. package/dist/{chunk-6XFGJBYX.cjs → chunk-JYNNIGQO.cjs} +16 -7
  78. package/dist/{chunk-EXHEPWFJ.cjs → chunk-KHXAJ2KA.cjs} +16 -16
  79. package/dist/{chunk-ALD2WMLA.mjs → chunk-KY32FWK7.mjs} +4 -4
  80. package/dist/{chunk-BR5FSKZ5.cjs → chunk-LEIXUFJN.cjs} +6 -2
  81. package/dist/{chunk-5566GNEG.cjs → chunk-LIFUPCXW.cjs} +13 -0
  82. package/dist/{chunk-I2SWKWO7.mjs → chunk-LJDIFIJ2.mjs} +1 -1
  83. package/dist/chunk-LMFJCXDD.mjs +55 -0
  84. package/dist/{chunk-IXSMFKZ2.cjs → chunk-LNM57D3H.cjs} +4 -4
  85. package/dist/{chunk-ATHPRVP2.mjs → chunk-LZ4SB57H.mjs} +3 -3
  86. package/dist/{chunk-73XBJRZW.cjs → chunk-MMEEXMUQ.cjs} +2 -2
  87. package/dist/chunk-N4AQNEXR.cjs +17 -0
  88. package/dist/{chunk-JZMZKABS.cjs → chunk-NWUHS6GV.cjs} +3 -2
  89. package/dist/{chunk-KZT2VHRQ.cjs → chunk-O3MMJPC2.cjs} +19 -19
  90. package/dist/{chunk-JWP56HCP.mjs → chunk-OD6WM3I7.mjs} +2 -2
  91. package/dist/{chunk-R2SEZEBC.cjs → chunk-OYNNA4DD.cjs} +4 -4
  92. package/dist/{chunk-GBPDSUFE.mjs → chunk-OZK2DS44.mjs} +1 -1
  93. package/dist/{chunk-A7DK663W.cjs → chunk-PDJSL7PL.cjs} +50 -39
  94. package/dist/{chunk-XLLVWLWO.mjs → chunk-PIHKO25G.mjs} +1 -1
  95. package/dist/chunk-PIUTGRDI.cjs +358 -0
  96. package/dist/{chunk-XO6WL6NL.mjs → chunk-PPDHCRTC.mjs} +1 -1
  97. package/dist/{chunk-LZBM35DH.mjs → chunk-QI5AQMEE.mjs} +20 -9
  98. package/dist/{chunk-FR4HJDI6.cjs → chunk-QK3HBOTG.cjs} +27 -30
  99. package/dist/{chunk-Q3UU2KXC.mjs → chunk-QMDU6QHN.mjs} +4 -1
  100. package/dist/chunk-QXJADAQB.cjs +40 -0
  101. package/dist/{chunk-DGVVVYKD.mjs → chunk-R5P4KFPM.mjs} +2 -2
  102. package/dist/{chunk-3HBFI373.cjs → chunk-S5AQ7CAC.cjs} +14 -14
  103. package/dist/{chunk-Z3BXMMFF.mjs → chunk-S5ZA2T2W.mjs} +63 -42
  104. package/dist/{chunk-PXEXOQ5R.mjs → chunk-SHS6KXOZ.mjs} +1 -1
  105. package/dist/{chunk-ETF5C6HR.cjs → chunk-SJ23LJ3N.cjs} +3 -3
  106. package/dist/{chunk-LL7TDMOM.mjs → chunk-SMUW7UST.mjs} +33 -59
  107. package/dist/{chunk-VCFBQFOV.mjs → chunk-SN5VSO3Q.mjs} +9 -7
  108. package/dist/{chunk-AIHD6VME.cjs → chunk-SO3T6T4I.cjs} +482 -378
  109. package/dist/{chunk-JHXJBNLY.cjs → chunk-SUCDVKUB.cjs} +21 -1
  110. package/dist/{chunk-DM3TFCC2.cjs → chunk-SUV6YO4Q.cjs} +5 -5
  111. package/dist/{chunk-NG44F7AH.mjs → chunk-T4EW7AAD.mjs} +2 -2
  112. package/dist/{chunk-JUMPFVMK.mjs → chunk-TUOO6IK3.mjs} +9 -0
  113. package/dist/chunk-UB7RVEMX.mjs +73 -0
  114. package/dist/{chunk-CDTIXBKN.mjs → chunk-UN6N623E.mjs} +2 -2
  115. package/dist/{chunk-BEXYFR2R.cjs → chunk-USL2ANCB.cjs} +10 -10
  116. package/dist/{chunk-HAH4FBTA.mjs → chunk-VAHBCI6X.mjs} +1 -1
  117. package/dist/{chunk-QNQEK3OF.cjs → chunk-VIFPE5RG.cjs} +14 -14
  118. package/dist/{chunk-HTLCLOXQ.cjs → chunk-VO6NLTV4.cjs} +3 -3
  119. package/dist/{chunk-XN2MB4QZ.cjs → chunk-VQJYGZNX.cjs} +4 -4
  120. package/dist/{chunk-N25RPPO5.cjs → chunk-WAPQWAE6.cjs} +10 -10
  121. package/dist/{chunk-5PKDHKQP.cjs → chunk-WFVSAT7Y.cjs} +6 -4
  122. package/dist/{chunk-EA5PMJDU.mjs → chunk-WSY2JD7O.mjs} +7 -7
  123. package/dist/{chunk-HNAUK3SC.mjs → chunk-WVX3BUNJ.mjs} +40 -199
  124. package/dist/chunk-X3EFRVXY.mjs +12 -0
  125. package/dist/{chunk-UCQ52TJY.mjs → chunk-X3JNB2TB.mjs} +1 -1
  126. package/dist/{chunk-J5VCA45K.cjs → chunk-X5BCMLGP.cjs} +1 -1
  127. package/dist/{chunk-SSNN55Q6.cjs → chunk-XB24LZWI.cjs} +10 -10
  128. package/dist/{chunk-XXB37YET.cjs → chunk-XLRLSTJ6.cjs} +7 -7
  129. package/dist/{chunk-BNMHXVLL.mjs → chunk-XMHERKSE.mjs} +0 -15
  130. package/dist/chunk-XPMC4E2G.cjs +55 -0
  131. package/dist/{chunk-J27BZO67.mjs → chunk-XWC5NAHV.mjs} +23 -26
  132. package/dist/{chunk-DRFADSKY.mjs → chunk-XXXRRVY6.mjs} +4 -4
  133. package/dist/{chunk-C7425KDG.cjs → chunk-XYL4HSVC.cjs} +2 -2
  134. package/dist/{chunk-2SVJGOAX.mjs → chunk-Y3N5BFRJ.mjs} +3 -3
  135. package/dist/{chunk-ZSIGEHSE.cjs → chunk-Y7TLL65B.cjs} +21 -180
  136. package/dist/{chunk-PEHL3IZL.cjs → chunk-YB44NKC2.cjs} +2 -2
  137. package/dist/chunk-YKHRCY4T.cjs +73 -0
  138. package/dist/{chunk-RYDDUCNJ.mjs → chunk-YLNBWUVS.mjs} +1 -1
  139. package/dist/chunk-Z5A6CNV2.mjs +60 -0
  140. package/dist/chunk-Z64V4WZI.mjs +17 -0
  141. package/dist/{chunk-ACI52TCN.mjs → chunk-ZF3GX4O7.mjs} +1 -1
  142. package/dist/client/lifecycle.d.mts +1 -1
  143. package/dist/client/lifecycle.d.ts +1 -1
  144. package/dist/{client-plugins-DFDQUI9Q.d.ts → client-plugins-CFBEfVPO.d.ts} +34 -10
  145. package/dist/{client-plugins-BNBeyLMi.d.mts → client-plugins-cqy_dQd0.d.mts} +34 -10
  146. package/dist/client-plugins.d.mts +6 -6
  147. package/dist/client-plugins.d.ts +6 -6
  148. package/dist/client.cjs +13 -9
  149. package/dist/client.d.mts +11 -10
  150. package/dist/client.d.ts +11 -10
  151. package/dist/client.mjs +15 -11
  152. package/dist/client.react-server.mjs +1 -1
  153. package/dist/config-CnhyvvmT.d.mts +188 -0
  154. package/dist/config-CnhyvvmT.d.ts +188 -0
  155. package/dist/config.d.mts +6 -6
  156. package/dist/config.d.ts +6 -6
  157. package/dist/cron.cjs +4 -4
  158. package/dist/cron.mjs +3 -3
  159. package/dist/desktop.d.mts +7 -7
  160. package/dist/desktop.d.ts +7 -7
  161. package/dist/{dev-guard-YO6KPIOQ.mjs → dev-guard-4PFQNXQX.mjs} +2 -1
  162. package/dist/{dev-guard-PLHL6OTJ.cjs → dev-guard-YLO5DE3H.cjs} +4 -3
  163. package/dist/{devtools-BLKHPY3C.mjs → devtools-4MLL3RAL.mjs} +10 -10
  164. package/dist/{devtools-A37WWJZL.cjs → devtools-4ZLMD454.cjs} +12 -12
  165. package/dist/docs.cjs +14 -14
  166. package/dist/docs.d.mts +7 -7
  167. package/dist/docs.d.ts +7 -7
  168. package/dist/docs.mjs +13 -13
  169. package/dist/environment/vite.d.mts +1 -1
  170. package/dist/environment/vite.d.ts +1 -1
  171. package/dist/generate-route-types-DQP0cUzk.d.ts +33 -0
  172. package/dist/generate-route-types-TF5Wwtvz.d.mts +33 -0
  173. package/dist/i18n/client.d.mts +2 -2
  174. package/dist/i18n/client.d.ts +2 -2
  175. package/dist/i18n/index.d.mts +3 -3
  176. package/dist/i18n/index.d.ts +3 -3
  177. package/dist/i18n/server.d.mts +5 -5
  178. package/dist/i18n/server.d.ts +5 -5
  179. package/dist/image/server.cjs +3 -3
  180. package/dist/image/server.mjs +2 -2
  181. package/dist/image/sharp.cjs +10 -10
  182. package/dist/image/sharp.mjs +2 -2
  183. package/dist/{index-DBdiTkNc.d.ts → index-BYkNbeQV.d.mts} +2 -2
  184. package/dist/{index-CeJ9_s9p.d.mts → index-BxjN_UDZ.d.ts} +2 -2
  185. package/dist/{index-MocnSP3a.d.ts → index-D3l4tREW.d.ts} +2 -2
  186. package/dist/{index-Cl3akY5U.d.mts → index-DPUAPho_.d.mts} +2 -2
  187. package/dist/index.cjs +88 -79
  188. package/dist/index.d.mts +29 -45
  189. package/dist/index.d.ts +29 -45
  190. package/dist/index.mjs +92 -83
  191. package/dist/integrations.cjs +3 -3
  192. package/dist/integrations.d.mts +6 -6
  193. package/dist/integrations.d.ts +6 -6
  194. package/dist/integrations.mjs +2 -2
  195. package/dist/internal/app-markdown-runtime.d.mts +7 -7
  196. package/dist/internal/app-markdown-runtime.d.ts +7 -7
  197. package/dist/internal/build-runtime.cjs +47 -43
  198. package/dist/internal/build-runtime.d.mts +9 -9
  199. package/dist/internal/build-runtime.d.ts +9 -9
  200. package/dist/internal/build-runtime.mjs +46 -42
  201. package/dist/internal/cli-runtime.cjs +24 -23
  202. package/dist/internal/cli-runtime.mjs +24 -23
  203. package/dist/internal/client-error-overlay.cjs +4 -4
  204. package/dist/internal/client-error-overlay.mjs +1 -1
  205. package/dist/internal/client-runtime.cjs +22 -3
  206. package/dist/internal/client-runtime.d.mts +46 -4
  207. package/dist/internal/client-runtime.d.ts +46 -4
  208. package/dist/internal/client-runtime.mjs +22 -3
  209. package/dist/internal/compression-runtime.d.mts +6 -6
  210. package/dist/internal/compression-runtime.d.ts +6 -6
  211. package/dist/internal/config-runtime.cjs +20 -13
  212. package/dist/internal/config-runtime.d.mts +259 -18
  213. package/dist/internal/config-runtime.d.ts +259 -18
  214. package/dist/internal/config-runtime.mjs +18 -11
  215. package/dist/internal/form-actions.cjs +5 -4
  216. package/dist/internal/form-actions.mjs +4 -3
  217. package/dist/internal/infra-analytics-runtime.cjs +6 -6
  218. package/dist/internal/infra-analytics-runtime.mjs +4 -4
  219. package/dist/internal/islands-runtime.cjs +56 -0
  220. package/dist/internal/islands-runtime.mjs +57 -1
  221. package/dist/internal/metadata-image-runtime.cjs +3 -3
  222. package/dist/internal/metadata-image-runtime.mjs +2 -2
  223. package/dist/internal/product-telemetry-runtime.cjs +2 -2
  224. package/dist/internal/product-telemetry-runtime.mjs +1 -1
  225. package/dist/internal/production-runtime.cjs +18 -15
  226. package/dist/internal/production-runtime.d.mts +33 -20
  227. package/dist/internal/production-runtime.d.ts +33 -20
  228. package/dist/internal/production-runtime.mjs +20 -17
  229. package/dist/internal/server-fn-transform.cjs +13 -0
  230. package/dist/internal/server-fn-transform.d.mts +24 -0
  231. package/dist/internal/server-fn-transform.d.ts +24 -0
  232. package/dist/internal/server-fn-transform.mjs +13 -0
  233. package/dist/{layers-D9fbe-rz.d.ts → layers-CcS42OGR.d.mts} +1 -1
  234. package/dist/{layers-D9fbe-rz.d.mts → layers-CcS42OGR.d.ts} +1 -1
  235. package/dist/{lifecycle-DK06VuKP.d.ts → lifecycle-C2aLBOwu.d.mts} +1 -1
  236. package/dist/{lifecycle-DK06VuKP.d.mts → lifecycle-C2aLBOwu.d.ts} +1 -1
  237. package/dist/markdown.d.mts +6 -6
  238. package/dist/markdown.d.ts +6 -6
  239. package/dist/middleware.cjs +11 -11
  240. package/dist/middleware.d.mts +8 -8
  241. package/dist/middleware.d.ts +8 -8
  242. package/dist/middleware.mjs +10 -10
  243. package/dist/mobile.cjs +9 -0
  244. package/dist/mobile.d.mts +94 -0
  245. package/dist/mobile.d.ts +94 -0
  246. package/dist/mobile.mjs +9 -0
  247. package/dist/navigation-delegate-BU4xqdnw.d.ts +29 -0
  248. package/dist/navigation-delegate-DLhbfEN4.d.mts +29 -0
  249. package/dist/navigation.cjs +5 -5
  250. package/dist/navigation.d.mts +9 -9
  251. package/dist/navigation.d.ts +9 -9
  252. package/dist/navigation.mjs +4 -4
  253. package/dist/{nitro-BIXIKJZS.cjs → nitro-CK7M4RMY.cjs} +12 -12
  254. package/dist/{nitro-UT2J5A5D.mjs → nitro-R444AF3O.mjs} +8 -8
  255. package/dist/platform.cjs +2 -1
  256. package/dist/platform.d.mts +4 -3
  257. package/dist/platform.d.ts +4 -3
  258. package/dist/platform.mjs +2 -1
  259. package/dist/{plugin-4KYXV7BB.mjs → plugin-53SY5YBS.mjs} +1 -1
  260. package/dist/{plugin-WBANOZQM.cjs → plugin-HZIBL3DW.cjs} +2 -2
  261. package/dist/plugin.cjs +40 -36
  262. package/dist/plugin.d.mts +13 -8
  263. package/dist/plugin.d.ts +13 -8
  264. package/dist/plugin.mjs +39 -35
  265. package/dist/{production-runtime-B3qFFtKF.d.ts → production-runtime-C78A8YgK.d.ts} +3 -3
  266. package/dist/{production-runtime-DcD-GRAv.d.mts → production-runtime-DLA4J5WG.d.mts} +3 -3
  267. package/dist/production-vite-BQFAlG7n.d.mts +13 -0
  268. package/dist/production-vite-BQFAlG7n.d.ts +13 -0
  269. package/dist/{programmatic-routes-client-fD9f4XqU.d.ts → programmatic-routes-client-CBqkNhBy.d.ts} +2 -2
  270. package/dist/{programmatic-routes-client-DzbYGiZQ.d.mts → programmatic-routes-client-NpqGBn-i.d.mts} +2 -2
  271. package/dist/query/client.cjs +6 -6
  272. package/dist/query/client.mjs +2 -2
  273. package/dist/{render-plan-DqJ51ufr.d.mts → render-plan-C9sWvDTv.d.mts} +1 -1
  274. package/dist/{render-plan-B6cfssrr.d.ts → render-plan-CrqcBbnV.d.ts} +1 -1
  275. package/dist/renderer-client.cjs +17 -12
  276. package/dist/renderer-client.d.mts +9 -8
  277. package/dist/renderer-client.d.ts +9 -8
  278. package/dist/renderer-client.mjs +10 -5
  279. package/dist/{request-jhvUMXRx.d.ts → request-BizeuqD7.d.ts} +1 -1
  280. package/dist/{request-UuAxHn8h.d.mts → request-WwB1-Uim.d.mts} +1 -1
  281. package/dist/request.d.mts +7 -7
  282. package/dist/request.d.ts +7 -7
  283. package/dist/{resolver-DC57A4vz.d.ts → resolver-CJ-D9nP-.d.ts} +1 -1
  284. package/dist/{resolver-C2G-3Tm6.d.mts → resolver-TDyZKgKI.d.mts} +1 -1
  285. package/dist/{route-rendering-Sn50cYZf.d.ts → route-rendering-BGhJN64l.d.ts} +1 -1
  286. package/dist/{route-rendering-Cou00t1X.d.mts → route-rendering-S6NFjnx4.d.mts} +1 -1
  287. package/dist/{router-0X9DCTcm.d.mts → router-BIheIy9G.d.mts} +1 -1
  288. package/dist/{router-xwLvi48p.d.ts → router-BUD_j2EL.d.ts} +1 -1
  289. package/dist/routes-8PT9cl60.d.ts +121 -0
  290. package/dist/routes-kEUsXHx3.d.mts +121 -0
  291. package/dist/routes.cjs +3 -2
  292. package/dist/routes.d.mts +7 -7
  293. package/dist/routes.d.ts +7 -7
  294. package/dist/routes.mjs +2 -1
  295. package/dist/{rsc-pipeline-VKHMABDJ.cjs → rsc-pipeline-JRGUZBYM.cjs} +18 -16
  296. package/dist/{rsc-pipeline-F6ZPH5MU.mjs → rsc-pipeline-OLAVIKI3.mjs} +17 -15
  297. package/dist/{runtime-B9HmxiZc.d.ts → runtime-C4CmlOOh.d.ts} +2 -2
  298. package/dist/{runtime-tkSXZiqO.d.ts → runtime-CWP-21hP.d.ts} +1 -1
  299. package/dist/{runtime-CMrsyChI.d.mts → runtime-CgJwe6H_.d.mts} +1 -1
  300. package/dist/{runtime-CCxTmGuf.d.mts → runtime-CihDZ2Rn.d.mts} +2 -2
  301. package/dist/runtime-G23RSLEK.cjs +1005 -0
  302. package/dist/runtime-OGCHDACZ.mjs +1005 -0
  303. package/dist/{schema-dev-notice-O3I5HLXK.mjs → schema-dev-notice-F6QYSOAI.mjs} +4 -4
  304. package/dist/{schema-dev-notice-Z73J3NJ6.cjs → schema-dev-notice-UU7DMZEU.cjs} +7 -7
  305. package/dist/{search-client-BTXL5XWD.mjs → search-client-OXH6GBNO.mjs} +5 -3
  306. package/dist/search-client-ZZLKVO5R.cjs +15 -0
  307. package/dist/server-action-security.cjs +3 -3
  308. package/dist/server-action-security.mjs +2 -2
  309. package/dist/server-fn-client.d.mts +0 -1
  310. package/dist/server-fn-client.d.ts +0 -1
  311. package/dist/server-fn.cjs +4 -4
  312. package/dist/server-fn.d.mts +0 -1
  313. package/dist/server-fn.d.ts +0 -1
  314. package/dist/server-fn.mjs +3 -3
  315. package/dist/server-plugins.cjs +1 -1
  316. package/dist/server-plugins.d.mts +7 -7
  317. package/dist/server-plugins.d.ts +7 -7
  318. package/dist/server-plugins.mjs +1 -1
  319. package/dist/server-query-client.cjs +4 -3
  320. package/dist/server-query-client.d.mts +0 -1
  321. package/dist/server-query-client.d.ts +0 -1
  322. package/dist/server-query-client.mjs +3 -2
  323. package/dist/server-query.cjs +5 -5
  324. package/dist/server-query.d.mts +0 -1
  325. package/dist/server-query.d.ts +0 -1
  326. package/dist/server-query.mjs +4 -4
  327. package/dist/server.cjs +104 -79
  328. package/dist/server.d.mts +22 -17
  329. package/dist/server.d.ts +22 -17
  330. package/dist/server.mjs +73 -48
  331. package/dist/{spa-router-B48EjsS1.d.mts → spa-router-CVOL0Vrq.d.mts} +4 -4
  332. package/dist/{spa-router-B06APnGK.d.ts → spa-router-Kytv4jSB.d.ts} +4 -4
  333. package/dist/testing.cjs +16 -15
  334. package/dist/testing.d.mts +6 -6
  335. package/dist/testing.d.ts +6 -6
  336. package/dist/testing.mjs +12 -11
  337. package/dist/{types--Wh02r5_.d.mts → types-C41ePjvP.d.mts} +1 -1
  338. package/dist/{types--Wh02r5_.d.ts → types-C41ePjvP.d.ts} +1 -1
  339. package/dist/{utils-C5fyK2tE.d.ts → utils-DbyXlzaj.d.ts} +1 -1
  340. package/dist/{utils-hyAwmcN6.d.mts → utils-Dsa1HZ7X.d.mts} +1 -1
  341. package/dist/version.cjs +2 -2
  342. package/dist/version.mjs +1 -1
  343. package/dist/vite.cjs +40 -36
  344. package/dist/vite.d.mts +9 -9
  345. package/dist/vite.d.ts +9 -9
  346. package/dist/vite.mjs +39 -35
  347. package/dist/{workflows-Df1C_7OG.d.mts → workflows-CRMzQZ3k.d.mts} +2 -1
  348. package/dist/{workflows-Df1C_7OG.d.ts → workflows-CRMzQZ3k.d.ts} +2 -1
  349. package/dist/workflows.cjs +5 -5
  350. package/dist/workflows.d.mts +1 -1
  351. package/dist/workflows.d.ts +1 -1
  352. package/dist/workflows.mjs +4 -4
  353. package/package.json +16 -3
  354. package/dist/base-path-leyrqXbX.d.mts +0 -19
  355. package/dist/base-path-leyrqXbX.d.ts +0 -19
  356. package/dist/cache-invalidation-BD0z_lfu.d.mts +0 -4
  357. package/dist/cache-invalidation-BD0z_lfu.d.ts +0 -4
  358. package/dist/chunk-45EUIICW.mjs +0 -15
  359. package/dist/chunk-MJ6IC4K2.mjs +0 -34
  360. package/dist/chunk-V7KTQR4C.cjs +0 -15
  361. package/dist/search-client-QCYAL6AY.cjs +0 -13
  362. package/dist/{chunk-5OJVKXFV.cjs → chunk-N7JQXQAV.cjs} +2 -2
  363. package/dist/{chunk-72KABRWN.mjs → chunk-WSDKXV4E.mjs} +4 -4
@@ -18,10 +18,17 @@ function resolveFarmDocsSearchClientModule(root) {
18
18
  }
19
19
  return void 0;
20
20
  }
21
+ function resolveFarmDocsSearchFrameworkModule(searchModule) {
22
+ try {
23
+ return createRequire(searchModule).resolve("fumadocs-core/framework");
24
+ } catch {
25
+ return void 0;
26
+ }
27
+ }
21
28
  function generateFarmDocsSearchBootstrapRuntime() {
22
29
  return `(()=>{if(window.__farmDocsSearchBootstrap)return;window.__farmDocsSearchBootstrap=true;const queue=(trigger,event)=>{if(window.__FARM_DOCS_SEARCH_BRIDGE_ACTIVE__)return;event.preventDefault();event.stopPropagation();event.stopImmediatePropagation();window.__FARM_DOCS_SEARCH_PENDING__=trigger;window.__FARM_MOUNT_DOCS_SEARCH__?.()};document.addEventListener("click",(event)=>{const target=event.target instanceof Element?event.target.closest("[data-search-full]"):null;if(target)queue("button",event)},true);document.addEventListener("keydown",(event)=>{if((event.metaKey||event.ctrlKey)&&event.key.toLowerCase()==="k")queue("keyboard",event)},true)})();`;
23
30
  }
24
- function generateFarmDocsSearchClientRuntime(enabled, moduleId) {
31
+ function generateFarmDocsSearchClientRuntime(enabled, moduleId, frameworkModuleId = moduleId ? resolveFarmDocsSearchFrameworkModule(moduleId) : void 0) {
25
32
  if (!enabled || !moduleId) {
26
33
  return `
27
34
  function isFarmDocsSearchPage() {
@@ -71,7 +78,21 @@ function replayFarmDocsSearchOpen() {
71
78
  });
72
79
  }
73
80
 
74
- function FarmDocsSearchBridge({ component, api }) {
81
+ const farmDocsSearchRouter = {
82
+ push(url) {
83
+ window.location.assign(url);
84
+ },
85
+ refresh() {
86
+ window.location.reload();
87
+ },
88
+ };
89
+ const farmDocsSearchFramework = {
90
+ usePathname: () => window.location.pathname,
91
+ useParams: () => ({}),
92
+ useRouter: () => farmDocsSearchRouter,
93
+ };
94
+
95
+ function FarmDocsSearchBridge({ component, api, FrameworkProvider }) {
75
96
  React.useEffect(() => {
76
97
  farmDocsSearchReady = true;
77
98
  replayFarmDocsSearchOpen();
@@ -80,7 +101,10 @@ function FarmDocsSearchBridge({ component, api }) {
80
101
  };
81
102
  }, []);
82
103
 
83
- return React.createElement(component, { api });
104
+ const search = React.createElement(component, { api });
105
+ return FrameworkProvider
106
+ ? React.createElement(FrameworkProvider, farmDocsSearchFramework, search)
107
+ : search;
84
108
  }
85
109
 
86
110
  function queueFarmDocsSearchOpen(trigger, event) {
@@ -122,8 +146,11 @@ async function mountFarmDocsSearch() {
122
146
  if (farmDocsSearchContainer === container && farmDocsSearchRoot) return true;
123
147
 
124
148
  try {
125
- farmDocsSearchModulePromise ||= import(${JSON.stringify(moduleId)});
126
- const { DocsCommandSearch } = await farmDocsSearchModulePromise;
149
+ farmDocsSearchModulePromise ||= Promise.all([
150
+ import(${JSON.stringify(moduleId)}),
151
+ ${frameworkModuleId ? `import(${JSON.stringify(frameworkModuleId)})` : "null"},
152
+ ]);
153
+ const [{ DocsCommandSearch }, framework] = await farmDocsSearchModulePromise;
127
154
  if (!container.isConnected) return false;
128
155
 
129
156
  if (farmDocsSearchRoot) {
@@ -139,6 +166,7 @@ async function mountFarmDocsSearch() {
139
166
  React.createElement(FarmDocsSearchBridge, {
140
167
  component: DocsCommandSearch,
141
168
  api: container.dataset.api || '/api/docs',
169
+ FrameworkProvider: framework?.FrameworkProvider,
142
170
  }),
143
171
  );
144
172
  return true;
@@ -156,6 +184,7 @@ window.__FARM_MOUNT_DOCS_SEARCH__ = mountFarmDocsSearch;
156
184
  export {
157
185
  isFarmDocsSearchEnabled,
158
186
  resolveFarmDocsSearchClientModule,
187
+ resolveFarmDocsSearchFrameworkModule,
159
188
  generateFarmDocsSearchBootstrapRuntime,
160
189
  generateFarmDocsSearchClientRuntime
161
190
  };
@@ -18,7 +18,7 @@ import {
18
18
  compileFarmDocsAdapterEdgeManifest,
19
19
  createFarmDocsAPIHandler,
20
20
  hasFarmDocsRuntimeAdapter
21
- } from "./chunk-QFQDRJKJ.mjs";
21
+ } from "./chunk-3HA7PP72.mjs";
22
22
  import {
23
23
  FARM_DOCS_LAST_MODIFIED_MANIFEST,
24
24
  createFarmDocsHandler,
@@ -29,15 +29,15 @@ import {
29
29
  loadFarmDocsPage,
30
30
  resolveFarmDocsContentDir,
31
31
  toFarmDocsMarkdownPage
32
- } from "./chunk-GXSMF7UR.mjs";
32
+ } from "./chunk-4GJJ65RB.mjs";
33
33
  import {
34
34
  generateFarmDocsSearchClientRuntime,
35
35
  isFarmDocsSearchEnabled,
36
36
  resolveFarmDocsSearchClientModule
37
- } from "./chunk-WB6XES4V.mjs";
37
+ } from "./chunk-ALEUMLJN.mjs";
38
38
  import {
39
39
  FARM_PRERENDER_ENV
40
- } from "./chunk-RYDDUCNJ.mjs";
40
+ } from "./chunk-YLNBWUVS.mjs";
41
41
  import {
42
42
  resolveFarmInstrumentationFile
43
43
  } from "./chunk-N35YPV4N.mjs";
@@ -52,7 +52,7 @@ import {
52
52
  getDeployTargetForPreset,
53
53
  hasCustomFarmRouteContext,
54
54
  resolveDeployOutputPath
55
- } from "./chunk-VJXLUTBM.mjs";
55
+ } from "./chunk-JF5CNHHF.mjs";
56
56
  import {
57
57
  DEFAULT_NOT_FOUND_STYLES,
58
58
  FARM_LAYOUT_ELEMENT_CLIENT_SOURCE,
@@ -84,10 +84,10 @@ import {
84
84
  resolveFarmIsolatedClientHydrationMode,
85
85
  resolveFarmNotFoundComponentPath,
86
86
  usesFarmServerTree
87
- } from "./chunk-Z3BXMMFF.mjs";
87
+ } from "./chunk-S5ZA2T2W.mjs";
88
88
  import {
89
89
  loadTailwindVitePlugin
90
- } from "./chunk-XLLVWLWO.mjs";
90
+ } from "./chunk-PIHKO25G.mjs";
91
91
  import {
92
92
  PluginManager
93
93
  } from "./chunk-GHNW564E.mjs";
@@ -95,7 +95,7 @@ import {
95
95
  generateFarmTypeArtifacts,
96
96
  readRouteRenderingDirectiveFromFile,
97
97
  resolveRouteRenderingConfigFromFile
98
- } from "./chunk-HNAUK3SC.mjs";
98
+ } from "./chunk-WVX3BUNJ.mjs";
99
99
  import {
100
100
  HOISTED_HEAD_ELEMENT,
101
101
  appMiddlewareMayHandlePath,
@@ -108,10 +108,13 @@ import {
108
108
  layoutsCanCoverSamePage,
109
109
  routeBoundaryCoversDirectory,
110
110
  stripRouteGroups
111
- } from "./chunk-ZIBIE7AH.mjs";
111
+ } from "./chunk-7UPCJDB5.mjs";
112
112
  import {
113
113
  farmPluginMayAffectRuntimePath
114
114
  } from "./chunk-UUMKLGUU.mjs";
115
+ import {
116
+ isFarmPreviewDeploymentEnvironment
117
+ } from "./chunk-CSLUBKGG.mjs";
115
118
  import {
116
119
  FARM_API_CATALOG_PATH,
117
120
  FARM_APP_MANIFEST_LEGACY_PATH,
@@ -119,18 +122,18 @@ import {
119
122
  listFarmBuiltInRoutePaths,
120
123
  resolveFarmApiCatalogInput,
121
124
  resolveFarmAppManifestInput
122
- } from "./chunk-DGVVVYKD.mjs";
125
+ } from "./chunk-R5P4KFPM.mjs";
123
126
  import {
124
127
  FARM_DEFAULT_MCP_PATH,
125
128
  createFarmDefaultMCPServer,
126
129
  farmConfigMountsMCP
127
130
  } from "./chunk-KRRZJ77U.mjs";
128
- import {
129
- isFarmPreviewDeploymentEnvironment
130
- } from "./chunk-CSLUBKGG.mjs";
131
131
  import {
132
132
  farmEnvironmentFunctionsPlugin
133
133
  } from "./chunk-C5JXCUKR.mjs";
134
+ import {
135
+ isFarmMarkdownPageFile
136
+ } from "./chunk-GW4YUIHW.mjs";
134
137
  import {
135
138
  generateFarmDocsAdapterClientRuntime,
136
139
  getFarmDocsAdapterConfigModule
@@ -164,26 +167,23 @@ import {
164
167
  import {
165
168
  getFarmAppDirectories
166
169
  } from "./chunk-52Y3C3HG.mjs";
170
+ import {
171
+ resolveFarmMdxComponentsModulePath,
172
+ resolveMdxConfig
173
+ } from "./chunk-UIJOLBUL.mjs";
167
174
  import {
168
175
  applyFarmWorkflowVercelCrons,
169
176
  prepareFarmWorkflowsForNitro
170
- } from "./chunk-ATHPRVP2.mjs";
177
+ } from "./chunk-LZ4SB57H.mjs";
171
178
  import {
172
179
  applyFarmCronVercelCrons,
173
180
  createFarmCronCloudflareConfig,
174
181
  mergeScheduledTasks,
175
182
  prepareFarmCronForNitro
176
- } from "./chunk-UCQ52TJY.mjs";
183
+ } from "./chunk-X3JNB2TB.mjs";
177
184
  import {
178
185
  resolveServerActionsConfig
179
- } from "./chunk-JOHXK4BB.mjs";
180
- import {
181
- isFarmMarkdownPageFile
182
- } from "./chunk-GW4YUIHW.mjs";
183
- import {
184
- resolveFarmMdxComponentsModulePath,
185
- resolveMdxConfig
186
- } from "./chunk-UIJOLBUL.mjs";
186
+ } from "./chunk-FSQMN2MQ.mjs";
187
187
  import {
188
188
  getFarmMarkdownAlternatePath
189
189
  } from "./chunk-N77JBPLC.mjs";
@@ -193,7 +193,7 @@ import {
193
193
  import {
194
194
  getFarmIntegrationPluginServerRuntime,
195
195
  getIntegrationProviders
196
- } from "./chunk-NW2BKDVT.mjs";
196
+ } from "./chunk-HHFMECFO.mjs";
197
197
  import {
198
198
  FARM_INTEGRATION_API_BASE_PATH_KEY
199
199
  } from "./chunk-F6TLUMH7.mjs";
@@ -201,10 +201,10 @@ import {
201
201
  appendMiddlewareDirectory,
202
202
  appendMiddlewareRoutePath,
203
203
  compareMiddlewareRouteLocations
204
- } from "./chunk-4HBKBHVP.mjs";
204
+ } from "./chunk-5ENW27SL.mjs";
205
205
  import {
206
206
  APIRouteManager
207
- } from "./chunk-ALD2WMLA.mjs";
207
+ } from "./chunk-KY32FWK7.mjs";
208
208
  import {
209
209
  readFarmI18nCatalogs
210
210
  } from "./chunk-DU4VHHPJ.mjs";
@@ -224,14 +224,14 @@ import {
224
224
  logger,
225
225
  toPosixPath,
226
226
  toViteModuleId
227
- } from "./chunk-2SVJGOAX.mjs";
227
+ } from "./chunk-Y3N5BFRJ.mjs";
228
228
  import {
229
229
  resolveFarmAPIServerBasePath,
230
230
  resolveFarmAPIServerRoutePath
231
231
  } from "./chunk-LM2YOGDK.mjs";
232
232
  import {
233
233
  FARM_VERSION
234
- } from "./chunk-ACI52TCN.mjs";
234
+ } from "./chunk-ZF3GX4O7.mjs";
235
235
  import {
236
236
  getFarmPresetRuntime
237
237
  } from "./chunk-UAQD67HM.mjs";
@@ -954,7 +954,7 @@ export default async function farmNetlifyHandler(request, context) {
954
954
  // src/build/strip-platform-config.ts
955
955
  import { realpathSync } from "fs";
956
956
  import path8 from "path";
957
- var PLATFORM_CONFIG_KEYS = /* @__PURE__ */ new Set(["desktop"]);
957
+ var PLATFORM_CONFIG_KEYS = /* @__PURE__ */ new Set(["desktop", "mobile"]);
958
958
  var CONFIG_FACTORIES = /* @__PURE__ */ new Set(["defineConfig", "defineFarmConfig"]);
959
959
  function isConfigObject(node) {
960
960
  return node?.type === "ObjectExpression";
@@ -989,23 +989,33 @@ function collectConfigObjects(node, found) {
989
989
  }
990
990
  }
991
991
  function stripPlatformConfigSource(code, parse) {
992
- if (!code.includes("desktop")) return null;
992
+ if (!code.includes("desktop") && !code.includes("mobile")) return null;
993
993
  const objects = [];
994
994
  collectConfigObjects(parse(code), objects);
995
995
  const removals = [];
996
996
  for (const object of objects) {
997
997
  const properties = object.properties;
998
- properties.forEach((property, index) => {
998
+ const removed = properties.map((property) => {
999
999
  const name = propertyName(property);
1000
- if (!name || !PLATFORM_CONFIG_KEYS.has(name)) return;
1001
- if (index < properties.length - 1)
1002
- removals.push([property.start, properties[index + 1].start]);
1003
- else if (index > 0) removals.push([properties[index - 1].end, property.end]);
1004
- else {
1005
- const trailingComma = /^\s*,/.exec(code.slice(property.end));
1006
- removals.push([property.start, property.end + (trailingComma?.[0].length ?? 0)]);
1007
- }
1000
+ return !!name && PLATFORM_CONFIG_KEYS.has(name);
1008
1001
  });
1002
+ for (let first = 0; first < properties.length; first++) {
1003
+ if (!removed[first]) continue;
1004
+ let last = first;
1005
+ while (last + 1 < properties.length && removed[last + 1]) last++;
1006
+ if (last < properties.length - 1) {
1007
+ removals.push([properties[first].start, properties[last + 1].start]);
1008
+ } else if (first > 0) {
1009
+ removals.push([properties[first - 1].end, properties[last].end]);
1010
+ } else {
1011
+ const trailingComma = /^\s*,/.exec(code.slice(properties[last].end));
1012
+ removals.push([
1013
+ properties[first].start,
1014
+ properties[last].end + (trailingComma?.[0].length ?? 0)
1015
+ ]);
1016
+ }
1017
+ first = last;
1018
+ }
1009
1019
  }
1010
1020
  if (removals.length === 0) return null;
1011
1021
  removals.sort((left, right) => right[0] - left[0]);
@@ -1070,6 +1080,75 @@ function createFarmPrivateClientSourcemapsPlugin(options) {
1070
1080
  };
1071
1081
  }
1072
1082
 
1083
+ // src/middleware/static-config.ts
1084
+ function literalMatcher(node) {
1085
+ if (!node) return void 0;
1086
+ if (node.type === "Literal" && typeof node.value === "string") return node.value;
1087
+ if (node.type === "Literal" && node.regex)
1088
+ return new RegExp(node.regex.pattern, node.regex.flags);
1089
+ if (node.type === "TemplateLiteral" && node.expressions.length === 0) {
1090
+ return node.quasis[0]?.value?.cooked ?? void 0;
1091
+ }
1092
+ return void 0;
1093
+ }
1094
+ function literalMatchers(node) {
1095
+ const values = node.type === "ArrayExpression" ? node.elements : [node];
1096
+ const matchers = [];
1097
+ for (const value of values) {
1098
+ const matcher = literalMatcher(value);
1099
+ if (matcher === void 0) return void 0;
1100
+ matchers.push(matcher);
1101
+ }
1102
+ return matchers;
1103
+ }
1104
+ function unwrap(node) {
1105
+ while (node.type === "TSAsExpression" || node.type === "TSSatisfiesExpression" || node.type === "ParenthesizedExpression") {
1106
+ node = node.expression;
1107
+ }
1108
+ return node;
1109
+ }
1110
+ function readStaticMiddlewareConfig(program) {
1111
+ let found = null;
1112
+ for (const statement of program.body) {
1113
+ if (statement.type === "ExportNamedDeclaration" && !statement.declaration) {
1114
+ if (statement.specifiers.some((specifier) => specifier.exported?.name === "config")) {
1115
+ return "unknown";
1116
+ }
1117
+ continue;
1118
+ }
1119
+ const declaration = statement.type === "ExportNamedDeclaration" ? statement.declaration : null;
1120
+ if (!declaration || declaration.type !== "VariableDeclaration") continue;
1121
+ for (const declarator of declaration.declarations) {
1122
+ if (declarator.id?.type !== "Identifier" || declarator.id.name !== "config") continue;
1123
+ if (declaration.kind !== "const" || !declarator.init) return "unknown";
1124
+ const init = unwrap(declarator.init);
1125
+ if (init.type !== "ObjectExpression") return "unknown";
1126
+ const config = {};
1127
+ for (const property of init.properties) {
1128
+ if (property.type !== "Property" || property.computed) return "unknown";
1129
+ const key = property.key?.name ?? property.key?.value;
1130
+ if (key !== "matcher" && key !== "exclude") continue;
1131
+ const matchers = literalMatchers(unwrap(property.value));
1132
+ if (!matchers) return "unknown";
1133
+ if (key === "matcher") config.matcher = matchers;
1134
+ else config.exclude = matchers;
1135
+ }
1136
+ found = config;
1137
+ }
1138
+ }
1139
+ return found;
1140
+ }
1141
+ async function readMiddlewareFileConfig(filePath) {
1142
+ try {
1143
+ const [{ readFile }, vite] = await Promise.all([import("fs/promises"), import("vite")]);
1144
+ const parsed = vite.parseSync(filePath, await readFile(filePath, "utf8"));
1145
+ if (parsed.errors?.length) return "unknown";
1146
+ return readStaticMiddlewareConfig(parsed.program);
1147
+ } catch {
1148
+ return "unknown";
1149
+ }
1150
+ }
1151
+
1073
1152
  // src/nitro/universal-build.ts
1074
1153
  function preloadFarmNitroBuilder() {
1075
1154
  return import("nitro/builder").then(
@@ -2044,7 +2123,7 @@ function getCachedClientModuleHydrationPlan(modulePath, root, mode, cache, optio
2044
2123
  async function buildClient(productionVite, config, root, srcDir, outputDir, pageRoutes, layoutRoutes = [], routeSlots = [], isolatedClientBoundaryModules = /* @__PURE__ */ new Set(), hydrationPlanCache = /* @__PURE__ */ new Map(), rendererBuildLifetime, programmaticClientRoutes) {
2045
2124
  const viteBuild = productionVite.build;
2046
2125
  const { farmPlugin, farmServerOnlyEntriesPlugin } = await import("./vite.mjs");
2047
- const { PluginManager: PluginManager2 } = await import("./plugin-4KYXV7BB.mjs");
2126
+ const { PluginManager: PluginManager2 } = await import("./plugin-53SY5YBS.mjs");
2048
2127
  const fs4 = await import("fs/promises");
2049
2128
  const pluginManager = new PluginManager2({
2050
2129
  config,
@@ -3345,6 +3424,14 @@ function countFarmKeptLayouts(request, layouts, params) {
3345
3424
  // browser's chain starts at the next layout.
3346
3425
  return keys.length > 1 ? 1 + getSharedLayoutPrefixLength(chain, keys.slice(1)) : 0;
3347
3426
  }
3427
+ `;
3428
+ var FARM_DOCUMENT_PARSED_RUNTIME = `function farmDocumentParsed() {
3429
+ if (document.readyState !== "loading") return Promise.resolve();
3430
+ return new Promise(function(resolve) {
3431
+ document.addEventListener("DOMContentLoaded", function() { resolve(); }, { once: true });
3432
+ });
3433
+ }
3434
+
3348
3435
  `;
3349
3436
  function generateClientHydrationEntry(clientPages, layoutRoutes, clientRouteSlots, root, srcDir, docsSearchEnabled, docsSearchModuleId, docsEntryPath, docsAdapterReact, i18nConfig = {
3350
3437
  enabled: false,
@@ -3458,7 +3545,7 @@ function isFarmDocsPath() {
3458
3545
  // Farm.js Client Runtime (no client components)
3459
3546
  ${cssImport}
3460
3547
  ${layoutImports}
3461
- import { createClientCancellation, createClientPluginManager, getFarmIslandValueHeaders, getHashTargetElement, installChunkErrorRecovery, isFarmBlockedNavigationURL, isFarmExternalNavigationURL, reconcileFarmDocumentHead, setFarmBasePath, setFarmTrailingSlashPreference, stripFarmBasePath } from "@farm.js/core/internal/client-runtime";
3548
+ import { createClientCancellation, createClientPluginManager, getFarmIslandValueHeaders, getHashTargetElement, installChunkErrorRecovery, isFarmBlockedNavigationURL, isFarmExternalNavigationURL, reconcileFarmDocumentHead, runFarmNavigationDelegates, setFarmBasePath, setFarmTrailingSlashPreference, stripFarmBasePath } from "@farm.js/core/internal/client-runtime";
3462
3549
  import { createFarmDeploymentMismatchError, createFarmDeploymentRequestHeaders, isFarmDeploymentMismatchResponse } from "@farm.js/core/deployment";
3463
3550
  ${clientPluginEntry.imports}
3464
3551
  ${clientCachePersistence.imports}
@@ -3523,6 +3610,15 @@ ${generateUniversalRouterStateProperties()}
3523
3610
  if (action === "pop") this.revertBlockedPopState(from);
3524
3611
  return;
3525
3612
  }
3613
+ // A refresh re-renders the page on screen; only a move to another page is offered.
3614
+ if (
3615
+ action !== "pop" &&
3616
+ !(options.refresh && to === from) &&
3617
+ (await runFarmNavigationDelegates({ url: url.href, from, to, action }))
3618
+ ) {
3619
+ this.cancelActiveNavigation();
3620
+ return;
3621
+ }
3526
3622
  if (action === "pop") {
3527
3623
  this.currentHistoryIndex = readHistoryIndex(options.popState);
3528
3624
  this.currentHistoryState = options.popState;
@@ -3696,7 +3792,7 @@ void farmClientRuntime.start();
3696
3792
  spaRouter.initializeHistory();
3697
3793
  window.__FARM_SPA_ROUTER__ = spaRouter;
3698
3794
 
3699
- ${islandValues ? "void farmDocumentParsed().then(hydrateFarmDocsAdapterRuntime);" : "void hydrateFarmDocsAdapterRuntime();"}
3795
+ ${islandValues ? `${FARM_DOCUMENT_PARSED_RUNTIME}void farmDocumentParsed().then(hydrateFarmDocsAdapterRuntime);` : "void hydrateFarmDocsAdapterRuntime();"}
3700
3796
 
3701
3797
  window.addEventListener("beforeunload", function(event) {
3702
3798
  if (spaRouter.shouldBlockUnload()) {
@@ -3823,7 +3919,7 @@ ${layoutImports}
3823
3919
  ${rendererClientImports}
3824
3920
  ${isolatedHydrationImport}
3825
3921
  ${providerClientCode.imports}
3826
- import { createClientCancellation, createClientPluginManager, getFarmIslandValueHeaders, getHashTargetElement, installChunkErrorRecovery, isFarmBlockedNavigationURL, isFarmExternalNavigationURL, reconcileFarmDocumentHead, scheduleFarmIslandHydration, searchParamsToObject, setFarmBasePath, setFarmTrailingSlashPreference, stripFarmBasePath } from "@farm.js/core/internal/client-runtime";
3922
+ import { createClientCancellation, createClientPluginManager, getFarmIslandValueHeaders, getHashTargetElement, installChunkErrorRecovery, isFarmBlockedNavigationURL, isFarmExternalNavigationURL, reconcileFarmDocumentHead, runFarmNavigationDelegates, scheduleFarmIslandHydration, createFarmSearchParams, searchParamsToObject, setFarmBasePath, setFarmTrailingSlashPreference, stripFarmBasePath } from "@farm.js/core/internal/client-runtime";
3827
3923
  import { createFarmDeploymentMismatchError, createFarmDeploymentRequestHeaders, isFarmDeploymentMismatchResponse } from "@farm.js/core/deployment";
3828
3924
  import { createFarmRouter, isFarmRouteActive, matchFarmRoute } from "@farm.js/core/router";
3829
3925
  ${clientPluginEntry.imports}
@@ -4010,7 +4106,7 @@ async function createMatchedHydrationRoute(matched, pathname, searchParams, serv
4010
4106
  if (!serverProps || serverProps.__farmRoutePropsResolved !== true) return null;
4011
4107
  const props = {
4012
4108
  ...reviveServerPageProps(serverProps),
4013
- searchParams: Promise.resolve(serverProps.search ?? searchParams),
4109
+ searchParams: createFarmSearchParams(serverProps.search ?? searchParams),
4014
4110
  };
4015
4111
  pageElement = React.createElement(Component, props);
4016
4112
  } else if (typeof Component === "function" && Component.constructor && Component.constructor.name === "AsyncFunction") {
@@ -4025,7 +4121,7 @@ async function createMatchedHydrationRoute(matched, pathname, searchParams, serv
4025
4121
  const props = {
4026
4122
  ...reviveServerPageProps(serverProps),
4027
4123
  params: params,
4028
- searchParams: Promise.resolve(searchParams),
4124
+ searchParams: createFarmSearchParams(searchParams),
4029
4125
  };
4030
4126
  pageElement = React.createElement(Component, props);
4031
4127
  }
@@ -4271,16 +4367,7 @@ function resetReactRoot() {
4271
4367
  isHydrated = false;
4272
4368
  }
4273
4369
 
4274
- ${islandValues ? `// Islands mode starts the client while the body streams (an async entry): a page of islands
4275
- // hydrates them as they arrive; anything else waits for the whole document.
4276
- function farmDocumentParsed() {
4277
- if (document.readyState !== "loading") return Promise.resolve();
4278
- return new Promise(function(resolve) {
4279
- document.addEventListener("DOMContentLoaded", function() { resolve(); }, { once: true });
4280
- });
4281
- }
4282
-
4283
- ` : ""}// Hydrate client components
4370
+ ${islandValues ? FARM_DOCUMENT_PARSED_RUNTIME : ""}// Hydrate client components
4284
4371
  async function hydrate() {
4285
4372
  await window.__FARM_PPR_REFRESH_PROMISE__;
4286
4373
  // A PPR refresh that is still retrying must not replace DOM once hydration starts.
@@ -4592,6 +4679,15 @@ ${islandValues ? ` // Islands mode: navigations name the layouts on screen, and
4592
4679
  if (action === "pop") this.revertBlockedPopState(from);
4593
4680
  return;
4594
4681
  }
4682
+ // A refresh re-renders the page on screen; only a move to another page is offered.
4683
+ if (
4684
+ action !== "pop" &&
4685
+ !(options.refresh && to === from) &&
4686
+ (await runFarmNavigationDelegates({ url: url.href, from, to, action }))
4687
+ ) {
4688
+ this.cancelActiveNavigation();
4689
+ return;
4690
+ }
4595
4691
  if (action === "pop") {
4596
4692
  this.currentHistoryIndex = readHistoryIndex(options.popState);
4597
4693
  this.currentHistoryState = options.popState;
@@ -4675,7 +4771,7 @@ ${islandValues ? ` // Islands mode: navigations name the layouts on screen, and
4675
4771
  if (!this.isCurrentNavigation(navigation, clientNavigation)) return;
4676
4772
  const params = matched.params;
4677
4773
  const searchParams = searchParamsToObject(url.searchParams);
4678
- const props = { params: params, searchParams: Promise.resolve(searchParams) };
4774
+ const props = { params: params, searchParams: createFarmSearchParams(searchParams) };
4679
4775
  let pageElement = React.createElement(Component, props);
4680
4776
  if (hasHydratableLayout(pathname)) {
4681
4777
  pageElement = createLayoutPageBoundary(matched.route, pageElement);
@@ -5046,7 +5142,7 @@ void hydrate();
5046
5142
  async function buildSSRInMemory(productionVite, config, root, routeManager, apiRouteManager, serverRenderer, preset, collectedPageRoutes, collectedLayoutRoutes, collectedRouteSlots, isolatedClientBoundaryModules, hydrationPlanCache, rendererBuildLifetime) {
5047
5143
  const viteBuild = productionVite.build;
5048
5144
  const { farmPlugin, farmServerOnlyEntriesPlugin } = await import("./vite.mjs");
5049
- const { PluginManager: PluginManager2 } = await import("./plugin-4KYXV7BB.mjs");
5145
+ const { PluginManager: PluginManager2 } = await import("./plugin-53SY5YBS.mjs");
5050
5146
  const fs4 = await import("fs/promises");
5051
5147
  const pluginManager = new PluginManager2({
5052
5148
  config,
@@ -5212,7 +5308,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
5212
5308
  srcDir: config.srcDir,
5213
5309
  clientEntry: FARM_CLIENT_JS_SRC_PLACEHOLDER,
5214
5310
  fontStylesheetHref: "/farm-fonts.css",
5215
- globalStylesheetHref: "/assets/globals.css"
5311
+ globalStylesheetHref: FARM_CLIENT_CSS_HREF_PLACEHOLDER
5216
5312
  }) : await (async () => {
5217
5313
  const guardedPaths = new Set(getFarmDocsGuardedPaths(config, middlewareRoutes));
5218
5314
  return compileFarmDocsManifest(config.docs, {
@@ -5221,7 +5317,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
5221
5317
  clientEntry: FARM_CLIENT_JS_SRC_PLACEHOLDER,
5222
5318
  fontAssets: toFarmDocsPublicFontAssets(resolveFarmDocsFontAssets(root)),
5223
5319
  fontStylesheetHref: "/farm-fonts.css",
5224
- globalStylesheetHref: "/assets/globals.css",
5320
+ globalStylesheetHref: FARM_CLIENT_CSS_HREF_PLACEHOLDER,
5225
5321
  isPathGuarded: (pathname) => guardedPaths.has(pathname)
5226
5322
  });
5227
5323
  })()
@@ -6240,6 +6336,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
6240
6336
  resolveFarmPreviewDeployment,
6241
6337
  resolveFarmWebRequestOrigin,
6242
6338
  runWithFarmRequestSpan,
6339
+ createFarmSearchParams,
6243
6340
  searchParamsToObject,
6244
6341
  setFarmBasePath,
6245
6342
  setFarmTrailingSlashPreference,
@@ -6760,7 +6857,8 @@ const farmDocsHandler = ${config.docs?.enabled ? hasPrecompiledDocs ? "farmDocsP
6760
6857
  getApplicableLayouts(getFarmRoutePathname(pathname)).map((layout) => layout.module),
6761
6858
  ),
6762
6859
  fontStylesheetHref: "/farm-fonts.css",
6763
- globalStylesheetHref: "/assets/globals.css",
6860
+ // The client stylesheet carries globals.css under a content-hashed name.
6861
+ globalStylesheetHref: ${JSON.stringify(FARM_CLIENT_CSS_HREF_PLACEHOLDER)},
6764
6862
  isPathGuarded: isFarmDocsPathGuarded,
6765
6863
  })` : "null"};
6766
6864
  const farmDocsAPIHandler = ${config.docs?.enabled ? hasPrecompiledDocs ? "farmDocsPrecompiledRuntime.handleAPIRequest" : adapterOwnsDocsRuntime ? "null" : `createFarmDocsAPIHandler({ rootDir: farmDocsRuntimeRoot, srcDir: ${JSON.stringify(config.srcDir)}, docs: farmDocsResolvedConfig, isPathGuarded: isFarmDocsPathGuarded })` : "null"};
@@ -7825,7 +7923,7 @@ async function handleMetadataImageRequest(request, routePathname) {
7825
7923
  const searchParams = searchParamsToObject(url.searchParams);
7826
7924
  const props = {
7827
7925
  params: match.params,
7828
- searchParams: Promise.resolve(searchParams),
7926
+ searchParams: createFarmSearchParams(searchParams),
7829
7927
  path: match.pagePath,
7830
7928
  };
7831
7929
  const value = typeof imageModule.default === "function"
@@ -9289,7 +9387,7 @@ ${hasServerRuntimeIntegrations ? `
9289
9387
  const rawPageProps = withFarmRouteContext(
9290
9388
  {
9291
9389
  params,
9292
- searchParams: Promise.resolve(searchParamsObj),
9390
+ searchParams: createFarmSearchParams(searchParamsObj),
9293
9391
  path: pathname,
9294
9392
  ...(middlewareData?.size ? { middleware: { data: middlewareData } } : {}),
9295
9393
  },
@@ -9330,7 +9428,7 @@ ${hasServerRuntimeIntegrations ? `
9330
9428
  ...rawPageProps,
9331
9429
  params: parsedParams,
9332
9430
  search: parsedSearch,
9333
- searchParams: Promise.resolve(parsedSearch),
9431
+ searchParams: createFarmSearchParams(parsedSearch),
9334
9432
  };
9335
9433
  })();
9336
9434
  if (
@@ -9349,7 +9447,7 @@ ${hasServerRuntimeIntegrations ? `
9349
9447
  const routeStateProps = {
9350
9448
  ...rawPageProps,
9351
9449
  search: searchParamsObj,
9352
- searchParams: Promise.resolve(searchParamsObj),
9450
+ searchParams: createFarmSearchParams(searchParamsObj),
9353
9451
  error: routeStateError,
9354
9452
  };
9355
9453
  if (isFarmNotFoundError(routeStateError) && routeComponents?.notFound) {
@@ -9378,7 +9476,7 @@ ${hasServerRuntimeIntegrations ? `
9378
9476
  const rawSlotProps = withFarmRouteContext(
9379
9477
  {
9380
9478
  params: slot.params,
9381
- searchParams: Promise.resolve(searchParamsObj),
9479
+ searchParams: createFarmSearchParams(searchParamsObj),
9382
9480
  path: pathname,
9383
9481
  ...(middlewareData?.size ? { middleware: { data: middlewareData } } : {}),
9384
9482
  },
@@ -9405,7 +9503,7 @@ ${hasServerRuntimeIntegrations ? `
9405
9503
  search: slotSchemas.search?.parse
9406
9504
  ? slotSchemas.search.parse(searchParamsObj)
9407
9505
  : searchParamsObj,
9408
- searchParams: Promise.resolve(
9506
+ searchParams: createFarmSearchParams(
9409
9507
  slotSchemas.search?.parse
9410
9508
  ? slotSchemas.search.parse(searchParamsObj)
9411
9509
  : searchParamsObj,
@@ -10069,7 +10167,7 @@ ${hasServerRuntimeIntegrations ? `
10069
10167
  reset: function() {},
10070
10168
  params,
10071
10169
  search: searchParamsObj,
10072
- searchParams: Promise.resolve(searchParamsObj),
10170
+ searchParams: createFarmSearchParams(searchParamsObj),
10073
10171
  path: pathname,
10074
10172
  ...(middlewareData?.size ? { middleware: { data: middlewareData } } : {}),
10075
10173
  });
@@ -10646,12 +10744,18 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
10646
10744
  const rewriteSources = configuredRewrites.map((route) => route.source);
10647
10745
  const prerenderRoutes = [];
10648
10746
  const skippedPrerenderRoutes = [];
10747
+ const middlewareRoutesWithConfig = ssgPages.length > 0 ? await Promise.all(
10748
+ middlewareRoutes.map(async (route) => ({
10749
+ ...route,
10750
+ config: await readMiddlewareFileConfig(route.filePath)
10751
+ }))
10752
+ ) : middlewareRoutes;
10649
10753
  for (const page of ssgPages) {
10650
10754
  if (page.revalidate !== void 0) continue;
10651
10755
  if (prerenderRoutes.includes(page.urlPath)) continue;
10652
10756
  const reason = getPhysicalPrerenderBypassReason({
10653
10757
  config,
10654
- middlewareRoutes,
10758
+ middlewareRoutes: middlewareRoutesWithConfig,
10655
10759
  routeRuntimeManifest,
10656
10760
  redirectSources,
10657
10761
  rewriteSources,
@@ -11967,7 +12071,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
11967
12071
  }
11968
12072
  async function buildClient2(viteBuild, config, root, srcDir, outputDir) {
11969
12073
  const { farmI18nClientBridgePlugin, farmPlugin, farmServerOnlyEntriesPlugin } = await import("./vite.mjs");
11970
- const { PluginManager: PluginManager2 } = await import("./plugin-4KYXV7BB.mjs");
12074
+ const { PluginManager: PluginManager2 } = await import("./plugin-53SY5YBS.mjs");
11971
12075
  const pluginManager = new PluginManager2({
11972
12076
  config,
11973
12077
  isDev: false,
@@ -11994,7 +12098,7 @@ async function buildClient2(viteBuild, config, root, srcDir, outputDir) {
11994
12098
  }
11995
12099
  async function buildSSR(viteBuild, config, root, srcDir, outputDir) {
11996
12100
  const { farmI18nClientBridgePlugin, farmPlugin } = await import("./vite.mjs");
11997
- const { PluginManager: PluginManager2 } = await import("./plugin-4KYXV7BB.mjs");
12101
+ const { PluginManager: PluginManager2 } = await import("./plugin-53SY5YBS.mjs");
11998
12102
  const pluginManager = new PluginManager2({
11999
12103
  config,
12000
12104
  isDev: false,
@@ -12035,7 +12139,7 @@ function resolveLegacyPageEntry(config, root, srcDir) {
12035
12139
  }
12036
12140
  async function buildNitro(config, routeManager, apiRouteManager, serverRenderer, preset, root, distDir, pluginManager) {
12037
12141
  const [{ createNitroConfig }, { createNitro, build: nitroBuild }] = await Promise.all([
12038
- import("./nitro-UT2J5A5D.mjs"),
12142
+ import("./nitro-R444AF3O.mjs"),
12039
12143
  import("nitro/builder")
12040
12144
  ]);
12041
12145
  let nitroConfig = await createNitroConfig(
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-BRYPZIMB.mjs";
4
4
  import {
5
5
  matchesFarmIfNoneMatch
6
- } from "./chunk-C6U66WWF.mjs";
6
+ } from "./chunk-GFT5AHAT.mjs";
7
7
 
8
8
  // src/image-pattern.ts
9
9
  var compiledPatterns = /* @__PURE__ */ new WeakMap();