@farm.js/core 0.1.69 → 0.1.71

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 (314) hide show
  1. package/dist/{agent-mcp-handler-FER4MQDF.cjs → agent-mcp-handler-KE4J3W7S.cjs} +8 -5
  2. package/dist/{agent-mcp-handler-AZ7QW4UP.mjs → agent-mcp-handler-VIT4GOSR.mjs} +7 -4
  3. package/dist/{agent-mcp.d-DOfBMEzP.d.mts → agent-mcp.d-BzNw6JI8.d.ts} +24 -5
  4. package/dist/{agent-mcp.d-DnIgriX1.d.ts → agent-mcp.d-CgFen3EH.d.mts} +24 -5
  5. package/dist/agent-runtime.cjs +3 -3
  6. package/dist/agent-runtime.d.mts +3 -2
  7. package/dist/agent-runtime.d.ts +3 -2
  8. package/dist/agent-runtime.mjs +2 -2
  9. package/dist/analyzer-LPIVRSTJ.cjs +16 -0
  10. package/dist/{analyzer-NAL5TJUP.mjs → analyzer-VK3BAOFI.mjs} +2 -2
  11. package/dist/api/node.d.mts +5 -4
  12. package/dist/api/node.d.ts +5 -4
  13. package/dist/api/route-manager.cjs +4 -4
  14. package/dist/api/route-manager.d.mts +16 -7
  15. package/dist/api/route-manager.d.ts +16 -7
  16. package/dist/api/route-manager.mjs +3 -3
  17. package/dist/api/runtime.d.mts +4 -3
  18. package/dist/api/runtime.d.ts +4 -3
  19. package/dist/api.cjs +6 -6
  20. package/dist/api.d.mts +8 -7
  21. package/dist/api.d.ts +8 -7
  22. package/dist/api.mjs +5 -5
  23. package/dist/{app-manifest.d-CaAcaukR.d.ts → app-manifest.d-DY4JfJxi.d.ts} +1 -1
  24. package/dist/{app-manifest.d-_BVbI0xp.d.mts → app-manifest.d-DpDK_B1k.d.mts} +1 -1
  25. package/dist/app-markdown.cjs +7 -4
  26. package/dist/app-markdown.d.mts +5 -4
  27. package/dist/app-markdown.d.ts +5 -4
  28. package/dist/app-markdown.mjs +6 -3
  29. package/dist/{app.d-BWeDqOaF.d.ts → app.d-BeK6bb1c.d.ts} +22 -10
  30. package/dist/{app.d-CaPwtytN.d.mts → app.d-D-5UNrFd.d.mts} +22 -10
  31. package/dist/{base-path.d-CTDVF0Fc.d.mts → base-path.d-BJ3SYpB8.d.mts} +6 -1
  32. package/dist/{base-path.d-CTDVF0Fc.d.ts → base-path.d-BJ3SYpB8.d.ts} +6 -1
  33. package/dist/{chunk-4ZXKYCYK.mjs → chunk-255J7K4X.mjs} +1 -1
  34. package/dist/{chunk-RVGLYMJM.cjs → chunk-2AM26UGI.cjs} +2 -2
  35. package/dist/{chunk-5TOWKGV3.mjs → chunk-2CQC5CMD.mjs} +1 -1
  36. package/dist/{chunk-VO65MYJD.cjs → chunk-2IFT2CSA.cjs} +4 -4
  37. package/dist/{chunk-UPOYKX4S.cjs → chunk-2MR4MABG.cjs} +4 -4
  38. package/dist/chunk-2RCCFB2Y.cjs +129 -0
  39. package/dist/{chunk-K6VFYFOY.cjs → chunk-2W4GNXGX.cjs} +2 -2
  40. package/dist/{chunk-CV6MFQ4Y.mjs → chunk-3AUINHFG.mjs} +1 -1
  41. package/dist/{chunk-TKYOJ5G2.cjs → chunk-3BQ7QHUH.cjs} +5 -5
  42. package/dist/{chunk-MMDKYJ5V.cjs → chunk-3GNVIYPO.cjs} +7 -7
  43. package/dist/{chunk-65Y5SIBH.cjs → chunk-3QM74STY.cjs} +1 -1
  44. package/dist/{chunk-FJMC24KG.cjs → chunk-42KMUIWZ.cjs} +0 -3
  45. package/dist/{chunk-YVPX5PI5.mjs → chunk-4O26BPUY.mjs} +8 -0
  46. package/dist/{chunk-PDQ6EGPK.mjs → chunk-4OD2LXF2.mjs} +2 -2
  47. package/dist/{chunk-LENKRGBV.mjs → chunk-5CFHQ7HM.mjs} +1 -1
  48. package/dist/{chunk-3Y52TWYU.mjs → chunk-62ZRA7XU.mjs} +0 -3
  49. package/dist/{chunk-K76CBYQM.mjs → chunk-7A3URI2F.mjs} +20 -0
  50. package/dist/{chunk-UHU4QALN.mjs → chunk-7BUE2GM6.mjs} +294 -164
  51. package/dist/{chunk-L6NWQ3DR.cjs → chunk-7OHJWFLB.cjs} +600 -469
  52. package/dist/{chunk-VX2HZGC7.cjs → chunk-ACGBXN3U.cjs} +2 -2
  53. package/dist/{chunk-MV7NWU23.mjs → chunk-AYVGD3PK.mjs} +1 -1
  54. package/dist/{chunk-FT6KJHS3.cjs → chunk-C2JOS77Z.cjs} +4 -1
  55. package/dist/{chunk-CRVSYDHV.mjs → chunk-CKQAQFF6.mjs} +2 -2
  56. package/dist/{chunk-QOGIZKSO.cjs → chunk-CSQPMV3Q.cjs} +21 -11
  57. package/dist/chunk-DC2AXGNZ.mjs +129 -0
  58. package/dist/{chunk-Q4HH5Q6A.cjs → chunk-DMXMIE2C.cjs} +2 -2
  59. package/dist/{chunk-MAGFDK4Q.mjs → chunk-DPIGYXSV.mjs} +1 -1
  60. package/dist/{chunk-GUMKIQJL.cjs → chunk-DPYBVVL3.cjs} +2 -2
  61. package/dist/{chunk-23VJEGKC.cjs → chunk-DVJM55D2.cjs} +9 -1
  62. package/dist/{chunk-QSUYB3RH.cjs → chunk-DZHTNSQ5.cjs} +14 -14
  63. package/dist/{chunk-OIOPQ25L.mjs → chunk-E77IA5IF.mjs} +46 -33
  64. package/dist/{chunk-EZTKXD6P.cjs → chunk-FDGYDQGL.cjs} +8 -1
  65. package/dist/{chunk-PLJKJJ2H.mjs → chunk-FETMUBIA.mjs} +27 -82
  66. package/dist/{chunk-HJZZSBVK.cjs → chunk-FILXOEWD.cjs} +2 -2
  67. package/dist/{chunk-PDFFYZAT.cjs → chunk-GF22VGMS.cjs} +2 -2
  68. package/dist/{chunk-IYLZZTP6.mjs → chunk-GUU3IZSM.mjs} +167 -77
  69. package/dist/{chunk-OOJBBHYW.cjs → chunk-GVYZCJZH.cjs} +30 -1
  70. package/dist/{chunk-YOHHL2UE.mjs → chunk-I4KPA2C6.mjs} +1 -1
  71. package/dist/{chunk-PEYDQMSA.mjs → chunk-IGXS54GC.mjs} +6 -6
  72. package/dist/{chunk-NVOMQLI2.mjs → chunk-IWJONXPF.mjs} +11 -0
  73. package/dist/{chunk-SZORL7EW.mjs → chunk-IYDJNCR7.mjs} +6 -6
  74. package/dist/{chunk-HEJM46HQ.mjs → chunk-J5ASGNKF.mjs} +28 -2
  75. package/dist/{chunk-RLH5AH2M.mjs → chunk-JDO346NV.mjs} +1 -1
  76. package/dist/{chunk-K6SXMVXO.mjs → chunk-JMFTKNBA.mjs} +22 -7
  77. package/dist/{chunk-YIHRZBD7.cjs → chunk-JRGR5Z4K.cjs} +1 -1
  78. package/dist/{chunk-4W4ZWSV2.cjs → chunk-JVA4PIYN.cjs} +604 -434
  79. package/dist/{chunk-UKZ6AWKZ.cjs → chunk-JWY66PID.cjs} +44 -1
  80. package/dist/{chunk-BDYM2TN3.cjs → chunk-JX5VOLAV.cjs} +8 -8
  81. package/dist/{chunk-WMLSZAKN.mjs → chunk-JZQS3ZOI.mjs} +1 -1
  82. package/dist/{chunk-OFBLGH6V.cjs → chunk-K66JILV3.cjs} +47 -34
  83. package/dist/{chunk-6GQJVY4E.cjs → chunk-KEB7AGS6.cjs} +17 -17
  84. package/dist/{chunk-IFR74W6S.mjs → chunk-KPJYBSHL.mjs} +4 -1
  85. package/dist/{chunk-TEJ67GD2.mjs → chunk-KQAB5LML.mjs} +28 -6
  86. package/dist/{chunk-DHR2WDSL.cjs → chunk-KWST2O22.cjs} +387 -297
  87. package/dist/{chunk-3EEINK7G.cjs → chunk-L6E4SHUB.cjs} +41 -15
  88. package/dist/{chunk-KI3MU7B5.mjs → chunk-LDVJIBGN.mjs} +1 -1
  89. package/dist/{chunk-5FBZJJGA.mjs → chunk-LXEJNWF5.mjs} +2 -2
  90. package/dist/{chunk-AKIQ54FK.cjs → chunk-MBCRWU3P.cjs} +26 -81
  91. package/dist/{chunk-22LGTSBA.cjs → chunk-MEJCP2LX.cjs} +1 -1
  92. package/dist/{chunk-ZR2QB45W.mjs → chunk-MITIAOUQ.mjs} +4 -4
  93. package/dist/{chunk-OCNV4CI2.cjs → chunk-MQ4DYVFS.cjs} +26 -0
  94. package/dist/{chunk-P2NBQ5JI.mjs → chunk-MWUDEYBI.mjs} +1 -1
  95. package/dist/{chunk-LR4KP3I7.cjs → chunk-N3XO5AL5.cjs} +2 -2
  96. package/dist/{chunk-ZPKJPM7K.mjs → chunk-NA77GEIU.mjs} +2 -2
  97. package/dist/{chunk-FVYBEMOD.cjs → chunk-NAXKOTPP.cjs} +6 -6
  98. package/dist/{chunk-I7J5RLGO.cjs → chunk-NLBHLPEO.cjs} +12 -1
  99. package/dist/{chunk-R2ZHU37O.mjs → chunk-NLRAQXAA.mjs} +26 -0
  100. package/dist/{chunk-QO43L7Z4.cjs → chunk-O32QPFVV.cjs} +25 -7
  101. package/dist/{chunk-CO6UYM2D.mjs → chunk-O5QUJEWT.mjs} +1 -1
  102. package/dist/{chunk-JL2YW5KX.mjs → chunk-OAEDVXVE.mjs} +44 -1
  103. package/dist/{chunk-F6YLXK5L.cjs → chunk-PLXD2MJV.cjs} +19 -19
  104. package/dist/{chunk-JFPKARWM.cjs → chunk-PMU4U2W2.cjs} +1 -0
  105. package/dist/{chunk-GTQOEEE7.cjs → chunk-Q5HMVGR5.cjs} +13 -13
  106. package/dist/{chunk-ZYCEEE3V.mjs → chunk-QUFENL7Q.mjs} +2 -2
  107. package/dist/{chunk-QOSDWGKT.mjs → chunk-QVBXTSIZ.mjs} +1 -1
  108. package/dist/{chunk-OGVTUGMU.mjs → chunk-REP6HWJN.mjs} +13 -3
  109. package/dist/{chunk-ANMIR6US.mjs → chunk-RJUCNO7R.mjs} +1 -1
  110. package/dist/{chunk-WYL4ODZ4.mjs → chunk-SE7HPBYK.mjs} +30 -1
  111. package/dist/{chunk-GQ6QOH7T.cjs → chunk-SXMWVP2L.cjs} +12 -12
  112. package/dist/{chunk-D5F7RPZP.mjs → chunk-THG2TVDH.mjs} +3 -3
  113. package/dist/{chunk-X3MHKLCO.cjs → chunk-TP4RAV7Y.cjs} +25 -10
  114. package/dist/{chunk-DWLNLU55.cjs → chunk-TPYAYFMF.cjs} +2 -2
  115. package/dist/{chunk-Y6KHPJDB.cjs → chunk-U7VH3Q5E.cjs} +2 -2
  116. package/dist/{chunk-4JRAMCUP.cjs → chunk-UISZLYKY.cjs} +22 -22
  117. package/dist/{chunk-CKCKCUYO.mjs → chunk-UQUOSNRN.mjs} +511 -341
  118. package/dist/{chunk-2P7UYHZP.mjs → chunk-V25GSH43.mjs} +1 -1
  119. package/dist/{chunk-437QZIC2.cjs → chunk-VNBDN5W2.cjs} +5 -5
  120. package/dist/{chunk-ABIBASLJ.cjs → chunk-VXB5CMNC.cjs} +2 -2
  121. package/dist/{chunk-G7NBPP7H.mjs → chunk-W2T6NDNP.mjs} +11 -1
  122. package/dist/{chunk-AJNBTOVQ.mjs → chunk-WW3LRNQV.mjs} +1 -1
  123. package/dist/{chunk-GFPS7MNE.mjs → chunk-WX63N6C5.mjs} +4 -4
  124. package/dist/{chunk-ULMXZYOA.mjs → chunk-X7LGLF33.mjs} +1 -1
  125. package/dist/{chunk-VOQ7XZZT.cjs → chunk-Y2SZVIVH.cjs} +20 -0
  126. package/dist/{chunk-XCAQTCGK.mjs → chunk-YBY34UHB.mjs} +1 -1
  127. package/dist/{chunk-5NFQ6AZI.cjs → chunk-YCNHUIPR.cjs} +33 -11
  128. package/dist/{chunk-YGJ5P3TJ.mjs → chunk-Z3GPAFIA.mjs} +21 -3
  129. package/dist/{chunk-PJQ5W356.mjs → chunk-Z5ZZAGIH.mjs} +1 -0
  130. package/dist/{chunk-L5OZN6YW.cjs → chunk-ZPUAOKHV.cjs} +3 -3
  131. package/dist/{chunk-4E57QHPW.cjs → chunk-ZUVAGMQ5.cjs} +17 -7
  132. package/dist/{chunk-23LVFSID.mjs → chunk-ZXDX7VYZ.mjs} +7 -0
  133. package/dist/{client-component.d-CnEeVvGG.d.mts → client-component.d-DwpH251K.d.mts} +2 -2
  134. package/dist/{client-component.d-CfJxuXZl.d.ts → client-component.d-fYupugbZ.d.ts} +2 -2
  135. package/dist/{client-plugins.d-D7dHV1Nf.d.ts → client-plugins.d-BxqFfHpM.d.ts} +39 -3
  136. package/dist/{client-plugins.d-Do5ULA0x.d.mts → client-plugins.d-k3bOT5gz.d.mts} +39 -3
  137. package/dist/client-plugins.d.mts +3 -2
  138. package/dist/client-plugins.d.ts +3 -2
  139. package/dist/client.cjs +6 -6
  140. package/dist/client.d.mts +8 -7
  141. package/dist/client.d.ts +8 -7
  142. package/dist/client.mjs +5 -5
  143. package/dist/config.d.mts +3 -2
  144. package/dist/config.d.ts +3 -2
  145. package/dist/deployment.cjs +4 -2
  146. package/dist/deployment.d.mts +7 -1
  147. package/dist/deployment.d.ts +7 -1
  148. package/dist/deployment.mjs +5 -3
  149. package/dist/desktop.d.mts +4 -3
  150. package/dist/desktop.d.ts +4 -3
  151. package/dist/{dev-guard-ONNMVQUN.mjs → dev-guard-ZDIELV6Q.mjs} +1 -1
  152. package/dist/{dev-guard-2UW2KERP.cjs → dev-guard-ZLLKVO5T.cjs} +2 -2
  153. package/dist/{devtools-BP4EBTKQ.mjs → devtools-6MXPFPNJ.mjs} +9 -8
  154. package/dist/{devtools-7HNDS4SY.cjs → devtools-O5625KCK.cjs} +10 -9
  155. package/dist/docs.cjs +13 -12
  156. package/dist/docs.d.mts +4 -3
  157. package/dist/docs.d.ts +4 -3
  158. package/dist/docs.mjs +12 -11
  159. package/dist/environment/vite.cjs +3 -3
  160. package/dist/environment/vite.mjs +2 -2
  161. package/dist/headers.d-DalIGbVO.d.ts +18 -0
  162. package/dist/headers.d-sNT7ZQiU.d.mts +18 -0
  163. package/dist/i18n/client.cjs +2 -2
  164. package/dist/i18n/client.d.mts +2 -2
  165. package/dist/i18n/client.d.ts +2 -2
  166. package/dist/i18n/client.mjs +1 -1
  167. package/dist/i18n/index.cjs +2 -2
  168. package/dist/i18n/index.d.mts +3 -3
  169. package/dist/i18n/index.d.ts +3 -3
  170. package/dist/i18n/index.mjs +1 -1
  171. package/dist/i18n/server.cjs +3 -3
  172. package/dist/i18n/server.d.mts +5 -5
  173. package/dist/i18n/server.d.ts +5 -5
  174. package/dist/i18n/server.mjs +2 -2
  175. package/dist/index.cjs +50 -45
  176. package/dist/{index.d-CVFk37uX.d.ts → index.d-BcA-secm.d.ts} +1 -1
  177. package/dist/{index.d-B1MpEJAo.d.mts → index.d-DDHHAv7j.d.mts} +1 -1
  178. package/dist/index.d.mts +26 -24
  179. package/dist/index.d.ts +26 -24
  180. package/dist/index.mjs +63 -58
  181. package/dist/integrations/orm.d.mts +3 -2
  182. package/dist/integrations/orm.d.ts +3 -2
  183. package/dist/integrations.cjs +3 -3
  184. package/dist/integrations.d.mts +3 -2
  185. package/dist/integrations.d.ts +3 -2
  186. package/dist/integrations.mjs +2 -2
  187. package/dist/internal/app-markdown-runtime.cjs +6 -3
  188. package/dist/internal/app-markdown-runtime.d.mts +13 -4
  189. package/dist/internal/app-markdown-runtime.d.ts +13 -4
  190. package/dist/internal/app-markdown-runtime.mjs +5 -2
  191. package/dist/internal/build-runtime.cjs +37 -37
  192. package/dist/internal/build-runtime.d.mts +5 -4
  193. package/dist/internal/build-runtime.d.ts +5 -4
  194. package/dist/internal/build-runtime.mjs +36 -36
  195. package/dist/internal/cli-runtime.cjs +18 -15
  196. package/dist/internal/cli-runtime.mjs +17 -14
  197. package/dist/internal/client-error-overlay.cjs +4 -4
  198. package/dist/internal/client-error-overlay.mjs +1 -1
  199. package/dist/internal/client-runtime.cjs +5 -3
  200. package/dist/internal/client-runtime.d.mts +17 -7
  201. package/dist/internal/client-runtime.d.ts +17 -7
  202. package/dist/internal/client-runtime.mjs +4 -2
  203. package/dist/internal/compression-runtime.d.mts +3 -2
  204. package/dist/internal/compression-runtime.d.ts +3 -2
  205. package/dist/internal/config-runtime.cjs +11 -10
  206. package/dist/internal/config-runtime.d.mts +6 -5
  207. package/dist/internal/config-runtime.d.ts +6 -5
  208. package/dist/internal/config-runtime.mjs +10 -9
  209. package/dist/internal/infra-analytics-runtime.cjs +12 -9
  210. package/dist/internal/infra-analytics-runtime.mjs +10 -7
  211. package/dist/internal/native-server-fns.cjs +4 -4
  212. package/dist/internal/native-server-fns.mjs +3 -3
  213. package/dist/internal/product-telemetry-runtime.cjs +3 -3
  214. package/dist/internal/product-telemetry-runtime.mjs +2 -2
  215. package/dist/internal/production-runtime.cjs +48 -17
  216. package/dist/internal/production-runtime.d.mts +53 -18
  217. package/dist/internal/production-runtime.d.ts +53 -18
  218. package/dist/internal/production-runtime.mjs +50 -19
  219. package/dist/internal/vercel-edge-middleware.cjs +3 -2
  220. package/dist/internal/vercel-edge-middleware.d.mts +2 -2
  221. package/dist/internal/vercel-edge-middleware.d.ts +2 -2
  222. package/dist/internal/vercel-edge-middleware.mjs +2 -1
  223. package/dist/markdown.cjs +3 -2
  224. package/dist/markdown.d.mts +3 -2
  225. package/dist/markdown.d.ts +3 -2
  226. package/dist/markdown.mjs +2 -1
  227. package/dist/middleware.cjs +6 -5
  228. package/dist/middleware.d.mts +4 -3
  229. package/dist/middleware.d.ts +4 -3
  230. package/dist/middleware.mjs +5 -4
  231. package/dist/mobile.d.mts +3 -3
  232. package/dist/mobile.d.ts +3 -3
  233. package/dist/{mount.d-CBqr-LfI.d.mts → mount.d-C1PONsEe.d.mts} +1 -1
  234. package/dist/{mount.d-CGzN61Kq.d.ts → mount.d-D3JOux2V.d.ts} +1 -1
  235. package/dist/{native-tree-W2SSJB3Y.cjs → native-tree-GF4BH33L.cjs} +4 -3
  236. package/dist/{native-tree-Y5YQANW7.mjs → native-tree-L2IIEBXH.mjs} +3 -2
  237. package/dist/{navigation-delegate.d-BwCOhpj7.d.mts → navigation-delegate.d-CJQQHboA.d.mts} +1 -1
  238. package/dist/{navigation-delegate.d-CLH2dXjy.d.ts → navigation-delegate.d-CQQPbdkE.d.ts} +1 -1
  239. package/dist/navigation.cjs +5 -5
  240. package/dist/navigation.d.mts +6 -5
  241. package/dist/navigation.d.ts +6 -5
  242. package/dist/navigation.mjs +4 -4
  243. package/dist/{nitro-Y3LGITW3.cjs → nitro-2LMOMIST.cjs} +2 -2
  244. package/dist/{nitro-NSTXT7LB.mjs → nitro-72TFIGGO.mjs} +1 -1
  245. package/dist/{plugin-F2O4BFTK.cjs → plugin-5PIQQVRP.cjs} +2 -2
  246. package/dist/{plugin-VEBRN7A3.mjs → plugin-QZT747YW.mjs} +1 -1
  247. package/dist/plugin.cjs +30 -29
  248. package/dist/plugin.d.mts +6 -4
  249. package/dist/plugin.d.ts +6 -4
  250. package/dist/plugin.mjs +29 -28
  251. package/dist/{production-runtime.d-DMZY3OgV.d.mts → production-runtime.d-B0IeWWyO.d.mts} +23 -2
  252. package/dist/{production-runtime.d-BMyyLGBB.d.ts → production-runtime.d-q3aHIv5Y.d.ts} +23 -2
  253. package/dist/query/client.cjs +6 -6
  254. package/dist/query/client.mjs +2 -2
  255. package/dist/{render-plan.d-CzGDjcT0.d.mts → render-plan.d-CiUj0rq5.d.mts} +1 -1
  256. package/dist/{render-plan.d-W6LmjD6y.d.ts → render-plan.d-DHuJMJRP.d.ts} +1 -1
  257. package/dist/renderer-client.cjs +7 -7
  258. package/dist/renderer-client.d.mts +6 -5
  259. package/dist/renderer-client.d.ts +6 -5
  260. package/dist/renderer-client.mjs +3 -3
  261. package/dist/{request.d-CgNVderU.d.mts → request.d-D-F7o7tb.d.mts} +1 -1
  262. package/dist/{request.d-CTVRZiQv.d.ts → request.d-DRUbOmYD.d.ts} +1 -1
  263. package/dist/request.d.mts +4 -3
  264. package/dist/request.d.ts +4 -3
  265. package/dist/{resolver.d-JnZKKsc5.d.mts → resolver.d-9iKC79CU.d.mts} +1 -1
  266. package/dist/{resolver.d-BHyZgpa7.d.ts → resolver.d-CY6mEa_F.d.ts} +1 -1
  267. package/dist/response.d-B_MtBCnF.d.mts +12 -0
  268. package/dist/response.d-B_MtBCnF.d.ts +12 -0
  269. package/dist/{route-rendering.d-D0bmZVJA.d.mts → route-rendering.d-6smgwT2t.d.mts} +9 -2
  270. package/dist/{route-rendering.d-FDSNtCMg.d.ts → route-rendering.d-KwqM_mlK.d.ts} +9 -2
  271. package/dist/{router.d-DZ3ldniI.d.ts → router.d-B6sesMRD.d.ts} +1 -1
  272. package/dist/{router.d-GRKm_uAV.d.mts → router.d-BYmDeDlp.d.mts} +1 -1
  273. package/dist/{routes.d-CrEy0lJS.d.mts → routes.d-D3aJw1H5.d.mts} +1 -1
  274. package/dist/{routes.d-9GFFNioh.d.ts → routes.d-K-Qg79AA.d.ts} +1 -1
  275. package/dist/routes.d.mts +3 -2
  276. package/dist/routes.d.ts +3 -2
  277. package/dist/{index.d-BNNDpql4.d.ts → routing.d-BxOZ2YWc.d.ts} +1 -2
  278. package/dist/{index.d-BqcfqJvt.d.mts → routing.d-DwSUVZbF.d.mts} +1 -2
  279. package/dist/{rsc-pipeline-J4KKBSCH.cjs → rsc-pipeline-P4PCWDO2.cjs} +14 -13
  280. package/dist/{rsc-pipeline-PJZOVYSY.mjs → rsc-pipeline-R2GOKIMU.mjs} +13 -12
  281. package/dist/{runtime-QDBSE4H6.mjs → runtime-DP5DYGW5.mjs} +12 -11
  282. package/dist/{runtime-OLEO5NXF.cjs → runtime-WA2Q4SLG.cjs} +20 -19
  283. package/dist/{runtime.d-DqXihlxm.d.mts → runtime.d-BFSJf-ww.d.mts} +1 -1
  284. package/dist/{runtime.d-BtL3PCL3.d.ts → runtime.d-B_uPfMjA.d.ts} +2 -2
  285. package/dist/{runtime.d-pqFQBU2N.d.ts → runtime.d-CbdMI0Oy.d.ts} +1 -1
  286. package/dist/{runtime.d-3iJAKptR.d.mts → runtime.d-nUz0HAL4.d.mts} +2 -2
  287. package/dist/server-plugins.cjs +3 -2
  288. package/dist/server-plugins.d.mts +6 -12
  289. package/dist/server-plugins.d.ts +6 -12
  290. package/dist/server-plugins.mjs +2 -1
  291. package/dist/server.cjs +64 -56
  292. package/dist/server.d.mts +23 -14
  293. package/dist/server.d.ts +23 -14
  294. package/dist/server.mjs +40 -32
  295. package/dist/{spa-router.d-Dhvy60p4.d.mts → spa-router.d-D4EDwR20.d.mts} +3 -3
  296. package/dist/{spa-router.d-DhOhaQ-7.d.ts → spa-router.d-mC1D5cTN.d.ts} +3 -3
  297. package/dist/testing.cjs +3 -3
  298. package/dist/testing.d.mts +3 -2
  299. package/dist/testing.d.ts +3 -2
  300. package/dist/testing.mjs +3 -3
  301. package/dist/{types.d-C41ePjvP.d.ts → types.d-wVRlLtBf.d.mts} +1 -1
  302. package/dist/{types.d-C41ePjvP.d.mts → types.d-wVRlLtBf.d.ts} +1 -1
  303. package/dist/{utils.d-BVCMRRau.d.ts → utils.d-A2X3a6z_.d.ts} +1 -1
  304. package/dist/{utils.d-Q8EHCpkF.d.mts → utils.d-DxMzteqE.d.mts} +1 -1
  305. package/dist/version.cjs +2 -2
  306. package/dist/version.mjs +1 -1
  307. package/dist/vite.cjs +37 -29
  308. package/dist/vite.d.mts +28 -6
  309. package/dist/vite.d.ts +28 -6
  310. package/dist/vite.mjs +36 -28
  311. package/package.json +3 -3
  312. package/dist/analyzer-SAJSV6SP.cjs +0 -16
  313. package/dist/response.d-BolW0Vx_.d.mts +0 -10
  314. package/dist/response.d-BolW0Vx_.d.ts +0 -10
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  resolveFarmAppClientEntry,
3
3
  resolveFarmClientPlugins
4
- } from "./chunk-YOHHL2UE.mjs";
4
+ } from "./chunk-I4KPA2C6.mjs";
5
5
  import {
6
6
  resolveFarmPlatform
7
7
  } from "./chunk-SMUW7UST.mjs";
@@ -9,7 +9,7 @@ import {
9
9
  collectSSGPages,
10
10
  matchSSGPage,
11
11
  resolveRouteRenderingConfigFromFile
12
- } from "./chunk-G7NBPP7H.mjs";
12
+ } from "./chunk-W2T6NDNP.mjs";
13
13
  import {
14
14
  createFarmMetadataImageResponse
15
15
  } from "./chunk-CROAFCMW.mjs";
@@ -39,10 +39,10 @@ import {
39
39
  renderFarmLocaleAlternateLinks,
40
40
  resolveDefaultErrorStatus,
41
41
  routeBoundaryCoversDirectory
42
- } from "./chunk-ZPKJPM7K.mjs";
42
+ } from "./chunk-NA77GEIU.mjs";
43
43
  import {
44
44
  listFarmMCPLlmsTxtLinks
45
- } from "./chunk-ZR2QB45W.mjs";
45
+ } from "./chunk-MITIAOUQ.mjs";
46
46
  import {
47
47
  FARM_DEFAULT_MCP_PATH,
48
48
  collectFarmDefaultMCPPages,
@@ -50,7 +50,7 @@ import {
50
50
  farmConfigMountsMCP,
51
51
  isFarmDefaultMCPPathname,
52
52
  resolveFarmDefaultMCPServer
53
- } from "./chunk-K6SXMVXO.mjs";
53
+ } from "./chunk-JMFTKNBA.mjs";
54
54
  import {
55
55
  getFarmFormState,
56
56
  handleFarmFormActionRequest,
@@ -76,7 +76,7 @@ import {
76
76
  resolveProgrammaticClientRoutes,
77
77
  runWithPackageClientBoundaryCacheFile,
78
78
  usesFarmServerTree
79
- } from "./chunk-ULMXZYOA.mjs";
79
+ } from "./chunk-X7LGLF33.mjs";
80
80
  import {
81
81
  FARM_ISLAND_REPLAYABLE_SELECTOR
82
82
  } from "./chunk-S32PDOLO.mjs";
@@ -93,7 +93,7 @@ import {
93
93
  } from "./chunk-TPA2PV5J.mjs";
94
94
  import {
95
95
  normalizeRouteRules
96
- } from "./chunk-R2ZHU37O.mjs";
96
+ } from "./chunk-NLRAQXAA.mjs";
97
97
  import {
98
98
  resolveFarmDevtoolsConfig
99
99
  } from "./chunk-CU5SYTJG.mjs";
@@ -103,7 +103,7 @@ import {
103
103
  resolveFarmAgentCrawlers,
104
104
  resolveFarmAgentSitemap,
105
105
  resolveFarmPerformanceConfig
106
- } from "./chunk-OGVTUGMU.mjs";
106
+ } from "./chunk-REP6HWJN.mjs";
107
107
  import {
108
108
  collectFarmLlmsTxtPages,
109
109
  createFarmDefaultLlmsTxt,
@@ -113,7 +113,7 @@ import {
113
113
  renderFarmLlmsFullTxt,
114
114
  resolveFarmAgentOrigin,
115
115
  resolveFarmLlmsTxtConfig
116
- } from "./chunk-YGJ5P3TJ.mjs";
116
+ } from "./chunk-Z3GPAFIA.mjs";
117
117
  import {
118
118
  createFarmCspNonce,
119
119
  createFarmCspNonceRewriter,
@@ -154,10 +154,10 @@ import {
154
154
  import {
155
155
  createFarmMarkdownRouteModuleFromFile,
156
156
  loadFarmMdxComponents
157
- } from "./chunk-MV7NWU23.mjs";
157
+ } from "./chunk-AYVGD3PK.mjs";
158
158
  import {
159
159
  isFarmMarkdownPageFile
160
- } from "./chunk-HEJM46HQ.mjs";
160
+ } from "./chunk-J5ASGNKF.mjs";
161
161
  import {
162
162
  resolveFarmMdxComponentsModulePath,
163
163
  resolveMdxConfig
@@ -170,7 +170,7 @@ import {
170
170
  farmRequestWantsMarkdown,
171
171
  getFarmMarkdownAlternatePath,
172
172
  resolveMarkdownConfig
173
- } from "./chunk-IFR74W6S.mjs";
173
+ } from "./chunk-KPJYBSHL.mjs";
174
174
  import {
175
175
  resolveWorkflowsConfig
176
176
  } from "./chunk-MGZVDX4R.mjs";
@@ -181,7 +181,7 @@ import {
181
181
  getIntegrationProviders,
182
182
  getRegisteredIntegrationAPIManifest,
183
183
  isFarmIntegrationProviderComponentReference
184
- } from "./chunk-AJNBTOVQ.mjs";
184
+ } from "./chunk-WW3LRNQV.mjs";
185
185
  import {
186
186
  initStorage
187
187
  } from "./chunk-TJVUTGED.mjs";
@@ -208,7 +208,7 @@ import {
208
208
  _setDefaultFarmI18nRuntime,
209
209
  createFarmI18nRuntime,
210
210
  getFarmI18nClientSnapshot
211
- } from "./chunk-CV6MFQ4Y.mjs";
211
+ } from "./chunk-3AUINHFG.mjs";
212
212
  import {
213
213
  formatOptionalPeerInstallHint,
214
214
  isOptionalPeerInstalled
@@ -234,7 +234,7 @@ import {
234
234
  } from "./chunk-RLEALQEN.mjs";
235
235
  import {
236
236
  sendWebResponse
237
- } from "./chunk-CO6UYM2D.mjs";
237
+ } from "./chunk-O5QUJEWT.mjs";
238
238
  import {
239
239
  toFileModuleUrl
240
240
  } from "./chunk-VHIXGZYH.mjs";
@@ -278,18 +278,18 @@ import {
278
278
  } from "./chunk-2DA7CLY7.mjs";
279
279
  import {
280
280
  FARM_VERSION
281
- } from "./chunk-ANMIR6US.mjs";
281
+ } from "./chunk-RJUCNO7R.mjs";
282
282
  import {
283
283
  resolveFarmTrailingSlashRedirect,
284
284
  setFarmTrailingSlashPreference
285
- } from "./chunk-YVPX5PI5.mjs";
285
+ } from "./chunk-4O26BPUY.mjs";
286
286
  import {
287
287
  normalizeFarmAPIConfig
288
288
  } from "./chunk-W6QLRQ3V.mjs";
289
289
  import {
290
290
  createFarmLocaleCookie,
291
291
  getFarmLocaleVaryHeaders
292
- } from "./chunk-K76CBYQM.mjs";
292
+ } from "./chunk-7A3URI2F.mjs";
293
293
  import {
294
294
  getFarmPageDataRedirect
295
295
  } from "./chunk-SD6JGJOM.mjs";
@@ -302,14 +302,17 @@ import {
302
302
  renderViewportHead,
303
303
  resolveFarmNotFoundMetadata
304
304
  } from "./chunk-S6O2L47H.mjs";
305
- import {
306
- FARM_DEPLOYMENT_ID_HEADER,
307
- createFarmDeploymentCookie
308
- } from "./chunk-NVOMQLI2.mjs";
309
305
  import {
310
306
  prepareDeferredData,
311
307
  snapshotDeferredData
312
308
  } from "./chunk-7BIW7VCW.mjs";
309
+ import {
310
+ FARM_DEPLOYMENT_ID_HEADER,
311
+ createFarmDeploymentCookie,
312
+ createFarmDeploymentMismatchResponse,
313
+ getFarmDeploymentMismatch,
314
+ withoutFarmDeploymentCookie
315
+ } from "./chunk-IWJONXPF.mjs";
313
316
  import {
314
317
  createFarmCacheKey
315
318
  } from "./chunk-GLOICKDO.mjs";
@@ -355,10 +358,6 @@ import {
355
358
  getRoutePatternShape
356
359
  } from "./chunk-AYP2YFVN.mjs";
357
360
 
358
- // src/routing/route-manager.ts
359
- import { realpathSync } from "fs";
360
- import path2 from "path";
361
-
362
361
  // src/static-metadata-image.ts
363
362
  import { createHash } from "crypto";
364
363
  import { readFile } from "fs/promises";
@@ -425,6 +424,8 @@ async function readAltText(filePath) {
425
424
  }
426
425
 
427
426
  // src/routing/route-manager.ts
427
+ import { realpathSync } from "fs";
428
+ import path2 from "path";
428
429
  function getRouteEntryDirectory(entry) {
429
430
  return entry.directory ?? entry.pattern;
430
431
  }
@@ -441,7 +442,7 @@ function getRouteSpecificity(entry) {
441
442
  function compareRouteEntries(left, right) {
442
443
  return compareRouteSpecificity(getRouteSpecificity(left), getRouteSpecificity(right));
443
444
  }
444
- var RouteManager = class {
445
+ var RouteManager = class _RouteManager {
445
446
  constructor(config, viteServer) {
446
447
  this.routes = /* @__PURE__ */ new Map();
447
448
  this.pageRouteShapes = /* @__PURE__ */ new Map();
@@ -457,6 +458,7 @@ var RouteManager = class {
457
458
  this.programmaticPages = /* @__PURE__ */ new Map();
458
459
  this.programmaticLayouts = /* @__PURE__ */ new Map();
459
460
  this.programmaticClientRoutes = mergeProgrammaticClientRoutes([]);
461
+ this.discovery = Promise.resolve();
460
462
  this.reportedIslandsErrors = /* @__PURE__ */ new Set();
461
463
  this.config = config;
462
464
  this.viteServer = viteServer;
@@ -466,23 +468,39 @@ var RouteManager = class {
466
468
  this.rendererRuntime = rendererRuntime;
467
469
  }
468
470
  /**
469
- * Discover all routes in the app directory
471
+ * Discover all routes in the app directory.
472
+ *
473
+ * Requests keep matching the current routes until discovery finishes. Discovery awaits file and
474
+ * module reads, and a dev server runs it again for each page or layout a watcher reports, so
475
+ * clearing the tables first answered any request in between with a 404. Discoveries run one at
476
+ * a time, so an older scan never replaces a newer one.
470
477
  */
471
- async discoverRoutes() {
472
- this.invalidateClientManifest();
473
- this.routes.clear();
474
- this.pageRouteShapes.clear();
475
- this.layouts.clear();
476
- this.orderedLayouts = [];
477
- this.routeSlots.clear();
478
- this.routeSlotOwnerSegments.clear();
479
- this.loadings.clear();
480
- this.errors.clear();
481
- this.metadataImages.clear();
482
- this.metadataRoutes.clear();
483
- this.redirects.clear();
484
- this.programmaticPages.clear();
485
- this.programmaticLayouts.clear();
478
+ discoverRoutes() {
479
+ const discovery = this.discovery.catch(() => {
480
+ }).then(async () => {
481
+ const next = new _RouteManager(this.config, this.viteServer);
482
+ await next.discoverInto();
483
+ this.invalidateClientManifest();
484
+ this.routes = next.routes;
485
+ this.pageRouteShapes = next.pageRouteShapes;
486
+ this.layouts = next.layouts;
487
+ this.orderedLayouts = next.orderedLayouts;
488
+ this.routeSlots = next.routeSlots;
489
+ this.routeSlotOwnerSegments = next.routeSlotOwnerSegments;
490
+ this.loadings = next.loadings;
491
+ this.errors = next.errors;
492
+ this.metadataImages = next.metadataImages;
493
+ this.metadataRoutes = next.metadataRoutes;
494
+ this.redirects = next.redirects;
495
+ this.programmaticPages = next.programmaticPages;
496
+ this.programmaticLayouts = next.programmaticLayouts;
497
+ this.programmaticClientRoutes = next.programmaticClientRoutes;
498
+ });
499
+ this.discovery = discovery;
500
+ return discovery;
501
+ }
502
+ /** Fill this manager's empty route tables. Only a fresh manager made by discoverRoutes runs it. */
503
+ async discoverInto() {
486
504
  const programmaticClientRoutes = [];
487
505
  for (const source of getFarmSourceRoots(this.config)) {
488
506
  await this.discoverFileRoutes(source);
@@ -3309,6 +3327,12 @@ function warnSuppressedAsyncHydrationOnce(modulePath, reason) {
3309
3327
  }
3310
3328
  var fullDocumentRoutes = /* @__PURE__ */ new Set();
3311
3329
  var documentLayouts = /* @__PURE__ */ new WeakMap();
3330
+ var reportedRenderErrors = /* @__PURE__ */ new WeakMap();
3331
+ function emitFarmRenderError(req, route, error) {
3332
+ if (reportedRenderErrors.has(req) && reportedRenderErrors.get(req) === error) return;
3333
+ reportedRenderErrors.set(req, error);
3334
+ emitFarmEvent({ type: "render.error", route, error });
3335
+ }
3312
3336
  function hasRequestHeader(req, name) {
3313
3337
  const value = req.headers[name.toLowerCase()];
3314
3338
  return Array.isArray(value) ? value.length > 0 : Boolean(value);
@@ -3830,7 +3854,7 @@ var ServerRenderer = class {
3830
3854
  return createFarmCacheKey(["ssg", normalizeRevalidatePath(urlPath)]);
3831
3855
  }
3832
3856
  getPPRCacheKey(pathname, search = "", locale = "", origin = "") {
3833
- const key = ["ppr", locale, normalizeRevalidatePath(pathname), search];
3857
+ const key = ["ppr", locale, normalizeRevalidatePath(pathname), search, this.getDeploymentId()];
3834
3858
  return createFarmCacheKey(origin ? [...key, origin] : key);
3835
3859
  }
3836
3860
  getCachedSSGPage(urlPath) {
@@ -3886,7 +3910,7 @@ var ServerRenderer = class {
3886
3910
  if (method !== "GET" && method !== "HEAD") {
3887
3911
  return "method";
3888
3912
  }
3889
- if (req.headers.cookie) {
3913
+ if (withoutFarmDeploymentCookie(req.headers.cookie)) {
3890
3914
  return "cookie";
3891
3915
  }
3892
3916
  if (req.headers.authorization) {
@@ -4145,8 +4169,14 @@ var ServerRenderer = class {
4145
4169
  completeRender(res.statusCode || 200, pathname);
4146
4170
  return;
4147
4171
  }
4148
- this.applyDeploymentHeaders(req, res);
4149
4172
  const match = this.routeManager.matchRoute(pathname);
4173
+ const deploymentMismatch = match.route ? this.getDeploymentMismatch(req) : null;
4174
+ if (deploymentMismatch) {
4175
+ await sendWebResponse(res, createFarmDeploymentMismatchResponse(deploymentMismatch));
4176
+ completeRender(res.statusCode, match.route.pattern);
4177
+ return;
4178
+ }
4179
+ if (match.route) this.applyDeploymentHeaders(req, res);
4150
4180
  if (match.route) {
4151
4181
  const redirectLocation = resolveFarmTrailingSlashRedirect(url, this.config.trailingSlash);
4152
4182
  if (redirectLocation) {
@@ -4179,7 +4209,7 @@ var ServerRenderer = class {
4179
4209
  }
4180
4210
  emitFarmEvent({ type: "route.notFound", pathname });
4181
4211
  await this.render404(req, res);
4182
- completeRender(404);
4212
+ completeRender(res.statusCode);
4183
4213
  return;
4184
4214
  }
4185
4215
  emitFarmEvent({
@@ -4762,7 +4792,7 @@ var ServerRenderer = class {
4762
4792
  return;
4763
4793
  }
4764
4794
  }
4765
- emitFarmEvent({ type: "render.error", route: pathname, error });
4795
+ emitFarmRenderError(req, pathname, error);
4766
4796
  const errorStatus = resolveDefaultErrorStatus(error);
4767
4797
  if (pprRefreshRoute) {
4768
4798
  emitFarmEvent({
@@ -5107,7 +5137,9 @@ var ServerRenderer = class {
5107
5137
  origin: new URL(request2.url).origin,
5108
5138
  config: this.getAgentSitemap(),
5109
5139
  metadataBase: rootMetadata?.metadataBase,
5110
- basePath: this.config.basePath
5140
+ basePath: this.config.basePath,
5141
+ trailingSlash: this.config.trailingSlash,
5142
+ i18n: this.i18nRuntime?.config
5111
5143
  }
5112
5144
  );
5113
5145
  await sendWebResponse(
@@ -5178,11 +5210,15 @@ var ServerRenderer = class {
5178
5210
  const server = this.getDefaultMCPServer();
5179
5211
  const request2 = getCurrentRequestOrNull() ?? createWebRequestFromFarmRequest(req, { trustProxy: this.config.server?.trustProxy });
5180
5212
  try {
5181
- const { handleFarmDefaultMCPRequest } = await import("./agent-mcp-handler-AZ7QW4UP.mjs");
5213
+ const { handleFarmDefaultMCPRequest } = await import("./agent-mcp-handler-VIT4GOSR.mjs");
5182
5214
  const origin = new URL(request2.url).origin;
5215
+ const i18n = this.i18nRuntime?.config;
5216
+ const metadataBase = await this.getRootMetadataBase();
5183
5217
  const response = await handleFarmDefaultMCPRequest(request2, {
5184
5218
  server,
5185
5219
  basePath: this.config.basePath,
5220
+ i18n,
5221
+ metadataBase,
5186
5222
  listPages: async () => {
5187
5223
  const sources = await Promise.all(
5188
5224
  this.getAgentListedRoutes().map(async ([pattern, route]) => {
@@ -5195,8 +5231,11 @@ var ServerRenderer = class {
5195
5231
  sources.filter((source) => source !== null),
5196
5232
  {
5197
5233
  origin,
5234
+ metadataBase,
5198
5235
  basePath: this.config.basePath,
5199
- markdown: resolveMarkdownConfig(this.config.md)
5236
+ markdown: resolveMarkdownConfig(this.config.md),
5237
+ trailingSlash: this.config.trailingSlash,
5238
+ i18n
5200
5239
  }
5201
5240
  );
5202
5241
  },
@@ -5245,7 +5284,9 @@ var ServerRenderer = class {
5245
5284
  basePath: this.config.basePath,
5246
5285
  markdown: resolveMarkdownConfig(this.config.md),
5247
5286
  include: config.include,
5248
- exclude: config.exclude
5287
+ exclude: config.exclude,
5288
+ trailingSlash: this.config.trailingSlash,
5289
+ i18n: this.i18nRuntime?.config
5249
5290
  }
5250
5291
  );
5251
5292
  return {
@@ -5275,16 +5316,17 @@ var ServerRenderer = class {
5275
5316
  };
5276
5317
  }
5277
5318
  /**
5278
- * The origin llms.txt and llms-full.txt link to: the root layout's `metadataBase`, else the
5279
- * request's origin, as for the sitemap and the production server.
5319
+ * The origin llms.txt, llms-full.txt and list_pages link to: the root layout's
5320
+ * `metadataBase`, else the request's origin, as for the sitemap and the production server.
5280
5321
  */
5281
5322
  async getAgentOrigin(request2) {
5323
+ return resolveFarmAgentOrigin(await this.getRootMetadataBase(), new URL(request2.url).origin);
5324
+ }
5325
+ /** The root layout's `metadataBase`, which generated agent files and list_pages link to. */
5326
+ async getRootMetadataBase() {
5282
5327
  const rootLayout = this.routeManager.getLayouts().get("/");
5283
5328
  const rootMetadata = rootLayout ? (await this.routeManager.loadLayoutModule(rootLayout.modulePath)).metadata : void 0;
5284
- return resolveFarmAgentOrigin(
5285
- rootMetadata?.metadataBase,
5286
- new URL(request2.url).origin
5287
- );
5329
+ return rootMetadata?.metadataBase;
5288
5330
  }
5289
5331
  /**
5290
5332
  * Reads page mirrors back through this dev server, the way its .md handler
@@ -5651,7 +5693,7 @@ window.__FARM_I18N__ = ${getFarmI18nClientSnapshot() ? serializeInlineValue(getF
5651
5693
  durationMs: Date.now() - startedAt
5652
5694
  });
5653
5695
  } catch (error) {
5654
- emitFarmEvent({ type: "render.error", route, error });
5696
+ emitFarmRenderError(req, route, error);
5655
5697
  throw error;
5656
5698
  } finally {
5657
5699
  clearMiddlewareData?.();
@@ -6083,11 +6125,7 @@ window.__FARM_I18N__ = ${getFarmI18nClientSnapshot() ? serializeInlineValue(getF
6083
6125
  didError = true;
6084
6126
  if (!isWebResponse(error) && !isFarmRedirectError(error) && !isFarmNotFoundError(error)) {
6085
6127
  logger.error(`SSR shell error: ${error}`);
6086
- emitFarmEvent({
6087
- type: "render.error",
6088
- route: observabilityRoute,
6089
- error
6090
- });
6128
+ emitFarmRenderError(req, observabilityRoute, error);
6091
6129
  }
6092
6130
  if (clearMiddlewareData) {
6093
6131
  clearMiddlewareData();
@@ -6103,11 +6141,7 @@ window.__FARM_I18N__ = ${getFarmI18nClientSnapshot() ? serializeInlineValue(getF
6103
6141
  }
6104
6142
  if (!isWebResponse(error)) {
6105
6143
  logger.error(`SSR streaming error: ${error}`);
6106
- emitFarmEvent({
6107
- type: "render.error",
6108
- route: observabilityRoute,
6109
- error
6110
- });
6144
+ emitFarmRenderError(req, observabilityRoute, error);
6111
6145
  }
6112
6146
  }
6113
6147
  });
@@ -6218,6 +6252,14 @@ window.__FARM_I18N__ = ${getFarmI18nClientSnapshot() ? serializeInlineValue(getF
6218
6252
  res.end(JSON.stringify({ error: "Not found", pathname }));
6219
6253
  return;
6220
6254
  }
6255
+ if (res.getHeader(FARM_DEPLOYMENT_ID_HEADER) === void 0) {
6256
+ const deploymentMismatch = this.getDeploymentMismatch(req);
6257
+ if (deploymentMismatch) {
6258
+ await sendWebResponse(res, createFarmDeploymentMismatchResponse(deploymentMismatch));
6259
+ return;
6260
+ }
6261
+ this.applyDeploymentHeaders(req, res);
6262
+ }
6221
6263
  const acceptHeader = req.headers.accept;
6222
6264
  const accept = Array.isArray(acceptHeader) ? acceptHeader.join(",") : acceptHeader;
6223
6265
  if (farmRequestWantsMarkdown(pathname, accept)) {
@@ -6440,6 +6482,17 @@ ${clientScript}
6440
6482
  res.setHeader("Set-Cookie", cookie);
6441
6483
  }
6442
6484
  }
6485
+ getDeploymentMismatch(req) {
6486
+ const headers = new Headers();
6487
+ for (const name of [FARM_DEPLOYMENT_ID_HEADER, "cookie"]) {
6488
+ const value = req.headers[name];
6489
+ if (value) headers.set(name, Array.isArray(value) ? value.join("; ") : value);
6490
+ }
6491
+ return getFarmDeploymentMismatch(
6492
+ { method: req.method || "GET", headers },
6493
+ this.getDeploymentId()
6494
+ );
6495
+ }
6443
6496
  getDeploymentId() {
6444
6497
  return this.config.deploymentId || "development";
6445
6498
  }
@@ -7427,17 +7480,23 @@ function mergeNoExternal(farmValue, userValue) {
7427
7480
  const normalize = (value) => value == null || value === true ? [] : Array.isArray(value) ? value : [value];
7428
7481
  return Array.from(/* @__PURE__ */ new Set([...normalize(farmValue), ...normalize(userValue)]));
7429
7482
  }
7430
- function mergeAlias(farmValue, userValue) {
7483
+ function mergeFarmViteAlias(farmValue, userValue) {
7431
7484
  if (!farmValue) return userValue || {};
7432
7485
  if (!userValue) return farmValue;
7433
7486
  if (!Array.isArray(farmValue) && !Array.isArray(userValue)) {
7434
7487
  return {
7435
- ...farmValue,
7436
- ...userValue
7488
+ ...userValue,
7489
+ ...Object.fromEntries(
7490
+ Object.entries(farmValue).filter(
7491
+ ([find]) => !Object.prototype.hasOwnProperty.call(userValue, find)
7492
+ )
7493
+ )
7437
7494
  };
7438
7495
  }
7439
7496
  const normalize = (value) => Array.isArray(value) ? [...value] : Object.entries(value).map(([find, replacement]) => ({ find, replacement }));
7440
- return [...normalize(userValue), ...normalize(farmValue)];
7497
+ const userEntries = normalize(userValue);
7498
+ const userNames = new Set(userEntries.map((entry) => entry.find));
7499
+ return [...userEntries, ...normalize(farmValue).filter((entry) => !userNames.has(entry.find))];
7441
7500
  }
7442
7501
  function mergeFarmViteConfig(farmConfig, userConfig = {}) {
7443
7502
  const noDiscovery = userConfig.optimizeDeps?.noDiscovery ?? farmConfig.optimizeDeps?.noDiscovery;
@@ -7453,7 +7512,7 @@ function mergeFarmViteConfig(farmConfig, userConfig = {}) {
7453
7512
  resolve: {
7454
7513
  ...farmConfig.resolve,
7455
7514
  ...userConfig.resolve,
7456
- alias: mergeAlias(farmConfig.resolve?.alias, userConfig.resolve?.alias),
7515
+ alias: mergeFarmViteAlias(farmConfig.resolve?.alias, userConfig.resolve?.alias),
7457
7516
  dedupe: Array.from(
7458
7517
  /* @__PURE__ */ new Set([...farmConfig.resolve?.dedupe || [], ...userConfig.resolve?.dedupe || []])
7459
7518
  )
@@ -7489,7 +7548,33 @@ function mergeExternal(farmValue, userValue) {
7489
7548
  if (farmValue === true || userValue === true) return true;
7490
7549
  return Array.from(/* @__PURE__ */ new Set([...farmValue, ...userValue]));
7491
7550
  }
7492
- function mergeFarmProductionViteConfig(farmConfig, userConfig = {}) {
7551
+ var FARM_CLIENT_OWNED_OUTPUT_OPTIONS = [
7552
+ "dir",
7553
+ "file",
7554
+ "format",
7555
+ "entryFileNames",
7556
+ "chunkFileNames",
7557
+ "assetFileNames",
7558
+ "hashCharacters"
7559
+ ];
7560
+ function isFarmOwnedClientOutputOption(key) {
7561
+ return FARM_CLIENT_OWNED_OUTPUT_OPTIONS.includes(key) || key.startsWith("sourcemap");
7562
+ }
7563
+ function mergeFarmClientOutputOptions(farmOutput, userOutput) {
7564
+ if (userOutput === void 0) return farmOutput;
7565
+ if (Array.isArray(userOutput) || Array.isArray(farmOutput)) {
7566
+ throw new Error(
7567
+ "Farm builds one client output: set vite.build.rolldownOptions.output (or rollupOptions.output) to an object, not an array."
7568
+ );
7569
+ }
7570
+ const app = Object.fromEntries(
7571
+ Object.entries(userOutput).filter(
7572
+ ([key, value]) => value !== void 0 && !isFarmOwnedClientOutputOption(key)
7573
+ )
7574
+ );
7575
+ return { ...app, ...farmOutput };
7576
+ }
7577
+ function mergeFarmProductionViteConfig(farmConfig, userConfig = {}, options = {}) {
7493
7578
  const {
7494
7579
  plugins: _plugins,
7495
7580
  root: _root,
@@ -7517,13 +7602,15 @@ function mergeFarmProductionViteConfig(farmConfig, userConfig = {}) {
7517
7602
  } = userBuild;
7518
7603
  const {
7519
7604
  input: _input,
7520
- output: _output,
7605
+ output: userOutput,
7521
7606
  ...userBundlerOptions
7522
7607
  } = {
7523
7608
  ...userRollupOptions,
7524
7609
  ...userRolldownOptions
7525
7610
  };
7526
7611
  const merged = mergeFarmViteConfig(farmConfig, shared);
7612
+ const farmBundlerOptions = farmConfig.build?.rollupOptions;
7613
+ const output = options.clientOutput ? mergeFarmClientOutputOptions(farmBundlerOptions?.output, userOutput) : farmBundlerOptions?.output;
7527
7614
  return {
7528
7615
  ...merged,
7529
7616
  build: {
@@ -7531,7 +7618,8 @@ function mergeFarmProductionViteConfig(farmConfig, userConfig = {}) {
7531
7618
  ...farmConfig.build,
7532
7619
  rollupOptions: {
7533
7620
  ...userBundlerOptions,
7534
- ...farmConfig.build?.rollupOptions
7621
+ ...farmBundlerOptions,
7622
+ ...output === void 0 ? {} : { output }
7535
7623
  }
7536
7624
  },
7537
7625
  css: farmConfig.css || userCss ? { ...farmConfig.css, ...userCss } : void 0,
@@ -7570,6 +7658,7 @@ ${FARM_DARK_VARIANT}
7570
7658
  }
7571
7659
 
7572
7660
  export {
7661
+ inspectStaticMetadataImage,
7573
7662
  RouteManager,
7574
7663
  resolveDevGlobalStylesheetHref,
7575
7664
  collectDevStylesheetUrls,
@@ -7605,6 +7694,7 @@ export {
7605
7694
  createFarmClientOptimizeDepsEntries,
7606
7695
  createFarmClientOptimizeDepsConfig,
7607
7696
  createFarmSourceAlias,
7697
+ mergeFarmViteAlias,
7608
7698
  mergeFarmViteConfig,
7609
7699
  mergeFarmProductionViteConfig,
7610
7700
  createFarmThemeCssPlugin
@@ -31,8 +31,37 @@ function reconcileFarmDocumentHead(nextDocument) {
31
31
  document.head.querySelectorAll(FARM_NAVIGATION_HEAD_SELECTOR).forEach((node) => node.remove());
32
32
  nextDocument.head.querySelectorAll(FARM_NAVIGATION_HEAD_SELECTOR).forEach((node) => document.head.appendChild(document.importNode(node, true)));
33
33
  }
34
+ function createFarmMetadataHeadReconciler(initialMarkup) {
35
+ const candidates = Array.from(
36
+ document.head.querySelectorAll(FARM_NAVIGATION_HEAD_SELECTOR)
37
+ ).reverse();
38
+ const claimed = /* @__PURE__ */ new Set();
39
+ for (const node of parseFarmHeadMarkup(initialMarkup)) {
40
+ const match = candidates.find(
41
+ (candidate) => !claimed.has(candidate) && candidate.isEqualNode(node)
42
+ );
43
+ if (match) claimed.add(match);
44
+ }
45
+ let current = initialMarkup;
46
+ let owned = Array.from(claimed);
47
+ return (markup) => {
48
+ if (markup === current) return;
49
+ current = markup;
50
+ for (const node of owned) node.remove();
51
+ owned = parseFarmHeadMarkup(markup).map(
52
+ (node) => document.head.appendChild(document.importNode(node, true))
53
+ );
54
+ };
55
+ }
56
+ function parseFarmHeadMarkup(markup) {
57
+ if (!markup) return [];
58
+ const template = document.createElement("template");
59
+ template.innerHTML = markup;
60
+ return Array.from(template.content.querySelectorAll(FARM_NAVIGATION_HEAD_SELECTOR));
61
+ }
62
+
34
63
 
35
64
 
36
65
 
37
66
 
38
- exports.FARM_NAVIGATION_HEAD_SELECTOR = FARM_NAVIGATION_HEAD_SELECTOR; exports.reconcileFarmDocumentHead = reconcileFarmDocumentHead;
67
+ exports.FARM_NAVIGATION_HEAD_SELECTOR = FARM_NAVIGATION_HEAD_SELECTOR; exports.reconcileFarmDocumentHead = reconcileFarmDocumentHead; exports.createFarmMetadataHeadReconciler = createFarmMetadataHeadReconciler;
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-SMUW7UST.mjs";
4
4
  import {
5
5
  getFarmIntegrationPluginServerRuntime
6
- } from "./chunk-AJNBTOVQ.mjs";
6
+ } from "./chunk-WW3LRNQV.mjs";
7
7
  import {
8
8
  formatOptionalPeerInstallHint,
9
9
  isMissingPackageError
@@ -4,22 +4,22 @@ import {
4
4
  formatFarmRscBlockingMessage,
5
5
  inspectFarmServerComponents,
6
6
  resolveFarmRscCheckConfig
7
- } from "./chunk-3Y52TWYU.mjs";
7
+ } from "./chunk-62ZRA7XU.mjs";
8
8
  import {
9
9
  createFarmDevLoopbackPlugin
10
10
  } from "./chunk-FN5UEC7I.mjs";
11
11
  import {
12
12
  resolveDeployOutputPath
13
- } from "./chunk-SZORL7EW.mjs";
13
+ } from "./chunk-IYDJNCR7.mjs";
14
14
  import {
15
15
  farmDesktopDevGuardPlugin,
16
16
  loadFarmReactPlugin
17
- } from "./chunk-QOSDWGKT.mjs";
17
+ } from "./chunk-QVBXTSIZ.mjs";
18
18
  import {
19
19
  generateFarmClientPluginEntryCode,
20
20
  hasFarmServerRuntimePlugins,
21
21
  loadTailwindVitePlugin
22
- } from "./chunk-YOHHL2UE.mjs";
22
+ } from "./chunk-I4KPA2C6.mjs";
23
23
  import {
24
24
  resolveFarmPlatform
25
25
  } from "./chunk-SMUW7UST.mjs";
@@ -49,7 +49,7 @@ var FARM_RSC_CONFIG_KEYS = [
49
49
  "agent",
50
50
  "mcp"
51
51
  ];
52
- var FARM_RSC_PASSTHROUGH_KEYS = ["i18n", "cache"];
52
+ var FARM_RSC_PASSTHROUGH_KEYS = ["i18n", "cache", "redirects", "rewrites", "headers"];
53
53
  function pickImportTarget(entry) {
54
54
  if (typeof entry === "string") return entry;
55
55
  if (!entry || typeof entry !== "object") return void 0;
@@ -210,7 +210,7 @@ async function resolveFarmRscServerPlugins(userConfig, config, root) {
210
210
  }
211
211
  async function configureFarmRscPlugins(config, command) {
212
212
  if (config.plugins.length === 0) return config;
213
- const { PluginManager } = await import("./plugin-VEBRN7A3.mjs");
213
+ const { PluginManager } = await import("./plugin-QZT747YW.mjs");
214
214
  const manager = new PluginManager({
215
215
  config,
216
216
  isDev: command === "serve",
@@ -115,6 +115,16 @@ function createFarmDeploymentCookie(deploymentId, path = "/", secure = false) {
115
115
  secure ? "Secure" : ""
116
116
  ].filter(Boolean).join("; ");
117
117
  }
118
+ function withoutFarmDeploymentCookie(cookieHeader) {
119
+ if (!cookieHeader) return void 0;
120
+ if (!cookieHeader.includes(FARM_DEPLOYMENT_COOKIE)) return cookieHeader;
121
+ const remaining = cookieHeader.split(";").filter((part) => {
122
+ const separator = part.indexOf("=");
123
+ const name = (separator === -1 ? part : part.slice(0, separator)).trim();
124
+ return name !== FARM_DEPLOYMENT_COOKIE && part.trim() !== "";
125
+ }).join(";").trim();
126
+ return remaining || void 0;
127
+ }
118
128
  function readCookie(cookieHeader, name) {
119
129
  if (!cookieHeader) return void 0;
120
130
  for (const part of cookieHeader.split(";")) {
@@ -164,5 +174,6 @@ export {
164
174
  isFarmDeploymentMismatchResponse,
165
175
  createFarmDeploymentMismatchError,
166
176
  createFarmDeploymentCookie,
177
+ withoutFarmDeploymentCookie,
167
178
  resolveCloudflareProcessEnvFlags
168
179
  };