@farm.js/core 0.1.47 → 0.1.49

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 (1092) hide show
  1. package/dist/after.cjs +3 -3
  2. package/dist/after.mjs +2 -2
  3. package/dist/agent-mcp-Bb8hnnqd.d.ts +115 -0
  4. package/dist/agent-mcp-handler-RT3COCEL.cjs +18 -0
  5. package/dist/agent-mcp-handler-WWCC4GLG.mjs +18 -0
  6. package/dist/agent-mcp-ir3v4fHf.d.mts +115 -0
  7. package/dist/agent-runtime.cjs +33 -61
  8. package/dist/agent-runtime.d.mts +1 -1
  9. package/dist/agent-runtime.d.ts +1 -1
  10. package/dist/agent-runtime.mjs +32 -60
  11. package/dist/api/client.cjs +14 -14
  12. package/dist/api/client.mjs +13 -13
  13. package/dist/api/route-manager.cjs +41 -41
  14. package/dist/api/route-manager.d.mts +3 -3
  15. package/dist/api/route-manager.d.ts +3 -3
  16. package/dist/api/route-manager.mjs +40 -40
  17. package/dist/api/runtime.cjs +23 -23
  18. package/dist/api/runtime.d.mts +2 -2
  19. package/dist/api/runtime.d.ts +2 -2
  20. package/dist/api/runtime.mjs +22 -22
  21. package/dist/api.cjs +52 -52
  22. package/dist/api.d.mts +3 -3
  23. package/dist/api.d.ts +3 -3
  24. package/dist/api.mjs +51 -51
  25. package/dist/app-DLzz02du.d.mts +562 -0
  26. package/dist/app-manifest-Crn8Qd3U.d.mts +120 -0
  27. package/dist/app-manifest-DNeTKMRL.d.ts +120 -0
  28. package/dist/app-markdown.cjs +14 -15
  29. package/dist/app-markdown.d.mts +2 -2
  30. package/dist/app-markdown.d.ts +2 -2
  31. package/dist/app-markdown.mjs +13 -14
  32. package/dist/app-y649szYm.d.ts +562 -0
  33. package/dist/cache.cjs +8 -8
  34. package/dist/cache.mjs +7 -7
  35. package/dist/chunk-22W4FNTG.mjs +538 -0
  36. package/dist/chunk-23LVFSID.mjs +182 -0
  37. package/dist/chunk-2DA7CLY7.mjs +560 -0
  38. package/dist/chunk-2DLGV2ZG.mjs +71 -0
  39. package/dist/chunk-2H3FJYY6.mjs +78 -0
  40. package/dist/chunk-2HW5LWAH.cjs +19 -0
  41. package/dist/chunk-2KMIJDY6.cjs +20 -0
  42. package/dist/chunk-2NGZFOKG.mjs +190 -0
  43. package/dist/chunk-2NHOYYUT.mjs +2250 -0
  44. package/dist/chunk-2SVJGOAX.mjs +206 -0
  45. package/dist/chunk-2WZTGPK6.mjs +65 -0
  46. package/dist/chunk-2XGBJSDV.cjs +408 -0
  47. package/dist/chunk-3BIASUGR.cjs +59 -0
  48. package/dist/chunk-3EEET2Q5.cjs +1044 -0
  49. package/dist/chunk-3EIPOTZV.cjs +272 -0
  50. package/dist/chunk-3HBFI373.cjs +227 -0
  51. package/dist/chunk-45EUIICW.mjs +15 -0
  52. package/dist/chunk-46P5KNTE.mjs +8 -0
  53. package/dist/chunk-47JV57DA.cjs +69 -0
  54. package/dist/chunk-4DCWVSL2.cjs +15 -0
  55. package/dist/chunk-4HBKBHVP.mjs +36 -0
  56. package/dist/chunk-4HM5B5RR.cjs +6166 -0
  57. package/dist/chunk-4IICUBQX.cjs +657 -0
  58. package/dist/chunk-4MU4QCX4.mjs +158 -0
  59. package/dist/chunk-4S7M63WX.cjs +91 -0
  60. package/dist/chunk-4ZJ5C7UJ.cjs +75 -0
  61. package/dist/chunk-52Y3C3HG.mjs +421 -0
  62. package/dist/chunk-53EHWHT2.cjs +166 -0
  63. package/dist/chunk-5566GNEG.cjs +410 -0
  64. package/dist/chunk-5C7XMKQ4.cjs +410 -0
  65. package/dist/chunk-5DX3O6TT.cjs +266 -0
  66. package/dist/chunk-5J45H65F.mjs +48 -0
  67. package/dist/chunk-5OJVKXFV.cjs +2072 -0
  68. package/dist/chunk-5PKDHKQP.cjs +81 -0
  69. package/dist/chunk-5PZJ63PK.mjs +17 -0
  70. package/dist/chunk-5Y2P454O.cjs +421 -0
  71. package/dist/chunk-5Y4GYKKH.mjs +13 -0
  72. package/dist/chunk-5YPBFMBN.cjs +19 -0
  73. package/dist/chunk-6BLAY2VQ.mjs +45 -0
  74. package/dist/chunk-6CTFVBAT.cjs +29 -0
  75. package/dist/chunk-6FXBJPF5.cjs +35 -0
  76. package/dist/chunk-6HRAK7I5.mjs +215 -0
  77. package/dist/chunk-6IOZPJ3I.cjs +549 -0
  78. package/dist/chunk-6JHZPB52.cjs +538 -0
  79. package/dist/chunk-6LH33DLL.cjs +34 -0
  80. package/dist/chunk-6ONBZGVH.cjs +124 -0
  81. package/dist/chunk-6XFGJBYX.cjs +78 -0
  82. package/dist/chunk-6XQSPIN6.cjs +155 -0
  83. package/dist/chunk-6YFC3ZFX.mjs +449 -0
  84. package/dist/chunk-6ZFRWRHO.mjs +54 -0
  85. package/dist/chunk-72D2NX77.mjs +293 -0
  86. package/dist/chunk-72KABRWN.mjs +2072 -0
  87. package/dist/chunk-72KCTHLV.cjs +723 -0
  88. package/dist/chunk-73XBJRZW.cjs +462 -0
  89. package/dist/chunk-75XSZIRE.mjs +180 -0
  90. package/dist/chunk-7EPYN7GW.cjs +30 -0
  91. package/dist/chunk-7H4SVNC4.cjs +700 -0
  92. package/dist/chunk-7JUIK547.cjs +62 -0
  93. package/dist/chunk-7KJJ4SBS.cjs +13 -0
  94. package/dist/chunk-7PTISZSQ.cjs +176 -0
  95. package/dist/chunk-7PZVXMWG.mjs +113 -0
  96. package/dist/chunk-7S7AAK2D.mjs +82 -0
  97. package/dist/chunk-A25FXJ7D.cjs +38 -0
  98. package/dist/chunk-A4PWGL46.mjs +141 -0
  99. package/dist/chunk-A7DK663W.cjs +577 -0
  100. package/dist/chunk-ACI52TCN.mjs +9 -0
  101. package/dist/chunk-AIHD6VME.cjs +12132 -0
  102. package/dist/chunk-ALD2WMLA.mjs +387 -0
  103. package/dist/chunk-AOKXITZ6.cjs +16 -0
  104. package/dist/chunk-ATHPRVP2.mjs +651 -0
  105. package/dist/chunk-ATYTLVSI.cjs +45 -0
  106. package/dist/chunk-AXRNEVCS.cjs +150 -0
  107. package/dist/chunk-AY2YD5ZX.mjs +34 -0
  108. package/dist/chunk-AYP2YFVN.mjs +168 -0
  109. package/dist/chunk-AZQXXXDX.mjs +80 -0
  110. package/dist/chunk-B5BBTPJQ.cjs +44 -0
  111. package/dist/chunk-BBPDJGCU.cjs +157 -0
  112. package/dist/chunk-BEXYFR2R.cjs +527 -0
  113. package/dist/chunk-BLD5GVCG.mjs +152 -0
  114. package/dist/chunk-BMQAPZXD.mjs +31 -0
  115. package/dist/chunk-BNH53KOT.cjs +69 -0
  116. package/dist/chunk-BNMHXVLL.mjs +239 -0
  117. package/dist/chunk-BOVGCUDZ.cjs +35 -0
  118. package/dist/chunk-BPAXGCKX.mjs +166 -0
  119. package/dist/chunk-BPNOYILC.cjs +450 -0
  120. package/dist/chunk-BR5FSKZ5.cjs +1457 -0
  121. package/dist/chunk-BRWIVOV4.cjs +48 -0
  122. package/dist/chunk-BTZ5O6VM.cjs +14 -0
  123. package/dist/chunk-BUC3FDYC.cjs +158 -0
  124. package/dist/chunk-C5JXCUKR.mjs +905 -0
  125. package/dist/chunk-C5S457CK.cjs +8671 -0
  126. package/dist/chunk-C64XOPBZ.mjs +380 -0
  127. package/dist/chunk-C6U66WWF.mjs +410 -0
  128. package/dist/chunk-C7425KDG.cjs +406 -0
  129. package/dist/chunk-C7LCTVJ2.cjs +30 -0
  130. package/dist/chunk-CA7DNRHO.cjs +164 -0
  131. package/dist/chunk-CBJKDB6F.mjs +80 -0
  132. package/dist/chunk-CDTIXBKN.mjs +40 -0
  133. package/dist/chunk-CL2ONP73.cjs +180 -0
  134. package/dist/chunk-CQL5ZGFU.cjs +50 -0
  135. package/dist/chunk-CSLUBKGG.mjs +44 -0
  136. package/dist/chunk-CU5SYTJG.mjs +23 -0
  137. package/dist/chunk-CV6MFQ4Y.mjs +259 -0
  138. package/dist/chunk-D22BUQKW.cjs +82 -0
  139. package/dist/chunk-D2LCAV6L.mjs +79 -0
  140. package/dist/chunk-D4XGKF67.cjs +127 -0
  141. package/dist/chunk-D7Y63SOY.mjs +15 -0
  142. package/dist/chunk-DGVVVYKD.mjs +489 -0
  143. package/dist/chunk-DM3TFCC2.cjs +697 -0
  144. package/dist/chunk-DMAP4RND.cjs +998 -0
  145. package/dist/chunk-DQJ2CIH7.cjs +87 -0
  146. package/dist/chunk-DRFADSKY.mjs +697 -0
  147. package/dist/chunk-DU4VHHPJ.mjs +157 -0
  148. package/dist/chunk-DUIP64BF.cjs +16 -0
  149. package/dist/chunk-DV52ZS53.cjs +40 -0
  150. package/dist/chunk-DXUXQP2T.cjs +142 -0
  151. package/dist/chunk-E552H232.cjs +154 -0
  152. package/dist/chunk-E7QOEV5Z.cjs +449 -0
  153. package/dist/chunk-EA5PMJDU.mjs +527 -0
  154. package/dist/chunk-EDPENAVO.mjs +266 -0
  155. package/dist/chunk-EFLNOZGH.mjs +30 -0
  156. package/dist/chunk-EGHPFXPZ.cjs +590 -0
  157. package/dist/chunk-EJCVG25Z.mjs +49 -0
  158. package/dist/chunk-EMDGXYUD.mjs +75 -0
  159. package/dist/chunk-EOXPRC2C.cjs +48 -0
  160. package/dist/chunk-EQMTJBB7.cjs +161 -0
  161. package/dist/chunk-ERMUL73L.cjs +39 -0
  162. package/dist/chunk-ES2LD2YD.mjs +203 -0
  163. package/dist/chunk-ETF5C6HR.cjs +135 -0
  164. package/dist/chunk-EV4SBMPX.mjs +208 -0
  165. package/dist/chunk-EVCQX243.cjs +1923 -0
  166. package/dist/chunk-EVIWKPJV.cjs +560 -0
  167. package/dist/chunk-EVMXPJCB.mjs +133 -0
  168. package/dist/chunk-EXHEPWFJ.cjs +387 -0
  169. package/dist/chunk-EZTKXD6P.cjs +182 -0
  170. package/dist/chunk-F3N52U7S.mjs +138 -0
  171. package/dist/chunk-F6TLUMH7.mjs +172 -0
  172. package/dist/chunk-FBEBSAVI.cjs +225 -0
  173. package/dist/chunk-FEFCISOX.cjs +102 -0
  174. package/dist/chunk-FGJQS4EC.cjs +385 -0
  175. package/dist/chunk-FHURJABM.mjs +45 -0
  176. package/dist/chunk-FR4HJDI6.cjs +156 -0
  177. package/dist/chunk-GBMWLDCC.cjs +138 -0
  178. package/dist/chunk-GBPDSUFE.mjs +203 -0
  179. package/dist/chunk-GERUXONA.cjs +775 -0
  180. package/dist/chunk-GHNW564E.mjs +1044 -0
  181. package/dist/chunk-GL3ZDHKI.mjs +274 -0
  182. package/dist/chunk-GLOICKDO.mjs +142 -0
  183. package/dist/chunk-GSVJ3IIF.cjs +173 -0
  184. package/dist/chunk-GUZC226X.mjs +164 -0
  185. package/dist/chunk-GW4YUIHW.mjs +277 -0
  186. package/dist/chunk-GWXZS7K5.mjs +24 -0
  187. package/dist/chunk-GXSMF7UR.mjs +1923 -0
  188. package/dist/chunk-GYMGK467.mjs +214 -0
  189. package/dist/chunk-H227LYHT.mjs +88 -0
  190. package/dist/chunk-H4WUWLQR.mjs +16 -0
  191. package/dist/chunk-HA7YRO53.cjs +214 -0
  192. package/dist/chunk-HAH4FBTA.mjs +227 -0
  193. package/dist/chunk-HELQXYVI.cjs +1093 -0
  194. package/dist/chunk-HEPJIKKQ.cjs +190 -0
  195. package/dist/chunk-HIFIG6HL.cjs +341 -0
  196. package/dist/chunk-HLYRXN2I.cjs +242 -0
  197. package/dist/chunk-HNAISJFD.cjs +215 -0
  198. package/dist/chunk-HNAUK3SC.mjs +1181 -0
  199. package/dist/chunk-HPP2II4Z.mjs +332 -0
  200. package/dist/chunk-HTLCLOXQ.cjs +433 -0
  201. package/dist/chunk-HXNLKCWH.cjs +13 -0
  202. package/dist/chunk-HZOMT5DY.mjs +30 -0
  203. package/dist/chunk-I2BYNELA.cjs +380 -0
  204. package/dist/chunk-I2SWKWO7.mjs +453 -0
  205. package/dist/chunk-IAPTECEB.mjs +48 -0
  206. package/dist/chunk-IFTGERT3.mjs +408 -0
  207. package/dist/chunk-IGL6CO6M.mjs +9 -0
  208. package/dist/chunk-ITV4QQL2.cjs +93 -0
  209. package/dist/chunk-IUQLRTTO.mjs +159 -0
  210. package/dist/chunk-IVHPRF4W.mjs +6166 -0
  211. package/dist/chunk-IWFV5ZED.cjs +152 -0
  212. package/dist/chunk-IXSMFKZ2.cjs +100 -0
  213. package/dist/chunk-IYEY3JWJ.mjs +186 -0
  214. package/dist/chunk-J27BZO67.mjs +156 -0
  215. package/dist/chunk-J2ZEVDEK.cjs +80 -0
  216. package/dist/chunk-J37KTQIA.cjs +905 -0
  217. package/dist/chunk-J5VCA45K.cjs +9 -0
  218. package/dist/chunk-JATTVAHA.cjs +277 -0
  219. package/dist/chunk-JGAE5XPL.cjs +26 -0
  220. package/dist/chunk-JHXJBNLY.cjs +22 -0
  221. package/dist/chunk-JMYXO572.cjs +531 -0
  222. package/dist/chunk-JNYFXL7X.mjs +62 -0
  223. package/dist/chunk-JOHXK4BB.mjs +385 -0
  224. package/dist/chunk-JPAVNDZH.cjs +712 -0
  225. package/dist/chunk-JRHGJVJH.mjs +44 -0
  226. package/dist/chunk-JUMPFVMK.mjs +78 -0
  227. package/dist/chunk-JWP56HCP.mjs +712 -0
  228. package/dist/chunk-JXIYH2NO.cjs +24 -0
  229. package/dist/chunk-JYT7AN37.cjs +79 -0
  230. package/dist/chunk-JZMZKABS.cjs +78 -0
  231. package/dist/chunk-K5EW7GUU.mjs +417 -0
  232. package/dist/chunk-K76CBYQM.mjs +157 -0
  233. package/dist/chunk-KBGZ5FD6.cjs +17 -0
  234. package/dist/chunk-KBRZAYI7.mjs +593 -0
  235. package/dist/chunk-KJMWAUKE.mjs +124 -0
  236. package/dist/chunk-KORZ6PRE.cjs +64 -0
  237. package/dist/chunk-KPAJWD3N.mjs +168 -0
  238. package/dist/chunk-KQH2COEJ.mjs +42 -0
  239. package/dist/chunk-KRRZJ77U.mjs +169 -0
  240. package/dist/chunk-KZT2VHRQ.cjs +894 -0
  241. package/dist/chunk-L5JDKFMQ.cjs +44 -0
  242. package/dist/chunk-L6QDME5Z.cjs +36 -0
  243. package/dist/chunk-LAZK6UV7.mjs +341 -0
  244. package/dist/chunk-LL7TDMOM.mjs +222 -0
  245. package/dist/chunk-LM2YOGDK.mjs +44 -0
  246. package/dist/chunk-LM55GS4R.mjs +38 -0
  247. package/dist/chunk-LNVGXUL3.cjs +172 -0
  248. package/dist/chunk-LSHX2H5G.cjs +57 -0
  249. package/dist/chunk-LZBM35DH.mjs +577 -0
  250. package/dist/chunk-M25IONJP.mjs +16 -0
  251. package/dist/chunk-MF3IA2AW.cjs +25 -0
  252. package/dist/chunk-MFQGU5CC.mjs +127 -0
  253. package/dist/chunk-MJ6IC4K2.mjs +34 -0
  254. package/dist/chunk-MNIR7I7B.mjs +217 -0
  255. package/dist/chunk-MPU5DOXX.cjs +21 -0
  256. package/dist/chunk-MTB57GOK.mjs +81 -0
  257. package/dist/chunk-MU5V7XHL.mjs +172 -0
  258. package/dist/chunk-N25RPPO5.cjs +1963 -0
  259. package/dist/chunk-N33DLJBC.mjs +272 -0
  260. package/dist/chunk-N35YPV4N.mjs +48 -0
  261. package/dist/chunk-N77JBPLC.mjs +1357 -0
  262. package/dist/chunk-N7XWC6BN.mjs +21 -0
  263. package/dist/chunk-NBIVGHAT.mjs +50 -0
  264. package/dist/chunk-NCIAP562.mjs +27 -0
  265. package/dist/chunk-NG44F7AH.mjs +150 -0
  266. package/dist/chunk-NJLTQR5P.cjs +293 -0
  267. package/dist/chunk-NPPT4RWF.cjs +489 -0
  268. package/dist/chunk-NR63PD3P.mjs +64 -0
  269. package/dist/chunk-NRNAHZ57.mjs +39 -0
  270. package/dist/chunk-NW2BKDVT.mjs +1963 -0
  271. package/dist/chunk-NYQSC4DX.cjs +593 -0
  272. package/dist/chunk-O4F3JUST.mjs +176 -0
  273. package/dist/chunk-OAJOQU5J.mjs +225 -0
  274. package/dist/chunk-OCS3PSYR.cjs +51 -0
  275. package/dist/chunk-OHWM2VI4.mjs +29 -0
  276. package/dist/chunk-OJO2GOM3.mjs +69 -0
  277. package/dist/chunk-OLGQZRW6.mjs +700 -0
  278. package/dist/chunk-ONG4RDW3.mjs +155 -0
  279. package/dist/chunk-OOJBBHYW.cjs +38 -0
  280. package/dist/chunk-OOZEU5KK.cjs +18 -0
  281. package/dist/chunk-OWQV6MLM.cjs +82 -0
  282. package/dist/chunk-OY5XDG24.cjs +113 -0
  283. package/dist/chunk-OYZXVBZP.cjs +133 -0
  284. package/dist/chunk-OZC2JPW6.cjs +10 -0
  285. package/dist/chunk-P2355C6E.cjs +186 -0
  286. package/dist/chunk-PAKCHVUS.mjs +450 -0
  287. package/dist/chunk-PEHL3IZL.cjs +203 -0
  288. package/dist/chunk-PENBZAHJ.cjs +88 -0
  289. package/dist/chunk-PFV2KPDZ.cjs +172 -0
  290. package/dist/chunk-PO5MXV5X.cjs +13 -0
  291. package/dist/chunk-PSUYE5HR.mjs +25 -0
  292. package/dist/chunk-PTLXHRJZ.mjs +57 -0
  293. package/dist/chunk-PXEXOQ5R.mjs +135 -0
  294. package/dist/chunk-PZXYAWYG.cjs +274 -0
  295. package/dist/chunk-Q3UU2KXC.mjs +775 -0
  296. package/dist/chunk-Q5B4LNON.mjs +19 -0
  297. package/dist/chunk-QFQDRJKJ.mjs +666 -0
  298. package/dist/chunk-QGJ4FI2G.mjs +723 -0
  299. package/dist/chunk-QISW423S.cjs +335 -0
  300. package/dist/chunk-QNQEK3OF.cjs +666 -0
  301. package/dist/chunk-QPJ4MZTO.mjs +60 -0
  302. package/dist/chunk-QPNVDSFZ.mjs +18 -0
  303. package/dist/chunk-QQ44FYRO.cjs +27 -0
  304. package/dist/chunk-QSTRBKHZ.mjs +102 -0
  305. package/dist/chunk-R2SEZEBC.cjs +453 -0
  306. package/dist/chunk-R5U7OIPI.cjs +34 -0
  307. package/dist/chunk-R62SF5R4.mjs +410 -0
  308. package/dist/chunk-RD623KW4.cjs +203 -0
  309. package/dist/chunk-RFKTJTWZ.mjs +26 -0
  310. package/dist/chunk-RI3EVPKD.cjs +57 -0
  311. package/dist/chunk-RLEALQEN.mjs +998 -0
  312. package/dist/chunk-RVGLYMJM.cjs +259 -0
  313. package/dist/chunk-RYDDUCNJ.mjs +433 -0
  314. package/dist/chunk-S32PDOLO.mjs +13 -0
  315. package/dist/chunk-S6O2L47H.mjs +549 -0
  316. package/dist/chunk-SBABQKPT.cjs +169 -0
  317. package/dist/chunk-SBDWCDS6.cjs +8 -0
  318. package/dist/chunk-SF3JB56B.mjs +82 -0
  319. package/dist/chunk-SG57PX7K.cjs +65 -0
  320. package/dist/chunk-SGBNF56S.cjs +44 -0
  321. package/dist/chunk-SHD265HW.cjs +19 -0
  322. package/dist/chunk-SHIWRBFI.cjs +17 -0
  323. package/dist/chunk-SM2SYWAR.cjs +49 -0
  324. package/dist/chunk-SNP33A33.cjs +9 -0
  325. package/dist/chunk-SSNN55Q6.cjs +651 -0
  326. package/dist/chunk-STF6VDYQ.cjs +23 -0
  327. package/dist/chunk-SVCUSOEF.mjs +590 -0
  328. package/dist/chunk-SXCL2MIN.cjs +208 -0
  329. package/dist/chunk-SYW346ZN.cjs +71 -0
  330. package/dist/chunk-TGSEVBPO.mjs +93 -0
  331. package/dist/chunk-TJVUTGED.mjs +531 -0
  332. package/dist/chunk-TTYXOAB7.mjs +657 -0
  333. package/dist/chunk-TUPKMMXT.mjs +173 -0
  334. package/dist/chunk-TVCFY3KK.cjs +217 -0
  335. package/dist/chunk-TXK4D46O.mjs +22 -0
  336. package/dist/chunk-UAQD67HM.mjs +154 -0
  337. package/dist/chunk-UCQ52TJY.mjs +406 -0
  338. package/dist/chunk-UIJOLBUL.mjs +19 -0
  339. package/dist/chunk-UPYIFH2H.cjs +168 -0
  340. package/dist/chunk-UUMKLGUU.mjs +69 -0
  341. package/dist/chunk-UYQOIPXE.mjs +368 -0
  342. package/dist/chunk-UYTAP4FQ.cjs +60 -0
  343. package/dist/chunk-UZCMMJJT.cjs +80 -0
  344. package/dist/chunk-V3UOEWCB.cjs +46 -0
  345. package/dist/chunk-V56632LA.cjs +141 -0
  346. package/dist/chunk-V7KTQR4C.cjs +15 -0
  347. package/dist/chunk-VCFBQFOV.mjs +1093 -0
  348. package/dist/chunk-VCKGOXFI.cjs +872 -0
  349. package/dist/chunk-VE3FWJBO.mjs +46 -0
  350. package/dist/chunk-VFXE6NWR.mjs +87 -0
  351. package/dist/chunk-VHIXGZYH.mjs +9 -0
  352. package/dist/chunk-VISQDC6W.mjs +10 -0
  353. package/dist/chunk-VIXTAVEA.mjs +59 -0
  354. package/dist/chunk-VJXLUTBM.mjs +894 -0
  355. package/dist/chunk-VM57CK74.cjs +42 -0
  356. package/dist/chunk-VOQ7XZZT.cjs +157 -0
  357. package/dist/chunk-VR4SEDEM.mjs +1457 -0
  358. package/dist/chunk-VR6QLTTX.mjs +59 -0
  359. package/dist/chunk-VSLM6BHX.cjs +2250 -0
  360. package/dist/chunk-VU3MYZPO.mjs +432 -0
  361. package/dist/chunk-VXCFJWK5.cjs +59 -0
  362. package/dist/chunk-VZY7MAVS.cjs +432 -0
  363. package/dist/chunk-WB6XES4V.mjs +161 -0
  364. package/dist/chunk-WCLLPR6H.mjs +35 -0
  365. package/dist/chunk-WEGAVN37.cjs +45 -0
  366. package/dist/chunk-WJFFPXCV.cjs +1357 -0
  367. package/dist/chunk-WNDAISB7.mjs +51 -0
  368. package/dist/chunk-WNLPQW7W.mjs +19 -0
  369. package/dist/chunk-WQGRD5BJ.cjs +239 -0
  370. package/dist/chunk-WT6RAN2I.cjs +41 -0
  371. package/dist/chunk-WXFY5JIY.mjs +20 -0
  372. package/dist/chunk-WYL4ODZ4.mjs +38 -0
  373. package/dist/chunk-X333W5KV.cjs +31 -0
  374. package/dist/chunk-X3XUZWRB.mjs +141 -0
  375. package/dist/chunk-XGJVRPYL.cjs +141 -0
  376. package/dist/chunk-XLLVWLWO.mjs +100 -0
  377. package/dist/chunk-XLYXG73A.mjs +87 -0
  378. package/dist/chunk-XN2MB4QZ.cjs +206 -0
  379. package/dist/chunk-XO6WL6NL.mjs +462 -0
  380. package/dist/chunk-XQ4DPO4G.mjs +13 -0
  381. package/dist/chunk-XQSYOVCW.cjs +417 -0
  382. package/dist/chunk-XR2ZIBQK.mjs +57 -0
  383. package/dist/chunk-XURDCXNH.cjs +48 -0
  384. package/dist/chunk-XXB37YET.cjs +40 -0
  385. package/dist/chunk-Y3WG64CP.cjs +9 -0
  386. package/dist/chunk-Y6FXYEAI.mjs +10 -0
  387. package/dist/chunk-Y7NN63LS.mjs +40 -0
  388. package/dist/chunk-YDXLC4DW.cjs +54 -0
  389. package/dist/chunk-YP7YO3S3.mjs +17 -0
  390. package/dist/chunk-YQGZLCT4.cjs +368 -0
  391. package/dist/chunk-YT3SLLZK.mjs +242 -0
  392. package/dist/chunk-YTVSWXEZ.cjs +168 -0
  393. package/dist/chunk-YVJV7Q2X.mjs +35 -0
  394. package/dist/chunk-YWPNIYUP.mjs +41 -0
  395. package/dist/chunk-YX6AFPXC.mjs +8 -0
  396. package/dist/chunk-Z3BXMMFF.mjs +8668 -0
  397. package/dist/chunk-Z4LTSH7D.mjs +12129 -0
  398. package/dist/chunk-Z5MZDFX4.cjs +159 -0
  399. package/dist/chunk-ZBS3GOQZ.cjs +222 -0
  400. package/dist/chunk-ZIBIE7AH.mjs +872 -0
  401. package/dist/chunk-ZSIGEHSE.cjs +1181 -0
  402. package/dist/chunk-ZXK2EYQW.cjs +8 -0
  403. package/dist/client/lifecycle.cjs +3 -3
  404. package/dist/client/lifecycle.mjs +2 -2
  405. package/dist/client-plugins-BNBeyLMi.d.mts +3922 -0
  406. package/dist/client-plugins-DFDQUI9Q.d.ts +3922 -0
  407. package/dist/client-plugins.cjs +3 -3
  408. package/dist/client-plugins.d.mts +1 -1
  409. package/dist/client-plugins.d.ts +1 -1
  410. package/dist/client-plugins.mjs +2 -2
  411. package/dist/client.cjs +41 -41
  412. package/dist/client.d.mts +5 -5
  413. package/dist/client.d.ts +5 -5
  414. package/dist/client.mjs +42 -42
  415. package/dist/config.cjs +3 -3
  416. package/dist/config.d.mts +1 -1
  417. package/dist/config.d.ts +1 -1
  418. package/dist/config.mjs +2 -2
  419. package/dist/cron.cjs +9 -9
  420. package/dist/cron.mjs +8 -8
  421. package/dist/deferred.cjs +3 -3
  422. package/dist/deferred.mjs +2 -2
  423. package/dist/deployment.cjs +3 -3
  424. package/dist/deployment.mjs +2 -2
  425. package/dist/desktop.cjs +13 -0
  426. package/dist/desktop.d.mts +120 -0
  427. package/dist/desktop.d.ts +120 -0
  428. package/dist/desktop.mjs +13 -0
  429. package/dist/dev-guard-PLHL6OTJ.cjs +58 -0
  430. package/dist/dev-guard-YO6KPIOQ.mjs +58 -0
  431. package/dist/devtools-A37WWJZL.cjs +463 -0
  432. package/dist/devtools-BLKHPY3C.mjs +463 -0
  433. package/dist/devtools-client-SU4XH46J.mjs +250 -0
  434. package/dist/devtools-client-X5OQCXDF.cjs +250 -0
  435. package/dist/devtools-ui-CYBVFLPH.mjs +1265 -0
  436. package/dist/devtools-ui-SYRUXUA7.cjs +1265 -0
  437. package/dist/docs.cjs +64 -64
  438. package/dist/docs.d.mts +2 -2
  439. package/dist/docs.d.ts +2 -2
  440. package/dist/docs.mjs +63 -63
  441. package/dist/env-types.cjs +4 -4
  442. package/dist/env-types.mjs +3 -3
  443. package/dist/env.cjs +4 -4
  444. package/dist/env.mjs +3 -3
  445. package/dist/environment/vite.cjs +7 -7
  446. package/dist/environment/vite.mjs +6 -6
  447. package/dist/environment.cjs +3 -3
  448. package/dist/environment.mjs +2 -2
  449. package/dist/font.cjs +3 -3
  450. package/dist/font.mjs +2 -2
  451. package/dist/headers.cjs +6 -6
  452. package/dist/headers.mjs +5 -5
  453. package/dist/i18n/client.cjs +19 -30
  454. package/dist/i18n/client.mjs +9 -20
  455. package/dist/i18n/index.cjs +6 -6
  456. package/dist/i18n/index.mjs +5 -5
  457. package/dist/i18n/server.cjs +10 -10
  458. package/dist/i18n/server.mjs +9 -9
  459. package/dist/image/server.cjs +6 -6
  460. package/dist/image/server.mjs +5 -5
  461. package/dist/image/sharp.cjs +15 -21
  462. package/dist/image/sharp.mjs +7 -13
  463. package/dist/image.cjs +9 -18
  464. package/dist/image.mjs +4 -13
  465. package/dist/index-CeJ9_s9p.d.mts +54 -0
  466. package/dist/index-DBdiTkNc.d.ts +54 -0
  467. package/dist/index.cjs +187 -196
  468. package/dist/index.d.mts +15 -15
  469. package/dist/index.d.ts +15 -15
  470. package/dist/index.mjs +217 -226
  471. package/dist/instrumentation.cjs +5 -5
  472. package/dist/instrumentation.mjs +4 -4
  473. package/dist/integration-orm-52GPGTHO.cjs +14 -0
  474. package/dist/integration-orm-CO23MSFE.mjs +14 -0
  475. package/dist/integrations.cjs +20 -20
  476. package/dist/integrations.d.mts +1 -1
  477. package/dist/integrations.d.ts +1 -1
  478. package/dist/integrations.mjs +19 -19
  479. package/dist/internal/app-markdown-runtime.cjs +12 -13
  480. package/dist/internal/app-markdown-runtime.d.mts +2 -2
  481. package/dist/internal/app-markdown-runtime.d.ts +2 -2
  482. package/dist/internal/app-markdown-runtime.mjs +11 -12
  483. package/dist/internal/build-runtime.cjs +153 -149
  484. package/dist/internal/build-runtime.d.mts +3 -3
  485. package/dist/internal/build-runtime.d.ts +3 -3
  486. package/dist/internal/build-runtime.mjs +136 -132
  487. package/dist/internal/cli-runtime.cjs +88 -88
  488. package/dist/internal/cli-runtime.mjs +87 -87
  489. package/dist/internal/client-error-overlay.cjs +18 -49
  490. package/dist/internal/client-error-overlay.mjs +14 -45
  491. package/dist/internal/client-runtime.cjs +39 -53
  492. package/dist/internal/client-runtime.mjs +36 -50
  493. package/dist/internal/compression-runtime.cjs +4 -4
  494. package/dist/internal/compression-runtime.d.mts +1 -1
  495. package/dist/internal/compression-runtime.d.ts +1 -1
  496. package/dist/internal/compression-runtime.mjs +3 -3
  497. package/dist/internal/config-runtime.cjs +85 -69
  498. package/dist/internal/config-runtime.d.mts +2 -2
  499. package/dist/internal/config-runtime.d.ts +2 -2
  500. package/dist/internal/config-runtime.mjs +73 -57
  501. package/dist/internal/desktop-guard.cjs +17 -0
  502. package/dist/internal/desktop-guard.d.mts +52 -0
  503. package/dist/internal/desktop-guard.d.ts +52 -0
  504. package/dist/internal/desktop-guard.mjs +17 -0
  505. package/dist/internal/docs-precompiled-runtime.cjs +5 -17
  506. package/dist/internal/docs-precompiled-runtime.mjs +4 -16
  507. package/dist/internal/form-actions-client.cjs +1 -5
  508. package/dist/internal/form-actions-client.mjs +1 -5
  509. package/dist/internal/form-actions.cjs +10 -10
  510. package/dist/internal/form-actions.mjs +9 -9
  511. package/dist/internal/infra-analytics-runtime.cjs +22 -8
  512. package/dist/internal/infra-analytics-runtime.mjs +20 -6
  513. package/dist/internal/island-codec.cjs +4 -4
  514. package/dist/internal/island-codec.mjs +3 -3
  515. package/dist/internal/island-value-store.cjs +1 -4
  516. package/dist/internal/island-value-store.mjs +1 -4
  517. package/dist/internal/islands-runtime.cjs +50 -22
  518. package/dist/internal/islands-runtime.d.mts +34 -25
  519. package/dist/internal/islands-runtime.d.ts +34 -25
  520. package/dist/internal/islands-runtime.mjs +45 -17
  521. package/dist/internal/islands-server.cjs +6 -9
  522. package/dist/internal/islands-server.mjs +5 -8
  523. package/dist/internal/islx-client.cjs +1 -1
  524. package/dist/internal/islx-react.cjs +1 -1
  525. package/dist/internal/islx-server.cjs +1 -1
  526. package/dist/internal/isolated-boundary.cjs +5 -5
  527. package/dist/internal/isolated-boundary.mjs +4 -4
  528. package/dist/internal/metadata-image-runtime.cjs +8 -8
  529. package/dist/internal/metadata-image-runtime.d.mts +6 -1
  530. package/dist/internal/metadata-image-runtime.d.ts +6 -1
  531. package/dist/internal/metadata-image-runtime.mjs +7 -7
  532. package/dist/internal/product-telemetry-runtime.cjs +5 -17
  533. package/dist/internal/product-telemetry-runtime.mjs +3 -15
  534. package/dist/internal/production-node-env.cjs +3 -3
  535. package/dist/internal/production-node-env.mjs +2 -2
  536. package/dist/internal/production-runtime.cjs +102 -103
  537. package/dist/internal/production-runtime.d.mts +42 -11
  538. package/dist/internal/production-runtime.d.ts +42 -11
  539. package/dist/internal/production-runtime.mjs +114 -115
  540. package/dist/internal/request-cookies.cjs +3 -3
  541. package/dist/internal/request-cookies.mjs +2 -2
  542. package/dist/internal/server-tree.cjs +5 -5
  543. package/dist/internal/server-tree.mjs +4 -4
  544. package/dist/json-ld.cjs +3 -16
  545. package/dist/json-ld.mjs +3 -16
  546. package/dist/layers-DMRXRL7F.cjs +18 -0
  547. package/dist/layers-T55SA47E.mjs +18 -0
  548. package/dist/manager-2LUKNX2N.cjs +14 -0
  549. package/dist/manager-H5ZM3HAM.mjs +14 -0
  550. package/dist/markdown.cjs +11 -12
  551. package/dist/markdown.d.mts +1 -1
  552. package/dist/markdown.d.ts +1 -1
  553. package/dist/markdown.mjs +10 -11
  554. package/dist/middleware.cjs +31 -31
  555. package/dist/middleware.d.mts +3 -3
  556. package/dist/middleware.d.ts +3 -3
  557. package/dist/middleware.mjs +30 -30
  558. package/dist/navigation.cjs +22 -22
  559. package/dist/navigation.d.mts +4 -4
  560. package/dist/navigation.d.ts +4 -4
  561. package/dist/navigation.mjs +21 -21
  562. package/dist/nitro-BIXIKJZS.cjs +650 -0
  563. package/dist/nitro-UT2J5A5D.mjs +650 -0
  564. package/dist/node-module-bundle-7JHPPF6B.mjs +11 -0
  565. package/dist/node-module-bundle-YJGYBOGK.cjs +11 -0
  566. package/dist/observability.cjs +3 -3
  567. package/dist/observability.mjs +2 -2
  568. package/dist/og.cjs +1 -1
  569. package/dist/og.mjs +1 -1
  570. package/dist/platform.cjs +28 -0
  571. package/dist/platform.d.mts +23 -0
  572. package/dist/platform.d.ts +23 -0
  573. package/dist/platform.mjs +28 -0
  574. package/dist/plugin-4KYXV7BB.mjs +32 -0
  575. package/dist/plugin-WBANOZQM.cjs +32 -0
  576. package/dist/plugin.cjs +147 -144
  577. package/dist/plugin.d.mts +3 -3
  578. package/dist/plugin.d.ts +3 -3
  579. package/dist/plugin.mjs +127 -124
  580. package/dist/production-runtime-B3qFFtKF.d.ts +123 -0
  581. package/dist/production-runtime-DcD-GRAv.d.mts +123 -0
  582. package/dist/programmatic-routes-client-DzbYGiZQ.d.mts +184 -0
  583. package/dist/programmatic-routes-client-fD9f4XqU.d.ts +184 -0
  584. package/dist/query/client.cjs +59 -70
  585. package/dist/query/client.mjs +49 -60
  586. package/dist/query/index.cjs +4 -4
  587. package/dist/query/index.mjs +3 -3
  588. package/dist/query/parsers.cjs +3 -3
  589. package/dist/query/parsers.mjs +2 -2
  590. package/dist/query/server.cjs +5 -11
  591. package/dist/query/server.mjs +3 -9
  592. package/dist/render-plan-B6cfssrr.d.ts +25 -0
  593. package/dist/render-plan-DqJ51ufr.d.mts +25 -0
  594. package/dist/renderer/react/client.cjs +1 -1
  595. package/dist/renderer/react/client.mjs +1 -1
  596. package/dist/renderer/react/server.cjs +10 -15
  597. package/dist/renderer/react/server.mjs +10 -15
  598. package/dist/renderer/react/vite.cjs +1 -4
  599. package/dist/renderer/react/vite.mjs +1 -4
  600. package/dist/renderer-client.cjs +67 -79
  601. package/dist/renderer-client.d.mts +3 -3
  602. package/dist/renderer-client.d.ts +3 -3
  603. package/dist/renderer-client.mjs +44 -56
  604. package/dist/renderer.cjs +3 -3
  605. package/dist/renderer.mjs +2 -2
  606. package/dist/request-UuAxHn8h.d.mts +24 -0
  607. package/dist/request-jhvUMXRx.d.ts +24 -0
  608. package/dist/request.cjs +4 -4
  609. package/dist/request.d.mts +2 -2
  610. package/dist/request.d.ts +2 -2
  611. package/dist/request.mjs +3 -3
  612. package/dist/route-rendering-Cou00t1X.d.mts +44 -0
  613. package/dist/route-rendering-Sn50cYZf.d.ts +44 -0
  614. package/dist/router-0X9DCTcm.d.mts +50 -0
  615. package/dist/router-xwLvi48p.d.ts +50 -0
  616. package/dist/router.cjs +5 -5
  617. package/dist/router.mjs +4 -4
  618. package/dist/routes.cjs +13 -13
  619. package/dist/routes.d.mts +1 -1
  620. package/dist/routes.d.ts +1 -1
  621. package/dist/routes.mjs +12 -12
  622. package/dist/rsc-pipeline-F6ZPH5MU.mjs +81 -0
  623. package/dist/rsc-pipeline-VKHMABDJ.cjs +81 -0
  624. package/dist/runtime-CMrsyChI.d.mts +69 -0
  625. package/dist/runtime-tkSXZiqO.d.ts +69 -0
  626. package/dist/schema-dev-notice-O3I5HLXK.mjs +54 -0
  627. package/dist/schema-dev-notice-Z73J3NJ6.cjs +54 -0
  628. package/dist/schema.cjs +3 -3
  629. package/dist/schema.mjs +2 -2
  630. package/dist/search-client-BTXL5XWD.mjs +13 -0
  631. package/dist/search-client-QCYAL6AY.cjs +13 -0
  632. package/dist/server-action-security.cjs +8 -8
  633. package/dist/server-action-security.mjs +7 -7
  634. package/dist/server-fn-client.cjs +4 -4
  635. package/dist/server-fn-client.mjs +3 -3
  636. package/dist/server-fn.cjs +15 -15
  637. package/dist/server-fn.mjs +14 -14
  638. package/dist/server-plugins.cjs +15 -15
  639. package/dist/server-plugins.d.mts +2 -2
  640. package/dist/server-plugins.d.ts +2 -2
  641. package/dist/server-plugins.mjs +14 -14
  642. package/dist/server-query-client.cjs +8 -8
  643. package/dist/server-query-client.mjs +7 -7
  644. package/dist/server-query.cjs +17 -17
  645. package/dist/server-query.mjs +16 -16
  646. package/dist/server.cjs +215 -219
  647. package/dist/server.d.mts +9 -9
  648. package/dist/server.d.ts +9 -9
  649. package/dist/server.mjs +178 -182
  650. package/dist/spa-router-B06APnGK.d.ts +239 -0
  651. package/dist/spa-router-B48EjsS1.d.mts +239 -0
  652. package/dist/storage.cjs +3 -3
  653. package/dist/storage.mjs +2 -2
  654. package/dist/testing.cjs +57 -77
  655. package/dist/testing.d.mts +1 -1
  656. package/dist/testing.d.ts +1 -1
  657. package/dist/testing.mjs +46 -66
  658. package/dist/theme/client.cjs +5 -5
  659. package/dist/theme/client.mjs +4 -4
  660. package/dist/theme/index.cjs +3 -3
  661. package/dist/theme/index.mjs +2 -2
  662. package/dist/theme/runtime.cjs +3 -3
  663. package/dist/theme/runtime.mjs +2 -2
  664. package/dist/theme/server.cjs +8 -8
  665. package/dist/theme/server.mjs +7 -7
  666. package/dist/utils-C5fyK2tE.d.ts +48 -0
  667. package/dist/utils-hyAwmcN6.d.mts +48 -0
  668. package/dist/version.cjs +3 -3
  669. package/dist/version.mjs +2 -2
  670. package/dist/vite.cjs +152 -149
  671. package/dist/vite.d.mts +4 -4
  672. package/dist/vite.d.ts +4 -4
  673. package/dist/vite.mjs +127 -124
  674. package/dist/workflows.cjs +14 -14
  675. package/dist/workflows.mjs +13 -13
  676. package/package.json +26 -2
  677. package/dist/agent-mcp-BtK_KZ1m.d.ts +0 -115
  678. package/dist/agent-mcp-Cc-ypyNi.d.mts +0 -115
  679. package/dist/agent-mcp-handler-HVV5LNXF.mjs +0 -19
  680. package/dist/agent-mcp-handler-YKG7KVCY.cjs +0 -19
  681. package/dist/app-2SBLAaNq.d.mts +0 -554
  682. package/dist/app-BlXGEpdA.d.ts +0 -554
  683. package/dist/app-manifest-D1Tgp8ya.d.ts +0 -120
  684. package/dist/app-manifest-nZHIvS3a.d.mts +0 -120
  685. package/dist/chunk-25LPIZSX.cjs +0 -576
  686. package/dist/chunk-26CXZR6L.mjs +0 -1242
  687. package/dist/chunk-26RUNDIR.mjs +0 -2355
  688. package/dist/chunk-2A3EQHXX.mjs +0 -173
  689. package/dist/chunk-2CQ74SP6.cjs +0 -13
  690. package/dist/chunk-2DZFF7F7.cjs +0 -11810
  691. package/dist/chunk-2FUIT2G2.cjs +0 -85
  692. package/dist/chunk-2GVF3C2F.cjs +0 -616
  693. package/dist/chunk-2J7W2WND.mjs +0 -149
  694. package/dist/chunk-2NROIAA6.cjs +0 -6066
  695. package/dist/chunk-2NXO5SBY.mjs +0 -57
  696. package/dist/chunk-2PQNJXFM.mjs +0 -20
  697. package/dist/chunk-2SJ4RQ6P.cjs +0 -57
  698. package/dist/chunk-2SLWGLZ7.mjs +0 -8620
  699. package/dist/chunk-2UC36WAC.mjs +0 -22
  700. package/dist/chunk-2VQKKQ6D.mjs +0 -51
  701. package/dist/chunk-2Y3JRYVG.mjs +0 -71
  702. package/dist/chunk-37VKVISD.mjs +0 -2042
  703. package/dist/chunk-3BROEWFY.cjs +0 -39
  704. package/dist/chunk-3HEQSCVV.mjs +0 -9
  705. package/dist/chunk-3SAWHWDH.cjs +0 -186
  706. package/dist/chunk-3XEMGDBF.cjs +0 -1242
  707. package/dist/chunk-44SYJEG3.mjs +0 -13
  708. package/dist/chunk-45QJHGZM.cjs +0 -1063
  709. package/dist/chunk-45ZSJLDT.mjs +0 -183
  710. package/dist/chunk-4GP3XZ4Z.mjs +0 -595
  711. package/dist/chunk-4JCQDWPX.mjs +0 -24
  712. package/dist/chunk-4KQDHTWX.mjs +0 -487
  713. package/dist/chunk-4OOBRCJX.mjs +0 -300
  714. package/dist/chunk-4PPEPOZZ.cjs +0 -21
  715. package/dist/chunk-4RB44K6Z.mjs +0 -94
  716. package/dist/chunk-4SIYUGRY.mjs +0 -93
  717. package/dist/chunk-4TLUFAIP.cjs +0 -92
  718. package/dist/chunk-4U5XZDLG.cjs +0 -80
  719. package/dist/chunk-4ZZNPK25.mjs +0 -178
  720. package/dist/chunk-53ZV6K65.mjs +0 -241
  721. package/dist/chunk-54UPOYFS.mjs +0 -35
  722. package/dist/chunk-55YI3RRB.mjs +0 -192
  723. package/dist/chunk-5LPHJZSI.cjs +0 -241
  724. package/dist/chunk-5NAVKJCZ.cjs +0 -435
  725. package/dist/chunk-5NIWBWDD.mjs +0 -97
  726. package/dist/chunk-5QIKR7RR.cjs +0 -224
  727. package/dist/chunk-5WI2S4CO.mjs +0 -20
  728. package/dist/chunk-63H6BKXG.cjs +0 -389
  729. package/dist/chunk-64SBBZDU.cjs +0 -102
  730. package/dist/chunk-666CKENS.mjs +0 -49
  731. package/dist/chunk-6BWKJ6QS.cjs +0 -43
  732. package/dist/chunk-6D24SDKO.cjs +0 -145
  733. package/dist/chunk-6EODJYCX.cjs +0 -183
  734. package/dist/chunk-6EXBPJ24.cjs +0 -434
  735. package/dist/chunk-6IZWX6ES.cjs +0 -74
  736. package/dist/chunk-6LVRDOAW.mjs +0 -74
  737. package/dist/chunk-6MVFHNYZ.cjs +0 -1033
  738. package/dist/chunk-6NT6S2VQ.mjs +0 -180
  739. package/dist/chunk-6QOLZITB.cjs +0 -22
  740. package/dist/chunk-6QQDAAAZ.cjs +0 -38
  741. package/dist/chunk-72ADZ6GQ.cjs +0 -19
  742. package/dist/chunk-72AK62H5.mjs +0 -55
  743. package/dist/chunk-73WX6PRY.mjs +0 -575
  744. package/dist/chunk-75RZHGLS.cjs +0 -135
  745. package/dist/chunk-7GNWGLWB.mjs +0 -14
  746. package/dist/chunk-7IQQIPRZ.mjs +0 -55
  747. package/dist/chunk-7LTCDQRS.mjs +0 -166
  748. package/dist/chunk-7P475T2X.mjs +0 -11809
  749. package/dist/chunk-7RNAKBWF.cjs +0 -40
  750. package/dist/chunk-7UEEHAW7.mjs +0 -576
  751. package/dist/chunk-7W3CPVXS.cjs +0 -24
  752. package/dist/chunk-A6WIQH5Z.cjs +0 -31
  753. package/dist/chunk-AELACLOB.mjs +0 -47
  754. package/dist/chunk-AI7QMY7O.cjs +0 -41
  755. package/dist/chunk-ALPWLT27.cjs +0 -291
  756. package/dist/chunk-AMDMVWMI.cjs +0 -39
  757. package/dist/chunk-APDGOKKE.cjs +0 -148
  758. package/dist/chunk-ARJWXNQL.cjs +0 -256
  759. package/dist/chunk-AZBSVLRM.cjs +0 -132
  760. package/dist/chunk-B2GSRB3P.mjs +0 -1033
  761. package/dist/chunk-B6XAA7V6.cjs +0 -2042
  762. package/dist/chunk-BCMSYSN2.mjs +0 -183
  763. package/dist/chunk-BIDYX3SL.cjs +0 -91
  764. package/dist/chunk-BJIYRUGQ.mjs +0 -35
  765. package/dist/chunk-BMOBTMDR.cjs +0 -178
  766. package/dist/chunk-BOYNDCZL.mjs +0 -54
  767. package/dist/chunk-BPNRQ5BA.mjs +0 -690
  768. package/dist/chunk-BRYHOB4X.mjs +0 -18
  769. package/dist/chunk-BTHHUD7Q.mjs +0 -51
  770. package/dist/chunk-BUGNQIHC.mjs +0 -449
  771. package/dist/chunk-C4NCTZLM.mjs +0 -22
  772. package/dist/chunk-C5GUTBZK.cjs +0 -173
  773. package/dist/chunk-CALY6QG6.mjs +0 -963
  774. package/dist/chunk-CBBLJMR5.mjs +0 -74
  775. package/dist/chunk-CBXBGM72.cjs +0 -212
  776. package/dist/chunk-CEDPEDNW.cjs +0 -98
  777. package/dist/chunk-CGR525MJ.cjs +0 -357
  778. package/dist/chunk-CGVPXIRN.cjs +0 -472
  779. package/dist/chunk-CMGMGHUZ.cjs +0 -27
  780. package/dist/chunk-CNOQY6Z7.mjs +0 -156
  781. package/dist/chunk-COABSY3U.mjs +0 -196
  782. package/dist/chunk-CQ6OSQ3K.mjs +0 -36
  783. package/dist/chunk-CU625VAY.mjs +0 -13
  784. package/dist/chunk-CW6SNEN2.cjs +0 -727
  785. package/dist/chunk-CXP5U3RW.cjs +0 -54
  786. package/dist/chunk-CY2ZQ5C6.cjs +0 -56
  787. package/dist/chunk-CZS6OACQ.mjs +0 -63
  788. package/dist/chunk-D4ROBNTK.cjs +0 -1378
  789. package/dist/chunk-D5IHNDHI.cjs +0 -367
  790. package/dist/chunk-D5RFPV2H.mjs +0 -148
  791. package/dist/chunk-D64OPY6A.cjs +0 -710
  792. package/dist/chunk-D7JTOLFK.cjs +0 -285
  793. package/dist/chunk-DAATZTKJ.mjs +0 -220
  794. package/dist/chunk-DMRPN25V.mjs +0 -701
  795. package/dist/chunk-DVM4FKZL.cjs +0 -169
  796. package/dist/chunk-E22SWCXB.cjs +0 -144
  797. package/dist/chunk-EMLAPBEM.mjs +0 -256
  798. package/dist/chunk-ETPEZLS3.mjs +0 -367
  799. package/dist/chunk-F3VB7ONA.mjs +0 -338
  800. package/dist/chunk-F646BZ4Y.mjs +0 -581
  801. package/dist/chunk-FA2W42OV.mjs +0 -25
  802. package/dist/chunk-FEYQCYT7.cjs +0 -823
  803. package/dist/chunk-FGH3ZXTP.mjs +0 -1063
  804. package/dist/chunk-FIAPD365.mjs +0 -85
  805. package/dist/chunk-FJ3M4CUX.cjs +0 -46
  806. package/dist/chunk-FK6GO24V.cjs +0 -54
  807. package/dist/chunk-FP2INE7H.mjs +0 -113
  808. package/dist/chunk-FQUKOELE.mjs +0 -6066
  809. package/dist/chunk-FVPXT2JR.cjs +0 -63
  810. package/dist/chunk-FWCGUVVL.mjs +0 -86
  811. package/dist/chunk-FXFKIJDA.cjs +0 -168
  812. package/dist/chunk-G2KY33I6.mjs +0 -202
  813. package/dist/chunk-G2Z5DGMS.cjs +0 -581
  814. package/dist/chunk-G4MWPDSE.mjs +0 -19
  815. package/dist/chunk-G643DQCH.cjs +0 -13
  816. package/dist/chunk-G7HXGLEC.cjs +0 -175
  817. package/dist/chunk-GB7LDGY5.cjs +0 -2355
  818. package/dist/chunk-GC3EM6H4.mjs +0 -80
  819. package/dist/chunk-GCXWJJKH.mjs +0 -169
  820. package/dist/chunk-GHFS7RUB.mjs +0 -152
  821. package/dist/chunk-GS3WR5HX.cjs +0 -595
  822. package/dist/chunk-GZTUT75U.mjs +0 -293
  823. package/dist/chunk-GZWHCWLB.mjs +0 -186
  824. package/dist/chunk-H3EGVQE5.mjs +0 -22
  825. package/dist/chunk-H4AMB6ZE.mjs +0 -421
  826. package/dist/chunk-H4LXPWI2.mjs +0 -46
  827. package/dist/chunk-H77NVNJ2.mjs +0 -57
  828. package/dist/chunk-H7BLEEAE.cjs +0 -57
  829. package/dist/chunk-HANGSYMB.mjs +0 -67
  830. package/dist/chunk-HJ64F4GS.mjs +0 -537
  831. package/dist/chunk-HKFBMHCD.mjs +0 -291
  832. package/dist/chunk-HLJ6MBUZ.cjs +0 -183
  833. package/dist/chunk-HREOKQWT.cjs +0 -45
  834. package/dist/chunk-I2BHUNBU.mjs +0 -14
  835. package/dist/chunk-I57LW5VZ.cjs +0 -94
  836. package/dist/chunk-I5MG3TKE.cjs +0 -487
  837. package/dist/chunk-I6UVKUYK.mjs +0 -1378
  838. package/dist/chunk-IE7XCHH3.cjs +0 -85
  839. package/dist/chunk-IF4NU2NG.mjs +0 -314
  840. package/dist/chunk-IFWSR7YZ.cjs +0 -416
  841. package/dist/chunk-IHQIOZLC.mjs +0 -65
  842. package/dist/chunk-IK6LVLKC.cjs +0 -51
  843. package/dist/chunk-IM7DY3ED.mjs +0 -40
  844. package/dist/chunk-IN6RCKLL.mjs +0 -396
  845. package/dist/chunk-INQ64HTJ.mjs +0 -696
  846. package/dist/chunk-IOAUK4OI.cjs +0 -2162
  847. package/dist/chunk-IOEH4VWN.mjs +0 -202
  848. package/dist/chunk-IOMVXBLZ.mjs +0 -144
  849. package/dist/chunk-IXFOBGLQ.cjs +0 -1120
  850. package/dist/chunk-J7FSKED3.cjs +0 -93
  851. package/dist/chunk-J7K2NZD6.mjs +0 -56
  852. package/dist/chunk-JAXDRRRC.cjs +0 -701
  853. package/dist/chunk-JBSVKMC5.mjs +0 -28
  854. package/dist/chunk-JDNHKPTD.cjs +0 -22
  855. package/dist/chunk-JEIG3EWE.cjs +0 -690
  856. package/dist/chunk-JEZO6VUR.cjs +0 -35
  857. package/dist/chunk-JGHCKIRI.mjs +0 -580
  858. package/dist/chunk-JGLC4TO3.cjs +0 -192
  859. package/dist/chunk-JM5XPKWH.mjs +0 -41
  860. package/dist/chunk-JNZ4TDWM.mjs +0 -445
  861. package/dist/chunk-JOW4HDJO.mjs +0 -179
  862. package/dist/chunk-JPLUGGRV.mjs +0 -230
  863. package/dist/chunk-JVXW76I7.mjs +0 -727
  864. package/dist/chunk-KCMTCM6I.cjs +0 -53
  865. package/dist/chunk-KEXK442I.cjs +0 -696
  866. package/dist/chunk-KF6VDJH7.cjs +0 -86
  867. package/dist/chunk-KFZZFZ7J.cjs +0 -46
  868. package/dist/chunk-KGB5UXJJ.mjs +0 -27
  869. package/dist/chunk-KGZIORNL.cjs +0 -43
  870. package/dist/chunk-KI3MESHB.mjs +0 -224
  871. package/dist/chunk-KNBBQHO2.cjs +0 -51
  872. package/dist/chunk-KNHBTJP6.mjs +0 -472
  873. package/dist/chunk-KQANE4Q4.mjs +0 -1210
  874. package/dist/chunk-KR6CKSXT.cjs +0 -15
  875. package/dist/chunk-KYN5ODF6.mjs +0 -62
  876. package/dist/chunk-L3KT7IXV.mjs +0 -91
  877. package/dist/chunk-L5H2GSUC.cjs +0 -49
  878. package/dist/chunk-L6A26QT5.cjs +0 -537
  879. package/dist/chunk-LCCBO7PJ.cjs +0 -46
  880. package/dist/chunk-LFHCG2DU.mjs +0 -43
  881. package/dist/chunk-LIUGYUX3.cjs +0 -22
  882. package/dist/chunk-LIZTLA5F.cjs +0 -396
  883. package/dist/chunk-LLUA2LSC.mjs +0 -157
  884. package/dist/chunk-LPE3ED4R.cjs +0 -929
  885. package/dist/chunk-LPEX4YW6.mjs +0 -13
  886. package/dist/chunk-LRJRXXQZ.cjs +0 -109
  887. package/dist/chunk-LTNGXMQ6.cjs +0 -55
  888. package/dist/chunk-LYLEZIG3.cjs +0 -73
  889. package/dist/chunk-LYV44OIR.mjs +0 -256
  890. package/dist/chunk-LZESP4IR.cjs +0 -575
  891. package/dist/chunk-M2L4MYDQ.cjs +0 -14
  892. package/dist/chunk-M3BXTWJM.mjs +0 -467
  893. package/dist/chunk-M7MKQXAF.cjs +0 -87
  894. package/dist/chunk-MEASUNVY.mjs +0 -440
  895. package/dist/chunk-MGMF4VP7.mjs +0 -102
  896. package/dist/chunk-MHHCLYXU.mjs +0 -236
  897. package/dist/chunk-MN4TQJ3W.cjs +0 -157
  898. package/dist/chunk-MQ3H6LT5.cjs +0 -202
  899. package/dist/chunk-MWSK6C4J.cjs +0 -18
  900. package/dist/chunk-MWWVKDW3.cjs +0 -169
  901. package/dist/chunk-MY5PZYAD.cjs +0 -2083
  902. package/dist/chunk-N46M65CI.mjs +0 -54
  903. package/dist/chunk-N4UOK6ZI.cjs +0 -256
  904. package/dist/chunk-NBPNUQYO.cjs +0 -179
  905. package/dist/chunk-NFG4PUPI.cjs +0 -64
  906. package/dist/chunk-NFME7OKZ.cjs +0 -109
  907. package/dist/chunk-NO3WWW3N.cjs +0 -192
  908. package/dist/chunk-NPC7VWJE.mjs +0 -277
  909. package/dist/chunk-NYJMY3JA.cjs +0 -156
  910. package/dist/chunk-NZKJGRB3.cjs +0 -230
  911. package/dist/chunk-O6BCQV2T.mjs +0 -46
  912. package/dist/chunk-O7BH5O46.mjs +0 -175
  913. package/dist/chunk-O7USYJ4U.mjs +0 -64
  914. package/dist/chunk-OF4TXHM4.cjs +0 -9
  915. package/dist/chunk-OHY2ZWUG.cjs +0 -25
  916. package/dist/chunk-OI6CMLWX.cjs +0 -47
  917. package/dist/chunk-OILHPMFX.cjs +0 -580
  918. package/dist/chunk-OJ7JP7RJ.mjs +0 -212
  919. package/dist/chunk-ONUEYC6N.mjs +0 -27
  920. package/dist/chunk-OT6ZEW74.mjs +0 -139
  921. package/dist/chunk-OX6O6WVA.cjs +0 -74
  922. package/dist/chunk-OYEUREB6.cjs +0 -35
  923. package/dist/chunk-OYZGFRPA.mjs +0 -714
  924. package/dist/chunk-OZVEHHMA.cjs +0 -194
  925. package/dist/chunk-P2UJF4SS.mjs +0 -823
  926. package/dist/chunk-P4TYB4SF.cjs +0 -417
  927. package/dist/chunk-P7XDC7UJ.mjs +0 -92
  928. package/dist/chunk-PCOTGFSM.cjs +0 -139
  929. package/dist/chunk-PDU4P2IC.cjs +0 -467
  930. package/dist/chunk-PJ42JESY.cjs +0 -87
  931. package/dist/chunk-PJEHUSHA.mjs +0 -229
  932. package/dist/chunk-PNGWZFUQ.mjs +0 -39
  933. package/dist/chunk-PSV6XKPO.cjs +0 -220
  934. package/dist/chunk-PZYCPSCC.cjs +0 -35
  935. package/dist/chunk-Q5B3KJBP.cjs +0 -152
  936. package/dist/chunk-Q5F32A26.cjs +0 -8621
  937. package/dist/chunk-QBK2AA4U.cjs +0 -445
  938. package/dist/chunk-QCFBDFRS.mjs +0 -169
  939. package/dist/chunk-QCVE2OCI.cjs +0 -169
  940. package/dist/chunk-QCVIRVHE.mjs +0 -87
  941. package/dist/chunk-QE6VAKLT.mjs +0 -85
  942. package/dist/chunk-QGH2RQVF.mjs +0 -132
  943. package/dist/chunk-QHSH7IH4.mjs +0 -35
  944. package/dist/chunk-QIBP5EFA.cjs +0 -476
  945. package/dist/chunk-QNPEUFHQ.cjs +0 -27
  946. package/dist/chunk-QSG2IX4A.mjs +0 -109
  947. package/dist/chunk-QVKYGNVM.mjs +0 -27
  948. package/dist/chunk-QVYLBY73.mjs +0 -93
  949. package/dist/chunk-R3DS7A2T.mjs +0 -21
  950. package/dist/chunk-R3ZFQJEF.mjs +0 -616
  951. package/dist/chunk-R5A5KNVX.cjs +0 -20
  952. package/dist/chunk-R5JIFR6B.cjs +0 -42
  953. package/dist/chunk-RHAZ22ZN.mjs +0 -87
  954. package/dist/chunk-S34OBRMZ.mjs +0 -109
  955. package/dist/chunk-S3A45T7F.cjs +0 -166
  956. package/dist/chunk-S3FNNQHR.mjs +0 -31
  957. package/dist/chunk-S3JO3N4H.cjs +0 -17
  958. package/dist/chunk-S3ZEMCE6.mjs +0 -1120
  959. package/dist/chunk-S67OYZU7.mjs +0 -711
  960. package/dist/chunk-S6ENKNNG.mjs +0 -168
  961. package/dist/chunk-S6FJO323.cjs +0 -65
  962. package/dist/chunk-S7MTDRYA.cjs +0 -394
  963. package/dist/chunk-SAXPH6G5.mjs +0 -169
  964. package/dist/chunk-SBH2JLLF.cjs +0 -55
  965. package/dist/chunk-SEJ5N6SL.mjs +0 -38
  966. package/dist/chunk-SFGWNC43.mjs +0 -97
  967. package/dist/chunk-SGB4IW7K.mjs +0 -710
  968. package/dist/chunk-SGBZPZUW.mjs +0 -75
  969. package/dist/chunk-SHB3GYXI.mjs +0 -285
  970. package/dist/chunk-SK35NQKK.cjs +0 -27
  971. package/dist/chunk-SKK6UF5P.cjs +0 -755
  972. package/dist/chunk-SKNL7VA2.mjs +0 -42
  973. package/dist/chunk-SLQCDJSO.mjs +0 -18
  974. package/dist/chunk-SOR334EB.cjs +0 -149
  975. package/dist/chunk-SU7MH53P.cjs +0 -180
  976. package/dist/chunk-SVRTJOUF.cjs +0 -113
  977. package/dist/chunk-SZLNU3GJ.cjs +0 -293
  978. package/dist/chunk-T76H22WI.mjs +0 -2162
  979. package/dist/chunk-TFQG7TBC.mjs +0 -43
  980. package/dist/chunk-TI7UANHI.cjs +0 -77
  981. package/dist/chunk-TIWHTW3Q.cjs +0 -24
  982. package/dist/chunk-TKJZFIML.cjs +0 -20
  983. package/dist/chunk-TVGP4BBZ.mjs +0 -45
  984. package/dist/chunk-UFDAAQFX.cjs +0 -169
  985. package/dist/chunk-UFDV5N3C.cjs +0 -711
  986. package/dist/chunk-UIDWEU7M.mjs +0 -357
  987. package/dist/chunk-ULQOP5UI.mjs +0 -54
  988. package/dist/chunk-UP4CW6WP.mjs +0 -169
  989. package/dist/chunk-UQUEANTY.mjs +0 -2083
  990. package/dist/chunk-UQZ4AYTH.cjs +0 -168
  991. package/dist/chunk-US2QVW3E.cjs +0 -36
  992. package/dist/chunk-UXHS27O6.cjs +0 -75
  993. package/dist/chunk-UYIHRDE4.cjs +0 -97
  994. package/dist/chunk-V2FTMRS7.mjs +0 -223
  995. package/dist/chunk-VB6UCX3V.cjs +0 -421
  996. package/dist/chunk-VDRM36QB.cjs +0 -963
  997. package/dist/chunk-VEKFLAQM.cjs +0 -300
  998. package/dist/chunk-VHRS3MCW.cjs +0 -196
  999. package/dist/chunk-VNPXKF3G.cjs +0 -314
  1000. package/dist/chunk-VQDBNVOO.cjs +0 -14
  1001. package/dist/chunk-VQGKD7RV.mjs +0 -25
  1002. package/dist/chunk-VTBXE6QG.mjs +0 -476
  1003. package/dist/chunk-W3B4PKAW.mjs +0 -28
  1004. package/dist/chunk-W4E7WMXE.cjs +0 -71
  1005. package/dist/chunk-WBKEZXWE.cjs +0 -449
  1006. package/dist/chunk-WDMIW6Q6.mjs +0 -145
  1007. package/dist/chunk-WLHA5USH.cjs +0 -1514
  1008. package/dist/chunk-WMAPPDMM.cjs +0 -28
  1009. package/dist/chunk-WMBRZI5V.mjs +0 -416
  1010. package/dist/chunk-WMHG64DA.mjs +0 -417
  1011. package/dist/chunk-WMOGFOUJ.cjs +0 -223
  1012. package/dist/chunk-WNSDDRNU.mjs +0 -24
  1013. package/dist/chunk-WPJQN64R.mjs +0 -755
  1014. package/dist/chunk-WROEFVNO.cjs +0 -236
  1015. package/dist/chunk-WU7ZS3EM.cjs +0 -440
  1016. package/dist/chunk-WWYXIECF.mjs +0 -929
  1017. package/dist/chunk-X3GMHKO3.cjs +0 -62
  1018. package/dist/chunk-X3NGFVRF.mjs +0 -237
  1019. package/dist/chunk-XIZO5VDA.cjs +0 -1210
  1020. package/dist/chunk-XJJVLDM6.mjs +0 -194
  1021. package/dist/chunk-XJXBIP67.cjs +0 -277
  1022. package/dist/chunk-XNPDONUH.mjs +0 -389
  1023. package/dist/chunk-XSIRSMAS.cjs +0 -339
  1024. package/dist/chunk-XUC6CFLE.mjs +0 -1514
  1025. package/dist/chunk-XUGFRFD2.mjs +0 -39
  1026. package/dist/chunk-XZNTNMHT.mjs +0 -15
  1027. package/dist/chunk-Y5RG6B7S.mjs +0 -77
  1028. package/dist/chunk-YFILVET3.mjs +0 -192
  1029. package/dist/chunk-YFPGHF5F.cjs +0 -202
  1030. package/dist/chunk-YHOCRI4H.mjs +0 -434
  1031. package/dist/chunk-YJRZR7VU.cjs +0 -28
  1032. package/dist/chunk-YKUEJ3MG.cjs +0 -229
  1033. package/dist/chunk-YN2QEMMO.cjs +0 -714
  1034. package/dist/chunk-YOZYCI6Z.mjs +0 -73
  1035. package/dist/chunk-YWCYV7QC.cjs +0 -54
  1036. package/dist/chunk-YX3DBN4M.cjs +0 -18
  1037. package/dist/chunk-YYQVGKO5.mjs +0 -394
  1038. package/dist/chunk-YZAKIXRL.cjs +0 -67
  1039. package/dist/chunk-Z2RZJZIZ.mjs +0 -168
  1040. package/dist/chunk-Z3HATSKO.mjs +0 -46
  1041. package/dist/chunk-ZEG3OPIB.cjs +0 -93
  1042. package/dist/chunk-ZLAT2CWY.mjs +0 -135
  1043. package/dist/chunk-ZQRCSUSB.cjs +0 -25
  1044. package/dist/chunk-ZTP3BJG6.cjs +0 -237
  1045. package/dist/chunk-ZZGQD7A4.mjs +0 -435
  1046. package/dist/chunk-ZZSRYEYU.mjs +0 -53
  1047. package/dist/client-plugins-DEmIQo5R.d.mts +0 -3801
  1048. package/dist/client-plugins-br48Hpmk.d.ts +0 -3801
  1049. package/dist/devtools-5Q7VRKVH.cjs +0 -478
  1050. package/dist/devtools-LJ4IGYGW.mjs +0 -478
  1051. package/dist/devtools-client-CXQ6PXI6.cjs +0 -254
  1052. package/dist/devtools-client-HJS2T34Y.mjs +0 -254
  1053. package/dist/devtools-ui-5GBDIGMK.cjs +0 -1296
  1054. package/dist/devtools-ui-5KDAVPIF.mjs +0 -1296
  1055. package/dist/index-CyD9Rfso.d.ts +0 -48
  1056. package/dist/index-_nhUt_dh.d.mts +0 -48
  1057. package/dist/integration-orm-P2II2EBK.cjs +0 -14
  1058. package/dist/integration-orm-RBKCIQYZ.mjs +0 -14
  1059. package/dist/layers-UTB43B7A.mjs +0 -18
  1060. package/dist/layers-VUWIOFEO.cjs +0 -18
  1061. package/dist/manager-RT733VRK.mjs +0 -14
  1062. package/dist/manager-XZ5TX7AO.cjs +0 -14
  1063. package/dist/nitro-KDACKNHU.mjs +0 -654
  1064. package/dist/nitro-NPGU6VBT.cjs +0 -654
  1065. package/dist/node-module-bundle-L5L7JCZ4.mjs +0 -11
  1066. package/dist/node-module-bundle-VAFZOXMJ.cjs +0 -11
  1067. package/dist/plugin-DBBZ4JI2.cjs +0 -32
  1068. package/dist/plugin-SYMK7PQ2.mjs +0 -32
  1069. package/dist/production-runtime-BEbIyIUe.d.mts +0 -123
  1070. package/dist/production-runtime-DsHjccVI.d.ts +0 -123
  1071. package/dist/programmatic-routes-client-DlMKstmL.d.ts +0 -184
  1072. package/dist/programmatic-routes-client-Dqr6tHND.d.mts +0 -184
  1073. package/dist/render-plan-Bu6XOxNg.d.mts +0 -25
  1074. package/dist/render-plan-MefW_fLC.d.ts +0 -25
  1075. package/dist/request-BBe1B8Bk.d.mts +0 -24
  1076. package/dist/request-CMsRJQK3.d.ts +0 -24
  1077. package/dist/route-rendering-DTLNruPw.d.ts +0 -44
  1078. package/dist/route-rendering-Do8tuYgh.d.mts +0 -44
  1079. package/dist/router-BJreOZ-k.d.ts +0 -50
  1080. package/dist/router-o2mZB9Y4.d.mts +0 -50
  1081. package/dist/rsc-pipeline-4ZJ6GUVQ.cjs +0 -78
  1082. package/dist/rsc-pipeline-KK6GFDET.mjs +0 -78
  1083. package/dist/runtime-Cp5YZNz4.d.mts +0 -69
  1084. package/dist/runtime-Da57KD8F.d.ts +0 -69
  1085. package/dist/schema-dev-notice-77ZL23PL.cjs +0 -58
  1086. package/dist/schema-dev-notice-BLXOS6U2.mjs +0 -58
  1087. package/dist/search-client-G3RICOFU.cjs +0 -13
  1088. package/dist/search-client-KR7YRIVR.mjs +0 -13
  1089. package/dist/spa-router-CN2vc0GY.d.ts +0 -239
  1090. package/dist/spa-router-COZLIB7k.d.mts +0 -239
  1091. package/dist/utils-BAtVIHfw.d.mts +0 -48
  1092. package/dist/utils-Y8MZrj4b.d.ts +0 -48
@@ -0,0 +1,3922 @@
1
+ import { n as FarmClientPlugin } from './lifecycle-DK06VuKP.mjs';
2
+ import { b as PluginRoutes, c as PluginRoutesFactory, d as RouteMethod, F as FarmIntegrationAPI, f as FarmIntegrationAPIMethod, e as FarmIntegrationAPIBodyFormat, h as FarmIntegrationAPIResponseFormat, g as FarmIntegrationAPIOperation, i as FarmIntegrationRouteOperationCarrier, I as InferIntegrationAPIFromRoutes } from './route-2_yXC6gv.mjs';
3
+ import { FarmRenderer } from './renderer.mjs';
4
+ import { IncomingMessage, ServerResponse } from 'http';
5
+ import { E as EndpointMCPMetadata, T as TypedEndpoint, R as RouteSchema, d as RouteSchemaOutput, e as RouteSchemaInput, Y as OpenAPISecurityMode } from './endpoint-BkMSCRf6.mjs';
6
+ import { ServerFn } from './server-fn.mjs';
7
+ import { ServerQuery } from './server-query.mjs';
8
+ import { F as FarmStorageUserConfig } from './types-BnIqOn9w.mjs';
9
+ import { FarmSchemaModel, FarmSchemaField, FarmSchema, FarmSchemaReference, FarmSchemaConfig, FarmSchemaConstraint, FarmSchemaFieldType, FarmSchemaModelExtension, FarmSchemaModelOverride, defineSchema } from './schema.mjs';
10
+ import React__default, { ComponentType, ReactNode } from 'react';
11
+ import { OrmClient, SchemaDefinition, ModelDefinition, FieldBuilder, JsonValue, AnyModelDefinition, SchemaModels } from '@farming-labs/orm';
12
+ import { DocsConfig } from '@farming-labs/docs';
13
+ import { p as FarmObservabilityUserConfig } from './observability-B2363jB6.mjs';
14
+ import * as vite from 'vite';
15
+ import { ViteDevServer, UserConfig } from 'vite';
16
+ import { n as FarmWorkflowsUserConfig, f as FarmServerConfig, F as FarmWorkflowsResolvedConfig, R as ResolvedFarmServerConfig } from './workflows-Df1C_7OG.mjs';
17
+ import { FarmCronUserConfig, FarmCronResolvedConfig } from './cron.mjs';
18
+ import { ResolvedFarmEnv, FarmEnvConfig } from './env.mjs';
19
+ import { FarmServerActionsConfig, ResolvedFarmServerActionsConfig } from './server-action-security.mjs';
20
+ import { F as FarmLayerEntry, R as ResolvedFarmLayer } from './layers-D9fbe-rz.mjs';
21
+ import { a as FarmImageConfig, R as ResolvedFarmImageConfig } from './image-config-CeDgNyX4.mjs';
22
+ import { k as FarmI18nUserConfig, R as ResolvedFarmI18nConfig } from './types--Wh02r5_.mjs';
23
+ import { FarmCacheUserConfig } from './cache.mjs';
24
+ import { R as ResolvedFarmThemeConfig, d as FarmThemeConfig } from './types-DQnyD3VD.mjs';
25
+ import { FarmLayoutFonts } from './font.mjs';
26
+
27
+ /**
28
+ * Integration auth routes accept ordinary form posts, which browsers send
29
+ * cross-site without a CORS preflight. Without an origin check, a third-party
30
+ * page can submit credentials to an app's own sign-in route and plant an
31
+ * attacker-controlled session in the victim's browser (login CSRF), or drive a
32
+ * forced sign-out. This mirrors the server-action origin contract so both
33
+ * entry points reject the same requests.
34
+ */
35
+ type IntegrationOriginRejection = "missing-origin" | "opaque-origin" | "invalid-origin" | "cross-site";
36
+ type IntegrationOriginResult = {
37
+ ok: true;
38
+ } | {
39
+ ok: false;
40
+ reason: IntegrationOriginRejection;
41
+ };
42
+ interface IntegrationOriginPolicy {
43
+ /** Extra trusted origins, using the `serverActions.allowedOrigins` pattern syntax. */
44
+ allowedOrigins?: readonly string[];
45
+ /**
46
+ * Whether a request carrying no origin metadata at all must be rejected.
47
+ *
48
+ * Form posts always carry an Origin header in supported browsers, so
49
+ * state-changing POSTs default to rejecting (`true`). Top-level GET
50
+ * navigations legitimately arrive with no Origin and no Referer — a typed
51
+ * URL or a bookmark — so GET callers pass `false` to avoid breaking them.
52
+ */
53
+ requireOriginMetadata?: boolean;
54
+ }
55
+ /**
56
+ * Resolve configured origin patterns once, at integration construction, so an
57
+ * invalid pattern fails loudly at startup instead of per request.
58
+ */
59
+ declare function resolveIntegrationAllowedOrigins(values: readonly string[] | undefined, label: string): readonly string[];
60
+ declare function validateIntegrationRequestOrigin(request: Request, policy?: IntegrationOriginPolicy): IntegrationOriginResult;
61
+ declare function describeIntegrationOriginRejection(reason: IntegrationOriginRejection): string;
62
+
63
+ /**
64
+ * `experimental.serverComponents`: which engine renders server components.
65
+ *
66
+ * - `"rsc"`: React's Flight pipeline (`@farm.js/plugin/rsc` on `@vitejs/plugin-rsc`).
67
+ * - `"islands"`: Farm's own engine (RFC 0003), on Farm's pipeline. Experimental.
68
+ *
69
+ * `true` means `{ mode: "rsc" }`. Both modes share one authoring contract.
70
+ */
71
+ type FarmServerComponentsMode = "rsc" | "islands";
72
+ interface FarmServerComponentsOptions {
73
+ mode: FarmServerComponentsMode;
74
+ }
75
+ type FarmServerComponentsConfig = boolean | FarmServerComponentsOptions;
76
+
77
+ /**
78
+ * `agent.manifest`: which sections `/.well-known/farmjs.json` shows. Every section is shown by
79
+ * default; a section set to `false` is served as `null` (hidden by the app), unlike an empty
80
+ * list, which means there is nothing to show.
81
+ */
82
+ /** Per-section options for `/.well-known/farmjs.json`. Every section is shown by default. */
83
+ interface FarmAppManifestConfig {
84
+ /**
85
+ * The `app` section. `false` serves `app: null`; an object leaves out the Farm version
86
+ * (`version`), the `renderer` or the `build` ID. `basePath` is always kept.
87
+ *
88
+ * @default true
89
+ */
90
+ app?: boolean | {
91
+ version?: boolean;
92
+ renderer?: boolean;
93
+ build?: boolean;
94
+ };
95
+ /**
96
+ * Installed `@farm.js/*` and `@farming-labs/*` packages. `"names"` lists them with `null`
97
+ * versions; `false` serves `packages: null`.
98
+ *
99
+ * @default true
100
+ */
101
+ packages?: boolean | "names";
102
+ /**
103
+ * MCP servers and their tools. `schemas: false` drops tools' `inputSchema` and
104
+ * `outputSchema`; `hide` leaves out a server (`"store"`) or one of its tools
105
+ * (`"store/list_orders"`). `false` serves `mcp: null`.
106
+ *
107
+ * @default true
108
+ */
109
+ mcp?: boolean | {
110
+ schemas?: boolean;
111
+ hide?: string[];
112
+ };
113
+ /**
114
+ * WebMCP browser tools. `hide` leaves out tools by name; `false` serves `webmcp: null`.
115
+ *
116
+ * @default true
117
+ */
118
+ webmcp?: boolean | {
119
+ hide?: string[];
120
+ };
121
+ /** Integration keys, categories and providers. `false` serves `integrations: null`. */
122
+ integrations?: boolean;
123
+ /** The app's agent surfaces (API catalog, llms.txt, OpenAPI). `false` serves `agent: null`. */
124
+ agent?: boolean;
125
+ /** Plugin names. `false` serves `plugins: null`. */
126
+ plugins?: boolean;
127
+ }
128
+ interface ResolvedFarmAppManifestConfig {
129
+ app: false | {
130
+ version: boolean;
131
+ renderer: boolean;
132
+ build: boolean;
133
+ };
134
+ packages: boolean | "names";
135
+ mcp: false | {
136
+ schemas: boolean;
137
+ hide: string[];
138
+ };
139
+ webmcp: false | {
140
+ hide: string[];
141
+ };
142
+ integrations: boolean;
143
+ agent: boolean;
144
+ plugins: boolean;
145
+ }
146
+
147
+ declare const DEFAULT_FARM_DEVTOOLS_SHORTCUT = "mod+shift+.";
148
+ declare const FARM_DEVTOOLS_PATH = "/__farm/devtools";
149
+ declare const FARM_DEVTOOLS_LAUNCH_PARAM = "__farm_devtools";
150
+ /**
151
+ * Configuration for the built-in DevTools dashboard. The dashboard is deprecated in favor
152
+ * of the `@farm.js/devtools` plugin, which reuses this configuration for enablement and
153
+ * the keyboard shortcut. Both options keep working while the built-in UI remains available.
154
+ */
155
+ interface FarmDevtoolsConfig {
156
+ /** Enable the development-only DevTools UI and runtime endpoints. */
157
+ enabled?: boolean;
158
+ /** Keyboard shortcut used to toggle DevTools, or false to disable the shortcut. */
159
+ shortcut?: string | false;
160
+ }
161
+ type FarmDevtoolsUserConfig = boolean | FarmDevtoolsConfig;
162
+ interface ResolvedFarmDevtoolsConfig {
163
+ enabled: boolean;
164
+ shortcut: string | false;
165
+ }
166
+ declare function resolveFarmDevtoolsConfig(config: FarmDevtoolsUserConfig | ResolvedFarmDevtoolsConfig | undefined, mode?: "development" | "production"): ResolvedFarmDevtoolsConfig;
167
+
168
+ type ResolvedSchemaField = FarmSchemaField & {
169
+ name: string;
170
+ };
171
+ type ResolvedSchemaModel = Omit<FarmSchemaModel, "fields"> & {
172
+ name: string;
173
+ fields: Record<string, ResolvedSchemaField>;
174
+ };
175
+ /**
176
+ * Resolve a schema's extensions, overrides, and name mappings.
177
+ *
178
+ * Table and column names fall back to the schema's own keys, which is what the
179
+ * runtime ORM uses. Any other default would generate artifacts describing
180
+ * tables the app cannot actually read.
181
+ */
182
+ declare function resolveSchemaModels(ownerKey: string, schema: FarmSchema): Record<string, ResolvedSchemaModel>;
183
+
184
+ type FarmSqlDialect = "postgres" | "mysql" | "sqlite";
185
+ type CollectedSchemaModel = {
186
+ /** Namespace that owns the model: an integration key or a plugin name. */
187
+ ownerKey: string;
188
+ modelKey: string;
189
+ modelName: string;
190
+ exportName: string;
191
+ prismaModelName: string;
192
+ model: ResolvedSchemaModel;
193
+ /**
194
+ * Real table and column for references to models this owner describes but
195
+ * does not create (external, or outside its `models`), keyed by field. Only
196
+ * shown in comments: Farm never creates a foreign key to them.
197
+ */
198
+ referenceTargets?: Record<string, {
199
+ table: string;
200
+ column: string;
201
+ }>;
202
+ /**
203
+ * References to tables other owners create that may carry a real foreign
204
+ * key, keyed by field. Set by migrate after checking the database; only a
205
+ * table created now gets one inline.
206
+ */
207
+ foreignKeys?: Record<string, {
208
+ table: string;
209
+ column: string;
210
+ onDelete: NonNullable<FarmSchemaReference["onDelete"]>;
211
+ }>;
212
+ };
213
+ /** `table.column` a field's reference points at, using real names when known. */
214
+ declare function describeSchemaReference(model: CollectedSchemaModel, fieldKey: string): string;
215
+ /**
216
+ * Flatten owners' schemas into one list, rejecting two models that would
217
+ * resolve to the same table.
218
+ *
219
+ * `only` narrows an owner to the models it actually controls; an owner handed a
220
+ * schema it shares with the rest of the app should not claim all of it.
221
+ */
222
+ declare function collectSchemaModels(entries: ReadonlyArray<readonly [string, FarmSchema, (readonly string[])?]>): CollectedSchemaModel[];
223
+ type FarmSqlStatement = {
224
+ kind: "table" | "index" | "column";
225
+ /** The object this statement creates, for drift reporting. */
226
+ target: string;
227
+ sql: string;
228
+ };
229
+ /**
230
+ * Emit create statements for a set of models.
231
+ *
232
+ * Everything here is derivable from the schema: nothing is inferred from a live
233
+ * database, so the output is stable and reviewable before it is applied.
234
+ */
235
+ declare function generateSqlStatements(models: readonly CollectedSchemaModel[], dialect: FarmSqlDialect): FarmSqlStatement[];
236
+ /** Render models as a standalone `.sql` file. */
237
+ declare function renderSqlSchemaFile(models: readonly CollectedSchemaModel[], dialect: FarmSqlDialect): string;
238
+ declare function getSqlColumnType(field: ResolvedSchemaField, dialect: FarmSqlDialect): "BOOLEAN" | "INTEGER" | "DOUBLE PRECISION" | "TIMESTAMPTZ" | "JSONB" | "TEXT" | "INT" | "DOUBLE" | "DATETIME" | "JSON" | "VARCHAR(255)" | "REAL";
239
+ declare function getSqlDefaultExpression(field: ResolvedSchemaField, dialect: FarmSqlDialect): string | null;
240
+ declare function isNullableField(field: ResolvedSchemaField): boolean;
241
+ declare function quoteSqlIdentifier(dialect: FarmSqlDialect, value: string): string;
242
+ declare function toSnakeCase(value: string): string;
243
+ declare function toPascalCase(value: string): string;
244
+ declare function toCamelCase(value: string): string;
245
+ declare function escapeSqlString(value: string, dialect?: FarmSqlDialect): string;
246
+
247
+ /**
248
+ * An ordered change a plugin release makes to its own tables that Farm will
249
+ * not infer: a rename looks exactly like a removal plus an addition. Each step
250
+ * runs once per database, in the order listed.
251
+ *
252
+ * Names are the plugin's own: `model` and `to` are keys in the current
253
+ * schema, so the app's renames apply; `from` is the old name in the database.
254
+ */
255
+ type FarmSchemaMigrationStep = {
256
+ id: string;
257
+ description?: string;
258
+ } & ({
259
+ renameColumn: {
260
+ model: string;
261
+ from: string;
262
+ to: string;
263
+ };
264
+ } | {
265
+ renameTable: {
266
+ from: string;
267
+ to: string;
268
+ };
269
+ }
270
+ /**
271
+ * Deletes data, so it runs only with `--allow-destructive`, and only on a
272
+ * column or table Farm recorded this plugin creating.
273
+ */
274
+ | {
275
+ dropColumn: {
276
+ model: string;
277
+ column: string;
278
+ };
279
+ } | {
280
+ dropTable: {
281
+ table: string;
282
+ };
283
+ } | {
284
+ /** Per dialect; a dialect without SQL cannot run the step. */
285
+ sql: Partial<Record<FarmSqlDialect, string | readonly string[]>>;
286
+ /**
287
+ * Custom SQL runs after this release's new tables and columns exist, so
288
+ * a backfill can fill them. Set `before` to run it with the renames.
289
+ */
290
+ before?: boolean;
291
+ });
292
+
293
+ /**
294
+ * Typed, validated plugin options.
295
+ *
296
+ * A plugin factory takes one options object. Describing it with a Standard
297
+ * Schema (Zod, Valibot, ArkType, ...) gives the call site its input type for
298
+ * autocomplete, gives the plugin the parsed type with defaults applied, and
299
+ * rejects bad options while the config loads instead of deep inside a hook.
300
+ */
301
+ type MaybePromise$2<T> = T | Promise<T>;
302
+ type FarmPluginOptionsIssuePathSegment = PropertyKey | {
303
+ readonly key: PropertyKey;
304
+ };
305
+ interface FarmPluginOptionsIssue {
306
+ readonly message: string;
307
+ readonly path?: ReadonlyArray<FarmPluginOptionsIssuePathSegment> | undefined;
308
+ }
309
+ type FarmPluginOptionsResult<TOutput> = {
310
+ readonly value: TOutput;
311
+ readonly issues?: undefined;
312
+ } | {
313
+ readonly issues: ReadonlyArray<FarmPluginOptionsIssue>;
314
+ };
315
+ /** The part of the Standard Schema interface plugin options need. */
316
+ interface FarmPluginOptionsSchema<TInput = unknown, TOutput = TInput> {
317
+ readonly "~standard": {
318
+ readonly version: 1;
319
+ readonly vendor: string;
320
+ readonly validate: (value: unknown) => MaybePromise$2<FarmPluginOptionsResult<TOutput>>;
321
+ readonly types?: {
322
+ readonly input: TInput;
323
+ readonly output: TOutput;
324
+ } | undefined;
325
+ };
326
+ }
327
+ /** What the app passes to the plugin factory. */
328
+ type InferPluginOptionsInput<TSchema> = TSchema extends FarmPluginOptionsSchema<infer TInput, any> ? TInput : never;
329
+ /** What the plugin receives, after parsing and defaults. */
330
+ type InferPluginOptionsOutput<TSchema> = TSchema extends FarmPluginOptionsSchema<any, infer TOutput> ? TOutput : never;
331
+ /**
332
+ * The factory a plugin exports. Options can be left out when every option is
333
+ * optional, so `plugin()` and `plugin({})` mean the same thing.
334
+ */
335
+ type FarmPluginFactory<TInput, TPlugin> = {} extends TInput ? (options?: TInput) => TPlugin : (options: TInput) => TPlugin;
336
+ /** Thrown when an app passes options its plugin's schema rejects. */
337
+ declare class FarmPluginOptionsError extends TypeError {
338
+ readonly issues: ReadonlyArray<FarmPluginOptionsIssue>;
339
+ constructor(issues: ReadonlyArray<FarmPluginOptionsIssue>);
340
+ }
341
+
342
+ type MaybePromise$1<T> = T | Promise<T>;
343
+ /** @internal Marks a Node response whose intercepted end is awaiting response hooks. */
344
+ declare const FARM_NODE_RESPONSE_END_PENDING: unique symbol;
345
+ declare const FARM_PLUGIN_INTEGRATION_INSTANCE: unique symbol;
346
+ declare const FARM_PLUGIN_INTEGRATION_BOUND: unique symbol;
347
+ interface FarmPluginIntegrationContext<TInstance = unknown> {
348
+ /** Key used to register the integration in farm.config.ts. */
349
+ readonly key: string;
350
+ readonly category: string;
351
+ readonly type: string;
352
+ readonly instance: TInstance;
353
+ readonly serverRuntime: boolean;
354
+ }
355
+ declare class FarmRuntimeShutdownError extends Error {
356
+ readonly errors: readonly unknown[];
357
+ constructor(message: string, errors: readonly unknown[]);
358
+ }
359
+ interface PluginRequestContext {
360
+ set: (target: FarmRequest | Request, key: string, value: any, options?: {
361
+ exposeToPage?: boolean;
362
+ }) => void;
363
+ get: <T = any>(target: FarmRequest | Request, key: string) => T | undefined;
364
+ has: (target: FarmRequest | Request, key: string) => boolean;
365
+ delete: (target: FarmRequest | Request, key: string) => boolean;
366
+ clear: (target: FarmRequest | Request) => void;
367
+ getAll: (target: FarmRequest | Request, options?: {
368
+ exposedOnly?: boolean;
369
+ }) => Map<string, any>;
370
+ }
371
+ interface FarmRequestStore {
372
+ set(key: string, value: unknown, options?: {
373
+ exposeToPage?: boolean;
374
+ }): void;
375
+ get<T = unknown>(key: string): T | undefined;
376
+ has(key: string): boolean;
377
+ delete(key: string): boolean;
378
+ clear(): void;
379
+ snapshot(options?: {
380
+ exposedOnly?: boolean;
381
+ }): Map<string, unknown>;
382
+ }
383
+ interface FarmPluginContext<TIntegrationInstance = unknown> {
384
+ config: FarmConfig;
385
+ viteServer?: ViteDevServer;
386
+ isDev: boolean;
387
+ isProd: boolean;
388
+ /** The owning integration when this plugin is contributed through `integration.plugins`. */
389
+ readonly integration?: Readonly<FarmPluginIntegrationContext<TIntegrationInstance>>;
390
+ /** Register resource cleanup that must run when the application runtime closes. */
391
+ lifecycle: FarmPluginLifecycle;
392
+ /** @deprecated Use `ctx.req` inside request hooks. */
393
+ requestContext: PluginRequestContext;
394
+ }
395
+ type FarmPluginHookContext<TContext, TIntegrationInstance, TIntegrationBound extends boolean> = TIntegrationBound extends true ? Omit<TContext, "integration"> & {
396
+ /** The owning integration bound by `definePlugin.forIntegration<T>()`. */
397
+ readonly integration: Readonly<FarmPluginIntegrationContext<TIntegrationInstance>>;
398
+ } : TContext;
399
+ interface FarmPluginLifecycle {
400
+ /**
401
+ * Register a database, storage, queue, or other resource disposer.
402
+ * Disposers run once in reverse registration order after plugin shutdown hooks.
403
+ */
404
+ onShutdown(dispose: () => void | Promise<void>): () => void;
405
+ }
406
+ interface FarmRequestPluginContext<TIntegrationInstance = unknown> extends FarmPluginContext<TIntegrationInstance> {
407
+ /** Request-scoped values for the current hook invocation. */
408
+ readonly req: FarmRequestStore;
409
+ }
410
+ interface RouteDiscoveredPayload {
411
+ kind: "page" | "layout";
412
+ pattern: string;
413
+ modulePath: string;
414
+ }
415
+ interface RoutesGeneratedPayload {
416
+ routes: RouteDiscoveredPayload[];
417
+ pageCount: number;
418
+ layoutCount: number;
419
+ }
420
+ interface MiddlewareDiscoveredPayload {
421
+ path: string;
422
+ filePath: string;
423
+ handlerCount: number;
424
+ }
425
+ interface APIRouteDiscoveredPayload {
426
+ path: string;
427
+ filePath: string;
428
+ methods: string[];
429
+ }
430
+ interface RouteMatchPayload {
431
+ pathname: string;
432
+ method?: string;
433
+ }
434
+ interface RouteMatchResultPayload {
435
+ pathname: string;
436
+ matched: boolean;
437
+ routePattern: string | null;
438
+ params: Record<string, string>;
439
+ layoutPatterns: string[];
440
+ }
441
+ interface RenderLifecyclePayload {
442
+ pathname: string;
443
+ method: string;
444
+ routePattern: string | null;
445
+ params: Record<string, string>;
446
+ }
447
+ interface APIHandlerLifecyclePayload {
448
+ pathname: string;
449
+ method: string;
450
+ routePath?: string;
451
+ }
452
+ interface ErrorLifecyclePayload {
453
+ phase: string;
454
+ error: unknown;
455
+ meta?: Record<string, unknown>;
456
+ }
457
+ interface HMRUpdatePayload {
458
+ file: string;
459
+ modules: string[];
460
+ }
461
+ interface BundleLifecyclePayload {
462
+ root: string;
463
+ preset: string;
464
+ universal: boolean;
465
+ distDir: string;
466
+ outputDir?: string;
467
+ }
468
+ interface BundleResultPayload extends BundleLifecyclePayload {
469
+ success: boolean;
470
+ }
471
+ interface NitroBuildLifecyclePayload {
472
+ root: string;
473
+ preset: string;
474
+ distDir: string;
475
+ outputDir: string;
476
+ }
477
+ interface ShutdownPayload {
478
+ reason: string;
479
+ }
480
+ type FarmPluginRuntimeKind = "request" | "endpoint" | "page" | "api" | "action" | "integration" | "docs" | "asset" | (string & {});
481
+ interface FarmPluginRouteRuntimePayload {
482
+ pathname: string;
483
+ pattern?: string | null;
484
+ params?: Record<string, string>;
485
+ }
486
+ interface FarmPluginSetupContext<TIntegrationInstance = unknown> extends FarmPluginContext<TIntegrationInstance> {
487
+ env: ResolvedFarmEnv;
488
+ }
489
+ interface FarmPluginStateContext<TState = unknown, TIntegrationInstance = unknown> extends FarmPluginContext<TIntegrationInstance> {
490
+ state: TState;
491
+ }
492
+ interface FarmPluginRuntimeBaseEvent<TState = unknown, TIntegrationInstance = unknown> extends FarmPluginStateContext<TState, TIntegrationInstance> {
493
+ request: Request;
494
+ /** Request-scoped values shared by plugin hooks. */
495
+ req: FarmRequestStore;
496
+ kind: FarmPluginRuntimeKind;
497
+ route?: FarmPluginRouteRuntimePayload;
498
+ signal: AbortSignal;
499
+ waitUntil(promise: Promise<unknown>): void;
500
+ }
501
+ type FarmPluginRuntimeContextEvent<TState = unknown, TIntegrationInstance = unknown> = FarmPluginRuntimeBaseEvent<TState, TIntegrationInstance>;
502
+ interface FarmPluginRuntimeEndpointEvent<TState = unknown, TIntegrationInstance = unknown> extends FarmPluginRuntimeBaseEvent<TState, TIntegrationInstance> {
503
+ /** Normalized application-relative path registered by the endpoint. */
504
+ path: string;
505
+ }
506
+ interface FarmPluginRuntimeEndpoint<TState = unknown, TIntegrationInstance = unknown, TIntegrationBound extends boolean = false> {
507
+ /** Exact application-relative pathname, before Farm's configured basePath. */
508
+ path: string;
509
+ handler(event: FarmPluginRuntimeEventFor<FarmPluginRuntimeEndpointEvent<TState, TIntegrationInstance>, TIntegrationInstance, TIntegrationBound>): MaybePromise$1<Response>;
510
+ }
511
+ interface FarmPluginRuntimeBeforeEvent<TState = unknown, TRequestContext extends object = Record<string, unknown>, TIntegrationInstance = unknown> extends FarmPluginRuntimeBaseEvent<TState, TIntegrationInstance> {
512
+ ctx: Readonly<TRequestContext>;
513
+ }
514
+ interface FarmPluginRuntimeAfterEvent<TState = unknown, TRequestContext extends object = Record<string, unknown>, TIntegrationInstance = unknown> extends FarmPluginRuntimeBeforeEvent<TState, TRequestContext, TIntegrationInstance> {
515
+ response: Response;
516
+ durationMs: number;
517
+ }
518
+ interface FarmPluginRuntimeErrorEvent<TState = unknown, TRequestContext extends object = Record<string, unknown>, TIntegrationInstance = unknown> extends FarmPluginRuntimeBeforeEvent<TState, TRequestContext, TIntegrationInstance> {
519
+ error: unknown;
520
+ durationMs: number;
521
+ }
522
+ type FarmPluginRuntimeStartEvent<TState = unknown, TIntegrationInstance = unknown> = FarmPluginStateContext<TState, TIntegrationInstance>;
523
+ interface FarmPluginRuntimeCloseEvent<TState = unknown, TIntegrationInstance = unknown> extends FarmPluginStateContext<TState, TIntegrationInstance>, ShutdownPayload {
524
+ }
525
+ type FarmPluginContextFor<TIntegrationInstance, TIntegrationBound extends boolean> = FarmPluginHookContext<FarmPluginContext<TIntegrationInstance>, TIntegrationInstance, TIntegrationBound>;
526
+ type FarmRequestPluginContextFor<TIntegrationInstance, TIntegrationBound extends boolean> = FarmPluginHookContext<FarmRequestPluginContext<TIntegrationInstance>, TIntegrationInstance, TIntegrationBound>;
527
+ type FarmPluginSetupContextFor<TIntegrationInstance, TIntegrationBound extends boolean> = FarmPluginHookContext<FarmPluginSetupContext<TIntegrationInstance>, TIntegrationInstance, TIntegrationBound>;
528
+ type FarmPluginStateContextFor<TState, TIntegrationInstance, TIntegrationBound extends boolean> = FarmPluginHookContext<FarmPluginStateContext<TState, TIntegrationInstance>, TIntegrationInstance, TIntegrationBound>;
529
+ type FarmPluginRuntimeEventFor<TEvent, TIntegrationInstance, TIntegrationBound extends boolean> = FarmPluginHookContext<TEvent, TIntegrationInstance, TIntegrationBound>;
530
+ interface FarmPluginRuntimeHooks<TState = unknown, TRequestContext extends object = Record<string, unknown>, TIntegrationInstance = unknown, TIntegrationBound extends boolean = false> {
531
+ /** Exact request endpoints owned by this plugin. */
532
+ endpoints?: readonly FarmPluginRuntimeEndpoint<TState, TIntegrationInstance, TIntegrationBound>[];
533
+ /**
534
+ * Whether a response `before` lets through may be stored by a shared cache (a CDN). `before`
535
+ * runs for every request and may be a guard, so by default (`"private"`) Farm sends those
536
+ * responses with `Cache-Control: private, no-store`. Set `"public"` when `before` never
537
+ * decides who may read a response, as for logging or analytics.
538
+ */
539
+ cache?: "private" | "public";
540
+ start?(event: FarmPluginRuntimeEventFor<FarmPluginRuntimeStartEvent<TState, TIntegrationInstance>, TIntegrationInstance, TIntegrationBound>): MaybePromise$1<void>;
541
+ context?(event: FarmPluginRuntimeEventFor<FarmPluginRuntimeContextEvent<TState, TIntegrationInstance>, TIntegrationInstance, TIntegrationBound>): MaybePromise$1<TRequestContext>;
542
+ before?(event: FarmPluginRuntimeEventFor<FarmPluginRuntimeBeforeEvent<TState, TRequestContext, TIntegrationInstance>, TIntegrationInstance, TIntegrationBound>): MaybePromise$1<Request | Response | void>;
543
+ after?(event: FarmPluginRuntimeEventFor<FarmPluginRuntimeAfterEvent<TState, TRequestContext, TIntegrationInstance>, TIntegrationInstance, TIntegrationBound>): MaybePromise$1<Response | void>;
544
+ error?(event: FarmPluginRuntimeEventFor<FarmPluginRuntimeErrorEvent<TState, TRequestContext, TIntegrationInstance>, TIntegrationInstance, TIntegrationBound>): MaybePromise$1<void>;
545
+ close?(event: FarmPluginRuntimeEventFor<FarmPluginRuntimeCloseEvent<TState, TIntegrationInstance>, TIntegrationInstance, TIntegrationBound>): MaybePromise$1<void>;
546
+ }
547
+ interface FarmPluginRuntimeRequestOptions {
548
+ kind?: FarmPluginRuntimeKind;
549
+ route?: FarmPluginRouteRuntimePayload;
550
+ waitUntil?: (promise: Promise<unknown>) => void;
551
+ }
552
+ type FarmPluginRuntimeRequestHandler = (request: Request) => MaybePromise$1<Response>;
553
+ interface FarmPluginRuntimeSession {
554
+ request: Request;
555
+ response?: Response;
556
+ ctx: Readonly<Record<string, unknown>>;
557
+ startedAt: number;
558
+ options: FarmPluginRuntimeRequestOptions;
559
+ waitUntil(promise: Promise<unknown>): void;
560
+ }
561
+ type FarmPluginDiscoveredRoute = RouteDiscoveredPayload | ({
562
+ kind: "middleware";
563
+ } & MiddlewareDiscoveredPayload) | ({
564
+ kind: "api";
565
+ } & APIRouteDiscoveredPayload);
566
+ interface FarmPluginRouterHooks<TState = unknown, TIntegrationInstance = unknown, TIntegrationBound extends boolean = false> {
567
+ discovered?(route: FarmPluginDiscoveredRoute, context: FarmPluginStateContextFor<TState, TIntegrationInstance, TIntegrationBound>): MaybePromise$1<void>;
568
+ generated?(routes: RoutesGeneratedPayload, context: FarmPluginStateContextFor<TState, TIntegrationInstance, TIntegrationBound>): MaybePromise$1<void>;
569
+ before?(route: RouteMatchPayload, context: FarmPluginStateContextFor<TState, TIntegrationInstance, TIntegrationBound>): MaybePromise$1<void>;
570
+ after?(result: RouteMatchResultPayload, context: FarmPluginStateContextFor<TState, TIntegrationInstance, TIntegrationBound>): MaybePromise$1<void>;
571
+ }
572
+ interface FarmPluginRenderHooks<TState = unknown, TIntegrationInstance = unknown, TIntegrationBound extends boolean = false> {
573
+ before?(render: RenderLifecyclePayload, context: FarmPluginStateContextFor<TState, TIntegrationInstance, TIntegrationBound>): MaybePromise$1<void>;
574
+ html?(html: string, render: RenderLifecyclePayload, context: FarmPluginStateContextFor<TState, TIntegrationInstance, TIntegrationBound>): MaybePromise$1<string | void>;
575
+ }
576
+ interface FarmPluginBuildHooks<TState = unknown, TIntegrationInstance = unknown, TIntegrationBound extends boolean = false> {
577
+ before?(bundle: BundleLifecyclePayload, context: FarmPluginStateContextFor<TState, TIntegrationInstance, TIntegrationBound>): MaybePromise$1<void>;
578
+ configure?(buildConfig: any, context: FarmPluginStateContextFor<TState, TIntegrationInstance, TIntegrationBound>): MaybePromise$1<any>;
579
+ after?(result: BundleResultPayload, context: FarmPluginStateContextFor<TState, TIntegrationInstance, TIntegrationBound>): MaybePromise$1<void>;
580
+ }
581
+ interface FarmPluginDevHooks<TState = unknown, TIntegrationInstance = unknown, TIntegrationBound extends boolean = false> {
582
+ server?(viteServer: ViteDevServer, context: FarmPluginStateContextFor<TState, TIntegrationInstance, TIntegrationBound>): MaybePromise$1<void>;
583
+ update?(update: HMRUpdatePayload, context: FarmPluginStateContextFor<TState, TIntegrationInstance, TIntegrationBound>): MaybePromise$1<void>;
584
+ }
585
+ interface FarmPluginClientConfig<TState = unknown, TPublic = undefined> extends FarmClientPlugin<TState, TPublic> {
586
+ /** Explicitly public, JSON-safe data embedded in the browser bundle. */
587
+ public?: TPublic;
588
+ }
589
+ interface FarmPlugin<TState = any, TRequestContext extends object = Record<string, unknown>, TClientState = any, TClientPublic = any, TIntegrationInstance = unknown, TIntegrationBound extends boolean = false, TRoutes extends PluginRoutes = PluginRoutes> {
590
+ name: string;
591
+ version?: string;
592
+ enforce?: "pre" | "post";
593
+ /** Declarative API routes, mounted through the normal dev and production API pipeline. */
594
+ routes?: PluginRoutesFactory<TRoutes>;
595
+ /** Transform Farm config before the development or production pipeline is created. */
596
+ configure?: (config: FarmConfig, context: FarmPluginContextFor<TIntegrationInstance, TIntegrationBound>) => MaybePromise$1<FarmConfig | void>;
597
+ /** Initialize private plugin state once for this plugin manager. */
598
+ setup?: (context: FarmPluginSetupContextFor<TIntegrationInstance, TIntegrationBound>) => MaybePromise$1<TState>;
599
+ runtime?: FarmPluginRuntimeHooks<TState, TRequestContext, TIntegrationInstance, TIntegrationBound>;
600
+ router?: FarmPluginRouterHooks<TState, TIntegrationInstance, TIntegrationBound>;
601
+ render?: FarmPluginRenderHooks<TState, TIntegrationInstance, TIntegrationBound>;
602
+ build?: FarmPluginBuildHooks<TState, TIntegrationInstance, TIntegrationBound>;
603
+ dev?: FarmPluginDevHooks<TState, TIntegrationInstance, TIntegrationBound>;
604
+ /** Optional browser lifecycle for this logical plugin. */
605
+ client?: FarmPluginClientConfig<TClientState, TClientPublic>;
606
+ /**
607
+ * Tables this plugin stores data in. Farm creates them with
608
+ * `farm <name> migrate` (the part of the plugin name after its last `:` or
609
+ * `/`), includes them in `farm generate` and `farm schema check`, and
610
+ * reaches them through the app's `storage.client`. Mark tables the plugin
611
+ * only reads, such as the app's `user`, with `external: true`.
612
+ */
613
+ schema?: FarmSchema;
614
+ /** Where the `schema` tables live, when not in the app's `storage.client`. */
615
+ database?: FarmPluginDatabase;
616
+ /**
617
+ * Plugins this one needs, by name (`farm:teams` or `teams`) or integration
618
+ * key. The config fails to load when one is missing or they form a cycle,
619
+ * and migrations run dependencies first.
620
+ */
621
+ dependsOn?: readonly string[];
622
+ /**
623
+ * Ordered steps for what a release changes in its tables that Farm will not
624
+ * infer, such as a renamed column. Each runs once per database, through
625
+ * `farm <name> migrate`. Additions need no step.
626
+ */
627
+ migrations?: readonly FarmSchemaMigrationStep[];
628
+ /** @internal Carries the expected integration instance type without runtime data. */
629
+ readonly [FARM_PLUGIN_INTEGRATION_INSTANCE]?: (instance: TIntegrationInstance) => void;
630
+ /** @internal Prevents integration-bound plugins from being registered globally. */
631
+ readonly [FARM_PLUGIN_INTEGRATION_BOUND]?: TIntegrationBound;
632
+ /** @deprecated Use `setup` instead. */
633
+ init?: (context: FarmPluginContextFor<TIntegrationInstance, TIntegrationBound>) => void | Promise<void>;
634
+ /** @deprecated Use `runtime.start` instead. */
635
+ ready?: (context: FarmPluginContextFor<TIntegrationInstance, TIntegrationBound>) => void | Promise<void>;
636
+ /** @deprecated Use `dev.server` instead. */
637
+ devServerCreated?: (viteServer: ViteDevServer, context: FarmPluginContextFor<TIntegrationInstance, TIntegrationBound>) => void | Promise<void>;
638
+ /** @deprecated Use `configure` instead. */
639
+ config?: (config: FarmConfig, context: FarmPluginContextFor<TIntegrationInstance, TIntegrationBound>) => FarmConfig | Promise<FarmConfig>;
640
+ configResolved?: (config: FarmConfig, context: FarmPluginContextFor<TIntegrationInstance, TIntegrationBound>) => void | Promise<void>;
641
+ /** @deprecated Use `build.before` instead. */
642
+ buildStart?: (context: FarmPluginContextFor<TIntegrationInstance, TIntegrationBound>) => void | Promise<void>;
643
+ /** @deprecated Use `build.after` instead. */
644
+ buildEnd?: (context: FarmPluginContextFor<TIntegrationInstance, TIntegrationBound>) => void | Promise<void>;
645
+ /** @deprecated Use `router.discovered` instead. */
646
+ routeDiscovered?: (route: RouteDiscoveredPayload, context: FarmPluginContextFor<TIntegrationInstance, TIntegrationBound>) => void | Promise<void>;
647
+ /** @deprecated Use `router.generated` instead. */
648
+ routesGenerated?: (routes: RoutesGeneratedPayload, context: FarmPluginContextFor<TIntegrationInstance, TIntegrationBound>) => void | Promise<void>;
649
+ /** @deprecated Use `router.discovered` instead. */
650
+ middlewareDiscovered?: (middleware: MiddlewareDiscoveredPayload, context: FarmPluginContextFor<TIntegrationInstance, TIntegrationBound>) => void | Promise<void>;
651
+ /** @deprecated Use `router.discovered` instead. */
652
+ apiRouteDiscovered?: (route: APIRouteDiscoveredPayload, context: FarmPluginContextFor<TIntegrationInstance, TIntegrationBound>) => void | Promise<void>;
653
+ /** @deprecated Use `router.before` instead. */
654
+ beforeRouteMatch?: (route: RouteMatchPayload, context: FarmPluginContextFor<TIntegrationInstance, TIntegrationBound>) => void | Promise<void>;
655
+ /** @deprecated Use `router.after` instead. */
656
+ afterRouteMatch?: (result: RouteMatchResultPayload, context: FarmPluginContextFor<TIntegrationInstance, TIntegrationBound>) => void | Promise<void>;
657
+ /** @deprecated Use `render.before` instead. */
658
+ beforeRender?: (render: RenderLifecyclePayload, context: FarmPluginContextFor<TIntegrationInstance, TIntegrationBound>) => void | Promise<void>;
659
+ /** @deprecated Use `render.html` instead. */
660
+ afterRender?: (html: string, render: RenderLifecyclePayload, context: FarmPluginContextFor<TIntegrationInstance, TIntegrationBound>) => string | Promise<string> | void | Promise<void>;
661
+ /** @deprecated Use `runtime.before` instead. */
662
+ beforeApiHandler?: (request: Request, api: APIHandlerLifecyclePayload, context: FarmRequestPluginContextFor<TIntegrationInstance, TIntegrationBound>) => Request | Promise<Request> | void | Promise<void>;
663
+ /** @deprecated Use `runtime.after` instead. */
664
+ afterApiHandler?: (response: Response, api: APIHandlerLifecyclePayload, context: FarmPluginContextFor<TIntegrationInstance, TIntegrationBound>) => Response | Promise<Response> | void | Promise<void>;
665
+ onError?: (error: ErrorLifecyclePayload, context: FarmPluginContextFor<TIntegrationInstance, TIntegrationBound>) => void | Promise<void>;
666
+ /** @deprecated Use `dev.update` instead. */
667
+ hmrUpdate?: (update: HMRUpdatePayload, context: FarmPluginContextFor<TIntegrationInstance, TIntegrationBound>) => void | Promise<void>;
668
+ /** @deprecated Use `build.before` instead. */
669
+ beforeBundle?: (bundle: BundleLifecyclePayload, context: FarmPluginContextFor<TIntegrationInstance, TIntegrationBound>) => void | Promise<void>;
670
+ /** @deprecated Use `build.after` instead. */
671
+ afterBundle?: (result: BundleResultPayload, context: FarmPluginContextFor<TIntegrationInstance, TIntegrationBound>) => void | Promise<void>;
672
+ /** @deprecated Use `build.configure` instead. */
673
+ beforeNitroBuild?: (nitroConfig: any, context: FarmPluginContextFor<TIntegrationInstance, TIntegrationBound>) => any | Promise<any>;
674
+ afterNitroBuild?: (payload: NitroBuildLifecyclePayload, context: FarmPluginContextFor<TIntegrationInstance, TIntegrationBound>) => void | Promise<void>;
675
+ /** @deprecated Use `runtime.close` instead. */
676
+ shutdown?: (payload: ShutdownPayload, context: FarmPluginContextFor<TIntegrationInstance, TIntegrationBound>) => void | Promise<void>;
677
+ /** @deprecated Use the Web Request based `runtime.before` hook instead. */
678
+ beforeRequest?: (req: FarmRequest, res: FarmResponse, context: FarmRequestPluginContextFor<TIntegrationInstance, TIntegrationBound>) => void | Promise<void>;
679
+ /** @deprecated Use the Web Response based `runtime.after` hook instead. */
680
+ afterResponse?: (req: FarmRequest, res: FarmResponse, context: FarmRequestPluginContextFor<TIntegrationInstance, TIntegrationBound>) => void | Promise<void>;
681
+ /** @deprecated Use `render.html` instead. */
682
+ transformHTML?: (html: string, context: FarmPluginContextFor<TIntegrationInstance, TIntegrationBound>) => string | Promise<string>;
683
+ /** @deprecated Use `render.before` or `render.html` instead. */
684
+ transformPage?: (component: any, context: FarmPluginContextFor<TIntegrationInstance, TIntegrationBound>) => any | Promise<any>;
685
+ }
686
+ declare class PluginManager {
687
+ private plugins;
688
+ private hookPresence;
689
+ private runtimeHookPresence;
690
+ private runtimeEndpoints?;
691
+ private context;
692
+ private pluginStates;
693
+ private setupComplete;
694
+ private initialized;
695
+ private runtimeReady;
696
+ private runtimeClosed;
697
+ private runtimeStartPromise?;
698
+ private runtimeClosePromise?;
699
+ private runtimeShutdownHooksRunning;
700
+ private runtimeDisposers;
701
+ private runtimeRequestContexts;
702
+ private failedRuntimeSessions;
703
+ constructor(context: Omit<FarmPluginContext, "requestContext" | "lifecycle">);
704
+ private createPluginHookContext;
705
+ private createRequestHookContext;
706
+ private copyRequestStore;
707
+ private copyRuntimeRequestContext;
708
+ private createRuntimeBaseEvent;
709
+ private getRuntimeEndpoints;
710
+ private runRuntimeEndpoint;
711
+ private createRuntimeRequestContext;
712
+ private runRuntimeErrorHooks;
713
+ private createStateHookContext;
714
+ private getPluginHooks;
715
+ private getHookContext;
716
+ addPlugin(plugin: FarmPlugin): void;
717
+ addPlugins(plugins: FarmPlugin[]): void;
718
+ getPlugins(): FarmPlugin[];
719
+ getSortedPlugins(): FarmPlugin[];
720
+ hasHook(hookName: keyof FarmPlugin): boolean;
721
+ hasRuntimeHook(hookName: "context" | "before" | "after" | "error"): boolean;
722
+ hasRuntimeRequestHooks(): boolean;
723
+ copyRequestContext(source: FarmRequest | Request, target: FarmRequest | Request): void;
724
+ setupPlugins(): Promise<void>;
725
+ startRuntime(): Promise<void>;
726
+ closeRuntime(reason?: string): Promise<void>;
727
+ private runBeforeHooks;
728
+ /**
729
+ * Runs only `runtime.before` for a request Farm re-routed internally, such as
730
+ * a configured rewrite, so guards also see the destination URL. The session
731
+ * opened for `source` keeps its context; context and after hooks don't rerun.
732
+ */
733
+ runRuntimeBeforeForRewrite(source: Request, request: Request, options?: FarmPluginRuntimeRequestOptions): Promise<Request | Response>;
734
+ beginRuntimeRequest(request: Request, options?: FarmPluginRuntimeRequestOptions): Promise<FarmPluginRuntimeSession>;
735
+ endRuntimeRequest(session: FarmPluginRuntimeSession, initialResponse: Response): Promise<Response>;
736
+ failRuntimeRequest(session: FarmPluginRuntimeSession, error: unknown): Promise<void>;
737
+ runRuntimeRequest(request: Request, handler: FarmPluginRuntimeRequestHandler, options?: FarmPluginRuntimeRequestOptions): Promise<Response>;
738
+ runHook<K extends keyof FarmPlugin>(hookName: K, ...args: any[]): Promise<any>;
739
+ runHookSerial<K extends keyof FarmPlugin>(hookName: K, initialValue: any, ...args: any[]): Promise<any>;
740
+ runHookParallel<K extends keyof FarmPlugin>(hookName: K, ...args: any[]): Promise<boolean>;
741
+ /** @internal Runs hooks for only the plugins selected by the runtime adapter. */
742
+ runHookParallelFiltered<K extends keyof FarmPlugin>(hookName: K, include: (plugin: FarmPlugin) => boolean, ...args: any[]): Promise<boolean>;
743
+ updateContext(updates: Partial<FarmPluginContext>): void;
744
+ }
745
+ type PluginOptionsSchemaInput = FarmPluginOptionsSchema<any, any>;
746
+ /** Parsed options, available to `setup` and `configure` when a plugin declares `options`. */
747
+ type WithPluginOptions<TContext, TSchema> = TSchema extends PluginOptionsSchemaInput ? TContext & {
748
+ readonly options: InferPluginOptionsOutput<TSchema>;
749
+ } : TContext;
750
+ /**
751
+ * A plugin's state. When it declares `options` and `setup` returns nothing (or
752
+ * there is no `setup`), the parsed options are its state.
753
+ */
754
+ type ResolvedPluginState<TState, TSchema> = TSchema extends PluginOptionsSchemaInput ? [TState] extends [undefined | void] ? InferPluginOptionsOutput<TSchema> : TState : TState;
755
+ /** What `definePlugin` accepts: a plugin, optionally with an `options` schema. */
756
+ type FarmPluginDefinition<TState = undefined, TRequestContext extends object = Record<string, never>, TClientState = unknown, TClientPublic = undefined, TIntegrationInstance = unknown, TRoutes extends PluginRoutes = PluginRoutes, TSchema extends PluginOptionsSchemaInput | undefined = undefined> = Omit<FarmPlugin<ResolvedPluginState<TState, TSchema>, TRequestContext, TClientState, TClientPublic, TIntegrationInstance, false, TRoutes>, "configure" | "setup"> & {
757
+ /**
758
+ * Describe the plugin's options with a Standard Schema (Zod, Valibot,
759
+ * ArkType, ...). `definePlugin` then returns a factory: the app passes typed
760
+ * options, invalid ones fail while the config loads, and the plugin receives
761
+ * the parsed result in `setup` and `configure`, and as its state.
762
+ */
763
+ options?: TSchema;
764
+ /** Transform Farm config before the development or production pipeline is created. */
765
+ configure?: (config: FarmConfig, context: WithPluginOptions<FarmPluginContextFor<TIntegrationInstance, false>, TSchema>) => MaybePromise$1<FarmConfig | void>;
766
+ /** Initialize private plugin state once for this plugin manager. */
767
+ setup?: (context: WithPluginOptions<FarmPluginSetupContextFor<TIntegrationInstance, false>, TSchema>) => MaybePromise$1<TState>;
768
+ };
769
+ type DefinedPlugin<TState, TRequestContext extends object, TClientState, TClientPublic, TIntegrationInstance, TRoutes extends PluginRoutes, TSchema> = FarmPlugin<ResolvedPluginState<TState, TSchema>, TRequestContext, TClientState, TClientPublic, TIntegrationInstance, false, TRoutes>;
770
+ /** The database a plugin's `schema` tables live in, when not `storage.client`. */
771
+ interface FarmPluginDatabase {
772
+ /**
773
+ * A pg, mysql2, or sqlite connection the app chose for this plugin, or a
774
+ * function returning one. Left undefined, the app's `storage.client` is used,
775
+ * so a plugin can forward an optional app setting as is.
776
+ */
777
+ client?: unknown;
778
+ /** Only when the dialect cannot be detected from the connection. */
779
+ dialect?: FarmSqlDialect;
780
+ }
781
+ /**
782
+ * Define a plugin. Declaring `options` turns the result into a factory:
783
+ *
784
+ * ```ts
785
+ * export const security = definePlugin({
786
+ * name: "acme:security",
787
+ * options: z.object({ frameAncestors: z.string().default("'none'") }),
788
+ * runtime: {
789
+ * after({ state, response }) {
790
+ * // state.frameAncestors: string
791
+ * return response;
792
+ * },
793
+ * },
794
+ * });
795
+ *
796
+ * // farm.config.ts
797
+ * plugins: [security({ frameAncestors: "'self'" })]
798
+ * ```
799
+ */
800
+ declare function definePlugin<TState = undefined, TRequestContext extends object = Record<string, never>, TClientState = unknown, TClientPublic = undefined, TIntegrationInstance = unknown, const TRoutes extends PluginRoutes = PluginRoutes, TSchema extends PluginOptionsSchemaInput | undefined = undefined>(plugin: FarmPluginDefinition<TState, TRequestContext, TClientState, TClientPublic, TIntegrationInstance, TRoutes, TSchema>): TSchema extends PluginOptionsSchemaInput ? FarmPluginFactory<InferPluginOptionsInput<TSchema>, DefinedPlugin<TState, TRequestContext, TClientState, TClientPublic, TIntegrationInstance, TRoutes, TSchema>> : DefinedPlugin<TState, TRequestContext, TClientState, TClientPublic, TIntegrationInstance, TRoutes, TSchema>;
801
+ declare namespace definePlugin {
802
+ /** Bind an integration instance type while preserving inference for plugin state and context. */
803
+ function forIntegration<TIntegrationInstance>(): <TState = undefined, TRequestContext extends object = Record<string, never>, TClientState = unknown, TClientPublic = undefined>(plugin: FarmPlugin<TState, TRequestContext, TClientState, TClientPublic, TIntegrationInstance, true>) => FarmPlugin<TState, TRequestContext, TClientState, TClientPublic, TIntegrationInstance, true>;
804
+ }
805
+
806
+ /** A server-only endpoint reference. Config references must declare an explicit /api path. */
807
+ type FarmMCPEndpoint = TypedEndpoint<any, any, any, any, any, any, any, any>;
808
+ interface FarmMCPExecuteContext {
809
+ /** The principal returned by authorize, or { subject: "anonymous" } for public servers. */
810
+ readonly authorization: Readonly<FarmMCPAuthorization>;
811
+ readonly request: Request;
812
+ /** Observe this signal in cancellable work. Cancellation cannot undo side effects. */
813
+ readonly signal: AbortSignal;
814
+ }
815
+ /** A server-only tool with no corresponding HTTP endpoint. */
816
+ interface FarmMCPStandaloneTool<Schema extends RouteSchema = RouteSchema, Result = unknown, OutputSchema extends RouteSchema | undefined = undefined> extends EndpointMCPMetadata {
817
+ name: string;
818
+ /** Must describe an object and support input JSON Schema conversion. */
819
+ inputSchema: Schema;
820
+ /** Validate/transform returned data and advertise its output shape inside MCP's result envelope. */
821
+ outputSchema?: OutputSchema;
822
+ /** Return JSON-serializable data, not a Response or an MCP protocol envelope. */
823
+ execute(input: RouteSchemaOutput<Schema>, context: FarmMCPExecuteContext): OutputSchema extends RouteSchema ? NoInfer<RouteSchemaInput<OutputSchema>> | Promise<NoInfer<RouteSchemaInput<OutputSchema>>> : Result | Promise<Result>;
824
+ endpoint?: never;
825
+ }
826
+ /**
827
+ * A createServerFn or createServerQuery function with `mcp` metadata. It runs through its own
828
+ * input schema, middleware and output schema, with the MCP request as its request.
829
+ */
830
+ type FarmMCPServerFunction = ServerFn<any, any, any> | ServerQuery<any, any>;
831
+ /** Compose endpoint references, server functions and standalone tools. */
832
+ type FarmMCPToolDefinition = FarmMCPEndpoint | FarmMCPServerFunction | (EndpointMCPMetadata & {
833
+ endpoint: FarmMCPEndpoint;
834
+ execute?: never;
835
+ }) | FarmMCPStandaloneTool<any, unknown, any>;
836
+ /** Resolved tool identity, without handlers, validators, or a way to bypass authorization. */
837
+ type FarmMCPTool = Readonly<EndpointMCPMetadata> & {
838
+ readonly name: string;
839
+ } & ({
840
+ readonly kind: "endpoint";
841
+ readonly method: RouteMethod;
842
+ readonly path: string;
843
+ } | {
844
+ readonly kind: "standalone";
845
+ readonly method?: never;
846
+ readonly path?: never;
847
+ } | {
848
+ readonly kind: "serverFunction";
849
+ readonly method?: never;
850
+ readonly path?: never;
851
+ });
852
+ /** What a resource's `read` receives: the URI asked for, its template variables, and the caller. */
853
+ interface FarmMCPResourceContext extends FarmMCPExecuteContext {
854
+ readonly uri: URL;
855
+ /** Values matched by `uriTemplate`; empty for a fixed `uri`. */
856
+ readonly variables: Readonly<Record<string, string | string[]>>;
857
+ }
858
+ /**
859
+ * One piece of resource content: a string (sent as `mimeType`, or text/plain),
860
+ * text with its own type, JSON data, or binary data.
861
+ */
862
+ type FarmMCPResourceContent = string | {
863
+ text: string;
864
+ mimeType?: string;
865
+ } | {
866
+ json: unknown;
867
+ } | {
868
+ blob: Uint8Array | ArrayBuffer;
869
+ mimeType?: string;
870
+ };
871
+ /** One concrete URI a templated resource lists. */
872
+ interface FarmMCPResourceListing {
873
+ uri: string;
874
+ name?: string;
875
+ title?: string;
876
+ description?: string;
877
+ mimeType?: string;
878
+ }
879
+ /**
880
+ * A server-only MCP resource: read-only context an agent can load, at a fixed
881
+ * `uri` or at every URI matching an RFC 6570 `uriTemplate`.
882
+ */
883
+ interface FarmMCPResource {
884
+ /** Stable name, used in authorization and in `authorize`'s `resources` allowlist. */
885
+ name: string;
886
+ title?: string;
887
+ description?: string;
888
+ mimeType?: string;
889
+ /** A fixed absolute URI, such as `docs://handbook`. Set this or `uriTemplate`. */
890
+ uri?: string;
891
+ /** An RFC 6570 template, such as `notes://{id}`. Set this or `uri`. */
892
+ uriTemplate?: string;
893
+ /** For a template: the concrete resources to list. Omit to list none. */
894
+ list?(context: FarmMCPExecuteContext): readonly FarmMCPResourceListing[] | Promise<readonly FarmMCPResourceListing[]>;
895
+ /** Return the content, or null when the URI names nothing. */
896
+ read(context: FarmMCPResourceContext): FarmMCPResourceContent | readonly FarmMCPResourceContent[] | null | Promise<FarmMCPResourceContent | readonly FarmMCPResourceContent[] | null>;
897
+ }
898
+ interface FarmMCPPromptMessage {
899
+ role: "user" | "assistant";
900
+ text: string;
901
+ }
902
+ /**
903
+ * A server-only MCP prompt: a reusable message template a client offers its
904
+ * user. Arguments arrive as strings, as MCP sends them, and are validated by
905
+ * `arguments` before `render` runs.
906
+ */
907
+ interface FarmMCPPrompt<Schema extends RouteSchema | undefined = RouteSchema | undefined> {
908
+ /** Stable name: 1-128 letters, numbers, dots, underscores, or hyphens. */
909
+ name: string;
910
+ title?: string;
911
+ description?: string;
912
+ /** An object schema of string arguments. */
913
+ arguments?: Schema;
914
+ /** Return the prompt text, sent as one user message, or a list of messages. */
915
+ render(args: Schema extends RouteSchema ? RouteSchemaOutput<Schema> : Record<string, never>, context: FarmMCPExecuteContext): string | readonly FarmMCPPromptMessage[] | Promise<string | readonly FarmMCPPromptMessage[]>;
916
+ }
917
+ interface FarmMCPServer {
918
+ readonly name: string;
919
+ readonly version: string;
920
+ readonly path: `/api/${string}`;
921
+ readonly title?: string;
922
+ readonly description?: string;
923
+ }
924
+ interface FarmMCPAuthorization extends Record<string, unknown> {
925
+ /** Stable application principal identifier. Never written to a response or log by Farm. */
926
+ subject: string;
927
+ scopes?: string[];
928
+ /** Allowed tool names for this request. Omit for all configured tools; [] denies all tools. */
929
+ tools?: readonly string[];
930
+ /** Allowed resource names. Omit for all configured resources; [] denies all resources. */
931
+ resources?: readonly string[];
932
+ /** Allowed prompt names. Omit for all configured prompts; [] denies all prompts. */
933
+ prompts?: readonly string[];
934
+ }
935
+ interface FarmMCPAuthorizeContext {
936
+ request: Request;
937
+ /** Untrusted requested name for a tools/call; authorization runs separately for every JSON-RPC batch item. */
938
+ tool?: string;
939
+ /** Untrusted requested URI for a resources/read. */
940
+ resource?: string;
941
+ /** Untrusted requested name for a prompts/get. */
942
+ prompt?: string;
943
+ /** Complete configured catalog, before applying this caller's permissions. */
944
+ tools: readonly FarmMCPTool[];
945
+ /** Resolved transport identity, for policies shared by multiple MCP endpoints. */
946
+ server: FarmMCPServer;
947
+ }
948
+ interface FarmMCPConfig {
949
+ /** Set false to disable MCP without removing its configuration. @default true */
950
+ enabled?: boolean;
951
+ /** Canonical Farm API path for the Streamable HTTP endpoint. @default "/api/mcp" */
952
+ path?: `/api/${string}`;
953
+ /** MCP server identity. @default "farm-api" */
954
+ name?: string;
955
+ /** MCP server version. @default "1.0.0" */
956
+ version?: string;
957
+ /** Display name, sent in `serverInfo` and the server card. */
958
+ title?: string;
959
+ /**
960
+ * What the server does, sent in `serverInfo` and the server card that
961
+ * `/.well-known/ai-catalog.json` lists. The card keeps the first 100 characters.
962
+ */
963
+ description?: string;
964
+ /** Explicit endpoint/standalone tool allowlist. Omit to discover route-owned MCP metadata. */
965
+ tools?: readonly FarmMCPToolDefinition[];
966
+ /** Read-only context for agents, from `defineResource()`. */
967
+ resources?: readonly FarmMCPResource[];
968
+ /** Reusable prompt templates, from `definePrompt()`. */
969
+ prompts?: readonly FarmMCPPrompt<any>[];
970
+ /** Authorize every MCP request. Returning false responds with 401 before protocol handling. */
971
+ authorize?: (context: FarmMCPAuthorizeContext) => FarmMCPAuthorization | false | Promise<FarmMCPAuthorization | false>;
972
+ /** Deliberate escape hatch for public servers. Authentication is required by default. */
973
+ allowUnauthenticated?: boolean;
974
+ /**
975
+ * Most JSON-RPC messages one batched POST may carry. `authorize` runs once per message, so a
976
+ * larger batch is refused before any of them is authorized. @default 25
977
+ */
978
+ maxBatchSize?: number;
979
+ /**
980
+ * Most array elements and object members, counted together across nested values, one tool
981
+ * call's arguments may contain. Larger arguments are refused before validation or the tool
982
+ * runs. `Infinity` removes the limit. @default 10000
983
+ */
984
+ maxToolInputElements?: number;
985
+ /**
986
+ * OAuth discovery for MCP clients. When set, a rejected request's 401 points at
987
+ * RFC 9728 Protected Resource Metadata naming these authorization servers, which
988
+ * Farm serves at `/.well-known/oauth-protected-resource/<endpoint path>`.
989
+ * Validating tokens stays in `authorize`.
990
+ */
991
+ oauth?: FarmMCPOAuthConfig;
992
+ }
993
+ interface FarmMCPOAuthConfig {
994
+ /** Issuer URLs of the OAuth authorization servers that issue tokens for this endpoint. */
995
+ authorizationServers: readonly string[];
996
+ /** Scopes clients may request, advertised as `scopes_supported` and in the 401 challenge. */
997
+ scopes?: readonly string[];
998
+ /** Human-readable name for consent screens. @default the MCP server name */
999
+ resourceName?: string;
1000
+ }
1001
+ type FarmMCPUserConfig = FarmMCPConfig | false;
1002
+ interface ResolvedFarmMCPConfig extends FarmMCPConfig {
1003
+ enabled: boolean;
1004
+ }
1005
+ declare function resolveFarmMCPConfig(input: FarmMCPUserConfig | undefined): ResolvedFarmMCPConfig;
1006
+ declare function resolveFarmMCPPlugin(config: ResolvedFarmMCPConfig, options: {
1007
+ root: string;
1008
+ }): Promise<FarmPlugin | undefined>;
1009
+
1010
+ type JSONSchema = Readonly<Record<string, unknown>>;
1011
+ /** What a server can say beyond its tool list, for the app manifest. All optional. */
1012
+ interface FarmMCPCatalogDetails {
1013
+ /**
1014
+ * True when the endpoint answers anonymous clients: it has no `authorize`. The public
1015
+ * `/.well-known/farmjs.json` lists tools, resources and prompts only for such a server.
1016
+ */
1017
+ public?: boolean;
1018
+ /** MCP protocol versions the endpoint accepts, for its server card. */
1019
+ protocolVersions?: readonly string[];
1020
+ /** Each tool's input and output JSON Schemas, by tool name. */
1021
+ schemas?: Readonly<Record<string, {
1022
+ input: JSONSchema;
1023
+ output?: JSONSchema;
1024
+ }>>;
1025
+ resources?: readonly {
1026
+ name: string;
1027
+ title?: string;
1028
+ description?: string;
1029
+ mimeType?: string;
1030
+ uri?: string;
1031
+ uriTemplate?: string;
1032
+ }[];
1033
+ prompts?: readonly {
1034
+ name: string;
1035
+ title?: string;
1036
+ description?: string;
1037
+ /** The arguments' JSON Schema. */
1038
+ arguments?: JSONSchema;
1039
+ }[];
1040
+ }
1041
+ /**
1042
+ * @internal Publishes one MCP server's tools, replacing an earlier catalog for
1043
+ * the same endpoint. Returns a function that removes it.
1044
+ */
1045
+ declare function _publishFarmMCPCatalog(server: FarmMCPServer, tools: readonly FarmMCPTool[], details?: FarmMCPCatalogDetails): () => void;
1046
+ interface FarmMCPServerRegistrationBase {
1047
+ /** Server name; a reverse-DNS name (`dev.farmjs/docs`) is kept as the card's name. */
1048
+ name: string;
1049
+ version: string;
1050
+ /** Display name for the card and the catalog entry. */
1051
+ title?: string;
1052
+ /** What the server does. The card keeps the first 100 characters. */
1053
+ description?: string;
1054
+ /** MCP protocol versions the endpoint accepts, for its server card. */
1055
+ protocolVersions?: readonly string[];
1056
+ }
1057
+ /**
1058
+ * An MCP server that Farm lists in `/.well-known/ai-catalog.json`, `/.well-known/ard.json`,
1059
+ * and the generated `/llms.txt`, but does not serve: a docs runtime's endpoint, an agent
1060
+ * runtime, or a server on another host. It is not part of the `/.well-known/farmjs.json`
1061
+ * manifest, which lists the tools Farm itself serves.
1062
+ */
1063
+ type FarmMCPServerRegistration = FarmMCPServerRegistrationBase & ({
1064
+ /**
1065
+ * The Streamable HTTP endpoint's path in this app, below the app's `basePath`.
1066
+ * Taken literally: it is not rewritten through `api.basePath`. Farm serves the
1067
+ * server card at `<path>/server-card`.
1068
+ */
1069
+ path: `/${string}`;
1070
+ url?: never;
1071
+ } | {
1072
+ /**
1073
+ * An absolute `http(s)` URL of an endpoint on another origin, which serves its
1074
+ * own card at `<url>/server-card`.
1075
+ */
1076
+ url: string;
1077
+ path?: never;
1078
+ });
1079
+ /**
1080
+ * List an MCP server Farm does not serve itself in the app's AI catalog. Registering
1081
+ * the same endpoint again replaces the earlier entry. Returns a function that removes it.
1082
+ *
1083
+ * ```ts
1084
+ * const unregister = registerFarmMCPServer({
1085
+ * name: "dev.farmjs/agent",
1086
+ * version: "1.0.0",
1087
+ * path: "/agent/mcp",
1088
+ * });
1089
+ * ```
1090
+ */
1091
+ declare function registerFarmMCPServer(server: FarmMCPServerRegistration): () => void;
1092
+ interface FarmMCPEndpointTool {
1093
+ /** The MCP tool name. */
1094
+ name: string;
1095
+ /** The public path of the MCP endpoint that serves the tool. */
1096
+ endpoint: string;
1097
+ }
1098
+ /**
1099
+ * @internal Finds the MCP tool that runs the API endpoint a request to
1100
+ * `method pathname` reaches, if a published catalog exposes one.
1101
+ * `serverBasePath` is the app's public API path, which maps to `/api`.
1102
+ */
1103
+ declare function _findFarmMCPEndpointTool(method: string, pathname: string, serverBasePath?: string): FarmMCPEndpointTool | undefined;
1104
+
1105
+ /** Content type for Markdown responses, including agent-facing error bodies. */
1106
+ declare const FARM_MARKDOWN_CONTENT_TYPE = "text/markdown; charset=utf-8";
1107
+ /**
1108
+ * @internal Header on the anonymous page render that decides whether a page's Markdown
1109
+ * source is public. Its value is a per-process secret, so a client cannot set it: the
1110
+ * render it selects is buffered to the end, where a late `redirect()` or `notFound()`
1111
+ * still sets the status instead of a script in an already-sent 200 document.
1112
+ */
1113
+ declare const FARM_MARKDOWN_PAGE_CHECK_HEADER = "x-farm-markdown-page-check";
1114
+ /** @internal The value of {@link FARM_MARKDOWN_PAGE_CHECK_HEADER} for this process. */
1115
+ declare function _getFarmMarkdownPageCheckToken(): string;
1116
+ /** @internal Whether a request is Farm's own anonymous page check. */
1117
+ declare function _isFarmMarkdownPageCheck(value: string | readonly string[] | null | undefined): boolean;
1118
+ declare function farmRequestWantsMarkdown(pathname: string, accept: string | null | undefined): boolean;
1119
+ declare function createFarmMarkdownErrorBody(status: number, pathname: string, homeHref?: string): string;
1120
+ type FarmMarkdownRouteInput = string | {
1121
+ route: string;
1122
+ title?: string;
1123
+ cache?: number | false;
1124
+ };
1125
+ interface FarmMarkdownUserConfig {
1126
+ /**
1127
+ * Enable generated markdown representations for React pages.
1128
+ * @default true
1129
+ */
1130
+ enabled?: boolean;
1131
+ /**
1132
+ * Routes that may expose generated markdown. Every page is exposed by default.
1133
+ */
1134
+ expose?: boolean | FarmMarkdownRouteInput[];
1135
+ /** @deprecated Use `expose`. */
1136
+ routes?: FarmMarkdownRouteInput[];
1137
+ cache?: number | false;
1138
+ includeMetadata?: boolean;
1139
+ }
1140
+ interface FarmMarkdownResolvedRoute {
1141
+ route: string;
1142
+ title?: string;
1143
+ cache?: number | false;
1144
+ }
1145
+ interface FarmMarkdownResolvedConfig {
1146
+ enabled: boolean;
1147
+ expose: true | FarmMarkdownResolvedRoute[];
1148
+ cache: number | false;
1149
+ includeMetadata: boolean;
1150
+ }
1151
+ interface FarmMarkdownMirrorTarget {
1152
+ pathname: string;
1153
+ route: FarmMarkdownResolvedRoute | null;
1154
+ }
1155
+ interface ResolveMarkdownMirrorTargetOptions {
1156
+ accept?: string | null;
1157
+ }
1158
+ interface CreateMarkdownMirrorResponseOptions {
1159
+ request: Request;
1160
+ /** @internal Reuse a parse only while its href still matches this request. */
1161
+ requestUrl?: URL;
1162
+ config?: FarmMarkdownResolvedConfig;
1163
+ routeExists?: (pathname: string) => boolean;
1164
+ renderPage: (request: Request) => Response | Promise<Response>;
1165
+ /** The app's public API path, so a form posting to an API route can be matched to its MCP tool. */
1166
+ apiServerBasePath?: string;
1167
+ }
1168
+ interface ApplyMarkdownNegotiationHeadersOptions {
1169
+ config?: FarmMarkdownResolvedConfig;
1170
+ pathname: string;
1171
+ }
1172
+ declare function resolveMarkdownConfig(config: FarmMarkdownUserConfig | boolean | undefined): FarmMarkdownResolvedConfig;
1173
+ declare function resolveMarkdownMirrorTarget(config: FarmMarkdownResolvedConfig | undefined, pathname: string, options?: ResolveMarkdownMirrorTargetOptions): FarmMarkdownMirrorTarget | null;
1174
+ declare function createMarkdownMirrorResponse(options: CreateMarkdownMirrorResponseOptions): Promise<Response | null>;
1175
+ declare function applyMarkdownNegotiationHeaders(response: Response, options: ApplyMarkdownNegotiationHeadersOptions): Response;
1176
+ declare function htmlToMarkdown(html: string, options?: {
1177
+ title?: string;
1178
+ sourcePath?: string;
1179
+ includeMetadata?: boolean;
1180
+ /** Where the page's forms are described, listed when the page has any. */
1181
+ actionsPath?: string;
1182
+ }): string;
1183
+ /**
1184
+ * Quality value an `Accept` header assigns a media type, or 0 when the client
1185
+ * will not take it.
1186
+ *
1187
+ * `q=0` means "not acceptable" per RFC 9110, so it has to be distinguished from
1188
+ * an absent entry rather than treated as a match. Wildcards are opt-in: a client
1189
+ * sending `*&#47;*` will take anything, which says nothing about whether it would
1190
+ * rather have Markdown than HTML, so callers negotiating between two concrete
1191
+ * types should ask for exact entries only.
1192
+ */
1193
+ declare function farmAcceptQuality(accept: string | null | undefined, mediaType: string, options?: {
1194
+ wildcards?: boolean;
1195
+ }): number;
1196
+ declare function requestAcceptsMarkdown(accept: string | null | undefined): boolean;
1197
+ /** @internal The `.md` URL that serves a page's Markdown mirror. */
1198
+ declare function getFarmMarkdownMirrorPath(pathname: string): string;
1199
+ /**
1200
+ * @internal The `.md` URL to advertise for the HTML page at `pathname`, or
1201
+ * null when it has no Markdown mirror. Both the `Link` response header and the
1202
+ * `<link rel="alternate">` in the document head come from this.
1203
+ */
1204
+ declare function getFarmMarkdownAlternatePath(config: FarmMarkdownResolvedConfig | undefined, pathname: string): string | null;
1205
+ /** @internal Whether `pathname` has a Markdown mirror under `config`. */
1206
+ declare function isFarmMarkdownMirrorExposed(config: FarmMarkdownResolvedConfig | undefined, pathname: string): boolean;
1207
+ /** @internal Matches a page pathname against a route pattern such as `/docs/[...slug]`. */
1208
+ declare function matchesFarmMarkdownRoutePattern(pattern: string, pathname: string): boolean;
1209
+ interface FarmPageFormOption {
1210
+ value: string;
1211
+ label?: string;
1212
+ selected?: true;
1213
+ }
1214
+ interface FarmPageFormField {
1215
+ name: string;
1216
+ /** The input type, or `select`, `textarea`, `radio`, or `checkbox` for a group. */
1217
+ type: string;
1218
+ label?: string;
1219
+ required?: true;
1220
+ multiple?: true;
1221
+ /** A preset value: always present for hidden fields. */
1222
+ value?: string;
1223
+ checked?: true;
1224
+ /** Choices of a select, or of radio buttons and checkboxes sharing a name. */
1225
+ options?: FarmPageFormOption[];
1226
+ placeholder?: string;
1227
+ pattern?: string;
1228
+ min?: string;
1229
+ max?: string;
1230
+ step?: string;
1231
+ minLength?: number;
1232
+ maxLength?: number;
1233
+ accept?: string;
1234
+ }
1235
+ interface FarmPageFormSubmit {
1236
+ label: string;
1237
+ name?: string;
1238
+ value?: string;
1239
+ /** Set when the button submits somewhere other than its form (`formaction`). */
1240
+ action?: string;
1241
+ method?: string;
1242
+ }
1243
+ interface FarmPageFormAction {
1244
+ type: "form";
1245
+ name?: string;
1246
+ method: "GET" | "POST";
1247
+ /**
1248
+ * Where the form submits: a root-relative URL on the page's origin, or an
1249
+ * absolute URL elsewhere. Absent when the form only submits with JavaScript.
1250
+ */
1251
+ action?: string;
1252
+ /** Present for POST forms. */
1253
+ enctype?: string;
1254
+ requiresJavaScript?: true;
1255
+ fields: FarmPageFormField[];
1256
+ submit: FarmPageFormSubmit[];
1257
+ /** A React server action form: the id React put in its hidden `$ACTION_` fields. */
1258
+ serverAction?: {
1259
+ id: string;
1260
+ };
1261
+ /**
1262
+ * The MCP tool that runs the same API endpoint, when `@farm.js/mcp` exposes
1263
+ * it: the tool `name` and the MCP `endpoint` to call it at. The caller's
1264
+ * `authorize` policy still decides whether that tool is available to it.
1265
+ */
1266
+ tool?: FarmMCPEndpointTool;
1267
+ }
1268
+ /**
1269
+ * Describes the forms in the part of the page the mirror reads, so an agent can
1270
+ * see what it can submit: where, how, and with which fields. Controls that are
1271
+ * disabled are left out, since a browser would not submit them; hidden fields
1272
+ * keep their values, so a submission without JavaScript can be replayed.
1273
+ */
1274
+ declare function extractFarmPageActions(html: string, pageUrl: URL): FarmPageFormAction[];
1275
+
1276
+ interface FarmLlmsTxtLink {
1277
+ title: string;
1278
+ url: string;
1279
+ description?: string;
1280
+ }
1281
+ interface FarmLlmsTxtSection {
1282
+ title: string;
1283
+ links: FarmLlmsTxtLink[];
1284
+ }
1285
+ interface FarmLlmsTxt {
1286
+ /** Site or project name, rendered as the `# H1`. Required by the format. */
1287
+ title: string;
1288
+ /** One-sentence summary, rendered as a `> blockquote`. */
1289
+ summary?: string;
1290
+ /** Free-form Markdown placed after the summary. */
1291
+ details?: string;
1292
+ /** `## H2` sections of links. A section titled "Optional" marks skippable links. */
1293
+ sections?: FarmLlmsTxtSection[];
1294
+ }
1295
+ /** A static page of the app, ready to use as an llms.txt link. */
1296
+ interface FarmLlmsTxtPage extends FarmLlmsTxtLink {
1297
+ /** The page's route path, such as `/docs/install`. */
1298
+ path: string;
1299
+ }
1300
+ interface FarmLlmsTxtUserConfig {
1301
+ /** Set to `false` to turn llms.txt off while keeping these options. */
1302
+ enabled?: boolean;
1303
+ /** Site name for the `# H1`. Defaults to the root layout's metadata title. */
1304
+ title?: string;
1305
+ /** Summary for the `> blockquote`. Defaults to the root layout's metadata description. */
1306
+ summary?: string;
1307
+ /** Markdown placed after the summary. */
1308
+ details?: string;
1309
+ /**
1310
+ * Route patterns to list, using the same syntax as `md.expose`
1311
+ * (`/docs/[...slug]`). Defaults to every static page.
1312
+ */
1313
+ include?: string[];
1314
+ /** Route patterns to leave out, such as `/admin/[...path]`. */
1315
+ exclude?: string[];
1316
+ /**
1317
+ * Also serve `/llms-full.txt`, the index with each page's Markdown mirror inlined.
1318
+ *
1319
+ * @default true
1320
+ */
1321
+ full?: boolean;
1322
+ /**
1323
+ * Seconds a CDN may cache the generated files, and the production server may
1324
+ * reuse an llms-full.txt render, which renders every listed page. Defaults to
1325
+ * no caching; concurrent llms-full.txt requests still share one render.
1326
+ */
1327
+ revalidate?: number;
1328
+ }
1329
+ interface ResolvedFarmLlmsTxtConfig {
1330
+ enabled: boolean;
1331
+ title?: string;
1332
+ summary?: string;
1333
+ details?: string;
1334
+ include: string[];
1335
+ exclude: string[];
1336
+ full: boolean;
1337
+ revalidate?: number;
1338
+ }
1339
+ interface FarmLlmsTxtPageSource {
1340
+ pattern: string;
1341
+ metadata?: unknown;
1342
+ }
1343
+ declare function resolveFarmLlmsTxtConfig(input: boolean | FarmLlmsTxtUserConfig | undefined): ResolvedFarmLlmsTxtConfig;
1344
+ declare function collectFarmLlmsTxtPages(sources: Iterable<FarmLlmsTxtPageSource>, options: {
1345
+ origin: string;
1346
+ basePath?: string;
1347
+ markdown?: FarmMarkdownResolvedConfig;
1348
+ include?: string[];
1349
+ exclude?: string[];
1350
+ }): FarmLlmsTxtPage[];
1351
+ declare function createFarmDefaultLlmsTxt(options: {
1352
+ origin: string;
1353
+ pages: FarmLlmsTxtPage[];
1354
+ config: ResolvedFarmLlmsTxtConfig;
1355
+ rootMetadata?: unknown;
1356
+ /** The app's MCP endpoints and AI catalog, listed in an "MCP" section. */
1357
+ mcp?: FarmLlmsTxtLink[];
1358
+ }): FarmLlmsTxt;
1359
+ /**
1360
+ * Reads a page's Markdown the way an agent would: a fresh `.md` request with no
1361
+ * cookies or credentials, so a page behind auth answers 401 and is left out of
1362
+ * a file that CDNs may cache, instead of leaking into it.
1363
+ */
1364
+ declare function createFarmLlmsMarkdownReader(fetchMarkdown: (request: Request) => Promise<Response>): (url: string) => Promise<string | null>;
1365
+ /**
1366
+ * Renders llms-full.txt: the llms.txt header, then one block per linked page with
1367
+ * its Markdown inlined, in the layout the docs engine uses. A string passes
1368
+ * through unchanged. Only same-origin links are fetched.
1369
+ */
1370
+ declare function renderFarmLlmsFullTxt(value: unknown, options: {
1371
+ origin: string;
1372
+ readMarkdown: (url: string) => Promise<string | null>;
1373
+ concurrency?: number;
1374
+ /** Milliseconds to wait for one page's Markdown before leaving it out. */
1375
+ pageTimeout?: number;
1376
+ /** Called when a page is left out because it did not answer in time. */
1377
+ onIncomplete?: () => void;
1378
+ }): Promise<string>;
1379
+ /**
1380
+ * Shares llms-full.txt renders, which read every listed page. Requests for the
1381
+ * same origin while a render runs, or within `revalidate` seconds after it, get
1382
+ * that result; renders run one at a time, so a burst of requests, even with
1383
+ * varied Host headers, cannot multiply page renders. The content is the same for
1384
+ * every caller: pages are read with fresh requests that carry no credentials.
1385
+ * A render that calls `incomplete()`, because a page timed out, is answered but
1386
+ * not reused, so the next request tries that page again.
1387
+ */
1388
+ declare function createFarmLlmsFullRenderer(options?: {
1389
+ revalidate?: number;
1390
+ now?: () => number;
1391
+ maxEntries?: number;
1392
+ }): (origin: string, render: (shared: {
1393
+ incomplete: () => void;
1394
+ }) => Promise<string>, onSettled?: (complete: boolean) => void) => Promise<string>;
1395
+
1396
+ type ApplicationMetadataRouteKind = "sitemap" | "robots" | "manifest" | "llms" | "llms-full";
1397
+ declare namespace MetadataRoute {
1398
+ type SitemapChangeFrequency = "always" | "hourly" | "daily" | "weekly" | "monthly" | "yearly" | "never";
1399
+ interface SitemapEntry {
1400
+ url: string;
1401
+ lastModified?: string | Date;
1402
+ changeFrequency?: SitemapChangeFrequency;
1403
+ priority?: number;
1404
+ alternates?: {
1405
+ languages?: Record<string, string>;
1406
+ };
1407
+ }
1408
+ type Sitemap = SitemapEntry[];
1409
+ interface RobotsRule {
1410
+ userAgent: string | string[];
1411
+ allow?: string | string[];
1412
+ disallow?: string | string[];
1413
+ crawlDelay?: number;
1414
+ }
1415
+ interface Robots {
1416
+ rules: RobotsRule | RobotsRule[];
1417
+ sitemap?: string | string[];
1418
+ host?: string;
1419
+ }
1420
+ interface ManifestIcon {
1421
+ src: string;
1422
+ sizes?: string;
1423
+ type?: string;
1424
+ purpose?: string;
1425
+ }
1426
+ interface Manifest {
1427
+ name?: string;
1428
+ short_name?: string;
1429
+ description?: string;
1430
+ id?: string;
1431
+ start_url?: string;
1432
+ scope?: string;
1433
+ display?: "fullscreen" | "standalone" | "minimal-ui" | "browser" | string;
1434
+ orientation?: string;
1435
+ background_color?: string;
1436
+ theme_color?: string;
1437
+ lang?: string;
1438
+ dir?: "ltr" | "rtl" | "auto";
1439
+ categories?: string[];
1440
+ icons?: ManifestIcon[];
1441
+ [key: string]: unknown;
1442
+ }
1443
+ /**
1444
+ * The object an `llms.ts` metadata route returns, rendered as llms.txt. An
1445
+ * `llms.ts` can also return the complete file as a string, or a `Response`.
1446
+ */
1447
+ type LlmsTxt = FarmLlmsTxt;
1448
+ type LlmsTxtSection = FarmLlmsTxtSection;
1449
+ type LlmsTxtLink = FarmLlmsTxtLink;
1450
+ /** A static page of the app, usable directly as an llms.txt link. */
1451
+ type LlmsTxtPage = FarmLlmsTxtPage;
1452
+ /** What an `llms.ts` default-export function receives. */
1453
+ interface LlmsTxtContext extends MetadataRouteContext {
1454
+ /** The app's static pages, linking to their Markdown mirrors when exposed. */
1455
+ pages: LlmsTxtPage[];
1456
+ /** The llms.txt that `agent.llmsTxt` would serve, to extend instead of replace. */
1457
+ defaults: LlmsTxt;
1458
+ }
1459
+ /**
1460
+ * What an `llms-full.ts` default-export function receives. Returning an
1461
+ * `LlmsTxt` object inlines each same-origin link's Markdown; returning a string
1462
+ * serves it as the complete file.
1463
+ */
1464
+ interface LlmsFullTxtContext extends LlmsTxtContext {
1465
+ /** A page's Markdown mirror, read without the request's cookies; `null` if unavailable. */
1466
+ markdown(url: string): Promise<string | null>;
1467
+ }
1468
+ }
1469
+ interface MetadataRouteContext {
1470
+ request: Request;
1471
+ params: Record<string, string>;
1472
+ searchParams: URLSearchParams;
1473
+ /** The concrete route-segment path that owns the metadata file. */
1474
+ path: string;
1475
+ }
1476
+ interface FarmMetadataRouteModule {
1477
+ revalidate?: number | false;
1478
+ }
1479
+ interface FarmMetadataRouteResponseOptions {
1480
+ method?: string;
1481
+ /** The request being answered, so llms.txt reads can be reported as agent traffic. */
1482
+ request?: Request;
1483
+ }
1484
+ /** @internal */
1485
+ declare function createFarmMetadataRouteResponse(kind: ApplicationMetadataRouteKind, value: unknown, routeModule?: FarmMetadataRouteModule, options?: FarmMetadataRouteResponseOptions): Response;
1486
+
1487
+ type FarmCrawlerPolicy = "allow" | "block";
1488
+ interface FarmAgentCrawlers {
1489
+ /** Set to `false` to stop serving the generated robots.txt while keeping these options. */
1490
+ enabled?: boolean;
1491
+ /**
1492
+ * AI search and user-triggered agents such as OAI-SearchBot, Claude-SearchBot,
1493
+ * and PerplexityBot. Left unset, they follow the `User-agent: *` rules.
1494
+ */
1495
+ search?: FarmCrawlerPolicy;
1496
+ /**
1497
+ * AI training crawlers such as GPTBot, ClaudeBot, Google-Extended, and CCBot.
1498
+ * Left unset, they follow the `User-agent: *` rules.
1499
+ */
1500
+ training?: FarmCrawlerPolicy;
1501
+ /**
1502
+ * More robots.txt groups, written after the generated ones. Crawlers combine
1503
+ * groups that name the same agent. A rule for `*` replaces the default
1504
+ * `User-agent: *` / `Allow: /` group.
1505
+ */
1506
+ rules?: MetadataRoute.RobotsRule[];
1507
+ /**
1508
+ * Absolute sitemap URLs. Defaults to the app's `sitemap.ts` route, resolved
1509
+ * against the root layout's `metadataBase`; with neither, no `Sitemap:` line.
1510
+ */
1511
+ sitemap?: string | string[];
1512
+ }
1513
+ interface ResolvedFarmAgentCrawlers {
1514
+ enabled: boolean;
1515
+ search?: FarmCrawlerPolicy;
1516
+ training?: FarmCrawlerPolicy;
1517
+ rules: MetadataRoute.RobotsRule[];
1518
+ sitemap?: string[];
1519
+ }
1520
+ interface FarmAgentRobotsOptions {
1521
+ crawlers: ResolvedFarmAgentCrawlers;
1522
+ /** The app's root sitemap route, such as `/sitemap.xml`, when it has one. */
1523
+ sitemapPath?: string;
1524
+ /** The root layout's `metadataBase`, which makes the sitemap URL absolute. */
1525
+ metadataBase?: unknown;
1526
+ basePath?: string;
1527
+ }
1528
+ /** The robots.txt `agent.crawlers` serves. */
1529
+ declare function createFarmAgentRobots(options: FarmAgentRobotsOptions): MetadataRoute.Robots;
1530
+
1531
+ interface FarmAgentSitemapUserConfig {
1532
+ /** Set to `false` to turn the sitemap off while keeping these options. */
1533
+ enabled?: boolean;
1534
+ /** Route patterns to list, such as `/blog/[...slug]`. Defaults to every static page. */
1535
+ include?: string[];
1536
+ /** Route patterns to leave out, such as `/admin/[...path]`. */
1537
+ exclude?: string[];
1538
+ }
1539
+ interface ResolvedFarmAgentSitemap {
1540
+ enabled: boolean;
1541
+ include: string[];
1542
+ exclude: string[];
1543
+ }
1544
+ interface FarmSitemapPageSource {
1545
+ pattern: string;
1546
+ /** The page module, for its `metadata` and whether a route `guard` gates it. */
1547
+ module?: unknown;
1548
+ /** When the page's file last changed, as an ISO date. */
1549
+ lastModified?: string;
1550
+ }
1551
+ /**
1552
+ * The generated sitemap's entries. Dynamic routes have no single URL and are left out,
1553
+ * as are pages whose metadata says noindex and pages behind a route `guard`. URLs are
1554
+ * absolute, on the root layout's `metadataBase` when it has one and the request's
1555
+ * origin otherwise, the same origin the generated llms.txt links to.
1556
+ */
1557
+ declare function createFarmDefaultSitemap(sources: Iterable<FarmSitemapPageSource>, options: {
1558
+ origin: string;
1559
+ config: ResolvedFarmAgentSitemap;
1560
+ metadataBase?: unknown;
1561
+ basePath?: string;
1562
+ }): MetadataRoute.Sitemap;
1563
+
1564
+ /**
1565
+ * Agent-readiness configuration: primitives that make a Farm site easier for AI agents and
1566
+ * crawlers to discover, resolve, and use. The ones that only describe the site agents can
1567
+ * already read (JSON-LD, llms.txt, the sitemap, and the AI catalog of MCP servers the app
1568
+ * already serves, plus a read-only MCP server over the same public pages) are on by default; the
1569
+ * ones that expose more (crawler rules, an API catalog) are opt-in. Each one turns off with `false`.
1570
+ */
1571
+
1572
+ /** schema.org JSON-LD emitted in the document head to identify the site. */
1573
+ interface FarmAgentJsonLd {
1574
+ /**
1575
+ * schema.org `@type`. Common values: `"Organization"` for a company or
1576
+ * project, `"SoftwareApplication"` for a product, `"WebSite"`, `"Person"`.
1577
+ *
1578
+ * @default "Organization"
1579
+ */
1580
+ type?: string;
1581
+ /** Entity name. Defaults to the site's Open Graph site name or page title. */
1582
+ name?: string;
1583
+ /** Canonical URL for the entity. Defaults to the configured `metadataBase`. */
1584
+ url?: string;
1585
+ /** Short description. Defaults to the page/site metadata description. */
1586
+ description?: string;
1587
+ /** Logo URL. */
1588
+ logo?: string;
1589
+ /** URLs that also represent this entity (social profiles, repos) — schema.org `sameAs`. */
1590
+ sameAs?: string[];
1591
+ /** Additional schema.org properties merged into the emitted object. */
1592
+ properties?: Record<string, unknown>;
1593
+ }
1594
+ interface FarmAgentUserConfig {
1595
+ /**
1596
+ * Emit schema.org JSON-LD in the document head so agents and crawlers can
1597
+ * resolve the site's identity. Left unset, it emits a `WebSite` built from the
1598
+ * site's metadata; `true` emits an `Organization`; an object customizes the type
1599
+ * and fields; `false` turns it off.
1600
+ *
1601
+ * @default { type: "WebSite" }
1602
+ */
1603
+ jsonLd?: boolean | FarmAgentJsonLd;
1604
+ /**
1605
+ * On a preview deployment, send `X-Robots-Tag: noindex, nofollow` with every
1606
+ * response from Farm's server. Previews are detected from `FARM_PREVIEW`,
1607
+ * `VERCEL_ENV=preview`, Netlify's deploy-preview and branch-deploy contexts,
1608
+ * and Render pull request previews. Production is unaffected.
1609
+ *
1610
+ * @default false
1611
+ */
1612
+ noindexPreviews?: boolean;
1613
+ /**
1614
+ * Serve `/llms.txt` (https://llmstxt.org): a Markdown index of the app's static
1615
+ * pages, linking to their Markdown mirrors. `true` builds it from page metadata
1616
+ * and also serves `/llms-full.txt`; an object sets the title, summary, details,
1617
+ * and which routes to list. A `src/app/llms.ts` metadata route or a
1618
+ * `public/llms.txt` replaces the generated file. Left unset, `/llms.txt` is served
1619
+ * (without `/llms-full.txt`) unless the docs engine is enabled, which serves its own.
1620
+ *
1621
+ * @default { full: false } without docs, false with docs
1622
+ */
1623
+ llmsTxt?: boolean | FarmLlmsTxtUserConfig;
1624
+ /**
1625
+ * Serve `/sitemap.xml` listing the app's static pages, the same pages the generated
1626
+ * llms.txt lists, each with the time its page file last changed. Dynamic routes,
1627
+ * pages whose metadata says noindex, pages behind a route `guard`, and pages a
1628
+ * path-specific guard covers (non-root middleware.ts, a config or integration
1629
+ * middleware matcher naming the path) are left out.
1630
+ * URLs use the root layout's `metadataBase`, or the request's origin without one. An
1631
+ * object sets which routes to list. A `src/app/sitemap.ts` or `public/sitemap.xml`
1632
+ * replaces the generated file. Left unset, it is served unless the docs engine is
1633
+ * enabled, which serves its own.
1634
+ *
1635
+ * @default true without docs, false with docs
1636
+ */
1637
+ sitemap?: boolean | FarmAgentSitemapUserConfig;
1638
+ /**
1639
+ * Serve a generated `/robots.txt` that allows or blocks AI search agents
1640
+ * (`search`) and AI training crawlers (`training`), plus your own `rules`.
1641
+ * `true` serves only `User-agent: *` / `Allow: /` and the sitemap. A
1642
+ * `public/robots.txt` or `src/app/robots.ts` replaces the generated file.
1643
+ *
1644
+ * @default false
1645
+ */
1646
+ crawlers?: boolean | FarmAgentCrawlers;
1647
+ /**
1648
+ * Serve `/.well-known/api-catalog` (RFC 9727): a Linkset listing the app's
1649
+ * OpenAPI description and reference (when `openapi` is enabled) and its MCP
1650
+ * endpoint (when the top-level `mcp` is enabled), so agents can find them
1651
+ * from the origin alone.
1652
+ *
1653
+ * @default false
1654
+ */
1655
+ apiCatalog?: boolean;
1656
+ /**
1657
+ * Advertise the app's MCP servers (the top-level `mcp` config, `apiMcp()`, and
1658
+ * endpoints listed with `registerFarmMCPServer`, such as the docs engine's):
1659
+ * `/.well-known/ai-catalog.json` (and `/.well-known/ard.json`) lists a server
1660
+ * card for each, served at `<endpoint>/server-card`, and the generated
1661
+ * `/llms.txt` names each endpoint. Nothing is served when the app has no MCP
1662
+ * server. `false` turns all of it off.
1663
+ *
1664
+ * @default true
1665
+ */
1666
+ aiCatalog?: boolean;
1667
+ /**
1668
+ * Serve `/.well-known/farmjs.json`: Farm's version and packages, the app's MCP tools and
1669
+ * their schemas, WebMCP browser tools, integration providers and plugin names. Everyone,
1670
+ * Farm Infra included, gets the same public document; an MCP server that requires
1671
+ * `authorize` or sits behind a guard is listed by identity only. An object hides sections
1672
+ * (served as `null`), package versions, schemas or single servers and tools. `false` turns
1673
+ * it off; Farm Infra then can't discover the app's tools either.
1674
+ *
1675
+ * @default true
1676
+ */
1677
+ manifest?: boolean | FarmAppManifestConfig;
1678
+ /**
1679
+ * Serve a read-only MCP server (Streamable HTTP) at `/mcp` with tools that list,
1680
+ * search, and read the app's public pages as Markdown: the static pages llms.txt and
1681
+ * the sitemap list, without pages whose metadata says noindex or pages a route `guard`
1682
+ * or path-specific guard covers. Pages are read like an anonymous visitor, never with the caller's cookies.
1683
+ * It steps aside when the app has an MCP server of its own: a route that answers
1684
+ * `/mcp`, an API route at `/api/mcp`, the top-level `mcp` config or `apiMcp()`, or a
1685
+ * server listed with `registerFarmMCPServer` (the docs engine's MCP). Left unset, it
1686
+ * is served unless the docs engine is enabled, which serves its own.
1687
+ *
1688
+ * @default true without docs, false with docs
1689
+ */
1690
+ mcp?: boolean;
1691
+ }
1692
+ interface ResolvedFarmAgentConfig {
1693
+ jsonLd: FarmAgentJsonLd | false;
1694
+ noindexPreviews: boolean;
1695
+ llmsTxt: ResolvedFarmLlmsTxtConfig;
1696
+ sitemap: ResolvedFarmAgentSitemap;
1697
+ crawlers: ResolvedFarmAgentCrawlers;
1698
+ apiCatalog: boolean;
1699
+ aiCatalog: boolean;
1700
+ manifest: false | ResolvedFarmAppManifestConfig;
1701
+ mcp: boolean;
1702
+ }
1703
+
1704
+ interface FarmDocsAdapterDescriptor {
1705
+ id: string;
1706
+ protocol: number;
1707
+ server: string;
1708
+ react?: string;
1709
+ vite?: string;
1710
+ /**
1711
+ * Build-time entry that compiles the adapter's docs runtime into Farm's
1712
+ * serializable edge manifest. Older Farm releases safely ignore it.
1713
+ */
1714
+ edgeCompiler?: string;
1715
+ }
1716
+ interface FarmDocsSidebarItem {
1717
+ label?: string;
1718
+ title?: string;
1719
+ slug?: string;
1720
+ href?: string;
1721
+ icon?: string;
1722
+ children?: FarmDocsSidebarItem[];
1723
+ items?: FarmDocsSidebarItem[];
1724
+ }
1725
+ interface FarmDocsNavigationConfig {
1726
+ sidebar?: FarmDocsSidebarItem[];
1727
+ }
1728
+ interface FarmDocsSocialImageConfig {
1729
+ /** Generate a page-specific 1200×630 social image. Defaults to true. */
1730
+ enabled?: boolean;
1731
+ /** Absolute public origin used in social metadata, e.g. https://example.com. */
1732
+ baseUrl?: string;
1733
+ /** Site name shown in Open Graph metadata. Defaults to the docs navigation title. */
1734
+ siteName?: string;
1735
+ /** Short brand label drawn in the image header. Defaults to siteName. */
1736
+ brand?: string;
1737
+ /** Optional WOFF2 URLs or data URLs embedded into the generated SVG. */
1738
+ fonts?: FarmDocsSocialImageFonts;
1739
+ }
1740
+ interface FarmDocsSocialImageFonts {
1741
+ /** Display face used for page titles. */
1742
+ display?: string;
1743
+ /** Sans-serif face used for descriptions. */
1744
+ sans?: string;
1745
+ /** Monospace face used for labels, routes, and diagrams. */
1746
+ mono?: string;
1747
+ }
1748
+ type FarmDocsRuntimeConfig = Partial<DocsConfig> & {
1749
+ /**
1750
+ * Public favicon URL used by the standalone docs renderer.
1751
+ * Set this explicitly when docs should share the host application's icon.
1752
+ */
1753
+ favicon?: string;
1754
+ /**
1755
+ * Optional serializable navigation tree used by Farm's docs runtime.
1756
+ * Icon values reference keys from `icons`.
1757
+ */
1758
+ navigation?: FarmDocsNavigationConfig;
1759
+ /**
1760
+ * Automatic page-specific Open Graph and X images for Markdown docs.
1761
+ * Enabled by default. Set false to opt out for the complete docs tree.
1762
+ */
1763
+ socialImage?: boolean | FarmDocsSocialImageConfig;
1764
+ };
1765
+ type FarmDocsConfigInput = FarmDocsRuntimeConfig & {
1766
+ /**
1767
+ * Versioned runtime descriptor supplied by an external docs adapter.
1768
+ * Set false to pin the embedded renderer and disable framework
1769
+ * auto-detection.
1770
+ */
1771
+ adapter?: FarmDocsAdapterDescriptor | false;
1772
+ /**
1773
+ * Farm public route for docs, e.g. "/docs". When passed through
1774
+ * `config`, this is converted to the docs package's folder-style `entry`.
1775
+ */
1776
+ entry?: string;
1777
+ /** Explicit public route prefix. Defaults to `entry`. */
1778
+ docsPath?: string;
1779
+ /** Source content directory, relative to the project root. */
1780
+ contentDir?: string;
1781
+ /** Set to false to opt out even when a docs config file exists. */
1782
+ enabled?: boolean;
1783
+ /** Inline @farming-labs/docs config object. */
1784
+ config?: FarmDocsRuntimeConfig;
1785
+ /** Path to docs.config.* or docs.json. */
1786
+ configPath?: string;
1787
+ };
1788
+ type FarmDocsUserConfig = boolean | FarmDocsConfigInput;
1789
+ interface FarmDocsResolvedConfig {
1790
+ enabled: boolean;
1791
+ entry: string;
1792
+ adapter?: FarmDocsAdapterDescriptor;
1793
+ contentDir?: string;
1794
+ configPath?: string;
1795
+ config: FarmDocsRuntimeConfig & Pick<DocsConfig, "entry">;
1796
+ /**
1797
+ * `config` before it was made serializable: icons and other React elements, MDX
1798
+ * components, and callbacks intact. Only the in-process adapter runtime reads it;
1799
+ * whatever Farm serializes uses `config`.
1800
+ */
1801
+ runtimeConfig?: FarmDocsRuntimeConfig & Pick<DocsConfig, "entry">;
1802
+ /** The serializable docs settings from `farm.config.ts`, applied over the config file. */
1803
+ configOverrides?: Partial<DocsConfig>;
1804
+ }
1805
+
1806
+ type FarmMdxComponent = React__default.ComponentType<any> | keyof React__default.JSX.IntrinsicElements;
1807
+ type FarmMdxComponents = Record<string, FarmMdxComponent>;
1808
+ interface FarmMdxUserConfig {
1809
+ /**
1810
+ * Component map or module path that exports `components` or a default component map.
1811
+ * Relative paths resolve from the project root.
1812
+ */
1813
+ components?: string | FarmMdxComponents;
1814
+ /**
1815
+ * Serve source-authored markdown pages at `/route.md`.
1816
+ * Enabled by default for `page.md` and `page.mdx`.
1817
+ */
1818
+ markdownRoutes?: boolean;
1819
+ /** Class name used for the wrapper around rendered markdown content. */
1820
+ className?: string;
1821
+ }
1822
+ interface FarmMdxResolvedConfig {
1823
+ components?: string | FarmMdxComponents;
1824
+ markdownRoutes: boolean;
1825
+ className: string;
1826
+ }
1827
+ declare function resolveMdxConfig(config: FarmMdxUserConfig | undefined): FarmMdxResolvedConfig;
1828
+ /**
1829
+ * The MDX components module a Markdown page renders from, as an absolute path. Undefined when
1830
+ * the components are an inline object, which cannot be analyzed for client components.
1831
+ */
1832
+ declare function resolveFarmMdxComponentsModulePath(config: FarmMdxResolvedConfig | undefined, root: string): string | undefined;
1833
+
1834
+ /**
1835
+ * Farm.js Middleware System
1836
+ *
1837
+ * Type definitions for the middleware system
1838
+ */
1839
+
1840
+ /**
1841
+ * Next function type for middleware chain
1842
+ */
1843
+ type MiddlewareResult = void | Response;
1844
+ type NextFunction = () => Promise<MiddlewareResult>;
1845
+ type MiddlewareStoreKey<TValues extends Record<string, any>> = Extract<keyof TValues, string>;
1846
+ /**
1847
+ * A typed view over the request-scoped maps used by middleware.
1848
+ */
1849
+ interface ReadonlyMiddlewareStore<TValues extends Record<string, any> = Record<string, any>> {
1850
+ readonly size: number;
1851
+ get<TKey extends MiddlewareStoreKey<TValues>>(key: TKey): TValues[TKey] | undefined;
1852
+ has<TKey extends MiddlewareStoreKey<TValues>>(key: TKey): boolean;
1853
+ entries(): IterableIterator<[MiddlewareStoreKey<TValues>, TValues[MiddlewareStoreKey<TValues>]]>;
1854
+ keys(): IterableIterator<MiddlewareStoreKey<TValues>>;
1855
+ values(): IterableIterator<TValues[MiddlewareStoreKey<TValues>]>;
1856
+ forEach(callback: (value: TValues[MiddlewareStoreKey<TValues>], key: MiddlewareStoreKey<TValues>, store: ReadonlyMiddlewareStore<TValues>) => void, thisArg?: any): void;
1857
+ [Symbol.iterator](): IterableIterator<[
1858
+ MiddlewareStoreKey<TValues>,
1859
+ TValues[MiddlewareStoreKey<TValues>]
1860
+ ]>;
1861
+ }
1862
+ interface MiddlewareStore<TValues extends Record<string, any> = Record<string, any>> extends ReadonlyMiddlewareStore<TValues> {
1863
+ clear(): void;
1864
+ delete<TKey extends MiddlewareStoreKey<TValues>>(key: TKey): boolean;
1865
+ set<TKey extends MiddlewareStoreKey<TValues>>(key: TKey, value: TValues[TKey]): this;
1866
+ }
1867
+ /**
1868
+ * Middleware function signature
1869
+ */
1870
+ type MiddlewareFunction = (ctx: MiddlewareContext, next: NextFunction) => MiddlewareResult | Promise<MiddlewareResult>;
1871
+ /**
1872
+ * Context passed to a named, request-first middleware export.
1873
+ * `locals` and the get/set helpers stay on the server. `data` can be exposed
1874
+ * through page props and should contain only serializable, client-safe values.
1875
+ */
1876
+ interface RequestMiddlewareContext<TLocals extends Record<string, any> = Record<string, any>, TData extends Record<string, any> = Record<string, any>> {
1877
+ readonly url: URL;
1878
+ readonly pathname: string;
1879
+ /** The pathname the router matches: decoded once, without basePath or locale. */
1880
+ readonly routePathname: string;
1881
+ readonly searchParams: URLSearchParams;
1882
+ readonly method: string;
1883
+ readonly params: Record<string, string>;
1884
+ readonly route: string;
1885
+ readonly locals: MiddlewareStore<TLocals>;
1886
+ readonly data: MiddlewareStore<TData>;
1887
+ readonly headers: Map<string, string>;
1888
+ readonly cookies: CookieJar;
1889
+ get<TKey extends MiddlewareStoreKey<TLocals>>(key: TKey): TLocals[TKey] | undefined;
1890
+ has<TKey extends MiddlewareStoreKey<TLocals>>(key: TKey): boolean;
1891
+ set<TKey extends MiddlewareStoreKey<TLocals>>(key: TKey, value: TLocals[TKey]): void;
1892
+ delete<TKey extends MiddlewareStoreKey<TLocals>>(key: TKey): boolean;
1893
+ redirect(url: string, status?: number): void;
1894
+ rewrite(url: string): void;
1895
+ json(data: any, status?: number): void;
1896
+ text(content: string, status?: number): void;
1897
+ html(content: string, status?: number): void;
1898
+ }
1899
+ type RequestMiddleware<TLocals extends Record<string, any> = Record<string, any>, TData extends Record<string, any> = Record<string, any>> = (request: Request, context: RequestMiddlewareContext<TLocals, TData>) => MiddlewareResult | Promise<MiddlewareResult>;
1900
+ /**
1901
+ * Cookie options
1902
+ */
1903
+ interface CookieOptions {
1904
+ maxAge?: number;
1905
+ expires?: Date;
1906
+ path?: string;
1907
+ domain?: string;
1908
+ secure?: boolean;
1909
+ httpOnly?: boolean;
1910
+ sameSite?: "strict" | "lax" | "none";
1911
+ }
1912
+ /**
1913
+ * Cookie management interface
1914
+ */
1915
+ interface CookieJar {
1916
+ get(name: string): string | undefined;
1917
+ set(name: string, value: string, options?: CookieOptions): void;
1918
+ /**
1919
+ * Remove a cookie. Pass the `path`/`domain` it was set with; a tombstone only
1920
+ * matches a cookie with the same scope.
1921
+ */
1922
+ delete(name: string, options?: CookieOptions): void;
1923
+ getAll(): Record<string, string>;
1924
+ }
1925
+ interface RateLimitIncrementResult {
1926
+ count: number;
1927
+ /** Unix epoch timestamp in milliseconds when the fixed window resets. */
1928
+ resetAt: number;
1929
+ }
1930
+ interface RateLimitStorage {
1931
+ /** Atomically increment a key and create or retain its fixed expiry window. */
1932
+ increment(key: string, windowMs: number): Promise<RateLimitIncrementResult> | RateLimitIncrementResult;
1933
+ /** Optional inspection support used by getRateLimitStatus(). */
1934
+ get?(key: string): Promise<RateLimitIncrementResult | null> | RateLimitIncrementResult | null;
1935
+ }
1936
+ interface MemoryRateLimitStorageOptions {
1937
+ /** Maximum number of active keys retained by this process. */
1938
+ maxEntries?: number;
1939
+ }
1940
+ interface RateLimitConfig {
1941
+ requests: number;
1942
+ window: string;
1943
+ keyGenerator?: (ctx: MiddlewareContext) => string;
1944
+ onLimit?: (ctx: MiddlewareContext) => void | Response | Promise<void | Response>;
1945
+ storage?: RateLimitStorage;
1946
+ }
1947
+ interface RateLimitStatus {
1948
+ requests: number;
1949
+ limit: number;
1950
+ remaining: number;
1951
+ resetIn: number | null;
1952
+ resetAt: Date | null;
1953
+ isLimited: boolean;
1954
+ }
1955
+ /**
1956
+ * Middleware configuration
1957
+ */
1958
+ type MiddlewareMatcher = string | RegExp | ((ctx: MiddlewareContext) => boolean);
1959
+ interface MiddlewareConfig$1 {
1960
+ matcher?: MiddlewareMatcher | MiddlewareMatcher[];
1961
+ exclude?: (string | RegExp)[];
1962
+ runtime?: "nodejs" | "edge";
1963
+ /**
1964
+ * Whether a response this middleware lets through may be stored by a shared cache (a CDN).
1965
+ * Farm cannot tell a guard from harmless middleware, and a CDN serves its copy without
1966
+ * running either, so by default (`"private"`) the response is sent with
1967
+ * `Cache-Control: private, no-store`. Set `"public"` only on middleware that never decides
1968
+ * who may read the response, such as logging or response headers.
1969
+ */
1970
+ cache?: "private" | "public";
1971
+ }
1972
+ interface MiddlewareConfigEntry extends MiddlewareConfig$1 {
1973
+ handler?: MiddlewareFunction;
1974
+ handlers?: MiddlewareFunction[];
1975
+ }
1976
+ type FarmMiddlewareConfig = MiddlewareConfig$1 | MiddlewareConfigEntry | MiddlewareConfigEntry[];
1977
+ /**
1978
+ * Middleware context - the main object passed to middleware functions
1979
+ */
1980
+ interface MiddlewareContext {
1981
+ request: IncomingMessage;
1982
+ response: ServerResponse;
1983
+ url: URL;
1984
+ /** Request pathname as received: still percent-encoded and carrying basePath/locale. */
1985
+ pathname: string;
1986
+ /**
1987
+ * The pathname the router matches: decoded once, without basePath or locale. String matchers
1988
+ * compare this value; compare it in path checks too. Updated by `rewrite()`.
1989
+ */
1990
+ readonly routePathname: string;
1991
+ searchParams: URLSearchParams;
1992
+ method: string;
1993
+ params: Record<string, string>;
1994
+ route: string;
1995
+ parent?: {
1996
+ data: Map<string, any>;
1997
+ locals?: Map<string, any>;
1998
+ headers: Record<string, string>;
1999
+ };
2000
+ vite: {
2001
+ isDev: boolean;
2002
+ hmr: boolean;
2003
+ server?: ViteDevServer;
2004
+ };
2005
+ data: Map<string, any>;
2006
+ locals: Map<string, any>;
2007
+ headers: Map<string, string>;
2008
+ cookies: CookieJar;
2009
+ _handled: boolean;
2010
+ _redirectUrl?: string;
2011
+ _rewriteUrl?: string;
2012
+ redirect(url: string, status?: number): void;
2013
+ rewrite(url: string): void;
2014
+ json(data: any, status?: number): void;
2015
+ text(content: string, status?: number): void;
2016
+ html(content: string, status?: number): void;
2017
+ }
2018
+ /**
2019
+ * Middleware chain interface
2020
+ */
2021
+ interface MiddlewareChain {
2022
+ use(fn: MiddlewareFunction): MiddlewareChain;
2023
+ /**
2024
+ * Conditionally run middleware based on a condition.
2025
+ * Supports boolean values or functions that evaluate to boolean.
2026
+ *
2027
+ * @example
2028
+ * .when(true, (ctx, next) => { ... }) // Always run
2029
+ * .when((ctx) => ctx.data.get('flag'), (ctx, next) => { ... }) // Conditional
2030
+ */
2031
+ when(condition: boolean | ((ctx: MiddlewareContext) => boolean), fn: MiddlewareFunction | ((chain: MiddlewareChain) => void)): MiddlewareChain;
2032
+ rateLimit(config: RateLimitConfig): MiddlewareChain;
2033
+ redirect(source: string, destination: string, permanent?: boolean): MiddlewareChain;
2034
+ /**
2035
+ * Rewrite the current route to a new destination.
2036
+ * In route-specific middleware, this rewrites the middleware's route.
2037
+ *
2038
+ * @param destination - The destination path to rewrite to
2039
+ * @param condition - Optional boolean or function that evaluates to boolean. If false, rewrite is skipped.
2040
+ *
2041
+ * @example
2042
+ * // In /contact/middleware.ts
2043
+ * .rewrite('/about') // Always rewrites /contact to /about
2044
+ * .rewrite('/about', true) // Always rewrites
2045
+ * .rewrite('/about', false) // Never rewrites
2046
+ * .rewrite('/about', (ctx) => ctx.data.get('shouldRewrite')) // Conditional rewrite
2047
+ */
2048
+ rewrite(destination: string, condition?: boolean | ((ctx: MiddlewareContext) => boolean)): MiddlewareChain;
2049
+ build(): {
2050
+ handlers: MiddlewareFunction[];
2051
+ config?: MiddlewareConfig$1;
2052
+ };
2053
+ }
2054
+ /**
2055
+ * Middleware module export
2056
+ */
2057
+ interface MiddlewareModule {
2058
+ default?: MiddlewareChain | MiddlewareFunction;
2059
+ middleware?: RequestMiddleware;
2060
+ config?: MiddlewareConfig$1;
2061
+ }
2062
+
2063
+ type FarmRedirectStatus = 301 | 302 | 303 | 307 | 308;
2064
+ interface FarmRedirectSignal {
2065
+ url: string;
2066
+ status: FarmRedirectStatus;
2067
+ }
2068
+ declare function redirect(url: string, status?: FarmRedirectStatus): never;
2069
+ declare function permanentRedirect(url: string): never;
2070
+ declare function notFound(): never;
2071
+ declare function isFarmRedirectError(error: unknown): boolean;
2072
+ declare function getFarmRedirectError(error: unknown): FarmRedirectSignal | null;
2073
+ declare function isFarmNotFoundError(error: unknown): boolean;
2074
+
2075
+ type FarmBuildActivityPosition = "bottom-right" | "bottom-left" | "top-right" | "top-left";
2076
+ interface FarmDevIndicatorsConfig {
2077
+ /** Show build and HMR activity in the browser during development. */
2078
+ buildActivity?: boolean;
2079
+ /** Corner used by the build activity indicator. */
2080
+ buildActivityPosition?: FarmBuildActivityPosition;
2081
+ }
2082
+ interface ResolvedFarmDevIndicatorsConfig {
2083
+ buildActivity: boolean;
2084
+ buildActivityPosition: FarmBuildActivityPosition;
2085
+ }
2086
+ declare function resolveFarmDevIndicatorsConfig(config: FarmDevIndicatorsConfig | undefined, mode?: "development" | "production"): ResolvedFarmDevIndicatorsConfig;
2087
+ declare function generateFarmDevIndicatorsClientRuntime(config: ResolvedFarmDevIndicatorsConfig): string;
2088
+
2089
+ interface FarmAuthEmailAndPasswordConfig {
2090
+ /** Require a verified email before creating a session. @default false */
2091
+ requireEmailVerification?: boolean;
2092
+ /** Smallest accepted password length. @default 8 */
2093
+ minPasswordLength?: number;
2094
+ /** Largest accepted password length. @default 128 */
2095
+ maxPasswordLength?: number;
2096
+ }
2097
+ interface FarmAuthSessionConfig {
2098
+ /** Session lifetime in seconds. @default 604800 */
2099
+ expiresIn?: number;
2100
+ /** Session refresh interval in seconds. @default 86400 */
2101
+ updateAge?: number;
2102
+ }
2103
+ interface FarmAuthDatabaseConfig {
2104
+ /**
2105
+ * Postgres connection string. Defaults to DATABASE_URL.
2106
+ * Local development falls back to SQLite when no URL is present.
2107
+ */
2108
+ url?: string;
2109
+ /** Local SQLite path. @default ".farm/auth.sqlite" */
2110
+ path?: string;
2111
+ /** Automatically update the auth schema in development. @default true */
2112
+ migrateInDevelopment?: boolean;
2113
+ }
2114
+ interface FarmAuthConfig {
2115
+ /** Set false to disable auth without removing its configuration. @default true */
2116
+ enabled?: boolean;
2117
+ /** Display name used by authentication emails and metadata. */
2118
+ appName?: string;
2119
+ /** Route prefix for the auth endpoints. @default "/api/auth" */
2120
+ basePath?: string;
2121
+ /**
2122
+ * Email/password authentication. It is enabled by default; set false to
2123
+ * disable it when adding another sign-in method.
2124
+ */
2125
+ emailAndPassword?: boolean | FarmAuthEmailAndPasswordConfig;
2126
+ session?: FarmAuthSessionConfig;
2127
+ database?: FarmAuthDatabaseConfig;
2128
+ }
2129
+ type FarmAuthUserConfig = boolean | FarmAuthConfig;
2130
+ interface ResolvedFarmAuthConfig {
2131
+ enabled: boolean;
2132
+ appName?: string;
2133
+ basePath: string;
2134
+ emailAndPassword: {
2135
+ enabled: boolean;
2136
+ requireEmailVerification: boolean;
2137
+ minPasswordLength: number;
2138
+ maxPasswordLength: number;
2139
+ };
2140
+ session: {
2141
+ expiresIn: number;
2142
+ updateAge: number;
2143
+ };
2144
+ database: {
2145
+ url?: string;
2146
+ path: string;
2147
+ migrateInDevelopment: boolean;
2148
+ };
2149
+ }
2150
+
2151
+ type FarmPreloadMode = "warn" | "enforce";
2152
+ interface FarmPreloadUserConfig {
2153
+ /** Report excess hints or remove the lower-priority hints. @default "enforce" */
2154
+ mode?: FarmPreloadMode;
2155
+ /** Maximum image preload hints per document. @default 1 */
2156
+ maxImages?: number;
2157
+ /** Maximum font preload hints per document. @default 2 */
2158
+ maxFonts?: number;
2159
+ }
2160
+ interface ResolvedFarmPreloadConfig {
2161
+ mode: FarmPreloadMode;
2162
+ maxImages: number;
2163
+ maxFonts: number;
2164
+ }
2165
+ interface FarmPerformanceConfig {
2166
+ preload?: FarmPreloadUserConfig;
2167
+ }
2168
+ interface ResolvedFarmPerformanceConfig {
2169
+ preload: ResolvedFarmPreloadConfig;
2170
+ }
2171
+ type FarmPreloadKind = "image" | "font";
2172
+ interface FarmPreloadBudgetWarning {
2173
+ kind: FarmPreloadKind;
2174
+ count: number;
2175
+ budget: number;
2176
+ removed: number;
2177
+ }
2178
+ interface FarmManagedPreloads {
2179
+ value: string;
2180
+ warnings: FarmPreloadBudgetWarning[];
2181
+ }
2182
+ interface FarmManagedDocumentPreloads {
2183
+ html: string;
2184
+ linkHeader: string;
2185
+ warnings: FarmPreloadBudgetWarning[];
2186
+ }
2187
+ /**
2188
+ * Apply image and font budgets to HTML preload elements. High-priority image
2189
+ * hints are retained before ordinary hints, making an explicitly preloaded LCP
2190
+ * image the winner when a document contains too many React-generated hints.
2191
+ */
2192
+ declare function manageFarmHtmlPreloads(html: string, config: ResolvedFarmPreloadConfig): FarmManagedPreloads;
2193
+ /** Apply the same budgets to HTTP Link preload hints, including Farm fonts. */
2194
+ declare function manageFarmLinkHeaderPreloads(value: string, config: ResolvedFarmPreloadConfig): FarmManagedPreloads;
2195
+ /** Apply a single document budget across HTML and HTTP Link header hints. */
2196
+ declare function manageFarmDocumentPreloads(html: string, linkHeader: string, config: ResolvedFarmPreloadConfig): FarmManagedDocumentPreloads;
2197
+ /** Rate-limit identical route-and-budget warnings within a server process. */
2198
+ declare function reportFarmPreloadWarnings(warnings: FarmPreloadBudgetWarning[], context?: string): void;
2199
+
2200
+ type FarmCspDirectiveValue = string | readonly string[] | boolean | null | undefined;
2201
+ type FarmCspDirectives = Readonly<Record<string, FarmCspDirectiveValue>>;
2202
+ interface FarmCspOptions {
2203
+ /** A pre-serialized CSP value. Cannot be combined with directives. */
2204
+ policy?: string;
2205
+ /** CSP directives using camelCase or kebab-case names. */
2206
+ directives?: FarmCspDirectives;
2207
+ /** Emit Content-Security-Policy-Report-Only instead of enforcing the policy. */
2208
+ reportOnly?: boolean;
2209
+ /**
2210
+ * Generate a fresh nonce for every dynamic HTML response and per-page
2211
+ * script hashes for prerendered HTML. Farm adds the matching sources to the
2212
+ * governing script directive. Only Farm's own scripts, the renderer's
2213
+ * streaming scripts, and scripts the app gives `getCspNonce()` carry the
2214
+ * nonce (or get a hash); every other script element loses its nonce.
2215
+ */
2216
+ nonce?: boolean;
2217
+ }
2218
+ type FarmCspConfig = string | FarmCspOptions;
2219
+ interface FarmSecurityConfig {
2220
+ /** App-wide CSP for dynamic responses and prerendered output. */
2221
+ csp?: FarmCspConfig | false;
2222
+ /** @deprecated Use csp. */
2223
+ contentSecurityPolicy?: never;
2224
+ }
2225
+ interface ResolvedFarmCspConfig {
2226
+ value: string;
2227
+ reportOnly: boolean;
2228
+ nonce: boolean;
2229
+ }
2230
+ interface ResolvedFarmSecurityConfig {
2231
+ csp: ResolvedFarmCspConfig | false;
2232
+ }
2233
+ declare function resolveFarmSecurityConfig(input: FarmSecurityConfig | ResolvedFarmSecurityConfig | undefined): ResolvedFarmSecurityConfig;
2234
+ declare function createFarmCspNonce(security: ResolvedFarmSecurityConfig): string | undefined;
2235
+ /**
2236
+ * Stamp the nonce of the response being rendered on Farm-generated `html`.
2237
+ * Returns `html` unchanged outside nonce mode.
2238
+ */
2239
+ declare function stampFarmCspNonce(html: string, nonce?: string | undefined): string;
2240
+ /**
2241
+ * Send `response` with the nonce policy. `nonce` is the one the response was
2242
+ * rendered with: script elements that carry it keep it, and every other
2243
+ * script element loses its nonce attribute, so markup injected into the page
2244
+ * can never run under the policy.
2245
+ */
2246
+ declare function applyFarmCspNonceToResponse(response: Response, security: ResolvedFarmSecurityConfig, nonce?: string | undefined): Response;
2247
+
2248
+ interface FarmDesktopDevSession {
2249
+ secret: string;
2250
+ handshakeToken: string;
2251
+ /** Set by the dev guard once the window used the token, so a Vite restart cannot reopen it. */
2252
+ handshakeUsed?: boolean;
2253
+ }
2254
+ /** Called by the CLI before it starts the dev server for `farm dev --desktop`. */
2255
+ declare function setFarmDesktopDevSession(session: FarmDesktopDevSession | undefined): void;
2256
+ interface FarmDesktopWindowConfig {
2257
+ /** Initial width in points. Defaults to 1024. */
2258
+ width?: number;
2259
+ /** Initial height in points. Defaults to 768. */
2260
+ height?: number;
2261
+ /** Window title. Defaults to `desktop.name`. */
2262
+ title?: string;
2263
+ }
2264
+ interface FarmDesktopUserConfig {
2265
+ /** Display name of the app. Defaults to the package.json `productName` or `name`. */
2266
+ name?: string;
2267
+ /**
2268
+ * Reverse-DNS app identifier, such as `com.example.notes`. The OS keys the app's data
2269
+ * directory on it, so changing it later moves the user's data. Defaults to `local.farm.<name>`.
2270
+ */
2271
+ id?: string;
2272
+ /** App version. Defaults to the package.json `version`. */
2273
+ version?: string;
2274
+ /**
2275
+ * App icon: a square PNG, relative to the app root. 1024×1024 is recommended; the OS scales it
2276
+ * down. Defaults to the Farm icon.
2277
+ */
2278
+ icon?: string;
2279
+ window?: FarmDesktopWindowConfig;
2280
+ /**
2281
+ * Desktop shell adapter. A name resolves to `@farm.js/desktop/<name>`; a package name or
2282
+ * subpath (containing `/`) is imported as is. Defaults to `"electrobun"`.
2283
+ */
2284
+ shell?: "electrobun" | (string & {});
2285
+ }
2286
+ /** What a function-valued `desktop` block receives. Resolved once per dev start or build. */
2287
+ interface FarmDesktopContext {
2288
+ /** The OS the app is built for. Builds target the host OS. */
2289
+ os: "macos" | "windows" | "linux";
2290
+ mode: "development" | "production";
2291
+ command: "dev" | "build";
2292
+ /** `--profile`, `"production"` by default. */
2293
+ profile: string;
2294
+ env: Readonly<Record<string, string | undefined>>;
2295
+ /** App root. */
2296
+ root: string;
2297
+ }
2298
+ /**
2299
+ * `desktop` in farm.config: a static block, or a function of the platform context that returns
2300
+ * one. The function runs in the CLI only; its code never reaches a server or browser bundle.
2301
+ */
2302
+ type FarmDesktopConfigInput = FarmDesktopUserConfig | ((context: FarmDesktopContext) => FarmDesktopUserConfig | Promise<FarmDesktopUserConfig>);
2303
+ interface ResolvedFarmDesktopConfig {
2304
+ name: string;
2305
+ id: string;
2306
+ version: string;
2307
+ /** Absolute path of the app's icon PNG, or undefined for the shell's default icon. */
2308
+ icon?: string;
2309
+ window: {
2310
+ width: number;
2311
+ height: number;
2312
+ title: string;
2313
+ };
2314
+ /** Adapter name, as configured. */
2315
+ shell: string;
2316
+ /** Module the CLI imports the adapter from, such as `@farm.js/desktop/electrobun`. */
2317
+ shellPackage: string;
2318
+ }
2319
+ /**
2320
+ * Check a `desktop` block. Web builds check a static block this way (a function-valued block is
2321
+ * not called there); desktop builds check the value a function returned, naming the OS.
2322
+ */
2323
+ declare function validateFarmDesktopConfig(input: unknown, context?: Pick<FarmDesktopContext, "os">): FarmDesktopUserConfig | undefined;
2324
+ /** Fill in `desktop` defaults for a desktop dev session or build. */
2325
+ /** Fill in defaults for an already resolved (static or returned) `desktop` block. */
2326
+ declare function resolveFarmDesktopConfig(input: FarmDesktopUserConfig | undefined, root: string, context?: Pick<FarmDesktopContext, "os">): ResolvedFarmDesktopConfig;
2327
+ /** Where `farm build --desktop` writes its outputs, relative to the app root. */
2328
+ declare function getFarmDesktopOutputDirs(distDir: string): {
2329
+ root: string;
2330
+ server: string;
2331
+ shell: string;
2332
+ dist: string;
2333
+ devData: string;
2334
+ };
2335
+ interface FarmDesktopSetupOptions {
2336
+ command: FarmDesktopContext["command"];
2337
+ /** `--profile`; defaults to `"production"`. */
2338
+ profile?: string;
2339
+ /** Target OS; defaults to the host. `farm config inspect --os` sets another one. */
2340
+ os?: FarmDesktopContext["os"];
2341
+ }
2342
+ /** The context a function-valued block receives. `env` is a frozen snapshot. */
2343
+ declare function createFarmDesktopContext(options: FarmDesktopSetupOptions & {
2344
+ root: string;
2345
+ mode: FarmDesktopContext["mode"];
2346
+ }): FarmDesktopContext;
2347
+ /** Results of function-valued blocks for one dev session or build. */
2348
+ type FarmDesktopBlockCache = Map<string, Promise<FarmDesktopUserConfig>>;
2349
+ /**
2350
+ * The plain `desktop` block for a context: the static object, or what the function returned.
2351
+ * Validated, with errors naming the OS and field.
2352
+ *
2353
+ * With a cache, the function runs once per session: `farm dev` loads farm.config more than once
2354
+ * while it starts, and each load brings a new function with the same source. An edited block has
2355
+ * new source, so it runs again.
2356
+ */
2357
+ declare function resolveFarmDesktopBlock(input: FarmDesktopConfigInput, context: FarmDesktopContext, cache?: FarmDesktopBlockCache): Promise<FarmDesktopUserConfig>;
2358
+ /** Called by `farm dev|build --desktop` before any config resolves. */
2359
+ declare function installFarmDesktopSetup(options: FarmDesktopSetupOptions): void;
2360
+
2361
+ declare const DEFAULT_FARM_API_BASE_PATH = "/api";
2362
+ interface FarmAPIConfigResolverContext {
2363
+ root: string;
2364
+ mode: "development" | "production";
2365
+ env: ResolvedFarmEnv;
2366
+ }
2367
+ type FarmAPIConfigValue = string | undefined | ((context: FarmAPIConfigResolverContext) => string | undefined | Promise<string | undefined>);
2368
+ interface FarmAPIConfig {
2369
+ /**
2370
+ * Public API root. An origin-only URL is joined with `basePath`; a URL that
2371
+ * already has a path is used as-is. May be resolved from deployment context.
2372
+ */
2373
+ baseURL?: FarmAPIConfigValue;
2374
+ /** Public API path and same-origin server mount used when `baseURL` has no path. @default "/api" */
2375
+ basePath?: FarmAPIConfigValue;
2376
+ }
2377
+ interface ResolvedFarmAPIConfig {
2378
+ /** Fully resolved public API root, either absolute or root-relative. */
2379
+ baseURL: string;
2380
+ /** Effective pathname of `baseURL`. */
2381
+ basePath: string;
2382
+ }
2383
+ declare function resolveFarmAPIConfig(config: FarmAPIConfig | undefined, context: FarmAPIConfigResolverContext): Promise<ResolvedFarmAPIConfig>;
2384
+ /** Normalize already-resolved API strings. */
2385
+ declare function normalizeFarmAPIConfig(config: {
2386
+ baseURL?: string;
2387
+ basePath?: string;
2388
+ } | undefined): ResolvedFarmAPIConfig;
2389
+ declare function normalizeFarmAPIBasePath(value: string): string;
2390
+ /** Read the API root embedded by Farm's Vite build. */
2391
+ declare function getFarmAPIBaseURL(): string;
2392
+ /** Resolve a canonical Farm route such as `/api/users` against an API root. */
2393
+ declare function resolveFarmAPIRequestURL(routePath: string, baseURL?: string, fallbackOrigin?: string): URL;
2394
+
2395
+ declare const FARM_RESOLVED_CUSTOM_CONTEXT: unique symbol;
2396
+
2397
+ interface RedirectConfig {
2398
+ source: string;
2399
+ destination: string;
2400
+ permanent?: boolean;
2401
+ statusCode?: FarmRedirectStatus;
2402
+ }
2403
+ interface HeaderConfig {
2404
+ source: string;
2405
+ headers: Array<{
2406
+ key: string;
2407
+ value: string;
2408
+ }>;
2409
+ }
2410
+ interface RewriteConfig {
2411
+ source: string;
2412
+ destination: string;
2413
+ }
2414
+ /** @deprecated Use FarmImageConfig. */
2415
+ type ImageConfig = FarmImageConfig;
2416
+ /** @deprecated Use FarmI18nUserConfig. */
2417
+ type I18nConfig = FarmI18nUserConfig;
2418
+ interface OpenAPIConfig {
2419
+ enabled?: boolean;
2420
+ route?: string;
2421
+ /**
2422
+ * Path where the raw OpenAPI spec is served as JSON, so agents and API tools
2423
+ * can fetch it at a predictable URL. Set to `false` to disable.
2424
+ *
2425
+ * @default "/openapi.json"
2426
+ */
2427
+ specRoute?: string | false;
2428
+ title?: string;
2429
+ description?: string;
2430
+ version?: string;
2431
+ /** Default authentication requirement for operations without an endpoint override. */
2432
+ security?: OpenAPISecurityMode;
2433
+ servers?: Array<{
2434
+ url: string;
2435
+ description?: string;
2436
+ }>;
2437
+ contact?: {
2438
+ name?: string;
2439
+ email?: string;
2440
+ url?: string;
2441
+ };
2442
+ license?: {
2443
+ name: string;
2444
+ url?: string;
2445
+ };
2446
+ }
2447
+ type MiddlewareConfig = FarmMiddlewareConfig;
2448
+ interface NotFoundConfig {
2449
+ /** Path to a custom 404 page component (e.g., "./src/app/not-found.tsx") */
2450
+ component?: string;
2451
+ }
2452
+ type FarmDeployTarget = "vercel" | "cloudflare" | "netlify" | "node" | string;
2453
+ interface FarmDeployConfig {
2454
+ /**
2455
+ * Deployment platform. When present, Farm picks the matching Nitro preset and
2456
+ * output directory unless explicitly overridden.
2457
+ */
2458
+ target?: FarmDeployTarget;
2459
+ /** Nitro preset override. Usually inferred from target. */
2460
+ preset?: FarmConfig["preset"];
2461
+ /** Deployable output directory, relative to project root unless absolute. */
2462
+ outputDir?: string;
2463
+ /** Alias for outputDir for terser config. */
2464
+ output?: string;
2465
+ /** Cloudflare Pages project name used by `farm deploy --cloudflare`. */
2466
+ projectName?: string;
2467
+ vercel?: {
2468
+ outputDirectory?: string;
2469
+ buildCommand?: string;
2470
+ installCommand?: string;
2471
+ framework?: string | null;
2472
+ };
2473
+ cloudflare?: {
2474
+ outputDir?: string;
2475
+ projectName?: string;
2476
+ };
2477
+ netlify?: {
2478
+ outputDir?: string;
2479
+ site?: string;
2480
+ };
2481
+ }
2482
+ interface ResolvedFarmDeployConfig extends Omit<FarmDeployConfig, "output"> {
2483
+ target?: FarmDeployTarget;
2484
+ preset: FarmConfig["preset"];
2485
+ outputDir: string;
2486
+ }
2487
+ interface FarmUserConfig extends Omit<FarmConfig, "vite" | "docs" | "env" | "layers"> {
2488
+ /** Reusable Farm directories or installed packages, applied from left to right. */
2489
+ extends?: readonly FarmLayerEntry[];
2490
+ /** Global plugins. Integration-bound plugins must be contributed through an integration. */
2491
+ plugins?: FarmPlugin<any, any, any, any, unknown, false>[];
2492
+ integrations?: FarmIntegrationsUserConfig;
2493
+ /**
2494
+ * Farm-native authentication. `true` enables email/password auth with
2495
+ * server helpers from `@farm.js/auth/server` and React APIs from
2496
+ * `@farm.js/auth/client`.
2497
+ */
2498
+ auth?: FarmAuthUserConfig;
2499
+ /** Compose opted-in API routes and standalone tools through an authenticated MCP transport. */
2500
+ mcp?: FarmMCPUserConfig;
2501
+ /** Shared application data, route, ISR, and PPR cache. */
2502
+ cache?: FarmCacheUserConfig;
2503
+ migrations?: FarmMigrationsUserConfig;
2504
+ /** Map portable cron schedules to ordinary GET API routes. */
2505
+ cron?: FarmCronUserConfig | FarmCronResolvedConfig | false;
2506
+ workflows?: FarmWorkflowsUserConfig | boolean;
2507
+ preset?: FarmConfig["preset"];
2508
+ deploy?: FarmDeployConfig;
2509
+ /**
2510
+ * The native desktop app `farm dev --desktop` and `farm build --desktop` produce: a block, or a
2511
+ * function of `{ os, mode, command, profile, env, root }` that returns one. A web build checks
2512
+ * a static block's shape, never calls the function, and ships neither.
2513
+ */
2514
+ desktop?: FarmDesktopConfigInput;
2515
+ docs?: FarmDocsUserConfig;
2516
+ md?: FarmMarkdownUserConfig | boolean;
2517
+ mdx?: FarmMdxUserConfig;
2518
+ observability?: FarmObservabilityUserConfig;
2519
+ trailingSlash?: boolean;
2520
+ redirects?: () => Promise<RedirectConfig[]> | RedirectConfig[];
2521
+ rewrites?: () => Promise<RewriteConfig[]> | RewriteConfig[];
2522
+ headers?: () => Promise<HeaderConfig[]> | HeaderConfig[];
2523
+ images?: ImageConfig;
2524
+ publicDir?: string;
2525
+ i18n?: FarmI18nUserConfig | false;
2526
+ openapi?: OpenAPIConfig;
2527
+ middleware?: FarmMiddlewareConfig;
2528
+ routeRules?: FarmRouteRules;
2529
+ context?: FarmConfig["context"];
2530
+ /** Server ingress and trusted-proxy policy. */
2531
+ server?: FarmServerConfig;
2532
+ serverActions?: FarmServerActionsConfig;
2533
+ /** Build identifier used to detect and recover from deployment version skew. */
2534
+ deploymentId?: string;
2535
+ notFound?: NotFoundConfig;
2536
+ distDir?: string;
2537
+ generateBuildId?: () => string | Promise<string>;
2538
+ compress?: boolean;
2539
+ devIndicators?: FarmDevIndicatorsConfig;
2540
+ serverRuntimeConfig?: Record<string, any>;
2541
+ publicRuntimeConfig?: Record<string, any>;
2542
+ env?: FarmEnvConfig<any, any>;
2543
+ vite?: UserConfig | ((config: UserConfig) => UserConfig);
2544
+ [key: string]: any;
2545
+ }
2546
+ interface ResolvedFarmConfig extends Required<Omit<FarmUserConfig, "extends" | "plugins" | "vite" | "deploy" | "docs" | "md" | "mdx" | "migrations" | "cron" | "workflows" | "api" | "env" | "server" | "serverActions" | "devtools" | "devIndicators" | "images" | "i18n" | "auth" | "mcp" | "performance" | "security" | "theme" | "renderer" | "agent" | "desktop">> {
2547
+ agent: ResolvedFarmAgentConfig;
2548
+ /** Set only in a desktop dev session or build (`--desktop`); `null` on the web. */
2549
+ desktop: ResolvedFarmDesktopConfig | null;
2550
+ /** @internal Tracks whether `context` came from user/layer config instead of the default noop. */
2551
+ [FARM_RESOLVED_CUSTOM_CONTEXT]?: boolean;
2552
+ root: string;
2553
+ extends: readonly FarmLayerEntry[];
2554
+ layers: ResolvedFarmLayer[];
2555
+ plugins: FarmPlugin[];
2556
+ vite: UserConfig;
2557
+ deploy: ResolvedFarmDeployConfig;
2558
+ docs: FarmDocsResolvedConfig;
2559
+ md: FarmMarkdownResolvedConfig;
2560
+ mdx: FarmMdxResolvedConfig;
2561
+ migrations: ResolvedFarmMigrationsConfig;
2562
+ cron: FarmCronResolvedConfig;
2563
+ workflows: FarmWorkflowsResolvedConfig;
2564
+ api: ResolvedFarmAPIConfig;
2565
+ env: ResolvedFarmEnv;
2566
+ server: ResolvedFarmServerConfig;
2567
+ serverActions: ResolvedFarmServerActionsConfig;
2568
+ devtools: ResolvedFarmDevtoolsConfig;
2569
+ devIndicators: ResolvedFarmDevIndicatorsConfig;
2570
+ images: ResolvedFarmImageConfig;
2571
+ i18n: ResolvedFarmI18nConfig;
2572
+ auth: ResolvedFarmAuthConfig;
2573
+ mcp: ResolvedFarmMCPConfig;
2574
+ performance: ResolvedFarmPerformanceConfig;
2575
+ security: ResolvedFarmSecurityConfig;
2576
+ theme: ResolvedFarmThemeConfig;
2577
+ renderer: FarmRenderer;
2578
+ routeRules: FarmRouteRules;
2579
+ notFound: NotFoundConfig;
2580
+ }
2581
+ type FarmLayerConfig = Omit<FarmUserConfig, "root" | "outDir" | "distDir" | "deploy" | "preset" | "publicDir" | "generateBuildId" | "deploymentId">;
2582
+
2583
+ declare function normalizeDeployTarget(target?: FarmDeployTarget): FarmDeployTarget | undefined;
2584
+ declare function getPresetForDeployTarget(target?: FarmDeployTarget): FarmConfig["preset"] | undefined;
2585
+ declare function getDeployTargetForPreset(preset?: string): FarmDeployTarget | undefined;
2586
+ declare function resolveDeployOutputPath(root: string, outputDir: string): string;
2587
+ declare function resolveDeployConfig(config: Pick<FarmUserConfig, "deploy" | "preset" | "distDir">, overrides?: {
2588
+ target?: FarmDeployTarget;
2589
+ preset?: FarmConfig["preset"];
2590
+ outputDir?: string;
2591
+ /** Build environment consulted for platform detection. Tests inject this. */
2592
+ env?: NodeJS.ProcessEnv;
2593
+ }): ResolvedFarmDeployConfig;
2594
+ declare function resolveMigrationsConfig(migrations: FarmMigrationsUserConfig | undefined): ResolvedFarmMigrationsConfig;
2595
+ declare function resolveConfig(userConfig: FarmUserConfig, mode: "development" | "production"): Promise<ResolvedFarmConfig>;
2596
+ declare function loadConfig(rootDir?: string, configPath?: string, mode?: string, loadEnvironment?: (typeof vite)["loadEnv"]): Promise<FarmUserConfig | undefined>;
2597
+
2598
+ type FarmRouteRuntime = "auto" | "node" | "edge";
2599
+ type FarmRouteRegions = "auto" | readonly string[];
2600
+ type FarmRouteMaxDuration = "auto" | number;
2601
+ /** Portable execution controls shared by file, programmatic, and config routes. */
2602
+ interface FarmRouteRuntimeConfig {
2603
+ runtime?: FarmRouteRuntime;
2604
+ regions?: FarmRouteRegions;
2605
+ maxDuration?: FarmRouteMaxDuration;
2606
+ }
2607
+ interface ResolvedFarmRouteRuntimeConfig {
2608
+ runtime: FarmRouteRuntime;
2609
+ regions?: string[];
2610
+ maxDuration?: number;
2611
+ }
2612
+ type FarmRouteRuntimeEntryKind = "page" | "api" | "metadata" | "rule";
2613
+ type FarmRouteRenderingMode = "static" | "dynamic";
2614
+ interface FarmRouteRuntimeManifestEntry extends ResolvedFarmRouteRuntimeConfig {
2615
+ kind: FarmRouteRuntimeEntryKind;
2616
+ pattern: string;
2617
+ rendering: FarmRouteRenderingMode;
2618
+ source?: string;
2619
+ }
2620
+ interface FarmRouteRuntimeManifest {
2621
+ version: 1;
2622
+ routes: FarmRouteRuntimeManifestEntry[];
2623
+ }
2624
+ declare function normalizeFarmRouteRuntimeConfig(value: FarmRouteRuntimeConfig | null | undefined, source?: string): FarmRouteRuntimeConfig;
2625
+ /** Merge from lowest to highest precedence. Explicit "auto" values reset inherited hints. */
2626
+ declare function mergeFarmRouteRuntimeConfigs(...configs: Array<FarmRouteRuntimeConfig | null | undefined>): FarmRouteRuntimeConfig;
2627
+ declare function resolveFarmRouteRuntimeConfig(config: FarmRouteRuntimeConfig | null | undefined, source?: string): ResolvedFarmRouteRuntimeConfig;
2628
+ declare function hasFarmRouteRuntimeControls(config: FarmRouteRuntimeConfig | null | undefined): boolean;
2629
+ declare function getFarmRouteRuntimeConfig(value: unknown): FarmRouteRuntimeConfig;
2630
+ declare function createFarmRouteRuntimeKey(config: ResolvedFarmRouteRuntimeConfig): string;
2631
+ /** Resolve matching route rules from broadest to most specific. */
2632
+ declare function resolveFarmRouteRuleRuntimeConfig(pathname: string, routeRules: Record<string, FarmRouteRuntimeConfig> | null | undefined): FarmRouteRuntimeConfig;
2633
+ declare function farmRouteRuleMatches(pattern: string, pathname: string): boolean;
2634
+
2635
+ type FarmRouteRuleRenderMode = "static" | "dynamic";
2636
+ type FarmRouteRuleRedirect = string | {
2637
+ to: string;
2638
+ statusCode?: FarmRedirectStatus;
2639
+ permanent?: boolean;
2640
+ };
2641
+ type FarmRouteRuleCors = boolean | {
2642
+ origin?: string;
2643
+ methods?: string | readonly string[];
2644
+ headers?: string | readonly string[];
2645
+ };
2646
+ interface FarmRouteRule extends FarmRouteRuntimeConfig {
2647
+ prerender?: boolean;
2648
+ render?: FarmRouteRuleRenderMode;
2649
+ ssr?: boolean;
2650
+ swr?: boolean | number;
2651
+ isr?: boolean | number;
2652
+ cors?: FarmRouteRuleCors;
2653
+ headers?: Record<string, string>;
2654
+ redirect?: FarmRouteRuleRedirect;
2655
+ }
2656
+ type FarmRouteRules = Record<string, FarmRouteRule>;
2657
+ declare function normalizeRouteRules(routeRules: FarmRouteRules | undefined): FarmRouteRules;
2658
+ declare function routeRulesToRedirects(routeRules: FarmRouteRules): RedirectConfig[];
2659
+ declare function routeRulesToHeaders(routeRules: FarmRouteRules): HeaderConfig[];
2660
+ declare function routeRulesToNitroRouteRules(routeRules: FarmRouteRules): Record<string, any>;
2661
+
2662
+ declare global {
2663
+ namespace FarmJS {
2664
+ /** @internal Application route patterns registered by generated types. */
2665
+ interface RouteRegistry {
2666
+ }
2667
+ }
2668
+ }
2669
+ /** A renderer-neutral component accepted by Farm's file-system router. */
2670
+ type FarmComponentType<TProps = Record<string, unknown>> = ((props: TProps) => any) | (new (props: TProps) => any);
2671
+ /** All generated route module patterns for the current application. */
2672
+ type AppRoutePattern = FarmJS.RouteRegistry extends {
2673
+ pattern: infer TPattern extends string;
2674
+ } ? TPattern : string;
2675
+ type FarmRoutePropsDefault = never;
2676
+ type FarmRoutePropsTarget = AppRoutePattern;
2677
+ type StripPageRouteSuffix<TRoute extends string> = TRoute extends `${infer TPath}?${string}` ? StripPageRouteSuffix<TPath> : TRoute extends `${infer TPath}#${string}` ? StripPageRouteSuffix<TPath> : TRoute;
2678
+ type SimplifyPageRouteParams<TValue> = {
2679
+ [TKey in keyof TValue]: TValue[TKey];
2680
+ } & {};
2681
+ type PageRouteSegmentParams<TSegment extends string> = TSegment extends `[[...${infer TParam}]]` ? {
2682
+ [TKey in TParam]?: string;
2683
+ } : TSegment extends `[...${infer TParam}]` ? {
2684
+ [TKey in TParam]: string;
2685
+ } : TSegment extends `[${infer TParam}]` ? {
2686
+ [TKey in TParam]: string;
2687
+ } : {};
2688
+ type ExtractPageRouteParams<TRoute extends string> = TRoute extends `${infer TSegment}/${infer TRest}` ? PageRouteSegmentParams<TSegment> & ExtractPageRouteParams<TRest> : PageRouteSegmentParams<TRoute>;
2689
+ /** Infer the decoded params received by a page from a route pattern. */
2690
+ type PageRouteParams<TRoute extends string> = string extends TRoute ? Record<string, string> : TRoute extends string ? SimplifyPageRouteParams<ExtractPageRouteParams<StripPageRouteSuffix<TRoute>>> : never;
2691
+ type ResolvePageRouteParams<TRoute extends FarmRoutePropsTarget> = [TRoute] extends [never] ? Record<string, string> : TRoute extends string ? PageRouteParams<TRoute> : Record<string, string>;
2692
+ type NitroPreset = "node-server" | "vercel" | "cloudflare" | "cloudflare-pages" | "netlify" | "netlify-edge" | "bun" | "deno" | "azure" | "aws-lambda" | "firebase" | "custom" | "self-host" | "farm" | string;
2693
+ type FarmMigrationCommand = string | {
2694
+ /** Shell command to run for this migration step. */
2695
+ command: string;
2696
+ /** Optional label printed by the CLI before running the command. */
2697
+ name?: string;
2698
+ /** Working directory for this command, relative to the project root unless absolute. */
2699
+ cwd?: string;
2700
+ /** Additional environment variables for this command. */
2701
+ env?: Record<string, string | undefined>;
2702
+ /** Skip this command without removing it from config. */
2703
+ skip?: boolean;
2704
+ };
2705
+ interface FarmMigrationsConfig {
2706
+ /** One-shot commands that create or update app/integration schemas. */
2707
+ commands?: FarmMigrationCommand[];
2708
+ }
2709
+ type FarmMigrationsUserConfig = FarmMigrationsConfig | FarmMigrationCommand[];
2710
+ interface ResolvedFarmMigrationsConfig {
2711
+ commands: FarmMigrationCommand[];
2712
+ }
2713
+ interface FarmContextFactoryInput {
2714
+ request: Request;
2715
+ rawRequest?: FarmRequest;
2716
+ params: Record<string, string>;
2717
+ search: Record<string, string | string[] | undefined>;
2718
+ path: string;
2719
+ }
2720
+ type FarmContextFactory<TContext = unknown> = (input: FarmContextFactoryInput) => TContext | Promise<TContext>;
2721
+ interface FarmAppContext {
2722
+ }
2723
+ interface FarmConfig {
2724
+ root?: string;
2725
+ /** App source directory. @default "src" */
2726
+ srcDir?: string;
2727
+ extends?: readonly FarmLayerEntry[];
2728
+ /** Resolved layer graph. Populated by config resolution. */
2729
+ layers?: readonly ResolvedFarmLayer[];
2730
+ outDir?: string;
2731
+ basePath?: string;
2732
+ /** Generate and canonicalize non-root application page URLs with a trailing slash. */
2733
+ trailingSlash?: boolean;
2734
+ /**
2735
+ * Component renderer used for JSX compilation, SSR, and browser hydration.
2736
+ * React is used when omitted.
2737
+ */
2738
+ renderer?: FarmRenderer;
2739
+ preset?: NitroPreset;
2740
+ deploy?: {
2741
+ target?: "vercel" | "cloudflare" | "netlify" | "node" | string;
2742
+ preset?: NitroPreset;
2743
+ outputDir?: string;
2744
+ output?: string;
2745
+ projectName?: string;
2746
+ vercel?: {
2747
+ outputDirectory?: string;
2748
+ buildCommand?: string;
2749
+ installCommand?: string;
2750
+ framework?: string | null;
2751
+ };
2752
+ cloudflare?: {
2753
+ outputDir?: string;
2754
+ projectName?: string;
2755
+ };
2756
+ netlify?: {
2757
+ outputDir?: string;
2758
+ site?: string;
2759
+ };
2760
+ };
2761
+ storage?: FarmStorageUserConfig;
2762
+ /** Rules for the tables plugins and integrations declare, such as which app tables they may add columns to. */
2763
+ schema?: FarmSchemaConfig;
2764
+ /** Shared application data, route, ISR, and PPR cache. */
2765
+ cache?: FarmCacheUserConfig;
2766
+ integrations?: FarmIntegrationsUserConfig;
2767
+ /** Farm-native authentication. `true` enables email/password auth. */
2768
+ auth?: FarmAuthUserConfig | ResolvedFarmAuthConfig;
2769
+ plugins?: FarmPlugin[];
2770
+ migrations?: FarmMigrationsUserConfig;
2771
+ /** Map portable cron schedules to ordinary GET API routes. */
2772
+ cron?: FarmCronUserConfig | FarmCronResolvedConfig | false;
2773
+ workflows?: FarmWorkflowsUserConfig | boolean;
2774
+ /** Public base URL and path used by Farm's browser API clients. */
2775
+ api?: FarmAPIConfig;
2776
+ env?: FarmEnvConfig<any, any> | ResolvedFarmEnv;
2777
+ middleware?: FarmMiddlewareConfig;
2778
+ routeRules?: FarmRouteRules;
2779
+ context?: FarmContextFactory<any>;
2780
+ /** Server ingress and trusted-proxy policy. */
2781
+ server?: FarmServerConfig;
2782
+ serverActions?: FarmServerActionsConfig;
2783
+ /** App-wide HTTP security policy. */
2784
+ security?: FarmSecurityConfig | ResolvedFarmSecurityConfig;
2785
+ /** Opt-in agent-readiness primitives (JSON-LD and related). Off by default. */
2786
+ agent?: FarmAgentUserConfig;
2787
+ images?: FarmImageConfig;
2788
+ /** Browser resource scheduling and preload budgets. */
2789
+ performance?: FarmPerformanceConfig;
2790
+ /** Built-in light, dark, and system color-mode runtime. */
2791
+ theme?: FarmThemeConfig | ResolvedFarmThemeConfig | false;
2792
+ i18n?: FarmI18nUserConfig | ResolvedFarmI18nConfig | false;
2793
+ /** Build identifier used to detect stale clients during rolling deployments. */
2794
+ deploymentId?: string;
2795
+ /** Optional project-relative module used for unmatched page routes. */
2796
+ notFound?: {
2797
+ component?: string;
2798
+ };
2799
+ /** Server-only application runtime values. */
2800
+ serverRuntimeConfig?: Record<string, unknown>;
2801
+ /** Serializable application values exposed to `src/client.ts`. */
2802
+ publicRuntimeConfig?: Record<string, unknown>;
2803
+ docs?: FarmDocsUserConfig | FarmDocsResolvedConfig;
2804
+ md?: FarmMarkdownUserConfig | FarmMarkdownResolvedConfig | boolean;
2805
+ mdx?: FarmMdxUserConfig | FarmMdxResolvedConfig;
2806
+ observability?: FarmObservabilityUserConfig;
2807
+ /** Farm product telemetry for deployed server runtimes. Set to false to disable. */
2808
+ telemetry?: boolean;
2809
+ /**
2810
+ * Request and MCP tool analytics for a Farm Infra project. On only when the server
2811
+ * environment sets `FARMJS_API_KEY` (plus `FARMJS_PROJECT_ID` for a key reaching several
2812
+ * projects). Set to false to never send them.
2813
+ */
2814
+ analytics?: boolean;
2815
+ /**
2816
+ * Development-only runtime inspector. Enabled by default during `farm dev`.
2817
+ *
2818
+ * @deprecated The built-in dashboard is deprecated. Install `@farm.js/devtools` and add
2819
+ * `devtools()` to `plugins` instead; it reuses this runtime and owns the maintained UI.
2820
+ * `devtools: false` and `shortcut` remain supported for the transition.
2821
+ */
2822
+ devtools?: FarmDevtoolsUserConfig;
2823
+ /** Development-only browser feedback for build and HMR activity. */
2824
+ devIndicators?: FarmDevIndicatorsConfig;
2825
+ /**
2826
+ * When true, Link href is not strictly typed (accepts any string).
2827
+ * Use when you want to skip route-type errors on Link or don't use generated route types.
2828
+ */
2829
+ suppressLintOnLink?: boolean;
2830
+ experimental?: {
2831
+ /**
2832
+ * React Server Components. `true` is `{ mode: "rsc" }`: `farm dev` and `farm build` run
2833
+ * React's Flight pipeline from `@farm.js/plugin/rsc`. `{ mode: "islands" }` is reserved for
2834
+ * Farm's own engine (RFC 0003). Pages and layouts are server components either way.
2835
+ */
2836
+ serverComponents?: FarmServerComponentsConfig;
2837
+ serverActions?: boolean;
2838
+ /**
2839
+ * Enables Partial Prerendering (static-shell caching). Routes still opt in
2840
+ * individually with `export const ppr = true`, the Next-compatible
2841
+ * `export const experimental_ppr = true`, or a `"use ppr"` directive;
2842
+ * without this flag those declarations are inert and the route renders
2843
+ * fully dynamically.
2844
+ *
2845
+ * @experimental
2846
+ * @default false
2847
+ */
2848
+ ppr?: boolean;
2849
+ /**
2850
+ * Controls non-RSC hydration ownership for server modules that import
2851
+ * leaf `"use client"` components.
2852
+ *
2853
+ * - `"off"` keeps the current route-wide hydration boundary.
2854
+ * - `"analyze"` reports eligible boundaries without changing runtime behavior.
2855
+ * - `"enabled"` hydrates eligible client leaves independently and falls
2856
+ * back to route-wide hydration for unsupported module graphs.
2857
+ *
2858
+ * This does not enable React Server Components. `"use client"` remains a
2859
+ * valid client-boundary declaration in normal SSR applications.
2860
+ *
2861
+ * @experimental
2862
+ * @default "off"
2863
+ */
2864
+ isolatedClientHydration?: FarmIsolatedClientHydrationMode;
2865
+ /**
2866
+ * Automatically optimize eligible server-only host-element subtrees with
2867
+ * the native Strata renderer. Unsupported trees keep normal React
2868
+ * rendering; no application boundary component is required.
2869
+ *
2870
+ * @experimental
2871
+ * @default false
2872
+ */
2873
+ optimizedBoundary?: boolean;
2874
+ };
2875
+ vite?: any;
2876
+ }
2877
+ type FarmIsolatedClientHydrationMode = "off" | "analyze" | "enabled";
2878
+ /**
2879
+ * Middleware data available in page components
2880
+ */
2881
+ interface MiddlewareProps {
2882
+ /**
2883
+ * Map containing all data set by middleware via ctx.data.set()
2884
+ *
2885
+ * @example
2886
+ * ```tsx
2887
+ * // In middleware.ts
2888
+ * ctx.data.set('user', { id: 1, name: 'John' });
2889
+ *
2890
+ * // In page.tsx
2891
+ * const user = props.middleware?.data.get('user');
2892
+ * ```
2893
+ */
2894
+ data: Map<string, any>;
2895
+ }
2896
+ /**
2897
+ * Plugin context data available in server page components.
2898
+ * Only values explicitly exposed by plugins are included.
2899
+ */
2900
+ interface PluginContextProps {
2901
+ data: Map<string, any>;
2902
+ }
2903
+ /**
2904
+ * Page component props
2905
+ *
2906
+ * @param params - Dynamic route parameters (e.g., { id: '123' } for /users/[id])
2907
+ * @param searchParams - URL search/query parameters
2908
+ * @param path - Current pathname
2909
+ * @param middleware - Data set by middleware.ts (optional, available if middleware exists)
2910
+ * @param context - Data explicitly exposed by plugins for this request (optional)
2911
+ */
2912
+ interface PageProps<TRoute extends FarmRoutePropsTarget = FarmRoutePropsDefault> {
2913
+ params: ResolvePageRouteParams<TRoute>;
2914
+ searchParams: Promise<Record<string, string | string[] | undefined>>;
2915
+ path: string;
2916
+ /**
2917
+ * Data from middleware.ts in the same directory or parent directories
2918
+ * Access data via props.middleware?.data.get('key')
2919
+ *
2920
+ * @example
2921
+ * ```tsx
2922
+ * export default function Page(props: PageProps) {
2923
+ * const user = props.middleware?.data.get('user');
2924
+ * const stats = props.middleware?.data.get('dashboardStats');
2925
+ *
2926
+ * return <div>Welcome {user?.name}</div>;
2927
+ * }
2928
+ * ```
2929
+ */
2930
+ middleware?: MiddlewareProps;
2931
+ /**
2932
+ * Request-scoped plugin context values explicitly exposed by plugins.
2933
+ * Access data via props.context?.data.get('key').
2934
+ */
2935
+ context?: PluginContextProps;
2936
+ }
2937
+ interface LoadingProps<TRoute extends FarmRoutePropsTarget = FarmRoutePropsDefault> {
2938
+ params: ResolvePageRouteParams<TRoute>;
2939
+ searchParams: Promise<Record<string, string | string[] | undefined>>;
2940
+ search?: Record<string, string | string[] | undefined>;
2941
+ path: string;
2942
+ middleware?: MiddlewareProps;
2943
+ context?: PluginContextProps;
2944
+ }
2945
+ interface ErrorProps<TRoute extends FarmRoutePropsTarget = FarmRoutePropsDefault> extends LoadingProps<TRoute> {
2946
+ error: unknown;
2947
+ reset: () => void;
2948
+ }
2949
+ /**
2950
+ * Helper type to create typed page props with specific middleware data shape
2951
+ *
2952
+ * @example
2953
+ * ```tsx
2954
+ * interface MyMiddlewareData {
2955
+ * user: { id: number; name: string };
2956
+ * stats: { views: number };
2957
+ * }
2958
+ *
2959
+ * type MyPageProps = PagePropsWithMiddleware<MyMiddlewareData>;
2960
+ *
2961
+ * export default function Page(props: MyPageProps) {
2962
+ * const user = props.middleware?.data.get('user'); // Fully typed!
2963
+ * const stats = props.middleware?.data.get('stats'); // Fully typed!
2964
+ *
2965
+ * return <div>Welcome {user?.name}</div>;
2966
+ * }
2967
+ * ```
2968
+ */
2969
+ type PagePropsWithMiddleware<T extends Record<string, any>, TRoute extends FarmRoutePropsTarget = FarmRoutePropsDefault> = PageProps<TRoute> & {
2970
+ middleware: {
2971
+ data: Map<keyof T, T[keyof T]>;
2972
+ };
2973
+ };
2974
+ interface LayoutProps<TRoute extends FarmRoutePropsTarget = FarmRoutePropsDefault> {
2975
+ children: any;
2976
+ params: ResolvePageRouteParams<TRoute>;
2977
+ }
2978
+ /** Props passed to a route's `generateMetadata` function. */
2979
+ type MetadataProps<TRoute extends FarmRoutePropsTarget = FarmRoutePropsDefault> = PageProps<TRoute>;
2980
+ /** Props passed to a layout's `generateMetadata` function. */
2981
+ interface LayoutMetadataProps<TRoute extends FarmRoutePropsTarget = FarmRoutePropsDefault> {
2982
+ params: ResolvePageRouteParams<TRoute>;
2983
+ }
2984
+ type Page<TRoute extends FarmRoutePropsTarget = FarmRoutePropsDefault> = FarmComponentType<PageProps<TRoute>>;
2985
+ type Layout<TRoute extends FarmRoutePropsTarget = FarmRoutePropsDefault> = FarmComponentType<LayoutProps<TRoute>>;
2986
+ type Loading<TRoute extends FarmRoutePropsTarget = FarmRoutePropsDefault> = FarmComponentType<LoadingProps<TRoute>>;
2987
+ type ErrorBoundary<TRoute extends FarmRoutePropsTarget = FarmRoutePropsDefault> = FarmComponentType<ErrorProps<TRoute>>;
2988
+ /**
2989
+ * Route module exports for pages
2990
+ *
2991
+ * SSR is the default - pages render on each request
2992
+ * SSG is opt-in via `export const ssg = true`, Next-compatible route
2993
+ * config exports, or a top-of-file rendering directive.
2994
+ *
2995
+ * @example SSR Page (default):
2996
+ * ```tsx
2997
+ * export default async function Page() {
2998
+ * const data = await fetchData();
2999
+ * return <div>{data.title}</div>;
3000
+ * }
3001
+ * ```
3002
+ *
3003
+ * @example SSG Page:
3004
+ * ```tsx
3005
+ * export const ssg = true;
3006
+ *
3007
+ * export default function AboutPage() {
3008
+ * return <h1>About Us</h1>;
3009
+ * }
3010
+ * ```
3011
+ *
3012
+ * @example SSG with Revalidation (ISR):
3013
+ * ```tsx
3014
+ * export const ssg = true;
3015
+ * export const revalidate = 60; // Regenerate every 60 seconds
3016
+ *
3017
+ * export default async function ProductsPage() {
3018
+ * const products = await fetchProducts();
3019
+ * return <ProductList products={products} />;
3020
+ * }
3021
+ * ```
3022
+ *
3023
+ * @example Dynamic SSG Route:
3024
+ * ```tsx
3025
+ * export const ssg = true;
3026
+ *
3027
+ * export async function getStaticPaths() {
3028
+ * const posts = await fetchPosts();
3029
+ * return posts.map(post => ({ slug: post.slug }));
3030
+ * }
3031
+ *
3032
+ * export default async function BlogPost({ params }) {
3033
+ * const post = await fetchPost(params.slug);
3034
+ * return <article>{post.title}</article>;
3035
+ * }
3036
+ * ```
3037
+ *
3038
+ * @example Next-compatible Route Config:
3039
+ * ```tsx
3040
+ * export const dynamic = "force-static";
3041
+ * export const revalidate = 60;
3042
+ *
3043
+ * export default function DocsPage() {
3044
+ * return <h1>Docs</h1>;
3045
+ * }
3046
+ * ```
3047
+ *
3048
+ * @example Directive Route Config:
3049
+ * ```tsx
3050
+ * "use ssg; 60";
3051
+ *
3052
+ * export default function DocsPage() {
3053
+ * return <h1>Docs</h1>;
3054
+ * }
3055
+ * ```
3056
+ */
3057
+ interface RouteModule<TRoute extends FarmRoutePropsTarget = FarmRoutePropsDefault> {
3058
+ default?: Page<TRoute>;
3059
+ /** Execution runtime for this route. Layout values are inherited unless overridden. */
3060
+ runtime?: FarmRouteRuntime;
3061
+ /** Provider-specific execution regions, or "auto" to clear an inherited value. */
3062
+ regions?: FarmRouteRegions;
3063
+ /** Maximum execution time in seconds, or "auto" to use the provider default. */
3064
+ maxDuration?: FarmRouteMaxDuration;
3065
+ /**
3066
+ * Mark this page for Static Site Generation (SSG)
3067
+ * When true, the page will be pre-rendered at build time
3068
+ */
3069
+ ssg?: boolean;
3070
+ /**
3071
+ * Revalidate interval in seconds for Incremental Static Regeneration (ISR)
3072
+ * Only applicable when ssg = true
3073
+ */
3074
+ revalidate?: number | false;
3075
+ /**
3076
+ * Next.js-compatible rendering mode.
3077
+ * - force-static/error: pre-render at build time
3078
+ * - force-dynamic: render on each request
3079
+ */
3080
+ dynamic?: "auto" | "force-static" | "force-dynamic" | "error";
3081
+ /**
3082
+ * Opt into Partial Prerendering/static-shell caching for this route.
3083
+ * Compatible with Farm's `ppr` export and Next.js `experimental_ppr`.
3084
+ * Requires `experimental.ppr` in `farm.config.ts`; inert without it.
3085
+ */
3086
+ ppr?: boolean;
3087
+ experimental_ppr?: boolean;
3088
+ /**
3089
+ * Return all paths to pre-render for dynamic SSG routes
3090
+ * Required for dynamic routes (e.g., [slug]) when ssg = true
3091
+ */
3092
+ getStaticPaths?: GenerateStaticParams<TRoute>;
3093
+ /**
3094
+ * @deprecated Use getStaticPaths instead
3095
+ */
3096
+ generateStaticParams?: GenerateStaticParams<TRoute>;
3097
+ metadata?: Metadata & Record<string, any>;
3098
+ generateMetadata?: (props: MetadataProps<TRoute>) => Promise<Metadata> | Metadata;
3099
+ viewport?: Viewport;
3100
+ generateViewport?: (props: MetadataProps<TRoute>) => Promise<Viewport> | Viewport;
3101
+ }
3102
+ /** A value accepted for one static route parameter. */
3103
+ type StaticPathPrimitive = string | number | boolean;
3104
+ /**
3105
+ * Parameters returned by `getStaticPaths` or `generateStaticParams`.
3106
+ * Arrays create individual URL segments for catch-all route parameters.
3107
+ */
3108
+ type StaticPathParams = Record<string, StaticPathPrimitive | readonly StaticPathPrimitive[]>;
3109
+ type StaticRouteSegmentParams<TSegment extends string> = TSegment extends `[[...${infer TParam}]]` ? {
3110
+ [TKey in TParam]?: readonly StaticPathPrimitive[];
3111
+ } : TSegment extends `[...${infer TParam}]` ? {
3112
+ [TKey in TParam]: readonly StaticPathPrimitive[];
3113
+ } : TSegment extends `[${infer TParam}]` ? {
3114
+ [TKey in TParam]: StaticPathPrimitive;
3115
+ } : {};
3116
+ type ExtractStaticRouteParams<TRoute extends string> = TRoute extends `${infer TSegment}/${infer TRest}` ? StaticRouteSegmentParams<TSegment> & ExtractStaticRouteParams<TRest> : StaticRouteSegmentParams<TRoute>;
3117
+ /** Infer the values accepted from `getStaticPaths` for a route pattern. */
3118
+ type StaticRouteParams<TRoute extends string> = string extends TRoute ? StaticPathParams : TRoute extends string ? SimplifyPageRouteParams<ExtractStaticRouteParams<StripPageRouteSuffix<TRoute>>> : never;
3119
+ type ResolveStaticRouteParams<TRoute extends FarmRoutePropsTarget> = [TRoute] extends [never] ? StaticPathParams : TRoute extends string ? StaticRouteParams<TRoute> : StaticPathParams;
3120
+ /** A route-aware `getStaticPaths` or `generateStaticParams` function. */
3121
+ type GenerateStaticParams<TRoute extends FarmRoutePropsTarget = FarmRoutePropsDefault> = () => Array<ResolveStaticRouteParams<TRoute>> | Promise<Array<ResolveStaticRouteParams<TRoute>>>;
3122
+ interface LayoutModule<TRoute extends FarmRoutePropsTarget = FarmRoutePropsDefault> {
3123
+ default: Layout<TRoute>;
3124
+ /** Semantic fonts inherited by framework-owned surfaces for this route. */
3125
+ fonts?: FarmLayoutFonts;
3126
+ runtime?: FarmRouteRuntime;
3127
+ regions?: FarmRouteRegions;
3128
+ maxDuration?: FarmRouteMaxDuration;
3129
+ metadata?: Metadata & Record<string, any>;
3130
+ generateMetadata?: (props: LayoutMetadataProps<TRoute>) => Promise<Metadata> | Metadata;
3131
+ viewport?: Viewport;
3132
+ generateViewport?: (props: LayoutMetadataProps<TRoute>) => Promise<Viewport> | Viewport;
3133
+ }
3134
+ /** A schema.org JSON-LD object, such as `{ "@context": "https://schema.org", "@type": "Article" }`. */
3135
+ type MetadataJsonLd = object;
3136
+ /** A `theme-color` entry, optionally for one `prefers-color-scheme` media query. */
3137
+ interface ThemeColorDescriptor {
3138
+ color: string;
3139
+ media?: string;
3140
+ }
3141
+ /**
3142
+ * The `viewport` export of a layout or page, and the return value of `generateViewport()`, as in
3143
+ * Next.js. Layouts and the page merge from root to page over the default
3144
+ * `width=device-width, initial-scale=1`.
3145
+ */
3146
+ interface Viewport {
3147
+ width?: string | number;
3148
+ height?: string | number;
3149
+ initialScale?: number;
3150
+ minimumScale?: number;
3151
+ maximumScale?: number;
3152
+ userScalable?: boolean;
3153
+ viewportFit?: "auto" | "cover" | "contain";
3154
+ interactiveWidget?: "resizes-visual" | "resizes-content" | "overlays-content";
3155
+ themeColor?: string | ThemeColorDescriptor | ThemeColorDescriptor[];
3156
+ colorScheme?: string;
3157
+ }
3158
+ interface Metadata {
3159
+ metadataBase?: string | URL;
3160
+ /** `absolute` names a page exactly, past any parent `template` (as in Next.js). */
3161
+ title?: string | {
3162
+ default?: string;
3163
+ template?: string;
3164
+ absolute?: string;
3165
+ };
3166
+ description?: string;
3167
+ keywords?: string | string[];
3168
+ /**
3169
+ * schema.org structured data rendered as `<script type="application/ld+json">`,
3170
+ * one per object. Layout entries come first, then the page's. Renders
3171
+ * alongside the site-level `agent.jsonLd`.
3172
+ */
3173
+ jsonLd?: MetadataJsonLd | MetadataJsonLd[];
3174
+ author?: string;
3175
+ authors?: Array<{
3176
+ name: string;
3177
+ url?: string;
3178
+ }>;
3179
+ creator?: string;
3180
+ /** Site ownership tokens for search consoles, one `<meta>` per token. */
3181
+ verification?: {
3182
+ /** `google-site-verification` */
3183
+ google?: string | string[];
3184
+ /** `msvalidate.01` */
3185
+ bing?: string | string[];
3186
+ /** `yandex-verification` */
3187
+ yandex?: string | string[];
3188
+ /** Any other verification meta name, keyed by name. */
3189
+ other?: Record<string, string | string[]>;
3190
+ };
3191
+ publisher?: string;
3192
+ robots?: string | MetadataRobots;
3193
+ openGraph?: {
3194
+ title?: string;
3195
+ description?: string;
3196
+ url?: string;
3197
+ siteName?: string;
3198
+ images?: string | {
3199
+ url: string;
3200
+ width?: number;
3201
+ height?: number;
3202
+ alt?: string;
3203
+ type?: string;
3204
+ } | Array<{
3205
+ url: string;
3206
+ width?: number;
3207
+ height?: number;
3208
+ alt?: string;
3209
+ type?: string;
3210
+ }>;
3211
+ image?: string;
3212
+ /**
3213
+ * `og:video` entries. Point `url` at the media file itself (an MP4, for
3214
+ * example) rather than a player page; relative URLs resolve against
3215
+ * `metadataBase` like `images`.
3216
+ */
3217
+ videos?: string | {
3218
+ url: string;
3219
+ secureUrl?: string;
3220
+ width?: number;
3221
+ height?: number;
3222
+ type?: string;
3223
+ } | Array<{
3224
+ url: string;
3225
+ secureUrl?: string;
3226
+ width?: number;
3227
+ height?: number;
3228
+ type?: string;
3229
+ }>;
3230
+ type?: string;
3231
+ locale?: string;
3232
+ /** `article:published_time`, rendered when `type` is `"article"`. */
3233
+ publishedTime?: string | Date;
3234
+ /** `article:modified_time`, rendered when `type` is `"article"`. */
3235
+ modifiedTime?: string | Date;
3236
+ /** `article:author` profile URLs or names, rendered when `type` is `"article"`. */
3237
+ authors?: string | string[];
3238
+ /** `article:section`, rendered when `type` is `"article"`. */
3239
+ section?: string;
3240
+ /** `article:tag`, rendered when `type` is `"article"`. */
3241
+ tags?: string | string[];
3242
+ };
3243
+ twitter?: {
3244
+ card?: "summary" | "summary_large_image" | "app" | "player";
3245
+ site?: string;
3246
+ creator?: string;
3247
+ title?: string;
3248
+ description?: string;
3249
+ images?: string | {
3250
+ url: string;
3251
+ width?: number;
3252
+ height?: number;
3253
+ alt?: string;
3254
+ type?: string;
3255
+ } | Array<string | {
3256
+ url: string;
3257
+ width?: number;
3258
+ height?: number;
3259
+ alt?: string;
3260
+ type?: string;
3261
+ }>;
3262
+ };
3263
+ alternates?: {
3264
+ canonical?: string;
3265
+ languages?: Record<string, string>;
3266
+ /**
3267
+ * Alternate representations keyed by MIME type, such as an RSS feed.
3268
+ * `text/markdown` replaces the link Farm adds for a page's Markdown mirror.
3269
+ */
3270
+ types?: Record<string, string | Array<{
3271
+ url: string;
3272
+ title?: string;
3273
+ }>>;
3274
+ };
3275
+ icons?: string | {
3276
+ icon?: string | Array<string | {
3277
+ url: string;
3278
+ sizes?: string;
3279
+ type?: string;
3280
+ }>;
3281
+ shortcut?: string | Array<string | {
3282
+ url: string;
3283
+ sizes?: string;
3284
+ type?: string;
3285
+ }>;
3286
+ apple?: string | Array<string | {
3287
+ url: string;
3288
+ sizes?: string;
3289
+ type?: string;
3290
+ }>;
3291
+ };
3292
+ manifest?: string;
3293
+ /** Extra `<meta name content>` tags, keyed by name. An array renders one tag per value. */
3294
+ other?: Record<string, string | number | Array<string | number>>;
3295
+ }
3296
+ interface FarmRequest extends IncomingMessage {
3297
+ params?: Record<string, string>;
3298
+ query?: Record<string, string | string[]>;
3299
+ body?: any;
3300
+ }
3301
+ interface FarmResponse extends ServerResponse {
3302
+ json: (data: any) => void;
3303
+ status: (code: number) => FarmResponse;
3304
+ redirect: (url: string, status?: number) => void;
3305
+ }
3306
+ type ServerAction = (...args: any[]) => Promise<any>;
3307
+ interface RouteSegment {
3308
+ segment: string;
3309
+ isDynamic: boolean;
3310
+ isOptional: boolean;
3311
+ isCatchAll: boolean;
3312
+ }
3313
+ interface ParsedRoute {
3314
+ segments: RouteSegment[];
3315
+ filePath: string;
3316
+ type: "page" | "layout" | "loading" | "error" | "not-found";
3317
+ }
3318
+ interface BuildOptions {
3319
+ mode: "development" | "production";
3320
+ ssr: boolean;
3321
+ minify: boolean;
3322
+ sourcemap: boolean;
3323
+ }
3324
+ /**
3325
+ * Represents a page to be pre-rendered at build time (SSG)
3326
+ */
3327
+ interface SSGPage {
3328
+ /** The URL path for this page */
3329
+ urlPath: string;
3330
+ /** The file path to the page module */
3331
+ filePath: string;
3332
+ /** Route parameters for dynamic routes */
3333
+ params: Record<string, string>;
3334
+ /** Revalidation interval in seconds (ISR) */
3335
+ revalidate?: number;
3336
+ }
3337
+ /**
3338
+ * Result of SSG page collection
3339
+ */
3340
+ interface SSGCollectionResult {
3341
+ /** Pages to pre-render at build time */
3342
+ ssg: SSGPage[];
3343
+ /** Routes that will be server-rendered on each request */
3344
+ ssr: string[];
3345
+ }
3346
+ /** Crawler directives for a robots `<meta>` tag. Unset fields are omitted. */
3347
+ interface MetadataRobotsDirectives {
3348
+ index?: boolean;
3349
+ follow?: boolean;
3350
+ noarchive?: boolean;
3351
+ nosnippet?: boolean;
3352
+ noimageindex?: boolean;
3353
+ /** Maximum text snippet length; `-1` means no limit and `0` means no snippet. */
3354
+ "max-snippet"?: number;
3355
+ "max-image-preview"?: "none" | "standard" | "large";
3356
+ /** Maximum video preview length in seconds; `-1` means no limit. */
3357
+ "max-video-preview"?: number;
3358
+ /** Date after which the page should drop out of results, for example an ISO 8601 date. */
3359
+ unavailable_after?: string;
3360
+ }
3361
+ interface MetadataRobots extends MetadataRobotsDirectives {
3362
+ /** Directives for a separate `<meta name="googlebot">` tag. */
3363
+ googleBot?: string | MetadataRobotsDirectives;
3364
+ }
3365
+
3366
+ type RuntimeClientFactory<TClient> = () => TClient | Promise<TClient>;
3367
+ type FarmIntegrationOrmSchema = SchemaDefinition<Record<string, AnyModelDefinition>>;
3368
+ type FarmIntegrationOrmClient<TSchema extends FarmIntegrationOrmSchema> = OrmClient<TSchema>;
3369
+ type FarmIntegrationOrmFieldKind<TField extends FarmIntegrationSchemaField> = TField extends {
3370
+ primaryKey: true;
3371
+ } ? TField["type"] extends "id" | "uuid" | "string" | "integer" ? "id" : never : TField["type"] extends "id" | "uuid" | "text" ? "string" : TField["type"] extends "number" ? "decimal" : Extract<TField["type"], "string" | "boolean" | "integer" | "datetime" | "json" | "enum">;
3372
+ type FarmIntegrationOrmFieldNullable<TField extends FarmIntegrationSchemaField> = TField extends {
3373
+ nullable: true;
3374
+ } ? true : TField extends {
3375
+ required: false;
3376
+ } ? true : false;
3377
+ type FarmIntegrationOrmEnumValue<TField extends FarmIntegrationSchemaField> = TField extends {
3378
+ values: readonly (infer TValue extends string)[];
3379
+ } ? TValue : string;
3380
+ type FarmIntegrationOrmFieldValue<TField extends FarmIntegrationSchemaField> = TField["type"] extends "id" | "uuid" | "string" | "text" ? string : TField["type"] extends "boolean" ? boolean : TField["type"] extends "integer" ? number : TField["type"] extends "number" ? string : TField["type"] extends "datetime" ? Date : TField["type"] extends "json" ? JsonValue : TField["type"] extends "enum" ? FarmIntegrationOrmEnumValue<TField> : never;
3381
+ type InferFarmIntegrationOrmField<TField extends FarmIntegrationSchemaField> = FieldBuilder<FarmIntegrationOrmFieldKind<TField>, FarmIntegrationOrmFieldNullable<TField>, FarmIntegrationOrmFieldValue<TField>>;
3382
+ type FarmIntegrationOrmModelShape = {
3383
+ fields: Record<string, unknown>;
3384
+ };
3385
+ type InferFarmIntegrationOrmFields<TModel extends FarmIntegrationOrmModelShape> = {
3386
+ [TFieldKey in keyof TModel["fields"] & string]: InferFarmIntegrationOrmField<Extract<TModel["fields"][TFieldKey], FarmIntegrationSchemaField>>;
3387
+ };
3388
+ type ReplaceRecord<TBase, TReplacement> = Omit<TBase, keyof TReplacement> & TReplacement;
3389
+ type SchemaExtensions<TSchema extends FarmIntegrationSchema> = NonNullable<TSchema["extend"]>;
3390
+ type SchemaOverrides<TSchema extends FarmIntegrationSchema> = NonNullable<TSchema["override"]>;
3391
+ type SchemaModelFields<TModel> = TModel extends {
3392
+ fields: infer TFields;
3393
+ } ? TFields : TModel extends {
3394
+ fields?: infer TFields;
3395
+ } ? NonNullable<TFields> : {};
3396
+ type ExtendedSchemaModelFields<TSchema extends FarmIntegrationSchema, TModelKey extends PropertyKey> = ReplaceRecord<TModelKey extends keyof TSchema["models"] ? SchemaModelFields<TSchema["models"][TModelKey]> : {}, TModelKey extends keyof SchemaExtensions<TSchema> ? SchemaModelFields<SchemaExtensions<TSchema>[TModelKey]> : {}>;
3397
+ type OverrideSchemaModelFields<TSchema extends FarmIntegrationSchema, TModelKey extends PropertyKey> = TModelKey extends keyof SchemaOverrides<TSchema> ? SchemaModelFields<SchemaOverrides<TSchema>[TModelKey]> : {};
3398
+ type ResolvedSchemaModelFields<TSchema extends FarmIntegrationSchema, TModelKey extends PropertyKey, TExtendedFields = ExtendedSchemaModelFields<TSchema, TModelKey>, TOverrideFields = OverrideSchemaModelFields<TSchema, TModelKey>> = {
3399
+ [TFieldKey in keyof TExtendedFields | keyof TOverrideFields]: TFieldKey extends keyof TOverrideFields ? TFieldKey extends keyof TExtendedFields ? ReplaceRecord<TExtendedFields[TFieldKey], TOverrideFields[TFieldKey]> : TOverrideFields[TFieldKey] : TFieldKey extends keyof TExtendedFields ? TExtendedFields[TFieldKey] : never;
3400
+ };
3401
+ type ResolvedFarmIntegrationSchemaModels<TSchema extends FarmIntegrationSchema> = {
3402
+ [TModelKey in (keyof TSchema["models"] | keyof SchemaExtensions<TSchema>) & string]: {
3403
+ fields: ResolvedSchemaModelFields<TSchema, TModelKey>;
3404
+ };
3405
+ };
3406
+ type InferFarmIntegrationOrmSchema<TSchema extends FarmIntegrationSchema> = SchemaDefinition<{
3407
+ [TModelKey in keyof ResolvedFarmIntegrationSchemaModels<TSchema> & string]: ModelDefinition<InferFarmIntegrationOrmFields<Extract<ResolvedFarmIntegrationSchemaModels<TSchema>[TModelKey], FarmIntegrationOrmModelShape>>, {}>;
3408
+ }>;
3409
+ type InferFarmIntegrationOrmClient<TSchema extends FarmIntegrationSchema | undefined> = TSchema extends FarmIntegrationSchema ? OrmClient<InferFarmIntegrationOrmSchema<TSchema>> : never;
3410
+ interface CreateIntegrationOrmOptions<TClient = unknown, TSchema extends FarmIntegrationSchema = FarmIntegrationSchema> {
3411
+ schema: TSchema;
3412
+ config?: Pick<FarmConfig, "storage">;
3413
+ storage?: FarmStorageUserConfig;
3414
+ client?: TClient | RuntimeClientFactory<TClient>;
3415
+ }
3416
+ declare function createIntegrationOrm<TClient = unknown, TSchema extends FarmIntegrationSchema = FarmIntegrationSchema>(options: CreateIntegrationOrmOptions<TClient, TSchema>): Promise<InferFarmIntegrationOrmClient<TSchema>>;
3417
+ declare function resolveIntegrationOrmRuntimeClient<TClient = unknown>(options: Omit<CreateIntegrationOrmOptions<TClient>, "schema">): Promise<TClient | unknown | undefined>;
3418
+ declare function farmIntegrationSchemaToOrmSchema(schema: FarmIntegrationSchema): Promise<FarmIntegrationOrmSchema>;
3419
+ type IntegrationOrmModelNames<TSchema extends FarmIntegrationOrmSchema> = keyof SchemaModels<TSchema> & string;
3420
+
3421
+ declare function isFarmIntegration(value: unknown): value is FarmIntegration;
3422
+ /**
3423
+ * @internal Whether an integration's middleware matcher (a `protectedRoutes` guard, say)
3424
+ * covers `pathname`, a route path without the base path. With `catchAllProbe`, a path no
3425
+ * route uses, only matchers naming particular paths count: middleware without a matcher,
3426
+ * or one that also meets the probe, covers every path and is left out.
3427
+ */
3428
+ declare function integrationMiddlewareMayHandlePath(integrations: FarmIntegrationsUserConfig | undefined, pathname: string, catchAllProbe?: string): boolean;
3429
+ /**
3430
+ * @internal Runtime config key holding the app's same-origin API path. The built server keeps the
3431
+ * user's raw `api` config, whose values may be resolver functions, so the build records the
3432
+ * resolved path here; development configs carry the resolved `api` itself.
3433
+ */
3434
+ declare const FARM_INTEGRATION_API_BASE_PATH_KEY = "__farmAPIServerBasePath";
3435
+
3436
+ type FarmIntegrationCategory = "auth" | "payment" | "monitoring" | "logging" | (string & {});
3437
+ /** @deprecated Use FarmIntegrationCategory instead. */
3438
+ type FarmIntegrationSlot = FarmIntegrationCategory;
3439
+ type FarmIntegrationRouteParamValue = string | string[];
3440
+ type FarmIntegrationRouteParams = Record<string, FarmIntegrationRouteParamValue>;
3441
+ type FarmIntegrationRouteMethod = FarmIntegrationAPIMethod | Lowercase<FarmIntegrationAPIMethod> | "ALL" | "all";
3442
+ type FarmIntegrationRouteInputSource = "body" | "query";
3443
+ type MaybePromise<T> = T | Promise<T>;
3444
+ type FarmIntegrationValidationPathSegment = PropertyKey | {
3445
+ readonly key: PropertyKey;
3446
+ };
3447
+ interface FarmIntegrationRouteInput<TBody = unknown, TQuery = unknown> {
3448
+ body?: TBody;
3449
+ query?: TQuery;
3450
+ }
3451
+ interface FarmIntegrationValidationIssue {
3452
+ source: FarmIntegrationRouteInputSource;
3453
+ path?: readonly (string | number)[];
3454
+ code?: string;
3455
+ message: string;
3456
+ }
3457
+ interface FarmIntegrationValidationErrorLike {
3458
+ issues?: readonly {
3459
+ path?: readonly FarmIntegrationValidationPathSegment[];
3460
+ code?: string;
3461
+ message?: string;
3462
+ }[];
3463
+ message?: string;
3464
+ }
3465
+ type FarmIntegrationValidationResult<TValue> = {
3466
+ success: true;
3467
+ data: TValue;
3468
+ } | {
3469
+ success: false;
3470
+ error: FarmIntegrationValidationErrorLike;
3471
+ };
3472
+ type FarmIntegrationStandardValidationResult<TValue> = {
3473
+ value: TValue;
3474
+ } | {
3475
+ issues: readonly {
3476
+ path?: readonly FarmIntegrationValidationPathSegment[];
3477
+ code?: string;
3478
+ message: string;
3479
+ }[];
3480
+ };
3481
+ interface FarmIntegrationInputSchema<TValue = unknown> {
3482
+ _output?: TValue;
3483
+ parse?(value: unknown): MaybePromise<TValue>;
3484
+ safeParse?(value: unknown): MaybePromise<FarmIntegrationValidationResult<TValue>>;
3485
+ safeParseAsync?(value: unknown): Promise<FarmIntegrationValidationResult<TValue>>;
3486
+ "~standard"?: {
3487
+ validate(value: unknown): MaybePromise<FarmIntegrationStandardValidationResult<TValue>>;
3488
+ types?: {
3489
+ output: TValue;
3490
+ };
3491
+ };
3492
+ }
3493
+ interface FarmIntegrationRouteInputSchemas<TBody = unknown, TQuery = unknown> {
3494
+ body?: FarmIntegrationInputSchema<TBody>;
3495
+ query?: FarmIntegrationInputSchema<TQuery>;
3496
+ }
3497
+ /** @deprecated Use `FarmRequestStore` and access it through `ctx.req`. */
3498
+ type FarmIntegrationRequestContextStore = FarmRequestStore;
3499
+ declare const FARM_INTEGRATION_INTERNAL_DISPATCH_CONTEXT_KEY = "farm.integration.internalDispatch";
3500
+ /**
3501
+ * Request-context key under which an integration middleware can hand
3502
+ * `Set-Cookie` values to the runtime when it returns `void` (i.e. lets the
3503
+ * request continue to the downstream route/page handler). The runtime reads
3504
+ * this key back after a `void` middleware return and forwards the cookies onto
3505
+ * the response it ultimately sends, so a server-side session refresh (or any
3506
+ * other cookie rotation) reaches the browser instead of being dropped.
3507
+ */
3508
+ declare const FARM_INTEGRATION_SET_COOKIES_KEY = "farm:integration:set-cookies";
3509
+ /**
3510
+ * Forward `Set-Cookie` values from an integration middleware that returns
3511
+ * `void` (the authenticated/passthrough branch) to the runtime, so they are
3512
+ * merged onto the response the runtime sends for the matched route. This is
3513
+ * the passthrough counterpart to appending `Set-Cookie` to a `Response` the
3514
+ * middleware returns directly (e.g. a failure redirect): both paths can rotate
3515
+ * auth cookies, and both must be able to reach the browser.
3516
+ */
3517
+ declare function forwardIntegrationSetCookies(context: Pick<FarmIntegrationHandlerContext, "req">, cookies: string[]): void;
3518
+ type FarmIntegrationRouteDb<TSchema extends FarmIntegrationSchema | undefined> = InferFarmIntegrationOrmClient<TSchema>;
3519
+ interface FarmIntegrationRouteStorageArgs<TSchema extends FarmIntegrationSchema | undefined = FarmIntegrationSchema | undefined> {
3520
+ getClient(): Promise<unknown | undefined>;
3521
+ getOrm(): Promise<FarmIntegrationRouteDb<TSchema>>;
3522
+ }
3523
+ interface FarmIntegrationRouteArgs<TSchema extends FarmIntegrationSchema | undefined = FarmIntegrationSchema | undefined> {
3524
+ db: FarmIntegrationRouteDb<TSchema>;
3525
+ getDb(): Promise<FarmIntegrationRouteDb<TSchema>>;
3526
+ storage: FarmIntegrationRouteStorageArgs<TSchema>;
3527
+ }
3528
+ interface FarmIntegrationConfigContext<TSchema extends FarmIntegrationSchema | undefined = FarmIntegrationSchema | undefined> {
3529
+ key: string;
3530
+ integration: FarmIntegration<TSchema, any>;
3531
+ appConfig: FarmPluginContext["config"];
3532
+ /** Alias for appConfig. */
3533
+ config: FarmPluginContext["config"];
3534
+ args: FarmIntegrationRouteArgs<TSchema>;
3535
+ env: Record<string, string | undefined>;
3536
+ isDev: boolean;
3537
+ isProd: boolean;
3538
+ }
3539
+ interface FarmIntegrationConfigDefinition<TConfig = unknown, TSchema extends FarmIntegrationSchema | undefined = FarmIntegrationSchema | undefined> {
3540
+ schema?: FarmIntegrationInputSchema<TConfig>;
3541
+ env?: Record<string, string | readonly string[]>;
3542
+ defaults?: Partial<TConfig> | ((context: FarmIntegrationConfigContext<TSchema>) => MaybePromise<Partial<TConfig>>);
3543
+ input?: Partial<TConfig> | ((context: FarmIntegrationConfigContext<TSchema>) => MaybePromise<Partial<TConfig>>);
3544
+ resolve?(context: FarmIntegrationConfigContext<TSchema>): MaybePromise<TConfig | Partial<TConfig> | undefined>;
3545
+ }
3546
+ type FarmIntegrationConfigInput<TConfig = unknown, TSchema extends FarmIntegrationSchema | undefined = FarmIntegrationSchema | undefined> = FarmIntegrationInputSchema<TConfig> | FarmIntegrationConfigDefinition<TConfig, TSchema>;
3547
+ type FarmIntegrationLifecycleLogLevel = "info" | "warn" | "error";
3548
+ interface FarmIntegrationLifecycleLogger {
3549
+ info(message: string, meta?: Record<string, unknown>): void;
3550
+ warn(message: string, meta?: Record<string, unknown>): void;
3551
+ error(message: string, meta?: Record<string, unknown>): void;
3552
+ }
3553
+ interface FarmIntegrationLifecycleContext<TConfig = unknown, TSchema extends FarmIntegrationSchema | undefined = FarmIntegrationSchema | undefined> extends FarmIntegrationConfigContext<TSchema> {
3554
+ integration: FarmIntegration<TSchema, TConfig>;
3555
+ integrationConfig: TConfig;
3556
+ log: FarmIntegrationLifecycleLogger;
3557
+ reason?: string;
3558
+ cleanup(callback?: () => MaybePromise<void>): Promise<void>;
3559
+ }
3560
+ type FarmIntegrationLifecycleHook<TConfig = unknown, TSchema extends FarmIntegrationSchema | undefined = FarmIntegrationSchema | undefined> = (context: FarmIntegrationLifecycleContext<TConfig, TSchema>) => MaybePromise<void>;
3561
+ /**
3562
+ * Small per-call integration metadata. Values received over HTTP are
3563
+ * client-controlled and should be validated before authorization decisions.
3564
+ */
3565
+ type FarmIntegrationData = Record<string, unknown>;
3566
+ interface FarmIntegrationHandlerContext<TBody = unknown, TQuery = unknown, TSchema extends FarmIntegrationSchema | undefined = FarmIntegrationSchema | undefined> {
3567
+ request: Request;
3568
+ requestId: string;
3569
+ url: URL;
3570
+ pathname: string;
3571
+ method: string;
3572
+ params: FarmIntegrationRouteParams;
3573
+ input: FarmIntegrationRouteInput<TBody, TQuery>;
3574
+ args: FarmIntegrationRouteArgs<TSchema>;
3575
+ data: FarmIntegrationData;
3576
+ integration: {
3577
+ category: FarmIntegrationCategory;
3578
+ /** @deprecated Use category instead. */
3579
+ slot: FarmIntegrationCategory;
3580
+ type: string;
3581
+ instance: unknown;
3582
+ };
3583
+ route: {
3584
+ kind: "route" | "middleware";
3585
+ path: string;
3586
+ methods: readonly string[];
3587
+ };
3588
+ req: FarmRequestStore;
3589
+ /** @deprecated Use `req` instead. */
3590
+ requestContext: FarmRequestStore;
3591
+ config: FarmPluginContext["config"];
3592
+ isDev: boolean;
3593
+ isProd: boolean;
3594
+ }
3595
+ interface FarmIntegrationRouteHookContext<TBody = unknown, TQuery = unknown, TSchema extends FarmIntegrationSchema | undefined = FarmIntegrationSchema | undefined> extends FarmIntegrationHandlerContext<TBody, TQuery, TSchema> {
3596
+ response?: Response;
3597
+ }
3598
+ type FarmIntegrationRouteHook<TBody = unknown, TQuery = unknown, TSchema extends FarmIntegrationSchema | undefined = FarmIntegrationSchema | undefined> = {
3599
+ bivarianceHack(request: Request, context: FarmIntegrationRouteHookContext<TBody, TQuery, TSchema>): Promise<Response | void> | Response | void;
3600
+ }["bivarianceHack"];
3601
+ interface FarmIntegrationRoute<TBody = unknown, TQuery = unknown, TSchema extends FarmIntegrationSchema | undefined = FarmIntegrationSchema | undefined> {
3602
+ path: string;
3603
+ method?: FarmIntegrationRouteMethod;
3604
+ methods?: readonly FarmIntegrationRouteMethod[];
3605
+ middleware?: readonly FarmIntegrationRouteMiddleware<TSchema>[];
3606
+ before?: readonly FarmIntegrationRouteHook<TBody, TQuery, TSchema>[];
3607
+ after?: readonly FarmIntegrationRouteHook<TBody, TQuery, TSchema>[];
3608
+ rawBody?: boolean;
3609
+ bodyFormat?: FarmIntegrationAPIBodyFormat;
3610
+ body?: FarmIntegrationInputSchema<TBody>;
3611
+ query?: FarmIntegrationInputSchema<TQuery>;
3612
+ input?: FarmIntegrationRouteInputSchemas<TBody, TQuery>;
3613
+ handler(request: Request, context: FarmIntegrationHandlerContext<TBody, TQuery, TSchema>): Promise<Response> | Response;
3614
+ }
3615
+ interface FarmTypedIntegrationRoute<TPath extends string = string, TBody = never, TQuery = never, TResponse = unknown, TServer extends boolean = false, TMethod extends FarmIntegrationAPIMethod = FarmIntegrationAPIMethod, TSchema extends FarmIntegrationSchema | undefined = FarmIntegrationSchema | undefined> extends FarmIntegrationRoute<TBody, TQuery, TSchema> {
3616
+ path: TPath;
3617
+ method: TMethod;
3618
+ __operation: FarmIntegrationAPIOperation<TBody, TQuery, TResponse, TServer, TMethod>;
3619
+ }
3620
+ interface FarmIntegrationRouteMiddleware<TSchema extends FarmIntegrationSchema | undefined = FarmIntegrationSchema | undefined> {
3621
+ handler(request: Request, context: FarmIntegrationHandlerContext<unknown, unknown, TSchema>): Promise<Response | void> | Response | void;
3622
+ }
3623
+ interface FarmIntegrationMiddleware<TSchema extends FarmIntegrationSchema | undefined = FarmIntegrationSchema | undefined> {
3624
+ matcher?: string | string[];
3625
+ handler(request: Request, context: FarmIntegrationHandlerContext<unknown, unknown, TSchema>): Promise<Response | void> | Response | void;
3626
+ }
3627
+ interface FarmIntegrationProviderProps {
3628
+ children: ReactNode;
3629
+ }
3630
+ interface FarmIntegrationProviderComponentReference {
3631
+ /** Client-safe module specifier using `@/`, a path relative to the app root, or a package. */
3632
+ module: string;
3633
+ /** Named export to use. Defaults to the module's default export. */
3634
+ export?: string;
3635
+ }
3636
+ interface FarmIntegrationProvider {
3637
+ name: string;
3638
+ type: string;
3639
+ props?: Record<string, unknown>;
3640
+ /**
3641
+ * The provider can be instantiated independently around each isolated
3642
+ * client root without relying on context or state owned by the route root.
3643
+ * Providers are treated as route-wide unless they explicitly opt in.
3644
+ */
3645
+ supportsIsolatedHydration?: boolean;
3646
+ component?: ComponentType<FarmIntegrationProviderProps> | FarmIntegrationProviderComponentReference;
3647
+ }
3648
+ interface FarmIntegrationDocumentNavigation {
3649
+ matcher: string | readonly string[];
3650
+ }
3651
+ /** @deprecated Use `FarmSchemaFieldType`. */
3652
+ type FarmIntegrationSchemaFieldType = FarmSchemaFieldType;
3653
+ /** @deprecated Use `FarmSchemaReference`. */
3654
+ type FarmIntegrationSchemaReference = FarmSchemaReference;
3655
+ /** @deprecated Use `FarmSchemaField`. */
3656
+ type FarmIntegrationSchemaField = FarmSchemaField;
3657
+ /** @deprecated Use `FarmSchemaConstraint`. */
3658
+ type FarmIntegrationSchemaConstraint = FarmSchemaConstraint;
3659
+ /** @deprecated Use `FarmSchemaModel`. */
3660
+ type FarmIntegrationSchemaModel = FarmSchemaModel;
3661
+ /** @deprecated Use `FarmSchemaModelExtension`. */
3662
+ type FarmIntegrationSchemaModelExtension = FarmSchemaModelExtension;
3663
+ /** @deprecated Use `FarmSchemaModelOverride`. */
3664
+ type FarmIntegrationSchemaModelOverride = FarmSchemaModelOverride;
3665
+ /** @deprecated Use `FarmSchema`. */
3666
+ type FarmIntegrationSchema = FarmSchema;
3667
+ /** @deprecated Use `defineSchema`. This is an exact alias, not a wrapper. */
3668
+ declare const defineIntegrationSchema: typeof defineSchema;
3669
+ type FarmIntegrationLogPhase = "registered" | "validate" | "setup" | "ready" | "dispose" | "request:start" | "request:end" | "request:error";
3670
+ interface FarmIntegrationLogEvent {
3671
+ category: FarmIntegrationCategory;
3672
+ /** @deprecated Use category instead. */
3673
+ slot: FarmIntegrationCategory;
3674
+ type: string;
3675
+ phase: FarmIntegrationLogPhase;
3676
+ route?: {
3677
+ kind: "route" | "middleware";
3678
+ path: string;
3679
+ methods: readonly string[];
3680
+ };
3681
+ requestId?: string;
3682
+ request?: Request;
3683
+ response?: Response;
3684
+ error?: unknown;
3685
+ durationMs?: number;
3686
+ level?: FarmIntegrationLifecycleLogLevel;
3687
+ message?: string;
3688
+ meta?: Record<string, unknown>;
3689
+ context: Map<string, unknown>;
3690
+ }
3691
+ type FarmIntegrationLogger = (event: FarmIntegrationLogEvent) => void | Promise<void>;
3692
+ interface FarmIntegrationPluginOwner {
3693
+ key: string;
3694
+ category: FarmIntegrationCategory;
3695
+ type: string;
3696
+ source: "lifecycle" | "contribution";
3697
+ serverRuntime: boolean;
3698
+ }
3699
+ /** A normal plugin or an integration-bound plugin compatible with the shared instance. */
3700
+ type FarmIntegrationContributedPlugin<TInstance = unknown> = FarmPlugin<any, any, any, any, unknown, false> | FarmPlugin<any, any, any, any, TInstance, true>;
3701
+ interface FarmIntegration<TSchema extends FarmIntegrationSchema | undefined = FarmIntegrationSchema | undefined, TConfig = unknown, TInstance = unknown> {
3702
+ readonly kind: "farm-integration";
3703
+ category: FarmIntegrationCategory;
3704
+ /** @deprecated Use category instead. */
3705
+ slot?: FarmIntegrationCategory;
3706
+ type: string;
3707
+ instance: TInstance;
3708
+ /** Set to false when a platform adapter owns this integration's production routes. */
3709
+ serverRuntime?: boolean;
3710
+ api?: FarmIntegrationAPI;
3711
+ schema?: TSchema;
3712
+ config?: FarmIntegrationConfigInput<TConfig, TSchema>;
3713
+ validate?: FarmIntegrationLifecycleHook<TConfig, TSchema>;
3714
+ setup?: FarmIntegrationLifecycleHook<TConfig, TSchema>;
3715
+ ready?: FarmIntegrationLifecycleHook<TConfig, TSchema>;
3716
+ dispose?: FarmIntegrationLifecycleHook<TConfig, TSchema>;
3717
+ log?: FarmIntegrationLogger;
3718
+ routes?: readonly FarmIntegrationRoute<any, any, TSchema>[];
3719
+ endpoints?: FarmIntegrationEndpoints<TSchema>;
3720
+ middleware?: readonly FarmIntegrationMiddleware<TSchema>[];
3721
+ providers?: readonly FarmIntegrationProvider[];
3722
+ documentNavigations?: readonly FarmIntegrationDocumentNavigation[];
3723
+ /** Additional Farm plugins owned and configured by this integration. */
3724
+ plugins?: readonly FarmIntegrationContributedPlugin<NoInfer<TInstance>>[];
3725
+ }
3726
+ type FarmIntegrationsUserConfig = Record<string, FarmIntegration<any, any, any> | undefined>;
3727
+ /** @internal Identifies plugins owned by platform-managed integrations. */
3728
+ declare function getFarmIntegrationPluginServerRuntime(plugin: FarmPlugin): boolean | undefined;
3729
+ /** Returns the integration that contributed a normalized plugin, when applicable. */
3730
+ declare function getFarmIntegrationPluginOwner(plugin: FarmPlugin): Readonly<FarmIntegrationPluginOwner> | undefined;
3731
+ type IntegrationRouteBuilderOptions<TBody, TQuery, TServer extends boolean, TSchema extends FarmIntegrationSchema | undefined> = {
3732
+ middleware?: readonly FarmIntegrationRouteMiddleware<TSchema>[];
3733
+ before?: readonly FarmIntegrationRouteHook<TBody, TQuery, TSchema>[];
3734
+ after?: readonly FarmIntegrationRouteHook<TBody, TQuery, TSchema>[];
3735
+ rawBody?: boolean;
3736
+ headers?: Record<string, string>;
3737
+ credentials?: RequestCredentials;
3738
+ bodyFormat?: FarmIntegrationAPIBodyFormat;
3739
+ responseFormat?: FarmIntegrationAPIResponseFormat;
3740
+ isServer?: TServer;
3741
+ body?: FarmIntegrationInputSchema<TBody>;
3742
+ query?: FarmIntegrationInputSchema<TQuery>;
3743
+ input?: FarmIntegrationRouteInputSchemas<TBody, TQuery>;
3744
+ handler(request: Request, context: FarmIntegrationHandlerContext<TBody, TQuery, TSchema>): Promise<Response> | Response;
3745
+ };
3746
+ interface FarmIntegrationRouteFactory<TSchema extends FarmIntegrationSchema | undefined = FarmIntegrationSchema | undefined> {
3747
+ get<TPath extends string, TResponse = unknown, TQuery = never, TServer extends boolean = false>(path: TPath, input: Omit<IntegrationRouteBuilderOptions<never, TQuery, TServer, TSchema>, "bodyFormat">): FarmTypedIntegrationRoute<TPath, never, TQuery, TResponse, TServer, "GET", TSchema>;
3748
+ post<TPath extends string, TBody = never, TResponse = unknown, TQuery = never, TServer extends boolean = false>(path: TPath, input: IntegrationRouteBuilderOptions<TBody, TQuery, TServer, TSchema>): FarmTypedIntegrationRoute<TPath, TBody, TQuery, TResponse, TServer, "POST", TSchema>;
3749
+ query<TPath extends string, TBody = never, TResponse = unknown, TQuery = never, TServer extends boolean = false>(path: TPath, input: IntegrationRouteBuilderOptions<TBody, TQuery, TServer, TSchema>): FarmTypedIntegrationRoute<TPath, TBody, TQuery, TResponse, TServer, "QUERY", TSchema>;
3750
+ put<TPath extends string, TBody = never, TResponse = unknown, TQuery = never, TServer extends boolean = false>(path: TPath, input: IntegrationRouteBuilderOptions<TBody, TQuery, TServer, TSchema>): FarmTypedIntegrationRoute<TPath, TBody, TQuery, TResponse, TServer, "PUT", TSchema>;
3751
+ patch<TPath extends string, TBody = never, TResponse = unknown, TQuery = never, TServer extends boolean = false>(path: TPath, input: IntegrationRouteBuilderOptions<TBody, TQuery, TServer, TSchema>): FarmTypedIntegrationRoute<TPath, TBody, TQuery, TResponse, TServer, "PATCH", TSchema>;
3752
+ delete<TPath extends string, TBody = never, TResponse = unknown, TQuery = never, TServer extends boolean = false>(path: TPath, input: IntegrationRouteBuilderOptions<TBody, TQuery, TServer, TSchema>): FarmTypedIntegrationRoute<TPath, TBody, TQuery, TResponse, TServer, "DELETE", TSchema>;
3753
+ options<TPath extends string, TResponse = unknown, TQuery = never, TServer extends boolean = false>(path: TPath, input: Omit<IntegrationRouteBuilderOptions<never, TQuery, TServer, TSchema>, "bodyFormat">): FarmTypedIntegrationRoute<TPath, never, TQuery, TResponse, TServer, "OPTIONS", TSchema>;
3754
+ head<TPath extends string, TResponse = unknown, TQuery = never, TServer extends boolean = false>(path: TPath, input: Omit<IntegrationRouteBuilderOptions<never, TQuery, TServer, TSchema>, "bodyFormat">): FarmTypedIntegrationRoute<TPath, never, TQuery, TResponse, TServer, "HEAD", TSchema>;
3755
+ }
3756
+ interface FarmIntegrationRoutesFactoryContext<TSchema extends FarmIntegrationSchema | undefined = FarmIntegrationSchema | undefined> {
3757
+ route: FarmIntegrationRouteFactory<TSchema>;
3758
+ integrationRoute: FarmIntegrationRouteFactory<TSchema>;
3759
+ }
3760
+ type FarmIntegrationRoutesFactory<TSchema extends FarmIntegrationSchema | undefined = FarmIntegrationSchema | undefined> = (context: FarmIntegrationRoutesFactoryContext<TSchema>) => readonly FarmIntegrationRoute<any, any, TSchema>[];
3761
+ type FarmIntegrationEndpointValue<TSchema extends FarmIntegrationSchema | undefined = FarmIntegrationSchema | undefined> = FarmIntegrationRoute<any, any, TSchema> | readonly FarmIntegrationEndpointValue<TSchema>[] | {
3762
+ readonly [key: string]: FarmIntegrationEndpointValue<TSchema> | undefined;
3763
+ };
3764
+ type FarmIntegrationEndpoints<TSchema extends FarmIntegrationSchema | undefined = FarmIntegrationSchema | undefined> = {
3765
+ readonly [key: string]: FarmIntegrationEndpointValue<TSchema> | undefined;
3766
+ };
3767
+ interface FarmIntegrationEndpointsFactoryContext<TSchema extends FarmIntegrationSchema | undefined = FarmIntegrationSchema | undefined> extends FarmIntegrationRoutesFactoryContext<TSchema> {
3768
+ endpoint: FarmIntegrationRouteFactory<TSchema>;
3769
+ }
3770
+ type FarmIntegrationEndpointsFactory<TSchema extends FarmIntegrationSchema | undefined = FarmIntegrationSchema | undefined> = (context: FarmIntegrationEndpointsFactoryContext<TSchema>) => FarmIntegrationEndpoints<TSchema>;
3771
+ declare function createIntegrationRoute<TSchema extends FarmIntegrationSchema | undefined = FarmIntegrationSchema | undefined>(_schema?: TSchema): FarmIntegrationRouteFactory<TSchema>;
3772
+ declare const integrationRoute: FarmIntegrationRouteFactory<undefined>;
3773
+ type RegisteredIntegrationRuntime = {
3774
+ integration: FarmIntegration;
3775
+ config: FarmPluginContext["config"];
3776
+ isDev: boolean;
3777
+ isProd: boolean;
3778
+ };
3779
+ type FarmIntegrationRoutesInput<TSchema extends FarmIntegrationSchema | undefined = FarmIntegrationSchema | undefined> = readonly FarmIntegrationRoute<any, any, TSchema>[] | FarmIntegrationRoutesFactory<TSchema>;
3780
+ type FarmIntegrationEndpointsInput<TSchema extends FarmIntegrationSchema | undefined = FarmIntegrationSchema | undefined> = FarmIntegrationEndpoints<TSchema> | FarmIntegrationEndpointsFactory<TSchema>;
3781
+ type FarmIntegrationInput<TSchema extends FarmIntegrationSchema | undefined = FarmIntegrationSchema | undefined, TConfig = unknown, TInstance = unknown> = Omit<FarmIntegration<TSchema, TConfig, TInstance>, "kind" | "category" | "slot" | "instance" | "config" | "routes" | "endpoints" | "plugins"> & {
3782
+ instance: TInstance;
3783
+ config?: FarmIntegrationConfigInput<TConfig, TSchema>;
3784
+ routes?: FarmIntegrationRoutesInput<TSchema>;
3785
+ endpoints?: FarmIntegrationEndpointsInput<TSchema>;
3786
+ plugins?: readonly FarmIntegrationContributedPlugin<NoInfer<TInstance>>[];
3787
+ } & ({
3788
+ category: FarmIntegrationCategory;
3789
+ slot?: FarmIntegrationCategory;
3790
+ } | {
3791
+ category?: FarmIntegrationCategory;
3792
+ slot: FarmIntegrationCategory;
3793
+ });
3794
+ type FarmIntegrationCategoryInput = {
3795
+ category: FarmIntegrationCategory;
3796
+ slot?: FarmIntegrationCategory;
3797
+ } | {
3798
+ category?: FarmIntegrationCategory;
3799
+ slot: FarmIntegrationCategory;
3800
+ };
3801
+ type FarmIntegrationShapeForInference = FarmIntegrationCategoryInput & {
3802
+ api?: FarmIntegrationAPI;
3803
+ schema?: FarmIntegrationSchema;
3804
+ config?: unknown;
3805
+ routes?: unknown;
3806
+ endpoints?: unknown;
3807
+ };
3808
+ type ExtractIntegrationSchema<TIntegration> = TIntegration extends {
3809
+ schema: infer TSchema extends FarmIntegrationSchema;
3810
+ } ? TSchema : undefined;
3811
+ type ResolveIntegrationRoutesInput<TRoutes, TSchema extends FarmIntegrationSchema | undefined> = TRoutes extends FarmIntegrationRoutesFactory<TSchema> ? ReturnType<TRoutes> : TRoutes;
3812
+ type ResolveIntegrationEndpointsInput<TEndpoints, TSchema extends FarmIntegrationSchema | undefined> = TEndpoints extends FarmIntegrationEndpointsFactory<TSchema> ? ReturnType<TEndpoints> : TEndpoints;
3813
+ type ExtractIntegrationRoutesFromRoutesInput<TRoutes, TSchema extends FarmIntegrationSchema | undefined> = ResolveIntegrationRoutesInput<TRoutes, TSchema> extends readonly (infer TRoute)[] ? TRoute : never;
3814
+ type ExtractIntegrationRoutesFromEndpointValue<TValue> = TValue extends FarmIntegrationRouteOperationCarrier<string, any> ? TValue : TValue extends readonly (infer TItem)[] ? ExtractIntegrationRoutesFromEndpointValue<TItem> : TValue extends object ? ExtractIntegrationRoutesFromEndpointValue<TValue[keyof TValue]> : never;
3815
+ type ExtractIntegrationRoutesFromEndpointsInput<TEndpoints, TSchema extends FarmIntegrationSchema | undefined> = ExtractIntegrationRoutesFromEndpointValue<ResolveIntegrationEndpointsInput<TEndpoints, TSchema>>;
3816
+ type ExtractIntegrationRouteUnion<TIntegration, TSchema extends FarmIntegrationSchema | undefined> = (TIntegration extends {
3817
+ routes: infer TRoutes;
3818
+ } ? ExtractIntegrationRoutesFromRoutesInput<TRoutes, TSchema> : never) | (TIntegration extends {
3819
+ endpoints: infer TEndpoints;
3820
+ } ? ExtractIntegrationRoutesFromEndpointsInput<TEndpoints, TSchema> : never);
3821
+ type ExtractDefinedIntegrationRoutes<TIntegration, TSchema extends FarmIntegrationSchema | undefined> = [ExtractIntegrationRouteUnion<TIntegration, TSchema>] extends [never] ? undefined : readonly ExtractIntegrationRouteUnion<TIntegration, TSchema>[];
3822
+ type ExtractDefinedIntegrationEndpoints<TIntegration, TSchema extends FarmIntegrationSchema | undefined> = TIntegration extends {
3823
+ endpoints: infer TEndpoints;
3824
+ } ? ResolveIntegrationEndpointsInput<TEndpoints, TSchema> : undefined;
3825
+ type ExtractIntegrationAPIRoutes<TIntegration, TSchema extends FarmIntegrationSchema | undefined> = Extract<ExtractIntegrationRouteUnion<TIntegration, TSchema>, FarmIntegrationRouteOperationCarrier<string, any>>;
3826
+ type ExtractIntegrationCategory<TIntegration extends FarmIntegrationCategoryInput> = TIntegration extends {
3827
+ category: infer TCategory extends FarmIntegrationCategory;
3828
+ } ? TCategory : TIntegration extends {
3829
+ slot: infer TSlot extends FarmIntegrationCategory;
3830
+ } ? TSlot : FarmIntegrationCategory;
3831
+ type ExtractDerivedIntegrationAPI<TIntegration extends FarmIntegrationShapeForInference, TSchema extends FarmIntegrationSchema | undefined = ExtractIntegrationSchema<TIntegration>> = TIntegration extends {
3832
+ api: infer TAPI extends FarmIntegrationAPI;
3833
+ } ? TAPI : [ExtractIntegrationAPIRoutes<TIntegration, TSchema>] extends [never] ? FarmIntegrationAPI | undefined : InferIntegrationAPIFromRoutes<readonly ExtractIntegrationAPIRoutes<TIntegration, TSchema>[]>;
3834
+ type DefinedIntegration<TIntegration extends FarmIntegrationShapeForInference, TSchema extends FarmIntegrationSchema | undefined = ExtractIntegrationSchema<TIntegration>> = Omit<TIntegration, "kind" | "category" | "slot" | "api" | "routes" | "endpoints"> & {
3835
+ readonly kind: "farm-integration";
3836
+ category: ExtractIntegrationCategory<TIntegration>;
3837
+ slot: ExtractIntegrationCategory<TIntegration>;
3838
+ routes: ExtractDefinedIntegrationRoutes<TIntegration, TSchema>;
3839
+ endpoints: ExtractDefinedIntegrationEndpoints<TIntegration, TSchema>;
3840
+ api: ExtractDerivedIntegrationAPI<TIntegration, TSchema>;
3841
+ };
3842
+ declare function defineIntegration<const TSchema extends FarmIntegrationSchema | undefined, const TConfig, TIntegration extends FarmIntegrationInput<TSchema, TConfig, any>>(integration: TIntegration & FarmIntegrationInput<TSchema, TConfig, NoInfer<TIntegration["instance"]>>): DefinedIntegration<TIntegration, TSchema>;
3843
+ declare function resolveIntegrationPlugins(integrations: FarmIntegrationsUserConfig | undefined): FarmPlugin[];
3844
+ declare function getIntegrationProviders(integrations: FarmIntegrationsUserConfig | undefined): FarmIntegrationProvider[];
3845
+ declare function isFarmIntegrationProviderComponentReference(value: FarmIntegrationProvider["component"]): value is FarmIntegrationProviderComponentReference;
3846
+ declare function getIntegrationDocumentNavigationMatchers(integrations: FarmIntegrationsUserConfig | undefined): string[];
3847
+ declare function getIntegrationSchemas(integrations: FarmIntegrationsUserConfig | undefined): Record<string, FarmIntegrationSchema>;
3848
+ declare function getRegisteredIntegrationRuntime(key: string): RegisteredIntegrationRuntime | undefined;
3849
+ declare function getRegisteredIntegrations(): Record<string, FarmIntegration>;
3850
+ declare function getRegisteredIntegrationSchemas(): Record<string, FarmIntegrationSchema>;
3851
+ declare function matchIntegrationRoute(integrations: FarmIntegrationsUserConfig | undefined, input: {
3852
+ pathname: string;
3853
+ method?: string;
3854
+ }): {
3855
+ key: string;
3856
+ integration: FarmIntegration;
3857
+ route: {
3858
+ path: string;
3859
+ methods: readonly string[];
3860
+ };
3861
+ params: FarmIntegrationRouteParams;
3862
+ } | null;
3863
+ declare function matchRegisteredIntegrationRoute(input: {
3864
+ pathname: string;
3865
+ method?: string;
3866
+ }): {
3867
+ key: string;
3868
+ integration: FarmIntegration;
3869
+ route: {
3870
+ path: string;
3871
+ methods: readonly string[];
3872
+ };
3873
+ params: FarmIntegrationRouteParams;
3874
+ } | null;
3875
+ declare function getRegisteredIntegrationAPIManifest(): Record<string, FarmIntegrationAPI>;
3876
+ declare function dispatchIntegrationRequest(runtime: RegisteredIntegrationRuntime, request: Request, options?: {
3877
+ currentRequest?: Request;
3878
+ data?: FarmIntegrationData;
3879
+ internal?: boolean;
3880
+ /**
3881
+ * Receives `Set-Cookie` values that a middleware forwarded via
3882
+ * forwardIntegrationSetCookies while returning `void`, when this dispatch
3883
+ * ends without a Response of its own. The request continues downstream, so
3884
+ * the caller owns merging them onto whatever response it finally produces.
3885
+ * Only called on the `null` return path: a Response returned from here has
3886
+ * already had the forwarded cookies appended.
3887
+ */
3888
+ onForwardedCookies?: (cookies: string[]) => void;
3889
+ /**
3890
+ * Middleware entries that already ran for this request, shared across dispatches. A
3891
+ * `ctx.rewrite()` target is guarded by a second dispatch, which skips these so each guard runs
3892
+ * at most once per request, as app middleware does.
3893
+ */
3894
+ ranMiddleware?: Set<object>;
3895
+ /** The peer address the server adapter reports, used unless `server.trustProxy` applies. */
3896
+ clientAddress?: string;
3897
+ }): Promise<Response | null>;
3898
+ /**
3899
+ * Run every configured integration's middleware and routes for one request.
3900
+ *
3901
+ * Integration middleware is not route scoped: it is the mechanism behind
3902
+ * `protectedRoutes` guards and provider session refresh, so it has to run for
3903
+ * ordinary page and API requests that match no integration route at all. That
3904
+ * makes this, not `matchIntegrationRoute`, the correct entry point for a
3905
+ * runtime dispatching integrations for every request.
3906
+ *
3907
+ * The first integration that produces a Response short-circuits the rest.
3908
+ * `Set-Cookie` values forwarded by middleware that returned `void` are
3909
+ * collected: they ride the short-circuiting Response when there is one, and are
3910
+ * otherwise handed back so the caller can merge them onto the downstream
3911
+ * response.
3912
+ */
3913
+ declare function dispatchIntegrationRequests(integrations: FarmIntegrationsUserConfig | undefined, runtime: Omit<RegisteredIntegrationRuntime, "integration">, request: Request, options?: {
3914
+ currentRequest?: Request;
3915
+ ranMiddleware?: Set<object>;
3916
+ clientAddress?: string;
3917
+ }): Promise<{
3918
+ response: Response | null;
3919
+ setCookies: string[];
3920
+ }>;
3921
+
3922
+ export { type FarmPluginDefinition as $, type FarmRouteMaxDuration as A, type BundleResultPayload as B, type FarmRedirectSignal as C, type FarmRedirectStatus as D, getFarmRedirectError as E, type FarmPlugin as F, isFarmNotFoundError as G, isFarmRedirectError as H, notFound as I, permanentRedirect as J, redirect as K, type LayoutProps as L, type Metadata as M, loadConfig as N, resolveConfig as O, type ParsedRoute as P, resolveDeployConfig as Q, type ResolvedFarmDesktopConfig as R, type APIHandlerLifecyclePayload as S, type APIRouteDiscoveredPayload as T, type BundleLifecyclePayload as U, type ErrorLifecyclePayload as V, FARM_NODE_RESPONSE_END_PENDING as W, type FarmDevtoolsUserConfig as X, type FarmPluginBuildHooks as Y, type FarmPluginClientConfig as Z, type FarmPluginDatabase as _, type FarmIntegration as a, type FarmIsolatedClientHydrationMode as a$, type FarmPluginDevHooks as a0, type FarmPluginDiscoveredRoute as a1, type FarmPluginIntegrationContext as a2, type FarmPluginLifecycle as a3, type FarmPluginRenderHooks as a4, type FarmPluginRouteRuntimePayload as a5, type FarmPluginRouterHooks as a6, type FarmPluginRuntimeAfterEvent as a7, type FarmPluginRuntimeBaseEvent as a8, type FarmPluginRuntimeBeforeEvent as a9, type RoutesGeneratedPayload as aA, type ShutdownPayload as aB, definePlugin as aC, resolveFarmDevtoolsConfig as aD, type MiddlewareProps as aE, type FarmContextFactory as aF, type FarmMCPCatalogDetails as aG, type ResolvedFarmAppManifestConfig as aH, type ReadonlyMiddlewareStore as aI, type FarmMiddlewareConfig as aJ, type MiddlewareModule as aK, type MiddlewareConfig$1 as aL, type MiddlewareContext as aM, type FarmServerComponentsMode as aN, type ResolvedFarmConfig as aO, type SSGCollectionResult as aP, type SSGPage as aQ, type FarmAgentJsonLd as aR, type FarmMCPServerRegistration as aS, type FarmMarkdownResolvedConfig as aT, type FarmConfig as aU, type AppRoutePattern as aV, type BuildOptions as aW, type ErrorBoundary as aX, type ErrorProps as aY, type FarmComponentType as aZ, type FarmContextFactoryInput as a_, type FarmPluginRuntimeCloseEvent as aa, type FarmPluginRuntimeContextEvent as ab, type FarmPluginRuntimeEndpoint as ac, type FarmPluginRuntimeEndpointEvent as ad, type FarmPluginRuntimeErrorEvent as ae, type FarmPluginRuntimeHooks as af, type FarmPluginRuntimeKind as ag, type FarmPluginRuntimeRequestHandler as ah, type FarmPluginRuntimeRequestOptions as ai, type FarmPluginRuntimeSession as aj, type FarmPluginRuntimeStartEvent as ak, type FarmPluginSetupContext as al, type FarmPluginStateContext as am, type FarmRequestPluginContext as an, type FarmRequestStore as ao, FarmRuntimeShutdownError as ap, type HMRUpdatePayload as aq, type MiddlewareDiscoveredPayload as ar, type NitroBuildLifecyclePayload as as, PluginManager as at, type PluginRequestContext as au, type RenderLifecyclePayload as av, type ResolvedFarmDevtoolsConfig as aw, type RouteDiscoveredPayload as ax, type RouteMatchPayload as ay, type RouteMatchResultPayload as az, type FarmDesktopConfigInput as b, type FarmAppManifestConfig as b$, type FarmMCPUserConfig as b0, type FarmMigrationCommand as b1, type FarmMigrationsConfig as b2, type FarmMigrationsUserConfig as b3, type GenerateStaticParams as b4, type Layout as b5, type LayoutMetadataProps as b6, type LayoutModule as b7, type Loading as b8, type LoadingProps as b9, type ResolvedFarmPerformanceConfig as bA, type ResolvedFarmSecurityConfig as bB, type ResolvedSchemaField as bC, type FarmSqlStatement as bD, type FarmSqlDialect as bE, type CollectedSchemaModel as bF, type FarmSchemaMigrationStep as bG, type OpenAPIConfig as bH, type ApplyMarkdownNegotiationHeadersOptions as bI, type CookieJar as bJ, type CookieOptions as bK, type CreateIntegrationOrmOptions as bL, type CreateMarkdownMirrorResponseOptions as bM, DEFAULT_FARM_API_BASE_PATH as bN, DEFAULT_FARM_DEVTOOLS_SHORTCUT as bO, type DefinedIntegration as bP, FARM_DEVTOOLS_LAUNCH_PARAM as bQ, FARM_DEVTOOLS_PATH as bR, FARM_INTEGRATION_API_BASE_PATH_KEY as bS, FARM_INTEGRATION_INTERNAL_DISPATCH_CONTEXT_KEY as bT, FARM_INTEGRATION_SET_COOKIES_KEY as bU, FARM_MARKDOWN_PAGE_CHECK_HEADER as bV, type FarmAPIConfig as bW, type FarmAPIConfigResolverContext as bX, type FarmAPIConfigValue as bY, type FarmAgentCrawlers as bZ, type FarmAgentUserConfig as b_, type MetadataJsonLd as ba, type MetadataProps as bb, type MetadataRobots as bc, type MetadataRobotsDirectives as bd, type NitroPreset as be, type Page as bf, type PagePropsWithMiddleware as bg, type PageRouteParams as bh, type ResolvedFarmMigrationsConfig as bi, type ServerAction as bj, type StaticPathParams as bk, type StaticPathPrimitive as bl, type StaticRouteParams as bm, type ThemeColorDescriptor as bn, type Viewport as bo, resolveFarmMCPConfig as bp, resolveFarmMCPPlugin as bq, _findFarmMCPEndpointTool as br, _publishFarmMCPCatalog as bs, registerFarmMCPServer as bt, type ResolvedFarmRouteRuntimeConfig as bu, type ApplicationMetadataRouteKind as bv, type ResolvedFarmAPIConfig as bw, type FarmDocsResolvedConfig as bx, type ResolvedFarmDevIndicatorsConfig as by, type ResolvedFarmAuthConfig as bz, type FarmDesktopContext as c, type FarmIntegrationRoutesFactory as c$, type FarmAuthConfig as c0, type FarmAuthDatabaseConfig as c1, type FarmAuthEmailAndPasswordConfig as c2, type FarmAuthSessionConfig as c3, type FarmAuthUserConfig as c4, type FarmBuildActivityPosition as c5, type FarmCrawlerPolicy as c6, type FarmCspConfig as c7, type FarmCspDirectiveValue as c8, type FarmCspDirectives as c9, type FarmIntegrationLifecycleLogLevel as cA, type FarmIntegrationLifecycleLogger as cB, type FarmIntegrationLogEvent as cC, type FarmIntegrationLogPhase as cD, type FarmIntegrationLogger as cE, type FarmIntegrationMiddleware as cF, type FarmIntegrationOrmClient as cG, type FarmIntegrationOrmSchema as cH, type FarmIntegrationPluginOwner as cI, type FarmIntegrationProvider as cJ, type FarmIntegrationProviderComponentReference as cK, type FarmIntegrationProviderProps as cL, type FarmIntegrationRequestContextStore as cM, type FarmIntegrationRoute as cN, type FarmIntegrationRouteArgs as cO, type FarmIntegrationRouteDb as cP, type FarmIntegrationRouteFactory as cQ, type FarmIntegrationRouteHook as cR, type FarmIntegrationRouteHookContext as cS, type FarmIntegrationRouteInput as cT, type FarmIntegrationRouteInputSchemas as cU, type FarmIntegrationRouteInputSource as cV, type FarmIntegrationRouteMethod as cW, type FarmIntegrationRouteMiddleware as cX, type FarmIntegrationRouteParamValue as cY, type FarmIntegrationRouteParams as cZ, type FarmIntegrationRouteStorageArgs as c_, type FarmCspOptions as ca, type FarmDeployConfig as cb, type FarmDeployTarget as cc, type FarmDevIndicatorsConfig as cd, type FarmDevtoolsConfig as ce, type FarmDocsConfigInput as cf, type FarmDocsNavigationConfig as cg, type FarmDocsSidebarItem as ch, type FarmDocsSocialImageConfig as ci, type FarmDocsSocialImageFonts as cj, type FarmDocsUserConfig as ck, type FarmIntegrationCategory as cl, type FarmIntegrationConfigContext as cm, type FarmIntegrationConfigDefinition as cn, type FarmIntegrationConfigInput as co, type FarmIntegrationContributedPlugin as cp, type FarmIntegrationData as cq, type FarmIntegrationDocumentNavigation as cr, type FarmIntegrationEndpointValue as cs, type FarmIntegrationEndpoints as ct, type FarmIntegrationEndpointsFactory as cu, type FarmIntegrationEndpointsFactoryContext as cv, type FarmIntegrationHandlerContext as cw, type FarmIntegrationInputSchema as cx, type FarmIntegrationLifecycleContext as cy, type FarmIntegrationLifecycleHook as cz, type FarmDesktopUserConfig as d, type FarmTypedIntegrationRoute as d$, type FarmIntegrationRoutesFactoryContext as d0, type FarmIntegrationSchema as d1, type FarmIntegrationSchemaConstraint as d2, type FarmIntegrationSchemaField as d3, type FarmIntegrationSchemaFieldType as d4, type FarmIntegrationSchemaModel as d5, type FarmIntegrationSchemaModelExtension as d6, type FarmIntegrationSchemaModelOverride as d7, type FarmIntegrationSchemaReference as d8, type FarmIntegrationSlot as d9, type FarmMarkdownMirrorTarget as dA, type FarmMarkdownResolvedRoute as dB, type FarmMarkdownRouteInput as dC, type FarmMarkdownUserConfig as dD, type FarmPageFormAction as dE, type FarmPageFormField as dF, type FarmPageFormOption as dG, type FarmPageFormSubmit as dH, type FarmPerformanceConfig as dI, type FarmPluginFactory as dJ, FarmPluginOptionsError as dK, type FarmPluginOptionsIssue as dL, type FarmPluginOptionsSchema as dM, type FarmPreloadMode as dN, type FarmPreloadUserConfig as dO, type FarmRouteRenderingMode as dP, type FarmRouteRule as dQ, type FarmRouteRuleCors as dR, type FarmRouteRuleRedirect as dS, type FarmRouteRuleRenderMode as dT, type FarmRouteRules as dU, type FarmRouteRuntimeEntryKind as dV, type FarmRouteRuntimeManifest as dW, type FarmRouteRuntimeManifestEntry as dX, type FarmSecurityConfig as dY, type FarmServerComponentsConfig as dZ, type FarmServerComponentsOptions as d_, type FarmIntegrationStandardValidationResult as da, type FarmIntegrationValidationErrorLike as db, type FarmIntegrationValidationIssue as dc, type FarmIntegrationValidationPathSegment as dd, type FarmIntegrationValidationResult as de, type FarmIntegrationsUserConfig as df, type FarmLayerConfig as dg, type FarmMCPAuthorization as dh, type FarmMCPAuthorizeContext as di, type FarmMCPConfig as dj, type FarmMCPEndpoint as dk, type FarmMCPEndpointTool as dl, type FarmMCPExecuteContext as dm, type FarmMCPOAuthConfig as dn, type FarmMCPPrompt as dp, type FarmMCPPromptMessage as dq, type FarmMCPResource as dr, type FarmMCPResourceContent as ds, type FarmMCPResourceContext as dt, type FarmMCPResourceListing as du, type FarmMCPServer as dv, type FarmMCPServerFunction as dw, type FarmMCPStandaloneTool as dx, type FarmMCPTool as dy, type FarmMCPToolDefinition as dz, type FarmDesktopWindowConfig as e, getFarmMarkdownMirrorPath as e$, type HeaderConfig as e0, type I18nConfig as e1, type ImageConfig as e2, type InferFarmIntegrationOrmClient as e3, type InferFarmIntegrationOrmField as e4, type InferFarmIntegrationOrmFields as e5, type InferFarmIntegrationOrmSchema as e6, type InferPluginOptionsInput as e7, type InferPluginOptionsOutput as e8, type IntegrationOriginPolicy as e9, _getFarmMarkdownPageCheckToken as eA, _isFarmMarkdownPageCheck as eB, applyMarkdownNegotiationHeaders as eC, collectSchemaModels as eD, createFarmRouteRuntimeKey as eE, createIntegrationOrm as eF, createIntegrationRoute as eG, createMarkdownMirrorResponse as eH, defineIntegration as eI, defineIntegrationSchema as eJ, describeIntegrationOriginRejection as eK, describeSchemaReference as eL, dispatchIntegrationRequest as eM, dispatchIntegrationRequests as eN, escapeSqlString as eO, extractFarmPageActions as eP, farmAcceptQuality as eQ, farmIntegrationSchemaToOrmSchema as eR, farmRouteRuleMatches as eS, forwardIntegrationSetCookies as eT, generateFarmDevIndicatorsClientRuntime as eU, generateSqlStatements as eV, getDeployTargetForPreset as eW, getFarmAPIBaseURL as eX, getFarmIntegrationPluginOwner as eY, getFarmIntegrationPluginServerRuntime as eZ, getFarmMarkdownAlternatePath as e_, type IntegrationOriginRejection as ea, type IntegrationOriginResult as eb, type IntegrationOrmModelNames as ec, type MemoryRateLimitStorageOptions as ed, MetadataRoute as ee, type MetadataRouteContext as ef, type MiddlewareChain as eg, type MiddlewareConfig as eh, type MiddlewareFunction as ei, type MiddlewareResult as ej, type MiddlewareStore as ek, type NextFunction as el, type RateLimitConfig as em, type RateLimitIncrementResult as en, type RateLimitStatus as eo, type RateLimitStorage as ep, type RedirectConfig as eq, type RequestMiddleware as er, type RequestMiddlewareContext as es, type ResolveMarkdownMirrorTargetOptions as et, type ResolvedFarmCspConfig as eu, type ResolvedFarmDeployConfig as ev, type ResolvedFarmMCPConfig as ew, type ResolvedFarmPreloadConfig as ex, type ResolvedSchemaModel as ey, type RewriteConfig as ez, type FarmRouteRuntimeConfig as f, manageFarmDocumentPreloads as f$, getFarmRouteRuntimeConfig as f0, getIntegrationDocumentNavigationMatchers as f1, getIntegrationProviders as f2, getIntegrationSchemas as f3, getPresetForDeployTarget as f4, getRegisteredIntegrationAPIManifest as f5, getRegisteredIntegrationRuntime as f6, getRegisteredIntegrationSchemas as f7, getRegisteredIntegrations as f8, getSqlColumnType as f9, resolveFarmRouteRuntimeConfig as fA, resolveIntegrationAllowedOrigins as fB, resolveIntegrationOrmRuntimeClient as fC, resolveIntegrationPlugins as fD, resolveMarkdownConfig as fE, resolveMarkdownMirrorTarget as fF, resolveMigrationsConfig as fG, resolveSchemaModels as fH, routeRulesToHeaders as fI, routeRulesToNitroRouteRules as fJ, routeRulesToRedirects as fK, toCamelCase as fL, toPascalCase as fM, toSnakeCase as fN, validateIntegrationRequestOrigin as fO, type FarmLlmsTxtLink as fP, type FarmLlmsTxtUserConfig as fQ, type ResolvedFarmLlmsTxtConfig as fR, applyFarmCspNonceToResponse as fS, collectFarmLlmsTxtPages as fT, createFarmAgentRobots as fU, createFarmCspNonce as fV, createFarmDefaultLlmsTxt as fW, createFarmDefaultSitemap as fX, createFarmLlmsFullRenderer as fY, createFarmLlmsMarkdownReader as fZ, createFarmMetadataRouteResponse as f_, getSqlDefaultExpression as fa, hasFarmRouteRuntimeControls as fb, htmlToMarkdown as fc, integrationMiddlewareMayHandlePath as fd, integrationRoute as fe, isFarmIntegration as ff, isFarmIntegrationProviderComponentReference as fg, isFarmMarkdownMirrorExposed as fh, isNullableField as fi, matchIntegrationRoute as fj, matchRegisteredIntegrationRoute as fk, matchesFarmMarkdownRoutePattern as fl, mergeFarmRouteRuntimeConfigs as fm, normalizeDeployTarget as fn, normalizeFarmAPIBasePath as fo, normalizeFarmAPIConfig as fp, normalizeFarmRouteRuntimeConfig as fq, normalizeRouteRules as fr, quoteSqlIdentifier as fs, renderSqlSchemaFile as ft, requestAcceptsMarkdown as fu, resolveDeployOutputPath as fv, resolveFarmAPIConfig as fw, resolveFarmAPIRequestURL as fx, resolveFarmDevIndicatorsConfig as fy, resolveFarmRouteRuleRuntimeConfig as fz, type FarmMdxComponents as g, manageFarmHtmlPreloads as g0, manageFarmLinkHeaderPreloads as g1, renderFarmLlmsFullTxt as g2, reportFarmPreloadWarnings as g3, resolveFarmLlmsTxtConfig as g4, resolveFarmSecurityConfig as g5, stampFarmCspNonce as g6, type FarmDesktopDevSession as g7, type FarmDesktopSetupOptions as g8, createFarmDesktopContext as g9, getFarmDesktopOutputDirs as ga, installFarmDesktopSetup as gb, resolveFarmDesktopBlock as gc, resolveFarmDesktopConfig as gd, setFarmDesktopDevSession as ge, validateFarmDesktopConfig as gf, type FarmMdxResolvedConfig as h, type RouteModule as i, FARM_MARKDOWN_CONTENT_TYPE as j, createFarmMarkdownErrorBody as k, farmRequestWantsMarkdown as l, type FarmMdxComponent as m, type FarmMdxUserConfig as n, resolveMdxConfig as o, type FarmUserConfig as p, type RouteSegment as q, resolveFarmMdxComponentsModulePath as r, type FarmRequest as s, type FarmResponse as t, type FarmPluginContext as u, type FarmAppContext as v, type PageProps as w, type PluginContextProps as x, type FarmRouteRuntime as y, type FarmRouteRegions as z };