@farm.js/core 0.1.66 → 0.1.68

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 (494) hide show
  1. package/dist/{agent-mcp-handler-QLFDDTYN.mjs → agent-mcp-handler-AZ7QW4UP.mjs} +5 -5
  2. package/dist/{agent-mcp-handler-OXT73ZBY.cjs → agent-mcp-handler-FER4MQDF.cjs} +6 -6
  3. package/dist/{agent-mcp.d-QD2WZ9BS.d.ts → agent-mcp.d-Uh5xr7aX.d.ts} +1 -1
  4. package/dist/{agent-mcp.d-CO_ABmNK.d.mts → agent-mcp.d-wkVPK1GA.d.mts} +1 -1
  5. package/dist/agent-runtime.cjs +6 -5
  6. package/dist/agent-runtime.d.mts +10 -8
  7. package/dist/agent-runtime.d.ts +10 -8
  8. package/dist/agent-runtime.mjs +5 -4
  9. package/dist/{analyzer-4UFP4HVP.mjs → analyzer-CQDU7E3Y.mjs} +2 -2
  10. package/dist/analyzer-PPAHM4AW.cjs +16 -0
  11. package/dist/api/client.cjs +12 -2
  12. package/dist/api/client.d.mts +4 -4
  13. package/dist/api/client.d.ts +4 -4
  14. package/dist/api/client.mjs +12 -2
  15. package/dist/api/client.native.cjs +12 -2
  16. package/dist/api/client.native.d.mts +5 -5
  17. package/dist/api/client.native.d.ts +5 -5
  18. package/dist/api/client.native.mjs +12 -2
  19. package/dist/api/node.cjs +223 -0
  20. package/dist/api/node.d.mts +61 -0
  21. package/dist/api/node.d.ts +61 -0
  22. package/dist/api/node.mjs +223 -0
  23. package/dist/api/route-manager.cjs +11 -11
  24. package/dist/api/route-manager.d.mts +14 -11
  25. package/dist/api/route-manager.d.ts +14 -11
  26. package/dist/api/route-manager.mjs +10 -10
  27. package/dist/api/runtime.cjs +11 -7
  28. package/dist/api/runtime.d.mts +11 -9
  29. package/dist/api/runtime.d.ts +11 -9
  30. package/dist/api/runtime.mjs +10 -6
  31. package/dist/{api-client.d-BNLXNCXJ.d.mts → api-client.d-Bp35zMqR.d.mts} +1 -1
  32. package/dist/{api-client.d-ddQBNGtu.d.ts → api-client.d-CFI_xL0V.d.ts} +1 -1
  33. package/dist/api.cjs +17 -13
  34. package/dist/api.d.mts +15 -12
  35. package/dist/api.d.ts +15 -12
  36. package/dist/api.mjs +16 -12
  37. package/dist/{app-manifest.d-DDmNkYQQ.d.ts → app-manifest.d-BT5i2F-o.d.ts} +1 -1
  38. package/dist/{app-manifest.d-BpKxiU_E.d.mts → app-manifest.d-Dd4q5CFx.d.mts} +1 -1
  39. package/dist/app-markdown.cjs +5 -5
  40. package/dist/app-markdown.d.mts +15 -15
  41. package/dist/app-markdown.d.ts +15 -15
  42. package/dist/app-markdown.mjs +4 -4
  43. package/dist/{app.d-x68Cwr0_.d.ts → app.d-BVOpL_f2.d.ts} +52 -11
  44. package/dist/{app.d-kuoVWhWM.d.mts → app.d-BhiDXex_.d.mts} +52 -11
  45. package/dist/{chunk-RY4ABNPE.cjs → chunk-225APHKC.cjs} +3 -3
  46. package/dist/{chunk-JGAE5XPL.cjs → chunk-23VJEGKC.cjs} +4 -2
  47. package/dist/{chunk-5C7XMKQ4.cjs → chunk-2AFW7673.cjs} +6 -1
  48. package/dist/{chunk-SYW346ZN.cjs → chunk-2LHZD3OP.cjs} +1 -21
  49. package/dist/{chunk-ZZI56IUY.mjs → chunk-2ZOYOYEE.mjs} +13 -13
  50. package/dist/{chunk-7XGWBPQQ.cjs → chunk-3EEINK7G.cjs} +24 -10
  51. package/dist/{chunk-BRWIVOV4.cjs → chunk-3GNHJ3RN.cjs} +10 -8
  52. package/dist/{chunk-HCGWDRZO.mjs → chunk-3Y52TWYU.mjs} +18 -7
  53. package/dist/{chunk-CBOEJ5Z4.cjs → chunk-437QZIC2.cjs} +133 -46
  54. package/dist/{chunk-O6L3YYPM.cjs → chunk-4E57QHPW.cjs} +8 -16
  55. package/dist/{chunk-WKPBIT5Q.cjs → chunk-4HGLJOXZ.cjs} +6 -6
  56. package/dist/{chunk-CJNAUEVC.mjs → chunk-4QENVMG7.mjs} +1 -1
  57. package/dist/{chunk-EMNKZGF4.mjs → chunk-4UAQB5LB.mjs} +556 -462
  58. package/dist/{chunk-BQWBHWEW.mjs → chunk-4ZXKYCYK.mjs} +1 -1
  59. package/dist/{chunk-N35YPV4N.mjs → chunk-57QAQU4F.mjs} +9 -7
  60. package/dist/{chunk-ZEXE4TGY.mjs → chunk-5FBZJJGA.mjs} +247 -110
  61. package/dist/{chunk-4OSOLDPL.cjs → chunk-5JKDFRTK.cjs} +2 -2
  62. package/dist/{chunk-OLIGNTWU.cjs → chunk-5NFQ6AZI.cjs} +7 -7
  63. package/dist/{chunk-6HRAK7I5.mjs → chunk-5OFNUETM.mjs} +8 -2
  64. package/dist/{chunk-RD623KW4.cjs → chunk-67MZTLTF.cjs} +21 -3
  65. package/dist/chunk-6I4BFRE7.cjs +51 -0
  66. package/dist/{chunk-UBMHQVWN.mjs → chunk-6OFOIMNS.mjs} +1 -1
  67. package/dist/{chunk-K5EW7GUU.mjs → chunk-7BIW7VCW.mjs} +13 -5
  68. package/dist/{chunk-CHYTADNK.cjs → chunk-7LK5CTUM.cjs} +70 -53
  69. package/dist/{chunk-HPP2II4Z.mjs → chunk-7PJARAQQ.mjs} +1 -1
  70. package/dist/{chunk-LEJDW34D.cjs → chunk-7PPLTD3P.cjs} +3 -3
  71. package/dist/{chunk-BYRZ5VTH.mjs → chunk-A3T445WK.mjs} +47 -34
  72. package/dist/{chunk-TGULJSHD.mjs → chunk-AJNBTOVQ.mjs} +20 -9
  73. package/dist/{chunk-FBEBSAVI.cjs → chunk-AKIQ54FK.cjs} +82 -63
  74. package/dist/{chunk-2NGZFOKG.mjs → chunk-AOIUYHPH.mjs} +2 -2
  75. package/dist/{chunk-NKRZLQUK.mjs → chunk-AQIO3RNL.mjs} +1 -1
  76. package/dist/chunk-AQIRXBBY.cjs +26 -0
  77. package/dist/{chunk-DQJ2CIH7.cjs → chunk-ASYOWPSR.cjs} +2 -1
  78. package/dist/chunk-AZ6IW6SF.mjs +28 -0
  79. package/dist/{chunk-QMDU6QHN.mjs → chunk-B6RBJJ5G.mjs} +1 -1
  80. package/dist/{chunk-I32V5CZL.cjs → chunk-BDYM2TN3.cjs} +28 -17
  81. package/dist/{chunk-JLDNXURZ.cjs → chunk-BZWTBELF.cjs} +32 -32
  82. package/dist/{chunk-ITV4QQL2.cjs → chunk-C6CUUBY5.cjs} +14 -3
  83. package/dist/{chunk-QGJ4FI2G.mjs → chunk-C6HGUTXB.mjs} +113 -29
  84. package/dist/{chunk-YN6BHOYY.cjs → chunk-CL52PD6D.cjs} +10 -3
  85. package/dist/{chunk-VQJHT2ND.mjs → chunk-CRVSYDHV.mjs} +2 -2
  86. package/dist/{chunk-XURDCXNH.cjs → chunk-CSLHNBPS.cjs} +6 -6
  87. package/dist/{chunk-XQSYOVCW.cjs → chunk-DBYNZIIQ.cjs} +13 -5
  88. package/dist/{chunk-AZUUKA66.mjs → chunk-DIXFKAPM.mjs} +1251 -389
  89. package/dist/{chunk-QTD6EMN2.mjs → chunk-DQ2DI3Y7.mjs} +11 -4
  90. package/dist/{chunk-NHQM2Q4I.cjs → chunk-DWLNLU55.cjs} +2 -2
  91. package/dist/chunk-DXZ57EPE.mjs +375 -0
  92. package/dist/{chunk-SA7MLSP4.mjs → chunk-E3HDJCWF.mjs} +3 -3
  93. package/dist/{chunk-52Y3C3HG.mjs → chunk-E7VF3LQ5.mjs} +3 -2
  94. package/dist/{chunk-752XUZIM.cjs → chunk-EGIY4A7V.cjs} +6 -6
  95. package/dist/chunk-EIVGPQN5.mjs +51 -0
  96. package/dist/{chunk-KPAJWD3N.mjs → chunk-EYPSKXO4.mjs} +1 -1
  97. package/dist/{chunk-E4UDLFWR.cjs → chunk-F36LS2C7.cjs} +796 -702
  98. package/dist/{chunk-MPIGW42F.mjs → chunk-F6CMGWAL.mjs} +1 -1
  99. package/dist/{chunk-GL7N5UHF.cjs → chunk-FJMC24KG.cjs} +21 -10
  100. package/dist/{chunk-QISW423S.cjs → chunk-FPBOAG6N.cjs} +2 -2
  101. package/dist/{chunk-3CCAICF7.cjs → chunk-FSODPZRT.cjs} +5 -5
  102. package/dist/{chunk-2C5L5RPM.cjs → chunk-FT6KJHS3.cjs} +71 -38
  103. package/dist/{chunk-WMTBBQHY.cjs → chunk-FVYBEMOD.cjs} +288 -151
  104. package/dist/{chunk-BM2LH2JM.mjs → chunk-G7NBPP7H.mjs} +14 -13
  105. package/dist/{chunk-ES2LD2YD.mjs → chunk-GCRT6GJG.mjs} +18 -0
  106. package/dist/{chunk-5OJVKXFV.cjs → chunk-GDM3ZD2O.cjs} +10 -8
  107. package/dist/{chunk-25T5VXOE.mjs → chunk-GFPS7MNE.mjs} +106 -19
  108. package/dist/{chunk-EMDGXYUD.mjs → chunk-GJ7QVFAG.mjs} +16 -7
  109. package/dist/{chunk-TGSEVBPO.mjs → chunk-GJEC5S4V.mjs} +11 -0
  110. package/dist/{chunk-HNAISJFD.cjs → chunk-HDPT6OYE.cjs} +9 -3
  111. package/dist/{chunk-RVGSVQWT.mjs → chunk-HEJM46HQ.mjs} +21 -7
  112. package/dist/chunk-HHLEYA4B.cjs +17 -0
  113. package/dist/{chunk-ZNH6NR3H.cjs → chunk-HJZZSBVK.cjs} +2 -2
  114. package/dist/{chunk-E552H232.cjs → chunk-I7J5RLGO.cjs} +16 -2
  115. package/dist/chunk-ICFPTHXM.mjs +97 -0
  116. package/dist/{chunk-K7OZAVOI.mjs → chunk-IFR74W6S.mjs} +46 -13
  117. package/dist/{chunk-MPJEIHW2.cjs → chunk-IGDYL2IA.cjs} +2 -2
  118. package/dist/{chunk-5A77OEIG.cjs → chunk-IHTDLCDJ.cjs} +5 -5
  119. package/dist/{chunk-OYZXVBZP.cjs → chunk-IUKBPBM7.cjs} +2 -1
  120. package/dist/chunk-J6TZRYCO.cjs +22 -0
  121. package/dist/{chunk-E4RDMG3K.mjs → chunk-JL2YW5KX.mjs} +5 -4
  122. package/dist/chunk-JSOCDYER.cjs +375 -0
  123. package/dist/{chunk-UPYIFH2H.cjs → chunk-JWLRBDDC.cjs} +2 -2
  124. package/dist/{chunk-OLGQZRW6.mjs → chunk-JZBU7V4D.mjs} +37 -17
  125. package/dist/{chunk-ONG4RDW3.mjs → chunk-JZGL2PIH.mjs} +13 -3
  126. package/dist/chunk-K63OWRY2.mjs +22 -0
  127. package/dist/{chunk-TUPKMMXT.mjs → chunk-K6HIIWUB.mjs} +1 -1
  128. package/dist/{chunk-MESQF2JC.mjs → chunk-K6SXMVXO.mjs} +2 -2
  129. package/dist/{chunk-L2JG337G.cjs → chunk-K6VFYFOY.cjs} +33 -31
  130. package/dist/{chunk-TKK5QHKZ.mjs → chunk-KDO6T6OB.mjs} +3 -3
  131. package/dist/{chunk-EZ34EHQP.mjs → chunk-KI3MU7B5.mjs} +1 -1
  132. package/dist/{chunk-GHNW564E.mjs → chunk-KSZK34HU.mjs} +30 -10
  133. package/dist/{chunk-IT6WRNGB.cjs → chunk-KWCZKJYU.cjs} +1541 -679
  134. package/dist/{chunk-DVKH2RVN.cjs → chunk-LDEXTX4I.cjs} +70 -57
  135. package/dist/{chunk-ECKQFEX2.mjs → chunk-LENKRGBV.mjs} +8 -6
  136. package/dist/{chunk-XBSKPLHF.cjs → chunk-LR4KP3I7.cjs} +2 -2
  137. package/dist/{chunk-HEPJIKKQ.cjs → chunk-MCSRMEQV.cjs} +2 -2
  138. package/dist/{chunk-DQF3QLOH.mjs → chunk-ME7RVELR.mjs} +3 -2
  139. package/dist/{chunk-VFXE6NWR.mjs → chunk-MGKWYPE3.mjs} +2 -1
  140. package/dist/{chunk-TZVUF5JJ.mjs → chunk-MGZVDX4R.mjs} +5 -5
  141. package/dist/{chunk-MGKW5XZE.cjs → chunk-MMDKYJ5V.cjs} +7 -7
  142. package/dist/{chunk-SK7QSNWE.mjs → chunk-MNJDNTGO.mjs} +1 -1
  143. package/dist/{chunk-5Y2P454O.cjs → chunk-MTBDJ326.cjs} +6 -5
  144. package/dist/{chunk-FIR62CR3.mjs → chunk-MV7NWU23.mjs} +1 -1
  145. package/dist/{chunk-7ONGIFYX.cjs → chunk-MZ4CRSY7.cjs} +481 -171
  146. package/dist/{chunk-O4F3JUST.mjs → chunk-NDDRTFN4.mjs} +4 -0
  147. package/dist/{chunk-4IHMHFQB.cjs → chunk-NG2EZ6QS.cjs} +28 -1
  148. package/dist/{chunk-XBSLKXBL.mjs → chunk-NT4W4H52.mjs} +52 -35
  149. package/dist/{chunk-UAQD67HM.mjs → chunk-NVOMQLI2.mjs} +16 -2
  150. package/dist/{chunk-R62SF5R4.mjs → chunk-OB45EAQL.mjs} +6 -1
  151. package/dist/{chunk-V56632LA.cjs → chunk-OCNV4CI2.cjs} +39 -6
  152. package/dist/{chunk-SYXPWJ7N.cjs → chunk-OFBLGH6V.cjs} +17 -18
  153. package/dist/{chunk-VQ4NWOWO.mjs → chunk-OGVTUGMU.mjs} +5 -13
  154. package/dist/{chunk-3UZVPO72.mjs → chunk-OIOPQ25L.mjs} +6 -7
  155. package/dist/{chunk-2XGBJSDV.cjs → chunk-OO7DYIJD.cjs} +73 -24
  156. package/dist/{chunk-27FPUFWR.mjs → chunk-P2NBQ5JI.mjs} +1 -1
  157. package/dist/{chunk-HZPKJRYA.cjs → chunk-PDFFYZAT.cjs} +2 -2
  158. package/dist/{chunk-GSVJ3IIF.cjs → chunk-PHCJJJZV.cjs} +2 -2
  159. package/dist/{chunk-EVMXPJCB.mjs → chunk-PKMUQ7LM.mjs} +2 -1
  160. package/dist/{chunk-OAJOQU5J.mjs → chunk-PLJKJJ2H.mjs} +82 -63
  161. package/dist/{chunk-72KCTHLV.cjs → chunk-PRL7FXG4.cjs} +113 -29
  162. package/dist/{chunk-6XQSPIN6.cjs → chunk-PWKAX5MS.cjs} +13 -3
  163. package/dist/{chunk-4ZJ5C7UJ.cjs → chunk-QIXEU2WV.cjs} +19 -10
  164. package/dist/{chunk-FJWN7RV4.cjs → chunk-QO43L7Z4.cjs} +38 -8
  165. package/dist/{chunk-X4K7TYN6.cjs → chunk-QOGIZKSO.cjs} +26 -25
  166. package/dist/{chunk-CNNBFGL5.cjs → chunk-QSUYB3RH.cjs} +14 -14
  167. package/dist/chunk-QYNZ3CTI.mjs +17 -0
  168. package/dist/{chunk-X3XUZWRB.mjs → chunk-R2ZHU37O.mjs} +36 -3
  169. package/dist/{chunk-ZIHWAN55.cjs → chunk-RE5E2G5S.cjs} +1 -1
  170. package/dist/{chunk-O75GQVUK.mjs → chunk-RLH5AH2M.mjs} +1 -1
  171. package/dist/chunk-RWR7SMD7.cjs +50 -0
  172. package/dist/{chunk-7PTISZSQ.cjs → chunk-S7MWSFFP.cjs} +4 -0
  173. package/dist/chunk-SD6JGJOM.mjs +50 -0
  174. package/dist/{chunk-7H4SVNC4.cjs → chunk-SPP3EZTJ.cjs} +46 -26
  175. package/dist/{chunk-BIF5MLTH.cjs → chunk-SQ6IWJ3H.cjs} +1 -1
  176. package/dist/{chunk-WVYRLP5E.mjs → chunk-T5XFZQCL.mjs} +1 -1
  177. package/dist/{chunk-WAY6LOQH.mjs → chunk-TEJ67GD2.mjs} +1 -1
  178. package/dist/{chunk-OP7LHY4Y.cjs → chunk-TNK2TVRS.cjs} +2005 -800
  179. package/dist/{chunk-IFTGERT3.mjs → chunk-TTXIITYA.mjs} +49 -0
  180. package/dist/{chunk-ZFWYCVKS.mjs → chunk-TY5KCYDE.mjs} +22 -4
  181. package/dist/{chunk-WYAXRIYP.cjs → chunk-UKZ6AWKZ.cjs} +10 -9
  182. package/dist/{chunk-UJ3R2AH2.cjs → chunk-UPOYKX4S.cjs} +5 -5
  183. package/dist/{chunk-VBCQ5WOI.cjs → chunk-URN7VFO7.cjs} +105 -16
  184. package/dist/{chunk-2DLGV2ZG.mjs → chunk-UTUS6JUH.mjs} +1 -21
  185. package/dist/{chunk-435QJNC2.mjs → chunk-VFNAK6A5.mjs} +4 -4
  186. package/dist/{chunk-WFWFECDW.mjs → chunk-VRGY3X2I.mjs} +100 -11
  187. package/dist/{chunk-LQNW3ABP.cjs → chunk-VX2HZGC7.cjs} +14 -14
  188. package/dist/chunk-W44X6IC2.cjs +97 -0
  189. package/dist/{chunk-A2MN5PQJ.mjs → chunk-WMLSZAKN.mjs} +9 -9
  190. package/dist/{chunk-672ISQIG.mjs → chunk-WPB67LE5.mjs} +379 -69
  191. package/dist/{chunk-3EEET2Q5.cjs → chunk-WUTFJOV7.cjs} +32 -12
  192. package/dist/chunk-WVQNXXNE.cjs +28 -0
  193. package/dist/{chunk-Y5TOT5F6.cjs → chunk-X3MHKLCO.cjs} +5 -5
  194. package/dist/{chunk-W2ZXMMHA.mjs → chunk-XCAQTCGK.mjs} +1 -1
  195. package/dist/{chunk-Z7P2BTZ3.cjs → chunk-XGTFLG73.cjs} +30 -12
  196. package/dist/{chunk-XCXHQBMM.mjs → chunk-Y2LU4LE5.mjs} +1 -1
  197. package/dist/{chunk-5J45H65F.mjs → chunk-Y5LEPEVH.mjs} +1 -1
  198. package/dist/{chunk-D4MRNBVF.cjs → chunk-Y6KHPJDB.cjs} +2 -2
  199. package/dist/{chunk-BT4SEFLC.cjs → chunk-YAEN3L2F.cjs} +3 -2
  200. package/dist/chunk-YFTGIHNC.mjs +26 -0
  201. package/dist/{chunk-KL7SHLQB.mjs → chunk-YGJ5P3TJ.mjs} +31 -1
  202. package/dist/{chunk-752IHQTD.cjs → chunk-YTNBCXCW.cjs} +12 -12
  203. package/dist/{chunk-RFKTJTWZ.mjs → chunk-YVPX5PI5.mjs} +3 -1
  204. package/dist/{chunk-4TVPYN32.cjs → chunk-Z3PW3DIR.cjs} +7 -7
  205. package/dist/{chunk-OB7VKCUZ.mjs → chunk-Z6SOXHAD.mjs} +1851 -646
  206. package/dist/{chunk-72KABRWN.mjs → chunk-ZJGFAW5U.mjs} +5 -3
  207. package/dist/{chunk-TNBJ4LZG.mjs → chunk-ZPKJPM7K.mjs} +4 -4
  208. package/dist/{chunk-5FE5YT2N.mjs → chunk-ZZGQD3LL.mjs} +28 -1
  209. package/dist/client/lifecycle.cjs +2 -2
  210. package/dist/client/lifecycle.d.mts +1 -1
  211. package/dist/client/lifecycle.d.ts +1 -1
  212. package/dist/client/lifecycle.mjs +1 -1
  213. package/dist/{client-component.d-D74pqdea.d.mts → client-component.d-BvQOxSqh.d.mts} +2 -2
  214. package/dist/{client-component.d-D8VcypQA.d.ts → client-component.d-DNVSLEPi.d.ts} +2 -2
  215. package/dist/client-plugins.cjs +2 -2
  216. package/dist/{client-plugins.d-D4-6hNx7.d.mts → client-plugins.d-CE1lVK2R.d.mts} +116 -373
  217. package/dist/{client-plugins.d-CXElzotB.d.ts → client-plugins.d-CNDqcAuf.d.ts} +116 -373
  218. package/dist/client-plugins.d.mts +10 -8
  219. package/dist/client-plugins.d.ts +10 -8
  220. package/dist/client-plugins.mjs +1 -1
  221. package/dist/client.cjs +11 -9
  222. package/dist/client.d.mts +17 -15
  223. package/dist/client.d.ts +17 -15
  224. package/dist/client.mjs +10 -8
  225. package/dist/{config.d-qt-mE8O5.d.mts → config.d-BKIhJtmr.d.mts} +7 -2
  226. package/dist/{config.d-qt-mE8O5.d.ts → config.d-BKIhJtmr.d.ts} +7 -2
  227. package/dist/config.d.mts +10 -8
  228. package/dist/config.d.ts +10 -8
  229. package/dist/cron.cjs +2 -2
  230. package/dist/cron.mjs +1 -1
  231. package/dist/deferred.cjs +2 -2
  232. package/dist/deferred.mjs +1 -1
  233. package/dist/deployment.cjs +4 -2
  234. package/dist/deployment.d.mts +15 -1
  235. package/dist/deployment.d.ts +15 -1
  236. package/dist/deployment.mjs +3 -1
  237. package/dist/desktop.d.mts +11 -9
  238. package/dist/desktop.d.ts +11 -9
  239. package/dist/{devtools-NZUVNUP3.mjs → devtools-2A2GPC7B.mjs} +33 -29
  240. package/dist/{devtools-N2JQCMXB.cjs → devtools-R27T3BRY.cjs} +38 -34
  241. package/dist/docs.cjs +28 -27
  242. package/dist/docs.d.mts +24 -10
  243. package/dist/docs.d.ts +24 -10
  244. package/dist/docs.mjs +27 -26
  245. package/dist/env-types.cjs +3 -3
  246. package/dist/env-types.mjs +2 -2
  247. package/dist/environment/vite.cjs +7 -7
  248. package/dist/environment/vite.d.mts +1 -1
  249. package/dist/environment/vite.d.ts +1 -1
  250. package/dist/environment/vite.mjs +6 -6
  251. package/dist/{generate-route-types.d-BL2pq6xC.d.ts → generate-route-types.d-B76M5R11.d.ts} +1 -1
  252. package/dist/{generate-route-types.d-BoVDU8qX.d.mts → generate-route-types.d-CaGMIaNI.d.mts} +1 -1
  253. package/dist/headers.cjs +3 -3
  254. package/dist/headers.mjs +2 -2
  255. package/dist/image/server.d.mts +1 -1
  256. package/dist/image/server.d.ts +1 -1
  257. package/dist/image/sharp.d.mts +1 -1
  258. package/dist/image/sharp.d.ts +1 -1
  259. package/dist/{image-config.d-CeDgNyX4.d.mts → image-config.d-ByhQ0TT7.d.mts} +3 -1
  260. package/dist/{image-config.d-CeDgNyX4.d.ts → image-config.d-ByhQ0TT7.d.ts} +3 -1
  261. package/dist/image.cjs +6 -6
  262. package/dist/image.d.mts +1 -1
  263. package/dist/image.d.ts +1 -1
  264. package/dist/image.mjs +1 -1
  265. package/dist/index.cjs +148 -128
  266. package/dist/{index.d-SSgYDv4D.d.mts → index.d-Bt3kl19W.d.mts} +1 -1
  267. package/dist/{index.d-A_x10zGS.d.ts → index.d-Cx_-DaKV.d.ts} +1 -1
  268. package/dist/index.d.mts +39 -87
  269. package/dist/index.d.ts +39 -87
  270. package/dist/index.mjs +224 -204
  271. package/dist/instrumentation.cjs +3 -3
  272. package/dist/instrumentation.mjs +2 -2
  273. package/dist/{integration-orm-52GPGTHO.cjs → integrations/orm.cjs} +5 -5
  274. package/dist/integrations/orm.d.mts +35 -0
  275. package/dist/integrations/orm.d.ts +35 -0
  276. package/dist/{integration-orm-CO23MSFE.mjs → integrations/orm.mjs} +5 -5
  277. package/dist/integrations.cjs +6 -5
  278. package/dist/integrations.d.mts +10 -8
  279. package/dist/integrations.d.ts +10 -8
  280. package/dist/integrations.mjs +5 -4
  281. package/dist/internal/app-markdown-runtime.cjs +4 -4
  282. package/dist/internal/app-markdown-runtime.d.mts +27 -11
  283. package/dist/internal/app-markdown-runtime.d.ts +27 -11
  284. package/dist/internal/app-markdown-runtime.mjs +3 -3
  285. package/dist/internal/build-runtime.cjs +76 -71
  286. package/dist/internal/build-runtime.d.mts +12 -10
  287. package/dist/internal/build-runtime.d.ts +12 -10
  288. package/dist/internal/build-runtime.mjs +75 -70
  289. package/dist/internal/cli-runtime.cjs +47 -46
  290. package/dist/internal/cli-runtime.mjs +46 -45
  291. package/dist/internal/client-error-overlay.cjs +6 -6
  292. package/dist/internal/client-error-overlay.mjs +2 -2
  293. package/dist/internal/client-runtime.cjs +85 -36
  294. package/dist/internal/client-runtime.d.mts +44 -13
  295. package/dist/internal/client-runtime.d.ts +44 -13
  296. package/dist/internal/client-runtime.mjs +79 -30
  297. package/dist/internal/compression-runtime.d.mts +10 -8
  298. package/dist/internal/compression-runtime.d.ts +10 -8
  299. package/dist/internal/config-runtime.cjs +27 -26
  300. package/dist/internal/config-runtime.d.mts +14 -12
  301. package/dist/internal/config-runtime.d.ts +14 -12
  302. package/dist/internal/config-runtime.mjs +26 -25
  303. package/dist/internal/docs-precompiled-runtime.cjs +16 -5
  304. package/dist/internal/docs-precompiled-runtime.d.mts +7 -0
  305. package/dist/internal/docs-precompiled-runtime.d.ts +7 -0
  306. package/dist/internal/docs-precompiled-runtime.mjs +15 -4
  307. package/dist/internal/form-actions.cjs +7 -2
  308. package/dist/internal/form-actions.d.mts +10 -3
  309. package/dist/internal/form-actions.d.ts +10 -3
  310. package/dist/internal/form-actions.mjs +8 -3
  311. package/dist/internal/infra-analytics-runtime.cjs +11 -11
  312. package/dist/internal/infra-analytics-runtime.mjs +9 -9
  313. package/dist/internal/islands-boot.cjs +6 -1
  314. package/dist/internal/islands-boot.mjs +6 -1
  315. package/dist/internal/islands-runtime.cjs +33 -4
  316. package/dist/internal/islands-runtime.d.mts +1 -1
  317. package/dist/internal/islands-runtime.d.ts +1 -1
  318. package/dist/internal/islands-runtime.mjs +31 -2
  319. package/dist/internal/native-server-fns.cjs +5 -5
  320. package/dist/internal/native-server-fns.mjs +4 -4
  321. package/dist/internal/product-telemetry-runtime.cjs +3 -3
  322. package/dist/internal/product-telemetry-runtime.mjs +2 -2
  323. package/dist/internal/production-node-env.cjs +4 -2
  324. package/dist/internal/production-node-env.d.mts +22 -1
  325. package/dist/internal/production-node-env.d.ts +22 -1
  326. package/dist/internal/production-node-env.mjs +3 -1
  327. package/dist/internal/production-runtime.cjs +57 -39
  328. package/dist/internal/production-runtime.d.mts +27 -21
  329. package/dist/internal/production-runtime.d.ts +27 -21
  330. package/dist/internal/production-runtime.mjs +72 -54
  331. package/dist/internal/react-cache.cjs +3 -3
  332. package/dist/internal/react-cache.mjs +1 -1
  333. package/dist/internal/server-tree.cjs +2 -2
  334. package/dist/internal/server-tree.d.mts +0 -5
  335. package/dist/internal/server-tree.d.ts +0 -5
  336. package/dist/internal/server-tree.mjs +1 -1
  337. package/dist/internal/vercel-edge-middleware.cjs +87 -0
  338. package/dist/internal/vercel-edge-middleware.d.mts +39 -0
  339. package/dist/internal/vercel-edge-middleware.d.ts +39 -0
  340. package/dist/internal/vercel-edge-middleware.mjs +87 -0
  341. package/dist/layers-7P4RLKVX.cjs +20 -0
  342. package/dist/{layers-T55SA47E.mjs → layers-XQ7VFMWO.mjs} +4 -2
  343. package/dist/{layers.d-CcS42OGR.d.mts → layers.d-CH0bC4QL.d.mts} +2 -1
  344. package/dist/{layers.d-CcS42OGR.d.ts → layers.d-CH0bC4QL.d.ts} +2 -1
  345. package/dist/{lifecycle.d-C2aLBOwu.d.ts → lifecycle.d-keQs5Swc.d.mts} +7 -1
  346. package/dist/{lifecycle.d-C2aLBOwu.d.mts → lifecycle.d-keQs5Swc.d.ts} +7 -1
  347. package/dist/{manager-H5ZM3HAM.mjs → manager-JIA66YJ2.mjs} +4 -3
  348. package/dist/manager-JOHU6BQI.cjs +15 -0
  349. package/dist/markdown.cjs +7 -3
  350. package/dist/markdown.d.mts +10 -8
  351. package/dist/markdown.d.ts +10 -8
  352. package/dist/markdown.mjs +6 -2
  353. package/dist/middleware.cjs +11 -11
  354. package/dist/middleware.d.mts +13 -10
  355. package/dist/middleware.d.ts +13 -10
  356. package/dist/middleware.mjs +13 -13
  357. package/dist/mobile.d.mts +6 -6
  358. package/dist/mobile.d.ts +6 -6
  359. package/dist/mount.d-Bki4pOaJ.d.mts +38 -0
  360. package/dist/mount.d-DjR5aerM.d.ts +38 -0
  361. package/dist/{native-server-fn-handler-GLRHAYWV.mjs → native-server-fn-handler-EP5AFJYE.mjs} +5 -5
  362. package/dist/{native-server-fn-handler-J5MYRXN6.cjs → native-server-fn-handler-QRTXGZA4.cjs} +6 -6
  363. package/dist/{native-tree-7LPH57Z4.cjs → native-tree-W2SSJB3Y.cjs} +4 -4
  364. package/dist/{native-tree-VV6WN3GX.mjs → native-tree-Y5YQANW7.mjs} +3 -3
  365. package/dist/{navigation-delegate.d-GghbHJuK.d.ts → navigation-delegate.d-CtghaSP3.d.ts} +1 -1
  366. package/dist/{navigation-delegate.d-DQVYKoaZ.d.mts → navigation-delegate.d-VDkziXTK.d.mts} +1 -1
  367. package/dist/navigation.cjs +8 -7
  368. package/dist/navigation.d.mts +13 -11
  369. package/dist/navigation.d.ts +13 -11
  370. package/dist/navigation.mjs +7 -6
  371. package/dist/{nitro-DD4QCA66.mjs → nitro-NSTXT7LB.mjs} +11 -11
  372. package/dist/{nitro-VRDX2H4M.cjs → nitro-Y3LGITW3.cjs} +13 -13
  373. package/dist/node-module-bundle-LIZ2KMVW.cjs +13 -0
  374. package/dist/node-module-bundle-VR6NV6AI.mjs +13 -0
  375. package/dist/{plugin-53SY5YBS.mjs → plugin-SAS22JL7.mjs} +4 -3
  376. package/dist/{plugin-HZIBL3DW.cjs → plugin-WIU4GDD4.cjs} +5 -4
  377. package/dist/plugin.cjs +65 -63
  378. package/dist/plugin.d.mts +12 -10
  379. package/dist/plugin.d.ts +12 -10
  380. package/dist/plugin.mjs +64 -62
  381. package/dist/{production-runtime.d-Bzns3NW9.d.ts → production-runtime.d-BMyyLGBB.d.ts} +3 -57
  382. package/dist/{production-runtime.d-DiFa5vHW.d.mts → production-runtime.d-DMZY3OgV.d.mts} +3 -57
  383. package/dist/query/client.cjs +9 -7
  384. package/dist/query/client.mjs +5 -3
  385. package/dist/{render-plan.d-CcF0MeCf.d.mts → render-plan.d-BSwV8PE4.d.mts} +1 -1
  386. package/dist/{render-plan.d-CL_Ikfg_.d.ts → render-plan.d-i9sI4tc9.d.ts} +1 -1
  387. package/dist/renderer/none/server.cjs +35 -0
  388. package/dist/renderer/none/server.d.mts +21 -0
  389. package/dist/renderer/none/server.d.ts +21 -0
  390. package/dist/renderer/none/server.mjs +35 -0
  391. package/dist/renderer/react/server.cjs +3 -3
  392. package/dist/renderer/react/server.mjs +3 -3
  393. package/dist/renderer-client.cjs +8 -6
  394. package/dist/renderer-client.d.mts +13 -11
  395. package/dist/renderer-client.d.ts +13 -11
  396. package/dist/renderer-client.mjs +5 -3
  397. package/dist/renderer.cjs +6 -2
  398. package/dist/renderer.d.mts +25 -2
  399. package/dist/renderer.d.ts +25 -2
  400. package/dist/renderer.mjs +5 -1
  401. package/dist/request.cjs +2 -2
  402. package/dist/{request.d-DarDOCk9.d.mts → request.d-C24FNQ_7.d.mts} +1 -1
  403. package/dist/{request.d-B1RnTLri.d.ts → request.d-Dgln8tuI.d.ts} +1 -1
  404. package/dist/request.d.mts +11 -9
  405. package/dist/request.d.ts +11 -9
  406. package/dist/request.mjs +1 -1
  407. package/dist/{route-rendering.d-BTUYCIj4.d.ts → route-rendering.d-CUylZKJA.d.ts} +1 -1
  408. package/dist/{route-rendering.d-D_2Ual0-.d.mts → route-rendering.d-Ds0BfwQi.d.mts} +1 -1
  409. package/dist/{route.d-BaVH3V0w.d.mts → route.d-DrXkpvcg.d.mts} +1 -1
  410. package/dist/{route.d-DBTEqifW.d.ts → route.d-hs-_cyHn.d.ts} +1 -1
  411. package/dist/{router.d-CMANF6da.d.ts → router.d-B56rMOFm.d.ts} +1 -1
  412. package/dist/{router.d-Cuv1jntg.d.mts → router.d-CFPcbqzc.d.mts} +1 -1
  413. package/dist/routes.cjs +3 -3
  414. package/dist/{routes.d-B6yFe6jm.d.ts → routes.d-9GFFNioh.d.ts} +2 -2
  415. package/dist/{routes.d-c2HKfrfL.d.mts → routes.d-CrEy0lJS.d.mts} +2 -2
  416. package/dist/routes.d.mts +10 -8
  417. package/dist/routes.d.ts +10 -8
  418. package/dist/routes.mjs +2 -2
  419. package/dist/{rsc-pipeline-Z7QBZOIJ.cjs → rsc-pipeline-3T7V6OUT.cjs} +30 -28
  420. package/dist/{rsc-pipeline-7PNVJSTR.mjs → rsc-pipeline-GA4AQWZI.mjs} +29 -27
  421. package/dist/{runtime-FKFCUHSK.cjs → runtime-REUTNTI5.cjs} +72 -46
  422. package/dist/{runtime-QQHX4BP3.mjs → runtime-ZYCKKY7L.mjs} +60 -34
  423. package/dist/{runtime.d-wvh4ngU0.d.mts → runtime.d-DLRO-ExG.d.mts} +11 -3
  424. package/dist/{runtime.d-C3RQUj6_.d.ts → runtime.d-H7k9hOQE.d.ts} +11 -3
  425. package/dist/{schema-dev-notice-JMXEQWIQ.mjs → schema-dev-notice-C2JINRZI.mjs} +3 -2
  426. package/dist/{schema-dev-notice-PLBFDTOF.cjs → schema-dev-notice-X7GG7QVB.cjs} +5 -4
  427. package/dist/schema.cjs +6 -2
  428. package/dist/schema.d-Dny9pnrm.d.mts +298 -0
  429. package/dist/schema.d-Dny9pnrm.d.ts +298 -0
  430. package/dist/schema.d.mts +1 -115
  431. package/dist/schema.d.ts +1 -115
  432. package/dist/schema.mjs +5 -1
  433. package/dist/server-fn-client.d.mts +2 -2
  434. package/dist/server-fn-client.d.ts +2 -2
  435. package/dist/server-fn.cjs +5 -5
  436. package/dist/server-fn.mjs +4 -4
  437. package/dist/server-http.d-rAe7lAQc.d.mts +70 -0
  438. package/dist/server-http.d-rAe7lAQc.d.ts +70 -0
  439. package/dist/server-plugins.cjs +7 -7
  440. package/dist/server-plugins.d.mts +20 -12
  441. package/dist/server-plugins.d.ts +20 -12
  442. package/dist/server-plugins.mjs +8 -8
  443. package/dist/server-query.cjs +6 -6
  444. package/dist/server-query.mjs +5 -5
  445. package/dist/server.cjs +168 -126
  446. package/dist/server.d-C5FFrZAo.d.ts +57 -0
  447. package/dist/server.d-DgC8xew5.d.mts +57 -0
  448. package/dist/server.d.mts +24 -16
  449. package/dist/server.d.ts +24 -16
  450. package/dist/server.mjs +144 -102
  451. package/dist/{spa-router.d-m8H_Kl_B.d.ts → spa-router.d-Dr7oanhl.d.ts} +15 -5
  452. package/dist/{spa-router.d-WU_qS5gJ.d.mts → spa-router.d-g4CzhEH1.d.mts} +15 -5
  453. package/dist/testing.cjs +17 -17
  454. package/dist/testing.d.mts +10 -8
  455. package/dist/testing.d.ts +10 -8
  456. package/dist/testing.mjs +13 -13
  457. package/dist/theme/server.cjs +3 -3
  458. package/dist/theme/server.mjs +2 -2
  459. package/dist/types.d-xCIhyjOq.d.mts +233 -0
  460. package/dist/types.d-xCIhyjOq.d.ts +233 -0
  461. package/dist/{utils.d-C9dQD5Zg.d.ts → utils.d-BxxyDEb8.d.ts} +1 -1
  462. package/dist/{utils.d-W9IiEqmW.d.mts → utils.d-HIla3pD_.d.mts} +1 -1
  463. package/dist/version.cjs +2 -2
  464. package/dist/version.mjs +1 -1
  465. package/dist/vite.cjs +65 -63
  466. package/dist/vite.d.mts +36 -14
  467. package/dist/vite.d.ts +36 -14
  468. package/dist/vite.mjs +64 -62
  469. package/dist/workflows.cjs +4 -4
  470. package/dist/workflows.d.mts +121 -1
  471. package/dist/workflows.d.ts +121 -1
  472. package/dist/workflows.mjs +3 -3
  473. package/package.json +37 -2
  474. package/dist/analyzer-H7SIX6BJ.cjs +0 -16
  475. package/dist/chunk-5YPBFMBN.cjs +0 -19
  476. package/dist/chunk-CLFEQGET.cjs +0 -60
  477. package/dist/chunk-MK5E44WP.mjs +0 -60
  478. package/dist/chunk-OM7WILES.mjs +0 -100
  479. package/dist/chunk-Q5B4LNON.mjs +0 -19
  480. package/dist/chunk-QPJ4MZTO.mjs +0 -60
  481. package/dist/chunk-R53QDV6T.cjs +0 -100
  482. package/dist/chunk-UYTAP4FQ.cjs +0 -60
  483. package/dist/layers-DMRXRL7F.cjs +0 -18
  484. package/dist/manager-2LUKNX2N.cjs +0 -14
  485. package/dist/node-module-bundle-7JHPPF6B.mjs +0 -11
  486. package/dist/node-module-bundle-YJGYBOGK.cjs +0 -11
  487. package/dist/workflows.d-CRMzQZ3k.d.mts +0 -188
  488. package/dist/workflows.d-CRMzQZ3k.d.ts +0 -188
  489. /package/dist/{chunk-QGOZLGVP.mjs → chunk-I6FIAWNT.mjs} +0 -0
  490. /package/dist/{chunk-XPIPMWY3.cjs → chunk-K5NI5YQR.cjs} +0 -0
  491. /package/dist/{chunk-NWUHS6GV.cjs → chunk-QEJWNXRI.cjs} +0 -0
  492. /package/dist/{chunk-FSXSQQTV.mjs → chunk-TXE4SAMV.mjs} +0 -0
  493. /package/dist/{chunk-ZXK2EYQW.cjs → chunk-UUQNJDGH.cjs} +0 -0
  494. /package/dist/{chunk-46P5KNTE.mjs → chunk-VZBAW44S.mjs} +0 -0
@@ -8,23 +8,30 @@ import {
8
8
  import {
9
9
  applyFarmCacheInvalidationTargets
10
10
  } from "./chunk-RLEALQEN.mjs";
11
- import {
12
- getFarmRedirectError
13
- } from "./chunk-JNYFXL7X.mjs";
14
11
  import {
15
12
  _resolveCurrentRequestForApp,
16
13
  _toAppRequestView
17
14
  } from "./chunk-VIXTAVEA.mjs";
15
+ import {
16
+ getFarmRedirectError
17
+ } from "./chunk-JNYFXL7X.mjs";
18
18
 
19
19
  // src/server-fn.ts
20
20
  var FARM_SERVER_FN_SYMBOL = /* @__PURE__ */ Symbol.for("farm.server-fn");
21
21
  var FARM_SERVER_FUNCTION_DESCRIPTOR = /* @__PURE__ */ Symbol.for("farm.server-function.descriptor");
22
+ var FARM_SERVER_FN_INPUT_ERROR = /* @__PURE__ */ Symbol.for("farm.server-fn.input-error");
22
23
  var ServerFnInputError = class extends Error {
23
24
  constructor(cause) {
24
25
  super("Server function input is invalid");
25
26
  this.cause = cause;
27
+ Object.defineProperty(this, FARM_SERVER_FN_INPUT_ERROR, { value: true, enumerable: false });
26
28
  }
27
29
  };
30
+ function isServerFnInputError(error) {
31
+ return Boolean(
32
+ error && typeof error === "object" && error[FARM_SERVER_FN_INPUT_ERROR] === true
33
+ );
34
+ }
28
35
  function createServerFunctionDescriptor(kind, options, run) {
29
36
  return Object.freeze({
30
37
  kind,
@@ -64,7 +71,7 @@ async function _invokeServerFunction(value, input, request) {
64
71
  const data = await runWithServerActionRequest(request, () => runner.run(input));
65
72
  return { ok: true, data };
66
73
  } catch (error) {
67
- if (error instanceof ServerFnInputError) {
74
+ if (isServerFnInputError(error)) {
68
75
  return { ok: false, reason: "input", error: error.cause };
69
76
  }
70
77
  if (isServerFnFailure(error)) return { ok: false, reason: "failure", failure: error };
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
- var _chunkWYAXRIYPcjs = require('./chunk-WYAXRIYP.cjs');
3
+ var _chunkUKZ6AWKZcjs = require('./chunk-UKZ6AWKZ.cjs');
4
4
 
5
5
 
6
6
 
@@ -54,7 +54,7 @@ function _applyFarmMobileShellClient(request, response, client, onPrivate) {
54
54
  return _chunkA25FXJ7Dcjs._withFarmResponseHeaders.call(void 0, response, (headers2) => appendVary(headers2, FARM_SHELL_HEADER));
55
55
  }
56
56
  _optionalChain([onPrivate, 'optionalCall', _8 => _8()]);
57
- const headers = new Headers(_chunkWYAXRIYPcjs._withFarmGuardedResponseCache.call(void 0, response).headers);
57
+ const headers = new Headers(_chunkUKZ6AWKZcjs._withFarmGuardedResponseCache.call(void 0, response).headers);
58
58
  appendVary(headers, FARM_SHELL_HEADER);
59
59
  headers.delete("content-length");
60
60
  headers.delete("etag");
@@ -0,0 +1,375 @@
1
+ import {
2
+ resolveFarmPlatform
3
+ } from "./chunk-SMUW7UST.mjs";
4
+ import {
5
+ formatOptionalPeerInstallHint,
6
+ isMissingPackageError
7
+ } from "./chunk-NR63PD3P.mjs";
8
+ import {
9
+ logger
10
+ } from "./chunk-JSDV2NUN.mjs";
11
+
12
+ // src/client-plugin-build.ts
13
+ import fs from "fs";
14
+ import path from "path";
15
+ var CLIENT_KEYS = [
16
+ "public",
17
+ "setup",
18
+ "hydration",
19
+ "navigation",
20
+ "error",
21
+ "performance",
22
+ "close"
23
+ ];
24
+ var HYDRATION_KEYS = ["before", "after"];
25
+ var NAVIGATION_KEYS = ["before", "loaded", "resolved", "rendered", "error"];
26
+ var MOBILE_SHELL_CLIENT_IMPORT = 'import { farmMobileShellClient as __farmMobileShellClient } from "@farm.js/core/internal/client-runtime";';
27
+ var MOBILE_SHELL_CLIENT_REGISTRATION = ` {
28
+ name: "farm:mobile-shell",
29
+ enforce: "pre",
30
+ definition: __farmMobileShellClient,
31
+ }`;
32
+ var APP_CLIENT_EXTENSIONS = ["ts", "tsx", "js", "jsx", "mts", "mjs"];
33
+ function resolveFarmAppClientEntry(root = process.cwd(), srcDir = "src") {
34
+ const sourceRoot = path.resolve(root, srcDir);
35
+ for (const extension of APP_CLIENT_EXTENSIONS) {
36
+ const candidate = path.join(sourceRoot, `client.${extension}`);
37
+ if (fs.existsSync(candidate) && fs.statSync(candidate).isFile()) return candidate;
38
+ }
39
+ return void 0;
40
+ }
41
+ function resolveFarmClientPlugins(plugins, _root) {
42
+ if (!plugins?.length) return [];
43
+ return plugins.flatMap((plugin) => {
44
+ if (!plugin.client) return [];
45
+ assertClientLifecycle(plugin.client, plugin.name);
46
+ assertPublicData(plugin.client.public, plugin.name);
47
+ return [
48
+ {
49
+ name: plugin.name,
50
+ version: plugin.version,
51
+ enforce: plugin.enforce,
52
+ definition: plugin.client,
53
+ publicData: plugin.client.public
54
+ }
55
+ ];
56
+ });
57
+ }
58
+ function generateFarmClientPluginEntryCode(plugins, root, srcDir = "src", appPublicData, platform = resolveFarmPlatform()) {
59
+ const resolved = resolveFarmClientPlugins(plugins, root);
60
+ const appClientEntry = root ? resolveFarmAppClientEntry(root, srcDir) : void 0;
61
+ const appImport = appClientEntry ? `import farmAppClientDefinition from ${JSON.stringify(appClientEntry.replace(/\\/g, "/"))};` : "";
62
+ const mobileShell = platform === "mobile";
63
+ const imports = mobileShell ? [MOBILE_SHELL_CLIENT_IMPORT, appImport].filter(Boolean).join("\n") : appImport;
64
+ const serializedPlugins = mobileShell ? [MOBILE_SHELL_CLIENT_REGISTRATION] : [];
65
+ serializedPlugins.push(
66
+ ...resolved.map(
67
+ (plugin) => ` {
68
+ name: ${JSON.stringify(plugin.name)},
69
+ version: ${serializeOptionalString(plugin.version)},
70
+ enforce: ${serializeOptionalString(plugin.enforce)},
71
+ definition: ${serializeClientLifecycle(plugin.definition, plugin.name)},
72
+ public: ${serializePublicData(plugin.publicData)},
73
+ }`
74
+ )
75
+ );
76
+ if (appClientEntry) {
77
+ assertPublicData(appPublicData, "farm:app-client");
78
+ serializedPlugins.push(` {
79
+ name: "farm:app-client",
80
+ enforce: "post",
81
+ definition: farmAppClientDefinition,
82
+ public: ${serializePublicData(appPublicData)},
83
+ }`);
84
+ }
85
+ const registrations = `[
86
+ ${serializedPlugins.join(",\n")}
87
+ ]`;
88
+ return { imports, registrations, plugins: resolved, empty: serializedPlugins.length === 0 };
89
+ }
90
+ function assertClientLifecycle(client, pluginName) {
91
+ assertLifecycleObject(client, pluginName, "client", CLIENT_KEYS);
92
+ assertHook(client.setup, pluginName, "client.setup");
93
+ assertHook(client.error, pluginName, "client.error");
94
+ assertHook(client.performance, pluginName, "client.performance");
95
+ assertHook(client.close, pluginName, "client.close");
96
+ if (client.hydration !== void 0) {
97
+ assertLifecycleObject(client.hydration, pluginName, "client.hydration", HYDRATION_KEYS);
98
+ assertHook(client.hydration.before, pluginName, "client.hydration.before");
99
+ assertHook(client.hydration.after, pluginName, "client.hydration.after");
100
+ }
101
+ if (client.navigation !== void 0) {
102
+ assertLifecycleObject(client.navigation, pluginName, "client.navigation", NAVIGATION_KEYS);
103
+ for (const key of NAVIGATION_KEYS) {
104
+ assertHook(client.navigation[key], pluginName, `client.navigation.${key}`);
105
+ }
106
+ }
107
+ }
108
+ function assertLifecycleObject(value, pluginName, location, allowedKeys) {
109
+ if (!value || typeof value !== "object" || Array.isArray(value)) {
110
+ throw new TypeError(`Client plugin "${pluginName}" ${location} must be an object`);
111
+ }
112
+ const prototype = Object.getPrototypeOf(value);
113
+ if (prototype !== Object.prototype && prototype !== null) {
114
+ throw new TypeError(`Client plugin "${pluginName}" ${location} must be a plain object`);
115
+ }
116
+ for (const key of Reflect.ownKeys(value)) {
117
+ if (typeof key === "symbol") {
118
+ throw new TypeError(`Client plugin "${pluginName}" ${location} cannot contain symbol keys`);
119
+ }
120
+ if (!allowedKeys.includes(key)) {
121
+ throw new TypeError(`Client plugin "${pluginName}" has an unknown ${location}.${key} option`);
122
+ }
123
+ const descriptor = Object.getOwnPropertyDescriptor(value, key);
124
+ if (!descriptor?.enumerable) {
125
+ throw new TypeError(`Client plugin "${pluginName}" ${location}.${key} must be enumerable`);
126
+ }
127
+ if (!("value" in descriptor)) {
128
+ throw new TypeError(`Client plugin "${pluginName}" ${location}.${key} cannot be an accessor`);
129
+ }
130
+ }
131
+ }
132
+ function assertHook(value, pluginName, location) {
133
+ if (value === void 0) return;
134
+ if (typeof value !== "function") {
135
+ throw new TypeError(`Client plugin "${pluginName}" ${location} must be a function`);
136
+ }
137
+ functionSource(value, pluginName, location);
138
+ }
139
+ function serializeClientLifecycle(definition, pluginName) {
140
+ const fields = [];
141
+ pushHook(fields, "setup", definition.setup, pluginName, "client.setup", 2);
142
+ pushHookGroup(fields, "hydration", definition.hydration, HYDRATION_KEYS, pluginName, 2);
143
+ pushHookGroup(fields, "navigation", definition.navigation, NAVIGATION_KEYS, pluginName, 2);
144
+ pushHook(fields, "error", definition.error, pluginName, "client.error", 2);
145
+ pushHook(fields, "performance", definition.performance, pluginName, "client.performance", 2);
146
+ pushHook(fields, "close", definition.close, pluginName, "client.close", 2);
147
+ return fields.length ? `{
148
+ ${fields.join(",\n")}
149
+ }` : "{}";
150
+ }
151
+ function pushHookGroup(fields, groupName, group, keys, pluginName, indent) {
152
+ if (!group) return;
153
+ const hooks = [];
154
+ for (const key of keys) {
155
+ pushHook(hooks, key, group[key], pluginName, `client.${groupName}.${key}`, indent + 2);
156
+ }
157
+ fields.push(
158
+ `${" ".repeat(indent)}${JSON.stringify(groupName)}: {
159
+ ${hooks.join(",\n")}
160
+ ${" ".repeat(indent)}}`
161
+ );
162
+ }
163
+ function pushHook(fields, key, hook, pluginName, location, indent) {
164
+ if (hook === void 0) return;
165
+ fields.push(
166
+ `${" ".repeat(indent)}${JSON.stringify(key)}: ${functionSource(hook, pluginName, location)}`
167
+ );
168
+ }
169
+ function functionSource(value, pluginName, location) {
170
+ if (typeof value !== "function") {
171
+ throw new TypeError(`Client plugin "${pluginName}" ${location} must be a function`);
172
+ }
173
+ const source = Function.prototype.toString.call(value).trim();
174
+ if (!source || source.includes("[native code]")) {
175
+ throw new TypeError(
176
+ `Client plugin "${pluginName}" ${location} must be authored inline and cannot be native or bound`
177
+ );
178
+ }
179
+ if (/^(?:async\s+)?function(?:\s*\*)?(?:\s+|\()/.test(source)) {
180
+ return `(${source})`;
181
+ }
182
+ if (!/^class\b/.test(source)) {
183
+ if (/^async\s*\(/.test(source) && value.name !== "async") return `(${source})`;
184
+ const method = source.match(/^(async\s+)?(\*\s*)?[$A-Z_a-z][$\w]*\s*(\([\s\S]*)$/);
185
+ if (method) {
186
+ const asyncPrefix = method[1] ?? "";
187
+ const generator = method[2] ? "*" : "";
188
+ return `(${asyncPrefix}function${generator}${method[3]})`;
189
+ }
190
+ if (source.includes("=>")) return `(${source})`;
191
+ }
192
+ throw new TypeError(
193
+ `Client plugin "${pluginName}" ${location} must use a function, method, or arrow function`
194
+ );
195
+ }
196
+ function assertPublicData(value, pluginName) {
197
+ if (value === void 0) return;
198
+ const seen = /* @__PURE__ */ new WeakSet();
199
+ const visit = (current, pathSegments) => {
200
+ if (current === null || typeof current === "string" || typeof current === "boolean") {
201
+ return;
202
+ }
203
+ if (typeof current === "number") {
204
+ if (Number.isFinite(current)) return;
205
+ throwPublicDataError(pluginName, pathSegments, "must be a finite number");
206
+ }
207
+ if (typeof current !== "object") {
208
+ throwPublicDataError(pluginName, pathSegments, `cannot contain ${typeof current} values`);
209
+ }
210
+ if (seen.has(current)) {
211
+ throwPublicDataError(pluginName, pathSegments, "cannot contain circular references");
212
+ }
213
+ seen.add(current);
214
+ if (Array.isArray(current)) {
215
+ for (let index = 0; index < current.length; index += 1) {
216
+ if (!Object.prototype.hasOwnProperty.call(current, index)) {
217
+ throwPublicDataError(
218
+ pluginName,
219
+ [...pathSegments, String(index)],
220
+ "cannot contain sparse array slots"
221
+ );
222
+ }
223
+ visit(current[index], [...pathSegments, String(index)]);
224
+ }
225
+ for (const key of Reflect.ownKeys(current)) {
226
+ if (key === "length" || typeof key === "string" && isArrayIndex(key)) continue;
227
+ throwPublicDataError(
228
+ pluginName,
229
+ pathSegments,
230
+ typeof key === "symbol" ? "cannot contain symbol keys" : `cannot contain non-index array property ${key}`
231
+ );
232
+ }
233
+ seen.delete(current);
234
+ return;
235
+ }
236
+ const prototype = Object.getPrototypeOf(current);
237
+ if (prototype !== Object.prototype && prototype !== null) {
238
+ throwPublicDataError(pluginName, pathSegments, "must contain only plain objects and arrays");
239
+ }
240
+ for (const key of Reflect.ownKeys(current)) {
241
+ if (typeof key === "symbol") {
242
+ throwPublicDataError(pluginName, pathSegments, "cannot contain symbol keys");
243
+ }
244
+ const descriptor = Object.getOwnPropertyDescriptor(current, key);
245
+ if (!descriptor?.enumerable) {
246
+ throwPublicDataError(
247
+ pluginName,
248
+ [...pathSegments, key],
249
+ "cannot contain non-enumerable properties"
250
+ );
251
+ }
252
+ if (!("value" in descriptor)) {
253
+ throwPublicDataError(
254
+ pluginName,
255
+ [...pathSegments, key],
256
+ "cannot contain accessor properties"
257
+ );
258
+ }
259
+ visit(descriptor.value, [...pathSegments, key]);
260
+ }
261
+ seen.delete(current);
262
+ };
263
+ visit(value, []);
264
+ }
265
+ function throwPublicDataError(pluginName, pathSegments, message) {
266
+ const location = pathSegments.length ? ` at client.public.${pathSegments.join(".")}` : "";
267
+ throw new TypeError(`Client plugin "${pluginName}"${location} ${message}`);
268
+ }
269
+ function serializePublicData(value) {
270
+ if (value === void 0) return "undefined";
271
+ return `JSON.parse(${JSON.stringify(JSON.stringify(value))})`;
272
+ }
273
+ function serializeOptionalString(value) {
274
+ return value === void 0 ? "undefined" : JSON.stringify(value);
275
+ }
276
+ function isArrayIndex(key) {
277
+ const value = Number(key);
278
+ return Number.isInteger(value) && value >= 0 && value < 4294967295 && String(value) === key;
279
+ }
280
+
281
+ // src/build/tailwind.ts
282
+ import path2 from "path";
283
+
284
+ // src/build/vite-plugin-compat.ts
285
+ function adaptTailwindVitePlugin(pluginOption, builder) {
286
+ if (builder !== "rolldown") return pluginOption;
287
+ return adaptPluginOption(pluginOption);
288
+ }
289
+ function adaptPluginOption(pluginOption) {
290
+ if (Array.isArray(pluginOption)) return pluginOption.map(adaptPluginOption);
291
+ if (!pluginOption || typeof pluginOption !== "object") return pluginOption;
292
+ const plugin = pluginOption;
293
+ if (!plugin.name?.startsWith("@tailwindcss/vite:generate:")) return pluginOption;
294
+ if (isVitePluginHook(plugin.transform)) {
295
+ return {
296
+ ...plugin,
297
+ transform: withVite5TransformContext(plugin.transform)
298
+ };
299
+ }
300
+ if (plugin.transform && typeof plugin.transform === "object" && "handler" in plugin.transform && isVitePluginHook(plugin.transform.handler)) {
301
+ return {
302
+ ...plugin,
303
+ transform: {
304
+ ...plugin.transform,
305
+ handler: withVite5TransformContext(plugin.transform.handler)
306
+ }
307
+ };
308
+ }
309
+ return pluginOption;
310
+ }
311
+ function isVitePluginHook(value) {
312
+ return typeof value === "function";
313
+ }
314
+ function withVite5TransformContext(handler) {
315
+ return function(...args) {
316
+ const context = new Proxy(this, {
317
+ get(target, property, receiver) {
318
+ if (property === "environment") return void 0;
319
+ return Reflect.get(target, property, receiver);
320
+ }
321
+ });
322
+ return handler.apply(context, args);
323
+ };
324
+ }
325
+
326
+ // src/build/tailwind.ts
327
+ var TAILWIND_CSS_IMPORT = /@import\s+["']tailwindcss["']/;
328
+ var TAILWIND_VITE_INSTALL_HINT = formatOptionalPeerInstallHint(
329
+ "@tailwindcss/vite",
330
+ "enable built-in Tailwind CSS support",
331
+ { dev: true }
332
+ );
333
+ var warnedMissingTailwind = false;
334
+ async function loadTailwindVitePlugin(options = {}, importTailwind = () => import("@tailwindcss/vite")) {
335
+ try {
336
+ const tailwindVite = (await importTailwind()).default;
337
+ const plugin = options.builder ? adaptTailwindVitePlugin(tailwindVite(), options.builder) : tailwindVite();
338
+ if (options.announce) logger.info("\u{1F4E6} Enabled built-in Tailwind support (@tailwindcss/vite)");
339
+ return plugin;
340
+ } catch (error) {
341
+ if (isMissingPackageError(error, "@tailwindcss/vite")) return createMissingTailwindPlugin();
342
+ logger.warn(
343
+ `Tailwind plugin auto-enable failed${options.label ? ` ${options.label}` : ""}; continuing without it: ${error.message}`
344
+ );
345
+ return void 0;
346
+ }
347
+ }
348
+ function createMissingTailwindPlugin() {
349
+ let root = process.cwd();
350
+ return {
351
+ name: "farm:tailwind-missing",
352
+ enforce: "pre",
353
+ configResolved(config) {
354
+ root = config.root;
355
+ },
356
+ transform(code, id) {
357
+ if (warnedMissingTailwind || !/\.css(?:\?.*)?$/.test(id) || !TAILWIND_CSS_IMPORT.test(code)) {
358
+ return null;
359
+ }
360
+ warnedMissingTailwind = true;
361
+ const file = path2.relative(root, id.split("?", 1)[0]).replace(/\\/g, "/");
362
+ logger.warn(
363
+ `${file} imports Tailwind CSS, but @tailwindcss/vite is not installed; continuing without Tailwind. ${TAILWIND_VITE_INSTALL_HINT}`
364
+ );
365
+ return null;
366
+ }
367
+ };
368
+ }
369
+
370
+ export {
371
+ resolveFarmAppClientEntry,
372
+ resolveFarmClientPlugins,
373
+ generateFarmClientPluginEntryCode,
374
+ loadTailwindVitePlugin
375
+ };
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  writeFileIfChanged
3
- } from "./chunk-Q5B4LNON.mjs";
3
+ } from "./chunk-YFTGIHNC.mjs";
4
4
  import {
5
5
  resolveFarmComponentExtensions
6
- } from "./chunk-ES2LD2YD.mjs";
6
+ } from "./chunk-GCRT6GJG.mjs";
7
7
  import {
8
8
  parseRouteSlotFile
9
9
  } from "./chunk-K3RU5MOR.mjs";
10
10
  import {
11
11
  discoverProgrammaticRoutePaths
12
- } from "./chunk-FSXSQQTV.mjs";
12
+ } from "./chunk-TXE4SAMV.mjs";
13
13
  import {
14
14
  parseRoutePath
15
15
  } from "./chunk-JSDV2NUN.mjs";
@@ -2,7 +2,7 @@ import {
2
2
  bundleNodeModule,
3
3
  isDeclarationFile,
4
4
  resolvePackageWithoutTsconfig
5
- } from "./chunk-VFXE6NWR.mjs";
5
+ } from "./chunk-MGKWYPE3.mjs";
6
6
 
7
7
  // src/layers.ts
8
8
  import { existsSync, readFileSync, realpathSync, statSync } from "fs";
@@ -417,5 +417,6 @@ export {
417
417
  getFarmAppDirectories,
418
418
  getFarmLayerAliases,
419
419
  createFarmConfigResolutionPlugin,
420
- loadFarmConfigFile
420
+ loadFarmConfigFile,
421
+ findFarmConfigFile
421
422
  };
@@ -1,15 +1,15 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
2
2
 
3
- var _chunk5YPBFMBNcjs = require('./chunk-5YPBFMBN.cjs');
3
+ var _chunkAQIRXBBYcjs = require('./chunk-AQIRXBBY.cjs');
4
4
 
5
5
 
6
- var _chunkRD623KW4cjs = require('./chunk-RD623KW4.cjs');
6
+ var _chunk67MZTLTFcjs = require('./chunk-67MZTLTF.cjs');
7
7
 
8
8
 
9
9
  var _chunkZDAEHG2Ocjs = require('./chunk-ZDAEHG2O.cjs');
10
10
 
11
11
 
12
- var _chunkNWUHS6GVcjs = require('./chunk-NWUHS6GV.cjs');
12
+ var _chunkQEJWNXRIcjs = require('./chunk-QEJWNXRI.cjs');
13
13
 
14
14
 
15
15
  var _chunkQMNWKQL4cjs = require('./chunk-QMNWKQL4.cjs');
@@ -66,7 +66,7 @@ async function generateRouteTypes(options) {
66
66
  const outPath = path.isAbsolute(outFile) ? outFile : path.join(root, srcDir, outFile);
67
67
  const content = await createRouteTypeDeclarations(options, outPath);
68
68
  fs.mkdirSync(path.dirname(outPath), { recursive: true });
69
- _chunk5YPBFMBNcjs.writeFileIfChanged.call(void 0, outPath, content);
69
+ _chunkAQIRXBBYcjs.writeFileIfChanged.call(void 0, outPath, content);
70
70
  return outPath;
71
71
  }
72
72
  async function createRouteTypeDeclarations(options, outPath) {
@@ -136,7 +136,7 @@ var PLATFORM_FILE = /^(?:(page|layout)\.(native|ios|android)\.(?:tsx|ts|jsx|js)|
136
136
  async function scanRoutePatterns(options) {
137
137
  const { root, srcDir = "src" } = options;
138
138
  const sourceRoots = _nullishCoalesce(options.sourceRoots, () => ( [{ name: "project", root, srcDir, layer: false }]));
139
- const componentExtensions = _chunkRD623KW4cjs.resolveFarmComponentExtensions.call(void 0, options.componentExtensions).map(
139
+ const componentExtensions = _chunk67MZTLTFcjs.resolveFarmComponentExtensions.call(void 0, options.componentExtensions).map(
140
140
  (extension) => extension.slice(1)
141
141
  );
142
142
  const pages = /* @__PURE__ */ new Set();
@@ -174,7 +174,7 @@ async function scanRoutePatterns(options) {
174
174
  );
175
175
  }
176
176
  }
177
- for (const route of await _chunkNWUHS6GVcjs.discoverProgrammaticRoutePaths.call(void 0, source.root, source.srcDir)) {
177
+ for (const route of await _chunkQEJWNXRIcjs.discoverProgrammaticRoutePaths.call(void 0, source.root, source.srcDir)) {
178
178
  pages.add(route);
179
179
  modules.add(route);
180
180
  }
@@ -0,0 +1,51 @@
1
+ // src/plugins/env.ts
2
+ function createEnvPlugin(env, {
3
+ beforeRequest: overrideBeforeRequest,
4
+ afterResponse: overrideAfterResponse
5
+ } = {}) {
6
+ return {
7
+ name: "farm:env",
8
+ configResolved(config, context) {
9
+ for (const [key, value] of Object.entries(env)) {
10
+ process.env[key] = value;
11
+ }
12
+ },
13
+ async beforeRequest(req, res, context) {
14
+ if (overrideBeforeRequest) {
15
+ await overrideBeforeRequest(req, res, context);
16
+ }
17
+ },
18
+ async afterResponse(req, res, context) {
19
+ if (overrideAfterResponse) {
20
+ await overrideAfterResponse(req, res, context);
21
+ }
22
+ }
23
+ };
24
+ }
25
+
26
+ // src/plugins/logger.ts
27
+ function createLoggerPlugin({
28
+ beforeRequest,
29
+ afterResponse
30
+ } = {}) {
31
+ const plugin = {
32
+ name: "farm:logger",
33
+ enforce: "post"
34
+ };
35
+ if (beforeRequest) {
36
+ plugin.beforeRequest = async (req, res, context) => {
37
+ await beforeRequest(req, res, context);
38
+ };
39
+ }
40
+ if (afterResponse) {
41
+ plugin.afterResponse = async (req, res, context) => {
42
+ await afterResponse(req, res, context);
43
+ };
44
+ }
45
+ return plugin;
46
+ }
47
+
48
+ export {
49
+ createEnvPlugin,
50
+ createLoggerPlugin
51
+ };
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-AY2YD5ZX.mjs";
4
4
  import {
5
5
  createWebRequestFromFarmRequest
6
- } from "./chunk-6HRAK7I5.mjs";
6
+ } from "./chunk-5OFNUETM.mjs";
7
7
 
8
8
  // src/middleware/cookie-header.ts
9
9
  function parseMiddlewareCookieHeader(cookieHeader) {