@farm.js/core 0.1.60 → 0.1.62

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 (265) hide show
  1. package/dist/{agent-mcp.d-C-2S9bnP.d.mts → agent-mcp.d-BKZ3UNbt.d.mts} +1 -1
  2. package/dist/{agent-mcp.d-SIoCUP1I.d.ts → agent-mcp.d-C1zr_nGS.d.ts} +1 -1
  3. package/dist/agent-runtime.cjs +3 -3
  4. package/dist/agent-runtime.d.mts +2 -2
  5. package/dist/agent-runtime.d.ts +2 -2
  6. package/dist/agent-runtime.mjs +2 -2
  7. package/dist/analyzer-2AHWJJR7.cjs +15 -0
  8. package/dist/analyzer-YESYU3GK.mjs +15 -0
  9. package/dist/api/route-manager.cjs +4 -4
  10. package/dist/api/route-manager.d.mts +4 -4
  11. package/dist/api/route-manager.d.ts +4 -4
  12. package/dist/api/route-manager.mjs +3 -3
  13. package/dist/api/runtime.cjs +3 -3
  14. package/dist/api/runtime.d.mts +3 -3
  15. package/dist/api/runtime.d.ts +3 -3
  16. package/dist/api/runtime.mjs +2 -2
  17. package/dist/api.cjs +5 -5
  18. package/dist/api.d.mts +4 -4
  19. package/dist/api.d.ts +4 -4
  20. package/dist/api.mjs +4 -4
  21. package/dist/{app-manifest.d-DrSAHskY.d.mts → app-manifest.d-BpvhfKRH.d.mts} +1 -1
  22. package/dist/{app-manifest.d-Tb3CJpL4.d.ts → app-manifest.d-ntch_bvA.d.ts} +1 -1
  23. package/dist/app-markdown.d.mts +3 -3
  24. package/dist/app-markdown.d.ts +3 -3
  25. package/dist/{app.d-CmWlYpZJ.d.ts → app.d-AE8_v3Db.d.ts} +4 -10
  26. package/dist/{app.d-D6QQM_kk.d.mts → app.d-CysWA_8v.d.mts} +4 -10
  27. package/dist/{chunk-FORSVMEJ.mjs → chunk-2CNKQC3G.mjs} +1 -1
  28. package/dist/{chunk-ZFUKPWFC.mjs → chunk-2JYBLE63.mjs} +416 -208
  29. package/dist/{chunk-QRX4JRBO.cjs → chunk-3CCAICF7.cjs} +5 -5
  30. package/dist/{chunk-ANHZ6SUL.mjs → chunk-3TXKFRSO.mjs} +1 -1
  31. package/dist/{chunk-BHJAYPYU.mjs → chunk-3UZVPO72.mjs} +1 -1
  32. package/dist/{chunk-6UUH4N4J.mjs → chunk-43V3ANPQ.mjs} +1 -1
  33. package/dist/chunk-4EBC7EMW.cjs +8 -0
  34. package/dist/{chunk-VZY7MAVS.cjs → chunk-4IHMHFQB.cjs} +27 -1
  35. package/dist/{chunk-FK25QSVC.cjs → chunk-4P5634G6.cjs} +2 -2
  36. package/dist/{chunk-4JTQPOKO.cjs → chunk-53ZCZ46B.cjs} +2 -2
  37. package/dist/{chunk-NQJDO7K7.cjs → chunk-545WJ5UG.cjs} +321 -37
  38. package/dist/{chunk-VU3MYZPO.mjs → chunk-5FE5YT2N.mjs} +26 -0
  39. package/dist/{chunk-A5BJKSZE.cjs → chunk-5IQ2ERQA.cjs} +2 -2
  40. package/dist/{chunk-SJRCWF4Z.mjs → chunk-5Y22WNTO.mjs} +2 -2
  41. package/dist/{chunk-U4BJKNIR.cjs → chunk-752XUZIM.cjs} +11 -6
  42. package/dist/{chunk-JBK7UJOI.cjs → chunk-AJB3DHN6.cjs} +2 -2
  43. package/dist/{chunk-YB44NKC2.cjs → chunk-AXVRUDMB.cjs} +2 -2
  44. package/dist/{chunk-LJVNMGE3.mjs → chunk-BM2LH2JM.mjs} +8 -3
  45. package/dist/{chunk-YI6FKTTN.cjs → chunk-BT4SEFLC.cjs} +261 -38
  46. package/dist/{chunk-LIFUPCXW.cjs → chunk-CFG4QERR.cjs} +13 -2
  47. package/dist/{chunk-3OWVWZ6R.cjs → chunk-CLFEQGET.cjs} +6 -6
  48. package/dist/{chunk-OZK2DS44.mjs → chunk-CROAFCMW.mjs} +1 -1
  49. package/dist/{chunk-2KTYMMWT.mjs → chunk-DPE53XWL.mjs} +1 -1
  50. package/dist/{chunk-3PX4AIXO.mjs → chunk-DQF3QLOH.mjs} +258 -35
  51. package/dist/{chunk-FSQMN2MQ.mjs → chunk-E46NXBNJ.mjs} +1 -1
  52. package/dist/{chunk-EGVC4LIG.mjs → chunk-E4RDMG3K.mjs} +1 -1
  53. package/dist/{chunk-X2CZTWQA.mjs → chunk-ECKQFEX2.mjs} +1 -1
  54. package/dist/{chunk-MTWXOEI4.cjs → chunk-EXXFSZOC.cjs} +246 -193
  55. package/dist/{chunk-UYSTTPYJ.cjs → chunk-GGNJAGGE.cjs} +643 -435
  56. package/dist/{chunk-XTG73QZA.cjs → chunk-GVOMPU3Y.cjs} +12 -8
  57. package/dist/{chunk-ZP32GNJQ.cjs → chunk-I32V5CZL.cjs} +14 -13
  58. package/dist/{chunk-37PYUEK5.mjs → chunk-IOF4KXMP.mjs} +7 -3
  59. package/dist/{chunk-ILMTRGBG.mjs → chunk-IQIKPKFP.mjs} +157 -45
  60. package/dist/{chunk-5JNUYGNF.cjs → chunk-IWRLV46X.cjs} +2 -2
  61. package/dist/{chunk-KPOMS5RO.cjs → chunk-J3GFOQOL.cjs} +3 -3
  62. package/dist/{chunk-NHD7BAKD.mjs → chunk-JCEFKP5M.mjs} +41 -25
  63. package/dist/{analyzer-LCSI3NSH.cjs → chunk-JEJQGZI7.cjs} +16 -13
  64. package/dist/{chunk-LB3DPQP6.cjs → chunk-JLDNXURZ.cjs} +23 -23
  65. package/dist/{chunk-VGG74PSU.cjs → chunk-L2JG337G.cjs} +2 -2
  66. package/dist/chunk-L4RTTTVE.mjs +8 -0
  67. package/dist/chunk-LEJDW34D.cjs +115 -0
  68. package/dist/{analyzer-22BEYV7S.mjs → chunk-LVWGURLD.mjs} +6 -3
  69. package/dist/{chunk-Z5A6CNV2.mjs → chunk-MK5E44WP.mjs} +1 -1
  70. package/dist/{chunk-T4EW7AAD.mjs → chunk-NKRZLQUK.mjs} +2 -2
  71. package/dist/{chunk-HPWB57PZ.mjs → chunk-NT3QDN2E.mjs} +1 -1
  72. package/dist/{chunk-T7I62A4C.mjs → chunk-OUWRNHTV.mjs} +81 -28
  73. package/dist/{chunk-GFT5AHAT.mjs → chunk-QDWMCFTH.mjs} +12 -1
  74. package/dist/{chunk-AER5I65K.mjs → chunk-QTD6EMN2.mjs} +1 -1
  75. package/dist/{chunk-UDJY2ZGY.cjs → chunk-RMUD75WT.cjs} +413 -301
  76. package/dist/chunk-RZNCMRD3.mjs +141 -0
  77. package/dist/{chunk-D7LTCK3U.mjs → chunk-SA7MLSP4.mjs} +11 -6
  78. package/dist/{chunk-2FRLSDBT.cjs → chunk-SM25ZC4S.cjs} +1 -1
  79. package/dist/{chunk-3YMLUNL2.cjs → chunk-SVXOCTQ2.cjs} +1 -1
  80. package/dist/{chunk-W2RZ73IU.cjs → chunk-SYXPWJ7N.cjs} +8 -8
  81. package/dist/{chunk-F6Y7ZAPQ.mjs → chunk-T46NNU4D.mjs} +6 -3
  82. package/dist/{chunk-IFHPDLIS.mjs → chunk-TGULJSHD.mjs} +5 -4
  83. package/dist/{chunk-JPIUGDK4.mjs → chunk-TZVUF5JJ.mjs} +1 -1
  84. package/dist/chunk-UWI3SJAK.cjs +141 -0
  85. package/dist/{chunk-JI5D7MXY.mjs → chunk-UYRI6U3P.mjs} +1 -1
  86. package/dist/{chunk-D2X5MUF5.cjs → chunk-V727H3RI.cjs} +47 -31
  87. package/dist/{chunk-ZMHAFH4R.mjs → chunk-VM7X5CKC.mjs} +2 -2
  88. package/dist/{chunk-VPTWKOCY.mjs → chunk-VWW4Q3BJ.mjs} +287 -6
  89. package/dist/{chunk-4P23B7DU.cjs → chunk-WKJQ2FJA.cjs} +3 -3
  90. package/dist/{chunk-HASX6DC7.cjs → chunk-WKPBIT5Q.cjs} +8 -8
  91. package/dist/{chunk-RAWWCDCT.cjs → chunk-WYAXRIYP.cjs} +3 -3
  92. package/dist/{chunk-3TL3AH25.cjs → chunk-X4K7TYN6.cjs} +12 -7
  93. package/dist/chunk-XCXHQBMM.mjs +115 -0
  94. package/dist/{chunk-DPJ66FSI.cjs → chunk-XX32BOMM.cjs} +7 -7
  95. package/dist/{chunk-2IAPKPEB.cjs → chunk-YN6BHOYY.cjs} +6 -6
  96. package/dist/{chunk-CBKRS3M4.cjs → chunk-Z7P2BTZ3.cjs} +7 -6
  97. package/dist/{chunk-SX7EECTS.mjs → chunk-ZBUAOGMY.mjs} +1 -1
  98. package/dist/{chunk-RPUJHJHE.mjs → chunk-ZFWYCVKS.mjs} +4 -3
  99. package/dist/{chunk-IFXSBJPN.cjs → chunk-ZVIEFTUA.cjs} +20 -17
  100. package/dist/{chunk-EXUONJYV.mjs → chunk-ZZI56IUY.mjs} +3 -3
  101. package/dist/{programmatic-routes-client.d-CLG2N1yH.d.ts → client-component.d-Bgt3x5Fu.d.ts} +18 -3
  102. package/dist/{programmatic-routes-client.d-CPbNqtIi.d.mts → client-component.d-BoqC2MLC.d.mts} +18 -3
  103. package/dist/{client-plugins.d-vXrbcfJ1.d.ts → client-plugins.d-BcqIy4au.d.ts} +1 -1
  104. package/dist/{client-plugins.d-CgQQ-EAv.d.mts → client-plugins.d-CWyYBxXf.d.mts} +1 -1
  105. package/dist/client-plugins.d.mts +2 -2
  106. package/dist/client-plugins.d.ts +2 -2
  107. package/dist/client.d.mts +7 -7
  108. package/dist/client.d.ts +7 -7
  109. package/dist/{config.d-DqZkLwef.d.ts → config.d-qt-mE8O5.d.mts} +6 -2
  110. package/dist/{config.d-DqZkLwef.d.mts → config.d-qt-mE8O5.d.ts} +6 -2
  111. package/dist/config.d.mts +2 -2
  112. package/dist/config.d.ts +2 -2
  113. package/dist/cron.cjs +12 -2
  114. package/dist/cron.d.mts +101 -3
  115. package/dist/cron.d.ts +101 -3
  116. package/dist/cron.mjs +11 -1
  117. package/dist/desktop.d.mts +3 -3
  118. package/dist/desktop.d.ts +3 -3
  119. package/dist/{devtools-KQZ6SRCJ.mjs → devtools-NUVXYG7I.mjs} +6 -6
  120. package/dist/{devtools-UF6JYHUN.cjs → devtools-SVRSGPNC.cjs} +8 -8
  121. package/dist/docs.cjs +9 -9
  122. package/dist/docs.d.mts +3 -3
  123. package/dist/docs.d.ts +3 -3
  124. package/dist/docs.mjs +8 -8
  125. package/dist/image/server.cjs +3 -3
  126. package/dist/image/server.mjs +2 -2
  127. package/dist/image/sharp.cjs +10 -10
  128. package/dist/image/sharp.mjs +2 -2
  129. package/dist/index.cjs +42 -27
  130. package/dist/{index.d-Dmfb7Kb_.d.mts → index.d-BDaiu2i5.d.mts} +1 -1
  131. package/dist/{index.d-DlCELfhf.d.ts → index.d-nAncqTXz.d.ts} +1 -1
  132. package/dist/index.d.mts +18 -18
  133. package/dist/index.d.ts +18 -18
  134. package/dist/index.mjs +42 -27
  135. package/dist/integrations.cjs +3 -3
  136. package/dist/integrations.d.mts +2 -2
  137. package/dist/integrations.d.ts +2 -2
  138. package/dist/integrations.mjs +2 -2
  139. package/dist/internal/app-markdown-runtime.d.mts +3 -3
  140. package/dist/internal/app-markdown-runtime.d.ts +3 -3
  141. package/dist/internal/build-runtime.cjs +27 -22
  142. package/dist/internal/build-runtime.d.mts +4 -4
  143. package/dist/internal/build-runtime.d.ts +4 -4
  144. package/dist/internal/build-runtime.mjs +26 -21
  145. package/dist/internal/cli-runtime.cjs +12 -11
  146. package/dist/internal/cli-runtime.mjs +11 -10
  147. package/dist/internal/client-error-overlay.cjs +4 -4
  148. package/dist/internal/client-error-overlay.mjs +1 -1
  149. package/dist/internal/client-runtime.d.mts +5 -5
  150. package/dist/internal/client-runtime.d.ts +5 -5
  151. package/dist/internal/compression-runtime.d.mts +2 -2
  152. package/dist/internal/compression-runtime.d.ts +2 -2
  153. package/dist/internal/config-runtime.cjs +8 -8
  154. package/dist/internal/config-runtime.d.mts +5 -5
  155. package/dist/internal/config-runtime.d.ts +5 -5
  156. package/dist/internal/config-runtime.mjs +7 -7
  157. package/dist/internal/form-actions.cjs +4 -4
  158. package/dist/internal/form-actions.mjs +3 -3
  159. package/dist/internal/infra-analytics-runtime.cjs +6 -6
  160. package/dist/internal/infra-analytics-runtime.mjs +4 -4
  161. package/dist/internal/metadata-image-runtime.cjs +3 -3
  162. package/dist/internal/metadata-image-runtime.mjs +2 -2
  163. package/dist/internal/native-server-fns.cjs +25 -0
  164. package/dist/internal/native-server-fns.d.mts +42 -0
  165. package/dist/internal/native-server-fns.d.ts +42 -0
  166. package/dist/internal/native-server-fns.mjs +25 -0
  167. package/dist/internal/product-telemetry-runtime.cjs +2 -2
  168. package/dist/internal/product-telemetry-runtime.mjs +1 -1
  169. package/dist/internal/production-node-env.cjs +2 -2
  170. package/dist/internal/production-node-env.mjs +1 -1
  171. package/dist/internal/production-runtime.cjs +16 -10
  172. package/dist/internal/production-runtime.d.mts +39 -12
  173. package/dist/internal/production-runtime.d.ts +39 -12
  174. package/dist/internal/production-runtime.mjs +15 -9
  175. package/dist/internal/react-cache.cjs +51 -0
  176. package/dist/internal/react-cache.d.mts +3 -0
  177. package/dist/internal/react-cache.d.ts +3 -0
  178. package/dist/internal/react-cache.mjs +51 -0
  179. package/dist/markdown.d.mts +2 -2
  180. package/dist/markdown.d.ts +2 -2
  181. package/dist/middleware.cjs +3 -3
  182. package/dist/middleware.d.mts +4 -4
  183. package/dist/middleware.d.ts +4 -4
  184. package/dist/middleware.mjs +2 -2
  185. package/dist/mobile.d.mts +10 -4
  186. package/dist/mobile.d.ts +10 -4
  187. package/dist/{modules-VHD7BELU.mjs → modules-KOKD4XS6.mjs} +2 -2
  188. package/dist/modules-QTP7WJPD.cjs +13 -0
  189. package/dist/native-server-fn-handler-GLRHAYWV.mjs +28 -0
  190. package/dist/native-server-fn-handler-J5MYRXN6.cjs +28 -0
  191. package/dist/native-specs-5OLED4MM.cjs +15 -0
  192. package/dist/{native-specs-BD7HOTMJ.mjs → native-specs-LDV6IZ4N.mjs} +1 -1
  193. package/dist/{native-tree-VWNW2MQ2.mjs → native-tree-AS5L3ID3.mjs} +2 -2
  194. package/dist/{native-tree-6G5O53O3.cjs → native-tree-Z2WYUJEV.cjs} +3 -3
  195. package/dist/native.cjs +1 -1
  196. package/dist/native.d.mts +5 -5
  197. package/dist/native.d.ts +5 -5
  198. package/dist/native.mjs +1 -1
  199. package/dist/{navigation-delegate.d-JXx40JzR.d.ts → navigation-delegate.d-BbUHRXxG.d.ts} +1 -1
  200. package/dist/{navigation-delegate.d-CnOTWOyi.d.mts → navigation-delegate.d-CSCm8ZxL.d.mts} +1 -1
  201. package/dist/navigation.d.mts +5 -5
  202. package/dist/navigation.d.ts +5 -5
  203. package/dist/{nitro-FLN6DRGJ.mjs → nitro-DD4QCA66.mjs} +5 -5
  204. package/dist/{nitro-HXAZZQKY.cjs → nitro-VRDX2H4M.cjs} +8 -8
  205. package/dist/plugin.cjs +19 -18
  206. package/dist/plugin.d.mts +5 -5
  207. package/dist/plugin.d.ts +5 -5
  208. package/dist/plugin.mjs +18 -17
  209. package/dist/{port-WOOQ3V56.mjs → port-UFUZL6RI.mjs} +2 -2
  210. package/dist/{port-C6GBH4C6.cjs → port-VTLHPZOI.cjs} +10 -10
  211. package/dist/{production-runtime.d-CP5s6RuY.d.mts → production-runtime.d-CcQiDko5.d.mts} +1 -1
  212. package/dist/{production-runtime.d-N-cE3pmy.d.ts → production-runtime.d-DgT24A0f.d.ts} +1 -1
  213. package/dist/{render-plan.d-DZ-qjjdG.d.mts → render-plan.d-BH9WF-JZ.d.mts} +1 -1
  214. package/dist/{render-plan.d-B9lAP3uX.d.ts → render-plan.d-CyrX6MDs.d.ts} +1 -1
  215. package/dist/renderer-client.d.mts +5 -5
  216. package/dist/renderer-client.d.ts +5 -5
  217. package/dist/{request.d-BiicaNxb.d.ts → request.d-BB8M8bcD.d.ts} +1 -1
  218. package/dist/{request.d-DV0oeUit.d.mts → request.d-CUrPnCW7.d.mts} +1 -1
  219. package/dist/request.d.mts +3 -3
  220. package/dist/request.d.ts +3 -3
  221. package/dist/{route-rendering.d-BrIKA51A.d.mts → route-rendering.d-CYxlzaFm.d.mts} +1 -1
  222. package/dist/{route-rendering.d-Iss0C7GR.d.ts → route-rendering.d-DYqZMIf4.d.ts} +1 -1
  223. package/dist/{router.d-mNTbOGV_.d.mts → router.d-7o24CD8u.d.mts} +1 -1
  224. package/dist/{router.d-DjGn_al7.d.ts → router.d-DaKo507j.d.ts} +1 -1
  225. package/dist/{routes.d-BKSjHuH9.d.ts → routes.d-BknKQcTu.d.ts} +7 -1
  226. package/dist/{routes.d-qd8Qf4LG.d.mts → routes.d-D1IrO9KK.d.mts} +7 -1
  227. package/dist/routes.d.mts +2 -2
  228. package/dist/routes.d.ts +2 -2
  229. package/dist/{rsc-pipeline-SVLBTY7H.cjs → rsc-pipeline-OF2I7PCX.cjs} +8 -8
  230. package/dist/{rsc-pipeline-WBLBDQXA.mjs → rsc-pipeline-RFLHDAKD.mjs} +7 -7
  231. package/dist/{runtime-DGUOWSMF.cjs → runtime-LBTK62AD.cjs} +70 -47
  232. package/dist/{runtime-HFZTVNFF.mjs → runtime-M6UJCSLA.mjs} +38 -15
  233. package/dist/{runtime.d-Bm_4hP5T.d.ts → runtime.d-CN73a-IL.d.ts} +1 -1
  234. package/dist/{runtime.d-BNVbojF1.d.mts → runtime.d-CcNuzhX6.d.mts} +1 -1
  235. package/dist/server-action-security.cjs +3 -3
  236. package/dist/server-action-security.mjs +2 -2
  237. package/dist/server-fn.cjs +4 -4
  238. package/dist/server-fn.mjs +3 -3
  239. package/dist/server-plugins.d.mts +3 -3
  240. package/dist/server-plugins.d.ts +3 -3
  241. package/dist/server-query.cjs +5 -5
  242. package/dist/server-query.mjs +4 -4
  243. package/dist/server.cjs +38 -37
  244. package/dist/server.d.mts +10 -10
  245. package/dist/server.d.ts +10 -10
  246. package/dist/server.mjs +23 -22
  247. package/dist/{spa-router.d-DHDoXxDE.d.mts → spa-router.d-CNi77LZm.d.mts} +2 -2
  248. package/dist/{spa-router.d-DAtnNoBe.d.ts → spa-router.d-Cvgf5QP4.d.ts} +2 -2
  249. package/dist/testing.cjs +6 -6
  250. package/dist/testing.d.mts +2 -2
  251. package/dist/testing.d.ts +2 -2
  252. package/dist/testing.mjs +4 -4
  253. package/dist/{utils.d-DwZ-KLSB.d.ts → utils.d-C3H-14_Y.d.ts} +1 -1
  254. package/dist/{utils.d-uKZcKJk4.d.mts → utils.d-D8VfzZYn.d.mts} +1 -1
  255. package/dist/version.cjs +2 -2
  256. package/dist/version.mjs +1 -1
  257. package/dist/vite.cjs +21 -18
  258. package/dist/vite.d.mts +5 -5
  259. package/dist/vite.d.ts +5 -5
  260. package/dist/vite.mjs +20 -17
  261. package/dist/workflows.cjs +3 -3
  262. package/dist/workflows.mjs +2 -2
  263. package/package.json +12 -2
  264. package/dist/modules-WT5D3AWY.cjs +0 -13
  265. package/dist/native-specs-IQQRJOOW.cjs +0 -15
@@ -1,3 +1,6 @@
1
+ import {
2
+ createFarmMetadataImageResponse
3
+ } from "./chunk-CROAFCMW.mjs";
1
4
  import {
2
5
  resolveFarmPlatform
3
6
  } from "./chunk-SMUW7UST.mjs";
@@ -5,7 +8,7 @@ import {
5
8
  collectSSGPages,
6
9
  matchSSGPage,
7
10
  resolveRouteRenderingConfigFromFile
8
- } from "./chunk-LJVNMGE3.mjs";
11
+ } from "./chunk-BM2LH2JM.mjs";
9
12
  import {
10
13
  classifyFarmDocumentPrefix,
11
14
  composeFarmFullDocument,
@@ -35,10 +38,10 @@ import {
35
38
  } from "./chunk-PCXIJKPM.mjs";
36
39
  import {
37
40
  handleFarmFormActionRequest
38
- } from "./chunk-Z5A6CNV2.mjs";
41
+ } from "./chunk-MK5E44WP.mjs";
39
42
  import {
40
43
  listFarmMCPLlmsTxtLinks
41
- } from "./chunk-ZMHAFH4R.mjs";
44
+ } from "./chunk-VM7X5CKC.mjs";
42
45
  import {
43
46
  FARM_DEFAULT_MCP_PATH,
44
47
  collectFarmDefaultMCPPages,
@@ -47,9 +50,6 @@ import {
47
50
  isFarmDefaultMCPPathname,
48
51
  resolveFarmDefaultMCPServer
49
52
  } from "./chunk-UZZ6IEQP.mjs";
50
- import {
51
- createFarmMetadataImageResponse
52
- } from "./chunk-OZK2DS44.mjs";
53
53
  import {
54
54
  installFarmIslandValues,
55
55
  uninstallFarmIslandValues
@@ -141,13 +141,13 @@ import {
141
141
  } from "./chunk-YSXTNSXS.mjs";
142
142
  import {
143
143
  resolveWorkflowsConfig
144
- } from "./chunk-JPIUGDK4.mjs";
144
+ } from "./chunk-TZVUF5JJ.mjs";
145
145
  import {
146
146
  resolveCronConfig
147
- } from "./chunk-3PX4AIXO.mjs";
147
+ } from "./chunk-DQF3QLOH.mjs";
148
148
  import {
149
149
  resolveServerActionsConfig
150
- } from "./chunk-FSQMN2MQ.mjs";
150
+ } from "./chunk-E46NXBNJ.mjs";
151
151
  import {
152
152
  _setDefaultFarmThemeConfig,
153
153
  getTheme
@@ -166,7 +166,7 @@ import {
166
166
  getIntegrationProviders,
167
167
  getRegisteredIntegrationAPIManifest,
168
168
  isFarmIntegrationProviderComponentReference
169
- } from "./chunk-IFHPDLIS.mjs";
169
+ } from "./chunk-TGULJSHD.mjs";
170
170
  import {
171
171
  createRouteSlotContainerId,
172
172
  parseRouteSlotFile
@@ -250,13 +250,13 @@ import {
250
250
  import {
251
251
  matchesFarmIfNoneMatch,
252
252
  resolveFarmServerConfig
253
- } from "./chunk-GFT5AHAT.mjs";
253
+ } from "./chunk-QDWMCFTH.mjs";
254
254
  import {
255
255
  getRequestContextSnapshot
256
256
  } from "./chunk-D2LCAV6L.mjs";
257
257
  import {
258
258
  FARM_VERSION
259
- } from "./chunk-HPWB57PZ.mjs";
259
+ } from "./chunk-NT3QDN2E.mjs";
260
260
  import {
261
261
  resolveFarmTrailingSlashRedirect,
262
262
  setFarmTrailingSlashPreference
@@ -327,17 +327,157 @@ import {
327
327
  getRoutePatternShape
328
328
  } from "./chunk-AYP2YFVN.mjs";
329
329
 
330
+ // src/islands-package-references.ts
331
+ import fs from "fs";
332
+ import path from "path";
333
+ import { parseAst } from "rolldown/parseAst";
334
+ var IDENTIFIER = /^[A-Za-z_$][\w$]*$/;
335
+ function parse(code, file) {
336
+ const extension = path.extname(file).slice(1);
337
+ const lang = extension === "ts" || extension === "mts" || extension === "cts" ? "ts" : "tsx";
338
+ try {
339
+ return parseAst(code, { lang });
340
+ } catch {
341
+ return null;
342
+ }
343
+ }
344
+ function walk(node, visit, parent = null) {
345
+ if (!node || typeof node !== "object") return;
346
+ if (Array.isArray(node)) {
347
+ for (const child of node) walk(child, visit, parent);
348
+ return;
349
+ }
350
+ const current = node;
351
+ if (typeof current.type !== "string") return;
352
+ visit(current, parent);
353
+ for (const [key, value] of Object.entries(current)) {
354
+ if (key === "start" || key === "end" || key === "loc" || key === "range") continue;
355
+ if (value && typeof value === "object") walk(value, visit, current);
356
+ }
357
+ }
358
+ function namespaceMembers(program, local, declaration) {
359
+ const members = /* @__PURE__ */ new Set();
360
+ let opaque = false;
361
+ walk(program, (node, parent) => {
362
+ if (opaque || node === declaration) return;
363
+ const name = node.type === "Identifier" || node.type === "JSXIdentifier" ? node.name : null;
364
+ if (name !== local) return;
365
+ if (parent?.type === "ImportNamespaceSpecifier") return;
366
+ const member = (parent?.type === "MemberExpression" || parent?.type === "JSXMemberExpression") && parent.object === node ? parent.property : null;
367
+ const property2 = member && !parent.computed && (member.type === "Identifier" || member.type === "JSXIdentifier") ? member.name : null;
368
+ if (property2) members.add(property2);
369
+ else opaque = true;
370
+ });
371
+ return opaque ? null : [...members];
372
+ }
373
+ function findFarmPackageClientImports(code, file, isClientPackage) {
374
+ if (!code.includes("import")) return [];
375
+ const program = parse(code, file);
376
+ if (!program) return [];
377
+ const found = [];
378
+ for (const node of program.body ?? []) {
379
+ if (node.type !== "ImportDeclaration" || node.importKind === "type") continue;
380
+ const specifier = node.source?.value;
381
+ if (typeof specifier !== "string" || specifier.startsWith(".") || specifier.startsWith("/"))
382
+ continue;
383
+ const specifiers = (node.specifiers ?? []).filter(
384
+ (entry2) => entry2.importKind !== "type"
385
+ );
386
+ if (specifiers.length === 0 || !isClientPackage(specifier)) continue;
387
+ const entry = {
388
+ start: node.start,
389
+ end: node.end,
390
+ specifier,
391
+ named: []
392
+ };
393
+ let supported = true;
394
+ for (const binding of specifiers) {
395
+ if (binding.type === "ImportDefaultSpecifier") entry.defaultLocal = binding.local.name;
396
+ else if (binding.type === "ImportNamespaceSpecifier") {
397
+ const members = namespaceMembers(program, binding.local.name, node);
398
+ if (!members || members.some((member) => !IDENTIFIER.test(member))) supported = false;
399
+ else entry.namespace = { local: binding.local.name, members };
400
+ } else {
401
+ const imported = binding.imported?.type === "Identifier" ? binding.imported.name : binding.imported?.value;
402
+ if (typeof imported !== "string" || !IDENTIFIER.test(imported)) supported = false;
403
+ else entry.named.push({ imported, local: binding.local.name });
404
+ }
405
+ }
406
+ if (supported) found.push(entry);
407
+ }
408
+ return found;
409
+ }
410
+ function farmPackageClientImportExports(entry) {
411
+ return [
412
+ ...entry.defaultLocal ? ["default"] : [],
413
+ ...entry.named.map((binding) => binding.imported),
414
+ ...entry.namespace?.members ?? []
415
+ ];
416
+ }
417
+ function farmPackageClientReferencePath(root, specifier, exportName) {
418
+ const directory = specifier.replace(/^@/, "").replace(/[^A-Za-z0-9._-]/g, "+");
419
+ return path.join(root, ".farm", "client-references", directory, `${exportName}.tsx`);
420
+ }
421
+ function ensureFarmPackageClientReference(root, specifier, exportName) {
422
+ const file = farmPackageClientReferencePath(root, specifier, exportName);
423
+ const source = [
424
+ `// Generated by Farm: ${specifier}'s ${exportName} export, as a client reference for server components.`,
425
+ '"use client";',
426
+ `export { ${exportName} } from ${JSON.stringify(specifier)};`,
427
+ ""
428
+ ].join("\n");
429
+ let current = null;
430
+ try {
431
+ current = fs.readFileSync(file, "utf8");
432
+ } catch {
433
+ }
434
+ if (current !== source) {
435
+ fs.mkdirSync(path.dirname(file), { recursive: true });
436
+ fs.writeFileSync(file, source);
437
+ }
438
+ return file;
439
+ }
440
+ function rewriteFarmPackageClientImports(options) {
441
+ const imports = findFarmPackageClientImports(options.code, options.file, options.isClientPackage);
442
+ if (imports.length === 0) return null;
443
+ const reference = (specifier, exportName) => JSON.stringify(ensureFarmPackageClientReference(options.root, specifier, exportName));
444
+ let output = options.code;
445
+ let next = 0;
446
+ for (const entry of [...imports].sort((left, right) => right.start - left.start)) {
447
+ const lines = [];
448
+ if (entry.defaultLocal) {
449
+ lines.push(`import ${entry.defaultLocal} from ${reference(entry.specifier, "default")};`);
450
+ }
451
+ for (const binding of entry.named) {
452
+ lines.push(
453
+ `import { ${binding.imported} as ${binding.local} } from ${reference(entry.specifier, binding.imported)};`
454
+ );
455
+ }
456
+ if (entry.namespace) {
457
+ const fields = [];
458
+ for (const member of entry.namespace.members) {
459
+ const local = `__farm_package_reference_${next++}__`;
460
+ lines.push(`import { ${member} as ${local} } from ${reference(entry.specifier, member)};`);
461
+ fields.push(`${member}: ${local}`);
462
+ }
463
+ lines.push(`const ${entry.namespace.local} = Object.freeze({ ${fields.join(", ")} });`);
464
+ }
465
+ output = output.slice(0, entry.start) + lines.join("\n") + output.slice(entry.end);
466
+ }
467
+ return output;
468
+ }
469
+
330
470
  // src/utils/client-component.ts
331
- import fs2 from "fs";
332
- import path2 from "path";
471
+ import fs3 from "fs";
472
+ import path3 from "path";
333
473
  import { fileURLToPath } from "url";
334
474
 
335
475
  // src/utils/package-client-boundary-cache.ts
336
476
  import { AsyncLocalStorage } from "async_hooks";
337
- import fs from "fs";
338
- import path from "path";
477
+ import fs2 from "fs";
478
+ import path2 from "path";
339
479
  var SCHEMA_VERSION = 1;
340
- var NODE_MODULES_SEGMENT = `${path.sep}node_modules${path.sep}`;
480
+ var NODE_MODULES_SEGMENT = `${path2.sep}node_modules${path2.sep}`;
341
481
  var PackageInspectionTrace = class {
342
482
  constructor() {
343
483
  this.files = /* @__PURE__ */ new Set();
@@ -347,7 +487,7 @@ var PackageInspectionTrace = class {
347
487
  }
348
488
  visit(file) {
349
489
  this.files.add(file);
350
- const directory = path.dirname(file);
490
+ const directory = path2.dirname(file);
351
491
  if (!this.directoryStamps.has(directory)) {
352
492
  this.directoryStamps.set(directory, stampPackagePath(directory, "directory"));
353
493
  }
@@ -374,9 +514,9 @@ var PackageInspectionTrace = class {
374
514
  }
375
515
  };
376
516
  function stampPackagePath(target, kind) {
377
- if (!`${target}${path.sep}`.includes(NODE_MODULES_SEGMENT)) return void 0;
517
+ if (!`${target}${path2.sep}`.includes(NODE_MODULES_SEGMENT)) return void 0;
378
518
  try {
379
- const stat = fs.statSync(target, { throwIfNoEntry: false });
519
+ const stat = fs2.statSync(target, { throwIfNoEntry: false });
380
520
  if (!stat || (kind === "file" ? !stat.isFile() : !stat.isDirectory())) return void 0;
381
521
  return [target, stat.size, stat.mtimeMs, stat.ctimeMs];
382
522
  } catch {
@@ -460,11 +600,11 @@ var PackageClientBoundaryCache = class {
460
600
  });
461
601
  const temporary = `${file}.${process.pid}.${Date.now()}.tmp`;
462
602
  try {
463
- await fs.promises.mkdir(path.dirname(file), { recursive: true });
464
- await fs.promises.writeFile(temporary, contents);
465
- await fs.promises.rename(temporary, file);
603
+ await fs2.promises.mkdir(path2.dirname(file), { recursive: true });
604
+ await fs2.promises.writeFile(temporary, contents);
605
+ await fs2.promises.rename(temporary, file);
466
606
  } catch {
467
- await fs.promises.rm(temporary, { force: true }).catch(() => {
607
+ await fs2.promises.rm(temporary, { force: true }).catch(() => {
468
608
  });
469
609
  }
470
610
  }
@@ -498,7 +638,7 @@ var PackageClientBoundaryCache = class {
498
638
  function readStoredCache(file) {
499
639
  let value;
500
640
  try {
501
- value = JSON.parse(fs.readFileSync(file, "utf8"));
641
+ value = JSON.parse(fs2.readFileSync(file, "utf8"));
502
642
  } catch {
503
643
  return null;
504
644
  }
@@ -519,7 +659,7 @@ function isRecord(value) {
519
659
  return typeof value === "object" && value !== null && !Array.isArray(value);
520
660
  }
521
661
  function isPathStamp(value) {
522
- return Array.isArray(value) && value.length === 4 && typeof value[0] === "string" && path.isAbsolute(value[0]) && value.slice(1).every((part) => typeof part === "number" && Number.isFinite(part));
662
+ return Array.isArray(value) && value.length === 4 && typeof value[0] === "string" && path2.isAbsolute(value[0]) && value.slice(1).every((part) => typeof part === "number" && Number.isFinite(part));
523
663
  }
524
664
  function isPathIndexList(value, pathCount) {
525
665
  return Array.isArray(value) && value.length > 0 && value.every((index) => Number.isSafeInteger(index) && index >= 0 && index < pathCount);
@@ -527,7 +667,7 @@ function isPathIndexList(value, pathCount) {
527
667
  function isStoredEntry(value, pathCount) {
528
668
  if (!isRecord(value) || !isRecord(value.result)) return false;
529
669
  const { isClientComponent, shouldHydrate, islandStrategy } = value.result;
530
- return isPathIndexList(value.files, pathCount) && isPathIndexList(value.directories, pathCount) && Array.isArray(value.stops) && value.stops.every((file) => typeof file === "string" && path.isAbsolute(file)) && typeof isClientComponent === "boolean" && typeof shouldHydrate === "boolean" && (islandStrategy === null || isFarmIslandStrategy(islandStrategy)) && Object.keys(value.result).length === 3;
670
+ return isPathIndexList(value.files, pathCount) && isPathIndexList(value.directories, pathCount) && Array.isArray(value.stops) && value.stops.every((file) => typeof file === "string" && path2.isAbsolute(file)) && typeof isClientComponent === "boolean" && typeof shouldHydrate === "boolean" && (islandStrategy === null || isFarmIslandStrategy(islandStrategy)) && Object.keys(value.result).length === 3;
531
671
  }
532
672
  var STORAGE_KEY = /* @__PURE__ */ Symbol.for("@farm.js/core/package-client-boundary-cache");
533
673
  function getStorage() {
@@ -558,10 +698,10 @@ function usePackageClientBoundaryCacheFile(file) {
558
698
  // src/utils/client-component.ts
559
699
  function readIfExists(filePath) {
560
700
  try {
561
- if (!filePath || !fs2.existsSync(filePath)) {
701
+ if (!filePath || !fs3.existsSync(filePath)) {
562
702
  return null;
563
703
  }
564
- return fs2.readFileSync(filePath, "utf-8");
704
+ return fs3.readFileSync(filePath, "utf-8");
565
705
  } catch {
566
706
  return null;
567
707
  }
@@ -580,21 +720,21 @@ function resolveModuleSourcePath(modulePath, root) {
580
720
  }
581
721
  if (modulePath.startsWith("/@fs/")) {
582
722
  const fsPath = withoutQuery.slice("/@fs/".length);
583
- candidates.add(path2.normalize(/^[A-Za-z]:/.test(fsPath) ? fsPath : `/${fsPath}`));
723
+ candidates.add(path3.normalize(/^[A-Za-z]:/.test(fsPath) ? fsPath : `/${fsPath}`));
584
724
  }
585
725
  }
586
726
  if (root && modulePath) {
587
727
  const normalized = withoutQuery.replace(/^\/+/, "");
588
- candidates.add(path2.join(root, normalized));
589
- candidates.add(path2.resolve(root, normalized));
728
+ candidates.add(path3.join(root, normalized));
729
+ candidates.add(path3.resolve(root, normalized));
590
730
  }
591
731
  if (withoutQuery?.startsWith("/src/")) {
592
732
  const normalized = withoutQuery.replace(/^\/+/, "");
593
- candidates.add(path2.join(process.cwd(), normalized));
594
- candidates.add(path2.resolve(process.cwd(), normalized));
733
+ candidates.add(path3.join(process.cwd(), normalized));
734
+ candidates.add(path3.resolve(process.cwd(), normalized));
595
735
  }
596
736
  for (const candidate of candidates) {
597
- if (fs2.existsSync(candidate)) {
737
+ if (fs3.existsSync(candidate)) {
598
738
  return candidate;
599
739
  }
600
740
  }
@@ -611,8 +751,8 @@ var FARM_ISOLATED_HYDRATION_MAX_BOUNDARIES = 4;
611
751
  function isolatedHydrationBoundaryLimit() {
612
752
  const benchmarkRoot = process.env.FARM_INTERNAL_ISOLATED_HYDRATION_BENCHMARK_ROOT;
613
753
  const benchmarkLimit = Number(process.env.FARM_INTERNAL_ISOLATED_HYDRATION_BENCHMARK_LIMIT);
614
- const resolvedBenchmarkRoot = benchmarkRoot ? path2.resolve(benchmarkRoot) : null;
615
- const isBenchmarkFixture = process.env.FARM_INTERNAL_BENCHMARK === "isolated-hydration" && resolvedBenchmarkRoot !== null && (process.cwd() === resolvedBenchmarkRoot || process.cwd().startsWith(`${resolvedBenchmarkRoot}${path2.sep}`));
754
+ const resolvedBenchmarkRoot = benchmarkRoot ? path3.resolve(benchmarkRoot) : null;
755
+ const isBenchmarkFixture = process.env.FARM_INTERNAL_BENCHMARK === "isolated-hydration" && resolvedBenchmarkRoot !== null && (process.cwd() === resolvedBenchmarkRoot || process.cwd().startsWith(`${resolvedBenchmarkRoot}${path3.sep}`));
616
756
  return isBenchmarkFixture && Number.isSafeInteger(benchmarkLimit) && benchmarkLimit > FARM_ISOLATED_HYDRATION_MAX_BOUNDARIES ? benchmarkLimit : FARM_ISOLATED_HYDRATION_MAX_BOUNDARIES;
617
757
  }
618
758
  var RESOLVABLE_SOURCE_EXTENSIONS = [
@@ -984,7 +1124,7 @@ function getClientModuleHydrationPlan(modulePath, root, mode = "off", options =
984
1124
  const layout = collectIsolatedClientBoundaries(resolvedPath, root, {
985
1125
  allowDynamicCardinality: true,
986
1126
  allowElementProps: true,
987
- staticPackageLeaves: true
1127
+ packageReferences: true
988
1128
  });
989
1129
  const routeWide = {
990
1130
  ...plan,
@@ -1043,7 +1183,9 @@ function planClientModuleHydration(modulePath, root, mode, options) {
1043
1183
  allowDynamicCardinality: asyncOwner,
1044
1184
  allowElementProps: asyncOwner,
1045
1185
  staticPackageBoundaries: asyncOwner,
1046
- staticPackageLeaves: options.serverTreeLayouts === true && options.asyncOwnerIslands === true
1186
+ staticPackageLeaves: options.serverTreeLayouts === true && options.asyncOwnerIslands === true,
1187
+ // Islands mode: pages carry `serverOwners`, layouts `serverTreeLayouts`.
1188
+ packageReferences: options.serverOwners === true || options.serverTreeLayouts === true
1047
1189
  });
1048
1190
  if (inspection.fallbackReason && asyncOwner && options.serverOwners === true) {
1049
1191
  return {
@@ -1115,7 +1257,8 @@ function getMarkdownPageHydrationPlan(componentsModulePath, root, mode = "off",
1115
1257
  }
1116
1258
  const inspection = collectIsolatedClientBoundaries(resolvedPath, root, {
1117
1259
  allowDynamicCardinality: true,
1118
- staticPackageBoundaries: true
1260
+ staticPackageBoundaries: true,
1261
+ packageReferences: options.packageReferences === true
1119
1262
  });
1120
1263
  if (inspection.fallbackReason) return { ...plan, fallbackReason: inspection.fallbackReason };
1121
1264
  if (inspection.staticPackages.length > 0)
@@ -1517,7 +1660,7 @@ function collectIsolatedClientBoundaries(ownerPath, root, options = {}) {
1517
1660
  let fallbackReason;
1518
1661
  let fallbackHint;
1519
1662
  let costGuardExceeded = false;
1520
- const projectRoot = root ? path2.resolve(root) : void 0;
1663
+ const projectRoot = root ? path3.resolve(root) : void 0;
1521
1664
  const visit = (moduleSourcePath) => {
1522
1665
  if (fallbackReason) return 0;
1523
1666
  const cached = estimates.get(moduleSourcePath);
@@ -1527,7 +1670,7 @@ function collectIsolatedClientBoundaries(ownerPath, root, options = {}) {
1527
1670
  const content = readIfExists(moduleSourcePath);
1528
1671
  const parsed = parseClientModuleMetadata(content, false);
1529
1672
  if (parsed.isClientComponent) {
1530
- if (projectRoot && !path2.resolve(moduleSourcePath).startsWith(`${projectRoot}${path2.sep}`)) {
1673
+ if (projectRoot && !path3.resolve(moduleSourcePath).startsWith(`${projectRoot}${path3.sep}`)) {
1531
1674
  fallbackReason = `client boundary ${moduleSourcePath} is outside the application root`;
1532
1675
  fallbackHint = "Move the component into the application, or publish it as a package (package client components render as static HTML)";
1533
1676
  return 0;
@@ -1556,20 +1699,35 @@ function collectIsolatedClientBoundaries(ownerPath, root, options = {}) {
1556
1699
  const imported = resolveImportedModule(moduleSourcePath, specifier, root);
1557
1700
  const importedPath = imported.path;
1558
1701
  if (!importedPath) continue;
1559
- if (!imported.local) {
1702
+ let importedBoundaryCount;
1703
+ if (imported.local) {
1704
+ importedBoundaryCount = visit(importedPath);
1705
+ } else {
1560
1706
  const packageMetadata = inspectPackageClientBoundary(importedPath, root, /* @__PURE__ */ new Set());
1561
- if (packageMetadata.shouldHydrate) {
1562
- if (options.staticPackageBoundaries || options.staticPackageLeaves && rendersOnlyLeafElements(content, importedBindings.get(specifier) ?? [])) {
1563
- staticPackages.add(specifier);
1564
- continue;
1707
+ if (!packageMetadata.shouldHydrate) continue;
1708
+ const references = options.packageReferences && projectRoot ? findFarmPackageClientImports(
1709
+ content ?? "",
1710
+ moduleSourcePath,
1711
+ (candidate) => candidate === specifier
1712
+ ) : [];
1713
+ if (references.length > 0) {
1714
+ importedBoundaryCount = 0;
1715
+ for (const reference of references) {
1716
+ for (const exportName of farmPackageClientImportExports(reference)) {
1717
+ importedBoundaryCount += visit(
1718
+ ensureFarmPackageClientReference(projectRoot, specifier, exportName)
1719
+ );
1720
+ }
1565
1721
  }
1722
+ } else if (options.staticPackageBoundaries || options.staticPackageLeaves && rendersOnlyLeafElements(content, importedBindings.get(specifier) ?? [])) {
1723
+ staticPackages.add(specifier);
1724
+ continue;
1725
+ } else {
1566
1726
  fallbackReason = `package client boundary ${specifier} cannot yet be isolated`;
1567
1727
  fallbackHint = `Render it from a local "use client" module (a providers.tsx that renders the ${specifier} component)`;
1568
1728
  return 0;
1569
1729
  }
1570
- continue;
1571
1730
  }
1572
- const importedBoundaryCount = visit(importedPath);
1573
1731
  if (fallbackReason || importedBoundaryCount === 0) continue;
1574
1732
  const localBindings = importedBindings.get(specifier) ?? [];
1575
1733
  const staticUses = countStaticJsxUses(content, localBindings);
@@ -1792,7 +1950,7 @@ var ALIAS_IMPORT = /^(?:@\/|~\/|#)/;
1792
1950
  function warnUnresolvedAliasImport(importerPath, specifier, root) {
1793
1951
  if (!ALIAS_IMPORT.test(specifier) || warnedUnresolvedAliasImports.has(specifier)) return;
1794
1952
  warnedUnresolvedAliasImports.add(specifier);
1795
- const importer = root ? path2.relative(root, importerPath) : importerPath;
1953
+ const importer = root ? path3.relative(root, importerPath) : importerPath;
1796
1954
  logger.warn(
1797
1955
  `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".`
1798
1956
  );
@@ -1801,7 +1959,7 @@ var projectImportAliasCache = /* @__PURE__ */ new Map();
1801
1959
  var PROJECT_ALIAS_FILES = ["tsconfig.json", "jsconfig.json", "package.json"];
1802
1960
  function resolveProjectAliasSourcePath(specifier, root) {
1803
1961
  if (!root) return void 0;
1804
- const projectRoot = path2.resolve(root);
1962
+ const projectRoot = path3.resolve(root);
1805
1963
  let match;
1806
1964
  for (const alias of getProjectImportAliases(projectRoot)) {
1807
1965
  const captured = matchProjectImportAlias(alias, specifier);
@@ -1811,7 +1969,7 @@ function resolveProjectAliasSourcePath(specifier, root) {
1811
1969
  if (!match) return void 0;
1812
1970
  const resolved = resolveSourceCandidate(
1813
1971
  match.alias.targets.map(
1814
- (target) => path2.normalize(match.alias.wildcard ? target.replace("*", match.captured) : target)
1972
+ (target) => path3.normalize(match.alias.wildcard ? target.replace("*", match.captured) : target)
1815
1973
  )
1816
1974
  );
1817
1975
  return resolved && /\.d\.[cm]?ts$/.test(resolved) ? null : resolved;
@@ -1826,7 +1984,7 @@ function matchProjectImportAlias(alias, specifier) {
1826
1984
  function getProjectImportAliases(projectRoot) {
1827
1985
  const stamp = PROJECT_ALIAS_FILES.map((file) => {
1828
1986
  try {
1829
- return String(fs2.statSync(path2.join(projectRoot, file)).mtimeMs);
1987
+ return String(fs3.statSync(path3.join(projectRoot, file)).mtimeMs);
1830
1988
  } catch {
1831
1989
  return "-";
1832
1990
  }
@@ -1844,7 +2002,7 @@ function getProjectImportAliases(projectRoot) {
1844
2002
  prefix: "@/",
1845
2003
  suffix: "",
1846
2004
  wildcard: true,
1847
- targets: [path2.join(projectRoot, sourceDir, "*")]
2005
+ targets: [path3.join(projectRoot, sourceDir, "*")]
1848
2006
  });
1849
2007
  }
1850
2008
  projectImportAliasCache.set(projectRoot, { stamp: cacheStamp, aliases });
@@ -1852,8 +2010,8 @@ function getProjectImportAliases(projectRoot) {
1852
2010
  }
1853
2011
  function readTsconfigPathAliases(projectRoot) {
1854
2012
  for (const name of ["tsconfig.json", "jsconfig.json"]) {
1855
- const configPath = path2.join(projectRoot, name);
1856
- if (!fs2.existsSync(configPath)) continue;
2013
+ const configPath = path3.join(projectRoot, name);
2014
+ if (!fs3.existsSync(configPath)) continue;
1857
2015
  const resolved = readTsconfigPaths(configPath, /* @__PURE__ */ new Set());
1858
2016
  if (!resolved?.paths) return [];
1859
2017
  const base = resolved.baseUrl ?? resolved.pathsDirectory;
@@ -1865,7 +2023,7 @@ function readTsconfigPathAliases(projectRoot) {
1865
2023
  prefix: wildcardIndex === -1 ? pattern : pattern.slice(0, wildcardIndex),
1866
2024
  suffix: wildcardIndex === -1 ? "" : pattern.slice(wildcardIndex + 1),
1867
2025
  wildcard: wildcardIndex !== -1,
1868
- targets: targets.filter((target) => typeof target === "string").map((target) => path2.resolve(base, target))
2026
+ targets: targets.filter((target) => typeof target === "string").map((target) => path3.resolve(base, target))
1869
2027
  }
1870
2028
  ];
1871
2029
  });
@@ -1877,27 +2035,27 @@ function readTsconfigPaths(configPath, visited) {
1877
2035
  visited.add(configPath);
1878
2036
  const config = readJsonWithComments(configPath);
1879
2037
  if (!config) return null;
1880
- const directory = path2.dirname(configPath);
2038
+ const directory = path3.dirname(configPath);
1881
2039
  const parents = (Array.isArray(config.extends) ? config.extends : [config.extends]).filter(
1882
2040
  (parent) => typeof parent === "string" && parent.startsWith(".")
1883
2041
  );
1884
2042
  let inherited = null;
1885
2043
  for (const parent of parents) {
1886
- const parentPath = path2.resolve(
2044
+ const parentPath = path3.resolve(
1887
2045
  directory,
1888
2046
  parent.endsWith(".json") ? parent : `${parent}.json`
1889
2047
  );
1890
2048
  inherited = readTsconfigPaths(parentPath, visited) ?? inherited;
1891
2049
  }
1892
2050
  const options = config.compilerOptions ?? {};
1893
- const baseUrl = typeof options.baseUrl === "string" ? path2.resolve(directory, options.baseUrl) : inherited?.baseUrl;
2051
+ const baseUrl = typeof options.baseUrl === "string" ? path3.resolve(directory, options.baseUrl) : inherited?.baseUrl;
1894
2052
  if (options.paths && typeof options.paths === "object") {
1895
2053
  return { paths: options.paths, pathsDirectory: directory, baseUrl };
1896
2054
  }
1897
2055
  return inherited ? { ...inherited, baseUrl } : { pathsDirectory: directory, baseUrl };
1898
2056
  }
1899
2057
  function readPackageImportAliases(projectRoot) {
1900
- const imports = readPackageJson(path2.join(projectRoot, "package.json"))?.imports;
2058
+ const imports = readPackageJson(path3.join(projectRoot, "package.json"))?.imports;
1901
2059
  if (!imports || typeof imports !== "object") return [];
1902
2060
  return Object.entries(imports).flatMap(([pattern, value]) => {
1903
2061
  const target = resolveConditionalExportTarget(value);
@@ -1908,7 +2066,7 @@ function readPackageImportAliases(projectRoot) {
1908
2066
  prefix: wildcardIndex === -1 ? pattern : pattern.slice(0, wildcardIndex),
1909
2067
  suffix: wildcardIndex === -1 ? "" : pattern.slice(wildcardIndex + 1),
1910
2068
  wildcard: wildcardIndex !== -1,
1911
- targets: [path2.resolve(projectRoot, target)]
2069
+ targets: [path3.resolve(projectRoot, target)]
1912
2070
  }
1913
2071
  ];
1914
2072
  });
@@ -1916,7 +2074,7 @@ function readPackageImportAliases(projectRoot) {
1916
2074
  function readJsonWithComments(filePath) {
1917
2075
  let source;
1918
2076
  try {
1919
- source = fs2.readFileSync(filePath, "utf8");
2077
+ source = fs3.readFileSync(filePath, "utf8");
1920
2078
  } catch {
1921
2079
  return null;
1922
2080
  }
@@ -1954,7 +2112,7 @@ function resolveImportedModuleSourcePath(importerPath, specifier, root) {
1954
2112
  return resolvePackageModuleSourcePath(importerPath, specifier, root);
1955
2113
  }
1956
2114
  const candidates = /* @__PURE__ */ new Set();
1957
- const basePath = specifier.startsWith(".") ? path2.resolve(path2.dirname(importerPath), specifier) : root ? path2.resolve(root, specifier.replace(/^\/+/, "")) : path2.resolve(specifier);
2115
+ const basePath = specifier.startsWith(".") ? path3.resolve(path3.dirname(importerPath), specifier) : root ? path3.resolve(root, specifier.replace(/^\/+/, "")) : path3.resolve(specifier);
1958
2116
  candidates.add(basePath);
1959
2117
  return resolveSourceCandidate(candidates);
1960
2118
  }
@@ -1964,45 +2122,45 @@ function resolvePackageModuleSourcePath(importerPath, specifier, root) {
1964
2122
  const packageSubpath = packageParts.slice(packageName.startsWith("@") ? 2 : 1).join("/");
1965
2123
  const packageDirectory = findPackageDirectory(importerPath, packageName, root);
1966
2124
  if (!packageDirectory) return null;
1967
- const packageJsonPath = path2.join(packageDirectory, "package.json");
2125
+ const packageJsonPath = path3.join(packageDirectory, "package.json");
1968
2126
  const packageJson = readPackageJson(packageJsonPath);
1969
2127
  const exportKey = packageSubpath ? `./${packageSubpath}` : ".";
1970
2128
  const exportTarget = resolvePackageExport(packageJson?.exports, exportKey);
1971
2129
  const candidates = /* @__PURE__ */ new Set();
1972
2130
  if (exportTarget?.startsWith("./")) {
1973
- candidates.add(path2.resolve(packageDirectory, exportTarget));
2131
+ candidates.add(path3.resolve(packageDirectory, exportTarget));
1974
2132
  }
1975
2133
  if (packageSubpath) {
1976
- candidates.add(path2.join(packageDirectory, packageSubpath));
2134
+ candidates.add(path3.join(packageDirectory, packageSubpath));
1977
2135
  } else {
1978
2136
  for (const entry of [packageJson?.browser, packageJson?.module, packageJson?.main]) {
1979
- if (typeof entry === "string") candidates.add(path2.resolve(packageDirectory, entry));
2137
+ if (typeof entry === "string") candidates.add(path3.resolve(packageDirectory, entry));
1980
2138
  }
1981
- candidates.add(path2.join(packageDirectory, "index"));
2139
+ candidates.add(path3.join(packageDirectory, "index"));
1982
2140
  }
1983
2141
  return resolveSourceCandidate(candidates);
1984
2142
  }
1985
2143
  function findPackageDirectory(importerPath, packageName, root) {
1986
2144
  const searchRoots = /* @__PURE__ */ new Set();
1987
- let current = path2.dirname(importerPath);
2145
+ let current = path3.dirname(importerPath);
1988
2146
  while (true) {
1989
2147
  searchRoots.add(current);
1990
- const parent = path2.dirname(current);
2148
+ const parent = path3.dirname(current);
1991
2149
  if (parent === current) break;
1992
2150
  current = parent;
1993
2151
  }
1994
2152
  if (root) {
1995
- current = path2.resolve(root);
2153
+ current = path3.resolve(root);
1996
2154
  while (true) {
1997
2155
  searchRoots.add(current);
1998
- const parent = path2.dirname(current);
2156
+ const parent = path3.dirname(current);
1999
2157
  if (parent === current) break;
2000
2158
  current = parent;
2001
2159
  }
2002
2160
  }
2003
2161
  for (const searchRoot of searchRoots) {
2004
- const packageDirectory = path2.join(searchRoot, "node_modules", packageName);
2005
- if (fs2.existsSync(path2.join(packageDirectory, "package.json"))) {
2162
+ const packageDirectory = path3.join(searchRoot, "node_modules", packageName);
2163
+ if (fs3.existsSync(path3.join(packageDirectory, "package.json"))) {
2006
2164
  return packageDirectory;
2007
2165
  }
2008
2166
  }
@@ -2010,7 +2168,7 @@ function findPackageDirectory(importerPath, packageName, root) {
2010
2168
  }
2011
2169
  function readPackageJson(packageJsonPath) {
2012
2170
  try {
2013
- return JSON.parse(fs2.readFileSync(packageJsonPath, "utf8"));
2171
+ return JSON.parse(fs3.readFileSync(packageJsonPath, "utf8"));
2014
2172
  } catch {
2015
2173
  return null;
2016
2174
  }
@@ -2068,26 +2226,73 @@ function resolveSourceCandidate(candidates) {
2068
2226
  for (const candidate of candidates) {
2069
2227
  const paths = [candidate];
2070
2228
  for (const extension of RESOLVABLE_SOURCE_EXTENSIONS) {
2071
- paths.push(`${candidate}${extension}`, path2.join(candidate, `index${extension}`));
2229
+ paths.push(`${candidate}${extension}`, path3.join(candidate, `index${extension}`));
2072
2230
  }
2073
2231
  for (const sourcePath of paths) {
2074
2232
  try {
2075
- if (fs2.statSync(sourcePath).isFile()) return sourcePath;
2233
+ if (fs3.statSync(sourcePath).isFile()) return sourcePath;
2076
2234
  } catch {
2077
2235
  }
2078
2236
  }
2079
2237
  }
2080
2238
  return null;
2081
2239
  }
2240
+ function isFarmPackageClientBoundary(importerPath, specifier, root) {
2241
+ const imported = resolveImportedModule(importerPath, specifier, root);
2242
+ if (imported.local || !imported.path) return false;
2243
+ return inspectPackageClientBoundary(imported.path, root, /* @__PURE__ */ new Set()).shouldHydrate;
2244
+ }
2245
+ var CLIENT_PACKAGE_SCAN_EXTENSIONS = /\.(?:[cm]?[jt]sx?)$/;
2246
+ var CLIENT_PACKAGE_SCAN_SKIP = /* @__PURE__ */ new Set(["node_modules", ".farm", ".git", "dist", ".output"]);
2247
+ function bareSpecifierPackage(specifier) {
2248
+ if (specifier.startsWith(".") || specifier.startsWith("/") || specifier.startsWith("#") || specifier.startsWith("node:") || specifier.startsWith("virtual:") || specifier.includes("\0") || // A package's stylesheet or asset is not a module for the optimizer.
2249
+ /\.(?:css|scss|sass|less|styl|svg|png|jpe?g|gif|webp|avif|ico|woff2?|ttf|json|wasm)$/.test(
2250
+ specifier
2251
+ )) {
2252
+ return null;
2253
+ }
2254
+ return specifier;
2255
+ }
2256
+ function collectFarmClientPackageImports(directory, root) {
2257
+ const found = /* @__PURE__ */ new Set();
2258
+ const walk2 = (current) => {
2259
+ let entries;
2260
+ try {
2261
+ entries = fs3.readdirSync(current, { withFileTypes: true });
2262
+ } catch {
2263
+ return;
2264
+ }
2265
+ for (const entry of entries) {
2266
+ if (entry.name.startsWith(".") && entry.isDirectory()) continue;
2267
+ const file = path3.join(current, entry.name);
2268
+ if (entry.isDirectory()) {
2269
+ if (!CLIENT_PACKAGE_SCAN_SKIP.has(entry.name)) walk2(file);
2270
+ continue;
2271
+ }
2272
+ if (!CLIENT_PACKAGE_SCAN_EXTENSIONS.test(entry.name) || entry.name.endsWith(".d.ts"))
2273
+ continue;
2274
+ const content = readIfExists(file);
2275
+ if (!content) continue;
2276
+ const client = hasUseClientDirective(content);
2277
+ for (const specifier of new Set(getImportSpecifiers(content))) {
2278
+ const name = bareSpecifierPackage(specifier);
2279
+ if (!name || found.has(name)) continue;
2280
+ if (client || isFarmPackageClientBoundary(file, name, root)) found.add(name);
2281
+ }
2282
+ }
2283
+ };
2284
+ walk2(directory);
2285
+ return [...found].sort();
2286
+ }
2082
2287
 
2083
2288
  // src/routing/route-manager.ts
2084
2289
  import { realpathSync } from "fs";
2085
- import path4 from "path";
2290
+ import path5 from "path";
2086
2291
 
2087
2292
  // src/static-metadata-image.ts
2088
2293
  import { createHash } from "crypto";
2089
2294
  import { readFile } from "fs/promises";
2090
- import path3 from "path";
2295
+ import path4 from "path";
2091
2296
  import { imageSize } from "image-size";
2092
2297
  var STATIC_METADATA_IMAGE_EXTENSIONS = ["png", "jpg", "jpeg", "gif", "webp"];
2093
2298
  var CONTENT_TYPES = {
@@ -2128,13 +2333,13 @@ async function inspectStaticMetadataImage(filePath) {
2128
2333
  };
2129
2334
  }
2130
2335
  function getStaticMetadataImageAltPath(filePath) {
2131
- return path3.join(
2132
- path3.dirname(filePath),
2133
- `${path3.basename(filePath, path3.extname(filePath))}.alt.txt`
2336
+ return path4.join(
2337
+ path4.dirname(filePath),
2338
+ `${path4.basename(filePath, path4.extname(filePath))}.alt.txt`
2134
2339
  );
2135
2340
  }
2136
2341
  function getStaticMetadataImageExtension(filePath) {
2137
- const extension = path3.extname(filePath).slice(1).toLowerCase();
2342
+ const extension = path4.extname(filePath).slice(1).toLowerCase();
2138
2343
  return STATIC_METADATA_IMAGE_EXTENSIONS.includes(extension) ? extension : null;
2139
2344
  }
2140
2345
  async function readAltText(filePath) {
@@ -2462,14 +2667,14 @@ var RouteManager = class {
2462
2667
  * Requests still fetch route data, but never inspect component source.
2463
2668
  */
2464
2669
  generateClientManifest(projectRoot = this.config.root) {
2465
- const normalizedProjectRoot = path4.resolve(projectRoot);
2670
+ const normalizedProjectRoot = path5.resolve(projectRoot);
2466
2671
  if (this.clientManifestCache?.projectRoot === normalizedProjectRoot) {
2467
2672
  return this.clientManifestCache.manifest;
2468
2673
  }
2469
2674
  const toUrlPath = (absolutePath) => {
2470
2675
  const rootRelative = toRootRelativeUrlPath(absolutePath, normalizedProjectRoot);
2471
2676
  if (rootRelative !== void 0) return rootRelative;
2472
- if (path4.isAbsolute(absolutePath)) {
2677
+ if (path5.isAbsolute(absolutePath)) {
2473
2678
  const normalized = absolutePath.replace(/\\/g, "/");
2474
2679
  return normalized.startsWith("/") ? `/@fs${normalized}` : `/@fs/${normalized}`;
2475
2680
  }
@@ -2511,7 +2716,7 @@ var RouteManager = class {
2511
2716
  resolveFarmMdxComponentsModulePath(resolveMdxConfig(this.config.mdx), normalizedProjectRoot),
2512
2717
  normalizedProjectRoot,
2513
2718
  isolatedMode,
2514
- planOptions
2719
+ { ...planOptions, packageReferences: islandsMode }
2515
2720
  );
2516
2721
  const routeEntries = Array.from(this.routes.values()).map((entry) => ({
2517
2722
  entry,
@@ -2649,7 +2854,7 @@ var RouteManager = class {
2649
2854
  for (const { metadata } of [...layoutEntries, ...routeEntries]) {
2650
2855
  if (!metadata.hasIsolatedClientBoundaries && !metadata.serverTreeLayout) continue;
2651
2856
  for (const boundary of metadata.isolatedBoundaries) {
2652
- isolatedClientBoundaryModules.add(path4.resolve(boundary.modulePath));
2857
+ isolatedClientBoundaryModules.add(path5.resolve(boundary.modulePath));
2653
2858
  }
2654
2859
  }
2655
2860
  const islandsErrors = [
@@ -2700,7 +2905,7 @@ var RouteManager = class {
2700
2905
  }
2701
2906
  /** @internal Client modules selected by the compiled hydration ownership plan. */
2702
2907
  getIsolatedClientBoundaryModules(projectRoot = this.config.root) {
2703
- const normalizedProjectRoot = path4.resolve(projectRoot);
2908
+ const normalizedProjectRoot = path5.resolve(projectRoot);
2704
2909
  this.generateClientManifest(normalizedProjectRoot);
2705
2910
  return this.clientManifestCache?.isolatedClientBoundaryModules ?? /* @__PURE__ */ new Set();
2706
2911
  }
@@ -2709,7 +2914,7 @@ var RouteManager = class {
2709
2914
  * such a page whole would ship its server code to the browser, so it stays static instead.
2710
2915
  */
2711
2916
  getIslandsErrors(projectRoot = this.config.root) {
2712
- this.generateClientManifest(path4.resolve(projectRoot));
2917
+ this.generateClientManifest(path5.resolve(projectRoot));
2713
2918
  return this.clientManifestCache?.islandsErrors ?? [];
2714
2919
  }
2715
2920
  /**
@@ -2840,19 +3045,19 @@ var RouteManager = class {
2840
3045
  const markdownFiles = group.files.filter(isFarmMarkdownPageFile);
2841
3046
  if (componentFiles.length > 1) {
2842
3047
  throw new Error(
2843
- `Duplicate page route "${pattern}". Found ${componentFiles.map((file) => path4.join(appDir, file)).join(" and ")}.`
3048
+ `Duplicate page route "${pattern}". Found ${componentFiles.map((file) => path5.join(appDir, file)).join(" and ")}.`
2844
3049
  );
2845
3050
  }
2846
3051
  if (markdownFiles.length > 1) {
2847
3052
  throw new Error(
2848
- `Duplicate markdown representation for page route "${pattern}". Found ${markdownFiles.map((file) => path4.join(appDir, file)).join(" and ")}.`
3053
+ `Duplicate markdown representation for page route "${pattern}". Found ${markdownFiles.map((file) => path5.join(appDir, file)).join(" and ")}.`
2849
3054
  );
2850
3055
  }
2851
3056
  const componentFile = componentFiles[0];
2852
3057
  const markdownFile = markdownFiles[0];
2853
3058
  const primaryFile = componentFile || markdownFile;
2854
3059
  if (!primaryFile) continue;
2855
- const modulePath = path4.join(appDir, primaryFile);
3060
+ const modulePath = path5.join(appDir, primaryFile);
2856
3061
  const existing = this.routes.get(pattern);
2857
3062
  if (existing?.sourceRoot === source.root) {
2858
3063
  throw new Error(
@@ -2863,7 +3068,7 @@ var RouteManager = class {
2863
3068
  route: group.route,
2864
3069
  modulePath,
2865
3070
  ...markdownFile ? {
2866
- markdownSourcePath: path4.join(appDir, markdownFile)
3071
+ markdownSourcePath: path5.join(appDir, markdownFile)
2867
3072
  } : {},
2868
3073
  pattern,
2869
3074
  ...getPageDirectoryField(group.route, pattern),
@@ -2878,7 +3083,7 @@ var RouteManager = class {
2878
3083
  ]) {
2879
3084
  for (const file of files) {
2880
3085
  const route = parseRoutePath(file);
2881
- const modulePath = path4.join(appDir, file);
3086
+ const modulePath = path5.join(appDir, file);
2882
3087
  const pattern = createRouteDirectoryPattern(route);
2883
3088
  const existing = target.get(pattern);
2884
3089
  if (existing?.sourceRoot === source.root) {
@@ -2898,7 +3103,7 @@ var RouteManager = class {
2898
3103
  for (const file of [...pageFiles, ...slotDefaultFiles]) {
2899
3104
  const slot = parseRouteSlotFile(file);
2900
3105
  if (!slot) continue;
2901
- const modulePath = path4.join(appDir, file);
3106
+ const modulePath = path5.join(appDir, file);
2902
3107
  const pattern = this.createRoutePattern(slot.route);
2903
3108
  const ownerPattern = this.createRoutePattern(slot.ownerRoute);
2904
3109
  const ownerDirectory = createRouteDirectoryPattern(slot.ownerRoute);
@@ -2924,11 +3129,11 @@ var RouteManager = class {
2924
3129
  });
2925
3130
  }
2926
3131
  for (const file of metadataImageFiles) {
2927
- const fileBase = path4.basename(file, path4.extname(file));
3132
+ const fileBase = path5.basename(file, path5.extname(file));
2928
3133
  const kind = fileBase === "twitter-image" ? "twitter" : "opengraph";
2929
3134
  const fileName = kind === "twitter" ? "twitter-image" : "opengraph-image";
2930
3135
  const route = parseRoutePath(file);
2931
- const modulePath = path4.join(appDir, file);
3136
+ const modulePath = path5.join(appDir, file);
2932
3137
  const pattern = this.createRoutePattern(route);
2933
3138
  const key = `${kind}:${pattern}`;
2934
3139
  const existing = this.metadataImages.get(key);
@@ -2953,11 +3158,11 @@ var RouteManager = class {
2953
3158
  }
2954
3159
  for (const file of metadataRouteFiles) {
2955
3160
  const descriptor = getApplicationMetadataRouteDescriptor(
2956
- path4.basename(file, path4.extname(file))
3161
+ path5.basename(file, path5.extname(file))
2957
3162
  );
2958
3163
  if (!descriptor) continue;
2959
3164
  const route = parseRoutePath(file);
2960
- const modulePath = path4.join(appDir, file);
3165
+ const modulePath = path5.join(appDir, file);
2961
3166
  const pattern = this.createRoutePattern(route);
2962
3167
  const key = `${descriptor.kind}:${pattern}`;
2963
3168
  const existing = this.metadataRoutes.get(key);
@@ -3368,12 +3573,12 @@ function toRealPath(filePath) {
3368
3573
  }
3369
3574
 
3370
3575
  // src/server/dev-styles.ts
3371
- import * as fs3 from "fs";
3372
- import * as path5 from "path";
3576
+ import * as fs4 from "fs";
3577
+ import * as path6 from "path";
3373
3578
  function resolveDevGlobalStylesheetHref(root, srcDir = "src") {
3374
- const file = path5.join(root, srcDir, "app", "globals.css");
3375
- if (!fs3.existsSync(file)) return void 0;
3376
- return `/${path5.relative(root, file).split(path5.sep).join("/")}`;
3579
+ const file = path6.join(root, srcDir, "app", "globals.css");
3580
+ if (!fs4.existsSync(file)) return void 0;
3581
+ return `/${path6.relative(root, file).split(path6.sep).join("/")}`;
3377
3582
  }
3378
3583
  var STYLE_EXTENSIONS = /\.(css|scss|sass|less|styl|stylus)(?:$|\?)/;
3379
3584
  var ALREADY_LINKED = "/src/app/globals.css";
@@ -3397,7 +3602,7 @@ function collectDevStylesheetUrls(modules, alreadyLinked = ALREADY_LINKED, optio
3397
3602
  import { createHash as createHash2, timingSafeEqual } from "crypto";
3398
3603
  import { existsSync as existsSync2 } from "fs";
3399
3604
  import { readFile as readFile2 } from "fs/promises";
3400
- import path6 from "path";
3605
+ import path7 from "path";
3401
3606
  import { createRequire } from "module";
3402
3607
  import { pathToFileURL } from "url";
3403
3608
  var FONT_IMPORTS = /* @__PURE__ */ new Set(["@farm.js/core", "@farm.js/core/font"]);
@@ -3754,7 +3959,7 @@ ${FONT_SECTION_END}
3754
3959
  return resource;
3755
3960
  }
3756
3961
  const bytes2 = await fetchRemoteFont(url, input.integrity);
3757
- return this.createSelfHostedResource(bytes2, extension, path6.basename(url.pathname));
3962
+ return this.createSelfHostedResource(bytes2, extension, path7.basename(url.pathname));
3758
3963
  }
3759
3964
  if (input.source.startsWith("/")) {
3760
3965
  return this.createPublicResource(input.moduleId, input.source);
@@ -3777,8 +3982,8 @@ ${FONT_SECTION_END}
3777
3982
  }
3778
3983
  return this.createSelfHostedResource(
3779
3984
  bytes,
3780
- path6.extname(resolvedPath),
3781
- path6.basename(resolvedPath)
3985
+ path7.extname(resolvedPath),
3986
+ path7.basename(resolvedPath)
3782
3987
  );
3783
3988
  }
3784
3989
  async createPublicResource(moduleId, source) {
@@ -3789,7 +3994,7 @@ ${FONT_SECTION_END}
3789
3994
  );
3790
3995
  }
3791
3996
  const publicPath = normalizePublicFontPath(source, moduleId);
3792
- const resolvedPath = path6.resolve(this.publicDir, `.${publicPath}`);
3997
+ const resolvedPath = path7.resolve(this.publicDir, `.${publicPath}`);
3793
3998
  if (!isPathInside(this.publicDir, resolvedPath)) {
3794
3999
  throw fontError(moduleId, `public font path must stay inside publicDir`);
3795
4000
  }
@@ -3805,7 +4010,7 @@ ${FONT_SECTION_END}
3805
4010
  `could not read ${JSON.stringify(source)} from publicDir: ${error.message}`
3806
4011
  );
3807
4012
  }
3808
- const extension = path6.extname(resolvedPath).toLowerCase();
4013
+ const extension = path7.extname(resolvedPath).toLowerCase();
3809
4014
  const hash = createHash2("sha256").update(bytes).digest("hex").slice(0, 12);
3810
4015
  const resource = {
3811
4016
  extension,
@@ -3820,7 +4025,7 @@ ${FONT_SECTION_END}
3820
4025
  createSelfHostedResource(bytes, extension, fileName) {
3821
4026
  const normalizedExtension = extension.toLowerCase();
3822
4027
  const hash = createHash2("sha256").update(bytes).digest("hex").slice(0, 12);
3823
- const baseName = sanitizeFileName(path6.basename(fileName, extension)) || "font";
4028
+ const baseName = sanitizeFileName(path7.basename(fileName, extension)) || "font";
3824
4029
  const outputFileName = `assets/fonts/${baseName}-h${hash}${normalizedExtension}`;
3825
4030
  const key = `${hash}${normalizedExtension}`;
3826
4031
  const existing = this.resources.get(key);
@@ -4173,24 +4378,24 @@ function verifyIntegrity(bytes, integrity) {
4173
4378
  if (!matches) throw new Error("downloaded font did not match its integrity value");
4174
4379
  }
4175
4380
  function resolveLocalFontPath(source, importer, root) {
4176
- if (source.startsWith(".")) return path6.resolve(path6.dirname(importer), source);
4177
- if (path6.isAbsolute(source)) {
4381
+ if (source.startsWith(".")) return path7.resolve(path7.dirname(importer), source);
4382
+ if (path7.isAbsolute(source)) {
4178
4383
  return source;
4179
4384
  }
4180
4385
  try {
4181
4386
  return createRequire(pathToFileURL(importer)).resolve(source);
4182
4387
  } catch {
4183
4388
  const segments = source.replace(/\\/g, "/").split("/");
4184
- if (segments.includes("..")) return path6.resolve(root, source);
4185
- let current = path6.dirname(importer);
4186
- const filesystemRoot = path6.parse(current).root;
4389
+ if (segments.includes("..")) return path7.resolve(root, source);
4390
+ let current = path7.dirname(importer);
4391
+ const filesystemRoot = path7.parse(current).root;
4187
4392
  while (true) {
4188
- const candidate = path6.join(current, "node_modules", ...segments);
4393
+ const candidate = path7.join(current, "node_modules", ...segments);
4189
4394
  if (existsSync2(candidate)) return candidate;
4190
4395
  if (current === filesystemRoot) break;
4191
- current = path6.dirname(current);
4396
+ current = path7.dirname(current);
4192
4397
  }
4193
- return path6.resolve(root, "node_modules", ...segments);
4398
+ return path7.resolve(root, "node_modules", ...segments);
4194
4399
  }
4195
4400
  }
4196
4401
  function replaceFontSection(css, section) {
@@ -4223,11 +4428,11 @@ function getGlobalMap(key) {
4223
4428
  return created;
4224
4429
  }
4225
4430
  function normalizeRoot(root) {
4226
- return path6.resolve(root).replace(/\\/g, "/");
4431
+ return path7.resolve(root).replace(/\\/g, "/");
4227
4432
  }
4228
4433
  function normalizePublicDir(root, publicDir) {
4229
4434
  if (publicDir === false || publicDir === "") return false;
4230
- return path6.resolve(root, publicDir || "public");
4435
+ return path7.resolve(root, publicDir || "public");
4231
4436
  }
4232
4437
  function normalizePublicFontPath(source, moduleId) {
4233
4438
  if (source.includes("?") || source.includes("#")) {
@@ -4236,8 +4441,8 @@ function normalizePublicFontPath(source, moduleId) {
4236
4441
  return `/${source.replace(/\\/g, "/").replace(/^\/+/, "")}`;
4237
4442
  }
4238
4443
  function isPathInside(parent, child) {
4239
- const relative3 = path6.relative(parent, child);
4240
- return relative3 === "" || !relative3.startsWith("..") && !path6.isAbsolute(relative3);
4444
+ const relative3 = path7.relative(parent, child);
4445
+ return relative3 === "" || !relative3.startsWith("..") && !path7.isAbsolute(relative3);
4241
4446
  }
4242
4447
  function normalizeBasePath(value) {
4243
4448
  if (!value || value === "/") return "/";
@@ -4247,7 +4452,7 @@ function joinBasePath(basePath, value) {
4247
4452
  return basePath === "/" ? value : `${basePath.replace(/\/$/, "")}${value}`;
4248
4453
  }
4249
4454
  function extensionFromPath(pathname) {
4250
- const extension = path6.extname(pathname).toLowerCase();
4455
+ const extension = path7.extname(pathname).toLowerCase();
4251
4456
  if (!FONT_EXTENSION_RE.test(extension)) {
4252
4457
  throw new Error(`[Farm fonts] Remote font URL must end in .woff2, .woff, .ttf, or .otf`);
4253
4458
  }
@@ -4387,7 +4592,7 @@ function fontError(id, message) {
4387
4592
  }
4388
4593
 
4389
4594
  // src/integration-provider-build.ts
4390
- import path7 from "path";
4595
+ import path8 from "path";
4391
4596
  function isRendererCompiledComponent(moduleId, rendererComponentExtensions) {
4392
4597
  const lowered = moduleId.toLowerCase();
4393
4598
  return rendererComponentExtensions.some((extension) => lowered.endsWith(extension.toLowerCase()));
@@ -4489,14 +4694,14 @@ function generateFarmIntegrationProviderServerModules(providers, root, rendererC
4489
4694
  }
4490
4695
  function resolveProviderModule(moduleId, root) {
4491
4696
  if (!moduleId.startsWith(".")) return moduleId;
4492
- return toViteModuleId(path7.resolve(root, moduleId), root);
4697
+ return toViteModuleId(path8.resolve(root, moduleId), root);
4493
4698
  }
4494
4699
 
4495
4700
  // src/island-inference.ts
4496
- import fs4 from "fs";
4497
- import path8 from "path";
4701
+ import fs5 from "fs";
4702
+ import path9 from "path";
4498
4703
  import { inferStrategy } from "@farm.js/islx/compiler";
4499
- import { parseAst } from "rolldown/parseAst";
4704
+ import { parseAst as parseAst2 } from "rolldown/parseAst";
4500
4705
  var PARSE_LANGS = /* @__PURE__ */ new Map([
4501
4706
  [".tsx", "tsx"],
4502
4707
  [".ts", "ts"],
@@ -4505,29 +4710,29 @@ var PARSE_LANGS = /* @__PURE__ */ new Map([
4505
4710
  [".mjs", "js"]
4506
4711
  ]);
4507
4712
  function parseFarmIslandSource(file, code) {
4508
- const lang = PARSE_LANGS.get(path8.extname(file));
4509
- if (!lang) throw new Error(`${path8.basename(file)} is not a script module`);
4510
- return parseAst(code, { lang });
4713
+ const lang = PARSE_LANGS.get(path9.extname(file));
4714
+ if (!lang) throw new Error(`${path9.basename(file)} is not a script module`);
4715
+ return parseAst2(code, { lang });
4511
4716
  }
4512
4717
  function modifiedAt(file) {
4513
4718
  try {
4514
- return fs4.statSync(file).mtimeMs;
4719
+ return fs5.statSync(file).mtimeMs;
4515
4720
  } catch {
4516
4721
  return -1;
4517
4722
  }
4518
4723
  }
4519
4724
  var inferences = /* @__PURE__ */ new Map();
4520
4725
  function inferFarmIslandStrategy(filePath, root) {
4521
- const file = path8.resolve(filePath);
4726
+ const file = path9.resolve(filePath);
4522
4727
  const cached = inferences.get(file);
4523
4728
  if (cached && cached.stamps.every(([read, stamp]) => modifiedAt(read) === stamp)) {
4524
4729
  return cached.result;
4525
4730
  }
4526
4731
  let code;
4527
4732
  try {
4528
- code = fs4.readFileSync(file, "utf8");
4733
+ code = fs5.readFileSync(file, "utf8");
4529
4734
  } catch {
4530
- return { strategy: null, files: [file], reason: `${path8.basename(file)} could not be read` };
4735
+ return { strategy: null, files: [file], reason: `${path9.basename(file)} could not be read` };
4531
4736
  }
4532
4737
  const result = inferStrategy(file, code, {
4533
4738
  parse: parseFarmIslandSource,
@@ -4551,7 +4756,7 @@ function inferFarmRouteRootStrategy(owners, root) {
4551
4756
  return {
4552
4757
  strategy: null,
4553
4758
  files,
4554
- reason: `${path8.basename(owner)}: its client components could not be listed`
4759
+ reason: `${path9.basename(owner)}: its client components could not be listed`
4555
4760
  };
4556
4761
  }
4557
4762
  modules.push(...rendered);
@@ -4559,7 +4764,7 @@ function inferFarmRouteRootStrategy(owners, root) {
4559
4764
  for (const module of modules) {
4560
4765
  let source = null;
4561
4766
  try {
4562
- source = fs4.readFileSync(module, "utf8");
4767
+ source = fs5.readFileSync(module, "utf8");
4563
4768
  } catch {
4564
4769
  }
4565
4770
  if (getIslandStrategyExport(source) !== null) return { strategy: null, files, declared: true };
@@ -4595,8 +4800,8 @@ function resolveFarmRouteRootStrategy(route, page, layouts, root, islandsMode) {
4595
4800
  }
4596
4801
 
4597
4802
  // src/client-plugin-build.ts
4598
- import fs5 from "fs";
4599
- import path9 from "path";
4803
+ import fs6 from "fs";
4804
+ import path10 from "path";
4600
4805
  var CLIENT_KEYS = [
4601
4806
  "public",
4602
4807
  "setup",
@@ -4616,10 +4821,10 @@ var MOBILE_SHELL_CLIENT_REGISTRATION = ` {
4616
4821
  }`;
4617
4822
  var APP_CLIENT_EXTENSIONS = ["ts", "tsx", "js", "jsx", "mts", "mjs"];
4618
4823
  function resolveFarmAppClientEntry(root = process.cwd(), srcDir = "src") {
4619
- const sourceRoot = path9.resolve(root, srcDir);
4824
+ const sourceRoot = path10.resolve(root, srcDir);
4620
4825
  for (const extension of APP_CLIENT_EXTENSIONS) {
4621
- const candidate = path9.join(sourceRoot, `client.${extension}`);
4622
- if (fs5.existsSync(candidate) && fs5.statSync(candidate).isFile()) return candidate;
4826
+ const candidate = path10.join(sourceRoot, `client.${extension}`);
4827
+ if (fs6.existsSync(candidate) && fs6.statSync(candidate).isFile()) return candidate;
4623
4828
  }
4624
4829
  return void 0;
4625
4830
  }
@@ -4861,27 +5066,27 @@ function isArrayIndex(key) {
4861
5066
  }
4862
5067
 
4863
5068
  // src/server/renderer.ts
4864
- import * as fs8 from "fs";
5069
+ import * as fs9 from "fs";
4865
5070
  import * as https from "https";
4866
5071
  import { isIP } from "net";
4867
- import * as path12 from "path";
5072
+ import * as path13 from "path";
4868
5073
  import * as tls from "tls";
4869
5074
  import { Readable, Writable } from "stream";
4870
5075
 
4871
5076
  // src/not-found.ts
4872
- import fs6 from "fs";
4873
- import path10 from "path";
5077
+ import fs7 from "fs";
5078
+ import path11 from "path";
4874
5079
  function resolveFarmNotFoundComponentPath(config, appDirs) {
4875
5080
  const extensions = getFarmRendererComponentExtensions(config.renderer);
4876
5081
  const configuredPath = config.notFound?.component?.trim();
4877
5082
  if (configuredPath) {
4878
- const componentPath = path10.isAbsolute(configuredPath) ? path10.normalize(configuredPath) : path10.resolve(config.root, configuredPath);
5083
+ const componentPath = path11.isAbsolute(configuredPath) ? path11.normalize(configuredPath) : path11.resolve(config.root, configuredPath);
4879
5084
  if (!extensions.some((extension) => componentPath.endsWith(extension))) {
4880
5085
  throw new Error(
4881
5086
  `notFound.component must use one of the configured renderer extensions: ${extensions.join(", ")}`
4882
5087
  );
4883
5088
  }
4884
- if (!fs6.existsSync(componentPath) || !fs6.statSync(componentPath).isFile()) {
5089
+ if (!fs7.existsSync(componentPath) || !fs7.statSync(componentPath).isFile()) {
4885
5090
  throw new Error(`notFound.component was not found: ${componentPath}`);
4886
5091
  }
4887
5092
  return componentPath;
@@ -4889,8 +5094,8 @@ function resolveFarmNotFoundComponentPath(config, appDirs) {
4889
5094
  let discoveredPath = null;
4890
5095
  for (const appDir of appDirs) {
4891
5096
  for (const extension of extensions) {
4892
- const candidate = path10.join(appDir, `not-found${extension}`);
4893
- if (fs6.existsSync(candidate) && fs6.statSync(candidate).isFile()) {
5097
+ const candidate = path11.join(appDir, `not-found${extension}`);
5098
+ if (fs7.existsSync(candidate) && fs7.statSync(candidate).isFile()) {
4894
5099
  discoveredPath = candidate;
4895
5100
  break;
4896
5101
  }
@@ -5086,8 +5291,8 @@ body {
5086
5291
  import { pathToFileURL as pathToFileURL2 } from "url";
5087
5292
 
5088
5293
  // src/server/error-diagnostics.ts
5089
- import * as fs7 from "fs";
5090
- import * as path11 from "path";
5294
+ import * as fs8 from "fs";
5295
+ import * as path12 from "path";
5091
5296
  import { fileURLToPath as fileURLToPath2 } from "url";
5092
5297
  var SECRET_VALUE_PATTERN = /\b(api[_-]?key|access[_-]?token|auth[_-]?token|client[_-]?secret|secret[_-]?key|token|password|secret)\s*[:=]\s*([^\s,;]+)/gi;
5093
5298
  var BEARER_PATTERN = /\b(Bearer\s+)[A-Za-z0-9._~+/=-]+/gi;
@@ -5095,8 +5300,8 @@ function redactErrorText(value) {
5095
5300
  return value.replace(BEARER_PATTERN, "$1[REDACTED]").replace(SECRET_VALUE_PATTERN, "$1=[REDACTED]");
5096
5301
  }
5097
5302
  function isPathInsideRoot(root, filePath) {
5098
- const relative3 = path11.relative(root, filePath);
5099
- return relative3 === "" || !relative3.startsWith("..") && !path11.isAbsolute(relative3);
5303
+ const relative3 = path12.relative(root, filePath);
5304
+ return relative3 === "" || !relative3.startsWith("..") && !path12.isAbsolute(relative3);
5100
5305
  }
5101
5306
  function normalizeStackPath(value) {
5102
5307
  const withoutQuery = value.replace(/[?#].*$/, "");
@@ -5113,13 +5318,13 @@ function findStackLocation(stack, root) {
5113
5318
  );
5114
5319
  if (!match) continue;
5115
5320
  const candidate = normalizeStackPath(match[1]);
5116
- if (!candidate || candidate.includes(`${path11.sep}node_modules${path11.sep}`)) continue;
5117
- const absolutePath = path11.resolve(candidate);
5118
- if (!isPathInsideRoot(root, absolutePath) || !fs7.existsSync(absolutePath)) continue;
5119
- const relativePath = path11.relative(root, absolutePath).split(path11.sep).join("/");
5321
+ if (!candidate || candidate.includes(`${path12.sep}node_modules${path12.sep}`)) continue;
5322
+ const absolutePath = path12.resolve(candidate);
5323
+ if (!isPathInsideRoot(root, absolutePath) || !fs8.existsSync(absolutePath)) continue;
5324
+ const relativePath = path12.relative(root, absolutePath).split(path12.sep).join("/");
5120
5325
  return {
5121
5326
  absolutePath,
5122
- displayPath: relativePath || path11.basename(absolutePath),
5327
+ displayPath: relativePath || path12.basename(absolutePath),
5123
5328
  line: Number(match[2]),
5124
5329
  column: Number(match[3])
5125
5330
  };
@@ -5128,7 +5333,7 @@ function findStackLocation(stack, root) {
5128
5333
  }
5129
5334
  function createSourceFrame(location) {
5130
5335
  try {
5131
- const sourceLines = fs7.readFileSync(location.absolutePath, "utf8").split(/\r?\n/);
5336
+ const sourceLines = fs8.readFileSync(location.absolutePath, "utf8").split(/\r?\n/);
5132
5337
  if (location.line < 1 || location.line > sourceLines.length) return void 0;
5133
5338
  const start = Math.max(1, location.line - 2);
5134
5339
  const end = Math.min(sourceLines.length, location.line + 2);
@@ -5151,13 +5356,13 @@ function createSourceFrame(location) {
5151
5356
  }
5152
5357
  }
5153
5358
  function sanitizeStack(stack, root) {
5154
- const normalizedRoot = path11.resolve(root);
5359
+ const normalizedRoot = path12.resolve(root);
5155
5360
  return redactErrorText(stack).split(normalizedRoot).join("<project>").replace(/<project>[^\s)]*/g, (segment) => segment.split("\\").join("/")).split("\n").filter((line, index) => index === 0 || !line.includes("node:internal")).slice(0, 14).join("\n");
5156
5361
  }
5157
5362
  function createDefaultErrorDiagnostics(error, root) {
5158
5363
  const normalizedError = error instanceof Error ? error : new Error(typeof error === "string" ? error : "Unknown server rendering error");
5159
5364
  const rawStack = normalizedError.stack || `${normalizedError.name}: ${normalizedError.message}`;
5160
- const location = findStackLocation(rawStack, path11.resolve(root));
5365
+ const location = findStackLocation(rawStack, path12.resolve(root));
5161
5366
  return {
5162
5367
  name: redactErrorText(normalizedError.name || "Error"),
5163
5368
  message: redactErrorText(normalizedError.message || "Unknown server rendering error"),
@@ -5426,7 +5631,7 @@ function createRouteStateProps(input) {
5426
5631
  function readAppPackageIdentity(root) {
5427
5632
  try {
5428
5633
  return JSON.parse(
5429
- fs8.readFileSync(path12.join(root || process.cwd(), "package.json"), "utf8")
5634
+ fs9.readFileSync(path13.join(root || process.cwd(), "package.json"), "utf8")
5430
5635
  );
5431
5636
  } catch {
5432
5637
  return {};
@@ -5733,10 +5938,10 @@ var ServerRenderer = class {
5733
5938
  * Load SSG manifest from build output
5734
5939
  */
5735
5940
  loadSSGManifest() {
5736
- const manifestPath = path12.join(this.config.root, this.config.outDir, "__ssg_manifest.json");
5941
+ const manifestPath = path13.join(this.config.root, this.config.outDir, "__ssg_manifest.json");
5737
5942
  let content;
5738
5943
  try {
5739
- content = fs8.readFileSync(manifestPath, "utf-8");
5944
+ content = fs9.readFileSync(manifestPath, "utf-8");
5740
5945
  } catch (error) {
5741
5946
  if (error.code === "ENOENT") {
5742
5947
  return;
@@ -5955,10 +6160,10 @@ var ServerRenderer = class {
5955
6160
  return true;
5956
6161
  }
5957
6162
  try {
5958
- const htmlPath = page.urlPath === "/" ? path12.join(this.config.root, this.config.outDir, "client", "index.html") : path12.join(this.config.root, this.config.outDir, "client", page.urlPath + ".html");
5959
- if (fs8.existsSync(htmlPath)) {
5960
- const stat = fs8.statSync(htmlPath);
5961
- const html = fs8.readFileSync(htmlPath, "utf-8");
6163
+ const htmlPath = page.urlPath === "/" ? path13.join(this.config.root, this.config.outDir, "client", "index.html") : path13.join(this.config.root, this.config.outDir, "client", page.urlPath + ".html");
6164
+ if (fs9.existsSync(htmlPath)) {
6165
+ const stat = fs9.statSync(htmlPath);
6166
+ const html = fs9.readFileSync(htmlPath, "utf-8");
5962
6167
  await this.cacheSSGPage(page, html, {
5963
6168
  document: true,
5964
6169
  createdAt: stat.mtimeMs
@@ -6721,11 +6926,11 @@ var ServerRenderer = class {
6721
6926
  if (isFarmIntegrationProviderComponentReference(provider.component)) {
6722
6927
  providerSourceModule = provider.component.module;
6723
6928
  const providerModuleId = provider.component.module.startsWith(".") ? toViteModuleId(
6724
- path12.resolve(this.config.root, provider.component.module),
6929
+ path13.resolve(this.config.root, provider.component.module),
6725
6930
  this.config.root
6726
6931
  ) : provider.component.module;
6727
6932
  const providerModule = this.viteServer ? await loadFarmDevModule(this.viteServer, providerModuleId) : await importRuntimeModule(
6728
- provider.component.module.startsWith(".") ? pathToFileURL2(path12.resolve(this.config.root, provider.component.module)).href : provider.component.module
6933
+ provider.component.module.startsWith(".") ? pathToFileURL2(path13.resolve(this.config.root, provider.component.module)).href : provider.component.module
6729
6934
  );
6730
6935
  ProviderComponent = providerModule[provider.component.export || "default"];
6731
6936
  } else if (typeof provider.component === "function") {
@@ -6992,7 +7197,7 @@ var ServerRenderer = class {
6992
7197
  logger.warn(`Could not read metadata for ${pattern} in sitemap.xml: ${error}`);
6993
7198
  return void 0;
6994
7199
  }),
6995
- fs8.promises.stat(route.modulePath).catch(() => void 0)
7200
+ fs9.promises.stat(route.modulePath).catch(() => void 0)
6996
7201
  ]);
6997
7202
  return { pattern, module, lastModified: stat?.mtime.toISOString() };
6998
7203
  })
@@ -7243,7 +7448,7 @@ var ServerRenderer = class {
7243
7448
  res.end();
7244
7449
  return;
7245
7450
  }
7246
- res.write(await fs8.promises.readFile(image.modulePath));
7451
+ res.write(await fs9.promises.readFile(image.modulePath));
7247
7452
  res.end();
7248
7453
  }
7249
7454
  async renderRouteErrorBoundary(req, res, options) {
@@ -8064,13 +8269,13 @@ window.__FARM_I18N__ = ${getFarmI18nClientSnapshot() ? serializeInlineValue(getF
8064
8269
  res.end(createFarmMarkdownErrorBody(404, pathname, this.config.basePath || "/"));
8065
8270
  return;
8066
8271
  }
8067
- const appDir = path12.join(this.config.root, this.config.srcDir, "app");
8272
+ const appDir = path13.join(this.config.root, this.config.srcDir, "app");
8068
8273
  const notFoundExtensions = getFarmRendererComponentExtensions(this.config.renderer);
8069
8274
  let layoutModule = null;
8070
8275
  try {
8071
8276
  for (const ext of notFoundExtensions) {
8072
- const layoutPath = path12.join(appDir, `layout${ext}`);
8073
- if (fs8.existsSync(layoutPath)) {
8277
+ const layoutPath = path13.join(appDir, `layout${ext}`);
8278
+ if (fs9.existsSync(layoutPath)) {
8074
8279
  layoutModule = await this.routeManager.loadLayoutModule(layoutPath);
8075
8280
  break;
8076
8281
  }
@@ -8283,7 +8488,7 @@ ${clientScript}
8283
8488
  };
8284
8489
 
8285
8490
  // src/app.ts
8286
- import path13 from "path";
8491
+ import path14 from "path";
8287
8492
  var defaultDocsConfig = {
8288
8493
  enabled: false,
8289
8494
  entry: "/docs",
@@ -8423,7 +8628,7 @@ var FarmApp = class {
8423
8628
  }
8424
8629
  const componentExtensions = getFarmRendererComponentExtensions(this.config.renderer);
8425
8630
  const rootLayoutPaths = appDirs.flatMap(
8426
- (appDir) => componentExtensions.map((extension) => path13.join(appDir, `layout${extension}`))
8631
+ (appDir) => componentExtensions.map((extension) => path14.join(appDir, `layout${extension}`))
8427
8632
  );
8428
8633
  const hasRootLayout = await Promise.all(rootLayoutPaths.map((p) => fileExists(p))).then(
8429
8634
  (results) => results.some(Boolean)
@@ -8487,13 +8692,13 @@ function resolveFarmImageServerRuntime(images, preset) {
8487
8692
  }
8488
8693
 
8489
8694
  // src/app-manifest-packages.ts
8490
- import fs9 from "fs";
8491
- import path14 from "path";
8695
+ import fs10 from "fs";
8696
+ import path15 from "path";
8492
8697
  var FARM_PACKAGE = /^@(?:farm\.js|farming-labs)\/[a-z0-9._-]+$/;
8493
8698
  function resolveFarmAppPackages(root) {
8494
8699
  let manifest;
8495
8700
  try {
8496
- manifest = JSON.parse(fs9.readFileSync(path14.join(root, "package.json"), "utf8"));
8701
+ manifest = JSON.parse(fs10.readFileSync(path15.join(root, "package.json"), "utf8"));
8497
8702
  } catch {
8498
8703
  return {};
8499
8704
  }
@@ -8508,13 +8713,13 @@ function resolveFarmAppPackages(root) {
8508
8713
  for (let dir = root; ; ) {
8509
8714
  try {
8510
8715
  const { version } = JSON.parse(
8511
- fs9.readFileSync(path14.join(dir, "node_modules", name, "package.json"), "utf8")
8716
+ fs10.readFileSync(path15.join(dir, "node_modules", name, "package.json"), "utf8")
8512
8717
  );
8513
8718
  if (typeof version === "string" && /^[0-9A-Za-z.+-]{1,64}$/.test(version))
8514
8719
  versions[name] = version;
8515
8720
  break;
8516
8721
  } catch {
8517
- const parent = path14.dirname(dir);
8722
+ const parent = path15.dirname(dir);
8518
8723
  if (parent === dir) break;
8519
8724
  dir = parent;
8520
8725
  }
@@ -8524,9 +8729,9 @@ function resolveFarmAppPackages(root) {
8524
8729
  }
8525
8730
 
8526
8731
  // src/app-manifest-webmcp.ts
8527
- import fs10 from "fs";
8732
+ import fs11 from "fs";
8528
8733
  import { createRequire as createRequire2 } from "module";
8529
- import path15 from "path";
8734
+ import path16 from "path";
8530
8735
  import { globSync } from "tinyglobby";
8531
8736
  var WEBMCP_CLIENT = "@farm.js/webmcp/client";
8532
8737
  var DEFINERS = /* @__PURE__ */ new Set(["defineWebMCPTool", "registerWebMCPTool", "registerWebMCPTools"]);
@@ -8544,7 +8749,7 @@ var LANGS = {
8544
8749
  cjs: "jsx",
8545
8750
  jsx: "jsx"
8546
8751
  };
8547
- var parseAst2;
8752
+ var parseAst3;
8548
8753
  function staticValue(node) {
8549
8754
  if (!node) return NOT_STATIC;
8550
8755
  switch (node.type) {
@@ -8621,13 +8826,13 @@ function toolFromObject(object) {
8621
8826
  }
8622
8827
  function findFarmWebMCPTools(code, filename = "module.tsx") {
8623
8828
  if (!code.includes(WEBMCP_CLIENT)) return [];
8624
- const lang = LANGS[path15.extname(filename).slice(1)] ?? "tsx";
8625
- parseAst2 ?? (parseAst2 = createRequire2(typeof __filename === "string" ? __filename : import.meta.url)(
8829
+ const lang = LANGS[path16.extname(filename).slice(1)] ?? "tsx";
8830
+ parseAst3 ?? (parseAst3 = createRequire2(typeof __filename === "string" ? __filename : import.meta.url)(
8626
8831
  "rolldown/parseAst"
8627
8832
  ).parseAst);
8628
8833
  let program;
8629
8834
  try {
8630
- program = parseAst2(code, { lang });
8835
+ program = parseAst3(code, { lang });
8631
8836
  } catch {
8632
8837
  return [];
8633
8838
  }
@@ -8668,7 +8873,7 @@ function findFarmWebMCPTools(code, filename = "module.tsx") {
8668
8873
  }
8669
8874
  var cache = /* @__PURE__ */ new Map();
8670
8875
  function collectFarmWebMCPTools(root, srcDir = "src") {
8671
- const base = path15.resolve(root, srcDir);
8876
+ const base = path16.resolve(root, srcDir);
8672
8877
  let files;
8673
8878
  try {
8674
8879
  files = globSync("**/*.{ts,tsx,js,jsx,mts,mjs,cts,cjs}", {
@@ -8685,7 +8890,7 @@ function collectFarmWebMCPTools(root, srcDir = "src") {
8685
8890
  for (const file of files.sort()) {
8686
8891
  let mtimeMs;
8687
8892
  try {
8688
- mtimeMs = fs10.statSync(file).mtimeMs;
8893
+ mtimeMs = fs11.statSync(file).mtimeMs;
8689
8894
  } catch {
8690
8895
  continue;
8691
8896
  }
@@ -8693,7 +8898,7 @@ function collectFarmWebMCPTools(root, srcDir = "src") {
8693
8898
  if (!entry || entry.mtimeMs !== mtimeMs) {
8694
8899
  let code = "";
8695
8900
  try {
8696
- code = fs10.readFileSync(file, "utf8");
8901
+ code = fs11.readFileSync(file, "utf8");
8697
8902
  } catch {
8698
8903
  }
8699
8904
  entry = { mtimeMs, tools: findFarmWebMCPTools(code, file) };
@@ -8709,8 +8914,8 @@ function collectFarmWebMCPTools(root, srcDir = "src") {
8709
8914
  }
8710
8915
 
8711
8916
  // src/client-cache-persistence-build.ts
8712
- import fs11 from "fs";
8713
- import path16 from "path";
8917
+ import fs12 from "fs";
8918
+ import path17 from "path";
8714
8919
  var ADAPTER_EXTENSIONS = ["ts", "tsx", "js", "jsx", "mts", "mjs"];
8715
8920
  function resolveFarmClientCacheAdapterEntry(root, cache2) {
8716
8921
  const client = cache2?.client;
@@ -8721,7 +8926,7 @@ function resolveFarmClientCacheAdapterEntry(root, cache2) {
8721
8926
  'cache.client.adapter must be a module path string, for example "./src/cache-adapter".'
8722
8927
  );
8723
8928
  }
8724
- const resolved = path16.resolve(root, adapter);
8929
+ const resolved = path17.resolve(root, adapter);
8725
8930
  const found = resolveAdapterFile(resolved);
8726
8931
  if (!found) {
8727
8932
  throw new Error(
@@ -8734,10 +8939,10 @@ function resolveFarmClientCacheAdapterEntry(root, cache2) {
8734
8939
  return { importPath: found.replace(/\\/g, "/"), options };
8735
8940
  }
8736
8941
  function resolveAdapterFile(resolved) {
8737
- if (fs11.existsSync(resolved) && fs11.statSync(resolved).isFile()) return resolved;
8942
+ if (fs12.existsSync(resolved) && fs12.statSync(resolved).isFile()) return resolved;
8738
8943
  for (const extension of ADAPTER_EXTENSIONS) {
8739
8944
  const candidate = `${resolved}.${extension}`;
8740
- if (fs11.existsSync(candidate) && fs11.statSync(candidate).isFile()) return candidate;
8945
+ if (fs12.existsSync(candidate) && fs12.statSync(candidate).isFile()) return candidate;
8741
8946
  }
8742
8947
  return void 0;
8743
8948
  }
@@ -8947,8 +9152,8 @@ async function readFarmNavigationStream(body, flushToken) {
8947
9152
  // src/docs/client-config.ts
8948
9153
  import { realpathSync as realpathSync2 } from "fs";
8949
9154
  import { createRequire as createRequire3 } from "module";
8950
- import path17 from "path";
8951
- var parseAst3;
9155
+ import path18 from "path";
9156
+ var parseAst4;
8952
9157
  function propertyKeyName(property2) {
8953
9158
  if (property2.computed) return void 0;
8954
9159
  const key = property2.key;
@@ -8957,11 +9162,11 @@ function propertyKeyName(property2) {
8957
9162
  return void 0;
8958
9163
  }
8959
9164
  function redactFarmDocsClientConfig(code, filename) {
8960
- parseAst3 ?? (parseAst3 = createRequire3(typeof __filename === "string" ? __filename : import.meta.url)(
9165
+ parseAst4 ?? (parseAst4 = createRequire3(typeof __filename === "string" ? __filename : import.meta.url)(
8961
9166
  "rolldown/parseAst"
8962
9167
  ).parseAst);
8963
- const extension = path17.extname(filename);
8964
- const program = parseAst3(code, {
9168
+ const extension = path18.extname(filename);
9169
+ const program = parseAst4(code, {
8965
9170
  lang: extension === ".tsx" || extension === ".jsx" ? "tsx" : "ts"
8966
9171
  });
8967
9172
  const edits = [];
@@ -9022,7 +9227,7 @@ function farmDocsClientConfigPlugin(configModule) {
9022
9227
  }
9023
9228
 
9024
9229
  // src/server/vite-config.ts
9025
- import path18 from "path";
9230
+ import path19 from "path";
9026
9231
  var FARM_CLIENT_ENTRY_PATTERN = "**/{page,layout,loading,error,not-found,default}.{js,jsx,ts,tsx}";
9027
9232
  var FARM_CLIENT_OPTIMIZE_DEPS_INCLUDE = [
9028
9233
  "react",
@@ -9049,9 +9254,9 @@ function getFarmClientOptimizeDepsInclude(renderer) {
9049
9254
  );
9050
9255
  }
9051
9256
  function createFarmClientOptimizeDepsEntries(projectRoot, appDirectories) {
9052
- const resolvedProjectRoot = path18.resolve(projectRoot);
9257
+ const resolvedProjectRoot = path19.resolve(projectRoot);
9053
9258
  return appDirectories.map((appDirectory) => {
9054
- const relativeAppDirectory = path18.relative(resolvedProjectRoot, path18.resolve(appDirectory)).replace(/\\/g, "/");
9259
+ const relativeAppDirectory = path19.relative(resolvedProjectRoot, path19.resolve(appDirectory)).replace(/\\/g, "/");
9055
9260
  const prefix = relativeAppDirectory || ".";
9056
9261
  return `${prefix}/${FARM_CLIENT_ENTRY_PATTERN}`;
9057
9262
  });
@@ -9073,7 +9278,7 @@ function createFarmClientOptimizeDepsConfig(entries, renderer) {
9073
9278
  }
9074
9279
  function createFarmSourceAlias(projectRoot, srcDir = "src") {
9075
9280
  return {
9076
- "@": path18.resolve(projectRoot, srcDir)
9281
+ "@": path19.resolve(projectRoot, srcDir)
9077
9282
  };
9078
9283
  }
9079
9284
  function mergeNoExternal(farmValue, userValue) {
@@ -9221,6 +9426,7 @@ ${FARM_DARK_VARIANT}
9221
9426
  }
9222
9427
 
9223
9428
  export {
9429
+ rewriteFarmPackageClientImports,
9224
9430
  withPackageClientBoundaryCache,
9225
9431
  usePackageClientBoundaryCacheFile,
9226
9432
  resolveModuleSourcePath,
@@ -9237,6 +9443,8 @@ export {
9237
9443
  createMarkdownPageHydrationPlanner,
9238
9444
  enforceFarmIsolatedHydrationRouteBudget,
9239
9445
  isIsolatableClientBoundarySource,
9446
+ isFarmPackageClientBoundary,
9447
+ collectFarmClientPackageImports,
9240
9448
  RouteManager,
9241
9449
  resolveDevGlobalStylesheetHref,
9242
9450
  resolveFarmNotFoundComponentPath,