@farm.js/core 0.1.66 → 0.1.68
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{agent-mcp-handler-QLFDDTYN.mjs → agent-mcp-handler-AZ7QW4UP.mjs} +5 -5
- package/dist/{agent-mcp-handler-OXT73ZBY.cjs → agent-mcp-handler-FER4MQDF.cjs} +6 -6
- package/dist/{agent-mcp.d-QD2WZ9BS.d.ts → agent-mcp.d-Uh5xr7aX.d.ts} +1 -1
- package/dist/{agent-mcp.d-CO_ABmNK.d.mts → agent-mcp.d-wkVPK1GA.d.mts} +1 -1
- package/dist/agent-runtime.cjs +6 -5
- package/dist/agent-runtime.d.mts +10 -8
- package/dist/agent-runtime.d.ts +10 -8
- package/dist/agent-runtime.mjs +5 -4
- package/dist/{analyzer-4UFP4HVP.mjs → analyzer-CQDU7E3Y.mjs} +2 -2
- package/dist/analyzer-PPAHM4AW.cjs +16 -0
- package/dist/api/client.cjs +12 -2
- package/dist/api/client.d.mts +4 -4
- package/dist/api/client.d.ts +4 -4
- package/dist/api/client.mjs +12 -2
- package/dist/api/client.native.cjs +12 -2
- package/dist/api/client.native.d.mts +5 -5
- package/dist/api/client.native.d.ts +5 -5
- package/dist/api/client.native.mjs +12 -2
- package/dist/api/node.cjs +223 -0
- package/dist/api/node.d.mts +61 -0
- package/dist/api/node.d.ts +61 -0
- package/dist/api/node.mjs +223 -0
- package/dist/api/route-manager.cjs +11 -11
- package/dist/api/route-manager.d.mts +14 -11
- package/dist/api/route-manager.d.ts +14 -11
- package/dist/api/route-manager.mjs +10 -10
- package/dist/api/runtime.cjs +11 -7
- package/dist/api/runtime.d.mts +11 -9
- package/dist/api/runtime.d.ts +11 -9
- package/dist/api/runtime.mjs +10 -6
- package/dist/{api-client.d-BNLXNCXJ.d.mts → api-client.d-Bp35zMqR.d.mts} +1 -1
- package/dist/{api-client.d-ddQBNGtu.d.ts → api-client.d-CFI_xL0V.d.ts} +1 -1
- package/dist/api.cjs +17 -13
- package/dist/api.d.mts +15 -12
- package/dist/api.d.ts +15 -12
- package/dist/api.mjs +16 -12
- package/dist/{app-manifest.d-DDmNkYQQ.d.ts → app-manifest.d-BT5i2F-o.d.ts} +1 -1
- package/dist/{app-manifest.d-BpKxiU_E.d.mts → app-manifest.d-Dd4q5CFx.d.mts} +1 -1
- package/dist/app-markdown.cjs +5 -5
- package/dist/app-markdown.d.mts +15 -15
- package/dist/app-markdown.d.ts +15 -15
- package/dist/app-markdown.mjs +4 -4
- package/dist/{app.d-x68Cwr0_.d.ts → app.d-BVOpL_f2.d.ts} +52 -11
- package/dist/{app.d-kuoVWhWM.d.mts → app.d-BhiDXex_.d.mts} +52 -11
- package/dist/{chunk-RY4ABNPE.cjs → chunk-225APHKC.cjs} +3 -3
- package/dist/{chunk-JGAE5XPL.cjs → chunk-23VJEGKC.cjs} +4 -2
- package/dist/{chunk-5C7XMKQ4.cjs → chunk-2AFW7673.cjs} +6 -1
- package/dist/{chunk-SYW346ZN.cjs → chunk-2LHZD3OP.cjs} +1 -21
- package/dist/{chunk-ZZI56IUY.mjs → chunk-2ZOYOYEE.mjs} +13 -13
- package/dist/{chunk-7XGWBPQQ.cjs → chunk-3EEINK7G.cjs} +24 -10
- package/dist/{chunk-BRWIVOV4.cjs → chunk-3GNHJ3RN.cjs} +10 -8
- package/dist/{chunk-HCGWDRZO.mjs → chunk-3Y52TWYU.mjs} +18 -7
- package/dist/{chunk-CBOEJ5Z4.cjs → chunk-437QZIC2.cjs} +133 -46
- package/dist/{chunk-O6L3YYPM.cjs → chunk-4E57QHPW.cjs} +8 -16
- package/dist/{chunk-WKPBIT5Q.cjs → chunk-4HGLJOXZ.cjs} +6 -6
- package/dist/{chunk-CJNAUEVC.mjs → chunk-4QENVMG7.mjs} +1 -1
- package/dist/{chunk-EMNKZGF4.mjs → chunk-4UAQB5LB.mjs} +556 -462
- package/dist/{chunk-BQWBHWEW.mjs → chunk-4ZXKYCYK.mjs} +1 -1
- package/dist/{chunk-N35YPV4N.mjs → chunk-57QAQU4F.mjs} +9 -7
- package/dist/{chunk-ZEXE4TGY.mjs → chunk-5FBZJJGA.mjs} +247 -110
- package/dist/{chunk-4OSOLDPL.cjs → chunk-5JKDFRTK.cjs} +2 -2
- package/dist/{chunk-OLIGNTWU.cjs → chunk-5NFQ6AZI.cjs} +7 -7
- package/dist/{chunk-6HRAK7I5.mjs → chunk-5OFNUETM.mjs} +8 -2
- package/dist/{chunk-RD623KW4.cjs → chunk-67MZTLTF.cjs} +21 -3
- package/dist/chunk-6I4BFRE7.cjs +51 -0
- package/dist/{chunk-UBMHQVWN.mjs → chunk-6OFOIMNS.mjs} +1 -1
- package/dist/{chunk-K5EW7GUU.mjs → chunk-7BIW7VCW.mjs} +13 -5
- package/dist/{chunk-CHYTADNK.cjs → chunk-7LK5CTUM.cjs} +70 -53
- package/dist/{chunk-HPP2II4Z.mjs → chunk-7PJARAQQ.mjs} +1 -1
- package/dist/{chunk-LEJDW34D.cjs → chunk-7PPLTD3P.cjs} +3 -3
- package/dist/{chunk-BYRZ5VTH.mjs → chunk-A3T445WK.mjs} +47 -34
- package/dist/{chunk-TGULJSHD.mjs → chunk-AJNBTOVQ.mjs} +20 -9
- package/dist/{chunk-FBEBSAVI.cjs → chunk-AKIQ54FK.cjs} +82 -63
- package/dist/{chunk-2NGZFOKG.mjs → chunk-AOIUYHPH.mjs} +2 -2
- package/dist/{chunk-NKRZLQUK.mjs → chunk-AQIO3RNL.mjs} +1 -1
- package/dist/chunk-AQIRXBBY.cjs +26 -0
- package/dist/{chunk-DQJ2CIH7.cjs → chunk-ASYOWPSR.cjs} +2 -1
- package/dist/chunk-AZ6IW6SF.mjs +28 -0
- package/dist/{chunk-QMDU6QHN.mjs → chunk-B6RBJJ5G.mjs} +1 -1
- package/dist/{chunk-I32V5CZL.cjs → chunk-BDYM2TN3.cjs} +28 -17
- package/dist/{chunk-JLDNXURZ.cjs → chunk-BZWTBELF.cjs} +32 -32
- package/dist/{chunk-ITV4QQL2.cjs → chunk-C6CUUBY5.cjs} +14 -3
- package/dist/{chunk-QGJ4FI2G.mjs → chunk-C6HGUTXB.mjs} +113 -29
- package/dist/{chunk-YN6BHOYY.cjs → chunk-CL52PD6D.cjs} +10 -3
- package/dist/{chunk-VQJHT2ND.mjs → chunk-CRVSYDHV.mjs} +2 -2
- package/dist/{chunk-XURDCXNH.cjs → chunk-CSLHNBPS.cjs} +6 -6
- package/dist/{chunk-XQSYOVCW.cjs → chunk-DBYNZIIQ.cjs} +13 -5
- package/dist/{chunk-AZUUKA66.mjs → chunk-DIXFKAPM.mjs} +1251 -389
- package/dist/{chunk-QTD6EMN2.mjs → chunk-DQ2DI3Y7.mjs} +11 -4
- package/dist/{chunk-NHQM2Q4I.cjs → chunk-DWLNLU55.cjs} +2 -2
- package/dist/chunk-DXZ57EPE.mjs +375 -0
- package/dist/{chunk-SA7MLSP4.mjs → chunk-E3HDJCWF.mjs} +3 -3
- package/dist/{chunk-52Y3C3HG.mjs → chunk-E7VF3LQ5.mjs} +3 -2
- package/dist/{chunk-752XUZIM.cjs → chunk-EGIY4A7V.cjs} +6 -6
- package/dist/chunk-EIVGPQN5.mjs +51 -0
- package/dist/{chunk-KPAJWD3N.mjs → chunk-EYPSKXO4.mjs} +1 -1
- package/dist/{chunk-E4UDLFWR.cjs → chunk-F36LS2C7.cjs} +796 -702
- package/dist/{chunk-MPIGW42F.mjs → chunk-F6CMGWAL.mjs} +1 -1
- package/dist/{chunk-GL7N5UHF.cjs → chunk-FJMC24KG.cjs} +21 -10
- package/dist/{chunk-QISW423S.cjs → chunk-FPBOAG6N.cjs} +2 -2
- package/dist/{chunk-3CCAICF7.cjs → chunk-FSODPZRT.cjs} +5 -5
- package/dist/{chunk-2C5L5RPM.cjs → chunk-FT6KJHS3.cjs} +71 -38
- package/dist/{chunk-WMTBBQHY.cjs → chunk-FVYBEMOD.cjs} +288 -151
- package/dist/{chunk-BM2LH2JM.mjs → chunk-G7NBPP7H.mjs} +14 -13
- package/dist/{chunk-ES2LD2YD.mjs → chunk-GCRT6GJG.mjs} +18 -0
- package/dist/{chunk-5OJVKXFV.cjs → chunk-GDM3ZD2O.cjs} +10 -8
- package/dist/{chunk-25T5VXOE.mjs → chunk-GFPS7MNE.mjs} +106 -19
- package/dist/{chunk-EMDGXYUD.mjs → chunk-GJ7QVFAG.mjs} +16 -7
- package/dist/{chunk-TGSEVBPO.mjs → chunk-GJEC5S4V.mjs} +11 -0
- package/dist/{chunk-HNAISJFD.cjs → chunk-HDPT6OYE.cjs} +9 -3
- package/dist/{chunk-RVGSVQWT.mjs → chunk-HEJM46HQ.mjs} +21 -7
- package/dist/chunk-HHLEYA4B.cjs +17 -0
- package/dist/{chunk-ZNH6NR3H.cjs → chunk-HJZZSBVK.cjs} +2 -2
- package/dist/{chunk-E552H232.cjs → chunk-I7J5RLGO.cjs} +16 -2
- package/dist/chunk-ICFPTHXM.mjs +97 -0
- package/dist/{chunk-K7OZAVOI.mjs → chunk-IFR74W6S.mjs} +46 -13
- package/dist/{chunk-MPJEIHW2.cjs → chunk-IGDYL2IA.cjs} +2 -2
- package/dist/{chunk-5A77OEIG.cjs → chunk-IHTDLCDJ.cjs} +5 -5
- package/dist/{chunk-OYZXVBZP.cjs → chunk-IUKBPBM7.cjs} +2 -1
- package/dist/chunk-J6TZRYCO.cjs +22 -0
- package/dist/{chunk-E4RDMG3K.mjs → chunk-JL2YW5KX.mjs} +5 -4
- package/dist/chunk-JSOCDYER.cjs +375 -0
- package/dist/{chunk-UPYIFH2H.cjs → chunk-JWLRBDDC.cjs} +2 -2
- package/dist/{chunk-OLGQZRW6.mjs → chunk-JZBU7V4D.mjs} +37 -17
- package/dist/{chunk-ONG4RDW3.mjs → chunk-JZGL2PIH.mjs} +13 -3
- package/dist/chunk-K63OWRY2.mjs +22 -0
- package/dist/{chunk-TUPKMMXT.mjs → chunk-K6HIIWUB.mjs} +1 -1
- package/dist/{chunk-MESQF2JC.mjs → chunk-K6SXMVXO.mjs} +2 -2
- package/dist/{chunk-L2JG337G.cjs → chunk-K6VFYFOY.cjs} +33 -31
- package/dist/{chunk-TKK5QHKZ.mjs → chunk-KDO6T6OB.mjs} +3 -3
- package/dist/{chunk-EZ34EHQP.mjs → chunk-KI3MU7B5.mjs} +1 -1
- package/dist/{chunk-GHNW564E.mjs → chunk-KSZK34HU.mjs} +30 -10
- package/dist/{chunk-IT6WRNGB.cjs → chunk-KWCZKJYU.cjs} +1541 -679
- package/dist/{chunk-DVKH2RVN.cjs → chunk-LDEXTX4I.cjs} +70 -57
- package/dist/{chunk-ECKQFEX2.mjs → chunk-LENKRGBV.mjs} +8 -6
- package/dist/{chunk-XBSKPLHF.cjs → chunk-LR4KP3I7.cjs} +2 -2
- package/dist/{chunk-HEPJIKKQ.cjs → chunk-MCSRMEQV.cjs} +2 -2
- package/dist/{chunk-DQF3QLOH.mjs → chunk-ME7RVELR.mjs} +3 -2
- package/dist/{chunk-VFXE6NWR.mjs → chunk-MGKWYPE3.mjs} +2 -1
- package/dist/{chunk-TZVUF5JJ.mjs → chunk-MGZVDX4R.mjs} +5 -5
- package/dist/{chunk-MGKW5XZE.cjs → chunk-MMDKYJ5V.cjs} +7 -7
- package/dist/{chunk-SK7QSNWE.mjs → chunk-MNJDNTGO.mjs} +1 -1
- package/dist/{chunk-5Y2P454O.cjs → chunk-MTBDJ326.cjs} +6 -5
- package/dist/{chunk-FIR62CR3.mjs → chunk-MV7NWU23.mjs} +1 -1
- package/dist/{chunk-7ONGIFYX.cjs → chunk-MZ4CRSY7.cjs} +481 -171
- package/dist/{chunk-O4F3JUST.mjs → chunk-NDDRTFN4.mjs} +4 -0
- package/dist/{chunk-4IHMHFQB.cjs → chunk-NG2EZ6QS.cjs} +28 -1
- package/dist/{chunk-XBSLKXBL.mjs → chunk-NT4W4H52.mjs} +52 -35
- package/dist/{chunk-UAQD67HM.mjs → chunk-NVOMQLI2.mjs} +16 -2
- package/dist/{chunk-R62SF5R4.mjs → chunk-OB45EAQL.mjs} +6 -1
- package/dist/{chunk-V56632LA.cjs → chunk-OCNV4CI2.cjs} +39 -6
- package/dist/{chunk-SYXPWJ7N.cjs → chunk-OFBLGH6V.cjs} +17 -18
- package/dist/{chunk-VQ4NWOWO.mjs → chunk-OGVTUGMU.mjs} +5 -13
- package/dist/{chunk-3UZVPO72.mjs → chunk-OIOPQ25L.mjs} +6 -7
- package/dist/{chunk-2XGBJSDV.cjs → chunk-OO7DYIJD.cjs} +73 -24
- package/dist/{chunk-27FPUFWR.mjs → chunk-P2NBQ5JI.mjs} +1 -1
- package/dist/{chunk-HZPKJRYA.cjs → chunk-PDFFYZAT.cjs} +2 -2
- package/dist/{chunk-GSVJ3IIF.cjs → chunk-PHCJJJZV.cjs} +2 -2
- package/dist/{chunk-EVMXPJCB.mjs → chunk-PKMUQ7LM.mjs} +2 -1
- package/dist/{chunk-OAJOQU5J.mjs → chunk-PLJKJJ2H.mjs} +82 -63
- package/dist/{chunk-72KCTHLV.cjs → chunk-PRL7FXG4.cjs} +113 -29
- package/dist/{chunk-6XQSPIN6.cjs → chunk-PWKAX5MS.cjs} +13 -3
- package/dist/{chunk-4ZJ5C7UJ.cjs → chunk-QIXEU2WV.cjs} +19 -10
- package/dist/{chunk-FJWN7RV4.cjs → chunk-QO43L7Z4.cjs} +38 -8
- package/dist/{chunk-X4K7TYN6.cjs → chunk-QOGIZKSO.cjs} +26 -25
- package/dist/{chunk-CNNBFGL5.cjs → chunk-QSUYB3RH.cjs} +14 -14
- package/dist/chunk-QYNZ3CTI.mjs +17 -0
- package/dist/{chunk-X3XUZWRB.mjs → chunk-R2ZHU37O.mjs} +36 -3
- package/dist/{chunk-ZIHWAN55.cjs → chunk-RE5E2G5S.cjs} +1 -1
- package/dist/{chunk-O75GQVUK.mjs → chunk-RLH5AH2M.mjs} +1 -1
- package/dist/chunk-RWR7SMD7.cjs +50 -0
- package/dist/{chunk-7PTISZSQ.cjs → chunk-S7MWSFFP.cjs} +4 -0
- package/dist/chunk-SD6JGJOM.mjs +50 -0
- package/dist/{chunk-7H4SVNC4.cjs → chunk-SPP3EZTJ.cjs} +46 -26
- package/dist/{chunk-BIF5MLTH.cjs → chunk-SQ6IWJ3H.cjs} +1 -1
- package/dist/{chunk-WVYRLP5E.mjs → chunk-T5XFZQCL.mjs} +1 -1
- package/dist/{chunk-WAY6LOQH.mjs → chunk-TEJ67GD2.mjs} +1 -1
- package/dist/{chunk-OP7LHY4Y.cjs → chunk-TNK2TVRS.cjs} +2005 -800
- package/dist/{chunk-IFTGERT3.mjs → chunk-TTXIITYA.mjs} +49 -0
- package/dist/{chunk-ZFWYCVKS.mjs → chunk-TY5KCYDE.mjs} +22 -4
- package/dist/{chunk-WYAXRIYP.cjs → chunk-UKZ6AWKZ.cjs} +10 -9
- package/dist/{chunk-UJ3R2AH2.cjs → chunk-UPOYKX4S.cjs} +5 -5
- package/dist/{chunk-VBCQ5WOI.cjs → chunk-URN7VFO7.cjs} +105 -16
- package/dist/{chunk-2DLGV2ZG.mjs → chunk-UTUS6JUH.mjs} +1 -21
- package/dist/{chunk-435QJNC2.mjs → chunk-VFNAK6A5.mjs} +4 -4
- package/dist/{chunk-WFWFECDW.mjs → chunk-VRGY3X2I.mjs} +100 -11
- package/dist/{chunk-LQNW3ABP.cjs → chunk-VX2HZGC7.cjs} +14 -14
- package/dist/chunk-W44X6IC2.cjs +97 -0
- package/dist/{chunk-A2MN5PQJ.mjs → chunk-WMLSZAKN.mjs} +9 -9
- package/dist/{chunk-672ISQIG.mjs → chunk-WPB67LE5.mjs} +379 -69
- package/dist/{chunk-3EEET2Q5.cjs → chunk-WUTFJOV7.cjs} +32 -12
- package/dist/chunk-WVQNXXNE.cjs +28 -0
- package/dist/{chunk-Y5TOT5F6.cjs → chunk-X3MHKLCO.cjs} +5 -5
- package/dist/{chunk-W2ZXMMHA.mjs → chunk-XCAQTCGK.mjs} +1 -1
- package/dist/{chunk-Z7P2BTZ3.cjs → chunk-XGTFLG73.cjs} +30 -12
- package/dist/{chunk-XCXHQBMM.mjs → chunk-Y2LU4LE5.mjs} +1 -1
- package/dist/{chunk-5J45H65F.mjs → chunk-Y5LEPEVH.mjs} +1 -1
- package/dist/{chunk-D4MRNBVF.cjs → chunk-Y6KHPJDB.cjs} +2 -2
- package/dist/{chunk-BT4SEFLC.cjs → chunk-YAEN3L2F.cjs} +3 -2
- package/dist/chunk-YFTGIHNC.mjs +26 -0
- package/dist/{chunk-KL7SHLQB.mjs → chunk-YGJ5P3TJ.mjs} +31 -1
- package/dist/{chunk-752IHQTD.cjs → chunk-YTNBCXCW.cjs} +12 -12
- package/dist/{chunk-RFKTJTWZ.mjs → chunk-YVPX5PI5.mjs} +3 -1
- package/dist/{chunk-4TVPYN32.cjs → chunk-Z3PW3DIR.cjs} +7 -7
- package/dist/{chunk-OB7VKCUZ.mjs → chunk-Z6SOXHAD.mjs} +1851 -646
- package/dist/{chunk-72KABRWN.mjs → chunk-ZJGFAW5U.mjs} +5 -3
- package/dist/{chunk-TNBJ4LZG.mjs → chunk-ZPKJPM7K.mjs} +4 -4
- package/dist/{chunk-5FE5YT2N.mjs → chunk-ZZGQD3LL.mjs} +28 -1
- package/dist/client/lifecycle.cjs +2 -2
- package/dist/client/lifecycle.d.mts +1 -1
- package/dist/client/lifecycle.d.ts +1 -1
- package/dist/client/lifecycle.mjs +1 -1
- package/dist/{client-component.d-D74pqdea.d.mts → client-component.d-BvQOxSqh.d.mts} +2 -2
- package/dist/{client-component.d-D8VcypQA.d.ts → client-component.d-DNVSLEPi.d.ts} +2 -2
- package/dist/client-plugins.cjs +2 -2
- package/dist/{client-plugins.d-D4-6hNx7.d.mts → client-plugins.d-CE1lVK2R.d.mts} +116 -373
- package/dist/{client-plugins.d-CXElzotB.d.ts → client-plugins.d-CNDqcAuf.d.ts} +116 -373
- package/dist/client-plugins.d.mts +10 -8
- package/dist/client-plugins.d.ts +10 -8
- package/dist/client-plugins.mjs +1 -1
- package/dist/client.cjs +11 -9
- package/dist/client.d.mts +17 -15
- package/dist/client.d.ts +17 -15
- package/dist/client.mjs +10 -8
- package/dist/{config.d-qt-mE8O5.d.mts → config.d-BKIhJtmr.d.mts} +7 -2
- package/dist/{config.d-qt-mE8O5.d.ts → config.d-BKIhJtmr.d.ts} +7 -2
- package/dist/config.d.mts +10 -8
- package/dist/config.d.ts +10 -8
- package/dist/cron.cjs +2 -2
- package/dist/cron.mjs +1 -1
- package/dist/deferred.cjs +2 -2
- package/dist/deferred.mjs +1 -1
- package/dist/deployment.cjs +4 -2
- package/dist/deployment.d.mts +15 -1
- package/dist/deployment.d.ts +15 -1
- package/dist/deployment.mjs +3 -1
- package/dist/desktop.d.mts +11 -9
- package/dist/desktop.d.ts +11 -9
- package/dist/{devtools-NZUVNUP3.mjs → devtools-2A2GPC7B.mjs} +33 -29
- package/dist/{devtools-N2JQCMXB.cjs → devtools-R27T3BRY.cjs} +38 -34
- package/dist/docs.cjs +28 -27
- package/dist/docs.d.mts +24 -10
- package/dist/docs.d.ts +24 -10
- package/dist/docs.mjs +27 -26
- package/dist/env-types.cjs +3 -3
- package/dist/env-types.mjs +2 -2
- package/dist/environment/vite.cjs +7 -7
- package/dist/environment/vite.d.mts +1 -1
- package/dist/environment/vite.d.ts +1 -1
- package/dist/environment/vite.mjs +6 -6
- package/dist/{generate-route-types.d-BL2pq6xC.d.ts → generate-route-types.d-B76M5R11.d.ts} +1 -1
- package/dist/{generate-route-types.d-BoVDU8qX.d.mts → generate-route-types.d-CaGMIaNI.d.mts} +1 -1
- package/dist/headers.cjs +3 -3
- package/dist/headers.mjs +2 -2
- package/dist/image/server.d.mts +1 -1
- package/dist/image/server.d.ts +1 -1
- package/dist/image/sharp.d.mts +1 -1
- package/dist/image/sharp.d.ts +1 -1
- package/dist/{image-config.d-CeDgNyX4.d.mts → image-config.d-ByhQ0TT7.d.mts} +3 -1
- package/dist/{image-config.d-CeDgNyX4.d.ts → image-config.d-ByhQ0TT7.d.ts} +3 -1
- package/dist/image.cjs +6 -6
- package/dist/image.d.mts +1 -1
- package/dist/image.d.ts +1 -1
- package/dist/image.mjs +1 -1
- package/dist/index.cjs +148 -128
- package/dist/{index.d-SSgYDv4D.d.mts → index.d-Bt3kl19W.d.mts} +1 -1
- package/dist/{index.d-A_x10zGS.d.ts → index.d-Cx_-DaKV.d.ts} +1 -1
- package/dist/index.d.mts +39 -87
- package/dist/index.d.ts +39 -87
- package/dist/index.mjs +224 -204
- package/dist/instrumentation.cjs +3 -3
- package/dist/instrumentation.mjs +2 -2
- package/dist/{integration-orm-52GPGTHO.cjs → integrations/orm.cjs} +5 -5
- package/dist/integrations/orm.d.mts +35 -0
- package/dist/integrations/orm.d.ts +35 -0
- package/dist/{integration-orm-CO23MSFE.mjs → integrations/orm.mjs} +5 -5
- package/dist/integrations.cjs +6 -5
- package/dist/integrations.d.mts +10 -8
- package/dist/integrations.d.ts +10 -8
- package/dist/integrations.mjs +5 -4
- package/dist/internal/app-markdown-runtime.cjs +4 -4
- package/dist/internal/app-markdown-runtime.d.mts +27 -11
- package/dist/internal/app-markdown-runtime.d.ts +27 -11
- package/dist/internal/app-markdown-runtime.mjs +3 -3
- package/dist/internal/build-runtime.cjs +76 -71
- package/dist/internal/build-runtime.d.mts +12 -10
- package/dist/internal/build-runtime.d.ts +12 -10
- package/dist/internal/build-runtime.mjs +75 -70
- package/dist/internal/cli-runtime.cjs +47 -46
- package/dist/internal/cli-runtime.mjs +46 -45
- package/dist/internal/client-error-overlay.cjs +6 -6
- package/dist/internal/client-error-overlay.mjs +2 -2
- package/dist/internal/client-runtime.cjs +85 -36
- package/dist/internal/client-runtime.d.mts +44 -13
- package/dist/internal/client-runtime.d.ts +44 -13
- package/dist/internal/client-runtime.mjs +79 -30
- package/dist/internal/compression-runtime.d.mts +10 -8
- package/dist/internal/compression-runtime.d.ts +10 -8
- package/dist/internal/config-runtime.cjs +27 -26
- package/dist/internal/config-runtime.d.mts +14 -12
- package/dist/internal/config-runtime.d.ts +14 -12
- package/dist/internal/config-runtime.mjs +26 -25
- package/dist/internal/docs-precompiled-runtime.cjs +16 -5
- package/dist/internal/docs-precompiled-runtime.d.mts +7 -0
- package/dist/internal/docs-precompiled-runtime.d.ts +7 -0
- package/dist/internal/docs-precompiled-runtime.mjs +15 -4
- package/dist/internal/form-actions.cjs +7 -2
- package/dist/internal/form-actions.d.mts +10 -3
- package/dist/internal/form-actions.d.ts +10 -3
- package/dist/internal/form-actions.mjs +8 -3
- package/dist/internal/infra-analytics-runtime.cjs +11 -11
- package/dist/internal/infra-analytics-runtime.mjs +9 -9
- package/dist/internal/islands-boot.cjs +6 -1
- package/dist/internal/islands-boot.mjs +6 -1
- package/dist/internal/islands-runtime.cjs +33 -4
- package/dist/internal/islands-runtime.d.mts +1 -1
- package/dist/internal/islands-runtime.d.ts +1 -1
- package/dist/internal/islands-runtime.mjs +31 -2
- package/dist/internal/native-server-fns.cjs +5 -5
- package/dist/internal/native-server-fns.mjs +4 -4
- package/dist/internal/product-telemetry-runtime.cjs +3 -3
- package/dist/internal/product-telemetry-runtime.mjs +2 -2
- package/dist/internal/production-node-env.cjs +4 -2
- package/dist/internal/production-node-env.d.mts +22 -1
- package/dist/internal/production-node-env.d.ts +22 -1
- package/dist/internal/production-node-env.mjs +3 -1
- package/dist/internal/production-runtime.cjs +57 -39
- package/dist/internal/production-runtime.d.mts +27 -21
- package/dist/internal/production-runtime.d.ts +27 -21
- package/dist/internal/production-runtime.mjs +72 -54
- package/dist/internal/react-cache.cjs +3 -3
- package/dist/internal/react-cache.mjs +1 -1
- package/dist/internal/server-tree.cjs +2 -2
- package/dist/internal/server-tree.d.mts +0 -5
- package/dist/internal/server-tree.d.ts +0 -5
- package/dist/internal/server-tree.mjs +1 -1
- package/dist/internal/vercel-edge-middleware.cjs +87 -0
- package/dist/internal/vercel-edge-middleware.d.mts +39 -0
- package/dist/internal/vercel-edge-middleware.d.ts +39 -0
- package/dist/internal/vercel-edge-middleware.mjs +87 -0
- package/dist/layers-7P4RLKVX.cjs +20 -0
- package/dist/{layers-T55SA47E.mjs → layers-XQ7VFMWO.mjs} +4 -2
- package/dist/{layers.d-CcS42OGR.d.mts → layers.d-CH0bC4QL.d.mts} +2 -1
- package/dist/{layers.d-CcS42OGR.d.ts → layers.d-CH0bC4QL.d.ts} +2 -1
- package/dist/{lifecycle.d-C2aLBOwu.d.ts → lifecycle.d-keQs5Swc.d.mts} +7 -1
- package/dist/{lifecycle.d-C2aLBOwu.d.mts → lifecycle.d-keQs5Swc.d.ts} +7 -1
- package/dist/{manager-H5ZM3HAM.mjs → manager-JIA66YJ2.mjs} +4 -3
- package/dist/manager-JOHU6BQI.cjs +15 -0
- package/dist/markdown.cjs +7 -3
- package/dist/markdown.d.mts +10 -8
- package/dist/markdown.d.ts +10 -8
- package/dist/markdown.mjs +6 -2
- package/dist/middleware.cjs +11 -11
- package/dist/middleware.d.mts +13 -10
- package/dist/middleware.d.ts +13 -10
- package/dist/middleware.mjs +13 -13
- package/dist/mobile.d.mts +6 -6
- package/dist/mobile.d.ts +6 -6
- package/dist/mount.d-Bki4pOaJ.d.mts +38 -0
- package/dist/mount.d-DjR5aerM.d.ts +38 -0
- package/dist/{native-server-fn-handler-GLRHAYWV.mjs → native-server-fn-handler-EP5AFJYE.mjs} +5 -5
- package/dist/{native-server-fn-handler-J5MYRXN6.cjs → native-server-fn-handler-QRTXGZA4.cjs} +6 -6
- package/dist/{native-tree-7LPH57Z4.cjs → native-tree-W2SSJB3Y.cjs} +4 -4
- package/dist/{native-tree-VV6WN3GX.mjs → native-tree-Y5YQANW7.mjs} +3 -3
- package/dist/{navigation-delegate.d-GghbHJuK.d.ts → navigation-delegate.d-CtghaSP3.d.ts} +1 -1
- package/dist/{navigation-delegate.d-DQVYKoaZ.d.mts → navigation-delegate.d-VDkziXTK.d.mts} +1 -1
- package/dist/navigation.cjs +8 -7
- package/dist/navigation.d.mts +13 -11
- package/dist/navigation.d.ts +13 -11
- package/dist/navigation.mjs +7 -6
- package/dist/{nitro-DD4QCA66.mjs → nitro-NSTXT7LB.mjs} +11 -11
- package/dist/{nitro-VRDX2H4M.cjs → nitro-Y3LGITW3.cjs} +13 -13
- package/dist/node-module-bundle-LIZ2KMVW.cjs +13 -0
- package/dist/node-module-bundle-VR6NV6AI.mjs +13 -0
- package/dist/{plugin-53SY5YBS.mjs → plugin-SAS22JL7.mjs} +4 -3
- package/dist/{plugin-HZIBL3DW.cjs → plugin-WIU4GDD4.cjs} +5 -4
- package/dist/plugin.cjs +65 -63
- package/dist/plugin.d.mts +12 -10
- package/dist/plugin.d.ts +12 -10
- package/dist/plugin.mjs +64 -62
- package/dist/{production-runtime.d-Bzns3NW9.d.ts → production-runtime.d-BMyyLGBB.d.ts} +3 -57
- package/dist/{production-runtime.d-DiFa5vHW.d.mts → production-runtime.d-DMZY3OgV.d.mts} +3 -57
- package/dist/query/client.cjs +9 -7
- package/dist/query/client.mjs +5 -3
- package/dist/{render-plan.d-CcF0MeCf.d.mts → render-plan.d-BSwV8PE4.d.mts} +1 -1
- package/dist/{render-plan.d-CL_Ikfg_.d.ts → render-plan.d-i9sI4tc9.d.ts} +1 -1
- package/dist/renderer/none/server.cjs +35 -0
- package/dist/renderer/none/server.d.mts +21 -0
- package/dist/renderer/none/server.d.ts +21 -0
- package/dist/renderer/none/server.mjs +35 -0
- package/dist/renderer/react/server.cjs +3 -3
- package/dist/renderer/react/server.mjs +3 -3
- package/dist/renderer-client.cjs +8 -6
- package/dist/renderer-client.d.mts +13 -11
- package/dist/renderer-client.d.ts +13 -11
- package/dist/renderer-client.mjs +5 -3
- package/dist/renderer.cjs +6 -2
- package/dist/renderer.d.mts +25 -2
- package/dist/renderer.d.ts +25 -2
- package/dist/renderer.mjs +5 -1
- package/dist/request.cjs +2 -2
- package/dist/{request.d-DarDOCk9.d.mts → request.d-C24FNQ_7.d.mts} +1 -1
- package/dist/{request.d-B1RnTLri.d.ts → request.d-Dgln8tuI.d.ts} +1 -1
- package/dist/request.d.mts +11 -9
- package/dist/request.d.ts +11 -9
- package/dist/request.mjs +1 -1
- package/dist/{route-rendering.d-BTUYCIj4.d.ts → route-rendering.d-CUylZKJA.d.ts} +1 -1
- package/dist/{route-rendering.d-D_2Ual0-.d.mts → route-rendering.d-Ds0BfwQi.d.mts} +1 -1
- package/dist/{route.d-BaVH3V0w.d.mts → route.d-DrXkpvcg.d.mts} +1 -1
- package/dist/{route.d-DBTEqifW.d.ts → route.d-hs-_cyHn.d.ts} +1 -1
- package/dist/{router.d-CMANF6da.d.ts → router.d-B56rMOFm.d.ts} +1 -1
- package/dist/{router.d-Cuv1jntg.d.mts → router.d-CFPcbqzc.d.mts} +1 -1
- package/dist/routes.cjs +3 -3
- package/dist/{routes.d-B6yFe6jm.d.ts → routes.d-9GFFNioh.d.ts} +2 -2
- package/dist/{routes.d-c2HKfrfL.d.mts → routes.d-CrEy0lJS.d.mts} +2 -2
- package/dist/routes.d.mts +10 -8
- package/dist/routes.d.ts +10 -8
- package/dist/routes.mjs +2 -2
- package/dist/{rsc-pipeline-Z7QBZOIJ.cjs → rsc-pipeline-3T7V6OUT.cjs} +30 -28
- package/dist/{rsc-pipeline-7PNVJSTR.mjs → rsc-pipeline-GA4AQWZI.mjs} +29 -27
- package/dist/{runtime-FKFCUHSK.cjs → runtime-REUTNTI5.cjs} +72 -46
- package/dist/{runtime-QQHX4BP3.mjs → runtime-ZYCKKY7L.mjs} +60 -34
- package/dist/{runtime.d-wvh4ngU0.d.mts → runtime.d-DLRO-ExG.d.mts} +11 -3
- package/dist/{runtime.d-C3RQUj6_.d.ts → runtime.d-H7k9hOQE.d.ts} +11 -3
- package/dist/{schema-dev-notice-JMXEQWIQ.mjs → schema-dev-notice-C2JINRZI.mjs} +3 -2
- package/dist/{schema-dev-notice-PLBFDTOF.cjs → schema-dev-notice-X7GG7QVB.cjs} +5 -4
- package/dist/schema.cjs +6 -2
- package/dist/schema.d-Dny9pnrm.d.mts +298 -0
- package/dist/schema.d-Dny9pnrm.d.ts +298 -0
- package/dist/schema.d.mts +1 -115
- package/dist/schema.d.ts +1 -115
- package/dist/schema.mjs +5 -1
- package/dist/server-fn-client.d.mts +2 -2
- package/dist/server-fn-client.d.ts +2 -2
- package/dist/server-fn.cjs +5 -5
- package/dist/server-fn.mjs +4 -4
- package/dist/server-http.d-rAe7lAQc.d.mts +70 -0
- package/dist/server-http.d-rAe7lAQc.d.ts +70 -0
- package/dist/server-plugins.cjs +7 -7
- package/dist/server-plugins.d.mts +20 -12
- package/dist/server-plugins.d.ts +20 -12
- package/dist/server-plugins.mjs +8 -8
- package/dist/server-query.cjs +6 -6
- package/dist/server-query.mjs +5 -5
- package/dist/server.cjs +168 -126
- package/dist/server.d-C5FFrZAo.d.ts +57 -0
- package/dist/server.d-DgC8xew5.d.mts +57 -0
- package/dist/server.d.mts +24 -16
- package/dist/server.d.ts +24 -16
- package/dist/server.mjs +144 -102
- package/dist/{spa-router.d-m8H_Kl_B.d.ts → spa-router.d-Dr7oanhl.d.ts} +15 -5
- package/dist/{spa-router.d-WU_qS5gJ.d.mts → spa-router.d-g4CzhEH1.d.mts} +15 -5
- package/dist/testing.cjs +17 -17
- package/dist/testing.d.mts +10 -8
- package/dist/testing.d.ts +10 -8
- package/dist/testing.mjs +13 -13
- package/dist/theme/server.cjs +3 -3
- package/dist/theme/server.mjs +2 -2
- package/dist/types.d-xCIhyjOq.d.mts +233 -0
- package/dist/types.d-xCIhyjOq.d.ts +233 -0
- package/dist/{utils.d-C9dQD5Zg.d.ts → utils.d-BxxyDEb8.d.ts} +1 -1
- package/dist/{utils.d-W9IiEqmW.d.mts → utils.d-HIla3pD_.d.mts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +65 -63
- package/dist/vite.d.mts +36 -14
- package/dist/vite.d.ts +36 -14
- package/dist/vite.mjs +64 -62
- package/dist/workflows.cjs +4 -4
- package/dist/workflows.d.mts +121 -1
- package/dist/workflows.d.ts +121 -1
- package/dist/workflows.mjs +3 -3
- package/package.json +37 -2
- package/dist/analyzer-H7SIX6BJ.cjs +0 -16
- package/dist/chunk-5YPBFMBN.cjs +0 -19
- package/dist/chunk-CLFEQGET.cjs +0 -60
- package/dist/chunk-MK5E44WP.mjs +0 -60
- package/dist/chunk-OM7WILES.mjs +0 -100
- package/dist/chunk-Q5B4LNON.mjs +0 -19
- package/dist/chunk-QPJ4MZTO.mjs +0 -60
- package/dist/chunk-R53QDV6T.cjs +0 -100
- package/dist/chunk-UYTAP4FQ.cjs +0 -60
- package/dist/layers-DMRXRL7F.cjs +0 -18
- package/dist/manager-2LUKNX2N.cjs +0 -14
- package/dist/node-module-bundle-7JHPPF6B.mjs +0 -11
- package/dist/node-module-bundle-YJGYBOGK.cjs +0 -11
- package/dist/workflows.d-CRMzQZ3k.d.mts +0 -188
- package/dist/workflows.d-CRMzQZ3k.d.ts +0 -188
- /package/dist/{chunk-QGOZLGVP.mjs → chunk-I6FIAWNT.mjs} +0 -0
- /package/dist/{chunk-XPIPMWY3.cjs → chunk-K5NI5YQR.cjs} +0 -0
- /package/dist/{chunk-NWUHS6GV.cjs → chunk-QEJWNXRI.cjs} +0 -0
- /package/dist/{chunk-FSXSQQTV.mjs → chunk-TXE4SAMV.mjs} +0 -0
- /package/dist/{chunk-ZXK2EYQW.cjs → chunk-UUQNJDGH.cjs} +0 -0
- /package/dist/{chunk-46P5KNTE.mjs → chunk-VZBAW44S.mjs} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkCL52PD6Dcjs = require('./chunk-CL52PD6D.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
@@ -64,14 +64,14 @@ async function handleFarmNativeServerFnRequest(request, options, parsed) {
|
|
|
64
64
|
return refuse(400, "invalid_body", "The input has a key that is not allowed.");
|
|
65
65
|
}
|
|
66
66
|
const fn = await options.resolve(call.id);
|
|
67
|
-
if (fn === void 0 ||
|
|
67
|
+
if (fn === void 0 || _chunkCL52PD6Dcjs._describeServerFunction.call(void 0, fn) === void 0) {
|
|
68
68
|
return refuse(
|
|
69
69
|
404,
|
|
70
70
|
"unknown_function",
|
|
71
71
|
"No server function with this id is open to native screens."
|
|
72
72
|
);
|
|
73
73
|
}
|
|
74
|
-
const outcome = await
|
|
74
|
+
const outcome = await _chunkCL52PD6Dcjs._invokeServerFunction.call(void 0, fn, call.input, request);
|
|
75
75
|
if (outcome.ok) {
|
|
76
76
|
try {
|
|
77
77
|
return json(200, { data: _nullishCoalesce(outcome.data, () => ( null)) });
|
|
@@ -1,18 +1,23 @@
|
|
|
1
1
|
import {
|
|
2
|
+
buildFarmDocsSitemapManifest,
|
|
2
3
|
discoverFarmDocsPages,
|
|
3
4
|
getFarmDocsMarkdownPath,
|
|
5
|
+
getFarmDocsPublicEntry,
|
|
4
6
|
getFarmDocsRoots,
|
|
7
|
+
getFarmDocsSiteUrl,
|
|
5
8
|
loadFarmDocsPage,
|
|
9
|
+
renderFarmDocsRobotsTxt,
|
|
6
10
|
resolveFarmDocsContentDir,
|
|
7
|
-
toFarmDocsMarkdownPage
|
|
8
|
-
|
|
11
|
+
toFarmDocsMarkdownPage,
|
|
12
|
+
toFarmDocsPublicSitemapConfig
|
|
13
|
+
} from "./chunk-5FBZJJGA.mjs";
|
|
9
14
|
import {
|
|
10
15
|
docsEngine,
|
|
11
16
|
loadFarmDocsEngine
|
|
12
17
|
} from "./chunk-VE3FWJBO.mjs";
|
|
13
18
|
import {
|
|
14
19
|
resolveDocsConfig
|
|
15
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-NT4W4H52.mjs";
|
|
16
21
|
import {
|
|
17
22
|
getFarmDocsAdapterConfigModule,
|
|
18
23
|
isSecretDocsConfigKey
|
|
@@ -20,6 +25,10 @@ import {
|
|
|
20
25
|
import {
|
|
21
26
|
cloneFarmRequest
|
|
22
27
|
} from "./chunk-QDWMCFTH.mjs";
|
|
28
|
+
import {
|
|
29
|
+
applyFarmBasePath,
|
|
30
|
+
normalizeFarmBasePath
|
|
31
|
+
} from "./chunk-SF3JB56B.mjs";
|
|
23
32
|
|
|
24
33
|
// src/docs/adapter.ts
|
|
25
34
|
import { createRequire } from "module";
|
|
@@ -28,12 +37,24 @@ import { pathToFileURL } from "url";
|
|
|
28
37
|
function hasFarmDocsRuntimeAdapter(docs) {
|
|
29
38
|
return Boolean(docs?.enabled && docs.adapter?.server && docs.adapter.react);
|
|
30
39
|
}
|
|
31
|
-
function
|
|
40
|
+
function farmDocsAdapterServesGuardedPages(docs) {
|
|
41
|
+
return Boolean(
|
|
42
|
+
hasFarmDocsRuntimeAdapter(docs) && docs.adapter.capabilities?.includes("guarded-pages")
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
function assertFarmDocsAdapterServesNoGuardedPages(docs, options, isPathGuarded, runtime = "node") {
|
|
32
46
|
if (!isPathGuarded || !hasFarmDocsRuntimeAdapter(docs)) return;
|
|
47
|
+
const servesGuardedPages = farmDocsAdapterServesGuardedPages(docs);
|
|
48
|
+
if (servesGuardedPages && runtime !== "edge") return;
|
|
33
49
|
const guarded = getFarmDocsRoots(docs).flatMap((root) => discoverFarmDocsPages(resolveFarmDocsContentDir(root, options), root)).filter((page) => isPathGuarded(page.href) || isPathGuarded(getFarmDocsMarkdownPath(page.href))).map((page) => page.href);
|
|
34
50
|
if (guarded.length === 0) return;
|
|
51
|
+
if (servesGuardedPages) {
|
|
52
|
+
throw new Error(
|
|
53
|
+
`Docs pages behind a path guard (${guarded.join(", ")}) would be public on an edge target: the docs adapter ${JSON.stringify(docs.adapter.id)} serves a build-time snapshot of their content in llms-full.txt, search, Markdown, and MCP, where no guard runs. Deploy to a Node or serverless target, or move those pages out of the docs content directory.`
|
|
54
|
+
);
|
|
55
|
+
}
|
|
35
56
|
throw new Error(
|
|
36
|
-
`Docs pages behind a path guard (${guarded.join(", ")}) would be public: the docs adapter ${JSON.stringify(docs.adapter.id)} serves their content in llms-full.txt, search, Markdown, and MCP without running the app's guards.
|
|
57
|
+
`Docs pages behind a path guard (${guarded.join(", ")}) would be public: the docs adapter ${JSON.stringify(docs.adapter.id)} serves their content in llms-full.txt, search, Markdown, and MCP without running the app's guards. Upgrade the adapter to a release that keeps guarded pages off those surfaces (@farming-labs/farmjs declares it as the \`guarded-pages\` capability), move those pages out of the docs content directory, or set docs.adapter = false to use Farm's built-in docs runtime, which keeps guarded pages off anonymous surfaces.`
|
|
37
58
|
);
|
|
38
59
|
}
|
|
39
60
|
async function loadFarmDocsConfigModule(docs, loadModule) {
|
|
@@ -158,7 +179,8 @@ async function createFarmDocsAdapterHandler(docs, options) {
|
|
|
158
179
|
stylesheets: getFarmDocsAdapterStylesheets(options),
|
|
159
180
|
resolveLayoutFonts: options.resolveLayoutFonts,
|
|
160
181
|
loadReactModule: () => options.loadModule(docs.adapter.react),
|
|
161
|
-
...options.registerMCPServer ? { registerMCPServer: options.registerMCPServer } : {}
|
|
182
|
+
...options.registerMCPServer ? { registerMCPServer: options.registerMCPServer } : {},
|
|
183
|
+
...options.isPathGuarded && farmDocsAdapterServesGuardedPages(docs) ? { isPathGuarded: options.isPathGuarded } : {}
|
|
162
184
|
};
|
|
163
185
|
if (multiRoot) {
|
|
164
186
|
return serverModule.createFarmDocsMultiRuntimeHandler(
|
|
@@ -310,15 +332,9 @@ function getDocsDescription(docs) {
|
|
|
310
332
|
function getLoadedDocsPages(context) {
|
|
311
333
|
return discoverFarmDocsPages(context.contentDir, context.docs).filter((page) => !context.isPathGuarded(page.href)).map((page) => loadFarmDocsPage(context.contentDir, context.docs, page.slug)).filter((page) => Boolean(page));
|
|
312
334
|
}
|
|
313
|
-
function toDocsSourcePage(page) {
|
|
335
|
+
function toDocsSourcePage(page, basePath) {
|
|
314
336
|
return {
|
|
315
|
-
...toFarmDocsMarkdownPage(page),
|
|
316
|
-
sourcePath: page.sourcePath
|
|
317
|
-
};
|
|
318
|
-
}
|
|
319
|
-
function toDocsSitemapPage(page) {
|
|
320
|
-
return {
|
|
321
|
-
...toFarmDocsMarkdownPage(page),
|
|
337
|
+
...toFarmDocsMarkdownPage(page, basePath),
|
|
322
338
|
sourcePath: page.sourcePath
|
|
323
339
|
};
|
|
324
340
|
}
|
|
@@ -329,7 +345,7 @@ function getDocsLlmsOptions(context, request) {
|
|
|
329
345
|
const configured = isRecord(context.docs.config.llmsTxt) ? context.docs.config.llmsTxt : {};
|
|
330
346
|
return {
|
|
331
347
|
enabled: true,
|
|
332
|
-
baseUrl:
|
|
348
|
+
baseUrl: getFarmDocsSiteUrl(request, context.basePath),
|
|
333
349
|
siteTitle: getDocsTitle(context.docs),
|
|
334
350
|
siteDescription: getDocsDescription(context.docs),
|
|
335
351
|
...configured
|
|
@@ -370,13 +386,12 @@ function getDocsDiscoveryOptions(context, request) {
|
|
|
370
386
|
};
|
|
371
387
|
}
|
|
372
388
|
function buildSitemapManifest(context, request) {
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
});
|
|
389
|
+
return buildFarmDocsSitemapManifest(
|
|
390
|
+
getLoadedDocsPages(context),
|
|
391
|
+
context.docs,
|
|
392
|
+
new URL(request.url).origin,
|
|
393
|
+
context.basePath
|
|
394
|
+
);
|
|
380
395
|
}
|
|
381
396
|
function renderLlmsTxt(context, request, full) {
|
|
382
397
|
const generated = docsEngine().renderDocsLlmsTxt(
|
|
@@ -426,7 +441,7 @@ function buildAgentSpec(context, request) {
|
|
|
426
441
|
},
|
|
427
442
|
entry: context.docs.entry,
|
|
428
443
|
routes: {
|
|
429
|
-
docs: `${origin}${context.docs.
|
|
444
|
+
docs: `${origin}${getFarmDocsPublicEntry(context.docs, context.basePath)}`,
|
|
430
445
|
config: `${origin}/api/docs?format=config`,
|
|
431
446
|
search: `${origin}/api/docs?query=<term>`,
|
|
432
447
|
markdown: `${origin}/api/docs/<slug>.md`,
|
|
@@ -450,7 +465,8 @@ function buildAgentSpec(context, request) {
|
|
|
450
465
|
post: false
|
|
451
466
|
},
|
|
452
467
|
// Same root-relative source paths the precompiled runtime serves.
|
|
453
|
-
pages: pages.map(({ sourcePath, ...
|
|
468
|
+
pages: pages.map(({ sourcePath, ...route }) => {
|
|
469
|
+
const page = { ...route, href: applyFarmBasePath(route.href, context.basePath) };
|
|
454
470
|
const publicSourcePath = toPublicDocsPath(sourcePath, context.root);
|
|
455
471
|
return publicSourcePath ? { ...page, sourcePath: `./${publicSourcePath}` } : page;
|
|
456
472
|
})
|
|
@@ -532,7 +548,7 @@ function buildDiagnostics(context) {
|
|
|
532
548
|
}
|
|
533
549
|
async function searchDocs(context, request, query) {
|
|
534
550
|
const loadedPages = getLoadedDocsPages(context);
|
|
535
|
-
const sourcePages = loadedPages.map(toDocsSourcePage);
|
|
551
|
+
const sourcePages = loadedPages.map((page) => toDocsSourcePage(page, context.basePath));
|
|
536
552
|
const sourcePageByUrl = new Map(sourcePages.map((page) => [page.url, page]));
|
|
537
553
|
const resultLimit = isRecord(context.docs.config.search) && typeof context.docs.config.search.maxResults === "number" ? context.docs.config.search.maxResults : void 0;
|
|
538
554
|
const results = await docsEngine().performDocsSearch({
|
|
@@ -576,7 +592,8 @@ async function resolveAPIContext(options) {
|
|
|
576
592
|
docs,
|
|
577
593
|
contentDir: resolveFarmDocsContentDir(docs, { root, srcDir }),
|
|
578
594
|
diagnostics: options.diagnostics === true,
|
|
579
|
-
isPathGuarded: options.isPathGuarded ?? ((pathname) => guardedPaths.has(pathname))
|
|
595
|
+
isPathGuarded: options.isPathGuarded ?? ((pathname) => guardedPaths.has(pathname)),
|
|
596
|
+
basePath: normalizeFarmBasePath(options.basePath ?? runtimeConfig?.basePath)
|
|
580
597
|
};
|
|
581
598
|
}
|
|
582
599
|
async function handleDocsAPIGet(request, context) {
|
|
@@ -621,12 +638,7 @@ async function handleDocsAPIGet(request, context) {
|
|
|
621
638
|
}
|
|
622
639
|
if (format === "robots") {
|
|
623
640
|
return text(
|
|
624
|
-
|
|
625
|
-
entry: context.docs.entry,
|
|
626
|
-
sitemap: context.docs.config.sitemap ?? true,
|
|
627
|
-
robots: context.docs.config.robots ?? true,
|
|
628
|
-
baseUrl: new URL(request.url).origin
|
|
629
|
-
}),
|
|
641
|
+
renderFarmDocsRobotsTxt(context.docs, new URL(request.url).origin, context.basePath),
|
|
630
642
|
"text/plain; charset=utf-8"
|
|
631
643
|
);
|
|
632
644
|
}
|
|
@@ -638,10 +650,10 @@ async function handleDocsAPIGet(request, context) {
|
|
|
638
650
|
return text("Docs page not found\n", "text/plain; charset=utf-8", { status: 404 });
|
|
639
651
|
}
|
|
640
652
|
return text(
|
|
641
|
-
docsEngine().renderDocsMarkdownDocument(toFarmDocsMarkdownPage(page), {
|
|
653
|
+
docsEngine().renderDocsMarkdownDocument(toFarmDocsMarkdownPage(page, context.basePath), {
|
|
642
654
|
origin: new URL(request.url).origin,
|
|
643
655
|
llms: getDocsLlmsOptions(context, request),
|
|
644
|
-
sitemap: context.docs.config.sitemap
|
|
656
|
+
sitemap: toFarmDocsPublicSitemapConfig(context.docs.config.sitemap, context.basePath)
|
|
645
657
|
}),
|
|
646
658
|
"text/markdown; charset=utf-8"
|
|
647
659
|
);
|
|
@@ -705,6 +717,7 @@ function createFarmDocsAPIHandler(options = {}, cloudIntegration) {
|
|
|
705
717
|
|
|
706
718
|
export {
|
|
707
719
|
hasFarmDocsRuntimeAdapter,
|
|
720
|
+
farmDocsAdapterServesGuardedPages,
|
|
708
721
|
assertFarmDocsAdapterServesNoGuardedPages,
|
|
709
722
|
getFarmDocsConfigModuleRoot,
|
|
710
723
|
compileFarmDocsAdapterEdgeManifest,
|
|
@@ -9,13 +9,15 @@ import {
|
|
|
9
9
|
} from "./chunk-M53MIIXY.mjs";
|
|
10
10
|
import {
|
|
11
11
|
defineSchema
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-VZBAW44S.mjs";
|
|
13
13
|
import {
|
|
14
14
|
assertSupportedMiddlewareMatcher
|
|
15
15
|
} from "./chunk-EDPENAVO.mjs";
|
|
16
16
|
import {
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
rejectCrossSiteNonJSONBody,
|
|
18
|
+
toPublicValidationIssues,
|
|
19
|
+
validateIntegrationRequestOrigin
|
|
20
|
+
} from "./chunk-GJEC5S4V.mjs";
|
|
19
21
|
import {
|
|
20
22
|
applyWebResponseHeaders,
|
|
21
23
|
sendWebResponse
|
|
@@ -42,7 +44,7 @@ import {
|
|
|
42
44
|
} from "./chunk-GYMGK467.mjs";
|
|
43
45
|
import {
|
|
44
46
|
validateConfigRouteSource
|
|
45
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-JZGL2PIH.mjs";
|
|
46
48
|
import {
|
|
47
49
|
canonicalizeRequestPathSegments
|
|
48
50
|
} from "./chunk-OHWM2VI4.mjs";
|
|
@@ -1156,6 +1158,7 @@ function normalizeIntegrationRouteInputSchemas(route) {
|
|
|
1156
1158
|
}
|
|
1157
1159
|
return input.body || input.query ? input : void 0;
|
|
1158
1160
|
}
|
|
1161
|
+
var CROSS_SITE_JSON_ROUTE_BODY_MESSAGE = 'This integration route reads a JSON body, so a request from another origin must send Content-Type: application/json. To accept form posts from other origins, set bodyFormat: "form" on the route.';
|
|
1159
1162
|
async function validateIntegrationRouteInput(route, request, url) {
|
|
1160
1163
|
if (request.method.toUpperCase() === "QUERY" && !request.headers.has("content-type")) {
|
|
1161
1164
|
return {
|
|
@@ -1176,6 +1179,11 @@ async function validateIntegrationRouteInput(route, request, url) {
|
|
|
1176
1179
|
input: {}
|
|
1177
1180
|
};
|
|
1178
1181
|
}
|
|
1182
|
+
const bodyFormat = getIntegrationRouteBodyFormat(route);
|
|
1183
|
+
if (schemas.body && bodyFormat === "json" && request.method !== "GET" && request.method !== "HEAD") {
|
|
1184
|
+
const rejection = rejectCrossSiteNonJSONBody(request, CROSS_SITE_JSON_ROUTE_BODY_MESSAGE);
|
|
1185
|
+
if (rejection) return { success: false, response: rejection };
|
|
1186
|
+
}
|
|
1179
1187
|
const input = {};
|
|
1180
1188
|
const issues = [];
|
|
1181
1189
|
if (schemas.query) {
|
|
@@ -1191,10 +1199,7 @@ async function validateIntegrationRouteInput(route, request, url) {
|
|
|
1191
1199
|
}
|
|
1192
1200
|
}
|
|
1193
1201
|
if (schemas.body) {
|
|
1194
|
-
const bodyInput = await readIntegrationValidationBody(
|
|
1195
|
-
request,
|
|
1196
|
-
getIntegrationRouteBodyFormat(route)
|
|
1197
|
-
);
|
|
1202
|
+
const bodyInput = await readIntegrationValidationBody(request, bodyFormat);
|
|
1198
1203
|
if (bodyInput.success) {
|
|
1199
1204
|
const bodyResult = await parseIntegrationInputSchema("body", schemas.body, bodyInput.data);
|
|
1200
1205
|
if (bodyResult.success) {
|
|
@@ -1331,6 +1336,12 @@ async function readIntegrationValidationBody(request, format) {
|
|
|
1331
1336
|
data: void 0
|
|
1332
1337
|
};
|
|
1333
1338
|
}
|
|
1339
|
+
if (!request.headers.get("content-type")?.trim() && !validateIntegrationRequestOrigin(request, { requireOriginMetadata: false }).ok) {
|
|
1340
|
+
return {
|
|
1341
|
+
success: true,
|
|
1342
|
+
data: void 0
|
|
1343
|
+
};
|
|
1344
|
+
}
|
|
1334
1345
|
return {
|
|
1335
1346
|
success: true,
|
|
1336
1347
|
data: JSON.parse(text)
|
|
@@ -1364,7 +1375,7 @@ function createIntegrationRouteArgs(input) {
|
|
|
1364
1375
|
`Integration "${input.integration.type}" does not define a schema for ctx.args.db.`
|
|
1365
1376
|
);
|
|
1366
1377
|
}
|
|
1367
|
-
ormPromise ?? (ormPromise = import("./
|
|
1378
|
+
ormPromise ?? (ormPromise = import("./integrations/orm.mjs").then(
|
|
1368
1379
|
({ createIntegrationOrm }) => createIntegrationOrm({
|
|
1369
1380
|
schema: input.integration.schema,
|
|
1370
1381
|
config: input.config
|
|
@@ -6,19 +6,23 @@ var _chunkHXNLKCWHcjs = require('./chunk-HXNLKCWH.cjs');
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var _chunk6XQSPIN6cjs = require('./chunk-6XQSPIN6.cjs');
|
|
10
9
|
|
|
10
|
+
var _chunkPWKAX5MScjs = require('./chunk-PWKAX5MS.cjs');
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
|
|
13
|
+
var _chunkHDPT6OYEcjs = require('./chunk-HDPT6OYE.cjs');
|
|
13
14
|
|
|
14
15
|
|
|
15
|
-
var
|
|
16
|
+
var _chunk7JUIK547cjs = require('./chunk-7JUIK547.cjs');
|
|
16
17
|
|
|
17
18
|
// src/plugins/redirects.ts
|
|
19
|
+
var FARM_CONFIG_REDIRECTS_PLUGIN_NAME = "farm:redirects";
|
|
20
|
+
var configRedirectMatchers = /* @__PURE__ */ new WeakMap();
|
|
18
21
|
function createRedirectsPlugin(redirects, {
|
|
19
22
|
beforeRequest: overrideBeforeRequest,
|
|
20
23
|
afterResponse: overrideAfterResponse,
|
|
21
|
-
i18n
|
|
24
|
+
i18n,
|
|
25
|
+
basePath
|
|
22
26
|
} = {}) {
|
|
23
27
|
for (const redirect of redirects) {
|
|
24
28
|
if (redirect.statusCode !== void 0 && !_chunk7JUIK547cjs.isFarmRedirectStatus.call(void 0, redirect.statusCode)) {
|
|
@@ -29,35 +33,40 @@ function createRedirectsPlugin(redirects, {
|
|
|
29
33
|
}
|
|
30
34
|
const compiledRedirects = redirects.map((redirect) => ({
|
|
31
35
|
redirect,
|
|
32
|
-
pattern:
|
|
36
|
+
pattern: _chunkPWKAX5MScjs.compileConfigRoutePattern.call(void 0, redirect.source)
|
|
33
37
|
}));
|
|
34
|
-
|
|
35
|
-
|
|
38
|
+
const matchRedirect = (url) => {
|
|
39
|
+
const routePath = _chunkPWKAX5MScjs.resolveConfigRoutePathname.call(void 0, url.pathname, i18n, basePath);
|
|
40
|
+
for (const { redirect, pattern } of compiledRedirects) {
|
|
41
|
+
const match = routePath.pathname.match(pattern.regex);
|
|
42
|
+
if (!match) continue;
|
|
43
|
+
const localizedDestination = _chunkPWKAX5MScjs.resolveConfigRedirectDestination.call(void 0,
|
|
44
|
+
_chunkPWKAX5MScjs.interpolateConfigRouteDestination.call(void 0, redirect.destination, match, pattern.tokens),
|
|
45
|
+
routePath.locale,
|
|
46
|
+
i18n,
|
|
47
|
+
basePath
|
|
48
|
+
);
|
|
49
|
+
return {
|
|
50
|
+
destination: _chunkHXNLKCWHcjs.appendFarmRedirectQuery.call(void 0, localizedDestination, url.search),
|
|
51
|
+
statusCode: _nullishCoalesce(redirect.statusCode, () => ( (redirect.permanent ? 308 : 307)))
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
return null;
|
|
55
|
+
};
|
|
56
|
+
const plugin = {
|
|
57
|
+
name: FARM_CONFIG_REDIRECTS_PLUGIN_NAME,
|
|
36
58
|
enforce: "pre",
|
|
37
59
|
async beforeRequest(req, res, context) {
|
|
38
60
|
if (overrideBeforeRequest) {
|
|
39
61
|
await overrideBeforeRequest(req, res, context);
|
|
40
62
|
}
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
_chunk6XQSPIN6cjs.interpolateConfigRouteDestination.call(void 0, redirect.destination, match, pattern.tokens),
|
|
49
|
-
routePath.locale,
|
|
50
|
-
i18n
|
|
51
|
-
);
|
|
52
|
-
const destination = _chunkHXNLKCWHcjs.appendFarmRedirectQuery.call(void 0, localizedDestination, url.search);
|
|
53
|
-
const statusCode = _nullishCoalesce(redirect.statusCode, () => ( (redirect.permanent ? 308 : 307)));
|
|
54
|
-
res.writeHead(statusCode, {
|
|
55
|
-
Location: destination
|
|
56
|
-
});
|
|
57
|
-
res.end();
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
63
|
+
const redirect = matchRedirect(_chunkHDPT6OYEcjs.resolveFarmRequestURL.call(void 0, req));
|
|
64
|
+
if (!redirect) return;
|
|
65
|
+
res.setHeader("Content-Type", "text/plain;charset=UTF-8");
|
|
66
|
+
res.writeHead(redirect.statusCode, {
|
|
67
|
+
Location: redirect.destination
|
|
68
|
+
});
|
|
69
|
+
res.end(`Redirecting to ${redirect.destination}`);
|
|
61
70
|
},
|
|
62
71
|
async afterResponse(req, res, context) {
|
|
63
72
|
if (overrideAfterResponse) {
|
|
@@ -65,9 +74,15 @@ function createRedirectsPlugin(redirects, {
|
|
|
65
74
|
}
|
|
66
75
|
}
|
|
67
76
|
};
|
|
77
|
+
configRedirectMatchers.set(plugin, matchRedirect);
|
|
78
|
+
return plugin;
|
|
79
|
+
}
|
|
80
|
+
function getConfigRedirectMatcher(plugin) {
|
|
81
|
+
return configRedirectMatchers.get(plugin);
|
|
68
82
|
}
|
|
69
83
|
|
|
70
84
|
// src/plugins/headers.ts
|
|
85
|
+
var FARM_CONFIG_HEADERS_PLUGIN_NAME = "farm:headers";
|
|
71
86
|
var FARM_CONFIG_HEADERS_FINALIZER = /* @__PURE__ */ Symbol.for("farm.configHeadersFinalizer");
|
|
72
87
|
function appendConfiguredLinkHeader(res, value) {
|
|
73
88
|
const current = res.getHeader("Link");
|
|
@@ -132,21 +147,22 @@ function applyWriteHeadHeaders(res, headers) {
|
|
|
132
147
|
function createHeadersPlugin(headers, {
|
|
133
148
|
beforeRequest: overrideBeforeRequest,
|
|
134
149
|
afterResponse: overrideAfterResponse,
|
|
135
|
-
i18n
|
|
150
|
+
i18n,
|
|
151
|
+
basePath
|
|
136
152
|
} = {}) {
|
|
137
153
|
const compiledHeaders = headers.map((config) => ({
|
|
138
154
|
config,
|
|
139
|
-
pattern:
|
|
155
|
+
pattern: _chunkPWKAX5MScjs.compileConfigRoutePattern.call(void 0, config.source)
|
|
140
156
|
}));
|
|
141
157
|
return {
|
|
142
|
-
name:
|
|
158
|
+
name: FARM_CONFIG_HEADERS_PLUGIN_NAME,
|
|
143
159
|
enforce: "pre",
|
|
144
160
|
async beforeRequest(req, res, context) {
|
|
145
161
|
if (overrideBeforeRequest) {
|
|
146
162
|
await overrideBeforeRequest(req, res, context);
|
|
147
163
|
}
|
|
148
|
-
const url =
|
|
149
|
-
const pathname =
|
|
164
|
+
const url = _chunkHDPT6OYEcjs.resolveFarmRequestURL.call(void 0, req);
|
|
165
|
+
const pathname = _chunkPWKAX5MScjs.resolveConfigRoutePathname.call(void 0, url.pathname, i18n, basePath).pathname;
|
|
150
166
|
const matchedHeaders = compiledHeaders.filter(({ pattern }) => pattern.regex.test(pathname)).map(({ config }) => config.headers);
|
|
151
167
|
applyResponseHeaders(res, matchedHeaders);
|
|
152
168
|
const responseWithFinalizer = res;
|
|
@@ -170,22 +186,44 @@ function createHeadersPlugin(headers, {
|
|
|
170
186
|
};
|
|
171
187
|
}
|
|
172
188
|
|
|
173
|
-
// src/plugins/
|
|
174
|
-
|
|
189
|
+
// src/plugins/rewrites.ts
|
|
190
|
+
var FARM_CONFIG_REWRITES_PLUGIN_NAME = "farm:rewrites";
|
|
191
|
+
function createRewritesPlugin(rewrites, {
|
|
175
192
|
beforeRequest: overrideBeforeRequest,
|
|
176
|
-
afterResponse: overrideAfterResponse
|
|
193
|
+
afterResponse: overrideAfterResponse,
|
|
194
|
+
i18n,
|
|
195
|
+
basePath
|
|
177
196
|
} = {}) {
|
|
197
|
+
const compiledRewrites = rewrites.map((rewrite) => ({
|
|
198
|
+
rewrite,
|
|
199
|
+
pattern: _chunkPWKAX5MScjs.compileConfigRoutePattern.call(void 0, rewrite.source)
|
|
200
|
+
}));
|
|
178
201
|
return {
|
|
179
|
-
name:
|
|
180
|
-
|
|
181
|
-
for (const [key, value] of Object.entries(env)) {
|
|
182
|
-
process.env[key] = value;
|
|
183
|
-
}
|
|
184
|
-
},
|
|
202
|
+
name: FARM_CONFIG_REWRITES_PLUGIN_NAME,
|
|
203
|
+
enforce: "pre",
|
|
185
204
|
async beforeRequest(req, res, context) {
|
|
186
205
|
if (overrideBeforeRequest) {
|
|
187
206
|
await overrideBeforeRequest(req, res, context);
|
|
188
207
|
}
|
|
208
|
+
const url = _chunkHDPT6OYEcjs.resolveFarmRequestURL.call(void 0, req);
|
|
209
|
+
const routePath = _chunkPWKAX5MScjs.resolveConfigRoutePathname.call(void 0, url.pathname, i18n, basePath);
|
|
210
|
+
const pathname = routePath.pathname;
|
|
211
|
+
for (const { rewrite, pattern } of compiledRewrites) {
|
|
212
|
+
const match = pathname.match(pattern.regex);
|
|
213
|
+
if (match) {
|
|
214
|
+
const newPath = _chunkPWKAX5MScjs.localizeConfigRouteDestination.call(void 0,
|
|
215
|
+
_chunkPWKAX5MScjs.interpolateConfigRouteDestination.call(void 0, rewrite.destination, match, pattern.tokens),
|
|
216
|
+
routePath.locale,
|
|
217
|
+
i18n
|
|
218
|
+
);
|
|
219
|
+
const destinationUrl = new URL(newPath, url);
|
|
220
|
+
if (!destinationUrl.search && url.search) {
|
|
221
|
+
destinationUrl.search = url.search;
|
|
222
|
+
}
|
|
223
|
+
req.url = destinationUrl.origin === url.origin ? destinationUrl.pathname + destinationUrl.search : destinationUrl.href;
|
|
224
|
+
break;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
189
227
|
},
|
|
190
228
|
async afterResponse(req, res, context) {
|
|
191
229
|
if (overrideAfterResponse) {
|
|
@@ -195,31 +233,12 @@ function createEnvPlugin(env, {
|
|
|
195
233
|
};
|
|
196
234
|
}
|
|
197
235
|
|
|
198
|
-
// src/plugins/logger.ts
|
|
199
|
-
function createLoggerPlugin({
|
|
200
|
-
beforeRequest,
|
|
201
|
-
afterResponse
|
|
202
|
-
} = {}) {
|
|
203
|
-
const plugin = {
|
|
204
|
-
name: "farm:logger",
|
|
205
|
-
enforce: "post"
|
|
206
|
-
};
|
|
207
|
-
if (beforeRequest) {
|
|
208
|
-
plugin.beforeRequest = async (req, res, context) => {
|
|
209
|
-
await beforeRequest(req, res, context);
|
|
210
|
-
};
|
|
211
|
-
}
|
|
212
|
-
if (afterResponse) {
|
|
213
|
-
plugin.afterResponse = async (req, res, context) => {
|
|
214
|
-
await afterResponse(req, res, context);
|
|
215
|
-
};
|
|
216
|
-
}
|
|
217
|
-
return plugin;
|
|
218
|
-
}
|
|
219
236
|
|
|
220
237
|
|
|
221
238
|
|
|
222
239
|
|
|
223
240
|
|
|
224
241
|
|
|
225
|
-
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
exports.FARM_CONFIG_REDIRECTS_PLUGIN_NAME = FARM_CONFIG_REDIRECTS_PLUGIN_NAME; exports.createRedirectsPlugin = createRedirectsPlugin; exports.getConfigRedirectMatcher = getConfigRedirectMatcher; exports.FARM_CONFIG_HEADERS_PLUGIN_NAME = FARM_CONFIG_HEADERS_PLUGIN_NAME; exports.createHeadersPlugin = createHeadersPlugin; exports.FARM_CONFIG_REWRITES_PLUGIN_NAME = FARM_CONFIG_REWRITES_PLUGIN_NAME; exports.createRewritesPlugin = createRewritesPlugin;
|
|
@@ -22,7 +22,7 @@ var SIZE_UNITS = {
|
|
|
22
22
|
mib: 1048576,
|
|
23
23
|
gib: 1073741824
|
|
24
24
|
};
|
|
25
|
-
function resolveFarmImageConfig(config) {
|
|
25
|
+
function resolveFarmImageConfig(config, defaultProvider = "auto") {
|
|
26
26
|
const path = normalizeImagePath(config?.path ?? DEFAULT_FARM_IMAGE_PATH);
|
|
27
27
|
const deviceSizes = normalizeIntegerList(
|
|
28
28
|
config?.deviceSizes ?? DEFAULT_FARM_IMAGE_DEVICE_SIZES,
|
|
@@ -50,7 +50,7 @@ function resolveFarmImageConfig(config) {
|
|
|
50
50
|
"images.maximumRedirects"
|
|
51
51
|
);
|
|
52
52
|
return Object.freeze({
|
|
53
|
-
provider: config?.provider ??
|
|
53
|
+
provider: config?.provider ?? defaultProvider,
|
|
54
54
|
path,
|
|
55
55
|
domains: Object.freeze([
|
|
56
56
|
...new Set(
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/write-file-if-changed.ts
|
|
2
|
+
var _fs = require('fs');
|
|
3
|
+
function isGeneratedFileCurrent(current, content) {
|
|
4
|
+
return current === content || normalizeLineEndings(current) === normalizeLineEndings(content);
|
|
5
|
+
}
|
|
6
|
+
function normalizeLineEndings(source) {
|
|
7
|
+
return source.includes("\r") ? source.replace(/\r\n/g, "\n") : source;
|
|
8
|
+
}
|
|
9
|
+
function writeFileIfChanged(filePath, content) {
|
|
10
|
+
try {
|
|
11
|
+
if (isGeneratedFileCurrent(_fs.readFileSync.call(void 0, filePath, "utf8"), content)) {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
} catch (error) {
|
|
15
|
+
if (error.code !== "ENOENT") {
|
|
16
|
+
throw error;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
_fs.writeFileSync.call(void 0, filePath, content, "utf8");
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
exports.isGeneratedFileCurrent = isGeneratedFileCurrent; exports.writeFileIfChanged = writeFileIfChanged;
|
|
@@ -84,4 +84,5 @@ function withPlainDiagnostics(error) {
|
|
|
84
84
|
|
|
85
85
|
|
|
86
86
|
|
|
87
|
-
|
|
87
|
+
|
|
88
|
+
exports.isDeclarationFile = isDeclarationFile; exports.resolvePackageWithoutTsconfig = resolvePackageWithoutTsconfig; exports.bundleNodeModule = bundleNodeModule; exports.withPlainDiagnostics = withPlainDiagnostics;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import {
|
|
2
|
+
API_ROUTE_METHODS
|
|
3
|
+
} from "./chunk-TY5KCYDE.mjs";
|
|
4
|
+
|
|
5
|
+
// src/api/mount.ts
|
|
6
|
+
function mountFetchHandler(app, options = {}) {
|
|
7
|
+
const fetchHandler = typeof app === "function" ? app : (request) => app.fetch(request);
|
|
8
|
+
const handle = async (request, context) => fetchHandler(
|
|
9
|
+
options.stripMountPath ? await stripMountPath(request, await context?.params) : request
|
|
10
|
+
);
|
|
11
|
+
return Object.fromEntries(
|
|
12
|
+
API_ROUTE_METHODS.map((method) => [method, handle])
|
|
13
|
+
);
|
|
14
|
+
}
|
|
15
|
+
async function stripMountPath(request, params) {
|
|
16
|
+
const rest = params ? Object.values(params).find((value) => Array.isArray(value)) : void 0;
|
|
17
|
+
const url = new URL(request.url);
|
|
18
|
+
const trailingSlash = url.pathname.length > 1 && url.pathname.endsWith("/");
|
|
19
|
+
const segments = url.pathname.split("/").slice(1);
|
|
20
|
+
if (trailingSlash) segments.pop();
|
|
21
|
+
const kept = rest?.length ? segments.slice(-rest.length) : [];
|
|
22
|
+
url.pathname = `/${kept.join("/")}${trailingSlash && kept.length > 0 ? "/" : ""}`;
|
|
23
|
+
return new Request(url, request);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export {
|
|
27
|
+
mountFetchHandler
|
|
28
|
+
};
|