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