@farm.js/core 0.1.69 → 0.1.70

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 (306) hide show
  1. package/dist/{agent-mcp-handler-FER4MQDF.cjs → agent-mcp-handler-6T2Z7TB6.cjs} +8 -5
  2. package/dist/{agent-mcp-handler-AZ7QW4UP.mjs → agent-mcp-handler-CPU354QQ.mjs} +7 -4
  3. package/dist/{agent-mcp.d-DOfBMEzP.d.mts → agent-mcp.d-DulgFLBt.d.ts} +13 -4
  4. package/dist/{agent-mcp.d-DnIgriX1.d.ts → agent-mcp.d-TAs1ES2F.d.mts} +13 -4
  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-GUIRJWZH.cjs +16 -0
  10. package/dist/{analyzer-NAL5TJUP.mjs → analyzer-QGRBLETM.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-_BVbI0xp.d.mts → app-manifest.d-6zXb90o6.d.mts} +1 -1
  24. package/dist/{app-manifest.d-CaAcaukR.d.ts → app-manifest.d-C-nf3Vmm.d.ts} +1 -1
  25. package/dist/app-markdown.cjs +5 -4
  26. package/dist/app-markdown.d.mts +4 -3
  27. package/dist/app-markdown.d.ts +4 -3
  28. package/dist/app-markdown.mjs +4 -3
  29. package/dist/{app.d-BWeDqOaF.d.ts → app.d-C2xeMIYT.d.ts} +18 -8
  30. package/dist/{app.d-CaPwtytN.d.mts → app.d-DF0aundc.d.mts} +18 -8
  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-UPOYKX4S.cjs → chunk-2MR4MABG.cjs} +4 -4
  36. package/dist/chunk-2RCCFB2Y.cjs +129 -0
  37. package/dist/{chunk-K6VFYFOY.cjs → chunk-2W4GNXGX.cjs} +2 -2
  38. package/dist/{chunk-F6YLXK5L.cjs → chunk-32SYRIQ7.cjs} +18 -18
  39. package/dist/{chunk-CV6MFQ4Y.mjs → chunk-3AUINHFG.mjs} +1 -1
  40. package/dist/{chunk-ZYCEEE3V.mjs → chunk-3EXCZJEN.mjs} +2 -2
  41. package/dist/{chunk-MMDKYJ5V.cjs → chunk-3GNVIYPO.cjs} +7 -7
  42. package/dist/{chunk-65Y5SIBH.cjs → chunk-3QM74STY.cjs} +1 -1
  43. package/dist/{chunk-SZORL7EW.mjs → chunk-3WS5AZ3R.mjs} +5 -5
  44. package/dist/{chunk-FJMC24KG.cjs → chunk-42KMUIWZ.cjs} +0 -3
  45. package/dist/{chunk-LR4KP3I7.cjs → chunk-4AC4PXZO.cjs} +2 -2
  46. package/dist/{chunk-YVPX5PI5.mjs → chunk-4O26BPUY.mjs} +8 -0
  47. package/dist/{chunk-LENKRGBV.mjs → chunk-5CFHQ7HM.mjs} +1 -1
  48. package/dist/{chunk-G7NBPP7H.mjs → chunk-5IJRJWJS.mjs} +1 -1
  49. package/dist/{chunk-MV7NWU23.mjs → chunk-5R3JQPWD.mjs} +1 -1
  50. package/dist/{chunk-3Y52TWYU.mjs → chunk-62ZRA7XU.mjs} +0 -3
  51. package/dist/{chunk-ABIBASLJ.cjs → chunk-65FPDDT4.cjs} +2 -2
  52. package/dist/{chunk-K6SXMVXO.mjs → chunk-75E5FDX2.mjs} +22 -7
  53. package/dist/{chunk-K76CBYQM.mjs → chunk-7A3URI2F.mjs} +20 -0
  54. package/dist/{chunk-ZR2QB45W.mjs → chunk-A2TH5MKE.mjs} +4 -4
  55. package/dist/{chunk-L5OZN6YW.cjs → chunk-A7HCBHMC.cjs} +3 -3
  56. package/dist/{chunk-VX2HZGC7.cjs → chunk-ACGBXN3U.cjs} +2 -2
  57. package/dist/{chunk-TKYOJ5G2.cjs → chunk-BPUVDCGG.cjs} +5 -5
  58. package/dist/{chunk-FT6KJHS3.cjs → chunk-C2JOS77Z.cjs} +4 -1
  59. package/dist/{chunk-UHU4QALN.mjs → chunk-CCHJWJGP.mjs} +177 -102
  60. package/dist/{chunk-CRVSYDHV.mjs → chunk-CKQAQFF6.mjs} +2 -2
  61. package/dist/chunk-DC2AXGNZ.mjs +129 -0
  62. package/dist/{chunk-4W4ZWSV2.cjs → chunk-DIHBWZDZ.cjs} +391 -335
  63. package/dist/{chunk-Q4HH5Q6A.cjs → chunk-DMXMIE2C.cjs} +2 -2
  64. package/dist/{chunk-23VJEGKC.cjs → chunk-DVJM55D2.cjs} +9 -1
  65. package/dist/{chunk-QSUYB3RH.cjs → chunk-DZHTNSQ5.cjs} +14 -14
  66. package/dist/{chunk-OIOPQ25L.mjs → chunk-E77IA5IF.mjs} +46 -33
  67. package/dist/{chunk-PEYDQMSA.mjs → chunk-EDZU7YRK.mjs} +5 -5
  68. package/dist/{chunk-EZTKXD6P.cjs → chunk-FDGYDQGL.cjs} +8 -1
  69. package/dist/{chunk-PLJKJJ2H.mjs → chunk-FETMUBIA.mjs} +27 -82
  70. package/dist/{chunk-HJZZSBVK.cjs → chunk-FILXOEWD.cjs} +2 -2
  71. package/dist/{chunk-L6NWQ3DR.cjs → chunk-FJ5YCERM.cjs} +375 -300
  72. package/dist/{chunk-PDFFYZAT.cjs → chunk-GF22VGMS.cjs} +2 -2
  73. package/dist/{chunk-OOJBBHYW.cjs → chunk-GVYZCJZH.cjs} +30 -1
  74. package/dist/{chunk-5TOWKGV3.mjs → chunk-HAXFV2CD.mjs} +1 -1
  75. package/dist/{chunk-YOHHL2UE.mjs → chunk-I4KPA2C6.mjs} +1 -1
  76. package/dist/{chunk-4JRAMCUP.cjs → chunk-I7NUT24Z.cjs} +22 -22
  77. package/dist/{chunk-VO65MYJD.cjs → chunk-IEN2EFE5.cjs} +4 -4
  78. package/dist/{chunk-NVOMQLI2.mjs → chunk-IWJONXPF.mjs} +11 -0
  79. package/dist/{chunk-RLH5AH2M.mjs → chunk-JDO346NV.mjs} +1 -1
  80. package/dist/{chunk-PDQ6EGPK.mjs → chunk-JFVT5ZZV.mjs} +2 -2
  81. package/dist/{chunk-ULMXZYOA.mjs → chunk-JRF2SKCD.mjs} +1 -1
  82. package/dist/{chunk-YIHRZBD7.cjs → chunk-JRGR5Z4K.cjs} +1 -1
  83. package/dist/{chunk-UKZ6AWKZ.cjs → chunk-JWY66PID.cjs} +44 -1
  84. package/dist/{chunk-BDYM2TN3.cjs → chunk-JX5VOLAV.cjs} +8 -8
  85. package/dist/{chunk-WMLSZAKN.mjs → chunk-JZQS3ZOI.mjs} +1 -1
  86. package/dist/{chunk-GQ6QOH7T.cjs → chunk-K4UGCUXX.cjs} +12 -12
  87. package/dist/{chunk-OFBLGH6V.cjs → chunk-K66JILV3.cjs} +47 -34
  88. package/dist/{chunk-QOGIZKSO.cjs → chunk-K7JMTAFH.cjs} +5 -5
  89. package/dist/{chunk-IFR74W6S.mjs → chunk-KPJYBSHL.mjs} +4 -1
  90. package/dist/{chunk-CKCKCUYO.mjs → chunk-KPMLDT3B.mjs} +146 -90
  91. package/dist/{chunk-KI3MU7B5.mjs → chunk-LDVJIBGN.mjs} +1 -1
  92. package/dist/{chunk-GUMKIQJL.cjs → chunk-LECZ5DPZ.cjs} +2 -2
  93. package/dist/{chunk-5FBZJJGA.mjs → chunk-LXEJNWF5.mjs} +2 -2
  94. package/dist/{chunk-DHR2WDSL.cjs → chunk-M6U6E4F7.cjs} +335 -285
  95. package/dist/{chunk-AKIQ54FK.cjs → chunk-MBCRWU3P.cjs} +26 -81
  96. package/dist/{chunk-P2NBQ5JI.mjs → chunk-MWUDEYBI.mjs} +1 -1
  97. package/dist/{chunk-22LGTSBA.cjs → chunk-MZLJFNMH.cjs} +1 -1
  98. package/dist/{chunk-MAGFDK4Q.mjs → chunk-N62IYXYD.mjs} +1 -1
  99. package/dist/{chunk-ZPKJPM7K.mjs → chunk-NA77GEIU.mjs} +2 -2
  100. package/dist/{chunk-FVYBEMOD.cjs → chunk-NAXKOTPP.cjs} +6 -6
  101. package/dist/{chunk-I7J5RLGO.cjs → chunk-NLBHLPEO.cjs} +12 -1
  102. package/dist/{chunk-3EEINK7G.cjs → chunk-NSZY3EWG.cjs} +10 -7
  103. package/dist/{chunk-ANMIR6US.mjs → chunk-NYF7A4UW.mjs} +1 -1
  104. package/dist/{chunk-QO43L7Z4.cjs → chunk-O32QPFVV.cjs} +25 -7
  105. package/dist/{chunk-CO6UYM2D.mjs → chunk-O5QUJEWT.mjs} +1 -1
  106. package/dist/{chunk-JL2YW5KX.mjs → chunk-OAEDVXVE.mjs} +44 -1
  107. package/dist/{chunk-GTQOEEE7.cjs → chunk-Q5HMVGR5.cjs} +13 -13
  108. package/dist/{chunk-5NFQ6AZI.cjs → chunk-QEWWKYDL.cjs} +25 -10
  109. package/dist/{chunk-QOSDWGKT.mjs → chunk-QVBXTSIZ.mjs} +1 -1
  110. package/dist/{chunk-2P7UYHZP.mjs → chunk-QZHTDVH4.mjs} +1 -1
  111. package/dist/{chunk-HEJM46HQ.mjs → chunk-R7254L3R.mjs} +5 -2
  112. package/dist/{chunk-OGVTUGMU.mjs → chunk-REP6HWJN.mjs} +13 -3
  113. package/dist/{chunk-IYLZZTP6.mjs → chunk-RMOU3PR4.mjs} +112 -62
  114. package/dist/{chunk-WYL4ODZ4.mjs → chunk-SE7HPBYK.mjs} +30 -1
  115. package/dist/{chunk-D5F7RPZP.mjs → chunk-THG2TVDH.mjs} +3 -3
  116. package/dist/{chunk-TEJ67GD2.mjs → chunk-TLSSIYAL.mjs} +20 -5
  117. package/dist/{chunk-DWLNLU55.cjs → chunk-TPYAYFMF.cjs} +2 -2
  118. package/dist/{chunk-Y6KHPJDB.cjs → chunk-U7VH3Q5E.cjs} +2 -2
  119. package/dist/{chunk-X3MHKLCO.cjs → chunk-VG6HYT5K.cjs} +26 -11
  120. package/dist/{chunk-437QZIC2.cjs → chunk-VNBDN5W2.cjs} +5 -5
  121. package/dist/{chunk-AJNBTOVQ.mjs → chunk-WW3LRNQV.mjs} +1 -1
  122. package/dist/{chunk-GFPS7MNE.mjs → chunk-WX63N6C5.mjs} +4 -4
  123. package/dist/{chunk-6GQJVY4E.cjs → chunk-XYVPTTUT.cjs} +13 -13
  124. package/dist/{chunk-VOQ7XZZT.cjs → chunk-Y2SZVIVH.cjs} +20 -0
  125. package/dist/{chunk-XCAQTCGK.mjs → chunk-YBY34UHB.mjs} +1 -1
  126. package/dist/{chunk-YGJ5P3TJ.mjs → chunk-Z3GPAFIA.mjs} +21 -3
  127. package/dist/{chunk-4E57QHPW.cjs → chunk-ZUVAGMQ5.cjs} +17 -7
  128. package/dist/{chunk-23LVFSID.mjs → chunk-ZXDX7VYZ.mjs} +7 -0
  129. package/dist/{client-component.d-CnEeVvGG.d.mts → client-component.d-Bk5qKJM-.d.mts} +2 -2
  130. package/dist/{client-component.d-CfJxuXZl.d.ts → client-component.d-DNbC4oWI.d.ts} +2 -2
  131. package/dist/{client-plugins.d-D7dHV1Nf.d.ts → client-plugins.d-DwUqh4gp.d.ts} +36 -3
  132. package/dist/{client-plugins.d-Do5ULA0x.d.mts → client-plugins.d-Pi9nG0W0.d.mts} +36 -3
  133. package/dist/client-plugins.d.mts +3 -2
  134. package/dist/client-plugins.d.ts +3 -2
  135. package/dist/client.cjs +6 -6
  136. package/dist/client.d.mts +8 -7
  137. package/dist/client.d.ts +8 -7
  138. package/dist/client.mjs +5 -5
  139. package/dist/config.d.mts +3 -2
  140. package/dist/config.d.ts +3 -2
  141. package/dist/deployment.cjs +4 -2
  142. package/dist/deployment.d.mts +7 -1
  143. package/dist/deployment.d.ts +7 -1
  144. package/dist/deployment.mjs +5 -3
  145. package/dist/desktop.d.mts +4 -3
  146. package/dist/desktop.d.ts +4 -3
  147. package/dist/{dev-guard-ONNMVQUN.mjs → dev-guard-ZDIELV6Q.mjs} +1 -1
  148. package/dist/{dev-guard-2UW2KERP.cjs → dev-guard-ZLLKVO5T.cjs} +2 -2
  149. package/dist/{devtools-BP4EBTKQ.mjs → devtools-CB43AHEP.mjs} +8 -7
  150. package/dist/{devtools-7HNDS4SY.cjs → devtools-L5DUNDF3.cjs} +9 -8
  151. package/dist/docs.cjs +12 -11
  152. package/dist/docs.d.mts +4 -3
  153. package/dist/docs.d.ts +4 -3
  154. package/dist/docs.mjs +11 -10
  155. package/dist/environment/vite.cjs +3 -3
  156. package/dist/environment/vite.mjs +2 -2
  157. package/dist/headers.d-CE6OWB-n.d.ts +18 -0
  158. package/dist/headers.d-DED1hHh4.d.mts +18 -0
  159. package/dist/i18n/client.cjs +2 -2
  160. package/dist/i18n/client.d.mts +2 -2
  161. package/dist/i18n/client.d.ts +2 -2
  162. package/dist/i18n/client.mjs +1 -1
  163. package/dist/i18n/index.cjs +2 -2
  164. package/dist/i18n/index.d.mts +3 -3
  165. package/dist/i18n/index.d.ts +3 -3
  166. package/dist/i18n/index.mjs +1 -1
  167. package/dist/i18n/server.cjs +3 -3
  168. package/dist/i18n/server.d.mts +5 -5
  169. package/dist/i18n/server.d.ts +5 -5
  170. package/dist/i18n/server.mjs +2 -2
  171. package/dist/index.cjs +46 -43
  172. package/dist/{index.d-B1MpEJAo.d.mts → index.d-CbvOjJcp.d.mts} +1 -1
  173. package/dist/{index.d-CVFk37uX.d.ts → index.d-c9UwIqDy.d.ts} +1 -1
  174. package/dist/index.d.mts +25 -23
  175. package/dist/index.d.ts +25 -23
  176. package/dist/index.mjs +59 -56
  177. package/dist/integrations/orm.d.mts +3 -2
  178. package/dist/integrations/orm.d.ts +3 -2
  179. package/dist/integrations.cjs +3 -3
  180. package/dist/integrations.d.mts +3 -2
  181. package/dist/integrations.d.ts +3 -2
  182. package/dist/integrations.mjs +2 -2
  183. package/dist/internal/app-markdown-runtime.cjs +4 -3
  184. package/dist/internal/app-markdown-runtime.d.mts +4 -3
  185. package/dist/internal/app-markdown-runtime.d.ts +4 -3
  186. package/dist/internal/app-markdown-runtime.mjs +3 -2
  187. package/dist/internal/build-runtime.cjs +35 -35
  188. package/dist/internal/build-runtime.d.mts +5 -4
  189. package/dist/internal/build-runtime.d.ts +5 -4
  190. package/dist/internal/build-runtime.mjs +34 -34
  191. package/dist/internal/cli-runtime.cjs +15 -14
  192. package/dist/internal/cli-runtime.mjs +14 -13
  193. package/dist/internal/client-error-overlay.cjs +4 -4
  194. package/dist/internal/client-error-overlay.mjs +1 -1
  195. package/dist/internal/client-runtime.cjs +5 -3
  196. package/dist/internal/client-runtime.d.mts +17 -7
  197. package/dist/internal/client-runtime.d.ts +17 -7
  198. package/dist/internal/client-runtime.mjs +4 -2
  199. package/dist/internal/compression-runtime.d.mts +3 -2
  200. package/dist/internal/compression-runtime.d.ts +3 -2
  201. package/dist/internal/config-runtime.cjs +10 -9
  202. package/dist/internal/config-runtime.d.mts +6 -5
  203. package/dist/internal/config-runtime.d.ts +6 -5
  204. package/dist/internal/config-runtime.mjs +9 -8
  205. package/dist/internal/infra-analytics-runtime.cjs +12 -9
  206. package/dist/internal/infra-analytics-runtime.mjs +10 -7
  207. package/dist/internal/native-server-fns.cjs +4 -4
  208. package/dist/internal/native-server-fns.mjs +3 -3
  209. package/dist/internal/product-telemetry-runtime.cjs +3 -3
  210. package/dist/internal/product-telemetry-runtime.mjs +2 -2
  211. package/dist/internal/production-runtime.cjs +48 -17
  212. package/dist/internal/production-runtime.d.mts +48 -18
  213. package/dist/internal/production-runtime.d.ts +48 -18
  214. package/dist/internal/production-runtime.mjs +50 -19
  215. package/dist/internal/vercel-edge-middleware.cjs +3 -2
  216. package/dist/internal/vercel-edge-middleware.d.mts +2 -2
  217. package/dist/internal/vercel-edge-middleware.d.ts +2 -2
  218. package/dist/internal/vercel-edge-middleware.mjs +2 -1
  219. package/dist/markdown.cjs +3 -2
  220. package/dist/markdown.d.mts +3 -2
  221. package/dist/markdown.d.ts +3 -2
  222. package/dist/markdown.mjs +2 -1
  223. package/dist/middleware.cjs +6 -5
  224. package/dist/middleware.d.mts +4 -3
  225. package/dist/middleware.d.ts +4 -3
  226. package/dist/middleware.mjs +5 -4
  227. package/dist/mobile.d.mts +3 -3
  228. package/dist/mobile.d.ts +3 -3
  229. package/dist/{mount.d-CBqr-LfI.d.mts → mount.d-BvWxf8ZE.d.mts} +1 -1
  230. package/dist/{mount.d-CGzN61Kq.d.ts → mount.d-DngLY7NL.d.ts} +1 -1
  231. package/dist/{native-tree-W2SSJB3Y.cjs → native-tree-GF4BH33L.cjs} +4 -3
  232. package/dist/{native-tree-Y5YQANW7.mjs → native-tree-L2IIEBXH.mjs} +3 -2
  233. package/dist/{navigation-delegate.d-BwCOhpj7.d.mts → navigation-delegate.d-CMyl1h2l.d.mts} +1 -1
  234. package/dist/{navigation-delegate.d-CLH2dXjy.d.ts → navigation-delegate.d-zZogiDfa.d.ts} +1 -1
  235. package/dist/navigation.cjs +5 -5
  236. package/dist/navigation.d.mts +6 -5
  237. package/dist/navigation.d.ts +6 -5
  238. package/dist/navigation.mjs +4 -4
  239. package/dist/plugin.cjs +28 -27
  240. package/dist/plugin.d.mts +6 -4
  241. package/dist/plugin.d.ts +6 -4
  242. package/dist/plugin.mjs +27 -26
  243. package/dist/{production-runtime.d-DMZY3OgV.d.mts → production-runtime.d-B0IeWWyO.d.mts} +23 -2
  244. package/dist/{production-runtime.d-BMyyLGBB.d.ts → production-runtime.d-q3aHIv5Y.d.ts} +23 -2
  245. package/dist/query/client.cjs +6 -6
  246. package/dist/query/client.mjs +2 -2
  247. package/dist/{render-plan.d-W6LmjD6y.d.ts → render-plan.d-DQj2bzd2.d.ts} +1 -1
  248. package/dist/{render-plan.d-CzGDjcT0.d.mts → render-plan.d-Di1znBDW.d.mts} +1 -1
  249. package/dist/renderer-client.cjs +7 -7
  250. package/dist/renderer-client.d.mts +6 -5
  251. package/dist/renderer-client.d.ts +6 -5
  252. package/dist/renderer-client.mjs +3 -3
  253. package/dist/{request.d-CTVRZiQv.d.ts → request.d-C5vyoYeL.d.ts} +1 -1
  254. package/dist/{request.d-CgNVderU.d.mts → request.d-CJWzfDYJ.d.mts} +1 -1
  255. package/dist/request.d.mts +4 -3
  256. package/dist/request.d.ts +4 -3
  257. package/dist/{resolver.d-JnZKKsc5.d.mts → resolver.d-9iKC79CU.d.mts} +1 -1
  258. package/dist/{resolver.d-BHyZgpa7.d.ts → resolver.d-CY6mEa_F.d.ts} +1 -1
  259. package/dist/response.d-B_MtBCnF.d.mts +12 -0
  260. package/dist/response.d-B_MtBCnF.d.ts +12 -0
  261. package/dist/{route-rendering.d-D0bmZVJA.d.mts → route-rendering.d-C-et2TZ1.d.mts} +9 -2
  262. package/dist/{route-rendering.d-FDSNtCMg.d.ts → route-rendering.d-DhsY5M2I.d.ts} +9 -2
  263. package/dist/{router.d-GRKm_uAV.d.mts → router.d-BMDS5s5X.d.mts} +1 -1
  264. package/dist/{router.d-DZ3ldniI.d.ts → router.d-CJB-Ntni.d.ts} +1 -1
  265. package/dist/{routes.d-CrEy0lJS.d.mts → routes.d-D3aJw1H5.d.mts} +1 -1
  266. package/dist/{routes.d-9GFFNioh.d.ts → routes.d-K-Qg79AA.d.ts} +1 -1
  267. package/dist/routes.d.mts +3 -2
  268. package/dist/routes.d.ts +3 -2
  269. package/dist/{index.d-BNNDpql4.d.ts → routing.d-BxOZ2YWc.d.ts} +1 -2
  270. package/dist/{index.d-BqcfqJvt.d.mts → routing.d-DwSUVZbF.d.mts} +1 -2
  271. package/dist/{rsc-pipeline-PJZOVYSY.mjs → rsc-pipeline-AXQJCCHI.mjs} +12 -11
  272. package/dist/{rsc-pipeline-J4KKBSCH.cjs → rsc-pipeline-NJKLZ3YE.cjs} +13 -12
  273. package/dist/{runtime-OLEO5NXF.cjs → runtime-DMW6DDOI.cjs} +19 -18
  274. package/dist/{runtime-QDBSE4H6.mjs → runtime-JXNEKOSE.mjs} +11 -10
  275. package/dist/{runtime.d-BtL3PCL3.d.ts → runtime.d-B_uPfMjA.d.ts} +2 -2
  276. package/dist/{runtime.d-DqXihlxm.d.mts → runtime.d-BonodRI9.d.mts} +1 -1
  277. package/dist/{runtime.d-3iJAKptR.d.mts → runtime.d-nUz0HAL4.d.mts} +2 -2
  278. package/dist/{runtime.d-pqFQBU2N.d.ts → runtime.d-uw4123iI.d.ts} +1 -1
  279. package/dist/server-plugins.cjs +3 -2
  280. package/dist/server-plugins.d.mts +6 -12
  281. package/dist/server-plugins.d.ts +6 -12
  282. package/dist/server-plugins.mjs +2 -1
  283. package/dist/server.cjs +60 -52
  284. package/dist/server.d.mts +23 -14
  285. package/dist/server.d.ts +23 -14
  286. package/dist/server.mjs +38 -30
  287. package/dist/{spa-router.d-DhOhaQ-7.d.ts → spa-router.d-l0d9pPZj.d.ts} +3 -3
  288. package/dist/{spa-router.d-Dhvy60p4.d.mts → spa-router.d-rha3M95y.d.mts} +3 -3
  289. package/dist/testing.cjs +3 -3
  290. package/dist/testing.d.mts +3 -2
  291. package/dist/testing.d.ts +3 -2
  292. package/dist/testing.mjs +3 -3
  293. package/dist/{types.d-C41ePjvP.d.ts → types.d-wVRlLtBf.d.mts} +1 -1
  294. package/dist/{types.d-C41ePjvP.d.mts → types.d-wVRlLtBf.d.ts} +1 -1
  295. package/dist/{utils.d-BVCMRRau.d.ts → utils.d-BK-PTOF8.d.ts} +1 -1
  296. package/dist/{utils.d-Q8EHCpkF.d.mts → utils.d-BzuTobEc.d.mts} +1 -1
  297. package/dist/version.cjs +2 -2
  298. package/dist/version.mjs +1 -1
  299. package/dist/vite.cjs +35 -27
  300. package/dist/vite.d.mts +26 -6
  301. package/dist/vite.d.ts +26 -6
  302. package/dist/vite.mjs +34 -26
  303. package/package.json +2 -2
  304. package/dist/analyzer-SAJSV6SP.cjs +0 -16
  305. package/dist/response.d-BolW0Vx_.d.mts +0 -10
  306. package/dist/response.d-BolW0Vx_.d.ts +0 -10
@@ -26,7 +26,7 @@ import {
26
26
  import {
27
27
  collectFarmNativeServerFns,
28
28
  findFarmNativeScreenFiles
29
- } from "./chunk-5TOWKGV3.mjs";
29
+ } from "./chunk-HAXFV2CD.mjs";
30
30
  import {
31
31
  generateNativeMCPPluginSource
32
32
  } from "./chunk-KQH2COEJ.mjs";
@@ -41,7 +41,7 @@ import {
41
41
  hasFarmDocsRuntimeAdapter,
42
42
  listFarmDocsAdapterPages,
43
43
  listFarmDocsPagePaths
44
- } from "./chunk-PDQ6EGPK.mjs";
44
+ } from "./chunk-JFVT5ZZV.mjs";
45
45
  import {
46
46
  FARM_DOCS_LAST_MODIFIED_MANIFEST,
47
47
  createFarmDocsHandler,
@@ -54,7 +54,7 @@ import {
54
54
  loadFarmDocsPage,
55
55
  resolveFarmDocsContentDir,
56
56
  toFarmDocsMarkdownPage
57
- } from "./chunk-5FBZJJGA.mjs";
57
+ } from "./chunk-LXEJNWF5.mjs";
58
58
  import {
59
59
  generateFarmDocsSearchClientRuntime,
60
60
  isFarmDocsSearchEnabled,
@@ -62,10 +62,10 @@ import {
62
62
  } from "./chunk-ALEUMLJN.mjs";
63
63
  import {
64
64
  CDN_CACHE_CONTROL_HEADERS
65
- } from "./chunk-JL2YW5KX.mjs";
65
+ } from "./chunk-OAEDVXVE.mjs";
66
66
  import {
67
67
  FARM_PRERENDER_ENV
68
- } from "./chunk-ZYCEEE3V.mjs";
68
+ } from "./chunk-3EXCZJEN.mjs";
69
69
  import {
70
70
  loadFarmDocsEngine
71
71
  } from "./chunk-VE3FWJBO.mjs";
@@ -74,7 +74,7 @@ import {
74
74
  getDeployTargetForPreset,
75
75
  hasCustomFarmRouteContext,
76
76
  resolveDeployOutputPath
77
- } from "./chunk-SZORL7EW.mjs";
77
+ } from "./chunk-3WS5AZ3R.mjs";
78
78
  import {
79
79
  resolveFarmInstrumentationFile
80
80
  } from "./chunk-57QAQU4F.mjs";
@@ -110,12 +110,12 @@ import {
110
110
  resolveFarmImageServerRuntime,
111
111
  resolveFarmNotFoundComponentPath,
112
112
  resolveFarmRouteRootStrategy
113
- } from "./chunk-IYLZZTP6.mjs";
113
+ } from "./chunk-RMOU3PR4.mjs";
114
114
  import {
115
115
  generateFarmClientPluginEntryCode,
116
116
  hasFarmServerRuntimePlugins,
117
117
  loadTailwindVitePlugin
118
- } from "./chunk-YOHHL2UE.mjs";
118
+ } from "./chunk-I4KPA2C6.mjs";
119
119
  import {
120
120
  PluginManager
121
121
  } from "./chunk-PJQ5W356.mjs";
@@ -123,7 +123,7 @@ import {
123
123
  generateFarmTypeArtifacts,
124
124
  readRouteRenderingDirectiveFromFile,
125
125
  resolveRouteRenderingConfigFromFile
126
- } from "./chunk-G7NBPP7H.mjs";
126
+ } from "./chunk-5IJRJWJS.mjs";
127
127
  import {
128
128
  HOISTED_HEAD_ELEMENT,
129
129
  appMiddlewareMayHandlePath,
@@ -136,7 +136,7 @@ import {
136
136
  layoutsCanCoverSamePage,
137
137
  routeBoundaryCoversDirectory,
138
138
  stripRouteGroups
139
- } from "./chunk-ZPKJPM7K.mjs";
139
+ } from "./chunk-NA77GEIU.mjs";
140
140
  import {
141
141
  FARM_NATIVE_TREE_CONTENT_TYPE
142
142
  } from "./chunk-LLZSYFOM.mjs";
@@ -150,15 +150,15 @@ import {
150
150
  listFarmBuiltInRoutePaths,
151
151
  resolveFarmApiCatalogInput,
152
152
  resolveFarmAppManifestInput
153
- } from "./chunk-ZR2QB45W.mjs";
153
+ } from "./chunk-A2TH5MKE.mjs";
154
154
  import {
155
155
  FARM_DEFAULT_MCP_PATH,
156
156
  createFarmDefaultMCPServer,
157
157
  farmConfigMountsMCP
158
- } from "./chunk-K6SXMVXO.mjs";
158
+ } from "./chunk-75E5FDX2.mjs";
159
159
  import {
160
160
  isFarmPreviewDeploymentEnvironment
161
- } from "./chunk-2P7UYHZP.mjs";
161
+ } from "./chunk-QZHTDVH4.mjs";
162
162
  import {
163
163
  FARM_NATIVE_SERVER_FN_PLUGIN
164
164
  } from "./chunk-L4RTTTVE.mjs";
@@ -176,7 +176,7 @@ import {
176
176
  usePackageClientBoundaryCacheFile,
177
177
  usesFarmServerTree,
178
178
  withPackageClientBoundaryCache
179
- } from "./chunk-ULMXZYOA.mjs";
179
+ } from "./chunk-JRF2SKCD.mjs";
180
180
  import {
181
181
  generateFarmDocsAdapterClientRuntime,
182
182
  getFarmDocsAdapterConfigModule
@@ -223,14 +223,14 @@ import {
223
223
  } from "./chunk-N33DLJBC.mjs";
224
224
  import {
225
225
  isFarmMarkdownPageFile
226
- } from "./chunk-HEJM46HQ.mjs";
226
+ } from "./chunk-R7254L3R.mjs";
227
227
  import {
228
228
  resolveFarmMdxComponentsModulePath,
229
229
  resolveMdxConfig
230
230
  } from "./chunk-UIJOLBUL.mjs";
231
231
  import {
232
232
  getFarmMarkdownAlternatePath
233
- } from "./chunk-IFR74W6S.mjs";
233
+ } from "./chunk-KPJYBSHL.mjs";
234
234
  import {
235
235
  withPlainDiagnostics
236
236
  } from "./chunk-MGKWYPE3.mjs";
@@ -241,7 +241,7 @@ import {
241
241
  import {
242
242
  getFarmIntegrationPluginServerRuntime,
243
243
  getIntegrationProviders
244
- } from "./chunk-AJNBTOVQ.mjs";
244
+ } from "./chunk-WW3LRNQV.mjs";
245
245
  import {
246
246
  FARM_INTEGRATION_API_BASE_PATH_KEY
247
247
  } from "./chunk-M53MIIXY.mjs";
@@ -255,7 +255,7 @@ import {
255
255
  } from "./chunk-MMK4MZUN.mjs";
256
256
  import {
257
257
  APIRouteManager
258
- } from "./chunk-OIOPQ25L.mjs";
258
+ } from "./chunk-E77IA5IF.mjs";
259
259
  import {
260
260
  readFarmI18nCatalogs
261
261
  } from "./chunk-DU4VHHPJ.mjs";
@@ -282,14 +282,14 @@ import {
282
282
  } from "./chunk-2I6PUKWJ.mjs";
283
283
  import {
284
284
  FARM_VERSION
285
- } from "./chunk-ANMIR6US.mjs";
285
+ } from "./chunk-NYF7A4UW.mjs";
286
286
  import {
287
287
  normalizeFarmTrailingSlashPathname
288
- } from "./chunk-YVPX5PI5.mjs";
288
+ } from "./chunk-4O26BPUY.mjs";
289
289
  import {
290
290
  getFarmPresetRuntime,
291
291
  resolveCloudflareProcessEnvFlags
292
- } from "./chunk-NVOMQLI2.mjs";
292
+ } from "./chunk-IWJONXPF.mjs";
293
293
  import {
294
294
  _runWithFarmCspNonce
295
295
  } from "./chunk-5OFNUETM.mjs";
@@ -1137,10 +1137,19 @@ const CREDENTIAL_VARY = /(?:^|,)\\s*(?:\\*|cookie|authorization)\\s*(?:,|$)/i;
1137
1137
  // What Nitro's entry sets when the response has no Cache-Control of its own.
1138
1138
  const NITRO_DEFAULT_CACHE_CONTROL = "public, max-age=0, must-revalidate";
1139
1139
 
1140
+ // The deployment cookie names a release, not a visitor (see @farm.js/core/deployment).
1141
+ function hasVisitorCookies(cookieHeader) {
1142
+ if (!cookieHeader) return false;
1143
+ return cookieHeader.split(";").some((part) => {
1144
+ const name = part.split("=")[0].trim();
1145
+ return name !== "" && name !== "__farm_deployment";
1146
+ });
1147
+ }
1148
+
1140
1149
  function isSharedCacheable(request, response) {
1141
1150
  return (
1142
1151
  response.status === 200 &&
1143
- !request.headers.has("cookie") &&
1152
+ !hasVisitorCookies(request.headers.get("cookie")) &&
1144
1153
  !request.headers.has("authorization") &&
1145
1154
  !response.headers.has("set-cookie") &&
1146
1155
  !PRIVATE_CACHE_DIRECTIVE.test(response.headers.get("cache-control") || "") &&
@@ -2494,13 +2503,16 @@ ${islandsErrors.map((error) => ` - ${error}`).join("\n")}`
2494
2503
  function shouldBuildFarmMobileClient(config) {
2495
2504
  return Boolean(config.mobileClient) && !config.desktop;
2496
2505
  }
2497
- function varyFarmNitroCacheRulesByShell(rules) {
2506
+ function varyFarmNitroCacheRules(rules, headerNames) {
2507
+ if (headerNames.length === 0) return rules;
2498
2508
  return Object.fromEntries(
2499
2509
  Object.entries(rules).map(([source, rule]) => {
2500
2510
  const cached = rule?.swr !== void 0 && rule.swr !== false || rule?.cache !== void 0 && rule.cache !== false;
2501
2511
  if (!cached || rule.cache === false) return [source, rule];
2502
2512
  const cache = rule.cache && typeof rule.cache === "object" ? rule.cache : {};
2503
- const varies = [...Array.isArray(cache.varies) ? cache.varies : [], "x-farm-shell"];
2513
+ const varies = [
2514
+ .../* @__PURE__ */ new Set([...Array.isArray(cache.varies) ? cache.varies : [], ...headerNames])
2515
+ ];
2504
2516
  return [source, { ...rule, cache: { ...cache, varies } }];
2505
2517
  })
2506
2518
  );
@@ -7305,6 +7317,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
7305
7317
  createFarmProductionLifecycle,
7306
7318
  createFarmNodeRequestAbortSignal,
7307
7319
  createProductionMiddlewareRunner,
7320
+ _hasPrivateFarmRequestHeaders,
7308
7321
  _withFarmGuardedResponseCache,
7309
7322
  _farmPluginsKeepResponsesPrivate,
7310
7323
  getTheme as getFarmTheme,
@@ -7318,6 +7331,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
7318
7331
  localizeFarmHref,
7319
7332
  manageFarmDocumentPreloads,
7320
7333
  mergeRouteRenderingDirectiveConfig,
7334
+ resolveRouteSharedCacheControl,
7321
7335
  manageFarmLinkHeaderPreloads,
7322
7336
  mergeMetadata,
7323
7337
  mergeModuleViewport,
@@ -7346,7 +7360,13 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
7346
7360
  stripFarmLocaleFromPathname,
7347
7361
  withFarmRouteContext,
7348
7362
  createLateNotFoundRecovery,
7349
- createLateRedirectRecovery,${config.mobileClient ? "\n createFarmNativeTreeResponse," : ""}${hasInfraAnalyticsRuntime ? "\n resolveFarmDocsEngineRouteLabel,\n resolveFarmDocsRouteLabel,\n resolveFarmMarkdownRouteLabel,\n resolveFarmMCPRouteLabel,\n setFarmRouteLabel," : ""}${hasFarmServerStorageConfig(config.storage) ? "\n _registerFarmStorageModules,\n disposeFarmStorage,\n initFarmStorage," : ""}
7363
+ createLateRedirectRecovery,
7364
+ _withFarmDeploymentCookie,
7365
+ _withFarmResponseHeaders,
7366
+ createFarmDeploymentMismatchResponse,
7367
+ FARM_DEPLOYMENT_ID_HEADER,
7368
+ getFarmDeploymentMismatch,
7369
+ withoutFarmDeploymentCookie,${config.mobileClient ? "\n createFarmNativeTreeResponse," : ""}${config.trailingSlash && (config.md?.enabled || hasMarkdownPages) ? "\n toFarmTrailingSlashPageRequest," : ""}${hasInfraAnalyticsRuntime ? "\n resolveFarmDocsEngineRouteLabel,\n resolveFarmDocsRouteLabel,\n resolveFarmMarkdownRouteLabel,\n resolveFarmMCPRouteLabel,\n setFarmRouteLabel," : ""}${hasFarmServerStorageConfig(config.storage) ? "\n _registerFarmStorageModules,\n disposeFarmStorage,\n initFarmStorage," : ""}
7350
7370
  } from "@farm.js/core/internal/production-runtime";${farmMobileClient ? `
7351
7371
  import { _applyFarmMobileShellClient } from "@farm.js/core/internal/production-runtime";
7352
7372
  // The mobile client documents load when a mobile shell asks for them (RFC 0004, 7.2), filled in
@@ -7794,7 +7814,11 @@ const farmImageHandler = ${imageRuntime === "none" ? "null" : imageRuntime === "
7794
7814
  validateRemoteUrl: createNodeImageUrlValidator(${JSON.stringify(config.images)}),
7795
7815
  onError(error) { console.error("[Farm Image]", error); },
7796
7816
  })`};
7797
- const farmMarkdownConfig = ${JSON.stringify(config.md)};
7817
+ const farmMarkdownConfig = ${JSON.stringify(config.md)};${config.md?.enabled || hasMarkdownPages ? config.trailingSlash ? `
7818
+ // A Markdown mirror, and a page.md source's page check, read the page at the URL it answers at
7819
+ // ('/about/'), so the trailing-slash 308 never answers in its place.
7820
+ const toFarmMarkdownPageRequest = (request) => toFarmTrailingSlashPageRequest(request, true);` : `
7821
+ const toFarmMarkdownPageRequest = (request) => request;` : ""}
7798
7822
  const farmLlmsTxtConfig = ${JSON.stringify(config.agent?.llmsTxt ?? { enabled: false, include: [], exclude: [] })};
7799
7823
  ${config.agent?.llmsTxt?.enabled ? "const farmLlmsFullRenderer = createFarmLlmsFullRenderer({ revalidate: farmLlmsTxtConfig.revalidate });\n" : ""}${servesAgentRobotsTxt ? `const farmAgentCrawlers = ${JSON.stringify(config.agent.crawlers)};` : ""}
7800
7824
  const farmMdxConfig = ${JSON.stringify({
@@ -7988,6 +8012,10 @@ function fetchFarmInnerRequest(request, context) {
7988
8012
  return fetch(new Request(request, { headers }), context);
7989
8013
  }
7990
8014
  const farmLocalAPIBasePath = ${JSON.stringify(resolveFarmAPIServerBasePath(config.api))};
8015
+ // Deployment skew protection (see the deployment docs): documents embed this ID, page responses
8016
+ // name it, and a page request from a browser holding another deployment's page is refused.
8017
+ const farmDeploymentId = ${JSON.stringify(config.deploymentId)};
8018
+ const farmDeploymentCookiePath = ${JSON.stringify(config.basePath || "/")};
7991
8019
  // Reports a failure Farm answers itself (an API or integration route's 500) to the plugin
7992
8020
  // runtime request.
7993
8021
  const farmRuntimeErrorSlot = Symbol("farm.runtime.error.slot");
@@ -8101,7 +8129,8 @@ function renderFarmClientBootstrapScript(canonicalPath, selectedRouteSlots, page
8101
8129
  let source = 'window.__FARM_PROPS__=' + serializedPageProps +
8102
8130
  ';window.__FARM_INTEGRATION_API_MANIFEST__=' +
8103
8131
  serializeFarmInlineValue(integrationManifest) +
8104
- ';window.__FARM_ROUTE_SLOTS__=' + serializedRouteSlots + ';';
8132
+ ';window.__FARM_ROUTE_SLOTS__=' + serializedRouteSlots +
8133
+ ';window.__FARM_DEPLOYMENT_ID__=' + serializeFarmInlineValue(farmDeploymentId) + ';';
8105
8134
  if (typeof canonicalPath === "string" && canonicalPath.startsWith("/")) {
8106
8135
  const serializedPath = serializeFarmInlineValue(canonicalPath);
8107
8136
  source += 'if(location.pathname+location.search!==' + serializedPath + '){' +
@@ -8903,38 +8932,14 @@ function applyFarmI18nResponse(response, resolution) {
8903
8932
  });
8904
8933
  }
8905
8934
 
8906
- function hasOnlyValidFarmLocaleCookie(cookieHeader) {
8907
- if (!farmI18nRuntime || !cookieHeader) return false;
8908
- const parts = cookieHeader.split(";");
8909
- if (parts.length !== 1) return false;
8910
-
8911
- const cookie = parts[0].trim();
8912
- const separator = cookie.indexOf("=");
8913
- if (separator <= 0) return false;
8914
-
8915
- let name;
8916
- let value;
8917
- try {
8918
- name = decodeURIComponent(cookie.slice(0, separator).trim());
8919
- value = decodeURIComponent(cookie.slice(separator + 1).trim());
8920
- } catch {
8921
- return false;
8922
- }
8923
-
8924
- return (
8925
- name === farmI18nConfig.cookie.name &&
8926
- farmI18nConfig.locales.includes(value)
8927
- );
8928
- }
8929
-
8935
+ // Credentials or a visitor's cookie; the deployment cookie, and a lone valid locale cookie when
8936
+ // the URL names the locale, keep shared caching. The RSC server decides with the same helper.
8930
8937
  function hasPrivateFarmRequestHeaders(request, farmLocaleResolution) {
8931
- if (request.headers.get("authorization")) return true;
8932
- const cookieHeader = request.headers.get("cookie");
8933
- if (!cookieHeader) return false;
8934
-
8935
- return !(
8936
- farmLocaleResolution?.source === "url" &&
8937
- hasOnlyValidFarmLocaleCookie(cookieHeader)
8938
+ return _hasPrivateFarmRequestHeaders(
8939
+ request,
8940
+ farmI18nRuntime && farmLocaleResolution?.source === "url"
8941
+ ? { name: farmI18nConfig.cookie.name, locales: farmI18nConfig.locales }
8942
+ : undefined,
8938
8943
  );
8939
8944
  }
8940
8945
 
@@ -9235,7 +9240,7 @@ function createFarmAgentSitemapResponse(request) {
9235
9240
  metadataBase: rootLayout && rootLayout.module && rootLayout.module.metadata
9236
9241
  ? rootLayout.module.metadata.metadataBase
9237
9242
  : undefined,
9238
- basePath: ${JSON.stringify(config.basePath)},
9243
+ basePath: ${JSON.stringify(config.basePath)},${config.trailingSlash ? "\n trailingSlash: true," : ""}${config.i18n.enabled ? "\n i18n: farmI18nConfig," : ""}
9239
9244
  },
9240
9245
  ),
9241
9246
  {},
@@ -9261,18 +9266,22 @@ async function handleFarmDefaultMCP(request) {
9261
9266
  return handleFarmDefaultMCPRequest(request, {
9262
9267
  server: getFarmDefaultMCPServer(),
9263
9268
  basePath: ${JSON.stringify(config.basePath)},
9269
+ i18n: farmI18nConfig,
9270
+ // Each page at the URL it answers at, as in development and as the sitemap lists it.
9264
9271
  listPages: () =>
9265
9272
  collectFarmDefaultMCPPages(
9266
9273
  getFarmAgentListedPageRoutes().map((route) => ({ pattern: route.pattern, module: route.module })),
9267
- { origin, basePath: ${JSON.stringify(config.basePath)}, markdown: farmMarkdownConfig },
9274
+ {
9275
+ origin,
9276
+ basePath: ${JSON.stringify(config.basePath)},
9277
+ markdown: farmMarkdownConfig,${config.trailingSlash ? "\n trailingSlash: true," : ""}
9278
+ i18n: farmI18nConfig,
9279
+ },
9268
9280
  ),
9269
- // A fresh request through this handler, so the caller's cookies never shape a page.
9270
- // The handler sees paths below the base path, as the server passes them in.
9271
- readMarkdown: (url) => {
9272
- const page = new URL(url);
9273
- page.pathname = stripFarmBasePath(page.pathname);
9274
- return farmDefaultMCPReadMarkdown(page.href);
9275
- },
9281
+ // A fresh request through this handler, so the caller's cookies never shape a page. It
9282
+ // reads the public URL, base path included, as llms-full.txt does: this handler sees
9283
+ // public paths, and with i18n a mirror path without the base path answers with a redirect.
9284
+ readMarkdown: farmDefaultMCPReadMarkdown,
9276
9285
  });
9277
9286
  }
9278
9287
  // \`fetch\` is this module's outer request entry: plugin runtime hooks run and the page
@@ -9300,7 +9309,7 @@ function createFarmLlmsTxtContext(request, full) {
9300
9309
  origin,
9301
9310
  markdown: farmMarkdownConfig,
9302
9311
  include: farmLlmsTxtConfig.include,
9303
- exclude: farmLlmsTxtConfig.exclude,
9312
+ exclude: farmLlmsTxtConfig.exclude,${config.trailingSlash ? "\n trailingSlash: true," : ""}${config.i18n.enabled ? "\n i18n: farmI18nConfig," : ""}
9304
9313
  },
9305
9314
  );
9306
9315
  const rootLayout = layoutRoutes.find((layout) => layout.pattern === "/");
@@ -9890,7 +9899,7 @@ function getPPRShellBypassReason(request, middlewareData, middlewareContext) {
9890
9899
  if (farmSecurityConfig.csp && farmSecurityConfig.csp.nonce) return "csp-nonce";
9891
9900
  const method = request.method.toUpperCase();
9892
9901
  if (method !== "GET" && method !== "HEAD") return "method";
9893
- if (request.headers.get("cookie")) return "cookie";
9902
+ if (withoutFarmDeploymentCookie(request.headers.get("cookie"))) return "cookie";
9894
9903
  if (request.headers.get("authorization")) return "authorization";
9895
9904
  if (request.headers.get("x-farm-intercept-from")) return "route-interception";
9896
9905
  if (request.headers.get("x-farm-ppr-refresh")) return "refresh";
@@ -9902,12 +9911,15 @@ function getPPRShellBypassReason(request, middlewareData, middlewareContext) {
9902
9911
 
9903
9912
  // origin is set when the shell carries hreflang alternates (i18n prefix
9904
9913
  // routing), so one host never serves a shell holding another host's URLs.
9914
+ // A shell embeds its deployment's ID and client assets, and a shared cache
9915
+ // adapter outlives a deployment, so each deployment keys its own shells.
9905
9916
  function getPPRShellCacheKey(url, locale, origin) {
9906
9917
  const key = [
9907
9918
  "ppr",
9908
9919
  locale || "",
9909
9920
  normalizeRevalidatePath(url.pathname),
9910
9921
  url.search,
9922
+ farmDeploymentId,
9911
9923
  ];
9912
9924
  return createFarmCacheKey(origin ? key.concat(origin) : key);
9913
9925
  }
@@ -9937,22 +9949,13 @@ function hasFarmUnserializableRouteData(data) {
9937
9949
  return Boolean(data) && typeof data === "object" && Object.values(data).some(isPromise);
9938
9950
  }
9939
9951
 
9952
+ // Core's policy for the route, shared with the RSC server so both send the same Cache-Control.
9940
9953
  function getRouteSharedCacheControl(route, pprCanCache) {
9941
9954
  if (!route || !route.module) {
9942
9955
  return null;
9943
9956
  }
9944
9957
 
9945
- const view = resolveRouteRenderingView(route);
9946
- if (view.dynamic === "force-dynamic") {
9947
- return null;
9948
- }
9949
- if (!view.ssg && !pprCanCache) {
9950
- return null;
9951
- }
9952
-
9953
- const revalidate =
9954
- typeof view.revalidate === "number" && view.revalidate > 0 ? view.revalidate : 60;
9955
- return "public, s-maxage=" + revalidate + ", stale-while-revalidate=300";
9958
+ return resolveRouteSharedCacheControl(resolveRouteRenderingView(route), pprCanCache);
9956
9959
  }
9957
9960
 
9958
9961
  async function getCachedPPRShell(cacheKey) {
@@ -10023,8 +10026,9 @@ async function handleFarmRequestInContext(
10023
10026
  adapterContext,
10024
10027
  requestUrl = new URL(request.url),
10025
10028
  ) {
10026
- const farmCacheGuard = { guarded: farmPluginRuntimeKeepsResponsesPrivate };
10027
- const response = await resolveFarmRequestInContext(
10029
+ // deploymentPage: a page route answered, so the response names this deployment.
10030
+ const farmCacheGuard = { guarded: farmPluginRuntimeKeepsResponsesPrivate, deploymentPage: false };
10031
+ let response = await resolveFarmRequestInContext(
10028
10032
  farmCacheGuard,
10029
10033
  request,
10030
10034
  farmLocaleResolution,
@@ -10033,6 +10037,11 @@ async function handleFarmRequestInContext(
10033
10037
  adapterContext,
10034
10038
  requestUrl,
10035
10039
  );
10040
+ if (farmCacheGuard.deploymentPage) {
10041
+ response = _withFarmResponseHeaders(response, (headers) =>
10042
+ headers.set(FARM_DEPLOYMENT_ID_HEADER, farmDeploymentId)
10043
+ );
10044
+ }
10036
10045
  if (!farmCacheGuard.guarded) return response;
10037
10046
  // Tells the Nitro entry, which keeps this policy over a swr rule's public one.
10038
10047
  adapterContext?.onGuardedResponse?.();
@@ -10276,6 +10285,14 @@ ${hasServerRuntimeIntegrations ? `
10276
10285
  middlewareHeaders,
10277
10286
  );
10278
10287
  }
10288
+ // A docs page is a page document: it names this deployment, and a navigation from
10289
+ // another deployment's page is refused, as for an app page.
10290
+ const farmDocsDeploymentMismatch = getFarmDeploymentMismatch(request, farmDeploymentId);
10291
+ if (farmDocsDeploymentMismatch) {
10292
+ await docsResponse.body?.cancel();
10293
+ return createFarmDeploymentMismatchResponse(farmDocsDeploymentMismatch);
10294
+ }
10295
+ farmCacheGuard.deploymentPage = true;
10279
10296
  const wrappedDocsResponse = withFarmDocsRequestCache(
10280
10297
  await wrapFarmDocsResponseWithLayouts(request, docsResponse),
10281
10298
  request,
@@ -10307,7 +10324,7 @@ ${hasServerRuntimeIntegrations ? `
10307
10324
  clientAddress: adapterContext?.clientAddress,
10308
10325
  // An anonymous visitor's request: guards never see the caller's address.
10309
10326
  renderPage: (targetRequest) =>
10310
- fetchFarmInnerRequest(targetRequest, {
10327
+ fetchFarmInnerRequest(toFarmMarkdownPageRequest(targetRequest), {
10311
10328
  ...adapterContext,
10312
10329
  clientAddress: FARM_MARKDOWN_ANONYMOUS_CLIENT_ADDRESS,
10313
10330
  }),
@@ -10354,7 +10371,8 @@ ${hasServerRuntimeIntegrations ? `
10354
10371
  routePathname: getFarmRoutePathname,
10355
10372
  routeExists: (targetPathname) =>
10356
10373
  Boolean(matchPageRoute(getFarmRoutePathname(targetPathname))),
10357
- renderPage: (targetRequest) => fetchFarmInnerRequest(targetRequest, adapterContext),
10374
+ renderPage: (targetRequest) =>
10375
+ fetchFarmInnerRequest(toFarmMarkdownPageRequest(targetRequest), adapterContext),
10358
10376
  apiServerBasePath: farmLocalAPIBasePath,
10359
10377
  });
10360
10378
  if (markdownResponse) {
@@ -10547,6 +10565,14 @@ ${hasServerRuntimeIntegrations ? `
10547
10565
  // Handle page routes (SSR)
10548
10566
  emitFarmEvent({ type: "render.start", route: pathname, pathname });
10549
10567
  const matchedRoute = matchPageRoute(routePathname);
10568
+ if (matchedRoute) {
10569
+ // A browser holding another deployment's page names it: a navigation fetch in its header, a
10570
+ // form or server action post in the deployment cookie. Refuse it before an action runs, and
10571
+ // before a document would refresh that cookie to this deployment.
10572
+ const farmDeploymentMismatch = getFarmDeploymentMismatch(request, farmDeploymentId);
10573
+ if (farmDeploymentMismatch) return createFarmDeploymentMismatchResponse(farmDeploymentMismatch);
10574
+ farmCacheGuard.deploymentPage = true;
10575
+ }
10550
10576
  ${farmIslandsMode ? `// Islands mode: a form or client component posting a server action to this page.
10551
10577
  if (matchedRoute && request.method === "POST") {
10552
10578
  const actionResponse = await _runWithMiddlewareData(middlewareData || {}, () =>
@@ -11679,6 +11705,13 @@ ${farmRendererDisabled ? `
11679
11705
  { status: 404, headers: { "Content-Type": "application/json" } }
11680
11706
  ), middlewareHeaders);
11681
11707
  ` : ""}
11708
+ // The not-found page is a page document: it names this deployment, and a navigation from
11709
+ // another deployment's page is refused, as for an app page.
11710
+ const farmNotFoundDeploymentMismatch = getFarmDeploymentMismatch(request, farmDeploymentId);
11711
+ if (farmNotFoundDeploymentMismatch) {
11712
+ return createFarmDeploymentMismatchResponse(farmNotFoundDeploymentMismatch);
11713
+ }
11714
+ farmCacheGuard.deploymentPage = true;
11682
11715
  // Agents that navigate in Markdown (a \`.md\` URL or \`Accept: text/markdown\`)
11683
11716
  // get a Markdown error body instead of the HTML not-found shell.
11684
11717
  if (farmRequestWantsMarkdown(pathname, request.headers.get("accept"))) {
@@ -11917,9 +11950,10 @@ async function handleFarmFetch(request, context) {
11917
11950
  );
11918
11951
 
11919
11952
  // headers() config applies after middleware let the request through, so it learns
11920
- // whether the response was guarded and can't make that response shareable again.
11953
+ // whether the response was guarded and can't make that response shareable again. A plugin
11954
+ // runtime hook that throws answers a new 500 out here, which learns it the same way.
11921
11955
  let farmGuardedResponse = false;
11922
- if (configuredHeaderRoutes.length > 0) {
11956
+ if (configuredHeaderRoutes.length > 0 || farmPluginRuntime) {
11923
11957
  const adapterContext = context;
11924
11958
  context = {
11925
11959
  ...adapterContext,
@@ -11952,9 +11986,15 @@ async function handleFarmFetch(request, context) {
11952
11986
  const configured = applyConfiguredResponseHeaders(response, routePathname);
11953
11987
  // Configured headers may edit the response in place, so check it either way.
11954
11988
  const guarded = farmGuardedResponse ? _withFarmGuardedResponseCache(configured) : configured;
11989
+ // The deployment cookie goes on once the response's cache policy is final.
11955
11990
  return applyFarmPreloadBudget(
11956
11991
  applyFarmCspNonceToResponse(
11957
- applyFarmMobileShellResponse(runtimeRequest, guarded, context),
11992
+ _withFarmDeploymentCookie(
11993
+ runtimeRequest,
11994
+ applyFarmMobileShellResponse(runtimeRequest, guarded, context),
11995
+ farmDeploymentId,
11996
+ farmDeploymentCookiePath,
11997
+ ),
11958
11998
  farmSecurityConfig,
11959
11999
  cspNonce,
11960
12000
  ),
@@ -11999,7 +12039,9 @@ async function handleFarmFetch(request, context) {
11999
12039
  const response = await _runWithCurrentRequest(request, () =>
12000
12040
  _runWithFarmCspNonce(cspNonce, () => _runWithAfterRequest(request, runRequest, context)),
12001
12041
  );
12002
- return ${hasCompressionRuntime && !hasPluginRuntime ? "compressFarmResponse(request, response, getFarmOwnedBufferedHtml(response), farmLazyBufferedHtml.has(response))" : "response"};
12042
+ // A Nitro cache rule stores the response and strips its Content-Encoding, so a
12043
+ // response it caches is sent as it is, with no Vary on an encoding it never saw.
12044
+ return ${hasCompressionRuntime && !hasPluginRuntime ? "context?.routeRuleCache ? response : compressFarmResponse(request, response, getFarmOwnedBufferedHtml(response), farmLazyBufferedHtml.has(response))" : "response"};
12003
12045
  }),
12004
12046
  {
12005
12047
  onResponseFinished: typeof context?.onResponseFinished === "function"
@@ -12093,6 +12135,14 @@ function withFarmEdgeGuardedPrerenderHeaders(headers, edgeGuarded) {
12093
12135
  "cache-control": "private, no-store"
12094
12136
  };
12095
12137
  }
12138
+ function prerenderWouldChangePageUrl(pathname) {
12139
+ if (/%(?:23|25|2F|3F)/i.test(pathname)) return true;
12140
+ try {
12141
+ return decodeURI(pathname) !== pathname;
12142
+ } catch {
12143
+ return true;
12144
+ }
12145
+ }
12096
12146
  function getPhysicalPrerenderBypassReason(options) {
12097
12147
  const {
12098
12148
  config,
@@ -12102,6 +12152,7 @@ function getPhysicalPrerenderBypassReason(options) {
12102
12152
  rewriteSources,
12103
12153
  pathname
12104
12154
  } = options;
12155
+ if (prerenderWouldChangePageUrl(pathname)) return "an escaped character in its URL";
12105
12156
  if (config.i18n.enabled) return "request-sensitive i18n";
12106
12157
  if (redirectSources.some((source) => middlewarePatternMatches(source, pathname))) {
12107
12158
  return "redirect";
@@ -12533,6 +12584,7 @@ ${hasNitroCacheRouteRules ? " let farmGuardedResponse = false\n" : ""} const r
12533
12584
  onResponseFinished: createResponseFinishedHook(event),
12534
12585
  trustedLocalOrigin: resolveTrustedLocalOrigin(event, request),
12535
12586
  clientAddress: resolveFarmClientAddress(event),${hasNitroCacheRouteRules ? `
12587
+ routeRuleCache: Boolean(event.context?.routeRules?.cache),
12536
12588
  onGuardedResponse: () => {
12537
12589
  farmGuardedResponse = true
12538
12590
  },` : ""}
@@ -12647,7 +12699,10 @@ function toFarmNodeResponse(request, response) {
12647
12699
  ssrEntryFile
12648
12700
  );
12649
12701
  const configuredNitroRouteRules = nitroRouteRulesBelowBasePath(
12650
- shouldBuildFarmMobileClient(config) ? varyFarmNitroCacheRulesByShell(routeRulesToNitroRouteRules(config.routeRules)) : routeRulesToNitroRouteRules(config.routeRules),
12702
+ varyFarmNitroCacheRules(routeRulesToNitroRouteRules(config.routeRules), [
12703
+ ...config.md.enabled ? ["accept"] : [],
12704
+ ...shouldBuildFarmMobileClient(config) ? ["x-farm-shell"] : []
12705
+ ]),
12651
12706
  config.basePath,
12652
12707
  resolveFarmAPIServerBasePath(config.api)
12653
12708
  );
@@ -13238,7 +13293,8 @@ async function copyFarmDocsRootContent(docs, root, srcDir, bundledContentDir, fs
13238
13293
  await fs4.mkdir(path12.dirname(bundledContentDir), { recursive: true });
13239
13294
  await fs4.cp(docsContentDir, bundledContentDir, {
13240
13295
  recursive: true,
13241
- force: true
13296
+ force: true,
13297
+ dereference: true
13242
13298
  });
13243
13299
  await fs4.writeFile(
13244
13300
  path12.join(bundledContentDir, FARM_DOCS_LAST_MODIFIED_MANIFEST),
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  MiddlewareManager
3
- } from "./chunk-WMLSZAKN.mjs";
3
+ } from "./chunk-JZQS3ZOI.mjs";
4
4
  import {
5
5
  matchesMiddlewarePredicate
6
6
  } from "./chunk-EDPENAVO.mjs";
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
- var _chunk22LGTSBAcjs = require('./chunk-22LGTSBA.cjs');
3
+ var _chunkMZLJFNMHcjs = require('./chunk-MZLJFNMH.cjs');
4
4
 
5
5
  // src/deployment-environment.ts
6
6
  function isFarmProductionDeploymentEnvironment(env = process.env) {
@@ -90,7 +90,7 @@ function createFarmProductionSiteReporter(options) {
90
90
  schemaVersion: FARM_PRODUCTION_SITE_TELEMETRY_SCHEMA_VERSION,
91
91
  eventType: FARM_PRODUCTION_SITE_ATTESTATION_EVENT_TYPE,
92
92
  packageName: FARM_PRODUCTION_SITE_TELEMETRY_PACKAGE_NAME,
93
- packageVersion: sanitizeDetail(_chunk22LGTSBAcjs.FARM_VERSION, "unknown"),
93
+ packageVersion: sanitizeDetail(_chunkMZLJFNMHcjs.FARM_VERSION, "unknown"),
94
94
  renderer: sanitizeDetail(options.renderer, "custom"),
95
95
  deployTarget: sanitizeDetail(options.deployTarget, "custom")
96
96
  };
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-ALEUMLJN.mjs";
5
5
  import {
6
6
  FARM_NAVIGATION_HEAD_SELECTOR
7
- } from "./chunk-WYL4ODZ4.mjs";
7
+ } from "./chunk-SE7HPBYK.mjs";
8
8
  import {
9
9
  docsEngine,
10
10
  loadFarmDocsEngine
@@ -18,7 +18,7 @@ import {
18
18
  } from "./chunk-22W4FNTG.mjs";
19
19
  import {
20
20
  farmAcceptQuality
21
- } from "./chunk-IFR74W6S.mjs";
21
+ } from "./chunk-KPJYBSHL.mjs";
22
22
  import {
23
23
  isMissingPackageError
24
24
  } from "./chunk-NR63PD3P.mjs";