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