@farm.js/core 0.1.51-beta.3 → 0.1.61

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