@farm.js/core 0.1.73 → 0.1.74

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (362) hide show
  1. package/dist/{agent-mcp-handler-RK7LDYEL.mjs → agent-mcp-handler-HX4F4VKN.mjs} +4 -4
  2. package/dist/{agent-mcp-handler-VBCA3WZ6.cjs → agent-mcp-handler-NRIL4JBC.cjs} +5 -5
  3. package/dist/{agent-mcp.d-PvEf-1mi.d.mts → agent-mcp.d-BEhDfdWc.d.mts} +1 -1
  4. package/dist/{agent-mcp.d-D_gHjCAE.d.ts → agent-mcp.d-CX8_oOT_.d.ts} +1 -1
  5. package/dist/agent-runtime.cjs +4 -4
  6. package/dist/agent-runtime.d.mts +4 -4
  7. package/dist/agent-runtime.d.ts +4 -4
  8. package/dist/agent-runtime.mjs +3 -3
  9. package/dist/{analyzer-MFYCJT75.mjs → analyzer-2K35LIQZ.mjs} +2 -2
  10. package/dist/analyzer-6EOYURMV.cjs +16 -0
  11. package/dist/api/client.d.mts +3 -3
  12. package/dist/api/client.d.ts +3 -3
  13. package/dist/api/client.native.d.mts +4 -4
  14. package/dist/api/client.native.d.ts +4 -4
  15. package/dist/api/node.cjs +9 -8
  16. package/dist/api/node.d.mts +6 -6
  17. package/dist/api/node.d.ts +6 -6
  18. package/dist/api/node.mjs +8 -7
  19. package/dist/api/route-manager.cjs +11 -9
  20. package/dist/api/route-manager.d.mts +9 -7
  21. package/dist/api/route-manager.d.ts +9 -7
  22. package/dist/api/route-manager.mjs +10 -8
  23. package/dist/api/runtime.cjs +8 -7
  24. package/dist/api/runtime.d.mts +5 -5
  25. package/dist/api/runtime.d.ts +5 -5
  26. package/dist/api/runtime.mjs +7 -6
  27. package/dist/{api-client.d-Bp35zMqR.d.mts → api-client.d-CyVmI4Di.d.mts} +2 -2
  28. package/dist/{api-client.d-CFI_xL0V.d.ts → api-client.d-DrTM7BdH.d.ts} +2 -2
  29. package/dist/api.cjs +13 -11
  30. package/dist/api.d.mts +9 -9
  31. package/dist/api.d.ts +9 -9
  32. package/dist/api.mjs +12 -10
  33. package/dist/{app-manifest.d-CN7cEWHX.d.mts → app-manifest.d-BcXt2yCx.d.mts} +10 -1
  34. package/dist/{app-manifest.d-BpVTg43i.d.ts → app-manifest.d-CVEx1CFB.d.ts} +10 -1
  35. package/dist/app-markdown.cjs +8 -4
  36. package/dist/app-markdown.d.mts +6 -6
  37. package/dist/app-markdown.d.ts +6 -6
  38. package/dist/app-markdown.mjs +7 -3
  39. package/dist/{app.d-DO4PTCWm.d.ts → app.d-B6i8CSrx.d.ts} +30 -4
  40. package/dist/{app.d-BFWzAdTe.d.mts → app.d-DowzSmT5.d.mts} +30 -4
  41. package/dist/cache.cjs +2 -2
  42. package/dist/cache.d.mts +8 -0
  43. package/dist/cache.d.ts +8 -0
  44. package/dist/cache.mjs +1 -1
  45. package/dist/chunk-2DOI6HLJ.cjs +284 -0
  46. package/dist/chunk-2GQBBOFH.mjs +76 -0
  47. package/dist/{chunk-5LOARKDP.cjs → chunk-2TZ3F6TN.cjs} +29 -17
  48. package/dist/{chunk-TDCP3Z4T.cjs → chunk-35GBGSQZ.cjs} +3 -3
  49. package/dist/{chunk-VPETSSWN.cjs → chunk-3BUJIPKE.cjs} +2 -2
  50. package/dist/{chunk-Y5LEPEVH.mjs → chunk-3ODLJRA6.mjs} +1 -1
  51. package/dist/{chunk-DMAP4RND.cjs → chunk-3OMLZLDE.cjs} +54 -16
  52. package/dist/{chunk-VNBDN5W2.cjs → chunk-47ZDUDN5.cjs} +64 -27
  53. package/dist/{chunk-2W4GNXGX.cjs → chunk-4AB62NMW.cjs} +2 -2
  54. package/dist/{chunk-HDPT6OYE.cjs → chunk-4M5ESTJ2.cjs} +10 -2
  55. package/dist/{chunk-TAU3OF5B.cjs → chunk-56HHUSR5.cjs} +420 -337
  56. package/dist/chunk-5XD2ULJG.mjs +114 -0
  57. package/dist/{chunk-JX5VOLAV.cjs → chunk-65OS2TOT.cjs} +4 -4
  58. package/dist/{chunk-7GMBETHM.mjs → chunk-6JEXH7N6.mjs} +1 -1
  59. package/dist/{chunk-TY5KCYDE.mjs → chunk-72NTEYCX.mjs} +10 -3
  60. package/dist/{chunk-KDOZORJD.cjs → chunk-737MIVX3.cjs} +22 -22
  61. package/dist/{chunk-ROCF6UQD.cjs → chunk-77SVUQM5.cjs} +74 -17
  62. package/dist/{chunk-CKQAQFF6.mjs → chunk-7RKHXF4P.mjs} +2 -2
  63. package/dist/{chunk-GJEC5S4V.mjs → chunk-7VCLTNED.mjs} +1 -1
  64. package/dist/{chunk-CLEWORVY.cjs → chunk-ACAEFEOH.cjs} +38 -41
  65. package/dist/{chunk-OBYM5S5G.mjs → chunk-AL6E63FZ.mjs} +2 -2
  66. package/dist/{chunk-DQ2DI3Y7.mjs → chunk-AO5IRA2N.mjs} +2 -2
  67. package/dist/{chunk-CYRIIVD4.mjs → chunk-AU5UPNOD.mjs} +2 -2
  68. package/dist/{chunk-Z3IN6GEX.mjs → chunk-B3XY6FMC.mjs} +69 -12
  69. package/dist/{chunk-U7VH3Q5E.cjs → chunk-B5WZP3T3.cjs} +15 -2
  70. package/dist/{chunk-IBVN7SW5.mjs → chunk-BFOMCSZ2.mjs} +292 -120
  71. package/dist/{chunk-I4KPA2C6.mjs → chunk-BIX46FTI.mjs} +1 -1
  72. package/dist/{chunk-YZLEOMMA.mjs → chunk-BNXV3PRM.mjs} +4 -4
  73. package/dist/{chunk-3GNVIYPO.cjs → chunk-BSJMWCWM.cjs} +7 -7
  74. package/dist/{chunk-WVQNXXNE.cjs → chunk-BWFBTTJ5.cjs} +2 -2
  75. package/dist/{chunk-FEFCISOX.cjs → chunk-CEVXKJKF.cjs} +2 -2
  76. package/dist/{chunk-B67CW2LM.mjs → chunk-CF77L6RL.mjs} +33 -36
  77. package/dist/{chunk-OB45EAQL.mjs → chunk-CXQZQK6R.mjs} +3 -2
  78. package/dist/{chunk-255J7K4X.mjs → chunk-D2IAYGYA.mjs} +1 -1
  79. package/dist/{chunk-ILQ5DKYF.cjs → chunk-D4TYE6MY.cjs} +2 -2
  80. package/dist/{chunk-4YHGQDTT.cjs → chunk-DM2YGTRH.cjs} +24 -17
  81. package/dist/{chunk-ICFPTHXM.mjs → chunk-DRBXYJZ6.mjs} +7 -3
  82. package/dist/{chunk-E3HDJCWF.mjs → chunk-DRHHTHA3.mjs} +1 -1
  83. package/dist/{chunk-YXIQYWOK.cjs → chunk-DTBRSRTR.cjs} +23 -5
  84. package/dist/{chunk-JZQS3ZOI.mjs → chunk-E4T7WJJN.mjs} +10 -2
  85. package/dist/{chunk-YAEN3L2F.cjs → chunk-EF5AP4CV.cjs} +21 -2
  86. package/dist/{chunk-SPP3EZTJ.cjs → chunk-EHJOSIXM.cjs} +137 -67
  87. package/dist/{chunk-JZBU7V4D.mjs → chunk-ELJQWUAR.mjs} +125 -55
  88. package/dist/{chunk-DMXMIE2C.cjs → chunk-ENYBDM4U.cjs} +2 -2
  89. package/dist/{chunk-ZFEJ2SF2.cjs → chunk-EWIEJQP6.cjs} +28 -28
  90. package/dist/{chunk-ODBM54RT.cjs → chunk-F244KE2D.cjs} +7 -7
  91. package/dist/{chunk-WW3LRNQV.mjs → chunk-FCBUNILW.mjs} +1 -1
  92. package/dist/{chunk-GZOKWJIW.mjs → chunk-FEQ72ZHD.mjs} +16 -9
  93. package/dist/{chunk-ME7RVELR.mjs → chunk-FGXSWRWA.mjs} +20 -1
  94. package/dist/{chunk-2AFW7673.cjs → chunk-FNWL5DMG.cjs} +4 -3
  95. package/dist/{chunk-XUSJVHHD.cjs → chunk-FYV6DTAG.cjs} +738 -485
  96. package/dist/{chunk-7PPLTD3P.cjs → chunk-G7S6XG6X.cjs} +6 -6
  97. package/dist/{chunk-AQIO3RNL.mjs → chunk-GK2GBIXD.mjs} +3 -3
  98. package/dist/{chunk-IHTDLCDJ.cjs → chunk-GRHSQYD4.cjs} +17 -4
  99. package/dist/{chunk-W44X6IC2.cjs → chunk-HBLYSWIJ.cjs} +13 -9
  100. package/dist/chunk-HK4VJI27.cjs +76 -0
  101. package/dist/{chunk-EGIY4A7V.cjs → chunk-HKZVC5GP.cjs} +2 -2
  102. package/dist/{chunk-EYPSKXO4.mjs → chunk-HRQV5Q3J.mjs} +1 -1
  103. package/dist/{chunk-S7MWSFFP.cjs → chunk-IBEHVSU4.cjs} +2 -2
  104. package/dist/{chunk-JMOCMXTQ.mjs → chunk-IG4IQMIW.mjs} +1 -1
  105. package/dist/{chunk-GPO3LJDJ.cjs → chunk-IJFNXP3D.cjs} +2 -2
  106. package/dist/{chunk-FRO4BB2T.mjs → chunk-IP2R2TAE.mjs} +1 -1
  107. package/dist/{chunk-FETMUBIA.mjs → chunk-IZ5WOTQP.mjs} +1 -1
  108. package/dist/{chunk-CSLHNBPS.cjs → chunk-J42QN7OC.cjs} +6 -6
  109. package/dist/{chunk-NDDRTFN4.mjs → chunk-J7EUGGTY.mjs} +2 -2
  110. package/dist/{chunk-MJEKMT6B.mjs → chunk-JI6N4W2I.mjs} +125 -42
  111. package/dist/{chunk-GJ7QVFAG.mjs → chunk-JOECBGY7.mjs} +1 -1
  112. package/dist/{chunk-CL52PD6D.cjs → chunk-JSUVQ5HG.cjs} +8 -8
  113. package/dist/{chunk-DZHTNSQ5.cjs → chunk-JWHRVBCZ.cjs} +14 -14
  114. package/dist/{chunk-462MUII7.mjs → chunk-JZ43UD6S.mjs} +7 -7
  115. package/dist/{chunk-RLEALQEN.mjs → chunk-KIRIFO6T.mjs} +43 -5
  116. package/dist/{chunk-XGTFLG73.cjs → chunk-KMYOKQPP.cjs} +18 -11
  117. package/dist/{chunk-WX63N6C5.mjs → chunk-KNEYWPZV.mjs} +64 -27
  118. package/dist/{chunk-XI3OXOMK.mjs → chunk-KUMKBBYP.mjs} +1 -1
  119. package/dist/{chunk-VT25ERQK.mjs → chunk-KWUZJZ23.mjs} +21 -3
  120. package/dist/{chunk-SVQX5HYW.mjs → chunk-LHFGTR7F.mjs} +2 -2
  121. package/dist/{chunk-4P5634G6.cjs → chunk-LIQJYEQP.cjs} +14 -9
  122. package/dist/chunk-LXTYJ2HW.mjs +139 -0
  123. package/dist/{chunk-5PDMBWAF.cjs → chunk-MKQ27TGW.cjs} +5 -5
  124. package/dist/{chunk-SUQACHER.mjs → chunk-MQ5HA7H2.mjs} +2 -2
  125. package/dist/{chunk-HY6IVQ54.mjs → chunk-MUITBU5Z.mjs} +1 -1
  126. package/dist/{chunk-QKEZLYON.cjs → chunk-NET6PBUH.cjs} +2 -2
  127. package/dist/{chunk-YBY34UHB.mjs → chunk-NKETXVKP.mjs} +15 -2
  128. package/dist/chunk-NRWEY2CM.mjs +25 -0
  129. package/dist/chunk-NU5XLYRN.cjs +139 -0
  130. package/dist/{chunk-HTXKSREF.cjs → chunk-NXGQIXR7.cjs} +345 -173
  131. package/dist/{chunk-PXAHSCR6.cjs → chunk-O2A6HE76.cjs} +4 -4
  132. package/dist/{chunk-OAEDVXVE.mjs → chunk-O6K4G7YA.mjs} +5 -2
  133. package/dist/{chunk-73K53YPP.mjs → chunk-OSKIG4OP.mjs} +1 -1
  134. package/dist/{chunk-OXNZUCHN.cjs → chunk-P3EZKU6L.cjs} +18 -18
  135. package/dist/{chunk-HGB4PM2C.cjs → chunk-PG6ZIHKE.cjs} +102 -30
  136. package/dist/{chunk-YZK64PZT.cjs → chunk-Q3MVNRAO.cjs} +1071 -650
  137. package/dist/{chunk-AZ6IW6SF.mjs → chunk-Q4G52OSW.mjs} +1 -1
  138. package/dist/{chunk-TPYAYFMF.cjs → chunk-QL3YZTGZ.cjs} +2 -2
  139. package/dist/{chunk-UVZMSRHF.mjs → chunk-R4BWNP73.mjs} +2 -2
  140. package/dist/{chunk-OIP62QEL.mjs → chunk-R6Q6VSGU.mjs} +24 -9
  141. package/dist/{chunk-B6RBJJ5G.mjs → chunk-RBRIKT6B.mjs} +15 -2
  142. package/dist/{chunk-C6CUUBY5.cjs → chunk-RHI67C2V.cjs} +5 -5
  143. package/dist/chunk-RK3YYUX6.cjs +114 -0
  144. package/dist/{chunk-Y2LU4LE5.mjs → chunk-ROPMQNCG.mjs} +2 -2
  145. package/dist/{chunk-QIXEU2WV.cjs → chunk-RQ4UZJPR.cjs} +3 -3
  146. package/dist/{chunk-UVQRMUAR.cjs → chunk-RSL3YFJG.cjs} +1 -1
  147. package/dist/{chunk-JWY66PID.cjs → chunk-S3D6SL2V.cjs} +9 -6
  148. package/dist/{chunk-4HGLJOXZ.cjs → chunk-TPDKFRQX.cjs} +11 -11
  149. package/dist/{chunk-6O6PAZZR.mjs → chunk-UHAARKF3.mjs} +2 -2
  150. package/dist/{chunk-QSTRBKHZ.mjs → chunk-UJWRXBVP.mjs} +2 -2
  151. package/dist/{chunk-KTDG4THT.cjs → chunk-V6T3UJAH.cjs} +7 -7
  152. package/dist/{chunk-IXZSBO76.mjs → chunk-VFPFXMTF.mjs} +1 -1
  153. package/dist/{chunk-CPMME66W.mjs → chunk-VKLV7GF4.mjs} +72 -0
  154. package/dist/{chunk-TU6VAH4V.cjs → chunk-VKRMO3EZ.cjs} +8 -8
  155. package/dist/chunk-VWIW47FW.cjs +25 -0
  156. package/dist/{chunk-LGR7565L.cjs → chunk-VZKCGHWC.cjs} +39 -24
  157. package/dist/{chunk-JWLRBDDC.cjs → chunk-WH3PBJS7.cjs} +2 -2
  158. package/dist/{chunk-QGCSUC5O.mjs → chunk-WS4SLJW5.mjs} +403 -150
  159. package/dist/{chunk-5OFNUETM.mjs → chunk-WTTJ2YS2.mjs} +9 -1
  160. package/dist/{chunk-RLFGKJQ6.mjs → chunk-X2KNHD4B.mjs} +14 -2
  161. package/dist/{chunk-5CFHQ7HM.mjs → chunk-XXKMAHYE.mjs} +1 -1
  162. package/dist/{chunk-MBCRWU3P.cjs → chunk-XZPI44Q7.cjs} +4 -4
  163. package/dist/{chunk-ACGBXN3U.cjs → chunk-Y4FEQBKY.cjs} +17 -9
  164. package/dist/{chunk-4CTCSKAF.mjs → chunk-YH33PZ3K.mjs} +1 -1
  165. package/dist/chunk-YQWRBBAA.mjs +284 -0
  166. package/dist/{chunk-REK6HZSU.mjs → chunk-YWDRWG4L.mjs} +962 -541
  167. package/dist/{chunk-E46NXBNJ.mjs → chunk-ZD7JUTBY.mjs} +11 -6
  168. package/dist/{chunk-JDO346NV.mjs → chunk-ZLRWO5GK.mjs} +1 -1
  169. package/dist/{chunk-HFUOLILA.cjs → chunk-ZRCGPSUM.cjs} +4 -4
  170. package/dist/{chunk-4Z3YLMSW.cjs → chunk-ZZGANFQH.cjs} +10 -10
  171. package/dist/client/lifecycle.d.mts +1 -1
  172. package/dist/client/lifecycle.d.ts +1 -1
  173. package/dist/{client-component.d-sF-Znk0j.d.ts → client-component.d-DYOwmq0c.d.ts} +80 -3
  174. package/dist/{client-component.d-C71rMuHF.d.mts → client-component.d-edV76QvU.d.mts} +80 -3
  175. package/dist/{client-plugins.d-MFibjgBg.d.ts → client-plugins.d-BmJYW2FY.d.ts} +19 -6
  176. package/dist/{client-plugins.d-B-Gd9mWR.d.mts → client-plugins.d-DwvqqGsU.d.mts} +19 -6
  177. package/dist/client-plugins.d.mts +4 -4
  178. package/dist/client-plugins.d.ts +4 -4
  179. package/dist/client.cjs +6 -5
  180. package/dist/client.d.mts +11 -11
  181. package/dist/client.d.ts +11 -11
  182. package/dist/client.mjs +5 -4
  183. package/dist/config.d.mts +4 -4
  184. package/dist/config.d.ts +4 -4
  185. package/dist/cron.cjs +6 -2
  186. package/dist/cron.d.mts +11 -2
  187. package/dist/cron.d.ts +11 -2
  188. package/dist/cron.mjs +7 -3
  189. package/dist/desktop.d.mts +5 -5
  190. package/dist/desktop.d.ts +5 -5
  191. package/dist/{devtools-TDIJ6HVC.mjs → devtools-WPX62NG2.mjs} +10 -9
  192. package/dist/{devtools-6K4QXFRL.cjs → devtools-YMDS7PUA.cjs} +12 -11
  193. package/dist/docs.cjs +13 -12
  194. package/dist/docs.d.mts +5 -5
  195. package/dist/docs.d.ts +5 -5
  196. package/dist/docs.mjs +12 -11
  197. package/dist/{endpoint.d-BkMSCRf6.d.mts → endpoint.d-BXbBpKoh.d.mts} +42 -1
  198. package/dist/{endpoint.d-BgHn0lhl.d.ts → endpoint.d-Dx_1k6Du.d.ts} +42 -1
  199. package/dist/environment/vite.cjs +3 -3
  200. package/dist/environment/vite.mjs +2 -2
  201. package/dist/headers.cjs +3 -3
  202. package/dist/{headers.d-uQ6BR59u.d.ts → headers.d-BIbQyAxJ.d.ts} +1 -1
  203. package/dist/{headers.d-BUxGJTsj.d.mts → headers.d-BtNxFc2s.d.mts} +1 -1
  204. package/dist/headers.mjs +2 -2
  205. package/dist/index.cjs +70 -59
  206. package/dist/{index.d-BCGfxCXY.d.ts → index.d-CQ_wUzOV.d.ts} +1 -1
  207. package/dist/{index.d-CuWOJ-un.d.mts → index.d-CQdDRXd1.d.mts} +1 -1
  208. package/dist/index.d.mts +62 -28
  209. package/dist/index.d.ts +62 -28
  210. package/dist/index.mjs +66 -55
  211. package/dist/integrations/orm.d.mts +4 -4
  212. package/dist/integrations/orm.d.ts +4 -4
  213. package/dist/integrations.cjs +4 -4
  214. package/dist/integrations.d.mts +4 -4
  215. package/dist/integrations.d.ts +4 -4
  216. package/dist/integrations.mjs +3 -3
  217. package/dist/internal/app-markdown-runtime.cjs +7 -3
  218. package/dist/internal/app-markdown-runtime.d.mts +17 -6
  219. package/dist/internal/app-markdown-runtime.d.ts +17 -6
  220. package/dist/internal/app-markdown-runtime.mjs +6 -2
  221. package/dist/internal/build-runtime.cjs +41 -39
  222. package/dist/internal/build-runtime.d.mts +6 -6
  223. package/dist/internal/build-runtime.d.ts +6 -6
  224. package/dist/internal/build-runtime.mjs +40 -38
  225. package/dist/internal/cli-runtime.cjs +20 -19
  226. package/dist/internal/cli-runtime.mjs +19 -18
  227. package/dist/internal/client-error-overlay.cjs +6 -6
  228. package/dist/internal/client-error-overlay.mjs +2 -2
  229. package/dist/internal/client-runtime.cjs +6 -2
  230. package/dist/internal/client-runtime.d.mts +21 -9
  231. package/dist/internal/client-runtime.d.ts +21 -9
  232. package/dist/internal/client-runtime.mjs +5 -1
  233. package/dist/internal/compression-runtime.d.mts +4 -4
  234. package/dist/internal/compression-runtime.d.ts +4 -4
  235. package/dist/internal/config-runtime.cjs +12 -11
  236. package/dist/internal/config-runtime.d.mts +6 -6
  237. package/dist/internal/config-runtime.d.ts +6 -6
  238. package/dist/internal/config-runtime.mjs +11 -10
  239. package/dist/internal/form-actions.cjs +5 -4
  240. package/dist/internal/form-actions.d.mts +2 -2
  241. package/dist/internal/form-actions.d.ts +2 -2
  242. package/dist/internal/form-actions.mjs +4 -3
  243. package/dist/internal/infra-analytics-runtime.cjs +10 -10
  244. package/dist/internal/infra-analytics-runtime.mjs +8 -8
  245. package/dist/internal/native-server-fns.cjs +4 -4
  246. package/dist/internal/native-server-fns.mjs +3 -3
  247. package/dist/internal/product-telemetry-runtime.cjs +3 -3
  248. package/dist/internal/product-telemetry-runtime.mjs +2 -2
  249. package/dist/internal/production-runtime.cjs +32 -22
  250. package/dist/internal/production-runtime.d.mts +64 -13
  251. package/dist/internal/production-runtime.d.ts +64 -13
  252. package/dist/internal/production-runtime.mjs +31 -21
  253. package/dist/internal/react-cache.cjs +3 -3
  254. package/dist/internal/react-cache.mjs +1 -1
  255. package/dist/internal/vercel-edge-middleware.cjs +4 -4
  256. package/dist/internal/vercel-edge-middleware.mjs +3 -3
  257. package/dist/{lifecycle.d-keQs5Swc.d.mts → lifecycle.d-OtGWAvJT.d.mts} +4 -0
  258. package/dist/{lifecycle.d-keQs5Swc.d.ts → lifecycle.d-OtGWAvJT.d.ts} +4 -0
  259. package/dist/{manager-JIA66YJ2.mjs → manager-RHB2P35B.mjs} +4 -1
  260. package/dist/{manager-JOHU6BQI.cjs → manager-S77ZARTC.cjs} +5 -2
  261. package/dist/markdown.cjs +2 -2
  262. package/dist/markdown.d.mts +4 -4
  263. package/dist/markdown.d.ts +4 -4
  264. package/dist/markdown.mjs +1 -1
  265. package/dist/middleware.cjs +6 -6
  266. package/dist/middleware.d.mts +4 -4
  267. package/dist/middleware.d.ts +4 -4
  268. package/dist/middleware.mjs +5 -5
  269. package/dist/{mount.d-BIYmcGGg.d.mts → mount.d-6bhpBQQB.d.mts} +1 -1
  270. package/dist/{mount.d-q8k0cJV0.d.ts → mount.d-C-u7rFkM.d.ts} +1 -1
  271. package/dist/{native-server-fn-handler-EP5AFJYE.mjs → native-server-fn-handler-I66X4E5S.mjs} +6 -5
  272. package/dist/{native-server-fn-handler-QRTXGZA4.cjs → native-server-fn-handler-W4FSD76W.cjs} +7 -6
  273. package/dist/{native-tree-OYGKP2NZ.mjs → native-tree-3X23BT3N.mjs} +2 -2
  274. package/dist/{native-tree-R6CQMDTI.cjs → native-tree-TAPKR7QJ.cjs} +3 -3
  275. package/dist/{navigation-delegate.d-CYBUupsv.d.mts → navigation-delegate.d-nx6gtsY4.d.mts} +1 -1
  276. package/dist/{navigation-delegate.d-Btfs6Uoa.d.ts → navigation-delegate.d-xsG4T1x-.d.ts} +1 -1
  277. package/dist/navigation.cjs +4 -4
  278. package/dist/navigation.d.mts +7 -7
  279. package/dist/navigation.d.ts +7 -7
  280. package/dist/navigation.mjs +3 -3
  281. package/dist/{nitro-2LMOMIST.cjs → nitro-SSFTPZMW.cjs} +4 -4
  282. package/dist/{nitro-72TFIGGO.mjs → nitro-XTQ2HKDL.mjs} +1 -1
  283. package/dist/plugin.cjs +36 -33
  284. package/dist/plugin.d.mts +7 -7
  285. package/dist/plugin.d.ts +7 -7
  286. package/dist/plugin.mjs +35 -32
  287. package/dist/query/client.cjs +5 -5
  288. package/dist/query/client.mjs +1 -1
  289. package/dist/{render-plan.d-BlyxqKMu.d.mts → render-plan.d-B5y3h97B.d.mts} +1 -1
  290. package/dist/{render-plan.d-0FHusf1D.d.ts → render-plan.d-gW0fwKz2.d.ts} +1 -1
  291. package/dist/renderer-client.cjs +4 -4
  292. package/dist/renderer-client.d.mts +7 -7
  293. package/dist/renderer-client.d.ts +7 -7
  294. package/dist/renderer-client.mjs +1 -1
  295. package/dist/request.cjs +2 -2
  296. package/dist/{request.d-CX-gks1l.d.mts → request.d-B0ugAadD.d.ts} +9 -2
  297. package/dist/{request.d-CPdVjssg.d.ts → request.d-DLq33nYo.d.mts} +9 -2
  298. package/dist/request.d.mts +5 -5
  299. package/dist/request.d.ts +5 -5
  300. package/dist/request.mjs +1 -1
  301. package/dist/{route-rendering.d-CcvZ_4N2.d.mts → route-rendering.d-DSeIV7yV.d.mts} +1 -1
  302. package/dist/{route-rendering.d-DcOoSNoG.d.ts → route-rendering.d-ytaqDQD6.d.ts} +1 -1
  303. package/dist/{route.d-DrXkpvcg.d.mts → route.d-Cd4Fi6BA.d.ts} +3 -1
  304. package/dist/{route.d-hs-_cyHn.d.ts → route.d-ShmtqqVQ.d.mts} +3 -1
  305. package/dist/{router.d-D2QnK8cM.d.ts → router.d-BaEAEGPg.d.ts} +1 -1
  306. package/dist/{router.d-C8RHma4A.d.mts → router.d-Chd5cpe3.d.mts} +1 -1
  307. package/dist/routes.cjs +5 -3
  308. package/dist/routes.d.mts +4 -4
  309. package/dist/routes.d.ts +4 -4
  310. package/dist/routes.mjs +4 -2
  311. package/dist/{rsc-pipeline-LC2FBZAR.mjs → rsc-pipeline-DPMYONEV.mjs} +12 -11
  312. package/dist/{rsc-pipeline-NTAM65NT.cjs → rsc-pipeline-XIUUMMG5.cjs} +13 -12
  313. package/dist/{runtime-U4PAMTVH.cjs → runtime-WD77S3C5.cjs} +25 -25
  314. package/dist/{runtime-MWAC7NWR.mjs → runtime-XIUJZTZ3.mjs} +16 -16
  315. package/dist/{runtime.d-BQUHHq8M.d.mts → runtime.d-DpCs0eAO.d.mts} +3 -3
  316. package/dist/{runtime.d-1l_1bLrL.d.ts → runtime.d-h2USyQsz.d.ts} +3 -3
  317. package/dist/server-action-security.cjs +5 -3
  318. package/dist/server-action-security.d.mts +11 -3
  319. package/dist/server-action-security.d.ts +11 -3
  320. package/dist/server-action-security.mjs +4 -2
  321. package/dist/server-fn-client.d.mts +3 -3
  322. package/dist/server-fn-client.d.ts +3 -3
  323. package/dist/server-fn.cjs +6 -5
  324. package/dist/server-fn.d.mts +1 -1
  325. package/dist/server-fn.d.ts +1 -1
  326. package/dist/server-fn.mjs +5 -4
  327. package/dist/server-plugins.cjs +4 -4
  328. package/dist/server-plugins.d.mts +53 -9
  329. package/dist/server-plugins.d.ts +53 -9
  330. package/dist/server-plugins.mjs +3 -3
  331. package/dist/server-query-client.d.mts +1 -1
  332. package/dist/server-query-client.d.ts +1 -1
  333. package/dist/server-query.cjs +7 -6
  334. package/dist/server-query.d.mts +1 -1
  335. package/dist/server-query.d.ts +1 -1
  336. package/dist/server-query.mjs +6 -5
  337. package/dist/server.cjs +62 -67
  338. package/dist/server.d.mts +14 -14
  339. package/dist/server.d.ts +14 -14
  340. package/dist/server.mjs +41 -46
  341. package/dist/{spa-router.d-BzPdi48R.d.mts → spa-router.d-DCQVtEaE.d.mts} +11 -5
  342. package/dist/{spa-router.d-BJtXNeqo.d.ts → spa-router.d-DpdJHs1q.d.ts} +11 -5
  343. package/dist/testing.cjs +16 -14
  344. package/dist/testing.d.mts +4 -4
  345. package/dist/testing.d.ts +4 -4
  346. package/dist/testing.mjs +12 -10
  347. package/dist/theme/server.cjs +3 -3
  348. package/dist/theme/server.mjs +2 -2
  349. package/dist/{utils.d-B4ZW-6z6.d.mts → utils.d-DKDZtAY5.d.mts} +1 -1
  350. package/dist/{utils.d-DquC6qxy.d.ts → utils.d-DmicwMvS.d.ts} +1 -1
  351. package/dist/version.cjs +2 -2
  352. package/dist/version.mjs +1 -1
  353. package/dist/vite.cjs +36 -33
  354. package/dist/vite.d.mts +13 -8
  355. package/dist/vite.d.ts +13 -8
  356. package/dist/vite.mjs +35 -32
  357. package/package.json +1 -1
  358. package/dist/analyzer-V5ZMRIIY.cjs +0 -16
  359. package/dist/chunk-6I4BFRE7.cjs +0 -51
  360. package/dist/chunk-EIVGPQN5.mjs +0 -51
  361. /package/dist/{chunk-QEJWNXRI.cjs → chunk-EMRYJG4U.cjs} +0 -0
  362. /package/dist/{chunk-TXE4SAMV.mjs → chunk-H2ZJ35NW.mjs} +0 -0
@@ -21,12 +21,123 @@ var _chunkE7QOEV5Zcjs = require('./chunk-E7QOEV5Z.cjs');
21
21
  var _chunkQMNWKQL4cjs = require('./chunk-QMNWKQL4.cjs');
22
22
 
23
23
 
24
- var _chunkUVQRMUARcjs = require('./chunk-UVQRMUAR.cjs');
24
+ var _chunkRSL3YFJGcjs = require('./chunk-RSL3YFJG.cjs');
25
25
 
26
26
  // src/environment-vite.ts
27
27
  var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
28
28
  var _path = require('path'); var _path2 = _interopRequireDefault(_path);
29
29
 
30
+ // src/diagnostics.ts
31
+ var _tracemapping = require('@jridgewell/trace-mapping');
32
+
33
+ var BOUNDARY_DOCS = "/docs/environment-functions#boundary-diagnostics";
34
+ var FARM_DIAGNOSTIC_RULES = {
35
+ CLIENT_SERVER_ENV: {
36
+ severity: "warning",
37
+ fix: "Read it on the server (a server function, API route, or server component), or declare it in env.public in farm.config.ts and read it through publicEnv.",
38
+ docs: BOUNDARY_DOCS
39
+ },
40
+ CLIENT_PROCESS_ENV_PUBLIC: {
41
+ severity: "warning",
42
+ fix: 'Read it through publicEnv from "@farm.js/core/env".',
43
+ docs: BOUNDARY_DOCS
44
+ },
45
+ CLIENT_NODE_BUILTIN: {
46
+ severity: "warning",
47
+ fix: "Move the import into server-only code, or import it lazily inside a function that runs only on the server.",
48
+ docs: BOUNDARY_DOCS
49
+ },
50
+ CLIENT_SERVER_FUNCTION: {
51
+ severity: "error",
52
+ fix: "Add @farm.js/plugin/rsc and set experimental.serverActions: true so client imports become server references, or call it from server code, or expose an API route and call it with createAPIClient.",
53
+ docs: BOUNDARY_DOCS
54
+ },
55
+ CLIENT_SERVER_ONLY_IMPORT: {
56
+ severity: "error",
57
+ fix: "Move what the client needs out of that module, or call it from a server component, server function, or API route.",
58
+ docs: BOUNDARY_DOCS
59
+ },
60
+ CLIENT_SERVER_ONLY_ENTRY: {
61
+ severity: "error",
62
+ fix: "Use it from an API route or another server module.",
63
+ docs: BOUNDARY_DOCS
64
+ },
65
+ CLIENT_ROUTES_FILE: {
66
+ severity: "error",
67
+ fix: "Import the component, server function, or helper from its own module instead of from the module that defines routes.",
68
+ docs: BOUNDARY_DOCS
69
+ },
70
+ CLIENT_ROUTE_SERVER_IMPORT: {
71
+ severity: "error",
72
+ fix: "Keep server-only imports in the routes file, or in modules only its guard, data, and API handlers use.",
73
+ docs: BOUNDARY_DOCS
74
+ },
75
+ SERVER_CLIENT_ONLY_IMPORT: {
76
+ severity: "error",
77
+ fix: 'Add "use client" to this module, or import the package from a "use client" module.',
78
+ docs: BOUNDARY_DOCS
79
+ }
80
+ };
81
+ var FARM_DOCS_ORIGIN = "https://farmjs.dev";
82
+ function createFarmDiagnostic(code, file, message, location) {
83
+ const rule = FARM_DIAGNOSTIC_RULES[code];
84
+ return {
85
+ code,
86
+ severity: rule.severity,
87
+ file: file.split("?", 1)[0].replace(/\\/g, "/"),
88
+ ...location,
89
+ message,
90
+ fix: rule.fix,
91
+ docs: FARM_DOCS_ORIGIN + rule.docs
92
+ };
93
+ }
94
+ function formatFarmDiagnostic(diagnostic, root) {
95
+ let file = diagnostic.file;
96
+ if (root) {
97
+ const relative = _path2.default.relative(root, file).replace(/\\/g, "/");
98
+ if (relative && !relative.startsWith("../") && !_path2.default.isAbsolute(relative)) file = relative;
99
+ }
100
+ const position = diagnostic.line === void 0 ? "" : `:${diagnostic.line}:${_nullishCoalesce(diagnostic.column, () => ( 1))}`;
101
+ return [
102
+ `${file}${position} - ${diagnostic.severity} ${diagnostic.code}: ${diagnostic.message}`,
103
+ ` fix: ${diagnostic.fix}`,
104
+ ` docs: ${diagnostic.docs}`
105
+ ].join("\n");
106
+ }
107
+ function createFarmSourceLocator(code, getCombinedSourcemap) {
108
+ let trace2;
109
+ let lineStarts;
110
+ return (offset) => {
111
+ if (trace2 === void 0) {
112
+ try {
113
+ const map = getCombinedSourcemap();
114
+ trace2 = map ? new (0, _tracemapping.TraceMap)(map) : null;
115
+ } catch (e) {
116
+ trace2 = null;
117
+ }
118
+ }
119
+ if (!trace2) return void 0;
120
+ if (!lineStarts) {
121
+ lineStarts = [0];
122
+ for (let index = code.indexOf("\n"); index !== -1; index = code.indexOf("\n", index + 1)) {
123
+ lineStarts.push(index + 1);
124
+ }
125
+ }
126
+ let low = 0;
127
+ let high = lineStarts.length - 1;
128
+ while (low < high) {
129
+ const middle = low + high + 1 >> 1;
130
+ if (lineStarts[middle] <= offset) low = middle;
131
+ else high = middle - 1;
132
+ }
133
+ const original = _tracemapping.originalPositionFor.call(void 0, trace2, {
134
+ line: low + 1,
135
+ column: offset - lineStarts[low]
136
+ });
137
+ return original.line === null ? void 0 : { line: original.line, column: (_nullishCoalesce(original.column, () => ( 0))) + 1 };
138
+ };
139
+ }
140
+
30
141
  // src/islands-react-server-exports.ts
31
142
 
32
143
 
@@ -34,19 +145,29 @@ var _parseAst = require('rolldown/parseAst');
34
145
 
35
146
  // src/utils/source-snapshot.ts
36
147
 
148
+
37
149
  var snapshot;
150
+ var base;
38
151
  var volatile;
39
152
  var trace;
40
- function stampOf(file) {
153
+ function farmSourceSnapshotPathKey(file, paths = _path2.default) {
154
+ return paths.resolve(file);
155
+ }
156
+ function getFarmSourceStamp(file) {
41
157
  try {
42
158
  const stat = _fs2.default.statSync(file);
43
159
  return `${stat.mtimeMs}:${stat.size}`;
44
- } catch (e) {
160
+ } catch (e2) {
45
161
  return "missing";
46
162
  }
47
163
  }
48
164
  var FarmSourceSnapshotStore = class {
49
- constructor() {
165
+ /**
166
+ * `tracked: false` keeps entries for a process that edits no sources while it runs, a production
167
+ * build: nothing is stamped, so each plan does not stat every file the snapshot holds.
168
+ */
169
+ constructor(tracked = true) {
170
+ this.tracked = tracked;
50
171
  this.entries = /* @__PURE__ */ new Map();
51
172
  this.stamps = /* @__PURE__ */ new Map();
52
173
  }
@@ -59,7 +180,7 @@ var FarmSourceSnapshotStore = class {
59
180
  const changed = /* @__PURE__ */ new Map();
60
181
  for (const file of edited) changed.set(file, void 0);
61
182
  for (const [file, stamp] of this.stamps) {
62
- if (stampOf(file) !== stamp) changed.set(file, void 0);
183
+ if (getFarmSourceStamp(file) !== stamp) changed.set(file, void 0);
63
184
  }
64
185
  if (changed.size === 0) return changed;
65
186
  const replaced = /* @__PURE__ */ new Set();
@@ -85,10 +206,11 @@ var FarmSourceSnapshotStore = class {
85
206
  }
86
207
  /** Records the stamp of every file an entry read that has none yet. */
87
208
  stamp() {
209
+ if (!this.tracked) return;
88
210
  for (const entries of this.entries.values()) {
89
211
  for (const entry of entries.values()) {
90
212
  for (const file of entry.files) {
91
- if (!this.stamps.has(file)) this.stamps.set(file, stampOf(file));
213
+ if (!this.stamps.has(file)) this.stamps.set(file, getFarmSourceStamp(file));
92
214
  }
93
215
  }
94
216
  }
@@ -112,22 +234,31 @@ function withFarmSourceSnapshot(operation, store) {
112
234
  _optionalChain([store, 'optionalAccess', _12 => _12.stamp, 'call', _13 => _13()]);
113
235
  }
114
236
  }
237
+ function withFarmSourceSnapshotOf(store, operation) {
238
+ if (snapshot) return operation();
239
+ base = store.entries;
240
+ try {
241
+ return withFarmSourceSnapshot(operation);
242
+ } finally {
243
+ base = void 0;
244
+ }
245
+ }
115
246
  function memoizeInFarmSourceSnapshot(scope, key, compute, lasting) {
116
247
  if (!snapshot) return compute();
117
248
  let entries = snapshot.get(scope);
118
249
  if (!entries) snapshot.set(scope, entries = /* @__PURE__ */ new Map());
119
- const memoized = entries.get(key);
250
+ const memoized = _nullishCoalesce(entries.get(key), () => ( _optionalChain([base, 'optionalAccess', _14 => _14.get, 'call', _15 => _15(scope), 'optionalAccess', _16 => _16.get, 'call', _17 => _17(key)])));
120
251
  if (memoized) {
121
252
  if (trace) for (const file of memoized.files) trace.add(file);
122
253
  return memoized.value;
123
254
  }
124
255
  const { result, files } = traceFarmSourceReads(compute);
125
256
  entries.set(key, { value: result, files });
126
- if (lasting && !lasting(result)) _optionalChain([volatile, 'optionalAccess', _14 => _14.push, 'call', _15 => _15([scope, key])]);
257
+ if (lasting && !lasting(result)) _optionalChain([volatile, 'optionalAccess', _18 => _18.push, 'call', _19 => _19([scope, key])]);
127
258
  return result;
128
259
  }
129
260
  function noteFarmSourceRead(file) {
130
- _optionalChain([trace, 'optionalAccess', _16 => _16.add, 'call', _17 => _17(file)]);
261
+ _optionalChain([trace, 'optionalAccess', _20 => _20.add, 'call', _21 => _21(file)]);
131
262
  }
132
263
  function traceFarmSourceReads(operation) {
133
264
  const outer = trace;
@@ -233,7 +364,7 @@ function resolveFarmReactServerExport(importer, specifier) {
233
364
  const file = _path2.default.resolve(directory, server);
234
365
  if (_fs2.default.existsSync(file)) resolved = file;
235
366
  }
236
- } catch (e2) {
367
+ } catch (e3) {
237
368
  resolved = null;
238
369
  }
239
370
  cache.set(key, resolved);
@@ -244,7 +375,7 @@ function readModule(file) {
244
375
  let stat;
245
376
  try {
246
377
  stat = _fs2.default.statSync(file);
247
- } catch (e3) {
378
+ } catch (e4) {
248
379
  return null;
249
380
  }
250
381
  noteFarmSourceRead(file);
@@ -256,7 +387,7 @@ function readModule(file) {
256
387
  const extension = _path2.default.extname(file).slice(1);
257
388
  const lang = extension === "ts" || extension === "mts" || extension === "cts" ? "ts" : "tsx";
258
389
  program = _parseAst.parseAst.call(void 0, code, { lang });
259
- } catch (e4) {
390
+ } catch (e5) {
260
391
  program = null;
261
392
  }
262
393
  parsedModules.set(file, { size: stat.size, mtimeMs: stat.mtimeMs, program });
@@ -270,19 +401,19 @@ function isClientModule(program) {
270
401
  return false;
271
402
  }
272
403
  function resolveRelative(from, specifier) {
273
- const base = _path2.default.resolve(_path2.default.dirname(from), specifier);
404
+ const base2 = _path2.default.resolve(_path2.default.dirname(from), specifier);
274
405
  for (const extension of SCRIPT_EXTENSIONS) {
275
- const file = `${base}${extension}`;
406
+ const file = `${base2}${extension}`;
276
407
  if (_fs2.default.existsSync(file) && _fs2.default.statSync(file).isFile()) return file;
277
408
  }
278
409
  for (const index of INDEX_FILES) {
279
- const file = _path2.default.join(base, index);
410
+ const file = _path2.default.join(base2, index);
280
411
  if (_fs2.default.existsSync(file)) return file;
281
412
  }
282
413
  return null;
283
414
  }
284
415
  function exportedName(node) {
285
- return _optionalChain([node, 'optionalAccess', _18 => _18.type]) === "Identifier" ? node.name : _optionalChain([node, 'optionalAccess', _19 => _19.value]);
416
+ return _optionalChain([node, 'optionalAccess', _22 => _22.type]) === "Identifier" ? node.name : _optionalChain([node, 'optionalAccess', _23 => _23.value]);
286
417
  }
287
418
  function resolveFarmPackageDefaultEntry(importer, specifier, conditions = ["browser", ...DEFAULT_CONDITIONS]) {
288
419
  const parsed = packageNameOf(specifier);
@@ -296,7 +427,7 @@ function resolveFarmPackageDefaultEntry(importer, specifier, conditions = ["brow
296
427
  _path2.default.join(directory, "package.json"),
297
428
  `./${String(target).replace(/^\.\//, "")}`
298
429
  );
299
- } catch (e5) {
430
+ } catch (e6) {
300
431
  return null;
301
432
  }
302
433
  }
@@ -319,7 +450,7 @@ function traceExport(file, name, depth) {
319
450
  };
320
451
  const imports = /* @__PURE__ */ new Map();
321
452
  for (const node of _nullishCoalesce(program.body, () => ( []))) {
322
- if (node.type !== "ImportDeclaration" || typeof _optionalChain([node, 'access', _20 => _20.source, 'optionalAccess', _21 => _21.value]) !== "string") continue;
453
+ if (node.type !== "ImportDeclaration" || typeof _optionalChain([node, 'access', _24 => _24.source, 'optionalAccess', _25 => _25.value]) !== "string") continue;
323
454
  for (const specifier of _nullishCoalesce(node.specifiers, () => ( []))) {
324
455
  if (specifier.type === "ImportNamespaceSpecifier") continue;
325
456
  const imported = specifier.type === "ImportDefaultSpecifier" ? "default" : _nullishCoalesce(exportedName(specifier.imported), () => ( specifier.local.name));
@@ -347,13 +478,13 @@ function traceExport(file, name, depth) {
347
478
  }
348
479
  }
349
480
  const declared = [
350
- ..._optionalChain([node, 'access', _22 => _22.declaration, 'optionalAccess', _23 => _23.id]) ? [node.declaration.id.name] : [],
351
- ...(_nullishCoalesce(_optionalChain([node, 'access', _24 => _24.declaration, 'optionalAccess', _25 => _25.declarations]), () => ( []))).map((declarator) => _optionalChain([declarator, 'access', _26 => _26.id, 'optionalAccess', _27 => _27.name]))
481
+ ..._optionalChain([node, 'access', _26 => _26.declaration, 'optionalAccess', _27 => _27.id]) ? [node.declaration.id.name] : [],
482
+ ...(_nullishCoalesce(_optionalChain([node, 'access', _28 => _28.declaration, 'optionalAccess', _29 => _29.declarations]), () => ( []))).map((declarator) => _optionalChain([declarator, 'access', _30 => _30.id, 'optionalAccess', _31 => _31.name]))
352
483
  ];
353
484
  if (declared.includes(name)) return here(client ? "client" : "server");
354
485
  } else if (node.type === "ExportDefaultDeclaration" && name === "default") {
355
486
  return own(
356
- () => _optionalChain([node, 'access', _28 => _28.declaration, 'optionalAccess', _29 => _29.type]) === "Identifier" ? local(node.declaration.name) : here("server")
487
+ () => _optionalChain([node, 'access', _32 => _32.declaration, 'optionalAccess', _33 => _33.type]) === "Identifier" ? local(node.declaration.name) : here("server")
357
488
  );
358
489
  }
359
490
  }
@@ -364,7 +495,7 @@ function traceExport(file, name, depth) {
364
495
  return void 0;
365
496
  }
366
497
  function traceFarmExport(file, name) {
367
- return _optionalChain([traceExport, 'call', _30 => _30(file, name, 0), 'optionalAccess', _31 => _31.kind]);
498
+ return _optionalChain([traceExport, 'call', _34 => _34(file, name, 0), 'optionalAccess', _35 => _35.kind]);
368
499
  }
369
500
  function isFarmClientExport(file, name) {
370
501
  return traceFarmExport(file, name) === "client";
@@ -372,7 +503,7 @@ function isFarmClientExport(file, name) {
372
503
  function isFarmPackageClientExport(importer, specifier, name) {
373
504
  return memoizeInFarmSourceSnapshot(
374
505
  "package-client-export",
375
- `${_path2.default.dirname(importer)}\0${specifier}\0${name}`,
506
+ `${farmSourceSnapshotPathKey(_path2.default.dirname(importer))}\0${specifier}\0${name}`,
376
507
  () => {
377
508
  const entry = resolveFarmPackageDefaultEntry(importer, specifier);
378
509
  return !entry || traceFarmExport(entry, name) !== "server";
@@ -382,11 +513,13 @@ function isFarmPackageClientExport(importer, specifier, name) {
382
513
  function parseCode(code, file) {
383
514
  const extension = _path2.default.extname(file).slice(1);
384
515
  const lang = extension === "ts" || extension === "mts" || extension === "cts" ? "ts" : "tsx";
385
- try {
386
- return _parseAst.parseAst.call(void 0, code, { lang });
387
- } catch (e6) {
388
- return null;
389
- }
516
+ return memoizeInFarmSourceSnapshot(`ast:${lang}`, code, () => {
517
+ try {
518
+ return _parseAst.parseAst.call(void 0, code, { lang });
519
+ } catch (e7) {
520
+ return null;
521
+ }
522
+ });
390
523
  }
391
524
  function namespaceMembers(program, local) {
392
525
  const members = /* @__PURE__ */ new Set();
@@ -399,8 +532,8 @@ function namespaceMembers(program, local) {
399
532
  }
400
533
  const current = node;
401
534
  if (typeof current.type !== "string") return;
402
- if ((current.type === "Identifier" || current.type === "JSXIdentifier") && current.name === local && _optionalChain([parent, 'optionalAccess', _32 => _32.type]) !== "ImportNamespaceSpecifier") {
403
- const property = (_optionalChain([parent, 'optionalAccess', _33 => _33.type]) === "MemberExpression" || _optionalChain([parent, 'optionalAccess', _34 => _34.type]) === "JSXMemberExpression") && parent.object === current && !parent.computed ? _optionalChain([parent, 'access', _35 => _35.property, 'optionalAccess', _36 => _36.name]) : void 0;
535
+ if ((current.type === "Identifier" || current.type === "JSXIdentifier") && current.name === local && _optionalChain([parent, 'optionalAccess', _36 => _36.type]) !== "ImportNamespaceSpecifier") {
536
+ const property = (_optionalChain([parent, 'optionalAccess', _37 => _37.type]) === "MemberExpression" || _optionalChain([parent, 'optionalAccess', _38 => _38.type]) === "JSXMemberExpression") && parent.object === current && !parent.computed ? _optionalChain([parent, 'access', _39 => _39.property, 'optionalAccess', _40 => _40.name]) : void 0;
404
537
  if (property) members.add(property);
405
538
  else opaque = true;
406
539
  return;
@@ -417,7 +550,7 @@ function findPackageImports(program, accept) {
417
550
  const found = [];
418
551
  for (const node of _nullishCoalesce(program.body, () => ( []))) {
419
552
  if (node.type !== "ImportDeclaration" || node.importKind === "type") continue;
420
- const specifier = _optionalChain([node, 'access', _37 => _37.source, 'optionalAccess', _38 => _38.value]);
553
+ const specifier = _optionalChain([node, 'access', _41 => _41.source, 'optionalAccess', _42 => _42.value]);
421
554
  if (typeof specifier !== "string" || !accept(specifier)) continue;
422
555
  const specifiers = (_nullishCoalesce(node.specifiers, () => ( []))).filter(
423
556
  (entry2) => entry2.importKind !== "type"
@@ -456,7 +589,7 @@ function findFarmReactServerClientNames(code, file, specifier) {
456
589
  const wanted = [
457
590
  ...entry.defaultLocal ? ["default"] : [],
458
591
  ...entry.named.map((binding) => binding.imported),
459
- ..._nullishCoalesce(_optionalChain([entry, 'access', _39 => _39.namespace, 'optionalAccess', _40 => _40.members]), () => ( []))
592
+ ..._nullishCoalesce(_optionalChain([entry, 'access', _43 => _43.namespace, 'optionalAccess', _44 => _44.members]), () => ( []))
460
593
  ];
461
594
  for (const name of wanted) if (isFarmClientExport(target, name)) names.add(name);
462
595
  }
@@ -464,7 +597,7 @@ function findFarmReactServerClientNames(code, file, specifier) {
464
597
  }
465
598
  function clientModuleSource(node) {
466
599
  if (node.importKind === "type" || node.exportKind === "type") return null;
467
- const source = (node.type === "ImportDeclaration" || node.type === "ExportNamedDeclaration" && node.source) && _optionalChain([node, 'access', _41 => _41.source, 'optionalAccess', _42 => _42.value]);
600
+ const source = (node.type === "ImportDeclaration" || node.type === "ExportNamedDeclaration" && node.source) && _optionalChain([node, 'access', _45 => _45.source, 'optionalAccess', _46 => _46.value]);
468
601
  return typeof source === "string" && source.startsWith(".") ? source : null;
469
602
  }
470
603
  function isClientModuleFile(file) {
@@ -484,8 +617,8 @@ function findFarmReactServerClientModules(code, file, specifier) {
484
617
  const module = readModule(current);
485
618
  if (!module || isClientModule(module)) return;
486
619
  for (const node of _nullishCoalesce(module.body, () => ( []))) {
487
- const source = _nullishCoalesce(clientModuleSource(node), () => ( (node.type === "ExportAllDeclaration" && typeof _optionalChain([node, 'access', _43 => _43.source, 'optionalAccess', _44 => _44.value]) === "string" ? node.source.value : null)));
488
- if (!_optionalChain([source, 'optionalAccess', _45 => _45.startsWith, 'call', _46 => _46(".")])) continue;
620
+ const source = _nullishCoalesce(clientModuleSource(node), () => ( (node.type === "ExportAllDeclaration" && typeof _optionalChain([node, 'access', _47 => _47.source, 'optionalAccess', _48 => _48.value]) === "string" ? node.source.value : null)));
621
+ if (!_optionalChain([source, 'optionalAccess', _49 => _49.startsWith, 'call', _50 => _50(".")])) continue;
489
622
  const child = resolveRelative(current, source);
490
623
  if (!child) continue;
491
624
  if (isClientModuleFile(child)) {
@@ -497,11 +630,11 @@ function findFarmReactServerClientModules(code, file, specifier) {
497
630
  const wanted = [
498
631
  ...entry.defaultLocal ? ["default"] : [],
499
632
  ...entry.named.map((binding) => binding.imported),
500
- ..._nullishCoalesce(_optionalChain([entry, 'access', _47 => _47.namespace, 'optionalAccess', _48 => _48.members]), () => ( []))
633
+ ..._nullishCoalesce(_optionalChain([entry, 'access', _51 => _51.namespace, 'optionalAccess', _52 => _52.members]), () => ( []))
501
634
  ];
502
635
  for (const name of wanted) {
503
636
  const traced = traceExport(target, name, 0);
504
- if (_optionalChain([traced, 'optionalAccess', _49 => _49.kind]) === "server") walk2(traced.file, 0);
637
+ if (_optionalChain([traced, 'optionalAccess', _53 => _53.kind]) === "server") walk2(traced.file, 0);
505
638
  }
506
639
  }
507
640
  return [...found].sort();
@@ -541,7 +674,7 @@ function rewriteFarmReactServerImports(options) {
541
674
  let next = 0;
542
675
  for (const entry of [...imports].sort((left, right) => right.start - left.start)) {
543
676
  const target = targets.get(entry.specifier);
544
- _optionalChain([options, 'access', _50 => _50.onServerFile, 'optionalCall', _51 => _51(target)]);
677
+ _optionalChain([options, 'access', _54 => _54.onServerFile, 'optionalCall', _55 => _55(target)]);
545
678
  const server = JSON.stringify(target);
546
679
  const lines = [];
547
680
  const bind = (name, local) => {
@@ -578,7 +711,7 @@ function staticImportSources(program) {
578
711
  continue;
579
712
  }
580
713
  if (node.importKind === "type" || node.exportKind === "type") continue;
581
- if (typeof _optionalChain([node, 'access', _52 => _52.source, 'optionalAccess', _53 => _53.value]) === "string") sources.push(node.source.value);
714
+ if (typeof _optionalChain([node, 'access', _56 => _56.source, 'optionalAccess', _57 => _57.value]) === "string") sources.push(node.source.value);
582
715
  }
583
716
  return sources;
584
717
  }
@@ -625,7 +758,7 @@ function farmRelativeImportFiles(code, file) {
625
758
  if (!program) return [];
626
759
  const files = [];
627
760
  for (const node of _nullishCoalesce(program.body, () => ( []))) {
628
- const source = (node.type === "ImportDeclaration" || node.type === "ExportAllDeclaration" || node.type === "ExportNamedDeclaration" && node.source) && _optionalChain([node, 'access', _54 => _54.source, 'optionalAccess', _55 => _55.value]);
761
+ const source = (node.type === "ImportDeclaration" || node.type === "ExportAllDeclaration" || node.type === "ExportNamedDeclaration" && node.source) && _optionalChain([node, 'access', _58 => _58.source, 'optionalAccess', _59 => _59.value]);
629
762
  if (typeof source !== "string" || !source.startsWith(".")) continue;
630
763
  const resolved = resolveRelative(file, source);
631
764
  if (resolved) files.push(resolved);
@@ -643,7 +776,7 @@ function farmReactServerBuildReachesClientModules(importer, specifier, serverImp
643
776
  if (!program) return false;
644
777
  if (depth > 0 && isClientModule(program)) return true;
645
778
  for (const node of _nullishCoalesce(program.body, () => ( []))) {
646
- const source = (node.type === "ExportAllDeclaration" || node.type === "ExportNamedDeclaration" && node.source || node.type === "ImportDeclaration") && _optionalChain([node, 'access', _56 => _56.source, 'optionalAccess', _57 => _57.value]);
779
+ const source = (node.type === "ExportAllDeclaration" || node.type === "ExportNamedDeclaration" && node.source || node.type === "ImportDeclaration") && _optionalChain([node, 'access', _60 => _60.source, 'optionalAccess', _61 => _61.value]);
647
780
  if (typeof source !== "string" || !source.startsWith(".")) continue;
648
781
  const child = resolveRelative(file, source);
649
782
  if (child && reaches(child, depth + 1)) return true;
@@ -667,7 +800,7 @@ function scanPackage(directory) {
667
800
  let entries;
668
801
  try {
669
802
  entries = _fs2.default.readdirSync(current, { withFileTypes: true });
670
- } catch (e7) {
803
+ } catch (e8) {
671
804
  continue;
672
805
  }
673
806
  for (const entry of entries) {
@@ -678,7 +811,7 @@ function scanPackage(directory) {
678
811
  let code;
679
812
  try {
680
813
  code = _fs2.default.readFileSync(file, "utf8");
681
- } catch (e8) {
814
+ } catch (e9) {
682
815
  continue;
683
816
  }
684
817
  for (const match of code.matchAll(IMPORT_SPECIFIER)) scan.imports.add(match[1]);
@@ -701,7 +834,7 @@ function findFarmServerBundledPackage(importer, specifier) {
701
834
  if (manifest.exports === void 0 && manifest.type !== "module" && typeof manifest.module === "string" && typeof manifest.main === "string" && _path2.default.resolve(directory, manifest.main) !== _path2.default.resolve(directory, manifest.module)) {
702
835
  return { name: parsed.name, prebundle: isSelfContainedPackage(manifest, importer) };
703
836
  }
704
- } catch (e9) {
837
+ } catch (e10) {
705
838
  return null;
706
839
  }
707
840
  return scanPackage(directory).stylesheets ? { name: parsed.name, prebundle: false } : null;
@@ -709,7 +842,7 @@ function findFarmServerBundledPackage(importer, specifier) {
709
842
  function isSelfContainedPackage(manifest, importer) {
710
843
  if (Object.keys(_nullishCoalesce(manifest.dependencies, () => ( {}))).length > 0) return false;
711
844
  return Object.keys(_nullishCoalesce(manifest.peerDependencies, () => ( {}))).every(
712
- (peer) => _optionalChain([manifest, 'access', _58 => _58.peerDependenciesMeta, 'optionalAccess', _59 => _59[peer], 'optionalAccess', _60 => _60.optional]) === true || findPackageDirectory(importer, peer) !== null
845
+ (peer) => _optionalChain([manifest, 'access', _62 => _62.peerDependenciesMeta, 'optionalAccess', _63 => _63[peer], 'optionalAccess', _64 => _64.optional]) === true || findPackageDirectory(importer, peer) !== null
713
846
  );
714
847
  }
715
848
  function findFarmPackageManifest(importer, specifier) {
@@ -721,11 +854,11 @@ function findFarmPackageManifest(importer, specifier) {
721
854
  try {
722
855
  const manifest = JSON.parse(_fs2.default.readFileSync(_path2.default.join(directory, "package.json"), "utf8"));
723
856
  names = new Set(Object.keys(_nullishCoalesce(manifest.dependencies, () => ( {}))));
724
- } catch (e10) {
857
+ } catch (e11) {
725
858
  return null;
726
859
  }
727
860
  const dependencies = [...scanPackage(directory).imports].filter((imported) => {
728
- const name = _optionalChain([packageNameOf, 'call', _61 => _61(imported), 'optionalAccess', _62 => _62.name]);
861
+ const name = _optionalChain([packageNameOf, 'call', _65 => _65(imported), 'optionalAccess', _66 => _66.name]);
729
862
  return name !== void 0 && names.has(name);
730
863
  });
731
864
  return { name: parsed.name, dependencies: dependencies.sort() };
@@ -758,9 +891,9 @@ function listFarmModuleExports(entry) {
758
891
  const name = exportedName(specifier.exported);
759
892
  if (name) names.add(name);
760
893
  }
761
- if (_optionalChain([node, 'access', _63 => _63.declaration, 'optionalAccess', _64 => _64.id, 'optionalAccess', _65 => _65.name])) names.add(node.declaration.id.name);
762
- for (const declarator of _nullishCoalesce(_optionalChain([node, 'access', _66 => _66.declaration, 'optionalAccess', _67 => _67.declarations]), () => ( []))) {
763
- if (_optionalChain([declarator, 'access', _68 => _68.id, 'optionalAccess', _69 => _69.type]) === "Identifier") names.add(declarator.id.name);
894
+ if (_optionalChain([node, 'access', _67 => _67.declaration, 'optionalAccess', _68 => _68.id, 'optionalAccess', _69 => _69.name])) names.add(node.declaration.id.name);
895
+ for (const declarator of _nullishCoalesce(_optionalChain([node, 'access', _70 => _70.declaration, 'optionalAccess', _71 => _71.declarations]), () => ( []))) {
896
+ if (_optionalChain([declarator, 'access', _72 => _72.id, 'optionalAccess', _73 => _73.type]) === "Identifier") names.add(declarator.id.name);
764
897
  }
765
898
  } else if (node.type === "ExportDefaultDeclaration") {
766
899
  esm = true;
@@ -852,7 +985,7 @@ function resolveProgrammaticClientRoutes(options) {
852
985
  const definedIn = /* @__PURE__ */ new Map();
853
986
  for (const route of definitions) {
854
987
  const source = _chunkE7QOEV5Zcjs.getProgrammaticRouteDefinitionSource.call(void 0, route);
855
- const callers = (_nullishCoalesce(_optionalChain([source, 'optionalAccess', _70 => _70.stacks]), () => ( []))).map((stack) => findRouteCallers(stack, modulesByFile));
988
+ const callers = (_nullishCoalesce(_optionalChain([source, 'optionalAccess', _74 => _74.stacks]), () => ( []))).map((stack) => findRouteCallers(stack, modulesByFile));
856
989
  for (const caller of callers.flat()) caller.routeSource = true;
857
990
  definedIn.set(route, callers.flat());
858
991
  if (!source || source.raw || (_nullishCoalesce(callers[0], () => ( []))).length === 0) untraced = true;
@@ -949,7 +1082,7 @@ function resolveProgrammaticClientRoutes(options) {
949
1082
  return { routes, routeSourceFiles };
950
1083
  }
951
1084
  function createEvaluatedRouteGraph(server) {
952
- const evaluated = _optionalChain([server, 'access', _71 => _71.environments, 'optionalAccess', _72 => _72.ssr, 'optionalAccess', _73 => _73.runner, 'optionalAccess', _74 => _74.evaluatedModules]);
1085
+ const evaluated = _optionalChain([server, 'access', _75 => _75.environments, 'optionalAccess', _76 => _76.ssr, 'optionalAccess', _77 => _77.runner, 'optionalAccess', _78 => _78.evaluatedModules]);
953
1086
  if (!evaluated) return void 0;
954
1087
  const toGraphModule = (node) => ({
955
1088
  id: node.id,
@@ -1073,7 +1206,7 @@ function isNodeBuiltinId(id) {
1073
1206
  return bare.startsWith("node:") || NODE_BUILTINS.has(bare);
1074
1207
  }
1075
1208
  function isProgrammaticRouteActionProxy(code) {
1076
- return Boolean(_optionalChain([code, 'optionalAccess', _75 => _75.includes, 'call', _76 => _76("__farmRouteActionTarget: true")]));
1209
+ return Boolean(_optionalChain([code, 'optionalAccess', _79 => _79.includes, 'call', _80 => _80("__farmRouteActionTarget: true")]));
1077
1210
  }
1078
1211
  function collectGraph(graph, routesFile) {
1079
1212
  const modules = /* @__PURE__ */ new Map();
@@ -1167,7 +1300,7 @@ function holdsRouteDefinition(value, definitions) {
1167
1300
  if (descriptor && "value" in descriptor) next(descriptor.value);
1168
1301
  }
1169
1302
  }
1170
- } catch (e11) {
1303
+ } catch (e12) {
1171
1304
  }
1172
1305
  }
1173
1306
  return false;
@@ -1260,7 +1393,7 @@ function readJsonString(text) {
1260
1393
  try {
1261
1394
  const value = JSON.parse(text);
1262
1395
  return typeof value === "string" ? value : void 0;
1263
- } catch (e12) {
1396
+ } catch (e13) {
1264
1397
  return void 0;
1265
1398
  }
1266
1399
  }
@@ -1268,7 +1401,7 @@ function readJsonArray(text) {
1268
1401
  try {
1269
1402
  const value = JSON.parse(text);
1270
1403
  return Array.isArray(value) ? value : void 0;
1271
- } catch (e13) {
1404
+ } catch (e14) {
1272
1405
  return void 0;
1273
1406
  }
1274
1407
  }
@@ -1278,13 +1411,13 @@ function readExports(namespace) {
1278
1411
  let keys;
1279
1412
  try {
1280
1413
  keys = Object.keys(namespace);
1281
- } catch (e14) {
1414
+ } catch (e15) {
1282
1415
  return [];
1283
1416
  }
1284
1417
  for (const key of keys) {
1285
1418
  try {
1286
1419
  entries.push([key, namespace[key]]);
1287
- } catch (e15) {
1420
+ } catch (e16) {
1288
1421
  }
1289
1422
  }
1290
1423
  return entries;
@@ -1317,7 +1450,7 @@ function toModuleFile(file) {
1317
1450
  if (file.startsWith("file://")) {
1318
1451
  try {
1319
1452
  return toPosixPath(_url.fileURLToPath.call(void 0, file));
1320
- } catch (e16) {
1453
+ } catch (e17) {
1321
1454
  return toPosixPath(file);
1322
1455
  }
1323
1456
  }
@@ -1336,7 +1469,7 @@ var _crypto = require('crypto');
1336
1469
 
1337
1470
  var IDENTIFIER = /^[A-Za-z_$][\w$]*$/;
1338
1471
  var moduleName = (node) => {
1339
- const name = _optionalChain([node, 'optionalAccess', _77 => _77.type]) === "Identifier" ? node.name : _optionalChain([node, 'optionalAccess', _78 => _78.value]);
1472
+ const name = _optionalChain([node, 'optionalAccess', _81 => _81.type]) === "Identifier" ? node.name : _optionalChain([node, 'optionalAccess', _82 => _82.value]);
1340
1473
  return typeof name === "string" ? name : null;
1341
1474
  };
1342
1475
  function parse(code, file) {
@@ -1347,7 +1480,7 @@ function parse(code, file) {
1347
1480
  function parseAs(code, lang) {
1348
1481
  try {
1349
1482
  return _parseAst.parseAst.call(void 0, code, { lang });
1350
- } catch (e17) {
1483
+ } catch (e18) {
1351
1484
  return null;
1352
1485
  }
1353
1486
  }
@@ -1372,8 +1505,8 @@ function namespaceMembers2(program, local, declaration) {
1372
1505
  if (opaque || node === declaration) return;
1373
1506
  const name = node.type === "Identifier" || node.type === "JSXIdentifier" ? node.name : null;
1374
1507
  if (name !== local) return;
1375
- if (_optionalChain([parent, 'optionalAccess', _79 => _79.type]) === "ImportNamespaceSpecifier") return;
1376
- const member = (_optionalChain([parent, 'optionalAccess', _80 => _80.type]) === "MemberExpression" || _optionalChain([parent, 'optionalAccess', _81 => _81.type]) === "JSXMemberExpression") && parent.object === node ? parent.property : null;
1508
+ if (_optionalChain([parent, 'optionalAccess', _83 => _83.type]) === "ImportNamespaceSpecifier") return;
1509
+ const member = (_optionalChain([parent, 'optionalAccess', _84 => _84.type]) === "MemberExpression" || _optionalChain([parent, 'optionalAccess', _85 => _85.type]) === "JSXMemberExpression") && parent.object === node ? parent.property : null;
1377
1510
  const property = member && !parent.computed && (member.type === "Identifier" || member.type === "JSXIdentifier") ? member.name : null;
1378
1511
  if (property) members.add(property);
1379
1512
  else opaque = true;
@@ -1389,7 +1522,7 @@ function findFarmPackageClientImports(code, file, isClientPackage) {
1389
1522
  const reexport = node.type === "ExportNamedDeclaration" && node.source != null;
1390
1523
  if (node.type !== "ImportDeclaration" && !reexport) continue;
1391
1524
  if (node.importKind === "type" || node.exportKind === "type") continue;
1392
- const specifier = _optionalChain([node, 'access', _82 => _82.source, 'optionalAccess', _83 => _83.value]);
1525
+ const specifier = _optionalChain([node, 'access', _86 => _86.source, 'optionalAccess', _87 => _87.value]);
1393
1526
  if (typeof specifier !== "string" || specifier.startsWith(".") || specifier.startsWith("/"))
1394
1527
  continue;
1395
1528
  const specifiers = (_nullishCoalesce(node.specifiers, () => ( []))).filter(
@@ -1446,7 +1579,7 @@ function farmPackageClientImportExports(entry) {
1446
1579
  return [
1447
1580
  ...entry.defaultLocal ? ["default"] : [],
1448
1581
  ...entry.named.map((binding) => binding.imported),
1449
- ..._nullishCoalesce(_optionalChain([entry, 'access', _84 => _84.namespace, 'optionalAccess', _85 => _85.members]), () => ( []))
1582
+ ..._nullishCoalesce(_optionalChain([entry, 'access', _88 => _88.namespace, 'optionalAccess', _89 => _89.members]), () => ( []))
1450
1583
  ];
1451
1584
  }
1452
1585
  var FARM_CLIENT_REFERENCE_PRAGMA = "// @farm-client-reference";
@@ -1487,7 +1620,7 @@ function packageLookup(directory, packageName) {
1487
1620
  const candidate = _path2.default.join(current, "node_modules", packageName);
1488
1621
  try {
1489
1622
  return { from: current, real: _fs2.default.realpathSync(candidate) };
1490
- } catch (e18) {
1623
+ } catch (e19) {
1491
1624
  }
1492
1625
  }
1493
1626
  if (_path2.default.dirname(current) === current) return null;
@@ -1498,10 +1631,10 @@ function referenceResolveFrom(root, specifier, importer) {
1498
1631
  const own = packageLookup(_path2.default.dirname(importer), packageName);
1499
1632
  if (!own) return null;
1500
1633
  const app = packageLookup(_path2.default.join(root, ".farm", "client-references"), packageName);
1501
- if (_optionalChain([app, 'optionalAccess', _86 => _86.real]) === own.real) return null;
1634
+ if (_optionalChain([app, 'optionalAccess', _90 => _90.real]) === own.real) return null;
1502
1635
  try {
1503
1636
  return _fs2.default.realpathSync(own.from);
1504
- } catch (e19) {
1637
+ } catch (e20) {
1505
1638
  return own.from;
1506
1639
  }
1507
1640
  }
@@ -1527,7 +1660,7 @@ function ensureFarmPackageClientReference(root, specifier, exportName, importer)
1527
1660
  let current = null;
1528
1661
  try {
1529
1662
  current = _fs2.default.readFileSync(file, "utf8");
1530
- } catch (e20) {
1663
+ } catch (e21) {
1531
1664
  }
1532
1665
  if (current !== source) {
1533
1666
  _fs2.default.mkdirSync(_path2.default.dirname(file), { recursive: true });
@@ -1539,7 +1672,7 @@ function writeIfChanged(file, source) {
1539
1672
  let current = null;
1540
1673
  try {
1541
1674
  current = _fs2.default.readFileSync(file, "utf8");
1542
- } catch (e21) {
1675
+ } catch (e22) {
1543
1676
  }
1544
1677
  if (current !== source) {
1545
1678
  _fs2.default.mkdirSync(_path2.default.dirname(file), { recursive: true });
@@ -1551,7 +1684,7 @@ function owningPackage(file) {
1551
1684
  try {
1552
1685
  const manifest = JSON.parse(_fs2.default.readFileSync(_path2.default.join(current, "package.json"), "utf8"));
1553
1686
  if (typeof manifest.name === "string") return { directory: current, name: manifest.name };
1554
- } catch (e22) {
1687
+ } catch (e23) {
1555
1688
  }
1556
1689
  if (_path2.default.dirname(current) === current) return null;
1557
1690
  }
@@ -1622,7 +1755,7 @@ function rewriteFarmPackageClientImports(options) {
1622
1755
  lines.push(`import { ${member} as ${local} } from ${reference(entry.specifier, member)};`);
1623
1756
  fields.push(`${member}: ${local}`);
1624
1757
  }
1625
- if (_optionalChain([entry, 'access', _87 => _87.namespace, 'access', _88 => _88.values, 'optionalAccess', _89 => _89.length])) {
1758
+ if (_optionalChain([entry, 'access', _91 => _91.namespace, 'access', _92 => _92.values, 'optionalAccess', _93 => _93.length])) {
1626
1759
  const local = `__farm_package_values_${next++}__`;
1627
1760
  lines.push(`import * as ${local} from ${JSON.stringify(entry.specifier)};`);
1628
1761
  for (const value of entry.namespace.values) fields.push(`${value}: ${local}.${value}`);
@@ -1671,7 +1804,7 @@ function ensureFarmIslandContainerReference(root) {
1671
1804
  let current = null;
1672
1805
  try {
1673
1806
  current = _fs2.default.readFileSync(file, "utf8");
1674
- } catch (e23) {
1807
+ } catch (e24) {
1675
1808
  }
1676
1809
  if (current !== source) {
1677
1810
  _fs2.default.mkdirSync(_path2.default.dirname(file), { recursive: true });
@@ -1685,7 +1818,7 @@ function parse2(code, file) {
1685
1818
  return memoizeInFarmSourceSnapshot(`ast:${lang}`, code, () => {
1686
1819
  try {
1687
1820
  return _parseAst.parseAst.call(void 0, code, { lang });
1688
- } catch (e24) {
1821
+ } catch (e25) {
1689
1822
  return null;
1690
1823
  }
1691
1824
  });
@@ -1719,7 +1852,7 @@ function findFarmIslandContainers(code, file, bindings) {
1719
1852
  const current = node;
1720
1853
  if (typeof current.type !== "string") return;
1721
1854
  if (current.type === "JSXElement") {
1722
- const name = jsxName(_optionalChain([current, 'access', _90 => _90.openingElement, 'optionalAccess', _91 => _91.name]));
1855
+ const name = jsxName(_optionalChain([current, 'access', _94 => _94.openingElement, 'optionalAccess', _95 => _95.name]));
1723
1856
  if (name && names.has(name)) {
1724
1857
  let container;
1725
1858
  for (let depth = open.length - 1; depth >= 0; depth--) {
@@ -1735,9 +1868,9 @@ function findFarmIslandContainers(code, file, bindings) {
1735
1868
  });
1736
1869
  }
1737
1870
  }
1738
- const host = _optionalChain([current, 'access', _92 => _92.openingElement, 'optionalAccess', _93 => _93.name, 'optionalAccess', _94 => _94.type]) === "JSXIdentifier" && (ISLAND_CONTAINER_TAGS.has(name) || FLOW_CONTENT_TAGS.has(name));
1871
+ const host = _optionalChain([current, 'access', _96 => _96.openingElement, 'optionalAccess', _97 => _97.name, 'optionalAccess', _98 => _98.type]) === "JSXIdentifier" && (ISLAND_CONTAINER_TAGS.has(name) || FLOW_CONTENT_TAGS.has(name));
1739
1872
  if (host) open.push(current);
1740
- visit(_optionalChain([current, 'access', _95 => _95.openingElement, 'optionalAccess', _96 => _96.attributes]));
1873
+ visit(_optionalChain([current, 'access', _99 => _99.openingElement, 'optionalAccess', _100 => _100.attributes]));
1741
1874
  visit(current.children);
1742
1875
  if (host) open.pop();
1743
1876
  return;
@@ -1768,7 +1901,7 @@ function wrapFarmIslandContainers(options) {
1768
1901
  const declaration = `import { ${FARM_ISLAND_CONTAINER_EXPORT} as ${CONTAINER_LOCAL} } from ${specifier};
1769
1902
  `;
1770
1903
  let prologueEnd = 0;
1771
- for (const statement of _nullishCoalesce(_optionalChain([parse2, 'call', _97 => _97(options.code, options.file), 'optionalAccess', _98 => _98.body]), () => ( []))) {
1904
+ for (const statement of _nullishCoalesce(_optionalChain([parse2, 'call', _101 => _101(options.code, options.file), 'optionalAccess', _102 => _102.body]), () => ( []))) {
1772
1905
  if (statement.type !== "ExpressionStatement" || typeof statement.directive !== "string") break;
1773
1906
  prologueEnd = statement.end;
1774
1907
  }
@@ -1824,7 +1957,7 @@ function stampPackagePath(target, kind) {
1824
1957
  const stat = _fs2.default.statSync(target, { throwIfNoEntry: false });
1825
1958
  if (!stat || (kind === "file" ? !stat.isFile() : !stat.isDirectory())) return void 0;
1826
1959
  return [target, stat.size, stat.mtimeMs, stat.ctimeMs];
1827
- } catch (e25) {
1960
+ } catch (e26) {
1828
1961
  return void 0;
1829
1962
  }
1830
1963
  }
@@ -1860,7 +1993,7 @@ var PackageClientBoundaryCache = class {
1860
1993
  else this.dirty = true;
1861
1994
  }
1862
1995
  }
1863
- return _optionalChain([entries, 'optionalAccess', _99 => _99.find, 'call', _100 => _100(
1996
+ return _optionalChain([entries, 'optionalAccess', _103 => _103.find, 'call', _104 => _104(
1864
1997
  (entry) => entry.stops.every((file) => visited.has(file)) && !entry.files.some((file) => visited.has(file))
1865
1998
  )]);
1866
1999
  }
@@ -1879,7 +2012,7 @@ var PackageClientBoundaryCache = class {
1879
2012
  await _fs2.default.promises.mkdir(_path2.default.dirname(file), { recursive: true });
1880
2013
  await _fs2.default.promises.writeFile(temporary, contents);
1881
2014
  await _fs2.default.promises.rename(temporary, file);
1882
- } catch (e26) {
2015
+ } catch (e27) {
1883
2016
  await _fs2.default.promises.rm(temporary, { force: true }).catch(() => {
1884
2017
  });
1885
2018
  }
@@ -1894,10 +2027,10 @@ var PackageClientBoundaryCache = class {
1894
2027
  _fs2.default.mkdirSync(_path2.default.dirname(file), { recursive: true });
1895
2028
  _fs2.default.writeFileSync(temporary, contents);
1896
2029
  _fs2.default.renameSync(temporary, file);
1897
- } catch (e27) {
2030
+ } catch (e28) {
1898
2031
  try {
1899
2032
  _fs2.default.rmSync(temporary, { force: true });
1900
- } catch (e28) {
2033
+ } catch (e29) {
1901
2034
  }
1902
2035
  }
1903
2036
  }
@@ -1931,7 +2064,7 @@ var PackageClientBoundaryCache = class {
1931
2064
  }
1932
2065
  const contents = JSON.stringify({
1933
2066
  schema: SCHEMA_VERSION,
1934
- farm: _chunkUVQRMUARcjs.FARM_VERSION,
2067
+ farm: _chunkRSL3YFJGcjs.FARM_VERSION,
1935
2068
  paths,
1936
2069
  entries
1937
2070
  });
@@ -1968,10 +2101,10 @@ function readStoredCache(file) {
1968
2101
  let value;
1969
2102
  try {
1970
2103
  value = JSON.parse(_fs2.default.readFileSync(file, "utf8"));
1971
- } catch (e29) {
2104
+ } catch (e30) {
1972
2105
  return null;
1973
2106
  }
1974
- if (!isRecord(value) || value.schema !== SCHEMA_VERSION || value.farm !== _chunkUVQRMUARcjs.FARM_VERSION) {
2107
+ if (!isRecord(value) || value.schema !== SCHEMA_VERSION || value.farm !== _chunkRSL3YFJGcjs.FARM_VERSION) {
1975
2108
  return null;
1976
2109
  }
1977
2110
  const { paths, entries } = value;
@@ -1982,7 +2115,7 @@ function readStoredCache(file) {
1982
2115
  const usable = variants.filter((entry) => isStoredEntry(entry, paths.length));
1983
2116
  if (usable.length > 0) valid[key] = usable;
1984
2117
  }
1985
- return { schema: SCHEMA_VERSION, farm: _chunkUVQRMUARcjs.FARM_VERSION, paths, entries: valid };
2118
+ return { schema: SCHEMA_VERSION, farm: _chunkRSL3YFJGcjs.FARM_VERSION, paths, entries: valid };
1986
2119
  }
1987
2120
  function isRecord(value) {
1988
2121
  return typeof value === "object" && value !== null && !Array.isArray(value);
@@ -2021,7 +2154,7 @@ async function withPackageClientBoundaryCache(operation) {
2021
2154
  }
2022
2155
  }
2023
2156
  function usePackageClientBoundaryCacheFile(file) {
2024
- _optionalChain([getPackageClientBoundaryCache, 'call', _101 => _101(), 'optionalAccess', _102 => _102.load, 'call', _103 => _103(file)]);
2157
+ _optionalChain([getPackageClientBoundaryCache, 'call', _105 => _105(), 'optionalAccess', _106 => _106.load, 'call', _107 => _107(file)]);
2025
2158
  }
2026
2159
  function resolvePackageClientBoundaryCacheFile(root, distDir) {
2027
2160
  return _path2.default.resolve(root, distDir, "cache", "client-boundaries.json");
@@ -2038,7 +2171,7 @@ function runWithPackageClientBoundaryCacheFile(file, operation) {
2038
2171
  var latestDevCache;
2039
2172
  function runWithLatestPackageClientBoundaryCache(file, operation) {
2040
2173
  if (getPackageClientBoundaryCache()) return operation();
2041
- if (_optionalChain([latestDevCache, 'optionalAccess', _104 => _104.file]) !== file) {
2174
+ if (_optionalChain([latestDevCache, 'optionalAccess', _108 => _108.file]) !== file) {
2042
2175
  const cache2 = new PackageClientBoundaryCache();
2043
2176
  cache2.load(file);
2044
2177
  latestDevCache = { file, cache: cache2 };
@@ -2072,7 +2205,7 @@ function readSourceFileContents(filePath) {
2072
2205
  return null;
2073
2206
  }
2074
2207
  return _fs2.default.readFileSync(filePath, "utf-8");
2075
- } catch (e30) {
2208
+ } catch (e31) {
2076
2209
  return null;
2077
2210
  }
2078
2211
  }
@@ -2085,7 +2218,7 @@ function resolveModuleSourcePath(modulePath, root) {
2085
2218
  if (modulePath.startsWith("file://")) {
2086
2219
  try {
2087
2220
  candidates.add(_url.fileURLToPath.call(void 0, modulePath));
2088
- } catch (e31) {
2221
+ } catch (e32) {
2089
2222
  }
2090
2223
  }
2091
2224
  if (modulePath.startsWith("/@fs/")) {
@@ -2098,7 +2231,7 @@ function resolveModuleSourcePath(modulePath, root) {
2098
2231
  candidates.add(_path2.default.join(root, normalized));
2099
2232
  candidates.add(_path2.default.resolve(root, normalized));
2100
2233
  }
2101
- if (_optionalChain([withoutQuery, 'optionalAccess', _105 => _105.startsWith, 'call', _106 => _106("/src/")])) {
2234
+ if (_optionalChain([withoutQuery, 'optionalAccess', _109 => _109.startsWith, 'call', _110 => _110("/src/")])) {
2102
2235
  const normalized = withoutQuery.replace(/^\/+/, "");
2103
2236
  candidates.add(_path2.default.join(process.cwd(), normalized));
2104
2237
  candidates.add(_path2.default.resolve(process.cwd(), normalized));
@@ -2153,7 +2286,7 @@ function hasUseClientDirective(content) {
2153
2286
  if (!normalized.includes("use client")) {
2154
2287
  return false;
2155
2288
  }
2156
- for (const token of tokenizeModuleSource(content)) {
2289
+ for (const token of scanModuleSourceTokens(content, true)) {
2157
2290
  if (token.kind === "string") {
2158
2291
  if (token.value === "use client") {
2159
2292
  return true;
@@ -2177,7 +2310,7 @@ function hasHydrateExport(content) {
2177
2310
  for (const match of content.matchAll(/\bexport\s*\{([^}]*)\}/g)) {
2178
2311
  for (const specifier of match[1].split(",")) {
2179
2312
  const parts = specifier.trim().split(/\s+as\s+/);
2180
- const exportedName2 = _optionalChain([(_nullishCoalesce(parts[1], () => ( parts[0]))), 'optionalAccess', _107 => _107.trim, 'call', _108 => _108()]);
2313
+ const exportedName2 = _optionalChain([(_nullishCoalesce(parts[1], () => ( parts[0]))), 'optionalAccess', _111 => _111.trim, 'call', _112 => _112()]);
2181
2314
  if (exportedName2 === "hydrate") {
2182
2315
  return true;
2183
2316
  }
@@ -2279,7 +2412,7 @@ function isIdentifierStartCode(code) {
2279
2412
  function isIdentifierPartCode(code) {
2280
2413
  return isIdentifierStartCode(code) || code >= 48 && code <= 57;
2281
2414
  }
2282
- function scanModuleSourceTokens(content) {
2415
+ function scanModuleSourceTokens(content, prologueOnly = false) {
2283
2416
  const tokens = [];
2284
2417
  let index = 0;
2285
2418
  let line = 1;
@@ -2359,9 +2492,11 @@ function scanModuleSourceTokens(content) {
2359
2492
  const start = index++;
2360
2493
  while (index < content.length && isIdentifierPartCode(content.charCodeAt(index))) index++;
2361
2494
  tokens.push({ kind: "identifier", value: content.slice(start, index), line });
2495
+ if (prologueOnly) return tokens;
2362
2496
  continue;
2363
2497
  }
2364
2498
  tokens.push({ kind: "punctuation", value: character, line });
2499
+ if (prologueOnly && character !== ";") return tokens;
2365
2500
  index++;
2366
2501
  }
2367
2502
  return tokens;
@@ -2370,7 +2505,7 @@ function isIslandExportStart(tokens, index) {
2370
2505
  const token = tokens[index];
2371
2506
  const previous = tokens[index - 1];
2372
2507
  const startsStatement = !previous || previous.value === ";" || previous.value === "{" || previous.value === "}" || token.line > previous.line;
2373
- return startsStatement && token.value === "export" && _optionalChain([tokens, 'access', _109 => _109[index + 1], 'optionalAccess', _110 => _110.value]) === "const" && _optionalChain([tokens, 'access', _111 => _111[index + 2], 'optionalAccess', _112 => _112.value]) === "island";
2508
+ return startsStatement && token.value === "export" && _optionalChain([tokens, 'access', _113 => _113[index + 1], 'optionalAccess', _114 => _114.value]) === "const" && _optionalChain([tokens, 'access', _115 => _115[index + 2], 'optionalAccess', _116 => _116.value]) === "island";
2374
2509
  }
2375
2510
  function getIslandStrategyExport(content) {
2376
2511
  if (!content) return null;
@@ -2378,15 +2513,15 @@ function getIslandStrategyExport(content) {
2378
2513
  for (let index = 0; index < tokens.length - 2; index++) {
2379
2514
  if (!isIslandExportStart(tokens, index)) continue;
2380
2515
  let valueIndex = index + 3;
2381
- if (_optionalChain([tokens, 'access', _113 => _113[valueIndex], 'optionalAccess', _114 => _114.value]) === ":") {
2516
+ if (_optionalChain([tokens, 'access', _117 => _117[valueIndex], 'optionalAccess', _118 => _118.value]) === ":") {
2382
2517
  while (valueIndex < tokens.length && tokens[valueIndex].value !== "=") valueIndex++;
2383
2518
  }
2384
- if (_optionalChain([tokens, 'access', _115 => _115[valueIndex], 'optionalAccess', _116 => _116.value]) !== "=") break;
2519
+ if (_optionalChain([tokens, 'access', _119 => _119[valueIndex], 'optionalAccess', _120 => _120.value]) !== "=") break;
2385
2520
  valueIndex++;
2386
2521
  const literal = tokens[valueIndex];
2387
2522
  if (!literal || literal.kind !== "string" || !_chunk7KJJ4SBScjs.isFarmIslandStrategy.call(void 0, literal.value)) break;
2388
2523
  let trailingIndex = valueIndex + 1;
2389
- if (_optionalChain([tokens, 'access', _117 => _117[trailingIndex], 'optionalAccess', _118 => _118.value]) === "as" && _optionalChain([tokens, 'access', _119 => _119[trailingIndex + 1], 'optionalAccess', _120 => _120.value]) === "const") {
2524
+ if (_optionalChain([tokens, 'access', _121 => _121[trailingIndex], 'optionalAccess', _122 => _122.value]) === "as" && _optionalChain([tokens, 'access', _123 => _123[trailingIndex + 1], 'optionalAccess', _124 => _124.value]) === "const") {
2390
2525
  trailingIndex += 2;
2391
2526
  }
2392
2527
  const trailing = tokens[trailingIndex];
@@ -2412,13 +2547,13 @@ function hasAsyncDefaultExport(content) {
2412
2547
  for (let index = 0; index < tokens.length - 2; index++) {
2413
2548
  const token = tokens[index];
2414
2549
  if (token.kind !== "identifier" || token.value !== "export") continue;
2415
- if (_optionalChain([tokens, 'access', _121 => _121[index - 1], 'optionalAccess', _122 => _122.value]) === ".") continue;
2416
- if (_optionalChain([tokens, 'access', _123 => _123[index + 1], 'optionalAccess', _124 => _124.value]) !== "default") continue;
2550
+ if (_optionalChain([tokens, 'access', _125 => _125[index - 1], 'optionalAccess', _126 => _126.value]) === ".") continue;
2551
+ if (_optionalChain([tokens, 'access', _127 => _127[index + 1], 'optionalAccess', _128 => _128.value]) !== "default") continue;
2417
2552
  const exported = tokens[index + 2];
2418
2553
  if (exported.kind === "identifier" && exported.value === "async") {
2419
2554
  return true;
2420
2555
  }
2421
- if (exported.kind === "identifier" && !["function", "class"].includes(exported.value) && _optionalChain([tokens, 'access', _125 => _125[index + 3], 'optionalAccess', _126 => _126.value]) !== "(" && isAsyncLocalDeclaration(tokens, exported.value)) {
2556
+ if (exported.kind === "identifier" && !["function", "class"].includes(exported.value) && _optionalChain([tokens, 'access', _129 => _129[index + 3], 'optionalAccess', _130 => _130.value]) !== "(" && isAsyncLocalDeclaration(tokens, exported.value)) {
2422
2557
  return true;
2423
2558
  }
2424
2559
  }
@@ -2426,10 +2561,10 @@ function hasAsyncDefaultExport(content) {
2426
2561
  }
2427
2562
  function isAsyncLocalDeclaration(tokens, name) {
2428
2563
  for (let index = 0; index < tokens.length - 2; index++) {
2429
- if (tokens[index].value === "async" && _optionalChain([tokens, 'access', _127 => _127[index + 1], 'optionalAccess', _128 => _128.value]) === "function" && _optionalChain([tokens, 'access', _129 => _129[index + 2], 'optionalAccess', _130 => _130.value]) === name) {
2564
+ if (tokens[index].value === "async" && _optionalChain([tokens, 'access', _131 => _131[index + 1], 'optionalAccess', _132 => _132.value]) === "function" && _optionalChain([tokens, 'access', _133 => _133[index + 2], 'optionalAccess', _134 => _134.value]) === name) {
2430
2565
  return true;
2431
2566
  }
2432
- if (tokens[index].value === name && _optionalChain([tokens, 'access', _131 => _131[index + 1], 'optionalAccess', _132 => _132.value]) === "=" && _optionalChain([tokens, 'access', _133 => _133[index + 2], 'optionalAccess', _134 => _134.value]) === "async") {
2567
+ if (tokens[index].value === name && _optionalChain([tokens, 'access', _135 => _135[index + 1], 'optionalAccess', _136 => _136.value]) === "=" && _optionalChain([tokens, 'access', _137 => _137[index + 2], 'optionalAccess', _138 => _138.value]) === "async") {
2433
2568
  return true;
2434
2569
  }
2435
2570
  }
@@ -2518,6 +2653,9 @@ function getClientModuleMetadata(modulePath, root) {
2518
2653
  const resolvedPath = resolveModuleSourcePath(modulePath, root);
2519
2654
  return inspectClientModuleMetadata(resolvedPath, root, /* @__PURE__ */ new Set(), true);
2520
2655
  }
2656
+ function getClientModuleHydrationPlanKey(modulePath, root, mode, options = {}) {
2657
+ return `${_path2.default.resolve(root)}\0${mode}\0${options.asyncOwnerIslands === true}\0${options.serverOwners === true}\0${options.serverTreeLayouts === true}\0${options.packageReferences === true}\0${_path2.default.resolve(modulePath)}`;
2658
+ }
2521
2659
  function getClientModuleHydrationPlan(modulePath, root, mode = "off", options = {}) {
2522
2660
  const plan = planClientModuleHydration(modulePath, root, mode, options);
2523
2661
  if (options.serverTreeLayouts !== true || options.asyncOwnerIslands !== true || !plan.shouldHydrate || plan.isClientComponent || plan.asyncOwnerIslands) {
@@ -2640,7 +2778,7 @@ function planClientModuleHydration(modulePath, root, mode, options) {
2640
2778
  return plan;
2641
2779
  }
2642
2780
  function usesFarmServerTree(plan) {
2643
- return _optionalChain([plan, 'optionalAccess', _135 => _135.asyncOwnerIslands]) === true && plan.isolatedBoundaries.length > 0;
2781
+ return _optionalChain([plan, 'optionalAccess', _139 => _139.asyncOwnerIslands]) === true && plan.isolatedBoundaries.length > 0;
2644
2782
  }
2645
2783
  function getMarkdownPageHydrationPlan(componentsModulePath, root, mode = "off", options = {}) {
2646
2784
  const plan = {
@@ -2770,7 +2908,7 @@ function clientModulePlanSignature(content) {
2770
2908
  isIsolatableClientBoundarySource(content),
2771
2909
  getImportSpecifiers(content).sort()
2772
2910
  ]);
2773
- } catch (e32) {
2911
+ } catch (e33) {
2774
2912
  return null;
2775
2913
  }
2776
2914
  }
@@ -2795,7 +2933,7 @@ function getStaticImportBindings(content) {
2795
2933
  if (!content) return bindings;
2796
2934
  const tokens = tokenizeModuleSource(content);
2797
2935
  for (let index = 0; index < tokens.length; index++) {
2798
- if (tokens[index].value !== "import" || _optionalChain([tokens, 'access', _136 => _136[index - 1], 'optionalAccess', _137 => _137.value]) === ".") continue;
2936
+ if (tokens[index].value !== "import" || _optionalChain([tokens, 'access', _140 => _140[index - 1], 'optionalAccess', _141 => _141.value]) === ".") continue;
2799
2937
  const first = tokens[index + 1];
2800
2938
  if (!first || first.value === "type" || first.value === "(" || first.kind === "string") {
2801
2939
  continue;
@@ -2803,7 +2941,7 @@ function getStaticImportBindings(content) {
2803
2941
  let fromIndex = -1;
2804
2942
  for (let cursor = index + 1; cursor < tokens.length; cursor++) {
2805
2943
  if (tokens[cursor].value === ";") break;
2806
- if (tokens[cursor].value === "from" && _optionalChain([tokens, 'access', _138 => _138[cursor + 1], 'optionalAccess', _139 => _139.kind]) === "string") {
2944
+ if (tokens[cursor].value === "from" && _optionalChain([tokens, 'access', _142 => _142[cursor + 1], 'optionalAccess', _143 => _143.kind]) === "string") {
2807
2945
  fromIndex = cursor;
2808
2946
  break;
2809
2947
  }
@@ -2812,13 +2950,13 @@ function getStaticImportBindings(content) {
2812
2950
  const specifier = tokens[fromIndex + 1].value;
2813
2951
  const clause = tokens.slice(index + 1, fromIndex);
2814
2952
  const localNames = [];
2815
- if (_optionalChain([clause, 'access', _140 => _140[0], 'optionalAccess', _141 => _141.kind]) === "identifier" && clause[0].value !== "type") {
2953
+ if (_optionalChain([clause, 'access', _144 => _144[0], 'optionalAccess', _145 => _145.kind]) === "identifier" && clause[0].value !== "type") {
2816
2954
  localNames.push(clause[0].value);
2817
2955
  }
2818
2956
  const namespaceAs = clause.findIndex(
2819
- (token, clauseIndex) => token.value === "*" && _optionalChain([clause, 'access', _142 => _142[clauseIndex + 1], 'optionalAccess', _143 => _143.value]) === "as"
2957
+ (token, clauseIndex) => token.value === "*" && _optionalChain([clause, 'access', _146 => _146[clauseIndex + 1], 'optionalAccess', _147 => _147.value]) === "as"
2820
2958
  );
2821
- if (namespaceAs !== -1 && _optionalChain([clause, 'access', _144 => _144[namespaceAs + 2], 'optionalAccess', _145 => _145.kind]) === "identifier") {
2959
+ if (namespaceAs !== -1 && _optionalChain([clause, 'access', _148 => _148[namespaceAs + 2], 'optionalAccess', _149 => _149.kind]) === "identifier") {
2822
2960
  localNames.push(clause[namespaceAs + 2].value);
2823
2961
  }
2824
2962
  const openingBrace = clause.findIndex((token) => token.value === "{");
@@ -2828,11 +2966,11 @@ function getStaticImportBindings(content) {
2828
2966
  if (openingBrace !== -1 && closingBrace !== -1) {
2829
2967
  let entryStart = openingBrace + 1;
2830
2968
  for (let cursor = entryStart; cursor <= closingBrace; cursor++) {
2831
- if (cursor !== closingBrace && _optionalChain([clause, 'access', _146 => _146[cursor], 'optionalAccess', _147 => _147.value]) !== ",") continue;
2969
+ if (cursor !== closingBrace && _optionalChain([clause, 'access', _150 => _150[cursor], 'optionalAccess', _151 => _151.value]) !== ",") continue;
2832
2970
  const entry = clause.slice(entryStart, cursor).filter((token) => token.value !== "type");
2833
2971
  const asIndex = entry.findIndex((token) => token.value === "as");
2834
2972
  const local = asIndex === -1 ? entry[0] : entry[asIndex + 1];
2835
- if (_optionalChain([local, 'optionalAccess', _148 => _148.kind]) === "identifier") localNames.push(local.value);
2973
+ if (_optionalChain([local, 'optionalAccess', _152 => _152.kind]) === "identifier") localNames.push(local.value);
2836
2974
  entryStart = cursor + 1;
2837
2975
  }
2838
2976
  }
@@ -2869,14 +3007,14 @@ function findParserSensitiveJsxContainer(content, localBindings) {
2869
3007
  const open = [];
2870
3008
  const isSelfClosing = (openingIndex) => {
2871
3009
  for (let index = openingIndex; index < tokens.length; index++) {
2872
- if (tokens[index].value === ">") return _optionalChain([tokens, 'access', _149 => _149[index - 1], 'optionalAccess', _150 => _150.value]) === "/";
3010
+ if (tokens[index].value === ">") return _optionalChain([tokens, 'access', _153 => _153[index - 1], 'optionalAccess', _154 => _154.value]) === "/";
2873
3011
  }
2874
3012
  return false;
2875
3013
  };
2876
3014
  for (let index = 0; index < tokens.length - 1; index++) {
2877
3015
  if (tokens[index].value !== "<") continue;
2878
3016
  if (tokens[index + 1].value === "/") {
2879
- const closing = _optionalChain([tokens, 'access', _151 => _151[index + 2], 'optionalAccess', _152 => _152.value]);
3017
+ const closing = _optionalChain([tokens, 'access', _155 => _155[index + 2], 'optionalAccess', _156 => _156.value]);
2880
3018
  const at = closing ? open.lastIndexOf(closing) : -1;
2881
3019
  if (at !== -1) open.length = at;
2882
3020
  continue;
@@ -2919,7 +3057,7 @@ function findMatchingToken(tokens, openingIndex, opening, closing) {
2919
3057
  }
2920
3058
  function containsClientJsx(tokens, start, end, clientBindings) {
2921
3059
  for (let index = start; index < end; index++) {
2922
- if (tokens[index].value === "<" && clientBindings.has(_optionalChain([tokens, 'access', _153 => _153[index + 1], 'optionalAccess', _154 => _154.value]))) return true;
3060
+ if (tokens[index].value === "<" && clientBindings.has(_optionalChain([tokens, 'access', _157 => _157[index + 1], 'optionalAccess', _158 => _158.value]))) return true;
2923
3061
  }
2924
3062
  return false;
2925
3063
  }
@@ -2957,7 +3095,7 @@ function getClientRenderingHelpers(tokens, clientBindings) {
2957
3095
  let helperName;
2958
3096
  let bodyStart = -1;
2959
3097
  let bodyEnd = -1;
2960
- if (tokens[index].value === "function" && _optionalChain([tokens, 'access', _155 => _155[index + 1], 'optionalAccess', _156 => _156.kind]) === "identifier") {
3098
+ if (tokens[index].value === "function" && _optionalChain([tokens, 'access', _159 => _159[index + 1], 'optionalAccess', _160 => _160.kind]) === "identifier") {
2961
3099
  helperName = tokens[index + 1].value;
2962
3100
  const parametersStart = tokens.findIndex(
2963
3101
  (token, tokenIndex) => tokenIndex > index + 1 && token.value === "("
@@ -2967,21 +3105,21 @@ function getClientRenderingHelpers(tokens, clientBindings) {
2967
3105
  (token, tokenIndex) => tokenIndex > parametersEnd && token.value === "{"
2968
3106
  );
2969
3107
  if (bodyStart !== -1) bodyEnd = findMatchingToken(tokens, bodyStart, "{", "}");
2970
- } else if ((tokens[index].value === "const" || tokens[index].value === "let" || tokens[index].value === "var") && _optionalChain([tokens, 'access', _157 => _157[index + 1], 'optionalAccess', _158 => _158.kind]) === "identifier") {
3108
+ } else if ((tokens[index].value === "const" || tokens[index].value === "let" || tokens[index].value === "var") && _optionalChain([tokens, 'access', _161 => _161[index + 1], 'optionalAccess', _162 => _162.kind]) === "identifier") {
2971
3109
  helperName = tokens[index + 1].value;
2972
3110
  let assignmentIndex = -1;
2973
3111
  let arrowIndex = -1;
2974
3112
  for (let cursor = index + 2; cursor < tokens.length; cursor++) {
2975
3113
  if (tokens[cursor].value === ";") break;
2976
3114
  if (assignmentIndex === -1 && tokens[cursor].value === "=") assignmentIndex = cursor;
2977
- if (tokens[cursor].value === "=" && _optionalChain([tokens, 'access', _159 => _159[cursor + 1], 'optionalAccess', _160 => _160.value]) === ">") {
3115
+ if (tokens[cursor].value === "=" && _optionalChain([tokens, 'access', _163 => _163[cursor + 1], 'optionalAccess', _164 => _164.value]) === ">") {
2978
3116
  arrowIndex = cursor;
2979
3117
  break;
2980
3118
  }
2981
3119
  }
2982
3120
  if (arrowIndex !== -1) {
2983
3121
  bodyStart = arrowIndex + 2;
2984
- bodyEnd = _optionalChain([tokens, 'access', _161 => _161[bodyStart], 'optionalAccess', _162 => _162.value]) === "{" ? findMatchingToken(tokens, bodyStart, "{", "}") : findStatementEnd(tokens, bodyStart);
3122
+ bodyEnd = _optionalChain([tokens, 'access', _165 => _165[bodyStart], 'optionalAccess', _166 => _166.value]) === "{" ? findMatchingToken(tokens, bodyStart, "{", "}") : findStatementEnd(tokens, bodyStart);
2985
3123
  } else if (assignmentIndex !== -1) {
2986
3124
  bodyStart = assignmentIndex + 1;
2987
3125
  bodyEnd = findStatementEnd(tokens, bodyStart);
@@ -3021,14 +3159,14 @@ function passesElementValuedProps(content, localBindings) {
3021
3159
  else if (value === "}") braceDepth--;
3022
3160
  else if (value === "<" && braceDepth > 0) return true;
3023
3161
  else if (value === ">" && braceDepth === 0) {
3024
- selfClosing = _optionalChain([tokens, 'access', _163 => _163[cursor - 1], 'optionalAccess', _164 => _164.value]) === "/";
3162
+ selfClosing = _optionalChain([tokens, 'access', _167 => _167[cursor - 1], 'optionalAccess', _168 => _168.value]) === "/";
3025
3163
  break;
3026
3164
  }
3027
3165
  }
3028
3166
  if (selfClosing || cursor >= tokens.length) continue;
3029
3167
  for (let child = cursor + 1; child < tokens.length; child++) {
3030
3168
  if (tokens[child].value !== "<") continue;
3031
- const closesBoundary = _optionalChain([tokens, 'access', _165 => _165[child + 1], 'optionalAccess', _166 => _166.value]) === "/" && _optionalChain([tokens, 'access', _167 => _167[child + 2], 'optionalAccess', _168 => _168.value]) === name;
3169
+ const closesBoundary = _optionalChain([tokens, 'access', _169 => _169[child + 1], 'optionalAccess', _170 => _170.value]) === "/" && _optionalChain([tokens, 'access', _171 => _171[child + 2], 'optionalAccess', _172 => _172.value]) === name;
3032
3170
  if (!closesBoundary) return true;
3033
3171
  break;
3034
3172
  }
@@ -3050,7 +3188,7 @@ function rendersOnlyLeafElements(content, localBindings) {
3050
3188
  else if (value === "<" && braceDepth > 0) return false;
3051
3189
  else if (value === ">" && braceDepth === 0) break;
3052
3190
  }
3053
- if (cursor >= tokens.length || _optionalChain([tokens, 'access', _169 => _169[cursor - 1], 'optionalAccess', _170 => _170.value]) !== "/") return false;
3191
+ if (cursor >= tokens.length || _optionalChain([tokens, 'access', _173 => _173[cursor - 1], 'optionalAccess', _174 => _174.value]) !== "/") return false;
3054
3192
  }
3055
3193
  return true;
3056
3194
  }
@@ -3062,9 +3200,9 @@ function hasDynamicJsxCardinality(content, localBindings) {
3062
3200
  const containsDynamicRenderer = (start, end) => containsClientJsx(tokens, start, end, clientBindings) || tokens.slice(start, end).some((token) => renderingHelpers.has(token.value));
3063
3201
  for (let index = 0; index < tokens.length; index++) {
3064
3202
  let callStart = -1;
3065
- if (tokens[index].value === "." && (_optionalChain([tokens, 'access', _171 => _171[index + 1], 'optionalAccess', _172 => _172.value]) === "map" || _optionalChain([tokens, 'access', _173 => _173[index + 1], 'optionalAccess', _174 => _174.value]) === "flatMap") && _optionalChain([tokens, 'access', _175 => _175[index + 2], 'optionalAccess', _176 => _176.value]) === "(") {
3203
+ if (tokens[index].value === "." && (_optionalChain([tokens, 'access', _175 => _175[index + 1], 'optionalAccess', _176 => _176.value]) === "map" || _optionalChain([tokens, 'access', _177 => _177[index + 1], 'optionalAccess', _178 => _178.value]) === "flatMap") && _optionalChain([tokens, 'access', _179 => _179[index + 2], 'optionalAccess', _180 => _180.value]) === "(") {
3066
3204
  callStart = index + 2;
3067
- } else if (tokens[index].value === "Array" && _optionalChain([tokens, 'access', _177 => _177[index + 1], 'optionalAccess', _178 => _178.value]) === "." && _optionalChain([tokens, 'access', _179 => _179[index + 2], 'optionalAccess', _180 => _180.value]) === "from" && _optionalChain([tokens, 'access', _181 => _181[index + 3], 'optionalAccess', _182 => _182.value]) === "(") {
3205
+ } else if (tokens[index].value === "Array" && _optionalChain([tokens, 'access', _181 => _181[index + 1], 'optionalAccess', _182 => _182.value]) === "." && _optionalChain([tokens, 'access', _183 => _183[index + 2], 'optionalAccess', _184 => _184.value]) === "from" && _optionalChain([tokens, 'access', _185 => _185[index + 3], 'optionalAccess', _186 => _186.value]) === "(") {
3068
3206
  callStart = index + 3;
3069
3207
  }
3070
3208
  if (callStart !== -1) {
@@ -3073,10 +3211,10 @@ function hasDynamicJsxCardinality(content, localBindings) {
3073
3211
  index = callEnd;
3074
3212
  continue;
3075
3213
  }
3076
- if ((tokens[index].value === "for" || tokens[index].value === "while") && _optionalChain([tokens, 'access', _183 => _183[index + 1], 'optionalAccess', _184 => _184.value]) === "(") {
3214
+ if ((tokens[index].value === "for" || tokens[index].value === "while") && _optionalChain([tokens, 'access', _187 => _187[index + 1], 'optionalAccess', _188 => _188.value]) === "(") {
3077
3215
  const conditionEnd = findMatchingToken(tokens, index + 1, "(", ")");
3078
3216
  const bodyStart = conditionEnd + 1;
3079
- const bodyEnd = _optionalChain([tokens, 'access', _185 => _185[bodyStart], 'optionalAccess', _186 => _186.value]) === "{" ? findMatchingToken(tokens, bodyStart, "{", "}") : tokens.findIndex((token, tokenIndex) => tokenIndex > bodyStart && token.value === ";");
3217
+ const bodyEnd = _optionalChain([tokens, 'access', _189 => _189[bodyStart], 'optionalAccess', _190 => _190.value]) === "{" ? findMatchingToken(tokens, bodyStart, "{", "}") : tokens.findIndex((token, tokenIndex) => tokenIndex > bodyStart && token.value === ";");
3080
3218
  if (containsDynamicRenderer(bodyStart, bodyEnd === -1 ? tokens.length : bodyEnd)) return true;
3081
3219
  }
3082
3220
  }
@@ -3188,7 +3326,7 @@ function collectIsolatedClientBoundaries(ownerPath, root, options = {}) {
3188
3326
  const localBindings = _nullishCoalesce(importedBindings.get(specifier), () => ( []));
3189
3327
  const staticUses = countStaticJsxUses(content, localBindings);
3190
3328
  if (staticUses > 0) {
3191
- const grows = options.packageReferences === true && projectRoot !== void 0 && (_nullishCoalesce(_optionalChain([findFarmIslandContainers, 'call', _187 => _187(_nullishCoalesce(content, () => ( "")), moduleSourcePath, localBindings), 'optionalAccess', _188 => _188.length]), () => ( 0))) > 0;
3329
+ const grows = options.packageReferences === true && projectRoot !== void 0 && (_nullishCoalesce(_optionalChain([findFarmIslandContainers, 'call', _191 => _191(_nullishCoalesce(content, () => ( "")), moduleSourcePath, localBindings), 'optionalAccess', _192 => _192.length]), () => ( 0))) > 0;
3192
3330
  if (grows) visit(ensureFarmIslandContainerReference(projectRoot));
3193
3331
  const container = grows ? void 0 : findParserSensitiveJsxContainer(content, localBindings);
3194
3332
  if (container) {
@@ -3284,7 +3422,7 @@ function farmWorkspaceServerEntry(entry) {
3284
3422
  function realpathOrSelf(file) {
3285
3423
  try {
3286
3424
  return _fs2.default.realpathSync(file);
3287
- } catch (e33) {
3425
+ } catch (e34) {
3288
3426
  return file;
3289
3427
  }
3290
3428
  }
@@ -3314,7 +3452,7 @@ function inspectPackageClientBoundary(resolvedPath, root, visited) {
3314
3452
  }
3315
3453
  function traversePackageClientBoundary(resolvedPath, root, visited, trace2) {
3316
3454
  if (!resolvedPath || visited.has(resolvedPath)) {
3317
- if (resolvedPath) _optionalChain([trace2, 'optionalAccess', _189 => _189.stop, 'call', _190 => _190(resolvedPath)]);
3455
+ if (resolvedPath) _optionalChain([trace2, 'optionalAccess', _193 => _193.stop, 'call', _194 => _194(resolvedPath)]);
3318
3456
  return {
3319
3457
  isClientComponent: false,
3320
3458
  shouldHydrate: false,
@@ -3322,7 +3460,7 @@ function traversePackageClientBoundary(resolvedPath, root, visited, trace2) {
3322
3460
  };
3323
3461
  }
3324
3462
  visited.add(resolvedPath);
3325
- _optionalChain([trace2, 'optionalAccess', _191 => _191.visit, 'call', _192 => _192(resolvedPath)]);
3463
+ _optionalChain([trace2, 'optionalAccess', _195 => _195.visit, 'call', _196 => _196(resolvedPath)]);
3326
3464
  const content = readIfExists(resolvedPath);
3327
3465
  const parsed = parseClientModuleMetadata(content, false);
3328
3466
  let importsClientBoundary = false;
@@ -3380,7 +3518,7 @@ function scanImportSpecifiers(content, { reexportsOnly = false, dynamic = false
3380
3518
  braceDepth = Math.max(0, braceDepth - 1);
3381
3519
  continue;
3382
3520
  }
3383
- if (dynamic && keyword.kind === "identifier" && keyword.value === "import" && _optionalChain([tokens, 'access', _193 => _193[index - 1], 'optionalAccess', _194 => _194.value]) !== "." && _optionalChain([tokens, 'access', _195 => _195[index + 1], 'optionalAccess', _196 => _196.value]) === "(" && _optionalChain([tokens, 'access', _197 => _197[index + 2], 'optionalAccess', _198 => _198.kind]) === "string") {
3521
+ if (dynamic && keyword.kind === "identifier" && keyword.value === "import" && _optionalChain([tokens, 'access', _197 => _197[index - 1], 'optionalAccess', _198 => _198.value]) !== "." && _optionalChain([tokens, 'access', _199 => _199[index + 1], 'optionalAccess', _200 => _200.value]) === "(" && _optionalChain([tokens, 'access', _201 => _201[index + 2], 'optionalAccess', _202 => _202.kind]) === "string") {
3384
3522
  matches.add(tokens[index + 2].value);
3385
3523
  continue;
3386
3524
  }
@@ -3390,7 +3528,7 @@ function scanImportSpecifiers(content, { reexportsOnly = false, dynamic = false
3390
3528
  }
3391
3529
  if (reexportsOnly && keyword.value !== "export") continue;
3392
3530
  const previous = tokens[index - 1];
3393
- if (_optionalChain([previous, 'optionalAccess', _199 => _199.value]) === ".") continue;
3531
+ if (_optionalChain([previous, 'optionalAccess', _203 => _203.value]) === ".") continue;
3394
3532
  const first = tokens[index + 1];
3395
3533
  if (!first || first.value === "type" || first.value === "(" || first.value === ".") {
3396
3534
  continue;
@@ -3406,7 +3544,7 @@ function scanImportSpecifiers(content, { reexportsOnly = false, dynamic = false
3406
3544
  for (let cursor = index + 1; cursor < tokens.length; cursor++) {
3407
3545
  const token = tokens[cursor];
3408
3546
  if (token.value === ";") break;
3409
- if (token.value === "from" && _optionalChain([tokens, 'access', _200 => _200[cursor + 1], 'optionalAccess', _201 => _201.kind]) === "string") {
3547
+ if (token.value === "from" && _optionalChain([tokens, 'access', _204 => _204[cursor + 1], 'optionalAccess', _205 => _205.kind]) === "string") {
3410
3548
  fromIndex = cursor;
3411
3549
  break;
3412
3550
  }
@@ -3424,14 +3562,14 @@ function scanImportSpecifiers(content, { reexportsOnly = false, dynamic = false
3424
3562
  return Array.from(matches);
3425
3563
  }
3426
3564
  function isTypeOnlyNamedClause(tokens, startIndex, endIndex) {
3427
- if (_optionalChain([tokens, 'access', _202 => _202[startIndex], 'optionalAccess', _203 => _203.value]) !== "{") return false;
3565
+ if (_optionalChain([tokens, 'access', _206 => _206[startIndex], 'optionalAccess', _207 => _207.value]) !== "{") return false;
3428
3566
  const closingBraceIndex = tokens.findIndex(
3429
3567
  (token, index) => index > startIndex && index < endIndex && token.value === "}"
3430
3568
  );
3431
3569
  if (closingBraceIndex === -1) return false;
3432
3570
  let entryStartsAt = startIndex + 1;
3433
3571
  for (let index = entryStartsAt; index <= closingBraceIndex; index++) {
3434
- if (index !== closingBraceIndex && _optionalChain([tokens, 'access', _204 => _204[index], 'optionalAccess', _205 => _205.value]) !== ",") continue;
3572
+ if (index !== closingBraceIndex && _optionalChain([tokens, 'access', _208 => _208[index], 'optionalAccess', _209 => _209.value]) !== ",") continue;
3435
3573
  const entry = tokens.slice(entryStartsAt, index);
3436
3574
  if (entry.length > 0 && entry[0].value !== "type") return false;
3437
3575
  entryStartsAt = index + 1;
@@ -3441,7 +3579,7 @@ function isTypeOnlyNamedClause(tokens, startIndex, endIndex) {
3441
3579
  function resolveImportedModule(importerPath, specifier, root) {
3442
3580
  const resolved = memoizeInFarmSourceSnapshot(
3443
3581
  "resolution",
3444
- `${_nullishCoalesce(root, () => ( ""))}\0${importerPath}\0${specifier}`,
3582
+ `${root ? farmSourceSnapshotPathKey(root) : ""}\0${farmSourceSnapshotPathKey(importerPath)}\0${specifier}`,
3445
3583
  () => resolveImportedModuleUncached(importerPath, specifier, root),
3446
3584
  // A file added later may resolve an import that does not resolve now.
3447
3585
  (result) => result.path !== null
@@ -3505,14 +3643,14 @@ function getProjectImportAliases(projectRoot) {
3505
3643
  const stamp = PROJECT_ALIAS_FILES.map((file) => {
3506
3644
  try {
3507
3645
  return String(_fs2.default.statSync(_path2.default.join(projectRoot, file)).mtimeMs);
3508
- } catch (e34) {
3646
+ } catch (e35) {
3509
3647
  return "-";
3510
3648
  }
3511
3649
  }).join(":");
3512
3650
  const sourceDir = _chunkRE5E2G5Scjs.getFarmProjectSourceDir.call(void 0, projectRoot);
3513
3651
  const cacheStamp = `${stamp}:${sourceDir}`;
3514
3652
  const cached = projectImportAliasCache.get(projectRoot);
3515
- if (_optionalChain([cached, 'optionalAccess', _206 => _206.stamp]) === cacheStamp) return cached.aliases;
3653
+ if (_optionalChain([cached, 'optionalAccess', _210 => _210.stamp]) === cacheStamp) return cached.aliases;
3516
3654
  const aliases = [
3517
3655
  ...readTsconfigPathAliases(projectRoot),
3518
3656
  ...readPackageImportAliases(projectRoot)
@@ -3533,8 +3671,8 @@ function readTsconfigPathAliases(projectRoot) {
3533
3671
  const configPath = _path2.default.join(projectRoot, name);
3534
3672
  if (!_fs2.default.existsSync(configPath)) continue;
3535
3673
  const resolved = readTsconfigPaths(configPath, /* @__PURE__ */ new Set());
3536
- if (!_optionalChain([resolved, 'optionalAccess', _207 => _207.paths])) return [];
3537
- const base = _nullishCoalesce(resolved.baseUrl, () => ( resolved.pathsDirectory));
3674
+ if (!_optionalChain([resolved, 'optionalAccess', _211 => _211.paths])) return [];
3675
+ const base2 = _nullishCoalesce(resolved.baseUrl, () => ( resolved.pathsDirectory));
3538
3676
  return Object.entries(resolved.paths).flatMap(([pattern, targets]) => {
3539
3677
  if (!Array.isArray(targets)) return [];
3540
3678
  const wildcardIndex = pattern.indexOf("*");
@@ -3543,7 +3681,7 @@ function readTsconfigPathAliases(projectRoot) {
3543
3681
  prefix: wildcardIndex === -1 ? pattern : pattern.slice(0, wildcardIndex),
3544
3682
  suffix: wildcardIndex === -1 ? "" : pattern.slice(wildcardIndex + 1),
3545
3683
  wildcard: wildcardIndex !== -1,
3546
- targets: targets.filter((target) => typeof target === "string").map((target) => _path2.default.resolve(base, target))
3684
+ targets: targets.filter((target) => typeof target === "string").map((target) => _path2.default.resolve(base2, target))
3547
3685
  }
3548
3686
  ];
3549
3687
  });
@@ -3568,18 +3706,18 @@ function readTsconfigPaths(configPath, visited) {
3568
3706
  inherited = _nullishCoalesce(readTsconfigPaths(parentPath, visited), () => ( inherited));
3569
3707
  }
3570
3708
  const options = _nullishCoalesce(config.compilerOptions, () => ( {}));
3571
- const baseUrl = typeof options.baseUrl === "string" ? _path2.default.resolve(directory, options.baseUrl) : _optionalChain([inherited, 'optionalAccess', _208 => _208.baseUrl]);
3709
+ const baseUrl = typeof options.baseUrl === "string" ? _path2.default.resolve(directory, options.baseUrl) : _optionalChain([inherited, 'optionalAccess', _212 => _212.baseUrl]);
3572
3710
  if (options.paths && typeof options.paths === "object") {
3573
3711
  return { paths: options.paths, pathsDirectory: directory, baseUrl };
3574
3712
  }
3575
3713
  return inherited ? { ...inherited, baseUrl } : { pathsDirectory: directory, baseUrl };
3576
3714
  }
3577
3715
  function readPackageImportAliases(projectRoot) {
3578
- const imports = _optionalChain([readPackageJson, 'call', _209 => _209(_path2.default.join(projectRoot, "package.json")), 'optionalAccess', _210 => _210.imports]);
3716
+ const imports = _optionalChain([readPackageJson, 'call', _213 => _213(_path2.default.join(projectRoot, "package.json")), 'optionalAccess', _214 => _214.imports]);
3579
3717
  if (!imports || typeof imports !== "object") return [];
3580
3718
  return Object.entries(imports).flatMap(([pattern, value]) => {
3581
3719
  const target = resolveConditionalExportTarget(value);
3582
- if (!pattern.startsWith("#") || !_optionalChain([target, 'optionalAccess', _211 => _211.startsWith, 'call', _212 => _212("./")])) return [];
3720
+ if (!pattern.startsWith("#") || !_optionalChain([target, 'optionalAccess', _215 => _215.startsWith, 'call', _216 => _216("./")])) return [];
3583
3721
  const wildcardIndex = pattern.indexOf("*");
3584
3722
  return [
3585
3723
  {
@@ -3595,7 +3733,7 @@ function readJsonWithComments(filePath) {
3595
3733
  let source;
3596
3734
  try {
3597
3735
  source = _fs2.default.readFileSync(filePath, "utf8");
3598
- } catch (e35) {
3736
+ } catch (e36) {
3599
3737
  return null;
3600
3738
  }
3601
3739
  let output = "";
@@ -3623,7 +3761,7 @@ function readJsonWithComments(filePath) {
3623
3761
  }
3624
3762
  try {
3625
3763
  return JSON.parse(output.replace(/,(\s*[}\]])/g, "$1"));
3626
- } catch (e36) {
3764
+ } catch (e37) {
3627
3765
  return null;
3628
3766
  }
3629
3767
  }
@@ -3645,15 +3783,15 @@ function resolvePackageModuleSourcePath(importerPath, specifier, root) {
3645
3783
  const packageJsonPath = _path2.default.join(packageDirectory, "package.json");
3646
3784
  const packageJson = readPackageJson(packageJsonPath);
3647
3785
  const exportKey = packageSubpath ? `./${packageSubpath}` : ".";
3648
- const exportTarget = resolvePackageExport(_optionalChain([packageJson, 'optionalAccess', _213 => _213.exports]), exportKey);
3786
+ const exportTarget = resolvePackageExport(_optionalChain([packageJson, 'optionalAccess', _217 => _217.exports]), exportKey);
3649
3787
  const candidates = /* @__PURE__ */ new Set();
3650
- if (_optionalChain([exportTarget, 'optionalAccess', _214 => _214.startsWith, 'call', _215 => _215("./")])) {
3788
+ if (_optionalChain([exportTarget, 'optionalAccess', _218 => _218.startsWith, 'call', _219 => _219("./")])) {
3651
3789
  candidates.add(_path2.default.resolve(packageDirectory, exportTarget));
3652
3790
  }
3653
3791
  if (packageSubpath) {
3654
3792
  candidates.add(_path2.default.join(packageDirectory, packageSubpath));
3655
3793
  } else {
3656
- for (const entry of [_optionalChain([packageJson, 'optionalAccess', _216 => _216.browser]), _optionalChain([packageJson, 'optionalAccess', _217 => _217.module]), _optionalChain([packageJson, 'optionalAccess', _218 => _218.main])]) {
3794
+ for (const entry of [_optionalChain([packageJson, 'optionalAccess', _220 => _220.browser]), _optionalChain([packageJson, 'optionalAccess', _221 => _221.module]), _optionalChain([packageJson, 'optionalAccess', _222 => _222.main])]) {
3657
3795
  if (typeof entry === "string") candidates.add(_path2.default.resolve(packageDirectory, entry));
3658
3796
  }
3659
3797
  candidates.add(_path2.default.join(packageDirectory, "index"));
@@ -3689,7 +3827,7 @@ function findPackageDirectory2(importerPath, packageName, root) {
3689
3827
  function readPackageJson(packageJsonPath) {
3690
3828
  try {
3691
3829
  return JSON.parse(_fs2.default.readFileSync(packageJsonPath, "utf8"));
3692
- } catch (e37) {
3830
+ } catch (e38) {
3693
3831
  return null;
3694
3832
  }
3695
3833
  }
@@ -3718,7 +3856,7 @@ function resolvePackageExport(exportsField, exportKey) {
3718
3856
  if (!exportKey.startsWith(prefix) || !exportKey.endsWith(suffix)) continue;
3719
3857
  const wildcard = exportKey.slice(prefix.length, exportKey.length - suffix.length);
3720
3858
  const target = resolveConditionalExportTarget(value);
3721
- return _nullishCoalesce(_optionalChain([target, 'optionalAccess', _219 => _219.replace, 'call', _220 => _220("*", wildcard)]), () => ( null));
3859
+ return _nullishCoalesce(_optionalChain([target, 'optionalAccess', _223 => _223.replace, 'call', _224 => _224("*", wildcard)]), () => ( null));
3722
3860
  }
3723
3861
  return null;
3724
3862
  }
@@ -3751,7 +3889,7 @@ function resolveSourceCandidate(candidates) {
3751
3889
  for (const sourcePath of paths) {
3752
3890
  try {
3753
3891
  if (_fs2.default.statSync(sourcePath).isFile()) return sourcePath;
3754
- } catch (e38) {
3892
+ } catch (e39) {
3755
3893
  }
3756
3894
  }
3757
3895
  }
@@ -3794,7 +3932,7 @@ function scanFarmPackageImports(directory, root) {
3794
3932
  let entries;
3795
3933
  try {
3796
3934
  entries = _fs2.default.readdirSync(current, { withFileTypes: true });
3797
- } catch (e39) {
3935
+ } catch (e40) {
3798
3936
  return;
3799
3937
  }
3800
3938
  for (const entry of entries) {
@@ -3827,7 +3965,7 @@ function collectFarmServerBundledPackageInfo(directory) {
3827
3965
  let entries;
3828
3966
  try {
3829
3967
  entries = _fs2.default.readdirSync(current, { withFileTypes: true });
3830
- } catch (e40) {
3968
+ } catch (e41) {
3831
3969
  return;
3832
3970
  }
3833
3971
  for (const entry of entries) {
@@ -3866,7 +4004,7 @@ function getFarmClientReachableModules(directory, root) {
3866
4004
  let entries;
3867
4005
  try {
3868
4006
  entries = _fs2.default.readdirSync(current, { withFileTypes: true });
3869
- } catch (e41) {
4007
+ } catch (e42) {
3870
4008
  return;
3871
4009
  }
3872
4010
  for (const entry of entries) {
@@ -3969,26 +4107,34 @@ function farmEnvironmentFunctionsPlugin(options = {}) {
3969
4107
  let projectRoot = process.cwd();
3970
4108
  let sources;
3971
4109
  const routeSourceFiles = () => {
3972
- const clientRoutes = _optionalChain([farmApi, 'optionalAccess', _221 => _221.getProgrammaticClientRoutes, 'call', _222 => _222()]);
3973
- if (_optionalChain([sources, 'optionalAccess', _223 => _223.for]) !== clientRoutes || !sources) {
4110
+ const clientRoutes = _optionalChain([farmApi, 'optionalAccess', _225 => _225.getProgrammaticClientRoutes, 'call', _226 => _226()]);
4111
+ if (_optionalChain([sources, 'optionalAccess', _227 => _227.for]) !== clientRoutes || !sources) {
3974
4112
  sources = {
3975
4113
  for: clientRoutes,
3976
4114
  files: /* @__PURE__ */ new Set([
3977
4115
  ...routesFiles,
3978
- ...[..._nullishCoalesce(_optionalChain([clientRoutes, 'optionalAccess', _224 => _224.routeSourceFiles]), () => ( []))].map(resolvedFile)
4116
+ ...[..._nullishCoalesce(_optionalChain([clientRoutes, 'optionalAccess', _228 => _228.routeSourceFiles]), () => ( []))].map(resolvedFile)
3979
4117
  ])
3980
4118
  };
3981
4119
  }
3982
4120
  return sources.files;
3983
4121
  };
3984
- const routeSourceError = (file, importers = []) => `[Farm.js] ${file} defines programmatic routes, but the browser bundle imports it` + (importers.length > 0 ? ` (from ${importers.join(", ")})` : "") + ". Routes files and the modules that define routes carry server-only guards, data hooks, and API handlers, so they never reach the browser. Import the component, server function, or helper from its own module instead.";
4122
+ const relativeFile = (file) => _path2.default.isAbsolute(file) ? _path2.default.relative(projectRoot, file).replace(/\\/g, "/") || file : file;
4123
+ const routeSourceError = (file, importers = []) => formatFarmDiagnostic(
4124
+ createFarmDiagnostic(
4125
+ "CLIENT_ROUTES_FILE",
4126
+ file,
4127
+ "This module defines programmatic routes, but the browser bundle imports it" + (importers.length > 0 ? ` (from ${importers.map(relativeFile).join(", ")})` : "") + ". Routes files and the modules that define routes carry server-only guards, data hooks, and API handlers, so they never reach the browser."
4128
+ ),
4129
+ projectRoot
4130
+ );
3985
4131
  return {
3986
4132
  name: "farm:environment-functions",
3987
4133
  enforce: "post",
3988
4134
  configResolved(config) {
3989
4135
  isBuild = config.command === "build";
3990
4136
  projectRoot = config.root;
3991
- farmApi = _optionalChain([config, 'access', _225 => _225.plugins, 'access', _226 => _226.find, 'call', _227 => _227((plugin) => plugin.name === "farm"), 'optionalAccess', _228 => _228.api]);
4137
+ farmApi = _optionalChain([config, 'access', _229 => _229.plugins, 'access', _230 => _230.find, 'call', _231 => _231((plugin) => plugin.name === "farm"), 'optionalAccess', _232 => _232.api]);
3992
4138
  sources = void 0;
3993
4139
  routesFiles = new Set(
3994
4140
  _chunkMTBDJ326cjs.getFarmSourceRoots.call(void 0, { ...options, root: _nullishCoalesce(options.root, () => ( config.root)) }).flatMap(
@@ -4001,22 +4147,35 @@ function farmEnvironmentFunctionsPlugin(options = {}) {
4001
4147
  transform(code, id, transformOptions) {
4002
4148
  const environment = resolveBuildEnvironment(
4003
4149
  this,
4004
- _optionalChain([transformOptions, 'optionalAccess', _229 => _229.ssr])
4150
+ _optionalChain([transformOptions, 'optionalAccess', _233 => _233.ssr])
4005
4151
  );
4006
4152
  const parse3 = (source) => this.parse(source);
4007
4153
  const result = transformEnvironmentFunctions({ code, id, environment, parse: parse3 });
4008
4154
  if (environment === "client" && !isBuild && !_chunkE7QOEV5Zcjs.parseProgrammaticRouteModuleId.call(void 0, id) && routeSourceFiles().has(moduleFile(id)) && !isProgrammaticRouteActionProxy(code)) {
4009
4155
  this.error(routeSourceError(moduleFile(id)));
4010
4156
  }
4011
- if (environment === "server" && _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([options, 'access', _230 => _230.experimental, 'optionalAccess', _231 => _231.serverComponents])) === "islands" && isApplicationScript(id)) {
4157
+ if (environment === "server" && _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([options, 'access', _234 => _234.experimental, 'optionalAccess', _235 => _235.serverComponents])) === "islands" && isApplicationScript(id)) {
4012
4158
  const file = id.split("?", 1)[0];
4013
4159
  const root = _fs.realpathSync.call(void 0, _nullishCoalesce(options.root, () => ( projectRoot)));
4014
4160
  const clientCode = getFarmClientReachableModules(root, root).has(_path2.default.resolve(file)) || _fs.existsSync.call(void 0, file) && hasUseClientDirective(_fs.readFileSync.call(void 0, file, "utf8"));
4015
4161
  const reached = clientCode ? null : findFarmClientOnlyImport(code, file);
4016
4162
  if (reached) {
4017
- const chain = reached.chain.map((step) => _path2.default.relative(root, step)).join(" -> ");
4163
+ const chain = reached.chain.map((step) => _path2.default.relative(root, step).replace(/\\/g, "/")).join(" -> ");
4164
+ const importMatch = new RegExp(
4165
+ String.raw`\b(?:from|import)\s*["']` + reached.specifier.replace(/[.*+?^${}()|[\]\\]/g, "\\$&") + `["']`
4166
+ ).exec(code);
4167
+ const importAt = importMatch ? importMatch.index + importMatch[0].search(/["']/) : void 0;
4168
+ const locate = createFarmSourceLocator(code, () => this.getCombinedSourcemap());
4018
4169
  this.error(
4019
- `[Farm.js] ${_path2.default.relative(root, file)} is server code, but its import of "${reached.specifier}" reaches "client-only" (${chain}), so that package can only run in the browser. Add "use client" to this module, or import the package from a "use client" module.`
4170
+ formatFarmDiagnostic(
4171
+ createFarmDiagnostic(
4172
+ "SERVER_CLIENT_ONLY_IMPORT",
4173
+ file,
4174
+ `This module is server code, but its import of "${reached.specifier}" reaches "client-only" (${chain}), so that package can only run in the browser.`,
4175
+ importAt === void 0 ? void 0 : locate(importAt)
4176
+ ),
4177
+ root
4178
+ )
4020
4179
  );
4021
4180
  }
4022
4181
  }
@@ -4029,19 +4188,26 @@ function farmEnvironmentFunctionsPlugin(options = {}) {
4029
4188
  for (const id of this.getModuleIds()) {
4030
4189
  if (_chunkE7QOEV5Zcjs.parseProgrammaticRouteModuleId.call(void 0, id)) {
4031
4190
  const chain = findClientNodeBuiltinChain(id, (moduleId) => {
4032
- return _optionalChain([this, 'access', _232 => _232.getModuleInfo, 'call', _233 => _233(moduleId), 'optionalAccess', _234 => _234.importedIds]);
4191
+ return _optionalChain([this, 'access', _236 => _236.getModuleInfo, 'call', _237 => _237(moduleId), 'optionalAccess', _238 => _238.importedIds]);
4033
4192
  });
4034
4193
  if (chain) {
4035
4194
  this.error(
4036
- `[Farm.js] The browser bundle reaches the server-only module "${chain.at(-1)}" through the programmatic route module ${moduleFile(id)}: ${chain.map(moduleFile).join(" -> ")}. Keep server-only imports in the routes file or in modules only its guard, data, and API handlers use.`
4195
+ formatFarmDiagnostic(
4196
+ createFarmDiagnostic(
4197
+ "CLIENT_ROUTE_SERVER_IMPORT",
4198
+ moduleFile(id),
4199
+ `The browser bundle reaches the server-only module "${chain.at(-1)}" through this programmatic route module: ${chain.map((step) => relativeFile(moduleFile(step))).join(" -> ")}.`
4200
+ ),
4201
+ projectRoot
4202
+ )
4037
4203
  );
4038
4204
  }
4039
4205
  continue;
4040
4206
  }
4041
4207
  if (!forbidden.has(moduleFile(id))) continue;
4042
4208
  const info = this.getModuleInfo(id);
4043
- if (isProgrammaticRouteActionProxy(_optionalChain([info, 'optionalAccess', _235 => _235.code]))) continue;
4044
- this.error(routeSourceError(moduleFile(id), _optionalChain([info, 'optionalAccess', _236 => _236.importers, 'access', _237 => _237.map, 'call', _238 => _238(moduleFile)])));
4209
+ if (isProgrammaticRouteActionProxy(_optionalChain([info, 'optionalAccess', _239 => _239.code]))) continue;
4210
+ this.error(routeSourceError(moduleFile(id), _optionalChain([info, 'optionalAccess', _240 => _240.importers, 'access', _241 => _241.map, 'call', _242 => _242(moduleFile)])));
4045
4211
  }
4046
4212
  }
4047
4213
  };
@@ -4055,13 +4221,13 @@ function moduleFile(id) {
4055
4221
  function resolvedFile(filePath) {
4056
4222
  try {
4057
4223
  return moduleFile(_fs.realpathSync.call(void 0, filePath));
4058
- } catch (e42) {
4224
+ } catch (e43) {
4059
4225
  return moduleFile(filePath);
4060
4226
  }
4061
4227
  }
4062
4228
  function resolveBuildEnvironment(context, ssr) {
4063
- if (_optionalChain([context, 'access', _239 => _239.environment, 'optionalAccess', _240 => _240.name]) === "client") return "client";
4064
- if (_optionalChain([context, 'access', _241 => _241.environment, 'optionalAccess', _242 => _242.name]) === "rsc" || _optionalChain([context, 'access', _243 => _243.environment, 'optionalAccess', _244 => _244.name]) === "ssr") {
4229
+ if (_optionalChain([context, 'access', _243 => _243.environment, 'optionalAccess', _244 => _244.name]) === "client") return "client";
4230
+ if (_optionalChain([context, 'access', _245 => _245.environment, 'optionalAccess', _246 => _246.name]) === "rsc" || _optionalChain([context, 'access', _247 => _247.environment, 'optionalAccess', _248 => _248.name]) === "ssr") {
4065
4231
  return "server";
4066
4232
  }
4067
4233
  return ssr ? "server" : "client";
@@ -4375,4 +4541,10 @@ function transformError(id, message) {
4375
4541
 
4376
4542
 
4377
4543
 
4378
- exports.FARM_BROWSER_BUILTIN_PREFIX = FARM_BROWSER_BUILTIN_PREFIX; exports.resolveFarmBrowserBuiltin = resolveFarmBrowserBuiltin; exports.loadFarmBrowserBuiltin = loadFarmBrowserBuiltin; exports.farmBrowserBuiltinsOptimizerPlugin = farmBrowserBuiltinsOptimizerPlugin; exports.programmaticClientRouteKey = programmaticClientRouteKey; exports.resolveProgrammaticClientRoutes = resolveProgrammaticClientRoutes; exports.createEvaluatedRouteGraph = createEvaluatedRouteGraph; exports.mergeProgrammaticClientRoutes = mergeProgrammaticClientRoutes; exports.generateProgrammaticClientRouteModule = generateProgrammaticClientRouteModule; exports.FarmSourceSnapshotStore = FarmSourceSnapshotStore; exports.withFarmSourceSnapshot = withFarmSourceSnapshot; exports.traceFarmSourceReads = traceFarmSourceReads; exports.rewriteFarmReactServerClientModuleImports = rewriteFarmReactServerClientModuleImports; exports.rewriteFarmReactServerImports = rewriteFarmReactServerImports; exports.invalidateFarmClientOnlyScan = invalidateFarmClientOnlyScan; exports.farmRelativeImportFiles = farmRelativeImportFiles; exports.FARM_CLIENT_REFERENCE_PRAGMA = FARM_CLIENT_REFERENCE_PRAGMA; exports.FARM_CLIENT_REFERENCE_DIRECTORY = FARM_CLIENT_REFERENCE_DIRECTORY; exports.FARM_RESOLVE_FROM_PREFIX = FARM_RESOLVE_FROM_PREFIX; exports.parseFarmResolveFrom = parseFarmResolveFrom; exports.ensureFarmPackageClientReference = ensureFarmPackageClientReference; exports.ensureFarmInternalClientReference = ensureFarmInternalClientReference; exports.rewriteFarmPackageClientImports = rewriteFarmPackageClientImports; exports.farmIslandContainerReferencePath = farmIslandContainerReferencePath; exports.ensureFarmIslandContainerReference = ensureFarmIslandContainerReference; exports.wrapFarmIslandContainers = wrapFarmIslandContainers; exports.withPackageClientBoundaryCache = withPackageClientBoundaryCache; exports.usePackageClientBoundaryCacheFile = usePackageClientBoundaryCacheFile; exports.resolvePackageClientBoundaryCacheFile = resolvePackageClientBoundaryCacheFile; exports.runWithPackageClientBoundaryCacheFile = runWithPackageClientBoundaryCacheFile; exports.runWithLatestPackageClientBoundaryCache = runWithLatestPackageClientBoundaryCache; exports.dropLatestPackageClientBoundaryCache = dropLatestPackageClientBoundaryCache; exports.resolveModuleSourcePath = resolveModuleSourcePath; exports.getFarmClientHydrationPlanOptions = getFarmClientHydrationPlanOptions; exports.describeSuppressedAsyncHydration = describeSuppressedAsyncHydration; exports.resolveFarmIsolatedClientHydrationMode = resolveFarmIsolatedClientHydrationMode; exports.hasUseClientDirective = hasUseClientDirective; exports.getIslandStrategyExport = getIslandStrategyExport; exports.stripUseClientDirective = stripUseClientDirective; exports.getFarmClientRenderingBindings = getFarmClientRenderingBindings; exports.collectFarmRenderedClientModules = collectFarmRenderedClientModules; exports.collectFarmServerStylesheets = collectFarmServerStylesheets; exports.getClientModuleMetadata = getClientModuleMetadata; exports.getClientModuleHydrationPlan = getClientModuleHydrationPlan; exports.usesFarmServerTree = usesFarmServerTree; exports.createMarkdownPageHydrationPlanner = createMarkdownPageHydrationPlanner; exports.enforceFarmIsolatedHydrationRouteBudget = enforceFarmIsolatedHydrationRouteBudget; exports.isIsolatableClientBoundarySource = isIsolatableClientBoundarySource; exports.isFarmClientModulePlanUnchanged = isFarmClientModulePlanUnchanged; exports.resolveImportedModule = resolveImportedModule; exports.isFarmPackageClientBoundary = isFarmPackageClientBoundary; exports.collectFarmClientPackageImports = collectFarmClientPackageImports; exports.collectFarmServerBundledPackageInfo = collectFarmServerBundledPackageInfo; exports.invalidateFarmClientReachableModules = invalidateFarmClientReachableModules; exports.getFarmClientReachableModules = getFarmClientReachableModules; exports.resolveFarmClientOptimizeDeps = resolveFarmClientOptimizeDeps; exports.transformEnvironmentFunctions = transformEnvironmentFunctions; exports.farmEnvironmentFunctionsPlugin = farmEnvironmentFunctionsPlugin;
4544
+
4545
+
4546
+
4547
+
4548
+
4549
+
4550
+ exports.FARM_BROWSER_BUILTIN_PREFIX = FARM_BROWSER_BUILTIN_PREFIX; exports.resolveFarmBrowserBuiltin = resolveFarmBrowserBuiltin; exports.loadFarmBrowserBuiltin = loadFarmBrowserBuiltin; exports.farmBrowserBuiltinsOptimizerPlugin = farmBrowserBuiltinsOptimizerPlugin; exports.programmaticClientRouteKey = programmaticClientRouteKey; exports.resolveProgrammaticClientRoutes = resolveProgrammaticClientRoutes; exports.createEvaluatedRouteGraph = createEvaluatedRouteGraph; exports.mergeProgrammaticClientRoutes = mergeProgrammaticClientRoutes; exports.generateProgrammaticClientRouteModule = generateProgrammaticClientRouteModule; exports.getFarmSourceStamp = getFarmSourceStamp; exports.FarmSourceSnapshotStore = FarmSourceSnapshotStore; exports.withFarmSourceSnapshot = withFarmSourceSnapshot; exports.withFarmSourceSnapshotOf = withFarmSourceSnapshotOf; exports.traceFarmSourceReads = traceFarmSourceReads; exports.rewriteFarmReactServerClientModuleImports = rewriteFarmReactServerClientModuleImports; exports.rewriteFarmReactServerImports = rewriteFarmReactServerImports; exports.invalidateFarmClientOnlyScan = invalidateFarmClientOnlyScan; exports.farmRelativeImportFiles = farmRelativeImportFiles; exports.FARM_CLIENT_REFERENCE_PRAGMA = FARM_CLIENT_REFERENCE_PRAGMA; exports.FARM_CLIENT_REFERENCE_DIRECTORY = FARM_CLIENT_REFERENCE_DIRECTORY; exports.FARM_RESOLVE_FROM_PREFIX = FARM_RESOLVE_FROM_PREFIX; exports.parseFarmResolveFrom = parseFarmResolveFrom; exports.ensureFarmPackageClientReference = ensureFarmPackageClientReference; exports.ensureFarmInternalClientReference = ensureFarmInternalClientReference; exports.rewriteFarmPackageClientImports = rewriteFarmPackageClientImports; exports.farmIslandContainerReferencePath = farmIslandContainerReferencePath; exports.ensureFarmIslandContainerReference = ensureFarmIslandContainerReference; exports.wrapFarmIslandContainers = wrapFarmIslandContainers; exports.withPackageClientBoundaryCache = withPackageClientBoundaryCache; exports.usePackageClientBoundaryCacheFile = usePackageClientBoundaryCacheFile; exports.resolvePackageClientBoundaryCacheFile = resolvePackageClientBoundaryCacheFile; exports.runWithPackageClientBoundaryCacheFile = runWithPackageClientBoundaryCacheFile; exports.runWithLatestPackageClientBoundaryCache = runWithLatestPackageClientBoundaryCache; exports.dropLatestPackageClientBoundaryCache = dropLatestPackageClientBoundaryCache; exports.resolveModuleSourcePath = resolveModuleSourcePath; exports.getFarmClientHydrationPlanOptions = getFarmClientHydrationPlanOptions; exports.describeSuppressedAsyncHydration = describeSuppressedAsyncHydration; exports.resolveFarmIsolatedClientHydrationMode = resolveFarmIsolatedClientHydrationMode; exports.hasUseClientDirective = hasUseClientDirective; exports.getIslandStrategyExport = getIslandStrategyExport; exports.stripUseClientDirective = stripUseClientDirective; exports.getFarmClientRenderingBindings = getFarmClientRenderingBindings; exports.collectFarmRenderedClientModules = collectFarmRenderedClientModules; exports.collectFarmServerStylesheets = collectFarmServerStylesheets; exports.getClientModuleMetadata = getClientModuleMetadata; exports.getClientModuleHydrationPlanKey = getClientModuleHydrationPlanKey; exports.getClientModuleHydrationPlan = getClientModuleHydrationPlan; exports.usesFarmServerTree = usesFarmServerTree; exports.createMarkdownPageHydrationPlanner = createMarkdownPageHydrationPlanner; exports.enforceFarmIsolatedHydrationRouteBudget = enforceFarmIsolatedHydrationRouteBudget; exports.isIsolatableClientBoundarySource = isIsolatableClientBoundarySource; exports.isFarmClientModulePlanUnchanged = isFarmClientModulePlanUnchanged; exports.resolveImportedModule = resolveImportedModule; exports.isFarmPackageClientBoundary = isFarmPackageClientBoundary; exports.collectFarmClientPackageImports = collectFarmClientPackageImports; exports.collectFarmServerBundledPackageInfo = collectFarmServerBundledPackageInfo; exports.invalidateFarmClientReachableModules = invalidateFarmClientReachableModules; exports.getFarmClientReachableModules = getFarmClientReachableModules; exports.resolveFarmClientOptimizeDeps = resolveFarmClientOptimizeDeps; exports.createFarmDiagnostic = createFarmDiagnostic; exports.formatFarmDiagnostic = formatFarmDiagnostic; exports.createFarmSourceLocator = createFarmSourceLocator; exports.transformEnvironmentFunctions = transformEnvironmentFunctions; exports.farmEnvironmentFunctionsPlugin = farmEnvironmentFunctionsPlugin;