@farm.js/core 0.1.82 → 0.1.84

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 (253) hide show
  1. package/dist/{agent-mcp.d-C2Su3x4D.d.ts → agent-mcp.d-7uKdOttc.d.ts} +1 -1
  2. package/dist/{agent-mcp.d-Yak-LqRd.d.mts → agent-mcp.d-LChlR2au.d.mts} +1 -1
  3. package/dist/agent-runtime.d.mts +2 -1
  4. package/dist/agent-runtime.d.ts +2 -1
  5. package/dist/{analyzer-RPU2KG4J.mjs → analyzer-7RNO3XKC.mjs} +2 -2
  6. package/dist/analyzer-PFKA5NI6.cjs +17 -0
  7. package/dist/api/node.d.mts +4 -3
  8. package/dist/api/node.d.ts +4 -3
  9. package/dist/api/route-manager.d.mts +4 -3
  10. package/dist/api/route-manager.d.ts +4 -3
  11. package/dist/api/runtime.d.mts +3 -2
  12. package/dist/api/runtime.d.ts +3 -2
  13. package/dist/api.d.mts +5 -4
  14. package/dist/api.d.ts +5 -4
  15. package/dist/{app-manifest.d-DZyXaICz.d.ts → app-manifest.d-CRp21oAz.d.ts} +1 -1
  16. package/dist/{app-manifest.d-BcyOFMrg.d.mts → app-manifest.d-QMdmqqCr.d.mts} +1 -1
  17. package/dist/app-markdown.d.mts +3 -2
  18. package/dist/app-markdown.d.ts +3 -2
  19. package/dist/{app.d-CIoXsAbN.d.ts → app.d-CVPu_hoD.d.ts} +34 -4
  20. package/dist/{app.d-C0ePpuaG.d.mts → app.d-eSm7jgoc.d.mts} +34 -4
  21. package/dist/{chunk-B2PGVHBG.cjs → chunk-22BTYPIX.cjs} +4 -4
  22. package/dist/{chunk-BCTHOQPP.cjs → chunk-3OKSEJ33.cjs} +98 -10
  23. package/dist/{chunk-QSMUMK7Y.mjs → chunk-3WM7VBGW.mjs} +2 -2
  24. package/dist/{chunk-XMHERKSE.mjs → chunk-42IBGQTN.mjs} +5 -12
  25. package/dist/{chunk-RMPUEH5T.cjs → chunk-57EEWWUS.cjs} +2 -2
  26. package/dist/{chunk-Q2VOT3K2.cjs → chunk-5I4ZGKP2.cjs} +395 -333
  27. package/dist/{chunk-TPA2PV5J.mjs → chunk-5V6HSJFG.mjs} +24 -1
  28. package/dist/{chunk-RMLR5RMH.mjs → chunk-BCCCPFHQ.mjs} +92 -4
  29. package/dist/{chunk-LM2ZDNDD.cjs → chunk-BOEDYXAX.cjs} +30 -25
  30. package/dist/{chunk-NRCKBDYP.mjs → chunk-BRDGINBB.mjs} +153 -47
  31. package/dist/chunk-BUQR7KKO.mjs +17 -0
  32. package/dist/{chunk-63ZE6B6M.mjs → chunk-BZY3SRRD.mjs} +1 -1
  33. package/dist/{chunk-724WT3NI.mjs → chunk-CRE642TW.mjs} +1 -1
  34. package/dist/{chunk-JK26IMT7.cjs → chunk-CVZY4TLW.cjs} +1 -1
  35. package/dist/{chunk-ZIZRIZLP.mjs → chunk-CWUQBECF.mjs} +3 -1
  36. package/dist/{chunk-DAXU2NBE.mjs → chunk-DFDQGHPU.mjs} +104 -42
  37. package/dist/{chunk-AIPZDBP6.cjs → chunk-DSWSDDP2.cjs} +844 -553
  38. package/dist/{chunk-DRO3NXA3.cjs → chunk-EBSL5TW7.cjs} +203 -93
  39. package/dist/{chunk-CJDBTTLB.mjs → chunk-EDBIBO67.mjs} +18 -13
  40. package/dist/{chunk-BBVLOEND.cjs → chunk-F7JVO3OZ.cjs} +4 -4
  41. package/dist/chunk-FZ7OUN5M.cjs +30 -0
  42. package/dist/chunk-GLNVLCUH.cjs +426 -0
  43. package/dist/{chunk-5MMKNW7Q.cjs → chunk-H7REG7OX.cjs} +15 -8
  44. package/dist/{chunk-N2EFMN2K.cjs → chunk-HOQ2MYBJ.cjs} +10 -10
  45. package/dist/{chunk-OP5VI4TP.mjs → chunk-I5CVJ24H.mjs} +1 -1
  46. package/dist/{chunk-I4DR3HCH.mjs → chunk-INU4K4U4.mjs} +5 -5
  47. package/dist/{chunk-4X7LSGM6.mjs → chunk-IRJSZAJB.mjs} +1 -1
  48. package/dist/{chunk-EX6ZSN5P.cjs → chunk-IZYFP7IN.cjs} +17 -24
  49. package/dist/chunk-J6RFB324.cjs +17 -0
  50. package/dist/{chunk-47I2MYIR.mjs → chunk-KXVMWLTC.mjs} +484 -193
  51. package/dist/{chunk-UVV3I5QA.cjs → chunk-L2GUEYHR.cjs} +29 -6
  52. package/dist/{chunk-VMBIKDKW.cjs → chunk-L3BSHASB.cjs} +6 -4
  53. package/dist/chunk-L5HDCDFT.mjs +426 -0
  54. package/dist/{chunk-GXLNARPO.mjs → chunk-M5XU22PQ.mjs} +1 -1
  55. package/dist/chunk-M6AJZ4XR.mjs +30 -0
  56. package/dist/chunk-MAPHNGTF.cjs +98 -0
  57. package/dist/{chunk-RE5E2G5S.cjs → chunk-MNUYXZV7.cjs} +2 -18
  58. package/dist/{chunk-C3VCYOU4.mjs → chunk-MUUDHWQZ.mjs} +1 -1
  59. package/dist/{chunk-YSU3WCW6.mjs → chunk-MYSH5Y4E.mjs} +1 -1
  60. package/dist/{chunk-OMB7UGVW.mjs → chunk-NLHSKKTT.mjs} +14 -9
  61. package/dist/{chunk-ARORZ3MH.cjs → chunk-OFVBMS6I.cjs} +439 -333
  62. package/dist/{chunk-5MUFW5UU.cjs → chunk-OP7BIEUW.cjs} +2 -2
  63. package/dist/{chunk-I4WZRG73.mjs → chunk-RB5IGN3N.mjs} +13 -6
  64. package/dist/chunk-RJBUI5AN.mjs +18 -0
  65. package/dist/chunk-RQ6XX5IN.mjs +98 -0
  66. package/dist/{chunk-EJCVG25Z.mjs → chunk-S3R4JDRO.mjs} +17 -9
  67. package/dist/{chunk-WFVSAT7Y.cjs → chunk-T7HGXF7D.cjs} +3 -3
  68. package/dist/{chunk-HHQEKLZL.cjs → chunk-USMRAC72.cjs} +36 -31
  69. package/dist/{chunk-SM2SYWAR.cjs → chunk-XJDB564A.cjs} +18 -10
  70. package/dist/{chunk-EL2Z6YFZ.mjs → chunk-XLULEFRW.mjs} +180 -70
  71. package/dist/{chunk-6BPFIYGY.cjs → chunk-YU6VL7H5.cjs} +3 -3
  72. package/dist/{chunk-CD5Z7RR5.cjs → chunk-Z37PDUJR.cjs} +4 -4
  73. package/dist/{cli-runtime.d-Hnvvadz7.d.mts → cli-runtime.d-C7aMfoTq.d.mts} +8 -6
  74. package/dist/{cli-runtime.d-I0MphTbc.d.ts → cli-runtime.d-DaElKjaL.d.ts} +8 -6
  75. package/dist/{client-component.d-DapRqtSC.d.mts → client-component.d-DLMCzmUx.d.mts} +1 -1
  76. package/dist/{client-component.d-5QEvtJsg.d.ts → client-component.d-DLknFP8l.d.ts} +1 -1
  77. package/dist/{client-plugins.d-DcmDzcSC.d.ts → client-plugins.d-BVXjyIkY.d.ts} +14 -0
  78. package/dist/{client-plugins.d-C1WM3ieD.d.mts → client-plugins.d-BwKwuO_0.d.mts} +14 -0
  79. package/dist/client-plugins.d.mts +2 -1
  80. package/dist/client-plugins.d.ts +2 -1
  81. package/dist/client.cjs +4 -3
  82. package/dist/client.d.mts +10 -9
  83. package/dist/client.d.ts +10 -9
  84. package/dist/client.mjs +3 -2
  85. package/dist/config.d.mts +2 -1
  86. package/dist/config.d.ts +2 -1
  87. package/dist/desktop.d.mts +3 -2
  88. package/dist/desktop.d.ts +3 -2
  89. package/dist/{devtools-5B7NZE6F.cjs → devtools-4SVIRV4P.cjs} +7 -7
  90. package/dist/{devtools-C5GXZZ7E.mjs → devtools-MWQA5LVN.mjs} +5 -5
  91. package/dist/docs.cjs +10 -9
  92. package/dist/docs.d.mts +15 -6
  93. package/dist/docs.d.ts +15 -6
  94. package/dist/docs.mjs +9 -8
  95. package/dist/environment/vite.cjs +5 -5
  96. package/dist/environment/vite.d.mts +1 -0
  97. package/dist/environment/vite.d.ts +1 -0
  98. package/dist/environment/vite.mjs +4 -4
  99. package/dist/{generate-route-types.d-CaGMIaNI.d.mts → generate-route-types.d-BFOMM8Ef.d.mts} +3 -0
  100. package/dist/{generate-route-types.d-B76M5R11.d.ts → generate-route-types.d-C2m8myHb.d.ts} +3 -0
  101. package/dist/{handler.d-B8bPCBzl.d.mts → handler.d-BKTWzzNA.d.mts} +1 -1
  102. package/dist/{handler.d-Cliwo6Nu.d.ts → handler.d-Dzpyg3-N.d.ts} +1 -1
  103. package/dist/{headers.d-CVwSpSGX.d.mts → headers.d-5opjyhXw.d.mts} +1 -1
  104. package/dist/{headers.d-C_btqjV6.d.ts → headers.d-PZyXcDAH.d.ts} +1 -1
  105. package/dist/index.cjs +32 -29
  106. package/dist/{index.d-DFuMZk9-.d.mts → index.d-C0Mie66f.d.mts} +1 -1
  107. package/dist/{index.d-hOEbMcLk.d.ts → index.d-DV2q-0mE.d.ts} +1 -1
  108. package/dist/index.d.mts +26 -25
  109. package/dist/index.d.ts +26 -25
  110. package/dist/index.mjs +32 -29
  111. package/dist/integrations/orm.d.mts +2 -1
  112. package/dist/integrations/orm.d.ts +2 -1
  113. package/dist/integrations.d.mts +2 -1
  114. package/dist/integrations.d.ts +2 -1
  115. package/dist/internal/app-markdown-runtime.d.mts +3 -2
  116. package/dist/internal/app-markdown-runtime.d.ts +3 -2
  117. package/dist/internal/build-runtime.cjs +28 -27
  118. package/dist/internal/build-runtime.d.mts +5 -4
  119. package/dist/internal/build-runtime.d.ts +5 -4
  120. package/dist/internal/build-runtime.mjs +27 -26
  121. package/dist/internal/cli-runtime.cjs +9 -9
  122. package/dist/internal/cli-runtime.d.mts +8 -7
  123. package/dist/internal/cli-runtime.d.ts +8 -7
  124. package/dist/internal/cli-runtime.mjs +8 -8
  125. package/dist/internal/client-error-overlay.cjs +4 -4
  126. package/dist/internal/client-error-overlay.mjs +1 -1
  127. package/dist/internal/client-runtime.d.mts +8 -42
  128. package/dist/internal/client-runtime.d.ts +8 -42
  129. package/dist/internal/compression-runtime.d.mts +2 -1
  130. package/dist/internal/compression-runtime.d.ts +2 -1
  131. package/dist/internal/config-runtime.cjs +7 -7
  132. package/dist/internal/config-runtime.d.mts +6 -5
  133. package/dist/internal/config-runtime.d.ts +6 -5
  134. package/dist/internal/config-runtime.mjs +6 -6
  135. package/dist/internal/infra-analytics-runtime.cjs +6 -6
  136. package/dist/internal/infra-analytics-runtime.mjs +4 -4
  137. package/dist/internal/islands-action-client.cjs +18 -0
  138. package/dist/internal/islands-action-client.d.mts +18 -0
  139. package/dist/internal/islands-action-client.d.ts +18 -0
  140. package/dist/internal/islands-action-client.mjs +18 -0
  141. package/dist/internal/islands-runtime.cjs +3 -8
  142. package/dist/internal/islands-runtime.mjs +4 -9
  143. package/dist/internal/islx-actions-client.cjs +4 -3
  144. package/dist/internal/islx-actions-client.mjs +3 -2
  145. package/dist/internal/islx-actions-server.d.mts +0 -2
  146. package/dist/internal/islx-actions-server.d.ts +0 -2
  147. package/dist/internal/islx-client.cjs +13 -1
  148. package/dist/internal/islx-client.d.mts +11 -0
  149. package/dist/internal/islx-client.d.ts +11 -0
  150. package/dist/internal/islx-client.mjs +14 -0
  151. package/dist/internal/metadata-image-runtime.d.mts +1 -0
  152. package/dist/internal/metadata-image-runtime.d.ts +1 -0
  153. package/dist/internal/native-server-fns.cjs +4 -4
  154. package/dist/internal/native-server-fns.mjs +3 -3
  155. package/dist/internal/product-telemetry-runtime.cjs +3 -3
  156. package/dist/internal/product-telemetry-runtime.mjs +2 -2
  157. package/dist/internal/production-runtime.cjs +13 -13
  158. package/dist/internal/production-runtime.d.mts +11 -11
  159. package/dist/internal/production-runtime.d.ts +11 -11
  160. package/dist/internal/production-runtime.mjs +19 -19
  161. package/dist/internal/renderer-islands.cjs +47 -0
  162. package/dist/internal/renderer-islands.d.mts +32 -0
  163. package/dist/internal/renderer-islands.d.ts +32 -0
  164. package/dist/internal/renderer-islands.mjs +47 -0
  165. package/dist/internal/spa-router.d.mts +3 -3
  166. package/dist/internal/spa-router.d.ts +3 -3
  167. package/dist/internal/start-manifest.d.mts +2 -1
  168. package/dist/internal/start-manifest.d.ts +2 -1
  169. package/dist/island-runtime.d-BA7EPo1v.d.ts +38 -0
  170. package/dist/island-runtime.d-BBS_YUSX.d.mts +38 -0
  171. package/dist/markdown.d.mts +2 -1
  172. package/dist/markdown.d.ts +2 -1
  173. package/dist/middleware.d.mts +2 -1
  174. package/dist/middleware.d.ts +2 -1
  175. package/dist/mobile.d.mts +6 -3
  176. package/dist/mobile.d.ts +6 -3
  177. package/dist/{mount.d-DLeYxeRR.d.mts → mount.d-CZ_qL1iS.d.mts} +1 -1
  178. package/dist/{mount.d-CAovYKfs.d.ts → mount.d-gWul1GA1.d.ts} +1 -1
  179. package/dist/{navigation-delegate.d-Chv93QS6.d.mts → navigation-delegate.d-BBTzhJLj.d.mts} +1 -1
  180. package/dist/{navigation-delegate.d-BLM-8Q3Z.d.ts → navigation-delegate.d-BZsYEAet.d.ts} +1 -1
  181. package/dist/navigation.d.mts +5 -5
  182. package/dist/navigation.d.ts +5 -5
  183. package/dist/plugin.cjs +23 -22
  184. package/dist/plugin.d.mts +6 -6
  185. package/dist/plugin.d.ts +6 -6
  186. package/dist/plugin.mjs +22 -21
  187. package/dist/{render-plan.d-BSTjTH8h.d.ts → render-plan.d-AaJsYPX-.d.ts} +1 -1
  188. package/dist/{render-plan.d-CK5Lggyb.d.mts → render-plan.d-bnWxS12w.d.mts} +1 -1
  189. package/dist/renderer-client.cjs +6 -5
  190. package/dist/renderer-client.d.mts +8 -7
  191. package/dist/renderer-client.d.ts +8 -7
  192. package/dist/renderer-client.mjs +2 -1
  193. package/dist/renderer.cjs +12 -2
  194. package/dist/renderer.d.mts +167 -4
  195. package/dist/renderer.d.ts +167 -4
  196. package/dist/renderer.mjs +11 -1
  197. package/dist/{request.d-BhggxQf3.d.mts → request.d-C2HOn3Hi.d.mts} +1 -1
  198. package/dist/{request.d-CyJS9bjm.d.ts → request.d-CAeitOG1.d.ts} +1 -1
  199. package/dist/request.d.mts +3 -2
  200. package/dist/request.d.ts +3 -2
  201. package/dist/{route-rendering.d-BLPPmI5I.d.ts → route-rendering.d-A1dIkUK5.d.ts} +1 -1
  202. package/dist/{route-rendering.d-CUpG2mZJ.d.mts → route-rendering.d-CYA-ulnX.d.mts} +1 -1
  203. package/dist/{router.d-2NQM1Kgw.d.mts → router.d-8lxnzlkr.d.mts} +1 -1
  204. package/dist/{router.d-0X2Ki6rf.d.ts → router.d-A_Yt6jYz.d.ts} +1 -1
  205. package/dist/{routes.d-CCccJRrp.d.mts → routes.d-BWvpUoYu.d.mts} +1 -1
  206. package/dist/{routes.d-b7khoRoU.d.ts → routes.d-D7RWvfqL.d.ts} +1 -1
  207. package/dist/routes.d.mts +2 -1
  208. package/dist/routes.d.ts +2 -1
  209. package/dist/{rsc-pipeline-5AOF64FL.cjs → rsc-pipeline-OWBEZ7HB.cjs} +10 -10
  210. package/dist/{rsc-pipeline-DNRLYOJ7.mjs → rsc-pipeline-UT3Z2GDO.mjs} +9 -9
  211. package/dist/{runtime-EHG2FRXZ.mjs → runtime-F5I3WY3B.mjs} +12 -12
  212. package/dist/{runtime-ZVHG5SRB.cjs → runtime-SRMQ46SK.cjs} +15 -15
  213. package/dist/{runtime.d-CXuwkUgr.d.ts → runtime.d-BPyvWrgQ.d.ts} +1 -1
  214. package/dist/{runtime.d-CaFXcu_Q.d.mts → runtime.d-C_rZ9_DD.d.mts} +1 -1
  215. package/dist/{server-components-status.d-Cp7zvBm5.d.mts → server-components-status.d-BpxiEMQE.d.mts} +1 -1
  216. package/dist/{server-components-status.d-BdeFD8ZH.d.ts → server-components-status.d-C2UEKJn7.d.ts} +1 -1
  217. package/dist/server-plugins.d.mts +4 -3
  218. package/dist/server-plugins.d.ts +4 -3
  219. package/dist/server-query-call.d-rVM_lsYk.d.mts +15 -0
  220. package/dist/server-query-call.d-rVM_lsYk.d.ts +15 -0
  221. package/dist/server-query-client.cjs +5 -3
  222. package/dist/server-query-client.d.mts +3 -2
  223. package/dist/server-query-client.d.ts +3 -2
  224. package/dist/server-query-client.mjs +5 -3
  225. package/dist/{server-query-runtime.d-DXRNhX_3.d.ts → server-query-runtime.d-BlHd90D0.d.ts} +2 -8
  226. package/dist/{server-query-runtime.d-aP52iuL5.d.mts → server-query-runtime.d-CCLGkQtE.d.mts} +2 -8
  227. package/dist/server.cjs +52 -52
  228. package/dist/server.d.mts +12 -12
  229. package/dist/server.d.ts +12 -12
  230. package/dist/server.mjs +30 -30
  231. package/dist/{spa-router.d-l3G38xHa.d.mts → spa-router.d-BD-6WX1R.d.mts} +2 -2
  232. package/dist/{spa-router.d-Bjgl-Osi.d.ts → spa-router.d-Cw5i_15e.d.ts} +2 -2
  233. package/dist/{ssg.d-DDca17Lc.d.ts → ssg.d-Bifiq0EL.d.ts} +2 -2
  234. package/dist/{ssg.d-RnlHOqUL.d.mts → ssg.d-CCE9aob5.d.mts} +2 -2
  235. package/dist/{store-core.d-BaOUOPf7.d.ts → store-core.d-5tVn5vi1.d.ts} +3 -3
  236. package/dist/{store-core.d-BZjuC6Zc.d.mts → store-core.d-BN2MxSG9.d.mts} +3 -3
  237. package/dist/testing.d.mts +2 -1
  238. package/dist/testing.d.ts +2 -1
  239. package/dist/{utils.d-D8TWmpWo.d.ts → utils.d-BUjpSNIO.d.ts} +1 -1
  240. package/dist/{utils.d-tdzw0_zQ.d.mts → utils.d-wGPLeVbq.d.mts} +1 -1
  241. package/dist/version.cjs +2 -2
  242. package/dist/version.mjs +1 -1
  243. package/dist/vite.cjs +23 -22
  244. package/dist/vite.d.mts +12 -6
  245. package/dist/vite.d.ts +12 -6
  246. package/dist/vite.mjs +22 -21
  247. package/package.json +13 -3
  248. package/dist/analyzer-LV23T6QN.cjs +0 -17
  249. package/dist/chunk-4QENVMG7.mjs +0 -34
  250. package/dist/chunk-AUFEM3FB.mjs +0 -229
  251. package/dist/chunk-S7WZUK3B.cjs +0 -229
  252. package/dist/{chunk-NEKO3HM2.cjs → chunk-4B6YJ5DS.cjs} +2 -2
  253. package/dist/{chunk-CA2HBLXP.mjs → chunk-4EEAPBNV.mjs} +3 -3
@@ -6,16 +6,18 @@ import {
6
6
  isFarmIslandStrategy
7
7
  } from "./chunk-S32PDOLO.mjs";
8
8
  import {
9
- getFarmProjectSourceDir,
10
- resolveFarmServerComponentsMode
11
- } from "./chunk-4QENVMG7.mjs";
9
+ getFarmProjectSourceDir
10
+ } from "./chunk-RJBUI5AN.mjs";
12
11
  import {
13
12
  getFarmSourceRoots
14
13
  } from "./chunk-Z3RM3VA2.mjs";
15
14
  import {
15
+ createFarmRendererHookError,
16
16
  getFarmRendererComponentExtensions,
17
- isReactRenderer
18
- } from "./chunk-RMLR5RMH.mjs";
17
+ isReactRenderer,
18
+ readFarmRendererHydration,
19
+ resolveFarmServerComponentsMode
20
+ } from "./chunk-BCCCPFHQ.mjs";
19
21
  import {
20
22
  PROGRAMMATIC_ROUTE_FILE_NAMES,
21
23
  getProgrammaticRouteDefinitionSource,
@@ -26,11 +28,11 @@ import {
26
28
  } from "./chunk-U6GMCDRS.mjs";
27
29
  import {
28
30
  FARM_VERSION
29
- } from "./chunk-OP5VI4TP.mjs";
31
+ } from "./chunk-I5CVJ24H.mjs";
30
32
 
31
33
  // src/environment-vite.ts
32
34
  import { existsSync, readFileSync, realpathSync } from "fs";
33
- import path8 from "path";
35
+ import path9 from "path";
34
36
 
35
37
  // src/diagnostics.ts
36
38
  import { TraceMap, originalPositionFor } from "@jridgewell/trace-mapping";
@@ -1606,8 +1608,8 @@ function toModuleFile(file) {
1606
1608
  }
1607
1609
 
1608
1610
  // src/utils/client-component.ts
1609
- import fs6 from "fs";
1610
- import path7 from "path";
1611
+ import fs7 from "fs";
1612
+ import path8 from "path";
1611
1613
  import { fileURLToPath as fileURLToPath2 } from "url";
1612
1614
 
1613
1615
  // src/islands-package-references.ts
@@ -2330,6 +2332,101 @@ function dropLatestPackageClientBoundaryCache() {
2330
2332
  latestDevCache = void 0;
2331
2333
  }
2332
2334
 
2335
+ // src/utils/renderer-hydration.ts
2336
+ import fs6 from "fs";
2337
+ import path7 from "path";
2338
+ var scopes = /* @__PURE__ */ new Map();
2339
+ function realPath(file) {
2340
+ try {
2341
+ return fs6.realpathSync(file);
2342
+ } catch {
2343
+ return path7.resolve(file);
2344
+ }
2345
+ }
2346
+ function setFarmRendererHydrationScope(roots, renderer, routeModules) {
2347
+ const keys = roots.map(realPath);
2348
+ const ruleSetsHydration = routeModules.some(
2349
+ (entry) => entry.hydration?.hydrate !== void 0 || entry.hydration?.strategy !== void 0
2350
+ );
2351
+ if (!renderer?.hydration && !ruleSetsHydration) {
2352
+ for (const key of keys) scopes.delete(key);
2353
+ return () => {
2354
+ };
2355
+ }
2356
+ const scope = {
2357
+ renderer,
2358
+ extensions: new Set((renderer.componentExtensions ?? []).map(normalizeExtension)),
2359
+ routeModules: new Map(
2360
+ routeModules.map((entry) => [
2361
+ realPath(entry.modulePath),
2362
+ { kind: entry.kind, hydration: entry.hydration ?? {} }
2363
+ ])
2364
+ )
2365
+ };
2366
+ for (const key of keys) scopes.set(key, scope);
2367
+ return () => {
2368
+ for (const key of keys) if (scopes.get(key) === scope) scopes.delete(key);
2369
+ };
2370
+ }
2371
+ function normalizeExtension(extension) {
2372
+ const lowered = extension.trim().toLowerCase();
2373
+ return lowered.startsWith(".") ? lowered : `.${lowered}`;
2374
+ }
2375
+ function findScope(file) {
2376
+ if (scopes.size === 0) return null;
2377
+ let match = null;
2378
+ for (const [root, scope] of scopes) {
2379
+ if (file !== root && !file.startsWith(`${root}${path7.sep}`)) continue;
2380
+ if (!match || root.length > match.length) match = { length: root.length, scope };
2381
+ }
2382
+ return match?.scope ?? null;
2383
+ }
2384
+ function resolveFarmRendererModuleHydration(content, sourcePath, readSource) {
2385
+ if (scopes.size === 0) return null;
2386
+ const file = realPath(sourcePath);
2387
+ const scope = findScope(file);
2388
+ if (!scope) return null;
2389
+ const route = scope.routeModules.get(file);
2390
+ const options = scope.renderer.hydration;
2391
+ const own = options?.resolve && scope.extensions.has(path7.extname(file).toLowerCase()) ? readOwnHydration(scope, content, file) : {};
2392
+ if (!route && own.hydrate === void 0 && own.strategy === void 0) return null;
2393
+ const source = readSource();
2394
+ const where = `${file} sets its hydration twice`;
2395
+ if (own.hydrate !== void 0 && source.hydrate !== void 0 && own.hydrate !== source.hydrate) {
2396
+ throw new Error(
2397
+ `${where}: \`export const hydrate = ${source.hydrate}\` and renderer \`${scope.renderer.name}\`'s syntax, which says ${own.hydrate}. Keep one of them.`
2398
+ );
2399
+ }
2400
+ if (own.strategy !== void 0 && source.strategy !== null && own.strategy !== source.strategy) {
2401
+ throw new Error(
2402
+ `${where}: \`export const island = "${source.strategy}"\` and renderer \`${scope.renderer.name}\`'s syntax, which says "${own.strategy}". Keep one of them.`
2403
+ );
2404
+ }
2405
+ const kindDefault = route?.kind === "page" ? options?.pages : route?.kind === "layout" ? options?.layouts : void 0;
2406
+ const hydrate = own.hydrate ?? source.hydrate ?? route?.hydration.hydrate ?? kindDefault ?? false;
2407
+ const strategy = own.strategy ?? source.strategy ?? route?.hydration.strategy ?? ((hydrate || source.clientDirective) && route ? options?.strategy : void 0) ?? null;
2408
+ return { hydrate, strategy };
2409
+ }
2410
+ function readOwnHydration(scope, content, file) {
2411
+ const where = `Renderer \`${scope.renderer.name}\` hydration.resolve() for ${file}`;
2412
+ let value;
2413
+ try {
2414
+ value = scope.renderer.hydration.resolve(content, file);
2415
+ } catch (error) {
2416
+ throw createFarmRendererHookError(
2417
+ `${where} threw: ${error instanceof Error ? error.message : String(error)}`,
2418
+ error
2419
+ );
2420
+ }
2421
+ if (value === null || value === void 0) return {};
2422
+ if (typeof value !== "object" || Array.isArray(value)) {
2423
+ throw new TypeError(
2424
+ `${where} returned ${JSON.stringify(value)}. Return \`{ hydrate?, strategy? }\`, or nothing to leave the file to Farm.`
2425
+ );
2426
+ }
2427
+ return readFarmRendererHydration(value, where);
2428
+ }
2429
+
2333
2430
  // src/utils/client-component.ts
2334
2431
  function readIfExists(filePath) {
2335
2432
  if (filePath.replace(/\\/g, "/").includes(FARM_CLIENT_REFERENCE_DIRECTORY)) {
@@ -2384,10 +2481,10 @@ function readSourceFile(filePath) {
2384
2481
  }
2385
2482
  function readSourceFileContents(filePath) {
2386
2483
  try {
2387
- if (!filePath || !fs6.existsSync(filePath)) {
2484
+ if (!filePath || !fs7.existsSync(filePath)) {
2388
2485
  return null;
2389
2486
  }
2390
- return fs6.readFileSync(filePath, "utf-8");
2487
+ return fs7.readFileSync(filePath, "utf-8");
2391
2488
  } catch {
2392
2489
  return null;
2393
2490
  }
@@ -2406,21 +2503,21 @@ function resolveModuleSourcePath(modulePath, root) {
2406
2503
  }
2407
2504
  if (modulePath.startsWith("/@fs/")) {
2408
2505
  const fsPath = withoutQuery.slice("/@fs/".length);
2409
- candidates.add(path7.normalize(/^[A-Za-z]:/.test(fsPath) ? fsPath : `/${fsPath}`));
2506
+ candidates.add(path8.normalize(/^[A-Za-z]:/.test(fsPath) ? fsPath : `/${fsPath}`));
2410
2507
  }
2411
2508
  }
2412
2509
  if (root && modulePath) {
2413
2510
  const normalized = withoutQuery.replace(/^\/+/, "");
2414
- candidates.add(path7.join(root, normalized));
2415
- candidates.add(path7.resolve(root, normalized));
2511
+ candidates.add(path8.join(root, normalized));
2512
+ candidates.add(path8.resolve(root, normalized));
2416
2513
  }
2417
2514
  if (withoutQuery?.startsWith("/src/")) {
2418
2515
  const normalized = withoutQuery.replace(/^\/+/, "");
2419
- candidates.add(path7.join(process.cwd(), normalized));
2420
- candidates.add(path7.resolve(process.cwd(), normalized));
2516
+ candidates.add(path8.join(process.cwd(), normalized));
2517
+ candidates.add(path8.resolve(process.cwd(), normalized));
2421
2518
  }
2422
2519
  for (const candidate of candidates) {
2423
- if (fs6.existsSync(candidate)) {
2520
+ if (fs7.existsSync(candidate)) {
2424
2521
  return candidate;
2425
2522
  }
2426
2523
  }
@@ -2437,8 +2534,8 @@ var FARM_ISOLATED_HYDRATION_MAX_BOUNDARIES = 4;
2437
2534
  function isolatedHydrationBoundaryLimit() {
2438
2535
  const benchmarkRoot = process.env.FARM_INTERNAL_ISOLATED_HYDRATION_BENCHMARK_ROOT;
2439
2536
  const benchmarkLimit = Number(process.env.FARM_INTERNAL_ISOLATED_HYDRATION_BENCHMARK_LIMIT);
2440
- const resolvedBenchmarkRoot = benchmarkRoot ? path7.resolve(benchmarkRoot) : null;
2441
- const isBenchmarkFixture = process.env.FARM_INTERNAL_BENCHMARK === "isolated-hydration" && resolvedBenchmarkRoot !== null && (process.cwd() === resolvedBenchmarkRoot || process.cwd().startsWith(`${resolvedBenchmarkRoot}${path7.sep}`));
2537
+ const resolvedBenchmarkRoot = benchmarkRoot ? path8.resolve(benchmarkRoot) : null;
2538
+ const isBenchmarkFixture = process.env.FARM_INTERNAL_BENCHMARK === "isolated-hydration" && resolvedBenchmarkRoot !== null && (process.cwd() === resolvedBenchmarkRoot || process.cwd().startsWith(`${resolvedBenchmarkRoot}${path8.sep}`));
2442
2539
  return isBenchmarkFixture && Number.isSafeInteger(benchmarkLimit) && benchmarkLimit > FARM_ISOLATED_HYDRATION_MAX_BOUNDARIES ? benchmarkLimit : FARM_ISOLATED_HYDRATION_MAX_BOUNDARIES;
2443
2540
  }
2444
2541
  var RESOLVABLE_SOURCE_EXTENSIONS = [
@@ -2751,6 +2848,18 @@ function parseClientModuleMetadata(content, inspectIslandExport, sourcePath) {
2751
2848
  if (inspectIslandExport && hydrate && hydrate.value === null) {
2752
2849
  throw new Error(formatFarmHydrateExportError(hydrate, sourcePath));
2753
2850
  }
2851
+ const rendererHydration = inspectIslandExport && sourcePath ? resolveFarmRendererModuleHydration(content, sourcePath, () => ({
2852
+ hydrate: typeof hydrate?.value === "boolean" ? hydrate.value : void 0,
2853
+ strategy: getIslandStrategyExport(content),
2854
+ clientDirective: isClientComponent
2855
+ })) : null;
2856
+ if (rendererHydration) {
2857
+ return {
2858
+ isClientComponent,
2859
+ hasHydrateExport: rendererHydration.hydrate,
2860
+ islandStrategy: rendererHydration.strategy
2861
+ };
2862
+ }
2754
2863
  const hasHydrate = hydrate?.value === true;
2755
2864
  return {
2756
2865
  isClientComponent,
@@ -2781,7 +2890,7 @@ function getFarmClientRenderingBindings(code, file, root) {
2781
2890
  for (const [specifier, locals] of getStaticImportBindings(code)) {
2782
2891
  const imported = resolveImportedModule(file, specifier, root);
2783
2892
  if (!imported.path) continue;
2784
- const metadata = imported.local ? inspectClientModuleMetadata(imported.path, root, /* @__PURE__ */ new Set([path7.resolve(file)]), false) : inspectPackageClientBoundary(imported.path, root, /* @__PURE__ */ new Set());
2893
+ const metadata = imported.local ? inspectClientModuleMetadata(imported.path, root, /* @__PURE__ */ new Set([path8.resolve(file)]), false) : inspectPackageClientBoundary(imported.path, root, /* @__PURE__ */ new Set());
2785
2894
  if (metadata.isClientComponent || metadata.shouldHydrate) bindings.push(...locals);
2786
2895
  }
2787
2896
  return bindings;
@@ -2826,7 +2935,7 @@ function getClientModuleMetadata(modulePath, root) {
2826
2935
  return inspectClientModuleMetadata(resolvedPath, root, /* @__PURE__ */ new Set(), true);
2827
2936
  }
2828
2937
  function getClientModuleHydrationPlanKey(modulePath, root, mode, options = {}) {
2829
- return `${path7.resolve(root)}\0${mode}\0${options.asyncOwnerIslands === true}\0${options.serverOwners === true}\0${options.serverTreeLayouts === true}\0${options.packageReferences === true}\0${path7.resolve(modulePath)}`;
2938
+ return `${path8.resolve(root)}\0${mode}\0${options.asyncOwnerIslands === true}\0${options.serverOwners === true}\0${options.serverTreeLayouts === true}\0${options.packageReferences === true}\0${path8.resolve(modulePath)}`;
2830
2939
  }
2831
2940
  function getClientModuleHydrationPlan(modulePath, root, mode = "off", options = {}) {
2832
2941
  const plan = planClientModuleHydration(modulePath, root, mode, options);
@@ -3405,7 +3514,7 @@ function collectIsolatedClientBoundaries(ownerPath, root, options = {}) {
3405
3514
  let fallbackReason;
3406
3515
  let fallbackHint;
3407
3516
  let costGuardExceeded = false;
3408
- const projectRoot = root ? path7.resolve(root) : void 0;
3517
+ const projectRoot = root ? path8.resolve(root) : void 0;
3409
3518
  const visit = (moduleSourcePath) => {
3410
3519
  if (fallbackReason) return 0;
3411
3520
  const cached = estimates.get(moduleSourcePath);
@@ -3599,13 +3708,13 @@ function inspectClientModuleMetadata(resolvedPath, root, visited, inspectIslandE
3599
3708
  }
3600
3709
  function farmWorkspaceServerEntry(entry) {
3601
3710
  const real = realpathOrSelf(entry);
3602
- if (real.split(path7.sep).includes("node_modules")) return null;
3711
+ if (real.split(path8.sep).includes("node_modules")) return null;
3603
3712
  if (parseClientModuleMetadata(readIfExists(real), false).isClientComponent) return null;
3604
3713
  return real;
3605
3714
  }
3606
3715
  function realpathOrSelf(file) {
3607
3716
  try {
3608
- return fs6.realpathSync(file);
3717
+ return fs7.realpathSync(file);
3609
3718
  } catch {
3610
3719
  return file;
3611
3720
  }
@@ -3650,7 +3759,7 @@ function traversePackageClientBoundary(resolvedPath, root, visited, trace2) {
3650
3759
  let importsClientBoundary = false;
3651
3760
  let importedIslandStrategy = null;
3652
3761
  const reexports = getBarePackageReexports(content);
3653
- const realPath = reexports.length > 0 ? realpathOrSelf(resolvedPath) : resolvedPath;
3762
+ const realPath2 = reexports.length > 0 ? realpathOrSelf(resolvedPath) : resolvedPath;
3654
3763
  const followed = [
3655
3764
  ...getImportSpecifiers(content).filter(
3656
3765
  (specifier) => specifier.startsWith(".") || specifier.startsWith("/")
@@ -3659,7 +3768,7 @@ function traversePackageClientBoundary(resolvedPath, root, visited, trace2) {
3659
3768
  ];
3660
3769
  for (const specifier of followed) {
3661
3770
  const importedPath = resolveImportedModuleSourcePath(
3662
- reexports.includes(specifier) ? realPath : resolvedPath,
3771
+ reexports.includes(specifier) ? realPath2 : resolvedPath,
3663
3772
  specifier,
3664
3773
  root
3665
3774
  );
@@ -3792,7 +3901,7 @@ var ALIAS_IMPORT = /^(?:@\/|~\/|#)/;
3792
3901
  function warnUnresolvedAliasImport(importerPath, specifier, root) {
3793
3902
  if (!ALIAS_IMPORT.test(specifier) || warnedUnresolvedAliasImports.has(specifier)) return;
3794
3903
  warnedUnresolvedAliasImports.add(specifier);
3795
- const importer = root ? path7.relative(root, importerPath) : importerPath;
3904
+ const importer = root ? path8.relative(root, importerPath) : importerPath;
3796
3905
  logger.warn(
3797
3906
  `Could not resolve "${specifier}" (imported by ${importer}) while checking which pages need client JavaScript. If it holds client components, they will not hydrate. Map the alias in tsconfig.json "paths" or package.json "imports".`
3798
3907
  );
@@ -3801,7 +3910,7 @@ var projectImportAliasCache = /* @__PURE__ */ new Map();
3801
3910
  var PROJECT_ALIAS_FILES = ["tsconfig.json", "jsconfig.json", "package.json"];
3802
3911
  function resolveProjectAliasSourcePath(specifier, root) {
3803
3912
  if (!root) return void 0;
3804
- const projectRoot = path7.resolve(root);
3913
+ const projectRoot = path8.resolve(root);
3805
3914
  let match;
3806
3915
  for (const alias of getProjectImportAliases(projectRoot)) {
3807
3916
  const captured = matchProjectImportAlias(alias, specifier);
@@ -3811,7 +3920,7 @@ function resolveProjectAliasSourcePath(specifier, root) {
3811
3920
  if (!match) return void 0;
3812
3921
  const resolved = resolveSourceCandidate(
3813
3922
  match.alias.targets.map(
3814
- (target) => path7.normalize(match.alias.wildcard ? target.replace("*", match.captured) : target)
3923
+ (target) => path8.normalize(match.alias.wildcard ? target.replace("*", match.captured) : target)
3815
3924
  )
3816
3925
  );
3817
3926
  return resolved && /\.d\.[cm]?ts$/.test(resolved) ? null : resolved;
@@ -3826,7 +3935,7 @@ function matchProjectImportAlias(alias, specifier) {
3826
3935
  function getProjectImportAliases(projectRoot) {
3827
3936
  const stamp = PROJECT_ALIAS_FILES.map((file) => {
3828
3937
  try {
3829
- return String(fs6.statSync(path7.join(projectRoot, file)).mtimeMs);
3938
+ return String(fs7.statSync(path8.join(projectRoot, file)).mtimeMs);
3830
3939
  } catch {
3831
3940
  return "-";
3832
3941
  }
@@ -3844,7 +3953,7 @@ function getProjectImportAliases(projectRoot) {
3844
3953
  prefix: "@/",
3845
3954
  suffix: "",
3846
3955
  wildcard: true,
3847
- targets: [path7.join(projectRoot, sourceDir, "*")]
3956
+ targets: [path8.join(projectRoot, sourceDir, "*")]
3848
3957
  });
3849
3958
  }
3850
3959
  projectImportAliasCache.set(projectRoot, { stamp: cacheStamp, aliases });
@@ -3852,8 +3961,8 @@ function getProjectImportAliases(projectRoot) {
3852
3961
  }
3853
3962
  function readTsconfigPathAliases(projectRoot) {
3854
3963
  for (const name of ["tsconfig.json", "jsconfig.json"]) {
3855
- const configPath = path7.join(projectRoot, name);
3856
- if (!fs6.existsSync(configPath)) continue;
3964
+ const configPath = path8.join(projectRoot, name);
3965
+ if (!fs7.existsSync(configPath)) continue;
3857
3966
  const resolved = readTsconfigPaths(configPath, /* @__PURE__ */ new Set());
3858
3967
  if (!resolved?.paths) return [];
3859
3968
  const base2 = resolved.baseUrl ?? resolved.pathsDirectory;
@@ -3865,7 +3974,7 @@ function readTsconfigPathAliases(projectRoot) {
3865
3974
  prefix: wildcardIndex === -1 ? pattern : pattern.slice(0, wildcardIndex),
3866
3975
  suffix: wildcardIndex === -1 ? "" : pattern.slice(wildcardIndex + 1),
3867
3976
  wildcard: wildcardIndex !== -1,
3868
- targets: targets.filter((target) => typeof target === "string").map((target) => path7.resolve(base2, target))
3977
+ targets: targets.filter((target) => typeof target === "string").map((target) => path8.resolve(base2, target))
3869
3978
  }
3870
3979
  ];
3871
3980
  });
@@ -3877,27 +3986,27 @@ function readTsconfigPaths(configPath, visited) {
3877
3986
  visited.add(configPath);
3878
3987
  const config = readJsonWithComments(configPath);
3879
3988
  if (!config) return null;
3880
- const directory = path7.dirname(configPath);
3989
+ const directory = path8.dirname(configPath);
3881
3990
  const parents = (Array.isArray(config.extends) ? config.extends : [config.extends]).filter(
3882
3991
  (parent) => typeof parent === "string" && parent.startsWith(".")
3883
3992
  );
3884
3993
  let inherited = null;
3885
3994
  for (const parent of parents) {
3886
- const parentPath = path7.resolve(
3995
+ const parentPath = path8.resolve(
3887
3996
  directory,
3888
3997
  parent.endsWith(".json") ? parent : `${parent}.json`
3889
3998
  );
3890
3999
  inherited = readTsconfigPaths(parentPath, visited) ?? inherited;
3891
4000
  }
3892
4001
  const options = config.compilerOptions ?? {};
3893
- const baseUrl = typeof options.baseUrl === "string" ? path7.resolve(directory, options.baseUrl) : inherited?.baseUrl;
4002
+ const baseUrl = typeof options.baseUrl === "string" ? path8.resolve(directory, options.baseUrl) : inherited?.baseUrl;
3894
4003
  if (options.paths && typeof options.paths === "object") {
3895
4004
  return { paths: options.paths, pathsDirectory: directory, baseUrl };
3896
4005
  }
3897
4006
  return inherited ? { ...inherited, baseUrl } : { pathsDirectory: directory, baseUrl };
3898
4007
  }
3899
4008
  function readPackageImportAliases(projectRoot) {
3900
- const imports = readPackageJson(path7.join(projectRoot, "package.json"))?.imports;
4009
+ const imports = readPackageJson(path8.join(projectRoot, "package.json"))?.imports;
3901
4010
  if (!imports || typeof imports !== "object") return [];
3902
4011
  return Object.entries(imports).flatMap(([pattern, value]) => {
3903
4012
  const target = resolveConditionalExportTarget(value);
@@ -3908,7 +4017,7 @@ function readPackageImportAliases(projectRoot) {
3908
4017
  prefix: wildcardIndex === -1 ? pattern : pattern.slice(0, wildcardIndex),
3909
4018
  suffix: wildcardIndex === -1 ? "" : pattern.slice(wildcardIndex + 1),
3910
4019
  wildcard: wildcardIndex !== -1,
3911
- targets: [path7.resolve(projectRoot, target)]
4020
+ targets: [path8.resolve(projectRoot, target)]
3912
4021
  }
3913
4022
  ];
3914
4023
  });
@@ -3916,7 +4025,7 @@ function readPackageImportAliases(projectRoot) {
3916
4025
  function readJsonWithComments(filePath) {
3917
4026
  let source;
3918
4027
  try {
3919
- source = fs6.readFileSync(filePath, "utf8");
4028
+ source = fs7.readFileSync(filePath, "utf8");
3920
4029
  } catch {
3921
4030
  return null;
3922
4031
  }
@@ -3954,7 +4063,7 @@ function resolveImportedModuleSourcePath(importerPath, specifier, root) {
3954
4063
  return resolvePackageModuleSourcePath(importerPath, specifier, root);
3955
4064
  }
3956
4065
  const candidates = /* @__PURE__ */ new Set();
3957
- const basePath = specifier.startsWith(".") ? path7.resolve(path7.dirname(importerPath), specifier) : root ? path7.resolve(root, specifier.replace(/^\/+/, "")) : path7.resolve(specifier);
4066
+ const basePath = specifier.startsWith(".") ? path8.resolve(path8.dirname(importerPath), specifier) : root ? path8.resolve(root, specifier.replace(/^\/+/, "")) : path8.resolve(specifier);
3958
4067
  candidates.add(basePath);
3959
4068
  return resolveSourceCandidate(candidates);
3960
4069
  }
@@ -3964,45 +4073,45 @@ function resolvePackageModuleSourcePath(importerPath, specifier, root) {
3964
4073
  const packageSubpath = packageParts.slice(packageName.startsWith("@") ? 2 : 1).join("/");
3965
4074
  const packageDirectory = findPackageDirectory2(importerPath, packageName, root);
3966
4075
  if (!packageDirectory) return null;
3967
- const packageJsonPath = path7.join(packageDirectory, "package.json");
4076
+ const packageJsonPath = path8.join(packageDirectory, "package.json");
3968
4077
  const packageJson = readPackageJson(packageJsonPath);
3969
4078
  const exportKey = packageSubpath ? `./${packageSubpath}` : ".";
3970
4079
  const exportTarget = resolvePackageExport(packageJson?.exports, exportKey);
3971
4080
  const candidates = /* @__PURE__ */ new Set();
3972
4081
  if (exportTarget?.startsWith("./")) {
3973
- candidates.add(path7.resolve(packageDirectory, exportTarget));
4082
+ candidates.add(path8.resolve(packageDirectory, exportTarget));
3974
4083
  }
3975
4084
  if (packageSubpath) {
3976
- candidates.add(path7.join(packageDirectory, packageSubpath));
4085
+ candidates.add(path8.join(packageDirectory, packageSubpath));
3977
4086
  } else {
3978
4087
  for (const entry of [packageJson?.browser, packageJson?.module, packageJson?.main]) {
3979
- if (typeof entry === "string") candidates.add(path7.resolve(packageDirectory, entry));
4088
+ if (typeof entry === "string") candidates.add(path8.resolve(packageDirectory, entry));
3980
4089
  }
3981
- candidates.add(path7.join(packageDirectory, "index"));
4090
+ candidates.add(path8.join(packageDirectory, "index"));
3982
4091
  }
3983
4092
  return resolveSourceCandidate(candidates);
3984
4093
  }
3985
4094
  function findPackageDirectory2(importerPath, packageName, root) {
3986
4095
  const searchRoots = /* @__PURE__ */ new Set();
3987
- let current = path7.dirname(importerPath);
4096
+ let current = path8.dirname(importerPath);
3988
4097
  while (true) {
3989
4098
  searchRoots.add(current);
3990
- const parent = path7.dirname(current);
4099
+ const parent = path8.dirname(current);
3991
4100
  if (parent === current) break;
3992
4101
  current = parent;
3993
4102
  }
3994
4103
  if (root) {
3995
- current = path7.resolve(root);
4104
+ current = path8.resolve(root);
3996
4105
  while (true) {
3997
4106
  searchRoots.add(current);
3998
- const parent = path7.dirname(current);
4107
+ const parent = path8.dirname(current);
3999
4108
  if (parent === current) break;
4000
4109
  current = parent;
4001
4110
  }
4002
4111
  }
4003
4112
  for (const searchRoot of searchRoots) {
4004
- const packageDirectory = path7.join(searchRoot, "node_modules", packageName);
4005
- if (fs6.existsSync(path7.join(packageDirectory, "package.json"))) {
4113
+ const packageDirectory = path8.join(searchRoot, "node_modules", packageName);
4114
+ if (fs7.existsSync(path8.join(packageDirectory, "package.json"))) {
4006
4115
  return packageDirectory;
4007
4116
  }
4008
4117
  }
@@ -4010,7 +4119,7 @@ function findPackageDirectory2(importerPath, packageName, root) {
4010
4119
  }
4011
4120
  function readPackageJson(packageJsonPath) {
4012
4121
  try {
4013
- return JSON.parse(fs6.readFileSync(packageJsonPath, "utf8"));
4122
+ return JSON.parse(fs7.readFileSync(packageJsonPath, "utf8"));
4014
4123
  } catch {
4015
4124
  return null;
4016
4125
  }
@@ -4079,11 +4188,11 @@ function resolveSourceCandidate(candidates) {
4079
4188
  function resolveSourceCandidatePath(candidate) {
4080
4189
  const paths = [candidate];
4081
4190
  for (const extension of RESOLVABLE_SOURCE_EXTENSIONS) {
4082
- paths.push(`${candidate}${extension}`, path7.join(candidate, `index${extension}`));
4191
+ paths.push(`${candidate}${extension}`, path8.join(candidate, `index${extension}`));
4083
4192
  }
4084
4193
  for (const sourcePath of paths) {
4085
4194
  try {
4086
- if (fs6.statSync(sourcePath, { throwIfNoEntry: false })?.isFile()) return sourcePath;
4195
+ if (fs7.statSync(sourcePath, { throwIfNoEntry: false })?.isFile()) return sourcePath;
4087
4196
  } catch {
4088
4197
  }
4089
4198
  }
@@ -4125,13 +4234,13 @@ function scanFarmPackageImports(directory, root) {
4125
4234
  const walk2 = (current) => {
4126
4235
  let entries;
4127
4236
  try {
4128
- entries = fs6.readdirSync(current, { withFileTypes: true });
4237
+ entries = fs7.readdirSync(current, { withFileTypes: true });
4129
4238
  } catch {
4130
4239
  return;
4131
4240
  }
4132
4241
  for (const entry of entries) {
4133
4242
  if (entry.name.startsWith(".") && entry.isDirectory()) continue;
4134
- const file = path7.join(current, entry.name);
4243
+ const file = path8.join(current, entry.name);
4135
4244
  if (entry.isDirectory()) {
4136
4245
  if (!CLIENT_PACKAGE_SCAN_SKIP.has(entry.name)) walk2(file);
4137
4246
  continue;
@@ -4158,13 +4267,13 @@ function collectFarmServerBundledPackageInfo(directory) {
4158
4267
  const walk2 = (current) => {
4159
4268
  let entries;
4160
4269
  try {
4161
- entries = fs6.readdirSync(current, { withFileTypes: true });
4270
+ entries = fs7.readdirSync(current, { withFileTypes: true });
4162
4271
  } catch {
4163
4272
  return;
4164
4273
  }
4165
4274
  for (const entry of entries) {
4166
4275
  if (entry.name.startsWith(".") && entry.isDirectory()) continue;
4167
- const file = path7.join(current, entry.name);
4276
+ const file = path8.join(current, entry.name);
4168
4277
  if (entry.isDirectory()) {
4169
4278
  if (!CLIENT_PACKAGE_SCAN_SKIP.has(entry.name)) walk2(file);
4170
4279
  continue;
@@ -4189,7 +4298,7 @@ function invalidateFarmClientReachableModules() {
4189
4298
  clientReachableModules.clear();
4190
4299
  }
4191
4300
  function getFarmClientReachableModules(directory, root) {
4192
- const key = `${path7.resolve(root)}\0${path7.resolve(directory)}`;
4301
+ const key = `${path8.resolve(root)}\0${path8.resolve(directory)}`;
4193
4302
  const cached = clientReachableModules.get(key);
4194
4303
  if (cached) return cached;
4195
4304
  const reachable = /* @__PURE__ */ new Set();
@@ -4197,12 +4306,12 @@ function getFarmClientReachableModules(directory, root) {
4197
4306
  const walk2 = (current) => {
4198
4307
  let entries;
4199
4308
  try {
4200
- entries = fs6.readdirSync(current, { withFileTypes: true });
4309
+ entries = fs7.readdirSync(current, { withFileTypes: true });
4201
4310
  } catch {
4202
4311
  return;
4203
4312
  }
4204
4313
  for (const entry of entries) {
4205
- const file = path7.join(current, entry.name);
4314
+ const file = path8.join(current, entry.name);
4206
4315
  if (entry.isDirectory()) {
4207
4316
  if (!entry.name.startsWith(".") && !CLIENT_PACKAGE_SCAN_SKIP.has(entry.name)) walk2(file);
4208
4317
  } else if (isScannedSourceFile(entry.name)) {
@@ -4213,12 +4322,12 @@ function getFarmClientReachableModules(directory, root) {
4213
4322
  };
4214
4323
  walk2(directory);
4215
4324
  while (queue.length > 0) {
4216
- const file = path7.resolve(queue.pop());
4325
+ const file = path8.resolve(queue.pop());
4217
4326
  if (reachable.has(file)) continue;
4218
4327
  reachable.add(file);
4219
4328
  for (const specifier of getImportSpecifiers(readIfExists(file), { dynamic: true })) {
4220
4329
  const imported = resolveImportedModule(file, specifier, root);
4221
- if (imported.local && imported.path && !reachable.has(path7.resolve(imported.path))) {
4330
+ if (imported.local && imported.path && !reachable.has(path8.resolve(imported.path))) {
4222
4331
  queue.push(imported.path);
4223
4332
  }
4224
4333
  }
@@ -4227,7 +4336,7 @@ function getFarmClientReachableModules(directory, root) {
4227
4336
  return reachable;
4228
4337
  }
4229
4338
  function resolveFarmClientOptimizeDeps(directory, root) {
4230
- const importer = path7.join(path7.resolve(root), "package.json");
4339
+ const importer = path8.join(path8.resolve(root), "package.json");
4231
4340
  const include = /* @__PURE__ */ new Set();
4232
4341
  const exclude = /* @__PURE__ */ new Set();
4233
4342
  const imports = scanFarmPackageImports(directory, root);
@@ -4316,7 +4425,7 @@ function farmEnvironmentFunctionsPlugin(options = {}) {
4316
4425
  }
4317
4426
  return sources.files;
4318
4427
  };
4319
- const relativeFile = (file) => path8.isAbsolute(file) ? path8.relative(projectRoot, file).replace(/\\/g, "/") || file : file;
4428
+ const relativeFile = (file) => path9.isAbsolute(file) ? path9.relative(projectRoot, file).replace(/\\/g, "/") || file : file;
4320
4429
  const routeSourceError = (file, importers = []) => formatFarmDiagnostic(
4321
4430
  createFarmDiagnostic(
4322
4431
  "CLIENT_ROUTES_FILE",
@@ -4336,7 +4445,7 @@ function farmEnvironmentFunctionsPlugin(options = {}) {
4336
4445
  routesFiles = new Set(
4337
4446
  getFarmSourceRoots({ ...options, root: options.root ?? config.root }).flatMap(
4338
4447
  (source) => PROGRAMMATIC_ROUTE_FILE_NAMES.map(
4339
- (name) => resolvedFile(path8.resolve(source.root, source.srcDir, name))
4448
+ (name) => resolvedFile(path9.resolve(source.root, source.srcDir, name))
4340
4449
  )
4341
4450
  )
4342
4451
  );
@@ -4360,10 +4469,10 @@ function farmEnvironmentFunctionsPlugin(options = {}) {
4360
4469
  if (environment === "server" && resolveFarmServerComponentsMode(options.experimental?.serverComponents) === "islands" && isApplicationScript(id)) {
4361
4470
  const file = id.split("?", 1)[0];
4362
4471
  const root = realpathSync(options.root ?? projectRoot);
4363
- const clientCode = getFarmClientReachableModules(root, root).has(path8.resolve(file)) || existsSync(file) && hasUseClientDirective(readFileSync(file, "utf8"));
4472
+ const clientCode = getFarmClientReachableModules(root, root).has(path9.resolve(file)) || existsSync(file) && hasUseClientDirective(readFileSync(file, "utf8"));
4364
4473
  const reached = clientCode ? null : findFarmClientOnlyImport(code, file);
4365
4474
  if (reached) {
4366
- const chain = reached.chain.map((step) => path8.relative(root, step).replace(/\\/g, "/")).join(" -> ");
4475
+ const chain = reached.chain.map((step) => path9.relative(root, step).replace(/\\/g, "/")).join(" -> ");
4367
4476
  const importMatch = new RegExp(
4368
4477
  String.raw`\b(?:from|import)\s*["']` + reached.specifier.replace(/[.*+?^${}()|[\]\\]/g, "\\$&") + `["']`
4369
4478
  ).exec(code);
@@ -4681,7 +4790,7 @@ function isTransformableModule(id, componentExtensions = /* @__PURE__ */ new Set
4681
4790
  const [cleanId = id, query = ""] = id.split("?", 2);
4682
4791
  if (/\.d\.[cm]?ts$/.test(cleanId)) return false;
4683
4792
  if (MODULE_EXTENSION_RE2.test(cleanId)) return true;
4684
- return componentExtensions.has(path8.extname(cleanId).toLowerCase()) && !/(?:^|&)type=style\b/.test(query);
4793
+ return componentExtensions.has(path9.extname(cleanId).toLowerCase()) && !/(?:^|&)type=style\b/.test(query);
4685
4794
  }
4686
4795
  function transformError(id, message) {
4687
4796
  return new Error(`[Farm environment functions] ${message} in ${id.split("?", 1)[0]}`);
@@ -4726,6 +4835,7 @@ export {
4726
4835
  runWithPackageClientBoundaryCacheFile,
4727
4836
  runWithLatestPackageClientBoundaryCache,
4728
4837
  dropLatestPackageClientBoundaryCache,
4838
+ setFarmRendererHydrationScope,
4729
4839
  resolveModuleSourcePath,
4730
4840
  getFarmClientHydrationPlanOptions,
4731
4841
  describeSuppressedAsyncHydration,
@@ -1,7 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
2
2
 
3
3
 
4
- var _chunk5MUFW5UUcjs = require('./chunk-5MUFW5UU.cjs');
4
+ var _chunkOP7BIEUWcjs = require('./chunk-OP7BIEUW.cjs');
5
5
 
6
6
 
7
7
  var _chunkPIUTGRDIcjs = require('./chunk-PIUTGRDI.cjs');
@@ -64,7 +64,7 @@ function findFarmNativeScreenFiles(appDirs) {
64
64
  }
65
65
  function collectFarmNativeServerFns(options) {
66
66
  const { root, srcDir } = options;
67
- const aliases = _chunk5MUFW5UUcjs.readAliases.call(void 0, root, srcDir);
67
+ const aliases = _chunkOP7BIEUWcjs.readAliases.call(void 0, root, srcDir);
68
68
  const seen = /* @__PURE__ */ new Set();
69
69
  const found = /* @__PURE__ */ new Map();
70
70
  const queue = [...options.entries];
@@ -98,7 +98,7 @@ function collectFarmNativeServerFns(options) {
98
98
  }
99
99
  }
100
100
  for (const candidate of _nullishCoalesce(candidates, () => ( []))) {
101
- const resolved = _chunk5MUFW5UUcjs.resolveFile.call(void 0, candidate);
101
+ const resolved = _chunkOP7BIEUWcjs.resolveFile.call(void 0, candidate);
102
102
  if (resolved && SCRIPT.test(resolved) && !resolved.includes(`${_path2.default.sep}node_modules${_path2.default.sep}`)) {
103
103
  queue.push(resolved);
104
104
  break;
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
- var _chunkB2PGVHBGcjs = require('./chunk-B2PGVHBG.cjs');
3
+ var _chunk22BTYPIXcjs = require('./chunk-22BTYPIX.cjs');
4
4
 
5
5
 
6
6
 
@@ -354,7 +354,7 @@ function requestEvent(metadata, method, status, durationMs) {
354
354
  id: uuid(),
355
355
  requestId: metadata.id,
356
356
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
357
- route: routeTemplate(_chunkB2PGVHBGcjs.getFarmRouteLabel.call(void 0, metadata.route)),
357
+ route: routeTemplate(_chunk22BTYPIXcjs.getFarmRouteLabel.call(void 0, metadata.route)),
358
358
  ...metadata.path ? { path: metadata.path } : {},
359
359
  agent: metadata.agent,
360
360
  kind: "request",
@@ -410,7 +410,7 @@ function toolEvent(metadata, event, payloads) {
410
410
  id: uuid(),
411
411
  requestId: metadata.id,
412
412
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
413
- route: routeTemplate(_chunkB2PGVHBGcjs.getFarmRouteLabel.call(void 0, metadata.route)),
413
+ route: routeTemplate(_chunk22BTYPIXcjs.getFarmRouteLabel.call(void 0, metadata.route)),
414
414
  ...metadata.path ? { path: metadata.path } : {},
415
415
  agent: metadata.agent,
416
416
  kind: "mcp.tool",
@@ -496,7 +496,7 @@ async function receiveWebMCPReport(request, exporter, options, webmcp, waitUntil
496
496
  exporter.enqueue({
497
497
  id: uuid(),
498
498
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
499
- route: routeTemplate(_chunkB2PGVHBGcjs.getFarmRouteLabel.call(void 0, route)),
499
+ route: routeTemplate(_chunk22BTYPIXcjs.getFarmRouteLabel.call(void 0, route)),
500
500
  ...path ? { path } : {},
501
501
  agent: _chunk2NOHVIJ3cjs.classifyFarmClient.call(void 0, request),
502
502
  kind: "mcp.tool",