@farm.js/core 0.1.65 → 0.1.67

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 (439) hide show
  1. package/dist/{agent-mcp-handler-QLFDDTYN.mjs → agent-mcp-handler-AZ7QW4UP.mjs} +5 -5
  2. package/dist/{agent-mcp-handler-OXT73ZBY.cjs → agent-mcp-handler-FER4MQDF.cjs} +6 -6
  3. package/dist/{agent-mcp.d-QD2WZ9BS.d.ts → agent-mcp.d-BFu9xHAi.d.ts} +1 -1
  4. package/dist/{agent-mcp.d-CO_ABmNK.d.mts → agent-mcp.d-DWyWkTSy.d.mts} +1 -1
  5. package/dist/agent-runtime.cjs +6 -5
  6. package/dist/agent-runtime.d.mts +6 -6
  7. package/dist/agent-runtime.d.ts +6 -6
  8. package/dist/agent-runtime.mjs +5 -4
  9. package/dist/analyzer-KVZGVY5Q.cjs +16 -0
  10. package/dist/{analyzer-PE33SK5W.mjs → analyzer-TTIIXXMQ.mjs} +3 -3
  11. package/dist/api/client.cjs +12 -2
  12. package/dist/api/client.d.mts +4 -4
  13. package/dist/api/client.d.ts +4 -4
  14. package/dist/api/client.mjs +12 -2
  15. package/dist/api/client.native.cjs +12 -2
  16. package/dist/api/client.native.d.mts +5 -5
  17. package/dist/api/client.native.d.ts +5 -5
  18. package/dist/api/client.native.mjs +12 -2
  19. package/dist/api/node.cjs +223 -0
  20. package/dist/api/node.d.mts +59 -0
  21. package/dist/api/node.d.ts +59 -0
  22. package/dist/api/node.mjs +223 -0
  23. package/dist/api/route-manager.cjs +11 -11
  24. package/dist/api/route-manager.d.mts +10 -9
  25. package/dist/api/route-manager.d.ts +10 -9
  26. package/dist/api/route-manager.mjs +10 -10
  27. package/dist/api/runtime.cjs +11 -7
  28. package/dist/api/runtime.d.mts +7 -7
  29. package/dist/api/runtime.d.ts +7 -7
  30. package/dist/api/runtime.mjs +10 -6
  31. package/dist/{api-client.d-BNLXNCXJ.d.mts → api-client.d-Bp35zMqR.d.mts} +1 -1
  32. package/dist/{api-client.d-ddQBNGtu.d.ts → api-client.d-CFI_xL0V.d.ts} +1 -1
  33. package/dist/api.cjs +17 -13
  34. package/dist/api.d.mts +11 -10
  35. package/dist/api.d.ts +11 -10
  36. package/dist/api.mjs +16 -12
  37. package/dist/{app-manifest.d-BpKxiU_E.d.mts → app-manifest.d-CRmjN5j9.d.mts} +1 -1
  38. package/dist/{app-manifest.d-DDmNkYQQ.d.ts → app-manifest.d-CwfhGrVR.d.ts} +1 -1
  39. package/dist/app-markdown.cjs +5 -5
  40. package/dist/app-markdown.d.mts +7 -7
  41. package/dist/app-markdown.d.ts +7 -7
  42. package/dist/app-markdown.mjs +4 -4
  43. package/dist/{app.d-x68Cwr0_.d.ts → app.d-BX9LVTiP.d.ts} +50 -9
  44. package/dist/{app.d-kuoVWhWM.d.mts → app.d-uBBUxwyV.d.mts} +50 -9
  45. package/dist/{chunk-V56632LA.cjs → chunk-22IWL4YD.cjs} +19 -5
  46. package/dist/{chunk-CZF4XIRZ.cjs → chunk-23PVOIPT.cjs} +3 -3
  47. package/dist/{chunk-5C7XMKQ4.cjs → chunk-2AFW7673.cjs} +6 -1
  48. package/dist/{chunk-SYW346ZN.cjs → chunk-2LHZD3OP.cjs} +1 -21
  49. package/dist/{chunk-ZZI56IUY.mjs → chunk-2ZOYOYEE.mjs} +13 -13
  50. package/dist/{chunk-RVGSVQWT.mjs → chunk-3T5TLFCQ.mjs} +10 -5
  51. package/dist/{chunk-XBSKPLHF.cjs → chunk-3T7ALZJF.cjs} +2 -2
  52. package/dist/{chunk-JCEFKP5M.mjs → chunk-423SSBYQ.mjs} +6 -0
  53. package/dist/{chunk-7QVRWGBL.cjs → chunk-4DRINDGN.cjs} +319 -138
  54. package/dist/{chunk-O6L3YYPM.cjs → chunk-4E57QHPW.cjs} +8 -16
  55. package/dist/{chunk-WKPBIT5Q.cjs → chunk-4HGLJOXZ.cjs} +6 -6
  56. package/dist/{chunk-JGAE5XPL.cjs → chunk-4JX3M4C6.cjs} +2 -1
  57. package/dist/{chunk-CJNAUEVC.mjs → chunk-4QENVMG7.mjs} +1 -1
  58. package/dist/{chunk-IMK32ERL.cjs → chunk-556H7JCE.cjs} +65 -48
  59. package/dist/{chunk-OLIGNTWU.cjs → chunk-5NFQ6AZI.cjs} +7 -7
  60. package/dist/{chunk-6HRAK7I5.mjs → chunk-5OFNUETM.mjs} +8 -2
  61. package/dist/{chunk-TZVUF5JJ.mjs → chunk-5TA63JD3.mjs} +4 -4
  62. package/dist/{chunk-RD623KW4.cjs → chunk-67MZTLTF.cjs} +21 -3
  63. package/dist/chunk-6I4BFRE7.cjs +51 -0
  64. package/dist/{chunk-OSFIUSYK.cjs → chunk-6R53ZWX2.cjs} +7 -7
  65. package/dist/{chunk-MGKW5XZE.cjs → chunk-6SQZXRJ2.cjs} +7 -7
  66. package/dist/{chunk-WNXVWXG3.cjs → chunk-6V5YWI4W.cjs} +2 -2
  67. package/dist/{chunk-BM2LH2JM.mjs → chunk-6YBYX4K4.mjs} +13 -12
  68. package/dist/{chunk-X3XUZWRB.mjs → chunk-724MGMIL.mjs} +17 -3
  69. package/dist/{chunk-K5EW7GUU.mjs → chunk-7BIW7VCW.mjs} +13 -5
  70. package/dist/{chunk-HPP2II4Z.mjs → chunk-7PJARAQQ.mjs} +1 -1
  71. package/dist/{chunk-LEJDW34D.cjs → chunk-7PPLTD3P.cjs} +3 -3
  72. package/dist/{chunk-TGULJSHD.mjs → chunk-AJNBTOVQ.mjs} +20 -9
  73. package/dist/{chunk-FBEBSAVI.cjs → chunk-AKIQ54FK.cjs} +82 -63
  74. package/dist/{chunk-2NGZFOKG.mjs → chunk-AOIUYHPH.mjs} +2 -2
  75. package/dist/{chunk-ZEXE4TGY.mjs → chunk-AQDLVHNF.mjs} +230 -110
  76. package/dist/{chunk-NKRZLQUK.mjs → chunk-AQIO3RNL.mjs} +1 -1
  77. package/dist/chunk-AQIRXBBY.cjs +26 -0
  78. package/dist/chunk-AZ6IW6SF.mjs +28 -0
  79. package/dist/{chunk-QMDU6QHN.mjs → chunk-B6RBJJ5G.mjs} +1 -1
  80. package/dist/{chunk-I32V5CZL.cjs → chunk-BDYM2TN3.cjs} +28 -17
  81. package/dist/{chunk-JLDNXURZ.cjs → chunk-BZWTBELF.cjs} +32 -32
  82. package/dist/{chunk-ITV4QQL2.cjs → chunk-C6CUUBY5.cjs} +14 -3
  83. package/dist/{chunk-V727H3RI.cjs → chunk-CCAUIBIS.cjs} +6 -0
  84. package/dist/{chunk-YN6BHOYY.cjs → chunk-CL52PD6D.cjs} +10 -3
  85. package/dist/{chunk-ZX2JHEWW.mjs → chunk-CO3YMZFD.mjs} +20 -9
  86. package/dist/{chunk-XURDCXNH.cjs → chunk-CSLHNBPS.cjs} +6 -6
  87. package/dist/{chunk-CNNBFGL5.cjs → chunk-DB2HSHQA.cjs} +14 -14
  88. package/dist/{chunk-XQSYOVCW.cjs → chunk-DBYNZIIQ.cjs} +13 -5
  89. package/dist/{chunk-32RPJAAS.cjs → chunk-DCXSIEFE.cjs} +40 -41
  90. package/dist/{chunk-D4MRNBVF.cjs → chunk-DGOFR7D5.cjs} +2 -2
  91. package/dist/{chunk-QTD6EMN2.mjs → chunk-DQ2DI3Y7.mjs} +11 -4
  92. package/dist/chunk-DXZ57EPE.mjs +375 -0
  93. package/dist/{chunk-SA7MLSP4.mjs → chunk-E3HDJCWF.mjs} +3 -3
  94. package/dist/{chunk-EFZGB7JC.cjs → chunk-E5UN4OWX.cjs} +1 -0
  95. package/dist/{chunk-HKNYNSOK.mjs → chunk-E6CD45JK.mjs} +30 -31
  96. package/dist/{chunk-752XUZIM.cjs → chunk-EGIY4A7V.cjs} +6 -6
  97. package/dist/chunk-EIVGPQN5.mjs +51 -0
  98. package/dist/{chunk-KPAJWD3N.mjs → chunk-EYPSKXO4.mjs} +1 -1
  99. package/dist/{chunk-E552H232.cjs → chunk-F43OG25P.cjs} +1 -1
  100. package/dist/{chunk-UAQD67HM.mjs → chunk-F7JKVHU2.mjs} +1 -1
  101. package/dist/{chunk-QISW423S.cjs → chunk-FPBOAG6N.cjs} +2 -2
  102. package/dist/{chunk-2C5L5RPM.cjs → chunk-FT6KJHS3.cjs} +71 -38
  103. package/dist/{chunk-ES2LD2YD.mjs → chunk-GCRT6GJG.mjs} +18 -0
  104. package/dist/{chunk-5OJVKXFV.cjs → chunk-GDM3ZD2O.cjs} +10 -8
  105. package/dist/{chunk-EMDGXYUD.mjs → chunk-GJ7QVFAG.mjs} +16 -7
  106. package/dist/{chunk-TGSEVBPO.mjs → chunk-GJEC5S4V.mjs} +11 -0
  107. package/dist/{chunk-ZAUOOGER.mjs → chunk-GTV2ABO7.mjs} +218 -37
  108. package/dist/{chunk-72JSHQQQ.mjs → chunk-H37MDCPR.mjs} +1 -1
  109. package/dist/{chunk-HNAISJFD.cjs → chunk-HDPT6OYE.cjs} +9 -3
  110. package/dist/{chunk-25T5VXOE.mjs → chunk-HFHJJXSV.mjs} +106 -19
  111. package/dist/{chunk-ZNH6NR3H.cjs → chunk-HJZZSBVK.cjs} +2 -2
  112. package/dist/{chunk-A3G5IY2W.cjs → chunk-HM7AGSKU.cjs} +1 -1
  113. package/dist/{chunk-GL7N5UHF.cjs → chunk-HNVAZGQD.cjs} +20 -9
  114. package/dist/{chunk-GRBJ7VKH.mjs → chunk-HP2DQGQH.mjs} +1 -1
  115. package/dist/{chunk-E2TSYUHV.mjs → chunk-HRPTMX5C.mjs} +4 -4
  116. package/dist/{chunk-K7OZAVOI.mjs → chunk-IFR74W6S.mjs} +46 -13
  117. package/dist/{chunk-5A77OEIG.cjs → chunk-IHTDLCDJ.cjs} +5 -5
  118. package/dist/{chunk-VQJHT2ND.mjs → chunk-IRA2CZAY.mjs} +2 -2
  119. package/dist/{chunk-OYZXVBZP.cjs → chunk-IUKBPBM7.cjs} +2 -1
  120. package/dist/chunk-J6TZRYCO.cjs +22 -0
  121. package/dist/{chunk-WYAXRIYP.cjs → chunk-J7JHVCWA.cjs} +8 -8
  122. package/dist/chunk-JSOCDYER.cjs +375 -0
  123. package/dist/{chunk-YUW7F6SK.mjs → chunk-JVM3DKZE.mjs} +3 -3
  124. package/dist/{chunk-UPYIFH2H.cjs → chunk-JWLRBDDC.cjs} +2 -2
  125. package/dist/{chunk-BQWBHWEW.mjs → chunk-JWSI5WO4.mjs} +1 -1
  126. package/dist/{chunk-OLGQZRW6.mjs → chunk-JZBU7V4D.mjs} +37 -17
  127. package/dist/{chunk-ONG4RDW3.mjs → chunk-JZGL2PIH.mjs} +13 -3
  128. package/dist/chunk-K63OWRY2.mjs +22 -0
  129. package/dist/{chunk-TUPKMMXT.mjs → chunk-K6HIIWUB.mjs} +1 -1
  130. package/dist/{chunk-MESQF2JC.mjs → chunk-K6SXMVXO.mjs} +2 -2
  131. package/dist/{chunk-L2JG337G.cjs → chunk-K6VFYFOY.cjs} +33 -31
  132. package/dist/{chunk-3CCAICF7.cjs → chunk-KCY52OUQ.cjs} +4 -4
  133. package/dist/{chunk-EZ34EHQP.mjs → chunk-KI3MU7B5.mjs} +1 -1
  134. package/dist/{chunk-GHNW564E.mjs → chunk-KSZK34HU.mjs} +30 -10
  135. package/dist/{chunk-RFKTJTWZ.mjs → chunk-KWFNUODD.mjs} +2 -1
  136. package/dist/{chunk-ECKQFEX2.mjs → chunk-LENKRGBV.mjs} +8 -6
  137. package/dist/{chunk-C7DCMGC4.cjs → chunk-LPIZMU7D.cjs} +12 -12
  138. package/dist/{chunk-HEPJIKKQ.cjs → chunk-MCSRMEQV.cjs} +2 -2
  139. package/dist/{chunk-DQF3QLOH.mjs → chunk-ME7RVELR.mjs} +3 -2
  140. package/dist/{chunk-3KJPIO5D.cjs → chunk-N5DQMOAG.cjs} +589 -678
  141. package/dist/{chunk-O4F3JUST.mjs → chunk-NDDRTFN4.mjs} +4 -0
  142. package/dist/{chunk-CBOEJ5Z4.cjs → chunk-OB3IFUK6.cjs} +133 -46
  143. package/dist/{chunk-R62SF5R4.mjs → chunk-OB45EAQL.mjs} +6 -1
  144. package/dist/{chunk-SYXPWJ7N.cjs → chunk-OFBLGH6V.cjs} +17 -18
  145. package/dist/{chunk-VQ4NWOWO.mjs → chunk-OGVTUGMU.mjs} +5 -13
  146. package/dist/{chunk-3UZVPO72.mjs → chunk-OIOPQ25L.mjs} +6 -7
  147. package/dist/{chunk-2XGBJSDV.cjs → chunk-OO7DYIJD.cjs} +73 -24
  148. package/dist/{chunk-IP2KHSGF.mjs → chunk-P2NBQ5JI.mjs} +57 -4
  149. package/dist/{chunk-ZQQK4U66.cjs → chunk-PDFFYZAT.cjs} +72 -19
  150. package/dist/{chunk-GSVJ3IIF.cjs → chunk-PHCJJJZV.cjs} +2 -2
  151. package/dist/{chunk-EVMXPJCB.mjs → chunk-PKMUQ7LM.mjs} +2 -1
  152. package/dist/{chunk-YD4J37RN.cjs → chunk-PL6RTBDE.cjs} +30 -19
  153. package/dist/{chunk-OAJOQU5J.mjs → chunk-PLJKJJ2H.mjs} +82 -63
  154. package/dist/{chunk-WMTBBQHY.cjs → chunk-PPX7UOFY.cjs} +271 -151
  155. package/dist/{chunk-6XQSPIN6.cjs → chunk-PWKAX5MS.cjs} +13 -3
  156. package/dist/{chunk-7XGWBPQQ.cjs → chunk-Q37INCXG.cjs} +13 -8
  157. package/dist/{chunk-T4M52BA5.cjs → chunk-Q5UX55YA.cjs} +1457 -612
  158. package/dist/{chunk-53ZCZ46B.cjs → chunk-QGQP6QKO.cjs} +4 -3
  159. package/dist/{chunk-TZOGZKI7.cjs → chunk-QITSS4TD.cjs} +1381 -626
  160. package/dist/{chunk-4ZJ5C7UJ.cjs → chunk-QIXEU2WV.cjs} +19 -10
  161. package/dist/{chunk-HCGWDRZO.mjs → chunk-QJVW76JG.mjs} +17 -6
  162. package/dist/{chunk-FJWN7RV4.cjs → chunk-QO43L7Z4.cjs} +38 -8
  163. package/dist/{chunk-ZIHWAN55.cjs → chunk-RE5E2G5S.cjs} +1 -1
  164. package/dist/chunk-RWR7SMD7.cjs +50 -0
  165. package/dist/{chunk-7PTISZSQ.cjs → chunk-S7MWSFFP.cjs} +4 -0
  166. package/dist/chunk-SD6JGJOM.mjs +50 -0
  167. package/dist/{chunk-7H4SVNC4.cjs → chunk-SPP3EZTJ.cjs} +46 -26
  168. package/dist/{chunk-E4RDMG3K.mjs → chunk-TEG6HJVF.mjs} +4 -4
  169. package/dist/{chunk-WAY6LOQH.mjs → chunk-TEJ67GD2.mjs} +1 -1
  170. package/dist/{chunk-ZNXTU4YH.mjs → chunk-TM2E623I.mjs} +1 -0
  171. package/dist/{chunk-IFTGERT3.mjs → chunk-TTXIITYA.mjs} +49 -0
  172. package/dist/{chunk-ZFWYCVKS.mjs → chunk-TY5KCYDE.mjs} +22 -4
  173. package/dist/{chunk-W2ZXMMHA.mjs → chunk-UHE5JUKB.mjs} +1 -1
  174. package/dist/{chunk-6X5NKNBE.mjs → chunk-UHNSY2PQ.mjs} +1304 -459
  175. package/dist/{chunk-UJ3R2AH2.cjs → chunk-UPOYKX4S.cjs} +5 -5
  176. package/dist/{chunk-2DLGV2ZG.mjs → chunk-UTUS6JUH.mjs} +1 -21
  177. package/dist/{chunk-Q75QPLBA.mjs → chunk-V5MQMQ2P.mjs} +1 -1
  178. package/dist/{chunk-TRIDJQ6A.cjs → chunk-V5RTHYJB.cjs} +30 -10
  179. package/dist/{chunk-QHRCR44V.mjs → chunk-VK54PDQ6.mjs} +25 -5
  180. package/dist/{chunk-LQNW3ABP.cjs → chunk-VX2HZGC7.cjs} +14 -14
  181. package/dist/{chunk-2L54YV25.mjs → chunk-WDD5CTZW.mjs} +49 -32
  182. package/dist/{chunk-7GYCZRTH.mjs → chunk-WGHY3OL5.mjs} +355 -444
  183. package/dist/{chunk-A2MN5PQJ.mjs → chunk-WMLSZAKN.mjs} +9 -9
  184. package/dist/{chunk-3EEET2Q5.cjs → chunk-WUTFJOV7.cjs} +32 -12
  185. package/dist/chunk-WVQNXXNE.cjs +28 -0
  186. package/dist/{chunk-Y5TOT5F6.cjs → chunk-X3MHKLCO.cjs} +5 -5
  187. package/dist/{chunk-Z7P2BTZ3.cjs → chunk-XGTFLG73.cjs} +30 -12
  188. package/dist/{chunk-VHHLKIDZ.mjs → chunk-XNZWMXCF.mjs} +1090 -335
  189. package/dist/{chunk-FIR62CR3.mjs → chunk-XUES6OET.mjs} +1 -1
  190. package/dist/{chunk-XCXHQBMM.mjs → chunk-Y2LU4LE5.mjs} +1 -1
  191. package/dist/{chunk-5J45H65F.mjs → chunk-Y5LEPEVH.mjs} +1 -1
  192. package/dist/{chunk-BT4SEFLC.cjs → chunk-YAEN3L2F.cjs} +3 -2
  193. package/dist/chunk-YFTGIHNC.mjs +26 -0
  194. package/dist/{chunk-KL7SHLQB.mjs → chunk-YGJ5P3TJ.mjs} +31 -1
  195. package/dist/{chunk-UYRI6U3P.mjs → chunk-YQYTQJZN.mjs} +3 -2
  196. package/dist/{chunk-X4K7TYN6.cjs → chunk-YVTS3S3F.cjs} +24 -23
  197. package/dist/{chunk-72KABRWN.mjs → chunk-ZJGFAW5U.mjs} +5 -3
  198. package/dist/{chunk-TNBJ4LZG.mjs → chunk-ZPKJPM7K.mjs} +4 -4
  199. package/dist/client/lifecycle.cjs +2 -2
  200. package/dist/client/lifecycle.d.mts +1 -1
  201. package/dist/client/lifecycle.d.ts +1 -1
  202. package/dist/client/lifecycle.mjs +1 -1
  203. package/dist/{client-component.d-D74pqdea.d.mts → client-component.d-CDRvRmbU.d.mts} +2 -2
  204. package/dist/{client-component.d-D8VcypQA.d.ts → client-component.d-DWRKyAp5.d.ts} +2 -2
  205. package/dist/client-plugins.cjs +2 -2
  206. package/dist/{client-plugins.d-D4-6hNx7.d.mts → client-plugins.d-BNILjfX3.d.mts} +94 -140
  207. package/dist/{client-plugins.d-CXElzotB.d.ts → client-plugins.d-CrKZiNSN.d.ts} +94 -140
  208. package/dist/client-plugins.d.mts +6 -6
  209. package/dist/client-plugins.d.ts +6 -6
  210. package/dist/client-plugins.mjs +1 -1
  211. package/dist/client.cjs +11 -9
  212. package/dist/client.d.mts +13 -13
  213. package/dist/client.d.ts +13 -13
  214. package/dist/client.mjs +10 -8
  215. package/dist/{config.d-qt-mE8O5.d.mts → config.d-BKIhJtmr.d.mts} +7 -2
  216. package/dist/{config.d-qt-mE8O5.d.ts → config.d-BKIhJtmr.d.ts} +7 -2
  217. package/dist/config.d.mts +6 -6
  218. package/dist/config.d.ts +6 -6
  219. package/dist/cron.cjs +2 -2
  220. package/dist/cron.mjs +1 -1
  221. package/dist/deferred.cjs +2 -2
  222. package/dist/deferred.mjs +1 -1
  223. package/dist/deployment.cjs +2 -2
  224. package/dist/deployment.mjs +1 -1
  225. package/dist/desktop.d.mts +7 -7
  226. package/dist/desktop.d.ts +7 -7
  227. package/dist/{devtools-SGYOG36E.cjs → devtools-RZVT4JVN.cjs} +36 -32
  228. package/dist/{devtools-PUVZB3F2.mjs → devtools-UFQYT3VA.mjs} +31 -27
  229. package/dist/docs.cjs +26 -25
  230. package/dist/docs.d.mts +20 -8
  231. package/dist/docs.d.ts +20 -8
  232. package/dist/docs.mjs +25 -24
  233. package/dist/env-types.cjs +3 -3
  234. package/dist/env-types.mjs +2 -2
  235. package/dist/environment/vite.cjs +5 -5
  236. package/dist/environment/vite.mjs +4 -4
  237. package/dist/headers.cjs +3 -3
  238. package/dist/headers.mjs +2 -2
  239. package/dist/image/server.d.mts +1 -1
  240. package/dist/image/server.d.ts +1 -1
  241. package/dist/image/sharp.d.mts +1 -1
  242. package/dist/image/sharp.d.ts +1 -1
  243. package/dist/{image-config.d-CeDgNyX4.d.mts → image-config.d-ByhQ0TT7.d.mts} +3 -1
  244. package/dist/{image-config.d-CeDgNyX4.d.ts → image-config.d-ByhQ0TT7.d.ts} +3 -1
  245. package/dist/image.cjs +6 -6
  246. package/dist/image.d.mts +1 -1
  247. package/dist/image.d.ts +1 -1
  248. package/dist/image.mjs +1 -1
  249. package/dist/index.cjs +143 -128
  250. package/dist/{index.d-SSgYDv4D.d.mts → index.d-Bdm6866n.d.mts} +1 -1
  251. package/dist/{index.d-A_x10zGS.d.ts → index.d-Dey5T14f.d.ts} +1 -1
  252. package/dist/index.d.mts +31 -82
  253. package/dist/index.d.ts +31 -82
  254. package/dist/index.mjs +214 -199
  255. package/dist/{integration-orm-52GPGTHO.cjs → integrations/orm.cjs} +5 -5
  256. package/dist/integrations/orm.d.mts +33 -0
  257. package/dist/integrations/orm.d.ts +33 -0
  258. package/dist/{integration-orm-CO23MSFE.mjs → integrations/orm.mjs} +5 -5
  259. package/dist/integrations.cjs +6 -5
  260. package/dist/integrations.d.mts +6 -6
  261. package/dist/integrations.d.ts +6 -6
  262. package/dist/integrations.mjs +5 -4
  263. package/dist/internal/app-markdown-runtime.cjs +4 -4
  264. package/dist/internal/app-markdown-runtime.d.mts +17 -8
  265. package/dist/internal/app-markdown-runtime.d.ts +17 -8
  266. package/dist/internal/app-markdown-runtime.mjs +3 -3
  267. package/dist/internal/build-runtime.cjs +70 -68
  268. package/dist/internal/build-runtime.d.mts +8 -8
  269. package/dist/internal/build-runtime.d.ts +8 -8
  270. package/dist/internal/build-runtime.mjs +69 -67
  271. package/dist/internal/cli-runtime.cjs +45 -44
  272. package/dist/internal/cli-runtime.mjs +44 -43
  273. package/dist/internal/client-error-overlay.cjs +6 -6
  274. package/dist/internal/client-error-overlay.mjs +2 -2
  275. package/dist/internal/client-runtime.cjs +60 -6
  276. package/dist/internal/client-runtime.d.mts +40 -11
  277. package/dist/internal/client-runtime.d.ts +40 -11
  278. package/dist/internal/client-runtime.mjs +58 -4
  279. package/dist/internal/compression-runtime.d.mts +6 -6
  280. package/dist/internal/compression-runtime.d.ts +6 -6
  281. package/dist/internal/config-runtime.cjs +25 -24
  282. package/dist/internal/config-runtime.d.mts +9 -9
  283. package/dist/internal/config-runtime.d.ts +9 -9
  284. package/dist/internal/config-runtime.mjs +24 -23
  285. package/dist/internal/docs-precompiled-runtime.cjs +16 -5
  286. package/dist/internal/docs-precompiled-runtime.d.mts +7 -0
  287. package/dist/internal/docs-precompiled-runtime.d.ts +7 -0
  288. package/dist/internal/docs-precompiled-runtime.mjs +15 -4
  289. package/dist/internal/infra-analytics-runtime.cjs +11 -11
  290. package/dist/internal/infra-analytics-runtime.mjs +9 -9
  291. package/dist/internal/islands-runtime.cjs +33 -4
  292. package/dist/internal/islands-runtime.d.mts +1 -1
  293. package/dist/internal/islands-runtime.d.ts +1 -1
  294. package/dist/internal/islands-runtime.mjs +31 -2
  295. package/dist/internal/native-server-fns.cjs +6 -6
  296. package/dist/internal/native-server-fns.mjs +5 -5
  297. package/dist/internal/product-telemetry-runtime.cjs +3 -3
  298. package/dist/internal/product-telemetry-runtime.mjs +2 -2
  299. package/dist/internal/production-runtime.cjs +54 -40
  300. package/dist/internal/production-runtime.d.mts +23 -15
  301. package/dist/internal/production-runtime.d.ts +23 -15
  302. package/dist/internal/production-runtime.mjs +69 -55
  303. package/dist/internal/react-cache.cjs +3 -3
  304. package/dist/internal/react-cache.mjs +1 -1
  305. package/dist/{lifecycle.d-C2aLBOwu.d.ts → lifecycle.d-keQs5Swc.d.mts} +7 -1
  306. package/dist/{lifecycle.d-C2aLBOwu.d.mts → lifecycle.d-keQs5Swc.d.ts} +7 -1
  307. package/dist/{manager-H5ZM3HAM.mjs → manager-JIA66YJ2.mjs} +4 -3
  308. package/dist/manager-JOHU6BQI.cjs +15 -0
  309. package/dist/markdown.cjs +7 -3
  310. package/dist/markdown.d.mts +6 -6
  311. package/dist/markdown.d.ts +6 -6
  312. package/dist/markdown.mjs +6 -2
  313. package/dist/middleware.cjs +10 -10
  314. package/dist/middleware.d.mts +8 -8
  315. package/dist/middleware.d.ts +8 -8
  316. package/dist/middleware.mjs +9 -9
  317. package/dist/mobile.d.mts +4 -4
  318. package/dist/mobile.d.ts +4 -4
  319. package/dist/mount.d-BP0nLYQO.d.mts +38 -0
  320. package/dist/mount.d-CkiPky_F.d.ts +38 -0
  321. package/dist/{native-server-fn-handler-GLRHAYWV.mjs → native-server-fn-handler-EP5AFJYE.mjs} +5 -5
  322. package/dist/{native-server-fn-handler-J5MYRXN6.cjs → native-server-fn-handler-QRTXGZA4.cjs} +6 -6
  323. package/dist/{native-tree-HE2FLS72.cjs → native-tree-W2SSJB3Y.cjs} +5 -5
  324. package/dist/{native-tree-YF2DSPKM.mjs → native-tree-Y5YQANW7.mjs} +4 -4
  325. package/dist/{navigation-delegate.d-DQVYKoaZ.d.mts → navigation-delegate.d-CdBP-hkZ.d.mts} +1 -1
  326. package/dist/{navigation-delegate.d-GghbHJuK.d.ts → navigation-delegate.d-DchcGzAQ.d.ts} +1 -1
  327. package/dist/navigation.cjs +8 -7
  328. package/dist/navigation.d.mts +9 -9
  329. package/dist/navigation.d.ts +9 -9
  330. package/dist/navigation.mjs +7 -6
  331. package/dist/{nitro-DD4QCA66.mjs → nitro-55YOZWRA.mjs} +11 -11
  332. package/dist/{nitro-VRDX2H4M.cjs → nitro-EEX2J3KB.cjs} +13 -13
  333. package/dist/{plugin-53SY5YBS.mjs → plugin-SAS22JL7.mjs} +4 -3
  334. package/dist/{plugin-HZIBL3DW.cjs → plugin-WIU4GDD4.cjs} +5 -4
  335. package/dist/plugin.cjs +61 -59
  336. package/dist/plugin.d.mts +8 -8
  337. package/dist/plugin.d.ts +8 -8
  338. package/dist/plugin.mjs +60 -58
  339. package/dist/{port-UFUZL6RI.mjs → port-CLL4BC4O.mjs} +1 -1
  340. package/dist/{port-VTLHPZOI.cjs → port-HASZTQGY.cjs} +9 -9
  341. package/dist/{production-runtime.d-Bzns3NW9.d.ts → production-runtime.d-Dou_Htas.d.ts} +1 -1
  342. package/dist/{production-runtime.d-DiFa5vHW.d.mts → production-runtime.d-VwsBzIee.d.mts} +1 -1
  343. package/dist/query/client.cjs +9 -7
  344. package/dist/query/client.mjs +5 -3
  345. package/dist/{render-plan.d-CL_Ikfg_.d.ts → render-plan.d-D8UakAIk.d.ts} +1 -1
  346. package/dist/{render-plan.d-CcF0MeCf.d.mts → render-plan.d-LKymStDJ.d.mts} +1 -1
  347. package/dist/renderer/none/server.cjs +35 -0
  348. package/dist/renderer/none/server.d.mts +21 -0
  349. package/dist/renderer/none/server.d.ts +21 -0
  350. package/dist/renderer/none/server.mjs +35 -0
  351. package/dist/renderer/react/server.cjs +2 -2
  352. package/dist/renderer/react/server.mjs +3 -3
  353. package/dist/renderer-client.cjs +8 -6
  354. package/dist/renderer-client.d.mts +9 -9
  355. package/dist/renderer-client.d.ts +9 -9
  356. package/dist/renderer-client.mjs +5 -3
  357. package/dist/renderer.cjs +6 -2
  358. package/dist/renderer.d.mts +20 -2
  359. package/dist/renderer.d.ts +20 -2
  360. package/dist/renderer.mjs +5 -1
  361. package/dist/request.cjs +2 -2
  362. package/dist/{request.d-B1RnTLri.d.ts → request.d-B928QjWy.d.ts} +1 -1
  363. package/dist/{request.d-DarDOCk9.d.mts → request.d-KG-4d2eG.d.mts} +1 -1
  364. package/dist/request.d.mts +7 -7
  365. package/dist/request.d.ts +7 -7
  366. package/dist/request.mjs +1 -1
  367. package/dist/{route-rendering.d-BTUYCIj4.d.ts → route-rendering.d-DoEe_w9t.d.ts} +1 -1
  368. package/dist/{route-rendering.d-D_2Ual0-.d.mts → route-rendering.d-NIHQeb4m.d.mts} +1 -1
  369. package/dist/{route.d-BaVH3V0w.d.mts → route.d-DrXkpvcg.d.mts} +1 -1
  370. package/dist/{route.d-DBTEqifW.d.ts → route.d-hs-_cyHn.d.ts} +1 -1
  371. package/dist/{router.d-Cuv1jntg.d.mts → router.d-B8PkJSGp.d.mts} +1 -1
  372. package/dist/{router.d-CMANF6da.d.ts → router.d-DYnRHQwz.d.ts} +1 -1
  373. package/dist/routes.cjs +3 -3
  374. package/dist/{routes.d-c2HKfrfL.d.mts → routes.d-DgZ_jgGG.d.mts} +1 -1
  375. package/dist/{routes.d-B6yFe6jm.d.ts → routes.d-uUBZyWoK.d.ts} +1 -1
  376. package/dist/routes.d.mts +6 -6
  377. package/dist/routes.d.ts +6 -6
  378. package/dist/routes.mjs +2 -2
  379. package/dist/{rsc-pipeline-T3PWURLJ.mjs → rsc-pipeline-4OJ5ZQNZ.mjs} +26 -25
  380. package/dist/{rsc-pipeline-V4ANLRAA.cjs → rsc-pipeline-7K5H2RPH.cjs} +27 -26
  381. package/dist/{runtime-LRIQ3XH7.mjs → runtime-U7O3HZOZ.mjs} +62 -36
  382. package/dist/{runtime-5AROV2C3.cjs → runtime-X52Q7JFR.cjs} +72 -46
  383. package/dist/{runtime.d-wvh4ngU0.d.mts → runtime.d-BxQIzwfy.d.mts} +11 -3
  384. package/dist/{runtime.d-C3RQUj6_.d.ts → runtime.d-DP7mEkEF.d.ts} +11 -3
  385. package/dist/{schema-dev-notice-JMXEQWIQ.mjs → schema-dev-notice-C2JINRZI.mjs} +3 -2
  386. package/dist/{schema-dev-notice-PLBFDTOF.cjs → schema-dev-notice-X7GG7QVB.cjs} +5 -4
  387. package/dist/schema.cjs +6 -2
  388. package/dist/schema.d-Dny9pnrm.d.mts +298 -0
  389. package/dist/schema.d-Dny9pnrm.d.ts +298 -0
  390. package/dist/schema.d.mts +1 -115
  391. package/dist/schema.d.ts +1 -115
  392. package/dist/schema.mjs +5 -1
  393. package/dist/server-fn-client.d.mts +2 -2
  394. package/dist/server-fn-client.d.ts +2 -2
  395. package/dist/server-fn.cjs +5 -5
  396. package/dist/server-fn.mjs +4 -4
  397. package/dist/server-plugins.cjs +7 -7
  398. package/dist/server-plugins.d.mts +16 -10
  399. package/dist/server-plugins.d.ts +16 -10
  400. package/dist/server-plugins.mjs +8 -8
  401. package/dist/server-query.cjs +6 -6
  402. package/dist/server-query.mjs +5 -5
  403. package/dist/server.cjs +160 -120
  404. package/dist/server.d.mts +20 -14
  405. package/dist/server.d.ts +20 -14
  406. package/dist/server.mjs +138 -98
  407. package/dist/{spa-router.d-WU_qS5gJ.d.mts → spa-router.d-BgHPVMhz.d.mts} +15 -5
  408. package/dist/{spa-router.d-m8H_Kl_B.d.ts → spa-router.d-DsFDHTsv.d.ts} +15 -5
  409. package/dist/testing.cjs +17 -17
  410. package/dist/testing.d.mts +6 -6
  411. package/dist/testing.d.ts +6 -6
  412. package/dist/testing.mjs +13 -13
  413. package/dist/theme/server.cjs +3 -3
  414. package/dist/theme/server.mjs +2 -2
  415. package/dist/{utils.d-W9IiEqmW.d.mts → utils.d-BKyKDBR1.d.mts} +1 -1
  416. package/dist/{utils.d-C9dQD5Zg.d.ts → utils.d-zxAVcf_V.d.ts} +1 -1
  417. package/dist/version.cjs +2 -2
  418. package/dist/version.mjs +1 -1
  419. package/dist/vite.cjs +63 -61
  420. package/dist/vite.d.mts +32 -12
  421. package/dist/vite.d.ts +32 -12
  422. package/dist/vite.mjs +62 -60
  423. package/dist/workflows.cjs +4 -4
  424. package/dist/workflows.mjs +3 -3
  425. package/package.json +31 -1
  426. package/dist/analyzer-GHWK46LX.cjs +0 -16
  427. package/dist/chunk-5YPBFMBN.cjs +0 -19
  428. package/dist/chunk-OM7WILES.mjs +0 -100
  429. package/dist/chunk-Q5B4LNON.mjs +0 -19
  430. package/dist/chunk-QPJ4MZTO.mjs +0 -60
  431. package/dist/chunk-R53QDV6T.cjs +0 -100
  432. package/dist/chunk-UYTAP4FQ.cjs +0 -60
  433. package/dist/manager-2LUKNX2N.cjs +0 -14
  434. /package/dist/{chunk-QGOZLGVP.mjs → chunk-I6FIAWNT.mjs} +0 -0
  435. /package/dist/{chunk-XPIPMWY3.cjs → chunk-K5NI5YQR.cjs} +0 -0
  436. /package/dist/{chunk-NWUHS6GV.cjs → chunk-QEJWNXRI.cjs} +0 -0
  437. /package/dist/{chunk-FSXSQQTV.mjs → chunk-TXE4SAMV.mjs} +0 -0
  438. /package/dist/{chunk-ZXK2EYQW.cjs → chunk-UUQNJDGH.cjs} +0 -0
  439. /package/dist/{chunk-46P5KNTE.mjs → chunk-VZBAW44S.mjs} +0 -0
@@ -4,13 +4,13 @@ var _chunk7KJJ4SBScjs = require('./chunk-7KJJ4SBS.cjs');
4
4
 
5
5
 
6
6
 
7
- var _chunkZIHWAN55cjs = require('./chunk-ZIHWAN55.cjs');
7
+ var _chunkRE5E2G5Scjs = require('./chunk-RE5E2G5S.cjs');
8
8
 
9
9
 
10
10
  var _chunk5Y2P454Ocjs = require('./chunk-5Y2P454O.cjs');
11
11
 
12
12
 
13
- var _chunkRD623KW4cjs = require('./chunk-RD623KW4.cjs');
13
+ var _chunk67MZTLTFcjs = require('./chunk-67MZTLTF.cjs');
14
14
 
15
15
 
16
16
 
@@ -21,7 +21,7 @@ var _chunkE7QOEV5Zcjs = require('./chunk-E7QOEV5Z.cjs');
21
21
  var _chunkQMNWKQL4cjs = require('./chunk-QMNWKQL4.cjs');
22
22
 
23
23
 
24
- var _chunkA3G5IY2Wcjs = require('./chunk-A3G5IY2W.cjs');
24
+ var _chunkHM7AGSKUcjs = require('./chunk-HM7AGSKU.cjs');
25
25
 
26
26
  // src/environment-vite.ts
27
27
  var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
@@ -192,14 +192,18 @@ function resolveSource(file, source) {
192
192
  if (source.startsWith(".")) return resolveRelative(file, source);
193
193
  return resolveFarmPackageDefaultEntry(file, source);
194
194
  }
195
- function traceFarmExport(file, name, depth = 0) {
195
+ function traceExport(file, name, depth) {
196
196
  if (depth > 8) return void 0;
197
197
  const program = readModule(file);
198
198
  if (!program) return void 0;
199
- if (isClientModule(program)) return "client";
199
+ const client = isClientModule(program);
200
+ const here = (kind) => ({ kind, file });
201
+ if (client && !(_nullishCoalesce(program.body, () => ( []))).some((node) => (_nullishCoalesce(node.type, () => ( ""))).startsWith("Export"))) {
202
+ return here("client");
203
+ }
200
204
  const follow = (source, imported) => {
201
205
  const target = resolveSource(file, source);
202
- return target ? traceFarmExport(target, imported, depth + 1) : void 0;
206
+ return target ? traceExport(target, imported, depth + 1) : void 0;
203
207
  };
204
208
  const imports = /* @__PURE__ */ new Map();
205
209
  for (const node of _nullishCoalesce(program.body, () => ( []))) {
@@ -212,38 +216,44 @@ function traceFarmExport(file, name, depth = 0) {
212
216
  }
213
217
  const local = (localName) => {
214
218
  const binding = imports.get(localName);
215
- return binding ? follow(binding.source, binding.imported) : "server";
219
+ return binding ? follow(binding.source, binding.imported) : here("server");
216
220
  };
221
+ const own = (traced) => client ? here("client") : traced();
217
222
  const stars = [];
218
223
  for (const node of _nullishCoalesce(program.body, () => ( []))) {
219
224
  if (node.type === "ExportNamedDeclaration" && node.source) {
220
225
  for (const specifier of _nullishCoalesce(node.specifiers, () => ( []))) {
221
226
  if (exportedName(specifier.exported) !== name) continue;
222
- return follow(node.source.value, _nullishCoalesce(exportedName(specifier.local), () => ( name)));
227
+ return own(() => follow(node.source.value, _nullishCoalesce(exportedName(specifier.local), () => ( name))));
223
228
  }
224
229
  } else if (node.type === "ExportAllDeclaration" && node.source && !node.exported) {
225
230
  stars.push(node.source.value);
226
231
  } else if (node.type === "ExportNamedDeclaration" && !node.source) {
227
232
  for (const specifier of _nullishCoalesce(node.specifiers, () => ( []))) {
228
233
  if (exportedName(specifier.exported) === name) {
229
- return local(_nullishCoalesce(exportedName(specifier.local), () => ( name)));
234
+ return own(() => local(_nullishCoalesce(exportedName(specifier.local), () => ( name))));
230
235
  }
231
236
  }
232
237
  const declared = [
233
238
  ..._optionalChain([node, 'access', _5 => _5.declaration, 'optionalAccess', _6 => _6.id]) ? [node.declaration.id.name] : [],
234
239
  ...(_nullishCoalesce(_optionalChain([node, 'access', _7 => _7.declaration, 'optionalAccess', _8 => _8.declarations]), () => ( []))).map((declarator) => _optionalChain([declarator, 'access', _9 => _9.id, 'optionalAccess', _10 => _10.name]))
235
240
  ];
236
- if (declared.includes(name)) return "server";
241
+ if (declared.includes(name)) return here(client ? "client" : "server");
237
242
  } else if (node.type === "ExportDefaultDeclaration" && name === "default") {
238
- return _optionalChain([node, 'access', _11 => _11.declaration, 'optionalAccess', _12 => _12.type]) === "Identifier" ? local(node.declaration.name) : "server";
243
+ return own(
244
+ () => _optionalChain([node, 'access', _11 => _11.declaration, 'optionalAccess', _12 => _12.type]) === "Identifier" ? local(node.declaration.name) : here("server")
245
+ );
239
246
  }
240
247
  }
241
248
  for (const source of stars) {
242
249
  const traced = follow(source, name);
243
- if (traced) return traced;
250
+ if (traced) return own(() => traced);
244
251
  }
245
252
  return void 0;
246
253
  }
254
+ function traceFarmExport(file, name) {
255
+ return _optionalChain([traceExport, 'call', _13 => _13(file, name, 0), 'optionalAccess', _14 => _14.kind]);
256
+ }
247
257
  function isFarmClientExport(file, name) {
248
258
  return traceFarmExport(file, name) === "client";
249
259
  }
@@ -271,8 +281,8 @@ function namespaceMembers(program, local) {
271
281
  }
272
282
  const current = node;
273
283
  if (typeof current.type !== "string") return;
274
- if ((current.type === "Identifier" || current.type === "JSXIdentifier") && current.name === local && _optionalChain([parent, 'optionalAccess', _13 => _13.type]) !== "ImportNamespaceSpecifier") {
275
- const property = (_optionalChain([parent, 'optionalAccess', _14 => _14.type]) === "MemberExpression" || _optionalChain([parent, 'optionalAccess', _15 => _15.type]) === "JSXMemberExpression") && parent.object === current && !parent.computed ? _optionalChain([parent, 'access', _16 => _16.property, 'optionalAccess', _17 => _17.name]) : void 0;
284
+ if ((current.type === "Identifier" || current.type === "JSXIdentifier") && current.name === local && _optionalChain([parent, 'optionalAccess', _15 => _15.type]) !== "ImportNamespaceSpecifier") {
285
+ const property = (_optionalChain([parent, 'optionalAccess', _16 => _16.type]) === "MemberExpression" || _optionalChain([parent, 'optionalAccess', _17 => _17.type]) === "JSXMemberExpression") && parent.object === current && !parent.computed ? _optionalChain([parent, 'access', _18 => _18.property, 'optionalAccess', _19 => _19.name]) : void 0;
276
286
  if (property) members.add(property);
277
287
  else opaque = true;
278
288
  return;
@@ -289,7 +299,7 @@ function findPackageImports(program, accept) {
289
299
  const found = [];
290
300
  for (const node of _nullishCoalesce(program.body, () => ( []))) {
291
301
  if (node.type !== "ImportDeclaration" || node.importKind === "type") continue;
292
- const specifier = _optionalChain([node, 'access', _18 => _18.source, 'optionalAccess', _19 => _19.value]);
302
+ const specifier = _optionalChain([node, 'access', _20 => _20.source, 'optionalAccess', _21 => _21.value]);
293
303
  if (typeof specifier !== "string" || !accept(specifier)) continue;
294
304
  const specifiers = (_nullishCoalesce(node.specifiers, () => ( []))).filter(
295
305
  (entry2) => entry2.importKind !== "type"
@@ -328,12 +338,76 @@ function findFarmReactServerClientNames(code, file, specifier) {
328
338
  const wanted = [
329
339
  ...entry.defaultLocal ? ["default"] : [],
330
340
  ...entry.named.map((binding) => binding.imported),
331
- ..._nullishCoalesce(_optionalChain([entry, 'access', _20 => _20.namespace, 'optionalAccess', _21 => _21.members]), () => ( []))
341
+ ..._nullishCoalesce(_optionalChain([entry, 'access', _22 => _22.namespace, 'optionalAccess', _23 => _23.members]), () => ( []))
332
342
  ];
333
343
  for (const name of wanted) if (isFarmClientExport(target, name)) names.add(name);
334
344
  }
335
345
  return [...names];
336
346
  }
347
+ function clientModuleSource(node) {
348
+ if (node.importKind === "type" || node.exportKind === "type") return null;
349
+ const source = (node.type === "ImportDeclaration" || node.type === "ExportNamedDeclaration" && node.source) && _optionalChain([node, 'access', _24 => _24.source, 'optionalAccess', _25 => _25.value]);
350
+ return typeof source === "string" && source.startsWith(".") ? source : null;
351
+ }
352
+ function isClientModuleFile(file) {
353
+ const program = readModule(file);
354
+ return program !== null && isClientModule(program);
355
+ }
356
+ function findFarmReactServerClientModules(code, file, specifier) {
357
+ const target = resolveFarmReactServerExport(file, specifier);
358
+ if (!target) return null;
359
+ const program = parseCode(code, file);
360
+ if (!program) return null;
361
+ const found = /* @__PURE__ */ new Set();
362
+ const seen = /* @__PURE__ */ new Set();
363
+ const walk2 = (current, depth) => {
364
+ if (depth > 8 || seen.has(current)) return;
365
+ seen.add(current);
366
+ const module = readModule(current);
367
+ if (!module || isClientModule(module)) return;
368
+ for (const node of _nullishCoalesce(module.body, () => ( []))) {
369
+ const source = _nullishCoalesce(clientModuleSource(node), () => ( (node.type === "ExportAllDeclaration" && typeof _optionalChain([node, 'access', _26 => _26.source, 'optionalAccess', _27 => _27.value]) === "string" ? node.source.value : null)));
370
+ if (!_optionalChain([source, 'optionalAccess', _28 => _28.startsWith, 'call', _29 => _29(".")])) continue;
371
+ const child = resolveRelative(current, source);
372
+ if (!child) continue;
373
+ if (isClientModuleFile(child)) {
374
+ if (clientModuleSource(node)) found.add(child);
375
+ } else walk2(child, depth + 1);
376
+ }
377
+ };
378
+ for (const entry of findPackageImports(program, (candidate) => candidate === specifier)) {
379
+ const wanted = [
380
+ ...entry.defaultLocal ? ["default"] : [],
381
+ ...entry.named.map((binding) => binding.imported),
382
+ ..._nullishCoalesce(_optionalChain([entry, 'access', _30 => _30.namespace, 'optionalAccess', _31 => _31.members]), () => ( []))
383
+ ];
384
+ for (const name of wanted) {
385
+ const traced = traceExport(target, name, 0);
386
+ if (_optionalChain([traced, 'optionalAccess', _32 => _32.kind]) === "server") walk2(traced.file, 0);
387
+ }
388
+ }
389
+ return [...found].sort();
390
+ }
391
+ function rewriteFarmReactServerClientModuleImports(options) {
392
+ if (!options.code.includes("import") && !options.code.includes("export")) return null;
393
+ const program = parseCode(options.code, options.file);
394
+ if (!program) return null;
395
+ const sources = [];
396
+ for (const node of _nullishCoalesce(program.body, () => ( []))) {
397
+ const source = clientModuleSource(node);
398
+ if (!source) continue;
399
+ const child = resolveRelative(options.file, source);
400
+ if (!child || !isClientModuleFile(child)) continue;
401
+ const reference = options.reference(child);
402
+ if (reference) sources.push({ start: node.source.start, end: node.source.end, reference });
403
+ }
404
+ if (sources.length === 0) return null;
405
+ let output = options.code;
406
+ for (const entry of sources.sort((left, right) => right.start - left.start)) {
407
+ output = output.slice(0, entry.start) + JSON.stringify(entry.reference) + output.slice(entry.end);
408
+ }
409
+ return output;
410
+ }
337
411
  function rewriteFarmReactServerImports(options) {
338
412
  if (!options.code.includes("import")) return null;
339
413
  const program = parseCode(options.code, options.file);
@@ -349,7 +423,7 @@ function rewriteFarmReactServerImports(options) {
349
423
  let next = 0;
350
424
  for (const entry of [...imports].sort((left, right) => right.start - left.start)) {
351
425
  const target = targets.get(entry.specifier);
352
- _optionalChain([options, 'access', _22 => _22.onServerFile, 'optionalCall', _23 => _23(target)]);
426
+ _optionalChain([options, 'access', _33 => _33.onServerFile, 'optionalCall', _34 => _34(target)]);
353
427
  const server = JSON.stringify(target);
354
428
  const lines = [];
355
429
  const bind = (name, local) => {
@@ -386,7 +460,7 @@ function staticImportSources(program) {
386
460
  continue;
387
461
  }
388
462
  if (node.importKind === "type" || node.exportKind === "type") continue;
389
- if (typeof _optionalChain([node, 'access', _24 => _24.source, 'optionalAccess', _25 => _25.value]) === "string") sources.push(node.source.value);
463
+ if (typeof _optionalChain([node, 'access', _35 => _35.source, 'optionalAccess', _36 => _36.value]) === "string") sources.push(node.source.value);
390
464
  }
391
465
  return sources;
392
466
  }
@@ -433,7 +507,7 @@ function farmRelativeImportFiles(code, file) {
433
507
  if (!program) return [];
434
508
  const files = [];
435
509
  for (const node of _nullishCoalesce(program.body, () => ( []))) {
436
- const source = (node.type === "ImportDeclaration" || node.type === "ExportAllDeclaration" || node.type === "ExportNamedDeclaration" && node.source) && _optionalChain([node, 'access', _26 => _26.source, 'optionalAccess', _27 => _27.value]);
510
+ const source = (node.type === "ImportDeclaration" || node.type === "ExportAllDeclaration" || node.type === "ExportNamedDeclaration" && node.source) && _optionalChain([node, 'access', _37 => _37.source, 'optionalAccess', _38 => _38.value]);
437
511
  if (typeof source !== "string" || !source.startsWith(".")) continue;
438
512
  const resolved = resolveRelative(file, source);
439
513
  if (resolved) files.push(resolved);
@@ -451,7 +525,7 @@ function farmReactServerBuildReachesClientModules(importer, specifier, serverImp
451
525
  if (!program) return false;
452
526
  if (depth > 0 && isClientModule(program)) return true;
453
527
  for (const node of _nullishCoalesce(program.body, () => ( []))) {
454
- const source = (node.type === "ExportAllDeclaration" || node.type === "ExportNamedDeclaration" && node.source || node.type === "ImportDeclaration") && _optionalChain([node, 'access', _28 => _28.source, 'optionalAccess', _29 => _29.value]);
528
+ const source = (node.type === "ExportAllDeclaration" || node.type === "ExportNamedDeclaration" && node.source || node.type === "ImportDeclaration") && _optionalChain([node, 'access', _39 => _39.source, 'optionalAccess', _40 => _40.value]);
455
529
  if (typeof source !== "string" || !source.startsWith(".")) continue;
456
530
  const child = resolveRelative(file, source);
457
531
  if (child && reaches(child, depth + 1)) return true;
@@ -507,12 +581,18 @@ function findFarmServerBundledPackage(importer, specifier) {
507
581
  try {
508
582
  const manifest = JSON.parse(_fs2.default.readFileSync(_path2.default.join(directory, "package.json"), "utf8"));
509
583
  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)) {
510
- return parsed.name;
584
+ return { name: parsed.name, prebundle: isSelfContainedPackage(manifest, importer) };
511
585
  }
512
586
  } catch (e8) {
513
587
  return null;
514
588
  }
515
- return scanPackage(directory).stylesheets ? parsed.name : null;
589
+ return scanPackage(directory).stylesheets ? { name: parsed.name, prebundle: false } : null;
590
+ }
591
+ function isSelfContainedPackage(manifest, importer) {
592
+ if (Object.keys(_nullishCoalesce(manifest.dependencies, () => ( {}))).length > 0) return false;
593
+ return Object.keys(_nullishCoalesce(manifest.peerDependencies, () => ( {}))).every(
594
+ (peer) => _optionalChain([manifest, 'access', _41 => _41.peerDependenciesMeta, 'optionalAccess', _42 => _42[peer], 'optionalAccess', _43 => _43.optional]) === true || findPackageDirectory(importer, peer) !== null
595
+ );
516
596
  }
517
597
  function findFarmPackageManifest(importer, specifier) {
518
598
  const parsed = packageNameOf(specifier);
@@ -527,14 +607,16 @@ function findFarmPackageManifest(importer, specifier) {
527
607
  return null;
528
608
  }
529
609
  const dependencies = [...scanPackage(directory).imports].filter((imported) => {
530
- const name = _optionalChain([packageNameOf, 'call', _30 => _30(imported), 'optionalAccess', _31 => _31.name]);
610
+ const name = _optionalChain([packageNameOf, 'call', _44 => _44(imported), 'optionalAccess', _45 => _45.name]);
531
611
  return name !== void 0 && names.has(name);
532
612
  });
533
613
  return { name: parsed.name, dependencies: dependencies.sort() };
534
614
  }
535
615
  function listFarmPackageExports(importer, specifier) {
536
616
  const entry = resolveFarmPackageDefaultEntry(importer, specifier);
537
- if (!entry) return null;
617
+ return entry ? listFarmModuleExports(entry) : null;
618
+ }
619
+ function listFarmModuleExports(entry) {
538
620
  const names = /* @__PURE__ */ new Set();
539
621
  const seen = /* @__PURE__ */ new Set();
540
622
  const collect = (file, depth) => {
@@ -554,13 +636,13 @@ function listFarmPackageExports(importer, specifier) {
554
636
  if (name) names.add(name);
555
637
  } else if (node.type === "ExportNamedDeclaration") {
556
638
  esm = true;
557
- for (const specifier2 of _nullishCoalesce(node.specifiers, () => ( []))) {
558
- const name = exportedName(specifier2.exported);
639
+ for (const specifier of _nullishCoalesce(node.specifiers, () => ( []))) {
640
+ const name = exportedName(specifier.exported);
559
641
  if (name) names.add(name);
560
642
  }
561
- if (_optionalChain([node, 'access', _32 => _32.declaration, 'optionalAccess', _33 => _33.id, 'optionalAccess', _34 => _34.name])) names.add(node.declaration.id.name);
562
- for (const declarator of _nullishCoalesce(_optionalChain([node, 'access', _35 => _35.declaration, 'optionalAccess', _36 => _36.declarations]), () => ( []))) {
563
- if (_optionalChain([declarator, 'access', _37 => _37.id, 'optionalAccess', _38 => _38.type]) === "Identifier") names.add(declarator.id.name);
643
+ if (_optionalChain([node, 'access', _46 => _46.declaration, 'optionalAccess', _47 => _47.id, 'optionalAccess', _48 => _48.name])) names.add(node.declaration.id.name);
644
+ for (const declarator of _nullishCoalesce(_optionalChain([node, 'access', _49 => _49.declaration, 'optionalAccess', _50 => _50.declarations]), () => ( []))) {
645
+ if (_optionalChain([declarator, 'access', _51 => _51.id, 'optionalAccess', _52 => _52.type]) === "Identifier") names.add(declarator.id.name);
564
646
  }
565
647
  } else if (node.type === "ExportDefaultDeclaration") {
566
648
  esm = true;
@@ -652,7 +734,7 @@ function resolveProgrammaticClientRoutes(options) {
652
734
  const definedIn = /* @__PURE__ */ new Map();
653
735
  for (const route of definitions) {
654
736
  const source = _chunkE7QOEV5Zcjs.getProgrammaticRouteDefinitionSource.call(void 0, route);
655
- const callers = (_nullishCoalesce(_optionalChain([source, 'optionalAccess', _39 => _39.stacks]), () => ( []))).map((stack) => findRouteCallers(stack, modulesByFile));
737
+ const callers = (_nullishCoalesce(_optionalChain([source, 'optionalAccess', _53 => _53.stacks]), () => ( []))).map((stack) => findRouteCallers(stack, modulesByFile));
656
738
  for (const caller of callers.flat()) caller.routeSource = true;
657
739
  definedIn.set(route, callers.flat());
658
740
  if (!source || source.raw || (_nullishCoalesce(callers[0], () => ( []))).length === 0) untraced = true;
@@ -749,7 +831,7 @@ function resolveProgrammaticClientRoutes(options) {
749
831
  return { routes, routeSourceFiles };
750
832
  }
751
833
  function createEvaluatedRouteGraph(server) {
752
- const evaluated = _optionalChain([server, 'access', _40 => _40.environments, 'optionalAccess', _41 => _41.ssr, 'optionalAccess', _42 => _42.runner, 'optionalAccess', _43 => _43.evaluatedModules]);
834
+ const evaluated = _optionalChain([server, 'access', _54 => _54.environments, 'optionalAccess', _55 => _55.ssr, 'optionalAccess', _56 => _56.runner, 'optionalAccess', _57 => _57.evaluatedModules]);
753
835
  if (!evaluated) return void 0;
754
836
  const toGraphModule = (node) => ({
755
837
  id: node.id,
@@ -873,7 +955,7 @@ function isNodeBuiltinId(id) {
873
955
  return bare.startsWith("node:") || NODE_BUILTINS.has(bare);
874
956
  }
875
957
  function isProgrammaticRouteActionProxy(code) {
876
- return Boolean(_optionalChain([code, 'optionalAccess', _44 => _44.includes, 'call', _45 => _45("__farmRouteActionTarget: true")]));
958
+ return Boolean(_optionalChain([code, 'optionalAccess', _58 => _58.includes, 'call', _59 => _59("__farmRouteActionTarget: true")]));
877
959
  }
878
960
  function collectGraph(graph, routesFile) {
879
961
  const modules = /* @__PURE__ */ new Map();
@@ -1130,6 +1212,7 @@ function toModuleFile(file) {
1130
1212
 
1131
1213
 
1132
1214
  // src/islands-package-references.ts
1215
+ var _crypto = require('crypto');
1133
1216
 
1134
1217
 
1135
1218
 
@@ -1164,8 +1247,8 @@ function namespaceMembers2(program, local, declaration) {
1164
1247
  if (opaque || node === declaration) return;
1165
1248
  const name = node.type === "Identifier" || node.type === "JSXIdentifier" ? node.name : null;
1166
1249
  if (name !== local) return;
1167
- if (_optionalChain([parent, 'optionalAccess', _46 => _46.type]) === "ImportNamespaceSpecifier") return;
1168
- const member = (_optionalChain([parent, 'optionalAccess', _47 => _47.type]) === "MemberExpression" || _optionalChain([parent, 'optionalAccess', _48 => _48.type]) === "JSXMemberExpression") && parent.object === node ? parent.property : null;
1250
+ if (_optionalChain([parent, 'optionalAccess', _60 => _60.type]) === "ImportNamespaceSpecifier") return;
1251
+ const member = (_optionalChain([parent, 'optionalAccess', _61 => _61.type]) === "MemberExpression" || _optionalChain([parent, 'optionalAccess', _62 => _62.type]) === "JSXMemberExpression") && parent.object === node ? parent.property : null;
1169
1252
  const property = member && !parent.computed && (member.type === "Identifier" || member.type === "JSXIdentifier") ? member.name : null;
1170
1253
  if (property) members.add(property);
1171
1254
  else opaque = true;
@@ -1179,7 +1262,7 @@ function findFarmPackageClientImports(code, file, isClientPackage) {
1179
1262
  const found = [];
1180
1263
  for (const node of _nullishCoalesce(program.body, () => ( []))) {
1181
1264
  if (node.type !== "ImportDeclaration" || node.importKind === "type") continue;
1182
- const specifier = _optionalChain([node, 'access', _49 => _49.source, 'optionalAccess', _50 => _50.value]);
1265
+ const specifier = _optionalChain([node, 'access', _63 => _63.source, 'optionalAccess', _64 => _64.value]);
1183
1266
  if (typeof specifier !== "string" || specifier.startsWith(".") || specifier.startsWith("/"))
1184
1267
  continue;
1185
1268
  const specifiers = (_nullishCoalesce(node.specifiers, () => ( []))).filter(
@@ -1214,7 +1297,7 @@ function findFarmPackageClientImports(code, file, isClientPackage) {
1214
1297
  ...values.length > 0 ? { values } : {}
1215
1298
  };
1216
1299
  } else {
1217
- const imported = _optionalChain([binding, 'access', _51 => _51.imported, 'optionalAccess', _52 => _52.type]) === "Identifier" ? binding.imported.name : _optionalChain([binding, 'access', _53 => _53.imported, 'optionalAccess', _54 => _54.value]);
1300
+ const imported = _optionalChain([binding, 'access', _65 => _65.imported, 'optionalAccess', _66 => _66.type]) === "Identifier" ? binding.imported.name : _optionalChain([binding, 'access', _67 => _67.imported, 'optionalAccess', _68 => _68.value]);
1218
1301
  if (typeof imported !== "string" || !IDENTIFIER.test(imported)) supported = false;
1219
1302
  else if (client(imported)) entry.named.push({ imported, local: binding.local.name });
1220
1303
  else entry.kept.push({ imported, local: binding.local.name });
@@ -1228,7 +1311,7 @@ function farmPackageClientImportExports(entry) {
1228
1311
  return [
1229
1312
  ...entry.defaultLocal ? ["default"] : [],
1230
1313
  ...entry.named.map((binding) => binding.imported),
1231
- ..._nullishCoalesce(_optionalChain([entry, 'access', _55 => _55.namespace, 'optionalAccess', _56 => _56.members]), () => ( []))
1314
+ ..._nullishCoalesce(_optionalChain([entry, 'access', _69 => _69.namespace, 'optionalAccess', _70 => _70.members]), () => ( []))
1232
1315
  ];
1233
1316
  }
1234
1317
  var FARM_CLIENT_REFERENCE_PRAGMA = "// @farm-client-reference";
@@ -1260,6 +1343,60 @@ function ensureFarmPackageClientReference(root, specifier, exportName) {
1260
1343
  }
1261
1344
  return file;
1262
1345
  }
1346
+ function writeIfChanged(file, source) {
1347
+ let current = null;
1348
+ try {
1349
+ current = _fs2.default.readFileSync(file, "utf8");
1350
+ } catch (e18) {
1351
+ }
1352
+ if (current !== source) {
1353
+ _fs2.default.mkdirSync(_path2.default.dirname(file), { recursive: true });
1354
+ _fs2.default.writeFileSync(file, source);
1355
+ }
1356
+ }
1357
+ function owningPackage(file) {
1358
+ for (let current = _path2.default.dirname(file); ; current = _path2.default.dirname(current)) {
1359
+ try {
1360
+ const manifest = JSON.parse(_fs2.default.readFileSync(_path2.default.join(current, "package.json"), "utf8"));
1361
+ if (typeof manifest.name === "string") return { directory: current, name: manifest.name };
1362
+ } catch (e19) {
1363
+ }
1364
+ if (_path2.default.dirname(current) === current) return null;
1365
+ }
1366
+ }
1367
+ function ensureFarmInternalClientReference(root, clientFile) {
1368
+ const owner = owningPackage(clientFile);
1369
+ const names = listFarmModuleExports(clientFile);
1370
+ if (!owner || !names || names.length === 0) return null;
1371
+ const directory = owner.name.replace(/^@/, "").replace(/[^A-Za-z0-9._-]/g, "+");
1372
+ const hash = _crypto.createHash.call(void 0, "sha256").update(owner.directory).digest("hex").slice(0, 8);
1373
+ const relative = _path2.default.relative(owner.directory, clientFile).split(_path2.default.sep).join("+").replace(/[^A-Za-z0-9._+-]/g, "_");
1374
+ const file = _path2.default.join(
1375
+ root,
1376
+ ".farm",
1377
+ "client-references",
1378
+ directory,
1379
+ `__internal__${hash}`,
1380
+ `${relative}.tsx`
1381
+ );
1382
+ const target = JSON.stringify(clientFile);
1383
+ const lines = [
1384
+ `// Generated by Farm: ${owner.name}'s ${_path2.default.relative(owner.directory, clientFile).split(_path2.default.sep).join("/")}, as a client reference for server components.`,
1385
+ FARM_CLIENT_REFERENCE_PRAGMA,
1386
+ '"use client";'
1387
+ ];
1388
+ const exported = [];
1389
+ names.forEach((name, index) => {
1390
+ const local = `__farm_reference_${index}__`;
1391
+ lines.push(
1392
+ name === "default" ? `import ${local} from ${target};` : `import { ${name} as ${local} } from ${target};`
1393
+ );
1394
+ exported.push(`${local} as ${name}`);
1395
+ });
1396
+ lines.push(`export { ${exported.join(", ")} };`, "");
1397
+ writeIfChanged(file, lines.join("\n"));
1398
+ return file;
1399
+ }
1263
1400
  function rewriteFarmPackageClientImports(options) {
1264
1401
  const imports = findFarmPackageClientImports(options.code, options.file, options.isClientPackage);
1265
1402
  if (imports.length === 0) return null;
@@ -1290,7 +1427,7 @@ function rewriteFarmPackageClientImports(options) {
1290
1427
  lines.push(`import { ${member} as ${local} } from ${reference(entry.specifier, member)};`);
1291
1428
  fields.push(`${member}: ${local}`);
1292
1429
  }
1293
- if (_optionalChain([entry, 'access', _57 => _57.namespace, 'access', _58 => _58.values, 'optionalAccess', _59 => _59.length])) {
1430
+ if (_optionalChain([entry, 'access', _71 => _71.namespace, 'access', _72 => _72.values, 'optionalAccess', _73 => _73.length])) {
1294
1431
  const local = `__farm_package_values_${next++}__`;
1295
1432
  lines.push(`import * as ${local} from ${JSON.stringify(entry.specifier)};`);
1296
1433
  for (const value of entry.namespace.values) fields.push(`${value}: ${local}.${value}`);
@@ -1349,7 +1486,7 @@ function stampPackagePath(target, kind) {
1349
1486
  const stat = _fs2.default.statSync(target, { throwIfNoEntry: false });
1350
1487
  if (!stat || (kind === "file" ? !stat.isFile() : !stat.isDirectory())) return void 0;
1351
1488
  return [target, stat.size, stat.mtimeMs, stat.ctimeMs];
1352
- } catch (e18) {
1489
+ } catch (e20) {
1353
1490
  return void 0;
1354
1491
  }
1355
1492
  }
@@ -1385,7 +1522,7 @@ var PackageClientBoundaryCache = class {
1385
1522
  else this.dirty = true;
1386
1523
  }
1387
1524
  }
1388
- return _optionalChain([entries, 'optionalAccess', _60 => _60.find, 'call', _61 => _61(
1525
+ return _optionalChain([entries, 'optionalAccess', _74 => _74.find, 'call', _75 => _75(
1389
1526
  (entry) => entry.stops.every((file) => visited.has(file)) && !entry.files.some((file) => visited.has(file))
1390
1527
  )]);
1391
1528
  }
@@ -1396,8 +1533,40 @@ var PackageClientBoundaryCache = class {
1396
1533
  if (entry.stamps) this.dirty = true;
1397
1534
  }
1398
1535
  async persist() {
1536
+ const pending = this.serialize();
1537
+ if (!pending) return;
1538
+ const { file, contents } = pending;
1539
+ const temporary = `${file}.${process.pid}.${Date.now()}.tmp`;
1540
+ try {
1541
+ await _fs2.default.promises.mkdir(_path2.default.dirname(file), { recursive: true });
1542
+ await _fs2.default.promises.writeFile(temporary, contents);
1543
+ await _fs2.default.promises.rename(temporary, file);
1544
+ } catch (e21) {
1545
+ await _fs2.default.promises.rm(temporary, { force: true }).catch(() => {
1546
+ });
1547
+ }
1548
+ }
1549
+ /** As `persist`, for a plan that runs synchronously (the dev server's). */
1550
+ persistSync() {
1551
+ const pending = this.serialize();
1552
+ if (!pending) return;
1553
+ const { file, contents } = pending;
1554
+ const temporary = `${file}.${process.pid}.${Date.now()}.tmp`;
1555
+ try {
1556
+ _fs2.default.mkdirSync(_path2.default.dirname(file), { recursive: true });
1557
+ _fs2.default.writeFileSync(temporary, contents);
1558
+ _fs2.default.renameSync(temporary, file);
1559
+ } catch (e22) {
1560
+ try {
1561
+ _fs2.default.rmSync(temporary, { force: true });
1562
+ } catch (e23) {
1563
+ }
1564
+ }
1565
+ }
1566
+ /** The file and its new contents, or `null` when it already holds what this scope learned. */
1567
+ serialize() {
1399
1568
  const file = this.file;
1400
- if (!file || !this.dirty && this.stored.size === 0) return;
1569
+ if (!file || !this.dirty && this.stored.size === 0) return null;
1401
1570
  const paths = [];
1402
1571
  const pathIndexes = /* @__PURE__ */ new Map();
1403
1572
  const indexOf = (stamp) => {
@@ -1424,19 +1593,11 @@ var PackageClientBoundaryCache = class {
1424
1593
  }
1425
1594
  const contents = JSON.stringify({
1426
1595
  schema: SCHEMA_VERSION,
1427
- farm: _chunkA3G5IY2Wcjs.FARM_VERSION,
1596
+ farm: _chunkHM7AGSKUcjs.FARM_VERSION,
1428
1597
  paths,
1429
1598
  entries
1430
1599
  });
1431
- const temporary = `${file}.${process.pid}.${Date.now()}.tmp`;
1432
- try {
1433
- await _fs2.default.promises.mkdir(_path2.default.dirname(file), { recursive: true });
1434
- await _fs2.default.promises.writeFile(temporary, contents);
1435
- await _fs2.default.promises.rename(temporary, file);
1436
- } catch (e19) {
1437
- await _fs2.default.promises.rm(temporary, { force: true }).catch(() => {
1438
- });
1439
- }
1600
+ return { file, contents };
1440
1601
  }
1441
1602
  restore(entry) {
1442
1603
  const files = this.restoreStamps(entry.files, "file");
@@ -1469,10 +1630,10 @@ function readStoredCache(file) {
1469
1630
  let value;
1470
1631
  try {
1471
1632
  value = JSON.parse(_fs2.default.readFileSync(file, "utf8"));
1472
- } catch (e20) {
1633
+ } catch (e24) {
1473
1634
  return null;
1474
1635
  }
1475
- if (!isRecord(value) || value.schema !== SCHEMA_VERSION || value.farm !== _chunkA3G5IY2Wcjs.FARM_VERSION) {
1636
+ if (!isRecord(value) || value.schema !== SCHEMA_VERSION || value.farm !== _chunkHM7AGSKUcjs.FARM_VERSION) {
1476
1637
  return null;
1477
1638
  }
1478
1639
  const { paths, entries } = value;
@@ -1483,7 +1644,7 @@ function readStoredCache(file) {
1483
1644
  const usable = variants.filter((entry) => isStoredEntry(entry, paths.length));
1484
1645
  if (usable.length > 0) valid[key] = usable;
1485
1646
  }
1486
- return { schema: SCHEMA_VERSION, farm: _chunkA3G5IY2Wcjs.FARM_VERSION, paths, entries: valid };
1647
+ return { schema: SCHEMA_VERSION, farm: _chunkHM7AGSKUcjs.FARM_VERSION, paths, entries: valid };
1487
1648
  }
1488
1649
  function isRecord(value) {
1489
1650
  return typeof value === "object" && value !== null && !Array.isArray(value);
@@ -1522,7 +1683,18 @@ async function withPackageClientBoundaryCache(operation) {
1522
1683
  }
1523
1684
  }
1524
1685
  function usePackageClientBoundaryCacheFile(file) {
1525
- _optionalChain([getPackageClientBoundaryCache, 'call', _62 => _62(), 'optionalAccess', _63 => _63.load, 'call', _64 => _64(file)]);
1686
+ _optionalChain([getPackageClientBoundaryCache, 'call', _76 => _76(), 'optionalAccess', _77 => _77.load, 'call', _78 => _78(file)]);
1687
+ }
1688
+ function resolvePackageClientBoundaryCacheFile(root, distDir) {
1689
+ return _path2.default.resolve(root, distDir, "cache", "client-boundaries.json");
1690
+ }
1691
+ function runWithPackageClientBoundaryCacheFile(file, operation) {
1692
+ if (getPackageClientBoundaryCache()) return operation();
1693
+ const cache2 = new PackageClientBoundaryCache();
1694
+ cache2.load(file);
1695
+ const result = getStorage().run(cache2, operation);
1696
+ cache2.persistSync();
1697
+ return result;
1526
1698
  }
1527
1699
 
1528
1700
  // src/utils/client-component.ts
@@ -1532,7 +1704,7 @@ function readIfExists(filePath) {
1532
1704
  return null;
1533
1705
  }
1534
1706
  return _fs2.default.readFileSync(filePath, "utf-8");
1535
- } catch (e21) {
1707
+ } catch (e25) {
1536
1708
  return null;
1537
1709
  }
1538
1710
  }
@@ -1545,7 +1717,7 @@ function resolveModuleSourcePath(modulePath, root) {
1545
1717
  if (modulePath.startsWith("file://")) {
1546
1718
  try {
1547
1719
  candidates.add(_url.fileURLToPath.call(void 0, modulePath));
1548
- } catch (e22) {
1720
+ } catch (e26) {
1549
1721
  }
1550
1722
  }
1551
1723
  if (modulePath.startsWith("/@fs/")) {
@@ -1558,7 +1730,7 @@ function resolveModuleSourcePath(modulePath, root) {
1558
1730
  candidates.add(_path2.default.join(root, normalized));
1559
1731
  candidates.add(_path2.default.resolve(root, normalized));
1560
1732
  }
1561
- if (_optionalChain([withoutQuery, 'optionalAccess', _65 => _65.startsWith, 'call', _66 => _66("/src/")])) {
1733
+ if (_optionalChain([withoutQuery, 'optionalAccess', _79 => _79.startsWith, 'call', _80 => _80("/src/")])) {
1562
1734
  const normalized = withoutQuery.replace(/^\/+/, "");
1563
1735
  candidates.add(_path2.default.join(process.cwd(), normalized));
1564
1736
  candidates.add(_path2.default.resolve(process.cwd(), normalized));
@@ -1571,7 +1743,7 @@ function resolveModuleSourcePath(modulePath, root) {
1571
1743
  return null;
1572
1744
  }
1573
1745
  function getFarmClientHydrationPlanOptions(renderer, hasUnsupportedIntegrationProvider) {
1574
- return { asyncOwnerIslands: _chunkRD623KW4cjs.isReactRenderer.call(void 0, renderer) && !hasUnsupportedIntegrationProvider };
1746
+ return { asyncOwnerIslands: _chunk67MZTLTFcjs.isReactRenderer.call(void 0, renderer) && !hasUnsupportedIntegrationProvider };
1575
1747
  }
1576
1748
  function describeSuppressedAsyncHydration(subject, reason) {
1577
1749
  const remediation = reason ? "Fix the reason above, or render the interactive UI from a synchronous owner." : 'Move the interactive UI into an eligible "use client" boundary, or render it from a synchronous owner.';
@@ -1637,7 +1809,7 @@ function hasHydrateExport(content) {
1637
1809
  for (const match of content.matchAll(/\bexport\s*\{([^}]*)\}/g)) {
1638
1810
  for (const specifier of match[1].split(",")) {
1639
1811
  const parts = specifier.trim().split(/\s+as\s+/);
1640
- const exportedName2 = _optionalChain([(_nullishCoalesce(parts[1], () => ( parts[0]))), 'optionalAccess', _67 => _67.trim, 'call', _68 => _68()]);
1812
+ const exportedName2 = _optionalChain([(_nullishCoalesce(parts[1], () => ( parts[0]))), 'optionalAccess', _81 => _81.trim, 'call', _82 => _82()]);
1641
1813
  if (exportedName2 === "hydrate") {
1642
1814
  return true;
1643
1815
  }
@@ -1805,7 +1977,7 @@ function isIslandExportStart(tokens, index) {
1805
1977
  const token = tokens[index];
1806
1978
  const previous = tokens[index - 1];
1807
1979
  const startsStatement = !previous || previous.value === ";" || previous.value === "{" || previous.value === "}" || token.line > previous.line;
1808
- return startsStatement && token.value === "export" && _optionalChain([tokens, 'access', _69 => _69[index + 1], 'optionalAccess', _70 => _70.value]) === "const" && _optionalChain([tokens, 'access', _71 => _71[index + 2], 'optionalAccess', _72 => _72.value]) === "island";
1980
+ return startsStatement && token.value === "export" && _optionalChain([tokens, 'access', _83 => _83[index + 1], 'optionalAccess', _84 => _84.value]) === "const" && _optionalChain([tokens, 'access', _85 => _85[index + 2], 'optionalAccess', _86 => _86.value]) === "island";
1809
1981
  }
1810
1982
  function getIslandStrategyExport(content) {
1811
1983
  if (!content) return null;
@@ -1813,15 +1985,15 @@ function getIslandStrategyExport(content) {
1813
1985
  for (let index = 0; index < tokens.length - 2; index++) {
1814
1986
  if (!isIslandExportStart(tokens, index)) continue;
1815
1987
  let valueIndex = index + 3;
1816
- if (_optionalChain([tokens, 'access', _73 => _73[valueIndex], 'optionalAccess', _74 => _74.value]) === ":") {
1988
+ if (_optionalChain([tokens, 'access', _87 => _87[valueIndex], 'optionalAccess', _88 => _88.value]) === ":") {
1817
1989
  while (valueIndex < tokens.length && tokens[valueIndex].value !== "=") valueIndex++;
1818
1990
  }
1819
- if (_optionalChain([tokens, 'access', _75 => _75[valueIndex], 'optionalAccess', _76 => _76.value]) !== "=") break;
1991
+ if (_optionalChain([tokens, 'access', _89 => _89[valueIndex], 'optionalAccess', _90 => _90.value]) !== "=") break;
1820
1992
  valueIndex++;
1821
1993
  const literal = tokens[valueIndex];
1822
1994
  if (!literal || literal.kind !== "string" || !_chunk7KJJ4SBScjs.isFarmIslandStrategy.call(void 0, literal.value)) break;
1823
1995
  let trailingIndex = valueIndex + 1;
1824
- if (_optionalChain([tokens, 'access', _77 => _77[trailingIndex], 'optionalAccess', _78 => _78.value]) === "as" && _optionalChain([tokens, 'access', _79 => _79[trailingIndex + 1], 'optionalAccess', _80 => _80.value]) === "const") {
1996
+ if (_optionalChain([tokens, 'access', _91 => _91[trailingIndex], 'optionalAccess', _92 => _92.value]) === "as" && _optionalChain([tokens, 'access', _93 => _93[trailingIndex + 1], 'optionalAccess', _94 => _94.value]) === "const") {
1825
1997
  trailingIndex += 2;
1826
1998
  }
1827
1999
  const trailing = tokens[trailingIndex];
@@ -1847,13 +2019,13 @@ function hasAsyncDefaultExport(content) {
1847
2019
  for (let index = 0; index < tokens.length - 2; index++) {
1848
2020
  const token = tokens[index];
1849
2021
  if (token.kind !== "identifier" || token.value !== "export") continue;
1850
- if (_optionalChain([tokens, 'access', _81 => _81[index - 1], 'optionalAccess', _82 => _82.value]) === ".") continue;
1851
- if (_optionalChain([tokens, 'access', _83 => _83[index + 1], 'optionalAccess', _84 => _84.value]) !== "default") continue;
2022
+ if (_optionalChain([tokens, 'access', _95 => _95[index - 1], 'optionalAccess', _96 => _96.value]) === ".") continue;
2023
+ if (_optionalChain([tokens, 'access', _97 => _97[index + 1], 'optionalAccess', _98 => _98.value]) !== "default") continue;
1852
2024
  const exported = tokens[index + 2];
1853
2025
  if (exported.kind === "identifier" && exported.value === "async") {
1854
2026
  return true;
1855
2027
  }
1856
- if (exported.kind === "identifier" && !["function", "class"].includes(exported.value) && _optionalChain([tokens, 'access', _85 => _85[index + 3], 'optionalAccess', _86 => _86.value]) !== "(" && isAsyncLocalDeclaration(tokens, exported.value)) {
2028
+ if (exported.kind === "identifier" && !["function", "class"].includes(exported.value) && _optionalChain([tokens, 'access', _99 => _99[index + 3], 'optionalAccess', _100 => _100.value]) !== "(" && isAsyncLocalDeclaration(tokens, exported.value)) {
1857
2029
  return true;
1858
2030
  }
1859
2031
  }
@@ -1861,10 +2033,10 @@ function hasAsyncDefaultExport(content) {
1861
2033
  }
1862
2034
  function isAsyncLocalDeclaration(tokens, name) {
1863
2035
  for (let index = 0; index < tokens.length - 2; index++) {
1864
- if (tokens[index].value === "async" && _optionalChain([tokens, 'access', _87 => _87[index + 1], 'optionalAccess', _88 => _88.value]) === "function" && _optionalChain([tokens, 'access', _89 => _89[index + 2], 'optionalAccess', _90 => _90.value]) === name) {
2036
+ if (tokens[index].value === "async" && _optionalChain([tokens, 'access', _101 => _101[index + 1], 'optionalAccess', _102 => _102.value]) === "function" && _optionalChain([tokens, 'access', _103 => _103[index + 2], 'optionalAccess', _104 => _104.value]) === name) {
1865
2037
  return true;
1866
2038
  }
1867
- if (tokens[index].value === name && _optionalChain([tokens, 'access', _91 => _91[index + 1], 'optionalAccess', _92 => _92.value]) === "=" && _optionalChain([tokens, 'access', _93 => _93[index + 2], 'optionalAccess', _94 => _94.value]) === "async") {
2039
+ if (tokens[index].value === name && _optionalChain([tokens, 'access', _105 => _105[index + 1], 'optionalAccess', _106 => _106.value]) === "=" && _optionalChain([tokens, 'access', _107 => _107[index + 2], 'optionalAccess', _108 => _108.value]) === "async") {
1868
2040
  return true;
1869
2041
  }
1870
2042
  }
@@ -2065,7 +2237,7 @@ function planClientModuleHydration(modulePath, root, mode, options) {
2065
2237
  return plan;
2066
2238
  }
2067
2239
  function usesFarmServerTree(plan) {
2068
- return _optionalChain([plan, 'optionalAccess', _95 => _95.asyncOwnerIslands]) === true && plan.isolatedBoundaries.length > 0 && plan.isolatedBoundaries.every((boundary) => boundary.islandStrategy === "load");
2240
+ return _optionalChain([plan, 'optionalAccess', _109 => _109.asyncOwnerIslands]) === true && plan.isolatedBoundaries.length > 0 && plan.isolatedBoundaries.every((boundary) => boundary.islandStrategy === "load");
2069
2241
  }
2070
2242
  function getMarkdownPageHydrationPlan(componentsModulePath, root, mode = "off", options = {}) {
2071
2243
  const plan = {
@@ -2196,7 +2368,7 @@ function getStaticImportBindings(content) {
2196
2368
  if (!content) return bindings;
2197
2369
  const tokens = tokenizeModuleSource(content);
2198
2370
  for (let index = 0; index < tokens.length; index++) {
2199
- if (tokens[index].value !== "import" || _optionalChain([tokens, 'access', _96 => _96[index - 1], 'optionalAccess', _97 => _97.value]) === ".") continue;
2371
+ if (tokens[index].value !== "import" || _optionalChain([tokens, 'access', _110 => _110[index - 1], 'optionalAccess', _111 => _111.value]) === ".") continue;
2200
2372
  const first = tokens[index + 1];
2201
2373
  if (!first || first.value === "type" || first.value === "(" || first.kind === "string") {
2202
2374
  continue;
@@ -2204,7 +2376,7 @@ function getStaticImportBindings(content) {
2204
2376
  let fromIndex = -1;
2205
2377
  for (let cursor = index + 1; cursor < tokens.length; cursor++) {
2206
2378
  if (tokens[cursor].value === ";") break;
2207
- if (tokens[cursor].value === "from" && _optionalChain([tokens, 'access', _98 => _98[cursor + 1], 'optionalAccess', _99 => _99.kind]) === "string") {
2379
+ if (tokens[cursor].value === "from" && _optionalChain([tokens, 'access', _112 => _112[cursor + 1], 'optionalAccess', _113 => _113.kind]) === "string") {
2208
2380
  fromIndex = cursor;
2209
2381
  break;
2210
2382
  }
@@ -2213,13 +2385,13 @@ function getStaticImportBindings(content) {
2213
2385
  const specifier = tokens[fromIndex + 1].value;
2214
2386
  const clause = tokens.slice(index + 1, fromIndex);
2215
2387
  const localNames = [];
2216
- if (_optionalChain([clause, 'access', _100 => _100[0], 'optionalAccess', _101 => _101.kind]) === "identifier" && clause[0].value !== "type") {
2388
+ if (_optionalChain([clause, 'access', _114 => _114[0], 'optionalAccess', _115 => _115.kind]) === "identifier" && clause[0].value !== "type") {
2217
2389
  localNames.push(clause[0].value);
2218
2390
  }
2219
2391
  const namespaceAs = clause.findIndex(
2220
- (token, clauseIndex) => token.value === "*" && _optionalChain([clause, 'access', _102 => _102[clauseIndex + 1], 'optionalAccess', _103 => _103.value]) === "as"
2392
+ (token, clauseIndex) => token.value === "*" && _optionalChain([clause, 'access', _116 => _116[clauseIndex + 1], 'optionalAccess', _117 => _117.value]) === "as"
2221
2393
  );
2222
- if (namespaceAs !== -1 && _optionalChain([clause, 'access', _104 => _104[namespaceAs + 2], 'optionalAccess', _105 => _105.kind]) === "identifier") {
2394
+ if (namespaceAs !== -1 && _optionalChain([clause, 'access', _118 => _118[namespaceAs + 2], 'optionalAccess', _119 => _119.kind]) === "identifier") {
2223
2395
  localNames.push(clause[namespaceAs + 2].value);
2224
2396
  }
2225
2397
  const openingBrace = clause.findIndex((token) => token.value === "{");
@@ -2229,11 +2401,11 @@ function getStaticImportBindings(content) {
2229
2401
  if (openingBrace !== -1 && closingBrace !== -1) {
2230
2402
  let entryStart = openingBrace + 1;
2231
2403
  for (let cursor = entryStart; cursor <= closingBrace; cursor++) {
2232
- if (cursor !== closingBrace && _optionalChain([clause, 'access', _106 => _106[cursor], 'optionalAccess', _107 => _107.value]) !== ",") continue;
2404
+ if (cursor !== closingBrace && _optionalChain([clause, 'access', _120 => _120[cursor], 'optionalAccess', _121 => _121.value]) !== ",") continue;
2233
2405
  const entry = clause.slice(entryStart, cursor).filter((token) => token.value !== "type");
2234
2406
  const asIndex = entry.findIndex((token) => token.value === "as");
2235
2407
  const local = asIndex === -1 ? entry[0] : entry[asIndex + 1];
2236
- if (_optionalChain([local, 'optionalAccess', _108 => _108.kind]) === "identifier") localNames.push(local.value);
2408
+ if (_optionalChain([local, 'optionalAccess', _122 => _122.kind]) === "identifier") localNames.push(local.value);
2237
2409
  entryStart = cursor + 1;
2238
2410
  }
2239
2411
  }
@@ -2270,14 +2442,14 @@ function findParserSensitiveJsxContainer(content, localBindings) {
2270
2442
  const open = [];
2271
2443
  const isSelfClosing = (openingIndex) => {
2272
2444
  for (let index = openingIndex; index < tokens.length; index++) {
2273
- if (tokens[index].value === ">") return _optionalChain([tokens, 'access', _109 => _109[index - 1], 'optionalAccess', _110 => _110.value]) === "/";
2445
+ if (tokens[index].value === ">") return _optionalChain([tokens, 'access', _123 => _123[index - 1], 'optionalAccess', _124 => _124.value]) === "/";
2274
2446
  }
2275
2447
  return false;
2276
2448
  };
2277
2449
  for (let index = 0; index < tokens.length - 1; index++) {
2278
2450
  if (tokens[index].value !== "<") continue;
2279
2451
  if (tokens[index + 1].value === "/") {
2280
- const closing = _optionalChain([tokens, 'access', _111 => _111[index + 2], 'optionalAccess', _112 => _112.value]);
2452
+ const closing = _optionalChain([tokens, 'access', _125 => _125[index + 2], 'optionalAccess', _126 => _126.value]);
2281
2453
  const at = closing ? open.lastIndexOf(closing) : -1;
2282
2454
  if (at !== -1) open.length = at;
2283
2455
  continue;
@@ -2320,7 +2492,7 @@ function findMatchingToken(tokens, openingIndex, opening, closing) {
2320
2492
  }
2321
2493
  function containsClientJsx(tokens, start, end, clientBindings) {
2322
2494
  for (let index = start; index < end; index++) {
2323
- if (tokens[index].value === "<" && clientBindings.has(_optionalChain([tokens, 'access', _113 => _113[index + 1], 'optionalAccess', _114 => _114.value]))) return true;
2495
+ if (tokens[index].value === "<" && clientBindings.has(_optionalChain([tokens, 'access', _127 => _127[index + 1], 'optionalAccess', _128 => _128.value]))) return true;
2324
2496
  }
2325
2497
  return false;
2326
2498
  }
@@ -2358,7 +2530,7 @@ function getClientRenderingHelpers(tokens, clientBindings) {
2358
2530
  let helperName;
2359
2531
  let bodyStart = -1;
2360
2532
  let bodyEnd = -1;
2361
- if (tokens[index].value === "function" && _optionalChain([tokens, 'access', _115 => _115[index + 1], 'optionalAccess', _116 => _116.kind]) === "identifier") {
2533
+ if (tokens[index].value === "function" && _optionalChain([tokens, 'access', _129 => _129[index + 1], 'optionalAccess', _130 => _130.kind]) === "identifier") {
2362
2534
  helperName = tokens[index + 1].value;
2363
2535
  const parametersStart = tokens.findIndex(
2364
2536
  (token, tokenIndex) => tokenIndex > index + 1 && token.value === "("
@@ -2368,21 +2540,21 @@ function getClientRenderingHelpers(tokens, clientBindings) {
2368
2540
  (token, tokenIndex) => tokenIndex > parametersEnd && token.value === "{"
2369
2541
  );
2370
2542
  if (bodyStart !== -1) bodyEnd = findMatchingToken(tokens, bodyStart, "{", "}");
2371
- } else if ((tokens[index].value === "const" || tokens[index].value === "let" || tokens[index].value === "var") && _optionalChain([tokens, 'access', _117 => _117[index + 1], 'optionalAccess', _118 => _118.kind]) === "identifier") {
2543
+ } else if ((tokens[index].value === "const" || tokens[index].value === "let" || tokens[index].value === "var") && _optionalChain([tokens, 'access', _131 => _131[index + 1], 'optionalAccess', _132 => _132.kind]) === "identifier") {
2372
2544
  helperName = tokens[index + 1].value;
2373
2545
  let assignmentIndex = -1;
2374
2546
  let arrowIndex = -1;
2375
2547
  for (let cursor = index + 2; cursor < tokens.length; cursor++) {
2376
2548
  if (tokens[cursor].value === ";") break;
2377
2549
  if (assignmentIndex === -1 && tokens[cursor].value === "=") assignmentIndex = cursor;
2378
- if (tokens[cursor].value === "=" && _optionalChain([tokens, 'access', _119 => _119[cursor + 1], 'optionalAccess', _120 => _120.value]) === ">") {
2550
+ if (tokens[cursor].value === "=" && _optionalChain([tokens, 'access', _133 => _133[cursor + 1], 'optionalAccess', _134 => _134.value]) === ">") {
2379
2551
  arrowIndex = cursor;
2380
2552
  break;
2381
2553
  }
2382
2554
  }
2383
2555
  if (arrowIndex !== -1) {
2384
2556
  bodyStart = arrowIndex + 2;
2385
- bodyEnd = _optionalChain([tokens, 'access', _121 => _121[bodyStart], 'optionalAccess', _122 => _122.value]) === "{" ? findMatchingToken(tokens, bodyStart, "{", "}") : findStatementEnd(tokens, bodyStart);
2557
+ bodyEnd = _optionalChain([tokens, 'access', _135 => _135[bodyStart], 'optionalAccess', _136 => _136.value]) === "{" ? findMatchingToken(tokens, bodyStart, "{", "}") : findStatementEnd(tokens, bodyStart);
2386
2558
  } else if (assignmentIndex !== -1) {
2387
2559
  bodyStart = assignmentIndex + 1;
2388
2560
  bodyEnd = findStatementEnd(tokens, bodyStart);
@@ -2422,14 +2594,14 @@ function passesElementValuedProps(content, localBindings) {
2422
2594
  else if (value === "}") braceDepth--;
2423
2595
  else if (value === "<" && braceDepth > 0) return true;
2424
2596
  else if (value === ">" && braceDepth === 0) {
2425
- selfClosing = _optionalChain([tokens, 'access', _123 => _123[cursor - 1], 'optionalAccess', _124 => _124.value]) === "/";
2597
+ selfClosing = _optionalChain([tokens, 'access', _137 => _137[cursor - 1], 'optionalAccess', _138 => _138.value]) === "/";
2426
2598
  break;
2427
2599
  }
2428
2600
  }
2429
2601
  if (selfClosing || cursor >= tokens.length) continue;
2430
2602
  for (let child = cursor + 1; child < tokens.length; child++) {
2431
2603
  if (tokens[child].value !== "<") continue;
2432
- const closesBoundary = _optionalChain([tokens, 'access', _125 => _125[child + 1], 'optionalAccess', _126 => _126.value]) === "/" && _optionalChain([tokens, 'access', _127 => _127[child + 2], 'optionalAccess', _128 => _128.value]) === name;
2604
+ const closesBoundary = _optionalChain([tokens, 'access', _139 => _139[child + 1], 'optionalAccess', _140 => _140.value]) === "/" && _optionalChain([tokens, 'access', _141 => _141[child + 2], 'optionalAccess', _142 => _142.value]) === name;
2433
2605
  if (!closesBoundary) return true;
2434
2606
  break;
2435
2607
  }
@@ -2451,7 +2623,7 @@ function rendersOnlyLeafElements(content, localBindings) {
2451
2623
  else if (value === "<" && braceDepth > 0) return false;
2452
2624
  else if (value === ">" && braceDepth === 0) break;
2453
2625
  }
2454
- if (cursor >= tokens.length || _optionalChain([tokens, 'access', _129 => _129[cursor - 1], 'optionalAccess', _130 => _130.value]) !== "/") return false;
2626
+ if (cursor >= tokens.length || _optionalChain([tokens, 'access', _143 => _143[cursor - 1], 'optionalAccess', _144 => _144.value]) !== "/") return false;
2455
2627
  }
2456
2628
  return true;
2457
2629
  }
@@ -2463,9 +2635,9 @@ function hasDynamicJsxCardinality(content, localBindings) {
2463
2635
  const containsDynamicRenderer = (start, end) => containsClientJsx(tokens, start, end, clientBindings) || tokens.slice(start, end).some((token) => renderingHelpers.has(token.value));
2464
2636
  for (let index = 0; index < tokens.length; index++) {
2465
2637
  let callStart = -1;
2466
- if (tokens[index].value === "." && (_optionalChain([tokens, 'access', _131 => _131[index + 1], 'optionalAccess', _132 => _132.value]) === "map" || _optionalChain([tokens, 'access', _133 => _133[index + 1], 'optionalAccess', _134 => _134.value]) === "flatMap") && _optionalChain([tokens, 'access', _135 => _135[index + 2], 'optionalAccess', _136 => _136.value]) === "(") {
2638
+ if (tokens[index].value === "." && (_optionalChain([tokens, 'access', _145 => _145[index + 1], 'optionalAccess', _146 => _146.value]) === "map" || _optionalChain([tokens, 'access', _147 => _147[index + 1], 'optionalAccess', _148 => _148.value]) === "flatMap") && _optionalChain([tokens, 'access', _149 => _149[index + 2], 'optionalAccess', _150 => _150.value]) === "(") {
2467
2639
  callStart = index + 2;
2468
- } else if (tokens[index].value === "Array" && _optionalChain([tokens, 'access', _137 => _137[index + 1], 'optionalAccess', _138 => _138.value]) === "." && _optionalChain([tokens, 'access', _139 => _139[index + 2], 'optionalAccess', _140 => _140.value]) === "from" && _optionalChain([tokens, 'access', _141 => _141[index + 3], 'optionalAccess', _142 => _142.value]) === "(") {
2640
+ } else if (tokens[index].value === "Array" && _optionalChain([tokens, 'access', _151 => _151[index + 1], 'optionalAccess', _152 => _152.value]) === "." && _optionalChain([tokens, 'access', _153 => _153[index + 2], 'optionalAccess', _154 => _154.value]) === "from" && _optionalChain([tokens, 'access', _155 => _155[index + 3], 'optionalAccess', _156 => _156.value]) === "(") {
2469
2641
  callStart = index + 3;
2470
2642
  }
2471
2643
  if (callStart !== -1) {
@@ -2474,10 +2646,10 @@ function hasDynamicJsxCardinality(content, localBindings) {
2474
2646
  index = callEnd;
2475
2647
  continue;
2476
2648
  }
2477
- if ((tokens[index].value === "for" || tokens[index].value === "while") && _optionalChain([tokens, 'access', _143 => _143[index + 1], 'optionalAccess', _144 => _144.value]) === "(") {
2649
+ if ((tokens[index].value === "for" || tokens[index].value === "while") && _optionalChain([tokens, 'access', _157 => _157[index + 1], 'optionalAccess', _158 => _158.value]) === "(") {
2478
2650
  const conditionEnd = findMatchingToken(tokens, index + 1, "(", ")");
2479
2651
  const bodyStart = conditionEnd + 1;
2480
- const bodyEnd = _optionalChain([tokens, 'access', _145 => _145[bodyStart], 'optionalAccess', _146 => _146.value]) === "{" ? findMatchingToken(tokens, bodyStart, "{", "}") : tokens.findIndex((token, tokenIndex) => tokenIndex > bodyStart && token.value === ";");
2652
+ const bodyEnd = _optionalChain([tokens, 'access', _159 => _159[bodyStart], 'optionalAccess', _160 => _160.value]) === "{" ? findMatchingToken(tokens, bodyStart, "{", "}") : tokens.findIndex((token, tokenIndex) => tokenIndex > bodyStart && token.value === ";");
2481
2653
  if (containsDynamicRenderer(bodyStart, bodyEnd === -1 ? tokens.length : bodyEnd)) return true;
2482
2654
  }
2483
2655
  }
@@ -2542,6 +2714,14 @@ function collectIsolatedClientBoundaries(ownerPath, root, options = {}) {
2542
2714
  ensureFarmPackageClientReference(projectRoot, specifier, exportName)
2543
2715
  );
2544
2716
  }
2717
+ for (const clientFile of _nullishCoalesce(findFarmReactServerClientModules(
2718
+ _nullishCoalesce(content, () => ( "")),
2719
+ moduleSourcePath,
2720
+ specifier
2721
+ ), () => ( []))) {
2722
+ const reference = ensureFarmInternalClientReference(projectRoot, clientFile);
2723
+ if (reference) importedBoundaryCount += visit(reference);
2724
+ }
2545
2725
  } else {
2546
2726
  const packageMetadata = inspectPackageClientBoundary(importedPath, root, /* @__PURE__ */ new Set());
2547
2727
  if (!packageMetadata.shouldHydrate) continue;
@@ -2661,7 +2841,7 @@ function inspectClientModuleMetadata(resolvedPath, root, visited, inspectIslandE
2661
2841
  function realpathOrSelf(file) {
2662
2842
  try {
2663
2843
  return _fs2.default.realpathSync(file);
2664
- } catch (e23) {
2844
+ } catch (e27) {
2665
2845
  return file;
2666
2846
  }
2667
2847
  }
@@ -2688,7 +2868,7 @@ function inspectPackageClientBoundary(resolvedPath, root, visited) {
2688
2868
  }
2689
2869
  function traversePackageClientBoundary(resolvedPath, root, visited, trace) {
2690
2870
  if (!resolvedPath || visited.has(resolvedPath)) {
2691
- if (resolvedPath) _optionalChain([trace, 'optionalAccess', _147 => _147.stop, 'call', _148 => _148(resolvedPath)]);
2871
+ if (resolvedPath) _optionalChain([trace, 'optionalAccess', _161 => _161.stop, 'call', _162 => _162(resolvedPath)]);
2692
2872
  return {
2693
2873
  isClientComponent: false,
2694
2874
  shouldHydrate: false,
@@ -2696,7 +2876,7 @@ function traversePackageClientBoundary(resolvedPath, root, visited, trace) {
2696
2876
  };
2697
2877
  }
2698
2878
  visited.add(resolvedPath);
2699
- _optionalChain([trace, 'optionalAccess', _149 => _149.visit, 'call', _150 => _150(resolvedPath)]);
2879
+ _optionalChain([trace, 'optionalAccess', _163 => _163.visit, 'call', _164 => _164(resolvedPath)]);
2700
2880
  const content = readIfExists(resolvedPath);
2701
2881
  const parsed = parseClientModuleMetadata(content, false);
2702
2882
  let importsClientBoundary = false;
@@ -2746,7 +2926,7 @@ function getImportSpecifiers(content, { reexportsOnly = false, dynamic = false }
2746
2926
  braceDepth = Math.max(0, braceDepth - 1);
2747
2927
  continue;
2748
2928
  }
2749
- if (dynamic && keyword.kind === "identifier" && keyword.value === "import" && _optionalChain([tokens, 'access', _151 => _151[index - 1], 'optionalAccess', _152 => _152.value]) !== "." && _optionalChain([tokens, 'access', _153 => _153[index + 1], 'optionalAccess', _154 => _154.value]) === "(" && _optionalChain([tokens, 'access', _155 => _155[index + 2], 'optionalAccess', _156 => _156.kind]) === "string") {
2929
+ if (dynamic && keyword.kind === "identifier" && keyword.value === "import" && _optionalChain([tokens, 'access', _165 => _165[index - 1], 'optionalAccess', _166 => _166.value]) !== "." && _optionalChain([tokens, 'access', _167 => _167[index + 1], 'optionalAccess', _168 => _168.value]) === "(" && _optionalChain([tokens, 'access', _169 => _169[index + 2], 'optionalAccess', _170 => _170.kind]) === "string") {
2750
2930
  matches.add(tokens[index + 2].value);
2751
2931
  continue;
2752
2932
  }
@@ -2756,7 +2936,7 @@ function getImportSpecifiers(content, { reexportsOnly = false, dynamic = false }
2756
2936
  }
2757
2937
  if (reexportsOnly && keyword.value !== "export") continue;
2758
2938
  const previous = tokens[index - 1];
2759
- if (_optionalChain([previous, 'optionalAccess', _157 => _157.value]) === ".") continue;
2939
+ if (_optionalChain([previous, 'optionalAccess', _171 => _171.value]) === ".") continue;
2760
2940
  const first = tokens[index + 1];
2761
2941
  if (!first || first.value === "type" || first.value === "(" || first.value === ".") {
2762
2942
  continue;
@@ -2772,7 +2952,7 @@ function getImportSpecifiers(content, { reexportsOnly = false, dynamic = false }
2772
2952
  for (let cursor = index + 1; cursor < tokens.length; cursor++) {
2773
2953
  const token = tokens[cursor];
2774
2954
  if (token.value === ";") break;
2775
- if (token.value === "from" && _optionalChain([tokens, 'access', _158 => _158[cursor + 1], 'optionalAccess', _159 => _159.kind]) === "string") {
2955
+ if (token.value === "from" && _optionalChain([tokens, 'access', _172 => _172[cursor + 1], 'optionalAccess', _173 => _173.kind]) === "string") {
2776
2956
  fromIndex = cursor;
2777
2957
  break;
2778
2958
  }
@@ -2790,14 +2970,14 @@ function getImportSpecifiers(content, { reexportsOnly = false, dynamic = false }
2790
2970
  return Array.from(matches);
2791
2971
  }
2792
2972
  function isTypeOnlyNamedClause(tokens, startIndex, endIndex) {
2793
- if (_optionalChain([tokens, 'access', _160 => _160[startIndex], 'optionalAccess', _161 => _161.value]) !== "{") return false;
2973
+ if (_optionalChain([tokens, 'access', _174 => _174[startIndex], 'optionalAccess', _175 => _175.value]) !== "{") return false;
2794
2974
  const closingBraceIndex = tokens.findIndex(
2795
2975
  (token, index) => index > startIndex && index < endIndex && token.value === "}"
2796
2976
  );
2797
2977
  if (closingBraceIndex === -1) return false;
2798
2978
  let entryStartsAt = startIndex + 1;
2799
2979
  for (let index = entryStartsAt; index <= closingBraceIndex; index++) {
2800
- if (index !== closingBraceIndex && _optionalChain([tokens, 'access', _162 => _162[index], 'optionalAccess', _163 => _163.value]) !== ",") continue;
2980
+ if (index !== closingBraceIndex && _optionalChain([tokens, 'access', _176 => _176[index], 'optionalAccess', _177 => _177.value]) !== ",") continue;
2801
2981
  const entry = tokens.slice(entryStartsAt, index);
2802
2982
  if (entry.length > 0 && entry[0].value !== "type") return false;
2803
2983
  entryStartsAt = index + 1;
@@ -2854,14 +3034,14 @@ function getProjectImportAliases(projectRoot) {
2854
3034
  const stamp = PROJECT_ALIAS_FILES.map((file) => {
2855
3035
  try {
2856
3036
  return String(_fs2.default.statSync(_path2.default.join(projectRoot, file)).mtimeMs);
2857
- } catch (e24) {
3037
+ } catch (e28) {
2858
3038
  return "-";
2859
3039
  }
2860
3040
  }).join(":");
2861
- const sourceDir = _chunkZIHWAN55cjs.getFarmProjectSourceDir.call(void 0, projectRoot);
3041
+ const sourceDir = _chunkRE5E2G5Scjs.getFarmProjectSourceDir.call(void 0, projectRoot);
2862
3042
  const cacheStamp = `${stamp}:${sourceDir}`;
2863
3043
  const cached = projectImportAliasCache.get(projectRoot);
2864
- if (_optionalChain([cached, 'optionalAccess', _164 => _164.stamp]) === cacheStamp) return cached.aliases;
3044
+ if (_optionalChain([cached, 'optionalAccess', _178 => _178.stamp]) === cacheStamp) return cached.aliases;
2865
3045
  const aliases = [
2866
3046
  ...readTsconfigPathAliases(projectRoot),
2867
3047
  ...readPackageImportAliases(projectRoot)
@@ -2882,7 +3062,7 @@ function readTsconfigPathAliases(projectRoot) {
2882
3062
  const configPath = _path2.default.join(projectRoot, name);
2883
3063
  if (!_fs2.default.existsSync(configPath)) continue;
2884
3064
  const resolved = readTsconfigPaths(configPath, /* @__PURE__ */ new Set());
2885
- if (!_optionalChain([resolved, 'optionalAccess', _165 => _165.paths])) return [];
3065
+ if (!_optionalChain([resolved, 'optionalAccess', _179 => _179.paths])) return [];
2886
3066
  const base = _nullishCoalesce(resolved.baseUrl, () => ( resolved.pathsDirectory));
2887
3067
  return Object.entries(resolved.paths).flatMap(([pattern, targets]) => {
2888
3068
  if (!Array.isArray(targets)) return [];
@@ -2917,18 +3097,18 @@ function readTsconfigPaths(configPath, visited) {
2917
3097
  inherited = _nullishCoalesce(readTsconfigPaths(parentPath, visited), () => ( inherited));
2918
3098
  }
2919
3099
  const options = _nullishCoalesce(config.compilerOptions, () => ( {}));
2920
- const baseUrl = typeof options.baseUrl === "string" ? _path2.default.resolve(directory, options.baseUrl) : _optionalChain([inherited, 'optionalAccess', _166 => _166.baseUrl]);
3100
+ const baseUrl = typeof options.baseUrl === "string" ? _path2.default.resolve(directory, options.baseUrl) : _optionalChain([inherited, 'optionalAccess', _180 => _180.baseUrl]);
2921
3101
  if (options.paths && typeof options.paths === "object") {
2922
3102
  return { paths: options.paths, pathsDirectory: directory, baseUrl };
2923
3103
  }
2924
3104
  return inherited ? { ...inherited, baseUrl } : { pathsDirectory: directory, baseUrl };
2925
3105
  }
2926
3106
  function readPackageImportAliases(projectRoot) {
2927
- const imports = _optionalChain([readPackageJson, 'call', _167 => _167(_path2.default.join(projectRoot, "package.json")), 'optionalAccess', _168 => _168.imports]);
3107
+ const imports = _optionalChain([readPackageJson, 'call', _181 => _181(_path2.default.join(projectRoot, "package.json")), 'optionalAccess', _182 => _182.imports]);
2928
3108
  if (!imports || typeof imports !== "object") return [];
2929
3109
  return Object.entries(imports).flatMap(([pattern, value]) => {
2930
3110
  const target = resolveConditionalExportTarget(value);
2931
- if (!pattern.startsWith("#") || !_optionalChain([target, 'optionalAccess', _169 => _169.startsWith, 'call', _170 => _170("./")])) return [];
3111
+ if (!pattern.startsWith("#") || !_optionalChain([target, 'optionalAccess', _183 => _183.startsWith, 'call', _184 => _184("./")])) return [];
2932
3112
  const wildcardIndex = pattern.indexOf("*");
2933
3113
  return [
2934
3114
  {
@@ -2944,7 +3124,7 @@ function readJsonWithComments(filePath) {
2944
3124
  let source;
2945
3125
  try {
2946
3126
  source = _fs2.default.readFileSync(filePath, "utf8");
2947
- } catch (e25) {
3127
+ } catch (e29) {
2948
3128
  return null;
2949
3129
  }
2950
3130
  let output = "";
@@ -2972,7 +3152,7 @@ function readJsonWithComments(filePath) {
2972
3152
  }
2973
3153
  try {
2974
3154
  return JSON.parse(output.replace(/,(\s*[}\]])/g, "$1"));
2975
- } catch (e26) {
3155
+ } catch (e30) {
2976
3156
  return null;
2977
3157
  }
2978
3158
  }
@@ -2994,15 +3174,15 @@ function resolvePackageModuleSourcePath(importerPath, specifier, root) {
2994
3174
  const packageJsonPath = _path2.default.join(packageDirectory, "package.json");
2995
3175
  const packageJson = readPackageJson(packageJsonPath);
2996
3176
  const exportKey = packageSubpath ? `./${packageSubpath}` : ".";
2997
- const exportTarget = resolvePackageExport(_optionalChain([packageJson, 'optionalAccess', _171 => _171.exports]), exportKey);
3177
+ const exportTarget = resolvePackageExport(_optionalChain([packageJson, 'optionalAccess', _185 => _185.exports]), exportKey);
2998
3178
  const candidates = /* @__PURE__ */ new Set();
2999
- if (_optionalChain([exportTarget, 'optionalAccess', _172 => _172.startsWith, 'call', _173 => _173("./")])) {
3179
+ if (_optionalChain([exportTarget, 'optionalAccess', _186 => _186.startsWith, 'call', _187 => _187("./")])) {
3000
3180
  candidates.add(_path2.default.resolve(packageDirectory, exportTarget));
3001
3181
  }
3002
3182
  if (packageSubpath) {
3003
3183
  candidates.add(_path2.default.join(packageDirectory, packageSubpath));
3004
3184
  } else {
3005
- for (const entry of [_optionalChain([packageJson, 'optionalAccess', _174 => _174.browser]), _optionalChain([packageJson, 'optionalAccess', _175 => _175.module]), _optionalChain([packageJson, 'optionalAccess', _176 => _176.main])]) {
3185
+ for (const entry of [_optionalChain([packageJson, 'optionalAccess', _188 => _188.browser]), _optionalChain([packageJson, 'optionalAccess', _189 => _189.module]), _optionalChain([packageJson, 'optionalAccess', _190 => _190.main])]) {
3006
3186
  if (typeof entry === "string") candidates.add(_path2.default.resolve(packageDirectory, entry));
3007
3187
  }
3008
3188
  candidates.add(_path2.default.join(packageDirectory, "index"));
@@ -3038,7 +3218,7 @@ function findPackageDirectory2(importerPath, packageName, root) {
3038
3218
  function readPackageJson(packageJsonPath) {
3039
3219
  try {
3040
3220
  return JSON.parse(_fs2.default.readFileSync(packageJsonPath, "utf8"));
3041
- } catch (e27) {
3221
+ } catch (e31) {
3042
3222
  return null;
3043
3223
  }
3044
3224
  }
@@ -3067,7 +3247,7 @@ function resolvePackageExport(exportsField, exportKey) {
3067
3247
  if (!exportKey.startsWith(prefix) || !exportKey.endsWith(suffix)) continue;
3068
3248
  const wildcard = exportKey.slice(prefix.length, exportKey.length - suffix.length);
3069
3249
  const target = resolveConditionalExportTarget(value);
3070
- return _nullishCoalesce(_optionalChain([target, 'optionalAccess', _177 => _177.replace, 'call', _178 => _178("*", wildcard)]), () => ( null));
3250
+ return _nullishCoalesce(_optionalChain([target, 'optionalAccess', _191 => _191.replace, 'call', _192 => _192("*", wildcard)]), () => ( null));
3071
3251
  }
3072
3252
  return null;
3073
3253
  }
@@ -3100,7 +3280,7 @@ function resolveSourceCandidate(candidates) {
3100
3280
  for (const sourcePath of paths) {
3101
3281
  try {
3102
3282
  if (_fs2.default.statSync(sourcePath).isFile()) return sourcePath;
3103
- } catch (e28) {
3283
+ } catch (e32) {
3104
3284
  }
3105
3285
  }
3106
3286
  }
@@ -3132,7 +3312,7 @@ function scanFarmPackageImports(directory, root) {
3132
3312
  let entries;
3133
3313
  try {
3134
3314
  entries = _fs2.default.readdirSync(current, { withFileTypes: true });
3135
- } catch (e29) {
3315
+ } catch (e33) {
3136
3316
  return;
3137
3317
  }
3138
3318
  for (const entry of entries) {
@@ -3159,14 +3339,14 @@ function scanFarmPackageImports(directory, root) {
3159
3339
  walk2(directory);
3160
3340
  return { client: [...found].sort(), server };
3161
3341
  }
3162
- function collectFarmServerBundledPackages(directory) {
3163
- const found = /* @__PURE__ */ new Set();
3342
+ function collectFarmServerBundledPackageInfo(directory) {
3343
+ const found = /* @__PURE__ */ new Map();
3164
3344
  const checked = /* @__PURE__ */ new Set();
3165
3345
  const walk2 = (current) => {
3166
3346
  let entries;
3167
3347
  try {
3168
3348
  entries = _fs2.default.readdirSync(current, { withFileTypes: true });
3169
- } catch (e30) {
3349
+ } catch (e34) {
3170
3350
  return;
3171
3351
  }
3172
3352
  for (const entry of entries) {
@@ -3185,12 +3365,12 @@ function collectFarmServerBundledPackages(directory) {
3185
3365
  if (!name || checked.has(name)) continue;
3186
3366
  checked.add(name);
3187
3367
  const bundled = findFarmServerBundledPackage(file, name);
3188
- if (bundled) found.add(bundled);
3368
+ if (bundled) found.set(bundled.name, bundled);
3189
3369
  }
3190
3370
  }
3191
3371
  };
3192
3372
  walk2(directory);
3193
- return [...found].sort();
3373
+ return [...found.values()].sort((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0);
3194
3374
  }
3195
3375
  var clientReachableModules = /* @__PURE__ */ new Map();
3196
3376
  function invalidateFarmClientReachableModules() {
@@ -3206,7 +3386,7 @@ function getFarmClientReachableModules(directory, root) {
3206
3386
  let entries;
3207
3387
  try {
3208
3388
  entries = _fs2.default.readdirSync(current, { withFileTypes: true });
3209
- } catch (e31) {
3389
+ } catch (e35) {
3210
3390
  return;
3211
3391
  }
3212
3392
  for (const entry of entries) {
@@ -3309,13 +3489,13 @@ function farmEnvironmentFunctionsPlugin(options = {}) {
3309
3489
  let projectRoot = process.cwd();
3310
3490
  let sources;
3311
3491
  const routeSourceFiles = () => {
3312
- const clientRoutes = _optionalChain([farmApi, 'optionalAccess', _179 => _179.getProgrammaticClientRoutes, 'call', _180 => _180()]);
3313
- if (_optionalChain([sources, 'optionalAccess', _181 => _181.for]) !== clientRoutes || !sources) {
3492
+ const clientRoutes = _optionalChain([farmApi, 'optionalAccess', _193 => _193.getProgrammaticClientRoutes, 'call', _194 => _194()]);
3493
+ if (_optionalChain([sources, 'optionalAccess', _195 => _195.for]) !== clientRoutes || !sources) {
3314
3494
  sources = {
3315
3495
  for: clientRoutes,
3316
3496
  files: /* @__PURE__ */ new Set([
3317
3497
  ...routesFiles,
3318
- ...[..._nullishCoalesce(_optionalChain([clientRoutes, 'optionalAccess', _182 => _182.routeSourceFiles]), () => ( []))].map(resolvedFile)
3498
+ ...[..._nullishCoalesce(_optionalChain([clientRoutes, 'optionalAccess', _196 => _196.routeSourceFiles]), () => ( []))].map(resolvedFile)
3319
3499
  ])
3320
3500
  };
3321
3501
  }
@@ -3328,7 +3508,7 @@ function farmEnvironmentFunctionsPlugin(options = {}) {
3328
3508
  configResolved(config) {
3329
3509
  isBuild = config.command === "build";
3330
3510
  projectRoot = config.root;
3331
- farmApi = _optionalChain([config, 'access', _183 => _183.plugins, 'access', _184 => _184.find, 'call', _185 => _185((plugin) => plugin.name === "farm"), 'optionalAccess', _186 => _186.api]);
3511
+ farmApi = _optionalChain([config, 'access', _197 => _197.plugins, 'access', _198 => _198.find, 'call', _199 => _199((plugin) => plugin.name === "farm"), 'optionalAccess', _200 => _200.api]);
3332
3512
  sources = void 0;
3333
3513
  routesFiles = new Set(
3334
3514
  _chunk5Y2P454Ocjs.getFarmSourceRoots.call(void 0, { ...options, root: _nullishCoalesce(options.root, () => ( config.root)) }).flatMap(
@@ -3341,20 +3521,17 @@ function farmEnvironmentFunctionsPlugin(options = {}) {
3341
3521
  transform(code, id, transformOptions) {
3342
3522
  const environment = resolveBuildEnvironment(
3343
3523
  this,
3344
- _optionalChain([transformOptions, 'optionalAccess', _187 => _187.ssr])
3524
+ _optionalChain([transformOptions, 'optionalAccess', _201 => _201.ssr])
3345
3525
  );
3346
3526
  const parse2 = (source) => this.parse(source);
3347
3527
  const result = transformEnvironmentFunctions({ code, id, environment, parse: parse2 });
3348
3528
  if (environment === "client" && !isBuild && !_chunkE7QOEV5Zcjs.parseProgrammaticRouteModuleId.call(void 0, id) && routeSourceFiles().has(moduleFile(id)) && !isProgrammaticRouteActionProxy(code)) {
3349
3529
  this.error(routeSourceError(moduleFile(id)));
3350
3530
  }
3351
- if (environment === "server" && _chunkZIHWAN55cjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([options, 'access', _188 => _188.experimental, 'optionalAccess', _189 => _189.serverComponents])) === "islands" && isApplicationScript(id)) {
3531
+ if (environment === "server" && _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([options, 'access', _202 => _202.experimental, 'optionalAccess', _203 => _203.serverComponents])) === "islands" && isApplicationScript(id)) {
3352
3532
  const file = id.split("?", 1)[0];
3353
3533
  const root = _fs.realpathSync.call(void 0, _nullishCoalesce(options.root, () => ( projectRoot)));
3354
- const clientCode = getFarmClientReachableModules(
3355
- _path2.default.resolve(root, options.srcDir || "src"),
3356
- root
3357
- ).has(_path2.default.resolve(file));
3534
+ const clientCode = getFarmClientReachableModules(root, root).has(_path2.default.resolve(file)) || _fs.existsSync.call(void 0, file) && hasUseClientDirective(_fs.readFileSync.call(void 0, file, "utf8"));
3358
3535
  const reached = clientCode ? null : findFarmClientOnlyImport(code, file);
3359
3536
  if (reached) {
3360
3537
  const chain = reached.chain.map((step) => _path2.default.relative(root, step)).join(" -> ");
@@ -3372,7 +3549,7 @@ function farmEnvironmentFunctionsPlugin(options = {}) {
3372
3549
  for (const id of this.getModuleIds()) {
3373
3550
  if (_chunkE7QOEV5Zcjs.parseProgrammaticRouteModuleId.call(void 0, id)) {
3374
3551
  const chain = findClientNodeBuiltinChain(id, (moduleId) => {
3375
- return _optionalChain([this, 'access', _190 => _190.getModuleInfo, 'call', _191 => _191(moduleId), 'optionalAccess', _192 => _192.importedIds]);
3552
+ return _optionalChain([this, 'access', _204 => _204.getModuleInfo, 'call', _205 => _205(moduleId), 'optionalAccess', _206 => _206.importedIds]);
3376
3553
  });
3377
3554
  if (chain) {
3378
3555
  this.error(
@@ -3383,8 +3560,8 @@ function farmEnvironmentFunctionsPlugin(options = {}) {
3383
3560
  }
3384
3561
  if (!forbidden.has(moduleFile(id))) continue;
3385
3562
  const info = this.getModuleInfo(id);
3386
- if (isProgrammaticRouteActionProxy(_optionalChain([info, 'optionalAccess', _193 => _193.code]))) continue;
3387
- this.error(routeSourceError(moduleFile(id), _optionalChain([info, 'optionalAccess', _194 => _194.importers, 'access', _195 => _195.map, 'call', _196 => _196(moduleFile)])));
3563
+ if (isProgrammaticRouteActionProxy(_optionalChain([info, 'optionalAccess', _207 => _207.code]))) continue;
3564
+ this.error(routeSourceError(moduleFile(id), _optionalChain([info, 'optionalAccess', _208 => _208.importers, 'access', _209 => _209.map, 'call', _210 => _210(moduleFile)])));
3388
3565
  }
3389
3566
  }
3390
3567
  };
@@ -3398,13 +3575,13 @@ function moduleFile(id) {
3398
3575
  function resolvedFile(filePath) {
3399
3576
  try {
3400
3577
  return moduleFile(_fs.realpathSync.call(void 0, filePath));
3401
- } catch (e32) {
3578
+ } catch (e36) {
3402
3579
  return moduleFile(filePath);
3403
3580
  }
3404
3581
  }
3405
3582
  function resolveBuildEnvironment(context, ssr) {
3406
- if (_optionalChain([context, 'access', _197 => _197.environment, 'optionalAccess', _198 => _198.name]) === "client") return "client";
3407
- if (_optionalChain([context, 'access', _199 => _199.environment, 'optionalAccess', _200 => _200.name]) === "rsc" || _optionalChain([context, 'access', _201 => _201.environment, 'optionalAccess', _202 => _202.name]) === "ssr") {
3583
+ if (_optionalChain([context, 'access', _211 => _211.environment, 'optionalAccess', _212 => _212.name]) === "client") return "client";
3584
+ if (_optionalChain([context, 'access', _213 => _213.environment, 'optionalAccess', _214 => _214.name]) === "rsc" || _optionalChain([context, 'access', _215 => _215.environment, 'optionalAccess', _216 => _216.name]) === "ssr") {
3408
3585
  return "server";
3409
3586
  }
3410
3587
  return ssr ? "server" : "client";
@@ -3701,4 +3878,8 @@ function transformError(id, message) {
3701
3878
 
3702
3879
 
3703
3880
 
3704
- 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.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.ensureFarmPackageClientReference = ensureFarmPackageClientReference; exports.rewriteFarmPackageClientImports = rewriteFarmPackageClientImports; exports.withPackageClientBoundaryCache = withPackageClientBoundaryCache; exports.usePackageClientBoundaryCacheFile = usePackageClientBoundaryCacheFile; exports.resolveModuleSourcePath = resolveModuleSourcePath; exports.getFarmClientHydrationPlanOptions = getFarmClientHydrationPlanOptions; exports.describeSuppressedAsyncHydration = describeSuppressedAsyncHydration; exports.resolveFarmIsolatedClientHydrationMode = resolveFarmIsolatedClientHydrationMode; exports.hasUseClientDirective = hasUseClientDirective; exports.getIslandStrategyExport = getIslandStrategyExport; exports.stripUseClientDirective = stripUseClientDirective; 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.resolveImportedModule = resolveImportedModule; exports.isFarmPackageClientBoundary = isFarmPackageClientBoundary; exports.collectFarmClientPackageImports = collectFarmClientPackageImports; exports.collectFarmServerBundledPackages = collectFarmServerBundledPackages; exports.invalidateFarmClientReachableModules = invalidateFarmClientReachableModules; exports.getFarmClientReachableModules = getFarmClientReachableModules; exports.resolveFarmClientOptimizeDeps = resolveFarmClientOptimizeDeps; exports.transformEnvironmentFunctions = transformEnvironmentFunctions; exports.farmEnvironmentFunctionsPlugin = farmEnvironmentFunctionsPlugin;
3881
+
3882
+
3883
+
3884
+
3885
+ 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.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.ensureFarmPackageClientReference = ensureFarmPackageClientReference; exports.ensureFarmInternalClientReference = ensureFarmInternalClientReference; exports.rewriteFarmPackageClientImports = rewriteFarmPackageClientImports; exports.withPackageClientBoundaryCache = withPackageClientBoundaryCache; exports.usePackageClientBoundaryCacheFile = usePackageClientBoundaryCacheFile; exports.resolvePackageClientBoundaryCacheFile = resolvePackageClientBoundaryCacheFile; exports.runWithPackageClientBoundaryCacheFile = runWithPackageClientBoundaryCacheFile; exports.resolveModuleSourcePath = resolveModuleSourcePath; exports.getFarmClientHydrationPlanOptions = getFarmClientHydrationPlanOptions; exports.describeSuppressedAsyncHydration = describeSuppressedAsyncHydration; exports.resolveFarmIsolatedClientHydrationMode = resolveFarmIsolatedClientHydrationMode; exports.hasUseClientDirective = hasUseClientDirective; exports.getIslandStrategyExport = getIslandStrategyExport; exports.stripUseClientDirective = stripUseClientDirective; 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.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;