@farm.js/core 0.1.35 → 0.1.36

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 (214) hide show
  1. package/dist/{metadata-WGpBYcGn.d.mts → agent-mcp-BVExL8rZ.d.mts} +45 -2
  2. package/dist/agent-mcp-handler-LPJ2CADR.mjs +19 -0
  3. package/dist/agent-mcp-handler-SJAHFSPI.cjs +19 -0
  4. package/dist/{metadata-BnLDsUOS.d.ts → agent-mcp-luzfXK-P.d.ts} +45 -2
  5. package/dist/agent-runtime.cjs +5 -3
  6. package/dist/agent-runtime.d.mts +1 -1
  7. package/dist/agent-runtime.d.ts +1 -1
  8. package/dist/agent-runtime.mjs +4 -2
  9. package/dist/api/route-manager.cjs +6 -6
  10. package/dist/api/route-manager.d.mts +10 -4
  11. package/dist/api/route-manager.d.ts +10 -4
  12. package/dist/api/route-manager.mjs +5 -5
  13. package/dist/api/runtime.cjs +4 -4
  14. package/dist/api/runtime.d.mts +4 -62
  15. package/dist/api/runtime.d.ts +4 -62
  16. package/dist/api/runtime.mjs +3 -3
  17. package/dist/api.cjs +8 -8
  18. package/dist/api.d.mts +3 -3
  19. package/dist/api.d.ts +3 -3
  20. package/dist/api.mjs +7 -7
  21. package/dist/{app-D_j9AAVL.d.mts → app-BukwkFIu.d.mts} +17 -3
  22. package/dist/{app-BXB3JZYc.d.ts → app-Yfa2dsFy.d.ts} +17 -3
  23. package/dist/app-markdown.cjs +4 -4
  24. package/dist/app-markdown.d.mts +2 -2
  25. package/dist/app-markdown.d.ts +2 -2
  26. package/dist/app-markdown.mjs +3 -3
  27. package/dist/{chunk-4KU5Q7C2.mjs → chunk-276VJSM6.mjs} +221 -48
  28. package/dist/{chunk-PFQKNERH.cjs → chunk-2YTDKNH3.cjs} +364 -197
  29. package/dist/{chunk-UAORZ7QA.mjs → chunk-35GKZR22.mjs} +2 -2
  30. package/dist/{chunk-QAU5JD57.mjs → chunk-35WV46VL.mjs} +203 -36
  31. package/dist/{chunk-EFCQPQMG.cjs → chunk-42NHY7HW.cjs} +54 -4
  32. package/dist/{chunk-SOMHP6GF.mjs → chunk-4E5AEDKY.mjs} +2 -2
  33. package/dist/{chunk-UJD4PHYB.mjs → chunk-4E5WBPEG.mjs} +72 -354
  34. package/dist/{chunk-2G2NNLE2.mjs → chunk-4GLOOWKE.mjs} +4 -4
  35. package/dist/{chunk-62XKI4Z3.cjs → chunk-4NU4GGTC.cjs} +2 -2
  36. package/dist/{chunk-4JHOT46A.mjs → chunk-4WCZJQUO.mjs} +54 -4
  37. package/dist/chunk-4WQ6PGSJ.cjs +367 -0
  38. package/dist/{chunk-SMHH4VDG.mjs → chunk-4WVJLURN.mjs} +1 -1
  39. package/dist/chunk-6SJ2KJTA.mjs +314 -0
  40. package/dist/{chunk-IPXLADVO.cjs → chunk-ADEA7PN3.cjs} +122 -61
  41. package/dist/{chunk-CP6X4AEU.mjs → chunk-AJQTP4OO.mjs} +1 -1
  42. package/dist/{chunk-4MMGO7YW.cjs → chunk-AO6RYU5N.cjs} +31 -28
  43. package/dist/{chunk-GFHLGIYC.cjs → chunk-BO36SELV.cjs} +6 -6
  44. package/dist/{chunk-6TJOML4E.mjs → chunk-BPOF5U4N.mjs} +4 -4
  45. package/dist/{chunk-JHWOVJ3M.mjs → chunk-BUGNQIHC.mjs} +5 -0
  46. package/dist/{chunk-FTFYRMQQ.cjs → chunk-CBJJH36A.cjs} +50 -25
  47. package/dist/{chunk-7GLPRTTF.cjs → chunk-CGBDNNSM.cjs} +2 -2
  48. package/dist/chunk-CI6E3UOH.cjs +314 -0
  49. package/dist/{chunk-X6W5FFH6.cjs → chunk-D2BB47NB.cjs} +8 -8
  50. package/dist/chunk-DTSROJ5J.mjs +367 -0
  51. package/dist/{chunk-YC6V7PWE.cjs → chunk-DZ5ZVB2K.cjs} +1 -1
  52. package/dist/{chunk-DBNKI4NF.cjs → chunk-ECKF2BAM.cjs} +6 -2
  53. package/dist/{chunk-Q3VLETLE.mjs → chunk-EWET4D2Y.mjs} +1 -1
  54. package/dist/{chunk-HUMR6LSU.mjs → chunk-F5QO4FNE.mjs} +1 -1
  55. package/dist/{chunk-XBML5KMG.cjs → chunk-FO427P6I.cjs} +22 -12
  56. package/dist/{chunk-SAZVVAJH.mjs → chunk-GQRWBCWK.mjs} +8 -5
  57. package/dist/{chunk-F6Z3Y5KL.mjs → chunk-HOXTWRGB.mjs} +1 -1
  58. package/dist/{chunk-3BHT4WMP.cjs → chunk-JNUWCDTF.cjs} +6 -6
  59. package/dist/{chunk-73MC7ZL6.cjs → chunk-JZVADIOD.cjs} +2 -2
  60. package/dist/{chunk-OMVAU7NT.cjs → chunk-KIIMAWOJ.cjs} +11 -1
  61. package/dist/{chunk-43FMW62B.mjs → chunk-KMTGADN3.mjs} +28 -0
  62. package/dist/{chunk-6ETPZTJI.mjs → chunk-LSZAVSGY.mjs} +116 -55
  63. package/dist/{chunk-HMIJDL7S.mjs → chunk-MKYBIIAQ.mjs} +30 -5
  64. package/dist/{chunk-RU3M2FIK.cjs → chunk-MRMI32SN.cjs} +87 -369
  65. package/dist/{chunk-7L5V3KQO.cjs → chunk-N2NAS2AM.cjs} +2 -2
  66. package/dist/{chunk-ICUQICNC.cjs → chunk-NMHWYWDR.cjs} +654 -481
  67. package/dist/{chunk-G5RT7EXW.mjs → chunk-O6I6VWKK.mjs} +20 -5
  68. package/dist/{chunk-PDOCJ6RY.mjs → chunk-O6WAEAX3.mjs} +1 -1
  69. package/dist/{chunk-6DU6UFUE.mjs → chunk-OHLSEQ57.mjs} +16 -8
  70. package/dist/{chunk-3PXS2MHU.mjs → chunk-OO7GXVSR.mjs} +1 -1
  71. package/dist/chunk-PTZ2TVNE.cjs +178 -0
  72. package/dist/{chunk-6WCPV6G2.mjs → chunk-Q2KB32T4.mjs} +1 -1
  73. package/dist/{chunk-XCACDAZZ.cjs → chunk-S6VYG6XU.cjs} +23 -8
  74. package/dist/{chunk-VFQT3LAO.cjs → chunk-SDOTRX3V.cjs} +5 -5
  75. package/dist/{chunk-BMWDEBXO.cjs → chunk-SHLXACIO.cjs} +31 -3
  76. package/dist/{chunk-22LTEMGQ.mjs → chunk-T4OGRVNS.mjs} +13 -3
  77. package/dist/{chunk-ZXGAFZDO.cjs → chunk-T5OJPTVN.cjs} +2 -2
  78. package/dist/{chunk-VZJR7UTG.cjs → chunk-TE2G5ION.cjs} +2 -2
  79. package/dist/chunk-UH6QN5NL.mjs +178 -0
  80. package/dist/{chunk-F7JZENPF.cjs → chunk-UVW64BCB.cjs} +38 -30
  81. package/dist/{chunk-OKZUAXHF.mjs → chunk-VILIPRS6.mjs} +1 -1
  82. package/dist/{chunk-3UH7MRCP.cjs → chunk-VQLJWDVW.cjs} +13 -13
  83. package/dist/{chunk-VPTDD5XF.cjs → chunk-WBKEZXWE.cjs} +5 -0
  84. package/dist/{chunk-EJQT6KZN.cjs → chunk-WC5UV2HQ.cjs} +2 -2
  85. package/dist/{chunk-YULD7ICZ.mjs → chunk-WZ77PUAM.mjs} +1 -1
  86. package/dist/{chunk-C35ZBVRD.mjs → chunk-YWMZUGIS.mjs} +6 -2
  87. package/dist/{chunk-Y7RKTKYI.mjs → chunk-ZMMBIVQM.mjs} +10 -0
  88. package/dist/{chunk-ULAWS2PA.cjs → chunk-ZWM5KGAA.cjs} +6 -6
  89. package/dist/{client-plugins-CvIslxWi.d.mts → client-plugins-C3mK9Pol.d.mts} +98 -5
  90. package/dist/{client-plugins-HIyulDym.d.ts → client-plugins-r1mOtSC1.d.ts} +98 -5
  91. package/dist/client-plugins.d.mts +1 -1
  92. package/dist/client-plugins.d.ts +1 -1
  93. package/dist/client.d.mts +5 -5
  94. package/dist/client.d.ts +5 -5
  95. package/dist/config.d.mts +1 -1
  96. package/dist/config.d.ts +1 -1
  97. package/dist/{devtools-EE5RIBTH.mjs → devtools-ERIKFEXX.mjs} +9 -8
  98. package/dist/{devtools-EAUY43BS.cjs → devtools-JZJJY5CK.cjs} +10 -9
  99. package/dist/docs.cjs +12 -11
  100. package/dist/docs.d.mts +2 -2
  101. package/dist/docs.d.ts +2 -2
  102. package/dist/docs.mjs +11 -10
  103. package/dist/image/server.cjs +3 -3
  104. package/dist/image/server.mjs +2 -2
  105. package/dist/image/sharp.cjs +10 -10
  106. package/dist/image/sharp.mjs +2 -2
  107. package/dist/index.cjs +39 -35
  108. package/dist/index.d.mts +13 -13
  109. package/dist/index.d.ts +13 -13
  110. package/dist/index.mjs +38 -34
  111. package/dist/integrations.cjs +7 -3
  112. package/dist/integrations.d.mts +1 -1
  113. package/dist/integrations.d.ts +1 -1
  114. package/dist/integrations.mjs +6 -2
  115. package/dist/internal/app-markdown-runtime.cjs +3 -3
  116. package/dist/internal/app-markdown-runtime.d.mts +2 -2
  117. package/dist/internal/app-markdown-runtime.d.ts +2 -2
  118. package/dist/internal/app-markdown-runtime.mjs +2 -2
  119. package/dist/internal/build-runtime.cjs +27 -25
  120. package/dist/internal/build-runtime.d.mts +3 -3
  121. package/dist/internal/build-runtime.d.ts +3 -3
  122. package/dist/internal/build-runtime.mjs +26 -24
  123. package/dist/internal/cli-runtime.cjs +14 -13
  124. package/dist/internal/cli-runtime.mjs +13 -12
  125. package/dist/internal/client-error-overlay.cjs +4 -4
  126. package/dist/internal/client-error-overlay.mjs +1 -1
  127. package/dist/internal/compression-runtime.d.mts +1 -1
  128. package/dist/internal/compression-runtime.d.ts +1 -1
  129. package/dist/internal/config-runtime.cjs +10 -9
  130. package/dist/internal/config-runtime.d.mts +2 -2
  131. package/dist/internal/config-runtime.d.ts +2 -2
  132. package/dist/internal/config-runtime.mjs +9 -8
  133. package/dist/internal/isolated-boundary.cjs +2 -2
  134. package/dist/internal/isolated-boundary.d.mts +0 -1
  135. package/dist/internal/isolated-boundary.d.ts +0 -1
  136. package/dist/internal/isolated-boundary.mjs +1 -1
  137. package/dist/internal/metadata-image-runtime.cjs +3 -3
  138. package/dist/internal/metadata-image-runtime.mjs +2 -2
  139. package/dist/internal/product-telemetry-runtime.cjs +2 -2
  140. package/dist/internal/product-telemetry-runtime.mjs +1 -1
  141. package/dist/internal/production-runtime.cjs +23 -9
  142. package/dist/internal/production-runtime.d.mts +67 -27
  143. package/dist/internal/production-runtime.d.ts +67 -27
  144. package/dist/internal/production-runtime.mjs +26 -12
  145. package/dist/{layers-BRQF5ETU.mjs → layers-UTB43B7A.mjs} +1 -1
  146. package/dist/layers-VUWIOFEO.cjs +18 -0
  147. package/dist/markdown.cjs +1 -1
  148. package/dist/markdown.d.mts +1 -1
  149. package/dist/markdown.d.ts +1 -1
  150. package/dist/markdown.mjs +1 -1
  151. package/dist/middleware.cjs +6 -6
  152. package/dist/middleware.d.mts +3 -3
  153. package/dist/middleware.d.ts +3 -3
  154. package/dist/middleware.mjs +5 -5
  155. package/dist/navigation.d.mts +4 -4
  156. package/dist/navigation.d.ts +4 -4
  157. package/dist/{nitro-OVPLKPE2.cjs → nitro-7F65EZZS.cjs} +3 -3
  158. package/dist/{nitro-MXRDCXWZ.mjs → nitro-MPZJGPXK.mjs} +2 -2
  159. package/dist/plugin.cjs +23 -21
  160. package/dist/plugin.d.mts +1 -1
  161. package/dist/plugin.d.ts +1 -1
  162. package/dist/plugin.mjs +22 -20
  163. package/dist/{production-runtime-0sRnuYc-.d.mts → production-runtime-CCeVZXst.d.mts} +1 -1
  164. package/dist/{production-runtime-Crq6CJ-2.d.ts → production-runtime-DPnsggY3.d.ts} +1 -1
  165. package/dist/{render-plan-gs9GGPzw.d.mts → render-plan-BuGaPFe6.d.mts} +1 -1
  166. package/dist/{render-plan-8ozZh2Qv.d.ts → render-plan-Cw4f5E_R.d.ts} +1 -1
  167. package/dist/renderer/react/server.cjs +3 -3
  168. package/dist/renderer/react/server.mjs +1 -1
  169. package/dist/renderer-client.d.mts +3 -3
  170. package/dist/renderer-client.d.ts +3 -3
  171. package/dist/{request-B5G8rLBH.d.ts → request-Bkg-hERy.d.ts} +1 -1
  172. package/dist/{request-fkhiynXe.d.mts → request-CsGARcAw.d.mts} +1 -1
  173. package/dist/request.d.mts +2 -2
  174. package/dist/request.d.ts +2 -2
  175. package/dist/{route-rendering-lS5nUMua.d.ts → route-rendering-BUZMH_64.d.ts} +1 -1
  176. package/dist/{route-rendering-CLnS7AZj.d.mts → route-rendering-f11yh5dp.d.mts} +1 -1
  177. package/dist/{router-4iuiYnOW.d.ts → router-B8CR9GbD.d.ts} +1 -1
  178. package/dist/{router-ifU8Dui1.d.mts → router-Cp6yRE8A.d.mts} +1 -1
  179. package/dist/routes.d.mts +1 -1
  180. package/dist/routes.d.ts +1 -1
  181. package/dist/runtime-CAEv36S_.d.mts +69 -0
  182. package/dist/runtime-CQVsT330.d.ts +69 -0
  183. package/dist/server-action-security.cjs +3 -3
  184. package/dist/server-action-security.mjs +2 -2
  185. package/dist/server-fn.cjs +4 -4
  186. package/dist/server-fn.mjs +3 -3
  187. package/dist/server-plugins.d.mts +2 -2
  188. package/dist/server-plugins.d.ts +2 -2
  189. package/dist/server-query.cjs +5 -5
  190. package/dist/server-query.mjs +4 -4
  191. package/dist/server.cjs +42 -40
  192. package/dist/server.d.mts +7 -7
  193. package/dist/server.d.ts +7 -7
  194. package/dist/server.mjs +25 -23
  195. package/dist/{spa-router-DaJk5Re4.d.ts → spa-router-BuciWGCZ.d.ts} +2 -2
  196. package/dist/{spa-router-Bq7VCOwx.d.mts → spa-router-DwbqGkGj.d.mts} +2 -2
  197. package/dist/testing.cjs +8 -8
  198. package/dist/testing.d.mts +1 -1
  199. package/dist/testing.d.ts +1 -1
  200. package/dist/testing.mjs +6 -6
  201. package/dist/{utils-XJn0c9bj.d.mts → utils-B9V0S_yL.d.mts} +1 -1
  202. package/dist/{utils-BXLmFsVR.d.ts → utils-CaoWKtYM.d.ts} +1 -1
  203. package/dist/version.cjs +2 -2
  204. package/dist/version.mjs +1 -1
  205. package/dist/vite.cjs +23 -21
  206. package/dist/vite.d.mts +1 -1
  207. package/dist/vite.d.ts +1 -1
  208. package/dist/vite.mjs +22 -20
  209. package/dist/workflows.cjs +3 -3
  210. package/dist/workflows.mjs +2 -2
  211. package/package.json +1 -1
  212. package/dist/layers-4PNE2HOY.cjs +0 -18
  213. package/dist/{chunk-2F2ER724.cjs → chunk-BPMATOP2.cjs} +2 -2
  214. package/dist/{chunk-IHNMMXHV.mjs → chunk-OTC5BDGO.mjs} +3 -3
@@ -10,7 +10,7 @@ var _chunkXD32KALFcjs = require('./chunk-XD32KALF.cjs');
10
10
 
11
11
 
12
12
 
13
- var _chunk3UH7MRCPcjs = require('./chunk-3UH7MRCP.cjs');
13
+ var _chunkVQLJWDVWcjs = require('./chunk-VQLJWDVW.cjs');
14
14
 
15
15
 
16
16
 
@@ -20,7 +20,7 @@ var _chunk3UH7MRCPcjs = require('./chunk-3UH7MRCP.cjs');
20
20
 
21
21
 
22
22
 
23
- var _chunkVZJR7UTGcjs = require('./chunk-VZJR7UTG.cjs');
23
+ var _chunkTE2G5IONcjs = require('./chunk-TE2G5ION.cjs');
24
24
 
25
25
 
26
26
 
@@ -37,7 +37,7 @@ var _chunkIK6LVLKCcjs = require('./chunk-IK6LVLKC.cjs');
37
37
 
38
38
 
39
39
 
40
- var _chunkF7JZENPFcjs = require('./chunk-F7JZENPF.cjs');
40
+ var _chunkUVW64BCBcjs = require('./chunk-UVW64BCB.cjs');
41
41
 
42
42
 
43
43
  var _chunkKCMTCM6Icjs = require('./chunk-KCMTCM6I.cjs');
@@ -76,13 +76,13 @@ var _chunk2SJ4RQ6Pcjs = require('./chunk-2SJ4RQ6P.cjs');
76
76
 
77
77
 
78
78
 
79
- var _chunkICUQICNCcjs = require('./chunk-ICUQICNC.cjs');
79
+ var _chunkNMHWYWDRcjs = require('./chunk-NMHWYWDR.cjs');
80
80
 
81
81
 
82
82
 
83
83
 
84
84
 
85
- var _chunk3BHT4WMPcjs = require('./chunk-3BHT4WMP.cjs');
85
+ var _chunkJNUWCDTFcjs = require('./chunk-JNUWCDTF.cjs');
86
86
 
87
87
 
88
88
 
@@ -93,7 +93,13 @@ var _chunk3BHT4WMPcjs = require('./chunk-3BHT4WMP.cjs');
93
93
 
94
94
 
95
95
 
96
- var _chunkIPXLADVOcjs = require('./chunk-IPXLADVO.cjs');
96
+
97
+ var _chunkADEA7PN3cjs = require('./chunk-ADEA7PN3.cjs');
98
+
99
+
100
+
101
+
102
+ var _chunkPTZ2TVNEcjs = require('./chunk-PTZ2TVNE.cjs');
97
103
 
98
104
 
99
105
  var _chunkCXP5U3RWcjs = require('./chunk-CXP5U3RW.cjs');
@@ -113,7 +119,7 @@ var _chunkHREOKQWTcjs = require('./chunk-HREOKQWT.cjs');
113
119
  var _chunkQ5B3KJBPcjs = require('./chunk-Q5B3KJBP.cjs');
114
120
 
115
121
 
116
- var _chunkVPTDD5XFcjs = require('./chunk-VPTDD5XF.cjs');
122
+ var _chunkWBKEZXWEcjs = require('./chunk-WBKEZXWE.cjs');
117
123
 
118
124
 
119
125
 
@@ -125,7 +131,7 @@ var _chunkVPTDD5XFcjs = require('./chunk-VPTDD5XF.cjs');
125
131
  var _chunkPSV6XKPOcjs = require('./chunk-PSV6XKPO.cjs');
126
132
 
127
133
 
128
- var _chunkRU3M2FIKcjs = require('./chunk-RU3M2FIK.cjs');
134
+ var _chunkMRMI32SNcjs = require('./chunk-MRMI32SN.cjs');
129
135
 
130
136
 
131
137
 
@@ -137,7 +143,7 @@ var _chunk6EXBPJ24cjs = require('./chunk-6EXBPJ24.cjs');
137
143
  var _chunkVEKFLAQMcjs = require('./chunk-VEKFLAQM.cjs');
138
144
 
139
145
 
140
- var _chunkEFCQPQMGcjs = require('./chunk-EFCQPQMG.cjs');
146
+ var _chunk42NHY7HWcjs = require('./chunk-42NHY7HW.cjs');
141
147
 
142
148
 
143
149
 
@@ -148,16 +154,17 @@ var _chunkEUV4YR3Vcjs = require('./chunk-EUV4YR3V.cjs');
148
154
 
149
155
 
150
156
 
151
- var _chunkVFQT3LAOcjs = require('./chunk-VFQT3LAO.cjs');
157
+ var _chunkSDOTRX3Vcjs = require('./chunk-SDOTRX3V.cjs');
158
+
152
159
 
153
160
 
154
161
 
155
- var _chunkFTFYRMQQcjs = require('./chunk-FTFYRMQQ.cjs');
162
+ var _chunkCBJJH36Acjs = require('./chunk-CBJJH36A.cjs');
156
163
 
157
164
 
158
165
 
159
166
 
160
- var _chunkULAWS2PAcjs = require('./chunk-ULAWS2PA.cjs');
167
+ var _chunkZWM5KGAAcjs = require('./chunk-ZWM5KGAA.cjs');
161
168
 
162
169
 
163
170
 
@@ -165,7 +172,7 @@ var _chunkULAWS2PAcjs = require('./chunk-ULAWS2PA.cjs');
165
172
  var _chunkZ2HLU4IXcjs = require('./chunk-Z2HLU4IX.cjs');
166
173
 
167
174
 
168
- var _chunkXBML5KMGcjs = require('./chunk-XBML5KMG.cjs');
175
+ var _chunkFO427P6Icjs = require('./chunk-FO427P6I.cjs');
169
176
 
170
177
 
171
178
  var _chunkUFDAAQFXcjs = require('./chunk-UFDAAQFX.cjs');
@@ -192,6 +199,9 @@ var _chunk5QIKR7RRcjs = require('./chunk-5QIKR7RR.cjs');
192
199
  var _chunkKNBBQHO2cjs = require('./chunk-KNBBQHO2.cjs');
193
200
 
194
201
 
202
+ var _chunkDZ5ZVB2Kcjs = require('./chunk-DZ5ZVB2K.cjs');
203
+
204
+
195
205
  var _chunkC5GUTBZKcjs = require('./chunk-C5GUTBZK.cjs');
196
206
 
197
207
 
@@ -299,7 +309,7 @@ function getDocsTitle(docs) {
299
309
  }
300
310
  _chunkS3JO3N4Hcjs.__name.call(void 0, getDocsTitle, "getDocsTitle");
301
311
  function loadPages(contentDir, docs) {
302
- return _chunkVZJR7UTGcjs.discoverFarmDocsPages.call(void 0, contentDir, docs).map((page) => _chunkVZJR7UTGcjs.loadFarmDocsPage.call(void 0, contentDir, docs, page.slug)).filter((page) => Boolean(page)).sort((a, b) => a.href.localeCompare(b.href));
312
+ return _chunkTE2G5IONcjs.discoverFarmDocsPages.call(void 0, contentDir, docs).map((page) => _chunkTE2G5IONcjs.loadFarmDocsPage.call(void 0, contentDir, docs, page.slug)).filter((page) => Boolean(page)).sort((a, b) => a.href.localeCompare(b.href));
303
313
  }
304
314
  _chunkS3JO3N4Hcjs.__name.call(void 0, loadPages, "loadPages");
305
315
  function findSocialImagePath(html) {
@@ -320,14 +330,14 @@ async function addHandlerRoute(routes, pathname, handler, absolutePaths) {
320
330
  }
321
331
  _chunkS3JO3N4Hcjs.__name.call(void 0, addHandlerRoute, "addHandlerRoute");
322
332
  async function compileFarmDocsManifest(docs, options) {
323
- const contentDir = _chunkVZJR7UTGcjs.resolveFarmDocsContentDir.call(void 0, docs, options);
333
+ const contentDir = _chunkTE2G5IONcjs.resolveFarmDocsContentDir.call(void 0, docs, options);
324
334
  const pages = loadPages(contentDir, docs);
325
335
  const absolutePaths = [
326
336
  _path2.default.resolve(options.root),
327
337
  _path2.default.resolve(contentDir),
328
338
  docs.configPath || ""
329
339
  ];
330
- const handler = _chunkVZJR7UTGcjs.createFarmDocsHandler.call(void 0, docs, {
340
+ const handler = _chunkTE2G5IONcjs.createFarmDocsHandler.call(void 0, docs, {
331
341
  root: options.root,
332
342
  srcDir: options.srcDir,
333
343
  clientEntry: options.clientEntry,
@@ -335,7 +345,7 @@ async function compileFarmDocsManifest(docs, options) {
335
345
  fontStylesheetHref: options.fontStylesheetHref,
336
346
  globalStylesheetHref: options.globalStylesheetHref
337
347
  });
338
- const apiHandler = _chunk3UH7MRCPcjs.createFarmDocsAPIHandler.call(void 0, {
348
+ const apiHandler = _chunkVQLJWDVWcjs.createFarmDocsAPIHandler.call(void 0, {
339
349
  rootDir: options.root,
340
350
  srcDir: options.srcDir,
341
351
  docs
@@ -427,7 +437,7 @@ async function compileFarmDocsManifest(docs, options) {
427
437
  post: await compileResponse(postResponse, absolutePaths),
428
438
  search: {
429
439
  pages: pages.map((page) => ({
430
- ..._chunkVZJR7UTGcjs.toFarmDocsMarkdownPage.call(void 0, page),
440
+ ..._chunkTE2G5IONcjs.toFarmDocsMarkdownPage.call(void 0, page),
431
441
  sourcePath: `farm-docs:${page.slug || "index"}`
432
442
  })),
433
443
  search: _nullishCoalesce(searchConfig, () => ( true)),
@@ -447,7 +457,7 @@ async function createFarmRouteRuntimeManifest(options) {
447
457
  const routes = [];
448
458
  for (const [pattern, entry] of options.routeManager.getRoutes()) {
449
459
  const routeModule = await options.routeManager.loadRouteModule(entry.modulePath);
450
- const rendering = await _chunk3BHT4WMPcjs.resolveRouteRenderingConfigFromFile.call(void 0, routeModule, entry.modulePath);
460
+ const rendering = await _chunkJNUWCDTFcjs.resolveRouteRenderingConfigFromFile.call(void 0, routeModule, entry.modulePath);
451
461
  const runtimeConfig = await options.routeManager.resolveRouteRuntimeConfig(pattern);
452
462
  routes.push({
453
463
  kind: "page",
@@ -767,10 +777,14 @@ export default async function farmNetlifyHandler(request, context) {
767
777
  _chunkS3JO3N4Hcjs.__name.call(void 0, createFarmNetlifyEntry, "createFarmNetlifyEntry");
768
778
 
769
779
  // src/nitro/node-server-entry.ts
780
+ var FARM_NODE_ENV_MODULE_FILE = "farm-node-env.mjs";
781
+ var FARM_NODE_ENV_MODULE_SOURCE = `if (!process.env.NODE_ENV) process.env.NODE_ENV = "production";
782
+ `;
770
783
  function createFarmNodeServerEntry(options) {
771
784
  const serverConfig = JSON.stringify(options.server);
772
785
  const nitroEntryImport = `./${options.nitroEntryFile.replace(/^\.\//, "")}`;
773
786
  return `
787
+ import "./${FARM_NODE_ENV_MODULE_FILE}";
774
788
  import "#nitro/virtual/polyfills";
775
789
  import { NodeRequest, serve } from ${JSON.stringify(options.nodeAdapterModule)};
776
790
  import wsAdapter from ${JSON.stringify(options.websocketAdapterModule)};
@@ -1586,7 +1600,7 @@ function hasFarmMiddlewareConfig(config) {
1586
1600
  _chunkS3JO3N4Hcjs.__name.call(void 0, hasFarmMiddlewareConfig, "hasFarmMiddlewareConfig");
1587
1601
  function hasFarmServerRuntimePlugins(config) {
1588
1602
  return (config.plugins || []).some((plugin) => {
1589
- if (_chunkFTFYRMQQcjs.getFarmIntegrationPluginServerRuntime.call(void 0, plugin) === false) return false;
1603
+ if (_chunkCBJJH36Acjs.getFarmIntegrationPluginServerRuntime.call(void 0, plugin) === false) return false;
1590
1604
  return Boolean(
1591
1605
  plugin.setup || plugin.init || plugin.ready || plugin.shutdown || plugin.runtime || plugin.router || plugin.render || plugin.beforeRouteMatch || plugin.afterRouteMatch || plugin.beforeRender || plugin.afterRender || plugin.onError || plugin.transformHTML
1592
1606
  );
@@ -1599,7 +1613,7 @@ function hasFarmPluginRoutes(config) {
1599
1613
  _chunkS3JO3N4Hcjs.__name.call(void 0, hasFarmPluginRoutes, "hasFarmPluginRoutes");
1600
1614
  function farmServerRuntimePluginsMayHandlePath(config, pathname) {
1601
1615
  return (config.plugins || []).some(
1602
- (plugin) => _chunkFTFYRMQQcjs.getFarmIntegrationPluginServerRuntime.call(void 0, plugin) !== false && _chunkICUQICNCcjs.farmPluginMayAffectRuntimePath.call(void 0, plugin, pathname)
1616
+ (plugin) => _chunkCBJJH36Acjs.getFarmIntegrationPluginServerRuntime.call(void 0, plugin) !== false && _chunkNMHWYWDRcjs.farmPluginMayAffectRuntimePath.call(void 0, plugin, pathname)
1603
1617
  );
1604
1618
  }
1605
1619
  _chunkS3JO3N4Hcjs.__name.call(void 0, farmServerRuntimePluginsMayHandlePath, "farmServerRuntimePluginsMayHandlePath");
@@ -1630,8 +1644,8 @@ async function discoverMiddlewareRoutes(appDir) {
1630
1644
  }
1631
1645
  await walk(
1632
1646
  _path2.default.join(dir, entry.name),
1633
- _chunkULAWS2PAcjs.appendMiddlewareRoutePath.call(void 0, routePath, entry.name),
1634
- _chunkULAWS2PAcjs.appendMiddlewareDirectory.call(void 0, directory, entry.name),
1647
+ _chunkZWM5KGAAcjs.appendMiddlewareRoutePath.call(void 0, routePath, entry.name),
1648
+ _chunkZWM5KGAAcjs.appendMiddlewareDirectory.call(void 0, directory, entry.name),
1635
1649
  discovered
1636
1650
  );
1637
1651
  }
@@ -1644,7 +1658,7 @@ async function discoverMiddlewareRoutes(appDir) {
1644
1658
  routes.set(route.directory, route);
1645
1659
  }
1646
1660
  }
1647
- return Array.from(routes.values()).sort(_chunkULAWS2PAcjs.compareMiddlewareRouteLocations).map(({ path: routePath, filePath }) => ({ path: routePath, filePath }));
1661
+ return Array.from(routes.values()).sort(_chunkZWM5KGAAcjs.compareMiddlewareRouteLocations).map(({ path: routePath, filePath }) => ({ path: routePath, filePath }));
1648
1662
  }
1649
1663
  _chunkS3JO3N4Hcjs.__name.call(void 0, discoverMiddlewareRoutes, "discoverMiddlewareRoutes");
1650
1664
  function assertFarmDocsRuntimeSupported(config, preset) {
@@ -1662,7 +1676,7 @@ async function buildUniversal(config, routeManager, apiRouteManager, serverRende
1662
1676
  assertFarmDocsRuntimeSupported(config, preset);
1663
1677
  const srcDir = config.srcDir || "src";
1664
1678
  const distDir = config.distDir || ".farm";
1665
- const deployOutputDir = _chunkF7JZENPFcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
1679
+ const deployOutputDir = _chunkUVW64BCBcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
1666
1680
  const lifecyclePluginManager = options.pluginManager;
1667
1681
  const productionViteResultPromise = Promise.allSettled([
1668
1682
  Promise.resolve(_nullishCoalesce(options.productionVite, () => ( _chunkA6WIQH5Zcjs.loadFarmProductionVite.call(void 0, ))))
@@ -1681,7 +1695,7 @@ async function buildUniversal(config, routeManager, apiRouteManager, serverRende
1681
1695
  const routeRuntimeManifestResultPromise = Promise.allSettled([routeRuntimeManifestPromise]);
1682
1696
  const pageRoutes = [];
1683
1697
  for (const [pattern, entry] of routeManager.getRoutes()) {
1684
- const markdownSourcePath = entry.markdownSourcePath || (_chunkEFCQPQMGcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) ? entry.modulePath : void 0);
1698
+ const markdownSourcePath = entry.markdownSourcePath || (_chunk42NHY7HWcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) ? entry.modulePath : void 0);
1685
1699
  pageRoutes.push({
1686
1700
  pattern,
1687
1701
  ...entry.directory ? { directory: entry.directory } : {},
@@ -1912,7 +1926,7 @@ async function mergeBuiltFontCss(outputDir, fontCssSource) {
1912
1926
  }
1913
1927
  const normalizedFontCss = typeof fontCss === "string" ? fontCss : Buffer.from(fontCss).toString("utf8");
1914
1928
  await fs.writeFile(fontCssPath, normalizedFontCss);
1915
- await fs.writeFile(clientCssPath, _chunkICUQICNCcjs.mergeFarmFontCss.call(void 0, clientCss, normalizedFontCss));
1929
+ await fs.writeFile(clientCssPath, _chunkNMHWYWDRcjs.mergeFarmFontCss.call(void 0, clientCss, normalizedFontCss));
1916
1930
  }
1917
1931
  _chunkS3JO3N4Hcjs.__name.call(void 0, mergeBuiltFontCss, "mergeBuiltFontCss");
1918
1932
  var _IncompleteClientBuildOutputError = class _IncompleteClientBuildOutputError extends Error {
@@ -1962,7 +1976,7 @@ function getCachedClientModuleHydrationPlan(modulePath, root, mode, cache, optio
1962
1976
  const key = `${_path2.default.resolve(root)}\0${mode}\0${options.asyncOwnerIslands === true}\0${_path2.default.resolve(modulePath)}`;
1963
1977
  let plan = cache.get(key);
1964
1978
  if (!plan) {
1965
- plan = _chunkICUQICNCcjs.getClientModuleHydrationPlan.call(void 0, modulePath, root, mode, options);
1979
+ plan = _chunkNMHWYWDRcjs.getClientModuleHydrationPlan.call(void 0, modulePath, root, mode, options);
1966
1980
  cache.set(key, plan);
1967
1981
  }
1968
1982
  return { ...plan, isolatedBoundaries: [...plan.isolatedBoundaries] };
@@ -1980,7 +1994,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
1980
1994
  });
1981
1995
  pluginManager.addPlugins(config.plugins || []);
1982
1996
  const clientPages = [];
1983
- const integrationProviders = _chunkFTFYRMQQcjs.getIntegrationProviders.call(void 0, config.integrations).filter(
1997
+ const integrationProviders = _chunkCBJJH36Acjs.getIntegrationProviders.call(void 0, config.integrations).filter(
1984
1998
  (provider) => provider.component || provider.type === "clerk"
1985
1999
  );
1986
2000
  const unsupportedIntegrationProvider = integrationProviders.find(
@@ -1991,14 +2005,14 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
1991
2005
  `[Farm.js] isolated hydration kept route-wide because integration provider "${unsupportedIntegrationProvider.name}" does not declare supportsIsolatedHydration: true.`
1992
2006
  );
1993
2007
  }
1994
- const isolatedMode = _chunkICUQICNCcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
2008
+ const isolatedMode = _chunkNMHWYWDRcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
1995
2009
  _optionalChain([config, 'access', _35 => _35.experimental, 'optionalAccess', _36 => _36.isolatedClientHydration]),
1996
2010
  {
1997
2011
  serverComponents: _optionalChain([config, 'access', _37 => _37.experimental, 'optionalAccess', _38 => _38.serverComponents]) === true,
1998
2012
  hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
1999
2013
  }
2000
2014
  );
2001
- const planOptions = _chunkICUQICNCcjs.getFarmClientHydrationPlanOptions.call(void 0,
2015
+ const planOptions = _chunkNMHWYWDRcjs.getFarmClientHydrationPlanOptions.call(void 0,
2002
2016
  config.renderer,
2003
2017
  Boolean(unsupportedIntegrationProvider)
2004
2018
  );
@@ -2045,7 +2059,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2045
2059
  };
2046
2060
  }
2047
2061
  });
2048
- const layoutAppliesToRoute = _chunkIPXLADVOcjs.routeBoundaryCoversDirectory;
2062
+ const layoutAppliesToRoute = _chunkADEA7PN3cjs.routeBoundaryCoversDirectory;
2049
2063
  const routeDirectory = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (route) => _nullishCoalesce(route.directory, () => ( route.pattern)), "routeDirectory");
2050
2064
  const adapterOwnsDocsRuntime = Boolean(
2051
2065
  _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, config.renderer) && _optionalChain([config, 'access', _39 => _39.docs, 'optionalAccess', _40 => _40.enabled]) && _optionalChain([config, 'access', _41 => _41.docs, 'access', _42 => _42.adapter, 'optionalAccess', _43 => _43.server]) && config.docs.adapter.react
@@ -2056,7 +2070,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2056
2070
  ), "isAdapterDocsRoute");
2057
2071
  const syntheticDocsEntry = _optionalChain([config, 'access', _46 => _46.docs, 'optionalAccess', _47 => _47.enabled]) && !adapterOwnsDocsRuntime ? adapterDocsEntry : null;
2058
2072
  const syntheticDocsPatterns = syntheticDocsEntry ? syntheticDocsEntry === "/" ? ["/", "/[...slug]"] : [syntheticDocsEntry, `${syntheticDocsEntry}/[...slug]`] : [];
2059
- const markdownPagePlan = _chunkICUQICNCcjs.createMarkdownPageHydrationPlanner.call(void 0,
2073
+ const markdownPagePlan = _chunkNMHWYWDRcjs.createMarkdownPageHydrationPlanner.call(void 0,
2060
2074
  _chunkOHY2ZWUGcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunkOHY2ZWUGcjs.resolveMdxConfig.call(void 0, config.mdx), root),
2061
2075
  root,
2062
2076
  isolatedMode,
@@ -2064,7 +2078,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2064
2078
  );
2065
2079
  const routePlans = pageRoutes.map((route) => ({
2066
2080
  route,
2067
- metadata: _chunkEFCQPQMGcjs.isFarmMarkdownPageFile.call(void 0, route.modulePath) ? markdownPagePlan() : getCachedClientModuleHydrationPlan(
2081
+ metadata: _chunk42NHY7HWcjs.isFarmMarkdownPageFile.call(void 0, route.modulePath) ? markdownPagePlan() : getCachedClientModuleHydrationPlan(
2068
2082
  route.modulePath,
2069
2083
  root,
2070
2084
  isolatedMode,
@@ -2072,7 +2086,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2072
2086
  planOptions
2073
2087
  )
2074
2088
  }));
2075
- _chunkICUQICNCcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
2089
+ _chunkNMHWYWDRcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
2076
2090
  clientLayouts.map((layout) => ({
2077
2091
  pattern: layout.pattern,
2078
2092
  depth: layout.pattern.split("/").filter(Boolean).length,
@@ -2081,7 +2095,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2081
2095
  [
2082
2096
  ...routePlans.map(({ route, metadata }) => ({
2083
2097
  pattern: routeDirectory(route),
2084
- depth: _chunkIPXLADVOcjs.getRouteDirectoryDepth.call(void 0, routeDirectory(route)),
2098
+ depth: _chunkADEA7PN3cjs.getRouteDirectoryDepth.call(void 0, routeDirectory(route)),
2085
2099
  metadata
2086
2100
  })),
2087
2101
  ...syntheticDocsPatterns.map((pattern) => ({
@@ -2104,7 +2118,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2104
2118
  for (const layout of clientLayouts) {
2105
2119
  const matchesBuiltRoute = pageRoutes.some((route) => layoutAppliesToRoute(layout.pattern, routeDirectory(route))) || Boolean(adapterDocsEntry && layoutAppliesToRoute(layout.pattern, adapterDocsEntry));
2106
2120
  if (matchesBuiltRoute && layout.suppressedAsyncHydration) {
2107
- _chunk5QIKR7RRcjs.logger.warn(`\u26A0\uFE0F ${_chunkICUQICNCcjs.describeSuppressedAsyncHydration.call(void 0, layout.pattern, layout.fallbackReason)}`);
2121
+ _chunk5QIKR7RRcjs.logger.warn(`\u26A0\uFE0F ${_chunkNMHWYWDRcjs.describeSuppressedAsyncHydration.call(void 0, layout.pattern, layout.fallbackReason)}`);
2108
2122
  }
2109
2123
  }
2110
2124
  if (isolatedMode === "analyze") {
@@ -2128,7 +2142,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2128
2142
  );
2129
2143
  if (metadata.suppressedAsyncHydration) {
2130
2144
  _chunk5QIKR7RRcjs.logger.warn(
2131
- `\u26A0\uFE0F ${_chunkICUQICNCcjs.describeSuppressedAsyncHydration.call(void 0, route.pattern, metadata.fallbackReason)}`
2145
+ `\u26A0\uFE0F ${_chunkNMHWYWDRcjs.describeSuppressedAsyncHydration.call(void 0, route.pattern, metadata.fallbackReason)}`
2132
2146
  );
2133
2147
  }
2134
2148
  if (metadata.shouldHydrate || metadata.hasIsolatedClientBoundaries || applicableClientLayouts.length > 0) {
@@ -2153,7 +2167,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2153
2167
  ...applicableClientLayouts.filter((layout) => layout.hasIsolatedClientBoundaries).flatMap((layout) => layout.isolatedBoundaries)
2154
2168
  ],
2155
2169
  // The server renders a server tree only below a hydrating layout.
2156
- ..._chunkICUQICNCcjs.usesFarmServerTree.call(void 0, metadata) && applicableClientLayouts.some((layout) => layout.shouldHydrate) ? { serverTree: true } : {}
2170
+ ..._chunkNMHWYWDRcjs.usesFarmServerTree.call(void 0, metadata) && applicableClientLayouts.some((layout) => layout.shouldHydrate) ? { serverTree: true } : {}
2157
2171
  });
2158
2172
  _chunk5QIKR7RRcjs.logger.info(`\u{1F4F1} Found hydratable route: ${route.pattern} -> ${route.modulePath}`);
2159
2173
  }
@@ -2189,7 +2203,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2189
2203
  }
2190
2204
  const clientRouteSlots = routeSlots.filter((slot) => {
2191
2205
  try {
2192
- return _chunkICUQICNCcjs.getClientModuleMetadata.call(void 0, slot.modulePath, root).shouldHydrate;
2206
+ return _chunkNMHWYWDRcjs.getClientModuleMetadata.call(void 0, slot.modulePath, root).shouldHydrate;
2193
2207
  } catch (error) {
2194
2208
  _chunk5QIKR7RRcjs.logger.warn(`\u26A0\uFE0F Could not inspect route slot ${slot.modulePath}: ${error}`);
2195
2209
  return false;
@@ -2217,9 +2231,9 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2217
2231
  config.renderer,
2218
2232
  config.publicRuntimeConfig,
2219
2233
  config.trailingSlash,
2220
- _chunkFTFYRMQQcjs.getIntegrationProviders.call(void 0, config.integrations),
2234
+ _chunkCBJJH36Acjs.getIntegrationProviders.call(void 0, config.integrations),
2221
2235
  config.basePath,
2222
- _chunkICUQICNCcjs.generateClientCachePersistenceCode.call(void 0, _chunkICUQICNCcjs.resolveFarmClientCacheAdapterEntry.call(void 0, root, config.cache)),
2236
+ _chunkNMHWYWDRcjs.generateClientCachePersistenceCode.call(void 0, _chunkNMHWYWDRcjs.resolveFarmClientCacheAdapterEntry.call(void 0, root, config.cache)),
2223
2237
  adapterOwnsDocsRuntime ? _chunkHITLGIAOcjs.getFarmDocsAdapterConfigModule.call(void 0, config.docs) : void 0
2224
2238
  );
2225
2239
  await fs.writeFile(clientEntryPath, clientHydrationCode);
@@ -2236,7 +2250,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2236
2250
  const postcssConfigPath = _path2.default.join(clientEntryDir, "postcss.config.cjs");
2237
2251
  await fs.writeFile(postcssConfigPath, "module.exports = { plugins: [] };\n");
2238
2252
  postcssSearchPath = clientEntryDir;
2239
- tailwindVitePlugin = await _chunkICUQICNCcjs.loadTailwindVitePlugin.call(void 0, {
2253
+ tailwindVitePlugin = await _chunkNMHWYWDRcjs.loadTailwindVitePlugin.call(void 0, {
2240
2254
  builder: productionVite.builder,
2241
2255
  announce: true
2242
2256
  });
@@ -2305,12 +2319,12 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2305
2319
  }
2306
2320
  },
2307
2321
  plugins: [
2308
- _chunkICUQICNCcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
2322
+ _chunkNMHWYWDRcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
2309
2323
  ...tailwindVitePlugin ? [tailwindVitePlugin] : [],
2310
2324
  ...rendererVitePlugins,
2311
2325
  ...config.vite.plugins || [],
2312
2326
  farmServerOnlyEntriesPlugin(),
2313
- _chunkICUQICNCcjs.farmDocsClientConfigPlugin.call(void 0,
2327
+ _chunkNMHWYWDRcjs.farmDocsClientConfigPlugin.call(void 0,
2314
2328
  adapterOwnsDocsRuntime ? _chunkHITLGIAOcjs.getFarmDocsAdapterConfigModule.call(void 0, config.docs) : void 0
2315
2329
  ),
2316
2330
  // Plugin to redirect @farm.js/core imports to client-only exports
@@ -2369,7 +2383,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2369
2383
  } : void 0,
2370
2384
  // Ensure React is bundled for client
2371
2385
  resolve: {
2372
- alias: _chunkICUQICNCcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
2386
+ alias: _chunkNMHWYWDRcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
2373
2387
  dedupe: [...config.renderer.dedupe || []]
2374
2388
  },
2375
2389
  // Optimize dependencies - exclude server-side code from client bundle
@@ -2382,7 +2396,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2382
2396
  ]
2383
2397
  }
2384
2398
  };
2385
- await viteBuild(_chunkICUQICNCcjs.mergeFarmProductionViteConfig.call(void 0, clientViteConfig, config.vite));
2399
+ await viteBuild(_chunkNMHWYWDRcjs.mergeFarmProductionViteConfig.call(void 0, clientViteConfig, config.vite));
2386
2400
  await mergeBuiltFontCss(outputDir);
2387
2401
  await validateClientBuildOutput(root, srcDir, outputDir);
2388
2402
  } finally {
@@ -3141,7 +3155,7 @@ function generateClientHydrationEntry(clientPages, layoutRoutes, clientRouteSlot
3141
3155
  direction: {}
3142
3156
  }, plugins = [], renderer = _chunkPSV6XKPOcjs.REACT_RENDERER, publicRuntimeConfig = void 0, trailingSlash = false, integrationProviders = [], basePath = "/", clientCachePersistence = { imports: "", init: "" }, docsConfigModule) {
3143
3157
  const toImportPath = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (targetPath) => targetPath.replace(/\\/g, "/"), "toImportPath");
3144
- const clientPluginEntry = _chunkICUQICNCcjs.generateFarmClientPluginEntryCode.call(void 0,
3158
+ const clientPluginEntry = _chunkNMHWYWDRcjs.generateFarmClientPluginEntryCode.call(void 0,
3145
3159
  plugins,
3146
3160
  root,
3147
3161
  srcDir,
@@ -3152,7 +3166,7 @@ function generateClientHydrationEntry(clientPages, layoutRoutes, clientRouteSlot
3152
3166
  import { createRoot, hydrateRoot } from "react-dom/client";` : appSetupPath ? `import React, { createRoot, hydrateRoot, configureApp as __farmConfigureApp } from ${JSON.stringify(renderer.client)};
3153
3167
  import __farmAppSetup from ${JSON.stringify(_chunk5QIKR7RRcjs.toPosixPath.call(void 0, appSetupPath))};
3154
3168
  __farmConfigureApp(__farmAppSetup);` : `import React, { createRoot, hydrateRoot } from ${JSON.stringify(renderer.client)};`;
3155
- const providerClientCode = _chunkICUQICNCcjs.generateFarmIntegrationProviderClientCode.call(void 0,
3169
+ const providerClientCode = _chunkNMHWYWDRcjs.generateFarmIntegrationProviderClientCode.call(void 0,
3156
3170
  integrationProviders,
3157
3171
  root,
3158
3172
  _nullishCoalesce(renderer.componentExtensions, () => ( []))
@@ -3166,8 +3180,8 @@ __farmConfigureApp(__farmAppSetup);` : `import React, { createRoot, hydrateRoot
3166
3180
  if (!layout.hasIsolatedClientBoundaries) {
3167
3181
  layoutImportStatements.push(`import Layout${index} from "${relativePath}";`);
3168
3182
  }
3169
- const groupScope = _chunkIPXLADVOcjs.getRouteGroupScope.call(void 0, layout.pattern);
3170
- const groupFields = groupScope ? `, urlPattern: ${JSON.stringify(_chunkIPXLADVOcjs.stripRouteGroups.call(void 0, layout.pattern))}, groupScope: ${JSON.stringify(groupScope)}` : "";
3183
+ const groupScope = _chunkADEA7PN3cjs.getRouteGroupScope.call(void 0, layout.pattern);
3184
+ const groupFields = groupScope ? `, urlPattern: ${JSON.stringify(_chunkADEA7PN3cjs.stripRouteGroups.call(void 0, layout.pattern))}, groupScope: ${JSON.stringify(groupScope)}` : "";
3171
3185
  layoutRegistrations.push(
3172
3186
  ` { pattern: ${JSON.stringify(layout.pattern)}${groupFields}, Component: ${layout.hasIsolatedClientBoundaries ? "null" : `Layout${index}`}, shouldHydrate: ${JSON.stringify(layout.shouldHydrate)}, islandStrategy: ${JSON.stringify(layout.islandStrategy)} }`
3173
3187
  );
@@ -3670,7 +3684,7 @@ function hasHydratableLayout(pathname) {
3670
3684
  });
3671
3685
  }
3672
3686
 
3673
- ${_chunkICUQICNCcjs.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE}
3687
+ ${_chunkNMHWYWDRcjs.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE}
3674
3688
  // Wrap a page element with applicable layouts
3675
3689
  function wrapWithLayouts(pageElement, pathname, params) {
3676
3690
  const layouts = getApplicableLayouts(pathname);
@@ -4649,7 +4663,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4649
4663
  _path2.default.join(postcssConfigDir, "postcss.config.cjs"),
4650
4664
  "module.exports = { plugins: [] };\n"
4651
4665
  );
4652
- tailwindVitePlugin = await _chunkICUQICNCcjs.loadTailwindVitePlugin.call(void 0, {
4666
+ tailwindVitePlugin = await _chunkNMHWYWDRcjs.loadTailwindVitePlugin.call(void 0, {
4653
4667
  builder: productionVite.builder,
4654
4668
  label: "for SSR"
4655
4669
  });
@@ -4724,7 +4738,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4724
4738
  })
4725
4739
  );
4726
4740
  const i18nCatalogs = config.i18n.enabled ? (await _chunkUFDAAQFXcjs.readFarmI18nCatalogs.call(void 0, config.i18n)).catalogs : {};
4727
- const appDirs = _chunkVPTDD5XFcjs.getFarmAppDirectories.call(void 0, config);
4741
+ const appDirs = _chunkWBKEZXWEcjs.getFarmAppDirectories.call(void 0, config);
4728
4742
  let openAPIReference = null;
4729
4743
  if (config.openapi.enabled && config.openapi.route) {
4730
4744
  const { OpenAPIManager, renderOpenAPIReferenceHTML } = await import("./manager-XZ5TX7AO.cjs");
@@ -4745,7 +4759,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4745
4759
  }
4746
4760
  const middlewareRoutes = await discoverMiddlewareRoutes(appDirs);
4747
4761
  const instrumentationPath = _chunkKCMTCM6Icjs.resolveFarmInstrumentationFile.call(void 0, root, config.srcDir || "src");
4748
- const notFoundPath = _chunkICUQICNCcjs.resolveFarmNotFoundComponentPath.call(void 0, config, appDirs);
4762
+ const notFoundPath = _chunkNMHWYWDRcjs.resolveFarmNotFoundComponentPath.call(void 0, config, appDirs);
4749
4763
  if (notFoundPath) _chunk5QIKR7RRcjs.logger.info(`\u{1F4CB} Found custom 404 page: ${notFoundPath}`);
4750
4764
  layoutRoutes.sort((a, b) => {
4751
4765
  const depthA = a.pattern.split("/").filter(Boolean).length;
@@ -4762,13 +4776,13 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4762
4776
  const hasServerRuntimeIntegrations = configuredIntegrationValues.some(
4763
4777
  (integration) => typeof integration === "object" && integration !== null && (!("serverRuntime" in integration) || integration.serverRuntime !== false)
4764
4778
  );
4765
- const hasIntegrationProviders = _chunkFTFYRMQQcjs.getIntegrationProviders.call(void 0, config.integrations).some(
4779
+ const hasIntegrationProviders = _chunkCBJJH36Acjs.getIntegrationProviders.call(void 0, config.integrations).some(
4766
4780
  (provider) => provider.component || provider.type === "clerk"
4767
4781
  );
4768
4782
  const hasObservabilityHandler = !!config.observability && typeof config.observability === "object" && "onEvent" in config.observability;
4769
4783
  const hasMdxComponentConfig = Boolean(_optionalChain([config, 'access', _56 => _56.mdx, 'optionalAccess', _57 => _57.components]));
4770
4784
  const hasMiddlewareConfig = hasFarmMiddlewareConfig(config.middleware);
4771
- const hasRouteContextConfig = _chunkF7JZENPFcjs.hasCustomFarmRouteContext.call(void 0, config);
4785
+ const hasRouteContextConfig = _chunkUVW64BCBcjs.hasCustomFarmRouteContext.call(void 0, config);
4772
4786
  const hasServerRuntimePlugins = hasFarmServerRuntimePlugins(config);
4773
4787
  const hasPluginRoutes = hasFarmPluginRoutes(config);
4774
4788
  const hasServerCacheConfig = hasFarmServerCacheConfig(config.cache);
@@ -4778,7 +4792,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4778
4792
  const hasConfiguredRuntimePlugins = Boolean(
4779
4793
  hasRuntimeConfigModule && (config.plugins || []).length > 0
4780
4794
  );
4781
- const farmDocsPrecompiledManifest = _optionalChain([config, 'access', _58 => _58.docs, 'optionalAccess', _59 => _59.enabled]) && _chunkC5GUTBZKcjs.getFarmPresetRuntime.call(void 0, preset) === "edge" ? _optionalChain([config, 'access', _60 => _60.docs, 'access', _61 => _61.adapter, 'optionalAccess', _62 => _62.server]) ? await _chunk3UH7MRCPcjs.compileFarmDocsAdapterEdgeManifest.call(void 0, config.docs, {
4795
+ const farmDocsPrecompiledManifest = _optionalChain([config, 'access', _58 => _58.docs, 'optionalAccess', _59 => _59.enabled]) && _chunkC5GUTBZKcjs.getFarmPresetRuntime.call(void 0, preset) === "edge" ? _optionalChain([config, 'access', _60 => _60.docs, 'access', _61 => _61.adapter, 'optionalAccess', _62 => _62.server]) ? await _chunkVQLJWDVWcjs.compileFarmDocsAdapterEdgeManifest.call(void 0, config.docs, {
4782
4796
  root,
4783
4797
  srcDir: config.srcDir,
4784
4798
  clientEntry: FARM_CLIENT_JS_SRC_PLACEHOLDER,
@@ -4928,7 +4942,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4928
4942
  __FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _68 => _68.env, 'optionalAccess', _69 => _69.public]) || {})
4929
4943
  },
4930
4944
  plugins: [
4931
- _chunkICUQICNCcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
4945
+ _chunkNMHWYWDRcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
4932
4946
  ...tailwindVitePlugin ? [tailwindVitePlugin] : [],
4933
4947
  ...rendererVitePlugins,
4934
4948
  ...config.vite.plugins || [],
@@ -4975,7 +4989,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4975
4989
  resolve: {
4976
4990
  alias: [
4977
4991
  ...shouldAliasReactServerToWebBuild(config.renderer, preset) ? [createFarmReactWebServerAlias(hasReactDomEdgeServerBuild(root))] : [],
4978
- ...Object.entries(_chunkICUQICNCcjs.createFarmSourceAlias.call(void 0, root, config.srcDir)).map(
4992
+ ...Object.entries(_chunkNMHWYWDRcjs.createFarmSourceAlias.call(void 0, root, config.srcDir)).map(
4979
4993
  ([find, replacement]) => ({ find, replacement })
4980
4994
  )
4981
4995
  ],
@@ -4983,7 +4997,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4983
4997
  dedupe: [...config.renderer.dedupe || []]
4984
4998
  }
4985
4999
  };
4986
- await viteBuild(_chunkICUQICNCcjs.mergeFarmProductionViteConfig.call(void 0, serverViteConfig, config.vite));
5000
+ await viteBuild(_chunkNMHWYWDRcjs.mergeFarmProductionViteConfig.call(void 0, serverViteConfig, config.vite));
4987
5001
  } finally {
4988
5002
  if (postcssConfigDir) {
4989
5003
  try {
@@ -4999,6 +5013,28 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4999
5013
  };
5000
5014
  }
5001
5015
  _chunkS3JO3N4Hcjs.__name.call(void 0, buildSSRInMemory, "buildSSRInMemory");
5016
+ function readFarmAppPackageIdentity(root) {
5017
+ try {
5018
+ return JSON.parse(_fs.readFileSync.call(void 0, _path2.default.join(root, "package.json"), "utf8"));
5019
+ } catch (e22) {
5020
+ return {};
5021
+ }
5022
+ }
5023
+ _chunkS3JO3N4Hcjs.__name.call(void 0, readFarmAppPackageIdentity, "readFarmAppPackageIdentity");
5024
+ function readFarmPageLastModified(pageRoutes) {
5025
+ const lastModified = {};
5026
+ for (const route of pageRoutes) {
5027
+ if (route.pattern.includes("[")) continue;
5028
+ try {
5029
+ lastModified[route.pattern] = _fs.statSync.call(void 0,
5030
+ _nullishCoalesce(route.markdownSourcePath, () => ( route.modulePath))
5031
+ ).mtime.toISOString();
5032
+ } catch (e23) {
5033
+ }
5034
+ }
5035
+ return lastModified;
5036
+ }
5037
+ _chunkS3JO3N4Hcjs.__name.call(void 0, readFarmPageLastModified, "readFarmPageLastModified");
5002
5038
  function getFarmAppOwnedDocsEnginePaths(agent, applicationMetadataRoutes) {
5003
5039
  const llmsTxt = _optionalChain([agent, 'optionalAccess', _70 => _70.llmsTxt]);
5004
5040
  const ownedByFile = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (kind) => applicationMetadataRoutes.some(
@@ -5007,8 +5043,8 @@ function getFarmAppOwnedDocsEnginePaths(agent, applicationMetadataRoutes) {
5007
5043
  return [
5008
5044
  ..._optionalChain([llmsTxt, 'optionalAccess', _71 => _71.enabled]) || ownedByFile("llms") ? ["/llms.txt"] : [],
5009
5045
  ..._optionalChain([llmsTxt, 'optionalAccess', _72 => _72.enabled]) && llmsTxt.full || ownedByFile("llms-full") ? ["/llms-full.txt"] : [],
5010
- ...ownedByFile("sitemap") ? ["/sitemap.xml"] : [],
5011
- ..._optionalChain([agent, 'optionalAccess', _73 => _73.crawlers, 'optionalAccess', _74 => _74.enabled]) || ownedByFile("robots") ? ["/robots.txt"] : []
5046
+ ..._optionalChain([agent, 'optionalAccess', _73 => _73.sitemap, 'optionalAccess', _74 => _74.enabled]) || ownedByFile("sitemap") ? ["/sitemap.xml"] : [],
5047
+ ..._optionalChain([agent, 'optionalAccess', _75 => _75.crawlers, 'optionalAccess', _76 => _76.enabled]) || ownedByFile("robots") ? ["/robots.txt"] : []
5012
5048
  ];
5013
5049
  }
5014
5050
  _chunkS3JO3N4Hcjs.__name.call(void 0, getFarmAppOwnedDocsEnginePaths, "getFarmAppOwnedDocsEnginePaths");
@@ -5050,7 +5086,7 @@ function toVirtualEntryImportSpecifier(modulePath) {
5050
5086
  }
5051
5087
  _chunkS3JO3N4Hcjs.__name.call(void 0, toVirtualEntryImportSpecifier, "toVirtualEntryImportSpecifier");
5052
5088
  function generateNativeAuthIntegrationSource(auth) {
5053
- if (_optionalChain([auth, 'optionalAccess', _75 => _75.enabled]) !== true) {
5089
+ if (_optionalChain([auth, 'optionalAccess', _77 => _77.enabled]) !== true) {
5054
5090
  return { importSource: "", registerSource: "" };
5055
5091
  }
5056
5092
  return {
@@ -5073,7 +5109,7 @@ function matchLocalIntegrationRequest(request) {
5073
5109
  });` : "return null;"}
5074
5110
  }
5075
5111
 
5076
- async function handleIntegrationRequest(request) {
5112
+ async function handleIntegrationRequest(request, ranMiddleware) {
5077
5113
  ${options.hasServerRuntimeIntegrations ? `return dispatchIntegrationRequests(
5078
5114
  serverRuntimeIntegrations,
5079
5115
  {
@@ -5082,6 +5118,7 @@ async function handleIntegrationRequest(request) {
5082
5118
  isProd: true,
5083
5119
  },
5084
5120
  request,
5121
+ { ranMiddleware },
5085
5122
  );` : `return { response: null, setCookies: [] };`}
5086
5123
  }
5087
5124
 
@@ -5169,10 +5206,10 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, generateConfiguredResponseHeadersRuntimeSo
5169
5206
  function parseRouteRenderingDirectiveFromDisk(modulePath) {
5170
5207
  try {
5171
5208
  const source = _fs.readFileSync.call(void 0, modulePath, "utf8");
5172
- const directive = _chunk3BHT4WMPcjs.parseRouteRenderingDirective.call(void 0, source);
5173
- if (_chunk3BHT4WMPcjs.findRequestBoundSourceBlockers.call(void 0, source).length === 0) return directive;
5209
+ const directive = _chunkJNUWCDTFcjs.parseRouteRenderingDirective.call(void 0, source);
5210
+ if (_chunkJNUWCDTFcjs.findRequestBoundSourceBlockers.call(void 0, source).length === 0) return directive;
5174
5211
  return { ..._nullishCoalesce(directive, () => ( { ssg: false, ppr: false, directive: "" })), requestBound: true };
5175
- } catch (e22) {
5212
+ } catch (e24) {
5176
5213
  return void 0;
5177
5214
  }
5178
5215
  }
@@ -5359,15 +5396,19 @@ ReactDOMServer.configureApp(__farmAppSetup);`;
5359
5396
  _chunkS3JO3N4Hcjs.__name.call(void 0, generateFarmRendererAppSetupServerCode, "generateFarmRendererAppSetupServerCode");
5360
5397
  function generateVirtualEntryCode(apiRoutes, pageRoutes, layoutRoutes, routeSlots, errorRoutes, metadataImageRoutes, applicationMetadataRoutes, middlewareRoutes, redirectRoutes, configuredRewriteRoutes, configuredHeaderRoutes, openAPIReference, notFoundPath, instrumentationPath, config, farmDocsPrecompiledManifest, configModulePath, hasServerRuntimeIntegrations, hasRuntimeIntegrationConfig, hasConfiguredRuntimePlugins, hasServerRuntimePlugins, preset, i18nCatalogs, isolatedClientBoundaryModules, hydrationPlanCache) {
5361
5398
  const hasCompressionRuntime = config.compress && _chunk2SJ4RQ6Pcjs.resolveFarmInstrumentationRuntime.call(void 0, preset) === "nodejs";
5362
- const servesAgentRobotsTxt = Boolean(_optionalChain([config, 'access', _76 => _76.agent, 'optionalAccess', _77 => _77.crawlers, 'optionalAccess', _78 => _78.enabled])) && !applicationMetadataRoutes.some(
5399
+ const servesAgentRobotsTxt = Boolean(_optionalChain([config, 'access', _78 => _78.agent, 'optionalAccess', _79 => _79.crawlers, 'optionalAccess', _80 => _80.enabled])) && !applicationMetadataRoutes.some(
5363
5400
  (metadata) => metadata.kind === "robots" && metadata.pattern === "/"
5364
5401
  );
5365
- const servesAiCatalog = _optionalChain([config, 'access', _79 => _79.agent, 'optionalAccess', _80 => _80.aiCatalog]) !== false;
5402
+ const servesAgentSitemap = Boolean(_optionalChain([config, 'access', _81 => _81.agent, 'optionalAccess', _82 => _82.sitemap, 'optionalAccess', _83 => _83.enabled])) && !applicationMetadataRoutes.some(
5403
+ (metadata) => metadata.kind === "sitemap" && metadata.pattern === "/"
5404
+ );
5405
+ const servesDefaultMCP = _optionalChain([config, 'access', _84 => _84.agent, 'optionalAccess', _85 => _85.mcp]) === true && !_chunkPTZ2TVNEcjs.farmConfigMountsMCP.call(void 0, config) && !apiRoutes.some((route) => route.path === "/api/mcp");
5406
+ const servesAiCatalog = _optionalChain([config, 'access', _86 => _86.agent, 'optionalAccess', _87 => _87.aiCatalog]) !== false;
5366
5407
  const hasPluginRuntime = hasRuntimeIntegrationConfig || hasServerRuntimePlugins;
5367
5408
  const hasInfraAnalyticsRuntime = config.analytics !== false && _chunk2SJ4RQ6Pcjs.resolveFarmInstrumentationRuntime.call(void 0, preset) === "nodejs";
5368
5409
  const hasPrecompiledDocs = Boolean(farmDocsPrecompiledManifest);
5369
5410
  const adapterOwnsDocsRuntime = Boolean(
5370
- _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, config.renderer) && _optionalChain([config, 'access', _81 => _81.docs, 'optionalAccess', _82 => _82.enabled]) && _optionalChain([config, 'access', _83 => _83.docs, 'access', _84 => _84.adapter, 'optionalAccess', _85 => _85.server]) && config.docs.adapter.react
5411
+ _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, config.renderer) && _optionalChain([config, 'access', _88 => _88.docs, 'optionalAccess', _89 => _89.enabled]) && _optionalChain([config, 'access', _90 => _90.docs, 'access', _91 => _91.adapter, 'optionalAccess', _92 => _92.server]) && config.docs.adapter.react
5371
5412
  );
5372
5413
  const docsConfigModulePath = adapterOwnsDocsRuntime && !hasPrecompiledDocs && config.docs.configPath && !config.docs.configPath.endsWith(".json") ? config.docs.configPath : void 0;
5373
5414
  const hasIsolatedClientGraphRuntime = _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, config.renderer) && isolatedClientBoundaryModules.size > 0;
@@ -5401,8 +5442,8 @@ function renderFarmRouteServerTree(element) { return element; }`;
5401
5442
  (image) => image.sourceType === "module"
5402
5443
  );
5403
5444
  const hasMiddlewareRuntime = middlewareRoutes.length > 0 || hasFarmMiddlewareConfig(config.middleware);
5404
- const farmDocsFontAssets = _optionalChain([config, 'access', _86 => _86.docs, 'optionalAccess', _87 => _87.enabled]) ? _chunkHREOKQWTcjs.toFarmDocsPublicFontAssets.call(void 0, _chunkHREOKQWTcjs.resolveFarmDocsFontAssets.call(void 0, config.root)) : [];
5405
- const integrationProviders = _chunkFTFYRMQQcjs.getIntegrationProviders.call(void 0, config.integrations);
5445
+ const farmDocsFontAssets = _optionalChain([config, 'access', _93 => _93.docs, 'optionalAccess', _94 => _94.enabled]) ? _chunkHREOKQWTcjs.toFarmDocsPublicFontAssets.call(void 0, _chunkHREOKQWTcjs.resolveFarmDocsFontAssets.call(void 0, config.root)) : [];
5446
+ const integrationProviders = _chunkCBJJH36Acjs.getIntegrationProviders.call(void 0, config.integrations);
5406
5447
  const renderedIntegrationProviders = integrationProviders.filter(
5407
5448
  (provider) => provider.component || provider.type === "clerk"
5408
5449
  );
@@ -5411,16 +5452,16 @@ function renderFarmRouteServerTree(element) { return element; }`;
5411
5452
  `Integration provider components are not supported by the "${config.renderer.name}" renderer.`
5412
5453
  );
5413
5454
  }
5414
- const providerServerModules = _chunkICUQICNCcjs.generateFarmIntegrationProviderServerModules.call(void 0,
5455
+ const providerServerModules = _chunkNMHWYWDRcjs.generateFarmIntegrationProviderServerModules.call(void 0,
5415
5456
  renderedIntegrationProviders,
5416
5457
  config.root,
5417
5458
  _nullishCoalesce(config.renderer.componentExtensions, () => ( []))
5418
5459
  );
5419
5460
  const resolvedIntegrationProviderFallback = Object.fromEntries(
5420
5461
  Object.entries(config.integrations).flatMap(([name, integration]) => {
5421
- const configuredProviders = _optionalChain([integration, 'optionalAccess', _88 => _88.providers]);
5462
+ const configuredProviders = _optionalChain([integration, 'optionalAccess', _95 => _95.providers]);
5422
5463
  const providers = Array.isArray(configuredProviders) ? configuredProviders : [];
5423
- if (providers.some((provider) => typeof _optionalChain([provider, 'optionalAccess', _89 => _89.component]) === "function")) {
5464
+ if (providers.some((provider) => typeof _optionalChain([provider, 'optionalAccess', _96 => _96.component]) === "function")) {
5424
5465
  throw new Error(
5425
5466
  `Integration provider components in production must use an importable component reference, for example component: { module: "@/components/provider" }.`
5426
5467
  );
@@ -5431,14 +5472,14 @@ function renderFarmRouteServerTree(element) { return element; }`;
5431
5472
  const unsupportedIntegrationProvider = renderedIntegrationProviders.find(
5432
5473
  (provider) => provider.supportsIsolatedHydration !== true
5433
5474
  );
5434
- const isolatedHydrationMode = _chunkICUQICNCcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
5435
- _optionalChain([config, 'access', _90 => _90.experimental, 'optionalAccess', _91 => _91.isolatedClientHydration]),
5475
+ const isolatedHydrationMode = _chunkNMHWYWDRcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
5476
+ _optionalChain([config, 'access', _97 => _97.experimental, 'optionalAccess', _98 => _98.isolatedClientHydration]),
5436
5477
  {
5437
- serverComponents: _optionalChain([config, 'access', _92 => _92.experimental, 'optionalAccess', _93 => _93.serverComponents]) === true,
5478
+ serverComponents: _optionalChain([config, 'access', _99 => _99.experimental, 'optionalAccess', _100 => _100.serverComponents]) === true,
5438
5479
  hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
5439
5480
  }
5440
5481
  );
5441
- const hydrationPlanOptions = _chunkICUQICNCcjs.getFarmClientHydrationPlanOptions.call(void 0,
5482
+ const hydrationPlanOptions = _chunkNMHWYWDRcjs.getFarmClientHydrationPlanOptions.call(void 0,
5442
5483
  config.renderer,
5443
5484
  Boolean(unsupportedIntegrationProvider)
5444
5485
  );
@@ -5452,7 +5493,7 @@ function renderFarmRouteServerTree(element) { return element; }`;
5452
5493
  hydrationPlanOptions
5453
5494
  )
5454
5495
  }));
5455
- const markdownPagePlan = _chunkICUQICNCcjs.createMarkdownPageHydrationPlanner.call(void 0,
5496
+ const markdownPagePlan = _chunkNMHWYWDRcjs.createMarkdownPageHydrationPlanner.call(void 0,
5456
5497
  _chunkOHY2ZWUGcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunkOHY2ZWUGcjs.resolveMdxConfig.call(void 0, config.mdx), config.root),
5457
5498
  config.root,
5458
5499
  isolatedHydrationMode,
@@ -5461,7 +5502,7 @@ function renderFarmRouteServerTree(element) { return element; }`;
5461
5502
  const pageHydrationPlans = new Map(
5462
5503
  pageRoutes.map((route) => [
5463
5504
  route.modulePath,
5464
- _chunkEFCQPQMGcjs.isFarmMarkdownPageFile.call(void 0, route.modulePath) ? markdownPagePlan() : getCachedClientModuleHydrationPlan(
5505
+ _chunk42NHY7HWcjs.isFarmMarkdownPageFile.call(void 0, route.modulePath) ? markdownPagePlan() : getCachedClientModuleHydrationPlan(
5465
5506
  route.modulePath,
5466
5507
  config.root,
5467
5508
  isolatedHydrationMode,
@@ -5470,7 +5511,7 @@ function renderFarmRouteServerTree(element) { return element; }`;
5470
5511
  )
5471
5512
  ])
5472
5513
  );
5473
- _chunkICUQICNCcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
5514
+ _chunkNMHWYWDRcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
5474
5515
  layoutHydrationPlans.map((layout) => ({
5475
5516
  pattern: layout.pattern,
5476
5517
  depth: layout.pattern.split("/").filter(Boolean).length,
@@ -5479,10 +5520,10 @@ function renderFarmRouteServerTree(element) { return element; }`;
5479
5520
  pageRoutes.map((route) => ({
5480
5521
  // Compared by directory so a grouped layout applies only inside its group.
5481
5522
  pattern: _nullishCoalesce(route.directory, () => ( route.pattern)),
5482
- depth: _chunkIPXLADVOcjs.getRouteDirectoryDepth.call(void 0, _nullishCoalesce(route.directory, () => ( route.pattern))),
5523
+ depth: _chunkADEA7PN3cjs.getRouteDirectoryDepth.call(void 0, _nullishCoalesce(route.directory, () => ( route.pattern))),
5483
5524
  metadata: pageHydrationPlans.get(route.modulePath)
5484
5525
  })),
5485
- _chunkIPXLADVOcjs.routeBoundaryCoversDirectory
5526
+ _chunkADEA7PN3cjs.routeBoundaryCoversDirectory
5486
5527
  );
5487
5528
  const providerServerImports = [
5488
5529
  providerServerModules.hasClerkProvider ? `import { ClerkProvider as FarmClerkProvider } from "@clerk/react";` : "",
@@ -5499,7 +5540,7 @@ function renderFarmRouteServerTree(element) { return element; }`;
5499
5540
  apiRegistrations.push(`
5500
5541
  {
5501
5542
  path: ${JSON.stringify(route.path)},
5502
- methods: ${JSON.stringify(route.methods.filter((method) => !_optionalChain([route, 'access', _94 => _94.pluginMethods, 'optionalAccess', _95 => _95.includes, 'call', _96 => _96(method)])))},
5543
+ methods: ${JSON.stringify(route.methods.filter((method) => !_optionalChain([route, 'access', _101 => _101.pluginMethods, 'optionalAccess', _102 => _102.includes, 'call', _103 => _103(method)])))},
5503
5544
  endpoints: ${varName},
5504
5545
  }`);
5505
5546
  });
@@ -5512,7 +5553,7 @@ function renderFarmRouteServerTree(element) { return element; }`;
5512
5553
  }).map(({ route }) => route);
5513
5554
  orderedPageRoutes.forEach((route, index) => {
5514
5555
  const varName = `pageRoute${index}`;
5515
- if (_chunkEFCQPQMGcjs.isFarmMarkdownPageFile.call(void 0, route.modulePath)) {
5556
+ if (_chunk42NHY7HWcjs.isFarmMarkdownPageFile.call(void 0, route.modulePath)) {
5516
5557
  pageRegistrations.push(`
5517
5558
  {
5518
5559
  pattern: ${JSON.stringify(route.pattern)},${route.directory ? `
@@ -5543,7 +5584,7 @@ function renderFarmRouteServerTree(element) { return element; }`;
5543
5584
  directory: ${JSON.stringify(route.directory)},` : ""}
5544
5585
  module: ${varName},
5545
5586
  shouldHydrate: ${JSON.stringify(clientMetadata.shouldHydrate)},
5546
- islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${_chunkICUQICNCcjs.usesFarmServerTree.call(void 0, clientMetadata) ? "\n serverTree: true," : ""}${renderingDirective ? `
5587
+ islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${_chunkNMHWYWDRcjs.usesFarmServerTree.call(void 0, clientMetadata) ? "\n serverTree: true," : ""}${renderingDirective ? `
5547
5588
  rendering: ${JSON.stringify(renderingDirective)},` : ""}
5548
5589
  ${route.source !== void 0 ? `markdownSource: {
5549
5590
  source: ${JSON.stringify(route.source)},
@@ -5600,12 +5641,12 @@ function renderFarmRouteServerTree(element) { return element; }`;
5600
5641
  errorImports.push(
5601
5642
  `import * as ${varName} from ${toVirtualEntryImportSpecifier(errorRoute.modulePath)};`
5602
5643
  );
5603
- const groupScope = _chunkIPXLADVOcjs.getRouteGroupScope.call(void 0, errorRoute.pattern);
5644
+ const groupScope = _chunkADEA7PN3cjs.getRouteGroupScope.call(void 0, errorRoute.pattern);
5604
5645
  errorRegistrations.push(`
5605
5646
  {
5606
- pattern: ${JSON.stringify(_chunkIPXLADVOcjs.stripRouteGroups.call(void 0, errorRoute.pattern))},${groupScope ? `
5647
+ pattern: ${JSON.stringify(_chunkADEA7PN3cjs.stripRouteGroups.call(void 0, errorRoute.pattern))},${groupScope ? `
5607
5648
  groupScope: ${JSON.stringify(groupScope)},
5608
- directoryDepth: ${_chunkIPXLADVOcjs.getRouteDirectoryDepth.call(void 0, errorRoute.pattern)},` : ""}
5649
+ directoryDepth: ${_chunkADEA7PN3cjs.getRouteDirectoryDepth.call(void 0, errorRoute.pattern)},` : ""}
5609
5650
  module: ${varName},
5610
5651
  }`);
5611
5652
  });
@@ -5687,6 +5728,10 @@ function renderFarmRouteServerTree(element) { return element; }`;
5687
5728
  createFarmCacheKey,
5688
5729
  createFarmMetadataRouteResponse,
5689
5730
  createFarmAgentRobots,
5731
+ createFarmDefaultSitemap,
5732
+ collectFarmDefaultMCPPages,
5733
+ resolveFarmDefaultMCPServer,
5734
+ handleFarmDefaultMCPRequest,
5690
5735
  createFarmAiCatalogResponse,
5691
5736
  createFarmApiCatalogResponse,
5692
5737
  createFarmAppManifestResponse,
@@ -5747,25 +5792,25 @@ function renderFarmRouteServerTree(element) { return element; }`;
5747
5792
  const infraAnalyticsImport = hasInfraAnalyticsRuntime ? `import { ${hasPluginRuntime ? "createFarmInfraAnalyticsPlugin" : "createFarmInfraAnalyticsRecorder"} } from "@farm.js/core/internal/infra-analytics-runtime";` : "";
5748
5793
  const compressionRuntimeImport = hasCompressionRuntime ? `import { compressFarmResponse${hasPluginRuntime ? ", createCompressionPlugin" : ""} } from "@farm.js/core/internal/compression-runtime";` : "";
5749
5794
  const i18nServerImport = config.i18n.enabled ? `import { _runWithFarmI18nRequest, _setDefaultFarmI18nRuntime, createFarmI18nRuntime, getFarmI18nClientSnapshot } from "@farm.js/core/i18n/server";` : "";
5750
- const docsHandlerImport = _optionalChain([config, 'access', _97 => _97.docs, 'optionalAccess', _98 => _98.enabled]) ? hasPrecompiledDocs ? `import { createFarmDocsPrecompiledRuntime } from "@farm.js/core/internal/docs-precompiled-runtime";
5795
+ const docsHandlerImport = _optionalChain([config, 'access', _104 => _104.docs, 'optionalAccess', _105 => _105.enabled]) ? hasPrecompiledDocs ? `import { createFarmDocsPrecompiledRuntime } from "@farm.js/core/internal/docs-precompiled-runtime";
5751
5796
  const isFarmDocsAPIRequest = (requestOrPathname) => {
5752
5797
  const pathname = typeof requestOrPathname === "string"
5753
5798
  ? requestOrPathname
5754
5799
  : new URL(requestOrPathname.url).pathname;
5755
- const apiPath = ${JSON.stringify(_optionalChain([farmDocsPrecompiledManifest, 'optionalAccess', _99 => _99.apiPath]) || "/api/docs")};
5800
+ const apiPath = ${JSON.stringify(_optionalChain([farmDocsPrecompiledManifest, 'optionalAccess', _106 => _106.apiPath]) || "/api/docs")};
5756
5801
  return pathname === apiPath || pathname.startsWith(apiPath + "/");
5757
5802
  };` : adapterOwnsDocsRuntime ? `import { isFarmDocsAPIRequest } from "@farm.js/core/docs";
5758
5803
  import { createFarmDocsRuntimeHandler as createFarmDocsAdapterRuntimeHandler } from ${JSON.stringify(config.docs.adapter.server)};
5759
5804
  import * as FarmDocsAdapterReact from ${JSON.stringify(config.docs.adapter.react)};${docsConfigModulePath ? `
5760
5805
  import * as farmDocsConfigModule from ${toVirtualEntryImportSpecifier(docsConfigModulePath)};` : ""}` : `import { createFarmDocsAPIHandler, createFarmDocsHandler, isFarmDocsAPIRequest } from "@farm.js/core/docs";` : "";
5761
- const docsFontImport = _optionalChain([config, 'access', _100 => _100.docs, 'optionalAccess', _101 => _101.enabled]) && !hasPrecompiledDocs ? `import { resolveFarmLayoutFonts } from "@farm.js/core/font";` : "";
5762
- const docsRuntimeImport = _optionalChain([config, 'access', _102 => _102.docs, 'optionalAccess', _103 => _103.enabled]) && !hasPrecompiledDocs ? `import { existsSync as farmDocsExistsSync } from "node:fs";
5806
+ const docsFontImport = _optionalChain([config, 'access', _107 => _107.docs, 'optionalAccess', _108 => _108.enabled]) && !hasPrecompiledDocs ? `import { resolveFarmLayoutFonts } from "@farm.js/core/font";` : "";
5807
+ const docsRuntimeImport = _optionalChain([config, 'access', _109 => _109.docs, 'optionalAccess', _110 => _110.enabled]) && !hasPrecompiledDocs ? `import { existsSync as farmDocsExistsSync } from "node:fs";
5763
5808
  import { dirname as farmDocsDirname, join as farmDocsJoin } from "node:path";
5764
5809
  import { fileURLToPath as farmDocsFileURLToPath } from "node:url";` : "";
5765
- const markdownHandlerImport = _optionalChain([config, 'access', _104 => _104.md, 'optionalAccess', _105 => _105.enabled]) ? `import { applyMarkdownNegotiationHeaders, createMarkdownMirrorResponse, getFarmMarkdownAlternatePath } from "@farm.js/core/markdown";` : "";
5810
+ const markdownHandlerImport = _optionalChain([config, 'access', _111 => _111.md, 'optionalAccess', _112 => _112.enabled]) ? `import { applyMarkdownNegotiationHeaders, createMarkdownMirrorResponse, getFarmMarkdownAlternatePath } from "@farm.js/core/markdown";` : "";
5766
5811
  const appMarkdownImport = hasMarkdownPages ? `import { createFarmMarkdownRouteModule, createFarmMarkdownSourceResponse, isFarmMarkdownPublicSourceResponse } from "@farm.js/core/internal/app-markdown-runtime";` : "const createFarmMarkdownSourceResponse = null;\nconst isFarmMarkdownPublicSourceResponse = null;";
5767
5812
  const markdownErrorImport = `import { FARM_MARKDOWN_CONTENT_TYPE, createFarmMarkdownErrorBody, farmRequestWantsMarkdown } from "@farm.js/core/markdown";`;
5768
- const mdxComponentsPath = typeof _optionalChain([config, 'access', _106 => _106.mdx, 'optionalAccess', _107 => _107.components]) === "string" ? _path2.default.isAbsolute(config.mdx.components) ? config.mdx.components : _path2.default.join(config.root, config.mdx.components) : null;
5813
+ const mdxComponentsPath = typeof _optionalChain([config, 'access', _113 => _113.mdx, 'optionalAccess', _114 => _114.components]) === "string" ? _path2.default.isAbsolute(config.mdx.components) ? config.mdx.components : _path2.default.join(config.root, config.mdx.components) : null;
5769
5814
  const mdxComponentsImport = mdxComponentsPath ? `import * as FarmMdxComponentsModule from ${toVirtualEntryImportSpecifier(mdxComponentsPath)};` : "";
5770
5815
  const layerConfigPaths = (config.layers || []).map((layer) => layer.configFile).filter((configFile) => Boolean(configFile)).filter((configFile) => configFile !== configModulePath);
5771
5816
  const layerConfigImports = layerConfigPaths.map(
@@ -5970,7 +6015,7 @@ const farmResolvedRuntimeConfig = Object.assign({}, ...farmRuntimeConfigs);
5970
6015
 
5971
6016
  function FarmDefault404Page() {
5972
6017
  return React.createElement(React.Fragment, null,
5973
- React.createElement("style", null, ${JSON.stringify(_chunkICUQICNCcjs.DEFAULT_NOT_FOUND_STYLES)}),
6018
+ React.createElement("style", null, ${JSON.stringify(_chunkNMHWYWDRcjs.DEFAULT_NOT_FOUND_STYLES)}),
5974
6019
  React.createElement("main", {
5975
6020
  className: "farm-default-not-found",
5976
6021
  "aria-labelledby": "farm-default-not-found-title",
@@ -6063,6 +6108,7 @@ const serverRuntimeIntegrations = Object.fromEntries(
6063
6108
  );
6064
6109
  const integrationRuntimeConfig = Object.assign({}, ...farmRuntimeConfigs, {
6065
6110
  integrations: configuredIntegrations,
6111
+ ${JSON.stringify(_chunkCBJJH36Acjs.FARM_INTEGRATION_API_BASE_PATH_KEY)}: ${JSON.stringify(_chunkKNBBQHO2cjs.resolveFarmAPIServerBasePath.call(void 0, config.api))},
6066
6112
  });
6067
6113
  const farmInfraAnalytics = ${hasInfraAnalyticsRuntime ? hasPluginRuntime ? "createFarmInfraAnalyticsPlugin()" : "createFarmInfraAnalyticsRecorder()" : "null"};
6068
6114
  const configuredPlugins = [
@@ -6098,14 +6144,14 @@ const farmImageHandler = ${imageRuntime === "none" ? "null" : imageRuntime === "
6098
6144
  onError(error) { console.error("[Farm Image]", error); },
6099
6145
  })`};
6100
6146
  const farmMarkdownConfig = ${JSON.stringify(config.md)};
6101
- const farmLlmsTxtConfig = ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access', _108 => _108.agent, 'optionalAccess', _109 => _109.llmsTxt]), () => ( { enabled: false, include: [], exclude: [] })))};
6102
- ${_optionalChain([config, 'access', _110 => _110.agent, 'optionalAccess', _111 => _111.llmsTxt, 'optionalAccess', _112 => _112.enabled]) ? "const farmLlmsFullRenderer = createFarmLlmsFullRenderer({ revalidate: farmLlmsTxtConfig.revalidate });\n" : ""}${servesAgentRobotsTxt ? `const farmAgentCrawlers = ${JSON.stringify(config.agent.crawlers)};` : ""}
6147
+ const farmLlmsTxtConfig = ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access', _115 => _115.agent, 'optionalAccess', _116 => _116.llmsTxt]), () => ( { enabled: false, include: [], exclude: [] })))};
6148
+ ${_optionalChain([config, 'access', _117 => _117.agent, 'optionalAccess', _118 => _118.llmsTxt, 'optionalAccess', _119 => _119.enabled]) ? "const farmLlmsFullRenderer = createFarmLlmsFullRenderer({ revalidate: farmLlmsTxtConfig.revalidate });\n" : ""}${servesAgentRobotsTxt ? `const farmAgentCrawlers = ${JSON.stringify(config.agent.crawlers)};` : ""}
6103
6149
  const farmMdxConfig = ${JSON.stringify({
6104
6150
  ...config.mdx,
6105
- components: typeof _optionalChain([config, 'access', _113 => _113.mdx, 'optionalAccess', _114 => _114.components]) === "string" ? config.mdx.components : void 0
6151
+ components: typeof _optionalChain([config, 'access', _120 => _120.mdx, 'optionalAccess', _121 => _121.components]) === "string" ? config.mdx.components : void 0
6106
6152
  })};
6107
6153
  const configuredFarmMdxComponents = farmUserConfig?.mdx?.components;
6108
- ${_optionalChain([config, 'access', _115 => _115.agent, 'optionalAccess', _116 => _116.noindexPreviews]) ? `// agent.noindexPreviews: the runtime environment decides, falling back to the
6154
+ ${_optionalChain([config, 'access', _122 => _122.agent, 'optionalAccess', _123 => _123.noindexPreviews]) ? `// agent.noindexPreviews: the runtime environment decides, falling back to the
6109
6155
  // environment this was built in, since Netlify exposes its deploy context only
6110
6156
  // to the build.
6111
6157
  const farmNoindexPreview = resolveFarmPreviewDeployment(
@@ -6153,7 +6199,7 @@ export const farmProductionLifecycle = createFarmProductionLifecycle({
6153
6199
  });
6154
6200
  const farmI18nRuntime = ${config.i18n.enabled ? `createFarmI18nRuntime(farmI18nConfig, ${JSON.stringify(i18nCatalogs)})` : "null"};
6155
6201
  ${config.i18n.enabled ? "_setDefaultFarmI18nRuntime(farmI18nRuntime);" : ""}
6156
- const farmDocsBundledContentDir = ${_optionalChain([config, 'access', _117 => _117.docs, 'optionalAccess', _118 => _118.enabled]) && !hasPrecompiledDocs ? `(() => {
6202
+ const farmDocsBundledContentDir = ${_optionalChain([config, 'access', _124 => _124.docs, 'optionalAccess', _125 => _125.enabled]) && !hasPrecompiledDocs ? `(() => {
6157
6203
  try {
6158
6204
  const currentDir = farmDocsDirname(farmDocsFileURLToPath(import.meta.url));
6159
6205
  const candidates = [
@@ -6174,7 +6220,7 @@ globalThis.__FARM_DOCS_RUNTIME_CONFIG__ = {
6174
6220
  docs: farmDocsResolvedConfig,
6175
6221
  };
6176
6222
  const farmDocsPrecompiledRuntime = ${hasPrecompiledDocs ? `createFarmDocsPrecompiledRuntime(${JSON.stringify(farmDocsPrecompiledManifest)})` : "null"};
6177
- const farmDocsHandler = ${_optionalChain([config, 'access', _119 => _119.docs, 'optionalAccess', _120 => _120.enabled]) ? hasPrecompiledDocs ? "farmDocsPrecompiledRuntime.handleDocsRequest" : adapterOwnsDocsRuntime ? `createFarmDocsAdapterRuntimeHandler({
6223
+ const farmDocsHandler = ${_optionalChain([config, 'access', _126 => _126.docs, 'optionalAccess', _127 => _127.enabled]) ? hasPrecompiledDocs ? "farmDocsPrecompiledRuntime.handleDocsRequest" : adapterOwnsDocsRuntime ? `createFarmDocsAdapterRuntimeHandler({
6178
6224
  ${docsConfigModulePath ? "...(farmDocsConfigModule.default || farmDocsConfigModule),\n ...farmDocsResolvedConfig.configOverrides," : "...farmDocsResolvedConfig.config,"}
6179
6225
  entry: farmDocsResolvedConfig.config?.entry || String(farmDocsResolvedConfig.entry || "/docs").replace(/^\\/+|\\/+$/g, "") || "docs",
6180
6226
  docsPath: farmDocsResolvedConfig.entry,
@@ -6207,22 +6253,29 @@ const farmDocsHandler = ${_optionalChain([config, 'access', _119 => _119.docs, '
6207
6253
  fontStylesheetHref: "/farm-fonts.css",
6208
6254
  globalStylesheetHref: "/assets/globals.css",
6209
6255
  })` : "null"};
6210
- const farmDocsAPIHandler = ${_optionalChain([config, 'access', _121 => _121.docs, 'optionalAccess', _122 => _122.enabled]) ? hasPrecompiledDocs ? "farmDocsPrecompiledRuntime.handleAPIRequest" : adapterOwnsDocsRuntime ? "null" : `createFarmDocsAPIHandler({ rootDir: farmDocsRuntimeRoot, srcDir: ${JSON.stringify(config.srcDir)}, docs: farmDocsResolvedConfig })` : "null"};
6256
+ const farmDocsAPIHandler = ${_optionalChain([config, 'access', _128 => _128.docs, 'optionalAccess', _129 => _129.enabled]) ? hasPrecompiledDocs ? "farmDocsPrecompiledRuntime.handleAPIRequest" : adapterOwnsDocsRuntime ? "null" : `createFarmDocsAPIHandler({ rootDir: farmDocsRuntimeRoot, srcDir: ${JSON.stringify(config.srcDir)}, docs: farmDocsResolvedConfig })` : "null"};
6211
6257
 
6212
6258
  // API routes bundled at build time
6213
6259
  const apiRoutes = ${apiRoutes.length > 0 ? "mergePluginAPIRoutes(" : ""}[${apiRegistrations.join(",")}
6214
- ]${apiRoutes.length > 0 ? `, configuredPlugins, ${JSON.stringify(apiRoutes.map(({ path: path8, methods }) => ({ path: path8, methods })))}, { bodySizeLimit: ${JSON.stringify(config.server.bodySizeLimit)} })` : ""};
6260
+ ]${apiRoutes.length > 0 ? `, configuredPlugins, ${JSON.stringify(apiRoutes.map(({ path: path8, methods }) => ({ path: path8, methods })))}, { bodySizeLimit: ${JSON.stringify(config.server.bodySizeLimit)}, dispatch: dispatchFarmPluginAPIRequest })` : ""};
6261
+ // A plugin calling an app endpoint (an MCP tool, say) goes through the whole
6262
+ // pipeline, so the endpoint's middleware and integration guards run for it.
6263
+ function dispatchFarmPluginAPIRequest(request) {
6264
+ const url = new URL(request.url);
6265
+ url.pathname = applyFarmBasePath(url.pathname);
6266
+ return handleFarmRequest(url.href === request.url ? request : new Request(url, request));
6267
+ }
6215
6268
  const farmLocalAPIBasePath = ${JSON.stringify(_chunkKNBBQHO2cjs.resolveFarmAPIServerBasePath.call(void 0, config.api))};
6216
6269
  const farmOpenAPIReference = ${JSON.stringify(openAPIReference)};
6217
- ${_optionalChain([config, 'access', _123 => _123.agent, 'optionalAccess', _124 => _124.apiCatalog]) ? `const farmApiCatalogInput = ${JSON.stringify(_chunkIPXLADVOcjs.resolveFarmApiCatalogInput.call(void 0, config))};
6218
- ` : ""}${config.analytics !== false ? `const farmAppManifestInput = ${JSON.stringify(
6219
- _chunkIPXLADVOcjs.resolveFarmAppManifestInput.call(void 0, config, {
6270
+ ${_optionalChain([config, 'access', _130 => _130.agent, 'optionalAccess', _131 => _131.apiCatalog]) ? `const farmApiCatalogInput = ${JSON.stringify(_chunkADEA7PN3cjs.resolveFarmApiCatalogInput.call(void 0, config))};
6271
+ ` : ""}${_optionalChain([config, 'access', _132 => _132.agent, 'optionalAccess', _133 => _133.manifest]) !== false ? `const farmAppManifestInput = ${JSON.stringify(
6272
+ _chunkADEA7PN3cjs.resolveFarmAppManifestInput.call(void 0, config, {
6220
6273
  build: config.deploymentId,
6221
- packages: _chunkICUQICNCcjs.resolveFarmAppPackages.call(void 0, config.root),
6222
- webmcpTools: config.plugins.some(({ name }) => name === "farm:webmcp") ? _chunkICUQICNCcjs.collectFarmWebMCPTools.call(void 0, config.root, config.srcDir) : []
6274
+ packages: _chunkNMHWYWDRcjs.resolveFarmAppPackages.call(void 0, config.root),
6275
+ webmcpTools: config.plugins.some(({ name }) => name === "farm:webmcp") ? _chunkNMHWYWDRcjs.collectFarmWebMCPTools.call(void 0, config.root, config.srcDir) : []
6223
6276
  })
6224
6277
  )};
6225
- ` : ""}
6278
+ ${servesDefaultMCP ? "farmAppManifestInput.defaultMCP = getFarmDefaultMCPServer;\n" : ""}` : ""}
6226
6279
  function isFarmLocalAPIPathname(pathname) {
6227
6280
  return farmLocalAPIBasePath !== "/" &&
6228
6281
  (pathname === farmLocalAPIBasePath ||
@@ -6664,7 +6717,7 @@ function peelFarmDocumentPrefix(markup) {
6664
6717
  let inner = markup.replace(/^\\s+/, "");
6665
6718
  let hoisted = "";
6666
6719
  const wrapper = /^<div\\b[^>]*style=["']display\\s*:\\s*contents["'][^>]*>/i;
6667
- const hoistable = /${_chunkIPXLADVOcjs.HOISTED_HEAD_ELEMENT.source}/i;
6720
+ const hoistable = /${_chunkADEA7PN3cjs.HOISTED_HEAD_ELEMENT.source}/i;
6668
6721
  let match;
6669
6722
  while ((match = wrapper.exec(inner) || hoistable.exec(inner))) {
6670
6723
  if (!/^<div/i.test(match[0])) hoisted += match[0];
@@ -6729,7 +6782,8 @@ function ensureFarmDocumentHead(markup) {
6729
6782
  }
6730
6783
 
6731
6784
  function ensureFarmDocumentRoot(markup) {
6732
- if (/\\sid=["']root["']/i.test(markup)) return markup;
6785
+ // Only a #root that opens the body is the container; page content can have id="root" too.
6786
+ if (/<body\\b[^>]*>\\s*<div\\b[^>]*\\sid=["']root["']/i.test(markup)) return markup;
6733
6787
  return markup
6734
6788
  .replace(/<body\\b([^>]*)>/i, function(_match, attributes) {
6735
6789
  return "<body" + attributes + '><div id="root">';
@@ -7108,7 +7162,7 @@ function createFarmAgentRobotsResponse(request) {
7108
7162
  "robots",
7109
7163
  createFarmAgentRobots({
7110
7164
  crawlers: farmAgentCrawlers,
7111
- sitemapPath: ${applicationMetadataRoutes.some(
7165
+ sitemapPath: ${servesAgentSitemap || applicationMetadataRoutes.some(
7112
7166
  (metadata) => metadata.kind === "sitemap" && metadata.pattern === "/"
7113
7167
  ) ? JSON.stringify("/sitemap.xml") : "undefined"},
7114
7168
  metadataBase: rootLayout && rootLayout.module && rootLayout.module.metadata
@@ -7121,6 +7175,68 @@ function createFarmAgentRobotsResponse(request) {
7121
7175
  );
7122
7176
  }
7123
7177
  ` : ""}
7178
+ ${servesAgentSitemap ? `// sitemap.xml from agent.sitemap, built the same way as in development. Each page's
7179
+ // lastmod is its file's modification time, read at build time.
7180
+ const farmAgentSitemapConfig = ${JSON.stringify(config.agent.sitemap)};
7181
+ const farmAgentSitemapLastModified = ${JSON.stringify(readFarmPageLastModified(pageRoutes))};
7182
+ function createFarmAgentSitemapResponse(request) {
7183
+ const rootLayout = layoutRoutes.find((layout) => layout.pattern === "/");
7184
+ return createFarmMetadataRouteResponse(
7185
+ "sitemap",
7186
+ createFarmDefaultSitemap(
7187
+ pageRoutes.map((route) => ({
7188
+ pattern: route.pattern,
7189
+ module: route.module,
7190
+ lastModified: farmAgentSitemapLastModified[route.pattern],
7191
+ })),
7192
+ {
7193
+ origin: new URL(request.url).origin,
7194
+ config: farmAgentSitemapConfig,
7195
+ metadataBase: rootLayout && rootLayout.module && rootLayout.module.metadata
7196
+ ? rootLayout.module.metadata.metadataBase
7197
+ : undefined,
7198
+ basePath: ${JSON.stringify(config.basePath)},
7199
+ },
7200
+ ),
7201
+ {},
7202
+ { method: request.method },
7203
+ );
7204
+ }
7205
+ ` : ""}
7206
+ ${servesDefaultMCP ? `// agent.mcp: the default read-only MCP server at /mcp, as in development. It steps
7207
+ // aside for a page route that answers /mcp and for any MCP server published or
7208
+ // registered at runtime, such as the docs engine's.
7209
+ const farmDefaultMCPServer = ${JSON.stringify(
7210
+ _chunkPTZ2TVNEcjs.createFarmDefaultMCPServer.call(void 0, readFarmAppPackageIdentity(config.root), _chunkDZ5ZVB2Kcjs.FARM_VERSION)
7211
+ )};
7212
+ let farmDefaultMCPRouteFree;
7213
+ function getFarmDefaultMCPServer() {
7214
+ if (farmDefaultMCPRouteFree === undefined) {
7215
+ farmDefaultMCPRouteFree = !matchPageRoute(${JSON.stringify(_chunkPTZ2TVNEcjs.FARM_DEFAULT_MCP_PATH)});
7216
+ }
7217
+ return farmDefaultMCPRouteFree ? resolveFarmDefaultMCPServer(farmDefaultMCPServer) : undefined;
7218
+ }
7219
+ async function handleFarmDefaultMCP(request) {
7220
+ const origin = new URL(request.url).origin;
7221
+ return handleFarmDefaultMCPRequest(request, {
7222
+ server: getFarmDefaultMCPServer(),
7223
+ basePath: ${JSON.stringify(config.basePath)},
7224
+ listPages: () =>
7225
+ collectFarmDefaultMCPPages(
7226
+ pageRoutes.map((route) => ({ pattern: route.pattern, module: route.module })),
7227
+ { origin, basePath: ${JSON.stringify(config.basePath)}, markdown: farmMarkdownConfig },
7228
+ ),
7229
+ // A fresh request through this handler, so the caller's cookies never shape a page.
7230
+ // The handler sees paths below the base path, as the server passes them in.
7231
+ readMarkdown: (url) => {
7232
+ const page = new URL(url);
7233
+ page.pathname = stripFarmBasePath(page.pathname);
7234
+ return farmDefaultMCPReadMarkdown(page.href);
7235
+ },
7236
+ });
7237
+ }
7238
+ const farmDefaultMCPReadMarkdown = createFarmLlmsMarkdownReader((page) => handleFarmRequest(page));
7239
+ ` : ""}
7124
7240
  // Static pages and root metadata for llms.txt, built the same way as in development.
7125
7241
  function createFarmLlmsTxtContext(request, full) {
7126
7242
  const origin = new URL(request.url).origin;
@@ -7143,7 +7259,7 @@ function createFarmLlmsTxtContext(request, full) {
7143
7259
  rootMetadata: rootLayout && rootLayout.module && rootLayout.module.metadata,
7144
7260
  ${servesAiCatalog ? `mcp: listFarmMCPLlmsTxtLinks(origin, {
7145
7261
  basePath: ${JSON.stringify(config.basePath)},
7146
- apiServerBasePath: farmLocalAPIBasePath,
7262
+ apiServerBasePath: farmLocalAPIBasePath,${servesDefaultMCP ? "\n defaultMCP: getFarmDefaultMCPServer," : ""}
7147
7263
  }),` : ""}
7148
7264
  }),
7149
7265
  // llms-full.txt reads each page's .md mirror through this same handler,
@@ -7388,7 +7504,7 @@ function hasLocalRequestRoute(request, routePathname) {
7388
7504
  if (${imageRuntime === "none" ? "false" : `pathname === ${JSON.stringify(config.images.path)}`}) {
7389
7505
  return true;
7390
7506
  }
7391
- ${_optionalChain([config, 'access', _125 => _125.docs, 'optionalAccess', _126 => _126.enabled]) ? `const docsPath = normalizeRuntimePath(farmDocsResolvedConfig?.entry || "/docs");
7507
+ ${_optionalChain([config, 'access', _134 => _134.docs, 'optionalAccess', _135 => _135.enabled]) ? `const docsPath = normalizeRuntimePath(farmDocsResolvedConfig?.entry || "/docs");
7392
7508
  if (
7393
7509
  isFarmDocsAPIRequest(pathname) ||
7394
7510
  docsPath === "/" ||
@@ -7414,7 +7530,7 @@ function getFarmPluginRequestOptions(request) {
7414
7530
  route: { ...route, pattern: normalizeRuntimePath(farmOpenAPIReference.route) },
7415
7531
  };
7416
7532
  }
7417
- const isDocsAPIRequest = ${_optionalChain([config, 'access', _127 => _127.docs, 'optionalAccess', _128 => _128.enabled]) ? "isFarmDocsAPIRequest(pathname)" : "false"};
7533
+ const isDocsAPIRequest = ${_optionalChain([config, 'access', _136 => _136.docs, 'optionalAccess', _137 => _137.enabled]) ? "isFarmDocsAPIRequest(pathname)" : "false"};
7418
7534
  const integrationMatch = ${hasServerRuntimeIntegrations ? `matchIntegrationRoute(serverRuntimeIntegrations, {
7419
7535
  pathname,
7420
7536
  method: request.method,
@@ -7511,7 +7627,7 @@ function getApplicableLayouts(pathname, directory) {
7511
7627
  return applicable;
7512
7628
  }
7513
7629
 
7514
- ${_optionalChain([config, 'access', _129 => _129.docs, 'optionalAccess', _130 => _130.enabled]) ? `async function wrapFarmDocsResponseWithLayouts(request, response) {
7630
+ ${_optionalChain([config, 'access', _138 => _138.docs, 'optionalAccess', _139 => _139.enabled]) ? `async function wrapFarmDocsResponseWithLayouts(request, response) {
7515
7631
  if (request.method === "HEAD") return response;
7516
7632
  if (response.headers.get("x-farm-docs-adapter")) return response;
7517
7633
 
@@ -7618,7 +7734,7 @@ ${_optionalChain([config, 'access', _129 => _129.docs, 'optionalAccess', _130 =>
7618
7734
  }` : ""}
7619
7735
 
7620
7736
  const pprShellCache = getFarmDataCache();
7621
- const experimentalPPREnabled = ${JSON.stringify(_optionalChain([config, 'access', _131 => _131.experimental, 'optionalAccess', _132 => _132.ppr]) === true)};
7737
+ const experimentalPPREnabled = ${JSON.stringify(_optionalChain([config, 'access', _140 => _140.experimental, 'optionalAccess', _141 => _141.ppr]) === true)};
7622
7738
 
7623
7739
  function resolveRouteRenderingView(route) {
7624
7740
  // The same merge development uses: baked directive config under the
@@ -7747,7 +7863,7 @@ async function handleFarmRequest(request, adapterContext) {
7747
7863
  },
7748
7864
  { redirect: !isFarmLocalAPIPathname(requestUrl.pathname) }
7749
7865
  )` : "handleFarmRequestInContext(request, null, false, Date.now(), adapterContext, requestUrl)"};
7750
- ${_optionalChain([config, 'access', _133 => _133.md, 'optionalAccess', _134 => _134.enabled]) ? `const pathname = getFarmRoutePathname(requestUrl.pathname);
7866
+ ${_optionalChain([config, 'access', _142 => _142.md, 'optionalAccess', _143 => _143.enabled]) ? `const pathname = getFarmRoutePathname(requestUrl.pathname);
7751
7867
  if (matchPageRoute(pathname)) {
7752
7868
  // The Link header advertises the public .md URL, like the head alternate.
7753
7869
  return applyMarkdownNegotiationHeaders(response, {
@@ -7824,7 +7940,11 @@ async function handleFarmRequestInContext(
7824
7940
  }
7825
7941
 
7826
7942
  ${hasServerRuntimeIntegrations ? `
7827
- const integrationDispatch = await handleIntegrationRequest(cloneFarmRequestWithContext(request));
7943
+ const farmIntegrationRanMiddleware = new Set();
7944
+ const integrationDispatch = await handleIntegrationRequest(
7945
+ cloneFarmRequestWithContext(request),
7946
+ farmIntegrationRanMiddleware,
7947
+ );
7828
7948
  if (integrationDispatch.response) {
7829
7949
  return integrationDispatch.response;
7830
7950
  }
@@ -7832,7 +7952,7 @@ async function handleFarmRequestInContext(
7832
7952
  // its rotated Set-Cookie values back here. They belong on whatever response
7833
7953
  // the page or API handler produces, so they ride the same deferred-header
7834
7954
  // channel the file middleware runner already uses.
7835
- const farmIntegrationSetCookies = integrationDispatch.setCookies;
7955
+ let farmIntegrationSetCookies = integrationDispatch.setCookies;
7836
7956
  ` : ""}
7837
7957
 
7838
7958
  ${hasMiddlewareRuntime ? `
@@ -7843,7 +7963,23 @@ async function handleFarmRequestInContext(
7843
7963
  if (middlewareResult.response) {
7844
7964
  return middlewareResult.response;
7845
7965
  }
7846
- request = middlewareResult.request;
7966
+ request = middlewareResult.request;${hasServerRuntimeIntegrations ? `
7967
+ // A ctx.rewrite() target is guarded as a direct request for it is: integration
7968
+ // guards (protectedRoutes) and routes see the rewritten URL, as in dev. Guards
7969
+ // that already ran for the original URL are skipped, so each runs once.
7970
+ if (request.url !== url.href) {
7971
+ const rewrittenDispatch = await handleIntegrationRequest(
7972
+ cloneFarmRequestWithContext(request),
7973
+ farmIntegrationRanMiddleware,
7974
+ );
7975
+ farmIntegrationSetCookies = [...farmIntegrationSetCookies, ...rewrittenDispatch.setCookies];
7976
+ if (rewrittenDispatch.response) {
7977
+ return applyProductionMiddlewareHeaders(
7978
+ rewrittenDispatch.response,
7979
+ withFarmIntegrationSetCookies(middlewareResult.headers, integrationDispatch.setCookies),
7980
+ );
7981
+ }
7982
+ }` : ""}
7847
7983
  const middlewareData = middlewareResult.data;
7848
7984
  const middlewareContext = middlewareResult.context;
7849
7985
  const middlewareHeaders = ${hasServerRuntimeIntegrations ? "withFarmIntegrationSetCookies(middlewareResult.headers, farmIntegrationSetCookies)" : "middlewareResult.headers"};
@@ -7872,7 +8008,10 @@ async function handleFarmRequestInContext(
7872
8008
  // API routes, as in dev.
7873
8009
  const farmAiCatalogResponse = createFarmAiCatalogResponse(
7874
8010
  request,
7875
- { basePath: ${JSON.stringify(config.basePath)}, apiServerBasePath: farmLocalAPIBasePath },
8011
+ {
8012
+ basePath: ${JSON.stringify(config.basePath)},
8013
+ apiServerBasePath: farmLocalAPIBasePath,${servesDefaultMCP ? "\n defaultMCP: getFarmDefaultMCPServer," : ""}
8014
+ },
7876
8015
  url,
7877
8016
  );
7878
8017
  if (farmAiCatalogResponse) {
@@ -7880,7 +8019,7 @@ async function handleFarmRequestInContext(
7880
8019
  }
7881
8020
  ` : ""}
7882
8021
 
7883
- ${_optionalChain([config, 'access', _135 => _135.docs, 'optionalAccess', _136 => _136.enabled]) ? `
8022
+ ${_optionalChain([config, 'access', _144 => _144.docs, 'optionalAccess', _145 => _145.enabled]) ? `
7884
8023
  // Docs responses are served after app middleware so route guards and
7885
8024
  // middleware headers apply to the docs engine like any other page content.
7886
8025
  // An app's own llms.txt, llms-full.txt, sitemap.xml, and robots.txt take
@@ -7929,7 +8068,7 @@ async function handleFarmRequestInContext(
7929
8068
  }
7930
8069
  ` : ""}
7931
8070
 
7932
- ${_optionalChain([config, 'access', _137 => _137.md, 'optionalAccess', _138 => _138.enabled]) ? `
8071
+ ${_optionalChain([config, 'access', _146 => _146.md, 'optionalAccess', _147 => _147.enabled]) ? `
7933
8072
  if (farmMarkdownConfig?.enabled) {
7934
8073
  const markdownResponse = await createMarkdownMirrorResponse({
7935
8074
  // The mirror helper only reads metadata and creates its own GET request.
@@ -8028,20 +8167,23 @@ async function handleFarmRequestInContext(
8028
8167
  return applyProductionMiddlewareHeaders(applicationMetadataResponse, middlewareHeaders);
8029
8168
  }
8030
8169
  ` : ""}
8031
- ${config.analytics !== false ? `
8032
- // /.well-known/farmjs: the app's manifest, only for a request Farm Infra signed.
8033
- if (normalizeRuntimePath(routePathname) === ${JSON.stringify(_chunkIPXLADVOcjs.FARM_APP_MANIFEST_PATH)}) {
8034
- const farmAppManifest = await createFarmAppManifestResponse(request, farmAppManifestInput, {
8035
- development: false,
8036
- });
8037
- if (farmAppManifest) {
8038
- return applyProductionMiddlewareHeaders(farmAppManifest, middlewareHeaders);
8039
- }
8170
+ ${_optionalChain([config, 'access', _148 => _148.agent, 'optionalAccess', _149 => _149.manifest]) !== false ? `
8171
+ // agent.manifest: /.well-known/farmjs.json (and 0.1.34's /.well-known/farmjs), the app's
8172
+ // public manifest; Farm Infra's signed request gets the full view.
8173
+ if (
8174
+ [${JSON.stringify(_chunkADEA7PN3cjs.FARM_APP_MANIFEST_PATH)}, ${JSON.stringify(_chunkADEA7PN3cjs.FARM_APP_MANIFEST_LEGACY_PATH)}].includes(
8175
+ normalizeRuntimePath(routePathname),
8176
+ )
8177
+ ) {
8178
+ return applyProductionMiddlewareHeaders(
8179
+ await createFarmAppManifestResponse(request, farmAppManifestInput),
8180
+ middlewareHeaders,
8181
+ );
8040
8182
  }
8041
8183
  ` : ""}
8042
- ${_optionalChain([config, 'access', _139 => _139.agent, 'optionalAccess', _140 => _140.apiCatalog]) ? `
8184
+ ${_optionalChain([config, 'access', _150 => _150.agent, 'optionalAccess', _151 => _151.apiCatalog]) ? `
8043
8185
  // agent.apiCatalog: list the OpenAPI and MCP surfaces at the RFC 9727 path.
8044
- if (normalizeRuntimePath(routePathname) === ${JSON.stringify(_chunkIPXLADVOcjs.FARM_API_CATALOG_PATH)}) {
8186
+ if (normalizeRuntimePath(routePathname) === ${JSON.stringify(_chunkADEA7PN3cjs.FARM_API_CATALOG_PATH)}) {
8045
8187
  return applyProductionMiddlewareHeaders(
8046
8188
  createFarmApiCatalogResponse(request.method, farmApiCatalogInput, request),
8047
8189
  middlewareHeaders,
@@ -8057,11 +8199,20 @@ async function handleFarmRequestInContext(
8057
8199
  );
8058
8200
  }
8059
8201
  ` : ""}
8060
- ${_optionalChain([config, 'access', _141 => _141.agent, 'optionalAccess', _142 => _142.llmsTxt, 'optionalAccess', _143 => _143.enabled]) ? `
8202
+ ${servesAgentSitemap ? `
8203
+ // agent.sitemap with no sitemap.ts: serve the generated file.
8204
+ if (normalizeRuntimePath(routePathname) === "/sitemap.xml") {
8205
+ return applyProductionMiddlewareHeaders(
8206
+ createFarmAgentSitemapResponse(request),
8207
+ middlewareHeaders,
8208
+ );
8209
+ }
8210
+ ` : ""}
8211
+ ${_optionalChain([config, 'access', _152 => _152.agent, 'optionalAccess', _153 => _153.llmsTxt, 'optionalAccess', _154 => _154.enabled]) ? `
8061
8212
  // agent.llmsTxt with no llms.ts or llms-full.ts: serve the generated files.
8062
8213
  const farmGeneratedLlmsKind = normalizeRuntimePath(routePathname) === "/llms.txt"
8063
8214
  ? "llms"
8064
- : ${_optionalChain([config, 'access', _144 => _144.agent, 'optionalAccess', _145 => _145.llmsTxt, 'optionalAccess', _146 => _146.full]) ? `normalizeRuntimePath(routePathname) === "/llms-full.txt" ? "llms-full" : ` : ""}null;
8215
+ : ${_optionalChain([config, 'access', _155 => _155.agent, 'optionalAccess', _156 => _156.llmsTxt, 'optionalAccess', _157 => _157.full]) ? `normalizeRuntimePath(routePathname) === "/llms-full.txt" ? "llms-full" : ` : ""}null;
8065
8216
  if (farmGeneratedLlmsKind) {
8066
8217
  const llmsContext = createFarmLlmsTxtContext(request, farmGeneratedLlmsKind === "llms-full");
8067
8218
  const llmsOrigin = new URL(request.url).origin;
@@ -8096,7 +8247,7 @@ async function handleFarmRequestInContext(
8096
8247
  }
8097
8248
  ` : ""}
8098
8249
 
8099
- ${_optionalChain([config, 'access', _147 => _147.docs, 'optionalAccess', _148 => _148.enabled]) ? `if (farmDocsAPIHandler && isFarmDocsAPIRequest(pathname)) {
8250
+ ${_optionalChain([config, 'access', _158 => _158.docs, 'optionalAccess', _159 => _159.enabled]) ? `if (farmDocsAPIHandler && isFarmDocsAPIRequest(pathname)) {
8100
8251
  const docsAPIResponse = await farmDocsAPIHandler(cloneFarmRequestWithContext(request));
8101
8252
  if (docsAPIResponse) {
8102
8253
  return applyProductionMiddlewareHeaders(docsAPIResponse, middlewareHeaders);
@@ -8554,7 +8705,7 @@ async function handleFarmRequestInContext(
8554
8705
  );
8555
8706
  }
8556
8707
  }
8557
- ${_optionalChain([config, 'access', _149 => _149.md, 'optionalAccess', _150 => _150.enabled]) ? `
8708
+ ${_optionalChain([config, 'access', _160 => _160.md, 'optionalAccess', _161 => _161.enabled]) ? `
8558
8709
  // Advertise the Markdown mirror in the head as well as the Link header,
8559
8710
  // using the public path the .md request will be resolved against.
8560
8711
  mergedMetadata = addMetadataMarkdownAlternate(
@@ -8573,7 +8724,7 @@ async function handleFarmRequestInContext(
8573
8724
  emitFarmEvent({ type: "cache.bypass", route: pathname, reason: "request-read" });
8574
8725
  }
8575
8726
 
8576
- const renderedMetadata = renderMetadataHead(mergedMetadata, { pathname, jsonLd: ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access', _151 => _151.agent, 'optionalAccess', _152 => _152.jsonLd]), () => ( false)))} });
8727
+ const renderedMetadata = renderMetadataHead(mergedMetadata, { pathname, jsonLd: ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access', _162 => _162.agent, 'optionalAccess', _163 => _163.jsonLd]), () => ( false)))} });
8577
8728
  const title = renderedMetadata.title;
8578
8729
  const metaTags = renderedMetadata.tags;
8579
8730
  const hasFavicon = renderedMetadata.hasFavicon;
@@ -8990,6 +9141,18 @@ async function handleFarmRequestInContext(
8990
9141
  }
8991
9142
  }
8992
9143
 
9144
+ ${servesDefaultMCP ? `
9145
+ // agent.mcp: no app route answered /mcp, so the default read-only server may.
9146
+ if (
9147
+ normalizeRuntimePath(routePathname) === ${JSON.stringify(_chunkPTZ2TVNEcjs.FARM_DEFAULT_MCP_PATH)} &&
9148
+ getFarmDefaultMCPServer()
9149
+ ) {
9150
+ return applyProductionMiddlewareHeaders(
9151
+ await handleFarmDefaultMCP(request),
9152
+ middlewareHeaders,
9153
+ );
9154
+ }
9155
+ ` : ""}
8993
9156
  // 404 fallback - render proper HTML page
8994
9157
  return renderFarmNotFoundResponse();
8995
9158
 
@@ -9195,11 +9358,11 @@ ${generatePreloadResponseRuntimeSource()}
9195
9358
 
9196
9359
  // Export as Web Standard fetch API
9197
9360
  export async function fetch(request, context) {
9198
- ${_optionalChain([config, 'access', _153 => _153.agent, 'optionalAccess', _154 => _154.noindexPreviews]) ? "const response = await" : "return"} _runWithAPIRequestRuntime({
9361
+ ${_optionalChain([config, 'access', _164 => _164.agent, 'optionalAccess', _165 => _165.noindexPreviews]) ? "const response = await" : "return"} _runWithAPIRequestRuntime({
9199
9362
  basePath: farmLocalAPIBasePath,
9200
9363
  dispatch: async (localRequest) =>
9201
9364
  (await handleAPIRequest(localRequest)) ?? Response.json({ error: "Not Found" }, { status: 404 }),
9202
- }, () => handleFarmFetch(request, context));${_optionalChain([config, 'access', _155 => _155.agent, 'optionalAccess', _156 => _156.noindexPreviews]) ? `
9365
+ }, () => handleFarmFetch(request, context));${_optionalChain([config, 'access', _166 => _166.agent, 'optionalAccess', _167 => _167.noindexPreviews]) ? `
9203
9366
  // Keep every response of a preview deployment out of search indexes.
9204
9367
  return farmNoindexPreview ? applyFarmPreviewRobotsTag(response) : response;` : ""}
9205
9368
  }
@@ -9395,11 +9558,11 @@ function getPhysicalPrerenderBypassReason(options) {
9395
9558
  }
9396
9559
  if (appMiddlewareMayHandlePath(middlewareRoutes, pathname)) return "app middleware";
9397
9560
  if (configMiddlewareMayHandlePath(config.middleware, pathname)) return "configured middleware";
9398
- if (_chunkF7JZENPFcjs.hasCustomFarmRouteContext.call(void 0, config)) return "request context";
9561
+ if (_chunkUVW64BCBcjs.hasCustomFarmRouteContext.call(void 0, config)) return "request context";
9399
9562
  if (farmServerRuntimePluginsMayHandlePath(config, pathname)) return "server runtime plugin";
9400
9563
  const manifestEntry = getManifestPageEntry(routeRuntimeManifest, pathname);
9401
- if (_optionalChain([manifestEntry, 'optionalAccess', _157 => _157.rendering]) === "dynamic") return "dynamic runtime manifest";
9402
- if (manifestEntry && (manifestEntry.runtime !== "auto" || Boolean(_optionalChain([manifestEntry, 'access', _158 => _158.regions, 'optionalAccess', _159 => _159.length])) || manifestEntry.maxDuration !== void 0)) {
9564
+ if (_optionalChain([manifestEntry, 'optionalAccess', _168 => _168.rendering]) === "dynamic") return "dynamic runtime manifest";
9565
+ if (manifestEntry && (manifestEntry.runtime !== "auto" || Boolean(_optionalChain([manifestEntry, 'access', _169 => _169.regions, 'optionalAccess', _170 => _170.length])) || manifestEntry.maxDuration !== void 0)) {
9403
9566
  return "route runtime controls";
9404
9567
  }
9405
9568
  const routeRule = getEffectiveRouteRule(config, pathname);
@@ -9421,7 +9584,7 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
9421
9584
  const nitroBuilder = nitroBuilderResult.value;
9422
9585
  const isVercel = preset === "vercel" || preset === "vercel-edge";
9423
9586
  const isCloudflareWorker = preset === "cloudflare-module";
9424
- const outputDir = _chunkF7JZENPFcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
9587
+ const outputDir = _chunkUVW64BCBcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
9425
9588
  const runtimeServerOutputDir = isVercel ? _path2.default.join(outputDir, "functions", "__nitro.func") : _path2.default.join(outputDir, "server");
9426
9589
  const ssrOutputDir = _path2.default.join(root, distDir, "ssr");
9427
9590
  const imageRuntime = resolveImageRuntime(config, preset);
@@ -9443,9 +9606,9 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
9443
9606
  _chunk5QIKR7RRcjs.logger.info(`\u{1F4E6} SSR entry file: ${ssrEntryFile}`);
9444
9607
  _chunk5QIKR7RRcjs.logger.info(`\u{1F4E6} Preset: ${preset}`);
9445
9608
  const ssgCollectionPromise = routeManager.collectSSGPages();
9446
- const middlewareRoutesPromise = discoverMiddlewareRoutes(_chunkVPTDD5XFcjs.getFarmAppDirectories.call(void 0, config));
9609
+ const middlewareRoutesPromise = discoverMiddlewareRoutes(_chunkWBKEZXWEcjs.getFarmAppDirectories.call(void 0, config));
9447
9610
  const configuredResponseRoutesPromise = Promise.all([config.redirects(), config.rewrites()]);
9448
- const farmWorkflows = await _chunkVFQT3LAOcjs.prepareFarmWorkflowsForNitro.call(void 0, config);
9611
+ const farmWorkflows = await _chunkSDOTRX3Vcjs.prepareFarmWorkflowsForNitro.call(void 0, config);
9449
9612
  const farmCron = await _chunk6EXBPJ24cjs.prepareFarmCronForNitro.call(void 0, config);
9450
9613
  const [{ ssg: ssgPages }, middlewareRoutes, [configuredRedirects, configuredRewrites]] = await Promise.all([
9451
9614
  ssgCollectionPromise,
@@ -9666,6 +9829,10 @@ function toFarmNodeResponse(request, response) {
9666
9829
  await fs.writeFile(nitroEntryPath, nitroEntryCode);
9667
9830
  const farmNodeServerEntryPath = preset === "node-server" ? _path2.default.join(ssrOutputDir, "farm-node-server-entry.mjs") : null;
9668
9831
  if (farmNodeServerEntryPath && nodeAdapterModule) {
9832
+ await fs.writeFile(
9833
+ _path2.default.join(ssrOutputDir, FARM_NODE_ENV_MODULE_FILE),
9834
+ FARM_NODE_ENV_MODULE_SOURCE
9835
+ );
9669
9836
  await fs.writeFile(
9670
9837
  farmNodeServerEntryPath,
9671
9838
  createFarmNodeServerEntry({
@@ -9807,20 +9974,20 @@ function toFarmNodeResponse(request, response) {
9807
9974
  snapshotSSRRebundleOptions(nitroConfig)
9808
9975
  );
9809
9976
  const requestedBuilder = _nullishCoalesce(nitroConfig.builder, () => ( process.env.NITRO_BUILDER));
9810
- const canReusePrebuiltSSR = isPrebuiltSSRCandidate && nitroConfig.preset === "node-server" && (requestedBuilder === void 0 || requestedBuilder === "rollup" || requestedBuilder === "rolldown") && nitroConfig.sourcemap === false && !hasCustomOxcOptions && !hasLateBuildMutationConfig && !hasUnsupportedSSRRebundleOverrides && _optionalChain([nitroConfig, 'access', _160 => _160.rollupConfig, 'optionalAccess', _161 => _161.external]) === nitroRollupExternal && !hasRollupPlugins(_optionalChain([nitroConfig, 'access', _162 => _162.rollupConfig, 'optionalAccess', _163 => _163.plugins])) && customRollupKeys.length === 0 && _path2.default.resolve(_optionalChain([nitroConfig, 'access', _164 => _164.output, 'optionalAccess', _165 => _165.serverDir]) || "") === _path2.default.resolve(expectedServerDir) && Boolean(
9811
- _optionalChain([nitroConfig, 'access', _166 => _166.handlers, 'optionalAccess', _167 => _167.some, 'call', _168 => _168(
9812
- (handler) => _path2.default.resolve(_optionalChain([handler, 'optionalAccess', _169 => _169.handler]) || "") === nitroEntryPath
9977
+ const canReusePrebuiltSSR = isPrebuiltSSRCandidate && nitroConfig.preset === "node-server" && (requestedBuilder === void 0 || requestedBuilder === "rollup" || requestedBuilder === "rolldown") && nitroConfig.sourcemap === false && !hasCustomOxcOptions && !hasLateBuildMutationConfig && !hasUnsupportedSSRRebundleOverrides && _optionalChain([nitroConfig, 'access', _171 => _171.rollupConfig, 'optionalAccess', _172 => _172.external]) === nitroRollupExternal && !hasRollupPlugins(_optionalChain([nitroConfig, 'access', _173 => _173.rollupConfig, 'optionalAccess', _174 => _174.plugins])) && customRollupKeys.length === 0 && _path2.default.resolve(_optionalChain([nitroConfig, 'access', _175 => _175.output, 'optionalAccess', _176 => _176.serverDir]) || "") === _path2.default.resolve(expectedServerDir) && Boolean(
9978
+ _optionalChain([nitroConfig, 'access', _177 => _177.handlers, 'optionalAccess', _178 => _178.some, 'call', _179 => _179(
9979
+ (handler) => _path2.default.resolve(_optionalChain([handler, 'optionalAccess', _180 => _180.handler]) || "") === nitroEntryPath
9813
9980
  )])
9814
9981
  );
9815
9982
  const selectRolldownBuilder = canReusePrebuiltSSR && requestedBuilder === void 0 && await canUseRolldownBuilder();
9816
9983
  if (selectRolldownBuilder) nitroConfig.builder = "rolldown";
9817
9984
  const useRolldownBuilder = canReusePrebuiltSSR && (_nullishCoalesce(nitroConfig.builder, () => ( process.env.NITRO_BUILDER))) === "rolldown";
9818
9985
  const shouldMinify = nitroConfig.minify !== false;
9819
- const keepServerNames = !(_optionalChain([config, 'access', _170 => _170.docs, 'optionalAccess', _171 => _171.enabled]) && _optionalChain([config, 'access', _172 => _172.docs, 'access', _173 => _173.adapter, 'optionalAccess', _174 => _174.server]));
9986
+ const keepServerNames = !(_optionalChain([config, 'access', _181 => _181.docs, 'optionalAccess', _182 => _182.enabled]) && _optionalChain([config, 'access', _183 => _183.docs, 'access', _184 => _184.adapter, 'optionalAccess', _185 => _185.server]));
9820
9987
  const useFarmServerMinifier = shouldMinify && nitroConfig.sourcemap === false && !hasCustomOxcOptions && !hasLateBuildMutationConfig;
9821
9988
  const serverChunkMinifier = useFarmServerMinifier ? createServerChunkMinifyPlugin({ keepNames: keepServerNames, target: "esnext" }) : null;
9822
9989
  if (canReusePrebuiltSSR) {
9823
- const configuredRollupPlugins = _optionalChain([nitroConfig, 'access', _175 => _175.rollupConfig, 'optionalAccess', _176 => _176.plugins]);
9990
+ const configuredRollupPlugins = _optionalChain([nitroConfig, 'access', _186 => _186.rollupConfig, 'optionalAccess', _187 => _187.plugins]);
9824
9991
  nitroConfig.rollupConfig = {
9825
9992
  ...nitroConfig.rollupConfig,
9826
9993
  plugins: [
@@ -9831,9 +9998,9 @@ function toFarmNodeResponse(request, response) {
9831
9998
  }
9832
9999
  nitroConfig.minify = useFarmServerMinifier ? false : shouldMinify;
9833
10000
  const nitroInstance = await nitroBuilder.createNitro(nitroConfig);
9834
- if (_optionalChain([config, 'access', _177 => _177.md, 'optionalAccess', _178 => _178.enabled])) {
10001
+ if (_optionalChain([config, 'access', _188 => _188.md, 'optionalAccess', _189 => _189.enabled])) {
9835
10002
  nitroInstance.hooks.hook("prerender:generate", (route) => {
9836
- if (!route.contents || !_optionalChain([route, 'access', _179 => _179.contentType, 'optionalAccess', _180 => _180.toLowerCase, 'call', _181 => _181(), 'access', _182 => _182.includes, 'call', _183 => _183("html")])) return;
10003
+ if (!route.contents || !_optionalChain([route, 'access', _190 => _190.contentType, 'optionalAccess', _191 => _191.toLowerCase, 'call', _192 => _192(), 'access', _193 => _193.includes, 'call', _194 => _194("html")])) return;
9837
10004
  const alternatePath = _chunkEUV4YR3Vcjs.getFarmMarkdownAlternatePath.call(void 0, config.md, route.route);
9838
10005
  if (!alternatePath) return;
9839
10006
  const routeRule = nitroInstance.options.routeRules[route.route] || {};
@@ -9854,8 +10021,8 @@ function toFarmNodeResponse(request, response) {
9854
10021
  }
9855
10022
  if (config.security.csp && config.security.csp.nonce) {
9856
10023
  nitroInstance.hooks.hook("prerender:generate", async (route) => {
9857
- if (!route.contents || !_optionalChain([route, 'access', _184 => _184.contentType, 'optionalAccess', _185 => _185.toLowerCase, 'call', _186 => _186(), 'access', _187 => _187.includes, 'call', _188 => _188("html")])) return;
9858
- const staticCsp = await _chunkRU3M2FIKcjs.applyFarmCspHashesToHtml.call(void 0, route.contents, config.security);
10024
+ if (!route.contents || !_optionalChain([route, 'access', _195 => _195.contentType, 'optionalAccess', _196 => _196.toLowerCase, 'call', _197 => _197(), 'access', _198 => _198.includes, 'call', _199 => _199("html")])) return;
10025
+ const staticCsp = await _chunkMRMI32SNcjs.applyFarmCspHashesToHtml.call(void 0, route.contents, config.security);
9859
10026
  if (!staticCsp) return;
9860
10027
  route.contents = staticCsp.html;
9861
10028
  const routeRule = nitroInstance.options.routeRules[route.route] || {};
@@ -10062,7 +10229,7 @@ async function moveVercelOutputPath(src, dest, fs) {
10062
10229
  await fs.rename(src, dest);
10063
10230
  return;
10064
10231
  } catch (error) {
10065
- const code = _optionalChain([error, 'optionalAccess', _189 => _189.code]);
10232
+ const code = _optionalChain([error, 'optionalAccess', _200 => _200.code]);
10066
10233
  if (code !== "EPERM" && code !== "EACCES" && code !== "EXDEV" && code !== "ENOTEMPTY") {
10067
10234
  throw error;
10068
10235
  }
@@ -10089,7 +10256,7 @@ async function postProcessVercelOutput(root, outputDir, fs, config, farmWorkflow
10089
10256
  try {
10090
10257
  await moveVercelOutputPath(publicDir, staticDir, fs);
10091
10258
  } catch (error) {
10092
- if (_optionalChain([error, 'optionalAccess', _190 => _190.code]) !== "ENOENT") throw error;
10259
+ if (_optionalChain([error, 'optionalAccess', _201 => _201.code]) !== "ENOENT") throw error;
10093
10260
  }
10094
10261
  await copyFarmDocsContentForVercel(config, root, nitroFuncDir, fs);
10095
10262
  await copyPrismaClientForVercel(root, nitroFuncDir, fs);
@@ -10106,7 +10273,7 @@ async function postProcessVercelOutput(root, outputDir, fs, config, farmWorkflow
10106
10273
  presetRoutes: Array.isArray(vercelConfig.routes) ? vercelConfig.routes : [],
10107
10274
  runtimeRoutes
10108
10275
  });
10109
- const vercelConfigWithWorkflowCrons = _chunkVFQT3LAOcjs.applyFarmWorkflowVercelCrons.call(void 0,
10276
+ const vercelConfigWithWorkflowCrons = _chunkSDOTRX3Vcjs.applyFarmWorkflowVercelCrons.call(void 0,
10110
10277
  vercelConfig,
10111
10278
  farmWorkflows.workflows
10112
10279
  );
@@ -10122,7 +10289,7 @@ async function copyFarmDocsContentForVercel(config, root, nitroFuncDir, fs) {
10122
10289
  const docsContentDir = resolveBuildDocsContentDir(config, root);
10123
10290
  if (!docsContentDir) return;
10124
10291
  const bundledContentDir = _path2.default.join(nitroFuncDir, "farm-docs-content");
10125
- const lastModifiedManifest = _chunkVZJR7UTGcjs.createFarmDocsLastModifiedManifest.call(void 0, docsContentDir, {
10292
+ const lastModifiedManifest = _chunkTE2G5IONcjs.createFarmDocsLastModifiedManifest.call(void 0, docsContentDir, {
10126
10293
  fallback: "now"
10127
10294
  });
10128
10295
  await fs.rm(bundledContentDir, { recursive: true, force: true });
@@ -10132,7 +10299,7 @@ async function copyFarmDocsContentForVercel(config, root, nitroFuncDir, fs) {
10132
10299
  force: true
10133
10300
  });
10134
10301
  await fs.writeFile(
10135
- _path2.default.join(bundledContentDir, _chunkVZJR7UTGcjs.FARM_DOCS_LAST_MODIFIED_MANIFEST),
10302
+ _path2.default.join(bundledContentDir, _chunkTE2G5IONcjs.FARM_DOCS_LAST_MODIFIED_MANIFEST),
10136
10303
  `${JSON.stringify(lastModifiedManifest, null, 2)}
10137
10304
  `
10138
10305
  );
@@ -10162,7 +10329,7 @@ async function stageSharpRuntime(config, root, distDir, fs, preset) {
10162
10329
  if (!resolvePackageJson(projectRequire, "sharp")) {
10163
10330
  try {
10164
10331
  sharpRequire = _module.createRequire.call(void 0, projectRequire.resolve("@farm.js/core"));
10165
- } catch (e23) {
10332
+ } catch (e25) {
10166
10333
  }
10167
10334
  }
10168
10335
  const copiedPackages = /* @__PURE__ */ new Map();
@@ -10209,7 +10376,7 @@ async function stageSharpRuntime(config, root, distDir, fs, preset) {
10209
10376
  try {
10210
10377
  await copyPackage("sharp", sharpRequire);
10211
10378
  if (!copiedPackages.has("sharp")) {
10212
- throw new Error(`Farm image optimization requires sharp. ${_chunkICUQICNCcjs.SHARP_INSTALL_HINT}`);
10379
+ throw new Error(`Farm image optimization requires sharp. ${_chunkNMHWYWDRcjs.SHARP_INSTALL_HINT}`);
10213
10380
  }
10214
10381
  } catch (error) {
10215
10382
  await fs.rm(stageDir, { recursive: true, force: true });
@@ -10296,7 +10463,7 @@ function resolveMetadataImageRuntimePackageJson(root) {
10296
10463
  if (packageJsonPath) return packageJsonPath;
10297
10464
  try {
10298
10465
  return resolvePackageJson(_module.createRequire.call(void 0, projectRequire.resolve("@farm.js/core")), "@vercel/og");
10299
- } catch (e24) {
10466
+ } catch (e26) {
10300
10467
  return null;
10301
10468
  }
10302
10469
  }
@@ -10347,7 +10514,7 @@ function resolvePackageJson(parentRequire, packageName) {
10347
10514
  const resolved = parentRequire.resolve(request);
10348
10515
  if (resolved.endsWith(".json")) return resolved;
10349
10516
  _nullishCoalesce(metadataModule, () => ( (metadataModule = resolved)));
10350
- } catch (e25) {
10517
+ } catch (e27) {
10351
10518
  }
10352
10519
  }
10353
10520
  try {
@@ -10358,13 +10525,13 @@ function resolvePackageJson(parentRequire, packageName) {
10358
10525
  try {
10359
10526
  const manifest = JSON.parse(_fs.readFileSync.call(void 0, candidate, "utf8"));
10360
10527
  if (manifest.name === packageName) return candidate;
10361
- } catch (e26) {
10528
+ } catch (e28) {
10362
10529
  }
10363
10530
  }
10364
10531
  if (_path2.default.basename(directory) === "node_modules") break;
10365
10532
  directory = _path2.default.dirname(directory);
10366
10533
  }
10367
- } catch (e27) {
10534
+ } catch (e29) {
10368
10535
  }
10369
10536
  return null;
10370
10537
  }
@@ -10374,13 +10541,13 @@ async function copyPrismaClientForVercel(root, nitroFuncDir, fs) {
10374
10541
  let prismaClientDir;
10375
10542
  try {
10376
10543
  prismaClientDir = _path2.default.dirname(projectRequire.resolve("@prisma/client/default.js"));
10377
- } catch (e28) {
10544
+ } catch (e30) {
10378
10545
  return;
10379
10546
  }
10380
10547
  const generatedClientDir = _path2.default.join(prismaClientDir, "..", "..", ".prisma", "client");
10381
10548
  try {
10382
10549
  await fs.access(generatedClientDir);
10383
- } catch (e29) {
10550
+ } catch (e31) {
10384
10551
  return;
10385
10552
  }
10386
10553
  const targetNodeModules = _path2.default.join(nitroFuncDir, "node_modules");
@@ -10423,7 +10590,7 @@ function createBuildTargetBaseline(config) {
10423
10590
  preset,
10424
10591
  distDir,
10425
10592
  outputDir,
10426
- outputWasDerived: outputDir === _chunkF7JZENPFcjs.getDefaultDeployOutputDir.call(void 0, config.deploy.target, preset, distDir)
10593
+ outputWasDerived: outputDir === _chunkUVW64BCBcjs.getDefaultDeployOutputDir.call(void 0, config.deploy.target, preset, distDir)
10427
10594
  };
10428
10595
  }
10429
10596
  _chunkS3JO3N4Hcjs.__name.call(void 0, createBuildTargetBaseline, "createBuildTargetBaseline");
@@ -10433,8 +10600,8 @@ function resolveBuildTargets(config, options, baseline) {
10433
10600
  const distDir = config.distDir || ".farm";
10434
10601
  const outputWasReplaced = config.deploy.outputDir !== baseline.outputDir;
10435
10602
  const shouldRefreshDerivedOutput = baseline.outputWasDerived && !outputWasReplaced && (preset !== baseline.preset || distDir !== baseline.distDir);
10436
- const deployTarget = preset === config.deploy.preset ? config.deploy.target : _chunkF7JZENPFcjs.getDeployTargetForPreset.call(void 0, preset);
10437
- const outputDir = shouldRefreshDerivedOutput ? _chunkF7JZENPFcjs.getDefaultDeployOutputDir.call(void 0, deployTarget, preset, distDir) : config.deploy.outputDir;
10603
+ const deployTarget = preset === config.deploy.preset ? config.deploy.target : _chunkUVW64BCBcjs.getDeployTargetForPreset.call(void 0, preset);
10604
+ const outputDir = shouldRefreshDerivedOutput ? _chunkUVW64BCBcjs.getDefaultDeployOutputDir.call(void 0, deployTarget, preset, distDir) : config.deploy.outputDir;
10438
10605
  return {
10439
10606
  root,
10440
10607
  preset,
@@ -10442,7 +10609,7 @@ function resolveBuildTargets(config, options, baseline) {
10442
10609
  distDir,
10443
10610
  deployTarget,
10444
10611
  outputDir,
10445
- deployOutputDir: _chunkF7JZENPFcjs.resolveDeployOutputPath.call(void 0, root, outputDir)
10612
+ deployOutputDir: _chunkUVW64BCBcjs.resolveDeployOutputPath.call(void 0, root, outputDir)
10446
10613
  };
10447
10614
  }
10448
10615
  _chunkS3JO3N4Hcjs.__name.call(void 0, resolveBuildTargets, "resolveBuildTargets");
@@ -10451,7 +10618,7 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
10451
10618
  const targetBaseline = createBuildTargetBaseline(config);
10452
10619
  let targets;
10453
10620
  const productionViteResultPromise = options.universal === false ? void 0 : Promise.allSettled([Promise.resolve(_nullishCoalesce(options.productionVite, () => ( _chunkA6WIQH5Zcjs.loadFarmProductionVite.call(void 0, ))))]);
10454
- const pluginManager = new (0, _chunkICUQICNCcjs.PluginManager)({
10621
+ const pluginManager = new (0, _chunkNMHWYWDRcjs.PluginManager)({
10455
10622
  config,
10456
10623
  isDev: false,
10457
10624
  isProd: true
@@ -10480,12 +10647,12 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
10480
10647
  };
10481
10648
  config = {
10482
10649
  ...config,
10483
- images: _chunkICUQICNCcjs.resolveFarmImageProviderForRuntime.call(void 0, config.images, {
10650
+ images: _chunkNMHWYWDRcjs.resolveFarmImageProviderForRuntime.call(void 0, config.images, {
10484
10651
  root: targets.root,
10485
10652
  preset: targets.preset
10486
10653
  })
10487
10654
  };
10488
- if (_optionalChain([config, 'access', _191 => _191.docs, 'optionalAccess', _192 => _192.enabled])) await _chunkIK6LVLKCcjs.loadFarmDocsEngine.call(void 0, );
10655
+ if (_optionalChain([config, 'access', _202 => _202.docs, 'optionalAccess', _203 => _203.enabled])) await _chunkIK6LVLKCcjs.loadFarmDocsEngine.call(void 0, );
10489
10656
  pluginManager.updateContext({ config });
10490
10657
  const { root, preset, srcDir, distDir, deployOutputDir } = targets;
10491
10658
  _chunk5QIKR7RRcjs.logger.info(`\u{1F69C} Building Farm.js application with preset: ${preset}...`);
@@ -10499,8 +10666,8 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
10499
10666
  });
10500
10667
  _chunk5QIKR7RRcjs.logger.info("\u{1F50D} Discovering routes and API endpoints...");
10501
10668
  const productionViteResult = productionViteResultPromise ? (await productionViteResultPromise)[0] : void 0;
10502
- if (_optionalChain([productionViteResult, 'optionalAccess', _193 => _193.status]) === "rejected") throw productionViteResult.reason;
10503
- const productionVite = _optionalChain([productionViteResult, 'optionalAccess', _194 => _194.value]);
10669
+ if (_optionalChain([productionViteResult, 'optionalAccess', _204 => _204.status]) === "rejected") throw productionViteResult.reason;
10670
+ const productionVite = _optionalChain([productionViteResult, 'optionalAccess', _205 => _205.value]);
10504
10671
  const createViteServer = productionVite ? productionVite.createServer : (await import("vite")).createServer;
10505
10672
  projectModuleServer = await createProjectModuleServer(
10506
10673
  createViteServer,
@@ -10508,18 +10675,18 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
10508
10675
  root,
10509
10676
  rendererBuild.signal
10510
10677
  );
10511
- const farmApp = _chunkICUQICNCcjs.createFarmApp.call(void 0, config, projectModuleServer);
10678
+ const farmApp = _chunkNMHWYWDRcjs.createFarmApp.call(void 0, config, projectModuleServer);
10512
10679
  await farmApp.initialize();
10513
10680
  const routeManager = farmApp.getRouteManager();
10514
10681
  const serverRenderer = farmApp.getServerRenderer();
10515
- const typeArtifacts = _chunk3BHT4WMPcjs.generateFarmTypeArtifacts.call(void 0, {
10682
+ const typeArtifacts = _chunkJNUWCDTFcjs.generateFarmTypeArtifacts.call(void 0, {
10516
10683
  root,
10517
10684
  srcDir,
10518
10685
  layers: config.layers,
10519
10686
  plugins: config.plugins,
10520
10687
  extraRoutes: [
10521
- ..._optionalChain([config, 'access', _195 => _195.openapi, 'optionalAccess', _196 => _196.enabled]) && config.openapi.route ? [config.openapi.route] : [],
10522
- ..._chunkVZJR7UTGcjs.getFarmDocsRouteTypeEntries.call(void 0, config.docs)
10688
+ ..._optionalChain([config, 'access', _206 => _206.openapi, 'optionalAccess', _207 => _207.enabled]) && config.openapi.route ? [config.openapi.route] : [],
10689
+ ..._chunkTE2G5IONcjs.getFarmDocsRouteTypeEntries.call(void 0, config.docs)
10523
10690
  ],
10524
10691
  suppressLintOnLink: config.suppressLintOnLink,
10525
10692
  componentExtensions: config.renderer.componentExtensions,
@@ -10528,8 +10695,8 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
10528
10695
  const message = error instanceof Error ? error.message : String(error);
10529
10696
  _chunk5QIKR7RRcjs.logger.warn(`Route type generation failed (farm.d.ts may be stale): ${message}`);
10530
10697
  });
10531
- const apiRouteManager = new (0, _chunkXBML5KMGcjs.APIRouteManager)(
10532
- _chunkVPTDD5XFcjs.getFarmAppDirectories.call(void 0, config),
10698
+ const apiRouteManager = new (0, _chunkFO427P6Icjs.APIRouteManager)(
10699
+ _chunkWBKEZXWEcjs.getFarmAppDirectories.call(void 0, config),
10533
10700
  projectModuleServer,
10534
10701
  {
10535
10702
  throwOnLoadError: true,
@@ -10603,7 +10770,7 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
10603
10770
  throw error;
10604
10771
  } finally {
10605
10772
  try {
10606
- await _optionalChain([projectModuleServer, 'optionalAccess', _197 => _197.close, 'call', _198 => _198()]);
10773
+ await _optionalChain([projectModuleServer, 'optionalAccess', _208 => _208.close, 'call', _209 => _209()]);
10607
10774
  } finally {
10608
10775
  rendererBuild.abort();
10609
10776
  }
@@ -10615,7 +10782,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
10615
10782
  ssr: true,
10616
10783
  buildLifetime
10617
10784
  });
10618
- const viteConfig = _chunkICUQICNCcjs.mergeFarmViteConfig.call(void 0,
10785
+ const viteConfig = _chunkNMHWYWDRcjs.mergeFarmViteConfig.call(void 0,
10619
10786
  {
10620
10787
  root,
10621
10788
  appType: "custom",
@@ -10627,7 +10794,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
10627
10794
  },
10628
10795
  plugins: [
10629
10796
  ...rendererVitePlugins,
10630
- _chunkICUQICNCcjs.farmFontImportsPlugin.call(void 0, {
10797
+ _chunkNMHWYWDRcjs.farmFontImportsPlugin.call(void 0, {
10631
10798
  root,
10632
10799
  basePath: config.basePath,
10633
10800
  publicDir: config.publicDir
@@ -10639,7 +10806,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
10639
10806
  hmr: false
10640
10807
  },
10641
10808
  resolve: {
10642
- alias: _chunkICUQICNCcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
10809
+ alias: _chunkNMHWYWDRcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
10643
10810
  dedupe: [...config.renderer.dedupe || []]
10644
10811
  },
10645
10812
  optimizeDeps: {
@@ -10725,7 +10892,7 @@ async function buildSSR(viteBuild, config, root, srcDir, outputDir) {
10725
10892
  define: {
10726
10893
  __FARM_API_BASE_URL__: JSON.stringify(config.api.baseURL),
10727
10894
  __FARM_ENV__: JSON.stringify(_chunkVEKFLAQMcjs.createBundledEnv.call(void 0, config.env)),
10728
- __FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _199 => _199.env, 'optionalAccess', _200 => _200.public]) || {})
10895
+ __FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _210 => _210.env, 'optionalAccess', _211 => _211.public]) || {})
10729
10896
  },
10730
10897
  plugins: [
10731
10898
  farmI18nClientBridgePlugin(),
@@ -10747,7 +10914,7 @@ function resolveLegacyPageEntry(config, root, srcDir) {
10747
10914
  _chunkS3JO3N4Hcjs.__name.call(void 0, resolveLegacyPageEntry, "resolveLegacyPageEntry");
10748
10915
  async function buildNitro(config, routeManager, apiRouteManager, serverRenderer, preset, root, distDir, pluginManager) {
10749
10916
  const [{ createNitroConfig }, { createNitro, build: nitroBuild }] = await Promise.all([
10750
- import("./nitro-OVPLKPE2.cjs"),
10917
+ import("./nitro-7F65EZZS.cjs"),
10751
10918
  import("nitro/builder")
10752
10919
  ]);
10753
10920
  let nitroConfig = await createNitroConfig(
@@ -10760,7 +10927,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
10760
10927
  if (pluginManager) {
10761
10928
  nitroConfig = await pluginManager.runHookSerial("beforeNitroBuild", nitroConfig);
10762
10929
  }
10763
- const outputDir = _chunkF7JZENPFcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
10930
+ const outputDir = _chunkUVW64BCBcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
10764
10931
  const serverOutputDir = _path2.default.join(outputDir, "server");
10765
10932
  const publicOutputDir = _path2.default.join(outputDir, "public");
10766
10933
  const { mkdir, cp } = await import("fs/promises");
@@ -10819,7 +10986,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
10819
10986
  const { readFile } = await import("fs/promises");
10820
10987
  const manifestContent = await readFile(clientManifestPath, "utf-8");
10821
10988
  farmRegistry.clientManifest = JSON.parse(manifestContent);
10822
- } catch (e30) {
10989
+ } catch (e32) {
10823
10990
  farmRegistry.clientManifest = {};
10824
10991
  }
10825
10992
  } catch (error) {
@@ -10831,7 +10998,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
10831
10998
  root,
10832
10999
  preset,
10833
11000
  distDir,
10834
- outputDir: _chunkF7JZENPFcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir)
11001
+ outputDir: _chunkUVW64BCBcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir)
10835
11002
  });
10836
11003
  }
10837
11004
  }