@farm.js/core 0.1.67 → 0.1.68

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 (281) hide show
  1. package/dist/{agent-mcp.d-BFu9xHAi.d.ts → agent-mcp.d-Uh5xr7aX.d.ts} +1 -1
  2. package/dist/{agent-mcp.d-DWyWkTSy.d.mts → agent-mcp.d-wkVPK1GA.d.mts} +1 -1
  3. package/dist/agent-runtime.d.mts +5 -3
  4. package/dist/agent-runtime.d.ts +5 -3
  5. package/dist/{analyzer-TTIIXXMQ.mjs → analyzer-CQDU7E3Y.mjs} +2 -2
  6. package/dist/analyzer-PPAHM4AW.cjs +16 -0
  7. package/dist/api/node.d.mts +7 -5
  8. package/dist/api/node.d.ts +7 -5
  9. package/dist/api/route-manager.d.mts +7 -5
  10. package/dist/api/route-manager.d.ts +7 -5
  11. package/dist/api/runtime.d.mts +6 -4
  12. package/dist/api/runtime.d.ts +6 -4
  13. package/dist/api.d.mts +8 -6
  14. package/dist/api.d.ts +8 -6
  15. package/dist/{app-manifest.d-CwfhGrVR.d.ts → app-manifest.d-BT5i2F-o.d.ts} +1 -1
  16. package/dist/{app-manifest.d-CRmjN5j9.d.mts → app-manifest.d-Dd4q5CFx.d.mts} +1 -1
  17. package/dist/app-markdown.cjs +3 -3
  18. package/dist/app-markdown.d.mts +10 -10
  19. package/dist/app-markdown.d.ts +10 -10
  20. package/dist/app-markdown.mjs +2 -2
  21. package/dist/{app.d-BX9LVTiP.d.ts → app.d-BVOpL_f2.d.ts} +6 -6
  22. package/dist/{app.d-uBBUxwyV.d.mts → app.d-BhiDXex_.d.mts} +6 -6
  23. package/dist/{chunk-23PVOIPT.cjs → chunk-225APHKC.cjs} +3 -3
  24. package/dist/{chunk-4JX3M4C6.cjs → chunk-23VJEGKC.cjs} +2 -1
  25. package/dist/{chunk-Q37INCXG.cjs → chunk-3EEINK7G.cjs} +11 -2
  26. package/dist/{chunk-BRWIVOV4.cjs → chunk-3GNHJ3RN.cjs} +10 -8
  27. package/dist/{chunk-QJVW76JG.mjs → chunk-3Y52TWYU.mjs} +2 -2
  28. package/dist/{chunk-OB3IFUK6.cjs → chunk-437QZIC2.cjs} +4 -4
  29. package/dist/{chunk-WGHY3OL5.mjs → chunk-4UAQB5LB.mjs} +232 -49
  30. package/dist/{chunk-JWSI5WO4.mjs → chunk-4ZXKYCYK.mjs} +1 -1
  31. package/dist/{chunk-N35YPV4N.mjs → chunk-57QAQU4F.mjs} +9 -7
  32. package/dist/{chunk-AQDLVHNF.mjs → chunk-5FBZJJGA.mjs} +17 -0
  33. package/dist/{chunk-PL6RTBDE.cjs → chunk-5JKDFRTK.cjs} +2 -2
  34. package/dist/{chunk-CO3YMZFD.mjs → chunk-6OFOIMNS.mjs} +1 -1
  35. package/dist/{chunk-556H7JCE.cjs → chunk-7LK5CTUM.cjs} +14 -14
  36. package/dist/{chunk-E6CD45JK.mjs → chunk-A3T445WK.mjs} +19 -5
  37. package/dist/{chunk-DQJ2CIH7.cjs → chunk-ASYOWPSR.cjs} +2 -1
  38. package/dist/{chunk-QGJ4FI2G.mjs → chunk-C6HGUTXB.mjs} +113 -29
  39. package/dist/{chunk-IRA2CZAY.mjs → chunk-CRVSYDHV.mjs} +2 -2
  40. package/dist/{chunk-XNZWMXCF.mjs → chunk-DIXFKAPM.mjs} +183 -76
  41. package/dist/{chunk-QGQP6QKO.cjs → chunk-DWLNLU55.cjs} +2 -2
  42. package/dist/{chunk-52Y3C3HG.mjs → chunk-E7VF3LQ5.mjs} +3 -2
  43. package/dist/{chunk-N5DQMOAG.cjs → chunk-F36LS2C7.cjs} +273 -90
  44. package/dist/{chunk-H37MDCPR.mjs → chunk-F6CMGWAL.mjs} +1 -1
  45. package/dist/{chunk-HNVAZGQD.cjs → chunk-FJMC24KG.cjs} +2 -2
  46. package/dist/{chunk-KCY52OUQ.cjs → chunk-FSODPZRT.cjs} +1 -1
  47. package/dist/{chunk-PPX7UOFY.cjs → chunk-FVYBEMOD.cjs} +55 -38
  48. package/dist/{chunk-6YBYX4K4.mjs → chunk-G7NBPP7H.mjs} +1 -1
  49. package/dist/{chunk-HFHJJXSV.mjs → chunk-GFPS7MNE.mjs} +1 -1
  50. package/dist/{chunk-3T5TLFCQ.mjs → chunk-HEJM46HQ.mjs} +11 -2
  51. package/dist/chunk-HHLEYA4B.cjs +17 -0
  52. package/dist/{chunk-F43OG25P.cjs → chunk-I7J5RLGO.cjs} +15 -1
  53. package/dist/chunk-ICFPTHXM.mjs +97 -0
  54. package/dist/{chunk-6V5YWI4W.cjs → chunk-IGDYL2IA.cjs} +2 -2
  55. package/dist/{chunk-TEG6HJVF.mjs → chunk-JL2YW5KX.mjs} +1 -0
  56. package/dist/{chunk-JVM3DKZE.mjs → chunk-KDO6T6OB.mjs} +1 -1
  57. package/dist/{chunk-QITSS4TD.cjs → chunk-KWCZKJYU.cjs} +352 -245
  58. package/dist/{chunk-DCXSIEFE.cjs → chunk-LDEXTX4I.cjs} +51 -37
  59. package/dist/{chunk-3T7ALZJF.cjs → chunk-LR4KP3I7.cjs} +2 -2
  60. package/dist/{chunk-VFXE6NWR.mjs → chunk-MGKWYPE3.mjs} +2 -1
  61. package/dist/{chunk-5TA63JD3.mjs → chunk-MGZVDX4R.mjs} +1 -1
  62. package/dist/{chunk-6SQZXRJ2.cjs → chunk-MMDKYJ5V.cjs} +7 -7
  63. package/dist/{chunk-HP2DQGQH.mjs → chunk-MNJDNTGO.mjs} +1 -1
  64. package/dist/{chunk-5Y2P454O.cjs → chunk-MTBDJ326.cjs} +6 -5
  65. package/dist/{chunk-XUES6OET.mjs → chunk-MV7NWU23.mjs} +1 -1
  66. package/dist/{chunk-4DRINDGN.cjs → chunk-MZ4CRSY7.cjs} +254 -125
  67. package/dist/{chunk-4IHMHFQB.cjs → chunk-NG2EZ6QS.cjs} +28 -1
  68. package/dist/{chunk-WDD5CTZW.mjs → chunk-NT4W4H52.mjs} +6 -6
  69. package/dist/{chunk-F7JKVHU2.mjs → chunk-NVOMQLI2.mjs} +15 -1
  70. package/dist/{chunk-22IWL4YD.cjs → chunk-OCNV4CI2.cjs} +21 -2
  71. package/dist/{chunk-72KCTHLV.cjs → chunk-PRL7FXG4.cjs} +113 -29
  72. package/dist/{chunk-YVTS3S3F.cjs → chunk-QOGIZKSO.cjs} +3 -3
  73. package/dist/{chunk-DB2HSHQA.cjs → chunk-QSUYB3RH.cjs} +14 -14
  74. package/dist/chunk-QYNZ3CTI.mjs +17 -0
  75. package/dist/{chunk-724MGMIL.mjs → chunk-R2ZHU37O.mjs} +19 -0
  76. package/dist/{chunk-YQYTQJZN.mjs → chunk-RLH5AH2M.mjs} +1 -1
  77. package/dist/{chunk-HM7AGSKU.cjs → chunk-SQ6IWJ3H.cjs} +1 -1
  78. package/dist/{chunk-V5MQMQ2P.mjs → chunk-T5XFZQCL.mjs} +1 -1
  79. package/dist/{chunk-Q5UX55YA.cjs → chunk-TNK2TVRS.cjs} +831 -470
  80. package/dist/{chunk-J7JHVCWA.cjs → chunk-UKZ6AWKZ.cjs} +2 -1
  81. package/dist/{chunk-V5RTHYJB.cjs → chunk-URN7VFO7.cjs} +91 -22
  82. package/dist/{chunk-HRPTMX5C.mjs → chunk-VFNAK6A5.mjs} +2 -2
  83. package/dist/{chunk-VK54PDQ6.mjs → chunk-VRGY3X2I.mjs} +86 -17
  84. package/dist/chunk-W44X6IC2.cjs +97 -0
  85. package/dist/{chunk-GTV2ABO7.mjs → chunk-WPB67LE5.mjs} +162 -33
  86. package/dist/{chunk-UHE5JUKB.mjs → chunk-XCAQTCGK.mjs} +1 -1
  87. package/dist/{chunk-DGOFR7D5.cjs → chunk-Y6KHPJDB.cjs} +2 -2
  88. package/dist/{chunk-LPIZMU7D.cjs → chunk-YTNBCXCW.cjs} +4 -4
  89. package/dist/{chunk-KWFNUODD.mjs → chunk-YVPX5PI5.mjs} +1 -0
  90. package/dist/{chunk-6R53ZWX2.cjs → chunk-Z3PW3DIR.cjs} +3 -3
  91. package/dist/{chunk-UHNSY2PQ.mjs → chunk-Z6SOXHAD.mjs} +772 -411
  92. package/dist/{chunk-5FE5YT2N.mjs → chunk-ZZGQD3LL.mjs} +28 -1
  93. package/dist/{client-component.d-CDRvRmbU.d.mts → client-component.d-BvQOxSqh.d.mts} +2 -2
  94. package/dist/{client-component.d-DWRKyAp5.d.ts → client-component.d-DNVSLEPi.d.ts} +2 -2
  95. package/dist/{client-plugins.d-BNILjfX3.d.mts → client-plugins.d-CE1lVK2R.d.mts} +23 -234
  96. package/dist/{client-plugins.d-CrKZiNSN.d.ts → client-plugins.d-CNDqcAuf.d.ts} +23 -234
  97. package/dist/client-plugins.d.mts +5 -3
  98. package/dist/client-plugins.d.ts +5 -3
  99. package/dist/client.cjs +6 -6
  100. package/dist/client.d.mts +10 -8
  101. package/dist/client.d.ts +10 -8
  102. package/dist/client.mjs +5 -5
  103. package/dist/config.d.mts +5 -3
  104. package/dist/config.d.ts +5 -3
  105. package/dist/deployment.cjs +4 -2
  106. package/dist/deployment.d.mts +15 -1
  107. package/dist/deployment.d.ts +15 -1
  108. package/dist/deployment.mjs +3 -1
  109. package/dist/desktop.d.mts +6 -4
  110. package/dist/desktop.d.ts +6 -4
  111. package/dist/{devtools-UFQYT3VA.mjs → devtools-2A2GPC7B.mjs} +6 -6
  112. package/dist/{devtools-RZVT4JVN.cjs → devtools-R27T3BRY.cjs} +7 -7
  113. package/dist/docs.cjs +9 -9
  114. package/dist/docs.d.mts +6 -4
  115. package/dist/docs.d.ts +6 -4
  116. package/dist/docs.mjs +8 -8
  117. package/dist/environment/vite.cjs +5 -5
  118. package/dist/environment/vite.d.mts +1 -1
  119. package/dist/environment/vite.d.ts +1 -1
  120. package/dist/environment/vite.mjs +4 -4
  121. package/dist/{generate-route-types.d-BL2pq6xC.d.ts → generate-route-types.d-B76M5R11.d.ts} +1 -1
  122. package/dist/{generate-route-types.d-BoVDU8qX.d.mts → generate-route-types.d-CaGMIaNI.d.mts} +1 -1
  123. package/dist/index.cjs +41 -36
  124. package/dist/{index.d-Bdm6866n.d.mts → index.d-Bt3kl19W.d.mts} +1 -1
  125. package/dist/{index.d-Dey5T14f.d.ts → index.d-Cx_-DaKV.d.ts} +1 -1
  126. package/dist/index.d.mts +25 -22
  127. package/dist/index.d.ts +25 -22
  128. package/dist/index.mjs +43 -38
  129. package/dist/instrumentation.cjs +3 -3
  130. package/dist/instrumentation.mjs +2 -2
  131. package/dist/integrations/orm.d.mts +5 -3
  132. package/dist/integrations/orm.d.ts +5 -3
  133. package/dist/integrations.d.mts +5 -3
  134. package/dist/integrations.d.ts +5 -3
  135. package/dist/internal/app-markdown-runtime.cjs +2 -2
  136. package/dist/internal/app-markdown-runtime.d.mts +12 -5
  137. package/dist/internal/app-markdown-runtime.d.ts +12 -5
  138. package/dist/internal/app-markdown-runtime.mjs +1 -1
  139. package/dist/internal/build-runtime.cjs +33 -30
  140. package/dist/internal/build-runtime.d.mts +7 -5
  141. package/dist/internal/build-runtime.d.ts +7 -5
  142. package/dist/internal/build-runtime.mjs +32 -29
  143. package/dist/internal/cli-runtime.cjs +10 -10
  144. package/dist/internal/cli-runtime.mjs +9 -9
  145. package/dist/internal/client-error-overlay.cjs +4 -4
  146. package/dist/internal/client-error-overlay.mjs +1 -1
  147. package/dist/internal/client-runtime.cjs +31 -36
  148. package/dist/internal/client-runtime.d.mts +8 -6
  149. package/dist/internal/client-runtime.d.ts +8 -6
  150. package/dist/internal/client-runtime.mjs +22 -27
  151. package/dist/internal/compression-runtime.d.mts +5 -3
  152. package/dist/internal/compression-runtime.d.ts +5 -3
  153. package/dist/internal/config-runtime.cjs +8 -8
  154. package/dist/internal/config-runtime.d.mts +9 -7
  155. package/dist/internal/config-runtime.d.ts +9 -7
  156. package/dist/internal/config-runtime.mjs +7 -7
  157. package/dist/internal/form-actions.cjs +7 -2
  158. package/dist/internal/form-actions.d.mts +10 -3
  159. package/dist/internal/form-actions.d.ts +10 -3
  160. package/dist/internal/form-actions.mjs +8 -3
  161. package/dist/internal/infra-analytics-runtime.cjs +6 -6
  162. package/dist/internal/infra-analytics-runtime.mjs +4 -4
  163. package/dist/internal/islands-boot.cjs +6 -1
  164. package/dist/internal/islands-boot.mjs +6 -1
  165. package/dist/internal/native-server-fns.cjs +4 -4
  166. package/dist/internal/native-server-fns.mjs +3 -3
  167. package/dist/internal/product-telemetry-runtime.cjs +3 -3
  168. package/dist/internal/product-telemetry-runtime.mjs +2 -2
  169. package/dist/internal/production-node-env.cjs +4 -2
  170. package/dist/internal/production-node-env.d.mts +22 -1
  171. package/dist/internal/production-node-env.d.ts +22 -1
  172. package/dist/internal/production-node-env.mjs +3 -1
  173. package/dist/internal/production-runtime.cjs +13 -9
  174. package/dist/internal/production-runtime.d.mts +21 -16
  175. package/dist/internal/production-runtime.d.ts +21 -16
  176. package/dist/internal/production-runtime.mjs +13 -9
  177. package/dist/internal/server-tree.cjs +2 -2
  178. package/dist/internal/server-tree.d.mts +0 -5
  179. package/dist/internal/server-tree.d.ts +0 -5
  180. package/dist/internal/server-tree.mjs +1 -1
  181. package/dist/internal/vercel-edge-middleware.cjs +87 -0
  182. package/dist/internal/vercel-edge-middleware.d.mts +39 -0
  183. package/dist/internal/vercel-edge-middleware.d.ts +39 -0
  184. package/dist/internal/vercel-edge-middleware.mjs +87 -0
  185. package/dist/layers-7P4RLKVX.cjs +20 -0
  186. package/dist/{layers-T55SA47E.mjs → layers-XQ7VFMWO.mjs} +4 -2
  187. package/dist/{layers.d-CcS42OGR.d.mts → layers.d-CH0bC4QL.d.mts} +2 -1
  188. package/dist/{layers.d-CcS42OGR.d.ts → layers.d-CH0bC4QL.d.ts} +2 -1
  189. package/dist/markdown.d.mts +5 -3
  190. package/dist/markdown.d.ts +5 -3
  191. package/dist/middleware.cjs +4 -4
  192. package/dist/middleware.d.mts +8 -5
  193. package/dist/middleware.d.ts +8 -5
  194. package/dist/middleware.mjs +6 -6
  195. package/dist/mobile.d.mts +4 -4
  196. package/dist/mobile.d.ts +4 -4
  197. package/dist/{mount.d-BP0nLYQO.d.mts → mount.d-Bki4pOaJ.d.mts} +1 -1
  198. package/dist/{mount.d-CkiPky_F.d.ts → mount.d-DjR5aerM.d.ts} +1 -1
  199. package/dist/{navigation-delegate.d-DchcGzAQ.d.ts → navigation-delegate.d-CtghaSP3.d.ts} +1 -1
  200. package/dist/{navigation-delegate.d-CdBP-hkZ.d.mts → navigation-delegate.d-VDkziXTK.d.mts} +1 -1
  201. package/dist/navigation.cjs +5 -5
  202. package/dist/navigation.d.mts +8 -6
  203. package/dist/navigation.d.ts +8 -6
  204. package/dist/navigation.mjs +4 -4
  205. package/dist/{nitro-55YOZWRA.mjs → nitro-NSTXT7LB.mjs} +2 -2
  206. package/dist/{nitro-EEX2J3KB.cjs → nitro-Y3LGITW3.cjs} +4 -4
  207. package/dist/node-module-bundle-LIZ2KMVW.cjs +13 -0
  208. package/dist/node-module-bundle-VR6NV6AI.mjs +13 -0
  209. package/dist/plugin.cjs +20 -20
  210. package/dist/plugin.d.mts +7 -5
  211. package/dist/plugin.d.ts +7 -5
  212. package/dist/plugin.mjs +19 -19
  213. package/dist/{production-runtime.d-Dou_Htas.d.ts → production-runtime.d-BMyyLGBB.d.ts} +3 -57
  214. package/dist/{production-runtime.d-VwsBzIee.d.mts → production-runtime.d-DMZY3OgV.d.mts} +3 -57
  215. package/dist/query/client.cjs +6 -6
  216. package/dist/query/client.mjs +2 -2
  217. package/dist/{render-plan.d-LKymStDJ.d.mts → render-plan.d-BSwV8PE4.d.mts} +1 -1
  218. package/dist/{render-plan.d-D8UakAIk.d.ts → render-plan.d-i9sI4tc9.d.ts} +1 -1
  219. package/dist/renderer/react/server.cjs +2 -2
  220. package/dist/renderer/react/server.mjs +1 -1
  221. package/dist/renderer-client.cjs +5 -5
  222. package/dist/renderer-client.d.mts +8 -6
  223. package/dist/renderer-client.d.ts +8 -6
  224. package/dist/renderer-client.mjs +2 -2
  225. package/dist/renderer.d.mts +5 -0
  226. package/dist/renderer.d.ts +5 -0
  227. package/dist/{request.d-KG-4d2eG.d.mts → request.d-C24FNQ_7.d.mts} +1 -1
  228. package/dist/{request.d-B928QjWy.d.ts → request.d-Dgln8tuI.d.ts} +1 -1
  229. package/dist/request.d.mts +6 -4
  230. package/dist/request.d.ts +6 -4
  231. package/dist/{route-rendering.d-DoEe_w9t.d.ts → route-rendering.d-CUylZKJA.d.ts} +1 -1
  232. package/dist/{route-rendering.d-NIHQeb4m.d.mts → route-rendering.d-Ds0BfwQi.d.mts} +1 -1
  233. package/dist/{router.d-DYnRHQwz.d.ts → router.d-B56rMOFm.d.ts} +1 -1
  234. package/dist/{router.d-B8PkJSGp.d.mts → router.d-CFPcbqzc.d.mts} +1 -1
  235. package/dist/{routes.d-uUBZyWoK.d.ts → routes.d-9GFFNioh.d.ts} +1 -1
  236. package/dist/{routes.d-DgZ_jgGG.d.mts → routes.d-CrEy0lJS.d.mts} +1 -1
  237. package/dist/routes.d.mts +5 -3
  238. package/dist/routes.d.ts +5 -3
  239. package/dist/{rsc-pipeline-7K5H2RPH.cjs → rsc-pipeline-3T7V6OUT.cjs} +10 -9
  240. package/dist/{rsc-pipeline-4OJ5ZQNZ.mjs → rsc-pipeline-GA4AQWZI.mjs} +9 -8
  241. package/dist/{runtime-X52Q7JFR.cjs → runtime-REUTNTI5.cjs} +20 -20
  242. package/dist/{runtime-U7O3HZOZ.mjs → runtime-ZYCKKY7L.mjs} +12 -12
  243. package/dist/{runtime.d-BxQIzwfy.d.mts → runtime.d-DLRO-ExG.d.mts} +1 -1
  244. package/dist/{runtime.d-DP7mEkEF.d.ts → runtime.d-H7k9hOQE.d.ts} +1 -1
  245. package/dist/server-http.d-rAe7lAQc.d.mts +70 -0
  246. package/dist/server-http.d-rAe7lAQc.d.ts +70 -0
  247. package/dist/server-plugins.d.mts +6 -4
  248. package/dist/server-plugins.d.ts +6 -4
  249. package/dist/server.cjs +46 -44
  250. package/dist/server.d-C5FFrZAo.d.ts +57 -0
  251. package/dist/server.d-DgC8xew5.d.mts +57 -0
  252. package/dist/server.d.mts +13 -11
  253. package/dist/server.d.ts +13 -11
  254. package/dist/server.mjs +28 -26
  255. package/dist/{spa-router.d-DsFDHTsv.d.ts → spa-router.d-Dr7oanhl.d.ts} +2 -2
  256. package/dist/{spa-router.d-BgHPVMhz.d.mts → spa-router.d-g4CzhEH1.d.mts} +2 -2
  257. package/dist/testing.d.mts +5 -3
  258. package/dist/testing.d.ts +5 -3
  259. package/dist/types.d-xCIhyjOq.d.mts +233 -0
  260. package/dist/types.d-xCIhyjOq.d.ts +233 -0
  261. package/dist/{utils.d-zxAVcf_V.d.ts → utils.d-BxxyDEb8.d.ts} +1 -1
  262. package/dist/{utils.d-BKyKDBR1.d.mts → utils.d-HIla3pD_.d.mts} +1 -1
  263. package/dist/version.cjs +2 -2
  264. package/dist/version.mjs +1 -1
  265. package/dist/vite.cjs +20 -20
  266. package/dist/vite.d.mts +10 -8
  267. package/dist/vite.d.ts +10 -8
  268. package/dist/vite.mjs +19 -19
  269. package/dist/workflows.cjs +2 -2
  270. package/dist/workflows.d.mts +121 -1
  271. package/dist/workflows.d.ts +121 -1
  272. package/dist/workflows.mjs +1 -1
  273. package/package.json +7 -2
  274. package/dist/analyzer-KVZGVY5Q.cjs +0 -16
  275. package/dist/chunk-CLFEQGET.cjs +0 -60
  276. package/dist/chunk-MK5E44WP.mjs +0 -60
  277. package/dist/layers-DMRXRL7F.cjs +0 -18
  278. package/dist/node-module-bundle-7JHPPF6B.mjs +0 -11
  279. package/dist/node-module-bundle-YJGYBOGK.cjs +0 -11
  280. package/dist/workflows.d-CRMzQZ3k.d.mts +0 -188
  281. package/dist/workflows.d-CRMzQZ3k.d.ts +0 -188
@@ -74,16 +74,25 @@ async function evaluateMdxSource(source, filePath) {
74
74
  }
75
75
  function createFarmMarkdownRouteModule(input) {
76
76
  const { body } = parseMarkdownFrontmatter(input.source);
77
- const components = input.components || {};
78
77
  const className = _optionalChain([input, 'access', _6 => _6.config, 'optionalAccess', _7 => _7.className]) || "farm-markdown";
79
78
  let evaluatedPromise;
79
+ let componentsPromise;
80
80
  const loadContent = async () => {
81
81
  _nullishCoalesce(evaluatedPromise, () => ( (evaluatedPromise = evaluateMdxSource(body, input.filePath))));
82
82
  return evaluatedPromise;
83
83
  };
84
+ const loadComponents = () => {
85
+ const configured = input.components;
86
+ if (typeof configured !== "function") return configured || {};
87
+ _nullishCoalesce(componentsPromise, () => ( (componentsPromise = configured().catch((error) => {
88
+ componentsPromise = void 0;
89
+ throw error;
90
+ }))));
91
+ return componentsPromise;
92
+ };
84
93
  async function FarmMarkdownPage(props) {
85
94
  const { createElement } = await import("react");
86
- const evaluated = await loadContent();
95
+ const [evaluated, components] = await Promise.all([loadContent(), loadComponents()]);
87
96
  const MDXContent = evaluated.default;
88
97
  return createElement(
89
98
  "article",
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
2
2
 
3
- var _chunkDQJ2CIH7cjs = require('./chunk-DQJ2CIH7.cjs');
3
+ var _chunkASYOWPSRcjs = require('./chunk-ASYOWPSR.cjs');
4
4
 
5
5
  // src/instrumentation.ts
6
6
  var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
@@ -9,12 +9,14 @@ var _url = require('url');
9
9
  var INSTRUMENTATION_EXTENSIONS = ["ts", "mts", "js", "mjs"];
10
10
  function resolveFarmInstrumentationFile(root, srcDir = "src") {
11
11
  const candidates = [
12
- ...INSTRUMENTATION_EXTENSIONS.map(
13
- (extension) => _path2.default.join(root, srcDir, `instrumentation.${extension}`)
14
- ),
15
- ...INSTRUMENTATION_EXTENSIONS.map(
16
- (extension) => _path2.default.join(root, `instrumentation.${extension}`)
17
- )
12
+ .../* @__PURE__ */ new Set([
13
+ ...INSTRUMENTATION_EXTENSIONS.map(
14
+ (extension) => _path2.default.join(root, srcDir, `instrumentation.${extension}`)
15
+ ),
16
+ ...INSTRUMENTATION_EXTENSIONS.map(
17
+ (extension) => _path2.default.join(root, `instrumentation.${extension}`)
18
+ )
19
+ ])
18
20
  ].filter((candidate) => _fs2.default.existsSync(candidate));
19
21
  if (candidates.length > 1) {
20
22
  throw new Error(
@@ -30,7 +32,7 @@ async function loadFarmInstrumentation(filePath, root) {
30
32
  const outputDirectory = _path2.default.join(root, ".farm", ".instrumentation-loader");
31
33
  const outputFile = _path2.default.join(outputDirectory, "instrumentation.mjs");
32
34
  await _fs2.default.promises.mkdir(outputDirectory, { recursive: true });
33
- await _chunkDQJ2CIH7cjs.bundleNodeModule.call(void 0, {
35
+ await _chunkASYOWPSRcjs.bundleNodeModule.call(void 0, {
34
36
  root,
35
37
  entry: filePath,
36
38
  outfile: outputFile,
@@ -93,7 +93,7 @@ function formatFarmRscBlockingMessage(blockingKeys) {
93
93
  var warnedFallback = false;
94
94
  async function resolveFarmRscCheckConfig(config, root, mode) {
95
95
  if (!config?.extends) return config;
96
- const { resolveFarmLayers } = await import("./layers-T55SA47E.mjs");
96
+ const { resolveFarmLayers } = await import("./layers-XQ7VFMWO.mjs");
97
97
  return (await resolveFarmLayers(config, { root, mode })).config;
98
98
  }
99
99
  function farmAppUsesRscPipeline(config, root) {
@@ -127,7 +127,7 @@ function formatFarmRscIgnoredMessage(ignoredKeys) {
127
127
  }
128
128
  if (others.length < ignoredKeys.length) {
129
129
  clauses.push(
130
- "runs only the browser `client` hooks of `plugins` and ignores their other hooks."
130
+ "runs only the `configure` and browser `client` hooks of `plugins` and ignores their other hooks."
131
131
  );
132
132
  }
133
133
  return `experimental.serverComponents runs on the RSC pipeline, which ${clauses.join(" It also ")}`;
@@ -29,7 +29,7 @@ var _chunkCQL5ZGFUcjs = require('./chunk-CQL5ZGFU.cjs');
29
29
 
30
30
 
31
31
 
32
- var _chunkF43OG25Pcjs = require('./chunk-F43OG25P.cjs');
32
+ var _chunkI7J5RLGOcjs = require('./chunk-I7J5RLGO.cjs');
33
33
 
34
34
 
35
35
  var _chunkDBYNZIIQcjs = require('./chunk-DBYNZIIQ.cjs');
@@ -687,7 +687,7 @@ var SPARouter = class {
687
687
  async requestPageData(path, recover, interceptFrom, activeLayoutChain, signal, cacheData, resolvePrefetch) {
688
688
  const response = await fetch(`/__farm/page-data?path=${encodeURIComponent(path)}`, {
689
689
  signal,
690
- headers: _chunkF43OG25Pcjs.createFarmDeploymentRequestHeaders.call(void 0, this.options.deploymentId, {
690
+ headers: _chunkI7J5RLGOcjs.createFarmDeploymentRequestHeaders.call(void 0, this.options.deploymentId, {
691
691
  Accept: "application/x-farm-deferred+json, application/json",
692
692
  "X-Farm-SPA": "1",
693
693
  ...activeLayoutChain ? { "X-Farm-Layout-Chain": activeLayoutChain } : {},
@@ -696,8 +696,8 @@ var SPARouter = class {
696
696
  ..._chunkCQL5ZGFUcjs.getFarmIslandValueHeaders.call(void 0, )
697
697
  })
698
698
  });
699
- if (_chunkF43OG25Pcjs.isFarmDeploymentMismatchResponse.call(void 0, response, this.options.deploymentId)) {
700
- const error = _chunkF43OG25Pcjs.createFarmDeploymentMismatchError.call(void 0,
699
+ if (_chunkI7J5RLGOcjs.isFarmDeploymentMismatchResponse.call(void 0, response, this.options.deploymentId)) {
700
+ const error = _chunkI7J5RLGOcjs.createFarmDeploymentMismatchError.call(void 0,
701
701
  response,
702
702
  this.options.deploymentId || "unknown"
703
703
  );
@@ -2,17 +2,17 @@ import {
2
2
  resolveFarmAppClientEntry,
3
3
  resolveFarmClientPlugins
4
4
  } from "./chunk-DXZ57EPE.mjs";
5
+ import {
6
+ resolveFarmPlatform
7
+ } from "./chunk-SMUW7UST.mjs";
5
8
  import {
6
9
  collectSSGPages,
7
10
  matchSSGPage,
8
11
  resolveRouteRenderingConfigFromFile
9
- } from "./chunk-6YBYX4K4.mjs";
12
+ } from "./chunk-G7NBPP7H.mjs";
10
13
  import {
11
14
  createFarmMetadataImageResponse
12
15
  } from "./chunk-CROAFCMW.mjs";
13
- import {
14
- resolveFarmPlatform
15
- } from "./chunk-SMUW7UST.mjs";
16
16
  import {
17
17
  classifyFarmDocumentPrefix,
18
18
  composeFarmFullDocument,
@@ -42,7 +42,7 @@ import {
42
42
  } from "./chunk-ZPKJPM7K.mjs";
43
43
  import {
44
44
  listFarmMCPLlmsTxtLinks
45
- } from "./chunk-HRPTMX5C.mjs";
45
+ } from "./chunk-VFNAK6A5.mjs";
46
46
  import {
47
47
  FARM_DEFAULT_MCP_PATH,
48
48
  collectFarmDefaultMCPPages,
@@ -52,8 +52,10 @@ import {
52
52
  resolveFarmDefaultMCPServer
53
53
  } from "./chunk-K6SXMVXO.mjs";
54
54
  import {
55
- handleFarmFormActionRequest
56
- } from "./chunk-MK5E44WP.mjs";
55
+ getFarmFormState,
56
+ handleFarmFormActionRequest,
57
+ renderFarmFormStateScript
58
+ } from "./chunk-ICFPTHXM.mjs";
57
59
  import {
58
60
  installFarmIslandValues,
59
61
  uninstallFarmIslandValues
@@ -74,7 +76,7 @@ import {
74
76
  resolveProgrammaticClientRoutes,
75
77
  runWithPackageClientBoundaryCacheFile,
76
78
  usesFarmServerTree
77
- } from "./chunk-GTV2ABO7.mjs";
79
+ } from "./chunk-WPB67LE5.mjs";
78
80
  import {
79
81
  FARM_ISLAND_REPLAYABLE_SELECTOR
80
82
  } from "./chunk-S32PDOLO.mjs";
@@ -91,7 +93,7 @@ import {
91
93
  } from "./chunk-TPA2PV5J.mjs";
92
94
  import {
93
95
  normalizeRouteRules
94
- } from "./chunk-724MGMIL.mjs";
96
+ } from "./chunk-R2ZHU37O.mjs";
95
97
  import {
96
98
  resolveFarmDevtoolsConfig
97
99
  } from "./chunk-CU5SYTJG.mjs";
@@ -126,7 +128,7 @@ import {
126
128
  import {
127
129
  getFarmAppDirectories,
128
130
  getFarmSourceRoots
129
- } from "./chunk-52Y3C3HG.mjs";
131
+ } from "./chunk-E7VF3LQ5.mjs";
130
132
  import {
131
133
  assertFarmRendererStreamingRuntime,
132
134
  getFarmRendererCapabilities,
@@ -152,10 +154,10 @@ import {
152
154
  import {
153
155
  createFarmMarkdownRouteModuleFromFile,
154
156
  loadFarmMdxComponents
155
- } from "./chunk-XUES6OET.mjs";
157
+ } from "./chunk-MV7NWU23.mjs";
156
158
  import {
157
159
  isFarmMarkdownPageFile
158
- } from "./chunk-3T5TLFCQ.mjs";
160
+ } from "./chunk-HEJM46HQ.mjs";
159
161
  import {
160
162
  resolveFarmMdxComponentsModulePath,
161
163
  resolveMdxConfig
@@ -171,7 +173,7 @@ import {
171
173
  } from "./chunk-IFR74W6S.mjs";
172
174
  import {
173
175
  resolveWorkflowsConfig
174
- } from "./chunk-5TA63JD3.mjs";
176
+ } from "./chunk-MGZVDX4R.mjs";
175
177
  import {
176
178
  resolveFarmThemeConfig
177
179
  } from "./chunk-YWPNIYUP.mjs";
@@ -276,11 +278,11 @@ import {
276
278
  } from "./chunk-2DA7CLY7.mjs";
277
279
  import {
278
280
  FARM_VERSION
279
- } from "./chunk-H37MDCPR.mjs";
281
+ } from "./chunk-F6CMGWAL.mjs";
280
282
  import {
281
283
  resolveFarmTrailingSlashRedirect,
282
284
  setFarmTrailingSlashPreference
283
- } from "./chunk-KWFNUODD.mjs";
285
+ } from "./chunk-YVPX5PI5.mjs";
284
286
  import {
285
287
  normalizeFarmAPIConfig
286
288
  } from "./chunk-W6QLRQ3V.mjs";
@@ -303,7 +305,7 @@ import {
303
305
  import {
304
306
  FARM_DEPLOYMENT_ID_HEADER,
305
307
  createFarmDeploymentCookie
306
- } from "./chunk-F7JKVHU2.mjs";
308
+ } from "./chunk-NVOMQLI2.mjs";
307
309
  import {
308
310
  prepareDeferredData,
309
311
  snapshotDeferredData
@@ -1042,12 +1044,13 @@ var RouteManager = class {
1042
1044
  }
1043
1045
  if (isFarmMarkdownPageFile(modulePath)) {
1044
1046
  const mdxConfig = resolveMdxConfig(this.config.mdx);
1045
- const components = await loadFarmMdxComponents(mdxConfig, {
1046
- root: this.config.root,
1047
- loadModule: this.viteServer ? (componentModulePath) => loadFarmDevModule(this.viteServer, componentModulePath) : void 0
1048
- });
1047
+ const viteServer = this.viteServer;
1049
1048
  return await createFarmMarkdownRouteModuleFromFile(modulePath, {
1050
- components,
1049
+ // Loaded on render: the route runtime manifest only reads metadata and rendering config.
1050
+ components: () => loadFarmMdxComponents(mdxConfig, {
1051
+ root: this.config.root,
1052
+ loadModule: viteServer ? (componentModulePath) => loadFarmDevModule(viteServer, componentModulePath) : void 0
1053
+ }),
1051
1054
  config: mdxConfig
1052
1055
  });
1053
1056
  }
@@ -1487,12 +1490,12 @@ var RouteManager = class {
1487
1490
  }
1488
1491
  }
1489
1492
  }
1490
- /** The page routes a docs adapter answers before Farm's own page rendering. */
1493
+ /** The page routes the docs runtime answers before Farm's own page rendering. */
1491
1494
  getDocsAdapterRoutes() {
1492
1495
  const docs = this.config.docs;
1493
- if (!docs || typeof docs !== "object" || !docs.enabled || !docs.adapter || !docs.adapter.server || !docs.adapter.react || !isReactRenderer(this.config.renderer)) {
1494
- return void 0;
1495
- }
1496
+ if (!docs || typeof docs !== "object" || !docs.enabled) return void 0;
1497
+ const usesAdapter = Boolean(docs.adapter && docs.adapter.server && docs.adapter.react);
1498
+ if (usesAdapter && !isReactRenderer(this.config.renderer)) return void 0;
1496
1499
  const entry = `/${String(docs.entry || "docs").replace(/^\/+|\/+$/g, "")}`;
1497
1500
  return {
1498
1501
  owns: (routePath) => entry === "/" || routePath === entry || routePath.startsWith(`${entry}/`),
@@ -2651,7 +2654,7 @@ function isFontLoaderKind(value) {
2651
2654
  return typeof value === "string" && FONT_FUNCTIONS.has(value);
2652
2655
  }
2653
2656
  function containsFontFunction(code) {
2654
- return Array.from(FONT_FUNCTIONS).some((name) => code.includes(name));
2657
+ return code.includes("@farm.js/core") && Array.from(FONT_FUNCTIONS).some((name) => code.includes(name));
2655
2658
  }
2656
2659
  function requireString(value, id, label) {
2657
2660
  if (typeof value !== "string" || value.trim() === "") {
@@ -3355,7 +3358,7 @@ function createPPRRefreshScript() {
3355
3358
  }
3356
3359
  function createPreHydrationClickQueueScript() {
3357
3360
  const selector = JSON.stringify(FARM_ISLAND_REPLAYABLE_SELECTOR);
3358
- return `<script>(function(){if(window.__FARM_PREHYDRATION_CLICK_QUEUE__)return;var queue=[];window.__FARM_PREHYDRATION_CLICK_QUEUE__=queue;window.__FARM_HYDRATED__=false;document.documentElement.dataset.farmHydrated="false";function isModified(event){return !!(event.metaKey||event.altKey||event.ctrlKey||event.shiftKey)}function inHydrated(node){return !!(node&&node.closest&&node.closest('[data-farm-island-hydrated="true"]'))}function closestQueuedTarget(target){while(target&&target!==document.documentElement){if(target.matches&&target.matches(${selector}))return target;target=target.parentElement}return null}function announce(target,kind){document.dispatchEvent(new CustomEvent("farm:island-interaction",{detail:{target:target,kind:kind||null}}))}function hold(event,target,kind){if(!queue.some(function(item){return item.target===target})){queue.push({target:target,kind:kind,createdAt:Date.now()});announce(target,kind)}event.preventDefault();event.stopImmediatePropagation()}document.addEventListener("click",function(event){if(window.__FARM_HYDRATED__)return;if(event.defaultPrevented||event.button!==0||isModified(event))return;var target=closestQueuedTarget(event.target);if(!target||target.closest&&target.closest("a[href]")||inHydrated(target))return;hold(event,target,"click")},true);document.addEventListener("submit",function(event){if(window.__FARM_HYDRATED__)return;if(event.defaultPrevented)return;var form=event.target;if(!form||form.nodeName!=="FORM"||inHydrated(form))return;hold(event,form,"submit")},true);function observe(event){if(window.__FARM_HYDRATED__)return;var target=event.target;if(!(target&&target.closest)||inHydrated(target))return;announce(target,null)}document.addEventListener("pointerdown",observe,true);document.addEventListener("focusin",observe,true);})();</script>`;
3361
+ return `<script>(function(){if(window.__FARM_PREHYDRATION_CLICK_QUEUE__)return;var queue=[];window.__FARM_PREHYDRATION_CLICK_QUEUE__=queue;window.__FARM_HYDRATED__=false;document.documentElement.dataset.farmHydrated="false";function isModified(event){return !!(event.metaKey||event.altKey||event.ctrlKey||event.shiftKey)}function inHydrated(node){return !!(node&&node.closest&&node.closest('[data-farm-island-hydrated="true"]'))}function closestQueuedTarget(target){while(target&&target!==document.documentElement){if(target.matches&&target.matches(${selector}))return target;target=target.parentElement}return null}function announce(target,kind){document.dispatchEvent(new CustomEvent("farm:island-interaction",{detail:{target:target,kind:kind||null}}))}function submits(target,kind){return kind==="submit"||!!(target.form&&target.type==="submit")}function hold(event,target,kind){if(!(submits(target,kind)&&queue.some(function(item){return item.target===target}))){queue.push({target:target,kind:kind,createdAt:Date.now()});announce(target,kind)}event.preventDefault();event.stopImmediatePropagation()}document.addEventListener("click",function(event){if(window.__FARM_HYDRATED__)return;if(event.defaultPrevented||event.button!==0||isModified(event))return;var target=closestQueuedTarget(event.target);if(!target||target.closest&&target.closest("a[href]")||inHydrated(target))return;hold(event,target,"click")},true);document.addEventListener("submit",function(event){if(window.__FARM_HYDRATED__)return;if(event.defaultPrevented)return;var form=event.target;if(!form||form.nodeName!=="FORM"||inHydrated(form))return;hold(event,form,"submit")},true);function observe(event){if(window.__FARM_HYDRATED__)return;var target=event.target;if(!(target&&target.closest)||inHydrated(target))return;announce(target,null)}document.addEventListener("pointerdown",observe,true);document.addEventListener("focusin",observe,true);})();</script>`;
3359
3362
  }
3360
3363
  function rendererRenderOptions() {
3361
3364
  const nonce = _resolveCurrentCspNonce();
@@ -3659,6 +3662,7 @@ var ServerRenderer = class {
3659
3662
  writable.once("error", reject);
3660
3663
  const stream = renderToPipeableStream(element, {
3661
3664
  nonce: _resolveCurrentCspNonce(),
3665
+ formState: getFarmFormState(),
3662
3666
  ...inlineBoundaries ? {
3663
3667
  progressiveChunkSize: Number.MAX_SAFE_INTEGER,
3664
3668
  onAllReady() {
@@ -4200,7 +4204,12 @@ var ServerRenderer = class {
4200
4204
  toMiddlewareMap(req.__FARM_MIDDLEWARE_CONTEXT__),
4201
4205
  () => handleFarmFormActionRequest(
4202
4206
  formActionRequest,
4203
- resolveServerActionsConfig(this.config.serverActions)
4207
+ resolveServerActionsConfig(this.config.serverActions),
4208
+ // Before a rewrite, the URL the browser posted to.
4209
+ new URL(
4210
+ req.originalUrl ?? req.url ?? "/",
4211
+ formActionRequest.url
4212
+ ).href
4204
4213
  )
4205
4214
  )
4206
4215
  );
@@ -5803,7 +5812,7 @@ window.__FARM_LOADING_MODULE__ = ${JSON.stringify(
5803
5812
  window.__FARM_MANIFEST__ = ${JSON.stringify(clientManifest)};
5804
5813
  window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(getRegisteredIntegrationAPIManifest())};
5805
5814
  window.__FARM_I18N__ = ${getFarmI18nClientSnapshot() ? serializeInlineValue(getFarmI18nClientSnapshot()) : "null"};
5806
- </script>`;
5815
+ </script>${renderFarmFormStateScript()}`;
5807
5816
  const islandsOnlyPage = this.islandValues() && req.__FARM_PAGE_SHOULD_HYDRATE__ !== true && req.__FARM_LAYOUT_SHOULD_HYDRATE__ !== true && req.__FARM_HAS_HYDRATABLE_ROUTE_SLOTS__ !== true;
5808
5817
  const rootStrategy = req.__FARM_ISLAND_STRATEGY__;
5809
5818
  const waitingRoot = this.islandValues() && !islandsOnlyPage && req.__FARM_HAS_HYDRATABLE_ROUTE_SLOTS__ !== true && rootStrategy !== void 0 && rootStrategy !== "load" ? req.__FARM_LAYOUT_SHOULD_HYDRATE__ === true ? "root" : "__farm_page__" : null;
@@ -5842,6 +5851,7 @@ window.__FARM_I18N__ = ${getFarmI18nClientSnapshot() ? serializeInlineValue(getF
5842
5851
  const earlyClientScript = bootClient ? createFarmDevBootScript(waitingRoot, rootStrategy) : FARM_DEV_EARLY_CLIENT_SCRIPT;
5843
5852
  const { pipe, abort } = renderToPipeableStream(streamRoot, {
5844
5853
  nonce: cspNonce,
5854
+ formState: getFarmFormState(),
5845
5855
  onShellReady() {
5846
5856
  if (pendingNavigationError) {
5847
5857
  abort?.(pendingNavigationError);
@@ -7069,6 +7079,83 @@ async function buildFarmTreeLayouts(layouts, params, source, options) {
7069
7079
  }
7070
7080
  `;
7071
7081
 
7082
+ // src/client/navigation-scripts.ts
7083
+ var FARM_NAVIGATION_SCRIPT_SOURCE = `// The nonce the page's Content Security Policy trusts: the one of the response that loaded the
7084
+ // document, read once, before a navigation adds scripts that carry another response's nonce.
7085
+ const farmDocumentScriptNonce = (function() {
7086
+ if (typeof document === "undefined") return "";
7087
+ const script = document.querySelector("script[data-farm-runtime]") || document.querySelector("script[nonce]");
7088
+ return (script && script.nonce) || "";
7089
+ })();
7090
+
7091
+ // A runnable copy of a script a navigation inserted as markup. A script its response nonced runs
7092
+ // with the page's nonce; one it left without a nonce stays without, so the policy still blocks it.
7093
+ function createFarmNavigationScript(script) {
7094
+ const freshScript = document.createElement("script");
7095
+ for (const attribute of Array.from(script.attributes)) {
7096
+ if (attribute.name !== "nonce") freshScript.setAttribute(attribute.name, attribute.value);
7097
+ }
7098
+ if (farmDocumentScriptNonce && (script.nonce || script.getAttribute("nonce"))) {
7099
+ freshScript.nonce = farmDocumentScriptNonce;
7100
+ }
7101
+ freshScript.textContent = script.textContent || "";
7102
+ return freshScript;
7103
+ }
7104
+ // React streams Suspense content after its fallback, in a hidden segment that a reveal script
7105
+ // ($RC for a boundary, $RS for a segment placeholder) moves into place. This makes the same moves
7106
+ // in a parsed page, before it goes on screen, and drops the calls it made, so the islands in that
7107
+ // content are where the swap looks for them (a refresh keeps them).
7108
+ function revealFarmStreamedContent(root) {
7109
+ const find = function(id) {
7110
+ return root.querySelector('[id="' + id.replace(/"/g, "") + '"]');
7111
+ };
7112
+ for (const script of Array.from(root.querySelectorAll("script:not([type]), script[type='text/javascript']"))) {
7113
+ const source = script.textContent || "";
7114
+ if (source.indexOf("$RC(") === -1 && source.indexOf("$RS(") === -1) continue;
7115
+ let rest = source;
7116
+ for (const call of source.matchAll(/\\$R([CS])\\("([^"]+)","([^"]+)"\\);?/g)) {
7117
+ const [text, kind, first, second] = call;
7118
+ if (kind === "S") {
7119
+ const segment = find(first);
7120
+ const placeholder = find(second);
7121
+ if (!segment || !placeholder) continue;
7122
+ while (segment.firstChild) placeholder.parentNode.insertBefore(segment.firstChild, placeholder);
7123
+ placeholder.remove();
7124
+ segment.remove();
7125
+ } else {
7126
+ const boundary = find(first);
7127
+ const segment = find(second);
7128
+ if (!boundary || !segment) continue;
7129
+ const parent = boundary.parentNode;
7130
+ const start = boundary.previousSibling;
7131
+ // The fallback goes, up to the boundary's closing comment (nested boundaries skipped).
7132
+ let node = boundary;
7133
+ let depth = 0;
7134
+ while (node) {
7135
+ if (node.nodeType === 8) {
7136
+ const data = node.data;
7137
+ if (data === "/$" || data === "/&") {
7138
+ if (depth === 0) break;
7139
+ depth--;
7140
+ } else if (data === "$" || data === "$?" || data === "$~" || data === "$!" || data === "&") {
7141
+ depth++;
7142
+ }
7143
+ }
7144
+ const next = node.nextSibling;
7145
+ parent.removeChild(node);
7146
+ node = next;
7147
+ }
7148
+ while (segment.firstChild) parent.insertBefore(segment.firstChild, node);
7149
+ segment.remove();
7150
+ if (start && start.nodeType === 8) start.data = "$";
7151
+ }
7152
+ rest = rest.replace(text, "");
7153
+ }
7154
+ script.textContent = rest;
7155
+ }
7156
+ }
7157
+ `;
7158
+
7072
7159
  // src/client/navigation-stream-client.ts
7073
7160
  var FARM_NAVIGATION_STREAM_READER_SOURCE = `// Reads a streamed navigation (F-Stream) up to the end of React's shell. \`next\` then resolves
7074
7161
  // with each later flush as it ends, and null at the end; a document without a marker is all shell.
@@ -7113,10 +7200,95 @@ async function readFarmNavigationStream(body, flushToken) {
7113
7200
  };
7114
7201
  }`;
7115
7202
 
7116
- // src/docs/client-config.ts
7203
+ // src/client/refresh-fields.ts
7204
+ var FARM_REFRESH_FIELDS_SOURCE = `// The server-rendered fields of a tree: islands keep their own.
7205
+ function listFarmServerFields(root) {
7206
+ return Array.from(root.querySelectorAll("input, textarea, select")).filter(function(field) {
7207
+ return !field.closest("f-island");
7208
+ });
7209
+ }
7210
+
7211
+ // Reads the fields of a tree about to be replaced: their order, and which one has the focus.
7212
+ function captureFarmServerFields(root) {
7213
+ const fields = listFarmServerFields(root);
7214
+ const focused = fields.indexOf(document.activeElement);
7215
+ const field = fields[focused];
7216
+ let selection = null;
7217
+ try {
7218
+ if (field && typeof field.selectionStart === "number") {
7219
+ selection = [field.selectionStart, field.selectionEnd, field.selectionDirection];
7220
+ }
7221
+ } catch {}
7222
+ return { fields, focused, selection };
7223
+ }
7224
+
7225
+ function isSameFarmField(current, next) {
7226
+ return current.tagName === next.tagName &&
7227
+ current.type === next.type &&
7228
+ current.name === next.name &&
7229
+ current.id === next.id;
7230
+ }
7231
+
7232
+ // Gives the replacing tree's fields what the user changed in the replaced one, and the focus.
7233
+ function restoreFarmServerFields(captured, root) {
7234
+ const fields = listFarmServerFields(root);
7235
+ captured.fields.forEach(function(current, index) {
7236
+ const next = fields[index];
7237
+ if (!next || !isSameFarmField(current, next)) return;
7238
+ if (current.form && current.form.getAttribute("aria-busy") === "true") return;
7239
+ if (current.tagName === "SELECT") {
7240
+ const changed = Array.from(current.options).some(function(option) {
7241
+ return option.selected !== option.defaultSelected;
7242
+ });
7243
+ if (!changed) return;
7244
+ const values = new Set(Array.from(current.selectedOptions, function(option) {
7245
+ return option.value;
7246
+ }));
7247
+ Array.from(next.options).forEach(function(option) {
7248
+ option.selected = values.has(option.value);
7249
+ });
7250
+ } else if (current.type === "checkbox" || current.type === "radio") {
7251
+ if (current.checked !== current.defaultChecked) next.checked = current.checked;
7252
+ } else if (current.type !== "file" && current.value !== current.defaultValue) {
7253
+ next.value = current.value;
7254
+ }
7255
+ });
7256
+ const focused = fields[captured.focused];
7257
+ if (!focused || !isSameFarmField(captured.fields[captured.focused], focused)) return;
7258
+ focused.focus({ preventScroll: true });
7259
+ if (captured.selection) {
7260
+ try {
7261
+ focused.setSelectionRange(captured.selection[0], captured.selection[1], captured.selection[2]);
7262
+ } catch {}
7263
+ }
7264
+ }
7265
+ `;
7266
+
7267
+ // src/utils/hook-filters.ts
7117
7268
  import { realpathSync as realpathSync2 } from "fs";
7118
- import { createRequire as createRequire3 } from "module";
7119
7269
  import path14 from "path";
7270
+ function escapeRegExp(value) {
7271
+ return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
7272
+ }
7273
+ function exactIdPattern(ids) {
7274
+ return new RegExp(`^(?:${ids.map(escapeRegExp).join("|")})(?:\\?.*)?$`);
7275
+ }
7276
+ function fileNamePattern(files) {
7277
+ const names = /* @__PURE__ */ new Set();
7278
+ for (const file of files) {
7279
+ names.add(path14.basename(file));
7280
+ try {
7281
+ names.add(path14.basename(realpathSync2(file)));
7282
+ } catch {
7283
+ }
7284
+ }
7285
+ return new RegExp(`(?:^|/)(?:${[...names].map(escapeRegExp).join("|")})(?:\\?.*)?$`);
7286
+ }
7287
+
7288
+ // src/docs/client-config.ts
7289
+ import { realpathSync as realpathSync3 } from "fs";
7290
+ import { createRequire as createRequire3 } from "module";
7291
+ import path15 from "path";
7120
7292
  var parseAst3;
7121
7293
  function propertyKeyName(property2) {
7122
7294
  if (property2.computed) return void 0;
@@ -7129,7 +7301,7 @@ function redactFarmDocsClientConfig(code, filename) {
7129
7301
  parseAst3 ?? (parseAst3 = createRequire3(typeof __filename === "string" ? __filename : import.meta.url)(
7130
7302
  "rolldown/parseAst"
7131
7303
  ).parseAst);
7132
- const extension = path14.extname(filename);
7304
+ const extension = path15.extname(filename);
7133
7305
  const program = parseAst3(code, {
7134
7306
  lang: extension === ".tsx" || extension === ".jsx" ? "tsx" : "ts"
7135
7307
  });
@@ -7173,7 +7345,7 @@ function isFarmDocsClientConfigModule(id, configModule) {
7173
7345
  const file = id.split("?")[0].replace(/\\/g, "/");
7174
7346
  if (file === configModule) return true;
7175
7347
  try {
7176
- return file === realpathSync2(configModule).replace(/\\/g, "/");
7348
+ return file === realpathSync3(configModule).replace(/\\/g, "/");
7177
7349
  } catch {
7178
7350
  return false;
7179
7351
  }
@@ -7182,16 +7354,20 @@ function farmDocsClientConfigPlugin(configModule) {
7182
7354
  return {
7183
7355
  name: "farm:docs-client-config",
7184
7356
  enforce: "pre",
7185
- transform(code, id, options) {
7186
- if (options?.ssr || !isFarmDocsClientConfigModule(id, configModule)) return null;
7187
- const redacted = redactFarmDocsClientConfig(code, id.split("?")[0]);
7188
- return redacted === null ? null : { code: redacted, map: null };
7357
+ transform: {
7358
+ // Never matches without a docs config module, so the bundler never calls the handler.
7359
+ filter: { id: configModule ? fileNamePattern([configModule]) : /(?!)/ },
7360
+ handler(code, id, options) {
7361
+ if (options?.ssr || !isFarmDocsClientConfigModule(id, configModule)) return null;
7362
+ const redacted = redactFarmDocsClientConfig(code, id.split("?")[0]);
7363
+ return redacted === null ? null : { code: redacted, map: null };
7364
+ }
7189
7365
  }
7190
7366
  };
7191
7367
  }
7192
7368
 
7193
7369
  // src/server/vite-config.ts
7194
- import path15 from "path";
7370
+ import path16 from "path";
7195
7371
  var FARM_CLIENT_ENTRY_PATTERN = "**/{page,layout,loading,error,not-found,default}.{js,jsx,ts,tsx}";
7196
7372
  var FARM_CLIENT_OPTIMIZE_DEPS_INCLUDE = [
7197
7373
  "react",
@@ -7218,9 +7394,9 @@ function getFarmClientOptimizeDepsInclude(renderer) {
7218
7394
  );
7219
7395
  }
7220
7396
  function createFarmClientOptimizeDepsEntries(projectRoot, appDirectories) {
7221
- const resolvedProjectRoot = path15.resolve(projectRoot);
7397
+ const resolvedProjectRoot = path16.resolve(projectRoot);
7222
7398
  return appDirectories.map((appDirectory) => {
7223
- const relativeAppDirectory = path15.relative(resolvedProjectRoot, path15.resolve(appDirectory)).replace(/\\/g, "/");
7399
+ const relativeAppDirectory = path16.relative(resolvedProjectRoot, path16.resolve(appDirectory)).replace(/\\/g, "/");
7224
7400
  const prefix = relativeAppDirectory || ".";
7225
7401
  return `${prefix}/${FARM_CLIENT_ENTRY_PATTERN}`;
7226
7402
  });
@@ -7243,7 +7419,7 @@ function createFarmClientOptimizeDepsConfig(entries, renderer) {
7243
7419
  }
7244
7420
  function createFarmSourceAlias(projectRoot, srcDir = "src") {
7245
7421
  return {
7246
- "@": path15.resolve(projectRoot, srcDir)
7422
+ "@": path16.resolve(projectRoot, srcDir)
7247
7423
  };
7248
7424
  }
7249
7425
  function mergeNoExternal(farmValue, userValue) {
@@ -7375,17 +7551,20 @@ function createFarmThemeCssPlugin(input, basePath = "/") {
7375
7551
  return {
7376
7552
  name: "farm:theme-css",
7377
7553
  enforce: "pre",
7378
- transform(code, id) {
7379
- if (!config.enabled || !/\.css(?:\?.*)?$/.test(id) || !/@import\s+["']tailwindcss["']/.test(code) || /@custom-variant\s+dark\b/.test(code)) {
7380
- return null;
7381
- }
7382
- return {
7383
- code: `${code.trimEnd()}
7554
+ transform: {
7555
+ filter: { id: /\.css(?:\?.*)?$/, code: /@import\s+["']tailwindcss["']/ },
7556
+ handler(code, id) {
7557
+ if (!config.enabled || !/\.css(?:\?.*)?$/.test(id) || !/@import\s+["']tailwindcss["']/.test(code) || /@custom-variant\s+dark\b/.test(code)) {
7558
+ return null;
7559
+ }
7560
+ return {
7561
+ code: `${code.trimEnd()}
7384
7562
 
7385
7563
  ${FARM_DARK_VARIANT}
7386
7564
  `,
7387
- map: null
7388
- };
7565
+ map: null
7566
+ };
7567
+ }
7389
7568
  }
7390
7569
  };
7391
7570
  }
@@ -7415,7 +7594,11 @@ export {
7415
7594
  generateClientCachePersistenceCode,
7416
7595
  FARM_LAYOUT_ELEMENT_CLIENT_SOURCE,
7417
7596
  FARM_SERVER_TREE_LAYOUT_CLIENT_SOURCE,
7597
+ FARM_NAVIGATION_SCRIPT_SOURCE,
7418
7598
  FARM_NAVIGATION_STREAM_READER_SOURCE,
7599
+ FARM_REFRESH_FIELDS_SOURCE,
7600
+ exactIdPattern,
7601
+ fileNamePattern,
7419
7602
  redactFarmDocsClientConfig,
7420
7603
  isFarmDocsClientConfigModule,
7421
7604
  farmDocsClientConfigPlugin,
@@ -7,7 +7,7 @@ import {
7
7
  notifyHistoryChange,
8
8
  readPageState,
9
9
  subscribeHistoryChange
10
- } from "./chunk-HFHJJXSV.mjs";
10
+ } from "./chunk-GFPS7MNE.mjs";
11
11
  import {
12
12
  getFarmI18nClientState
13
13
  } from "./chunk-PTLXHRJZ.mjs";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  bundleNodeModule
3
- } from "./chunk-VFXE6NWR.mjs";
3
+ } from "./chunk-MGKWYPE3.mjs";
4
4
 
5
5
  // src/instrumentation.ts
6
6
  import fs from "fs";
@@ -9,12 +9,14 @@ import { pathToFileURL } from "url";
9
9
  var INSTRUMENTATION_EXTENSIONS = ["ts", "mts", "js", "mjs"];
10
10
  function resolveFarmInstrumentationFile(root, srcDir = "src") {
11
11
  const candidates = [
12
- ...INSTRUMENTATION_EXTENSIONS.map(
13
- (extension) => path.join(root, srcDir, `instrumentation.${extension}`)
14
- ),
15
- ...INSTRUMENTATION_EXTENSIONS.map(
16
- (extension) => path.join(root, `instrumentation.${extension}`)
17
- )
12
+ .../* @__PURE__ */ new Set([
13
+ ...INSTRUMENTATION_EXTENSIONS.map(
14
+ (extension) => path.join(root, srcDir, `instrumentation.${extension}`)
15
+ ),
16
+ ...INSTRUMENTATION_EXTENSIONS.map(
17
+ (extension) => path.join(root, `instrumentation.${extension}`)
18
+ )
19
+ ])
18
20
  ].filter((candidate) => fs.existsSync(candidate));
19
21
  if (candidates.length > 1) {
20
22
  throw new Error(