@farm.js/core 0.1.49 → 0.1.51-beta.0

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 (363) hide show
  1. package/README.md +163 -3
  2. package/dist/{agent-mcp-Bb8hnnqd.d.ts → agent-mcp-BBMfNpsC.d.ts} +1 -1
  3. package/dist/{agent-mcp-ir3v4fHf.d.mts → agent-mcp-D44ip11f.d.mts} +1 -1
  4. package/dist/agent-runtime.cjs +3 -3
  5. package/dist/agent-runtime.d.mts +6 -6
  6. package/dist/agent-runtime.d.ts +6 -6
  7. package/dist/agent-runtime.mjs +2 -2
  8. package/dist/analyzer-HOUCQR3K.mjs +1066 -0
  9. package/dist/analyzer-VKUDHNDF.cjs +1066 -0
  10. package/dist/api/client.d.mts +0 -1
  11. package/dist/api/client.d.ts +0 -1
  12. package/dist/api/route-manager.cjs +8 -8
  13. package/dist/api/route-manager.d.mts +10 -10
  14. package/dist/api/route-manager.d.ts +10 -10
  15. package/dist/api/route-manager.mjs +7 -7
  16. package/dist/api/runtime.cjs +3 -3
  17. package/dist/api/runtime.d.mts +7 -7
  18. package/dist/api/runtime.d.ts +7 -7
  19. package/dist/api/runtime.mjs +2 -2
  20. package/dist/api.cjs +9 -9
  21. package/dist/api.d.mts +10 -10
  22. package/dist/api.d.ts +10 -10
  23. package/dist/api.mjs +8 -8
  24. package/dist/{app-y649szYm.d.ts → app-CourU3rQ.d.ts} +7 -7
  25. package/dist/{app-DLzz02du.d.mts → app-aeD4s_mg.d.mts} +7 -7
  26. package/dist/{app-manifest-Crn8Qd3U.d.mts → app-manifest-BC6mFn5A.d.mts} +1 -1
  27. package/dist/{app-manifest-DNeTKMRL.d.ts → app-manifest-LzjoNPeq.d.ts} +1 -1
  28. package/dist/app-markdown.d.mts +7 -7
  29. package/dist/app-markdown.d.ts +7 -7
  30. package/dist/base-path-BOUV5ozD.d.mts +10 -0
  31. package/dist/base-path-BOUV5ozD.d.ts +10 -0
  32. package/dist/cache.d.mts +4 -3
  33. package/dist/cache.d.ts +4 -3
  34. package/dist/{chunk-YQGZLCT4.cjs → chunk-2IAPKPEB.cjs} +6 -6
  35. package/dist/chunk-2KVDHNQS.mjs +224 -0
  36. package/dist/{chunk-QFQDRJKJ.mjs → chunk-3HA7PP72.mjs} +2 -2
  37. package/dist/{chunk-6LH33DLL.cjs → chunk-3OWVWZ6R.cjs} +28 -2
  38. package/dist/{chunk-GXSMF7UR.mjs → chunk-4GJJ65RB.mjs} +10 -2
  39. package/dist/{chunk-GERUXONA.cjs → chunk-5A77OEIG.cjs} +4 -1
  40. package/dist/{chunk-4HBKBHVP.mjs → chunk-5ENW27SL.mjs} +1 -1
  41. package/dist/{chunk-MTB57GOK.mjs → chunk-724WT3NI.mjs} +4 -2
  42. package/dist/{chunk-XLYXG73A.mjs → chunk-75WWOZ5C.mjs} +22 -0
  43. package/dist/{chunk-VCKGOXFI.cjs → chunk-76GHW3WI.cjs} +7 -1
  44. package/dist/{chunk-ZIBIE7AH.mjs → chunk-7UPCJDB5.mjs} +7 -1
  45. package/dist/{chunk-4IICUBQX.cjs → chunk-A5BJKSZE.cjs} +2 -2
  46. package/dist/{chunk-UYQOIPXE.mjs → chunk-AER5I65K.mjs} +1 -1
  47. package/dist/{chunk-WB6XES4V.mjs → chunk-ALEUMLJN.mjs} +34 -5
  48. package/dist/{chunk-Z4LTSH7D.mjs → chunk-AMRK3P6W.mjs} +175 -71
  49. package/dist/{chunk-TTYXOAB7.mjs → chunk-ANHZ6SUL.mjs} +1 -1
  50. package/dist/{chunk-ZBS3GOQZ.cjs → chunk-AQLHD6HZ.cjs} +35 -61
  51. package/dist/{chunk-L6QDME5Z.cjs → chunk-B3GZAQSC.cjs} +3 -3
  52. package/dist/chunk-CKPTIEDX.cjs +12 -0
  53. package/dist/{chunk-JPAVNDZH.cjs → chunk-CY7H5KS4.cjs} +25 -25
  54. package/dist/{chunk-4S7M63WX.cjs → chunk-DGOLAZLV.cjs} +22 -1
  55. package/dist/{chunk-4HM5B5RR.cjs → chunk-DWW3AMJX.cjs} +343 -308
  56. package/dist/{chunk-EQMTJBB7.cjs → chunk-DZZHTMWM.cjs} +35 -6
  57. package/dist/chunk-E36C43IX.cjs +224 -0
  58. package/dist/{chunk-J2ZEVDEK.cjs → chunk-EHB77D5U.cjs} +3 -3
  59. package/dist/{chunk-WQGRD5BJ.cjs → chunk-EX6ZSN5P.cjs} +1 -16
  60. package/dist/{chunk-C5S457CK.cjs → chunk-F42U3R4F.cjs} +214 -193
  61. package/dist/{chunk-FGJQS4EC.cjs → chunk-FK25QSVC.cjs} +4 -3
  62. package/dist/{chunk-JOHXK4BB.mjs → chunk-FSQMN2MQ.mjs} +2 -1
  63. package/dist/{chunk-2H3FJYY6.mjs → chunk-FSXSQQTV.mjs} +3 -2
  64. package/dist/chunk-G2KTRMWA.mjs +40 -0
  65. package/dist/{chunk-C6U66WWF.mjs → chunk-GFT5AHAT.mjs} +13 -0
  66. package/dist/chunk-GNZIAJGB.mjs +358 -0
  67. package/dist/{chunk-TXK4D46O.mjs → chunk-H3ASZDT7.mjs} +21 -1
  68. package/dist/{chunk-AXRNEVCS.cjs → chunk-HASX6DC7.cjs} +8 -8
  69. package/dist/{chunk-NW2BKDVT.mjs → chunk-HHFMECFO.mjs} +1 -1
  70. package/dist/{chunk-HELQXYVI.cjs → chunk-I2DQGS56.cjs} +11 -9
  71. package/dist/{chunk-IVHPRF4W.mjs → chunk-I2ZA5SXS.mjs} +81 -46
  72. package/dist/{chunk-EVCQX243.cjs → chunk-IOUOGRDX.cjs} +13 -5
  73. package/dist/{chunk-CBJKDB6F.mjs → chunk-IRSS4HS4.mjs} +1 -1
  74. package/dist/{chunk-NPPT4RWF.cjs → chunk-J22JD5YJ.cjs} +7 -7
  75. package/dist/{chunk-VJXLUTBM.mjs → chunk-JF5CNHHF.mjs} +9 -9
  76. package/dist/{chunk-VR4SEDEM.mjs → chunk-JWI5PUO2.mjs} +6 -2
  77. package/dist/{chunk-6XFGJBYX.cjs → chunk-JYNNIGQO.cjs} +16 -7
  78. package/dist/{chunk-EXHEPWFJ.cjs → chunk-KHXAJ2KA.cjs} +16 -16
  79. package/dist/{chunk-ALD2WMLA.mjs → chunk-KY32FWK7.mjs} +4 -4
  80. package/dist/{chunk-BR5FSKZ5.cjs → chunk-LEIXUFJN.cjs} +6 -2
  81. package/dist/{chunk-5566GNEG.cjs → chunk-LIFUPCXW.cjs} +13 -0
  82. package/dist/{chunk-I2SWKWO7.mjs → chunk-LJDIFIJ2.mjs} +1 -1
  83. package/dist/chunk-LMFJCXDD.mjs +55 -0
  84. package/dist/{chunk-IXSMFKZ2.cjs → chunk-LNM57D3H.cjs} +4 -4
  85. package/dist/{chunk-ATHPRVP2.mjs → chunk-LZ4SB57H.mjs} +3 -3
  86. package/dist/{chunk-73XBJRZW.cjs → chunk-MMEEXMUQ.cjs} +2 -2
  87. package/dist/chunk-N4AQNEXR.cjs +17 -0
  88. package/dist/{chunk-JZMZKABS.cjs → chunk-NWUHS6GV.cjs} +3 -2
  89. package/dist/{chunk-KZT2VHRQ.cjs → chunk-O3MMJPC2.cjs} +19 -19
  90. package/dist/{chunk-JWP56HCP.mjs → chunk-OD6WM3I7.mjs} +2 -2
  91. package/dist/{chunk-R2SEZEBC.cjs → chunk-OYNNA4DD.cjs} +4 -4
  92. package/dist/{chunk-GBPDSUFE.mjs → chunk-OZK2DS44.mjs} +1 -1
  93. package/dist/{chunk-A7DK663W.cjs → chunk-PDJSL7PL.cjs} +50 -39
  94. package/dist/{chunk-XLLVWLWO.mjs → chunk-PIHKO25G.mjs} +1 -1
  95. package/dist/chunk-PIUTGRDI.cjs +358 -0
  96. package/dist/{chunk-XO6WL6NL.mjs → chunk-PPDHCRTC.mjs} +1 -1
  97. package/dist/{chunk-LZBM35DH.mjs → chunk-QI5AQMEE.mjs} +20 -9
  98. package/dist/{chunk-FR4HJDI6.cjs → chunk-QK3HBOTG.cjs} +27 -30
  99. package/dist/{chunk-Q3UU2KXC.mjs → chunk-QMDU6QHN.mjs} +4 -1
  100. package/dist/chunk-QXJADAQB.cjs +40 -0
  101. package/dist/{chunk-DGVVVYKD.mjs → chunk-R5P4KFPM.mjs} +2 -2
  102. package/dist/{chunk-3HBFI373.cjs → chunk-S5AQ7CAC.cjs} +14 -14
  103. package/dist/{chunk-Z3BXMMFF.mjs → chunk-S5ZA2T2W.mjs} +63 -42
  104. package/dist/{chunk-PXEXOQ5R.mjs → chunk-SHS6KXOZ.mjs} +1 -1
  105. package/dist/{chunk-ETF5C6HR.cjs → chunk-SJ23LJ3N.cjs} +3 -3
  106. package/dist/{chunk-LL7TDMOM.mjs → chunk-SMUW7UST.mjs} +33 -59
  107. package/dist/{chunk-VCFBQFOV.mjs → chunk-SN5VSO3Q.mjs} +9 -7
  108. package/dist/{chunk-AIHD6VME.cjs → chunk-SO3T6T4I.cjs} +482 -378
  109. package/dist/{chunk-JHXJBNLY.cjs → chunk-SUCDVKUB.cjs} +21 -1
  110. package/dist/{chunk-DM3TFCC2.cjs → chunk-SUV6YO4Q.cjs} +5 -5
  111. package/dist/{chunk-NG44F7AH.mjs → chunk-T4EW7AAD.mjs} +2 -2
  112. package/dist/{chunk-JUMPFVMK.mjs → chunk-TUOO6IK3.mjs} +9 -0
  113. package/dist/chunk-UB7RVEMX.mjs +73 -0
  114. package/dist/{chunk-CDTIXBKN.mjs → chunk-UN6N623E.mjs} +2 -2
  115. package/dist/{chunk-BEXYFR2R.cjs → chunk-USL2ANCB.cjs} +10 -10
  116. package/dist/{chunk-HAH4FBTA.mjs → chunk-VAHBCI6X.mjs} +1 -1
  117. package/dist/{chunk-QNQEK3OF.cjs → chunk-VIFPE5RG.cjs} +14 -14
  118. package/dist/{chunk-HTLCLOXQ.cjs → chunk-VO6NLTV4.cjs} +3 -3
  119. package/dist/{chunk-XN2MB4QZ.cjs → chunk-VQJYGZNX.cjs} +4 -4
  120. package/dist/{chunk-N25RPPO5.cjs → chunk-WAPQWAE6.cjs} +10 -10
  121. package/dist/{chunk-5PKDHKQP.cjs → chunk-WFVSAT7Y.cjs} +6 -4
  122. package/dist/{chunk-EA5PMJDU.mjs → chunk-WSY2JD7O.mjs} +7 -7
  123. package/dist/{chunk-HNAUK3SC.mjs → chunk-WVX3BUNJ.mjs} +40 -199
  124. package/dist/chunk-X3EFRVXY.mjs +12 -0
  125. package/dist/{chunk-UCQ52TJY.mjs → chunk-X3JNB2TB.mjs} +1 -1
  126. package/dist/{chunk-J5VCA45K.cjs → chunk-X5BCMLGP.cjs} +1 -1
  127. package/dist/{chunk-SSNN55Q6.cjs → chunk-XB24LZWI.cjs} +10 -10
  128. package/dist/{chunk-XXB37YET.cjs → chunk-XLRLSTJ6.cjs} +7 -7
  129. package/dist/{chunk-BNMHXVLL.mjs → chunk-XMHERKSE.mjs} +0 -15
  130. package/dist/chunk-XPMC4E2G.cjs +55 -0
  131. package/dist/{chunk-J27BZO67.mjs → chunk-XWC5NAHV.mjs} +23 -26
  132. package/dist/{chunk-DRFADSKY.mjs → chunk-XXXRRVY6.mjs} +4 -4
  133. package/dist/{chunk-C7425KDG.cjs → chunk-XYL4HSVC.cjs} +2 -2
  134. package/dist/{chunk-2SVJGOAX.mjs → chunk-Y3N5BFRJ.mjs} +3 -3
  135. package/dist/{chunk-ZSIGEHSE.cjs → chunk-Y7TLL65B.cjs} +21 -180
  136. package/dist/{chunk-PEHL3IZL.cjs → chunk-YB44NKC2.cjs} +2 -2
  137. package/dist/chunk-YKHRCY4T.cjs +73 -0
  138. package/dist/{chunk-RYDDUCNJ.mjs → chunk-YLNBWUVS.mjs} +1 -1
  139. package/dist/chunk-Z5A6CNV2.mjs +60 -0
  140. package/dist/chunk-Z64V4WZI.mjs +17 -0
  141. package/dist/{chunk-ACI52TCN.mjs → chunk-ZF3GX4O7.mjs} +1 -1
  142. package/dist/client/lifecycle.d.mts +1 -1
  143. package/dist/client/lifecycle.d.ts +1 -1
  144. package/dist/{client-plugins-DFDQUI9Q.d.ts → client-plugins-CFBEfVPO.d.ts} +34 -10
  145. package/dist/{client-plugins-BNBeyLMi.d.mts → client-plugins-cqy_dQd0.d.mts} +34 -10
  146. package/dist/client-plugins.d.mts +6 -6
  147. package/dist/client-plugins.d.ts +6 -6
  148. package/dist/client.cjs +13 -9
  149. package/dist/client.d.mts +11 -10
  150. package/dist/client.d.ts +11 -10
  151. package/dist/client.mjs +15 -11
  152. package/dist/client.react-server.mjs +1 -1
  153. package/dist/config-CnhyvvmT.d.mts +188 -0
  154. package/dist/config-CnhyvvmT.d.ts +188 -0
  155. package/dist/config.d.mts +6 -6
  156. package/dist/config.d.ts +6 -6
  157. package/dist/cron.cjs +4 -4
  158. package/dist/cron.mjs +3 -3
  159. package/dist/desktop.d.mts +7 -7
  160. package/dist/desktop.d.ts +7 -7
  161. package/dist/{dev-guard-YO6KPIOQ.mjs → dev-guard-4PFQNXQX.mjs} +2 -1
  162. package/dist/{dev-guard-PLHL6OTJ.cjs → dev-guard-YLO5DE3H.cjs} +4 -3
  163. package/dist/{devtools-BLKHPY3C.mjs → devtools-4MLL3RAL.mjs} +10 -10
  164. package/dist/{devtools-A37WWJZL.cjs → devtools-4ZLMD454.cjs} +12 -12
  165. package/dist/docs.cjs +14 -14
  166. package/dist/docs.d.mts +7 -7
  167. package/dist/docs.d.ts +7 -7
  168. package/dist/docs.mjs +13 -13
  169. package/dist/environment/vite.d.mts +1 -1
  170. package/dist/environment/vite.d.ts +1 -1
  171. package/dist/generate-route-types-DQP0cUzk.d.ts +33 -0
  172. package/dist/generate-route-types-TF5Wwtvz.d.mts +33 -0
  173. package/dist/i18n/client.d.mts +2 -2
  174. package/dist/i18n/client.d.ts +2 -2
  175. package/dist/i18n/index.d.mts +3 -3
  176. package/dist/i18n/index.d.ts +3 -3
  177. package/dist/i18n/server.d.mts +5 -5
  178. package/dist/i18n/server.d.ts +5 -5
  179. package/dist/image/server.cjs +3 -3
  180. package/dist/image/server.mjs +2 -2
  181. package/dist/image/sharp.cjs +10 -10
  182. package/dist/image/sharp.mjs +2 -2
  183. package/dist/{index-DBdiTkNc.d.ts → index-BYkNbeQV.d.mts} +2 -2
  184. package/dist/{index-CeJ9_s9p.d.mts → index-BxjN_UDZ.d.ts} +2 -2
  185. package/dist/{index-MocnSP3a.d.ts → index-D3l4tREW.d.ts} +2 -2
  186. package/dist/{index-Cl3akY5U.d.mts → index-DPUAPho_.d.mts} +2 -2
  187. package/dist/index.cjs +88 -79
  188. package/dist/index.d.mts +29 -45
  189. package/dist/index.d.ts +29 -45
  190. package/dist/index.mjs +92 -83
  191. package/dist/integrations.cjs +3 -3
  192. package/dist/integrations.d.mts +6 -6
  193. package/dist/integrations.d.ts +6 -6
  194. package/dist/integrations.mjs +2 -2
  195. package/dist/internal/app-markdown-runtime.d.mts +7 -7
  196. package/dist/internal/app-markdown-runtime.d.ts +7 -7
  197. package/dist/internal/build-runtime.cjs +47 -43
  198. package/dist/internal/build-runtime.d.mts +9 -9
  199. package/dist/internal/build-runtime.d.ts +9 -9
  200. package/dist/internal/build-runtime.mjs +46 -42
  201. package/dist/internal/cli-runtime.cjs +24 -23
  202. package/dist/internal/cli-runtime.mjs +24 -23
  203. package/dist/internal/client-error-overlay.cjs +4 -4
  204. package/dist/internal/client-error-overlay.mjs +1 -1
  205. package/dist/internal/client-runtime.cjs +22 -3
  206. package/dist/internal/client-runtime.d.mts +46 -4
  207. package/dist/internal/client-runtime.d.ts +46 -4
  208. package/dist/internal/client-runtime.mjs +22 -3
  209. package/dist/internal/compression-runtime.d.mts +6 -6
  210. package/dist/internal/compression-runtime.d.ts +6 -6
  211. package/dist/internal/config-runtime.cjs +20 -13
  212. package/dist/internal/config-runtime.d.mts +259 -18
  213. package/dist/internal/config-runtime.d.ts +259 -18
  214. package/dist/internal/config-runtime.mjs +18 -11
  215. package/dist/internal/form-actions.cjs +5 -4
  216. package/dist/internal/form-actions.mjs +4 -3
  217. package/dist/internal/infra-analytics-runtime.cjs +6 -6
  218. package/dist/internal/infra-analytics-runtime.mjs +4 -4
  219. package/dist/internal/islands-runtime.cjs +56 -0
  220. package/dist/internal/islands-runtime.mjs +57 -1
  221. package/dist/internal/metadata-image-runtime.cjs +3 -3
  222. package/dist/internal/metadata-image-runtime.mjs +2 -2
  223. package/dist/internal/product-telemetry-runtime.cjs +2 -2
  224. package/dist/internal/product-telemetry-runtime.mjs +1 -1
  225. package/dist/internal/production-runtime.cjs +18 -15
  226. package/dist/internal/production-runtime.d.mts +33 -20
  227. package/dist/internal/production-runtime.d.ts +33 -20
  228. package/dist/internal/production-runtime.mjs +20 -17
  229. package/dist/internal/server-fn-transform.cjs +13 -0
  230. package/dist/internal/server-fn-transform.d.mts +24 -0
  231. package/dist/internal/server-fn-transform.d.ts +24 -0
  232. package/dist/internal/server-fn-transform.mjs +13 -0
  233. package/dist/{layers-D9fbe-rz.d.ts → layers-CcS42OGR.d.mts} +1 -1
  234. package/dist/{layers-D9fbe-rz.d.mts → layers-CcS42OGR.d.ts} +1 -1
  235. package/dist/{lifecycle-DK06VuKP.d.ts → lifecycle-C2aLBOwu.d.mts} +1 -1
  236. package/dist/{lifecycle-DK06VuKP.d.mts → lifecycle-C2aLBOwu.d.ts} +1 -1
  237. package/dist/markdown.d.mts +6 -6
  238. package/dist/markdown.d.ts +6 -6
  239. package/dist/middleware.cjs +11 -11
  240. package/dist/middleware.d.mts +8 -8
  241. package/dist/middleware.d.ts +8 -8
  242. package/dist/middleware.mjs +10 -10
  243. package/dist/mobile.cjs +9 -0
  244. package/dist/mobile.d.mts +94 -0
  245. package/dist/mobile.d.ts +94 -0
  246. package/dist/mobile.mjs +9 -0
  247. package/dist/navigation-delegate-BU4xqdnw.d.ts +29 -0
  248. package/dist/navigation-delegate-DLhbfEN4.d.mts +29 -0
  249. package/dist/navigation.cjs +5 -5
  250. package/dist/navigation.d.mts +9 -9
  251. package/dist/navigation.d.ts +9 -9
  252. package/dist/navigation.mjs +4 -4
  253. package/dist/{nitro-BIXIKJZS.cjs → nitro-CK7M4RMY.cjs} +12 -12
  254. package/dist/{nitro-UT2J5A5D.mjs → nitro-R444AF3O.mjs} +8 -8
  255. package/dist/platform.cjs +2 -1
  256. package/dist/platform.d.mts +4 -3
  257. package/dist/platform.d.ts +4 -3
  258. package/dist/platform.mjs +2 -1
  259. package/dist/{plugin-4KYXV7BB.mjs → plugin-53SY5YBS.mjs} +1 -1
  260. package/dist/{plugin-WBANOZQM.cjs → plugin-HZIBL3DW.cjs} +2 -2
  261. package/dist/plugin.cjs +40 -36
  262. package/dist/plugin.d.mts +13 -8
  263. package/dist/plugin.d.ts +13 -8
  264. package/dist/plugin.mjs +39 -35
  265. package/dist/{production-runtime-B3qFFtKF.d.ts → production-runtime-C78A8YgK.d.ts} +3 -3
  266. package/dist/{production-runtime-DcD-GRAv.d.mts → production-runtime-DLA4J5WG.d.mts} +3 -3
  267. package/dist/production-vite-BQFAlG7n.d.mts +13 -0
  268. package/dist/production-vite-BQFAlG7n.d.ts +13 -0
  269. package/dist/{programmatic-routes-client-fD9f4XqU.d.ts → programmatic-routes-client-CBqkNhBy.d.ts} +2 -2
  270. package/dist/{programmatic-routes-client-DzbYGiZQ.d.mts → programmatic-routes-client-NpqGBn-i.d.mts} +2 -2
  271. package/dist/query/client.cjs +6 -6
  272. package/dist/query/client.mjs +2 -2
  273. package/dist/{render-plan-DqJ51ufr.d.mts → render-plan-C9sWvDTv.d.mts} +1 -1
  274. package/dist/{render-plan-B6cfssrr.d.ts → render-plan-CrqcBbnV.d.ts} +1 -1
  275. package/dist/renderer-client.cjs +17 -12
  276. package/dist/renderer-client.d.mts +9 -8
  277. package/dist/renderer-client.d.ts +9 -8
  278. package/dist/renderer-client.mjs +10 -5
  279. package/dist/{request-jhvUMXRx.d.ts → request-BizeuqD7.d.ts} +1 -1
  280. package/dist/{request-UuAxHn8h.d.mts → request-WwB1-Uim.d.mts} +1 -1
  281. package/dist/request.d.mts +7 -7
  282. package/dist/request.d.ts +7 -7
  283. package/dist/{resolver-DC57A4vz.d.ts → resolver-CJ-D9nP-.d.ts} +1 -1
  284. package/dist/{resolver-C2G-3Tm6.d.mts → resolver-TDyZKgKI.d.mts} +1 -1
  285. package/dist/{route-rendering-Sn50cYZf.d.ts → route-rendering-BGhJN64l.d.ts} +1 -1
  286. package/dist/{route-rendering-Cou00t1X.d.mts → route-rendering-S6NFjnx4.d.mts} +1 -1
  287. package/dist/{router-0X9DCTcm.d.mts → router-BIheIy9G.d.mts} +1 -1
  288. package/dist/{router-xwLvi48p.d.ts → router-BUD_j2EL.d.ts} +1 -1
  289. package/dist/routes-8PT9cl60.d.ts +121 -0
  290. package/dist/routes-kEUsXHx3.d.mts +121 -0
  291. package/dist/routes.cjs +3 -2
  292. package/dist/routes.d.mts +7 -7
  293. package/dist/routes.d.ts +7 -7
  294. package/dist/routes.mjs +2 -1
  295. package/dist/{rsc-pipeline-VKHMABDJ.cjs → rsc-pipeline-JRGUZBYM.cjs} +18 -16
  296. package/dist/{rsc-pipeline-F6ZPH5MU.mjs → rsc-pipeline-OLAVIKI3.mjs} +17 -15
  297. package/dist/{runtime-B9HmxiZc.d.ts → runtime-C4CmlOOh.d.ts} +2 -2
  298. package/dist/{runtime-tkSXZiqO.d.ts → runtime-CWP-21hP.d.ts} +1 -1
  299. package/dist/{runtime-CMrsyChI.d.mts → runtime-CgJwe6H_.d.mts} +1 -1
  300. package/dist/{runtime-CCxTmGuf.d.mts → runtime-CihDZ2Rn.d.mts} +2 -2
  301. package/dist/runtime-G23RSLEK.cjs +1005 -0
  302. package/dist/runtime-OGCHDACZ.mjs +1005 -0
  303. package/dist/{schema-dev-notice-O3I5HLXK.mjs → schema-dev-notice-F6QYSOAI.mjs} +4 -4
  304. package/dist/{schema-dev-notice-Z73J3NJ6.cjs → schema-dev-notice-UU7DMZEU.cjs} +7 -7
  305. package/dist/{search-client-BTXL5XWD.mjs → search-client-OXH6GBNO.mjs} +5 -3
  306. package/dist/search-client-ZZLKVO5R.cjs +15 -0
  307. package/dist/server-action-security.cjs +3 -3
  308. package/dist/server-action-security.mjs +2 -2
  309. package/dist/server-fn-client.d.mts +0 -1
  310. package/dist/server-fn-client.d.ts +0 -1
  311. package/dist/server-fn.cjs +4 -4
  312. package/dist/server-fn.d.mts +0 -1
  313. package/dist/server-fn.d.ts +0 -1
  314. package/dist/server-fn.mjs +3 -3
  315. package/dist/server-plugins.cjs +1 -1
  316. package/dist/server-plugins.d.mts +7 -7
  317. package/dist/server-plugins.d.ts +7 -7
  318. package/dist/server-plugins.mjs +1 -1
  319. package/dist/server-query-client.cjs +4 -3
  320. package/dist/server-query-client.d.mts +0 -1
  321. package/dist/server-query-client.d.ts +0 -1
  322. package/dist/server-query-client.mjs +3 -2
  323. package/dist/server-query.cjs +5 -5
  324. package/dist/server-query.d.mts +0 -1
  325. package/dist/server-query.d.ts +0 -1
  326. package/dist/server-query.mjs +4 -4
  327. package/dist/server.cjs +104 -79
  328. package/dist/server.d.mts +22 -17
  329. package/dist/server.d.ts +22 -17
  330. package/dist/server.mjs +73 -48
  331. package/dist/{spa-router-B48EjsS1.d.mts → spa-router-CVOL0Vrq.d.mts} +4 -4
  332. package/dist/{spa-router-B06APnGK.d.ts → spa-router-Kytv4jSB.d.ts} +4 -4
  333. package/dist/testing.cjs +16 -15
  334. package/dist/testing.d.mts +6 -6
  335. package/dist/testing.d.ts +6 -6
  336. package/dist/testing.mjs +12 -11
  337. package/dist/{types--Wh02r5_.d.mts → types-C41ePjvP.d.mts} +1 -1
  338. package/dist/{types--Wh02r5_.d.ts → types-C41ePjvP.d.ts} +1 -1
  339. package/dist/{utils-C5fyK2tE.d.ts → utils-DbyXlzaj.d.ts} +1 -1
  340. package/dist/{utils-hyAwmcN6.d.mts → utils-Dsa1HZ7X.d.mts} +1 -1
  341. package/dist/version.cjs +2 -2
  342. package/dist/version.mjs +1 -1
  343. package/dist/vite.cjs +40 -36
  344. package/dist/vite.d.mts +9 -9
  345. package/dist/vite.d.ts +9 -9
  346. package/dist/vite.mjs +39 -35
  347. package/dist/{workflows-Df1C_7OG.d.mts → workflows-CRMzQZ3k.d.mts} +2 -1
  348. package/dist/{workflows-Df1C_7OG.d.ts → workflows-CRMzQZ3k.d.ts} +2 -1
  349. package/dist/workflows.cjs +5 -5
  350. package/dist/workflows.d.mts +1 -1
  351. package/dist/workflows.d.ts +1 -1
  352. package/dist/workflows.mjs +4 -4
  353. package/package.json +16 -3
  354. package/dist/base-path-leyrqXbX.d.mts +0 -19
  355. package/dist/base-path-leyrqXbX.d.ts +0 -19
  356. package/dist/cache-invalidation-BD0z_lfu.d.mts +0 -4
  357. package/dist/cache-invalidation-BD0z_lfu.d.ts +0 -4
  358. package/dist/chunk-45EUIICW.mjs +0 -15
  359. package/dist/chunk-MJ6IC4K2.mjs +0 -34
  360. package/dist/chunk-V7KTQR4C.cjs +0 -15
  361. package/dist/search-client-QCYAL6AY.cjs +0 -13
  362. package/dist/{chunk-5OJVKXFV.cjs → chunk-N7JQXQAV.cjs} +2 -2
  363. package/dist/{chunk-72KABRWN.mjs → chunk-WSDKXV4E.mjs} +4 -4
@@ -9,10 +9,10 @@ var _chunkKBGZ5FD6cjs = require('./chunk-KBGZ5FD6.cjs');
9
9
  var _chunkP2355C6Ecjs = require('./chunk-P2355C6E.cjs');
10
10
 
11
11
 
12
- var _chunkEXHEPWFJcjs = require('./chunk-EXHEPWFJ.cjs');
12
+ var _chunkKHXAJ2KAcjs = require('./chunk-KHXAJ2KA.cjs');
13
13
 
14
14
 
15
- var _chunkJZMZKABScjs = require('./chunk-JZMZKABS.cjs');
15
+ var _chunkNWUHS6GVcjs = require('./chunk-NWUHS6GV.cjs');
16
16
 
17
17
 
18
18
  var _chunkSBDWCDS6cjs = require('./chunk-SBDWCDS6.cjs');
@@ -23,7 +23,8 @@ var _chunkSBDWCDS6cjs = require('./chunk-SBDWCDS6.cjs');
23
23
 
24
24
 
25
25
 
26
- var _chunkR2SEZEBCcjs = require('./chunk-R2SEZEBC.cjs');
26
+
27
+ var _chunkOYNNA4DDcjs = require('./chunk-OYNNA4DD.cjs');
27
28
 
28
29
 
29
30
  var _chunkE7QOEV5Zcjs = require('./chunk-E7QOEV5Z.cjs');
@@ -32,11 +33,11 @@ var _chunkE7QOEV5Zcjs = require('./chunk-E7QOEV5Z.cjs');
32
33
  var _chunkY3WG64CPcjs = require('./chunk-Y3WG64CP.cjs');
33
34
 
34
35
 
35
- var _chunk6XFGJBYXcjs = require('./chunk-6XFGJBYX.cjs');
36
+ var _chunkJYNNIGQOcjs = require('./chunk-JYNNIGQO.cjs');
36
37
 
37
38
 
38
39
 
39
- var _chunkXN2MB4QZcjs = require('./chunk-XN2MB4QZ.cjs');
40
+ var _chunkVQJYGZNXcjs = require('./chunk-VQJYGZNX.cjs');
40
41
 
41
42
 
42
43
  var _chunkZ5MZDFX4cjs = require('./chunk-Z5MZDFX4.cjs');
@@ -44,7 +45,7 @@ var _chunkZ5MZDFX4cjs = require('./chunk-Z5MZDFX4.cjs');
44
45
 
45
46
 
46
47
 
47
- var _chunk5566GNEGcjs = require('./chunk-5566GNEG.cjs');
48
+ var _chunkLIFUPCXWcjs = require('./chunk-LIFUPCXW.cjs');
48
49
 
49
50
 
50
51
  var _chunkHNAISJFDcjs = require('./chunk-HNAISJFD.cjs');
@@ -60,7 +61,7 @@ function farmApiPlugin(options = {}) {
60
61
  const srcDir = _nullishCoalesce(options.srcDir, () => ( "src"));
61
62
  const apiDirFromRoot = _nullishCoalesce(options.apiDir, () => ( _path2.default.join(srcDir, "api")));
62
63
  const debug = _nullishCoalesce(options.debug, () => ( false));
63
- const bodySizeLimit = _chunk5566GNEGcjs.resolveFarmServerConfig.call(void 0, {
64
+ const bodySizeLimit = _chunkLIFUPCXWcjs.resolveFarmServerConfig.call(void 0, {
64
65
  bodySizeLimit: options.bodySizeLimit
65
66
  }).bodySizeLimit;
66
67
  const basePath = options.basePath;
@@ -113,7 +114,7 @@ function farmApiPlugin(options = {}) {
113
114
  const existing = apiRoutesCache.get(routePath);
114
115
  const existingFile = _optionalChain([endpointSources, 'access', _ => _.get, 'call', _2 => _2(routePath), 'optionalAccess', _3 => _3.get, 'call', _4 => _4(normalizedMethod)]);
115
116
  if (existingFile) {
116
- throw new (0, _chunkEXHEPWFJcjs.APIRouteConflictError)(routePath, normalizedMethod, existingFile, filePath);
117
+ throw new (0, _chunkKHXAJ2KAcjs.APIRouteConflictError)(routePath, normalizedMethod, existingFile, filePath);
117
118
  }
118
119
  if (existing) {
119
120
  if (!existing.methods.includes(normalizedMethod)) {
@@ -189,7 +190,7 @@ function farmApiPlugin(options = {}) {
189
190
  const createRouter = async () => {
190
191
  const plugins = options.plugins ? await (_nullishCoalesce(routePlugins, () => ( (routePlugins = Promise.resolve(options.plugins({ root: projectRoot })))))) : [];
191
192
  pluginMergedRoutes = plugins.length ? new Map(
192
- _chunkR2SEZEBCcjs.mergePluginAPIRoutes.call(void 0, [...apiRoutesCache.values()], plugins, void 0, {
193
+ _chunkOYNNA4DDcjs.mergePluginAPIRoutes.call(void 0, [...apiRoutesCache.values()], plugins, void 0, {
193
194
  bodySizeLimit,
194
195
  // A plugin calling an app endpoint (an MCP tool, say) goes back through this server,
195
196
  // so the middleware that guards the endpoint's path runs for it.
@@ -209,7 +210,7 @@ function farmApiPlugin(options = {}) {
209
210
  const url = new URL(request.url);
210
211
  const method = request.method.toUpperCase();
211
212
  const pathname = url.pathname;
212
- const match = _chunkR2SEZEBCcjs.matchAPIRouteAtBasePath.call(void 0, servedRoutes(), pathname, basePath);
213
+ const match = _chunkOYNNA4DDcjs.matchAPIRouteAtBasePath.call(void 0, servedRoutes(), pathname, basePath);
213
214
  if (!match) {
214
215
  return new Response(JSON.stringify({ error: "Not Found" }), {
215
216
  status: 404,
@@ -217,18 +218,18 @@ function farmApiPlugin(options = {}) {
217
218
  });
218
219
  }
219
220
  const { route, params } = match;
220
- const endpoint = _chunkR2SEZEBCcjs.resolveAPIRouteEndpoint.call(void 0, route, method);
221
+ const endpoint = _chunkOYNNA4DDcjs.resolveAPIRouteEndpoint.call(void 0, route, method);
221
222
  if (!endpoint) {
222
223
  return new Response(JSON.stringify({ error: "Method Not Allowed" }), {
223
224
  status: 405,
224
225
  headers: {
225
- Allow: _chunkR2SEZEBCcjs.getAllowedAPIRouteMethods.call(void 0, route).join(", "),
226
+ Allow: _chunkOYNNA4DDcjs.getAllowedAPIRouteMethods.call(void 0, route).join(", "),
226
227
  "Content-Type": "application/json"
227
228
  }
228
229
  });
229
230
  }
230
231
  try {
231
- return await _chunkR2SEZEBCcjs.invokeAPIRouteEndpoint.call(void 0, endpoint, request, params, bodySizeLimit);
232
+ return await _chunkOYNNA4DDcjs.invokeAPIRouteEndpoint.call(void 0, endpoint, request, params, bodySizeLimit);
232
233
  } catch (error) {
233
234
  return new Response(JSON.stringify({ error: error.message || "Internal Server Error" }), {
234
235
  status: 500,
@@ -274,10 +275,10 @@ function farmApiPlugin(options = {}) {
274
275
  try {
275
276
  const relativePath = path.relative(apiDir, path.dirname(filePath));
276
277
  const routePath = "/api/" + (relativePath === "." ? "" : relativePath.replace(/\\/g, "/"));
277
- const routeModule = await _chunk6XFGJBYXcjs.loadFarmDevModule.call(void 0, server, filePath);
278
+ const routeModule = await _chunkJYNNIGQOcjs.loadFarmDevModule.call(void 0, server, filePath);
278
279
  const endpoints = {};
279
280
  const availableMethods = [];
280
- for (const method of _chunkR2SEZEBCcjs.API_ROUTE_METHODS) {
281
+ for (const method of _chunkOYNNA4DDcjs.API_ROUTE_METHODS) {
281
282
  if (routeModule[method]) {
282
283
  availableMethods.push(method);
283
284
  endpoints[method] = routeModule[method];
@@ -290,7 +291,7 @@ function farmApiPlugin(options = {}) {
290
291
  log(`API route discovered: ${availableMethods.join(", ")} ${routePath}`);
291
292
  }
292
293
  } catch (e) {
293
- if (e instanceof _chunkEXHEPWFJcjs.APIRouteConflictError || e instanceof _chunkYTVSWXEZcjs.AmbiguousRouteError) throw e;
294
+ if (e instanceof _chunkKHXAJ2KAcjs.APIRouteConflictError || e instanceof _chunkYTVSWXEZcjs.AmbiguousRouteError) throw e;
294
295
  log(`API route load failed at ${filePath}: ${e.message}`);
295
296
  }
296
297
  }
@@ -306,7 +307,7 @@ function farmApiPlugin(options = {}) {
306
307
  for (const routesFile of routesFiles) {
307
308
  if (fs.existsSync(routesFile)) {
308
309
  try {
309
- const routesModule = await _chunk6XFGJBYXcjs.loadFarmDevModule.call(void 0, server, routesFile);
310
+ const routesModule = await _chunkJYNNIGQOcjs.loadFarmDevModule.call(void 0, server, routesFile);
310
311
  for (const [exportName, exportValue] of Object.entries(routesModule)) {
311
312
  const endpoint = exportValue;
312
313
  if (endpoint && endpoint.__path) {
@@ -317,7 +318,7 @@ function farmApiPlugin(options = {}) {
317
318
  }
318
319
  }
319
320
  } catch (e) {
320
- if (e instanceof _chunkEXHEPWFJcjs.APIRouteConflictError || e instanceof _chunkYTVSWXEZcjs.AmbiguousRouteError) throw e;
321
+ if (e instanceof _chunkKHXAJ2KAcjs.APIRouteConflictError || e instanceof _chunkYTVSWXEZcjs.AmbiguousRouteError) throw e;
321
322
  log(`Root routes.ts load failed: ${e.message}`);
322
323
  }
323
324
  break;
@@ -327,14 +328,14 @@ function farmApiPlugin(options = {}) {
327
328
  const discoverProgrammaticRoutes = async () => {
328
329
  const path = await import("path");
329
330
  const srcRoot = path.join(server.config.root, srcDir);
330
- const routeFiles = _chunkJZMZKABScjs.findProgrammaticRouteFilesInDir.call(void 0, srcRoot);
331
+ const routeFiles = _chunkNWUHS6GVcjs.findProgrammaticRouteFilesInDir.call(void 0, srcRoot);
331
332
  if (routeFiles.length === 0) return;
332
333
  const { getProgrammaticRouteManifest } = await import("./routes.cjs");
333
334
  for (const routeFile of routeFiles) {
334
335
  try {
335
- const routesModule = await _chunk6XFGJBYXcjs.loadFarmDevModule.call(void 0,
336
+ const routesModule = await _chunkJYNNIGQOcjs.loadFarmDevModule.call(void 0,
336
337
  server,
337
- _chunkXN2MB4QZcjs.toViteModuleId.call(void 0, routeFile, server.config.root)
338
+ _chunkVQJYGZNXcjs.toViteModuleId.call(void 0, routeFile, server.config.root)
338
339
  );
339
340
  const manifest = getProgrammaticRouteManifest(routesModule);
340
341
  if (!manifest) continue;
@@ -348,7 +349,7 @@ function farmApiPlugin(options = {}) {
348
349
  }
349
350
  }
350
351
  } catch (e) {
351
- if (e instanceof _chunkEXHEPWFJcjs.APIRouteConflictError || e instanceof _chunkYTVSWXEZcjs.AmbiguousRouteError) throw e;
352
+ if (e instanceof _chunkKHXAJ2KAcjs.APIRouteConflictError || e instanceof _chunkYTVSWXEZcjs.AmbiguousRouteError) throw e;
352
353
  log(`Programmatic routes file load failed at ${routeFile}: ${e.message}`);
353
354
  }
354
355
  }
@@ -400,17 +401,27 @@ function farmApiPlugin(options = {}) {
400
401
  const pathname = url.split("?")[0];
401
402
  const method = req.method || "GET";
402
403
  if (discoveryPromise) await waitForDiscovery();
403
- if (!_chunkR2SEZEBCcjs.matchAPIRouteAtBasePath.call(void 0, servedRoutes(), pathname, basePath)) {
404
- return next();
404
+ const farmMiddleware = server.__farmMiddleware__;
405
+ let middlewareRan = false;
406
+ if (!_chunkOYNNA4DDcjs.matchAPIRouteAtBasePath.call(void 0, servedRoutes(), pathname, basePath)) {
407
+ if (!farmMiddleware || !apiRouterHandler || !_chunkOYNNA4DDcjs.isFarmAPIPathname.call(void 0, pathname, basePath)) {
408
+ return next();
409
+ }
410
+ await _optionalChain([farmMiddleware, 'access', _5 => _5.waitForDiscovery, 'optionalCall', _6 => _6()]);
411
+ if (await farmMiddleware.execute(req, res, pathname, /* @__PURE__ */ new Map())) return;
412
+ middlewareRan = true;
413
+ const rewrittenPathname = (req.url || url).split("?")[0];
414
+ if (rewrittenPathname === pathname || !_chunkOYNNA4DDcjs.matchAPIRouteAtBasePath.call(void 0, servedRoutes(), rewrittenPathname, basePath)) {
415
+ return next();
416
+ }
405
417
  }
406
418
  if (!apiRouterHandler) {
407
419
  return next();
408
420
  }
409
421
  const startTime = Date.now();
410
422
  try {
411
- const farmMiddleware = server.__farmMiddleware__;
412
- if (farmMiddleware) {
413
- await _optionalChain([farmMiddleware, 'access', _5 => _5.waitForDiscovery, 'optionalCall', _6 => _6()]);
423
+ if (farmMiddleware && !middlewareRan) {
424
+ await _optionalChain([farmMiddleware, 'access', _7 => _7.waitForDiscovery, 'optionalCall', _8 => _8()]);
414
425
  const middlewareData = /* @__PURE__ */ new Map();
415
426
  const handled = await farmMiddleware.execute(req, res, pathname, middlewareData);
416
427
  if (handled) {
@@ -421,7 +432,7 @@ function farmApiPlugin(options = {}) {
421
432
  }
422
433
  const currentUrl = req.url || url;
423
434
  const currentPathname = currentUrl.split("?")[0];
424
- if (currentPathname !== pathname && !_chunkR2SEZEBCcjs.matchAPIRouteAtBasePath.call(void 0, servedRoutes(), currentPathname, basePath)) {
435
+ if (currentPathname !== pathname && !_chunkOYNNA4DDcjs.matchAPIRouteAtBasePath.call(void 0, servedRoutes(), currentPathname, basePath)) {
425
436
  return next();
426
437
  }
427
438
  const fullUrl = _chunkHNAISJFDcjs.resolveFarmRequestURL.call(void 0, req);
@@ -433,7 +444,7 @@ function farmApiPlugin(options = {}) {
433
444
  }
434
445
  let body;
435
446
  if (method !== "GET" && method !== "HEAD") {
436
- body = await _chunk5566GNEGcjs.readNodeRequestBody.call(void 0, req, bodySizeLimit);
447
+ body = await _chunkLIFUPCXWcjs.readNodeRequestBody.call(void 0, req, bodySizeLimit);
437
448
  }
438
449
  const request = new Request(fullUrl, {
439
450
  method,
@@ -448,7 +459,7 @@ function farmApiPlugin(options = {}) {
448
459
  logResponse(method, currentPathname, response.status, duration);
449
460
  await _chunkZ5MZDFX4cjs.sendWebResponse.call(void 0, res, response);
450
461
  } catch (error) {
451
- const bodyErrorResponse = _chunk5566GNEGcjs.createFarmRequestBodyErrorResponse.call(void 0, error);
462
+ const bodyErrorResponse = _chunkLIFUPCXWcjs.createFarmRequestBodyErrorResponse.call(void 0, error);
452
463
  if (bodyErrorResponse) {
453
464
  await _chunkZ5MZDFX4cjs.sendWebResponse.call(void 0, res, bodyErrorResponse);
454
465
  return;
@@ -476,7 +487,7 @@ function farmApiPlugin(options = {}) {
476
487
  );
477
488
  if (res.writableEnded) return;
478
489
  if (res.headersSent) {
479
- _optionalChain([res, 'access', _7 => _7.destroy, 'optionalCall', _8 => _8(error instanceof Error ? error : new Error(String(error)))]);
490
+ _optionalChain([res, 'access', _9 => _9.destroy, 'optionalCall', _10 => _10(error instanceof Error ? error : new Error(String(error)))]);
480
491
  return;
481
492
  }
482
493
  res.statusCode = 500;
@@ -487,17 +498,17 @@ function farmApiPlugin(options = {}) {
487
498
  };
488
499
  },
489
500
  async handleHotUpdate({ file, server, modules }) {
490
- const normalizedFile = _chunkXN2MB4QZcjs.toPosixPath.call(void 0, file);
501
+ const normalizedFile = _chunkVQJYGZNXcjs.toPosixPath.call(void 0, file);
491
502
  const fileName = normalizedFile.split("/").pop() || "";
492
503
  if (fileName === "routes.ts" || fileName === "routes.tsx" || fileName === "routes.js" || _chunkE7QOEV5Zcjs.isProgrammaticRoutesFileName.call(void 0, fileName)) {
493
504
  log(`Root routes file updated: ${fileName}`);
494
505
  for (const mod of modules) {
495
506
  server.moduleGraph.invalidateModule(mod);
496
507
  }
497
- if (await _optionalChain([recoverFailedDiscovery, 'optionalCall', _9 => _9()])) return [];
508
+ if (await _optionalChain([recoverFailedDiscovery, 'optionalCall', _11 => _11()])) return [];
498
509
  const previousState = snapshotRouteState();
499
510
  try {
500
- const routesModule = await _chunk6XFGJBYXcjs.loadFarmDevModule.call(void 0, server, file);
511
+ const routesModule = await _chunkJYNNIGQOcjs.loadFarmDevModule.call(void 0, server, file);
501
512
  removeEndpointsFromFile(file);
502
513
  for (const [exportName, exportValue] of Object.entries(routesModule)) {
503
514
  const endpoint = exportValue;
@@ -525,7 +536,7 @@ function farmApiPlugin(options = {}) {
525
536
  log(`API router recreated`);
526
537
  } catch (e) {
527
538
  restoreRouteState(previousState);
528
- if (e instanceof _chunkEXHEPWFJcjs.APIRouteConflictError || e instanceof _chunkYTVSWXEZcjs.AmbiguousRouteError) throw e;
539
+ if (e instanceof _chunkKHXAJ2KAcjs.APIRouteConflictError || e instanceof _chunkYTVSWXEZcjs.AmbiguousRouteError) throw e;
529
540
  log(`Root routes.ts HMR failed: ${e.message}`);
530
541
  }
531
542
  return [];
@@ -536,7 +547,7 @@ function farmApiPlugin(options = {}) {
536
547
  for (const mod of modules) {
537
548
  server.moduleGraph.invalidateModule(mod);
538
549
  }
539
- if (await _optionalChain([recoverFailedDiscovery, 'optionalCall', _10 => _10()])) return [];
550
+ if (await _optionalChain([recoverFailedDiscovery, 'optionalCall', _12 => _12()])) return [];
540
551
  const previousState = snapshotRouteState();
541
552
  try {
542
553
  const path = await import("path");
@@ -550,10 +561,10 @@ function farmApiPlugin(options = {}) {
550
561
  log(`API route file removed: ${routePath}`);
551
562
  return [];
552
563
  }
553
- const routeModule = await _chunk6XFGJBYXcjs.loadFarmDevModule.call(void 0, server, file);
564
+ const routeModule = await _chunkJYNNIGQOcjs.loadFarmDevModule.call(void 0, server, file);
554
565
  removeEndpointsFromFile(file);
555
566
  const availableMethods = [];
556
- for (const method of _chunkR2SEZEBCcjs.API_ROUTE_METHODS) {
567
+ for (const method of _chunkOYNNA4DDcjs.API_ROUTE_METHODS) {
557
568
  if (!routeModule[method]) continue;
558
569
  availableMethods.push(method);
559
570
  addEndpoint(routePath, file, method, routeModule[method]);
@@ -563,7 +574,7 @@ function farmApiPlugin(options = {}) {
563
574
  log(`API router recreated`);
564
575
  } catch (e) {
565
576
  restoreRouteState(previousState);
566
- if (e instanceof _chunkEXHEPWFJcjs.APIRouteConflictError || e instanceof _chunkYTVSWXEZcjs.AmbiguousRouteError) throw e;
577
+ if (e instanceof _chunkKHXAJ2KAcjs.APIRouteConflictError || e instanceof _chunkYTVSWXEZcjs.AmbiguousRouteError) throw e;
567
578
  log(`API route HMR failed: ${e.message}`);
568
579
  }
569
580
  return [];
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-NR63PD3P.mjs";
5
5
  import {
6
6
  logger
7
- } from "./chunk-2SVJGOAX.mjs";
7
+ } from "./chunk-Y3N5BFRJ.mjs";
8
8
 
9
9
  // src/build/tailwind.ts
10
10
  import path from "path";
@@ -0,0 +1,358 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }// src/server-fn-transform.ts
2
+ var SERVER_FUNCTION_FACTORY_IMPORT_RE = /\bimport\s+(?:type\s+)?(?:[A-Za-z_$][\w$]*\s*,\s*)?(\{[^}]*\})\s+from\s*["']@farm.js\/core(?:\/(?:server-fn|server-query))?["']\s*;?/g;
3
+ var EXPORT_SERVER_FUNCTION_FACTORY_RE = /\bexport\s+(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s*=\s*([A-Za-z_$][\w$]*)\s*(?:<[^<>]*(?:<[^<>]*>[^<>]*)*>)?\s*\(/g;
4
+ var EXPORT_DEFAULT_SERVER_FUNCTION_FACTORY_RE = /\bexport\s+default\s+([A-Za-z_$][\w$]*)\s*(?:<[^<>]*(?:<[^<>]*>[^<>]*)*>)?\s*\(/g;
5
+ var SERVER_FUNCTION_DECLARATION_RE = /(?<![.\w$])([A-Za-z_$][\w$]*)\s*=\s*([A-Za-z_$][\w$]*)\s*(?:<[^<>]*(?:<[^<>]*>[^<>]*)*>)?\s*\(/g;
6
+ var LOCAL_EXPORT_CLAUSE_RE = /\bexport\s*\{([^}]*)\}/g;
7
+ var EXPORT_DEFAULT_ALIAS_RE = /\bexport\s+default\s+([A-Za-z_$][\w$]*)\s*(?:;|(?=[\r\n])|$)/g;
8
+ var EXPORT_BINDING_ALIAS_RE = /\bexport\s+(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s*=\s*([A-Za-z_$][\w$]*)\s*(?:;|(?=[,\r\n])|$)/g;
9
+ var MODULE_EXT_RE = /\.[cm]?[jt]sx?$/;
10
+ var DECLARATION_RE = /(^|\n)\s*["']([^"']+)["']\s*;?/g;
11
+ var FARM_SERVER_FN_BOUNDARY_QUERY = "?farm-server-fns";
12
+ function transformFarmServerFns(code, id, options = {}) {
13
+ const analysis = analyzeServerFnModule(code, id);
14
+ if (!analysis) return null;
15
+ const { replacements } = analysis;
16
+ const exports = replacements.map((replacement) => replacement.exportName);
17
+ if (hasModuleDirective(code, "use server")) {
18
+ return { code: applyReplacements(code, replacements, "wrapper"), exports };
19
+ }
20
+ const boundaryId = JSON.stringify(serverFnBoundaryId(id));
21
+ if (options.environment !== void 0 && options.environment !== "rsc") {
22
+ return {
23
+ code: `export { ${exports.join(", ")} } from ${boundaryId};
24
+ `,
25
+ exports
26
+ };
27
+ }
28
+ const imports = replacements.map(
29
+ (replacement) => replacement.exportName === "default" ? "default as $$farm_server_fn_boundary_default" : replacement.exportName
30
+ );
31
+ const reExports = replacements.map(
32
+ (replacement) => replacement.exportName === "default" ? "$$farm_server_fn_boundary_default as default" : replacement.exportName
33
+ );
34
+ const privateNames = replacements.map((replacement) => replacement.privateName);
35
+ return {
36
+ code: applyReplacements(code, replacements, "private") + `
37
+ import { ${imports.join(", ")} } from ${boundaryId};
38
+ export { ${[...reExports, ...privateNames].join(", ")} };
39
+ `,
40
+ exports
41
+ };
42
+ }
43
+ function createFarmServerFnBoundaryModule(code, id) {
44
+ if (hasModuleDirective(code, "use server")) return null;
45
+ const analysis = analyzeServerFnModule(code, id);
46
+ if (!analysis) return null;
47
+ const sourceId = JSON.stringify(id.split("?", 1)[0].replace(/\\/g, "/"));
48
+ const privateNames = analysis.replacements.map((replacement) => replacement.privateName);
49
+ let output = `"use server";
50
+ import { ${privateNames.join(", ")} } from ${sourceId};
51
+ `;
52
+ for (const replacement of analysis.replacements) {
53
+ const declaration = replacement.exportName === "default" ? "export default async function" : "export async function";
54
+ output += `${declaration} ${replacement.wrapperName}(input) {
55
+ return ${replacement.privateName}(input);
56
+ }
57
+ ${copyServerFunctionDescriptor(replacement.wrapperName, replacement.privateName, true)}
58
+ `;
59
+ }
60
+ return output;
61
+ }
62
+ function isFarmServerFnBoundaryId(id) {
63
+ return /[?&]farm-server-fns(?:&|$)/.test(id);
64
+ }
65
+ function serverFnBoundaryId(id) {
66
+ return `${id.split("?", 1)[0].replace(/\\/g, "/")}${FARM_SERVER_FN_BOUNDARY_QUERY}`;
67
+ }
68
+ function applyReplacements(code, replacements, mode) {
69
+ let output = code;
70
+ for (const replacement of [...replacements].sort((a, b) => b.start - a.start)) {
71
+ const declaration = `const ${replacement.privateName} = ${replacement.callExpression};
72
+ `;
73
+ const wrapper = mode === "private" ? "" : `${replacement.exportName === "default" ? "export default async function" : "export async function"} ${replacement.wrapperName}(input) {
74
+ return ${replacement.privateName}(input);
75
+ }
76
+ ${copyServerFunctionDescriptor(replacement.wrapperName, replacement.privateName, false)}`;
77
+ output = output.slice(0, replacement.start) + declaration + wrapper + output.slice(replacement.end);
78
+ }
79
+ return output;
80
+ }
81
+ function analyzeServerFnModule(code, id) {
82
+ if (!isTransformableModule(id) || !code.includes("createServerFn") && !code.includes("createServerQuery")) {
83
+ return null;
84
+ }
85
+ const factoryNames = findServerFunctionFactoryImportNames(code);
86
+ if (factoryNames.size === 0) return null;
87
+ const reExport = findServerFnReExport(code, factoryNames);
88
+ if (reExport) {
89
+ const factoryName = reExport.factory === "fn" ? "createServerFn" : "createServerQuery";
90
+ const escape = reExport.form === "clause" ? "with an export clause" : reExport.form === "default" ? "as the default export" : "through another exported binding";
91
+ const inlineForm = reExport.form === "default" ? `export default ${factoryName}(...)` : `export const ${reExport.exportName} = ${factoryName}(...)`;
92
+ throw new Error(
93
+ `Server function "${reExport.localName}" cannot be re-exported ${escape}. Export it inline instead: ${inlineForm}.`
94
+ );
95
+ }
96
+ const replacements = findServerFnExportReplacements(code, factoryNames);
97
+ if (replacements.length === 0) return null;
98
+ if (hasModuleDirective(code, "use client")) {
99
+ throw new Error(
100
+ "createServerFn and createServerQuery exports must live in a server module. Move them out of the 'use client' file."
101
+ );
102
+ }
103
+ return { replacements };
104
+ }
105
+ function isTransformableModule(id) {
106
+ const cleanId = id.split("?", 1)[0];
107
+ return MODULE_EXT_RE.test(cleanId) && !/\.d\.[cm]?ts$/.test(cleanId);
108
+ }
109
+ function findServerFunctionFactoryImportNames(code) {
110
+ const names = /* @__PURE__ */ new Map();
111
+ for (const match of code.matchAll(SERVER_FUNCTION_FACTORY_IMPORT_RE)) {
112
+ const importClause = _nullishCoalesce(match[1], () => ( ""));
113
+ const namedStart = importClause.indexOf("{");
114
+ const namedEnd = importClause.lastIndexOf("}");
115
+ if (namedStart === -1 || namedEnd === -1 || namedEnd <= namedStart) continue;
116
+ const namedImports = importClause.slice(namedStart + 1, namedEnd).split(",");
117
+ for (const specifier of namedImports) {
118
+ const normalized = specifier.trim().replace(/^type\s+/, "");
119
+ const specifierMatch = normalized.match(
120
+ /^(createServerFn|createServerQuery)(?:\s+as\s+([A-Za-z_$][\w$]*))?$/
121
+ );
122
+ if (specifierMatch) {
123
+ const factory = specifierMatch[1];
124
+ names.set(_nullishCoalesce(specifierMatch[2], () => ( factory)), factory === "createServerFn" ? "fn" : "query");
125
+ }
126
+ }
127
+ }
128
+ return names;
129
+ }
130
+ function findServerFnReExport(code, factoryNames) {
131
+ const scannable = stripCommentsAndStrings(code);
132
+ const declarations = /* @__PURE__ */ new Map();
133
+ for (const match of scannable.matchAll(SERVER_FUNCTION_DECLARATION_RE)) {
134
+ const localName = match[1];
135
+ const factoryName = match[2];
136
+ const factory = factoryName ? factoryNames.get(factoryName) : void 0;
137
+ if (localName && factory) declarations.set(localName, factory);
138
+ }
139
+ if (declarations.size === 0) return null;
140
+ for (const match of scannable.matchAll(LOCAL_EXPORT_CLAUSE_RE)) {
141
+ const clause = _nullishCoalesce(match[1], () => ( ""));
142
+ const clauseEnd = (_nullishCoalesce(match.index, () => ( 0))) + match[0].length;
143
+ if (scannable.slice(clauseEnd).trimStart().startsWith("from")) continue;
144
+ for (const specifier of clause.split(",")) {
145
+ const parts = specifier.trim().split(/\s+as\s+/);
146
+ const localName = _optionalChain([parts, 'access', _ => _[0], 'optionalAccess', _2 => _2.trim, 'call', _3 => _3()]);
147
+ if (!localName || !declarations.has(localName)) continue;
148
+ return {
149
+ localName,
150
+ exportName: _optionalChain([parts, 'access', _4 => _4[1], 'optionalAccess', _5 => _5.trim, 'call', _6 => _6()]) || localName,
151
+ factory: declarations.get(localName),
152
+ form: "clause"
153
+ };
154
+ }
155
+ }
156
+ for (const match of scannable.matchAll(EXPORT_DEFAULT_ALIAS_RE)) {
157
+ const localName = match[1];
158
+ if (!localName || !declarations.has(localName)) continue;
159
+ return {
160
+ localName,
161
+ exportName: "default",
162
+ factory: declarations.get(localName),
163
+ form: "default"
164
+ };
165
+ }
166
+ for (const match of scannable.matchAll(EXPORT_BINDING_ALIAS_RE)) {
167
+ const exportName = match[1];
168
+ const localName = match[2];
169
+ if (!exportName || !localName || !declarations.has(localName)) continue;
170
+ return {
171
+ localName,
172
+ exportName,
173
+ factory: declarations.get(localName),
174
+ form: "binding"
175
+ };
176
+ }
177
+ return null;
178
+ }
179
+ function stripCommentsAndStrings(code) {
180
+ const output = code.split("");
181
+ let quote = null;
182
+ let lineComment = false;
183
+ let blockComment = false;
184
+ let escaped = false;
185
+ for (let index = 0; index < code.length; index++) {
186
+ const char = code[index];
187
+ const next = code[index + 1];
188
+ if (lineComment) {
189
+ if (char === "\n" || char === "\r") lineComment = false;
190
+ else output[index] = " ";
191
+ continue;
192
+ }
193
+ if (blockComment) {
194
+ if (char === "*" && next === "/") {
195
+ blockComment = false;
196
+ output[index] = " ";
197
+ output[index + 1] = " ";
198
+ index++;
199
+ } else if (char !== "\n") {
200
+ output[index] = " ";
201
+ }
202
+ continue;
203
+ }
204
+ if (quote) {
205
+ if (escaped) {
206
+ escaped = false;
207
+ output[index] = " ";
208
+ continue;
209
+ }
210
+ if (char === "\\") {
211
+ escaped = true;
212
+ output[index] = " ";
213
+ continue;
214
+ }
215
+ if (char === quote) {
216
+ quote = null;
217
+ continue;
218
+ }
219
+ if (char !== "\n") output[index] = " ";
220
+ continue;
221
+ }
222
+ if (char === "/" && next === "/") {
223
+ lineComment = true;
224
+ output[index] = " ";
225
+ continue;
226
+ }
227
+ if (char === "/" && next === "*") {
228
+ blockComment = true;
229
+ output[index] = " ";
230
+ continue;
231
+ }
232
+ if (char === "'" || char === '"' || char === "`") {
233
+ quote = char;
234
+ }
235
+ }
236
+ return output.join("");
237
+ }
238
+ function findServerFnExportReplacements(code, factoryNames) {
239
+ const replacements = [];
240
+ for (const match of code.matchAll(EXPORT_SERVER_FUNCTION_FACTORY_RE)) {
241
+ const exportName = match[1];
242
+ const calleeName = match[2];
243
+ const factory = calleeName ? factoryNames.get(calleeName) : void 0;
244
+ if (!exportName || !calleeName || !factory) continue;
245
+ const openParenIndex = (_nullishCoalesce(match.index, () => ( 0))) + match[0].length - 1;
246
+ const callEnd = findMatchingParen(code, openParenIndex);
247
+ if (callEnd === -1) continue;
248
+ let declarationEnd = callEnd + 1;
249
+ while (/\s/.test(_nullishCoalesce(code[declarationEnd], () => ( "")))) declarationEnd++;
250
+ if (code[declarationEnd] === ";") declarationEnd++;
251
+ const calleeIndex = code.indexOf(calleeName, match.index);
252
+ replacements.push({
253
+ start: _nullishCoalesce(match.index, () => ( 0)),
254
+ end: declarationEnd,
255
+ exportName,
256
+ privateName: `$$farm_server_${factory}_${exportName}`,
257
+ wrapperName: exportName,
258
+ callExpression: code.slice(calleeIndex, callEnd + 1)
259
+ });
260
+ }
261
+ for (const match of code.matchAll(EXPORT_DEFAULT_SERVER_FUNCTION_FACTORY_RE)) {
262
+ const calleeName = match[1];
263
+ const factory = calleeName ? factoryNames.get(calleeName) : void 0;
264
+ if (!calleeName || !factory) continue;
265
+ const openParenIndex = (_nullishCoalesce(match.index, () => ( 0))) + match[0].length - 1;
266
+ const callEnd = findMatchingParen(code, openParenIndex);
267
+ if (callEnd === -1) continue;
268
+ let declarationEnd = callEnd + 1;
269
+ while (/\s/.test(_nullishCoalesce(code[declarationEnd], () => ( "")))) declarationEnd++;
270
+ if (code[declarationEnd] === ";") declarationEnd++;
271
+ const calleeIndex = code.indexOf(calleeName, match.index);
272
+ const privateName = `$$farm_server_${factory}_default`;
273
+ replacements.push({
274
+ start: _nullishCoalesce(match.index, () => ( 0)),
275
+ end: declarationEnd,
276
+ exportName: "default",
277
+ privateName,
278
+ wrapperName: `${privateName}_export`,
279
+ callExpression: code.slice(calleeIndex, callEnd + 1)
280
+ });
281
+ }
282
+ return replacements;
283
+ }
284
+ function copyServerFunctionDescriptor(target, source, lazy) {
285
+ const key = 'Symbol.for("farm.server-function.descriptor")';
286
+ return lazy ? `Object.defineProperty(${target}, ${key}, { get: () => ${source}[${key}] });` : `Object.defineProperty(${target}, ${key}, { value: ${source}[${key}] });`;
287
+ }
288
+ function hasModuleDirective(code, directive) {
289
+ for (const match of code.matchAll(DECLARATION_RE)) {
290
+ const value = match[2];
291
+ if (value === directive) return true;
292
+ if (value !== "use strict" && value !== "use client" && value !== "use server") return false;
293
+ }
294
+ return false;
295
+ }
296
+ function findMatchingParen(code, openParenIndex) {
297
+ let depth = 0;
298
+ let quote = null;
299
+ let lineComment = false;
300
+ let blockComment = false;
301
+ let escaped = false;
302
+ for (let index = openParenIndex; index < code.length; index++) {
303
+ const char = code[index];
304
+ const next = code[index + 1];
305
+ if (lineComment) {
306
+ if (char === "\n" || char === "\r") lineComment = false;
307
+ continue;
308
+ }
309
+ if (blockComment) {
310
+ if (char === "*" && next === "/") {
311
+ blockComment = false;
312
+ index++;
313
+ }
314
+ continue;
315
+ }
316
+ if (quote) {
317
+ if (escaped) {
318
+ escaped = false;
319
+ continue;
320
+ }
321
+ if (char === "\\") {
322
+ escaped = true;
323
+ continue;
324
+ }
325
+ if (char === quote) {
326
+ quote = null;
327
+ }
328
+ continue;
329
+ }
330
+ if (char === "/" && next === "/") {
331
+ lineComment = true;
332
+ index++;
333
+ continue;
334
+ }
335
+ if (char === "/" && next === "*") {
336
+ blockComment = true;
337
+ index++;
338
+ continue;
339
+ }
340
+ if (char === "'" || char === '"' || char === "`") {
341
+ quote = char;
342
+ continue;
343
+ }
344
+ if (char === "(") depth++;
345
+ if (char === ")") {
346
+ depth--;
347
+ if (depth === 0) return index;
348
+ }
349
+ }
350
+ return -1;
351
+ }
352
+
353
+
354
+
355
+
356
+
357
+
358
+ exports.FARM_SERVER_FN_BOUNDARY_QUERY = FARM_SERVER_FN_BOUNDARY_QUERY; exports.transformFarmServerFns = transformFarmServerFns; exports.createFarmServerFnBoundaryModule = createFarmServerFnBoundaryModule; exports.isFarmServerFnBoundaryId = isFarmServerFnBoundaryId;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  MiddlewareManager
3
- } from "./chunk-EA5PMJDU.mjs";
3
+ } from "./chunk-WSY2JD7O.mjs";
4
4
  import {
5
5
  matchesMiddlewarePredicate
6
6
  } from "./chunk-EDPENAVO.mjs";