@farm.js/core 0.1.38 → 0.1.40
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-BwKlpnc7.d.mts → agent-mcp-DRlXq3lM.d.ts} +1 -1
- package/dist/{agent-mcp-De1imoMS.d.ts → agent-mcp-XNF4JqHw.d.mts} +1 -1
- package/dist/{agent-mcp-handler-OLRMZONF.mjs → agent-mcp-handler-HVV5LNXF.mjs} +6 -6
- package/dist/{agent-mcp-handler-MRGP3WJ3.cjs → agent-mcp-handler-YKG7KVCY.cjs} +7 -7
- package/dist/agent-runtime.cjs +10 -6
- package/dist/agent-runtime.d.mts +5 -7
- package/dist/agent-runtime.d.ts +5 -7
- package/dist/agent-runtime.mjs +9 -5
- package/dist/api/client.cjs +3 -3
- package/dist/api/client.d.mts +3 -3
- package/dist/api/client.d.ts +3 -3
- package/dist/api/client.mjs +2 -2
- package/dist/api/route-manager.cjs +15 -13
- package/dist/api/route-manager.d.mts +7 -9
- package/dist/api/route-manager.d.ts +7 -9
- package/dist/api/route-manager.mjs +14 -12
- package/dist/api/runtime.cjs +12 -10
- package/dist/api/runtime.d.mts +6 -8
- package/dist/api/runtime.d.ts +6 -8
- package/dist/api/runtime.mjs +11 -9
- package/dist/{api-client-CyFtZFJ4.d.ts → api-client-BJv9mTbO.d.ts} +2 -2
- package/dist/{api-client-BjMmY8OD.d.mts → api-client-Dk9QOLwr.d.mts} +2 -2
- package/dist/api.cjs +17 -15
- package/dist/api.d.mts +9 -11
- package/dist/api.d.ts +9 -11
- package/dist/api.mjs +16 -14
- package/dist/{app-kT_QXTdx.d.ts → app-CDJHPqZn.d.ts} +11 -4
- package/dist/{app-CFZt-srr.d.mts → app-CWjCklhF.d.mts} +11 -4
- package/dist/app-markdown.cjs +7 -6
- package/dist/app-markdown.d.mts +6 -8
- package/dist/app-markdown.d.ts +6 -8
- package/dist/app-markdown.mjs +6 -5
- package/dist/cache.cjs +6 -3
- package/dist/cache.d.mts +23 -2
- package/dist/cache.d.ts +23 -2
- package/dist/cache.mjs +5 -2
- package/dist/{chunk-3UEVPCGW.mjs → chunk-2DMWQWNJ.mjs} +6 -1
- package/dist/{chunk-ZXH4TS3F.cjs → chunk-2JG2LJDI.cjs} +3 -64
- package/dist/{chunk-QTXBII4Z.cjs → chunk-3TB5QGUW.cjs} +5 -5
- package/dist/chunk-45QJHGZM.cjs +1063 -0
- package/dist/{chunk-JCKYH4LG.mjs → chunk-45UZKX2J.mjs} +12 -44
- package/dist/{chunk-FUCSUGDM.cjs → chunk-4A3YUB4D.cjs} +3 -3
- package/dist/{chunk-FUZEBRP3.mjs → chunk-4GP3XZ4Z.mjs} +5 -3
- package/dist/chunk-4TLUFAIP.cjs +92 -0
- package/dist/chunk-4U5XZDLG.cjs +80 -0
- package/dist/{chunk-VXEEATVD.cjs → chunk-4XO5GSD6.cjs} +2 -2
- package/dist/{chunk-P664ZVTV.mjs → chunk-4ZZNPK25.mjs} +2 -2
- package/dist/{chunk-TGFQVLLF.cjs → chunk-54QWHSNR.cjs} +697 -422
- package/dist/{chunk-W36M2BQ4.mjs → chunk-5E65AL7P.mjs} +3 -3
- package/dist/{chunk-3LOLJTFV.cjs → chunk-5JEC43MQ.cjs} +11 -11
- package/dist/{chunk-INL3THCU.mjs → chunk-5LL6TKII.mjs} +1 -1
- package/dist/{chunk-KIIMAWOJ.cjs → chunk-5NAVKJCZ.cjs} +35 -105
- package/dist/{chunk-PGZDEPTM.cjs → chunk-5XS5NCVM.cjs} +10 -10
- package/dist/{chunk-HXRYZWTA.mjs → chunk-62DY5GKS.mjs} +3 -3
- package/dist/{chunk-LSKZMJMP.cjs → chunk-64SBBZDU.cjs} +38 -1
- package/dist/chunk-6BWKJ6QS.cjs +43 -0
- package/dist/{chunk-JSROZYYO.cjs → chunk-6D24SDKO.cjs} +1 -20
- package/dist/{chunk-EIPC3FDA.cjs → chunk-6ILGLCXF.cjs} +9 -5
- package/dist/chunk-6QOLZITB.cjs +22 -0
- package/dist/{chunk-CXEN47J3.mjs → chunk-73WX6PRY.mjs} +25 -0
- package/dist/{chunk-RW63BOV7.cjs → chunk-7FHZ3E6D.cjs} +2 -2
- package/dist/chunk-7GNWGLWB.mjs +14 -0
- package/dist/{chunk-34UCJRQO.cjs → chunk-7RNAKBWF.cjs} +2 -2
- package/dist/{chunk-MSSFIQGM.mjs → chunk-7VAJSSPG.mjs} +41 -10
- package/dist/{chunk-KHKLMNI5.mjs → chunk-ACLPN56I.mjs} +43 -25
- package/dist/{chunk-JCYYXBAJ.cjs → chunk-AGR7F3LA.cjs} +3 -3
- package/dist/{chunk-4GWRFP22.cjs → chunk-ALPWLT27.cjs} +35 -3
- package/dist/{chunk-IBUQWVYA.mjs → chunk-AX7S67YV.mjs} +43 -40
- package/dist/{chunk-CUM5NYL5.mjs → chunk-AXB5P7BK.mjs} +1 -1
- package/dist/{chunk-2ZYGC6SS.cjs → chunk-B6IMBBOS.cjs} +3 -3
- package/dist/{chunk-472NCAZ7.cjs → chunk-B77AUCBV.cjs} +3 -3
- package/dist/{chunk-FWE7LEQC.cjs → chunk-BD3D7EZV.cjs} +4 -4
- package/dist/{chunk-H5CLOUZS.cjs → chunk-BMOBTMDR.cjs} +5 -5
- package/dist/{chunk-CQMVIOYP.mjs → chunk-BPGO2IEP.mjs} +7 -7
- package/dist/{chunk-E2ROOWQC.cjs → chunk-BPOTSHDO.cjs} +24 -87
- package/dist/chunk-BRYPZIMB.mjs +6 -0
- package/dist/{chunk-WFRT7JPX.mjs → chunk-BYQVROIP.mjs} +2 -2
- package/dist/{chunk-HALDNTIV.mjs → chunk-BYR3RQPB.mjs} +10 -73
- package/dist/{chunk-IWZKTWHZ.cjs → chunk-CA62IQY3.cjs} +7 -2
- package/dist/chunk-CALY6QG6.mjs +963 -0
- package/dist/{chunk-WC5UV2HQ.cjs → chunk-CBXBGM72.cjs} +2 -2
- package/dist/{chunk-WW46B6HA.cjs → chunk-CGR525MJ.cjs} +84 -45
- package/dist/{chunk-6V4TDWEC.cjs → chunk-CGVPXIRN.cjs} +18 -1
- package/dist/{chunk-TYMMBFN2.mjs → chunk-CKFK3Z2V.mjs} +1 -1
- package/dist/chunk-CZS6OACQ.mjs +63 -0
- package/dist/{chunk-SGBJ247Q.cjs → chunk-D4ROBNTK.cjs} +2 -2
- package/dist/{chunk-WEW2JVA4.cjs → chunk-D5IHNDHI.cjs} +6 -6
- package/dist/{chunk-ULASELLA.cjs → chunk-DATEWH3W.cjs} +13 -1
- package/dist/{chunk-KKSTAEMY.cjs → chunk-DKU6NXRK.cjs} +1 -1
- package/dist/{chunk-NBBEQLOK.cjs → chunk-E55H6UKH.cjs} +9 -9
- package/dist/{chunk-YR2VBEMO.cjs → chunk-EGCT3AHF.cjs} +1455 -8187
- package/dist/{chunk-SDOTRX3V.cjs → chunk-EORXKFLR.cjs} +7 -7
- package/dist/{chunk-HD5CF3OE.mjs → chunk-ETPEZLS3.mjs} +2 -2
- package/dist/{chunk-2DD4JMQC.cjs → chunk-EW4MEVLE.cjs} +30 -30
- package/dist/{chunk-TUBTR2OP.mjs → chunk-FCOLU5P6.mjs} +1173 -7905
- package/dist/chunk-FGH3ZXTP.mjs +1063 -0
- package/dist/{chunk-Q3NXS4MU.cjs → chunk-FLZ4H25A.cjs} +44 -32
- package/dist/chunk-FVPXT2JR.cjs +63 -0
- package/dist/{chunk-D2ULAULS.cjs → chunk-FXFKIJDA.cjs} +9 -7
- package/dist/chunk-GC3EM6H4.mjs +80 -0
- package/dist/chunk-GKQL726H.cjs +6096 -0
- package/dist/{chunk-5PWXMJOH.cjs → chunk-GNVEJUT5.cjs} +36 -36
- package/dist/{chunk-E3UK5IIB.cjs → chunk-GS3WR5HX.cjs} +5 -3
- package/dist/{chunk-QFW2IH5E.mjs → chunk-GZTUT75U.mjs} +5 -2
- package/dist/chunk-H3EGVQE5.mjs +22 -0
- package/dist/{chunk-KCQBAKIY.cjs → chunk-H44XGLFU.cjs} +36 -68
- package/dist/{chunk-LI2F57NI.mjs → chunk-H56MQYEG.mjs} +1 -1
- package/dist/chunk-HANGSYMB.mjs +67 -0
- package/dist/{chunk-5BWWFHR2.mjs → chunk-HBEBV7OZ.mjs} +3 -3
- package/dist/{chunk-RSOJ7DRT.mjs → chunk-HCSVR4YZ.mjs} +1 -58
- package/dist/{chunk-HZFM2LWQ.mjs → chunk-HKFBMHCD.mjs} +34 -2
- package/dist/{chunk-MLY2RP5R.mjs → chunk-I63UCMXW.mjs} +6 -2
- package/dist/{chunk-TO4GJ56K.cjs → chunk-I64GEPOB.cjs} +58 -18
- package/dist/{chunk-VNGH5MLF.mjs → chunk-I6UVKUYK.mjs} +1 -1
- package/dist/{chunk-EPYU2EBL.mjs → chunk-IF4NU2NG.mjs} +1 -1
- package/dist/{chunk-IVLZZZEI.mjs → chunk-IM7DY3ED.mjs} +1 -1
- package/dist/{chunk-A3EAIURZ.mjs → chunk-IMQO6ZUU.mjs} +2 -2
- package/dist/{chunk-F5QO4FNE.mjs → chunk-INQ64HTJ.mjs} +43 -11
- package/dist/{chunk-XKVVMZP5.cjs → chunk-IRYK4Z5M.cjs} +4 -4
- package/dist/{chunk-UWPLULNK.mjs → chunk-JGHCKIRI.mjs} +84 -24
- package/dist/{chunk-7FPTZLKH.mjs → chunk-JIYYX7WU.mjs} +10 -8
- package/dist/{chunk-6MVFL3R5.cjs → chunk-JR4QCLJY.cjs} +1 -58
- package/dist/{chunk-Q2KB32T4.mjs → chunk-JXB6DVCO.mjs} +5 -5
- package/dist/{chunk-CGBDNNSM.cjs → chunk-KEXK442I.cjs} +44 -12
- package/dist/{chunk-5D2JIPLH.cjs → chunk-KK22JPQM.cjs} +10 -10
- package/dist/{chunk-EA5K5BKU.mjs → chunk-KNHBTJP6.mjs} +18 -1
- package/dist/{chunk-MVL2RAJW.mjs → chunk-KYN5ODF6.mjs} +1 -1
- package/dist/{chunk-TYJALEHQ.cjs → chunk-LDPKAYVS.cjs} +16 -16
- package/dist/chunk-LFHCG2DU.mjs +43 -0
- package/dist/{chunk-EK4QAEFZ.cjs → chunk-LZESP4IR.cjs} +25 -0
- package/dist/{chunk-FZ6YYU2W.mjs → chunk-MGMF4VP7.mjs} +38 -1
- package/dist/{chunk-EKF7KDFD.mjs → chunk-MNUSIXGS.mjs} +2 -2
- package/dist/{chunk-MYIZXDZA.mjs → chunk-MOSYH4CY.mjs} +1 -1
- package/dist/{chunk-4ZFL5GFN.cjs → chunk-OILHPMFX.cjs} +86 -26
- package/dist/{chunk-AJQTP4OO.mjs → chunk-OJ7JP7RJ.mjs} +1 -1
- package/dist/{chunk-7PEP3BUT.mjs → chunk-OLQ73ZO5.mjs} +2 -2
- package/dist/{chunk-5OKBARDN.cjs → chunk-OZN4XL6L.cjs} +10 -10
- package/dist/{chunk-T5OJPTVN.cjs → chunk-P4TYB4SF.cjs} +2 -2
- package/dist/chunk-P7XDC7UJ.mjs +92 -0
- package/dist/{chunk-4E5QXOCL.cjs → chunk-PGW7HZE2.cjs} +6 -6
- package/dist/{chunk-SHLXACIO.cjs → chunk-PJ42JESY.cjs} +1 -9
- package/dist/{chunk-U6QLDL3G.mjs → chunk-PNCM5MFD.mjs} +1 -1
- package/dist/{chunk-OAHTRMIC.mjs → chunk-PYQ3ZG4Z.mjs} +11 -11
- package/dist/{chunk-KMTGADN3.mjs → chunk-QCVIRVHE.mjs} +1 -9
- package/dist/{chunk-RWFLWR5J.cjs → chunk-QJM7A4CR.cjs} +17 -15
- package/dist/{chunk-VU6AAZVY.cjs → chunk-RHGK2JEN.cjs} +65 -62
- package/dist/{chunk-QV4VE2OW.mjs → chunk-S6ENKNNG.mjs} +5 -3
- package/dist/{chunk-EMO6K4YY.cjs → chunk-SHFXCE5A.cjs} +7 -7
- package/dist/{chunk-EKN7NSZO.cjs → chunk-SZLNU3GJ.cjs} +8 -5
- package/dist/{chunk-WLL43JMO.mjs → chunk-T36UJS3X.mjs} +7 -5
- package/dist/{chunk-CNNOLE4O.mjs → chunk-T4II4MMW.mjs} +1 -1
- package/dist/{chunk-B6G5CKMC.mjs → chunk-T6DLMX5V.mjs} +11 -11
- package/dist/{chunk-4IE345DM.cjs → chunk-TAKG7ZCD.cjs} +14 -14
- package/dist/{chunk-SKVTP5PR.mjs → chunk-TFX4RTH2.mjs} +1 -62
- package/dist/chunk-TI7UANHI.cjs +77 -0
- package/dist/{chunk-ND2CWPOD.mjs → chunk-TS4JHGUJ.mjs} +1 -1
- package/dist/{chunk-6BK3K2GB.mjs → chunk-UIDWEU7M.mjs} +83 -44
- package/dist/{chunk-DRLKAXDM.mjs → chunk-UM3ZV5EP.mjs} +2 -2
- package/dist/{chunk-YWN746US.cjs → chunk-UMQAK3KP.cjs} +85 -54
- package/dist/chunk-UNJZGVPU.cjs +6 -0
- package/dist/{chunk-XKG2BLFN.cjs → chunk-UXMIFB44.cjs} +18 -35
- package/dist/{chunk-DMEPTZTI.mjs → chunk-VBN3UAPQ.mjs} +47 -7
- package/dist/chunk-VDRM36QB.cjs +963 -0
- package/dist/{chunk-RG4A6LB2.cjs → chunk-VNPXKF3G.cjs} +7 -7
- package/dist/chunk-VQDBNVOO.cjs +14 -0
- package/dist/chunk-VQGKD7RV.mjs +25 -0
- package/dist/{chunk-6HB6V3R7.mjs → chunk-WCWV25PG.mjs} +10 -27
- package/dist/{chunk-ZMSZZXOR.mjs → chunk-WDMIW6Q6.mjs} +0 -19
- package/dist/{chunk-4WVJLURN.mjs → chunk-WMHG64DA.mjs} +1 -1
- package/dist/{chunk-L4DD7ODZ.cjs → chunk-WSOBCAYO.cjs} +37 -35
- package/dist/{chunk-ARC7I3O2.mjs → chunk-WW374SGU.mjs} +1 -1
- package/dist/{chunk-J63ZH5OQ.cjs → chunk-X3GMHKO3.cjs} +2 -2
- package/dist/{chunk-VT4WFRHA.mjs → chunk-XJAEZCT6.mjs} +1 -1
- package/dist/{chunk-OCIEZME4.mjs → chunk-XKIUHXHW.mjs} +618 -343
- package/dist/{chunk-6XWDE2P2.cjs → chunk-XVIEGKTT.cjs} +30 -5
- package/dist/{chunk-N32CC42M.cjs → chunk-Y2GNNXGV.cjs} +72 -54
- package/dist/{chunk-ZJD2PN6Z.mjs → chunk-Y4QVEU67.mjs} +30 -18
- package/dist/chunk-Y5RG6B7S.mjs +77 -0
- package/dist/{chunk-QRKIMN7T.mjs → chunk-Y6LRPO2K.mjs} +13 -1
- package/dist/{chunk-BZHXGVMA.mjs → chunk-YJBWB6GF.mjs} +5 -3
- package/dist/{chunk-WXJLNP33.cjs → chunk-YR2P74F7.cjs} +9 -7
- package/dist/chunk-YZAKIXRL.cjs +67 -0
- package/dist/chunk-ZKVJYQPO.mjs +6095 -0
- package/dist/{chunk-POSPE3IO.mjs → chunk-ZOABCQGT.mjs} +27 -2
- package/dist/chunk-ZQRCSUSB.cjs +25 -0
- package/dist/{chunk-ZMMBIVQM.mjs → chunk-ZZGQD7A4.mjs} +16 -86
- package/dist/{client-plugins-DUrIYX9B.d.mts → client-plugins-B_5QbNrp.d.mts} +2551 -2653
- package/dist/{client-plugins-BvlNhGEB.d.ts → client-plugins-DgSfIWIF.d.ts} +2551 -2653
- package/dist/client-plugins.d.mts +5 -7
- package/dist/client-plugins.d.ts +5 -7
- package/dist/client.cjs +7 -7
- package/dist/client.d.mts +11 -12
- package/dist/client.d.ts +11 -12
- package/dist/client.mjs +6 -6
- package/dist/config.d.mts +5 -7
- package/dist/config.d.ts +5 -7
- package/dist/{devtools-VQWJANJV.cjs → devtools-ANJ7JAPQ.cjs} +21 -18
- package/dist/{devtools-JYJNOLPQ.mjs → devtools-VEQQDVHE.mjs} +20 -17
- package/dist/docs.cjs +23 -20
- package/dist/docs.d.mts +6 -8
- package/dist/docs.d.ts +6 -8
- package/dist/docs.mjs +22 -19
- package/dist/{endpoint-CA-TNX60.d.ts → endpoint-BOE0IAaG.d.ts} +6 -3
- package/dist/{endpoint-CCHFqyTE.d.mts → endpoint-DGZRZHux.d.mts} +6 -3
- package/dist/environment/vite.cjs +6 -2
- package/dist/environment/vite.d.mts +11 -2
- package/dist/environment/vite.d.ts +11 -2
- package/dist/environment/vite.mjs +5 -1
- package/dist/headers.cjs +4 -4
- package/dist/headers.mjs +3 -3
- package/dist/image/server.cjs +7 -3
- package/dist/image/server.d.mts +9 -1
- package/dist/image/server.d.ts +9 -1
- package/dist/image/server.mjs +6 -2
- package/dist/image/sharp.cjs +12 -10
- package/dist/image/sharp.mjs +4 -2
- package/dist/index.cjs +89 -69
- package/dist/index.d.mts +27 -24
- package/dist/index.d.ts +27 -24
- package/dist/index.mjs +102 -82
- package/dist/{integration-api-BPJo5oXb.d.ts → integration-api-BuPHMeKz.d.ts} +2 -2
- package/dist/{integration-api-0y4FXJpC.d.mts → integration-api-DWyMmvrR.d.mts} +2 -2
- package/dist/integration-orm-P2II2EBK.cjs +14 -0
- package/dist/{integration-orm-KV5B3BGZ.mjs → integration-orm-RBKCIQYZ.mjs} +4 -3
- package/dist/integrations.cjs +7 -5
- package/dist/integrations.d.mts +7 -9
- package/dist/integrations.d.ts +7 -9
- package/dist/integrations.mjs +6 -4
- package/dist/internal/app-markdown-runtime.cjs +6 -5
- package/dist/internal/app-markdown-runtime.d.mts +6 -8
- package/dist/internal/app-markdown-runtime.d.ts +6 -8
- package/dist/internal/app-markdown-runtime.mjs +5 -4
- package/dist/internal/build-runtime.cjs +57 -56
- package/dist/internal/build-runtime.d.mts +7 -9
- package/dist/internal/build-runtime.d.ts +7 -9
- package/dist/internal/build-runtime.mjs +56 -55
- package/dist/internal/cli-runtime.cjs +36 -30
- package/dist/internal/cli-runtime.mjs +36 -30
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/compression-runtime.d.mts +5 -7
- package/dist/internal/compression-runtime.d.ts +5 -7
- package/dist/internal/config-runtime.cjs +21 -18
- package/dist/internal/config-runtime.d.mts +6 -8
- package/dist/internal/config-runtime.d.ts +6 -8
- package/dist/internal/config-runtime.mjs +20 -17
- package/dist/internal/docs-precompiled-runtime.cjs +3 -3
- package/dist/internal/docs-precompiled-runtime.mjs +2 -2
- package/dist/internal/infra-analytics-runtime.cjs +7 -7
- package/dist/internal/infra-analytics-runtime.mjs +5 -5
- package/dist/internal/metadata-image-runtime.cjs +4 -3
- package/dist/internal/metadata-image-runtime.mjs +3 -2
- package/dist/internal/product-telemetry-runtime.cjs +2 -2
- package/dist/internal/product-telemetry-runtime.mjs +1 -1
- package/dist/internal/production-node-env.cjs +2 -2
- package/dist/internal/production-node-env.mjs +1 -1
- package/dist/internal/production-runtime.cjs +47 -28
- package/dist/internal/production-runtime.d.mts +25 -14
- package/dist/internal/production-runtime.d.ts +25 -14
- package/dist/internal/production-runtime.mjs +50 -31
- package/dist/layers-CM5i6T7z.d.mts +55 -0
- package/dist/layers-CM5i6T7z.d.ts +55 -0
- package/dist/markdown.cjs +4 -4
- package/dist/markdown.d.mts +5 -7
- package/dist/markdown.d.ts +5 -7
- package/dist/markdown.mjs +3 -3
- package/dist/middleware.cjs +16 -10
- package/dist/middleware.d.mts +7 -9
- package/dist/middleware.d.ts +7 -9
- package/dist/middleware.mjs +19 -13
- package/dist/navigation.cjs +6 -6
- package/dist/navigation.d.mts +8 -9
- package/dist/navigation.d.ts +8 -9
- package/dist/navigation.mjs +5 -5
- package/dist/{nitro-MPZJGPXK.mjs → nitro-NFG2LBRC.mjs} +3 -2
- package/dist/{nitro-7F65EZZS.cjs → nitro-S2QABUFA.cjs} +4 -3
- package/dist/observability.cjs +2 -2
- package/dist/observability.mjs +1 -1
- package/dist/plugin-DBBZ4JI2.cjs +32 -0
- package/dist/plugin-SYMK7PQ2.mjs +32 -0
- package/dist/plugin.cjs +56 -43
- package/dist/plugin.d.mts +23 -7
- package/dist/plugin.d.ts +23 -7
- package/dist/plugin.mjs +57 -44
- package/dist/{production-runtime-D2aMyzjr.d.ts → production-runtime-DfknD3g_.d.ts} +17 -3
- package/dist/{production-runtime-BQ4_WLwQ.d.mts → production-runtime-j_WCfuwB.d.mts} +17 -3
- package/dist/programmatic-routes-client-DcoxEaLe.d.mts +55 -0
- package/dist/programmatic-routes-client-DcoxEaLe.d.ts +55 -0
- package/dist/query/client.cjs +8 -8
- package/dist/query/client.mjs +3 -3
- package/dist/{render-plan-25p4hrj4.d.ts → render-plan-CFIhcYYS.d.ts} +1 -1
- package/dist/{render-plan-DtkXMN8D.d.mts → render-plan-ChUtsymc.d.mts} +1 -1
- package/dist/renderer-client.cjs +5 -5
- package/dist/renderer-client.d.mts +7 -8
- package/dist/renderer-client.d.ts +7 -8
- package/dist/renderer-client.mjs +2 -2
- package/dist/{request-DgCkIdcn.d.mts → request-F4HRwzSd.d.mts} +1 -1
- package/dist/{request-jF4jwx8f.d.ts → request-RJvelT8L.d.ts} +1 -1
- package/dist/request.cjs +3 -3
- package/dist/request.d.mts +6 -8
- package/dist/request.d.ts +6 -8
- package/dist/request.mjs +2 -2
- package/dist/{route-rendering-Bji6S6a_.d.ts → route-rendering-3a4fbNyC.d.mts} +1 -1
- package/dist/{route-rendering-CSBF78Ya.d.mts → route-rendering-D4coJ-kw.d.ts} +1 -1
- package/dist/{router-B09Ui3Qm.d.mts → router-DqIssGRO.d.mts} +1 -1
- package/dist/{router-CPB9cXtG.d.ts → router-WLEW3Te1.d.ts} +1 -1
- package/dist/routes.cjs +6 -5
- package/dist/routes.d.mts +5 -7
- package/dist/routes.d.ts +5 -7
- package/dist/routes.mjs +5 -4
- package/dist/{runtime-EDMwLdjv.d.ts → runtime-BrNdLOq9.d.ts} +3 -3
- package/dist/{runtime-CM6E6yuI.d.mts → runtime-CmE_j-js.d.mts} +3 -3
- package/dist/{schema-dev-notice-Y7MQEFGN.cjs → schema-dev-notice-5JPE67AI.cjs} +6 -4
- package/dist/{schema-dev-notice-O67CPXJ6.mjs → schema-dev-notice-WLPZ6WKU.mjs} +4 -2
- package/dist/server-action-security.cjs +4 -3
- package/dist/server-action-security.mjs +3 -2
- package/dist/server-client-bridge-DKWDl5NB.d.mts +7 -0
- package/dist/server-client-bridge-DKWDl5NB.d.ts +7 -0
- package/dist/server-fn-client.d.mts +3 -3
- package/dist/server-fn-client.d.ts +3 -3
- package/dist/server-fn.cjs +8 -7
- package/dist/server-fn.d.mts +1 -1
- package/dist/server-fn.d.ts +1 -1
- package/dist/server-fn.mjs +7 -6
- package/dist/server-plugins.cjs +5 -5
- package/dist/server-plugins.d.mts +6 -8
- package/dist/server-plugins.d.ts +6 -8
- package/dist/server-plugins.mjs +4 -4
- package/dist/server-query-client.d.mts +1 -1
- package/dist/server-query-client.d.ts +1 -1
- package/dist/server-query.cjs +9 -8
- package/dist/server-query.d.mts +1 -1
- package/dist/server-query.d.ts +1 -1
- package/dist/server-query.mjs +8 -7
- package/dist/server.cjs +97 -73
- package/dist/server.d.mts +16 -12
- package/dist/server.d.ts +16 -12
- package/dist/server.mjs +82 -58
- package/dist/{spa-router-Cgimzfbi.d.mts → spa-router-C41zjnFl.d.mts} +2 -2
- package/dist/{spa-router-B_N8XgVu.d.ts → spa-router-D_0VXqPC.d.ts} +2 -2
- package/dist/storage.cjs +6 -2
- package/dist/storage.d.mts +9 -1
- package/dist/storage.d.ts +9 -1
- package/dist/storage.mjs +5 -1
- package/dist/testing.cjs +20 -18
- package/dist/testing.d.mts +6 -8
- package/dist/testing.d.ts +6 -8
- package/dist/testing.mjs +16 -14
- package/dist/theme/server.cjs +4 -4
- package/dist/theme/server.mjs +3 -3
- package/dist/{utils-DZciYXYl.d.mts → utils-BKWSe3S7.d.mts} +1 -1
- package/dist/{utils-BNxAKAuT.d.ts → utils-YYcWsOJp.d.ts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +58 -45
- package/dist/vite.d.mts +92 -10
- package/dist/vite.d.ts +92 -10
- package/dist/vite.mjs +59 -46
- package/dist/{workflows-jZ4BcdoZ.d.ts → workflows-IWP1ddBm.d.mts} +5 -2
- package/dist/{workflows-jZ4BcdoZ.d.mts → workflows-IWP1ddBm.d.ts} +5 -2
- package/dist/workflows.cjs +4 -3
- package/dist/workflows.d.mts +1 -1
- package/dist/workflows.d.ts +1 -1
- package/dist/workflows.mjs +3 -2
- package/package.json +2 -1
- package/dist/chunk-3SDFA7UF.cjs +0 -701
- package/dist/chunk-E5GNDG5F.mjs +0 -701
- package/dist/integration-orm-55F7CII5.cjs +0 -13
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunk5XS5NCVMcjs = require('./chunk-5XS5NCVM.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
var _chunkIK6LVLKCcjs = require('./chunk-IK6LVLKC.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _chunkFLZ4H25Acjs = require('./chunk-FLZ4H25A.cjs');
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
@@ -30,7 +30,7 @@ function hasFarmDocsRuntimeAdapter(docs) {
|
|
|
30
30
|
_chunkS3JO3N4Hcjs.__name.call(void 0, hasFarmDocsRuntimeAdapter, "hasFarmDocsRuntimeAdapter");
|
|
31
31
|
function assertFarmDocsAdapterServesNoGuardedPages(docs, options, isPathGuarded) {
|
|
32
32
|
if (!isPathGuarded || !hasFarmDocsRuntimeAdapter(docs)) return;
|
|
33
|
-
const guarded =
|
|
33
|
+
const guarded = _chunk5XS5NCVMcjs.discoverFarmDocsPages.call(void 0, _chunk5XS5NCVMcjs.resolveFarmDocsContentDir.call(void 0, docs, options), docs).filter((page) => isPathGuarded(page.href) || isPathGuarded(_chunk5XS5NCVMcjs.getFarmDocsMarkdownPath.call(void 0, page.href))).map((page) => page.href);
|
|
34
34
|
if (guarded.length === 0) return;
|
|
35
35
|
throw new Error(
|
|
36
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. 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.`
|
|
@@ -50,7 +50,7 @@ function createFarmDocsAdapterRuntimeConfig(docs, options, moduleConfig) {
|
|
|
50
50
|
...moduleConfig ? { ...moduleConfig, ...docs.configOverrides } : _nullishCoalesce(docs.runtimeConfig, () => ( docs.config)),
|
|
51
51
|
entry: docs.config.entry || docs.entry.replace(/^\/+|\/+$/g, "") || "docs",
|
|
52
52
|
docsPath: docs.entry,
|
|
53
|
-
contentDir:
|
|
53
|
+
contentDir: _chunk5XS5NCVMcjs.resolveFarmDocsContentDir.call(void 0, docs, options)
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
56
|
_chunkS3JO3N4Hcjs.__name.call(void 0, createFarmDocsAdapterRuntimeConfig, "createFarmDocsAdapterRuntimeConfig");
|
|
@@ -288,25 +288,25 @@ function getDocsDescription(docs) {
|
|
|
288
288
|
}
|
|
289
289
|
_chunkS3JO3N4Hcjs.__name.call(void 0, getDocsDescription, "getDocsDescription");
|
|
290
290
|
function getLoadedDocsPages(context) {
|
|
291
|
-
return
|
|
291
|
+
return _chunk5XS5NCVMcjs.discoverFarmDocsPages.call(void 0, context.contentDir, context.docs).filter((page) => !context.isPathGuarded(page.href)).map((page) => _chunk5XS5NCVMcjs.loadFarmDocsPage.call(void 0, context.contentDir, context.docs, page.slug)).filter((page) => Boolean(page));
|
|
292
292
|
}
|
|
293
293
|
_chunkS3JO3N4Hcjs.__name.call(void 0, getLoadedDocsPages, "getLoadedDocsPages");
|
|
294
294
|
function toDocsSourcePage(page) {
|
|
295
295
|
return {
|
|
296
|
-
...
|
|
296
|
+
..._chunk5XS5NCVMcjs.toFarmDocsMarkdownPage.call(void 0, page),
|
|
297
297
|
sourcePath: page.sourcePath
|
|
298
298
|
};
|
|
299
299
|
}
|
|
300
300
|
_chunkS3JO3N4Hcjs.__name.call(void 0, toDocsSourcePage, "toDocsSourcePage");
|
|
301
301
|
function toDocsSitemapPage(page) {
|
|
302
302
|
return {
|
|
303
|
-
...
|
|
303
|
+
..._chunk5XS5NCVMcjs.toFarmDocsMarkdownPage.call(void 0, page),
|
|
304
304
|
sourcePath: page.sourcePath
|
|
305
305
|
};
|
|
306
306
|
}
|
|
307
307
|
_chunkS3JO3N4Hcjs.__name.call(void 0, toDocsSitemapPage, "toDocsSitemapPage");
|
|
308
308
|
function toDocsLlmsPage(page) {
|
|
309
|
-
return
|
|
309
|
+
return _chunk5XS5NCVMcjs.toFarmDocsMarkdownPage.call(void 0, page);
|
|
310
310
|
}
|
|
311
311
|
_chunkS3JO3N4Hcjs.__name.call(void 0, toDocsLlmsPage, "toDocsLlmsPage");
|
|
312
312
|
function getDocsLlmsOptions(context, request) {
|
|
@@ -400,7 +400,7 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, renderAgentsDocument, "renderAgentsDocumen
|
|
|
400
400
|
function buildAgentSpec(context, request) {
|
|
401
401
|
const url = new URL(request.url);
|
|
402
402
|
const origin = url.origin;
|
|
403
|
-
const pages =
|
|
403
|
+
const pages = _chunk5XS5NCVMcjs.discoverFarmDocsPages.call(void 0, context.contentDir, context.docs).filter(
|
|
404
404
|
(page) => !context.isPathGuarded(page.href)
|
|
405
405
|
);
|
|
406
406
|
const spec = _chunkIK6LVLKCcjs.docsEngine.call(void 0, ).buildDocsAgentDiscoverySpec(getDocsDiscoveryOptions(context, request));
|
|
@@ -492,7 +492,7 @@ function buildPublicConfig(context) {
|
|
|
492
492
|
}
|
|
493
493
|
_chunkS3JO3N4Hcjs.__name.call(void 0, buildPublicConfig, "buildPublicConfig");
|
|
494
494
|
function buildDiagnostics(context) {
|
|
495
|
-
const pages =
|
|
495
|
+
const pages = _chunk5XS5NCVMcjs.discoverFarmDocsPages.call(void 0, context.contentDir, context.docs);
|
|
496
496
|
const diagnostics = _chunkIK6LVLKCcjs.docsEngine.call(void 0, ).buildDocsDiagnostics(context.docs.config, {
|
|
497
497
|
entry: context.docs.entry,
|
|
498
498
|
mcp: {
|
|
@@ -564,13 +564,13 @@ async function resolveAPIContext(options) {
|
|
|
564
564
|
config: options.config,
|
|
565
565
|
configPath: options.configPath
|
|
566
566
|
}));
|
|
567
|
-
const docs = isResolvedDocsConfig(docsInput) ? docsInput : await
|
|
567
|
+
const docs = isResolvedDocsConfig(docsInput) ? docsInput : await _chunkFLZ4H25Acjs.resolveDocsConfig.call(void 0, docsInput, { root, srcDir });
|
|
568
568
|
const guardedPaths = new Set(_nullishCoalesce(_optionalChain([runtimeConfig, 'optionalAccess', _20 => _20.guardedPaths]), () => ( [])));
|
|
569
569
|
return {
|
|
570
570
|
root,
|
|
571
571
|
srcDir,
|
|
572
572
|
docs,
|
|
573
|
-
contentDir:
|
|
573
|
+
contentDir: _chunk5XS5NCVMcjs.resolveFarmDocsContentDir.call(void 0, docs, { root, srcDir }),
|
|
574
574
|
diagnostics: options.diagnostics === true,
|
|
575
575
|
isPathGuarded: _nullishCoalesce(options.isPathGuarded, () => ( ((pathname) => guardedPaths.has(pathname))))
|
|
576
576
|
};
|
|
@@ -630,12 +630,12 @@ async function handleDocsAPIGet(request, context) {
|
|
|
630
630
|
if (format === "markdown" || url.pathname.endsWith(".md")) {
|
|
631
631
|
const pathParam = url.searchParams.get("path") || url.searchParams.get("slug");
|
|
632
632
|
const slug = normalizeDocsApiSlug(_nullishCoalesce(_nullishCoalesce(pathParam, () => ( pathTarget.slug)), () => ( "")), context.docs);
|
|
633
|
-
const page =
|
|
633
|
+
const page = _chunk5XS5NCVMcjs.loadFarmDocsPage.call(void 0, context.contentDir, context.docs, slug);
|
|
634
634
|
if (!page || context.isPathGuarded(page.href)) {
|
|
635
635
|
return text("Docs page not found\n", "text/plain; charset=utf-8", { status: 404 });
|
|
636
636
|
}
|
|
637
637
|
return text(
|
|
638
|
-
_chunkIK6LVLKCcjs.docsEngine.call(void 0, ).renderDocsMarkdownDocument(
|
|
638
|
+
_chunkIK6LVLKCcjs.docsEngine.call(void 0, ).renderDocsMarkdownDocument(_chunk5XS5NCVMcjs.toFarmDocsMarkdownPage.call(void 0, page), {
|
|
639
639
|
origin: new URL(request.url).origin,
|
|
640
640
|
llms: getDocsLlmsOptions(context, request),
|
|
641
641
|
sitemap: context.docs.config.sitemap
|
|
@@ -3,65 +3,11 @@ import {
|
|
|
3
3
|
} from "./chunk-JM5XPKWH.mjs";
|
|
4
4
|
import {
|
|
5
5
|
createWebRequestFromFarmRequest
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-ZOABCQGT.mjs";
|
|
7
7
|
import {
|
|
8
8
|
__name
|
|
9
9
|
} from "./chunk-LPEX4YW6.mjs";
|
|
10
10
|
|
|
11
|
-
// src/middleware/server.ts
|
|
12
|
-
import { AsyncLocalStorage } from "async_hooks";
|
|
13
|
-
var MIDDLEWARE_DATA_STORE_KEY = /* @__PURE__ */ Symbol.for("farm.middlewareDataStore");
|
|
14
|
-
var MIDDLEWARE_CONTEXT_STORE_KEY = /* @__PURE__ */ Symbol.for("farm.middlewareContextStore");
|
|
15
|
-
function getGlobalMiddlewareStore(key) {
|
|
16
|
-
const state = globalThis;
|
|
17
|
-
const existing = state[key];
|
|
18
|
-
if (existing instanceof AsyncLocalStorage) {
|
|
19
|
-
return existing;
|
|
20
|
-
}
|
|
21
|
-
const store = new AsyncLocalStorage();
|
|
22
|
-
state[key] = store;
|
|
23
|
-
return store;
|
|
24
|
-
}
|
|
25
|
-
__name(getGlobalMiddlewareStore, "getGlobalMiddlewareStore");
|
|
26
|
-
var middlewareStore = getGlobalMiddlewareStore(MIDDLEWARE_DATA_STORE_KEY);
|
|
27
|
-
var middlewareContextStore = getGlobalMiddlewareStore(MIDDLEWARE_CONTEXT_STORE_KEY);
|
|
28
|
-
function toMiddlewareMap(data) {
|
|
29
|
-
if (data instanceof Map) {
|
|
30
|
-
return new Map(data);
|
|
31
|
-
}
|
|
32
|
-
return new Map(Object.entries(data));
|
|
33
|
-
}
|
|
34
|
-
__name(toMiddlewareMap, "toMiddlewareMap");
|
|
35
|
-
function _clearCurrentMiddlewareData() {
|
|
36
|
-
middlewareStore.enterWith(/* @__PURE__ */ new Map());
|
|
37
|
-
}
|
|
38
|
-
__name(_clearCurrentMiddlewareData, "_clearCurrentMiddlewareData");
|
|
39
|
-
function _clearCurrentMiddlewareContext() {
|
|
40
|
-
middlewareContextStore.enterWith(/* @__PURE__ */ new Map());
|
|
41
|
-
}
|
|
42
|
-
__name(_clearCurrentMiddlewareContext, "_clearCurrentMiddlewareContext");
|
|
43
|
-
async function _runWithMiddlewareData(data, fn) {
|
|
44
|
-
return middlewareStore.run(toMiddlewareMap(data), fn);
|
|
45
|
-
}
|
|
46
|
-
__name(_runWithMiddlewareData, "_runWithMiddlewareData");
|
|
47
|
-
async function _runWithMiddlewareContext(context, fn) {
|
|
48
|
-
return middlewareContextStore.run(toMiddlewareMap(context), fn);
|
|
49
|
-
}
|
|
50
|
-
__name(_runWithMiddlewareContext, "_runWithMiddlewareContext");
|
|
51
|
-
function getMiddlewareData() {
|
|
52
|
-
return middlewareStore.getStore() || /* @__PURE__ */ new Map();
|
|
53
|
-
}
|
|
54
|
-
__name(getMiddlewareData, "getMiddlewareData");
|
|
55
|
-
function getMiddlewareValue(key) {
|
|
56
|
-
const data = getMiddlewareData();
|
|
57
|
-
return data.get(key);
|
|
58
|
-
}
|
|
59
|
-
__name(getMiddlewareValue, "getMiddlewareValue");
|
|
60
|
-
function getMiddlewareContext() {
|
|
61
|
-
return middlewareContextStore.getStore() || /* @__PURE__ */ new Map();
|
|
62
|
-
}
|
|
63
|
-
__name(getMiddlewareContext, "getMiddlewareContext");
|
|
64
|
-
|
|
65
11
|
// src/middleware/cookie-header.ts
|
|
66
12
|
function parseMiddlewareCookieHeader(cookieHeader) {
|
|
67
13
|
const cookies = /* @__PURE__ */ Object.create(null);
|
|
@@ -226,13 +172,6 @@ function normalizeMiddlewareModule(middlewareModule, routePath) {
|
|
|
226
172
|
__name(normalizeMiddlewareModule, "normalizeMiddlewareModule");
|
|
227
173
|
|
|
228
174
|
export {
|
|
229
|
-
_clearCurrentMiddlewareData,
|
|
230
|
-
_clearCurrentMiddlewareContext,
|
|
231
|
-
_runWithMiddlewareData,
|
|
232
|
-
_runWithMiddlewareContext,
|
|
233
|
-
getMiddlewareData,
|
|
234
|
-
getMiddlewareValue,
|
|
235
|
-
getMiddlewareContext,
|
|
236
175
|
parseMiddlewareCookieHeader,
|
|
237
176
|
serializeMiddlewareCookie,
|
|
238
177
|
serializeMiddlewareCookieDeletion,
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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
|
+
|
|
3
|
+
var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
|
|
4
|
+
|
|
5
|
+
// src/plugin-runtime-endpoint.ts
|
|
6
|
+
function normalizeFarmPluginRuntimeEndpointPath(pathname, label = "Farm plugin runtime endpoint") {
|
|
7
|
+
if (typeof pathname !== "string" || pathname.trim() !== pathname || pathname.length === 0) {
|
|
8
|
+
throw new TypeError(`${label} path must be a non-empty pathname without surrounding spaces`);
|
|
9
|
+
}
|
|
10
|
+
if (!pathname.startsWith("/") || pathname.startsWith("//") || pathname.includes("?") || pathname.includes("#") || pathname.includes("*")) {
|
|
11
|
+
throw new TypeError(`${label} path must be an exact pathname such as "/status"`);
|
|
12
|
+
}
|
|
13
|
+
if (pathname.includes("\\") || Array.from(pathname).some((character) => {
|
|
14
|
+
const code = character.charCodeAt(0);
|
|
15
|
+
return code <= 31 || code >= 127 && code <= 159;
|
|
16
|
+
})) {
|
|
17
|
+
throw new TypeError(`${label} path cannot contain backslashes or control characters`);
|
|
18
|
+
}
|
|
19
|
+
for (const segment of pathname.split("/").slice(1)) {
|
|
20
|
+
let decoded = segment;
|
|
21
|
+
try {
|
|
22
|
+
decoded = decodeURIComponent(segment);
|
|
23
|
+
} catch (e) {
|
|
24
|
+
throw new TypeError(`${label} path contains a malformed percent escape`);
|
|
25
|
+
}
|
|
26
|
+
if (decoded.includes("/") || decoded.includes("\\")) {
|
|
27
|
+
throw new TypeError(`${label} path cannot contain percent-encoded path separators`);
|
|
28
|
+
}
|
|
29
|
+
if (Array.from(decoded).some((character) => {
|
|
30
|
+
const code = character.charCodeAt(0);
|
|
31
|
+
return code <= 31 || code >= 127 && code <= 159;
|
|
32
|
+
})) {
|
|
33
|
+
throw new TypeError(`${label} path cannot contain control characters`);
|
|
34
|
+
}
|
|
35
|
+
if (decoded === "." || decoded === "..") {
|
|
36
|
+
throw new TypeError(`${label} path cannot contain dot segments`);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return normalizeRuntimeEndpointRequestPath(pathname);
|
|
40
|
+
}
|
|
41
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, normalizeFarmPluginRuntimeEndpointPath, "normalizeFarmPluginRuntimeEndpointPath");
|
|
42
|
+
function normalizeRuntimeEndpointRequestPath(pathname) {
|
|
43
|
+
return pathname.length > 1 ? pathname.replace(/\/+$/, "") || "/" : pathname;
|
|
44
|
+
}
|
|
45
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, normalizeRuntimeEndpointRequestPath, "normalizeRuntimeEndpointRequestPath");
|
|
46
|
+
function farmPluginMayAffectRuntimePath(plugin, pathname) {
|
|
47
|
+
const runtime = plugin.runtime;
|
|
48
|
+
const endpoints = _optionalChain([runtime, 'optionalAccess', _ => _.endpoints]);
|
|
49
|
+
const hasUnscopedRequestHooks = Boolean(
|
|
50
|
+
plugin.init || plugin.ready || plugin.shutdown || _optionalChain([runtime, 'optionalAccess', _2 => _2.context]) || _optionalChain([runtime, 'optionalAccess', _3 => _3.before]) || _optionalChain([runtime, 'optionalAccess', _4 => _4.after]) || _optionalChain([runtime, 'optionalAccess', _5 => _5.error]) || plugin.router || plugin.render || plugin.beforeRouteMatch || plugin.afterRouteMatch || plugin.beforeRender || plugin.afterRender || plugin.onError || plugin.transformHTML || plugin.beforeRequest || plugin.afterResponse
|
|
51
|
+
);
|
|
52
|
+
if (hasUnscopedRequestHooks) return true;
|
|
53
|
+
if (Array.isArray(endpoints) && endpoints.length > 0) {
|
|
54
|
+
const normalizedPathname = normalizeRuntimeEndpointRequestPath(pathname);
|
|
55
|
+
return endpoints.some(
|
|
56
|
+
(endpoint) => normalizeFarmPluginRuntimeEndpointPath(
|
|
57
|
+
endpoint.path,
|
|
58
|
+
`Farm plugin "${plugin.name}" runtime endpoint`
|
|
59
|
+
) === normalizedPathname
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
return Boolean(plugin.setup || _optionalChain([runtime, 'optionalAccess', _6 => _6.start]) || _optionalChain([runtime, 'optionalAccess', _7 => _7.close]));
|
|
63
|
+
}
|
|
64
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, farmPluginMayAffectRuntimePath, "farmPluginMayAffectRuntimePath");
|
|
65
|
+
function _farmPluginsKeepResponsesPrivate(plugins) {
|
|
66
|
+
return plugins.some(
|
|
67
|
+
(plugin) => typeof _optionalChain([plugin, 'optionalAccess', _8 => _8.runtime, 'optionalAccess', _9 => _9.before]) === "function" && plugin.runtime.cache !== "public"
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, _farmPluginsKeepResponsesPrivate, "_farmPluginsKeepResponsesPrivate");
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
exports.normalizeFarmPluginRuntimeEndpointPath = normalizeFarmPluginRuntimeEndpointPath; exports.normalizeRuntimeEndpointRequestPath = normalizeRuntimeEndpointRequestPath; exports.farmPluginMayAffectRuntimePath = farmPluginMayAffectRuntimePath; exports._farmPluginsKeepResponsesPrivate = _farmPluginsKeepResponsesPrivate;
|
|
@@ -6,13 +6,88 @@ import {
|
|
|
6
6
|
var FARM_NODE_ENV_MODULE_FILE = "farm-node-env.mjs";
|
|
7
7
|
var FARM_NODE_ENV_MODULE_SOURCE = `if (!process.env.NODE_ENV) process.env.NODE_ENV = "production";
|
|
8
8
|
`;
|
|
9
|
+
var NODE_SERVER_SOURCE = `const socketPath = process.env.NITRO_UNIX_SOCKET;
|
|
10
|
+
const server = serve({
|
|
11
|
+
manual: true,
|
|
12
|
+
silent: true,
|
|
13
|
+
gracefulShutdown: false,
|
|
14
|
+
port,
|
|
15
|
+
hostname: host,
|
|
16
|
+
node: socketPath ? { path: socketPath } : undefined,
|
|
17
|
+
tls: cert && key ? { cert, key } : undefined,
|
|
18
|
+
fetch: nitroApp.fetch,
|
|
19
|
+
plugins: [...tracingSrvxPlugins],
|
|
20
|
+
});
|
|
21
|
+
const nodeServer = server.node?.server;
|
|
22
|
+
if (!nodeServer) throw new Error("[Farm] Nitro did not create a Node server");
|
|
23
|
+
|
|
24
|
+
nodeServer.headersTimeout = farmServerConfig.headersTimeout;
|
|
25
|
+
nodeServer.requestTimeout = farmServerConfig.requestTimeout;
|
|
26
|
+
nodeServer.keepAliveTimeout = farmServerConfig.keepAliveTimeout;
|
|
27
|
+
|
|
28
|
+
let isShuttingDown = false;
|
|
29
|
+
nodeServer.on("request", (_request, response) => {
|
|
30
|
+
response.once("finish", () => {
|
|
31
|
+
if (isShuttingDown) nodeServer.closeIdleConnections?.();
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
if (import.meta._websocket) {
|
|
36
|
+
const { handleUpgrade } = wsAdapter({ resolve: resolveWebsocketHooks });
|
|
37
|
+
nodeServer.on("upgrade", (request, socket, head) => {
|
|
38
|
+
handleUpgrade(
|
|
39
|
+
request,
|
|
40
|
+
socket,
|
|
41
|
+
head,
|
|
42
|
+
new NodeRequest({ req: request, upgrade: { socket, head } }),
|
|
43
|
+
);
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
`;
|
|
47
|
+
var BUN_SERVER_SOURCE = `const ws = import.meta._websocket ? wsAdapter({ resolve: resolveWebsocketHooks }) : undefined;
|
|
48
|
+
const server = serve({
|
|
49
|
+
manual: true,
|
|
50
|
+
silent: true,
|
|
51
|
+
gracefulShutdown: false,
|
|
52
|
+
port,
|
|
53
|
+
hostname: host,
|
|
54
|
+
tls: cert && key ? { cert, key } : undefined,
|
|
55
|
+
fetch: import.meta._websocket
|
|
56
|
+
? (request) =>
|
|
57
|
+
request.headers.get("upgrade") === "websocket"
|
|
58
|
+
? ws.handleUpgrade(request, request.runtime.bun.server)
|
|
59
|
+
: nitroApp.fetch(request)
|
|
60
|
+
: nitroApp.fetch,
|
|
61
|
+
bun: { websocket: import.meta._websocket ? ws?.websocket : undefined },
|
|
62
|
+
plugins: [...tracingSrvxPlugins],
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
let isShuttingDown = false;
|
|
66
|
+
`;
|
|
9
67
|
function createFarmNodeServerEntry(options) {
|
|
68
|
+
return createFarmServerEntry({
|
|
69
|
+
...options,
|
|
70
|
+
runtime: "node",
|
|
71
|
+
adapterModule: options.nodeAdapterModule
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
__name(createFarmNodeServerEntry, "createFarmNodeServerEntry");
|
|
75
|
+
function createFarmBunServerEntry(options) {
|
|
76
|
+
return createFarmServerEntry({
|
|
77
|
+
...options,
|
|
78
|
+
runtime: "bun",
|
|
79
|
+
adapterModule: options.bunAdapterModule
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
__name(createFarmBunServerEntry, "createFarmBunServerEntry");
|
|
83
|
+
function createFarmServerEntry(options) {
|
|
10
84
|
const serverConfig = JSON.stringify(options.server);
|
|
11
85
|
const nitroEntryImport = `./${options.nitroEntryFile.replace(/^\.\//, "")}`;
|
|
86
|
+
const node = options.runtime === "node";
|
|
12
87
|
return `
|
|
13
|
-
import "./${FARM_NODE_ENV_MODULE_FILE}";
|
|
14
|
-
import "#nitro/virtual/polyfills";
|
|
15
|
-
import { NodeRequest, serve } from ${JSON.stringify(options.
|
|
88
|
+
${node ? `import "./${FARM_NODE_ENV_MODULE_FILE}";
|
|
89
|
+
` : ""}import "#nitro/virtual/polyfills";
|
|
90
|
+
import { ${node ? "NodeRequest, " : ""}serve } from ${JSON.stringify(options.adapterModule)};
|
|
16
91
|
import wsAdapter from ${JSON.stringify(options.websocketAdapterModule)};
|
|
17
92
|
import { resolveWebsocketHooks, useNitroApp, useNitroHooks } from "#nitro/runtime/app";
|
|
18
93
|
import { useRuntimeConfig } from "#nitro/runtime/runtime-config";
|
|
@@ -135,44 +210,7 @@ const key = process.env.NITRO_SSL_KEY;
|
|
|
135
210
|
const configuredPort = Number(process.env.NITRO_PORT || process.env.PORT);
|
|
136
211
|
const port = Number.isFinite(configuredPort) && configuredPort > 0 ? configuredPort : 3000;
|
|
137
212
|
const host = process.env.NITRO_HOST || process.env.HOST;
|
|
138
|
-
|
|
139
|
-
const server = serve({
|
|
140
|
-
manual: true,
|
|
141
|
-
silent: true,
|
|
142
|
-
gracefulShutdown: false,
|
|
143
|
-
port,
|
|
144
|
-
hostname: host,
|
|
145
|
-
node: socketPath ? { path: socketPath } : undefined,
|
|
146
|
-
tls: cert && key ? { cert, key } : undefined,
|
|
147
|
-
fetch: nitroApp.fetch,
|
|
148
|
-
plugins: [...tracingSrvxPlugins],
|
|
149
|
-
});
|
|
150
|
-
const nodeServer = server.node?.server;
|
|
151
|
-
if (!nodeServer) throw new Error("[Farm] Nitro did not create a Node server");
|
|
152
|
-
|
|
153
|
-
nodeServer.headersTimeout = farmServerConfig.headersTimeout;
|
|
154
|
-
nodeServer.requestTimeout = farmServerConfig.requestTimeout;
|
|
155
|
-
nodeServer.keepAliveTimeout = farmServerConfig.keepAliveTimeout;
|
|
156
|
-
|
|
157
|
-
let isShuttingDown = false;
|
|
158
|
-
nodeServer.on("request", (_request, response) => {
|
|
159
|
-
response.once("finish", () => {
|
|
160
|
-
if (isShuttingDown) nodeServer.closeIdleConnections?.();
|
|
161
|
-
});
|
|
162
|
-
});
|
|
163
|
-
|
|
164
|
-
if (import.meta._websocket) {
|
|
165
|
-
const { handleUpgrade } = wsAdapter({ resolve: resolveWebsocketHooks });
|
|
166
|
-
nodeServer.on("upgrade", (request, socket, head) => {
|
|
167
|
-
handleUpgrade(
|
|
168
|
-
request,
|
|
169
|
-
socket,
|
|
170
|
-
head,
|
|
171
|
-
new NodeRequest({ req: request, upgrade: { socket, head } }),
|
|
172
|
-
);
|
|
173
|
-
});
|
|
174
|
-
}
|
|
175
|
-
|
|
213
|
+
${node ? NODE_SERVER_SOURCE : BUN_SERVER_SOURCE}
|
|
176
214
|
setupCloseHooks(server);
|
|
177
215
|
trapUnhandledErrors();
|
|
178
216
|
|
|
@@ -189,7 +227,7 @@ async function shutdown(signal) {
|
|
|
189
227
|
return true;
|
|
190
228
|
},
|
|
191
229
|
);
|
|
192
|
-
nodeServer.closeIdleConnections?.();
|
|
230
|
+
${node ? "nodeServer.closeIdleConnections?.();" : ""}
|
|
193
231
|
let gracefulTimer;
|
|
194
232
|
const gracefullyClosed = await Promise.race([
|
|
195
233
|
gracefulClose,
|
|
@@ -243,7 +281,7 @@ if (!shutdownConfig.disabled) {
|
|
|
243
281
|
try {
|
|
244
282
|
await server.serve();
|
|
245
283
|
const protocol = cert && key ? "https" : "http";
|
|
246
|
-
const addressInfo = nodeServer.address();
|
|
284
|
+
const addressInfo = ${node ? "nodeServer.address()" : "server.bun.server?.address"};
|
|
247
285
|
if (typeof addressInfo === "string") {
|
|
248
286
|
console.log(\`Listening on unix socket \${addressInfo}\`);
|
|
249
287
|
} else if (addressInfo) {
|
|
@@ -272,7 +310,7 @@ if (import.meta._tasks) {
|
|
|
272
310
|
export default {};
|
|
273
311
|
`.trim();
|
|
274
312
|
}
|
|
275
|
-
__name(
|
|
313
|
+
__name(createFarmServerEntry, "createFarmServerEntry");
|
|
276
314
|
|
|
277
315
|
// src/build/production-node-env.ts
|
|
278
316
|
var productionNodeEnvStateKey = /* @__PURE__ */ Symbol.for("@farm.js/core/production-node-env-state");
|
|
@@ -314,5 +352,6 @@ export {
|
|
|
314
352
|
FARM_NODE_ENV_MODULE_FILE,
|
|
315
353
|
FARM_NODE_ENV_MODULE_SOURCE,
|
|
316
354
|
createFarmNodeServerEntry,
|
|
355
|
+
createFarmBunServerEntry,
|
|
317
356
|
withProductionNodeEnv
|
|
318
357
|
};
|